Interface ChildNodeEntries
-
public interface ChildNodeEntries
ChildNodeEntries
represents a collection ofNodeEntry
s that also maintains the index values of same-name siblings on insertion and removal.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
add(NodeEntry cne)
Adds aNodeEntry
to the end of the list.void
add(NodeEntry cne, int index)
Adds aNodeEntry
.
Note the following special cases: If an entry with the given index already exists, the the new sibling is inserted before. If the given index is bigger that the last entry in the siblings list, intermediate entries will be created.void
add(NodeEntry entry, int index, NodeEntry beforeEntry)
Adds a the newNodeEntry
beforebeforeEntry
.List<NodeEntry>
get(Name nodeName)
Returns aList
ofNodeEntry
s for the givennodeName
.NodeEntry
get(Name nodeName, int index)
Returns theNodeEntry
with the givennodeName
andindex
.NodeEntry
get(Name nodeName, String uniqueID)
Return theNodeEntry
that matches the given nodeName and uniqueID ornull
if no matching entry can be found.boolean
isComplete()
Iterator<NodeEntry>
iterator()
Returns an unmodifiable iterator over all NodeEntry objects present in this ChildNodeEntries collection irrespective of their status.void
reload()
Reloads thisChildNodeEntries
object.NodeEntry
remove(NodeEntry childEntry)
Removes the child node entry referring to the node state.NodeEntry
reorder(NodeEntry insertEntry, NodeEntry beforeEntry)
Reorders an existingNodeEntry
before anotherNodeEntry
.void
reorderAfter(NodeEntry insertEntry, NodeEntry afterEntry)
Reorders an existingNodeEntry
after anotherNodeEntry
.
-
-
-
Method Detail
-
isComplete
boolean isComplete()
- Returns:
true
if thisChildNodeEntries
have been updated or completely loaded without being invalidated in the mean time.
-
reload
void reload() throws ItemNotFoundException, RepositoryException
Reloads thisChildNodeEntries
object.
-
iterator
Iterator<NodeEntry> iterator()
Returns an unmodifiable iterator over all NodeEntry objects present in this ChildNodeEntries collection irrespective of their status.- Returns:
- Iterator over all NodeEntry object
-
get
List<NodeEntry> get(Name nodeName)
Returns aList
ofNodeEntry
s for the givennodeName
. This method does not filter out removedNodeEntry
s.- Parameters:
nodeName
- the child node name.- Returns:
- same name sibling nodes with the given
nodeName
.
-
get
NodeEntry get(Name nodeName, int index)
Returns theNodeEntry
with the givennodeName
andindex
. Note, that this method does not filter out removedNodeEntry
s.- Parameters:
nodeName
- name of the child node entry.index
- the index of the child node entry.- Returns:
- the
NodeEntry
ornull
if there is no suchNodeEntry
.
-
get
NodeEntry get(Name nodeName, String uniqueID)
Return theNodeEntry
that matches the given nodeName and uniqueID ornull
if no matching entry can be found.- Parameters:
nodeName
-uniqueID
-- Returns:
- Throws:
IllegalArgumentException
- if the given uniqueID is null.
-
add
void add(NodeEntry cne)
Adds aNodeEntry
to the end of the list. Same asadd(NodeEntry, int)
, where the index isPath.INDEX_UNDEFINED
.- Parameters:
cne
- theNodeEntry
to add.
-
add
void add(NodeEntry cne, int index)
Adds aNodeEntry
.
Note the following special cases:- If an entry with the given index already exists, the the new sibling is inserted before.
- If the given index is bigger that the last entry in the siblings list, intermediate entries will be created.
- Parameters:
cne
- theNodeEntry
to add.
-
add
void add(NodeEntry entry, int index, NodeEntry beforeEntry)
Adds a the newNodeEntry
beforebeforeEntry
.- Parameters:
entry
-index
-beforeEntry
-
-
remove
NodeEntry remove(NodeEntry childEntry)
Removes the child node entry referring to the node state.- Parameters:
childEntry
- the entry to be removed.- Returns:
- the removed entry or
null
if there is no such entry.
-
reorder
NodeEntry reorder(NodeEntry insertEntry, NodeEntry beforeEntry)
Reorders an existingNodeEntry
before anotherNodeEntry
. IfbeforeEntry
isnull
insertEntry
is moved to the end of the child node entries.- Parameters:
insertEntry
- the NodeEntry to move.beforeEntry
- the NodeEntry whereinsertEntry
is reordered to.- Returns:
- the NodeEntry that followed the 'insertEntry' before the reordering.
- Throws:
NoSuchElementException
- ifinsertEntry
orbeforeEntry
does not have aNodeEntry
in thisChildNodeEntries
.
-
reorderAfter
void reorderAfter(NodeEntry insertEntry, NodeEntry afterEntry)
Reorders an existingNodeEntry
after anotherNodeEntry
. IfafterEntry
isnull
insertEntry
is moved to the beginning of the child node entries.- Parameters:
insertEntry
- the NodeEntry to move.afterEntry
- the NodeEntry whereinsertEntry
is reordered behind.- Throws:
NoSuchElementException
- ifinsertEntry
orafterEntry
does not have aNodeEntry
in thisChildNodeEntries
.
-
-