com.rubecula.darwin.domain.environment
Class Phenome_

java.lang.Object
  extended by net.sf.tostring0.AToString
      extended by com.rubecula.darwin.domain.environment.Phenome_
All Implemented Interfaces:
Phenome, net.sf.tostring0.IToString
Direct Known Subclasses:
Phenome_Gouldian, Phenome_Numerical

public abstract class Phenome_
extends net.sf.tostring0.AToString
implements Phenome

Abstract class defining base methods and fields for implementations of Phenome interface.

Author:
Robin Hillyard XXX consider extending StringHash instead.

Field Summary
protected static org.apache.commons.logging.Log LOG
          The logger for this class.
 
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 Phenome_(FitnessEngine fitnessFunction)
          This constructs a new (empty) Phenome belonging to a Taxon.
 
Method Summary
 int addCharacter(Pharacter character)
          Add a character to this phenome.
 boolean equals(java.lang.Object obj)
           
 Pharacter getCharacter(java.lang.String id)
          Get the character whose identifier matches id.
 java.util.Collection<java.lang.String> getCharacterKeys()
           
 java.util.Collection<Pharacter> getCharacters()
           
 java.lang.Object getData()
          XXX
 FitnessEngine getFitnessEngine()
          XXX
 int hashCode()
           
 void setCharacters(java.util.Collection<? extends Pharacter> characters)
          Set the phenotypic characters, usually by reflection/dependeny injection.
 void setData(java.lang.Object data)
          XXX
 int size()
           
 
Methods inherited from class net.sf.tostring0.AToString
toString, toString, toStringBrief, toStringId
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

LOG

protected static final org.apache.commons.logging.Log LOG
The logger for this class.

Constructor Detail

Phenome_

protected Phenome_(FitnessEngine fitnessFunction)
This constructs a new (empty) Phenome belonging to a Taxon.

Parameters:
fitnessFunction - the implementer of FitnessEngine which evaluates the fintness of a phenome for an environemnt.
Method Detail

addCharacter

public int addCharacter(Pharacter character)
Description copied from interface: Phenome
Add a character to this phenome.

Specified by:
addCharacter in interface Phenome
Returns:
the index of the new character.
See Also:
Phenome.addCharacter(com.rubecula.darwin.domain.helper.Pharacter)

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

getCharacter

public Pharacter getCharacter(java.lang.String id)
Get the character whose identifier matches id.

Specified by:
getCharacter in interface Phenome
Returns:
the character with given id, else null
See Also:
Phenome.getCharacter(java.lang.String)

getCharacterKeys

public java.util.Collection<java.lang.String> getCharacterKeys()
Specified by:
getCharacterKeys in interface Phenome
Returns:
the set of character keys for this Phenome

getCharacters

public java.util.Collection<Pharacter> getCharacters()
Specified by:
getCharacters in interface Phenome
Returns:
the characters

getData

public java.lang.Object getData()
XXX

Specified by:
getData in interface Phenome
Returns:
application-specific data.
See Also:
Phenome.getData()

getFitnessEngine

public FitnessEngine getFitnessEngine()
XXX

Specified by:
getFitnessEngine in interface Phenome
Returns:
an implementation of FitnessEngine.
See Also:
Phenome.getFitnessEngine()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

setCharacters

public void setCharacters(java.util.Collection<? extends Pharacter> characters)
Set the phenotypic characters, usually by reflection/dependeny injection.

Parameters:
characters -

setData

public void setData(java.lang.Object data)
XXX

Specified by:
setData in interface Phenome
Parameters:
data - application-specific data.
See Also:
Phenome.setData(java.lang.Object)

size

public int size()
Specified by:
size in interface Phenome
Returns:
the number of characters for this phenome.
See Also:
Phenome.size()


Copyright © 2010 Rubecula Software, LLC. All Rights Reserved.