org.norther.tammi.acorn.io
Class RecordAccessFile.RecordHeader

java.lang.Object
  extended by org.norther.tammi.acorn.io.RecordAccessFile.RecordHeader
Enclosing class:
RecordAccessFile

protected static class RecordAccessFile.RecordHeader
extends Object

A header for records.


Constructor Summary
protected RecordAccessFile.RecordHeader()
          Constructs a new header.
  RecordAccessFile.RecordHeader(long ptr, int cap)
          Constructs a new header with pointer and capacity.
 
Method Summary
 int getCapacity()
          Gets the capacity.
 int getFreeSpace()
          Gets the free space.
 int getIndex()
          Gets the index.
 long getPointer()
          Gets the pointer.
 int getSize()
          Gets the size.
 void read(DataInput data)
          Reads the header data.
static RecordAccessFile.RecordHeader readHeader(DataInput data)
          Reads the next record header.
 void setCapacity(int cap)
          Sets the capacity.
 void setIndex(int ind)
          Sets the index.
 void setPointer(long ptr)
          Sets the pointer.
 void setSize(int s)
          Sets the size.
 RecordAccessFile.RecordHeader split()
          Splits the free space to a new record.
 void write(DataOutput data)
          Writes the header data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RecordAccessFile.RecordHeader

protected RecordAccessFile.RecordHeader()
Constructs a new header.


RecordAccessFile.RecordHeader

public RecordAccessFile.RecordHeader(long ptr,
                                     int cap)
Constructs a new header with pointer and capacity.

Parameters:
ptr - the pointer.
cap - the capacity.
Method Detail

readHeader

public static RecordAccessFile.RecordHeader readHeader(DataInput data)
                                                throws IOException
Reads the next record header.

Parameters:
data - the data input.
Returns:
the next record header.
Throws:
IOException - on errors.

getIndex

public int getIndex()
Gets the index.

Returns:
the index.

setIndex

public void setIndex(int ind)
Sets the index.

Parameters:
ind - the index.

getPointer

public long getPointer()
Gets the pointer.

Returns:
the pointer.

setPointer

public void setPointer(long ptr)
Sets the pointer.

Parameters:
ptr - the pointer.

getSize

public int getSize()
Gets the size.

Returns:
the size.

setSize

public void setSize(int s)
Sets the size.

Parameters:
s - the size.

getCapacity

public int getCapacity()
Gets the capacity.

Returns:
the capacity.

setCapacity

public void setCapacity(int cap)
Sets the capacity.

Parameters:
cap - the capacity.

getFreeSpace

public int getFreeSpace()
Gets the free space.

Returns:
the free space.

read

public void read(DataInput data)
          throws IOException
Reads the header data.

Parameters:
data - the data input.
Throws:
IOException - on errors.

write

public void write(DataOutput data)
           throws IOException
Writes the header data.

Parameters:
data - the data output.
Throws:
IOException - on errors.

split

public RecordAccessFile.RecordHeader split()
Splits the free space to a new record.

Returns:
the splited record header.


Copyright © 2004 The Norther Organization. All rights reserved.