com.rubecula.darwin.domain.environment
Class EcoFactor_

java.lang.Object
  extended by net.sf.tostring0.AToString
      extended by com.rubecula.darwin.domain.helper.Attribute_
          extended by com.rubecula.darwin.domain.environment.EcoFactor_
All Implemented Interfaces:
Attribute, Censusible, EcoFactor, Individual, java.lang.Cloneable, net.sf.tostring0.Identifiable, net.sf.tostring0.IToString
Direct Known Subclasses:
EcoFactor_Number, EcoFactor_TS

public abstract class EcoFactor_
extends Attribute_
implements EcoFactor, java.lang.Cloneable

Abstract class providing base functionality for implementers of EcoFactor.

Author:
Robin Hillyard

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 EcoFactor_(java.lang.Object identifier, java.lang.Object value)
          Protected constructor.
 
Method Summary
 boolean censusMe(Census census, java.lang.Object context)
          Method to census this object.
 java.lang.Object clone()
          Note that if an EcoFactor's value (or identifier) is mutable, i.e.
 java.util.Collection<? extends Censusible> getCensusibleChildren()
          Method to return a list of censusible children of this object.
 Environment getEnvironment()
           
 Visualizable getVisualizable()
           
 void setEnvironment(Environment environment)
           
 java.lang.String toString(boolean showDetail, boolean showClass, boolean showIdentifier, boolean includeParent, boolean includeChildren, java.lang.String prefix, boolean recurse, int maxElements, int maxChars)
           
 
Methods inherited from class com.rubecula.darwin.domain.helper.Attribute_
equals, getAttribute, getIdentifier, getValue, hashCode, setValue
 
Methods inherited from class net.sf.tostring0.AToString
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.EcoFactor
update
 
Methods inherited from interface com.rubecula.darwin.domain.helper.Attribute
getAttribute, getValue, setValue
 
Methods inherited from interface com.rubecula.darwin.foundation.Individual
isNew, isVisible
 
Methods inherited from interface net.sf.tostring0.Identifiable
getIdentifier
 

Field Detail

LOG

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

Constructor Detail

EcoFactor_

protected EcoFactor_(java.lang.Object identifier,
                     java.lang.Object value)
Protected constructor.

Parameters:
identifier -
value -
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
Note that if an EcoFactor's value (or identifier) is mutable, i.e. is not a primitive (or String) and is dynamically changeable, it probably needs deep-copying. Therefore sub-classes should probably override this method.

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

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()

getEnvironment

public Environment getEnvironment()
Specified by:
getEnvironment in interface EcoFactor
Returns:
the environment to which this factor belongs.
See Also:
EcoFactor.getEnvironment()

getVisualizable

public Visualizable getVisualizable()
Specified by:
getVisualizable in interface Individual
Returns:
the Visualizable object of which this Individual is a member.
See Also:
Individual.getVisualizable()

setEnvironment

public void setEnvironment(Environment environment)
Specified by:
setEnvironment in interface EcoFactor
See Also:
EcoFactor.setEnvironment(com.rubecula.darwin.domain.helper.Environment)

toString

public java.lang.String toString(boolean showDetail,
                                 boolean showClass,
                                 boolean showIdentifier,
                                 boolean includeParent,
                                 boolean includeChildren,
                                 java.lang.String prefix,
                                 boolean recurse,
                                 int maxElements,
                                 int maxChars)
Specified by:
toString in interface net.sf.tostring0.IToString
Overrides:
toString in class Attribute_
See Also:
Attribute_.toString(boolean, boolean, boolean, boolean, boolean, java.lang.String, boolean, int, int)


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