Class SimplePopulation

  • All Implemented Interfaces:
    Changeable, Population

    public final class SimplePopulation
    extends AbstractPopulation

    Simple concrete implementation of the Population interface

    Internally the SimplePopulation store Organisms in a HashMap

    Since:
    1.5
    Version:
    1.0
    Author:
    Mark Schreiber
    • Constructor Detail

      • SimplePopulation

        public SimplePopulation​(java.lang.String name)
      • SimplePopulation

        public SimplePopulation()
    • Method Detail

      • getOrganismByName

        public Organism getOrganismByName​(java.lang.String name)
        Description copied from interface: Population
        Gets the specified organism
        Parameters:
        name - the name of the organism to retreive
        Returns:
        the organism named or null if that organism doesn't exist.
      • size

        public int size()
        Description copied from interface: Population
        Gets the Size of the population
        Returns:
        the size
      • organisms

        public java.util.Iterator organisms()
        Returns:
        an iterator over the set of Organisms.
      • getOrganisms

        public java.util.Set getOrganisms()
        Description copied from interface: Population
        Gets the Set of Organisms
        Returns:
        a Set