Package com.pnfsoftware.jeb.core.units
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>
A collection of entries that can be used by parsers to represent pools.
-
Field Details
-
poolname
Pool name. -
list
Pool entries.
-
-
Constructor Details
-
Pool
Create a pool.- Parameters:
poolname- pool name
-
Pool
Create a pool with an initial capacity.- Parameters:
poolname- pool nameinitialCapacity- initial entry capacity
-
-
Method Details
-
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
Add an entry to the pool.- Parameters:
e- entry to add
-
get
Retrieve an entry by index.- Parameters:
index- entry index- Returns:
- the entry
-
getAll
Retrieve all entries.- Returns:
- the mutable entry list
-
iterator
-
toString
-