1 19 package org.netbeans.mdr.persistence.btreeimpl.btreeindex; 20 21 import java.io.*; 22 import org.netbeans.mdr.persistence.*; 23 24 30 public abstract class EntryTypeInfo extends Object { 31 32 static final byte EQUAL = 0; 33 static final byte GREATER = 1; 34 static final byte LESS = -1; 35 36 43 public static EntryTypeInfo getEntryTypeInfo( 44 Storage.EntryType type, Storage storage) { 45 46 if (type == Storage.EntryType.INT) { 47 return new IntInfo(); 48 } else if (type == Storage.EntryType.MOFID) { 49 return new MOFIDInfo(storage); 50 } else if (type == Storage.EntryType.STRING) { 51 return new StringInfo(); 52 } else { 53 return null; 54 } 55 } 56 57 62 public abstract byte[] toBuffer(Object object); 63 68 public abstract Object fromBuffer(byte[] buffer); 69 75 public Object objectFromBuffer(byte[] buffer, SinglevaluedIndex repos) { 76 return fromBuffer(buffer); 77 } 78 79 92 public abstract byte compare(byte[] key, byte[] key2, int offset, int length); 93 96 public abstract int getLength(); 97 100 public abstract boolean isFixedLength(); 101 104 public abstract String typeName(); 105 106 } 107 | Popular Tags |