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
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 -
Method Summary
Modifier and TypeMethodDescriptionfinal void
addOrganism
(Organism org) Adds an Organism to the Populationprotected abstract void
addOrganismImpl
(Organism org) final void
addOrganisms
(Set orgs) Adds several organisms to the populationfinal void
addOrganisms
(Organism[] orgs) Adds several organisms to the populationfinal void
addOrganisms
(Population orgs) Adds the residents of one population to this onegetName()
final void
Removes all theOrganisms
in thisPopulation
protected abstract void
final void
removeOrganism
(Organism org) Kills off the organismprotected abstract void
final void
removeOrganisms
(Set orgs) Removes all theOrganisms
inorgs
final void
removeOrganisms
(Organism[] orgs) Removes all theOrganisms
inorgs
final void
Sets the name of the populationMethods 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 Details
-
AbstractPopulation
public AbstractPopulation() -
AbstractPopulation
-
-
Method Details
-
getName
- Specified by:
getName
in interfacePopulation
- Returns:
- the name of the population
-
setName
Description copied from interface:Population
Sets the name of the population- Specified by:
setName
in interfacePopulation
- Parameters:
name
- set the name to this.- Throws:
ChangeVetoException
- if the name may not be changed
-
addOrganism
Description copied from interface:Population
Adds an Organism to the Population- Specified by:
addOrganism
in interfacePopulation
- Parameters:
org
- the organism- Throws:
ChangeVetoException
IllegalOrganismException
- if for some reason the organism is invalid
-
addOrganismImpl
- Throws:
IllegalOrganismException
-
addOrganisms
public final void addOrganisms(Organism[] orgs) throws ChangeVetoException, IllegalOrganismException Description copied from interface:Population
Adds several organisms to the population- Specified by:
addOrganisms
in interfacePopulation
- Parameters:
orgs
- the organisms to add- Throws:
ChangeVetoException
IllegalOrganismException
- if for some reason the organism is invalid
-
addOrganisms
Description copied from interface:Population
Adds several organisms to the population- Specified by:
addOrganisms
in interfacePopulation
- Parameters:
orgs
- the organisms to add- Throws:
ChangeVetoException
IllegalOrganismException
- if for some reason the organism is invalid
-
addOrganisms
public final void addOrganisms(Population orgs) throws ChangeVetoException, IllegalOrganismException Description copied from interface:Population
Adds the residents of one population to this one- Specified by:
addOrganisms
in interfacePopulation
- Parameters:
orgs
- the population to add- Throws:
ChangeVetoException
IllegalOrganismException
- if for some reason the organism is invalid
-
removeOrganisms
Description copied from interface:Population
Removes all theOrganisms
inorgs
- Specified by:
removeOrganisms
in interfacePopulation
- Parameters:
orgs
- theOrganisms
to remove.- Throws:
ChangeVetoException
- if the change is vetoed
-
removeOrganisms
Description copied from interface:Population
Removes all theOrganisms
inorgs
- Specified by:
removeOrganisms
in interfacePopulation
- Parameters:
orgs
- theOrganisms
to remove.- Throws:
ChangeVetoException
- if the change is vetoed
-
removeAllOrganisms
Description copied from interface:Population
Removes all theOrganisms
in thisPopulation
- Specified by:
removeAllOrganisms
in interfacePopulation
- Throws:
ChangeVetoException
- if the change is vetoed
-
removeOrganism
Description copied from interface:Population
Kills off the organism- Specified by:
removeOrganism
in interfacePopulation
- Parameters:
org
- the organism to kill- Throws:
ChangeVetoException
-
removeOrganismImpl
-
removeAllOrganismsImpl
-