- All Superinterfaces:
Collection<Attribute>
,Iterable<Attribute>
,List<Attribute>
,SequencedCollection<Attribute>
,TargetList
- All Known Subinterfaces:
TupleDescriptor
,TupleDescriptor.Ephemeral
,TupleDescriptor.Interned
- Enclosing interface:
TargetList
A
TargetList
in which no one attribute may appear more than once.
The prime example of a Projection
is a TupleDescriptor
as
obtained, for example, from the Portal
for a query result.
To preserve the "no attribute appears more than once" property, the only
new Projection
s derivable from an existing one involve selecting
a subset of its attributes, and possibly changing their order. The
project
methods taking attribute names, attribute indices, or the
attributes themselves can be used to do so, as can the subList
method.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.postgresql.pljava.TargetList
TargetList.Cursor, TargetList.Projection
-
Method Summary
Modifier and TypeMethodDescriptionproject
(int... indices) Returns aProjection
containing only the attributes found at the supplied indices in thisProjection
, and in the order of the argument list.default TargetList.Projection
project
(CharSequence... names) From thisProjection
, returns aProjection
containing only the attributes matching the supplied names and in the order of the argument list.Returns aProjection
containing only attributes and in the order of the argument list.project
(Lexicals.Identifier.Simple... names) From thisProjection
, returns aProjection
containing only the attributes matching the supplied names and in the order of the argument list.sqlProject
(int... indices) Likeproject(int...)
but using SQL's 1-based indexing convention.subList
(int fromIndex, int toIndex) Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
add, add, addAll, addAll, addFirst, addLast, clear, contains, containsAll, equals, get, getFirst, getLast, hashCode, indexOf, isEmpty, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, set, size, sort, spliterator, toArray, toArray
Methods inherited from interface org.postgresql.pljava.TargetList
applyOver, applyOver, sqlGet
-
Method Details
-
project
From thisProjection
, returns aProjection
containing only the attributes matching the supplied names and in the order of the argument list.- Throws:
IllegalArgumentException
- if more names are supplied than this Projection has attributes, or if any remain unmatched after matching each attribute in this Projection at most once.
-
project
From thisProjection
, returns aProjection
containing only the attributes matching the supplied names and in the order of the argument list.The names will be converted to
Identifier.Simple
by itsfromJava
method before comparison.- Throws:
IllegalArgumentException
- if more names are supplied than this Projection has attributes, or if any remain unmatched after matching each attribute in this Projection at most once.
-
project
Returns aProjection
containing only the attributes found at the supplied indices in thisProjection
, and in the order of the argument list.The index of the first attribute is zero.
- Throws:
IllegalArgumentException
- if more indices are supplied than this Projection has attributes, if any index is negative or beyond the last index in this Projection, or if any index appears more than once.
-
sqlProject
Likeproject(int...)
but using SQL's 1-based indexing convention.The index of the first attribute is 1.
- Throws:
IllegalArgumentException
- if more indices are supplied than this Projection has attributes, if any index is nonpositive or beyond the last 1-based index in this Projection, or if any index appears more than once.
-
project
Returns aProjection
containing only attributes and in the order of the argument list.The attributes must be found in this
Projection
by exact reference identity.- Throws:
IllegalArgumentException
- if more attributes are supplied than this Projection has, or if any remain unmatched after matching each attribute in this Projection at most once.
-
subList
- Specified by:
subList
in interfaceList<Attribute>
- Specified by:
subList
in interfaceTargetList
-