i-net Clear Reports

com.inet.report
Class FormulaRange

java.lang.Object
  extended by com.inet.report.FormulaRange
All Implemented Interfaces:
com.inet.report.formula.Evaluable, java.io.Serializable

public class FormulaRange
extends java.lang.Object
implements com.inet.report.formula.Evaluable, java.io.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:

An object of this class will used for the representation of prompt ranges, too. So, if you want to fill the value of a prompt field as range use an object of this class to do this.

See Also:
Serialized Form

Field Summary
 java.lang.Object from
          The Object that holds the from value of range.
 java.lang.Object to
          The Object that holds the to value of range.
 
Constructor Summary
FormulaRange(java.lang.Object from, java.lang.Object to, boolean includeFrom, boolean includeTo)
          Create a new FormulaRange object.
FormulaRange(java.lang.Object from, java.lang.Object to, java.lang.String intervalType, boolean includeFrom, boolean includeTo)
          Create a new FormulaRange object.
FormulaRange(java.lang.Object from, java.lang.Object to)
          Creates a new FormulaRange object.
FormulaRange(java.lang.Object from, java.lang.Object to, java.lang.Object intervalType)
          Create a new FormulaRange object.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.Object getFrom()
          Gets the value the range begins with.
 java.lang.String 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.
 java.lang.Object getTo()
          Gets the value the range ends with.
 boolean isHighLimitIncluded()
          Returns whether or not the high limit of this range is inclusive or exclusive.
 boolean isLowLimitIncluded()
          Returns whether or not the low limit of this range is inclusive or exclusive.
 void setFrom(java.lang.Object from)
          Sets the value the range should begin with.
 void setHighLimitIncluded(boolean includeTo)
          Sets whether or not the high limit of this range is inclusive or exclusive.
 void setIntervalType(java.lang.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.
 void setLowLimitIncluded(boolean includeFrom)
          Sets whether or not the low limit of this range is inclusive or exclusive.
 void setTo(java.lang.Object to)
          Sets the value the range should end with.
 java.lang.String toString()
          Returns a simple string representation of this FormulaRange, using "_to", "to_", "_to_" and "to" to indicate limit inclusion.
 

Field Detail

from

public java.lang.Object from
The Object that holds the from value of range.


to

public java.lang.Object to
The Object that holds the to value of range.

Constructor Detail

FormulaRange

public FormulaRange(java.lang.Object from,
                    java.lang.Object to,
                    boolean includeFrom,
                    boolean includeTo)
Create a new FormulaRange object.

Parameters:
from - The Object that holds the "from" value of the range
to - The Object that holds the "to" value of the range
includeFrom - 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.

FormulaRange

public FormulaRange(java.lang.Object from,
                    java.lang.Object to,
                    java.lang.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 range
includeTo - Whether or not the high limit of this range is to be included in the range

FormulaRange

public FormulaRange(java.lang.Object from,
                    java.lang.Object to)
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.

FormulaRange

public FormulaRange(java.lang.Object from,
                    java.lang.Object to,
                    java.lang.Object intervalType)
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.
Method Detail

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.

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.

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.

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.

setFrom

public void setFrom(java.lang.Object from)
Sets the value the range should begin with.

Parameters:
from - The value the range should begin with

getFrom

public java.lang.Object getFrom()
Gets the value the range begins with.

Returns:
the value the range begins with.

setTo

public void setTo(java.lang.Object to)
Sets the value the range should end with.

Parameters:
to - The value the range should end with

getTo

public java.lang.Object getTo()
Gets the value the range ends with.

Returns:
the value the range ends with.

setIntervalType

public void setIntervalType(java.lang.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. "d" for Day in Date.

Parameters:
intervalType - Interval type to use for date or time ranges. "d", "w", "m" are allowed values.

getIntervalType

public java.lang.String 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.

toString

public java.lang.String toString()
Returns a simple string representation of this FormulaRange, using "_to", "to_", "_to_" and "to" to indicate limit inclusion.

Overrides:
toString in class java.lang.Object
Returns:
a simple string representation of this FormulaRange

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

i-net Clear Reports

Copyright © 1999-2011 by i-net software GmbH