public class ConfETuple extends ConfEObject implements Serializable, Cloneable
The arity of the tuple is the number of elements it contains. Elements are indexed from 0 to (arity-1) and can be retrieved individually by using the appropriate index.
Constructor and Description |
---|
ConfETuple(ConfEObject elem)
Create a unary tuple containing the given element.
|
ConfETuple(ConfEObject[] elems)
Create a tuple from an array of terms.
|
ConfETuple(ConfEObject[] elems,
int start,
int count)
Create a tuple from an array of terms.
|
ConfETuple(ConfInputStream buf)
Create a tuple from a stream containing an tuple encoded in E external
format.
|
Modifier and Type | Method and Description |
---|---|
int |
arity()
Get the arity of the tuple.
|
Object |
clone() |
ConfEObject |
elementAt(int i)
Get the specified element from the tuple.
|
ConfEObject[] |
elements()
Get all the elements from the tuple as an array.
|
void |
encode(ConfOutputStream buf)
Convert this tuple to the equivalent E external representation.
|
boolean |
equals(Object o)
Determine if two tuples are equal.
|
int |
hashCode() |
String |
toString()
Get the string representation of the tuple.
|
decode
public ConfETuple(ConfEObject elem)
elem
- the element to create the tuple from.IllegalArgumentException
- if the array is empty (null).public ConfETuple(ConfEObject[] elems)
elems
- the array of terms to create the tuple from.IllegalArgumentException
- if the array is empty (null) or contains null elements.public ConfETuple(ConfEObject[] elems, int start, int count)
elems
- the array of terms to create the tuple from.start
- the offset of the first term to insert.count
- the number of terms to insert.IllegalArgumentException
- if the array is empty (null) or contains null elements.public ConfETuple(ConfInputStream buf) throws ConfEDecodeException
buf
- the stream containing the encoded tuple.ConfEDecodeException
- if the buffer does not contain a valid external
representation of an E tuple.public int arity()
public ConfEObject elementAt(int i)
i
- the index of the requested element. Tuple elements are
numbered as array elements, starting at 0.public ConfEObject[] elements()
public String toString()
toString
in class ConfEObject
public void encode(ConfOutputStream buf)
encode
in class ConfEObject
buf
- an output stream to which the encoded tuple should be written.public boolean equals(Object o)
equals
in class ConfEObject
o
- the tuple to compare to.public Object clone()
clone
in class ConfEObject