Documentation of 'com.jstatcom.model.NumberRangeTypes' Java class
NumberRangeTypes
com.jstatcom.model

Class NumberRangeTypes



  • public class NumberRangeTypes
    extends java.lang.Object
    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 Detail

      • leftBracket

        public final java.lang.String leftBracket
        "(" (not inclusive) or "[" (inclusive).
      • rightBracket

        public final java.lang.String rightBracket
        ")" (not inclusive) or "]" (inclusive).
      • leftOpen

        public final boolean leftOpen
        Whether lower bound is open.
      • rightOpen

        public final boolean rightOpen
        Whether upper bound is open.
      • LEFT_OPEN

        public static final NumberRangeTypes LEFT_OPEN
        Type for left-open interval.
      • RIGHT_OPEN

        public static final NumberRangeTypes RIGHT_OPEN
        Type for right-open interval.
    • Method Detail

      • leftBracket

        public final java.lang.String leftBracket()
        Gets the strimg for the left bracket.
        Returns:
        "(" or "["
      • name

        public final java.lang.String name()
        Returns the name of the type. Do not use for comparisons, but compare by reference.
        Returns:
        name of this type
      • rightBracket

        public final java.lang.String rightBracket()
        Gets the strimg for the right bracket.
        Returns:
        ")" or "]"
      • getTypeForBounds

        public static final NumberRangeTypes getTypeForBounds(boolean leftOpen,
                                                              boolean rightOpen)
        Gets the appropriate range type according to the specification of the bounds openess.
        Parameters:
        leftOpen - whether lower bound is open
        rightOpen - whether upper bound is open
        Returns:
        number range type
      • isLeftOpen

        public final boolean isLeftOpen()
        Gets whether left bound is open.
        Returns:
        true if left bound is open
      • isRightOpen

        public final boolean isRightOpen()
        Gets whether right bound is open.
        Returns:
        true if right bound is open
      • toString

        public final java.lang.String toString()
        Returns a string representation of the type, do not use for comparisons.
        Overrides:
        toString in class java.lang.Object
        Returns:
        string representing this type

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.