|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectilog.cpl.model.IlpAttributeValueChangeSupport
ilog.cpl.model.IlpAttributeValueHolderSupport
public class IlpAttributeValueHolderSupport
This class models a default implementation for attribute holders.
| Field Summary |
|---|
| Fields inherited from interface ilog.cpl.model.IlpAttributeValueHolder |
|---|
VALUE_NOT_SET |
| Constructor Summary | |
|---|---|
IlpAttributeValueHolderSupport(IlpAttributeValueHolder source,
IlpAttributeGroup model)
Creates a new attribute holder based on the given model. |
|
IlpAttributeValueHolderSupport(IlpAttributeValueHolder source,
IlpAttributeGroup model,
IlpAttributeValueHolder defaultHolder)
Creates a new attribute holder based on the given model. |
|
| Method Summary | |
|---|---|
void |
addAttributeValueListener(AttributeValueListener l)
Adds a listener to attribute value changes. |
void |
attributeValueChange(AttributeValueEvent ev)
This method is called when an attribute value of the underlying attribute holder is modified. |
IlpAttributeGroup |
getAttributeGroup()
Returns the model that defines which attributes are allowed in this instance. |
Object |
getAttributeValue(IlpAttribute a)
Retrieves the value of an attribute of this object. |
Object |
getAttributeValue(String name)
Returns the value of an attribute of this object. |
boolean |
hasAttributeValue(IlpAttribute a)
Returns true if the requested attribute is part of the
attribute group of this instance and if a value has been set for this
attribute. |
void |
recomputeDependentAttributes(IlpAttribute a)
Verifies if any of the computed attributes in the computed attribute list depend on the given attribute. |
void |
removeAttributeValueListener(AttributeValueListener l)
Removes the given listener from the attribute value change notifications. |
void |
setAttributeValue(IlpAttribute attribute,
Object value)
Sets the value of an attribute of this object. |
void |
setAttributeValue(String name,
Object value)
Sets the value of an attribute of this object. |
| Methods inherited from class ilog.cpl.model.IlpAttributeValueChangeSupport |
|---|
fireAttributeChange, fireEvent, getSource, hasAttributeValueNotification |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface ilog.cpl.model.IlpAttributeValueHolder |
|---|
fireEvent |
| Constructor Detail |
|---|
public IlpAttributeValueHolderSupport(IlpAttributeValueHolder source,
IlpAttributeGroup model)
source - The IlpAttributeValueHolder that delegates its
method to this support class.model - The attribute model.
public IlpAttributeValueHolderSupport(IlpAttributeValueHolder source,
IlpAttributeGroup model,
IlpAttributeValueHolder defaultHolder)
source - This is the real IlpAttributeValueHolder.model - This is the attribute model which defines the valid
attributes for this holder.defaultHolder - This is a secondary
IlpAttributeValueHolder in which to
look if the attribute is not set locally.| Method Detail |
|---|
public IlpAttributeGroup getAttributeGroup()
getAttributeGroup in interface IlpAttributeValueHolderpublic Object getAttributeValue(IlpAttribute a)
getAttributeValue in interface IlpAttributeValueHoldera - The attribute.
VALUE_NOT_SET if no
value has been set.public boolean hasAttributeValue(IlpAttribute a)
true if the requested attribute is part of the
attribute group of this instance and if a value has been set for this
attribute.
hasAttributeValue in interface IlpAttributeValueHolder
public void setAttributeValue(IlpAttribute attribute,
Object value)
Object value = o.getAttributeValue(attribute); // Incorrect: the value is stored in the same object. The change is not // taken into account. value.modify(); o.setAttributeValue(attribute,value); // Correct: the new value is stored in a new object. The change is taken // into account. value = value.clone(); // Returns a new object value.modify(); o.setAttributeValue(attribute,value);
setAttributeValue in interface IlpAttributeValueHolderattribute - The attribute.value - The new value of the attribute or
VALUE_NOT_SET to remove the value of the
attribute.
IllegalArgumentException - if the attribute cannot have
its value modified.public Object getAttributeValue(String name)
getAttributeValue in interface IlpAttributeValueHoldername - The name of the attribute.
VALUE_NOT_SET if no
value has been set.
public void setAttributeValue(String name,
Object value)
Object value = o.getAttributeValue(name); // Incorrect: the value is stored in the same object. The change is not // taken into account. value.modify(); o.setAttributeValue(name,value); // Correct: the new value is stored in a new object. The change is taken // into account. value = value.clone(); // Returns a new object value.modify(); o.setAttributeValue(name,value);
setAttributeValue in interface IlpAttributeValueHoldername - The name of the attribute.value - The new value of the attribute or
VALUE_NOT_SET to remove the value of the
attribute.
IllegalArgumentException - if the attribute cannot have
its value modified.public void attributeValueChange(AttributeValueEvent ev)
attributeValueChange in interface AttributeValueListenerev - The attribute value event to be fired.public void addAttributeValueListener(AttributeValueListener l)
addAttributeValueListener in interface IlpAttributeValueHolderaddAttributeValueListener in class IlpAttributeValueChangeSupportpublic void removeAttributeValueListener(AttributeValueListener l)
removeAttributeValueListener in interface IlpAttributeValueHolderremoveAttributeValueListener in class IlpAttributeValueChangeSupportpublic void recomputeDependentAttributes(IlpAttribute a)
getAttributeValue.
|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||