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

java.lang.Object
  extended by com.crystaldecisions.sdk.occa.report.data.FilterItem
      extended by com.crystaldecisions.sdk.occa.report.data.FieldRangeFilterItem
All Implemented Interfaces:
IFieldRangeFilterItem, IFilterItem, IClone

public class FieldRangeFilterItem
extends FilterItem
implements IFieldRangeFilterItem, IClone

This object is used to represent a primitive expression in a filter string. A primitive expression is an expression that contains a field, an operator, and another field or value, for example Customer.Name = "Joel". It is the simplest expression using a operator that one may have in a formula.

The following diagram illustrates the relationship between a formula string and the FieldRangeFilterItem object.

The primitive expression is broken up into three parts and each part is represented by a member property:

Note: A primitive expression may have more than one value. For example, the IN operator can have more than one value that it uses to evaluate the expression. For example, Customer.Name IN ["Joel","Tomi"]. There are two values here: "Joel" and "Tomi".

For more information on how a filter string is parsed, see the IFilter interface.


Constructor Summary
FieldRangeFilterItem()
           
FieldRangeFilterItem(IFieldRangeFilterItem 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 the field's value as a localized and formatted string.
 void endElement(java.lang.String eleName, java.util.Map objState)
           For internal use only.
 void enumerateMembers(IMemberVisitor visitor)
           
 boolean getInclusive()
          Returns whether, if the operator compares a range, the compared value is included in the comparison.
 SelectionOperation getOperation()
          Returns the type of operation being performed on the field that is being used as a filter.
 IField getRangeField()
          Returns the range field that represents the field that is being used in the operation.
 Values getValues()
          Returns the values that are being compared with those in the range field.
 boolean hasContent(java.lang.Object srcFieldRangeFilterItem)
           
 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 setInclusive(boolean inclusive)
          Sets whether, if the operator compares a range, the compared value is included in the comparison.
 void setOperation(SelectionOperation operation)
          Sets the type of operation being performed on the field that is being used as a filter.
 void setRangeField(IField rangeField)
          Sets the range field that represents the field that is being used in the operation.
 void setValues(Values values)
          Sets the values that are being compared with those in the range field.
 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.FilterItem
doControllerModification, getControllableMixin, isDirectlyControllable
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldRangeFilterItem

public FieldRangeFilterItem(IFieldRangeFilterItem src)

FieldRangeFilterItem

public FieldRangeFilterItem()
Method Detail

clone

public java.lang.Object clone(boolean deepClone)
Specified by:
clone in class FilterItem

computeText

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

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 IFilterItem
Specified by:
computeText in class FilterItem
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)
Specified by:
copyTo in class FilterItem

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.


displayText

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

Returns the field's value as a localized and formatted string.

Specified by:
displayText in interface IFilterItem
Specified by:
displayText in class FilterItem
Parameters:
type - How the field names in the filter should be formatted.
locale - The locale that is used to format the string. If this value is not specified and you are writing a Win32 application, the locale will be the user's default locale. If you are writing a thin client (a script that is running on a server) and this value is not specified, the server's default locale will be used.
Returns:
The field's value as a localized and formatted string.

endElement

public void endElement(java.lang.String eleName,
                       java.util.Map objState)

For internal use only.


getInclusive

public boolean getInclusive()
Description copied from interface: IFieldRangeFilterItem

Returns whether, if the operator compares a range, the compared value is included in the comparison. If, for example, the "greater than" operator is used, if Inclusive is True, then the operator will effectively be "greater than or equal to".

Specified by:
getInclusive in interface IFieldRangeFilterItem
Returns:
true if the value is included in the comparison, and false otherwise.

getOperation

public SelectionOperation getOperation()
Description copied from interface: IFieldRangeFilterItem

Returns the type of operation being performed on the field that is being used as a filter.

Specified by:
getOperation in interface IFieldRangeFilterItem
Returns:
The SelectionOperation object.

getRangeField

public IField getRangeField()
Description copied from interface: IFieldRangeFilterItem

Returns the range field that represents the field that is being used in the operation. The range field is the field that is being used in the filter to determine the result of the expression.

Specified by:
getRangeField in interface IFieldRangeFilterItem
Returns:
The range field as an IField.

getValues

public Values getValues()
Description copied from interface: IFieldRangeFilterItem

Returns the values that are being compared with those in the range field. There are two different types of values that are stored: constant values, which represent a literal value, and expression values, which are values that require evaluation.

Specified by:
getValues in interface IFieldRangeFilterItem
Returns:
The values as a Values object.

hasContent

public boolean hasContent(java.lang.Object srcFieldRangeFilterItem)

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,
                 XMLSerializationContext ctxt)
          throws java.io.IOException

For internal use only.

Throws:
java.io.IOException

save

public void save(XMLWriter writer,
                 java.lang.String sTag,
                 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

setInclusive

public void setInclusive(boolean inclusive)
Description copied from interface: IFieldRangeFilterItem

Sets whether, if the operator compares a range, the compared value is included in the comparison. If, for example, the "greater than" operator is used, if Inclusive is True, then the operator will effectively be "greater than or equal to".

Specified by:
setInclusive in interface IFieldRangeFilterItem
Parameters:
inclusive - true if the value is included in the comparison, and false otherwise.

setOperation

public void setOperation(SelectionOperation operation)
Description copied from interface: IFieldRangeFilterItem

Sets the type of operation being performed on the field that is being used as a filter.

Specified by:
setOperation in interface IFieldRangeFilterItem
Parameters:
operation - The SelectionOperation object.

setRangeField

public void setRangeField(IField rangeField)
Description copied from interface: IFieldRangeFilterItem

Sets the range field that represents the field that is being used in the operation. The range field is the field that is being used in the filter to determine the result of the expression.

Specified by:
setRangeField in interface IFieldRangeFilterItem
Parameters:
rangeField - The range field as an IField.

setValues

public void setValues(Values values)
Description copied from interface: IFieldRangeFilterItem

Sets the values that are being compared with those in the range field. There are two different types of values that are stored: constant values, which represent a literal value, and expression values, which are values that require evaluation.

Specified by:
setValues in interface IFieldRangeFilterItem
Parameters:
values - The values as a Values object.

startElement

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

For internal use only.


enumerateMembers

public void enumerateMembers(IMemberVisitor visitor)
Overrides:
enumerateMembers in class FilterItem