|
What this is
Other links
The source code/* * Sun Public License Notice * * The contents of this file are subject to the Sun Public License * Version 1.0 (the "License"). You may not use this file except in * compliance with the License. A copy of the License is available at * http://www.sun.com/ * * The Original Code is NetBeans. The Initial Developer of the Original * Code is Sun Microsystems, Inc. Portions Copyright 1997-2001 Sun * Microsystems, Inc. All Rights Reserved. */ package org.netbeans.mdr.persistence.btreeimpl.btreeindex; import java.io.*; import org.netbeans.mdr.persistence.*; /** * Encapsulates the behavior of an entry of a given type. * * @author Dana Bergen * @version 1.0 */ public abstract class EntryTypeInfo extends Object { static final byte EQUAL = 0; static final byte GREATER = 1; static final byte LESS = -1; /** * Returns an IntInfo, MOFIDInfo, or StringInfo. * * @param type type to return Info object for * * @return a new IntInfo, MOFIDInfo, or StringInfo */ public static EntryTypeInfo getEntryTypeInfo( Storage.EntryType type, Storage storage) { if (type == Storage.EntryType.INT) { return new IntInfo(); } else if (type == Storage.EntryType.MOFID) { return new MOFIDInfo(storage); } else if (type == Storage.EntryType.STRING) { return new StringInfo(); } else { return null; } } /** * Store the value of the object in a byte array. * @param object * @return newly allocated byte array */ public abstract byte[] toBuffer(Object object); /** * Create an object from the contents of the byte array. * @param buffer * @return new object */ public abstract Object fromBuffer(byte[] buffer); /** * Like fromBuffer, except that if this type is a key, returns object * associated with the key * @param buffer * @return new object */ public Object objectFromBuffer(byte[] buffer, SinglevaluedIndex repos) { return fromBuffer(buffer); } /** * Compare two items of this type which are stored in byte arrays. * * @param key * @param key2 * @param offset offset into key2 of target key * @param length length in key2 of target key * * @return Returns one of: * |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.