org.apache.jackrabbit.commons.iterator
Class RangeIteratorDecorator

java.lang.Object
  extended by org.apache.jackrabbit.commons.iterator.RangeIteratorDecorator
All Implemented Interfaces:
Iterator, RangeIterator
Direct Known Subclasses:
AccessControlPolicyIteratorAdapter, EventIteratorAdapter, EventListenerIteratorAdapter, NodeIteratorAdapter, NodeTypeIteratorAdapter, PrincipalIteratorAdapter, PropertyIteratorAdapter, RowIteratorAdapter, VersionIteratorAdapter

public class RangeIteratorDecorator
extends Object
implements RangeIterator

Base class for decorating RangeIterators.


Constructor Summary
protected RangeIteratorDecorator(RangeIterator iterator)
          Creates a decorated iterator.
 
Method Summary
 long getPosition()
          Delegated to the underlying iterator.
 long getSize()
          Delegated to the underlying iterator.
 boolean hasNext()
          Delegated to the underlying iterator.
 Object next()
          Delegated to the underlying iterator.
 void remove()
          Delegated to the underlying iterator.
 void skip(long n)
          Delegated to the underlying iterator.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RangeIteratorDecorator

protected RangeIteratorDecorator(RangeIterator iterator)
Creates a decorated iterator. Protected since this class is only useful when subclassed.

Parameters:
iterator - the iterator to be decorated
Method Detail

getPosition

public long getPosition()
Delegated to the underlying iterator.

Specified by:
getPosition in interface RangeIterator
Returns:
iterator position

getSize

public long getSize()
Delegated to the underlying iterator.

Specified by:
getSize in interface RangeIterator
Returns:
iterator size

skip

public void skip(long n)
          throws NoSuchElementException
Delegated to the underlying iterator.

Specified by:
skip in interface RangeIterator
Parameters:
n - number of elements to skip
Throws:
NoSuchElementException - if skipped past the last element

hasNext

public boolean hasNext()
Delegated to the underlying iterator.

Specified by:
hasNext in interface Iterator
Returns:
true if the iterator has more elements, false otherwise

next

public Object next()
            throws NoSuchElementException
Delegated to the underlying iterator.

Specified by:
next in interface Iterator
Returns:
next element
Throws:
NoSuchElementException - if there are no more elements

remove

public void remove()
            throws UnsupportedOperationException,
                   IllegalStateException
Delegated to the underlying iterator.

Specified by:
remove in interface Iterator
Throws:
UnsupportedOperationException - if the operation is not supported
IllegalStateException - if there is no element to be removed


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