Top Description Fields Constructors Methods
org.apache.derby.iapi.services.io

public Class FormatableArrayHolder

extends Object
implements Formatable
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.services.io.Formatable, org.apache.derby.iapi.services.io.TypedFormat, java.io.Externalizable, java.io.Serializable
Imports
org.apache.derby.shared.common.sanity.SanityManager, java.io.ObjectOutput, .ObjectInput, .IOException, java.util.Arrays, org.apache.derby.shared.common.util.ArrayUtil

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

Field Summary

Modifier and TypeField and Description
private Object[]
array

This class implements Formatable.

Constructor Summary

AccessConstructor and Description
public
FormatableArrayHolder()

Niladic constructor for formatable

public
FormatableArrayHolder(Object[]
the array to hold
array
)

Construct a FormatableArrayHolder using the input array.

Method Summary

Modifier and TypeMethod and Description
public <
The type of the array cell
E
>
E[]

Returns:

an array of formatables
getArray
(Class<E[]>
the type of array to return
arrayClass
)

Get the held array of formatables, and return it in an array that is an instance of arrayClass.

public int

Returns:

the formatID of this class
getTypeFormatId
()

Implements org.apache.derby.iapi.services.io.TypedFormat.getTypeFormatId.

Get the formatID which corresponds to this class.

public void
readExternal(ObjectInput
read this.
in
)

Implements java.io.Externalizable.readExternal.

Read this array from a stream of stored objects.

public void
setArray(Object[]
the array to hold
array
)

Set the held array to the input array.

public void
writeExternal(ObjectOutput
write bytes here
out
)

Implements java.io.Externalizable.writeExternal.

Write this array out

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

arrayback to summary
private 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

FormatableArrayHolderback to summary
public FormatableArrayHolder()

Niladic constructor for formatable

FormatableArrayHolderback to summary
public FormatableArrayHolder(Object[] array)

Construct a FormatableArrayHolder using the input array.

Parameters
array:Object[]

the array to hold

Method Detail

getArrayback to summary
public <E> E[] getArray(Class<E[]> arrayClass)

Get the held array of formatables, and return it in an array that is an instance of arrayClass.

Parameters
<E>
The type of the array cell
arrayClass:Class<E[]>

the type of array to return

Returns:E[]

an array of formatables

getTypeFormatIdback to summary
public int getTypeFormatId()

Implements org.apache.derby.iapi.services.io.TypedFormat.getTypeFormatId.

Get the formatID which corresponds to this class.

Returns:int

the formatID of this class

readExternalback to summary
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException

Implements java.io.Externalizable.readExternal.

Read this array from a stream of stored objects.

Parameters
in:ObjectInput

read this.

Exceptions
IOException:
thrown on error
ClassNotFoundException:
thrown on error
setArrayback to summary
public void setArray(Object[] array)

Set the held array to the input array.

Parameters
array:Object[]

the array to hold

writeExternalback to summary
public void writeExternal(ObjectOutput out) throws IOException

Implements java.io.Externalizable.writeExternal.

Write this array out

Parameters
out:ObjectOutput

write bytes here

Exceptions
IOException:
thrown on error