org.netbeans.mdr.persistence.btreeimpl.btreeindex
Class MOFIDInfo

java.lang.Object
  extended by org.netbeans.mdr.persistence.btreeimpl.btreeindex.EntryTypeInfo
      extended by org.netbeans.mdr.persistence.btreeimpl.btreeindex.MOFIDInfo

public class MOFIDInfo
extends EntryTypeInfo

EntryTypeInfo implementation for type MOFID

Version:
1.0
Author:
Dana Bergen

Method Summary
 byte compare(byte[] key, byte[] buffer, int offset, int targetLength)
          Compares two MOFIDs byte-by-byte.
 java.lang.Object fromBuffer(byte[] buffer)
          Create an object from the contents of the byte array.
 int getLength()
          Returns the length of an item of this type, or 0 if variable length.
 boolean isFixedLength()
          Returns true if this is a fixed length type, otherwise returns false;
 java.lang.Object objectFromBuffer(byte[] buffer, SinglevaluedIndex repos)
          Like fromBuffer, except that if this type is a key, returns object associated with the key
 byte[] toBuffer(java.lang.Object object)
          Store the value of the object in a byte array.
 java.lang.String typeName()
          Returns the name of this type as a String.
 
Methods inherited from class org.netbeans.mdr.persistence.btreeimpl.btreeindex.EntryTypeInfo
getEntryTypeInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

typeName

public java.lang.String typeName()
Description copied from class: EntryTypeInfo
Returns the name of this type as a String.

Specified by:
typeName in class EntryTypeInfo

compare

public byte compare(byte[] key,
                    byte[] buffer,
                    int offset,
                    int targetLength)
Compares two MOFIDs byte-by-byte.

Specified by:
compare in class EntryTypeInfo
Parameters:
key - byte array containing search key
buffer - buffer containing target key
offset - offset into buffer of target key
length - should always be MOFID.LENGTH
Returns:
Returns one of:

EQUAL if the two keys are equal

GREATER if search key is greater than target key

LESS if search key is less than target key


getLength

public int getLength()
Description copied from class: EntryTypeInfo
Returns the length of an item of this type, or 0 if variable length.

Specified by:
getLength in class EntryTypeInfo

isFixedLength

public boolean isFixedLength()
Description copied from class: EntryTypeInfo
Returns true if this is a fixed length type, otherwise returns false;

Specified by:
isFixedLength in class EntryTypeInfo

toBuffer

public byte[] toBuffer(java.lang.Object object)
Description copied from class: EntryTypeInfo
Store the value of the object in a byte array.

Specified by:
toBuffer in class EntryTypeInfo
Returns:
newly allocated byte array

fromBuffer

public java.lang.Object fromBuffer(byte[] buffer)
Description copied from class: EntryTypeInfo
Create an object from the contents of the byte array.

Specified by:
fromBuffer in class EntryTypeInfo
Returns:
new object

objectFromBuffer

public java.lang.Object objectFromBuffer(byte[] buffer,
                                         SinglevaluedIndex repos)
Description copied from class: EntryTypeInfo
Like fromBuffer, except that if this type is a key, returns object associated with the key

Overrides:
objectFromBuffer in class EntryTypeInfo
Returns:
new object


Copyright © 2005-2009 Apache Software Foundation. All Rights Reserved.