RISC JKU

at.jku.risc.stout.hoau.util

Class DataStructureFactory



  • public class DataStructureFactory
    extends Object
    This factory class defines which data structures to use. The complexity of the algorithm will depend on the used data structures. Hash based structures (DataStructureFactory.MyHashMap, HashSet) have better average case complexity and tree based structures (TreeMap, TreeSet) have better worst case complexity in Java's standard implementation. Of course you are free to provide your own data structures with better computational behavior here ;)
    You can simply change the public static instance field which is called $ to your own implementation of DataStructureFactory (override some of the methods). The data structures which are used by default are ArrayList, ArrayDeque, HashSet and DataStructureFactory.MyHashMap.
    Author:
    Alexander Baumgartner
    • Constructor Detail

      • DataStructureFactory

        public DataStructureFactory()
    • Method Detail

      • newDeque

        public <T> Deque<T> newDeque()
      • newDeque

        public <T> Deque<T> newDeque(Collection<? extends T> toCopy)
      • newDeque

        public <T> Deque<T> newDeque(int size)
      • newList

        public <T> List<T> newList()
      • newList

        public <T> List<T> newList(Collection<? extends T> toCopy)
      • newList

        public <T> List<T> newList(int size)
      • newMap

        public <K,V> Map<K,V> newMap()
      • newMap

        public <K,V> Map<K,V> newMap(int size)
      • newMap

        public <K,V> Map<K,V> newMap(Map<? extends K,? extends V> toCopy)
      • newSet

        public <T> Set<T> newSet()
      • newSet

        public <T> Set<T> newSet(Collection<? extends T> toCopy)
      • newSet

        public <T> Set<T> newSet(int size)