Class Inlist.List<T extends Inlist<?>>

java.lang.Object
org.oscim.utils.pool.Inlist.List<T>
All Implemented Interfaces:
Iterable<T>, Iterator<T>
Direct Known Subclasses:
VertexData
Enclosing class:
Inlist<T extends Inlist<T>>

public static class Inlist.List<T extends Inlist<?>> extends Object implements Iterable<T>, Iterator<T>
  • Constructor Details

    • List

      public List()
  • Method Details

    • push

      public void push(T it)
      Insert single item at start of list. item.next must be null.
    • pop

      public T pop()
      Insert item at start of list.
    • reverse

      public void reverse()
      Reverse list.
    • append

      public void append(T it)
      Append item, O(n) - use push() and reverse() to iterate in insertion order!
    • appendList

      public void appendList(T list)
      Append Inlist.
    • remove

      public void remove(T it)
      Remove item from list.
    • clear

      public T clear()
      Clear list.
      Returns:
      head of list
    • head

      public T head()
      Returns:
      first node in list
    • hasNext

      public boolean hasNext()
      Iterator: Has next item
      Specified by:
      hasNext in interface Iterator<T extends Inlist<?>>
    • next

      public T next()
      Iterator: Get next item
      Specified by:
      next in interface Iterator<T extends Inlist<?>>
    • remove

      public void remove()
      Iterator: Remove current item
      Specified by:
      remove in interface Iterator<T extends Inlist<?>>
    • iterator

      public Iterator<T> iterator()
      NB: Only one iterator at a time possible!
      Specified by:
      iterator in interface Iterable<T extends Inlist<?>>
    • size

      public int size()