public static class Uri.Encoded extends Object implements Comparable<Uri.Encoded>, CharSequence
Constructor and Description |
---|
Uri.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)
|
Modifier and Type | Method and 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 the
x-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 String
|
int |
hashCode() |
int |
indexOf(int ch)
See
String.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() |
public Uri.Encoded(String vanilla, String legal)
Uses Uri.encode(String, String)
for implementation..
vanilla
- the string to be encodedlegal
- extended character set, allowed to be preserved in the vanilla stringpublic static Uri.Encoded cast(String encoded)
No encoding will be performed, use with care.
public boolean isASCII()
public final String get()
public final String decode()
x-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..
public final String toString()
Returns the encoded String, same as get()
.
toString
in interface CharSequence
toString
in class Object
public final boolean equals(Object o)
equals
in class Object
o
- The comparison argument, either a Uri.Encoded
or a String
true
if the given object is equivalent to this instance,
otherwise false
.#compareTo(Encoded)
,
#equalsIgnoreCase(Encoded)
public final int length()
length
in interface CharSequence
public final char charAt(int index)
charAt
in interface CharSequence
public final CharSequence subSequence(int start, int end)
subSequence
in interface CharSequence
public final int compareTo(Uri.Encoded o)
compareTo
in interface Comparable<Uri.Encoded>
public Uri.Encoded concat(Uri.Encoded encoded)
public final Uri.Encoded substring(int start)
public final Uri.Encoded substring(int start, int end)
public final int indexOf(int ch)
String.indexOf(int)
.public final int indexOf(int ch, int fromIndex)
public final int indexOf(String str)
public final int indexOf(String str, int fromIndex)
public final int lastIndexOf(int ch)
public int lastIndexOf(int ch, int fromIndex)
public int lastIndexOf(String str)
public int lastIndexOf(String str, int fromIndex)
public boolean startsWith(String prefix)
public boolean startsWith(String prefix, int toffset)
public boolean endsWith(String suffix)
public final boolean equalsIgnoreCase(Uri.Encoded anotherEncoded)