Package org.apache.uima.cas.impl
Class Id2FS
- java.lang.Object
-
- org.apache.uima.cas.impl.Id2FS
-
- All Implemented Interfaces:
java.lang.Iterable<TOP>
public class Id2FS extends java.lang.Object implements java.lang.Iterable<TOP>
A map from ints representing FS id's (or "addresses") to those FSs There is one map instance per CAS (all views). The map is not populated, normally. It is only populated when there is a need to be able to map from the id to the FS, or to prevent the FS from being GC'd -- The low level CAS apis for creating FSs have this need, because they return the id, and this won't prevent the FS from being GC'd. Removes not supported; they happen when the map is reset / cleared This corresponds to the v2 property of "once created, a FS cannot be reclaimed (until reset)" Threading: to support read-only views, concurrent with updates, needs to be thread safe
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
Id2FS.MeasureCaller
-
Field Summary
Fields Modifier and Type Field Description private static java.util.Map<Id2FS.MeasureCaller,Id2FS.MeasureCaller>
callers
private JCasHashMap
id2fs
private int
initialSize
private static boolean
IS_REPORT_PINNING
(package private) static boolean
MEASURE
private static int
MEASURE_STACK_SIZE
private static int
pinning_count
private static java.lang.String
REPORT_FS_PINNING
private static java.util.Map<Id2FS.MeasureCaller,Id2FS.MeasureCaller>
walkableCallers
-
Constructor Summary
Constructors Constructor Description Id2FS(int initialHeapSize)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
clear()
adjusts the underlying array down in size if grew beyond the reset heap size valueprivate static void
dumpCallers(java.lang.String title, java.util.Map<Id2FS.MeasureCaller,Id2FS.MeasureCaller> map)
(package private) TOP
get(int id)
IteratorNvc<TOP>
iterator()
private void
maybeReport()
(package private) void
put(int id, TOP fs)
put but assert wasn't there before(package private) void
put(TOP fs)
(package private) void
putChange(int id, TOP fs)
make an id map to an fs, asserting there was a previous mapping for this id(package private) void
putUnconditionally(TOP fs)
Skips the assert that the item wasn't already present(package private) int
size()
(package private) void
trace(java.util.Map<Id2FS.MeasureCaller,Id2FS.MeasureCaller> map)
(package private) void
traceWeakGets()
-
-
-
Field Detail
-
MEASURE
static final boolean MEASURE
- See Also:
- Constant Field Values
-
MEASURE_STACK_SIZE
private static final int MEASURE_STACK_SIZE
- See Also:
- Constant Field Values
-
callers
private static java.util.Map<Id2FS.MeasureCaller,Id2FS.MeasureCaller> callers
-
walkableCallers
private static java.util.Map<Id2FS.MeasureCaller,Id2FS.MeasureCaller> walkableCallers
-
REPORT_FS_PINNING
private static final java.lang.String REPORT_FS_PINNING
- See Also:
- Constant Field Values
-
IS_REPORT_PINNING
private static final boolean IS_REPORT_PINNING
-
pinning_count
private static int pinning_count
-
id2fs
private final JCasHashMap id2fs
-
initialSize
private final int initialSize
-
-
Method Detail
-
maybeReport
private void maybeReport()
-
put
void put(int id, TOP fs)
put but assert wasn't there before
-
putUnconditionally
void putUnconditionally(TOP fs)
Skips the assert that the item wasn't already present- Parameters:
fs
- the fs to add
-
putChange
void putChange(int id, TOP fs)
make an id map to an fs, asserting there was a previous mapping for this id- Parameters:
id
- -fs
- -
-
put
void put(TOP fs)
-
get
TOP get(int id)
-
size
int size()
-
clear
void clear()
adjusts the underlying array down in size if grew beyond the reset heap size value
-
traceWeakGets
void traceWeakGets()
-
trace
void trace(java.util.Map<Id2FS.MeasureCaller,Id2FS.MeasureCaller> map)
-
dumpCallers
private static void dumpCallers(java.lang.String title, java.util.Map<Id2FS.MeasureCaller,Id2FS.MeasureCaller> map)
-
iterator
public IteratorNvc<TOP> iterator()
- Specified by:
iterator
in interfacejava.lang.Iterable<TOP>
-
-