org.apache.jackrabbit.commons.iterator
Class VersionIteratorAdapter

java.lang.Object
  extended by org.apache.jackrabbit.commons.iterator.RangeIteratorDecorator
      extended by org.apache.jackrabbit.commons.iterator.VersionIteratorAdapter
All Implemented Interfaces:
Iterator, RangeIterator, VersionIterator

public class VersionIteratorAdapter
extends RangeIteratorDecorator
implements VersionIterator

Adapter class for turning RangeIterators or Iterators into VersionIterators.


Field Summary
static VersionIterator EMPTY
          Static instance of an empty VersionIterator.
 
Constructor Summary
VersionIteratorAdapter(Collection collection)
          Creates an iterator for the given collection.
VersionIteratorAdapter(Iterator iterator)
          Creates an adapter for the given Iterator.
VersionIteratorAdapter(RangeIterator iterator)
          Creates an adapter for the given RangeIterator.
 
Method Summary
 Version nextVersion()
          Returns the next version.
 
Methods inherited from class org.apache.jackrabbit.commons.iterator.RangeIteratorDecorator
getPosition, getSize, hasNext, next, remove, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.jcr.RangeIterator
getPosition, getSize, skip
 
Methods inherited from interface java.util.Iterator
hasNext, next, remove
 

Field Detail

EMPTY

public static final VersionIterator EMPTY
Static instance of an empty VersionIterator.

Constructor Detail

VersionIteratorAdapter

public VersionIteratorAdapter(RangeIterator iterator)
Creates an adapter for the given RangeIterator.

Parameters:
iterator - iterator of Versions

VersionIteratorAdapter

public VersionIteratorAdapter(Iterator iterator)
Creates an adapter for the given Iterator.

Parameters:
iterator - iterator of Versions

VersionIteratorAdapter

public VersionIteratorAdapter(Collection collection)
Creates an iterator for the given collection.

Parameters:
collection - collection of Versions
Method Detail

nextVersion

public Version nextVersion()
Returns the next version.

Specified by:
nextVersion in interface VersionIterator
Returns:
next version
Throws:
NoSuchElementException - if there is no next version


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