@ThreadSafe protected static class SessionNode.ChangedChildren extends Object implements ChildReferences.Changes
Modifier | Constructor and Description |
---|---|
protected |
ChangedChildren() |
Modifier and Type | Method and Description |
---|---|
Map<NodeKey,SessionNode.Insertions> |
getInsertionsByBeforeKey()
Get the map of insertions keyed by the 'before' node
|
Map<NodeKey,Name> |
getNewNames()
Get the names for the new nodes, keyed by their key.
|
Set<NodeKey> |
getRemovals()
Get the set of keys for the nodes that were removed from the list of child references.
|
StringBuilder |
getString(StringBuilder sb) |
void |
insertBefore(ChildReference before,
ChildReference inserted)
Insert the supplied child reference before another child reference.
|
ChildReference |
inserted(NodeKey key)
Get the child reference for the inserted node with the supplied key.
|
int |
insertionCount()
Get the number of child references that were inserted.
|
int |
insertionCount(Name name)
Get the number of child references that were inserted with the given name.
|
Iterator<ChildReferences.ChildInsertions> |
insertions(Name name)
Get the references to the children with the supplied name that were inserted.
|
ChildReferences.ChildInsertions |
insertionsBefore(ChildReference key)
Get the set of child references that were inserted before the node with the supplied key.
|
boolean |
isEmpty()
Determine if this set of changes is empty.
|
boolean |
isRemoved(ChildReference ref)
Determine whether the supplied child reference was removed.
|
boolean |
isRenamed(ChildReference ref)
Determine whether the supplied child reference was renamed.
|
boolean |
isRenamed(Name newName)
Determine whether any of the child references were renamed to the supplied name.
|
int |
removalCount()
Get the number of child references that were removed.
|
boolean |
remove(NodeKey key)
Remove the supplied node from this node's list of child references.
|
int |
renameCount()
Get the number of child references that were renamed.
|
Name |
renamed(NodeKey key)
Return the new name for the child node with the supplied key.
|
void |
renameTo(NodeKey key,
Name newName)
Rename the child reference with the given key.
|
String |
toString() |
public boolean isEmpty()
ChildReferences.Changes
isEmpty
in interface ChildReferences.Changes
public int insertionCount()
ChildReferences.Changes
insertionCount
in interface ChildReferences.Changes
public int insertionCount(Name name)
ChildReferences.Changes
insertionCount
in interface ChildReferences.Changes
name
- the Name
of a child, never null
public int removalCount()
ChildReferences.Changes
removalCount
in interface ChildReferences.Changes
public int renameCount()
ChildReferences.Changes
renameCount
in interface ChildReferences.Changes
public ChildReference inserted(NodeKey key)
ChildReferences.Changes
inserted
in interface ChildReferences.Changes
key
- the node key for the inserted node; may not be nullpublic Iterator<ChildReferences.ChildInsertions> insertions(Name name)
ChildReferences.Changes
insertions
in interface ChildReferences.Changes
name
- the name; may not be nullnull
if there are no insertions with this namepublic ChildReferences.ChildInsertions insertionsBefore(ChildReference key)
ChildReferences.Changes
insertionsBefore
in interface ChildReferences.Changes
key
- the node key for the node before which the inserted nodes are to be returned; may not be nullnull
if there are no insertions
before the given key.public void insertBefore(ChildReference before, ChildReference inserted)
before
- the existing child reference before which the child reference is to be placed; may not be nullinserted
- the reference to the child that is to be inserted; may not be nullpublic boolean isRemoved(ChildReference ref)
ChildReferences.Changes
isRemoved
in interface ChildReferences.Changes
ref
- the reference; may not be nullpublic boolean isRenamed(ChildReference ref)
ChildReferences.Changes
isRenamed
in interface ChildReferences.Changes
ref
- the reference; may not be nullpublic boolean isRenamed(Name newName)
ChildReferences.Changes
isRenamed
in interface ChildReferences.Changes
newName
- the new name; may not be nullpublic boolean remove(NodeKey key)
key
- the key for the node that is to be removed; may not be nullpublic Name renamed(NodeKey key)
ChildReferences.Changes
renamed
in interface ChildReferences.Changes
key
- the child node's key; may not be nullpublic void renameTo(NodeKey key, Name newName)
key
- the key for the child reference; may not be nullnewName
- the new name for the node; may not be nullpublic StringBuilder getString(StringBuilder sb)
public Map<NodeKey,Name> getNewNames()
public Set<NodeKey> getRemovals()
public Map<NodeKey,SessionNode.Insertions> getInsertionsByBeforeKey()
Copyright © 2008–2016 JBoss, a division of Red Hat. All rights reserved.