|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectheap.Tuple
Field Summary | |
static int |
max_size
Maximum size of any tuple |
Fields inherited from interface global.GlobalConst |
INVALID_PAGE, MAX_NAME, MAX_SPACE, MAXATTRNAME, MAXFILENAME, MAXINDEXNAME, MINIBASE_BUFFER_POOL_SIZE, MINIBASE_DB_SIZE, MINIBASE_DEFAULT_SHAREDMEM_SIZE, MINIBASE_MAX_TRANSACTIONS, MINIBASE_MAXARRSIZE, MINIBASE_PAGESIZE, NUMBUF |
Constructor Summary | |
Tuple()
Class constructor Creat a new tuple with length = max_size,tuple offset = 0. |
|
Tuple(byte[] atuple,
int offset,
int length)
Constructor |
|
Tuple(int size)
Class constructor Creat a new tuple with length = size,tuple offset = 0. |
|
Tuple(Tuple fromTuple)
Constructor(used as tuple copy) |
Method Summary | |
short[] |
copyFldOffset()
Makes a copy of the fldOffset array |
char |
getCharFld(int fldNo)
Convert this field into a character |
float |
getFloFld(int fldNo)
Convert this field in to float |
int |
getIntFld(int fldNo)
Convert this field into integer |
int |
getLength()
get the length of a tuple, call this method if you did not call setHdr () before |
int |
getOffset()
get the offset of a tuple |
java.lang.String |
getStrFld(int fldNo)
Convert this field into String |
byte[] |
getTupleByteArray()
Copy the tuple byte array out |
short |
noOfFlds()
Returns number of fields in this tuple |
void |
print(AttrType[] type)
Print out the tuple |
byte[] |
returnTupleByteArray()
return the data byte array |
Tuple |
setFloFld(int fldNo,
float val)
Set this field to float value |
void |
setHdr(short numFlds,
AttrType[] types,
short[] strSizes)
setHdr will set the header of this tuple. |
Tuple |
setIntFld(int fldNo,
int val)
Set this field to integer value |
Tuple |
setStrFld(int fldNo,
java.lang.String val)
Set this field to String value |
short |
size()
get the length of a tuple, call this method if you did call setHdr () before |
void |
tupleCopy(Tuple fromTuple)
Copy a tuple to the current tuple position you must make sure the tuple lengths must be equal |
void |
tupleInit(byte[] atuple,
int offset,
int length)
This is used when you don't want to use the constructor |
void |
tupleSet(byte[] record,
int offset,
int length)
Set a tuple with the given tuple length and offset |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int max_size
Constructor Detail |
public Tuple()
public Tuple(byte[] atuple, int offset, int length)
atuple
- a byte array which contains the tupleoffset
- the offset of the tuple in the byte arraylength
- the length of the tuplepublic Tuple(Tuple fromTuple)
fromTuple
- a byte array which contains the tuplepublic Tuple(int size)
Method Detail |
public void tupleCopy(Tuple fromTuple)
fromTuple
- the tuple being copiedpublic void tupleInit(byte[] atuple, int offset, int length)
atuple
- a byte array which contains the tupleoffset
- the offset of the tuple in the byte arraylength
- the length of the tuplepublic void tupleSet(byte[] record, int offset, int length)
record
- a byte array contains the tupleoffset
- the offset of the tuple ( =0 by default)length
- the length of the tuplepublic int getLength()
public short size()
public int getOffset()
public byte[] getTupleByteArray()
public byte[] returnTupleByteArray()
public int getIntFld(int fldNo) throws java.io.IOException, FieldNumberOutOfBoundException
fldNo
- the field number
java.io.IOException
- I/O errors
FieldNumberOutOfBoundException
- Tuple field number out of boundpublic float getFloFld(int fldNo) throws java.io.IOException, FieldNumberOutOfBoundException
fldNo
- the field number
java.io.IOException
- I/O errors
FieldNumberOutOfBoundException
- Tuple field number out of boundpublic java.lang.String getStrFld(int fldNo) throws java.io.IOException, FieldNumberOutOfBoundException
fldNo
- the field number
java.io.IOException
- I/O errors
FieldNumberOutOfBoundException
- Tuple field number out of boundpublic char getCharFld(int fldNo) throws java.io.IOException, FieldNumberOutOfBoundException
fldNo
- the field number
java.io.IOException
- I/O errors
FieldNumberOutOfBoundException
- Tuple field number out of boundpublic Tuple setIntFld(int fldNo, int val) throws java.io.IOException, FieldNumberOutOfBoundException
fldNo
- the field numberval
- the integer value
java.io.IOException
- I/O errors
FieldNumberOutOfBoundException
- Tuple field number out of boundpublic Tuple setFloFld(int fldNo, float val) throws java.io.IOException, FieldNumberOutOfBoundException
fldNo
- the field numberval
- the float value
java.io.IOException
- I/O errors
FieldNumberOutOfBoundException
- Tuple field number out of boundpublic Tuple setStrFld(int fldNo, java.lang.String val) throws java.io.IOException, FieldNumberOutOfBoundException
fldNo
- the field numberval
- the string value
java.io.IOException
- I/O errors
FieldNumberOutOfBoundException
- Tuple field number out of boundpublic void setHdr(short numFlds, AttrType[] types, short[] strSizes) throws java.io.IOException, InvalidTypeException, InvalidTupleSizeException
numFlds
- number of fields
java.io.IOException
- I/O errors
InvalidTypeException
- Invalid tupe type
InvalidTupleSizeException
- Tuple size too bigpublic short noOfFlds()
public short[] copyFldOffset()
public void print(AttrType[] type) throws java.io.IOException
type
- the types in the tuple
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |