Class DelegatingMapProperty<S,​K,​V>

  • Type Parameters:
    S - type of the source object
    K - type of the keys to the map
    V - type of the values in the map
    All Implemented Interfaces:
    IProperty, IMapProperty<S,​K,​V>

    public abstract class DelegatingMapProperty<S,​K,​V>
    extends MapProperty<S,​K,​V>
    Since:
    1.2
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      protected abstract IMapProperty<S,​K,​V> doGetDelegate​(S source)
      Returns the property to delegate to for the specified source object.
      protected java.util.Map<K,​V> doGetMap​(S source)
      Returns a Map with the current contents of the source's map property
      protected void doSetMap​(S source, java.util.Map<K,​V> map)
      Updates the property on the source with the specified change.
      protected void doUpdateMap​(S source, MapDiff<K,​V> diff)
      Updates the property on the source with the specified change.
      IMapProperty<S,​K,​V> getDelegate​(S source)
      Returns the property to delegate to for the specified source object.
      java.lang.Object getKeyType()
      Returns the element type of the map's key set or null if the key set is untyped.
      java.lang.Object getValueType()
      Returns the element type of the map's values collection or null if the collection is untyped.
      IObservableMap<K,​V> observe​(Realm realm, S source)
      Returns an observable map observing this map property on the given property source
      IObservableMap<K,​V> observe​(S source)
      Returns an observable map observing this map property on the given property source
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DelegatingMapProperty

        protected DelegatingMapProperty()
      • DelegatingMapProperty

        protected DelegatingMapProperty​(java.lang.Object keyType,
                                        java.lang.Object valueType)
    • Method Detail

      • getDelegate

        public final IMapProperty<S,​K,​V> getDelegate​(S source)
        Returns the property to delegate to for the specified source object. Repeated calls to this method with the same source object returns the same delegate instance.
        Parameters:
        source - the property source (may be null)
        Returns:
        the property to delegate to for the specified source object.
      • doGetDelegate

        protected abstract IMapProperty<S,​K,​V> doGetDelegate​(S source)
        Returns the property to delegate to for the specified source object. Implementers must ensure that repeated calls to this method with the same source object returns the same delegate instance.
        Parameters:
        source - the property source
        Returns:
        the property to delegate to for the specified source object.
      • getKeyType

        public java.lang.Object getKeyType()
        Description copied from interface: IMapProperty
        Returns the element type of the map's key set or null if the key set is untyped.
        Returns:
        the element type of the map's key set or null if the key set is untyped.
      • getValueType

        public java.lang.Object getValueType()
        Description copied from interface: IMapProperty
        Returns the element type of the map's values collection or null if the collection is untyped.
        Returns:
        the element type of the map's values collection or null if the collection is untyped.
      • doGetMap

        protected java.util.Map<K,​V> doGetMap​(S source)
        Description copied from class: MapProperty
        Returns a Map with the current contents of the source's map property
        Overrides:
        doGetMap in class MapProperty<S,​K,​V>
        Parameters:
        source - the property source
        Returns:
        a Map with the current contents of the source's map property
      • doSetMap

        protected void doSetMap​(S source,
                                java.util.Map<K,​V> map)
        Description copied from class: MapProperty
        Updates the property on the source with the specified change.
        Overrides:
        doSetMap in class MapProperty<S,​K,​V>
        Parameters:
        source - the property source
        map - the new map
      • doUpdateMap

        protected void doUpdateMap​(S source,
                                   MapDiff<K,​V> diff)
        Description copied from class: MapProperty
        Updates the property on the source with the specified change.
        Overrides:
        doUpdateMap in class MapProperty<S,​K,​V>
        Parameters:
        source - the property source
        diff - a diff describing the change
      • observe

        public IObservableMap<K,​V> observe​(S source)
        Description copied from interface: IMapProperty
        Returns an observable map observing this map property on the given property source
        Specified by:
        observe in interface IMapProperty<S,​K,​V>
        Overrides:
        observe in class MapProperty<S,​K,​V>
        Parameters:
        source - the property source
        Returns:
        an observable map observing this map-typed property on the given property source
      • observe

        public IObservableMap<K,​V> observe​(Realm realm,
                                                 S source)
        Description copied from interface: IMapProperty
        Returns an observable map observing this map property on the given property source
        Parameters:
        realm - the observable's realm
        source - the property source
        Returns:
        an observable map observing this map-typed property on the given property source