org.apache.jdo.impl.fostore
Class ObjectTranscriber.ArrayTranscriber

java.lang.Object
  extended byorg.apache.jdo.impl.fostore.ObjectTranscriber.AbstractTranscriber
      extended byorg.apache.jdo.impl.fostore.ObjectTranscriber.ArrayTranscriber
All Implemented Interfaces:
Transcriber
Direct Known Subclasses:
ObjectTranscriber.BooleanArrayTranscriber, ObjectTranscriber.ByteArrayTranscriber, ObjectTranscriber.CharArrayTranscriber, ObjectTranscriber.DoubleArrayTranscriber, ObjectTranscriber.FloatArrayTranscriber, ObjectTranscriber.IntArrayTranscriber, ObjectTranscriber.LongArrayTranscriber, ObjectTranscriber.ObjArrayTranscriber, ObjectTranscriber.ShortArrayTranscriber, ObjectTranscriber.StringArrayTranscriber
Enclosing class:
ObjectTranscriber

abstract class ObjectTranscriber.ArrayTranscriber
extends ObjectTranscriber.AbstractTranscriber

Abstract class which provides support for transcribing arrays of any type. For each type of array, there should be a subclass.

See Also:
ObjectTranscriber.IntArrayTranscriber

Field Summary
private  int fieldNum
           
private  java.lang.Object owner
           
 
Constructor Summary
(package private) ObjectTranscriber.ArrayTranscriber()
           
 
Method Summary
(package private)  java.lang.Object fetch(java.io.DataInput in, java.lang.Object owner, int fieldNum)
          Fetches the entire array by delegating to fetchElements.
(package private) abstract  java.lang.Object fetchElements(java.io.DataInput in, int length)
          Creates an array of some type and returns it, after reading in all the array's element's values.
protected  int getFieldNum()
           
protected  java.lang.Object getOwner()
           
(package private)  void skip(java.io.DataInput in)
          Skips the entire array by delegating to skipElements.
(package private) abstract  void skipElements(java.io.DataInput in, int length)
          Skips an array of some type after skipping all the array's element's values.
(package private)  void store(java.lang.Object value, FOStoreOutput out)
          Stores the entire array by delegating the storing of each element to the storeElement method, which is implemented by a subclass.
(package private) abstract  void storeElement(java.lang.Object value, FOStoreOutput out, int index)
          Stores a single element of an array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

owner

private java.lang.Object owner

fieldNum

private int fieldNum
Constructor Detail

ObjectTranscriber.ArrayTranscriber

ObjectTranscriber.ArrayTranscriber()
Method Detail

getOwner

protected java.lang.Object getOwner()

getFieldNum

protected int getFieldNum()

store

final void store(java.lang.Object value,
                 FOStoreOutput out)
          throws java.io.IOException
Stores the entire array by delegating the storing of each element to the storeElement method, which is implemented by a subclass.

Specified by:
store in class ObjectTranscriber.AbstractTranscriber
Throws:
java.io.IOException

storeElement

abstract void storeElement(java.lang.Object value,
                           FOStoreOutput out,
                           int index)
                    throws java.io.IOException,
                           java.lang.IllegalArgumentException,
                           java.lang.ArrayIndexOutOfBoundsException
Stores a single element of an array.

Parameters:
value - An array of some type. The type of the array is conditional on the class which is implementing this method.
out - Where the value should be stored
index - Index into the value which should be stored.
Throws:
java.io.IOException
java.lang.IllegalArgumentException
java.lang.ArrayIndexOutOfBoundsException

fetch

final java.lang.Object fetch(java.io.DataInput in,
                             java.lang.Object owner,
                             int fieldNum)
                      throws java.lang.Exception
Fetches the entire array by delegating to fetchElements.

Specified by:
fetch in class ObjectTranscriber.AbstractTranscriber
Throws:
java.lang.Exception

skip

final void skip(java.io.DataInput in)
         throws java.io.IOException
Skips the entire array by delegating to skipElements.

Specified by:
skip in class ObjectTranscriber.AbstractTranscriber
Throws:
java.io.IOException

fetchElements

abstract java.lang.Object fetchElements(java.io.DataInput in,
                                        int length)
                                 throws java.lang.Exception,
                                        java.lang.IllegalArgumentException,
                                        java.lang.ArrayIndexOutOfBoundsException
Creates an array of some type and returns it, after reading in all the array's element's values. The type of the array that should be created is conditional on the class which is implementing this method.

Parameters:
in - Place from where the array's values should be read
length - Length of the array to create.
Throws:
java.lang.Exception
java.lang.IllegalArgumentException
java.lang.ArrayIndexOutOfBoundsException

skipElements

abstract void skipElements(java.io.DataInput in,
                           int length)
                    throws java.io.IOException
Skips an array of some type after skipping all the array's element's values.

Parameters:
in - Place from where the array's values should be read
length - Length of the array.
Throws:
java.io.IOException