Interface ChildNodeEntries
-
public interface ChildNodeEntriesChildNodeEntriesrepresents a collection ofNodeEntrys 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 voidadd(NodeEntry cne)Adds aNodeEntryto the end of the list.voidadd(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.voidadd(NodeEntry entry, int index, NodeEntry beforeEntry)Adds a the newNodeEntrybeforebeforeEntry.List<NodeEntry>get(Name nodeName)Returns aListofNodeEntrys for the givennodeName.NodeEntryget(Name nodeName, int index)Returns theNodeEntrywith the givennodeNameandindex.NodeEntryget(Name nodeName, String uniqueID)Return theNodeEntrythat matches the given nodeName and uniqueID ornullif no matching entry can be found.booleanisComplete()Iterator<NodeEntry>iterator()Returns an unmodifiable iterator over all NodeEntry objects present in this ChildNodeEntries collection irrespective of their status.voidreload()Reloads thisChildNodeEntriesobject.NodeEntryremove(NodeEntry childEntry)Removes the child node entry referring to the node state.NodeEntryreorder(NodeEntry insertEntry, NodeEntry beforeEntry)Reorders an existingNodeEntrybefore anotherNodeEntry.voidreorderAfter(NodeEntry insertEntry, NodeEntry afterEntry)Reorders an existingNodeEntryafter anotherNodeEntry.
-
-
-
Method Detail
-
isComplete
boolean isComplete()
- Returns:
trueif thisChildNodeEntrieshave been updated or completely loaded without being invalidated in the mean time.
-
reload
void reload() throws ItemNotFoundException, RepositoryExceptionReloads thisChildNodeEntriesobject.
-
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 aListofNodeEntrys for the givennodeName. This method does not filter out removedNodeEntrys.- Parameters:
nodeName- the child node name.- Returns:
- same name sibling nodes with the given
nodeName.
-
get
NodeEntry get(Name nodeName, int index)
Returns theNodeEntrywith the givennodeNameandindex. Note, that this method does not filter out removedNodeEntrys.- Parameters:
nodeName- name of the child node entry.index- the index of the child node entry.- Returns:
- the
NodeEntryornullif there is no suchNodeEntry.
-
get
NodeEntry get(Name nodeName, String uniqueID)
Return theNodeEntrythat matches the given nodeName and uniqueID ornullif no matching entry can be found.- Parameters:
nodeName-uniqueID-- Returns:
- Throws:
IllegalArgumentException- if the given uniqueID is null.
-
add
void add(NodeEntry cne)
Adds aNodeEntryto the end of the list. Same asadd(NodeEntry, int), where the index isPath.INDEX_UNDEFINED.- Parameters:
cne- theNodeEntryto 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- theNodeEntryto add.
-
add
void add(NodeEntry entry, int index, NodeEntry beforeEntry)
Adds a the newNodeEntrybeforebeforeEntry.- 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
nullif there is no such entry.
-
reorder
NodeEntry reorder(NodeEntry insertEntry, NodeEntry beforeEntry)
Reorders an existingNodeEntrybefore anotherNodeEntry. IfbeforeEntryisnullinsertEntryis moved to the end of the child node entries.- Parameters:
insertEntry- the NodeEntry to move.beforeEntry- the NodeEntry whereinsertEntryis reordered to.- Returns:
- the NodeEntry that followed the 'insertEntry' before the reordering.
- Throws:
NoSuchElementException- ifinsertEntryorbeforeEntrydoes not have aNodeEntryin thisChildNodeEntries.
-
reorderAfter
void reorderAfter(NodeEntry insertEntry, NodeEntry afterEntry)
Reorders an existingNodeEntryafter anotherNodeEntry. IfafterEntryisnullinsertEntryis moved to the beginning of the child node entries.- Parameters:
insertEntry- the NodeEntry to move.afterEntry- the NodeEntry whereinsertEntryis reordered behind.- Throws:
NoSuchElementException- ifinsertEntryorafterEntrydoes not have aNodeEntryin thisChildNodeEntries.
-
-