de.dfki.mycbr.core.casebase
Class SymbolAttribute

java.lang.Object
  extended by java.util.Observable
      extended by de.dfki.mycbr.core.casebase.Attribute
          extended by de.dfki.mycbr.core.casebase.SimpleAttribute
              extended by de.dfki.mycbr.core.casebase.SymbolAttribute
All Implemented Interfaces:
IExplainable, TaxonomyNode
Direct Known Subclasses:
SpecialAttribute

public class SymbolAttribute
extends SimpleAttribute
implements TaxonomyNode

Represents values of symbol attribute descriptions (for example: color could have green, blue, red, ... as SymbolAttribute objects). A symbol attribute depends on a description (so if you have two attribute descriptions for color there would be two SymbolAttribute objects for green). However, if green (for a fixed description) appears in several cases, the corresponding SymbolAttribute object is referenced. SymbolAttribut objects are maintained by SymbolRange

Author:
myCBR Team

Constructor Summary
SymbolAttribute(SymbolDesc desc, java.lang.String v)
          Creates new symbol with the specified value for the specified description.
 
Method Summary
 java.util.List<TaxonomyNode> getNodes()
          Returns a list of nodes allowed for the taxonomy this is contained in.
 java.lang.String getValue()
          Returns the value of this symbol.
 java.lang.String getValueAsString()
          Returns a string representation of this attribute.
 void setValue(java.lang.String v)
          Updates the value of this symbol.
 java.lang.String toString()
          Returns string representation of this symbol.
 
Methods inherited from class de.dfki.mycbr.core.casebase.SimpleAttribute
getAttributeDesc, getDesc, getExpType, getName, setDesc
 
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

SymbolAttribute

public SymbolAttribute(SymbolDesc desc,
                       java.lang.String v)
Creates new symbol with the specified value for the specified description. It is assumed that this value is an allowed value of the given description.

Parameters:
desc - the description having value as allowed value
v - the value representing this symbol
Method Detail

setValue

public final void setValue(java.lang.String v)
Updates the value of this symbol. It is assumed that the symbol range which maintains this symbol attribute, does not contain another symbol attribute with this value.

Parameters:
v - the value to be used for this symbol

getValue

public final java.lang.String getValue()
Returns the value of this symbol. This value is unique within the scope of this attribute's description.

Returns:
the value representing this symbol

toString

public final java.lang.String toString()
Returns string representation of this symbol. Returns the result of getValue()

Overrides:
toString in class java.lang.Object
Returns:
the string representation of this symbol

getValueAsString

public final java.lang.String getValueAsString()
Returns a string representation of this attribute.

Specified by:
getValueAsString in class Attribute
Returns:
string representation of this attribute

getNodes

public java.util.List<TaxonomyNode> getNodes()
Description copied from interface: TaxonomyNode
Returns a list of nodes allowed for the taxonomy this is contained in. Does not include root, although root is TaxonomyNode, too.

Specified by:
getNodes in interface TaxonomyNode
Returns:
list of nodes for the corresponding taxonomy