com.rubecula.jquantity
Class IntegerPresentation

java.lang.Object
  extended bycom.rubecula.util.Presentation
      extended bycom.rubecula.jquantity.MutablePresentation
          extended bycom.rubecula.jquantity.IntegerPresentation
All Implemented Interfaces:
Auditable, java.lang.Cloneable, Identifiable, Mutable

public class IntegerPresentation
extends MutablePresentation

Presentation class to deal with integral objects in radix 10.

Since:
V_0_1
Version:
$Revision: 1.11 $
Author:
Robin Hillyard

Field Summary
(package private) static java.lang.String _PresentableClass
          This string defines the class which will be used to parse JQuantityPresentations.
(package private)  java.lang.String _String
          The integer as a string, without the radix.
private static int $10
           
 
Fields inherited from class com.rubecula.jquantity.MutablePresentation
 
Fields inherited from class com.rubecula.util.Presentation
_Appearance, $empty, $Stars
 
Constructor Summary
IntegerPresentation(java.lang.String integer)
           
 
Method Summary
 java.lang.String audit(java.lang.String label)
          Method to return a detailed string from an object for debugging purposes.
 AttrMap getAttributes()
          Return the attributes with which this presentation was created, or at least the best guess.
 java.lang.String getIdentifier()
          Method to get the specific identifier for an object.
 java.lang.String getPresentableClass()
          Method to get the name of the corresponding Presentable class for this Presentation.
 boolean isMutable()
          This method indicates whether this particular instance is mutable.
static void main(java.lang.String[] args)
          Main method for testing this class.
 Presentable parse()
          Convert this Presentation into a Presentable object.
(package private) static int StringToInt(java.lang.String s)
           
(package private) static int StringToInt(java.lang.String s, int radix)
           
(package private)  java.math.BigInteger toBigInteger()
          Return this in the form of a BigInteger.
(package private)  java.math.BigInteger toBigInteger(int radix)
          Return this in the form of a BigInteger interpreted in radix.
 java.lang.String toString(int width)
          Render this Presentation as a String with the given width limitation.
 
Methods inherited from class com.rubecula.jquantity.MutablePresentation
audit, audit, setConstant
 
Methods inherited from class com.rubecula.util.Presentation
toString, updateAppearance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

$10

private static final int $10
See Also:
Constant Field Values

_PresentableClass

static java.lang.String _PresentableClass
This string defines the class which will be used to parse JQuantityPresentations. Note: Currently the value is "com.rubecula.jquantity.WholeNumber".


_String

java.lang.String _String
The integer as a string, without the radix.

Constructor Detail

IntegerPresentation

public IntegerPresentation(java.lang.String integer)
                    throws PresentationException
Method Detail

main

public static void main(java.lang.String[] args)
Main method for testing this class.

Parameters:
args - String[] : the command line options.

getAttributes

public AttrMap getAttributes()
                      throws PresentationException
Return the attributes with which this presentation was created, or at least the best guess.

Specified by:
getAttributes in class Presentation
Returns:
a map of attributes used to render this Presentation. Currently returns an empty map.
Throws:
PresentationException

toString

public java.lang.String toString(int width)
Render this Presentation as a String with the given width limitation.

Specified by:
toString in class Presentation
Parameters:
width - the maximum number of characters allowed for depiction of this presentation.
Returns:
a representation (rendering) of this Presentation.

parse

public Presentable parse()
                  throws PresentationException
Convert this Presentation into a Presentable object.

Overrides:
parse in class Presentation
Returns:
an appropriate instance of WholeNumber.
Throws:
PresentationException

getPresentableClass

public java.lang.String getPresentableClass()
Method to get the name of the corresponding Presentable class for this Presentation.

Specified by:
getPresentableClass in class Presentation
Returns:
_PresentableClass.

audit

public java.lang.String audit(java.lang.String label)
Description copied from interface: Auditable
Method to return a detailed string from an object for debugging purposes.

Parameters:
label - the label to associate with the data. If label is non-null, a more detailed audit will be returned (this normally occurs only at the top level).
Returns:
the detailed string.

getIdentifier

public java.lang.String getIdentifier()
Description copied from interface: Identifiable
Method to get the specific identifier for an object.

Returns:
the identifier.

isMutable

public boolean isMutable()
This method indicates whether this particular instance is mutable.

Specified by:
isMutable in interface Mutable
Overrides:
isMutable in class MutablePresentation
Returns:
true.

toBigInteger

final java.math.BigInteger toBigInteger()
Return this in the form of a BigInteger.

Returns:
the BigInteger corresponding to this.

toBigInteger

final java.math.BigInteger toBigInteger(int radix)
Return this in the form of a BigInteger interpreted in radix.

Parameters:
radix - the base of number in which to interpret this integer presentation.
Returns:
the BigInteger corresponding to this.

StringToInt

static int StringToInt(java.lang.String s)

StringToInt

static int StringToInt(java.lang.String s,
                       int radix)