|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.datamixer.collections.DatamixerIterator
org.datamixer.containers.CollectionContainerIterator
A CollectionContainerIterator manages a list of collections or iterators. At
initialization time, it gets an iterator from each collection, so that at
runtime it has a list of iterators. DatamixerIterator.next() returns a ValueListValue, which contains a ValueList with the next value from each
iterator.
iterator(), in
which case each list in the CollectionContainer contributes an iterator to the
CollectionContainerIterator.
| Field Summary | |
static int |
ALL_DONE
done when all children are done |
static java.lang.String |
ALL_DONE_STRING
string representation for ALL_DONE |
static int |
ANY_DONE
done when any child is done |
static java.lang.String |
ANY_DONE_STRING
string representation for ANY_DONE |
protected Value |
current_
current value |
protected int |
dataType_
datatype |
protected boolean |
dataTypeSet_
true if datatype has been set |
static int |
DONE_UNDEFINED
done policy not defined |
static java.lang.String |
DONE_UNDEFINED_STRING
string representation for UNDEFINED_DONE |
protected int |
donePolicy_
policy for deciding when done (ANY_DONE or ALL_DONE). |
protected java.util.ArrayList |
elements_
collections and iterators |
protected java.util.ArrayList |
iterators_
iterators |
protected java.lang.Boolean |
repeatAll_
set the repeat flag for all iterators to enabled. |
| Fields inherited from class org.datamixer.collections.DatamixerIterator |
collection_, debugEnabled_, done_, doneChecked_, doneListeners_, format_, formatPattern_, id_, infoEnabled_, initialized_, logger_, name_, nextListeners_, path_, repeat_, repeatSet_ |
| Constructor Summary | |
CollectionContainerIterator()
|
|
| Method Summary | |
void |
addElement(DatamixerCollection collection)
Add collection to the element list. |
void |
addElement(DatamixerIterator iterator)
Add iterator to the element list. |
protected boolean |
allDone()
returns true if all iterators are done. |
protected boolean |
anyDone()
returns true if any generator is done. |
static void |
checkCompatibility(int type1,
int type2)
Checks compatibility between two datatypes. |
static int |
dataTypeWeight(int type)
Returns the datatype with maximum precision for type1 and
type2. |
protected void |
doContainerGenerate(ValueList result)
Generate the next element in the collection. |
protected boolean |
doDone()
call done on generators. |
protected void |
doGenerate()
Generate the next element in the collection. |
protected Value |
doGetCurrentValue()
Returns the current value. |
protected void |
doInitialize()
Initialization. |
protected void |
doReset()
Resets the iterator to an initial state. |
protected int |
findDataType()
Returns the datatype. |
int |
getDataType()
Returns the datatype. |
int |
getDonePolicy()
|
java.lang.String |
getDonePolicyString()
|
static java.lang.String |
getDonePolicyString(int value)
|
java.lang.Object |
getElement(int index)
|
java.util.ArrayList |
getElements()
|
java.text.Format |
getFormat(java.lang.String pattern)
Returns an appropriate Format object. |
DatamixerIterator |
getIterator(int index)
|
java.util.ArrayList |
getIterators()
|
java.lang.Boolean |
getRepeatAll()
Returns repeat flag for all iterators to enabled. |
static int |
maxDataType(int type1,
int type2)
Returns the datatype with maximum precision for type1 and
type2. |
void |
setDataType(int value)
Sets the data type. |
void |
setDonePolicy(int value)
|
void |
setDonePolicyString(java.lang.String value)
|
void |
setRepeatAll(java.lang.Boolean enabled)
Set the repeat flag for all iterators to enabled. |
| Methods inherited from class org.datamixer.collections.DatamixerIterator |
addDatamixerListener, doFireDatamixerEvent, fireDatamixerEvent, generate, getCollection, getContainer, getCurrent, getCurrentValue, getFormatPattern, getHasNext, getId, getListeners, getName, getNext, getNextValue, getPath, getRepeat, hasNext, initialize, next, remove, removeDatamixerListener, reset, setCollection, setContainer, setCurrentValue, setFormatPattern, setId, setName, setRepeat, toString, updateCurrentValue |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
public static final int DONE_UNDEFINED
public static final int ANY_DONE
public static final int ALL_DONE
public static final java.lang.String DONE_UNDEFINED_STRING
public static final java.lang.String ANY_DONE_STRING
public static final java.lang.String ALL_DONE_STRING
protected int dataType_
protected boolean dataTypeSet_
protected java.util.ArrayList elements_
protected java.util.ArrayList iterators_
protected Value current_
protected java.lang.Boolean repeatAll_
enabled.
protected int donePolicy_
| Constructor Detail |
public CollectionContainerIterator()
| Method Detail |
public int getDataType()
getDataType in class DatamixerIteratorpublic void setDataType(int value)
setDataType in class DatamixerIteratorprotected Value doGetCurrentValue()
doGetCurrentValue in class DatamixerIteratorpublic java.text.Format getFormat(java.lang.String pattern)
getFormat in class DatamixerIterator
protected void doInitialize()
throws DatamixerException
doInitialize in class DatamixerIteratorDatamixerException
protected boolean doDone()
throws DatamixerException
doDone in class DatamixerIteratorDatamixerException
protected boolean anyDone()
throws DatamixerException
DatamixerException
protected boolean allDone()
throws DatamixerException
DatamixerException
protected void doGenerate()
throws DatamixerException
doGenerate in class DatamixerIteratorDatamixerException
protected void doContainerGenerate(ValueList result)
throws DatamixerException
DatamixerException
protected void doReset()
throws DatamixerException
doReset in class DatamixerIteratorDatamixerException
protected int findDataType()
throws DatamixerException
DatamixerException - if children have incompatible types.
public static int maxDataType(int type1,
int type2)
throws DatamixerException
type1 and
type2.
DatamixerException - if types are not supported or incompatible.
public static void checkCompatibility(int type1,
int type2)
throws DatamixerException
DatamixerException - if types are incompatible.
public static int dataTypeWeight(int type)
throws DatamixerException
type1 and
type2.
DatamixerException - if type is not supported.public void addElement(DatamixerCollection collection)
collection to the element list.
public void addElement(DatamixerIterator iterator)
iterator to the element list.
public java.util.ArrayList getElements()
public java.lang.Object getElement(int index)
public java.util.ArrayList getIterators()
public DatamixerIterator getIterator(int index)
public int getDonePolicy()
public void setDonePolicy(int value)
public void setDonePolicyString(java.lang.String value)
public java.lang.String getDonePolicyString()
public static java.lang.String getDonePolicyString(int value)
public java.lang.Boolean getRepeatAll()
enabled.
public void setRepeatAll(java.lang.Boolean enabled)
enabled.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||