com.rubecula.darwin.core
Class Attribute_Abstract

java.lang.Object
  extended by com.rubecula.util.AuditableObject
      extended by com.rubecula.darwin.core.Attribute_Abstract
All Implemented Interfaces:
Attribute, Auditable, Identifiable, Cloneable
Direct Known Subclasses:
Allele_Abstract, EcoFactor_Abstract, Trait_Abstract

public abstract class Attribute_Abstract
extends AuditableObject
implements Attribute

Abstract class representing a named attribute, and is the base class for Trait_Abstract, Allele_Abstract and EcoFactor_Abstract.
An attribute has two properties: identifier and value.

Author:
Robin Hillyard

Constructor Summary
protected Attribute_Abstract(Object identifier, Object value)
           
 
Method Summary
 String audit(String label)
          Method to yield this object as a String.
 Object getAttribute()
           
 String getIdentifier()
          Method to get the specific identifier for an object.
 Object getValue()
          Method to return the value for this attribute.
 void setValue(Object value)
          Mutating method to set the value of this attribute.
 String toString()
          Method to yield this object as a String.
 
Methods inherited from class com.rubecula.util.AuditableObject
audit, audit, audit, clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Attribute_Abstract

protected Attribute_Abstract(Object identifier,
                             Object value)
Parameters:
identifier -
value -
Method Detail

audit

public String audit(String label)
Method to yield this object as a String. Should be overridden by extenders of this class.

Specified by:
audit in interface Auditable
Parameters:
label - the label to associate with the data. If label is non-null, a more detailed audit will be returned (this normally occurs only at the top level).
Returns:
canonical class name + " " + getIdentifier() + ": " + value.toString()
See Also:
Object.toString()

getAttribute

public Object getAttribute()
Specified by:
getAttribute in interface Attribute
Returns:
the value of (private field) _Identifier

getIdentifier

public String getIdentifier()
Description copied from interface: Identifiable
Method to get the specific identifier for an object.

Specified by:
getIdentifier in interface Identifiable
Returns:
the identifier.

getValue

public Object getValue()
Description copied from interface: Attribute
Method to return the value for this attribute.

Specified by:
getValue in interface Attribute
Returns:
value of (private field) _Value as an Object.

setValue

public void setValue(Object value)
Description copied from interface: Attribute
Mutating method to set the value of this attribute.

Specified by:
setValue in interface Attribute
Parameters:
value - the new value for the attribute.

toString

public String toString()
Method to yield this object as a String. Should be overridden by extenders of this class.

Overrides:
toString in class Object
Returns:
canonical class name + " " + getIdentifier() + ": " + value.toString()
See Also:
Object.toString()