RISC JKU

at.jku.risc.stout.urauc.util

Class TinyList<V>

  • All Implemented Interfaces:
    Cloneable
    Direct Known Subclasses:
    Alignment


    public abstract class TinyList<V>
    extends Object
    implements Cloneable
    A tiny abstract class for list implementations. All implementors have to provide O(1) complexity for all the abstract methods!!! Every method call other then toString() which is defined in this class has complexity O(1).
    Author:
    Alexander Baumgartner
    • Constructor Summary

      Constructors 
      Constructor and Description
      TinyList() 
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      V get(int i)
      Returns the element at the relative position i.
      V getFirst()
      Returns the (relative) first element.
      V getLast()
      Returns the last element.
      boolean isEmpty()
      Returns true if the relative size is 0.
      void removeFirst()
      Removes the first element by incrementing the start.
      This is a dirty remove which does not nullify any pointers!
      void removeLast()
      Removes the last element by decrementing the size.
      This is a dirty remove which does not nullify any pointers!
      int size()
      The relative size of this list is defined by size - start.
      <T extends TinyList<V>> 
      T
      subList(int from) 
      <T extends TinyList<V>> 
      T
      subList(int from, int to) 
      String toString() 
    • Constructor Detail

      • TinyList

        public TinyList()
    • Method Detail

      • get

        public V get(int i)
        Returns the element at the relative position i. The relative position is defined by getAbsolut(int) with argument start + i.
      • getFirst

        public V getFirst()
        Returns the (relative) first element.
      • getLast

        public V getLast()
        Returns the last element.
      • isEmpty

        public boolean isEmpty()
        Returns true if the relative size is 0.
      • removeFirst

        public void removeFirst()
        Removes the first element by incrementing the start.
        This is a dirty remove which does not nullify any pointers!
      • removeLast

        public void removeLast()
        Removes the last element by decrementing the size.
        This is a dirty remove which does not nullify any pointers!
      • size

        public int size()
        The relative size of this list is defined by size - start.
      • subList

        public <T extends TinyList<V>> T subList(int from)
      • subList

        public <T extends TinyList<V>> T subList(int from,
                                        int to)