Package io.jenetics.ext
Class BigIntegerGene
- java.lang.Object
-
- io.jenetics.ext.BigIntegerGene
-
- All Implemented Interfaces:
BoundedGene<BigInteger,BigIntegerGene>
,Gene<BigInteger,BigIntegerGene>
,NumericGene<BigInteger,BigIntegerGene>
,Factory<BigIntegerGene>
,Mean<BigIntegerGene>
,Verifiable
,Serializable
,Comparable<BigIntegerGene>
public final class BigIntegerGene extends Object implements NumericGene<BigInteger,BigIntegerGene>, Mean<BigIntegerGene>, Serializable
Numeric chromosome implementation which holds an arbitrary sized integer number.This is a value-based class; use of identity-sensitive operations (including reference equality (
==
), identity hash code, or synchronization) on instances ofIntegerGene
may have unpredictable results and should be avoided.- Since:
- 3.5
- Version:
- 6.0
- See Also:
- Serialized Form
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description BigInteger
allele()
boolean
equals(Object obj)
int
hashCode()
BigInteger
max()
BigIntegerGene
mean(BigIntegerGene that)
BigInteger
min()
BigIntegerGene
newInstance()
BigIntegerGene
newInstance(Number number)
BigIntegerGene
newInstance(BigInteger value)
static BigIntegerGene
of(BigInteger min, BigInteger max)
Create a new randomBigIntegerGene
.static BigIntegerGene
of(BigInteger value, BigInteger min, BigInteger max)
Create a new randomBigIntegerGene
with the given value and the given range.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.jenetics.BoundedGene
compareTo, isValid
-
Methods inherited from interface io.jenetics.NumericGene
byteValue, doubleValue, floatValue, intValue, longValue, shortValue
-
-
-
-
Method Detail
-
allele
public BigInteger allele()
- Specified by:
allele
in interfaceGene<BigInteger,BigIntegerGene>
-
min
public BigInteger min()
- Specified by:
min
in interfaceBoundedGene<BigInteger,BigIntegerGene>
-
max
public BigInteger max()
- Specified by:
max
in interfaceBoundedGene<BigInteger,BigIntegerGene>
-
mean
public BigIntegerGene mean(BigIntegerGene that)
- Specified by:
mean
in interfaceMean<BigIntegerGene>
-
newInstance
public BigIntegerGene newInstance(Number number)
- Specified by:
newInstance
in interfaceNumericGene<BigInteger,BigIntegerGene>
-
newInstance
public BigIntegerGene newInstance(BigInteger value)
- Specified by:
newInstance
in interfaceBoundedGene<BigInteger,BigIntegerGene>
- Specified by:
newInstance
in interfaceGene<BigInteger,BigIntegerGene>
-
newInstance
public BigIntegerGene newInstance()
- Specified by:
newInstance
in interfaceFactory<BigIntegerGene>
- Specified by:
newInstance
in interfaceGene<BigInteger,BigIntegerGene>
-
of
public static BigIntegerGene of(BigInteger value, BigInteger min, BigInteger max)
Create a new randomBigIntegerGene
with the given value and the given range. If thevalue
isn't within the interval [min, max], no exception is thrown. In this case the methodBoundedGene.isValid()
returnsfalse
.- Parameters:
value
- the value of the gene.min
- the minimal valid value of this gene (inclusively).max
- the maximal valid value of this gene (inclusively).- Returns:
- a new random
BigIntegerGene
- Throws:
NullPointerException
- if one of the arguments isnull
-
of
public static BigIntegerGene of(BigInteger min, BigInteger max)
Create a new randomBigIntegerGene
. It is guaranteed that the value of theBigIntegerGene
lies in the interval [min, max].- Parameters:
min
- the minimal valid value of this gene (inclusively).max
- the maximal valid value of this gene (inclusively).- Returns:
- a new random
BigIntegerGene
- Throws:
NullPointerException
- if one of the arguments isnull
-
-