Package com.jogamp.common.net
Class Uri.Encoded
- java.lang.Object
-
- com.jogamp.common.net.Uri.Encoded
-
- All Implemented Interfaces:
CharSequence
,Comparable<Uri.Encoded>
- Direct Known Subclasses:
Uri.ASCIIEncoded
- Enclosing class:
- Uri
public static class Uri.Encoded extends Object implements Comparable<Uri.Encoded>, CharSequence
Immutable RFC3986 encoded string.
-
-
Constructor Summary
Constructors Constructor Description Encoded(String vanilla, String legal)
Encodes all characters into their hexadecimal value prepended by '%', except: letters ('a'..'z', 'A'..'Z') numbers ('0'..'9') characters in the legal-set parameter others (unicode characters that are not in US-ASCII set, and are not ISO Control or are not ISO Space characters)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Uri.Encoded
cast(String encoded)
Casts the given encoded String by creating a new Encoded instance.char
charAt(int index)
int
compareTo(Uri.Encoded o)
Uri.Encoded
concat(Uri.Encoded encoded)
String
decode()
Decodes the string argument which is assumed to be encoded in thex-www-form-urlencoded
MIME content type using the UTF-8 encoding scheme.boolean
endsWith(String suffix)
boolean
equals(Object o)
boolean
equalsIgnoreCase(Uri.Encoded anotherEncoded)
String
get()
Returns the encoded Stringint
hashCode()
int
indexOf(int ch)
SeeString.indexOf(int)
.int
indexOf(int ch, int fromIndex)
int
indexOf(String str)
int
indexOf(String str, int fromIndex)
boolean
isASCII()
int
lastIndexOf(int ch)
int
lastIndexOf(int ch, int fromIndex)
int
lastIndexOf(String str)
int
lastIndexOf(String str, int fromIndex)
int
length()
boolean
startsWith(String prefix)
boolean
startsWith(String prefix, int toffset)
CharSequence
subSequence(int start, int end)
Uri.Encoded
substring(int start)
Uri.Encoded
substring(int start, int end)
String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface java.lang.CharSequence
chars, codePoints
-
-
-
-
Constructor Detail
-
Encoded
public Encoded(String vanilla, String legal)
Encodes all characters into their hexadecimal value prepended by '%', except:- letters ('a'..'z', 'A'..'Z')
- numbers ('0'..'9')
- characters in the legal-set parameter
- others (unicode characters that are not in US-ASCII set, and are not ISO Control or are not ISO Space characters)
Uses
Uri.encode(String, String)
for implementation..- Parameters:
vanilla
- the string to be encodedlegal
- extended character set, allowed to be preserved in the vanilla string
-
-
Method Detail
-
cast
public static Uri.Encoded cast(String encoded)
Casts the given encoded String by creating a new Encoded instance.No encoding will be performed, use with care.
-
isASCII
public boolean isASCII()
-
get
public final String get()
Returns the encoded String
-
decode
public final String decode()
Decodes the string argument which is assumed to be encoded in thex-www-form-urlencoded
MIME content type using the UTF-8 encoding scheme.'%' and two following hex digit characters are converted to the equivalent byte value. All other characters are passed through unmodified.
e.g. "A%20B%20C %24%25" -> "A B C $%"
Uses
Uri.decode(String)
for implementation..
-
toString
public final String toString()
Returns the encoded String, same as
get()
.- Specified by:
toString
in interfaceCharSequence
- Overrides:
toString
in classObject
-
equals
public final boolean equals(Object o)
- Overrides:
equals
in classObject
- Parameters:
o
- The comparison argument, either aUri.Encoded
or aString
- Returns:
true
if the given object is equivalent to this instance, otherwisefalse
.- See Also:
compareTo(Encoded)
,equalsIgnoreCase(Encoded)
-
length
public final int length()
- Specified by:
length
in interfaceCharSequence
-
charAt
public final char charAt(int index)
- Specified by:
charAt
in interfaceCharSequence
-
subSequence
public final CharSequence subSequence(int start, int end)
- Specified by:
subSequence
in interfaceCharSequence
-
compareTo
public final int compareTo(Uri.Encoded o)
- Specified by:
compareTo
in interfaceComparable<Uri.Encoded>
-
concat
public Uri.Encoded concat(Uri.Encoded encoded)
-
substring
public final Uri.Encoded substring(int start)
-
substring
public final Uri.Encoded substring(int start, int end)
-
indexOf
public final int indexOf(int ch)
SeeString.indexOf(int)
.
-
indexOf
public final int indexOf(int ch, int fromIndex)
-
indexOf
public final int indexOf(String str)
-
indexOf
public final int indexOf(String str, int fromIndex)
-
lastIndexOf
public final int lastIndexOf(int ch)
-
lastIndexOf
public int lastIndexOf(int ch, int fromIndex)
-
lastIndexOf
public int lastIndexOf(String str)
-
lastIndexOf
public int lastIndexOf(String str, int fromIndex)
-
startsWith
public boolean startsWith(String prefix)
-
startsWith
public boolean startsWith(String prefix, int toffset)
-
endsWith
public boolean endsWith(String suffix)
-
equalsIgnoreCase
public final boolean equalsIgnoreCase(Uri.Encoded anotherEncoded)
-
-