|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectsimpledb.TupleDesc
public class TupleDesc
TupleDesc describes the schema of a tuple.
| Constructor Summary | |
|---|---|
TupleDesc(Type[] typeAr)
Constructor. |
|
TupleDesc(Type[] typeAr,
java.lang.String[] fieldAr)
Create a new TupleDesc with typeAr.length fields with fields of the specified types, with associated named fields. |
|
| Method Summary | |
|---|---|
boolean |
equals(java.lang.Object o)
Compares the specified object with this TupleDesc for equality. |
int |
fieldNameToIndex(java.lang.String name)
Find the index of the field with a given name. |
java.lang.String |
getFieldName(int i)
Gets the (possibly null) field name of the ith field of this TupleDesc. |
Type |
getFieldType(int i)
Gets the type of the ith field of this TupleDesc. |
int |
getSize()
|
int |
hashCode()
|
static TupleDesc |
merge(TupleDesc td1,
TupleDesc td2)
Merge two TupleDescs into one, with td1.numFields + td2.numFields fields, with the first td1.numFields coming from td1 and the remaining from td2. |
int |
numFields()
|
java.lang.String |
toString()
Returns a String describing this descriptor. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public TupleDesc(Type[] typeAr,
java.lang.String[] fieldAr)
typeAr - array specifying the number of and types of fields in
this TupleDesc. It must contain at least one entry.fieldAr - array specifying the names of the fields. Note that names may be null.public TupleDesc(Type[] typeAr)
typeAr - array specifying the number of and types of fields in
this TupleDesc. It must contain at least one entry.| Method Detail |
|---|
public int numFields()
public java.lang.String getFieldName(int i)
throws java.util.NoSuchElementException
i - index of the field name to return. It must be a valid index.
java.util.NoSuchElementException - if i is not a valid field reference.
public Type getFieldType(int i)
throws java.util.NoSuchElementException
i - The index of the field to get the type of. It must be a valid index.
java.util.NoSuchElementException - if i is not a valid field reference.
public int fieldNameToIndex(java.lang.String name)
throws java.util.NoSuchElementException
name - name of the field.
java.util.NoSuchElementException - if no field with a matching name is found.public int getSize()
public static TupleDesc merge(TupleDesc td1,
TupleDesc td2)
td1 - The TupleDesc with the first fields of the new TupleDesctd2 - The TupleDesc with the last fields of the TupleDesc
public boolean equals(java.lang.Object o)
equals in class java.lang.Objecto - the Object to be compared for equality with this TupleDesc.
public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||