Package com.tailf.proto
Class ConfEList
Object
com.tailf.proto.ConfEObject
com.tailf.proto.ConfEList
- All Implemented Interfaces:
Serializable
,Cloneable
Provides a Java representation of E lists. Lists are created from zero or
more arbitrary E terms.
The arity of the list is the number of elements it contains.
- See Also:
-
Constructor Summary
ConstructorDescriptionCreate an empty list.ConfEList
(ConfEObject elem) Create a list containing one element.ConfEList
(ConfEObject[] elems) Create a list from an array of arbitrary E terms.ConfEList
(ConfEObject[] elems, int start, int count) Create a list from an array of arbitrary E terms.ConfEList
(ConfInputStream buf) Create a list from a stream containing an list encoded in E external format.Create a list of characters. -
Method Summary
Modifier and TypeMethodDescriptionint
arity()
Get the arity of the list.clone()
elementAt
(int i) Get the specified element from the list.elements()
Get all the elements from the list as an array.void
encode
(ConfOutputStream buf) Convert this list to the equivalent E external representation.boolean
Determine if two lists are equal.int
hashCode()
boolean
proper()
reverse()
void
setProper
(boolean p) toString()
Get the string representation of the list.Methods inherited from class com.tailf.proto.ConfEObject
decode
-
Constructor Details
-
ConfEList
public ConfEList()Create an empty list. -
ConfEList
Create a list of characters.- Parameters:
str
- the characters from which to create the list.
-
ConfEList
Create a list containing one element.- Parameters:
elem
- the element to make the list from.
-
ConfEList
Create a list from an array of arbitrary E terms.- Parameters:
elems
- the array of terms from which to create the list.
-
ConfEList
Create a list from an array of arbitrary E terms.- Parameters:
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.
-
ConfEList
Create a list from a stream containing an list encoded in E external format.- Parameters:
buf
- the stream containing the encoded list.- Throws:
ConfEDecodeException
- if the buffer does not contain a valid external representation of an E list.
-
-
Method Details
-
proper
public boolean proper() -
setProper
public void setProper(boolean p) -
arity
public int arity()Get the arity of the list.- Returns:
- the number of elements contained in the list.
-
elementAt
Get the specified element from the list.- Parameters:
i
- the index of the requested element. List elements are numbered as array elements, starting at 0.- Returns:
- the requested element, of null if i is not a valid element index.
-
elements
Get all the elements from the list as an array.- Returns:
- an array containing all of the list's elements.
-
reverse
-
toString
Get the string representation of the list.- Specified by:
toString
in classConfEObject
- Returns:
- the string representation of the list.
-
encode
Convert this list to the equivalent E external representation. Note that this method never encodes lists as strings, even when it is possible to do so.- Specified by:
encode
in classConfEObject
- Parameters:
buf
- An output stream to which the encoded list should be written.
-
equals
Determine if two lists are equal. Lists are equal if they have the same arity and all of the elements are equal.- Specified by:
equals
in classConfEObject
- Parameters:
o
- the list to compare to.- Returns:
- true if the lists have the same arity and all the elements are equal.
-
hashCode
public int hashCode() -
clone
- Overrides:
clone
in classConfEObject
-