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
NumericChromosome
interface must be immutable and guarantee efficient random access (O(1)
) to the genes. AChromosome
must contains at least oneGene
.
-
Method Summary
Modifier and TypeMethodDescriptiondefault byte
Return the byte value of thisNumericChromosome
at theindex
0.default byte
byteValue
(int index) Return the byte value of thisNumericChromosome
at the givenindex
.default double
Return the double value of thisNumericChromosome
at theindex
0.default double
doubleValue
(int index) Return the double value of thisNumericChromosome
at the givenindex
.default float
Return the float value of thisNumericChromosome
at theindex
0.default float
floatValue
(int index) Return the float value of thisNumericChromosome
at the givenindex
.default int
intValue()
Return the int value of thisNumericChromosome
at theindex
0.default int
intValue
(int index) Return the int value of thisNumericChromosome
at the givenindex
.default long
Return the long value of thisNumericChromosome
at theindex
0.default long
longValue
(int index) Return the long value of thisNumericChromosome
at the givenindex
.default short
Return the short value of thisNumericChromosome
at theindex
0.default short
shortValue
(int index) Return the short value of thisNumericChromosome
at the givenindex
.Methods inherited from interface io.jenetics.util.BaseSeq
forEach, get, isEmpty, iterator, length, listIterator, nonEmpty, spliterator, stream
Methods inherited from interface io.jenetics.BoundedChromosome
max, min
Methods inherited from interface io.jenetics.Chromosome
as, gene, isValid, newInstance
Methods inherited from interface io.jenetics.util.Factory
instances, newInstance
-
Method Details
-
byteValue
Return the byte value of thisNumericChromosome
at the givenindex
.- Parameters:
index
- the index of theNumericGene
.- Returns:
- the byte value of the
Gene
with the givenindex
. - Throws:
IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= length()).
-
byteValue
Return the byte value of thisNumericChromosome
at theindex
0.- Returns:
- the byte value of the
Gene
withindex
0.
-
shortValue
Return the short value of thisNumericChromosome
at the givenindex
.- Parameters:
index
- the index of theNumericGene
.- Returns:
- the short value of the
Gene
with the givenindex
. - Throws:
IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= length()).
-
shortValue
Return the short value of thisNumericChromosome
at theindex
0.- Returns:
- the short value of the
Gene
withindex
0.
-
intValue
Return the int value of thisNumericChromosome
at the givenindex
.- Parameters:
index
- the index of theNumericGene
.- Returns:
- the int value of the
Gene
with the givenindex
. - Throws:
IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= length()).
-
intValue
Return the int value of thisNumericChromosome
at theindex
0.- Returns:
- the int value of the
Gene
withindex
0.
-
longValue
Return the long value of thisNumericChromosome
at the givenindex
.- Parameters:
index
- the index of theNumericGene
.- Returns:
- the long value of the
Gene
with the givenindex
. - Throws:
IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= length()).
-
longValue
Return the long value of thisNumericChromosome
at theindex
0.- Returns:
- the long value of the
Gene
withindex
0.
-
floatValue
Return the float value of thisNumericChromosome
at the givenindex
.- Parameters:
index
- the index of theNumericGene
.- Returns:
- the float value of the
Gene
with the givenindex
. - Throws:
IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= length()).
-
floatValue
Return the float value of thisNumericChromosome
at theindex
0.- Returns:
- the float value of the
Gene
withindex
0.
-
doubleValue
Return the double value of thisNumericChromosome
at the givenindex
.- Parameters:
index
- the index of theNumericGene
.- Returns:
- the double value of the
Gene
with the givenindex
. - Throws:
IndexOutOfBoundsException
- if the index is out of range (index < 0 || index >= length()).
-
doubleValue
Return the double value of thisNumericChromosome
at theindex
0.- Returns:
- the double value of the
Gene
withindex
0.
-