com.rubecula.jquantity
Class UnitsFoundation

java.lang.Object
  |
  +--com.rubecula.jquantity.Item
        |
        +--com.rubecula.jquantity.BaseUnit
              |
              +--com.rubecula.jquantity.UnitsFoundation
All Implemented Interfaces:
Auditable, java.lang.Comparable, Identifiable, Measurable, Nameable, Presentable, java.io.Serializable
Direct Known Subclasses:
Units

public abstract class UnitsFoundation
extends BaseUnit
implements Nameable

The public abstract class UnitsFoundation is the base class from which the other Units (Measurable) classes are derived.

Version:
$Revision: 1.4 $
Author:
Robin Hillyard
See Also:
Serialized Form

Nested Class Summary
 class UnitsFoundation.UnitsException
           
 
Field Summary
protected  UnitsName _Name
          The name by which this UnitsFoundation will be identified.
 
Constructor Summary
(package private) UnitsFoundation()
           
(package private) UnitsFoundation(UnitsFoundation that)
           
(package private) UnitsFoundation(UnitsName name)
           
 
Method Summary
 java.lang.String audit()
          Method to return a detailed (unlabeled) string from an Auditable object for debugging purposes.
 void audit(java.io.PrintStream out, java.lang.String label)
          Method to output detailed string from an object for debugging purposes.
 java.lang.String audit(java.lang.String label)
          Method to return a detailed string from an arithmetical object for debugging purposes.
 java.lang.String getIdentifier()
          Method to get the specific identifier for an object.
 java.lang.String getName()
           
 boolean isNumber()
          Method to determine if this is dimensionless (i.e.
(package private)  void monitor(java.lang.String method, java.lang.String[] args, java.lang.String result)
           
(package private)  int normalize()
           
 void setIdentifier(java.lang.String identifier)
          Method to set a specific identifier to an object.
 void setName(java.lang.String name)
           
 void setName(java.lang.String nameAbbrev, boolean force)
           
 void setName(java.lang.String nameAbbrev, int exponent, boolean force)
           
 void setName(UnitsName name)
           
 void setName(UnitsName name, boolean force)
           
 void setName(UnitsName name, boolean force, int sysIndex)
           
 java.lang.String toString()
          This is the default toString method for all Items.
abstract  java.lang.String toString(int sysIndex)
           
 
Methods inherited from class com.rubecula.jquantity.BaseUnit
flatten, isEqual, isInSystem, isParallel
 
Methods inherited from class com.rubecula.jquantity.Item
compareTo, Debug, getClassNameShort, getType, IsDebug, present, SetDebug, test, test, Wrap
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.rubecula.jquantity.Measurable
getDimensions, getOffset, getScale
 
Methods inherited from interface com.rubecula.util.Presentable
makePresentableInstance, present
 

Field Detail

_Name

protected UnitsName _Name
The name by which this UnitsFoundation will be identified.

Constructor Detail

UnitsFoundation

UnitsFoundation()

UnitsFoundation

UnitsFoundation(UnitsName name)

UnitsFoundation

UnitsFoundation(UnitsFoundation that)
Method Detail

setIdentifier

public void setIdentifier(java.lang.String identifier)
Method to set a specific identifier to an object.

Specified by:
setIdentifier in interface Nameable
Parameters:
identifier - String: the identifier to associate with the object

getIdentifier

public java.lang.String getIdentifier()
Method to get the specific identifier for an object.

Specified by:
getIdentifier in interface Identifiable
Returns:
String: the identifier.

audit

public java.lang.String audit(java.lang.String label)
Method to return a detailed string from an arithmetical object for debugging purposes.

Specified by:
audit in interface Auditable
Parameters:
label - String: the label to associate with the data
Returns:
the detailed string.

audit

public java.lang.String audit()
Method to return a detailed (unlabeled) string from an Auditable object for debugging purposes.

Specified by:
audit in interface Auditable
Overrides:
audit in class Item
Returns:
the detailed string.

audit

public void audit(java.io.PrintStream out,
                  java.lang.String label)
Description copied from class: Item
Method to output detailed string from an object for debugging purposes.

Specified by:
audit in interface Auditable
Overrides:
audit in class Item
Parameters:
out - the output stream.
label - the label to attach to the output (may be null).

isNumber

public boolean isNumber()
Method to determine if this is dimensionless (i.e. unitless).

Overrides:
isNumber in class BaseUnit
Returns:
true if not in any System.

normalize

final int normalize()

toString

public abstract java.lang.String toString(int sysIndex)

toString

public java.lang.String toString()
Description copied from class: Item
This is the default toString method for all Items. Specific classes will override as appropriate.

Overrides:
toString in class Item
Returns:
a String representing this Item by first converting it to a Presentation and then rendering that with no length constraint.

setName

public final void setName(UnitsName name,
                          boolean force,
                          int sysIndex)

setName

public final void setName(UnitsName name,
                          boolean force)

setName

public final void setName(java.lang.String nameAbbrev,
                          int exponent,
                          boolean force)

setName

public final void setName(java.lang.String nameAbbrev,
                          boolean force)

setName

public final void setName(UnitsName name)

setName

public final void setName(java.lang.String name)

getName

public final java.lang.String getName()

monitor

void monitor(java.lang.String method,
             java.lang.String[] args,
             java.lang.String result)