Class FormatableArrayHolder
java.lang.Object
org.apache.derby.iapi.services.io.FormatableArrayHolder
- All Implemented Interfaces:
Externalizable, Serializable, Formatable, TypedFormat
A formatable holder for an array of formatables.
Used to avoid serializing arrays.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNiladic constructor for formatableFormatableArrayHolder(Object[] array) Construct a FormatableArrayHolder using the input array. -
Method Summary
Modifier and TypeMethodDescription<E> E[]Get the held array of formatables, and return it in an array that is an instance ofarrayClass.intGet the formatID which corresponds to this class.voidRead this array from a stream of stored objects.voidSet the held array to the input array.voidWrite this array out
-
Field Details
-
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 Details
-
FormatableArrayHolder
public FormatableArrayHolder()Niladic constructor for formatable -
FormatableArrayHolder
Construct a FormatableArrayHolder using the input array.- Parameters:
array- the array to hold
-
-
Method Details
-
setArray
Set the held array to the input array.- Parameters:
array- the array to hold
-
getArray
Get the held array of formatables, and return it in an array that is an instance ofarrayClass.- Parameters:
arrayClass- the type of array to return- Returns:
- an array of formatables
-
writeExternal
Write this array out- Specified by:
writeExternalin interfaceExternalizable- Parameters:
out- write bytes here- Throws:
IOException- thrown on error
-
readExternal
Read this array from a stream of stored objects.- Specified by:
readExternalin interfaceExternalizable- Parameters:
in- read this.- Throws:
IOException- thrown on errorClassNotFoundException- thrown on error
-
getTypeFormatId
public int getTypeFormatId()Get the formatID which corresponds to this class.- Specified by:
getTypeFormatIdin interfaceTypedFormat- Returns:
- the formatID of this class
-