org.apache.jackrabbit.iterator
Class ArrayPropertyIterator

java.lang.Object
  extended byorg.apache.jackrabbit.iterator.ArrayIterator
      extended byorg.apache.jackrabbit.iterator.ArrayPropertyIterator
All Implemented Interfaces:
Iterator, PropertyIterator, RangeIterator

public class ArrayPropertyIterator
extends org.apache.jackrabbit.iterator.ArrayIterator
implements PropertyIterator

Array implementation of the JCR PropertyIterator interface.


Constructor Summary
ArrayPropertyIterator(Collection properties)
          Creates an iterator for the given collection of properties.
ArrayPropertyIterator(Property[] properties)
          Creates an iterator for the given array of properties.
 
Method Summary
 long getPosition()
          Returns the current array position
 long getSize()
          Returns the length of the array.
 boolean hasNext()
          Checks whether there are more elements in the array.
 Object next()
          Returns the next array element and advances the array position.
 Property nextProperty()
          Returns the next property in the array.
 void remove()
          Element removal is not supported.
 void skip(long items)
          Advances the array position the given number of elements.
 
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
 

Constructor Detail

ArrayPropertyIterator

public ArrayPropertyIterator(Property[] properties)
Creates an iterator for the given array of properties.

Parameters:
properties - the properties to iterate

ArrayPropertyIterator

public ArrayPropertyIterator(Collection properties)
Creates an iterator for the given collection of properties.

Parameters:
properties - the properties to iterate
Method Detail

nextProperty

public Property nextProperty()
Returns the next property in the array.

Specified by:
nextProperty in interface PropertyIterator
Returns:
next property
See Also:
PropertyIterator.nextProperty()

hasNext

public boolean hasNext()
Checks whether there are more elements in the array.

Specified by:
hasNext in interface Iterator
Returns:
true if more elements are available, false otherwise
See Also:
Iterator#hasNext()

next

public Object next()
Returns the next array element and advances the array position.

Specified by:
next in interface Iterator
Returns:
next element
See Also:
Iterator#next()

remove

public void remove()
            throws UnsupportedOperationException
Element removal is not supported.

Specified by:
remove in interface Iterator
Throws:
UnsupportedOperationException - always thrown
See Also:
Iterator#remove()

skip

public void skip(long items)
          throws IllegalArgumentException,
                 NoSuchElementException
Advances the array position the given number of elements.

Specified by:
skip in interface RangeIterator
Parameters:
items - number of items to skip
Throws:
IllegalArgumentException - if the given number of items is negative
NoSuchElementException - if skipping past the end of the array
See Also:
RangeIterator.skip(long)

getSize

public long getSize()
Returns the length of the array.

Specified by:
getSize in interface RangeIterator
Returns:
array length
See Also:
RangeIterator.getSize()

getPosition

public long getPosition()
Returns the current array position

Specified by:
getPosition in interface RangeIterator
Returns:
array position
See Also:
RangeIterator.getPosition()


Copyright © 2004-2005 . All Rights Reserved.