neustore.base
Class IntKey

java.lang.Object
  extended by neustore.base.IntKey
All Implemented Interfaces:
java.lang.Comparable<Key>, Key

public class IntKey
extends java.lang.Object
implements Key

An integer key.

Author:
Donghui Zhang <donghui@ccs.neu.edu>

Field Summary
 int key
           
 
Constructor Summary
IntKey(int _key)
           
 
Method Summary
 java.lang.Object clone()
          Creates a new copy of the object.
 int compareTo(Key key2)
           
 boolean equals(java.lang.Object key2)
           
 int maxSize()
          Returns the maximum number of bytes this type of object may occupy.
 void read(java.io.DataInputStream in)
          Reads the object from an input stream.
 int size()
           
 void write(java.io.DataOutputStream out)
          Writes the object to an output stream.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

key

public int key
Constructor Detail

IntKey

public IntKey(int _key)
Method Detail

clone

public java.lang.Object clone()
Description copied from interface: Key
Creates a new copy of the object.

Specified by:
clone in interface Key
Overrides:
clone in class java.lang.Object
Returns:
the new copy

size

public int size()
Specified by:
size in interface Key

maxSize

public int maxSize()
Description copied from interface: Key
Returns the maximum number of bytes this type of object may occupy. It is used to support variable-length key.

Specified by:
maxSize in interface Key
Returns:
maximum number of bytes

read

public void read(java.io.DataInputStream in)
          throws java.io.IOException
Description copied from interface: Key
Reads the object from an input stream.

Specified by:
read in interface Key
Parameters:
in - input stream
Throws:
java.io.IOException

write

public void write(java.io.DataOutputStream out)
           throws java.io.IOException
Description copied from interface: Key
Writes the object to an output stream.

Specified by:
write in interface Key
Parameters:
out - output stream
Throws:
java.io.IOException

compareTo

public int compareTo(Key key2)
Specified by:
compareTo in interface java.lang.Comparable<Key>

equals

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