|
|||||||||
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.OtpErlangList
public class OtpErlangList
Provides a Java representation of Erlang lists. Lists are created from zero or more arbitrary Erlang terms.
The arity of the list is the number of elements it contains.
Nested Class Summary | |
---|---|
static class |
OtpErlangList.SubList
|
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 | |
---|---|
OtpErlangList()
Create an empty list. |
|
OtpErlangList(OtpErlangObject elem)
Create a list containing one element. |
|
OtpErlangList(OtpErlangObject[] elems)
Create a list from an array of arbitrary Erlang terms. |
|
OtpErlangList(OtpErlangObject[] elems,
int start,
int count)
Create a list from an array of arbitrary Erlang terms. |
|
OtpErlangList(OtpErlangObject[] elems,
OtpErlangObject lastTail)
Create a list from an array of arbitrary Erlang terms. |
|
OtpErlangList(OtpInputStream buf)
Create a list from a stream containing an list encoded in Erlang external format. |
|
OtpErlangList(java.lang.String str)
Create a list of Erlang integers representing Unicode codePoints. |
Method Summary | ||
---|---|---|
int |
arity()
Get the arity of the list. |
|
|
bind(T binds)
Make new Erlang term replacing variables with the respective values from bindings argument(s). |
|
java.lang.Object |
clone()
|
|
protected int |
doHashCode()
|
|
OtpErlangObject |
elementAt(int i)
Get the specified element from the list. |
|
OtpErlangObject[] |
elements()
Get all the elements from the list as an array. |
|
void |
encode(OtpOutputStream buf)
Convert this list to the equivalent Erlang external representation. |
|
protected void |
encode(OtpOutputStream buf,
int start)
|
|
boolean |
equals(java.lang.Object o)
Determine if two lists are equal. |
|
OtpErlangObject |
getHead()
|
|
OtpErlangObject |
getLastTail()
|
|
OtpErlangObject |
getNthTail(int n)
|
|
OtpErlangObject |
getTail()
|
|
boolean |
isProper()
|
|
java.util.Iterator<OtpErlangObject> |
iterator()
|
|
|
match(OtpErlangObject term,
T bindings)
Perform match operation against given term. |
|
java.lang.String |
stringValue()
Convert a list of integers into a Unicode string, interpreting each integer as a Unicode code point value. |
|
java.lang.String |
toString()
Get the string representation of the list. |
|
protected java.lang.String |
toString(int start)
|
Methods inherited from class com.ericsson.otp.erlang.OtpErlangObject |
---|
decode, hashCode |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public OtpErlangList()
public OtpErlangList(java.lang.String str)
str
- the characters from which to create the list.public OtpErlangList(OtpErlangObject elem)
elem
- the elememet to make the list from.public OtpErlangList(OtpErlangObject[] elems)
elems
- the array of terms from which to create the list.public OtpErlangList(OtpErlangObject[] elems, OtpErlangObject lastTail) throws OtpErlangException
elems
- array of terms from which to create the listlastTail
-
OtpErlangException
public OtpErlangList(OtpErlangObject[] elems, int start, int count)
elems
- the array of terms from which to create the list.start
- the offset of the first term to insert.count
- the number of terms to insert.public OtpErlangList(OtpInputStream buf) throws OtpErlangDecodeException
buf
- the stream containing the encoded list.
OtpErlangDecodeException
- if the buffer does not contain a valid external
representation of an Erlang list.Method Detail |
---|
public int arity()
public OtpErlangObject elementAt(int i)
i
- the index of the requested element. List elements are numbered
as array elements, starting at 0.
public OtpErlangObject[] elements()
public java.lang.String toString()
toString
in class OtpErlangObject
protected java.lang.String toString(int start)
public void encode(OtpOutputStream buf)
encode
in class OtpErlangObject
buf
- An output stream to which the encoded list should be written.protected void encode(OtpOutputStream buf, int start)
public boolean equals(java.lang.Object o)
equals
in class OtpErlangObject
o
- the list to compare to.
public <T> boolean match(OtpErlangObject term, T bindings)
OtpErlangObject
match
in class OtpErlangObject
term
- the object to matchbindings
- variable bindings
public <T> OtpErlangObject bind(T binds) throws OtpErlangException
OtpErlangObject
bind
in class OtpErlangObject
binds
- variable bindings
OtpErlangException
public OtpErlangObject getLastTail()
protected int doHashCode()
doHashCode
in class OtpErlangObject
public java.lang.Object clone()
clone
in class OtpErlangObject
public java.util.Iterator<OtpErlangObject> iterator()
iterator
in interface java.lang.Iterable<OtpErlangObject>
public boolean isProper()
public OtpErlangObject getHead()
public OtpErlangObject getTail()
public OtpErlangObject getNthTail(int n)
public java.lang.String stringValue() throws OtpErlangException
OtpErlangException
- for non-proper and non-integer lists.
OtpErlangRangeException
- if any integer does not fit into a Java int.
java.security.InvalidParameterException
- if any integer is not within the Unicode range.String.String(int[], int, int)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |