Package pulse.util
Class UpwardsNavigable
- java.lang.Object
-
- pulse.util.UpwardsNavigable
-
- All Implemented Interfaces:
Serializable,Descriptive
- Direct Known Subclasses:
AbstractResult,Group,TaskManager
public abstract class UpwardsNavigable extends Object implements Descriptive, Serializable
An
UpwardsNavigableprovides a two-way connection with the otherDescribablein an asymmetric (upwards-oriented) manner (hence its name). TheUpwardsNavigablestores information about its parent, which stands higher in hierarchy than this object. Theparentis always informed if any changes happen with its child properties.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description UpwardsNavigable()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddHierarchyListener(HierarchyListener l)Stringdescribe()Uses the SearchTask id (if present) to describe this UpwardsNavigable.List<HierarchyListener>getHierarchyListeners()UpwardsNavigablegetParent()Return the parent of thisUpwardsNavigable-- if is has been previously explicitly set.Identifieridentify()Retrieves the Identifier of the SearchTaks this UpwardsNavigable belongs to.voidinitListeners()voidremoveHierarchyListener(HierarchyListener l)voidremoveHierarchyListeners()voidsetParent(UpwardsNavigable parent)Explicitly sets the parent of thisUpwardsNavigable.UpwardsNavigablespecificAncestor(Class<? extends UpwardsNavigable> aClass)Finds an ancestor that looks similar toaClassby recursively callinggetParent().voidtellParent(PropertyEvent e)Recursively informs the parent, the parent of its parent, etc.
-
-
-
Method Detail
-
initListeners
public void initListeners()
-
removeHierarchyListeners
public final void removeHierarchyListeners()
-
removeHierarchyListener
public final void removeHierarchyListener(HierarchyListener l)
-
addHierarchyListener
public final void addHierarchyListener(HierarchyListener l)
-
getHierarchyListeners
public final List<HierarchyListener> getHierarchyListeners()
-
tellParent
public void tellParent(PropertyEvent e)
Recursively informs the parent, the parent of its parent, etc. of thisUpwardsNavigablethat an action has been taken on its child's properties specified by {- Parameters:
e- the property event
-
getParent
public UpwardsNavigable getParent()
Return the parent of thisUpwardsNavigable-- if is has been previously explicitly set.- Returns:
- the parent (which is also an
UpwardsNavigable).
-
specificAncestor
public UpwardsNavigable specificAncestor(Class<? extends UpwardsNavigable> aClass)
Finds an ancestor that looks similar toaClassby recursively callinggetParent().- Parameters:
aClass- a class which should be similar to an ancestor of thisUpwardsNavigable- Returns:
- the ancestor, which is a parent, or grand-parent, or
grand-grand-parent, etc. of this
UpwardsNavigable.
-
setParent
public final void setParent(UpwardsNavigable parent)
Explicitly sets the parent of thisUpwardsNavigable.- Parameters:
parent- the new parent that will adopt thisUpwardsNavigable.
-
identify
public Identifier identify()
Retrieves the Identifier of the SearchTaks this UpwardsNavigable belongs to.- Returns:
- the identifier of the SearchTask
-
describe
public String describe()
Uses the SearchTask id (if present) to describe this UpwardsNavigable.- Specified by:
describein interfaceDescriptive- Returns:
- by default, this will return the name of the implementing class and the date of the calculation.
-
-