com.crystaldecisions.sdk.occa.report.data
Class Formula

java.lang.Object
  extended by com.crystaldecisions.sdk.occa.report.data.Formula
All Implemented Interfaces:
IFormula, IClone
Direct Known Subclasses:
ConditionFormula, CustomFunction, DataConditionFormula, DataSourceParameterFormula, Filter

public class Formula
extends java.lang.Object
implements IFormula, IClone

This class defines a formula and allows you modify the formula text, its syntax type, and its treatment of null values.

Whenever possible, use the IFormula interface to manipulate this object.

See Also:
IReportClientDocument.checkFormula(IFormula)

Constructor Summary
Formula()
          Creates a new IFormula object.
Formula(IFormula src)
          Copies the given IFormula object.
 
Method Summary
 java.lang.Object clone(boolean deepClone)
           
 void copyTo(java.lang.Object destObject, boolean deepCopy)
           
 java.lang.Object createMember(java.lang.String eleName, org.xml.sax.Attributes attrs, XMLSerializationContext ctxt, java.util.Map objState, boolean[] bLoaded)
          For internal use only.
 void doControllerModification(java.lang.Object newObject)
          For internal use only.
 void endElement(java.lang.String eleName, java.util.Map objState)
          For internal use only.
 void enumerateMembers(IMemberVisitor visitor)
          For internal use only.
 ControllableMixin getControllableMixin()
          For internal use only.
 FormulaNullTreatment getFormulaNullTreatment()
          Returns how to treat null values in the evaluation of a formula.
 FormulaSyntax getSyntax()
          Returns the syntax used to write the formula.
 java.lang.String getText()
          Returns the formula string.
 boolean hasContent(java.lang.Object srcFormula)
           
 boolean isDirectlyControllable()
          For internal use only.
 void readElement(java.lang.String eleName, java.lang.String sVal, org.xml.sax.Attributes attrs, java.util.Map objState)
          For internal use only.
 void save(XMLWriter writer, java.lang.String sTag, XMLSerializationContext ctxt)
          For internal use only.
 void save(XMLWriter writer, XMLSerializationContext ctxt)
          For internal use only.
 void saveContents(XMLWriter writer, XMLSerializationContext ctxt)
          For internal use only.
 void setFormulaNullTreatment(FormulaNullTreatment treatment)
          Sets how to treat null values in the evaluation of a formula.
 void setSyntax(FormulaSyntax syntax)
          Sets the syntax used to write the formula.
 void setText(java.lang.String text)
          Sets the formula string.
 void startElement(java.lang.String eleName, java.util.Map objState, org.xml.sax.Attributes attrs)
          For internal use only.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Formula

public Formula(IFormula src)
Copies the given IFormula object. This constructor makes a deep copy of the src object.

Parameters:
src - the object to copy

Formula

public Formula()
Creates a new IFormula object.

Method Detail

getFormulaNullTreatment

public FormulaNullTreatment getFormulaNullTreatment()
Description copied from interface: IFormula

Returns how to treat null values in the evaluation of a formula.

By default, null values are treated as exceptions, which means that as soon as RAS encounters a null valued field in a formula, it immediately stops evaluating the formula and produces no value.

If you want to handle null field values in your formula, you must explicitly do so by adding a test function such as IsNull(). You also have the option to treat nulls as default values. The following are the default values for different types used in a formula.

Specified by:
getFormulaNullTreatment in interface IFormula
Returns:
The FormulaNullTreatment object that specifies how to treat null values in the evaluation of a formula.

getSyntax

public FormulaSyntax getSyntax()
Description copied from interface: IFormula

Returns the syntax used to write the formula.

Specified by:
getSyntax in interface IFormula
Returns:
The FormulaSyntax object.

getText

public java.lang.String getText()
Description copied from interface: IFormula

Returns the formula string.

Specified by:
getText in interface IFormula
Returns:
The formula as a String.

setSyntax

public void setSyntax(FormulaSyntax syntax)
Description copied from interface: IFormula

Sets the syntax used to write the formula.

Specified by:
setSyntax in interface IFormula
Parameters:
syntax - The FormulaSyntax object.

setText

public void setText(java.lang.String text)
Description copied from interface: IFormula

Sets the formula string.

Specified by:
setText in interface IFormula
Parameters:
text - The formula as a String.

clone

public java.lang.Object clone(boolean deepClone)

copyTo

public void copyTo(java.lang.Object destObject,
                   boolean deepCopy)

hasContent

public boolean hasContent(java.lang.Object srcFormula)

createMember

public java.lang.Object createMember(java.lang.String eleName,
                                     org.xml.sax.Attributes attrs,
                                     XMLSerializationContext ctxt,
                                     java.util.Map objState,
                                     boolean[] bLoaded)
For internal use only.


endElement

public void endElement(java.lang.String eleName,
                       java.util.Map objState)
For internal use only.


readElement

public void readElement(java.lang.String eleName,
                        java.lang.String sVal,
                        org.xml.sax.Attributes attrs,
                        java.util.Map objState)
For internal use only.


save

public void save(XMLWriter writer,
                 java.lang.String sTag,
                 XMLSerializationContext ctxt)
          throws java.io.IOException
For internal use only.

Throws:
java.io.IOException

save

public void save(XMLWriter writer,
                 XMLSerializationContext ctxt)
          throws java.io.IOException
For internal use only.

Throws:
java.io.IOException

saveContents

public void saveContents(XMLWriter writer,
                         XMLSerializationContext ctxt)
                  throws java.io.IOException
For internal use only.

Throws:
java.io.IOException

setFormulaNullTreatment

public void setFormulaNullTreatment(FormulaNullTreatment treatment)
Description copied from interface: IFormula

Sets how to treat null values in the evaluation of a formula.

By default, null values are treated as exceptions, which means that as soon as RAS encounters a null valued field in a formula, it immediately stops evaluating the formula and produces no value.

If you want to handle null field values in your formula, you must explicitly do so by adding a test function such as IsNull(). You also have the option to treat nulls as default values. The following are the default values for different types used in a formula.

Specified by:
setFormulaNullTreatment in interface IFormula
Parameters:
treatment - The FormulaNullTreatment object that specifies how to treat null values in the evaluation of a formula.

startElement

public void startElement(java.lang.String eleName,
                         java.util.Map objState,
                         org.xml.sax.Attributes attrs)
For internal use only.


getControllableMixin

public ControllableMixin getControllableMixin()
For internal use only.


doControllerModification

public void doControllerModification(java.lang.Object newObject)
                              throws ReportSDKException
For internal use only.

Throws:
ReportSDKException

isDirectlyControllable

public boolean isDirectlyControllable()
For internal use only.


enumerateMembers

public void enumerateMembers(IMemberVisitor visitor)
For internal use only.