GeezerVison is showing docs.oracle.com — ValueRange (Java Platform SE 8 )
Java™ Platform Standard Ed. 8
- Summary:
- Nested |
- Field |
- Constr |
- Method
- Detail:
- Field |
- Constr |
- Method
compact1, compact2, compact3
java.time.temporal
Class ValueRange
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods
| Modifier and Type |
Method |
Description |
int |
checkValidIntValue(long value,
TemporalField field) |
Checks that the specified value is valid and fits in an int.
|
long |
checkValidValue(long value,
TemporalField field) |
Checks that the specified value is valid.
|
boolean |
equals(Object obj) |
Checks if this range is equal to another range.
|
long |
getLargestMinimum() |
Gets the largest possible minimum value that the field can take.
|
long |
getMaximum() |
Gets the maximum value that the field can take.
|
long |
getMinimum() |
Gets the minimum value that the field can take.
|
long |
getSmallestMaximum() |
Gets the smallest possible maximum value that the field can take.
|
int |
hashCode() |
A hash code for this range.
|
boolean |
isFixed() |
Is the value range fixed and fully known.
|
boolean |
isIntValue() |
Checks if all values in the range fit in an int.
|
boolean |
isValidIntValue(long value) |
Checks if the value is within the valid range and that all values
in the range fit in an int.
|
boolean |
isValidValue(long value) |
Checks if the value is within the valid range.
|
static ValueRange |
of(long min,
long max) |
Obtains a fixed value range.
|
static ValueRange |
of(long min,
long maxSmallest,
long maxLargest) |
Obtains a variable value range.
|
static ValueRange |
of(long minSmallest,
long minLargest,
long maxSmallest,
long maxLargest) |
Obtains a fully variable value range.
|
String |
toString() |
Outputs this range as a String.
|
-
-
Method Detail
-
isFixed
public boolean isFixed()
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
-
getMinimum
public long getMinimum()
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
-
getMaximum
public long getMaximum()
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
-
toString
public String toString()
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.
- Overrides:
toString in class Object
- Returns:
- a string representation of this range, not null
Java™ Platform Standard Ed. 8
- Summary:
- Nested |
- Field |
- Constr |
- Method
- Detail:
- Field |
- Constr |
- Method
Submit a bug or feature For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples. Copyright © 1993, 2026, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
|