Main Page | Class Hierarchy | Data Structures | Directories | File List | Data Fields | Related Pages

SerialSerialBinding.java

00001 /*-
00002  * See the file LICENSE for redistribution information.
00003  *
00004  * Copyright (c) 2000-2005
00005  *      Sleepycat Software.  All rights reserved.
00006  *
00007  * $Id: SerialSerialBinding.java,v 12.1 2005/01/31 19:27:29 mark Exp $
00008  */
00009 
00010 package com.sleepycat.bind.serial;
00011 
00012 import com.sleepycat.bind.EntityBinding;
00013 import com.sleepycat.db.DatabaseEntry;
00014 
00031 public abstract class SerialSerialBinding implements EntityBinding {
00032 
00033     private SerialBinding keyBinding;
00034     private SerialBinding dataBinding;
00035 
00046     public SerialSerialBinding(ClassCatalog classCatalog,
00047                                Class keyClass,
00048                                Class dataClass) {
00049 
00050         this(new SerialBinding(classCatalog, keyClass),
00051              new SerialBinding(classCatalog, dataClass));
00052     }
00053 
00061     public SerialSerialBinding(SerialBinding keyBinding,
00062                                SerialBinding dataBinding) {
00063 
00064         this.keyBinding = keyBinding;
00065         this.dataBinding = dataBinding;
00066     }
00067 
00068     // javadoc is inherited
00069     public Object entryToObject(DatabaseEntry key, DatabaseEntry data) {
00070 
00071         return entryToObject(keyBinding.entryToObject(key),
00072                              dataBinding.entryToObject(data));
00073     }
00074 
00075     // javadoc is inherited
00076     public void objectToKey(Object object, DatabaseEntry key) {
00077 
00078         object = objectToKey(object);
00079         keyBinding.objectToEntry(object, key);
00080     }
00081 
00082     // javadoc is inherited
00083     public void objectToData(Object object, DatabaseEntry data) {
00084 
00085         object = objectToData(object);
00086         dataBinding.objectToEntry(object, data);
00087     }
00088 
00098     public abstract Object entryToObject(Object keyInput, Object dataInput);
00099 
00107     public abstract Object objectToKey(Object object);
00108 
00116     public abstract Object objectToData(Object object);
00117 }

Generated on Sun Dec 25 12:14:30 2005 for Berkeley DB 4.4.16 by  doxygen 1.4.2