org.firebirdsql.gds.impl.argument

## Class SingleItem

- java.lang.Object
- - org.firebirdsql.gds.impl.argument.Argument
  - - org.firebirdsql.gds.impl.argument.SingleItem

All Implemented Interfaces:
  java.io.Serializable, Parameter

    public final class SingleItem
    extends Argument

`Argument` implementation for items without a value.

See Also:
  Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`SingleItem(int item)`

### Method Summary

Methods
`void` `copyTo(ParameterBuffer buffer, Encoding encoding)` Copies this argument into the supplied buffer, uses the supplied `Encoding` for string arguments.
`boolean` `equals(java.lang.Object other)`
`int` `getLength()`
`void` `writeTo(java.io.OutputStream outputStream)` Writes the arguments to the supplied `OutputStream` in the XDR format of the type.

### Methods inherited from class org.firebirdsql.gds.impl.argument.Argument

`getType, getValueAsInt, getValueAsLong, getValueAsString, hashCode`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### SingleItem

    public SingleItem(int item)

### Method Detail

#### writeTo

    public void writeTo(java.io.OutputStream outputStream)
                 throws java.io.IOException

Description copied from class: `Argument`
Writes the arguments to the supplied `OutputStream` in the XDR format of the type.

Specified by:
  `writeTo` in class `Argument`
Parameters:
  `outputStream` - OutputStream
Throws:
  `java.io.IOException` - For errors writing to the OutputStream

#### getLength

    public int getLength()

Specified by:
  `getLength` in class `Argument`
Returns:
  Total length of the buffer item when written to the OutputStream by `Argument.writeTo(java.io.OutputStream)`. This includes the item, the value and other items contributing to the total length (eg the length of the value).

#### equals

    public boolean equals(java.lang.Object other)

Overrides:
  `equals` in class `java.lang.Object`

#### copyTo

    public void copyTo(ParameterBuffer buffer,
              Encoding encoding)

Description copied from interface: `Parameter`
Copies this argument into the supplied buffer, uses the supplied `Encoding` for string arguments.

An instance of `Parameter` should know how to copy itself into another buffer (eg an instance of `StringArgument` would know to call `ParameterBuffer.addArgument(int, String, Encoding)`).

The parameter does not need to check if it is the right type of destination buffer (if someone tries to add a TPB argument to a DPB he is free to try that).

Parameters:
  `buffer` - ParameterBuffer instance
  `encoding` - Encoding to use for string properties. A value of `null` can be used to signal that the original encoding should be used.