- All Implemented Interfaces:
Gene<Boolean,
,BitGene> Factory<BitGene>
,Self<BitGene>
,Verifiable
,Serializable
,Comparable<BitGene>
,Constable
Implementation of a BitGene.
- Since:
- 1.0
- Version:
- 6.0
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionallele()
Return the allele of this gene.final boolean
bit()
Return the value of the BitGene.boolean
Return theboolean
value of this gene.boolean
isValid()
Return alwaystrue
.Create a new, random gene.newInstance
(Boolean value) Create a new gene from the givenvalue
.static BitGene
of
(boolean value) Return the correspondingBitGene
for the givenboolean
value.toString()
static BitGene
Returns the enum constant of this class with the specified name.static BitGene[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.Methods inherited from class java.lang.Enum
clone, compareTo, describeConstable, equals, finalize, getDeclaringClass, hashCode, name, ordinal, valueOf
Methods inherited from interface java.lang.Comparable
compareTo
-
Enum Constant Details
-
FALSE
-
TRUE
-
-
Field Details
-
ZERO
-
ONE
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified nameNullPointerException
- if the argument is null
-
bit
Return the value of the BitGene.- Returns:
- The value of the BitGene.
- See Also:
-
booleanValue
Return theboolean
value of this gene.- Returns:
- the
boolean
value of this gene. - See Also:
-
allele
Description copied from interface:Gene
Return the allele of this gene. -
isValid
Return alwaystrue
.- Specified by:
isValid
in interfaceVerifiable
- Returns:
- always
true
-
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
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
-
toString
-
of
Return the correspondingBitGene
for the givenboolean
value.- Parameters:
value
- the value of the returnedBitGene
.- Returns:
- the
BitGene
for the givenboolean
value.
-