Class ValuePolicyModelGroup<V>

  • Type Parameters:
    V - The type of value contained in the value model.
    All Implemented Interfaces:
    com.globalmentor.beans.GenericPropertyChangeListener<V>, ModelGroup<ValueModel<V>>, java.beans.PropertyChangeListener, java.util.EventListener
    Direct Known Subclasses:
    MutualExclusionPolicyModelGroup

    public abstract class ValuePolicyModelGroup<V>
    extends AbstractModelGroup<ValueModel<V>>
    implements com.globalmentor.beans.GenericPropertyChangeListener<V>
    An abstract implementation of a group of value models implementing a value policy across several models, such as mutual exclusion. When value models are added to the list, the group adds itself as a property value change listeners to the model, listening for changes in the value.
    Author:
    Garret Wilson.
    See Also:
    ValueModel
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void addImpl​(ValueModel<V> valueModel)
      Actual implementation of adding a model to the group.
      void propertyChange​(java.beans.PropertyChangeEvent propertyChangeEvent)  
      protected void removeImpl​(ValueModel<V> valueModel)
      Actual implementation of removing a model from the group.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface com.globalmentor.beans.GenericPropertyChangeListener

        propertyChange
    • Constructor Detail

      • ValuePolicyModelGroup

        public ValuePolicyModelGroup​(ValueModel<V>... models)
        Model constructor.
        Parameters:
        models - Zero or more models with which to initially place in the group.
        Throws:
        java.lang.NullPointerException - if one of the models is null.
    • Method Detail

      • addImpl

        protected void addImpl​(ValueModel<V> valueModel)
        Actual implementation of adding a model to the group.

        This version adds this class instance as a listener to the model's value changing.

        Overrides:
        addImpl in class AbstractModelGroup<ValueModel<V>>
        Parameters:
        valueModel - The model to add to the group.
      • removeImpl

        protected void removeImpl​(ValueModel<V> valueModel)
        Actual implementation of removing a model from the group.

        This version removes this class instance as a listener to the model's value changing.

        Overrides:
        removeImpl in class AbstractModelGroup<ValueModel<V>>
        Parameters:
        valueModel - The model to remove from the group.
      • propertyChange

        public final void propertyChange​(java.beans.PropertyChangeEvent propertyChangeEvent)
        Specified by:
        propertyChange in interface java.beans.PropertyChangeListener