dsto.dfc.util
Class NamedObject

java.lang.Object
  extended by dsto.dfc.util.AbstractNamedObject
      extended by dsto.dfc.util.NamedObject
All Implemented Interfaces:
Serializable, Comparable

public class NamedObject
extends AbstractNamedObject
implements Comparable, Serializable

Base class for objects with a name that (at least partially) defines their identity. Provides toString (), equals (), hashCode (), compareTo () plus a name property.

Version:
$Revision$
Author:
Matthew Phillips
See Also:
Serialized Form

Field Summary
protected  String name
           
 
Constructor Summary
NamedObject(String name)
           
 
Method Summary
 int compareTo(Object o)
           
 boolean equals(Object o)
           
 String getName()
           
 int hashCode()
           
 void setName(String newName)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

name

protected String name
Constructor Detail

NamedObject

public NamedObject(String name)
Method Detail

getName

public String getName()
Specified by:
getName in class AbstractNamedObject

setName

public void setName(String newName)

hashCode

public int hashCode()
Overrides:
hashCode in class AbstractNamedObject

toString

public String toString()
Overrides:
toString in class AbstractNamedObject

equals

public boolean equals(Object o)
Overrides:
equals in class AbstractNamedObject

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable
Overrides:
compareTo in class AbstractNamedObject


Copyright © 2008 Commonwealth of Australia