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

java.lang.Object
  extended by com.crystaldecisions.sdk.occa.report.data.Formula
      extended by com.crystaldecisions.sdk.occa.report.data.Filter
All Implemented Interfaces:
IFilter, IFormula, IClone

public class Filter
extends Formula
implements IFilter, IClone

This object defines filters that are used in record selection and group selection. As the name implies, they are used to select specified data. Initially, the filter is a simple string written in Crystal syntax. When the file is opened, the string is parsed into an array of FilterItems, which is stored in the Filter object's FilterItems property. When possible, use the IFilter interface to manipulate this object.


Constructor Summary
Filter()
           
Filter(FilterType filterType)
           
Filter(IFilter src)
           
 
Method Summary
 java.lang.Object clone(boolean deepClone)
           
 java.lang.String computeText()
           Returns a String representation of the field value that can be used in a report formula.
 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.
 java.lang.String displayText(FieldDisplayNameType type, java.util.Locale locale)
           Returns a UI-friendly string representation of the filter.
 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.
 FilterItems getFilterItems()
          For internal use only.
 FilterType getFilterType()
          Gets the type of this filter.
 java.lang.String getFreeEditingText()
          Deprecated. please use getText()
 java.lang.String getName()
          Returns the name of the filter.
 java.lang.String getText()
          Returns the formula string.
 boolean hasContent(java.lang.Object srcFilter)
           
 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 setFilterItems(FilterItems filterItems)
          For internal use only.
 void setFilterType(FilterType filterType)
          Sets the type of this filter.
 void setFreeEditingText(java.lang.String freeEditingText)
          Deprecated. please use setText(String)
 void setName(java.lang.String name)
          Sets the name of the filter.
 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 com.crystaldecisions.sdk.occa.report.data.Formula
getControllableMixin, getFormulaNullTreatment, getSyntax, setFormulaNullTreatment, setSyntax
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.crystaldecisions.sdk.occa.report.data.IFormula
getFormulaNullTreatment, getSyntax, setFormulaNullTreatment, setSyntax
 

Constructor Detail

Filter

public Filter(IFilter src)

Filter

public Filter()

Filter

public Filter(FilterType filterType)
Method Detail

clone

public java.lang.Object clone(boolean deepClone)
Overrides:
clone in class Formula

computeText

public java.lang.String computeText()
Description copied from interface: IFilter

Returns a String representation of the field value that can be used in a report formula. The string is not formatted or localized. The syntax will always be Crystal syntax.

If the field contains a date, computeText returns Date(x, x, x); if it contains a date and time, computeText returns DateTime(x, x, x, x, x, x). However, when the date is 1900, 0, 1 (the Java start date), computeText returns Time(x, x, x). If you want to set a field to a time value only (that is, with no date), you should set the date to 1900, 0, 1, so that computeText will retrieve the correct information.

Specified by:
computeText in interface IFilter
Returns:
A String representation of the field value that can be used in a report formula.

copyTo

public void copyTo(java.lang.Object destObject,
                   boolean deepCopy)
Overrides:
copyTo in class Formula

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.

Overrides:
createMember in class Formula

displayText

public java.lang.String displayText(FieldDisplayNameType type,
                                    java.util.Locale locale)
Description copied from interface: IFilter

Returns a UI-friendly string representation of the filter. This method attempts to structure the filter formula as close to a localized phrase as possible. If you do not pass in a locale, it attempts to localize the string using the user's default locale.

If the field contains a date, displayText returns a locale-specific Date string; if it contains a date and time, displayText returns a locale-specific DateTime string; if it contains a time string, displayText returns a locale-specific Time string.

Specified by:
displayText in interface IFilter
Parameters:
type - Indicates how the name of the field is displayed.
locale - Localizes the string according to a specific locale.
Returns:
A UI-friendly string representation of the filter.

endElement

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

Overrides:
endElement in class Formula

getFilterItems

public FilterItems getFilterItems()
For internal use only.


getFreeEditingText

public java.lang.String getFreeEditingText()
Deprecated. please use getText()

Description copied from interface: IFilter
Returns the formula text that was originally used to define the filter.

Specified by:
getFreeEditingText in interface IFilter
Returns:
A String containing the formula text that was originally used to define the filter.

getText

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

Returns the formula string.

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

setText

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

Sets the formula string.

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

getName

public java.lang.String getName()
Description copied from interface: IFilter
Returns the name of the filter.

Specified by:
getName in interface IFilter
Returns:
A String containing the name of the filter.

hasContent

public boolean hasContent(java.lang.Object srcFilter)
Overrides:
hasContent in class Formula

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.

Overrides:
readElement in class Formula

save

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

Overrides:
save in class Formula
Throws:
java.io.IOException

save

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

Overrides:
save in class Formula
Throws:
java.io.IOException

saveContents

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

Overrides:
saveContents in class Formula
Throws:
java.io.IOException

setFilterItems

public void setFilterItems(FilterItems filterItems)
For internal use only.


setFreeEditingText

public void setFreeEditingText(java.lang.String freeEditingText)
Deprecated. please use setText(String)

Description copied from interface: IFilter
Sets the formula text that will be used to define the filter.

Specified by:
setFreeEditingText in interface IFilter
Parameters:
freeEditingText - A String containing the formula text that was originally used to define the filter.

setName

public void setName(java.lang.String name)
Description copied from interface: IFilter
Sets the name of the filter.

Specified by:
setName in interface IFilter
Parameters:
name - A String containing the name of the filter.

startElement

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

Overrides:
startElement in class Formula

getFilterType

public FilterType getFilterType()
Description copied from interface: IFilter
Gets the type of this filter.

Specified by:
getFilterType in interface IFilter
Returns:
the FilterType of this filter

setFilterType

public void setFilterType(FilterType filterType)
Description copied from interface: IFilter
Sets the type of this filter.

Specified by:
setFilterType in interface IFilter
Parameters:
filterType - a FilterType

doControllerModification

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

Overrides:
doControllerModification in class Formula
Throws:
ReportSDKException

isDirectlyControllable

public boolean isDirectlyControllable()
For internal use only.

Overrides:
isDirectlyControllable in class Formula

enumerateMembers

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

Overrides:
enumerateMembers in class Formula