PathwayLogic Assistant API

pla.data
Class NamedThing

java.lang.Object
  extended by pla.data.NamedThing
All Implemented Interfaces:
Comparable
Direct Known Subclasses:
Category, NodeThing, Setting

public abstract class NamedThing
extends Object
implements Comparable

Abstract class to define things that are distinguished uniquely by their name. The name is set at construction time and is used for testing of equality. The name must be non-null and not empty (after trimming white-space), otherwise runtime exceptions are thrown.

The named things are case-insensitive with respect to equality and ordering.

Author:
linda

Constructor Summary
NamedThing(String name)
          Construct a named thing.
 
Method Summary
 int compareTo(Object o)
           
 boolean equals(Object o)
           
 String getName()
           
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

NamedThing

public NamedThing(String name)
Construct a named thing. The given name must be non-null and non-empty (after trimming), otherwise constructor throws a RuntimeException.

Parameters:
name - String containing name
Method Detail

getName

public String getName()

compareTo

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

toString

public String toString()
Overrides:
toString in class Object

equals

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

hashCode

public int hashCode()
Overrides:
hashCode in class Object

PathwayLogic Assistant API