Package org.biojavax.ga.impl
Class AbstractPopulation
- java.lang.Object
-
- org.biojava.utils.AbstractChangeable
-
- org.biojavax.ga.impl.AbstractPopulation
-
- All Implemented Interfaces:
Changeable,Population
- Direct Known Subclasses:
SimplePopulation
public abstract class AbstractPopulation extends AbstractChangeable implements Population
Most Population implementations will want to inherit from here. This class doesn't define how Organims are stored or accessed so inheriting classes can define that themselves.- 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 AbstractPopulation()AbstractPopulation(String name)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidaddOrganism(Organism org)Adds an Organism to the Populationprotected abstract voidaddOrganismImpl(Organism org)voidaddOrganisms(Set orgs)Adds several organisms to the populationvoidaddOrganisms(Organism[] orgs)Adds several organisms to the populationvoidaddOrganisms(Population orgs)Adds the residents of one population to this oneStringgetName()voidremoveAllOrganisms()Removes all theOrganismsin thisPopulationprotected abstract voidremoveAllOrganismsImpl()voidremoveOrganism(Organism org)Kills off the organismprotected abstract voidremoveOrganismImpl(Organism org)voidremoveOrganisms(Set orgs)Removes all theOrganismsinorgsvoidremoveOrganisms(Organism[] orgs)Removes all theOrganismsinorgsvoidsetName(String name)Sets the name of the population-
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
-
Methods inherited from interface org.biojavax.ga.Population
getOrganismByName, getOrganisms, organisms, size
-
-
-
-
Constructor Detail
-
AbstractPopulation
public AbstractPopulation()
-
AbstractPopulation
public AbstractPopulation(String name)
-
-
Method Detail
-
getName
public String getName()
- Specified by:
getNamein interfacePopulation- Returns:
- the name of the population
-
setName
public final void setName(String name) throws ChangeVetoException
Description copied from interface:PopulationSets the name of the population- Specified by:
setNamein interfacePopulation- Parameters:
name- set the name to this.- Throws:
ChangeVetoException- if the name may not be changed
-
addOrganism
public final void addOrganism(Organism org) throws ChangeVetoException, IllegalOrganismException
Description copied from interface:PopulationAdds an Organism to the Population- Specified by:
addOrganismin interfacePopulation- Parameters:
org- the organism- Throws:
ChangeVetoExceptionIllegalOrganismException- if for some reason the organism is invalid
-
addOrganismImpl
protected abstract void addOrganismImpl(Organism org) throws IllegalOrganismException
- Throws:
IllegalOrganismException
-
addOrganisms
public final void addOrganisms(Organism[] orgs) throws ChangeVetoException, IllegalOrganismException
Description copied from interface:PopulationAdds several organisms to the population- Specified by:
addOrganismsin interfacePopulation- Parameters:
orgs- the organisms to add- Throws:
ChangeVetoExceptionIllegalOrganismException- if for some reason the organism is invalid
-
addOrganisms
public final void addOrganisms(Set orgs) throws ChangeVetoException, IllegalOrganismException
Description copied from interface:PopulationAdds several organisms to the population- Specified by:
addOrganismsin interfacePopulation- Parameters:
orgs- the organisms to add- Throws:
ChangeVetoExceptionIllegalOrganismException- if for some reason the organism is invalid
-
addOrganisms
public final void addOrganisms(Population orgs) throws ChangeVetoException, IllegalOrganismException
Description copied from interface:PopulationAdds the residents of one population to this one- Specified by:
addOrganismsin interfacePopulation- Parameters:
orgs- the population to add- Throws:
ChangeVetoExceptionIllegalOrganismException- if for some reason the organism is invalid
-
removeOrganisms
public final void removeOrganisms(Organism[] orgs) throws ChangeVetoException
Description copied from interface:PopulationRemoves all theOrganismsinorgs- Specified by:
removeOrganismsin interfacePopulation- Parameters:
orgs- theOrganismsto remove.- Throws:
ChangeVetoException- if the change is vetoed
-
removeOrganisms
public final void removeOrganisms(Set orgs) throws ChangeVetoException
Description copied from interface:PopulationRemoves all theOrganismsinorgs- Specified by:
removeOrganismsin interfacePopulation- Parameters:
orgs- theOrganismsto remove.- Throws:
ChangeVetoException- if the change is vetoed
-
removeAllOrganisms
public final void removeAllOrganisms() throws ChangeVetoException
Description copied from interface:PopulationRemoves all theOrganismsin thisPopulation- Specified by:
removeAllOrganismsin interfacePopulation- Throws:
ChangeVetoException- if the change is vetoed
-
removeOrganism
public final void removeOrganism(Organism org) throws ChangeVetoException
Description copied from interface:PopulationKills off the organism- Specified by:
removeOrganismin interfacePopulation- Parameters:
org- the organism to kill- Throws:
ChangeVetoException
-
removeOrganismImpl
protected abstract void removeOrganismImpl(Organism org)
-
removeAllOrganismsImpl
protected abstract void removeAllOrganismsImpl()
-
-