Module io.jenetics.base
Package io.jenetics
Interface NumericChromosome<N extends Number & Comparable<? super N>,G extends NumericGene<N,G>>
- All Superinterfaces:
BaseSeq<G>,BoundedChromosome<N,,G> Chromosome<G>,Factory<Chromosome<G>>,Iterable<G>,RandomAccess,Verifiable
- All Known Implementing Classes:
BigIntegerChromosome,DoubleChromosome,IntegerChromosome,LongChromosome
public interface NumericChromosome<N extends Number & Comparable<? super N>,G extends NumericGene<N,G>>
extends BoundedChromosome<N,G>
Numeric chromosome interface.
- Since:
- 1.6
- Version:
- 5.2
- See Also:
- Implementation Requirements:
- Implementations of the
NumericChromosomeinterface must be immutable and guarantee efficient random access (O(1)) to the genes. AChromosomemust contains at least oneGene.
-
Method Summary
Modifier and TypeMethodDescriptiondefault byteReturn the byte value of thisNumericChromosomeat theindex0.default bytebyteValue(int index) Return the byte value of thisNumericChromosomeat the givenindex.default doubleReturn the double value of thisNumericChromosomeat theindex0.default doubledoubleValue(int index) Return the double value of thisNumericChromosomeat the givenindex.default floatReturn the float value of thisNumericChromosomeat theindex0.default floatfloatValue(int index) Return the float value of thisNumericChromosomeat the givenindex.default intintValue()Return the int value of thisNumericChromosomeat theindex0.default intintValue(int index) Return the int value of thisNumericChromosomeat the givenindex.default longReturn the long value of thisNumericChromosomeat theindex0.default longlongValue(int index) Return the long value of thisNumericChromosomeat the givenindex.default shortReturn the short value of thisNumericChromosomeat theindex0.default shortshortValue(int index) Return the short value of thisNumericChromosomeat the givenindex.Methods inherited from interface io.jenetics.util.BaseSeq
forEach, get, isEmpty, iterator, length, listIterator, nonEmpty, spliterator, streamMethods inherited from interface io.jenetics.BoundedChromosome
max, minMethods inherited from interface io.jenetics.Chromosome
as, gene, isValid, newInstanceMethods inherited from interface io.jenetics.util.Factory
instances, newInstance
-
Method Details
-
byteValue
Return the byte value of thisNumericChromosomeat the givenindex.- Parameters:
index- the index of theNumericGene.- Returns:
- the byte value of the
Genewith the givenindex. - Throws:
IndexOutOfBoundsException- if the index is out of range (index < 0 || index >= length()).
-
byteValue
Return the byte value of thisNumericChromosomeat theindex0.- Returns:
- the byte value of the
Genewithindex0.
-
shortValue
Return the short value of thisNumericChromosomeat the givenindex.- Parameters:
index- the index of theNumericGene.- Returns:
- the short value of the
Genewith the givenindex. - Throws:
IndexOutOfBoundsException- if the index is out of range (index < 0 || index >= length()).
-
shortValue
Return the short value of thisNumericChromosomeat theindex0.- Returns:
- the short value of the
Genewithindex0.
-
intValue
Return the int value of thisNumericChromosomeat the givenindex.- Parameters:
index- the index of theNumericGene.- Returns:
- the int value of the
Genewith the givenindex. - Throws:
IndexOutOfBoundsException- if the index is out of range (index < 0 || index >= length()).
-
intValue
Return the int value of thisNumericChromosomeat theindex0.- Returns:
- the int value of the
Genewithindex0.
-
longValue
Return the long value of thisNumericChromosomeat the givenindex.- Parameters:
index- the index of theNumericGene.- Returns:
- the long value of the
Genewith the givenindex. - Throws:
IndexOutOfBoundsException- if the index is out of range (index < 0 || index >= length()).
-
longValue
Return the long value of thisNumericChromosomeat theindex0.- Returns:
- the long value of the
Genewithindex0.
-
floatValue
Return the float value of thisNumericChromosomeat the givenindex.- Parameters:
index- the index of theNumericGene.- Returns:
- the float value of the
Genewith the givenindex. - Throws:
IndexOutOfBoundsException- if the index is out of range (index < 0 || index >= length()).
-
floatValue
Return the float value of thisNumericChromosomeat theindex0.- Returns:
- the float value of the
Genewithindex0.
-
doubleValue
Return the double value of thisNumericChromosomeat the givenindex.- Parameters:
index- the index of theNumericGene.- Returns:
- the double value of the
Genewith the givenindex. - Throws:
IndexOutOfBoundsException- if the index is out of range (index < 0 || index >= length()).
-
doubleValue
Return the double value of thisNumericChromosomeat theindex0.- Returns:
- the double value of the
Genewithindex0.
-