JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.util.formulae
Class MathScalar

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

public class MathScalar
extends MathValue

MathScalar is a scalar constant represented as a MathValue. By encapsulating it in this fashion we can potentially extend this class in future to support complex numbers as well as integer and real numbers.


Field Summary
protected  Number realValue
          A real number stored in the appropriate format
 
Fields inherited from class com.klg.jclass.util.formulae.MathValue
dataFormat
 
Constructor Summary
MathScalar()
          Create a MathScalar (default value 0.0)
MathScalar(double value)
          Create a MathScalar from a double
MathScalar(int value)
          Create a MathScalar from an integer
MathScalar(Number value)
          Create a MathScalar from a Number
 
Method Summary
 Number[][] matrixValue()
          Get the contents of this MathValue as a matrix of Numbers
 Number numberValue()
          Get the contents of this MathValue as a Number
 String toString()
          Return a string representation of this value
 Number[] vectorValue()
          Get the contents of this MathValue as a vector of Numbers
 
Methods inherited from class com.klg.jclass.util.formulae.MathValue
clone, evaluate, getDataFormat, setDataFormat
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

realValue

protected Number realValue
A real number stored in the appropriate format

Constructor Detail

MathScalar

public MathScalar()
Create a MathScalar (default value 0.0)


MathScalar

public MathScalar(double value)
Create a MathScalar from a double


MathScalar

public MathScalar(int value)
Create a MathScalar from an integer


MathScalar

public MathScalar(Number value)
Create a MathScalar from a Number

Method Detail

numberValue

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

Specified by:
numberValue in class MathValue
Returns:
A Number which is the contents of this MathValue

vectorValue

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

Specified by:
vectorValue in class MathValue
Returns:
A vector of Numbers which is the contents of this MathValue

matrixValue

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

Specified by:
matrixValue in class MathValue
Returns:
A matrix of Numbers which is the contents of this MathValue

toString

public String toString()
Return a string representation of this value

Overrides:
toString in class Object
Returns:
A string containing this value

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