|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.rubecula.util.Presentation com.rubecula.jquantity.MutablePresentation com.rubecula.jquantity.QuantityPresentation
Presentation class to deal with quantity objects.
Field Summary | |
(package private) Presentation |
_Number
A Presentation representing the number part of this quantity. |
(package private) static java.lang.String |
_PresentableClass
This string defines the class which will be used to parse JQuantityPresentations. |
(package private) java.lang.String |
_Units
A String representing the units of this quantity. |
static char |
$At
The character value "@". |
Fields inherited from class com.rubecula.jquantity.MutablePresentation |
|
Fields inherited from class com.rubecula.util.Presentation |
_Appearance, $empty, $Stars |
Constructor Summary | |
QuantityPresentation(Presentation number,
java.lang.String units)
|
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. |
java.lang.String |
toString(int width)
Render this Presentation as a String with the given width limitation. |
static QuantityPresentation |
valueOf(java.lang.String quantity)
Factory method to create a new instance of QuantityPresentation from a string quantity. |
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 |
public static final char $At
Presentation _Number
java.lang.String _Units
static java.lang.String _PresentableClass
Constructor Detail |
public QuantityPresentation(Presentation number, java.lang.String units) throws PresentationException
Method Detail |
public static void main(java.lang.String[] args)
args
- String[] : the command line options.public static QuantityPresentation valueOf(java.lang.String quantity) throws PresentationException
quantity
- the string in the form:
number@units
where number can be formed into a NumberPresentation and
where units is a recognized units name.
PresentationException
public AttrMap getAttributes() throws PresentationException
getAttributes
in class Presentation
PresentationException
public java.lang.String toString(int width) throws PresentationException
toString
in class Presentation
width
- the maximum number of characters allowed for depiction of
this presentation.
PresentationException
- when width is insufficient.public Presentable parse() throws PresentationException
parse
in class Presentation
PresentationException
public java.lang.String getPresentableClass()
getPresentableClass
in class Presentation
_PresentableClass
.public java.lang.String audit(java.lang.String label)
Auditable
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).
public java.lang.String getIdentifier()
Identifiable
public boolean isMutable()
isMutable
in interface Mutable
isMutable
in class MutablePresentation
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |