Package uk.ac.starlink.ttools.votlint
Interface Ancestry
public interface Ancestry
Defines the family relationships of an ElementHandler.
- Since:
- 7 Apr 2005
- Author:
- Mark Taylor (Starlink)
-
Method Summary
Modifier and TypeMethodDescription<H extends ElementHandler>
HgetAncestor
(Class<H> clazz) Returns the handler's nearest ancestor (excluding itself) of a given class.int
Returns the number of child elements this handler currently has.Returns the handler's parent.getSelf()
Returns the handler itself.int
Returns the index of this child in the list of its parent's children.
-
Method Details
-
getSelf
ElementHandler getSelf()Returns the handler itself.- Returns:
- self
-
getParent
ElementHandler getParent()Returns the handler's parent.- Returns:
- parent
-
getAncestor
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
-