Package org.apache.uima.cas.impl
Class Heap
java.lang.Object
org.apache.uima.cas.impl.Heap
the v2 CAS heap - used in modeling some binary (de)serialization
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Default size of the heap.static final int
Minimum size of the heap. -
Constructor Summary
-
Method Summary
-
Field Details
-
MIN_SIZE
public static final int MIN_SIZEMinimum size of the heap. Currently set to1000
.- See Also:
-
DEFAULT_SIZE
public static final int DEFAULT_SIZEDefault size of the heap. Currently set to500000
(2 MB).- See Also:
-
-
Constructor Details
-
Heap
public Heap()Default constructor. -
Heap
public Heap(int initialSize) Constructor lets you set initial heap size. Use only if you know what you're doing.- Parameters:
initialSize
- The initial heap size. If this is smaller than theMIN_SIZE
, the default will be used instead.
-
-
Method Details
-
reset
public void reset()Reset the temporary heap. -
add
public int add(int[] fs) Add a structure to the heap.- Parameters:
fs
- The input structure.- Returns:
- The position where the structure was added, i.e., a pointer to the first element of the structure.
-
add
public int add(int len, int val) Reserve space forlen
items on the heap and set the first item toval
. The other items are set to0
.- Parameters:
len
- The length of the new structure.val
- The value of the first cell in the new structure.- Returns:
- The position where the structure was added, i.e., a pointer to the first element of the structure.
-
getNextId
public int getNextId() -
grow
public void grow(int len) -
getInitialSize
public int getInitialSize() -
toArray
public int[] toArray()
-