org.feijoas.mango.common.collect

DiscreteDomain

Related Docs: object DiscreteDomain | package collect

trait DiscreteDomain[C] extends AnyRef

A descriptor for a discrete domain such as all Int instances. A discrete domain is one that supports the three basic operations: #next, #previous and #distance, according to their specifications. The methods #minValue and #maxValue should also be overridden for bounded types.

A discrete domain always represents the entire set of values of its type; it cannot represent partial domains such as "prime integers" or "strings of length 5."

See the Guava User Guide section on DiscreteDomain.

Annotations
@Beta()
Since

0.8 (copied from Guava-libraries)

Linear Supertypes
AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. DiscreteDomain
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def distance(start: C, end: C): Long

    Returns a signed value indicating how many nested invocations of #next (if positive) or #previous (if negative) are needed to reach end starting from start.

    Returns a signed value indicating how many nested invocations of #next (if positive) or #previous (if negative) are needed to reach end starting from start. For example, if end = next(next(next(start))), then distance(start, end) == 3 and distance(end, start) == -3. As well, distance(a, a) is always zero.

    Note that this function is necessarily well-defined for any discrete type.

    returns

    the distance as described above, or Long#MIN_VALUE or Long#MAX_VALUE if the distance is too small or too large, respectively.

  2. abstract def next(value: C): Option[C]

    Returns a Some wiht the unique least value of type C that is greater than value, or None if none exists.

    Returns a Some wiht the unique least value of type C that is greater than value, or None if none exists. Inverse operation to #previous.

    value

    any value of type C

    returns

    Some with the least value greater than value, or None if value is maxValue()

  3. abstract def previous(value: C): Option[C]

    Returns a Some with the unique greatest value of type C that is less than value, or None if none exists.

    Returns a Some with the unique greatest value of type C that is less than value, or None if none exists. Inverse operation to #next.

    value

    any value of type C

    returns

    Some with the greatest value less than value, or None if value is minValue()

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  5. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  10. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  11. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  12. def maxValue(): Option[C]

    Returns a Some with the maximum value of type C, if it has one.

    Returns a Some with the maximum value of type C, if it has one. The maximum value is the unique value for which Ordering#compare(this,that) never returns a negative value for any input of type C.

    The default implementation returns None.

    returns

    a Some with the maximum value of type C or None if there is none

  13. def minValue(): Option[C]

    Returns a Some with the minimum value of type C, if it has one.

    Returns a Some with the minimum value of type C, if it has one. The minimum value is the unique value for which Ordering#compare(this,that) never returns a positive value for any input of type C.

    The default implementation returns None.

    returns

    a Some with the minimum value of type C or None if there is none

  14. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  15. final def notify(): Unit

    Definition Classes
    AnyRef
  16. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  17. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  18. def toString(): String

    Definition Classes
    AnyRef → Any
  19. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  20. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  21. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped