|
|||||
FRAMES NO FRAMES | |||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Manages a set of index variables and their binding to concrete values in a given environment. An index binding consists of - an environment - a set of pairs of an index variable name (given as String) and a set of values to which the corresponding variable shall be bound. When the index binding is traversed, the index variables are set one-by-one to the values occurring in their corresponding value set.
Field Summary | |
---|---|
List |
idxVarNames
|
GSet |
valueSet
|
Constructor Summary | |
GIndexBinding(String idxVarName, Object valueSetDef)
Constructor (given a single index variable name and a value set) bound; type must be convertable to a set. |
|
GIndexBinding(List idxVarNames, Object valueSetDef)
Constructor (given a list of index variable names and a set of tuples) bound; type must be convertable to a set. |
|
GIndexBinding(List idxVarNames, List valueSets)
Constructor (given a list of index names and a corresponding list of value sets). |
|
GIndexBinding(Map bindDef)
|
Method Summary | |
---|---|
void |
assertNumbered()
|
static GIndexBinding |
convert(Object bindDef)
Convert an object of arbitrary type to an expression. |
Iterator |
evaluate(Object env)
|
Object |
getElem(int idx)
|
List |
getIdxVarNames()
|
GSet |
getSet()
|
int |
indexOf(Object elem)
|
void |
init(List idxVarNames, GSet valueSet)
|
boolean |
isNumbered()
|
GSet |
multiply(def other)
|
void |
remove()
Needs to be implemented to satisfy ResettableIterator interface. |
void |
setIdxVars(Object values, Object env)
Internal helper function: Assign a list of values to the variables in the binding. |
void |
setNthBinding(int n, Object env)
Set the binding to the n-th value in the value set |
int |
size()
|
String |
toString()
|
int |
tupleSize()
|
Constructor Detail |
---|
public GIndexBinding(String idxVarName, Object valueSetDef)
public GIndexBinding(List idxVarNames, Object valueSetDef)
public GIndexBinding(List idxVarNames, List valueSets)
public GIndexBinding(Map bindDef)
Method Detail |
---|
void assertNumbered()
public static GIndexBinding convert(Object bindDef)
public Iterator evaluate(Object env)
public Object getElem(int idx)
public List getIdxVarNames()
public GSet getSet()
public int indexOf(Object elem)
void init(List idxVarNames, GSet valueSet)
public boolean isNumbered()
public GSet multiply(def other)
public void remove()
void setIdxVars(Object values, Object env)
public void setNthBinding(int n, Object env)
public int size()
public String toString()
public int tupleSize()