|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object sk.uniba.euromath.document.schema.impl.iterator.SchemaLevelNodeIterator
public class SchemaLevelNodeIterator
Iterator over insert point infos (instances of ContentInfo
class). Insert point is a point between two adjacent nodes, where a new
element/elements can be inserted. Does not support modification operations.
Only Text
(CDATASection
) and
Element
are generating element's content. Thus, only
InsertPoint
s pointing to such nodes are returned. Returned
string may span over multiple Text
and/or
CDATASection
nodes. That is because text value is a string
between two adjacent elements.
Every returned insertpoint must point to a validable node, or it can have
value of [nodes.getLength(), 0]
.
Warning: given NodeList
must NOT be changed during process of
iteration.
Field Summary | |
---|---|
protected int |
act
Iterator is now standing before this item - this insertpoint will be returned by the next() call. |
protected List<ContentInfo> |
items
Contains set of ContentInfo s, computed from given
nodeset. |
boolean |
lastEmptyItem
If true then last item is a pointer that points after the last node. |
Node |
parent
The parent of the children over which the iteration occurs. |
Constructor Summary | |
---|---|
protected |
SchemaLevelNodeIterator(Collection<ContentInfo> contentInfos,
Node parent)
Constructs an iterator from given collection of ContentInfo
objects. |
Method Summary | |
---|---|
void |
add(ContentInfo o)
|
protected int |
getActIP()
Returns actual index to items array, that will be returned by next call to next() . |
SchemaLevelNodeIterator |
getChildIterator(Element e)
Returns a child iterator for given element. |
SchemaLevelNodeIterator |
getClone()
Clones the iterator. |
sk.baka.ikslibs.ptr.DomPointer |
getEquivalent(sk.baka.ikslibs.ptr.DomPointer ptr)
Returns an DOMPointer that is equal to some pointer in the list, and inserting an element/text at given ip is equivalent to inserting the node at returned pointer. |
boolean |
hasNext()
|
boolean |
hasPrevious()
|
Iterator<ContentInfo> |
iterator()
|
ContentInfo |
next()
|
int |
nextIndex()
|
ContentInfo |
previous()
|
int |
previousIndex()
|
void |
remove()
|
void |
set(ContentInfo o)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final List<ContentInfo> items
ContentInfo
s, computed from given
nodeset. When text spans over multiple text/cdata nodes, then pointer
points to first such node.
public final boolean lastEmptyItem
protected int act
next()
call.
public final Node parent
Constructor Detail |
---|
protected SchemaLevelNodeIterator(Collection<ContentInfo> contentInfos, Node parent)
ContentInfo
objects. They must be ordered in ascending order by the ptr
part. There shall be no force insertpoints, the filter shall accept
anything and lastEmptyItem
is determined from the last
item in the collection.
contentInfos
- collection of ContentInfo
ordered by
the ptr part.parent
- the parent node
IllegalArgumentException
- if given collection is not ordered
correctly.Method Detail |
---|
public final void add(ContentInfo o)
add
in interface ListIterator<ContentInfo>
public final boolean hasNext()
hasNext
in interface Iterator<ContentInfo>
hasNext
in interface ListIterator<ContentInfo>
public final boolean hasPrevious()
hasPrevious
in interface ListIterator<ContentInfo>
public final ContentInfo next()
next
in interface Iterator<ContentInfo>
next
in interface ListIterator<ContentInfo>
public final int nextIndex()
nextIndex
in interface ListIterator<ContentInfo>
public final ContentInfo previous()
previous
in interface ListIterator<ContentInfo>
public final int previousIndex()
previousIndex
in interface ListIterator<ContentInfo>
public final void remove()
remove
in interface Iterator<ContentInfo>
remove
in interface ListIterator<ContentInfo>
public final void set(ContentInfo o)
set
in interface ListIterator<ContentInfo>
protected final int getActIP()
next()
.
public final sk.baka.ikslibs.ptr.DomPointer getEquivalent(sk.baka.ikslibs.ptr.DomPointer ptr)
ptr
- pointer to check.
ContentInfo
of type NONE. In
such case, given pointer is returned.public SchemaLevelNodeIterator getChildIterator(Element e)
lastEmptyItem
value, however forceIPs
are not given to the child. The algorithm iterating with this iterator
should use this method when entering child elements. You should override
getClone()
method when overriding this method to ensure
the correct class type.
e
- the element whose children shall be enumerated.
public SchemaLevelNodeIterator getClone()
public Iterator<ContentInfo> iterator()
iterator
in interface Iterable<ContentInfo>
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |