|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface IlpAttributeValueHolder
This interface defines methods for classes that can store attributes and their values.
An IlpAttributeValueHolder can store one value for each
attribute. A possible value is null. The value can be retrieved
through the method getAttributeValue.
Note: When no value has been set for an attribute,
getAttributeValue returns VALUE_NOT_SET.
| Field Summary | |
|---|---|
static Object |
VALUE_NOT_SET
Value returned by getAttributeValue when no value has been set
for a given attribute. |
| Method Summary | |
|---|---|
void |
addAttributeValueListener(AttributeValueListener l)
Adds a listener to attribute value changes. |
void |
fireEvent(AttributeValueEvent ev)
Fires an event to the listeners. |
IlpAttributeGroup |
getAttributeGroup()
Returns the model that defines which attributes are allowed in this instance. |
Object |
getAttributeValue(IlpAttribute attribute)
Retrieves the value of an attribute of this object. |
Object |
getAttributeValue(String attributeName)
Retrieves 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
a value has been set for this 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 attributeName,
Object value)
Sets the value of an attribute of this object. |
| Field Detail |
|---|
static final Object VALUE_NOT_SET
getAttributeValue when no value has been set
for a given attribute.
| Method Detail |
|---|
IlpAttributeGroup getAttributeGroup()
Object getAttributeValue(IlpAttribute attribute)
attribute - The attribute.
VALUE_NOT_SET if no
value has been set.boolean hasAttributeValue(IlpAttribute a)
true if:
void setAttributeValue(IlpAttribute attribute,
Object value)
VALUE_NOT_SET for the value argument.Note: For the new value to be taken into account, set an object that is different from the initial object.
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);
attribute - 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.Object getAttributeValue(String attributeName)
attributeName - The name of the attribute.
VALUE_NOT_SET if no
value has been set.
void setAttributeValue(String attributeName,
Object value)
VALUE_NOT_SET for the value argument.Note: For the new value to be taken into account, set an object that is different from the initial object.
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);
attributeName - 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.void addAttributeValueListener(AttributeValueListener l)
void removeAttributeValueListener(AttributeValueListener l)
void fireEvent(AttributeValueEvent ev)
|
||||||||||
| PREV CLASS Documentation homepage NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||