PathwayLogic Assistant API

pla.data
Class Category

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

public class Category
extends NamedThing

Author:
linda

Constructor Summary
Category(String name)
          Construct a Category.
Category(String name, Set set)
          Construct a Category.
 
Method Summary
 void addChild(Occurrence o)
           
 Category cloneWithGivenOccs(Map occs)
          Produce a clone of this category that has the same name and the same children.
 boolean equals(Object o)
           
 Set getChildren()
           
 void removeChild(Occurrence o)
           
 
Methods inherited from class pla.data.NamedThing
compareTo, getName, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Category

public Category(String name)
Construct a Category. The given name must be non-null and non-empty (after trimming), otherwise constructor throws a RuntimeException. Initialize empty list of children.

Parameters:
name - String containing name

Category

public Category(String name,
                Set set)
Construct a Category. The given name must be non-null and non-empty (after trimming), otherwise constructor throws a RuntimeException. Initialize children with given set.

Parameters:
name - String containing name
set - Set of initial children
Method Detail

addChild

public void addChild(Occurrence o)

removeChild

public void removeChild(Occurrence o)

getChildren

public Set getChildren()

cloneWithGivenOccs

public Category cloneWithGivenOccs(Map occs)
Produce a clone of this category that has the same name and the same children. Draws the children from the given map of Occurrences (keyed by their ID) in order to ensure different clones pointing to the same Occurrence object.

Parameters:
occs - Map of Occurrences by ID to draw from for the set of children of the clone
Returns:
Category with the same name and the same children

equals

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

PathwayLogic Assistant API