Class SparseIntVector

  • All Implemented Interfaces:
    IntVector, java.io.Serializable

    public class SparseIntVector
    extends java.lang.Object
    implements IntVector, java.io.Serializable
    an int vector implementation designed for low occupancy. Note that get() from this vector is a binary search. This should only be used for small sets ... insertion and deletion are linear in size of set.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      SparseIntVector​(int defaultValue)  
    • Constructor Detail

      • SparseIntVector

        public SparseIntVector​(int defaultValue)
    • Method Detail

      • get

        public int get​(int x)
        Specified by:
        get in interface IntVector
      • set

        public void set​(int x,
                        int value)
        Specified by:
        set in interface IntVector
      • performVerboseAction

        public void performVerboseAction()
      • getMaxIndex

        public int getMaxIndex()
        Specified by:
        getMaxIndex in interface IntVector
        Returns:
        max i s.t set(i) was called.