de.dfki.mycbr.core.casebase
Class DoubleAttribute

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.DoubleAttribute
All Implemented Interfaces:
IExplainable, java.lang.Comparable<DoubleAttribute>

public final class DoubleAttribute
extends SimpleAttribute
implements java.lang.Comparable<DoubleAttribute>

Represents integers in query/cases. To avoid unnecessary objects, objects of this class should only be created by integer ranges. For a fixed integer # description, the integer attributes will then be referenced.

Author:
myCBR Team

Method Summary
 int compareTo(DoubleAttribute o)
          Compares this attribute to the given one.
 double getValue()
          Returns the numeric value of this attribute.
 java.lang.String getValueAsString()
          Returns a 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, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getValue

public double getValue()
Returns the numeric value of this attribute.

Returns:
the value of this attribute

compareTo

public int compareTo(DoubleAttribute o)
Compares this attribute to the given one. Returns 0 if the values are identical, -1 if this value is smaller than the given attribute's value and 1 otherwise.

Specified by:
compareTo in interface java.lang.Comparable<DoubleAttribute>
Parameters:
o - the attribute which should be compared to this
Returns:
comparison result of the respective attributes

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