Class ItemSequence.NodeSequenceImpl
- java.lang.Object
-
- org.apache.jackrabbit.commons.flat.ItemSequence
-
- org.apache.jackrabbit.commons.flat.ItemSequence.NodeSequenceImpl
-
- All Implemented Interfaces:
Iterable<Node>
,NodeSequence
,Sequence<Node>
- Enclosing class:
- ItemSequence
protected static class ItemSequence.NodeSequenceImpl extends ItemSequence implements NodeSequence
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.apache.jackrabbit.commons.flat.ItemSequence
ItemSequence.NodeSequenceImpl, ItemSequence.PropertySequenceImpl
-
-
Field Summary
-
Fields inherited from class org.apache.jackrabbit.commons.flat.ItemSequence
autoSave, errorHandler, order, root, treeManager
-
-
Constructor Summary
Constructors Constructor Description NodeSequenceImpl(TreeManager treeManager, TreeTraverser.ErrorHandler errorHandler)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Node
addNode(String key, String primaryNodeTypeName)
Add a with the givenkey
and primary node type name.Node
getItem(String key)
Retrieve anItem
from this sequence by itskey
.Node
getParent(String key)
Returns the parent node for the given key.boolean
hasItem(String key)
Determine whether this sequence contains a specifickey
.Iterator<Node>
iterator()
Iterator for theItem
s in this sequence.void
removeNode(String key)
Remove the node with the given key.-
Methods inherited from class org.apache.jackrabbit.commons.flat.ItemSequence
createNodeSequence, createNodeSequence, createPropertySequence, createPropertySequence, getMinimal, getMinimal, getNodeSequence, getPredecessor, getPredecessor, getPropertySequence, getSuccessor, renamePath
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
-
-
-
Constructor Detail
-
NodeSequenceImpl
public NodeSequenceImpl(TreeManager treeManager, TreeTraverser.ErrorHandler errorHandler)
-
-
Method Detail
-
iterator
public Iterator<Node> iterator()
Description copied from interface:Sequence
Iterator for theItem
s in this sequence. The order of the items is implementation specific.
-
getItem
public Node getItem(String key) throws RepositoryException
Description copied from interface:Sequence
Retrieve anItem
from this sequence by itskey
. If the sequence does not contain thekey
this method throws anItemNotFoundException
.- Specified by:
getItem
in interfaceSequence<Node>
- Parameters:
key
- Thekey
of the item to retrieve. Must not benull
.- Returns:
- The item belonging to
key
. - Throws:
ItemNotFoundException
RepositoryException
-
hasItem
public boolean hasItem(String key) throws RepositoryException
Description copied from interface:Sequence
Determine whether this sequence contains a specifickey
.- Specified by:
hasItem
in interfaceSequence<Node>
- Parameters:
key
- Thekey
to look up.- Returns:
true
if this sequence containskey
.False
otherwise.- Throws:
RepositoryException
-
addNode
public Node addNode(String key, String primaryNodeTypeName) throws RepositoryException
Description copied from interface:NodeSequence
Add a with the givenkey
and primary node type name.- Specified by:
addNode
in interfaceNodeSequence
- Parameters:
key
- key of the node to addprimaryNodeTypeName
- primary node type of the node to add- Returns:
- the newly added node
- Throws:
RepositoryException
-
removeNode
public void removeNode(String key) throws RepositoryException
Description copied from interface:NodeSequence
Remove the node with the given key.- Specified by:
removeNode
in interfaceNodeSequence
- Parameters:
key
- The key of the node to remove- Throws:
RepositoryException
- If there is no node with such a key or another error occurs.
-
getParent
public Node getParent(String key) throws RepositoryException
Description copied from class:ItemSequence
Returns the parent node for the given key. When the key is not present in this sequence already, the returned node is the node that would contain that key if it where present.- Specified by:
getParent
in classItemSequence
- Throws:
RepositoryException
-
-