Package org.zkoss.bind.tracker.impl

## Class TrackerImpl

- java.lang.Object
- - org.zkoss.bind.tracker.impl.TrackerImpl

- All Implemented Interfaces:
    `java.io.Serializable`, `Tracker`
  Direct Known Subclasses:
    `TrackerImplEx`

      public class TrackerImpl
      extends java.lang.Object
      implements Tracker, java.io.Serializable

  Implementation of dependency tracking.
  Since:
    6.0.0
  Author:
    henrichen
  See Also:
    Serialized Form

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `protected static class` | `TrackerImpl.EqualBeansMap` |

  - ### Field Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected java.util.Map<java.lang.Object,​java.util.Set<TrackerNode>>` | `_beanMap` |
    `protected java.util.Map<Component,​java.util.Map<java.lang.Object,​TrackerNode>>` | `_compMap` |
    `protected TrackerImpl.EqualBeansMap` | `_equalBeansMap` |
    `protected java.util.Map<java.lang.Object,​java.util.Set<TrackerNode>>` | `_nullMap` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `TrackerImpl()` |

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected void` | `addBeanMap​(TrackerNode node, java.lang.Object value, java.lang.Object basePath)` |
    `void` | `addDependsOn​(Component srcComp, java.lang.String[] srcSeries, Binding srcBinding, Component dependsOnComp, java.lang.String[] dependsOnSeries)` | Add a depends-on tracking between the source property name series and depends-on property name series.
    `void` | `addTracking​(Component comp, java.lang.String[] series, Binding binding)` | Add a tracking that associate a binding to a dot series under the specified `Component`
    `void` | `dump()` |
    `void` | `dumpLess()` |
    `protected java.util.Collection<TrackerNode>` | `getAllTrackerNodes()` |
    `java.util.Set<LoadBinding>` | `getDirectLoadBindings​(java.lang.Object base, java.lang.String prop)` | Returns all direct bindings that associated with the specified property.
    `java.util.Set<java.lang.Object>` | `getEqualBeans​(java.lang.Object bean)` |
    `java.util.Set<LoadBinding>` | `getKidBaseLoadBindings​(java.lang.Object base, java.lang.String prop)` | Returns all bindings that associated with the kid bases of specified property.
    `java.util.Set<LoadBinding>` | `getLoadBindings​(java.lang.Object base, java.lang.String prop)` | Returns all bindings that associated with the specified property.
    `protected TrackerNode` | `getOrCreateTrackerNode​(Component comp, java.lang.String[] series)` |
    `protected TrackerNode` | `getTrackerNodePerComponentScript​(java.lang.Object comp, java.lang.Object script)` |
    `protected java.util.Map<Component,​java.util.Map<java.lang.Object,​TrackerNode>>` | `initCompMap()` |
    `protected TrackerImpl.EqualBeansMap` | `newEqualBeansMap()` |
    `protected TrackerNode` | `newTrackerNode​(java.lang.Object script)` |
    `protected void` | `removeAllFromBeanMap​(java.util.Collection<TrackerNode> removed)` |
    `protected void` | `removeAllFromNullMap​(java.util.Set<TrackerNode> removed)` |
    `protected void` | `removeBeanMap​(TrackerNode node)` |
    `void` | `removeTrackings​(java.util.Set<Component> comps)` | Remove all tracking associated with the specified `Component` set.
    `void` | `removeTrackings​(Component comp)` | Remove all tracking associated with the specified `Component`.
    `protected static boolean` | `testEqualsBean​(java.lang.Object nodeBean, java.lang.Object bean)` |
    `void` | `tieValue​(java.lang.Object comp, java.lang.Object base, java.lang.Object script, java.lang.Object propName, java.lang.Object value, java.lang.Object basePath)` | Tie a property to its corresponding value under the specified `Component`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### _compMap

          protected java.util.Map<Component,​java.util.Map<java.lang.Object,​TrackerNode>> _compMap

    - #### _nullMap

          protected java.util.Map<java.lang.Object,​java.util.Set<TrackerNode>> _nullMap

    - #### _beanMap

          protected transient java.util.Map<java.lang.Object,​java.util.Set<TrackerNode>> _beanMap

    - #### _equalBeansMap

          protected transient TrackerImpl.EqualBeansMap _equalBeansMap

  - ### Constructor Detail

    - #### TrackerImpl

          public TrackerImpl()

  - ### Method Detail

    - #### initCompMap

          protected java.util.Map<Component,​java.util.Map<java.lang.Object,​TrackerNode>> initCompMap()

    - #### newEqualBeansMap

          protected TrackerImpl.EqualBeansMap newEqualBeansMap()

    - #### addTracking

          public void addTracking​(Component comp,
                                  java.lang.String[] series,
                                  Binding binding)

      Description copied from interface: `Tracker`
      Add a tracking that associate a binding to a dot series under the specified `Component`
      Specified by:
        `addTracking` in interface `Tracker`
      Parameters:
        `comp` - the component with the associated binding
        `series` - the dot series as an array of property name
        `binding` - the associated binding

    - #### addDependsOn

          public void addDependsOn​(Component srcComp,
                                   java.lang.String[] srcSeries,
                                   Binding srcBinding,
                                   Component dependsOnComp,
                                   java.lang.String[] dependsOnSeries)

      Description copied from interface: `Tracker`
      Add a depends-on tracking between the source property name series and depends-on property name series.
      Specified by:
        `addDependsOn` in interface `Tracker`
      Parameters:
        `srcComp` - the source component with the associated binding
        `srcSeries` - the dot series as an array of source property name.
        `srcBinding` - the associated binding
        `dependsOnSeries` - the dot series as an array of dependsOn property name.

    - #### getOrCreateTrackerNode

          protected TrackerNode getOrCreateTrackerNode​(Component comp,
                                                       java.lang.String[] series)

    - #### newTrackerNode

          protected TrackerNode newTrackerNode​(java.lang.Object script)

    - #### removeTrackings

          public void removeTrackings​(java.util.Set<Component> comps)

      Description copied from interface: `Tracker`
      Remove all tracking associated with the specified `Component` set.
      Specified by:
        `removeTrackings` in interface `Tracker`
      Parameters:
        `comps` - the associated component set

    - #### removeTrackings

          public void removeTrackings​(Component comp)

      Description copied from interface: `Tracker`
      Remove all tracking associated with the specified `Component`.
      Specified by:
        `removeTrackings` in interface `Tracker`
      Parameters:
        `comp` - the associated component

    - #### removeAllFromNullMap

          protected void removeAllFromNullMap​(java.util.Set<TrackerNode> removed)

    - #### getLoadBindings

          public java.util.Set<LoadBinding> getLoadBindings​(java.lang.Object base,
                                                            java.lang.String prop)

      Description copied from interface: `Tracker`
      Returns all bindings that associated with the specified property.
      Specified by:
        `getLoadBindings` in interface `Tracker`
      Parameters:
        `base` - base object
        `prop` - property name
      Returns:
        all LoadBindings that associated with the specified property.

    - #### getDirectLoadBindings

          public java.util.Set<LoadBinding> getDirectLoadBindings​(java.lang.Object base,
                                                                  java.lang.String prop)

      Description copied from interface: `Tracker`
      Returns all direct bindings that associated with the specified property.
      Specified by:
        `getDirectLoadBindings` in interface `Tracker`
      Parameters:
        `base` - base object
        `prop` - property name
      Returns:
        all direct LoadBindings that associated with the specified property.

    - #### getKidBaseLoadBindings

          public java.util.Set<LoadBinding> getKidBaseLoadBindings​(java.lang.Object base,
                                                                   java.lang.String prop)

      Description copied from interface: `Tracker`
      Returns all bindings that associated with the kid bases of specified property.
      Specified by:
        `getKidBaseLoadBindings` in interface `Tracker`
      Parameters:
        `base` - base object
        `prop` - property name
      Returns:
        all bindings that associated with the kid bases of specified property.

    - #### getAllTrackerNodes

          protected java.util.Collection<TrackerNode> getAllTrackerNodes()

    - #### getTrackerNodePerComponentScript

          protected TrackerNode getTrackerNodePerComponentScript​(java.lang.Object comp,
                                                                 java.lang.Object script)

    - #### tieValue

          public void tieValue​(java.lang.Object comp,
                               java.lang.Object base,
                               java.lang.Object script,
                               java.lang.Object propName,
                               java.lang.Object value,
                               java.lang.Object basePath)

      Description copied from interface: `Tracker`
      Tie a property to its corresponding value under the specified `Component`.
      Specified by:
        `tieValue` in interface `Tracker`
      Parameters:
        `comp` - the associated component
        `base` - the base object of the property
        `script` - the field script
        `propName` - the resolved property name from the field script
        `value` - the value of the property
        `basePath` - the basePath script prior to the `script` field script (Since 8.0)

    - #### addBeanMap

          protected void addBeanMap​(TrackerNode node,
                                    java.lang.Object value,
                                    java.lang.Object basePath)

    - #### removeBeanMap

          protected void removeBeanMap​(TrackerNode node)

    - #### removeAllFromBeanMap

          protected void removeAllFromBeanMap​(java.util.Collection<TrackerNode> removed)

    - #### getEqualBeans

          public java.util.Set<java.lang.Object> getEqualBeans​(java.lang.Object bean)

    - #### testEqualsBean

          protected static boolean testEqualsBean​(java.lang.Object nodeBean,
                                                  java.lang.Object bean)

    - #### dumpLess

          public void dumpLess()

    - #### dump

          public void dump()