Package org.apache.openjpa.jdbc.sql
Class SelectImpl.Selects
java.lang.Object
java.util.AbstractCollection<E>
java.util.AbstractList
org.apache.openjpa.jdbc.sql.SelectImpl.Selects
- All Implemented Interfaces:
Iterable
,Collection
,List
- Enclosing class:
- SelectImpl
Helper class to track selected columns, with fast contains method.
Acts as a list of select ids, with additional methods to manipulate
the alias of each selected id.
-
Field Summary
Modifier and TypeFieldDescriptionprotected Map
protected DBDictionary
protected List
protected List
protected Map
Fields inherited from class java.util.AbstractList
modCount
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAll
(SelectImpl.Selects sels) Add all aliases from another instance.void
clear()
void
Clear all placeholders and select AS clauses.boolean
get
(int i) Returns the alias of a given id.getAliases
(boolean ident, boolean inner) A list representation of the aliases, in select order, with AS aliases present.int
indexOfAlias
(Object alias) Return the index of the given alias.void
insertAlias
(int idx, Object id, Object alias) Insert an alias before the given index, using negative indexes to count backwards.void
Set an alias for a given index.int
Set an alias for a given id.void
setSelectAs
(Object id, String as) Set that a given id's alias has an AS value.int
size()
Methods inherited from class java.util.AbstractList
add, add, addAll, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subList
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface java.util.List
addAll, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
-
Field Details
-
_ids
-
_idents
-
_aliases
-
_selectAs
-
_dict
-
-
Constructor Details
-
Selects
protected Selects()
-
-
Method Details
-
addAll
Add all aliases from another instance. -
getAlias
Returns the alias of a given id. -
setAlias
Set an alias for a given id. -
setAlias
Set an alias for a given index. -
insertAlias
Insert an alias before the given index, using negative indexes to count backwards. -
indexOfAlias
Return the index of the given alias. -
getAliases
A list representation of the aliases, in select order, with AS aliases present. -
setSelectAs
Set that a given id's alias has an AS value. -
clearPlaceholders
public void clearPlaceholders()Clear all placeholders and select AS clauses. -
contains
- Specified by:
contains
in interfaceCollection
- Specified by:
contains
in interfaceList
- Overrides:
contains
in classAbstractCollection
-
get
- Specified by:
get
in interfaceList
- Specified by:
get
in classAbstractList
-
size
public int size()- Specified by:
size
in interfaceCollection
- Specified by:
size
in interfaceList
- Specified by:
size
in classAbstractCollection
-
clear
public void clear()- Specified by:
clear
in interfaceCollection
- Specified by:
clear
in interfaceList
- Overrides:
clear
in classAbstractList
-