Class CombinedIntGenerator
- java.lang.Object
-
- elki.utilities.datastructures.range.CombinedIntGenerator
-
- All Implemented Interfaces:
IntGenerator
public class CombinedIntGenerator extends java.lang.Object implements IntGenerator
Combine multiple ranges.- Since:
- 0.7.5
- Author:
- Erich Schubert
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Collection<IntGenerator>generatorsGenerators.private intmaxMaximum value.private intminMinimum.
-
Constructor Summary
Constructors Constructor Description CombinedIntGenerator(IntGenerator... generators)Constructor.CombinedIntGenerator(java.util.Collection<IntGenerator> generators)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidforEach(java.util.function.IntConsumer c)Process the entire series once.intgetMax()Maximum value of the stream.intgetMin()Minimum value of the stream.java.lang.StringBuilderserializeTo(java.lang.StringBuilder buf)Produce a textual representation.java.lang.StringtoString()private voidupdateMinMax()Compute the minimum and maximum.
-
-
-
Field Detail
-
min
private int min
Minimum.
-
max
private int max
Maximum value.
-
generators
private java.util.Collection<IntGenerator> generators
Generators.
-
-
Constructor Detail
-
CombinedIntGenerator
public CombinedIntGenerator(IntGenerator... generators)
Constructor.- Parameters:
generators- Data generators.
-
CombinedIntGenerator
public CombinedIntGenerator(java.util.Collection<IntGenerator> generators)
Constructor.- Parameters:
generators- Data generators. Will not be copied. Modifying this afterwards can cause incorrect results, use with care.
-
-
Method Detail
-
getMin
public int getMin()
Description copied from interface:IntGeneratorMinimum value of the stream.- Specified by:
getMinin interfaceIntGenerator- Returns:
- Minimum
-
getMax
public int getMax()
Description copied from interface:IntGeneratorMaximum value of the stream.- Specified by:
getMaxin interfaceIntGenerator- Returns:
- Maximum
-
updateMinMax
private void updateMinMax()
Compute the minimum and maximum.
-
forEach
public void forEach(java.util.function.IntConsumer c)
Description copied from interface:IntGeneratorProcess the entire series once.- Specified by:
forEachin interfaceIntGenerator- Parameters:
c- Consumer
-
serializeTo
public java.lang.StringBuilder serializeTo(java.lang.StringBuilder buf)
Description copied from interface:IntGeneratorProduce a textual representation.- Specified by:
serializeToin interfaceIntGenerator- Parameters:
buf- Output buffer.- Returns:
- Buffer
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-