com.rubecula.darwin.core
Class Allele_Abstract

java.lang.Object
  extended by com.rubecula.util.AuditableObject
      extended by com.rubecula.darwin.core.Attribute_Abstract
          extended by com.rubecula.darwin.core.Allele_Abstract
All Implemented Interfaces:
Allele, Attribute, Auditable, Identifiable, Cloneable
Direct Known Subclasses:
Allele_Default, Allele_Key_Resetter, Allele_PepperedMoth, Allele_TS

public abstract class Allele_Abstract
extends Attribute_Abstract
implements Allele

This abstract provides base operations for implementations of Allele, which are specific genes which may appear at a Locus.
It extends Attribute by defining that the identifier is a long integer key which is assigned sequentially.

Version:
$Revision: 1.2 $
Author:
Robin Hillyard

Constructor Summary
protected Allele_Abstract(Object value)
          Constructor of an Allele_Abstract based on a specific value.
protected Allele_Abstract(Object key, Object value)
          Primary Private constructor of an Allele_Abstract based on a specific value.
 
Method Summary
 boolean equals(Object obj)
           
 long getKey()
          Method to yield the value of this Allele's key.
 int hashCode()
           
protected static void resetKey()
          Reset the value of nextKey to zero.
 String toString()
          Method to yield this object as a String.
 
Methods inherited from class com.rubecula.darwin.core.Attribute_Abstract
audit, getAttribute, getIdentifier, getValue, setValue
 
Methods inherited from class com.rubecula.util.AuditableObject
audit, audit, audit, clone
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.rubecula.darwin.core.Attribute
getAttribute, getValue, setValue
 

Constructor Detail

Allele_Abstract

protected Allele_Abstract(Object value)
Constructor of an Allele_Abstract based on a specific value. The key will be the value of the field nextKey as a Long (nextKey will be incremented).

Parameters:
value - the value for the new Allele_Abstract, as an Object.

Allele_Abstract

protected Allele_Abstract(Object key,
                          Object value)
Primary Private constructor of an Allele_Abstract based on a specific value.

Parameters:
key - the key for the new Allele_Abstract, as an Object.
value - the value for the new Allele_Abstract, as an Object.
Method Detail

resetKey

protected static void resetKey()
Reset the value of nextKey to zero.


getKey

public long getKey()
Description copied from interface: Allele
Method to yield the value of this Allele's key.

Specified by:
getKey in interface Allele
Returns:
the key as a long.

toString

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

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

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object