Class Cut<C extends java.lang.Comparable>

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<Cut<C>>
    Direct Known Subclasses:
    Cut.AboveAll, Cut.AboveValue, Cut.BelowAll, Cut.BelowValue

    @GwtCompatible
    abstract class Cut<C extends java.lang.Comparable>
    extends java.lang.Object
    implements java.lang.Comparable<Cut<C>>, java.io.Serializable
    Implementation detail for the internal structure of Range instances. Represents a unique way of "cutting" a "number line" (actually of instances of type C, not necessarily "numbers") into two sections; this can be done below a certain value, above a certain value, below all values or above all values. With this object defined in this way, an interval can always be represented by a pair of Cut instances.
    • Field Detail

      • endpoint

        final C extends java.lang.Comparable endpoint
    • Constructor Detail

      • Cut

        Cut​(C endpoint)
    • Method Detail

      • isLessThan

        abstract boolean isLessThan​(C value)
      • typeAsLowerBound

        abstract BoundType typeAsLowerBound()
      • typeAsUpperBound

        abstract BoundType typeAsUpperBound()
      • describeAsLowerBound

        abstract void describeAsLowerBound​(java.lang.StringBuilder sb)
      • describeAsUpperBound

        abstract void describeAsUpperBound​(java.lang.StringBuilder sb)
      • greatestValueBelow

        abstract C greatestValueBelow​(DiscreteDomain<C> domain)
      • compareTo

        public int compareTo​(Cut<C> that)
        Specified by:
        compareTo in interface java.lang.Comparable<C extends java.lang.Comparable>
      • endpoint

        C endpoint()
      • equals

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

        public abstract int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • belowAll

        static <C extends java.lang.Comparable> Cut<C> belowAll()
      • aboveAll

        static <C extends java.lang.Comparable> Cut<C> aboveAll()
      • belowValue

        static <C extends java.lang.Comparable> Cut<C> belowValue​(C endpoint)
      • aboveValue

        static <C extends java.lang.Comparable> Cut<C> aboveValue​(C endpoint)