de.fu_berlin.ties.context
Class ElementPosition

java.lang.Object
  extended by de.fu_berlin.ties.context.ElementPosition

public class ElementPosition
extends Object

A small immutable wrapper class that bundles the position of an element within a parent element and the number of children of the parent.

Version:
$Revision: 1.1 $, $Date: 2004/02/02 18:35:58 $, $Author: siefkes $
Author:
Christian Siefkes

Constructor Summary
ElementPosition(int allChildElements, int overallPos, int typedChildElements, int typedPos, int processedPrecedingSiblings, int processedFollowingSiblings)
          Creates a new instance.
 
Method Summary
 int getAllChildren()
          Returns the number of all children elements in the parent element.
 int getOverallPosition()
          Returns the position of the represented element in the parent element, counting all children.
 int getProcessedFollowing()
          Returns the number of preceding siblings that were processed by the context representation.
 int getProcessedPreceding()
          Returns the number of following siblings that were processed by the context representation.
 int getTypedChildren()
          Returns the number of children elements in the parent element with the type (qualified name) of the represented element.
 int getTypedPosition()
          Returns the position of the represented element in the parent element, counting only children with the same type (qualified name).
 String toString()
          Returns a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ElementPosition

public ElementPosition(int allChildElements,
                       int overallPos,
                       int typedChildElements,
                       int typedPos,
                       int processedPrecedingSiblings,
                       int processedFollowingSiblings)
Creates a new instance.

Parameters:
allChildElements - the number of all children elements in the parent element
overallPos - the position of the represented element in the parent element, counting all children
typedChildElements - the number of children elements in the parent element with the type (qualified name) of the represented element
typedPos - the position of the represented element in the parent element, counting only children with the same type (qualified name)
processedPrecedingSiblings - the number of following siblings that were processed by the context representation
processedFollowingSiblings - the number of preceding siblings that were processed by the context representation
Method Detail

getAllChildren

public int getAllChildren()
Returns the number of all children elements in the parent element.

Returns:
the number

getOverallPosition

public int getOverallPosition()
Returns the position of the represented element in the parent element, counting all children.

Returns:
the position

getProcessedFollowing

public int getProcessedFollowing()
Returns the number of preceding siblings that were processed by the context representation.

Returns:
the number

getProcessedPreceding

public int getProcessedPreceding()
Returns the number of following siblings that were processed by the context representation.

Returns:
the number

getTypedChildren

public int getTypedChildren()
Returns the number of children elements in the parent element with the type (qualified name) of the represented element.

Returns:
the number

getTypedPosition

public int getTypedPosition()
Returns the position of the represented element in the parent element, counting only children with the same type (qualified name).

Returns:
the position

toString

public String toString()
Returns a string representation of this object.

Overrides:
toString in class Object
Returns:
a textual representation


Copyright © 2003-2004 Christian Siefkes. All Rights Reserved.