|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.rubecula.spreadsheet.QuantityCell
Objects of this class have various component fields:
| Constructor Summary | |
|
QuantityCell(java.lang.String name,
Presentable quantity)
Constructor to create a new QuantityCell with the given name and quantity. |
protected |
QuantityCell(java.lang.String name,
Presentable quantity,
java.lang.String expression,
PresentationFactoryInterface presentationFactory,
CellTable cells)
Primary constructor to create a new QuantityCell with the given name and quantity. |
|
QuantityCell(java.lang.String name,
Presentation presentation)
Constructor to create a new QuantityCell with the given name and presentation. |
|
QuantityCell(java.lang.String name,
java.lang.String formula,
PresentationFactoryInterface presentationFactory,
CellTable cells)
Constructor to create a new QuantityCell with the given name and formula. |
| Method Summary | |
void |
addDependent(Presentable dependent)
Add a dependent of this cell. |
java.lang.String |
audit()
Method to return a detailed (unlabeled) string from an 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. |
void |
calculate()
|
java.util.Iterator |
dependents()
Get an iterator on the dependents. |
AttrMap |
getAttributes()
Method to get the attributes for this cell. |
java.lang.String |
getExpression()
Method to get the Expression which defines this cell, if any. |
java.lang.String |
getIdentifier()
Method to get the specific identifier for an object. |
java.lang.String |
getName()
Method to get the name of this cell. |
Presentable |
getQuantity()
|
java.lang.Object |
getValue()
This method yields the true definition of this cell so that it can be edited in the spreadsheet editor. |
boolean |
isDirty()
Method to determine if this cell is in its "dirty" state. |
Presentable |
makePresentableInstance(Presentation presentation)
Instance method to convert a Presentation into a Presentable. |
Presentation |
present(AttrMap attributes)
Present the cell with the given attributes merged into the cell's own attributes. |
void |
removeAttribute(java.lang.String attr)
Method to unset an attribute for this cell. |
void |
removeDependent(Presentable dependent)
Remove a dependent from this cell. |
void |
setAttribute(java.lang.String attr,
java.lang.String value)
Method to set/reset an attribute for this cell. |
static void |
SetDebug(boolean debug)
Class method to set the debug status for QuantityCell calculations. |
void |
setDirty()
Method to set this cell in its "dirty" state. |
static void |
SetJEPParser()
Method to set up JEP as the expression parser for QuantityCell calculations. |
void |
setName(java.lang.String name)
Method to set the name of this cell. |
static void |
SetParser(ExpressionInterface parser)
Class-mutating method to set the ExpressionParser to be used when encountering an expression which cannot be handled with related package classes. |
void |
setValue(java.lang.Object value)
This method sets the value of this cell according to the class of value. |
void |
setValue(Presentable value)
Method to set the value of this cell. |
void |
setValue(Presentation value)
Method to set the value of this cell. |
void |
setValue(java.lang.String value)
Method to set the value (and possibly the attributes) of this cell. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
protected QuantityCell(java.lang.String name,
Presentable quantity,
java.lang.String expression,
PresentationFactoryInterface presentationFactory,
CellTable cells)
name - the name of this new QuantityCell (of the form A1, B1, etc.)quantity - the quantity represented by this cell
(or null if expression is valid).expression - the formula for recalculating this quantity (or null).presentationFactory - the factory from which Presentations will be
created from Strings (or null).cells - a table of QuantityCells used when expression is valid
(otherwise may be null).
public QuantityCell(java.lang.String name,
Presentable quantity)
name - the name of this new QuantityCell (of the form A1, B1, etc.quantity - the quantity represented by this cell.
public QuantityCell(java.lang.String name,
Presentation presentation)
name - the name of this new QuantityCell (of the form A1, B1, etc.).presentation - the presentation for this cell.
public QuantityCell(java.lang.String name,
java.lang.String formula,
PresentationFactoryInterface presentationFactory,
CellTable cells)
name - the name of this new QuantityCell (of the form A1, B1, etc.).formula - the formula represented by this cell.presentationFactory - the factory from which to create Presentations
from strings.cells - the table of QuantityCells relevant to this formula.| Method Detail |
public static void SetDebug(boolean debug)
debug - true or false.public static void SetParser(ExpressionInterface parser)
parser - an implementing instance of ExpressionInterface with which
to parse expressions in cells.public static void SetJEPParser()
public java.lang.String getName()
public void setName(java.lang.String name)
name - the name to give this cell.public AttrMap getAttributes()
public void setValue(Presentation value)
value - a presentation representing the value for this cell.public void setValue(Presentable value)
value - a presentable instance representing the value for this cell.public void setValue(java.lang.String value)
value - a string representing the value for this cell,
optionally followed by a set of comma-separated attributes enclosed in
{}.
Each of the attributes is of the form name[=value] where the
[=value] part is optional.public void setValue(java.lang.Object value)
value - an object which will determine the cell's new value.public java.lang.String getExpression()
public java.lang.Object getValue()
java.lang.RuntimeException - if expression and presentable both null.
public Presentable getQuantity()
throws PresentableException
PresentableException - if there is a problem calculating the value of
this cell.
public void calculate()
throws PresentableException
PresentableException - if there is a problem calculating the value of
this cell.public Presentation present(AttrMap attributes)
present in interface Presentableattributes - an AttrMap list of attributes.
java.lang.UnsupportedOperationException - not implemented.public Presentable makePresentableInstance(Presentation presentation)
makePresentableInstance in interface Presentablepresentation - a presentation of a number which you want to convert into a number.
public void setDirty()
public boolean isDirty()
public void addDependent(Presentable dependent)
addDependent in interface Dependentdependent - a Presentable object which is dependent on this cell.public void removeDependent(Presentable dependent)
removeDependent in interface Dependentdependent - a Presentable object which is not dependent on this cell.public java.util.Iterator dependents()
dependents in interface Dependentpublic java.lang.String getIdentifier()
getIdentifier in interface Auditablepublic java.lang.String audit(java.lang.String label)
audit in interface Auditablelabel - String: the label to associate with the data
public java.lang.String audit()
audit in interface Auditable
public void audit(java.io.PrintStream out,
java.lang.String label)
audit in interface Auditableout - the output stream.label - the label to attach to the output (may be null).
public void setAttribute(java.lang.String attr,
java.lang.String value)
attr - the attribute name.value - the attribute value.public void removeAttribute(java.lang.String attr)
attr - the attribute name.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||