com.sleepycat.persist.impl
Class EntityInput

java.lang.Object
  extended by java.io.InputStream
      extended by com.sleepycat.util.FastInputStream
          extended by com.sleepycat.bind.tuple.TupleInput
              extended by com.sleepycat.persist.impl.EntityInput
All Implemented Interfaces:
Closeable

public class EntityInput
extends TupleInput

Used for reading object fields.

Although this class extends TupleInput, not all TupleInput methods should be called. See Format for which methods should be called. In particular, Strings should be passed to readObject() in this class.

Author:
Mark Hayes

Field Summary
(package private)  boolean rawAccess
           
 
Fields inherited from class com.sleepycat.util.FastInputStream
buf, len, mark, off
 
Constructor Summary
EntityInput(Catalog catalog, boolean rawAccess, DatabaseEntry priKeyEntry, int priKeyFormatId, byte[] buffer, int offset, int length)
          Creates a new input with a empty/null VisitedObjects set.
 
Method Summary
(package private)  Catalog getCatalog()
          Get the catalog for this input.
(package private)  KeyLocation getKeyLocation(Format fieldFormat)
          Called when copying secondary keys, for an input that is positioned on the secondary key field.
 Object readKeyObject(Format format)
          Called for a primary key field or a composite key field with a reference type.
 Object readObject()
          Called via Accessor to read all fields with reference types, except for the primary key field and composite key fields (see readKeyObject below).
 void registerPriKeyObject(Object o)
          Called via Accessor.readSecKeyFields for a primary key field with a reference type.
(package private)  void skipField(Format declaredFormat)
          Called via PersistKeyCreator to skip fields prior to the secondary key field.
 
Methods inherited from class com.sleepycat.bind.tuple.TupleInput
getPackedIntByteLength, getStringByteLength, readBoolean, readByte, readBytes, readBytes, readChar, readChars, readChars, readDouble, readFloat, readInt, readLong, readPackedInt, readShort, readSortedDouble, readSortedFloat, readString, readString, readString, readUnsignedByte, readUnsignedInt, readUnsignedShort
 
Methods inherited from class com.sleepycat.util.FastInputStream
available, getBufferBytes, getBufferLength, getBufferOffset, mark, markSupported, read, read, read, readFast, readFast, readFast, reset, skip, skipFast
 
Methods inherited from class java.io.InputStream
close
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rawAccess

boolean rawAccess
Constructor Detail

EntityInput

EntityInput(Catalog catalog,
            boolean rawAccess,
            DatabaseEntry priKeyEntry,
            int priKeyFormatId,
            byte[] buffer,
            int offset,
            int length)
Creates a new input with a empty/null VisitedObjects set.

Method Detail

getCatalog

Catalog getCatalog()
Get the catalog for this input.


readObject

public Object readObject()
Called via Accessor to read all fields with reference types, except for the primary key field and composite key fields (see readKeyObject below).


readKeyObject

public Object readKeyObject(Format format)
Called for a primary key field or a composite key field with a reference type.

For such key fields, no formatId is present nor can the object already be present in the visited object set.


getKeyLocation

KeyLocation getKeyLocation(Format fieldFormat)
Called when copying secondary keys, for an input that is positioned on the secondary key field. Handles references to previously occurring objects, returning a different EntityInput than this one if appropriate.


registerPriKeyObject

public void registerPriKeyObject(Object o)
Called via Accessor.readSecKeyFields for a primary key field with a reference type. This method must be called before reading any other fields.


skipField

void skipField(Format declaredFormat)
Called via PersistKeyCreator to skip fields prior to the secondary key field.



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