|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.pig.data.DefaultTuple
public class DefaultTuple
A default implementation of Tuple. This class will be created by the DefaultTupleFactory.
Nested Class Summary | |
---|---|
static class |
DefaultTuple.DefaultTupleRawComparator
|
Field Summary | |
---|---|
protected boolean |
isNull
|
protected List<Object> |
mFields
|
Fields inherited from interface org.apache.pig.data.Tuple |
---|
NOTNULL, NULL |
Constructor Summary | |
---|---|
DefaultTuple()
Default constructor. |
Method Summary | |
---|---|
void |
append(Object val)
Append a field to a tuple. |
int |
compareTo(Object other)
|
boolean |
equals(Object other)
|
Object |
get(int fieldNum)
Get the value in a given field. |
List<Object> |
getAll()
Get all of the fields in the tuple as a list. |
static Class<? extends TupleRawComparator> |
getComparatorClass()
|
long |
getMemorySize()
Determine the size of tuple in memory. |
byte |
getType(int fieldNum)
Find the type of a given field. |
int |
hashCode()
|
boolean |
isNull()
Determine if this entire tuple (not any particular field) is null. |
boolean |
isNull(int fieldNum)
Find out if a given field is null. |
void |
readFields(DataInput in)
|
void |
reference(Tuple t)
Make this tuple reference the contents of another. |
void |
set(int fieldNum,
Object val)
Set the value in a given field. |
void |
setNull(boolean isNull)
Mark this entire tuple as null or not null. |
int |
size()
Find the size of the tuple. |
String |
toDelimitedString(String delim)
Write a tuple of atomic values into a string. |
String |
toString()
|
void |
write(DataOutput out)
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected boolean isNull
protected List<Object> mFields
Constructor Detail |
---|
public DefaultTuple()
Method Detail |
---|
public void reference(Tuple t)
reference
in interface Tuple
t
- Tuple to reference.public int size()
size
in interface Tuple
public boolean isNull(int fieldNum) throws ExecException
isNull
in interface Tuple
fieldNum
- Number of field to check for null.
ExecException
- if the field number given is greater than or equal to the number of fields in the tuple.public byte getType(int fieldNum) throws ExecException
getType
in interface Tuple
fieldNum
- Number of field to get the type for.
ExecException
- if the field number is greater than or equal to the number of fields in the tuple.public Object get(int fieldNum) throws ExecException
get
in interface Tuple
fieldNum
- Number of the field to get the value for.
ExecException
- if the field number is greater than or equal to the number of fields in the tuple.public List<Object> getAll()
getAll
in interface Tuple
public void set(int fieldNum, Object val) throws ExecException
set
in interface Tuple
fieldNum
- Number of the field to set the value for.val
- Object to put in the indicated field.
ExecException
- if the field number is greater than or equal to the number of fields in the tuple.public void append(Object val)
append
in interface Tuple
val
- Object to append to the tuple.public long getMemorySize()
getMemorySize
in interface Tuple
public String toDelimitedString(String delim) throws ExecException
toDelimitedString
in interface Tuple
delim
- Delimiter to use in the string.
ExecException
- if a non-atomic value is found.public String toString()
toString
in class Object
public int compareTo(Object other)
compareTo
in interface Comparable
public boolean equals(Object other)
equals
in class Object
public int hashCode()
hashCode
in class Object
public void write(DataOutput out) throws IOException
write
in interface org.apache.hadoop.io.Writable
IOException
public void readFields(DataInput in) throws IOException
readFields
in interface org.apache.hadoop.io.Writable
IOException
public boolean isNull()
Tuple
isNull
in interface Tuple
public void setNull(boolean isNull)
Tuple
setNull
in interface Tuple
isNull
- boolean indicating whether this tuple is nullpublic static Class<? extends TupleRawComparator> getComparatorClass()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |