public class Tuple
extends java.lang.Object
Tuple
.Constructor and Description |
---|
Tuple()
Constructs a new empty
Tuple . |
Tuple(TupleIdentifier tupleIdentifier,
java.util.List<java.lang.Comparable> values)
Constructs a new tuple given an identifier and a
List of values. |
Modifier and Type | Method and Description |
---|---|
byte |
asByte(int slot)
Returns the slot of the tuple cast to a primitive byte.
|
char |
asChar(int slot)
Returns the slot of the tuple cast to a primitive character.
|
double |
asDouble(int slot)
Returns the slot of the tuple cast to a primitive double.
|
float |
asFloat(int slot)
Returns the slot of the tuple cast to a primitive float.
|
int |
asInt(int slot)
Returns the slot of the tuple cast to a primitive integer.
|
long |
asLong(int slot)
Returns the slot of the tuple cast to a primitive long.
|
short |
asShort(int slot)
Returns the slot of the tuple cast to a primitive short.
|
java.lang.String |
asString(int slot)
Returns the slot of the tuple cast to a Java
String . |
boolean |
equals(java.lang.Object o)
Tests this tuple to an object for equality.
|
TupleIdentifier |
getTupleIdentifier()
Returns the identifier of this tuple.
|
java.lang.Comparable |
getValue(int slot)
Returns the specified slot of this tuple as a generic
Comparable.
|
java.util.List<java.lang.Comparable> |
getValues()
Returns the values of this tuple.
|
int |
hashCode()
Returns a hash code for this tuple.
|
boolean |
isIntermediate()
Is this tuple intermediate or not?
|
void |
setTupleIdentifier(TupleIdentifier td)
Sets this tuple's identifier.
|
void |
setValue(int slot,
java.lang.Comparable value)
Sets a value of the tuple.
|
void |
setValues(java.util.List<java.lang.Comparable> values)
Sets the values of this tuple.
|
int |
size()
Returns the size in slots of this tuple.
|
java.lang.String |
toString()
Textual representation.
|
java.lang.String |
toStringFormatted() |
public Tuple()
Tuple
.public Tuple(TupleIdentifier tupleIdentifier, java.util.List<java.lang.Comparable> values)
List
of values.tupleIdentifier
- the identifier of the tuple.values
- the values to be added.public boolean isIntermediate()
true
if the tuple is intermediate,
false
otherwise.public TupleIdentifier getTupleIdentifier()
public void setTupleIdentifier(TupleIdentifier td)
td
- the tuple's identifier.public void setValue(int slot, java.lang.Comparable value)
slot
- the slot of the tuple accessed.value
- the new value of the tuple.public void setValues(java.util.List<java.lang.Comparable> values)
values
- the vector of new values.public int size()
public java.util.List<java.lang.Comparable> getValues()
public char asChar(int slot) throws java.lang.ClassCastException
slot
- the slot of the Tuple
accessed.java.lang.ClassCastException
- if the cast fails.public byte asByte(int slot) throws java.lang.ClassCastException
slot
- the slot of the Tuple
accessed.java.lang.ClassCastException
- if the cast fails.public short asShort(int slot) throws java.lang.ClassCastException
slot
- the slot of the Tuple
accessed.java.lang.ClassCastException
- if the cast fails.public int asInt(int slot) throws java.lang.ClassCastException
slot
- the slot of the Tuple
accessed.java.lang.ClassCastException
- if the cast fails.public long asLong(int slot) throws java.lang.ClassCastException
slot
- the slot of the Tuple
accessed.java.lang.ClassCastException
- if the cast fails.public float asFloat(int slot) throws java.lang.ClassCastException
slot
- the slot of the Tuple
accessed.java.lang.ClassCastException
- if the cast fails.public double asDouble(int slot) throws java.lang.ClassCastException
slot
- the slot of the Tuple
accessed.java.lang.ClassCastException
- if the cast fails.public java.lang.String asString(int slot) throws java.lang.ClassCastException
String
.slot
- the slot of the Tuple
accessed.String
.java.lang.ClassCastException
- if the cast fails.public java.lang.Comparable getValue(int slot)
slot
- ths slot of the Tuple
accessed.public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
o
- the object to compare this tuple to.true
if this tuple is equal to
o
, false
otherwise.public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toStringFormatted()