Berkeley DB
version 4.3.29

com.sleepycat.collections
Class TupleSerialFactory

java.lang.Object
  extended bycom.sleepycat.collections.TupleSerialFactory

public class TupleSerialFactory
extends Object

Creates stored collections having tuple keys and serialized entity values. The entity classes must implement the java.io.Serializable and MarshalledTupleKeyEntity interfaces. The key classes must either implement the MarshalledTupleEntry interface or be one of the Java primitive type classes. Underlying binding objects are created automatically.


Constructor Summary
TupleSerialFactory(ClassCatalog catalog)
          Creates a tuple-serial factory for given environment and class catalog.
 
Method Summary
 ClassCatalog getCatalog()
          Returns the class catalog associated with this factory.
 TupleSerialMarshalledKeyCreator getKeyCreator(Class valueBaseClass, String keyName)
          Creates a SecondaryKeyCreator object for use in configuring a SecondaryDatabase.
 StoredMap newMap(Database db, Class keyClass, Class valueBaseClass, boolean writeAllowed)
          Creates a map from a previously opened Database object.
 StoredSortedMap newSortedMap(Database db, Class keyClass, Class valueBaseClass, boolean writeAllowed)
          Creates a sorted map from a previously opened Database object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TupleSerialFactory

public TupleSerialFactory(ClassCatalog catalog)
Creates a tuple-serial factory for given environment and class catalog.

Method Detail

getCatalog

public final ClassCatalog getCatalog()
Returns the class catalog associated with this factory.


newMap

public StoredMap newMap(Database db,
                        Class keyClass,
                        Class valueBaseClass,
                        boolean writeAllowed)
Creates a map from a previously opened Database object.

Parameters:
db - the previously opened Database object.
keyClass - is the class used for map keys. It must implement the MarshalledTupleEntry interface or be one of the Java primitive type classes.
valueBaseClass - the base class of the entity values for this store. It must implement the MarshalledTupleKeyEntity interface.
writeAllowed - is true to create a read-write collection or false to create a read-only collection.

newSortedMap

public StoredSortedMap newSortedMap(Database db,
                                    Class keyClass,
                                    Class valueBaseClass,
                                    boolean writeAllowed)
Creates a sorted map from a previously opened Database object.

Parameters:
db - the previously opened Database object.
keyClass - is the class used for map keys. It must implement the MarshalledTupleEntry interface or be one of the Java primitive type classes.
valueBaseClass - the base class of the entity values for this store. It must implement the MarshalledTupleKeyEntity interface.
writeAllowed - is true to create a read-write collection or false to create a read-only collection.

getKeyCreator

public TupleSerialMarshalledKeyCreator getKeyCreator(Class valueBaseClass,
                                                     String keyName)
Creates a SecondaryKeyCreator object for use in configuring a SecondaryDatabase. The returned object implements the SecondaryKeyCreator interface.

Parameters:
valueBaseClass - the base class of the entity values for this store. It must implement the MarshalledTupleKeyEntity interface.
keyName - is the key name passed to the MarshalledTupleKeyEntity.marshalSecondaryKey(java.lang.String, com.sleepycat.bind.tuple.TupleOutput) method to identify the secondary key.

Berkeley DB
version 4.3.29

Copyright (c) 1996-2004 Sleepycat Software, Inc. - All rights reserved.