Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import java.util.ArrayList;
import java.util.Collection;

import java.util.Iterator;

import java.util.List;

public class Main {
    public static <T> List<T> search(final String str, Collection<? extends T> coll, Comparable<? super T> comp) {
        if (comp == null)
            return null;
        List<T> list = new ArrayList<T>();
        Iterator<? extends T> i = coll.iterator();
        while (i.hasNext()) {
            T next = i.next();
            if (comp.compareTo(next) > 0) {
                list.add(next);
            }
        }
        return list;
    }
}