Package io.guise.framework.model
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>>
,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
-
-
Constructor Summary
Constructors Constructor Description ValuePolicyModelGroup(ValueModel<V>... models)
Model constructor.
-
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 io.guise.framework.model.AbstractModelGroup
add, contains, getModelSet, remove
-
-
-
-
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 isnull
.
-
-
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 classAbstractModelGroup<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 classAbstractModelGroup<ValueModel<V>>
- Parameters:
valueModel
- The model to remove from the group.
-
propertyChange
public final void propertyChange(java.beans.PropertyChangeEvent propertyChangeEvent)
- Specified by:
propertyChange
in interfacejava.beans.PropertyChangeListener
-
-