com.sleepycat.persist.impl
Class SimpleCatalog

java.lang.Object
  extended by com.sleepycat.persist.impl.SimpleCatalog
All Implemented Interfaces:
Catalog

public class SimpleCatalog
extends java.lang.Object
implements Catalog

A static catalog containing simple types only. Once created, this catalog is immutable. For bindings accessed by a PersistComparator during recovery, the SimpleCatalog provides formats for all simple types. To reduce redundant format objects, the SimpleCatalog's formats are copied when creating a regular PersistCatalog. This class also contains utility methods for dealing with primitives.

Author:
Mark Hayes

Method Summary
static java.lang.Class classForName(java.lang.String className)
           
(package private) static java.util.List<Format> copyFormatList()
           
 Format createFormat(java.lang.Class type, java.util.Map<java.lang.String,Format> newFormats)
           
 Format getFormat(java.lang.Class cls)
          Returns a format for a given class, or throws an exception.
 Format getFormat(int formatId)
          Returns a format for a given ID, or throws an exception.
 Format getFormat(java.lang.String className)
          Returns a format by class name.
(package private) static SimpleCatalog getInstance()
           
(package private) static SimpleFormat getSimpleFormat(java.lang.Class type)
           
(package private) static boolean isSimpleType(java.lang.Class type)
           
static java.lang.Class keyClassForName(java.lang.String className)
           
static java.lang.String keyClassName(java.lang.String className)
           
(package private) static java.lang.Class primitiveToWrapper(java.lang.Class type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

static SimpleCatalog getInstance()

isSimpleType

static boolean isSimpleType(java.lang.Class type)

primitiveToWrapper

static java.lang.Class primitiveToWrapper(java.lang.Class type)

keyClassForName

public static java.lang.Class keyClassForName(java.lang.String className)

keyClassName

public static java.lang.String keyClassName(java.lang.String className)

classForName

public static java.lang.Class classForName(java.lang.String className)
                                    throws java.lang.ClassNotFoundException
Throws:
java.lang.ClassNotFoundException

getSimpleFormat

static SimpleFormat getSimpleFormat(java.lang.Class type)

copyFormatList

static java.util.List<Format> copyFormatList()

getFormat

public Format getFormat(int formatId)
Description copied from interface: Catalog
Returns a format for a given ID, or throws an exception. This method is used when reading an object from the byte array format.

Specified by:
getFormat in interface Catalog

getFormat

public Format getFormat(java.lang.Class cls)
Description copied from interface: Catalog
Returns a format for a given class, or throws an exception. This method is used when writing an object that was passed in by the user.

Specified by:
getFormat in interface Catalog

getFormat

public Format getFormat(java.lang.String className)
Description copied from interface: Catalog
Returns a format by class name. Unlike Catalog.getFormat(int), the format will not be created if it is not already known.

Specified by:
getFormat in interface Catalog

createFormat

public Format createFormat(java.lang.Class type,
                           java.util.Map<java.lang.String,Format> newFormats)
Specified by:
createFormat in interface Catalog
See Also:
PersistCatalog.createFormat(java.lang.Class, java.util.Map)


Copyright 2004-2006 Sleepycat, Inc. All Rights Reserved.