Class SelectImpl.Selects

  • All Implemented Interfaces:
    java.lang.Iterable, java.util.Collection, java.util.List
    Enclosing class:
    SelectImpl

    protected static class SelectImpl.Selects
    extends java.util.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

      Fields 
      Modifier and Type Field Description
      protected java.util.Map _aliases  
      protected DBDictionary _dict  
      protected java.util.List _idents  
      protected java.util.List _ids  
      protected java.util.Map _selectAs  
      • Fields inherited from class java.util.AbstractList

        modCount
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected Selects()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addAll​(SelectImpl.Selects sels)
      Add all aliases from another instance.
      void clear()  
      void clearPlaceholders()
      Clear all placeholders and select AS clauses.
      boolean contains​(java.lang.Object id)  
      java.lang.Object get​(int i)  
      java.lang.Object getAlias​(java.lang.Object id)
      Returns the alias of a given id.
      java.util.List getAliases​(boolean ident, boolean inner)
      A list representation of the aliases, in select order, with AS aliases present.
      int indexOfAlias​(java.lang.Object alias)
      Return the index of the given alias.
      void insertAlias​(int idx, java.lang.Object id, java.lang.Object alias)
      Insert an alias before the given index, using negative indexes to count backwards.
      void setAlias​(int idx, java.lang.Object alias)
      Set an alias for a given index.
      int setAlias​(java.lang.Object id, java.lang.Object alias, boolean ident)
      Set an alias for a given id.
      void setSelectAs​(java.lang.Object id, java.lang.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.lang.Iterable

        forEach
      • Methods inherited from interface java.util.List

        addAll, containsAll, isEmpty, remove, removeAll, replaceAll, retainAll, sort, spliterator, toArray, toArray
    • Field Detail

      • _ids

        protected java.util.List _ids
      • _idents

        protected java.util.List _idents
      • _aliases

        protected java.util.Map _aliases
      • _selectAs

        protected java.util.Map _selectAs
    • Constructor Detail

      • Selects

        protected Selects()
    • Method Detail

      • addAll

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

        public java.lang.Object getAlias​(java.lang.Object id)
        Returns the alias of a given id.
      • setAlias

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

        public void setAlias​(int idx,
                             java.lang.Object alias)
        Set an alias for a given index.
      • insertAlias

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

        public int indexOfAlias​(java.lang.Object alias)
        Return the index of the given alias.
      • getAliases

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

        public void setSelectAs​(java.lang.Object id,
                                java.lang.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​(java.lang.Object id)
        Specified by:
        contains in interface java.util.Collection
        Specified by:
        contains in interface java.util.List
        Overrides:
        contains in class java.util.AbstractCollection
      • get

        public java.lang.Object get​(int i)
        Specified by:
        get in interface java.util.List
        Specified by:
        get in class java.util.AbstractList
      • size

        public int size()
        Specified by:
        size in interface java.util.Collection
        Specified by:
        size in interface java.util.List
        Specified by:
        size in class java.util.AbstractCollection
      • clear

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