Class TwoLevelVector<T>

  • All Implemented Interfaces:
    IVector<T>, java.io.Serializable, java.lang.Iterable<T>

    public class TwoLevelVector<T>
    extends java.lang.Object
    implements IVector<T>, java.io.Serializable
    An IVector implementation which delegates to pages of int vectors.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      TwoLevelVector()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T get​(int x)  
      int getMaxIndex()  
      java.util.Iterator<T> iterator()  
      void performVerboseAction()  
      void set​(int x, T value)
      TODO: this can be optimized
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Constructor Detail

      • TwoLevelVector

        public TwoLevelVector()
    • Method Detail

      • get

        public T get​(int x)
        Specified by:
        get in interface IVector<T>
      • iterator

        public java.util.Iterator<T> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<T>
      • getMaxIndex

        public int getMaxIndex()
        Specified by:
        getMaxIndex in interface IVector<T>
        Returns:
        max i s.t get(i) != null