org.apache.jackrabbit.commons.flat
Interface Sequence<T extends Item>

Type Parameters:
T - extends <Item>
All Superinterfaces:
Iterable<T>
All Known Subinterfaces:
NodeSequence, PropertySequence
All Known Implementing Classes:
ItemSequence.NodeSequenceImpl, ItemSequence.PropertySequenceImpl

public interface Sequence<T extends Item>
extends Iterable<T>

Interface for accessing JCR Items sequentially through an Iterator or looking them up through a key.


Method Summary
 T getItem(String key)
          Retrieve an Item from this sequence by its key.
 boolean hasItem(String key)
          Determine whether this sequence contains a specific key.
 Iterator<T> iterator()
          Iterator for the Items in this sequence.
 

Method Detail

iterator

Iterator<T> iterator()
Iterator for the Items in this sequence. The order of the items is implementation specific.

Specified by:
iterator in interface Iterable<T extends Item>
See Also:
Iterable.iterator()

getItem

T getItem(String key)
                       throws AccessDeniedException,
                              PathNotFoundException,
                              ItemNotFoundException,
                              RepositoryException
Retrieve an Item from this sequence by its key. If the sequence does not contain the key this method throws an ItemNotFoundException.

Parameters:
key - The key of the item to retrieve. Must not be null.
Returns:
The item belonging to key.
Throws:
ItemNotFoundException
RepositoryException
AccessDeniedException
PathNotFoundException

hasItem

boolean hasItem(String key)
                throws RepositoryException
Determine whether this sequence contains a specific key.

Parameters:
key - The key to look up.
Returns:
true if this sequence contains key. False otherwise.
Throws:
RepositoryException


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