org.apache.openjpa.jdbc.sql
Class SelectImpl.Selects

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList
          extended by org.apache.openjpa.jdbc.sql.SelectImpl.Selects
All Implemented Interfaces:
Iterable, Collection, List
Enclosing class:
SelectImpl

protected static class SelectImpl.Selects
extends AbstractList

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
protected  Map _aliases
           
protected  DBDictionary _dict
           
protected  List _idents
           
protected  List _ids
           
protected  Map _selectAs
           
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
protected SelectImpl.Selects()
           
 
Method Summary
 void addAll(SelectImpl.Selects sels)
          Add all aliases from another instance.
 void clear()
           
 void clearPlaceholders()
          Clear all placeholders and select AS clauses.
 boolean contains(Object id)
           
 Object get(int i)
           
 Object getAlias(Object id)
          Returns the alias of a given id.
 List 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 setAlias(int idx, Object alias)
          Set an alias for a given index.
 int setAlias(Object id, Object alias, boolean ident)
          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.List
addAll, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray
 

Field Detail

_ids

protected List _ids

_idents

protected List _idents

_aliases

protected Map _aliases

_selectAs

protected Map _selectAs

_dict

protected DBDictionary _dict
Constructor Detail

SelectImpl.Selects

protected SelectImpl.Selects()
Method Detail

addAll

public void addAll(SelectImpl.Selects sels)
Add all aliases from another instance.


getAlias

public Object getAlias(Object id)
Returns the alias of a given id.


setAlias

public int setAlias(Object id,
                    Object alias,
                    boolean ident)
Set an alias for a given id.


setAlias

public void setAlias(int idx,
                     Object alias)
Set an alias for a given index.


insertAlias

public void insertAlias(int idx,
                        Object id,
                        Object alias)
Insert an alias before the given index, using negative indexes to count backwards.


indexOfAlias

public int indexOfAlias(Object alias)
Return the index of the given alias.


getAliases

public List getAliases(boolean ident,
                       boolean inner)
A list representation of the aliases, in select order, with AS aliases present.


setSelectAs

public void setSelectAs(Object id,
                        String as)
Set that a given id's alias has an AS value.


clearPlaceholders

public void clearPlaceholders()
Clear all placeholders and select AS clauses.


contains

public boolean contains(Object id)
Specified by:
contains in interface Collection
Specified by:
contains in interface List
Overrides:
contains in class AbstractCollection

get

public Object get(int i)
Specified by:
get in interface List
Specified by:
get in class AbstractList

size

public int size()
Specified by:
size in interface Collection
Specified by:
size in interface List
Specified by:
size in class AbstractCollection

clear

public void clear()
Specified by:
clear in interface Collection
Specified by:
clear in interface List
Overrides:
clear in class AbstractList


Copyright © 2006-2010 Apache Software Foundation. All Rights Reserved.