T - the type of the items in the node listpublic class ListAddChange<T extends Serializable> extends AbstractListChange<T>
list node feature.
For internal use only. May be renamed or removed in a future release.
| Constructor and Description |
|---|
ListAddChange(NodeList<T> list,
boolean nodeValues,
int index,
List<? extends T> newItems)
Creates a new list add change.
|
| Modifier and Type | Method and Description |
|---|---|
ListAddChange<T> |
copy(int indx)
Gets a copy of the change with the same data except
index. |
ListAddChange<T> |
copy(List<? extends T> items)
Gets a copy of the change with the same data except a list of new
items. |
List<? extends T> |
getNewItems()
Gets the added items.
|
boolean |
isEmpty()
Returns whether this add operation still contains any new items.
|
protected void |
populateJson(elemental.json.JsonObject json,
ConstantPool constantPool)
Overridden by subclasses to populate a JSON object when serializing.
|
void |
removeItem(T item)
Removes item from the change list.
|
getIndex, getNodeList, setIndexgetFeaturegetNode, toJsonpublic ListAddChange(NodeList<T> list, boolean nodeValues, int index, List<? extends T> newItems)
list - the changed listnodeValues - true if the values are StateNodes, false otherwiseindex - the index of the add operationsnewItems - a list of new itemspublic boolean isEmpty()
true if no new items, false if still
has new itemspublic ListAddChange<T> copy(List<? extends T> items)
items.items - new list of itemspublic ListAddChange<T> copy(int indx)
AbstractListChangeindex.copy in class AbstractListChange<T extends Serializable>indx - the new index of the changeprotected void populateJson(elemental.json.JsonObject json,
ConstantPool constantPool)
NodeChangepopulateJson in class NodeFeatureChangejson - the json object to populateconstantPool - the constant pool to use for serializing constant pool
referencespublic void removeItem(T item)
Note: This should be used only when list of changes is being re-indexed after adding a new change.
item - Item to be removed.Copyright © 2025. All rights reserved.