Package uk.ac.starlink.ttools.votlint
Interface Ancestry
-
public interface AncestryDefines the family relationships of an ElementHandler.- Since:
- 7 Apr 2005
- Author:
- Mark Taylor (Starlink)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <H extends ElementHandler>
HgetAncestor(java.lang.Class<H> clazz)Returns the handler's nearest ancestor (excluding itself) of a given class.intgetChildCount()Returns the number of child elements this handler currently has.ElementHandlergetParent()Returns the handler's parent.ElementHandlergetSelf()Returns the handler itself.intgetSiblingIndex()Returns the index of this child in the list of its parent's children.
-
-
-
Method Detail
-
getSelf
ElementHandler getSelf()
Returns the handler itself.- Returns:
- self
-
getParent
ElementHandler getParent()
Returns the handler's parent.- Returns:
- parent
-
getAncestor
<H extends ElementHandler> H getAncestor(java.lang.Class<H> clazz)
Returns the handler's nearest ancestor (excluding itself) of a given class. clazz must be ElementHandler or a subclass. If there is no handler in the ancestry of type clazz, null is returned.- Parameters:
clazz- class required- Returns:
- handler's ancestor of type clazz
-
getSiblingIndex
int getSiblingIndex()
Returns the index of this child in the list of its parent's children. The first child of a parent has index 0.- Returns:
- sibling index
-
getChildCount
int getChildCount()
Returns the number of child elements this handler currently has.- Returns:
- child count
-
-