net.sourceforge.hatbox
Class AbstractNode

java.lang.Object
  extended by net.sourceforge.hatbox.AbstractNode
Direct Known Subclasses:
MetaNode, Node

public class AbstractNode
extends java.lang.Object

The core node structure

Author:
Peter Yuill

Field Summary
static int BOUNDS_MAX_X_OFFSET
           
static int BOUNDS_MAX_Y_OFFSET
           
static int BOUNDS_MIN_X_OFFSET
           
static int BOUNDS_MIN_Y_OFFSET
           
static int COUNT_OFFSET
           
protected  byte[] data
           
protected  boolean dirty
           
static int ENTRY_KEY_SIZE
           
static int ENTRY_LIST_OFFSET
           
static int ENTRY_ORDINATE_SIZE
           
protected  long id
           
static int LEVEL_OFFSET
           
static int MAX_OFFSET
           
static int PARENT_OFFSET
           
 
Constructor Summary
AbstractNode()
           
AbstractNode(long id, byte[] data)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 boolean getBoolean(int offset)
           
 int getByte(int offset)
           
 char getChar(int offset)
           
 byte[] getData()
           
 double getDouble(int offset)
           
 long getId()
           
 int getIndexNodeSize(int entriesMax)
           
 int getInt(int offset)
           
 long getLong(int offset)
           
 int getShort(int offset)
           
 int hashCode()
           
 boolean isDirty()
           
 void putBoolean(boolean val, int offset)
           
 void putByte(int val, int offset)
           
 void putChar(char val, int offset)
           
 void putDouble(double val, int offset)
           
 void putInt(int val, int offset)
           
 void putLong(long val, int offset)
           
 void putShort(int val, int offset)
           
 void setDirty(boolean dirty)
           
 void setId(long id)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PARENT_OFFSET

public static final int PARENT_OFFSET
See Also:
Constant Field Values

LEVEL_OFFSET

public static final int LEVEL_OFFSET
See Also:
Constant Field Values

COUNT_OFFSET

public static final int COUNT_OFFSET
See Also:
Constant Field Values

MAX_OFFSET

public static final int MAX_OFFSET
See Also:
Constant Field Values

BOUNDS_MIN_X_OFFSET

public static final int BOUNDS_MIN_X_OFFSET
See Also:
Constant Field Values

BOUNDS_MAX_X_OFFSET

public static final int BOUNDS_MAX_X_OFFSET
See Also:
Constant Field Values

BOUNDS_MIN_Y_OFFSET

public static final int BOUNDS_MIN_Y_OFFSET
See Also:
Constant Field Values

BOUNDS_MAX_Y_OFFSET

public static final int BOUNDS_MAX_Y_OFFSET
See Also:
Constant Field Values

ENTRY_LIST_OFFSET

public static final int ENTRY_LIST_OFFSET
See Also:
Constant Field Values

ENTRY_ORDINATE_SIZE

public static final int ENTRY_ORDINATE_SIZE
See Also:
Constant Field Values

ENTRY_KEY_SIZE

public static final int ENTRY_KEY_SIZE
See Also:
Constant Field Values

id

protected long id

data

protected byte[] data

dirty

protected boolean dirty
Constructor Detail

AbstractNode

public AbstractNode()

AbstractNode

public AbstractNode(long id,
                    byte[] data)
Method Detail

getIndexNodeSize

public int getIndexNodeSize(int entriesMax)

getByte

public final int getByte(int offset)

putByte

public final void putByte(int val,
                          int offset)

getBoolean

public final boolean getBoolean(int offset)

putBoolean

public final void putBoolean(boolean val,
                             int offset)

getChar

public final char getChar(int offset)

putChar

public final void putChar(char val,
                          int offset)

getShort

public final int getShort(int offset)

putShort

public final void putShort(int val,
                           int offset)

getInt

public final int getInt(int offset)

putInt

public final void putInt(int val,
                         int offset)

getLong

public final long getLong(int offset)

putLong

public final void putLong(long val,
                          int offset)

getDouble

public final double getDouble(int offset)

putDouble

public final void putDouble(double val,
                            int offset)

getId

public long getId()

setId

public void setId(long id)

getData

public byte[] getData()

isDirty

public boolean isDirty()

setDirty

public void setDirty(boolean dirty)

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Copyright © 2010. All Rights Reserved.