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

java.lang.Object
  extended byorg.netbeans.mdr.persistence.btreeimpl.btreeindex.EntryTypeInfo
      extended byorg.netbeans.mdr.persistence.btreeimpl.btreeindex.StringInfo

public class StringInfo
extends EntryTypeInfo

EntryTypeInfo implementation for type String

Version:
1.0
Author:
Dana Bergen

Constructor Summary
StringInfo()
           
 
Method Summary
 byte compare(byte[] key1buffer, byte[] key2buffer, int offset, int length)
          Compare two items of this type which are stored in byte arrays.
 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;
 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, objectFromBuffer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringInfo

public StringInfo()
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

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
Parameters:
object -
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
Parameters:
buffer -
Returns:
new object

compare

public byte compare(byte[] key1buffer,
                    byte[] key2buffer,
                    int offset,
                    int length)
Description copied from class: EntryTypeInfo
Compare two items of this type which are stored in byte arrays.

Specified by:
compare in class EntryTypeInfo
Parameters:
key1buffer -
key2buffer -
offset - offset into key2 of target key
length - length in key2 of target key
Returns:
Returns one of:

EQUAL if the two keys are equal

GREATER if key greater than key2

LESS if key less than key2


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


Copyright © 2005 Apache Software Foundation. All Rights Reserved.