PathwayLogic Assistant API

pla.data
Class Rule

java.lang.Object
  extended by pla.data.NamedThing
      extended by pla.data.NodeThing
          extended by pla.data.Rule
All Implemented Interfaces:
Comparable

public class Rule
extends NodeThing

Encapsulating a rule.

Rule objects are ordered in a special way. If the two comparing names do not both start with Integers, simply use case insensitive String ordering. Otherwise, it orders the Strings according to the numerical order of the Integers at the beginning, e.g., "4" comes before "10".

Author:
linda

Constructor Summary
Rule(Rule r)
          Construct a Rule as a clone of a given one.
Rule(String name, int ID)
          Construct a Rule.
Rule(String name, int ID, String longName)
          Construct a Rule with an associated long name.
 
Method Summary
 int compareTo(Object o)
           
 boolean equals(Object o)
           
 
Methods inherited from class pla.data.NodeThing
getID, getLongName, hashCode, isSelected, isShowLongName, setSelected, setShowLongName, toString
 
Methods inherited from class pla.data.NamedThing
getName
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Rule

public Rule(String name,
            int ID)
Construct a Rule. The given name must be non-null and non-empty (after trimming), otherwise constructor throws a RuntimeException. Uses the name also as the long name since it cannot be null.

Parameters:
name - String containing name
ID - numerical ID (used for identification)

Rule

public Rule(String name,
            int ID,
            String longName)
Construct a Rule with an associated long name. The given name must be non-nulland non-empty (after trimming), otherwise constructor throws a RuntimeException.

Parameters:
name - String containing name
ID - numerical ID (used for identification)
longName - String containing a long name

Rule

public Rule(Rule r)
Construct a Rule as a clone of a given one.

Parameters:
r - Rule to be cloned
Method Detail

compareTo

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

equals

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

PathwayLogic Assistant API