Stack-like data structure that allows the following efficient operations:
Object equality is their identity equality.
This class implements List for accessing items in the stack,
but List methods that alter the stack is not supported.
| Modifier and Type | Field and Description |
|---|---|
| private Object[] | |
| private final int[] | |
| private boolean | |
| private int[] | |
| private int | |
| private boolean | useIdentity
True if the check shall be done by using the object identity. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public boolean | |
| private boolean | |
| public E | get(int index)
Implements abstract java. Implements java. Returns the element at the specified position in this list. |
| public String | |
| public boolean | |
| public boolean | |
| private int | |
| public E | |
| public E | |
| public boolean | |
| public void | pushNocheck(E o)
Pushes a new object to the stack without making it participate with the collision check. |
| public void | |
| public void | |
| public int | size()
Implements abstract java. Implements java. Returns the number of elements in this list. |
| data | back to summary |
|---|---|
| private Object[] data | |
| initialHash | back to summary |
|---|---|
| private final int[] initialHash | |
| latestPushResult | back to summary |
|---|---|
| private boolean latestPushResult | |
| next | back to summary |
|---|---|
| private int[] next | |
| size | back to summary |
|---|---|
| private int size | |
| useIdentity | back to summary |
|---|---|
| private boolean useIdentity True if the check shall be done by using the object identity. False if the check shall be done with the equals method. | |
| CollisionCheckStack | back to summary |
|---|---|
| public CollisionCheckStack() | |
| expandCapacity | back to summary |
|---|---|
| private void expandCapacity() | |
| findDuplicate | back to summary |
|---|---|
| public boolean findDuplicate(E o) | |
| findDuplicate | back to summary |
|---|---|
| private boolean findDuplicate(E o, int hash) | |
| get | back to summary |
|---|---|
| public E get(int index) Implements abstract java. Implements java. Doc from java. Returns the element at the specified position in this list.
| |
| getCycleString | back to summary |
|---|---|
| public String getCycleString() String that represents the cycle. | |
| getLatestPushResult | back to summary |
|---|---|
| public boolean getLatestPushResult() | |
| getUseIdentity | back to summary |
|---|---|
| public boolean getUseIdentity() | |
| hash | back to summary |
|---|---|
| private int hash(Object o) | |
| peek | back to summary |
|---|---|
| public E peek() Returns the top of the stack. | |
| pop | back to summary |
|---|---|
| public E pop() Pops an object from the stack | |
| push | back to summary |
|---|---|
| public boolean push(E o) Pushes a new object to the stack.
| |
| pushNocheck | back to summary |
|---|---|
| public void pushNocheck(E o) Pushes a new object to the stack without making it participate with the collision check. | |
| reset | back to summary |
|---|---|
| public void reset() Clears all the contents in the stack. | |
| setUseIdentity | back to summary |
|---|---|
| public void setUseIdentity(boolean useIdentity) Set to false to use | |
| size | back to summary |
|---|---|
| public int size() Implements abstract java. Implements java. Doc from java. Returns the number of elements in this list. If this list contains
more than
| |