com.rubecula.darwin.domain.genetics
Class Nuclear_

java.lang.Object
  extended by net.sf.tostring0.AToString
      extended by com.rubecula.darwin.domain.genetics.Nuclear_
All Implemented Interfaces:
Censusible, Genetic, Nuclear, java.lang.Cloneable, net.sf.tostring0.IToString
Direct Known Subclasses:
Nuclear_Clone, Nuclear_Zygote

public abstract class Nuclear_
extends net.sf.tostring0.AToString
implements Nuclear, java.lang.Cloneable

TODO need a better name for this Nuclear concept. We are trying to represent something which can reproduce either asexually (e.g. bacteria), or sexually (e.g. animals).

Author:
Robin Hillyard

Field Summary
 
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 Nuclear_(Genome genome, java.lang.String populationTag)
          Protected Primary Constructor
 
Method Summary
 boolean censusMe(Census census, java.lang.Object context)
          Method to census this object.
 java.lang.Object clone()
           
 boolean equals(java.lang.Object obj)
           
 java.util.Collection<? extends Censusible> getCensusibleChildren()
          Method to return a list of censusible children of this object.
 java.lang.String getColonyId()
          XXX
 Genome getGenome()
          XXX
 int hashCode()
           
 void setColonyId(java.lang.String id)
          XXX consider eliminating this.
 
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
 

Constructor Detail

Nuclear_

protected Nuclear_(Genome genome,
                   java.lang.String populationTag)
Protected Primary Constructor

Parameters:
genome -
populationTag -
Method Detail

censusMe

public boolean censusMe(Census census,
                        java.lang.Object context)
Description copied from interface: Censusible
Method to census this object.

Specified by:
censusMe in interface Censusible
Parameters:
census - the census object which will present the results of taking this census
context - an arbitrary object which can be used by the census object to provide appropriate context for this object.
Returns:
true if we should continue censusing this object at deeper levels. If the result is false, then we do not call Censusible.getCensusibleChildren().
See Also:
Censusible.censusMe(com.rubecula.darwin.domain.helper.Census, java.lang.Object)

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException
See Also:
Object.clone()

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
Returns:
true if colonyId and genome are equal.
See Also:
Object.equals(java.lang.Object)

getCensusibleChildren

public java.util.Collection<? extends Censusible> getCensusibleChildren()
Description copied from interface: Censusible
Method to return a list of censusible children of this object.

Specified by:
getCensusibleChildren in interface Censusible
Returns:
either null or an ArrayList of censusible objects.
See Also:
Censusible.getCensusibleChildren()

getColonyId

public java.lang.String getColonyId()
XXX

Specified by:
getColonyId in interface Nuclear
Returns:
the colony id for this object
See Also:
Nuclear.getColonyId()

getGenome

public Genome getGenome()
XXX

Specified by:
getGenome in interface Genetic
Returns:
the genome for this genetic object.
See Also:
Genetic.getGenome()

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
Returns:
combination of hash codes for colonyId and genome.
See Also:
Object.hashCode()

setColonyId

public void setColonyId(java.lang.String id)
XXX consider eliminating this. Is there ever a time when we need to change the colonyId of a Nuclear object? I don't think so.

Specified by:
setColonyId in interface Nuclear
Parameters:
id - the new id
See Also:
Nuclear.setColonyId(java.lang.String)


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