Package com.inet.report
Class FormulaRange
java.lang.Object
com.inet.report.FormulaRange
- All Implemented Interfaces:
com.inet.report.formula.Evaluable
,Serializable
This class is the representation of a range, e.g. defined with a formula like '20 to_ 30'.
A range can have one or two limits - a lower and/or a higher limit. Either limit can be set to be
"inclusive" or "exclusive", that is, itself included in the range or not.
Note that if a range has only one limit, the range includes all values which are greater than the limit (if the limit is the lower limit), or less than the limit accordingly (if the limit is the higher limit).
Examples:
Note that if a range has only one limit, the range includes all values which are greater than the limit (if the limit is the lower limit), or less than the limit accordingly (if the limit is the higher limit).
Examples:
- 1 _to 2 will include all values between 1 and 2, including the 2 but NOT including 1. This range
would be created by calling:
new FormulaRange(new Integer(1),new Integer(2),false,true)
. - upfrom_ DateTime(2006,3,1,0,0,0) will include all DateTime values after March 1st, 2006, 12 a.m.,
not including this datetime itself. This range would be created by calling:
new FormulaRange(myDate,null,false,false)
- See Also:
-
Field Summary
Modifier and TypeFieldDescriptionThe Object that holds the from value of range.The Object that holds the to value of range.Fields inherited from interface com.inet.report.formula.Evaluable
ARRAY, BINARY, BOOLEAN, BOOLEAN_ARRAY, CONSTANT_NULL, CURRENCY, CURRENCY_ARRAY, CURRENCY_RANGE, CURRENCY_RANGE_ARRAY, DATE, DATE_ARRAY, DATE_RANGE, DATE_RANGE_ARRAY, DATETIME, DATETIME_ARRAY, DATETIME_RANGE, DATETIME_RANGE_ARRAY, FIELD, ILLEGAL_VALUE_TYPE, NO_RETURN_VALUE, NUMBER, NUMBER_ARRAY, NUMBER_RANGE, NUMBER_RANGE_ARRAY, OBJECT, RANGE, RANGE_ARRAY, STRING, STRING_ARRAY, STRING_RANGE, STRING_RANGE_ARRAY, TIME, TIME_ARRAY, TIME_RANGE, TIME_RANGE_ARRAY, UNDEFINED_TYPE
-
Constructor Summary
ConstructorDescriptionFormulaRange
(Object from, Object to) Creates a new FormulaRange object.FormulaRange
(Object from, Object to, boolean includeFrom, boolean includeTo) Create a new FormulaRange object.FormulaRange
(Object from, Object to, Object intervalType) Create a new FormulaRange object.FormulaRange
(Object from, Object to, String intervalType, boolean includeFrom, boolean includeTo) Create a new FormulaRange object. -
Method Summary
Modifier and TypeMethodDescriptionvoid
checkContext
(com.inet.report.formula.IFormulaRunner formula, int formulaType) FOR INTERNAL USE ONLYboolean
eval
(com.inet.report.formula.IFormulaRunner formula) FOR INTERNAL USE ONLYint
getEvaluateTime
(com.inet.report.formula.IFormulaRunner formula) FOR INTERNAL USE ONLYgetFrom()
Gets the value the range begins with.If the range type is Date or Time, the intervalType specifies the part of the Date or Time, that should be used, e.g.getTo()
Gets the value the range ends with.int
getValueType
(com.inet.report.formula.IFormulaRunner formula) FOR INTERNAL USE ONLYfinal boolean
Returns whether or not the high limit of this range is inclusive or exclusive.final boolean
Returns whether or not the low limit of this range is inclusive or exclusive.com.inet.report.formula.Evaluable
optimize
(com.inet.report.formula.IFormulaRunner formula) FOR INTERNAL USE ONLYvoid
Sets the value the range should begin with.final void
setHighLimitIncluded
(boolean includeTo) Sets whether or not the high limit of this range is inclusive or exclusive.void
setIntervalType
(String intervalType) If the range type is Date or Time, the intervalType specifies the part of the Date or Time that should be used for the range, e.g.final void
setLowLimitIncluded
(boolean includeFrom) Sets whether or not the low limit of this range is inclusive or exclusive.void
setReferencing
(com.inet.report.formula.IFormulaRunner formula) FOR INTERNAL USE ONLYvoid
Sets the value the range should end with.toSql
(com.inet.report.formula.IFormulaRunner formula, com.inet.report.database.sql.SqlSyntax syntax, boolean isPlaceholder, boolean isTopLevel) FOR INTERNAL USE ONLYtoString()
Returns a simple string representation of this FormulaRange, using "_to", "to_", "_to_" and "to" to indicate limit inclusion.
-
Field Details
-
from
The Object that holds the from value of range. -
to
The Object that holds the to value of range.
-
-
Constructor Details
-
FormulaRange
Create a new FormulaRange object.- Parameters:
from
- The Object that holds the "from" value of the rangeto
- The Object that holds the "to" value of the rangeincludeFrom
- Whether or not the low limit of this range is inclusive or exclusive.includeTo
- Whether or not the high limit of this range is inclusive or exclusive.- Since:
- 7.0
-
FormulaRange
public FormulaRange(Object from, Object to, String intervalType, boolean includeFrom, boolean includeTo) Create a new FormulaRange object.- Parameters:
from
- The Object that holds the from value of range.to
- The Object that holds the to value of range.intervalType
- The Object that specifies which part of a Date or Time should be used for range, i.e. "d" for day.includeFrom
- Whether or not the low limit of this range is to be included in the rangeincludeTo
- Whether or not the high limit of this range is to be included in the range- Since:
- 7.0
-
FormulaRange
Creates a new FormulaRange object.- Parameters:
from
- The Object that holds the from value of range.to
- The Object that holds the to value of range.- Since:
- 6.0
-
FormulaRange
Create a new FormulaRange object.- Parameters:
from
- The Object that holds the from value of range.to
- The Object that holds the to value of range.intervalType
- The Object that specifies which part of a Date or Time should be used for range, i.e. "d" for day.- Since:
- 6.0
-
-
Method Details
-
isLowLimitIncluded
public final boolean isLowLimitIncluded()Returns whether or not the low limit of this range is inclusive or exclusive.- Returns:
- Whether or not the low limit of this range is inclusive or exclusive.
- Since:
- 7.0
-
setLowLimitIncluded
public final void setLowLimitIncluded(boolean includeFrom) Sets whether or not the low limit of this range is inclusive or exclusive.- Parameters:
includeFrom
- Whether or not the low limit of this range is inclusive or exclusive.- Since:
- 7.0
-
isHighLimitIncluded
public final boolean isHighLimitIncluded()Returns whether or not the high limit of this range is inclusive or exclusive.- Returns:
- Whether or not the high limit of this range is inclusive or exclusive.
- Since:
- 7.0
-
setHighLimitIncluded
public final void setHighLimitIncluded(boolean includeTo) Sets whether or not the high limit of this range is inclusive or exclusive.- Parameters:
includeTo
- Whether or not the high limit of this range is inclusive or exclusive.- Since:
- 7.0
-
setFrom
Sets the value the range should begin with.- Parameters:
from
- The value the range should begin with- Since:
- 6.0
-
getFrom
Gets the value the range begins with.- Returns:
- the value the range begins with.
- Since:
- 6.0
-
setTo
Sets the value the range should end with.- Parameters:
to
- The value the range should end with- Since:
- 6.0
-
getTo
Gets the value the range ends with.- Returns:
- the value the range ends with.
- Since:
- 6.0
-
setIntervalType
If the range type is Date or Time, the intervalType specifies the part of the Date or Time that should be used for the range, e.g. "d" for Day in Date.- Parameters:
intervalType
- Interval type to use for date or time ranges. "d", "w", "m" are allowed values.- Since:
- 6.0
-
getIntervalType
If the range type is Date or Time, the intervalType specifies the part of the Date or Time, that should be used, e.g. "d" for Day in Date, "w" for Week, and "m" for Month- Returns:
- Interval type used for date or time ranges.
- Since:
- 6.0
-
eval
FOR INTERNAL USE ONLY- Specified by:
eval
in interfacecom.inet.report.formula.Evaluable
- Since:
- 6.0
-
getValueType
FOR INTERNAL USE ONLY- Specified by:
getValueType
in interfacecom.inet.report.formula.Evaluable
- Throws:
ReportException
- Since:
- 6.0
-
checkContext
public void checkContext(com.inet.report.formula.IFormulaRunner formula, int formulaType) FOR INTERNAL USE ONLY- Specified by:
checkContext
in interfacecom.inet.report.formula.Evaluable
-
getEvaluateTime
public int getEvaluateTime(com.inet.report.formula.IFormulaRunner formula) FOR INTERNAL USE ONLY- Specified by:
getEvaluateTime
in interfacecom.inet.report.formula.Evaluable
-
toString
Returns a simple string representation of this FormulaRange, using "_to", "to_", "_to_" and "to" to indicate limit inclusion. -
toSql
public String toSql(com.inet.report.formula.IFormulaRunner formula, com.inet.report.database.sql.SqlSyntax syntax, boolean isPlaceholder, boolean isTopLevel) throws ReportException FOR INTERNAL USE ONLY- Specified by:
toSql
in interfacecom.inet.report.formula.Evaluable
- Throws:
ReportException
-
optimize
public com.inet.report.formula.Evaluable optimize(com.inet.report.formula.IFormulaRunner formula) throws ReportException FOR INTERNAL USE ONLY- Specified by:
optimize
in interfacecom.inet.report.formula.Evaluable
- Throws:
ReportException
-
setReferencing
public void setReferencing(com.inet.report.formula.IFormulaRunner formula) FOR INTERNAL USE ONLY- Specified by:
setReferencing
in interfacecom.inet.report.formula.Evaluable
-
equals
-