public class AbstractHeap extends Object
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_INITIAL_CAPACITY
Default initial capacity
|
int |
modCount
(Structural) modification counter.
|
int |
size
Current number of objects
|
int |
validSize
Indicate up to where the heap is valid
|
Constructor and Description |
---|
AbstractHeap()
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Delete all elements from the heap.
|
protected int |
desiredSize(int requiredSize,
int capacity)
Test whether we need to resize to have the requested capacity.
|
protected void |
heapModified()
Called at the end of each heap modification.
|
int |
size()
Query the size
|
public static final int DEFAULT_INITIAL_CAPACITY
public int size
public int validSize
public int modCount
public int size()
public void clear()
protected final int desiredSize(int requiredSize, int capacity)
requiredSize
- required capacitycapacity
- Current capacityprotected void heapModified()