- java.lang.Object
-
- org.arakhne.afc.math.tree.TreeDataEvent
-
public class TreeDataEvent extends Object
Event on tree nodes.- Since:
- 13.0
- Version:
- 17.0 2020-01-04 14:41:41
- Author:
- Stéphane GALLAND
- Maven Group Id:
- org.arakhne.afc.core
- Maven Artifact Id:
- mathtree
-
-
Constructor Summary
Constructors Constructor Description TreeDataEvent(TreeNode<?,?> node1, int delta1, Collection<?> allValues1)
Construct an event.TreeDataEvent(TreeNode<?,?> node1, Collection<?> oldValues1, Collection<?> newValues1, Collection<?> allValues1)
Construct an event.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
getAddedValueAt(int index)
Replies the value added to a node.int
getAddedValueCount()
Replies the count of added values.List<Object>
getAddedValues()
Replies the list of added data.Object
getCurrentValueAt(int index)
Replies the value associated to a node.int
getCurrentValueCount()
Replies the count of all associated values.List<Object>
getCurrentValues()
Replies the list of current data.int
getDelta()
Replies the amount of data that cause this event.TreeNode<?,?>
getNode()
Replies the node on which the event occurs.Object
getRemovedValueAt(int index)
Replies the value removed from a node.int
getRemovedValueCount()
Replies the count of removed values.List<Object>
getRemovedValues()
Replies the list of removed data.
-
-
-
Constructor Detail
-
TreeDataEvent
public TreeDataEvent(TreeNode<?,?> node1, Collection<?> oldValues1, Collection<?> newValues1, Collection<?> allValues1)
Construct an event.- Parameters:
node1
- is the node on which the event that occursoldValues1
- is the list of old user data associated to the nodenewValues1
- is the list of new user data associated to the nodeallValues1
- is the list of all user data currently associated to the node
-
TreeDataEvent
public TreeDataEvent(TreeNode<?,?> node1, int delta1, Collection<?> allValues1)
Construct an event.- Parameters:
node1
- is the node on which the event that occursdelta1
- is the difference between the size of the data list before change and size after change.allValues1
- is the list of all user data currently associated to the node
-
-
Method Detail
-
getNode
@Pure public TreeNode<?,?> getNode()
Replies the node on which the event occurs.- Returns:
- the node on which the event occurs.
-
getRemovedValueCount
@Pure public int getRemovedValueCount()
Replies the count of removed values.- Returns:
- the count of removed values.
-
getAddedValueCount
@Pure public int getAddedValueCount()
Replies the count of added values.- Returns:
- the count of added values.
-
getCurrentValueCount
@Pure public int getCurrentValueCount()
Replies the count of all associated values.- Returns:
- the count of all associated values.
-
getRemovedValueAt
@Pure public Object getRemovedValueAt(int index)
Replies the value removed from a node.- Parameters:
index
- is the index of the value- Returns:
- the old value at the given index.
-
getAddedValueAt
@Pure public Object getAddedValueAt(int index)
Replies the value added to a node.- Parameters:
index
- is the index of the value- Returns:
- the new value at the given index.
-
getCurrentValueAt
@Pure public Object getCurrentValueAt(int index)
Replies the value associated to a node.- Parameters:
index
- is the index of the value- Returns:
- the value at the given index.
-
getDelta
@Pure public int getDelta()
Replies the amount of data that cause this event.The amount may be positive is the global size of the data list has increased. It may be negative is the global size of the data list has decreased. The value of the delta corresponds to the difference between the size before change and size after change.
- Returns:
- amount of data change.
-
getAddedValues
@Pure public List<Object> getAddedValues()
Replies the list of added data.- Returns:
- the list of added data.
-
getRemovedValues
@Pure public List<Object> getRemovedValues()
Replies the list of removed data.- Returns:
- the list of removed data.
-
-