salvo.jesus.util
Class Collections

java.lang.Object
  extended by salvo.jesus.util.Collections

public class Collections
extends java.lang.Object


Constructor Summary
Collections()
           
 
Method Summary
static java.lang.Object contains(java.util.Collection c, java.lang.Object compareTo, java.util.Comparator comparator)
          Returns true if the specified Collection has an object that matches the argument object compareTo using the given Comparator.
static java.util.Set subset(java.util.Collection c, java.lang.Object compareTo, java.util.Comparator comparator)
          Returns a subset of the specified collection whose elements match a given object using a specified Comparator.
static java.util.Collection twoLevelCopyOfCollectionOfCollectionS(java.util.Collection collOfCollSToBeCopied)
           
static java.util.Map twoLevelCopyOfMapOfCollectionS(java.util.Map mapOfCollectionSToBeCopied)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Collections

public Collections()
Method Detail

subset

public static java.util.Set subset(java.util.Collection c,
                                   java.lang.Object compareTo,
                                   java.util.Comparator comparator)
Returns a subset of the specified collection whose elements match a given object using a specified Comparator. Only elements in the collection that match the given object compareTo using the specified comparator are returned in the subset.

Parameters:
c - Collection object from which a subset will be taken.
compareTo - Object to which elements of the collection will be compared against.
comparator - Comparator object determining how elements in the collection will be compared to the compareTo object.
Returns:
Collection object that is a subset of the collection specified in the argument.

contains

public static java.lang.Object contains(java.util.Collection c,
                                        java.lang.Object compareTo,
                                        java.util.Comparator comparator)
Returns true if the specified Collection has an object that matches the argument object compareTo using the given Comparator. This therefore does use obj1.equals( obj2 ) but uses comparator.compare( obj1, obj2 ).

Parameters:
c - Collection object from which a subset will be taken.
compareTo - Object to which elements of the collection will be compared against.
comparator - Comparator object determining how elements in the collection will be compared to the compareTo object.
Returns:
boolean True if the Collection has a matching object

twoLevelCopyOfMapOfCollectionS

public static java.util.Map twoLevelCopyOfMapOfCollectionS(java.util.Map mapOfCollectionSToBeCopied)

twoLevelCopyOfCollectionOfCollectionS

public static java.util.Collection twoLevelCopyOfCollectionOfCollectionS(java.util.Collection collOfCollSToBeCopied)