JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.util.formulae
Class MathValue

java.lang.Object
  |
  +--com.klg.jclass.util.formulae.MathValue
All Implemented Interfaces:
Cloneable, Expression, Result
Direct Known Subclasses:
MathMatrix, MathScalar, MathVector

public abstract class MathValue
extends Object
implements Result, Cloneable

The class MathValue forms the root for all derived constant-based result/data classes.


Field Summary
 NumberFormat dataFormat
          The format used to output values stored in results
 
Constructor Summary
MathValue()
           
 
Method Summary
 Object clone()
          Return an Expression which is a copy of this MathValue
 com.klg.jclass.util.formulae.Result evaluate()
          Satisfy the Expression interface by returning the stored value (no evaluation is required).
 NumberFormat getDataFormat()
          Retrieve the NumberFormat associated with this data
abstract  Number[][] matrixValue()
          Get the contents of this MathValue as a matrix of Numbers
abstract  Number numberValue()
          Get the contents of this MathValue as a Number
 void setDataFormat(NumberFormat format)
          Set a NumberFormat to use on the contents of this MathValue
abstract  Number[] vectorValue()
          Get the contents of this MathValue as a vector of Numbers
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dataFormat

public NumberFormat dataFormat
The format used to output values stored in results

Constructor Detail

MathValue

public MathValue()
Method Detail

evaluate

public com.klg.jclass.util.formulae.Result evaluate()
Satisfy the Expression interface by returning the stored value (no evaluation is required).

Specified by:
evaluate in interface Expression
Returns:
The value this object represents

getDataFormat

public NumberFormat getDataFormat()
Retrieve the NumberFormat associated with this data

Returns:
The NumberFormat used to convert this data to a String

setDataFormat

public void setDataFormat(NumberFormat format)
Set a NumberFormat to use on the contents of this MathValue

Parameters:
format - The NumberFormat to be used to format this as a String

numberValue

public abstract Number numberValue()
Get the contents of this MathValue as a Number

Returns:
A Number which is the contents of this MathValue

vectorValue

public abstract Number[] vectorValue()
Get the contents of this MathValue as a vector of Numbers

Returns:
A vector of Numbers which is the contents of this MathValue

matrixValue

public abstract Number[][] matrixValue()
Get the contents of this MathValue as a matrix of Numbers

Returns:
A matrix of Numbers which is the contents of this MathValue

clone

public Object clone()
Return an Expression which is a copy of this MathValue

Specified by:
clone in interface Expression
Overrides:
clone in class Object

Copyright © 2004 Quest Software Inc..
All rights reserved.