|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.tostring0.AToString com.rubecula.darwin.domain.environment.Environment_
public abstract class Environment_
Abstract class defining base methods which implement Environment
interface.
Field Summary | |
---|---|
protected long |
idealPopulation
This is the ideal number of organisms for this environment, i.e. |
protected static org.apache.commons.logging.Log |
LOG
The logger for this class. |
Fields inherited from interface com.rubecula.darwin.domain.helper.Environment |
---|
IDEAL_POPULATION_DEFAULT, S_ID_UNIDENTIFIED |
Fields inherited from interface net.sf.tostring0.IToString |
---|
ANGBR_OPEN, ANGBRA_CLSE, BRA_CLSE, BRA_OPEN, BRCE_OPEN, BRCS_CLSE, COLON, LIST_SEPARATOR, MAX_ELEMENTS_DEFAULT, S_MT, S_PERCENT, SEPARATOR, SPACE |
Constructor Summary | |
---|---|
protected |
Environment_(Realm realm)
Secondary constructor of an empty unidentified environment with default initial value for ideal population (no eco factors). |
protected |
Environment_(java.lang.String identifier,
Realm realm)
Secondary constructor of an empty identified environment with default initial value for ideal population (no eco factors). |
protected |
Environment_(java.lang.String identifier,
Realm realm,
long idealPopulation)
Primary constructor an empty identified environment with given ideal population (no eco factors). |
Method Summary | |
---|---|
java.lang.Object |
addFactor(EcoFactor factor)
Not the favored method of adding an EcoFactor to an
Environment . |
boolean |
addListener(EnvironmentListener listener)
Mutating method to add a listener to changes in this Environment. |
boolean |
censusMe(Census census,
java.lang.Object context)
Method to census this object. |
java.lang.Object |
clone()
|
protected void |
environmentChanged()
This method should be called whenever the environment has changed. |
boolean |
equals(java.lang.Object obj)
|
java.util.Set<java.lang.String> |
factorKeys()
|
void |
fireEnvironmentChanged()
XXX |
java.util.Collection<? extends Censusible> |
getCensusibleChildren()
Method to return a list of censusible children of this object. |
int |
getCount()
|
double |
getEcoFactorValue(java.lang.String name)
Method to retrieve the value of the eco factor defined by name . |
java.util.Collection<EcoFactor> |
getEcoSystem()
|
EcoFactor |
getFactor(java.lang.String name)
Method to retrieve the eco factor defined by name . |
long |
getIdealPopulation()
XXX |
java.lang.String |
getIdentifier()
|
java.util.Collection<Individual> |
getIndividuals()
|
java.util.Collection<EnvironmentListener> |
getListeners()
|
Realm |
getRealm()
|
java.lang.String |
getSignature()
|
Sink |
getSink()
|
int |
hashCode()
|
void |
setEcoSystem(java.util.Collection<EcoFactor> ecoFactors)
Set the ecoFactors for this environment to the collection provided. |
void |
setIdealPopulation(long idealPopulation)
|
void |
setListeners(java.util.Collection<EnvironmentListener> listeners)
Add the given set of environment listeners according to the collection provided. |
void |
setSink(Sink sink)
|
boolean |
update(java.lang.String factorKey,
java.lang.Object factorValue)
Find and set the eco factor to have the factor value, then, if successful, invoke fireEnvironmentChanged() . |
Methods inherited from class net.sf.tostring0.AToString |
---|
toString, toString, toStringBrief, toStringId |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.rubecula.darwin.domain.helper.Environment |
---|
init |
Field Detail |
---|
protected static final org.apache.commons.logging.Log LOG
protected transient long idealPopulation
Environment.IDEAL_POPULATION_DEFAULT
.
Constructor Detail |
---|
protected Environment_(Realm realm)
realm
- protected Environment_(java.lang.String identifier, Realm realm)
identifier
- realm
- protected Environment_(java.lang.String identifier, Realm realm, long idealPopulation)
identifier
- the identifier for this Environment (for logging).realm
- idealPopulation
- the initial value of ideal populationMethod Detail |
---|
public java.lang.Object addFactor(EcoFactor factor)
EcoFactor
to an
Environment
. Normally, we use setEcoSystem(Collection)
.
addFactor
in interface Environment
factor
- the eco factor, whose identifier will be used as the key.
Environment.addFactor(com.rubecula.darwin.domain.helper.EcoFactor)
public boolean addListener(EnvironmentListener listener)
Environment
addListener
in interface Environment
listener
- an object which is interested in changes to the environment.
Collection.add(java.lang.Object)
public boolean censusMe(Census census, java.lang.Object context)
Censusible
censusMe
in interface Censusible
census
- the census object which will present the results of taking
this censuscontext
- an arbitrary object which can be used by the census object to
provide appropriate context for this object.
Censusible.getCensusibleChildren()
.Censusible.censusMe(com.rubecula.darwin.domain.helper.Census,
java.lang.Object)
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
Object.clone()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
Object.equals(java.lang.Object)
public java.util.Set<java.lang.String> factorKeys()
factorKeys
in interface Environment
Environment.factorKeys()
public void fireEnvironmentChanged()
fireEnvironmentChanged
in interface Environment
Environment.fireEnvironmentChanged()
public java.util.Collection<? extends Censusible> getCensusibleChildren()
Censusible
getCensusibleChildren
in interface Censusible
ArrayList
of censusible objects.Censusible.getCensusibleChildren()
public int getCount()
getCount
in interface Countable
Countable.getCount()
public double getEcoFactorValue(java.lang.String name)
Environment
name
.
getEcoFactorValue
in interface Environment
name
- the name (identifier, key) of the eco factor.
Environment.getEcoFactorValue(java.lang.String)
public java.util.Collection<EcoFactor> getEcoSystem()
getEcoSystem
in interface Environment
Environment.getEcoSystem()
public EcoFactor getFactor(java.lang.String name)
Environment
name
.
getFactor
in interface Environment
name
- the name (identifier, key) of the eco factor.
Environment.getFactor(java.lang.String)
public long getIdealPopulation()
getIdealPopulation
in interface Environment
Environment.getIdealPopulation()
public java.lang.String getIdentifier()
getIdentifier
in interface net.sf.tostring0.Identifiable
Identifiable.getIdentifier()
public java.util.Collection<Individual> getIndividuals()
getIndividuals
in interface Visualizable
Visualizable
Visualizable.getIndividuals()
public java.util.Collection<EnvironmentListener> getListeners()
getListeners
in interface Environment
public Realm getRealm()
getRealm
in interface Visualizable
Visualizable.getRealm()
public java.lang.String getSignature()
getSignature
in interface CacheSignature
CacheSignature.getSignature()
public Sink getSink()
getSink
in interface Visualizable
Visualizable.getSink()
public int hashCode()
hashCode
in class java.lang.Object
Object.hashCode()
public void setEcoSystem(java.util.Collection<EcoFactor> ecoFactors)
setEcoSystem
in interface Environment
ecoFactors
- public void setIdealPopulation(long idealPopulation)
setIdealPopulation
in interface Environment
Environment.setIdealPopulation(long)
public void setListeners(java.util.Collection<EnvironmentListener> listeners)
setListeners
in interface Environment
listeners
- public void setSink(Sink sink)
sink
- public boolean update(java.lang.String factorKey, java.lang.Object factorValue)
fireEnvironmentChanged()
.
update
in interface Environment
factorKey
- factorValue
-
protected void environmentChanged()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |