slib.utils.impl
Class SetUtils

java.lang.Object
  extended by slib.utils.impl.SetUtils

public class SetUtils
extends Object

Author:
seb

Constructor Summary
SetUtils()
           
 
Method Summary
static
<X> Set<X>
buildSet(X o)
          Build a Set containing the given object of type X.
static
<X> double
getMax(HashMap<X,Integer> nbOccurrence)
           
static
<X> Set<X>
intersection(Collection<X> anc_setA, Collection<X> anc_setB)
          Compute the intersection of two collections
static
<X> Set<X>
union(Collection<X> a, Collection<X> b)
          Compute the union of two collections
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SetUtils

public SetUtils()
Method Detail

union

public static <X> Set<X> union(Collection<X> a,
                               Collection<X> b)
Compute the union of two collections

Type Parameters:
X -
Parameters:
a -
b -
Returns:

intersection

public static <X> Set<X> intersection(Collection<X> anc_setA,
                                      Collection<X> anc_setB)
Compute the intersection of two collections

Type Parameters:
X -
Parameters:
anc_setA -
anc_setB -
Returns:

getMax

public static <X> double getMax(HashMap<X,Integer> nbOccurrence)
Type Parameters:
X -
Parameters:
nbOccurrence -
Returns:

buildSet

public static <X> Set<X> buildSet(X o)
Build a Set containing the given object of type X. If the object is null, null is returned

Type Parameters:
X -
Parameters:
o -
Returns:
a Set containing the given object of type X or null


Copyright © 2013. All Rights Reserved.