Package org.biojavax.ga.impl
Class SimplePopulation
- java.lang.Object
-
- org.biojava.utils.AbstractChangeable
-
- org.biojavax.ga.impl.AbstractPopulation
-
- org.biojavax.ga.impl.SimplePopulation
-
- All Implemented Interfaces:
Changeable,Population
public final class SimplePopulation extends AbstractPopulation
Simple concrete implementation of the
PopulationinterfaceInternally the SimplePopulation store Organisms in a HashMap
- Since:
- 1.5
- Version:
- 1.0
- Author:
- Mark Schreiber
-
-
Field Summary
-
Fields inherited from interface org.biojavax.ga.Population
NAME, ORGANISMS
-
-
Constructor Summary
Constructors Constructor Description SimplePopulation()SimplePopulation(java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddOrganismImpl(Organism orgToAdd)OrganismgetOrganismByName(java.lang.String name)Gets the specified organismjava.util.SetgetOrganisms()Gets the Set of Organismsjava.util.Iteratororganisms()protected voidremoveAllOrganismsImpl()protected voidremoveOrganismImpl(Organism orgToRemove)intsize()Gets the Size of the population-
Methods inherited from class org.biojavax.ga.impl.AbstractPopulation
addOrganism, addOrganisms, addOrganisms, addOrganisms, getName, removeAllOrganisms, removeOrganism, removeOrganisms, removeOrganisms, setName
-
Methods inherited from class org.biojava.utils.AbstractChangeable
addChangeListener, addChangeListener, generateChangeSupport, getChangeSupport, hasListeners, hasListeners, isUnchanging, removeChangeListener, removeChangeListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.biojava.utils.Changeable
addChangeListener, addChangeListener, isUnchanging, removeChangeListener, removeChangeListener
-
-
-
-
Method Detail
-
addOrganismImpl
protected void addOrganismImpl(Organism orgToAdd) throws IllegalOrganismException
- Specified by:
addOrganismImplin classAbstractPopulation- Throws:
IllegalOrganismException
-
removeOrganismImpl
protected void removeOrganismImpl(Organism orgToRemove)
- Specified by:
removeOrganismImplin classAbstractPopulation
-
removeAllOrganismsImpl
protected void removeAllOrganismsImpl()
- Specified by:
removeAllOrganismsImplin classAbstractPopulation
-
getOrganismByName
public Organism getOrganismByName(java.lang.String name)
Description copied from interface:PopulationGets 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:PopulationGets 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:PopulationGets the Set of Organisms- Returns:
- a Set
-
-