net.sourceforge.groboutils.pmti.v1.defimpl
Class AbstractEditableListAttribute

java.lang.Object
  extended bynet.sourceforge.groboutils.pmti.v1.defimpl.AbstractEditableListAttribute
All Implemented Interfaces:
IAttribute, IEditableAttribute, IEditableListAttribute, IListAttribute

public abstract class AbstractEditableListAttribute
extends java.lang.Object
implements IEditableListAttribute

A simple name-value association for a specific kind of issue attribute. All implementations of IAttribute are immutable, unless they also implement IEditableAttribute.

Since:
July 12, 2002
Version:
$Date: 2003/02/10 22:51:57 $
Author:
Matt Albrecht groboclown@users.sourceforge.net

Constructor Summary
AbstractEditableListAttribute(IListAttribute a)
           
 
Method Summary
 void addValue(java.lang.Object value)
          This method still performs array checking.
 boolean containsValue(java.lang.Object value)
           
 IAttributeInfo getInfo()
          Returns the meta-information for this attribute.
 java.lang.Object getValue()
          Returns the enumeration for all values in this attribute.
 int getValueCount()
           
 java.util.Enumeration getValues()
          A synonym for getValue(), but redefined here to explicitly declare the returned type.
 boolean hasValueChanged()
           
protected abstract  boolean innerIsValidValue(java.lang.Object value)
          Simplified form of the value validation check.
 boolean isValidValue(java.lang.Object value)
          Specialization of the original purpose.
 void removeValue(java.lang.Object value)
          Does nothing if the value is not in the list of known values.
 void setValue(java.lang.Object value)
          This list version needs special handling for when the value is an array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractEditableListAttribute

public AbstractEditableListAttribute(IListAttribute a)
Method Detail

getValue

public java.lang.Object getValue()
Returns the enumeration for all values in this attribute.

Specified by:
getValue in interface IAttribute

getInfo

public IAttributeInfo getInfo()
Returns the meta-information for this attribute.

Specified by:
getInfo in interface IAttribute

getValues

public java.util.Enumeration getValues()
A synonym for getValue(), but redefined here to explicitly declare the returned type.

Specified by:
getValues in interface IListAttribute

getValueCount

public int getValueCount()
Specified by:
getValueCount in interface IListAttribute
Returns:
the number of value elements in this list attribute.

containsValue

public boolean containsValue(java.lang.Object value)
Specified by:
containsValue in interface IListAttribute

setValue

public void setValue(java.lang.Object value)
This list version needs special handling for when the value is an array.

Specified by:
setValue in interface IEditableAttribute
Throws:
java.lang.IllegalArgumentException - thrown if the value argument is invalid.

hasValueChanged

public boolean hasValueChanged()
Specified by:
hasValueChanged in interface IEditableAttribute
Returns:
true if the setValue( Object ) method has been called on this instance and the actual value has changed (via inspection with == and equals()), otherwise false.

isValidValue

public boolean isValidValue(java.lang.Object value)
Specialization of the original purpose. Allows for the value to be an array, in which case it checks each element. In the case of an array, the array is invalid if any one element inside is invalid. Do not override this method with an explicit array form - the Java calling methodology is NOT dynamic, so if this class is known as an IEditableAttribute, then this method will be invoked, not the array form.

Specified by:
isValidValue in interface IEditableAttribute

innerIsValidValue

protected abstract boolean innerIsValidValue(java.lang.Object value)
Simplified form of the value validation check. This method should not perform array checking.


addValue

public void addValue(java.lang.Object value)
This method still performs array checking.

Specified by:
addValue in interface IEditableListAttribute
Throws:
java.lang.IllegalArgumentException - thrown if the value argument is invalid.

removeValue

public void removeValue(java.lang.Object value)
Does nothing if the value is not in the list of known values.

Specified by:
removeValue in interface IEditableListAttribute


Copyright © 2001-2003 by The GroboUtils Project