Package pal.math
Class OrderEnumerator.Utils
java.lang.Object
pal.math.OrderEnumerator.Utils
- Enclosing interface:
OrderEnumerator
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final OrderEnumerator
getAdjusted
(OrderEnumerator toAdjust, int adjustmentFactor) static final OrderEnumerator.OEFactory
getAdjustedFactory
(OrderEnumerator.OEFactory toAdjust, int adjustmentFactor) static final OrderEnumerator
getAlternating
(OrderEnumerator primary, OrderEnumerator secondary) static final OrderEnumerator.OEFactory
getAlternatingFactory
(OrderEnumerator.OEFactory primary, OrderEnumerator.OEFactory secondary) static final OrderEnumerator
getBiasAlternating
(OrderEnumerator primary, OrderEnumerator secondary) static final OrderEnumerator.OEFactory
getBiasAlternatingFactory
(OrderEnumerator.OEFactory primary, OrderEnumerator.OEFactory secondary) static final OrderEnumerator
getConstant
(int index) static final OrderEnumerator.OEFactory
getConstantFactory
(int index) static final OrderEnumerator
getOrdered
(int size) static final OrderEnumerator.OEFactory
static final OrderEnumerator
getRestricted
(OrderEnumerator toRestrict, int minimum, int range) static final OrderEnumerator.OEFactory
getRestrictedFactory
(OrderEnumerator.OEFactory toRestrict, int minimum, int range) static final OrderEnumerator
getShuffled
(int size) static final OrderEnumerator.OEFactory
static final OrderEnumerator
getZero()
static final OrderEnumerator.OEFactory
-
Constructor Details
-
Utils
public Utils()
-
-
Method Details
-
getConstant
- Parameters:
index
- The index to always return- Returns:
- an OrderEnumerator object that always returns 'index'
-
getOrdered
- 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
- 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 takensecondar
- 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 OrderEnumeratorsecondar
- The primary OrderEnumerator- Returns:
- an OrderEnumerator object that combines two sub enumerators, by alternating between outputs
-
getZero
- Returns:
- OrderEnumerator that always returns 0 (zero)
-
getRestricted
public static final OrderEnumerator getRestricted(OrderEnumerator toRestrict, int minimum, int range) - Parameters:
minimum
- minmim value releasedrange
- 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
- Returns:
- OrderEnumerator that always returns 0 (zero)
-
getZeroFactory
- Returns:
- OrderEnumerator that always returns 0 (zero)
-
getConstantFactory
- Parameters:
index
- The index to always return- Returns:
- an OrderEnumerator object that always returns 'index'
-
getOrderedFactory
- Returns:
- an OrderEnumerator object returns index in order between a certain range
-
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 releasedrange
- 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)
-