com.rubecula.jquantity
Interface Typed

All Known Implementing Classes:
Value

public interface Typed

This interface is implemented by classes which have a type, i.e. their numerical value is not necessarily what it appears to be.

Version:
$Revision: 1.1 $
Author:
Robin Hillyard

Method Summary
 void cast(ValueType type)
          MUTATING METHOD! This method sets the type of the object to be type.
 void convert(ValueType type)
          MUTATING METHOD! This method sets the type of the object to be type.
 double getRealValue()
          This method is used to get the the true value of this.
 ValueType getType()
          Method to get the type of this object.
 ValueType getTypeClass()
          Method to get the type class of this object.
 boolean isReal()
          Method to determine if this is real-typed.
 void setType(ValueType type)
          Method to set the type of this object.
 void updateRealEstimate()
          MUTATING METHOD! This method does not affect the critical values of this object.
 

Method Detail

setType

public void setType(ValueType type)
Method to set the type of this object.

Parameters:
type - the new type for this.

getType

public ValueType getType()
Method to get the type of this object.

Returns:
the type of this.

getTypeClass

public ValueType getTypeClass()
Method to get the type class of this object.

Returns:
the type-class of this, having one of the values:
  • ValueType.$ClassReal
  • ValueType.$ClassLog
  • ValueType.$ClassExp
  • ValueType.$ClassNone
.

isReal

public boolean isReal()
Method to determine if this is real-typed. Equivalent to getTypeClass()==ValueType.$ClassReal.

Returns:
true if the type of this object is of the real class.

cast

public void cast(ValueType type)
MUTATING METHOD! This method sets the type of the object to be type. The numerical setting(s) of the object remain unchanged, so that in general the equivalent value of this will change as a result.

Parameters:
type - the new type.

convert

public void convert(ValueType type)
MUTATING METHOD! This method sets the type of the object to be type. The numerical setting(s) of the object will if necessary change in such a way that the true value of this remains unchanged.

Parameters:
type - the new type.

getRealValue

public double getRealValue()
This method is used to get the the true value of this.

Returns:
this' true (effective) value.

updateRealEstimate

public void updateRealEstimate()
MUTATING METHOD! This method does not affect the critical values of this object. It updates the current real estimate (for debugging purposes).