com.sleepycat.persist.impl
Class ReadOnlyCatalog

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

 class ReadOnlyCatalog
extends java.lang.Object
implements Catalog

Read-only catalog operations used when initializing new formats. This catalog is used temprarily when the main catalog has not been updated yet, but the new formats need to do catalog lookups.

Author:
Mark Hayes
See Also:
PersistCatalog.addNewFormat(java.lang.Class)

Constructor Summary
ReadOnlyCatalog(java.util.List<Format> formatList, java.util.Map<java.lang.String,Format> formatMap)
           
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReadOnlyCatalog

ReadOnlyCatalog(java.util.List<Format> formatList,
                java.util.Map<java.lang.String,Format> formatMap)
Method Detail

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.