Class/Object

org.threeten.bp.temporal

ValueRange

Related Docs: object ValueRange | package temporal

Permalink

final class ValueRange extends Serializable

The range of valid values for a date-time field.

All TemporalField instances have a valid range of values. For example, the ISO day-of-month runs from 1 to somewhere between 28 and 31. This class captures that valid range.

It is important to be aware of the limitations of this class. Only the minimum and maximum values are provided. It is possible for there to be invalid values within the outer range. For example, a weird field may have valid values of 1, 2, 4, 6, 7, thus have a range of '1 - 7', despite that fact that values 3 and 5 are invalid.

Instances of this class are not tied to a specific field.

Specification for implementors

This class is immutable and thread-safe.

Annotations
@SerialVersionUID()
Linear Supertypes
Serializable, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ValueRange
  2. Serializable
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

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

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

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

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

    Permalink
    Definition Classes
    Any
  5. def checkValidIntValue(value: Long, field: TemporalField): Int

    Permalink

    Checks that the specified value is valid and fits in an int.

    Checks that the specified value is valid and fits in an int.

    This validates that the value is within the valid range of values and that all valid values are within the bounds of an int. The field is only used to improve the error message.

    value

    the value to check

    field

    the field being checked, may be null

    returns

    the value that was passed in

    See also

    #isValidIntValue(long)

  6. def checkValidValue(value: Long, field: TemporalField): Long

    Permalink

    Checks that the specified value is valid.

    Checks that the specified value is valid.

    This validates that the value is within the valid range of values. The field is only used to improve the error message.

    value

    the value to check

    field

    the field being checked, may be null

    returns

    the value that was passed in

    See also

    #isValidValue(long)

  7. def clone(): AnyRef

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

    Permalink
    Definition Classes
    AnyRef
  9. def equals(obj: Any): Boolean

    Permalink

    Checks if this range is equal to another range.

    Checks if this range is equal to another range.

    The comparison is based on the four values, minimum, largest minimum, smallest maximum and maximum. Only objects of type ValueRange are compared, other types return false.

    obj

    the object to check, null returns false

    returns

    true if this is equal to the other range

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  12. def getLargestMinimum: Long

    Permalink

    Gets the largest possible minimum value that the field can take.

    Gets the largest possible minimum value that the field can take.

    For example, the ISO day-of-month always starts at 1. The largest minimum is therefore 1.

    returns

    the largest possible minimum value for this field

  13. def getMaximum: Long

    Permalink

    Gets the maximum value that the field can take.

    Gets the maximum value that the field can take.

    For example, the ISO day-of-month runs to between 28 and 31 days. The maximum is therefore 31.

    returns

    the maximum value for this field

  14. def getMinimum: Long

    Permalink

    Gets the minimum value that the field can take.

    Gets the minimum value that the field can take.

    For example, the ISO day-of-month always starts at 1. The minimum is therefore 1.

    returns

    the minimum value for this field

  15. def getSmallestMaximum: Long

    Permalink

    Gets the smallest possible maximum value that the field can take.

    Gets the smallest possible maximum value that the field can take.

    For example, the ISO day-of-month runs to between 28 and 31 days. The smallest maximum is therefore 28.

    returns

    the smallest possible maximum value for this field

  16. def hashCode(): Int

    Permalink

    A hash code for this range.

    A hash code for this range.

    returns

    a suitable hash code

    Definition Classes
    ValueRange → AnyRef → Any
  17. def isFixed: Boolean

    Permalink

    Is the value range fixed and fully known.

    Is the value range fixed and fully known.

    For example, the ISO day-of-month runs from 1 to between 28 and 31. Since there is uncertainty about the maximum value, the range is not fixed. However, for the month of January, the range is always 1 to 31, thus it is fixed.

    returns

    true if the set of values is fixed

  18. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  19. def isIntValue: Boolean

    Permalink

    Checks if all values in the range fit in an int.

    Checks if all values in the range fit in an int.

    This checks that all valid values are within the bounds of an int.

    For example, the ISO month-of-year has values from 1 to 12, which fits in an int. By comparison, ISO nano-of-day runs from 1 to 86,400,000,000,000 which does not fit in an int.

    This implementation uses #getMinimum() and #getMaximum().

    returns

    true if a valid value always fits in an { @code int}

  20. def isValidIntValue(value: Long): Boolean

    Permalink

    Checks if the value is within the valid range and that all values in the range fit in an int.

    Checks if the value is within the valid range and that all values in the range fit in an int.

    This method combines #isIntValue() and #isValidValue(long).

    value

    the value to check

    returns

    true if the value is valid and fits in an { @code int}

  21. def isValidValue(value: Long): Boolean

    Permalink

    Checks if the value is within the valid range.

    Checks if the value is within the valid range.

    This checks that the value is within the stored range of values.

    value

    the value to check

    returns

    true if the value is valid

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

    Permalink
    Definition Classes
    AnyRef
  23. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  24. final def notifyAll(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  26. def toString(): String

    Permalink

    Outputs this range as a String.

    Outputs this range as a String.

    The format will be '{min}/{largestMin} - {smallestMax}/{max}', where the largestMin or smallestMax sections may be omitted, together with associated slash, if they are the same as the min or max.

    returns

    a string representation of this range, not null

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped