Class ValuePolicyModelGroup<V>

java.lang.Object
io.guise.framework.model.AbstractModelGroup<ValueModel<V>>
io.guise.framework.model.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>>, PropertyChangeListener, 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:
  • Constructor Details

    • ValuePolicyModelGroup

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

    • 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(PropertyChangeEvent propertyChangeEvent)
      Specified by:
      propertyChange in interface PropertyChangeListener