|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.rubecula.util.Presentation
com.rubecula.jquantity.JQuantityPresentation
This class is a string-component representation of a JQuantity.
| Field Summary | |
private java.lang.String |
_Identifier
The identifier for this object. |
private NumberPresentation |
_Imaginary
The presentation for the imaginary part, if any. |
(package private) static java.lang.String |
_PresentableClass
This string defines the class which will be used to parse JQuantityPresentations. |
private NumberPresentation |
_Real
The presentation for the real part. |
private java.lang.String |
_Units
The units part of the JQuantity (or ""). |
private static char |
$DelimiterId
Delimiter to terminate an identifier prefix, if any. |
private static char |
$DelimiterImaginary
Delimiter to initiate an imaginary part, if any. |
private static char |
$DelimiterUnits
Delimiter to initiate an units part, if any. |
| Fields inherited from class com.rubecula.util.Presentation |
_Appearance, $empty, $Stars |
| Constructor Summary | |
JQuantityPresentation()
Empty constructor to create an undefine JQuantityPresentation. |
|
JQuantityPresentation(java.lang.String identifier,
NumberPresentation real,
NumberPresentation imag,
java.lang.String units)
Primary constructor to create an identified, possibly complex, JQuantityPresentation, optionally with defined Units. |
|
JQuantityPresentation(java.lang.String identifier,
java.lang.String real)
Secondary constructor to create an identified, JQuantityPresentation, optionally with defined Units. |
|
JQuantityPresentation(java.lang.String identifier,
java.lang.String real,
java.lang.String units)
Secondary constructor to create an identified, JQuantityPresentation, optionally with defined Units. |
|
JQuantityPresentation(java.lang.String identifier,
java.lang.String real,
java.lang.String imag,
java.lang.String units)
Secondary constructor to create an identified, possibly complex, JQuantityPresentation, optionally with defined Units. |
|
| Method Summary | |
java.lang.String |
audit(java.lang.String label)
Method to return a detailed string from an arithmetical 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. |
NumberPresentation |
getImag()
|
java.lang.String |
getPresentableClass()
Method to get the name of the corresponding Presentable class for this Presentation. |
NumberPresentation |
getReal()
|
java.lang.String |
getUnitsPart()
|
static void |
main(java.lang.String[] args)
Main method for testing this class. |
void |
setIdentifier(java.lang.String identifier)
Method to set a specific identifier to an object. |
Presentation |
setValue(java.lang.String source)
Fix the value of this Presentation according to the given string s. |
java.lang.String |
toString(int width)
Render this Presentation as a String within the width specified. |
static JQuantityPresentation |
valueOf(java.lang.String string)
Factory method to create a JQuantityPresentation from a String. |
| Methods inherited from class com.rubecula.util.Presentation |
audit, audit, parse, toString, updateAppearance |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
static java.lang.String _PresentableClass
private static final char $DelimiterId
private static final char $DelimiterImaginary
private static final char $DelimiterUnits
private java.lang.String _Units
private java.lang.String _Identifier
private NumberPresentation _Real
private NumberPresentation _Imaginary
| Constructor Detail |
public JQuantityPresentation(java.lang.String identifier,
NumberPresentation real,
NumberPresentation imag,
java.lang.String units)
identifier - a String to be used to identify this presentation.real - a NumberPresentation representing the real part of this presentation.imag - a NumberPresentation representing the imaginary part of this presentation.units - a String to represent the units (may be "").
public JQuantityPresentation(java.lang.String identifier,
java.lang.String real,
java.lang.String imag,
java.lang.String units)
throws PresentationException
identifier - a String to be used to identify this presentation.real - a string representing the real part of this presentation.imag - a string representing the imaginary part of this presentation.units - a String to represent the units (may be "").
PresentationException
public JQuantityPresentation(java.lang.String identifier,
java.lang.String real,
java.lang.String units)
throws PresentationException
identifier - a String to be used to identify this presentation.real - a String representing the real part of this presentation (see ValuePresentation).units - a String to represent the units (or null).
PresentationException
public JQuantityPresentation(java.lang.String identifier,
java.lang.String real)
throws PresentationException
identifier - a String to be used to identify this presentation.real - a String representing the real part of this presentation (see ValuePresentation).
PresentationExceptionpublic JQuantityPresentation()
| Method Detail |
public static JQuantityPresentation valueOf(java.lang.String string)
throws PresentationException
string - the string from which to create the JQuantityPresentation.
PresentationExceptionpublic java.lang.String getPresentableClass()
getPresentableClass in class Presentation_PresentableClass.
public Presentation setValue(java.lang.String source)
throws PresentationException
source - the string representing all aspects of this value.
The format of the string is:
[Identifier ':'] ValuePresentation ['i' ValuePresentation ] ['@' Units]
PresentationExceptioneither the (required) real part or the (optional) imaginary part.
- Units
- the name of the Units
public AttrMap getAttributes()
throws PresentationException
getAttributes in class PresentationPresentationExceptionpublic java.lang.String toString(int width)
toString in class Presentationwidth - the max. number of characters within which to output the presentation.
public void setIdentifier(java.lang.String identifier)
setIdentifier in interface Nameableidentifier - String: the identifier to associate with the objectpublic java.lang.String getIdentifier()
getIdentifier in interface Identifiablepublic java.lang.String audit(java.lang.String label)
audit in interface Auditablelabel - String: the label to associate with the data
public NumberPresentation getReal()
public NumberPresentation getImag()
public java.lang.String getUnitsPart()
public static void main(java.lang.String[] args)
args - String[] : the command line options.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||