Class SelectGenotype<V>

Type Parameters:
V - the type of elements
All Implemented Interfaces:
Serializable, Cloneable, Iterable<Integer>, Collection<Integer>, List<Integer>, RandomAccess, Genotype, ListGenotype<Integer>

public class SelectGenotype<V> extends IntegerGenotype
The SelectGenotype selects for each index an element from the given list.
See Also:
  • Field Details

    • values

      protected final List<V> values
  • Constructor Details

    • SelectGenotype

      public SelectGenotype(List<V> values)
      Constructs a SelectGenotype.
      Parameters:
      values - the elements to be selected
  • Method Details

    • getValue

      public V getValue(int index)
      Returns the element value of the index.
      Parameters:
      index - the index
      Returns:
      the element
    • newInstance

      public <G extends Genotype> G newInstance()
      Description copied from interface: Genotype
      Constructs a new (empty) instance of this Genotype.
      Specified by:
      newInstance in interface Genotype
      Overrides:
      newInstance in class IntegerGenotype
      Type Parameters:
      G - the type of genotype for an implicit cast
      Returns:
      new instance of the genotype