org.datamixer.functions
Class FunctionIterator

java.lang.Object
  extended by org.datamixer.collections.DatamixerIterator
      extended by org.datamixer.containers.SequenceIterator
          extended by org.datamixer.functions.FunctionIterator
All Implemented Interfaces:
java.util.Iterator

public class FunctionIterator
extends SequenceIterator


Field Summary
protected  Value[] params_
          for each generation, function parameters are iterator values
protected  FunctionStrategy strategy_
          strategy
 
Fields inherited from class org.datamixer.containers.SequenceIterator
current_, currentIterator_, currentIteratorIndex_, elements_, iterators_, repeatAll_, TRAVERSAL_BREADTH, TRAVERSAL_BREADTH_STRING, TRAVERSAL_DEPTH, TRAVERSAL_DEPTH_STRING, TRAVERSAL_UNDEFINED, TRAVERSAL_UNDEFINED_STRING, traversalOrder_, wasReset_
 
Fields inherited from class org.datamixer.collections.DatamixerIterator
collection_, dataType_, dataTypeSet_, debugEnabled_, done_, doneChecked_, format_, formatPattern_, id_, infoEnabled_, initialized_, iterations_, limit_, limitSet_, logger_, repeat_, repeatSet_
 
Constructor Summary
FunctionIterator()
           
FunctionIterator(FunctionStrategy strategy)
           
 
Method Summary
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  boolean doDone()
          Gets the next value from each iterator, returns true if any are done.
protected  void doGenerate()
          Generates the next value.
protected  void doInitialize()
          Initialization.
protected  int findDataType()
          Returns the datatype.
 java.text.Format getFormat(java.lang.String pattern)
          Returns an appropriate Format object.
 Value[] getParams()
          Sets the current strategy.
 FunctionStrategy getStrategy()
          Returns the current strategy.
static int maxDataType(int type1, int type2)
          Returns the datatype with maximum precision for type1 and type2.
 void setStrategy(FunctionStrategy value)
          Sets the current strategy.
 
Methods inherited from class org.datamixer.containers.SequenceIterator
addElement, addElement, doGetCurrentValue, doReset, getElement, getElements, getIterator, getIterators, getRepeatAll, getTraversalOrder, setRepeatAll, setTraversalOrder, traversalOrderFromString, traversalOrderToString
 
Methods inherited from class org.datamixer.collections.DatamixerIterator
generate, getCollection, getCurrent, getCurrentValue, getDataType, getFormatPattern, getHasNext, getId, getIterations, getLimit, getNext, getNextValue, getRepeat, hasNext, initialize, next, remove, reset, setCollection, setCurrentValue, setDataType, setFormatPattern, setId, setLimit, setRepeat, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

strategy_

protected FunctionStrategy strategy_
strategy


params_

protected Value[] params_
for each generation, function parameters are iterator values

Constructor Detail

FunctionIterator

public FunctionIterator()

FunctionIterator

public FunctionIterator(FunctionStrategy strategy)
Method Detail

getFormat

public java.text.Format getFormat(java.lang.String pattern)
Returns an appropriate Format object.

Overrides:
getFormat in class SequenceIterator

doInitialize

protected void doInitialize()
                     throws DatamixerException
Description copied from class: SequenceIterator
Initialization.

Overrides:
doInitialize in class SequenceIterator
Throws:
DatamixerException

doDone

protected boolean doDone()
                  throws DatamixerException
Gets the next value from each iterator, returns true if any are done.

Overrides:
doDone in class SequenceIterator
Throws:
DatamixerException

doGenerate

protected void doGenerate()
                   throws DatamixerException
Generates the next value.

Overrides:
doGenerate in class SequenceIterator
Throws:
DatamixerException

getStrategy

public FunctionStrategy getStrategy()
                             throws DatamixerException
Returns the current strategy.

Returns:
the current strategy.
Throws:
DatamixerException

setStrategy

public void setStrategy(FunctionStrategy value)
Sets the current strategy.

Parameters:
value - the current strategy.

getParams

public Value[] getParams()
Sets the current strategy.

Parameters:
value - the current strategy.

findDataType

protected int findDataType()
                    throws DatamixerException
Returns the datatype. Datatypes are defined in java.sql.Types.

Throws:
DatamixerException - if children have incompatible types.

maxDataType

public static int maxDataType(int type1,
                              int type2)
                       throws DatamixerException
Returns the datatype with maximum precision for type1 and type2.

Throws:
DatamixerException - if types are not supported or incompatible.

checkCompatibility

public static void checkCompatibility(int type1,
                                      int type2)
                               throws DatamixerException
Checks compatibility between two datatypes.

Throws:
DatamixerException - if types are incompatible.

dataTypeWeight

public static int dataTypeWeight(int type)
                          throws DatamixerException
Returns the datatype with maximum precision for type1 and type2.

Throws:
DatamixerException - if type is not supported.


Copyright © 2004-2009 datamixer.org. All Rights Reserved.