MetaDone
metadone.util.SetUtil Class Reference

List of all members.

Classes

interface  Criteria< T extends Object >

Static Public Member Functions

static boolean isDisjoined (Set<?> a, Set<?> b)

Static Package Functions

static public< A > Set< A > add (Set< A > s, A a)
static public< B, A > HashSet< A > mapset (final Set< B > set, final MapFct< B, A > map)
static public< T extends
Object > String 
convertToString (Set< T > set)
static public< T extends
Object > Set< T > 
intersect (Set< T > a, Set< T > b, Set< T > c)
static public< T extends
Object > Set< T > 
union (Set< T > a, Set< T > b, Set< T > c)
static public< T extends
Object > Set< T > 
diff (Set< T > a, Set< T > b, Set< T > c)
static public< T extends Object > T getOneOf (Set< T > s)
static public< T extends
Object > HashSet< T > 
array2HashSet (T[] array)
static public< T extends
Object > HashSet< T > 
filter (Set< T > myset, Criteria< T > criteria)

Private Member Functions

 SetUtil ()

Detailed Description

Author:
ven

Constructor & Destructor Documentation

metadone.util.SetUtil.SetUtil ( ) [private]

Member Function Documentation

static public<A> Set<A> metadone.util.SetUtil.add ( Set< A >  s,
a 
) [static, package]
Parameters:
<A>
sa set, not null
aan element
Returns:
the set s with element a included

Referenced by metadone.client.grasyla2.SelectorBestEquation.findEquation().

static public<T extends Object> HashSet<T> metadone.util.SetUtil.array2HashSet ( T[]  array) [static, package]

Convert an array into an hashset. If the array is null, the result is an empty set. Null elements of the array are thrown away of the result.

Parameters:
arrayan array of type T
Returns:
an hashset of type T

Referenced by metadone.metabusiness.impl.MetaModel_impl._createMetaModel(), and metadone.metabusiness.impl.MetaModel_impl._createMetaObject().

static public<T extends Object> String metadone.util.SetUtil.convertToString ( Set< T >  set) [static, package]
Parameters:
<T>
set
Returns:
A string that denotes the argument.
static public<T extends Object> Set<T> metadone.util.SetUtil.diff ( Set< T >  a,
Set< T >  b,
Set< T >  c 
) [static, package]

Compute C as A

Parameters:
<T>
anot null
bnot null
cif c is null, an hashset is created for the result.
Returns:
c
static public<T extends Object> HashSet<T> metadone.util.SetUtil.filter ( Set< T >  myset,
Criteria< T >  criteria 
) [static, package]
Parameters:
<T>any type
myseta set of T. Can be null.
criteriaA not null criteria that denotes a predicate
Returns:
a set with all the elements of myset that meets the predicate.

Referenced by metadone.client.dialog.swing.metaobjecteditor.ModelTreeChooseMetaObject.getSortedMembersInMetaModel().

static public<T extends Object> T metadone.util.SetUtil.getOneOf ( Set< T >  s) [static, package]
Parameters:
<T>
scan be null
Returns:
One random element of the s set and null if the set is empty or null.

Referenced by metadone.metabusiness.impl.ConcreteProperty_impl< T >.createValueProperty(), and metadone.metabusiness.syntax.grasyla.GrasylaPhenomenon.getModel().

static public<T extends Object> Set<T> metadone.util.SetUtil.intersect ( Set< T >  a,
Set< T >  b,
Set< T >  c 
) [static, package]

Computes C as A intersection with B.

Parameters:
<T>
anot null
bnot null
cif c is null, a new hashset is created.
Returns:
c

Referenced by metadone.client.dialog.swing.genConcreteObject.Builder.retrieveElements(), and metadone.client.dialog.swing.genConcreteObject.DialogConcreteRoles.selectMetaObject().

static boolean metadone.util.SetUtil.isDisjoined ( Set<?>  a,
Set<?>  b 
) [static]
static public<B, A> HashSet<A> metadone.util.SetUtil.mapset ( final Set< B >  set,
final MapFct< B, A >  map 
) [static, package]

Converts a set into another set by mapping every element with the map function.

Parameters:
<B>
<A>
set
map
Returns:
static public<T extends Object> Set<T> metadone.util.SetUtil.union ( Set< T >  a,
Set< T >  b,
Set< T >  c 
) [static, package]

Computes C as A+B

Parameters:
<T>
anot null
bnot null
cif c is null, a new hashset is created.
Returns:
C

Referenced by metadone.metabusiness.impl.MetaObject_impl._shareMetaProperty().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations