sk.uniba.euromath.document.schema.impl.iterator
Class ContentInfo

java.lang.Object
  extended by sk.uniba.euromath.document.schema.impl.iterator.ContentInfo

public class ContentInfo
extends Object

Represents item returned by the InsertPointIterator. This class is immutable however extending classes may be mutable.

Author:
Martin Vysny

Field Summary
 sk.baka.ikslibs.ptr.DomPointer ptr
          DOM pointer, pointing to context node.
 sk.baka.ikslibs.ptr.DomPointer ptrInsert
          Points to point, where node is insertable.
 int type
          Type of node, that follows the insertpoint.
static int TYPE_CHARDATA
          Node, following the insertpoint, is CharacterData.
static int TYPE_ELEMENT
          Node, following the insertpoint, is Element.
static int TYPE_NONE
          Following node is not valid/none.
 
Constructor Summary
ContentInfo(sk.baka.ikslibs.ptr.DomPointer ptr, String value, Element e)
          Constructs instance of InsertPointInfo.
 
Method Summary
static ContentInfo create(sk.baka.ikslibs.ptr.DomPointer ptr, Node node)
          Creates instance of the object.
 boolean equals(Object obj)
           
 Element getElement()
          Returns element represented by this object.
 String getValue()
          Returns string value of active node.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TYPE_ELEMENT

public static final int TYPE_ELEMENT
Node, following the insertpoint, is Element.

See Also:
Constant Field Values

TYPE_CHARDATA

public static final int TYPE_CHARDATA
Node, following the insertpoint, is CharacterData.

See Also:
Constant Field Values

TYPE_NONE

public static final int TYPE_NONE
Following node is not valid/none.

See Also:
Constant Field Values

ptr

public final sk.baka.ikslibs.ptr.DomPointer ptr
DOM pointer, pointing to context node.


ptrInsert

public final sk.baka.ikslibs.ptr.DomPointer ptrInsert
Points to point, where node is insertable. It points always before the context node. When not in entity reference, it is always same as the ptr property. When the context node is first node in the entity reference, then this pointer will point to this reference node. Otherwise, no node is insertable before the context node and this pointer is null.


type

public final int type
Type of node, that follows the insertpoint. One from TYPE_* constants. When TYPE_NONE, then there is no node, that follows this insertpoint (insertpoint is after last node).

Constructor Detail

ContentInfo

public ContentInfo(sk.baka.ikslibs.ptr.DomPointer ptr,
                   String value,
                   Element e)
Constructs instance of InsertPointInfo.

Parameters:
ptr - new pointer.
value - if this object will represent TYPE_CHARDATA, then it must specify non-null value. Otherwise, it must be null.
e - if this object will represent TYPE_ELEMENT, then it must hold non-null reference to element. Otherwise, it must be null.
Method Detail

getValue

public String getValue()
Returns string value of active node. Function fails if node type is not TYPE_CHARDATA.

Returns:
text value of CharacterData node.
Throws:
IllegalStateException - when function fails.

getElement

public Element getElement()
Returns element represented by this object. Function fails if object is not representing element (the TYPE_ELEMENT type).

Returns:
element.
Throws:
IllegalStateException - when function fails.

toString

public String toString()
Overrides:
toString in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

create

public static ContentInfo create(sk.baka.ikslibs.ptr.DomPointer ptr,
                                 Node node)
Creates instance of the object.

Parameters:
ptr - the pointer.
node - the node. If null then TYPE_NONE object is constructed.
Returns:
the instance.


Copyright © 2003-2006 null. All Rights Reserved.