Class 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 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 occurs
        oldValues1 - is the list of old user data associated to the node
        newValues1 - is the list of new user data associated to the node
        allValues1 - 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 occurs
        delta1 - 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.
      • getCurrentValues

        @Pure
        public List<Object> getCurrentValues()
        Replies the list of current data.
        Returns:
        the list of current data.