uk.co.agena.minerva.util.model
Class DataPoint

java.lang.Object
  extended by uk.co.agena.minerva.util.model.DataPoint
All Implemented Interfaces:
java.lang.Cloneable, Writable
Direct Known Subclasses:
AbsoluteDataPoint, IntervalDataPoint, StringDataPoint

public class DataPoint
extends java.lang.Object
implements java.lang.Cloneable, Writable

A DataPoint represents a single numerical value. The numerical value that a DataPoint encapsulates has double precision.

Typically, a DataPoint is used to express a single probability value of an ExtendedState (or a single piece of evidence entered on it).


Field Summary
protected  int connObjectId
          The unique identifier of the object (e.g.
protected  java.lang.String label
          The label for this DataPoint.
protected  double value
          The actual value encapsulated by this DataPoint.
static double version
           
 
Fields inherited from interface uk.co.agena.minerva.util.model.Writable
FIELD_SEPARATOR
 
Constructor Summary
DataPoint()
          Default constructor.
DataPoint(double value)
           
DataPoint(java.lang.String label)
           
DataPoint(java.lang.String label, double value, int connObjectId)
          Creates a DataPoint with the specified label, connected object ID (e.g.
 
Method Summary
 java.lang.Object clone()
          Creates a copy of this DataPoint.
 double getAdjustedValue()
          Returns a double value that is equal to the value encapsulated by the DataPoint.
 int getConnObjectId()
          Returns the connected object ID of the DataPoint.
 java.lang.String getLabel()
          Returns the label of the DataPoint.
 double getValue()
          Returns the double value encapsulated by the DataPoint.
 double getVersion()
          Returns the version of the class.
 int read(java.util.List strings, int currentLineNumber)
           
protected  void readRestOfFields(java.util.StringTokenizer st)
           
 void setConnObjectId(int connObjectId)
          Sets the connected object ID of the DataPoint to the ID specified.
 void setLabel(java.lang.String label)
          Sets the label of the DataPoint to the label specified.
 void setValue(double value)
          Sets the value of the DataPoint to the value specified.
 void setVersion(double version)
          Sets the version number of the class.
 java.lang.String toHTMLString(boolean includeHTMLTag, java.lang.String formatterMask)
          This method will render the data set to an HTML string.
 java.lang.String toString()
          Returns a string representation of the DataPoint in the format: [LABEL] = [VALUE]
 java.lang.String toString(java.lang.String formatterMask)
          This method will render the data set to a string.
 java.util.List write()
          Writes the object in question to a List of Strings.
protected  void writeRestOfFields(java.lang.StringBuffer sb)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

version

public static double version

label

protected java.lang.String label
The label for this DataPoint.


value

protected double value
The actual value encapsulated by this DataPoint.


connObjectId

protected int connObjectId
The unique identifier of the object (e.g. ExtendedState) with which this DataPoint is associated.

Constructor Detail

DataPoint

public DataPoint()
Default constructor.


DataPoint

public DataPoint(java.lang.String label,
                 double value,
                 int connObjectId)
Creates a DataPoint with the specified label, connected object ID (e.g. ExtendedState) and value.

Parameters:
label - the String label of the DataPoint
value - the double value of the DataPoint
connObjectId - the ID of the object to which the DataPoint applies

DataPoint

public DataPoint(java.lang.String label)

DataPoint

public DataPoint(double value)
Method Detail

getVersion

public double getVersion()
Description copied from interface: Writable
Returns the version of the class. Used to ensure backward compatibility.

Specified by:
getVersion in interface Writable
Returns:
the version number

setVersion

public void setVersion(double version)
Description copied from interface: Writable
Sets the version number of the class. Used to ensure backward compatibility.

Specified by:
setVersion in interface Writable
Parameters:
version - the version number

getValue

public double getValue()
Returns the double value encapsulated by the DataPoint.

Returns:
the double value of the DataPoint

getAdjustedValue

public double getAdjustedValue()
Returns a double value that is equal to the value encapsulated by the DataPoint. This method can be overridden by other classes to return a adjusted value. The manor of the adjustment is left to the sub class.

Returns:

setValue

public void setValue(double value)
Sets the value of the DataPoint to the value specified.

Parameters:
value - the new value for the DataPoint

getConnObjectId

public int getConnObjectId()
Returns the connected object ID of the DataPoint.

Returns:
the connected object ID of the DataPoint

setConnObjectId

public void setConnObjectId(int connObjectId)
Sets the connected object ID of the DataPoint to the ID specified.

Parameters:
connObjectId - the new connected object ID for the DataPoint

getLabel

public java.lang.String getLabel()
Returns the label of the DataPoint.

Returns:
the label of the DataPoint

setLabel

public void setLabel(java.lang.String label)
Sets the label of the DataPoint to the label specified.

Parameters:
label - the new label for the DataPoint

toString

public java.lang.String toString()
Returns a string representation of the DataPoint in the format: [LABEL] = [VALUE]

Overrides:
toString in class java.lang.Object
Returns:
the String representation of the DataPoint

clone

public java.lang.Object clone()
Creates a copy of this DataPoint.

Overrides:
clone in class java.lang.Object
Returns:
a copy of this DataPoint.

write

public java.util.List write()
                     throws MinervaReadWriteException
Description copied from interface: Writable
Writes the object in question to a List of Strings.

Specified by:
write in interface Writable
Returns:
the List to which the Strings have been written
Throws:
MinervaReadWriteException - if there

read

public int read(java.util.List strings,
                int currentLineNumber)
         throws MinervaReadWriteException
Specified by:
read in interface Writable
Throws:
MinervaReadWriteException

readRestOfFields

protected void readRestOfFields(java.util.StringTokenizer st)

writeRestOfFields

protected void writeRestOfFields(java.lang.StringBuffer sb)

toHTMLString

public java.lang.String toHTMLString(boolean includeHTMLTag,
                                     java.lang.String formatterMask)
This method will render the data set to an HTML string. Each data point will occupy its own line and be formatted :

Parameters:
includeHTMLTag - determines whether the string should be begun and ended with
formatterMask - if not "" then this method will apply the specified formatter mask to the value when turning it into a string
Returns:

toString

public java.lang.String toString(java.lang.String formatterMask)
This method will render the data set to a string. :

Parameters:
formatterMask - if not "" then this method will apply the specified formatter mask to the value when turning it into a string
Returns:


Copyright © 2006 Agena Ltd. All Rights Reserved.