Package com.mckoi.database
Class SelectableRangeSet
java.lang.Object
com.mckoi.database.SelectableRangeSet
Represents a complex normalized range of a list. This is essentially a
set of SelectableRange objects that make up a complex view of a range. For
example, say we had a query
'(a > 10 and a < 20 and a <> 15) or a >= 50',
we could represent this range by the following range set;
RANGE: AFTER_LAST_VALUE 10, BEFORE_FIRST_VALUE 15 RANGE: AFTER_LAST_VALUE 15, BEFORE_FIRST_VALUE 20 RANGE: FIRST_VALUE 50, LAST_VALUE LAST_IN_SET
The range is constructed by calls to 'intersect', and 'union'.
- Author:
- Tobias Downer
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs the SelectableRangeSet to a full range (a range that encompases all values). -
Method Summary
Modifier and TypeMethodDescriptionvoid
Intersects this range with the given Operator and value constraint.static void
A test application.Returns the range as an array of SelectableRange or an empty array if there is no range.toString()
Outputs this range as a string, for diagnostic and testing purposes.void
Unions this range with the given Operator and value constraint.void
union
(SelectableRangeSet union_to) Unions the current range set with the given range set.
-
Constructor Details
-
SelectableRangeSet
public SelectableRangeSet()Constructs the SelectableRangeSet to a full range (a range that encompases all values). If 'no_nulls' is true then the range can't include null values.
-
-
Method Details
-
intersect
Intersects this range with the given Operator and value constraint. For example, if a range is 'a' -> [END] and the given operator is 'invalid input: '<'=' and the value is 'z' the result range is 'a' -> 'z'. -
union
Unions this range with the given Operator and value constraint. -
union
Unions the current range set with the given range set. -
toSelectableRangeArray
Returns the range as an array of SelectableRange or an empty array if there is no range. -
toString
Outputs this range as a string, for diagnostic and testing purposes. -
main
A test application.
-