Package jasima.core.random.discrete
Class IntConst
- java.lang.Object
-
- jasima.core.random.continuous.DblSequence
-
- jasima.core.random.discrete.IntSequence
-
- jasima.core.random.discrete.IntConst
-
- All Implemented Interfaces:
Serializable,Cloneable
public class IntConst extends IntSequence
Returns a constant set of integer numbers, as passed to the constructor or viasetValues(int...). This value sequence is repeated if all values are returned once. Optionally the order of items is permuted ifrandomizeOrderwas set to true.- Author:
- Torsten Hildebrandt
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class jasima.core.random.continuous.DblSequence
rndGen
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IntConstclone()Clones the current number stream.doublegetNumericalMean()Returns the arithmetic mean of the values returned byDblSequence.nextDbl().Pair<Double,Double>getValueRange()This method computes the minimum and maximum support values (range of possible values) of this stream.int[]getValues()booleanisRandomizeOrder()intnextInt()voidsetRandomizeOrder(boolean randomizeOrder)If set totrue, the elements ofvalueswill be returned in a randomly permuted order.voidsetValues(int... vs)Sets the values to return as members of this number stream.StringtoString()-
Methods inherited from class jasima.core.random.discrete.IntSequence
nextDbl
-
Methods inherited from class jasima.core.random.continuous.DblSequence
createStreamDefFromStream, getName, getRndGen, init, max, min, setName, setRndGen
-
-
-
-
Method Detail
-
nextInt
public int nextInt()
- Specified by:
nextIntin classIntSequence
-
getNumericalMean
public double getNumericalMean()
Description copied from class:DblSequenceReturns the arithmetic mean of the values returned byDblSequence.nextDbl().- Overrides:
getNumericalMeanin classDblSequence
-
getValueRange
public Pair<Double,Double> getValueRange()
Description copied from class:DblSequenceThis method computes the minimum and maximum support values (range of possible values) of this stream.- Overrides:
getValueRangein classDblSequence- Returns:
- A
Paircontaining the minimum and maximum support values.
-
clone
public IntConst clone()
Description copied from class:DblSequenceClones the current number stream. This method fails with aCloneNotSupportedExceptionif there is a random number generator associated with this stream.- Overrides:
clonein classIntSequence
-
getValues
public int[] getValues()
-
setValues
public void setValues(int... vs)
Sets the values to return as members of this number stream.- Parameters:
vs- The values to use.
-
isRandomizeOrder
public boolean isRandomizeOrder()
-
setRandomizeOrder
public void setRandomizeOrder(boolean randomizeOrder)
If set totrue, the elements ofvalueswill be returned in a randomly permuted order. Otherwise the values will be returned in exactly the same order as given invalues.- Parameters:
randomizeOrder- Whether or not to randomize the order.
-
-