Class Pool<T extends PoolEntry>

java.lang.Object
com.pnfsoftware.jeb.core.units.Pool<T>
Type Parameters:
T - pool entry type
All Implemented Interfaces:
Iterable<T>

@Ser public class Pool<T extends PoolEntry> extends Object implements Iterable<T>
A collection of entries that can be used by parsers to represent pools.
  • Field Details

    • poolname

      protected String poolname
      Pool name.
    • list

      protected List<T extends PoolEntry> list
      Pool entries.
  • Constructor Details

    • Pool

      public Pool(String poolname)
      Create a pool.
      Parameters:
      poolname - pool name
    • Pool

      public Pool(String poolname, int initialCapacity)
      Create a pool with an initial capacity.
      Parameters:
      poolname - pool name
      initialCapacity - initial entry capacity
  • Method Details

    • getName

      public String getName()
      Retrieve the pool name.
      Returns:
      pool name
    • size

      public int size()
      Retrieve the number of entries.
      Returns:
      entry count
    • isEmpty

      public boolean isEmpty()
      Determine whether the pool is empty.
      Returns:
      true if this pool has no entries
    • add

      public void add(T e)
      Add an entry to the pool.
      Parameters:
      e - entry to add
    • get

      public T get(int index)
      Retrieve an entry by index.
      Parameters:
      index - entry index
      Returns:
      the entry
    • getAll

      public List<T> getAll()
      Retrieve all entries.
      Returns:
      the mutable entry list
    • iterator

      public Iterator<T> iterator()
      Specified by:
      iterator in interface Iterable<T extends PoolEntry>
    • toString

      public String toString()
      Overrides:
      toString in class Object