Class VarListBuilderWithApplyAndSort<T,​U>


  • public class VarListBuilderWithApplyAndSort<T,​U>
    extends java.lang.Object
    VarListBuilderWithApplyAndSort<T, U> - Documentation.

    This class will build an suite of implementations of the VarList interface. This version provides the ability to transform and then sort the input list-class.



    • Field Detail

      • VECTOR

        public final VarList<java.util.Vector<U>,​T> VECTOR
        This VarList instance has a 'retrieve()' method that will return a Vector whose Vector-contents are of parametrized-type 'U'. The Vector returned will have already been sorted upon return.
        Code:
        Exact Field Declaration Expression:
        1
        public final VarList<Vector<U>, T>          VECTOR;
        
      • ARRAYLIST

        public final VarList<java.util.ArrayList<U>,​T> ARRAYLIST
        This VarList instance has a 'retrieve()' method that will return an ArrayList whose ArrayList-contents are of parametrized-type 'U'. The ArrayList returned will have already been sorted upon return.
        Code:
        Exact Field Declaration Expression:
        1
        public final VarList<ArrayList<U>, T>       ARRAYLIST;
        
      • ITERATOR

        public final VarList<java.util.Iterator<U>,​T> ITERATOR
        This VarList instance has a 'retrieve()' method that will return an Iterator whose Iterator-contents are of parametrized-type 'U'. The Iterator returned will have already been sorted upon return.
        Code:
        Exact Field Declaration Expression:
        1
        public final VarList<Iterator<U>, T>        ITERATOR;
        
      • ARRAY

        public final VarList<U[],​T> ARRAY
        This VarList instance has a 'retrieve()' method that will return an array whose array-contents are of parametrized-type 'U'. The array returned will have already been sorted upon return.
        Code:
        Exact Field Declaration Expression:
        1
        public final VarList<U[], T>                ARRAY;
        
      • STREAM

        public final VarList<java.util.stream.Stream<U>,​T> STREAM
        This VarList instance has a 'retrieve()' method that will return a Stream whose Stream-contents are of parametrized-type 'U'. The Stream returned will have already been sorted upon return.
        Code:
        Exact Field Declaration Expression:
        1
        public final VarList<Stream<U>, T>          STREAM;
        
      • STREAM_BUILDER

        public final VarList<java.util.stream.Stream.Builder<U>,​T> STREAM_BUILDER
        Instances of Stream.Builder cannot be sorted. Only a built Stream may be sorted. Therefore this parameter shall always be null.
        Code:
        Exact Field Declaration Expression:
        1
        public final VarList<Stream.Builder<U>, T>  STREAM_BUILDER = null;
        
      • LINKEDLIST

        public final VarList<java.util.LinkedList<U>,​T> LINKEDLIST
        This VarList instance has a 'retrieve()' method that will return a LinkedList whose LinkedList-contents are of parametrized-type 'U'. The LinkedList returned will have already been sorted upon return.
        Code:
        Exact Field Declaration Expression:
        1
        public final VarList<LinkedList<U>, T>      LINKEDLIST;
        
      • TREESET

        public final VarList<java.util.TreeSet<U>,​T> TREESET
        This VarList instance has a 'retrieve()' method that will return a TreeSet whose TreeSet-contents are of parametrized-type 'U'. The TreeSet returned will have already been sorted upon return.
        Code:
        Exact Field Declaration Expression:
        1
        public final VarList<TreeSet<U>, T>         TREESET;
        
      • STACK

        public final VarList<java.util.Stack<U>,​T> STACK
        This VarList instance has a 'retrieve()' method that will return a Stack whose Stack-contents are of parametrized-type 'U'. The Stack returned will have already been sorted upon return.
        Code:
        Exact Field Declaration Expression:
        1
        public final VarList<Stack<U>, T>           STACK;
        
    • Constructor Detail

      • VarListBuilderWithApplyAndSort

        public VarListBuilderWithApplyAndSort​
                    (java.util.function.Function<T,​U> transformer,
                     java.util.Comparator<U> comparator,
                     java.lang.Class<U> outputClass)
        
        Builds all 8 of the VarList's provided by this builder class.
        Parameters:
        transformer - This transform is used to convert the contents of the returned list-type. As noticed by its type, 'Function<T, U>', the final type of the returned VarList will of type 'U', although while building this 'VarList', the elements that shall be inserted will be of type 'T'.

        It is the job of the transformer parameter to convert the elements from type 'T' to type 'U'
        comparator - This is used to sort the returned list. Notice that this 'comparator' shall sort list-elements of type 'U'. The list that is ultimately returned by these VarList's will be of type 'U' (because of the transform).

        NOTICE The 'comparator' is of parametrized-type 'U'. This is because the sort shall occur AFTER the transform.
        outputClass - The final list that is built will be of type class U. Because Java generics use "Type Erasure," this class must be obtained here. It is used for array generation or array-construction.