Class PositionalIndex
java.lang.Object
com.apple.foundationdb.relational.util.PositionalIndex
The field positional offset/index is zero-based in protobuf but one-based in JDBC. Below is small utility
for going between the different indexing modes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
toJDBC
(int zeroBasedProtobufIndex) Adjust 'zeroBasedIndex' so can be used as a one-based JDBC index.static int
toProtobuf
(int oneBasedIndex) Adjust 'oneBasedIndex' so can be used as a zero-based protobuf index.
-
Constructor Details
-
PositionalIndex
public PositionalIndex()
-
-
Method Details
-
toProtobuf
public static int toProtobuf(int oneBasedIndex) Adjust 'oneBasedIndex' so can be used as a zero-based protobuf index.- Parameters:
oneBasedIndex
- JDBC indices are oneBased; i.e. first item is at postion 1.- Returns:
- Protobuf index derived from
oneBasedIndex
.
-
toJDBC
public static int toJDBC(int zeroBasedProtobufIndex) Adjust 'zeroBasedIndex' so can be used as a one-based JDBC index.- Parameters:
zeroBasedProtobufIndex
- Protobuf zero-based index.- Returns:
- An index that can be used on JDBC types.
-