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
UpwardsNavigable
provides a two-way connection with the otherDescribable
in an asymmetric (upwards-oriented) manner (hence its name). TheUpwardsNavigable
stores information about its parent, which stands higher in hierarchy than this object. Theparent
is 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 void
addHierarchyListener(HierarchyListener l)
String
describe()
Uses the SearchTask id (if present) to describe this UpwardsNavigable.List<HierarchyListener>
getHierarchyListeners()
UpwardsNavigable
getParent()
Return the parent of thisUpwardsNavigable
-- if is has been previously explicitly set.Identifier
identify()
Retrieves the Identifier of the SearchTaks this UpwardsNavigable belongs to.void
initListeners()
void
removeHierarchyListener(HierarchyListener l)
void
removeHierarchyListeners()
void
setParent(UpwardsNavigable parent)
Explicitly sets the parent of thisUpwardsNavigable
.UpwardsNavigable
specificAncestor(Class<? extends UpwardsNavigable> aClass)
Finds an ancestor that looks similar toaClass
by recursively callinggetParent()
.void
tellParent(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 thisUpwardsNavigable
that 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 toaClass
by 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:
describe
in interfaceDescriptive
- Returns:
- by default, this will return the name of the implementing class and the date of the calculation.
-
-