pla.data
Class Category
java.lang.Object
pla.data.NamedThing
pla.data.Category
- All Implemented Interfaces:
- Comparable
public class Category
- extends NamedThing
- Author:
- linda
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 nameset - Set of initial children
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