# Interface Ancestry

public interface Ancestry
Defines the family relationships of an ElementHandler.

Since:
  7 Apr 2005
Author:
  Mark Taylor (Starlink)

## Method Summary

Modifier and Type
Method
Description
`<H extends ElementHandler>
H`
`getAncestor(Class<H> clazz)`
Returns the handler's nearest ancestor (excluding itself) of a given class.
`int`
`getChildCount()`
Returns the number of child elements this handler currently has.
`ElementHandler`
`getParent()`
Returns the handler's parent.
`ElementHandler`
`getSelf()`
Returns the handler itself.
`int`
`getSiblingIndex()`
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

<H extends ElementHandler> H getAncestor(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