Package com.mckoi.database
Class SelectableRange
- java.lang.Object
-
- com.mckoi.database.SelectableRange
-
public final class SelectableRange extends java.lang.ObjectAn object that represents a range of values to select from a list. A range has a start value, an end value, and whether we should pick inclusive or exclusive of the end value. The start value may be a concrete value from the set or it may be a flag that represents the start or end of the list.For example, to select the first item from a set the range would be;
RANGE: start = FIRST_VALUE, first end = LAST_VALUE, first
To select the last item from a set the range would be;RANGE: start = FIRST_VALUE, last end = LAST_VALUE, last
To select the range of values between '10' and '15' then range would be;RANGE: start = FIRST_VALUE, '10' end = LAST_VALUE, '15'
Note that the the start value may not compare less than the end value. For example, start can not be 'last' and end can not be 'first'.
-
-
Field Summary
Fields Modifier and Type Field Description static byteAFTER_LAST_VALUERepresents the various points in the set on the value to represent the set range.static byteBEFORE_FIRST_VALUERepresents the various points in the set on the value to represent the set range.private TObjectendThe end of the range to select from the set.static TObjectFIRST_IN_SETAn object that represents the first value in the set.static byteFIRST_VALUERepresents the various points in the set on the value to represent the set range.static SelectableRangeFULL_RANGEThe range that represents the entire range (including null).static SelectableRangeFULL_RANGE_NO_NULLSThe range that represents the entire range (not including null).static TObjectLAST_IN_SETAn object that represents the last value in the set.static byteLAST_VALUERepresents the various points in the set on the value to represent the set range.private byteset_end_flagDenotes the place for the range to end with respect to the end value.private byteset_start_flagDenotes the place for the range to start with respect to the start value.private TObjectstartThe start of the range to select from the set.
-
Constructor Summary
Constructors Constructor Description SelectableRange(byte set_start_flag, TObject start, byte set_end_flag, TObject end)Constructs the range.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object ob)Returns true if this range is equal to the given range.TObjectgetEnd()Returns the end of the range.bytegetEndFlag()Returns the place for the range to end (either BEFORE_FIRST_VALUE or LAST VALUE).TObjectgetStart()Returns the start of the range.bytegetStartFlag()Returns the place for the range to start (either FIRST_VALUE or AFTER_LAST_VALUE)java.lang.StringtoString()Outputs this range as a string.
-
-
-
Field Detail
-
FIRST_IN_SET
public static final TObject FIRST_IN_SET
An object that represents the first value in the set.Note that these objects have no (NULL) type.
-
LAST_IN_SET
public static final TObject LAST_IN_SET
An object that represents the last value in the set.Note that these objects have no (NULL) type.
-
FIRST_VALUE
public static final byte FIRST_VALUE
Represents the various points in the set on the value to represent the set range.- See Also:
- Constant Field Values
-
LAST_VALUE
public static final byte LAST_VALUE
Represents the various points in the set on the value to represent the set range.- See Also:
- Constant Field Values
-
BEFORE_FIRST_VALUE
public static final byte BEFORE_FIRST_VALUE
Represents the various points in the set on the value to represent the set range.- See Also:
- Constant Field Values
-
AFTER_LAST_VALUE
public static final byte AFTER_LAST_VALUE
Represents the various points in the set on the value to represent the set range.- See Also:
- Constant Field Values
-
start
private TObject start
The start of the range to select from the set.
-
end
private TObject end
The end of the range to select from the set.
-
set_start_flag
private byte set_start_flag
Denotes the place for the range to start with respect to the start value. Either FIRST_VALUE or AFTER_LAST_VALUE.
-
set_end_flag
private byte set_end_flag
Denotes the place for the range to end with respect to the end value. Either BEFORE_FIRST_VALUE or LAST_VALUE.
-
FULL_RANGE
public static final SelectableRange FULL_RANGE
The range that represents the entire range (including null).
-
FULL_RANGE_NO_NULLS
public static final SelectableRange FULL_RANGE_NO_NULLS
The range that represents the entire range (not including null).
-
-
Method Detail
-
getStart
public TObject getStart()
Returns the start of the range. NOTE: This may return FIRST_IN_SET or LAST_IN_SET.
-
getEnd
public TObject getEnd()
Returns the end of the range. NOTE: This may return FIRST_IN_SET or LAST_IN_SET.
-
getStartFlag
public byte getStartFlag()
Returns the place for the range to start (either FIRST_VALUE or AFTER_LAST_VALUE)
-
getEndFlag
public byte getEndFlag()
Returns the place for the range to end (either BEFORE_FIRST_VALUE or LAST VALUE).
-
toString
public java.lang.String toString()
Outputs this range as a string.- Overrides:
toStringin classjava.lang.Object
-
equals
public boolean equals(java.lang.Object ob)
Returns true if this range is equal to the given range.- Overrides:
equalsin classjava.lang.Object
-
-