|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jstatcom.model.NumberRangeTypes
public class NumberRangeTypes
This class contains an enumeration of constants that define different types of number ranges.
It implements the typesave enum pattern (Joshua Bloch, "Effective Java", Item 21).
If you compare NumberRangeTypes
, always use the ==
operator. This is
save, because they are Singletons (Gamma et al., 1995).
Field Summary | |
---|---|
static NumberRangeTypes |
CLOSED
Type for closed interval. |
static NumberRangeTypes |
LEFT_OPEN
Type for left-open interval. |
java.lang.String |
leftBracket
"(" (not inclusive) or "[" (inclusive). |
boolean |
leftOpen
Whether lower bound is open. |
static NumberRangeTypes |
OPEN
Type for open interval. |
static NumberRangeTypes |
RIGHT_OPEN
Type for right-open interval. |
java.lang.String |
rightBracket
")" (not inclusive) or "]" (inclusive). |
boolean |
rightOpen
Whether upper bound is open. |
Method Summary | |
---|---|
static NumberRangeTypes |
getTypeForBounds(boolean leftOpen,
boolean rightOpen)
Gets the appropriate range type according to the specification of the bounds openess. |
boolean |
isLeftOpen()
Gets whether left bound is open. |
boolean |
isRightOpen()
Gets whether right bound is open. |
java.lang.String |
leftBracket()
Gets the strimg for the left bracket. |
java.lang.String |
name()
Returns the name of the type. |
java.lang.String |
rightBracket()
Gets the strimg for the right bracket. |
java.lang.String |
toString()
Returns a string representation of the type, do not use for comparisons. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public final java.lang.String leftBracket
public final java.lang.String rightBracket
public final boolean leftOpen
public final boolean rightOpen
public static final NumberRangeTypes CLOSED
public static final NumberRangeTypes OPEN
public static final NumberRangeTypes LEFT_OPEN
public static final NumberRangeTypes RIGHT_OPEN
Method Detail |
---|
public final java.lang.String leftBracket()
public final java.lang.String name()
public final java.lang.String rightBracket()
public static final NumberRangeTypes getTypeForBounds(boolean leftOpen, boolean rightOpen)
leftOpen
- whether lower bound is openrightOpen
- whether upper bound is open
public final boolean isLeftOpen()
true
if left bound is openpublic final boolean isRightOpen()
true
if right bound is openpublic final java.lang.String toString()
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |