public class Range extends Object
Constructor and Description |
---|
Range(Lang lang)
Create a Language-Range from a Lang tag
|
Range(Lang lang,
boolean extended)
Create a Language-Range from a Lang tag
|
Range(String range)
Create a Language-Range
|
Range(String range,
boolean extended)
Create a Language-Range
|
Modifier and Type | Method and Description |
---|---|
Range |
append(Subtag subtag)
Append a subtag to the range
|
Range |
appendWildcard()
Append a wildcard subtag to the range
|
List<Subtag> |
asList() |
Range |
clone()
Copy this range
|
int |
compareTo(org.apache.abdera.i18n.rfc4646.SubtagSet o) |
boolean |
contains(String tag) |
boolean |
contains(String tag,
Subtag.Type type) |
boolean |
contains(Subtag subtag) |
int |
count() |
boolean |
equals(Object obj) |
Lang[] |
filter(Lang... lang)
Filter the given set of lang tags.
|
String[] |
filter(String... lang)
Filter the given set of lang tags.
|
static Lang[] |
filter(String range,
Lang... lang)
Filter the given set of lang tags.
|
static String[] |
filter(String range,
String... lang)
Filter the given set of lang tags.
|
Subtag |
get(int index) |
int |
hashCode() |
boolean |
isBasic()
True if this range is a basic range
|
boolean |
isValid() |
Iterator<Subtag> |
iterator() |
int |
length() |
boolean |
matches(Lang lang)
True if the lang tag matches this range
|
boolean |
matches(Lang lang,
boolean extended)
True if the lang tag matches this range
|
boolean |
matches(String lang)
True if the lang tag matches this range
|
boolean |
matches(String lang,
boolean extended)
True if the lang tag matches this range
|
static boolean |
matches(String range,
Lang lang)
True if the lang tag matches the range.
|
static boolean |
matches(String range,
Lang lang,
boolean extended)
True if the lang tag matches the range.
|
static boolean |
matches(String range,
String lang)
True if the lang tag matches the range.
|
static boolean |
matches(String range,
String lang,
boolean extended)
True if the lang tag matches the range.
|
static Range |
parse(String range)
Parse the language-range
|
static Range |
parse(String range,
boolean extended)
Parse the language-range
|
Subtag[] |
toArray() |
Range |
toBasicRange()
Create a basic language-range from this range
|
String |
toString() |
forEach, spliterator
public Range(String range, boolean extended)
range
- The language-rangeextended
- true if this is an extended language rangepublic Range(String range)
public Range(Lang lang)
public Range(Lang lang, boolean extended)
lang
- The language tagextended
- true if this is an extended language-rangepublic Range appendWildcard()
public Range toBasicRange()
public boolean isBasic()
public boolean matches(String lang)
public boolean matches(String lang, boolean extended)
lang
- The language tageextended
- True if extended matching rules should be usedpublic boolean matches(Lang lang)
public boolean matches(Lang lang, boolean extended)
lang
- The language tageextended
- True if extended matching rules should be usedpublic Lang[] filter(Lang... lang)
public String[] filter(String... lang)
public static Lang[] filter(String range, Lang... lang)
public static String[] filter(String range, String... lang)
public static boolean matches(String range, Lang lang, boolean extended)
range
- The language-rangelang
- The language tagextended
- true to use extended match rulespublic static boolean matches(String range, Lang lang)
range
- The language-rangelang
- The language tagextended
- true to use extended match rulespublic static boolean matches(String range, String lang, boolean extended)
range
- The language-rangelang
- The language tagextended
- true to use extended match rulespublic static boolean matches(String range, String lang)
range
- The language-rangelang
- The language tagextended
- true to use extended match rulespublic static Range parse(String range, boolean extended)
range
- The language-rangeextended
- true to use extended language rulespublic boolean contains(Subtag subtag)
public boolean contains(String tag)
public boolean contains(String tag, Subtag.Type type)
public int length()
public boolean isValid()
public int count()
public Subtag get(int index)
public Subtag[] toArray()
public int compareTo(org.apache.abdera.i18n.rfc4646.SubtagSet o)
compareTo
in interface Comparable<org.apache.abdera.i18n.rfc4646.SubtagSet>
Copyright © 2010 - 2020 Adobe. All Rights Reserved