java.lang.Cloneable
, java.lang.Iterable<Result.Column>
, java.util.Iterator<Result.Column>
, Result
Result.OutColumn
, Result.RowColumn
public static interface Result.Column extends Result, java.lang.Iterable<Result.Column>, java.util.Iterator<Result.Column>, java.lang.Cloneable
clone
and slice
create new instances. All other methods return this
instance (modifying it if necessary) including forEach
,
next
, and iterator
.Result.Column, Result.OutColumn, Result.RowColumn, Result.RowCount
Modifier and Type | Method | Description |
---|---|---|
int |
absoluteIndex() |
Return the 1-based index of this
Result.Column relative to the original
sequence of values. |
Result.Column |
at(int index) |
Modify this
Result.Column to point to the value at index . |
Result.Column |
at(java.lang.String id) |
Modify this
Result.Column to point to a value identified by id. |
Result.Column |
clone() |
Return a new
Result.Column that is a duplicate of this Result.Column . |
default void |
forEach(java.util.function.Consumer<? super Result.Column> action) |
|
default <T> T |
get() |
Return the value of this
Result.Column as an instance of the default
Java type for this column. |
<T> T |
get(java.lang.Class<T> type) |
Return the value of this column as an instance of the given type.
|
default boolean |
hasNext() |
|
java.lang.String |
identifier() |
Return the identifier of this
Result.Column . |
int |
index() |
Return the 1-based index of this
Result.Column . |
default Result.Column |
iterator() |
|
<T> java.lang.Class<T> |
javaType() |
Return the Java type that best represents the value of this
Result.Column . |
long |
length() |
The length of the current value if defined.
|
default Result.Column |
next() |
Modify this
Result.Column to point to the next value in the sequence. |
default Result.Column |
next(int offset) |
Modify this
Result.Column to point to the value at the current index +
offset . |
int |
numberOfValuesRemaining() |
Return the number of remaining values accessible by this
Result.Column
excluding the current value. |
Result.Column |
slice(int numValues) |
Return a new
Result.Column that is a handle to a subsequence of the
sequence of values referenced by this Result.Column . |
default java.util.Spliterator<Result.Column> |
spliterator() |
TODO This almost certainly works correctly but it doesn't integrate well
with the other access patterns.
|
SqlType |
sqlType() |
Return the SQL type of the value of this
Result.Column . |
<T> T get(java.lang.Class<T> type)
T
- type
- Result.Column
default <T> T get()
Result.Column
as an instance of the default
Java type for this column.T
- Result.Column
java.lang.String identifier()
Result.Column
. May be null.Result.Column
. May be nullint index()
Result.Column
. The returned value is
relative to the slice if this Result.Column
is the result of a call to
slice()
.
col.slice(n).index() == 1
.Result.Column
int absoluteIndex()
Result.Column
relative to the original
sequence of values.
col.absoluteIndex() == col.slice(n).absoluteIndex()
.Result.Column
SqlType sqlType()
Result.Column
.<T> java.lang.Class<T> javaType()
Result.Column
.T
- Class
that best represents the value of this
Result.Column
long length()
java.lang.UnsupportedOperationException
- if the length of the current value
is undefinedint numberOfValuesRemaining()
Result.Column
excluding the current value. This is the number of times next()
can be called before hasNext()
returns false.Result.Column at(java.lang.String id)
Result.Column
to point to a value identified by id.id
- an identifier. Not nullResult.Column
java.util.NoSuchElementException
- if id does not identify exactly one valueid
represents the name of a
column or parameter marker for the underlying data source and is
implementation specific. This may be a simple SQL identifier, a quoted
identifier, or any other type of identifier supported by the data source.
Consult your implementation's documentation for additional information.
Result.Column at(int index)
Result.Column
to point to the value at index
. The
first value is at index 1. Negative numbers count back from the last
value. The last value is at index -1.index
- a new indexResult.Column
java.util.NoSuchElementException
- if index > length
or
index < -length
default Result.Column next(int offset)
Result.Column
to point to the value at the current index +
offset
. If offset
is 0 this is a noop. If offset
is negative the new index is less than the current index. If the new
index would be less than 1 or greater than length this Result.Column
is
not modified and IllegalArgumentException
is thrown.offset
- an increment to the current indexResult.Column
java.util.NoSuchElementException
- if the new index would be less than 1 or
greater than length
Result.Column slice(int numValues)
Result.Column
that is a handle to a subsequence of the
sequence of values referenced by this Result.Column
. The subsequence
consists of numValues
number of values. If numValues
is
positive the values are the value of this column and its successors. If
numValues
is negative the values are the predecessors of this
column not including this Result.Column
. The order of the values of the
new Result.Column
is the same as the order of the values of this
Result.Column
. The returned Result.Column
points to the first value of
the slice. This Result.Column
is not modified.numValues
- the number of columns to include in the sliceResult.Column
.java.util.NoSuchElementException
- if the current index plus
numValues
is greater than the number of values of this
Result.Column
or less than 1Result.Column clone()
Result.Column
that is a duplicate of this Result.Column
.
This Result.Column
is not modified.Result.Column
default Result.Column next()
Result.Column
to point to the next value in the sequence.next
in interface java.util.Iterator<Result.Column>
Result.Column
java.util.NoSuchElementException
- if the new index would be greater than
length
default boolean hasNext()
hasNext
in interface java.util.Iterator<Result.Column>
default void forEach(java.util.function.Consumer<? super Result.Column> action)
forEach
in interface java.lang.Iterable<Result.Column>
default Result.Column iterator()
iterator
in interface java.lang.Iterable<Result.Column>
default java.util.Spliterator<Result.Column> spliterator()
spliterator
in interface java.lang.Iterable<Result.Column>
Spliterator
Report a bug or suggest an enhancement
For further API reference and developer documentation see the Java SE Documentation, which contains more detailed, developer-targeted descriptions with conceptual overviews, definitions of terms, workarounds, and working code examples.
Java is a trademark or registered trademark of Oracle and/or its affiliates in the US and other countries.
Copyright © 1993, 2017, Oracle and/or its affiliates, 500 Oracle Parkway, Redwood Shores, CA 94065 USA.
All rights reserved. Use is subject to license terms and the documentation redistribution policy.
DRAFT JDBC 4.4 EA5