weiss.util
Class Collections

java.lang.Object
  |
  +--weiss.util.Collections

public class Collections
extends java.lang.Object

Instanceless class contains static methods that operate on collections.


Method Summary
static java.lang.Object max(Collection coll)
          Returns the maximum object in the collection, using default ordering
static java.lang.Object max(Collection coll, Comparator cmp)
          Returns the maximum object in the collection, using comparator.
static Comparator reverseOrder()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

max

public static java.lang.Object max(Collection coll)
Returns the maximum object in the collection, using default ordering
Parameters:
coll - the collection.
Returns:
the maximum object.
Throws:
NoSuchElementException - if coll is empty.
java.lang.ClassCastException - if objects in collection cannot be compared.

max

public static java.lang.Object max(Collection coll,
                                   Comparator cmp)
Returns the maximum object in the collection, using comparator.
Parameters:
coll - the collection.
cmp - the comparator.
Returns:
the maximum object.
Throws:
NoSuchElementException - if coll is empty.
java.lang.ClassCastException - if objects in collection cannot be compared.

reverseOrder

public static Comparator reverseOrder()