|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.Observable jimm.datavision.Element jimm.datavision.field.Field jimm.datavision.field.FormulaField
public class FormulaField
A formula field represents a formula calculated on-the-fly. The value of a
formula field holds a Formula
object. (In the XML, the formula
field's value is the id of the formula.)
Field Summary | |
---|---|
protected Formula |
formula
|
Fields inherited from class jimm.datavision.field.Field |
---|
border, bounds, cache, DEFAULT_HEIGHT, DEFAULT_WIDTH, format, id, maxIdSeen, value |
Fields inherited from class jimm.datavision.Element |
---|
report, section, visible |
Constructor Summary | |
---|---|
FormulaField(java.lang.Long id,
Report report,
Section section,
java.lang.Object value,
boolean visible)
Constructs a formula field with the specified id in the specified report section whose Formula 's id is value. |
Method Summary | |
---|---|
boolean |
canBeAggregated()
This override returns true if this formula is in a detail
section. |
java.util.Collection |
columnsUsed()
Returns a collection of the columns used in the formula. |
java.lang.String |
designLabel()
Returns a string representing the field in the GUI during report design. |
java.lang.String |
dragString()
Not really used; we drag formulas, not formula fields. |
protected void |
finalize()
|
java.lang.String |
formulaString()
Returns a string representing the field as it appears in a formula. |
Formula |
getFormula()
Returns the formula. |
java.lang.Object |
getValue()
Returns the value of this field. |
FieldWidget |
makeWidget(SectionWidget sw)
Returns a new widget of the appropriate FieldWidget
subclass for this field. |
boolean |
refersTo(Field f)
Returns true if this field contains a reference to the
specified field. |
boolean |
refersTo(Formula f)
Returns true if this field contains a reference to the
specified formula. |
boolean |
refersTo(Parameter p)
Returns true if this field contains a reference to the
specified parameter. |
boolean |
refersTo(UserColumn uc)
Returns true if this field contains a reference to the
specified user column. |
void |
setFormula(Formula newFormula)
Sets the formula. |
java.lang.String |
typeString()
Returns the string that specifies this field's type in the report XML. |
void |
update(java.util.Observable o,
java.lang.Object arg)
|
java.util.Collection |
userColumnsUsed()
Returns a collection of the user columns used in the formula. |
Methods inherited from class jimm.datavision.field.Field |
---|
clone, create, createFromDragString, getBorder, getBorderOrDefault, getBounds, getFormat, getId, getOutputHeight, setBorder, setBounds, setFormat, setValue, toString, writeFieldGuts, writeXML |
Methods inherited from class jimm.datavision.Element |
---|
getReport, getSection, isVisible, setSection, setVisible |
Methods inherited from class java.util.Observable |
---|
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected Formula formula
Constructor Detail |
---|
public FormulaField(java.lang.Long id, Report report, Section section, java.lang.Object value, boolean visible)
Formula
's id is value.
id
- the new field's idreport
- the report containing this elementsection
- the report section in which the field residesvalue
- the id of a formulavisible
- show/hide flagMethod Detail |
---|
protected void finalize() throws java.lang.Throwable
finalize
in class Field
java.lang.Throwable
public void update(java.util.Observable o, java.lang.Object arg)
update
in interface java.util.Observer
update
in class Field
public FieldWidget makeWidget(SectionWidget sw)
Field
FieldWidget
subclass for this field. Subclasses override this method to return
different types of widgets.
makeWidget
in class Field
sw
- a field widgetpublic java.lang.String dragString()
dragString
in interface Draggable
dragString
in class Field
public Formula getFormula()
public void setFormula(Formula newFormula)
newFormula
- the new formulapublic java.lang.String typeString()
Field
typeString
in class Field
public java.lang.String designLabel()
Field
designLabel
in class Field
public java.lang.String formulaString()
Field
formulaString
in class Field
public boolean refersTo(Field f)
Field
true
if this field contains a reference to the
specified field. Most fields return false
; only a AggregateField
or FormulaField
would return true
.
refersTo
in class Field
f
- a field
true
if this field contains a reference to the
specified fieldpublic boolean refersTo(Formula f)
Field
true
if this field contains a reference to the
specified formula. Most fields return false
; only a AggregateField
or FormulaField
would return true
.
refersTo
in class Field
f
- a formula
true
if this field contains a reference to the
specified fieldpublic boolean refersTo(UserColumn uc)
Field
true
if this field contains a reference to the
specified user column. Most fields return false
; only a AggregateField
, UserColumnField
, or FormulaField
would
return true
.
refersTo
in class Field
uc
- a user column
true
if this field contains a reference to the
specified user columnpublic boolean refersTo(Parameter p)
Field
true
if this field contains a reference to the
specified parameter. Most fields return false
; only a AggregateField
or FormulaField
would return true
.
refersTo
in class Field
p
- a parameter
true
if this field contains a reference to the
specified fieldpublic boolean canBeAggregated()
true
if this formula is in a detail
section. We don't really know that this formula returns a number, so
we'll err on the side of allowing aggregation.
canBeAggregated
in class Field
true
if this field can be aggregatedpublic java.lang.Object getValue()
Formula
.
getValue
in class Field
public java.util.Collection columnsUsed()
Expression.columnsUsed()
.
Query.findSelectablesUsed()
public java.util.Collection userColumnsUsed()
Expression.userColumnsUsed()
.
Query.findSelectablesUsed()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |