de.dfki.mycbr.core.casebase
Class MultipleAttribute<Type extends AttributeDesc>

java.lang.Object
  extended by java.util.Observable
      extended by de.dfki.mycbr.core.casebase.Attribute
          extended by de.dfki.mycbr.core.casebase.MultipleAttribute<Type>
Type Parameters:
Type - type of attribute description describing single values contained in this collection

public final class MultipleAttribute<Type extends AttributeDesc>
extends Attribute

Represents sets of values in query/case. The class Type should be a class which extends. AttributeDesc class and corresponds to the description of the values contained in the mentioned set. This class is a wrapper for the original values which are maintained by a class implementing Range.

Author:
myCBR Team

Constructor Summary
MultipleAttribute(Type desc, java.util.LinkedList<Attribute> l1)
          Initializes this with empty value.
 
Method Summary
 void addValue(Attribute value)
          Adds the given attribute to the list of values for this attribute.
 Type getAttributeDesc()
           
 java.lang.String getValueAsString()
          Returns a string representation of this attribute's value.
 java.util.List<Attribute> getValues()
          Gets the list of values for this attribute.
 void removeValue(Attribute value)
          Adds the given attribute to the list of values for this attribute.
 java.lang.String toString()
          Returns the string representation of this attribute as the concatenation of the string representations of the single values.
 
Methods inherited from class java.util.Observable
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MultipleAttribute

public MultipleAttribute(Type desc,
                         java.util.LinkedList<Attribute> l1)
Initializes this with empty value.

Parameters:
desc - the description of this attribute.
l1 - list of values for this collection
Method Detail

getValues

public java.util.List<Attribute> getValues()
Gets the list of values for this attribute.

Returns:
the values

addValue

public void addValue(Attribute value)
Adds the given attribute to the list of values for this attribute.

Parameters:
value - the attribute to be added

removeValue

public void removeValue(Attribute value)
Adds the given attribute to the list of values for this attribute.

Parameters:
value - the attribute to be added

toString

public java.lang.String toString()
Returns the string representation of this attribute as the concatenation of the string representations of the single values.

Overrides:
toString in class java.lang.Object
Returns:
string representation of this attribute's value

getValueAsString

public java.lang.String getValueAsString()
Description copied from class: Attribute
Returns a string representation of this attribute's value. Mostly used for saving cases to internal XML file.

Specified by:
getValueAsString in class Attribute
Returns:
the value of this attribute as string

getAttributeDesc

public Type getAttributeDesc()
Returns:
the type of this attribute