org.xerial.db
Class TupleImpl

java.lang.Object
  extended by org.xerial.db.AbstractTuple
      extended by org.xerial.db.TupleImpl
All Implemented Interfaces:
Tuple

public class TupleImpl
extends AbstractTuple

A simple implementation of the Tuple interface

Author:
leo

Constructor Summary
TupleImpl(Relation relation, String[] value)
           
 
Method Summary
 int getByteSize()
          Gets the byte size of this tuple
 Object getValue(int relationIndex)
          Gets the column value
 int load(BufferReader reader)
          Loads the tuple from the buffer
 int save(BufferWriter writer)
          Saves the tuple to the buffer
 void setValue(int relationIndex, Object value)
          Sets the tuple value of the specified column
 
Methods inherited from class org.xerial.db.AbstractTuple
getRelation, getValue, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TupleImpl

public TupleImpl(Relation relation,
                 String[] value)
Method Detail

getValue

public Object getValue(int relationIndex)
Description copied from interface: Tuple
Gets the column value

Specified by:
getValue in interface Tuple
Specified by:
getValue in class AbstractTuple
Parameters:
relationIndex - the column index from which the value is read
Returns:
the column value of the specfied column index

setValue

public void setValue(int relationIndex,
                     Object value)
Description copied from interface: Tuple
Sets the tuple value of the specified column

Specified by:
setValue in interface Tuple
Specified by:
setValue in class AbstractTuple
Parameters:
relationIndex - the column index to which the value is set
value - the column value to set

getByteSize

public int getByteSize()
Description copied from interface: Tuple
Gets the byte size of this tuple

Returns:
the byte size of this tuple

load

public int load(BufferReader reader)
Description copied from interface: Tuple
Loads the tuple from the buffer

Parameters:
reader - the BufferReader
Returns:
the byte size read (tuple size)

save

public int save(BufferWriter writer)
Description copied from interface: Tuple
Saves the tuple to the buffer

Parameters:
writer - the BufferWriter
Returns:
the byte size wrote (tuple size)


Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.1 Japan License.