Class IndexedVector


  • public class IndexedVector
    extends Object
    A simple indexed vector: a normal vector except that you must specify a key when adding an element. This allows fast lookup and allows the order of specification to be preserved.
    • Constructor Detail

      • IndexedVector

        public IndexedVector()
        IndexedVector constructor comment.
      • IndexedVector

        public IndexedVector​(int size)
        IndexedVector constructor comment.
        Parameters:
        size - int
    • Method Detail

      • appendElement

        public void appendElement​(Object key,
                                  Object value)
      • elementAt

        public Object elementAt​(int i)
        Returns the element at the specified index.
        Parameters:
        index - the index of the desired element
        Throws:
        ArrayIndexOutOfBoundsException - If an invalid index was given.
      • removeElement

        public boolean removeElement​(Object key)
        remove element referred to by key NOT value; return false if not found.
      • size

        public int size()