public abstract class ParameterBufferBase extends java.lang.Object implements ParameterBuffer, java.io.Serializable
Modifier | Constructor and Description |
---|---|
protected |
ParameterBufferBase(ParameterBufferMetaData parameterBufferMetaData)
Creates a
ParameterBufferBase . |
protected |
ParameterBufferBase(ParameterBufferMetaData parameterBufferMetaData,
Encoding defaultEncoding)
Creates a
ParameterBufferBase . |
Modifier and Type | Method and Description |
---|---|
void |
addArgument(int argumentType)
Add argument with no parameters.
|
void |
addArgument(int type,
byte[] content)
Add array of bytes.
|
void |
addArgument(int argumentType,
int value)
Add integer argument.
|
void |
addArgument(int argumentType,
long value)
Add long argument.
|
void |
addArgument(int argumentType,
java.lang.String value)
Add string argument with the default encoding.
|
void |
addArgument(int argumentType,
java.lang.String value,
Encoding encoding)
Add string argument.
|
boolean |
equals(java.lang.Object other) |
int |
getArgumentAsInt(int type)
Get argument as int.
|
java.lang.String |
getArgumentAsString(int type)
Get argument as string.
|
protected java.util.List<Argument> |
getArgumentsList() |
Encoding |
getDefaultEncoding() |
protected int |
getLength() |
ParameterBufferMetaData |
getParameterBufferMetaData() |
int |
getType() |
boolean |
hasArgument(int type)
Check if this parameter buffer has specified argument.
|
int |
hashCode() |
java.util.Iterator<Parameter> |
iterator()
Returns an iterator over a copy of the parameters in this parameter buffer.
|
void |
removeArgument(int type)
Remove specified argument.
|
int |
size() |
byte[] |
toBytes()
Converts this parameter buffer to a byte array.
|
byte[] |
toBytesWithType()
Converts this parameter buffer to a byte array with type information.
|
Xdrable |
toXdrable() |
void |
writeArgumentsTo(java.io.OutputStream outputStream)
Writes the arguments in the implementation specific serialization into the
OutputStream . |
protected ParameterBufferBase(ParameterBufferMetaData parameterBufferMetaData)
ParameterBufferBase
.
This uses a default encoding derived from the system default encoding. You usually want to
use ParameterBufferBase(ParameterBufferMetaData, Encoding)
instead.
parameterBufferMetaData
- Metadata for the parameter buffer.protected ParameterBufferBase(ParameterBufferMetaData parameterBufferMetaData, Encoding defaultEncoding)
ParameterBufferBase
.parameterBufferMetaData
- Metadata for the parameter buffer.defaultEncoding
- Default encoding to use for string argumentspublic final Encoding getDefaultEncoding()
public final ParameterBufferMetaData getParameterBufferMetaData()
public final int getType()
getType
in interface ParameterBuffer
public final void addArgument(int argumentType, java.lang.String value)
ParameterBuffer
addArgument
in interface ParameterBuffer
argumentType
- type of argument.value
- string value to add.public final void addArgument(int argumentType, java.lang.String value, Encoding encoding)
ParameterBuffer
addArgument
in interface ParameterBuffer
argumentType
- type of argument.value
- string value to add.encoding
- encoding to use for conversion to bytespublic final void addArgument(int argumentType, int value)
ParameterBuffer
addArgument
in interface ParameterBuffer
argumentType
- type of argument.value
- integer value to add.public final void addArgument(int argumentType, long value)
ParameterBuffer
addArgument
in interface ParameterBuffer
argumentType
- type of argument.value
- long value to add.public final void addArgument(int argumentType)
ParameterBuffer
addArgument
in interface ParameterBuffer
argumentType
- type of argument.public final void addArgument(int type, byte[] content)
ParameterBuffer
addArgument
in interface ParameterBuffer
type
- type of argument.content
- content of argument.public final java.lang.String getArgumentAsString(int type)
ParameterBuffer
getArgumentAsString
in interface ParameterBuffer
type
- type of argument to find.null
if nothing found.public final int getArgumentAsInt(int type)
ParameterBuffer
getArgumentAsInt
in interface ParameterBuffer
type
- type of argument to find.0
if nothing found.public final boolean hasArgument(int type)
ParameterBuffer
hasArgument
in interface ParameterBuffer
type
- type of argument to find.true
if this buffer contains specified argument.public final void removeArgument(int type)
ParameterBuffer
removeArgument
in interface ParameterBuffer
type
- type of argument to remove.public final java.util.Iterator<Parameter> iterator()
ParameterBuffer
It is safe to iterate over this iterator while modifying the parameter buffer. Changes will not be reflected in the iterator.
iterator
in interface java.lang.Iterable<Parameter>
iterator
in interface ParameterBuffer
public final void writeArgumentsTo(java.io.OutputStream outputStream) throws java.io.IOException
ParameterBuffer
OutputStream
.writeArgumentsTo
in interface ParameterBuffer
outputStream
- The OutputStream
to write tojava.io.IOException
- Errors produced by the output stream during writespublic final Xdrable toXdrable()
toXdrable
in interface ParameterBuffer
Xdrable
to write (and optionally read) this instance as Xdr.protected final int getLength()
protected final java.util.List<Argument> getArgumentsList()
public final byte[] toBytes()
ParameterBuffer
This byte array includes the extra header-bytes (if any), but does not include the type information
toBytes
in interface ParameterBuffer
ParameterBuffer.toBytesWithType()
public final byte[] toBytesWithType()
ParameterBuffer
This byte array includes the type information and the extra header bytes (if any).
toBytesWithType
in interface ParameterBuffer
ParameterBuffer.toBytes()
public final int size()
size
in interface ParameterBuffer
public final boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public final int hashCode()
hashCode
in class java.lang.Object
Copyright © 2001-2021 Jaybird (Firebird JDBC/JCA) team. All rights reserved.