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