de.dfki.mycbr.core.casebase
Class StringAttribute

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.StringAttribute
All Implemented Interfaces:
IExplainable

public final class StringAttribute
extends SimpleAttribute

Represents strings used in query/cases. Currently, each StringAttribute object is used once, meaning that it is not referenced when used in several cases. This is because usually one string does not appear more than once.

Author:
myCBR Team

Method Summary
 boolean equals(StringAttribute att)
          Returns true, if this attribute equals the given attribute.
 java.lang.String getValue()
          Gets the value of this attribute.
 java.lang.String getValueAsString()
          Returns a string representation of this attribute's value.
 int hashCode()
           
 java.lang.String toString()
          Returns the string representation of this attribute's value.
 
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, notify, notifyAll, wait, wait, wait
 

Method Detail

getValue

public java.lang.String getValue()
Gets the value of this attribute.

Returns:
the value

toString

public java.lang.String toString()
Returns the string representation of this attribute's value.

Overrides:
toString in class java.lang.Object
Returns:
the string representation of the 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

equals

public boolean equals(StringAttribute att)
Returns true, if this attribute equals the given attribute. A string attribute is equal to another if the respective attribute values equal.

Parameters:
att - the attribute to be compared with this.
Returns:
true, if values of attributes equal, false otherwise.

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
Returns:
hash value for this