org.apache.jackrabbit.util
Class IteratorHelper

java.lang.Object
  extended byorg.apache.jackrabbit.util.IteratorHelper
All Implemented Interfaces:
Iterator, NodeIterator, NodeTypeIterator, PropertyIterator, RangeIterator

public class IteratorHelper
extends Object
implements NodeIterator, PropertyIterator, NodeTypeIterator

IteratorHelper is a utility class which wraps an iterator and implements the various typed iterator interfaces.


Field Summary
static IteratorHelper EMPTY
           
 
Constructor Summary
IteratorHelper(Collection c)
          Constructs an IteratorHelper which is backed by a java.util.Collection.
IteratorHelper(Iterator iter)
          Constructs an IteratorHelper which is wrapping a java.util.Iterator.
 
Method Summary
 long getPosition()
          
 long getSize()
          
 boolean hasNext()
          
 Object next()
          
 Node nextNode()
          
 NodeType nextNodeType()
          
 Property nextProperty()
          
 void remove()
          
 void skip(long skipNum)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EMPTY

public static final IteratorHelper EMPTY
Constructor Detail

IteratorHelper

public IteratorHelper(Collection c)
Constructs an IteratorHelper which is backed by a java.util.Collection.

Parameters:
c - collection which should be iterated over.

IteratorHelper

public IteratorHelper(Iterator iter)
Constructs an IteratorHelper which is wrapping a java.util.Iterator.

Parameters:
iter - iterator which should be wrapped.
Method Detail

skip

public void skip(long skipNum)

Specified by:
skip in interface RangeIterator

getSize

public long getSize()

Specified by:
getSize in interface RangeIterator

getPosition

public long getPosition()

Specified by:
getPosition in interface RangeIterator

hasNext

public boolean hasNext()

Specified by:
hasNext in interface Iterator

next

public Object next()

Specified by:
next in interface Iterator

remove

public void remove()

Specified by:
remove in interface Iterator

nextNode

public Node nextNode()

Specified by:
nextNode in interface NodeIterator

nextProperty

public Property nextProperty()

Specified by:
nextProperty in interface PropertyIterator

nextNodeType

public NodeType nextNodeType()

Specified by:
nextNodeType in interface NodeTypeIterator


Copyright © 2004-2006 The Apache Software Foundation. All Rights Reserved.