Package io.jenetics
Enum BitGene
- java.lang.Object
-
- java.lang.Enum<BitGene>
-
- io.jenetics.BitGene
-
- All Implemented Interfaces:
Gene<Boolean,BitGene>
,Factory<BitGene>
,Verifiable
,Serializable
,Comparable<BitGene>
public enum BitGene extends Enum<BitGene> implements Gene<Boolean,BitGene>, Comparable<BitGene>
Implementation of a BitGene.- Since:
- 1.0
- Version:
- 6.0
- See Also:
BitChromosome
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Boolean
allele()
Return the allele of this gene.boolean
bit()
Return the value of the BitGene.boolean
booleanValue()
Return theboolean
value of this gene.boolean
isValid()
Return alwaystrue
.BitGene
newInstance()
Create a new, random gene.BitGene
newInstance(Boolean value)
Create a new gene from the givenvalue
.static BitGene
of(boolean value)
Return the correspondingBitGene
for the givenboolean
value.String
toString()
static BitGene
valueOf(String name)
Returns the enum constant of this type with the specified name.static BitGene[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.-
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
-
Methods inherited from interface java.lang.Comparable
compareTo
-
-
-
-
Method Detail
-
values
public static BitGene[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (BitGene c : BitGene.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static BitGene valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
bit
public final boolean bit()
Return the value of the BitGene.- Returns:
- The value of the BitGene.
- See Also:
allele()
,booleanValue()
-
booleanValue
public boolean booleanValue()
Return theboolean
value of this gene.
-
allele
public Boolean allele()
Description copied from interface:Gene
Return the allele of this gene.
-
isValid
public boolean isValid()
Return alwaystrue
.- Specified by:
isValid
in interfaceVerifiable
- Returns:
- always
true
-
newInstance
public BitGene newInstance()
Create a new, random gene.- Specified by:
newInstance
in interfaceFactory<BitGene>
- Specified by:
newInstance
in interfaceGene<Boolean,BitGene>
- Returns:
- a new instance of type T
-
newInstance
public BitGene newInstance(Boolean value)
Create a new gene from the givenvalue
.- Specified by:
newInstance
in interfaceGene<Boolean,BitGene>
- Parameters:
value
- the value of the new gene.- Returns:
- a new gene with the given value.
- Since:
- 1.6
-
-