Package io.jenetics

Enum Class BitGene

All Implemented Interfaces:
Gene<Boolean,BitGene>, Factory<BitGene>, Self<BitGene>, Verifiable, Serializable, Comparable<BitGene>, Constable

public enum BitGene extends Enum<BitGene> implements Gene<Boolean,BitGene>, Comparable<BitGene>
Implementation of a BitGene.
Since:
1.0
Version:
6.0
See Also:
  • Enum Constant Details

  • Field Details

  • Method Details

    • values

      public static BitGene[] 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

      public static BitGene valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • bit

      public final boolean bit()
      Return the value of the BitGene.
      Returns:
      The value of the BitGene.
      See Also:
    • booleanValue

      public boolean booleanValue()
      Return the boolean value of this gene.
      Returns:
      the boolean value of this gene.
      See Also:
    • allele

      public Boolean allele()
      Description copied from interface: Gene
      Return the allele of this gene.
      Specified by:
      allele in interface Gene<Boolean,BitGene>
      Returns:
      the allele of this gene.
    • isValid

      public boolean isValid()
      Return always true.
      Specified by:
      isValid in interface Verifiable
      Returns:
      always true
    • newInstance

      public BitGene newInstance()
      Create a new, random gene.
      Specified by:
      newInstance in interface Factory<BitGene>
      Specified by:
      newInstance in interface Gene<Boolean,BitGene>
      Returns:
      a new instance of type T
    • newInstance

      public BitGene newInstance(Boolean value)
      Create a new gene from the given value.
      Specified by:
      newInstance in interface Gene<Boolean,BitGene>
      Parameters:
      value - the value of the new gene.
      Returns:
      a new gene with the given value.
      Since:
      1.6
    • toString

      public String toString()
      Overrides:
      toString in class Enum<BitGene>
    • of

      public static BitGene of(boolean value)
      Return the corresponding BitGene for the given boolean value.
      Parameters:
      value - the value of the returned BitGene.
      Returns:
      the BitGene for the given boolean value.