java.util.Stack when the requirement is to create a pool of re-usable
objects with no requirement to shrink the pool. The aim is to provide the
bare minimum of required functionality as quickly as possible with minimum
garbage.
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| public static final int | |
| private int | |
| private final int | |
| private int | |
| private Object[] |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public synchronized void | |
| private void | |
| public synchronized T | |
| public synchronized boolean |
| DEFAULT_LIMIT | back to summary |
|---|---|
| private static final int DEFAULT_LIMIT | |
| DEFAULT_SIZE | back to summary |
|---|---|
| public static final int DEFAULT_SIZE | |
| index | back to summary |
|---|---|
| private int index | |
| limit | back to summary |
|---|---|
| private final int limit | |
| size | back to summary |
|---|---|
| private int size | |
| stack | back to summary |
|---|---|
| private Object[] stack | |
| SynchronizedStack | back to summary |
|---|---|
| public SynchronizedStack() | |
| SynchronizedStack | back to summary |
|---|---|
| public SynchronizedStack(int size, int limit) | |
| clear | back to summary |
|---|---|
| public synchronized void clear() | |
| expand | back to summary |
|---|---|
| private void expand() | |
| pop | back to summary |
|---|---|
public synchronized T pop()
| |
| push | back to summary |
|---|---|
| public synchronized boolean push(T obj) | |