net.sourceforge.combean.mathprog.grooml
Class GNumberedSet

Abstract definition of a set with numbered elements. A numbered set satisfies the following properties: - the number of elements can be queried without traversing the elements of the set - every element has unique index in the interval [0; cardinality-1]. This index can be queried for a given element and the element for a given index can be queried as well.

 
Constructor Summary
GNumberedSet()
           
 
Method Summary
static GNumberedSet convert(def setDef)
           Convert a set definition to a numbered set.
Object getElem(int idx)
          
int indexOf(Object elem)
          
boolean isNumbered()
          
int size()
          
 

Constructor Detail

GNumberedSet

GNumberedSet()


Method Detail

convert

public static GNumberedSet convert(def setDef)
Convert a set definition to a numbered set. Executed GSet.convert and throws an exception if the result is not a numbered set.


getElem

public Object getElem(int idx)
returns:
the cardinality of the set


indexOf

public int indexOf(Object elem)
returns:
the cardinality of the set


isNumbered

public boolean isNumbered()
returns:
the cardinality of the set


size

public int size()
returns:
the cardinality of the set