public class Tuple
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
(package private) java.util.List<Field> |
fieldValues |
private RecordId |
recordId |
private static long |
serialVersionUID |
private TupleDesc |
tupleDesc |
Constructor and Description |
---|
Tuple(TupleDesc td)
Create a new tuple with the specified schema (type).
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
java.util.Iterator<Field> |
fields() |
Field |
getField(int i) |
RecordId |
getRecordId() |
TupleDesc |
getTupleDesc() |
int |
hashCode() |
static Tuple |
merge(Tuple t1,
Tuple t2)
Merges two tuples
|
void |
removeField(int i)
Removes a field from the tuple
Also chages the tuple desc accordingly
|
void |
setField(int i,
Field f)
Change the value of the ith field of this tuple.
|
void |
setRecordId(RecordId rid)
Set the RecordId information for this tuple.
|
static java.util.List<Tuple> |
sortedList(DbIterator iterator,
int field) |
java.lang.String |
toString()
Returns the contents of this Tuple as a string.
|
private static final long serialVersionUID
private TupleDesc tupleDesc
private RecordId recordId
java.util.List<Field> fieldValues
public Tuple(TupleDesc td)
td
- the schema of this tuple. It must be a valid TupleDesc
instance with at least one field.public TupleDesc getTupleDesc()
public RecordId getRecordId()
public void setRecordId(RecordId rid)
rid
- the new RecordId for this tuple.public void setField(int i, Field f)
i
- index of the field to change. It must be a valid index.f
- new value for the field.public Field getField(int i)
i
- field index to return. Must be a valid index.public java.lang.String toString()
toString
in class java.lang.Object
public java.util.Iterator<Field> fields()
public static Tuple merge(Tuple t1, Tuple t2)
t1
- Tuple 1t2
- Tuple 2public void removeField(int i)
i
- The index of field to removepublic boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public static java.util.List<Tuple> sortedList(DbIterator iterator, int field) throws DbException, TransactionAbortedException