Class FormatableIntHolder
java.lang.Object
org.apache.derby.iapi.services.io.FormatableIntHolder
- All Implemented Interfaces:
Externalizable
,Serializable
,Formatable
,TypedFormat
A formatable holder for an int.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNiladic constructor for formatableFormatableIntHolder
(int theInt) Construct a FormatableIntHolder using the input int. -
Method Summary
Modifier and TypeMethodDescriptionstatic FormatableIntHolder[]
getFormatableIntHolders
(int[] theInts) Create and return an array of FormatableIntHolders given an array of ints.int
getInt()
Get the held int.int
Get the formatID which corresponds to this class.void
Read this formatable from a stream of stored objects.void
setInt
(int theInt) Set the held int to the input int.void
Write this formatable out
-
Field Details
-
theInt
private int theIntThis 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
-
FormatableIntHolder
public FormatableIntHolder()Niladic constructor for formatable -
FormatableIntHolder
public FormatableIntHolder(int theInt) Construct a FormatableIntHolder using the input int.- Parameters:
theInt
- the int to hold
-
-
Method Details
-
setInt
public void setInt(int theInt) Set the held int to the input int.- Parameters:
theInt
- the int to hold
-
getInt
public int getInt()Get the held int.- Returns:
- The held int.
-
getFormatableIntHolders
Create and return an array of FormatableIntHolders given an array of ints.- Parameters:
theInts
- The array of ints- Returns:
- An array of FormatableIntHolders
-
writeExternal
Write this formatable out- Specified by:
writeExternal
in interfaceExternalizable
- Parameters:
out
- write bytes here- Throws:
IOException
- thrown on error
-
readExternal
Read this formatable from a stream of stored objects.- Specified by:
readExternal
in interfaceExternalizable
- Parameters:
in
- read this.- Throws:
IOException
- thrown on error
-
getTypeFormatId
public int getTypeFormatId()Get the formatID which corresponds to this class.- Specified by:
getTypeFormatId
in interfaceTypedFormat
- Returns:
- the formatID of this class
-