Top Description Fields Constructors Methods
org.postgresql.core

public Class Tuple

extends Object
Class Inheritance
Imports
org.checkerframework.checker.index.qual.NonNegative, org.checkerframework.checker.nullness.qual.Nullable, org.checkerframework.dataflow.qual.Pure

Class representing a row in a java.sql.ResultSet.

Field Summary

Modifier and TypeField and Description
pack-priv final @Nullable byte[][]
private final boolean

Constructor Summary

AccessConstructor and Description
public
Tuple(int
the number of fields in the tuple.
length
)

Construct an empty tuple.

public
Tuple(@Nullable byte[][]
the tuple data
data
)

Construct a populated tuple.

private
Tuple(@Nullable byte[][] data, boolean forUpdate)

Method Summary

Modifier and TypeMethod and Description
private Tuple
copy(boolean forUpdate)

public @NonNegative int

Returns:

number of fields
fieldCount
()

Number of fields in the tuple

public @Nullable byte[]

Returns:

byte array of the data
get
(@NonNegative int
0-based field position in the tuple
index
)

Get the data for the given field

public @NonNegative int

Returns:

the number of bytes in this tuple
length
()

Total length in bytes of the tuple data.

public Tuple

Returns:

a copy of the tuple that does not allow updates
readOnlyCopy
()

Create a read-only copy of the tuple

public void
set(@NonNegative int
0-based field position
index
,
@Nullable byte[]
the data to set
fieldData
)

Set the given field to the given data.

public Tuple

Returns:

a copy of the tuple that allows updates
updateableCopy
()

Create a copy of the tuple for updating.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

databack to summary
pack-priv final @Nullable byte[][] data
forUpdateback to summary
private final boolean forUpdate

Constructor Detail

Tupleback to summary
public Tuple(int length)

Construct an empty tuple. Used in updatable result sets.

Parameters
length:int

the number of fields in the tuple.

Tupleback to summary
public Tuple(@Nullable byte[][] data)

Construct a populated tuple. Used when returning results.

Parameters
data:@Nullable byte[][]

the tuple data

Tupleback to summary
private Tuple(@Nullable byte[][] data, boolean forUpdate)

Method Detail

copyback to summary
private Tuple copy(boolean forUpdate)
fieldCountback to summary
public @NonNegative int fieldCount()

Number of fields in the tuple

Returns:@NonNegative int

number of fields

getback to summary
public @Nullable byte[] get(@NonNegative int index)

Get the data for the given field

Parameters
index:@NonNegative int

0-based field position in the tuple

Returns:@Nullable byte[]

byte array of the data

Annotations
@Pure
lengthback to summary
public @NonNegative int length()

Total length in bytes of the tuple data.

Returns:@NonNegative int

the number of bytes in this tuple

readOnlyCopyback to summary
public Tuple readOnlyCopy()

Create a read-only copy of the tuple

Returns:Tuple

a copy of the tuple that does not allow updates

setback to summary
public void set(@NonNegative int index, @Nullable byte[] fieldData)

Set the given field to the given data.

Parameters
index:@NonNegative int

0-based field position

fieldData:@Nullable byte[]

the data to set

updateableCopyback to summary
public Tuple updateableCopy()

Create a copy of the tuple for updating.

Returns:Tuple

a copy of the tuple that allows updates