GeezerVison is showing docs.oracle.com — Locale.LanguageRange (Java Platform SE 8 )
Java™ Platform Standard Ed. 8
compact1, compact2, compact3
java.util
Class Locale.LanguageRange
-
-
Field Summary
Fields
| Modifier and Type |
Field |
Description |
static double |
MAX_WEIGHT |
A constant holding the maximum value of weight, 1.0, which indicates
that the language range is a good fit for the user.
|
static double |
MIN_WEIGHT |
A constant holding the minimum value of weight, 0.0, which indicates
that the language range is not a good fit for the user.
|
-
Constructor Summary
Constructors
| Constructor |
Description |
LanguageRange(String range) |
Constructs a LanguageRange using the given range.
|
LanguageRange(String range,
double weight) |
Constructs a LanguageRange using the given range and
weight.
|
-
-
Field Detail
-
MAX_WEIGHT
public static final double MAX_WEIGHT
A constant holding the maximum value of weight, 1.0, which indicates
that the language range is a good fit for the user.
- See Also:
- Constant Field Values
-
MIN_WEIGHT
public static final double MIN_WEIGHT
A constant holding the minimum value of weight, 0.0, which indicates
that the language range is not a good fit for the user.
- See Also:
- Constant Field Values
-
Constructor Detail
-
LanguageRange
public LanguageRange(String range,
double weight)
Constructs a LanguageRange using the given range and
weight. Note that no validation is done against the IANA
Language Subtag Registry at time of construction.
- Parameters:
range - a language range
weight - a weight value between MIN_WEIGHT and
MAX_WEIGHT
- Throws:
NullPointerException - if the given range is
null
IllegalArgumentException - if the given weight is less
than MIN_WEIGHT or greater than MAX_WEIGHT
-
Method Detail
-
equals
public boolean equals(Object obj)
Compares this object to the specified object. The result is true if
and only if the argument is not null and is a
LanguageRange object that contains the same range
and weight values as this object.
- Overrides:
equals in class Object
- Parameters:
obj - the object to compare with
- Returns:
true if this object's range and
weight are the same as the obj's; false
otherwise.
- See Also:
Object.hashCode(),
HashMap
Java™ Platform Standard Ed. 8
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.
|