sk.uniba.euromath.document.schema.impl.modify
Class EnclosingIterator

java.lang.Object
  extended by sk.uniba.euromath.document.schema.impl.iterator.SchemaLevelNodeIterator
      extended by sk.uniba.euromath.document.schema.impl.modify.EnclosingIterator
All Implemented Interfaces:
Iterable<ContentInfo>, Iterator<ContentInfo>, ListIterator<ContentInfo>

final class EnclosingIterator
extends SchemaLevelNodeIterator

Iterates the content of start.parent element. All nodes in start-end range are removed - they are placed in enclosing element instead.

Author:
Martin Vysny

Field Summary
(package private)  EnclosableElementContentInfo enclosable
          the enclosable element
(package private)  List<ContentInfo> filteredContent
          This list was filtered out by our filter.
 
Fields inherited from class sk.uniba.euromath.document.schema.impl.iterator.SchemaLevelNodeIterator
act, items, lastEmptyItem, parent
 
Constructor Summary
EnclosingIterator(Collection<ContentInfo> contentInfos, List<ContentInfo> filteredContent, EnclosableElementContentInfo enclosable, Node parent)
          Constructs the instance.
 
Method Summary
 SchemaLevelNodeIterator getChildIterator(Element e)
          Returns a child iterator for given element.
 SchemaLevelNodeIterator getClone()
          Clones the iterator.
 
Methods inherited from class sk.uniba.euromath.document.schema.impl.iterator.SchemaLevelNodeIterator
add, getActIP, getEquivalent, hasNext, hasPrevious, iterator, next, nextIndex, previous, previousIndex, remove, set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

filteredContent

final List<ContentInfo> filteredContent
This list was filtered out by our filter. If we are asked to return iterator over children of enclosing then just return iterator iterating over this sequence.


enclosable

final EnclosableElementContentInfo enclosable
the enclosable element

Constructor Detail

EnclosingIterator

EnclosingIterator(Collection<ContentInfo> contentInfos,
                  List<ContentInfo> filteredContent,
                  EnclosableElementContentInfo enclosable,
                  Node parent)
Constructs the instance.

Parameters:
contentInfos - the XML content
filteredContent - content being filtered out (placed in the 'enclosable' element)
enclosable - the enclosable element
parent - parent of the enclosable element.
Method Detail

getChildIterator

public SchemaLevelNodeIterator getChildIterator(Element e)
Description copied from class: SchemaLevelNodeIterator
Returns a child iterator for given element. The element must be amongst contentinfos returned by this iterator. Default implementation inherits the filter and the 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.

Overrides:
getChildIterator in class SchemaLevelNodeIterator
Parameters:
e - the element whose children shall be enumerated.
Returns:
iterator that iterates the children of given element. It points before the first node of the element children.

getClone

public SchemaLevelNodeIterator getClone()
Description copied from class: SchemaLevelNodeIterator
Clones the iterator. The clone behaves independently from the original iterator.

Overrides:
getClone in class SchemaLevelNodeIterator
Returns:
the clone.


Copyright 2003-2003-2006 null. All Rights Reserved.