java.io.Serializable
, java.lang.Cloneable
, java.lang.Iterable<OtpErlangObject>
OtpErlangList.SubList
public class OtpErlangList extends OtpErlangObject implements java.lang.Iterable<OtpErlangObject>
The arity of the list is the number of elements it contains.
Modifier and Type | Class | Description |
---|---|---|
static class |
OtpErlangList.SubList |
OtpErlangObject.Hash
hashCodeValue
Constructor | Description |
---|---|
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.
|
Modifier and Type | Method | Description |
---|---|---|
int |
arity() |
Get the arity of the list.
|
<T> OtpErlangObject |
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() |
|
<T> boolean |
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) |
finalize, getClass, notify, notifyAll, wait, wait, wait
decode, hashCode
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.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 bindingspublic <T> OtpErlangObject bind(T binds) throws OtpErlangException
OtpErlangObject
bind
in class OtpErlangObject
binds
- variable bindingsOtpErlangException
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(int[], int, int)