org.apache.derby.iapi.services.io
Class FormatableArrayHolder

java.lang.Object
  extended by org.apache.derby.iapi.services.io.FormatableArrayHolder
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable, Formatable, TypedFormat

public class FormatableArrayHolder
extends java.lang.Object
implements Formatable

A formatable holder for an array of formatables. Used to avoid serializing arrays.

See Also:
Serialized Form

Field Summary
private  java.lang.Object[] array
          This class implements Formatable.
 
Constructor Summary
FormatableArrayHolder()
          Niladic constructor for formatable
FormatableArrayHolder(java.lang.Object[] array)
          Construct a FormatableArrayHolder using the input array.
 
Method Summary
 java.lang.Object[] getArray(java.lang.Class inputClass)
          Get the held array of formatables, and return it in an array of type inputClass.
 int getTypeFormatId()
          Get the formatID which corresponds to this class.
 void readExternal(ArrayInputStream in)
           
 void readExternal(java.io.ObjectInput in)
          Read this array from a stream of stored objects.
 void setArray(java.lang.Object[] array)
          Set the held array to the input array.
 void writeExternal(java.io.ObjectOutput out)
          Write this array out
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

array

private java.lang.Object[] array
This class implements Formatable. That means that it can write itself to and from a formatted stream. If you add more fields to this class, make sure that you also write/read them with the writeExternal()/readExternal() methods. If, inbetween releases, you add more fields to this class, then you should bump the version number emitted by the getTypeFormatId() method.

Constructor Detail

FormatableArrayHolder

public FormatableArrayHolder()
Niladic constructor for formatable


FormatableArrayHolder

public FormatableArrayHolder(java.lang.Object[] array)
Construct a FormatableArrayHolder using the input array.

Parameters:
array - the array to hold
Method Detail

setArray

public void setArray(java.lang.Object[] array)
Set the held array to the input array.

Parameters:
array - the array to hold

getArray

public java.lang.Object[] getArray(java.lang.Class inputClass)
Get the held array of formatables, and return it in an array of type inputClass.

Parameters:
inputClass - the class to use for the returned array
Returns:
an array of formatables

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Write this array out

Specified by:
writeExternal in interface java.io.Externalizable
Parameters:
out - write bytes here
Throws:
java.io.IOException - thrown on error

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Read this array from a stream of stored objects.

Specified by:
readExternal in interface java.io.Externalizable
Parameters:
in - read this.
Throws:
java.io.IOException - thrown on error
java.lang.ClassNotFoundException - thrown on error

readExternal

public void readExternal(ArrayInputStream in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
Throws:
java.io.IOException
java.lang.ClassNotFoundException

getTypeFormatId

public int getTypeFormatId()
Get the formatID which corresponds to this class.

Specified by:
getTypeFormatId in interface TypedFormat
Returns:
the formatID of this class

Built on Thu 2012-03-29 21:53:33+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.