public class OtpErlangList extends OtpErlangObject implements java.lang.Iterable<OtpErlangObject>, java.io.Serializable, java.lang.Cloneable
The arity of the list is the number of elements it contains.
限定符和类型 | 类和说明 |
---|---|
static class |
OtpErlangList.SubList |
OtpErlangObject.Hash
hashCodeValue
构造器和说明 |
---|
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.
|
限定符和类型 | 方法和说明 |
---|---|
int |
arity()
Get the arity of the list.
|
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() |
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) |
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
在类中 OtpErlangObject
protected java.lang.String toString(int start)
public void encode(OtpOutputStream buf)
encode
在类中 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
在类中 OtpErlangObject
o
- the list to compare to.public OtpErlangObject getLastTail()
protected int doHashCode()
doHashCode
在类中 OtpErlangObject
public java.lang.Object clone()
clone
在类中 OtpErlangObject
public java.util.Iterator<OtpErlangObject> iterator()
iterator
在接口中 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)