public abstract class AbstractSyntacticHeap extends Object implements SyntacticHeap
| Modifier and Type | Field and Description |
|---|---|
protected ArrayList<SyntacticItem> |
syntacticItems |
| Constructor and Description |
|---|
AbstractSyntacticHeap() |
| Modifier and Type | Method and Description |
|---|---|
<T extends SyntacticItem> |
allocate(T item)
Allocate a given syntactic item into this heap.
|
int |
getIndexOf(SyntacticItem item)
Determine the index of a given syntactic item in this heap.
|
SyntacticItem |
getSyntacticItem(int index)
Return the ith syntactic item in this heap.
|
<T extends SyntacticItem> |
getSyntacticItems(Class<T> kind) |
void |
print(PrintWriter out) |
int |
size()
Get the number of items in the heap.
|
protected final ArrayList<SyntacticItem> syntacticItems
public int size()
SyntacticHeapsize in interface SyntacticHeappublic SyntacticItem getSyntacticItem(int index)
SyntacticHeapgetSyntacticItem in interface SyntacticHeappublic int getIndexOf(SyntacticItem item)
SyntacticHeapgetIndexOf in interface SyntacticHeappublic <T extends SyntacticItem> List<T> getSyntacticItems(Class<T> kind)
public <T extends SyntacticItem> T allocate(T item)
SyntacticHeapAllocate a given syntactic item into this heap. The item must not already be allocated to another heap. This will recursively allocate children not already allocated to this heap. Observe that the item returned is the actual object allocated into this heap. One should not assume that the item given is that which is actually allocated.
This method will not permit mixed allocation items. That is, when it encounters an item already allocated to another heap it will simple throw an exception.
allocate in interface SyntacticHeappublic void print(PrintWriter out)
Copyright © 2017. All rights reserved.