jebl.math
Class OrderEnumerator.Utils

java.lang.Object
  extended by jebl.math.OrderEnumerator.Utils
Enclosing interface:
OrderEnumerator

public static class OrderEnumerator.Utils
extends Object


Constructor Summary
OrderEnumerator.Utils()
           
 
Method Summary
static OrderEnumerator getAdjusted(OrderEnumerator toAdjust, int adjustmentFactor)
           
static OrderEnumerator.OEFactory getAdjustedFactory(OrderEnumerator.OEFactory toAdjust, int adjustmentFactor)
           
static OrderEnumerator getAlternating(OrderEnumerator primary, OrderEnumerator secondary)
           
static OrderEnumerator.OEFactory getAlternatingFactory(OrderEnumerator.OEFactory primary, OrderEnumerator.OEFactory secondary)
           
static OrderEnumerator getBiasAlternating(OrderEnumerator primary, OrderEnumerator secondary)
           
static OrderEnumerator.OEFactory getBiasAlternatingFactory(OrderEnumerator.OEFactory primary, OrderEnumerator.OEFactory secondary)
           
static OrderEnumerator getConstant(int index)
           
static OrderEnumerator.OEFactory getConstantFactory(int index)
           
static OrderEnumerator getOrdered(int size)
           
static OrderEnumerator.OEFactory getOrderedFactory()
           
static OrderEnumerator getRestricted(OrderEnumerator toRestrict, int minimum, int range)
           
static OrderEnumerator.OEFactory getRestrictedFactory(OrderEnumerator.OEFactory toRestrict, int minimum, int range)
           
static OrderEnumerator getShuffled(int size)
           
static OrderEnumerator.OEFactory getShuffledFactory()
           
static OrderEnumerator getZero()
           
static OrderEnumerator.OEFactory getZeroFactory()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrderEnumerator.Utils

public OrderEnumerator.Utils()
Method Detail

getConstant

public static final OrderEnumerator getConstant(int index)
Parameters:
index - The index to always return
Returns:
an OrderEnumerator object that always returns 'index'

getOrdered

public static final OrderEnumerator getOrdered(int size)
Parameters:
size - the number of different indexes returned (between 0 and size-1)
Returns:
an OrderEnumerator object returns index in order between a certain range

getShuffled

public static final OrderEnumerator getShuffled(int size)
Parameters:
size - the number of different indexes returned (between 0 and size-1)
Returns:
an OrderEnumerator object returns index in random order between a certain range (order changes with each reset)

getBiasAlternating

public static final OrderEnumerator getBiasAlternating(OrderEnumerator primary,
                                                       OrderEnumerator secondary)
Parameters:
primary - The primary OrderEnumerator, one index is taken from this enumertor than an entire sequence of the secondary is taken
secondary - The primary OrderEnumerator, the entire sequence of a secondary enumerator is taken for every single index from the primary enumerator
Returns:
an OrderEnumerator object that combines two sub enumerators

getAlternating

public static final OrderEnumerator getAlternating(OrderEnumerator primary,
                                                   OrderEnumerator secondary)
Parameters:
primary - The primary OrderEnumerator
secondary - The primary OrderEnumerator
Returns:
an OrderEnumerator object that combines two sub enumerators, by alternating between outputs

getZero

public static final OrderEnumerator getZero()
Returns:
OrderEnumerator that always returns 0 (zero)

getRestricted

public static final OrderEnumerator getRestricted(OrderEnumerator toRestrict,
                                                  int minimum,
                                                  int range)
Parameters:
minimum - minmim value released
range - range of values released (that is values go between minimum (inclusive) and minimum+range(exclusive)
Returns:
an OrderEnumerator that is restricted in indexes it returns based on base Enumerator

getAdjusted

public static final OrderEnumerator getAdjusted(OrderEnumerator toAdjust,
                                                int adjustmentFactor)
Returns:
OrderEnumerator that always returns 0 (zero)

getZeroFactory

public static final OrderEnumerator.OEFactory getZeroFactory()
Returns:
OrderEnumerator that always returns 0 (zero)

getConstantFactory

public static final OrderEnumerator.OEFactory getConstantFactory(int index)
Parameters:
index - The index to always return
Returns:
an OrderEnumerator object that always returns 'index'

getOrderedFactory

public static final OrderEnumerator.OEFactory getOrderedFactory()
Returns:
an OrderEnumerator object returns index in order between a certain range

getShuffledFactory

public static final OrderEnumerator.OEFactory getShuffledFactory()
Returns:
an OrderEnumerator object returns index in random order between a certain range (order changes with each reset)

getAdjustedFactory

public static final OrderEnumerator.OEFactory getAdjustedFactory(OrderEnumerator.OEFactory toAdjust,
                                                                 int adjustmentFactor)
Parameters:
adjustmentFactor - If to adjust returns x, adjusted will return x+adjustmentFactory (it's that simple)
Returns:
an OrderEnumerator that returns indexes adjusted from a base enumerator

getRestrictedFactory

public static final OrderEnumerator.OEFactory getRestrictedFactory(OrderEnumerator.OEFactory toRestrict,
                                                                   int minimum,
                                                                   int range)
Parameters:
minimum - minmim value released
range - range of values released (that is values go between minimum (inclusive) and minimum+range(exclusive)
Returns:
an OrderEnumerator that is restricted in indexes it returns based on base Enumerator

getAlternatingFactory

public static final OrderEnumerator.OEFactory getAlternatingFactory(OrderEnumerator.OEFactory primary,
                                                                    OrderEnumerator.OEFactory secondary)
Returns:
an OrderEnumerator object that alternates outputs between two base enumerator

getBiasAlternatingFactory

public static final OrderEnumerator.OEFactory getBiasAlternatingFactory(OrderEnumerator.OEFactory primary,
                                                                        OrderEnumerator.OEFactory secondary)
Returns:
an OrderEnumerator object that alternates outputs between two base enumerator (takes one from primary, than all from secondary, one from primary, all from secondary)