|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ericsson.otp.erlang.OtpErlangObject com.ericsson.otp.erlang.OtpErlangString
public class OtpErlangString
Provides a Java representation of Erlang strings.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.ericsson.otp.erlang.OtpErlangObject |
---|
OtpErlangObject.Hash |
Field Summary |
---|
Fields inherited from class com.ericsson.otp.erlang.OtpErlangObject |
---|
hashCodeValue |
Constructor Summary | |
---|---|
OtpErlangString(OtpErlangList list)
Create an Erlang string from a list of integers. |
|
OtpErlangString(OtpInputStream buf)
Create an Erlang string from a stream containing a string encoded in Erlang external format. |
|
OtpErlangString(java.lang.String str)
Create an Erlang string from the given string. |
Method Summary | |
---|---|
protected int |
doHashCode()
|
void |
encode(OtpOutputStream buf)
Convert this string to the equivalent Erlang external representation. |
boolean |
equals(java.lang.Object o)
Determine if two strings are equal. |
static boolean |
isValidCodePoint(int cp)
Validate a code point according to Erlang definition; Unicode 3.0. |
static java.lang.String |
newString(byte[] bytes)
Construct a String from a Latin-1 (ISO-8859-1) encoded byte array, if Latin-1 is available, otherwise use the default encoding. |
static int[] |
stringToCodePoints(java.lang.String s)
Create Unicode code points from a String. |
java.lang.String |
stringValue()
Get the actual string contained in this object. |
java.lang.String |
toString()
Get the printable version of the string contained in this object. |
Methods inherited from class com.ericsson.otp.erlang.OtpErlangObject |
---|
clone, decode, hashCode |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public OtpErlangString(java.lang.String str)
public OtpErlangString(OtpErlangList list) throws OtpErlangException
OtpErlangException
- for non-proper and non-integer lists.
OtpErlangRangeException
- if an integer in the list is not
a valid Unicode code point according to Erlang.public OtpErlangString(OtpInputStream buf) throws OtpErlangDecodeException
buf
- the stream containing the encoded string.
OtpErlangDecodeException
- if the buffer does not contain a valid external
representation of an Erlang string.Method Detail |
---|
public java.lang.String stringValue()
toString()
public java.lang.String toString()
toString
in class OtpErlangObject
stringValue()
public void encode(OtpOutputStream buf)
encode
in class OtpErlangObject
buf
- an output stream to which the encoded string should be
written.public boolean equals(java.lang.Object o)
equals
in class OtpErlangObject
o
- the OtpErlangString or String to compare to.
protected int doHashCode()
doHashCode
in class OtpErlangObject
public static int[] stringToCodePoints(java.lang.String s)
s
- a String to convert to an Unicode code point array
public static boolean isValidCodePoint(int cp)
cp
- the code point value to validate
public static java.lang.String newString(byte[] bytes)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |