Class CASImpl
- All Implemented Interfaces:
AbstractCas
,CASMgr
,CAS
,LowLevelCAS
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate class
Binary Deserializaion Support An instance of this class is made for every reinit operationprivate static enum
private static class
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final int
private static final int
private static final AtomicInteger
static final int
static final int
private static final boolean
static final String
Set this JVM property to false for high performance, (no checking); insure you don't have the report flag (above) turned on - otherwise it will force this to "true".static final int
(package private) FSIndexRepositoryImpl
private static final int[]
private static final boolean
the protect indexes flag is on by default, but may be turned of via setting the property.private static final boolean
static final boolean
private final boolean
private JCas
private int
The heap address of the sofa FS for this view, or -1 if the sofa FS is for the initial view, or 0 if there is no sofa FS - for instance, in the "base cas"static final int
static final String
Define this JVM property to enable checking for invalid updates to features which are used as keys by any index.(package private) final CASImpl.SharedViewData
static final String
The UIMA framework detects (unless disabled, for high performance) updates to indexed FS which update key values used as keys in indexes.private static final boolean
static final int
Fields inherited from interface org.apache.uima.cas.CAS
DEFAULT_LANGUAGE_NAME, FEATURE_BASE_NAME_BEGIN, FEATURE_BASE_NAME_END, FEATURE_BASE_NAME_HEAD, FEATURE_BASE_NAME_LANGUAGE, FEATURE_BASE_NAME_SOFA, FEATURE_BASE_NAME_SOFAARRAY, FEATURE_BASE_NAME_SOFAID, FEATURE_BASE_NAME_SOFAMIME, FEATURE_BASE_NAME_SOFANUM, FEATURE_BASE_NAME_SOFASTRING, FEATURE_BASE_NAME_SOFAURI, FEATURE_BASE_NAME_TAIL, FEATURE_FULL_NAME_BEGIN, FEATURE_FULL_NAME_END, FEATURE_FULL_NAME_FLOAT_LIST_HEAD, FEATURE_FULL_NAME_FLOAT_LIST_TAIL, FEATURE_FULL_NAME_FS_LIST_HEAD, FEATURE_FULL_NAME_FS_LIST_TAIL, FEATURE_FULL_NAME_INTEGER_LIST_HEAD, FEATURE_FULL_NAME_INTEGER_LIST_TAIL, FEATURE_FULL_NAME_LANGUAGE, FEATURE_FULL_NAME_SOFA, FEATURE_FULL_NAME_SOFAARRAY, FEATURE_FULL_NAME_SOFAID, FEATURE_FULL_NAME_SOFAMIME, FEATURE_FULL_NAME_SOFANUM, FEATURE_FULL_NAME_SOFASTRING, FEATURE_FULL_NAME_SOFAURI, FEATURE_FULL_NAME_STRING_LIST_HEAD, FEATURE_FULL_NAME_STRING_LIST_TAIL, NAME_DEFAULT_SOFA, NAME_DEFAULT_TEXT_SOFA, NAME_SPACE_UIMA_CAS, NAME_SPACE_UIMA_TCAS, SOFA_INDEX_NAME, STD_ANNOTATION_INDEX, TYPE_NAME_ANNOTATION, TYPE_NAME_ANNOTATION_BASE, TYPE_NAME_ARRAY_BASE, TYPE_NAME_BOOLEAN, TYPE_NAME_BOOLEAN_ARRAY, TYPE_NAME_BYTE, TYPE_NAME_BYTE_ARRAY, TYPE_NAME_DOCUMENT_ANNOTATION, TYPE_NAME_DOUBLE, TYPE_NAME_DOUBLE_ARRAY, TYPE_NAME_EMPTY_FLOAT_LIST, TYPE_NAME_EMPTY_FS_LIST, TYPE_NAME_EMPTY_INTEGER_LIST, TYPE_NAME_EMPTY_STRING_LIST, TYPE_NAME_FLOAT, TYPE_NAME_FLOAT_ARRAY, TYPE_NAME_FLOAT_LIST, TYPE_NAME_FS_ARRAY, TYPE_NAME_FS_LIST, TYPE_NAME_INTEGER, TYPE_NAME_INTEGER_ARRAY, TYPE_NAME_INTEGER_LIST, TYPE_NAME_LIST_BASE, TYPE_NAME_LONG, TYPE_NAME_LONG_ARRAY, TYPE_NAME_NON_EMPTY_FLOAT_LIST, TYPE_NAME_NON_EMPTY_FS_LIST, TYPE_NAME_NON_EMPTY_INTEGER_LIST, TYPE_NAME_NON_EMPTY_STRING_LIST, TYPE_NAME_SHORT, TYPE_NAME_SHORT_ARRAY, TYPE_NAME_SOFA, TYPE_NAME_STRING, TYPE_NAME_STRING_ARRAY, TYPE_NAME_STRING_LIST, TYPE_NAME_TOP, UIMA_CAS_PREFIX
Fields inherited from interface org.apache.uima.cas.impl.LowLevelCAS
NULL_FS_REF, TYPE_CLASS_BOOLEAN, TYPE_CLASS_BOOLEANARRAY, TYPE_CLASS_BYTE, TYPE_CLASS_BYTEARRAY, TYPE_CLASS_DOUBLE, TYPE_CLASS_DOUBLEARRAY, TYPE_CLASS_FLOAT, TYPE_CLASS_FLOATARRAY, TYPE_CLASS_FS, TYPE_CLASS_FSARRAY, TYPE_CLASS_INT, TYPE_CLASS_INTARRAY, TYPE_CLASS_INVALID, TYPE_CLASS_LONG, TYPE_CLASS_LONGARRAY, TYPE_CLASS_SHORT, TYPE_CLASS_SHORTARRAY, TYPE_CLASS_STRING, TYPE_CLASS_STRINGARRAY
-
Constructor Summary
ConstructorsConstructorDescriptionCASImpl()
Constructor.CASImpl
(int initialHeapSize, boolean useJcasCache) CASImpl
(CASMgrSerializer ser) CASImpl
(TypeSystemImpl typeSystem, int initialHeapSize, boolean useJcasCache) CASImpl
(TypeSystemImpl typeSystem, int initialHeapSize, boolean useFSCache, boolean useJcasCache) -
Method Summary
Modifier and TypeMethodDescription(package private) void
addbackModifiedFSs
(FSsTobeAddedback addbacks) This design is to support normal operations where the addbacks could be nested It also handles cases where nested ones were inadvertently left open Three cases: 1) the addbacks are the last element in the stack - remove it from the stack 2) the addbacks are (no longer) in the list - leave stack alone 3) the addbacks are in the list but not at the end - remove it and all later ones If the "withProtectedindexes" approach is used, it guarantees proper nesting, but the Runnable can't throw checked exceptions.(package private) void
addbackSingle
(int fsAddr) void
Add a feature structure to all appropriate indexes in the repository associated with this CAS View.void
addSofa
(FeatureStructure sofa, String sofaName, String mimeType) (package private) void
addSofaFsToIndex
(SofaFS sofa) (package private) int
final void
checkArrayBounds
(int fsRef, int pos) final void
checkArrayBounds
(int fsRef, int pos, int length) final void
checkArrayPreconditions
(int len) private final void
checkDomTypeConditions
(int domTypeCode, int featCode) private final void
checkFeature
(int featureCode) private boolean
checkForInvalidFeatureSetting
(int fsRef, int featureCode) This is the method all normal FS feature "setters" call before doing the set operation.private final void
checkFsRan
(int featCode) (package private) final void
checkFsRef
(int fsRef) private final void
checkFsRefConditions
(int fsRef, int featureCode) private void
private final void
checkLowLevelParams
(int fsRef, int domType, int feat) private final void
checkLowLevelParams
(int fsRef, int domType, int ranType, int feat) private final void
checkNonArrayConditions
(int fsRef, int typeCode, int featureCode) private final void
checkPrimitiveArrayConditions
(int fsRef, int typeCode, int position) private final void
checkTypeAt
(int typeCode, int fsRef) private final void
checkTypingConditions
(int domTypeCode, int ranTypeCode, int featCode) final void
checkTypingConditions
(Type domType, Type ranType, Feature feat) Check the range is appropriate for this type/feature.private void
void
Deprecated.void
(package private) void
copyFeatures
(int trgAddr, int srcAddr) (package private) void
copyFromArray
(int[] src, int srcOffset, int addr, int destOffset, int length) Copy the contents of an input array into a CAS array.(package private) void
copyToArray
(int addr, int sourceOffset, int[] dest, int destOffset, int length) Copy the contents of an array to an externally provided array.createAnnotation
(Type type, int begin, int end) Create a new annotation.createArrayFS
(int length) Create a new feature structure array.createBooleanArrayFS
(int length) Create a new Boolean array.createByteArrayFS
(int length) Create a new Byte array.private <T extends AnnotationFS>
TcreateDocumentAnnotation
(int length) createDoubleArrayFS
(int length) Create a new Double array.Create a feature path.createFeatureValuePath
(String featureValuePath) Create a feature-value path from a string.<T extends FeatureStructure>
FSIterator<T>createFilteredIterator
(FSIterator<T> it, FSMatchConstraint cons) Create an iterator over structures satisfying a given constraint.createFloatArrayFS
(int length) Create a new int array.<T extends FeatureStructure>
TcreateFS
(int addr) This is your link from the low-level API to the high-level API.<T extends FeatureStructure>
TCreate a new FeatureStructure.private void
(package private) SofaFS
createInitialSofa
(String mimeType) createIntArrayFS
(int length) Create a new int array.createLongArrayFS
(int length) Create a new Long array.The current implementation only supports 1 marker call per CAS.createShortArrayFS
(int length) Create a new Short array.(package private) SofaFS
createSofa
(String sofaName, String mimeType) createSofa
(SofaID sofaID, String mimeType) Deprecated.createStringArrayFS
(int length) Create a new String array.(package private) void
createStringTableFromArray
(String[] stringTable) int
createTempArray
(int type, int len) Create a temporary (i.e., per document) array FS on the heap.createView
(String aSofaID) Create a view and its underlying Sofa (subject of analysis).static final long
double2long
(double d) final boolean
(package private) void
void
enableReset
(boolean flag) Enable/disable resetting the CAS withCAS.reset()
.private void
private void
featModWhileInIndexReport
(int fsRef, int featureCode) (package private) void
featureCodesInIndexKeysAdd
(int featCode) private void
findCorrespondingFs
(int heapAddr, CASImpl.BinDeserSupport bds) static final int
float2int
(float f) void
flush()
Deprecated.<T extends FeatureStructure>
ListIterator<T>fs2listIterator
(FSIterator<T> it) Wrap a standard JavaListIterator
around an FSListIterator.(package private) FSsTobeAddedback.FSsTobeAddedbackSingle
<T extends AnnotationFS>
AnnotationIndex<T>The generic spec T extends AnnotationFS (rather than AnnotationFS) allows the method JCasImpl getAnnotationIndex to return Annotation instead of AnnotationFS<T extends AnnotationFS>
AnnotationIndex<T>getAnnotationIndex
(Type type) Get the standard annotation index restricted to a specific annotation type.Get the type object for the annotation type.final int
getArrayStartAddress
(int addr) Get the heap address of the first cell of this array.int
getArrayValue
(int addr, int index) Get a specific value out of an array.(package private) FSIndexRepository
(package private) int
Get the feature object for the annotation begin feature.boolean
getBooleanValue
(int addr, int feat) (package private) ByteHeap
byte
getByteValue
(int addr, int feat) getCAS()
Return a non-admin version of the CAS.(package private) int
getCasId()
(package private) int
Get a constraint factory.(package private) ComponentInfo
Get the Cas view that the current component should use.(package private) int[]
getDeltaIndexedFSs
(MarkerImpl mark) <T extends AnnotationFS>
TGeneric issue: The returned document annotation could be either an instance of DocumentAnnotation or an instance of AnnotationImpl - the Java cover class used for annotations when JCas is not being used.Gets the language code for this document from the language feature of the special instance of the DocumentationAnnotation associated with this CAS.Get the document text.double
getDoubleValue
(int addr, int feat) Get the feature object for the annotation end feature.Internal use onlyint
getFeatureOffset
(int feat) int
getFeatureValue
(int addr, int feat) getFeatureValueAsString
(int addr, int feat) float
getFloatValue
(int addr) float
getFloatValue
(int addr, int feat) getHeap()
int
getHeapValue
(int addr) Get the value of an address on the heap.(package private) int[]
Get the index repository.(package private) CAS
getJCas()
Get the JCas for this CAS.Create a JCas view for a Sofa.Deprecated.Gets the ClassLoader that should be used by the JCas to load the generated FS cover classes for this CAS.(package private) LongHeap
long
getLongValue
(int addr, int feat) Get an instance of the low-level CAS.(package private) IntVector
(package private) IntVector
(package private) IntVector
(package private) IntVector
(package private) IntVector
private int
getNextFsHeapAddr
(int fsAddr) (package private) ShortHeap
short
getShortValue
(int addr, int feat) getSofa()
Get the Sofa feature structure associated with this CAS view.(package private) SofaFS
getSofa
(int sofaRef) private SofaFS
Deprecated.Get the Sofa data array.Get the Sofa data as a byte stream.getSofaDataStream
(SofaFS aSofa) Get the Sofa Data String (a.k.a.Get the Sofa data array.int
getSofaFeat
(int addr) (package private) FSIndexRepository
getSofaIndexRepository
(int aSofaRef) (package private) FSIndexRepository
getSofaIndexRepository
(SofaFS aSofa) Get iterator for all SofaFS in the CAS.Get the mime type of the Sofa data being analyzed.int
getStringForCode
(int stringCode) (package private) StringHeap
getStringValue
(int addr, int feat) int
getTypeCode
(int fsAddr) Return the type system of this CAS instance.Return a writable version of the type system.getView
(int sofaNum) Get the view for a Sofa (subject of analysis).Get the view for a Sofa (subject of analysis).private CAS
getViewFromSofaNbr
(int nbr) Get iterator over all views in this CAS.getViewIterator
(String localViewNamePrefix) Get iterator over all views with the given name prefix.Get the view name.void
Install the standard built-in indexes into the base CASprivate void
static final float
int2float
(int i) boolean
isAbstractArrayType
(int type) boolean
isAbstractArrayType
(Type type) boolean
boolean
isArrayType
(int type) boolean
isArrayType
(Type type) boolean
boolean
isBooleanArrayType
(int type) boolean
isBooleanArrayType
(Type type) boolean
isBooleanType
(int type) boolean
isBooleanType
(Type type) boolean
isByteArrayType
(int type) boolean
isByteArrayType
(Type type) boolean
isByteType
(int type) boolean
isByteType
(Type type) private final boolean
isCreatableArrayType
(int typeCode) (package private) final boolean
isCreatableType
(int typeCode) Check if this is a regular type (i.e., not an array or a basic type).boolean
isDoubleArrayType
(int type) boolean
isDoubleArrayType
(Type type) boolean
isDoubleType
(int type) boolean
isDoubleType
(Type type) boolean
isFloatArrayType
(int type) boolean
isFloatArrayType
(Type type) boolean
isFloatType
(int type) boolean
isFloatType
(Type type) boolean
isFSArrayType
(int type) boolean
isFSArrayType
(Type type) (package private) boolean
boolean
isIntArrayType
(int type) boolean
isIntArrayType
(Type type) boolean
isIntType
(int type) boolean
boolean
isLongArrayType
(int type) boolean
isLongArrayType
(Type type) boolean
isLongType
(int type) boolean
isLongType
(Type type) boolean
isShortArrayType
(int type) boolean
isShortArrayType
(Type type) boolean
isShortType
(int type) boolean
isShortType
(Type type) (package private) boolean
isSofaView
(int sofaAddr) boolean
isStringArrayType
(int type) boolean
isStringArrayType
(Type type) boolean
isStringType
(int type) boolean
isStringType
(Type type) boolean
int
ll_copyCharBufferValue
(int fsRef, int featureCode, char[] buffer, int start) int
ll_createAnnotation
(int typeCode, int begin, int end) int
ll_createArray
(int typeCode, int arrayLength) Create a new array.int
ll_createArray
(int typeCode, int arrayLength, boolean doChecks) Create a new array.int
ll_createAuxArray
(int typeCode, int arrayLength) int
ll_createBooleanArray
(int arrayLength) int
ll_createByteArray
(int arrayLength) int
ll_createDocumentAnnotation
(int length) int
ll_createDocumentAnnotationNoIndex
(int begin, int end) int
ll_createDoubleArray
(int arrayLength) final int
ll_createFS
(int typeCode) Create a new FS on the heap.final int
ll_createFS
(int typeCode, boolean doCheck) Create a new FS on the heap.int
ll_createFSAnnotCheck
(int typeCode) int
ll_createLongArray
(int arrayLength) int
ll_createShortArray
(int arrayLength) int
ll_getAnnotBegin
(int fsRef) int
ll_getAnnotEnd
(int fsRef) int
ll_getArraySize
(int arrayFsRef) Get the size of an array.boolean
ll_getBooleanArrayValue
(int fsRef, int position) boolean
ll_getBooleanArrayValue
(int fsRef, int position, boolean doTypeChecks) boolean
ll_getBooleanValue
(int fsRef, int featureCode) boolean
ll_getBooleanValue
(int fsRef, int featureCode, boolean doTypeChecks) byte
ll_getByteArrayValue
(int fsRef, int position) byte
ll_getByteArrayValue
(int fsRef, int position, boolean doTypeChecks) byte
ll_getByteValue
(int fsRef, int featureCode) byte
ll_getByteValue
(int fsRef, int featureCode, boolean doTypeChecks) int
ll_getCharBufferValueSize
(int fsRef, int featureCode) int
double
ll_getDoubleArrayValue
(int fsRef, int position) double
ll_getDoubleArrayValue
(int fsRef, int position, boolean doTypeChecks) double
ll_getDoubleValue
(int fsRef, int featureCode) double
ll_getDoubleValue
(int fsRef, int featureCode, boolean doTypeChecks) double
ll_getDoubleValueFeatOffset
(int fsRef, int featureOffset) final float
ll_getFloatArrayValue
(int fsRef, int position) Get the value of a float array at a certain position.float
ll_getFloatArrayValue
(int fsRef, int position, boolean doTypeChecks) Get the value of a float array at a certain position.final float
ll_getFloatValue
(int fsRef, int featureCode) Get the value of a float valued feature.final float
ll_getFloatValue
(int fsRef, int featureCode, boolean doTypeChecks) Get the value of a float valued feature.<T extends FeatureStructure>
Tll_getFSForRef
(int fsRef) Return a FS object that corresponds to a low-level reference.final int
ll_getFSRef
(FeatureStructure fsImpl) Get the low-level reference from an existing FS object.int
ll_getFSRefType
(int fsRef) Get the type code for a FS reference.int
ll_getFSRefType
(int fsRef, boolean doChecks) Get the type code for a FS reference.Get the low-level version of the index repository.final int
ll_getIntArrayValue
(int fsRef, int position) Get the value of an array at a certain position.final int
ll_getIntArrayValue
(int fsRef, int position, boolean doTypeChecks) Get the value of an integer array at a certain position.final int
ll_getIntValue
(int fsRef, int featureCode) Get the value of an integer valued feature.final int
ll_getIntValue
(int fsRef, int featureCode, boolean doTypeChecks) Get the value of an integer valued feature.final int
ll_getIntValueFeatOffset
(int fsRef, int featureOffset) long
ll_getLongArrayValue
(int fsRef, int position) long
ll_getLongArrayValue
(int fsRef, int position, boolean doTypeChecks) long
ll_getLongValue
(int offset) long
ll_getLongValue
(int fsRef, int featureCode) long
ll_getLongValue
(int fsRef, int featureCode, boolean doTypeChecks) long
ll_getLongValueFeatOffset
(int fsRef, int featureOffset) final int
ll_getRefArrayValue
(int fsRef, int position) Get the value of a FS reference array at a certain position.int
ll_getRefArrayValue
(int fsRef, int position, boolean doTypeChecks) Get the value of a FS reference array at a certain position.final int
ll_getRefValue
(int fsRef, int featureCode) Get the value of a FS reference valued feature.final int
ll_getRefValue
(int fsRef, int featureCode, boolean doTypeChecks) Get the value of a FS reference valued feature.final int
ll_getRefValueFeatOffset
(int fsRef, int featureOffset) short
ll_getShortArrayValue
(int fsRef, int position) short
ll_getShortArrayValue
(int fsRef, int position, boolean doTypeChecks) short
ll_getShortValue
(int fsRef, int featureCode) short
ll_getShortValue
(int fsRef, int featureCode, boolean doTypeChecks) int
ll_getSofaCasView
(int addr) ll_getSofaDataString
(int sofaAddr) ll_getSofaID
(int sofaRef) int
ll_getSofaNum
(int sofaRef) final String
ll_getStringArrayValue
(int fsRef, int position) Get the value of a string array at a certain position.ll_getStringArrayValue
(int fsRef, int position, boolean doTypeChecks) Get the value of a string array at a certain position.final String
ll_getStringValue
(int fsRef, int featureCode) Get the value of a string valued feature.final String
ll_getStringValue
(int fsRef, int featureCode, boolean doTypeChecks) Get the value of a string valued feature.final String
ll_getStringValueFeatOffset
(int fsRef, int featureOffset) final int
ll_getTypeClass
(int typeCode) Determine the type class of a type.Get the low-level version of the type system object.final boolean
ll_isRefType
(int typeCode) Checks if the type code is that of a reference type (anything that's not a basic type, currently Integer, String and Float).void
ll_setBooleanArrayValue
(int fsRef, int position, boolean b) void
ll_setBooleanArrayValue
(int fsRef, int position, boolean value, boolean doTypeChecks) void
ll_setBooleanValue
(int fsRef, int featureCode, boolean value) void
ll_setBooleanValue
(int fsRef, int featureCode, boolean value, boolean doTypeChecks) void
ll_setByteArrayValue
(int fsRef, int position, byte value) void
ll_setByteArrayValue
(int fsRef, int position, byte value, boolean doTypeChecks) final void
ll_setByteValue
(int fsRef, int featureCode, byte value) void
ll_setByteValue
(int fsRef, int featureCode, byte value, boolean doTypeChecks) final void
ll_setCharBufferValue
(int fsRef, int featureCode, char[] buffer, int start, int length) final void
ll_setCharBufferValue
(int fsRef, int featureCode, char[] buffer, int start, int length, boolean doTypeChecks) void
ll_setDoubleArrayValue
(int fsRef, int position, double d) void
ll_setDoubleArrayValue
(int fsRef, int position, double value, boolean doTypeChecks) void
ll_setDoubleValue
(int fsRef, int featureCode, double value) void
ll_setDoubleValue
(int fsRef, int featureCode, double value, boolean doTypeChecks) void
ll_setFloatArrayValue
(int fsRef, int position, float value) Set the value of an integer array at a certain position.void
ll_setFloatArrayValue
(int fsRef, int position, float value, boolean doTypeChecks) Set the value of an integer array at a certain position.final void
ll_setFloatValue
(int fsRef, int featureCode, float value) Set the value of a float feature.final void
ll_setFloatValue
(int fsRef, int featureCode, float value, boolean doTypeChecks) Set the value of a float feature.void
ll_setIntArrayValue
(int fsRef, int position, int value) Set the value of an integer array at a certain position.void
ll_setIntArrayValue
(int fsRef, int position, int value, boolean doTypeChecks) Set the value of an integer array at a certain position.final void
ll_setIntValue
(int fsRef, int featureCode, int value) Set the value of an integer feature.final void
ll_setIntValue
(int fsRef, int featureCode, int value, boolean doTypeChecks) Set the value of an integer feature.void
ll_setLongArrayValue
(int fsRef, int position, long value) void
ll_setLongArrayValue
(int fsRef, int position, long value, boolean doTypeChecks) void
ll_setLongValue
(int fsRef, int featureCode, long value) void
ll_setLongValue
(int fsRef, int featureCode, long value, boolean doTypeChecks) void
ll_setRefArrayValue
(int fsRef, int position, int value) Set the value of an integer array at a certain position.void
ll_setRefArrayValue
(int fsRef, int position, int value, boolean doTypeChecks) Set the value of an integer array at a certain position.final void
ll_setRefValue
(int fsRef, int featureCode, int value) Set the value of a FS reference feature.final void
ll_setRefValue
(int fsRef, int featureCode, int value, boolean doTypeChecks) Set the value of a FS reference feature.void
ll_setShortArrayValue
(int fsRef, int position, short value) void
ll_setShortArrayValue
(int fsRef, int position, short value, boolean doTypeChecks) final void
ll_setShortValue
(int fsRef, int featureCode, short value) void
ll_setShortValue
(int fsRef, int featureCode, short value, boolean doTypeChecks) void
ll_setStringArrayValue
(int fsRef, int position, String value) Set the value of an integer array at a certain position.void
ll_setStringArrayValue
(int fsRef, int position, String value, boolean doTypeChecks) Set the value of an integer array at a certain position.final void
ll_setStringValue
(int fsRef, int featureCode, String value) Set the value of a string feature.final void
ll_setStringValue
(int fsRef, int featureCode, String value, boolean doTypeChecks) Set the value of a string feature.private void
logFSUpdate
(int fsaddr, int position, CASImpl.ModifiedHeap whichheap, int howmany) static final double
long2double
(long l) (package private) static String
private void
maybeAddback
(int fsRef) Do the individual feat update addback if a) not in a block mode, and b) running with auto protect indexes c) not in block-single mode if running in block mode, the add back is delayed until the end of the blockprivate void
maybeAddBackAndRemoveFs
(int heapAddr, CASImpl.BinDeserSupport bds) for Deserialization of Delta, when updating existing FSs, If the heap addr is for the next FS, re-add the previous one to those indexes where it was removed, and then maybe remove the new one (and remember which views to re-add to).(package private) void
maybeClearCacheNotInIndex
(int fsAddr) private boolean
protectIndexes Within the scope of protectIndexes, feature updates are checked, and if found to be a key, and the FS is in a corruptable index, then the FS is removed from the indexes (in all necessary views) (perhaps multiple times if the FS was added to the indexes multiple times), and this removal is recorded on an new instance of FSsTobeReindexed appended to fssTobeAddedback.void
Runs the code in the runnable inside a protection block, where any modifications to features done while in this block will be done in a way to protect any indexes which otherwise might become corrupted by the update action; the protection is achieved by temporarily removing the FS (if it is in the indexes), before the update happens.private int
readInt
(DataInputStream dis, boolean swap) private long
readLong
(DataInputStream dis, boolean swap) private short
readShort
(DataInputStream dis, boolean swap) (package private) void
refreshView
(CAS cas, SofaFS aSofa) (package private) void
(package private) void
registerView
(SofaFS aSofa) (package private) void
reinit
(int[] heapMetadata, int[] heapArray, String[] stringTable, int[] fsIndex, byte[] byteHeapArray, short[] shortHeapArray, long[] longHeapArray) reinit
(InputStream istream) --------------------------------------------------------------------- see Blob Format in CASSerializer This reads in and deserializes CAS data from a stream.void
reinit
(CASCompleteSerializer casCompSer) void
reinit
(CASSerializer ser) (package private) void
reinitDeltaIndexedFSs
(int[] fsIndex) Adds the SofaFSs to the base view Assumes "cas" refers to the base cas Processes "adds", "removes" and "reindexes" for all views(package private) void
reinitIndexedFSs
(int[] fsIndex) void
release()
Default implementation that returns this CAS to its CasManager by callingCasOwner.releaseCas(AbstractCas)
.private boolean
removeAndRecord
(int fsRef, FSIndexRepositoryImpl ir, FSsTobeAddedback toBeAdded) remove a FS from corruptable indexes in this view(package private) boolean
removeFromCorruptableIndexAnyView
(int fsRef, FSsTobeAddedback toBeAdded) Remove the fsRef from any corruptable index in any view, and remember per view whether it was actually in the index.(package private) boolean
removeFromCorruptableIndexAnyView
(int fsRef, FSsTobeAddedback toBeAdded, int featCode) A conditional remove, depends on the featCode being used as a key Skip tests if the FS is known not to be in the indexes in any view(package private) boolean
removeFromCorruptableIndexAnyViewSetCache
(int fsRef, FSsTobeAddedback toBeAdded) void
Remove a feature structure from all indexes in the repository associated with this CAS View.void
reset()
Reset the CAS, emptying it of all content.(package private) void
void
(package private) void
private void
void
(package private) void
setArrayValue
(int addr, int index, int value) Set an array value.(package private) void
setArrayValueFromString
(int addr, int index, String value) void
setCacheNotInIndex
(int fsAddr) Called by feature setters which know the FS is not in any index to bypass any index corruption checking, e.g., CasCopier Internal use onlyvoid
void
Informs the CAS of relevant information about the component that is currently processing it.(package private) void
void
setDocumentLanguage
(String languageCode) Sets the language for this document.void
setDocumentText
(String text) Set the document text.void
setFeatureValue
(int addr, int feat, boolean v) void
setFeatureValue
(int addr, int feat, byte v) void
setFeatureValue
(int addr, int feat, double s) void
setFeatureValue
(int addr, int feat, float f) void
setFeatureValue
(int addr, int feat, int val) This is the common point where all sets of values in the heap come through It implements the check for invalid feature setting and potentially the addback.void
setFeatureValue
(int addr, int feat, long s) void
setFeatureValue
(int addr, int feat, short s) void
setFeatureValueFromString
(int fsref, int feat, String value) (package private) void
setFeatureValueNoIndexCorruptionCheck
(int addr, int feat, int val) Set the value of a feature of a FS without checking for index corruption (typically because the feature isn't one that can be used as a key, or the context is one where the FS is being created, and is guaranteed not to be in any index (yet))(package private) void
setFeatureValueNotJournaled
(int addr, int feat, int val) Set the value of a feature in the FS without journaling (because it's for a new FS above the mark)void
setFloatValue
(int addr, int feat, float f) void
setJCasClassLoader
(ClassLoader classLoader) Sets the ClassLoader that should be used by the JCas to load the generated FS cover classes for this CAS.void
setLocalFsGenerators
(FSGenerator<? extends FeatureStructure>[] fsGenerators) void
Provides this CAS with a handle to the CASOwner that owns it.void
setSofaDataArray
(FeatureStructure array, String mime) Set the Sofa data as an ArrayFS.void
setSofaDataString
(String text, String mime) Set the document text.void
setSofaDataURI
(String uri, String mime) Set the Sofa data as a URI.void
setSofaFeat
(int addr, int sofa) (package private) void
setSofaIndexRepository
(int aSofaRef, FSIndexRepository indxRepos) (package private) void
setSofaIndexRepository
(SofaFS aSofa, FSIndexRepository indxRepos) void
setStringValue
(int addr, int feat, String s) private static void
setTypeFinal
(Type type) static void
private void
setViewForSofaNbr
(int nbr, CAS view) int
size()
Estimate the memory consumption of this CAS instance (in bytes).void
switchClassLoader
(ClassLoader newClassLoader) void
switchClassLoaderLockCas
(Object userCode) void
switchClassLoaderLockCasCL
(ClassLoader newClassLoader) private void
throwAccessTypeError
(int fsRef, int typeCode) toString()
void
boolean
private void
verifySofaNameUniqueIfDeserializedViewAdded
(int sofaNbr, SofaFS aSofa)
-
Field Details
-
trace
private static final boolean trace- See Also:
-
casIdProvider
-
NULL
public static final int NULL- See Also:
-
TRUE
public static final int TRUE- See Also:
-
FALSE
public static final int FALSE- See Also:
-
INT0
private static final int[] INT0 -
DEFAULT_INITIAL_HEAP_SIZE
public static final int DEFAULT_INITIAL_HEAP_SIZE- See Also:
-
DEFAULT_RESET_HEAP_SIZE
public static final int DEFAULT_RESET_HEAP_SIZE- See Also:
-
THROW_EXCEPTION_FS_UPDATES_CORRUPTS
The UIMA framework detects (unless disabled, for high performance) updates to indexed FS which update key values used as keys in indexes. Normally the framework will protect against index corruption by temporarily removing the FS from the indexes, then do the update to the feature value, and then addback the changed FS.Users can use the protectIndexes() methods to explicitly control this remove - add back cycle, for instance to "batch" together several updates to multiple features in a FS.
Some build processes may want to FAIL if any unprotected updates of this kind occur, instead of having the framework silently recover them. This is enabled by having the framework throw an exception; this is controlled by this global JVM property, which, if defined, causes the framework to throw an exception rather than recover.
- See Also:
-
IS_THROW_EXCEPTION_CORRUPT_INDEX
public static final boolean IS_THROW_EXCEPTION_CORRUPT_INDEX -
REPORT_FS_UPDATES_CORRUPTS
Define this JVM property to enable checking for invalid updates to features which are used as keys by any index.- The following are the same: -Duima.check_invalid_fs_updates and -Duima.check_invalid_fs_updates=true
- See Also:
-
IS_REPORT_FS_UPDATE_CORRUPTS_INDEX
private static final boolean IS_REPORT_FS_UPDATE_CORRUPTS_INDEX -
DISABLE_PROTECT_INDEXES
Set this JVM property to false for high performance, (no checking); insure you don't have the report flag (above) turned on - otherwise it will force this to "true".- See Also:
-
IS_DISABLED_PROTECT_INDEXES
private static final boolean IS_DISABLED_PROTECT_INDEXESthe protect indexes flag is on by default, but may be turned of via setting the property. This is overridden if a report is requested or the exception detection is on. -
arrayLengthFeatOffset
private static final int arrayLengthFeatOffset- See Also:
-
arrayContentOffset
private static final int arrayContentOffset- See Also:
-
DEFAULT_USE_FS_CACHE
private static final boolean DEFAULT_USE_FS_CACHE- See Also:
-
svd
-
indexRepository
FSIndexRepositoryImpl indexRepository -
mySofaRef
private int mySofaRefThe heap address of the sofa FS for this view, or -1 if the sofa FS is for the initial view, or 0 if there is no sofa FS - for instance, in the "base cas" -
jcas
-
isUsedJcasCache
private final boolean isUsedJcasCache
-
-
Constructor Details
-
CASImpl
-
CASImpl
CASImpl(TypeSystemImpl typeSystem, int initialHeapSize, boolean useFSCache, boolean useJcasCache) -
CASImpl
public CASImpl()Constructor. Use only if you want to use the low-level APIs. -
CASImpl
public CASImpl(int initialHeapSize, boolean useJcasCache) -
CASImpl
-
CASImpl
-
-
Method Details
-
addbackSingle
void addbackSingle(int fsAddr) -
resetAddbackSingleInUse
void resetAddbackSingleInUse() -
getAddbackSingle
FSsTobeAddedback.FSsTobeAddedbackSingle getAddbackSingle() -
featureCodesInIndexKeysAdd
void featureCodesInIndexKeysAdd(int featCode) -
maybeClearCacheNotInIndex
void maybeClearCacheNotInIndex(int fsAddr) -
setCacheNotInIndex
public void setCacheNotInIndex(int fsAddr) Called by feature setters which know the FS is not in any index to bypass any index corruption checking, e.g., CasCopier Internal use only- Parameters:
fsAddr
- the address of the feature structure
-
getStringList
-
setCAS
-
refreshView
-
checkInternalCodes
- Throws:
CASAdminException
-
enableReset
public void enableReset(boolean flag) Description copied from interface:CASMgr
Enable/disable resetting the CAS withCAS.reset()
.- Specified by:
enableReset
in interfaceCASMgr
- Parameters:
flag
- true to enable reset
-
getTypeSystem
Description copied from interface:CAS
Return the type system of this CAS instance.- Specified by:
getTypeSystem
in interfaceCAS
- Returns:
- The type system, or
null
if none is available.
-
getConstraintFactory
Description copied from interface:CAS
Get a constraint factory. A constraint factory is a simple way of creatingFSMatchConstraints
.- Specified by:
getConstraintFactory
in interfaceCAS
- Returns:
- A constraint factory to create new FS constraints.
-
createFS
Description copied from interface:CAS
Create a new FeatureStructure. -
ll_createFSAnnotCheck
public int ll_createFSAnnotCheck(int typeCode) -
createArrayFS
Description copied from interface:CAS
Create a new feature structure array.- Specified by:
createArrayFS
in interfaceCAS
- Parameters:
length
- The length of the array.- Returns:
- The new array.
-
createIntArrayFS
Description copied from interface:CAS
Create a new int array.- Specified by:
createIntArrayFS
in interfaceCAS
- Parameters:
length
- The length of the array.- Returns:
- The new array.
-
createFloatArrayFS
Description copied from interface:CAS
Create a new int array.- Specified by:
createFloatArrayFS
in interfaceCAS
- Parameters:
length
- The length of the array.- Returns:
- The new array.
-
createStringArrayFS
Description copied from interface:CAS
Create a new String array.- Specified by:
createStringArrayFS
in interfaceCAS
- Parameters:
length
- The length of the array.- Returns:
- The new array.
-
checkArrayPreconditions
- Throws:
CASRuntimeException
-
isBackwardCompatibleCas
public boolean isBackwardCompatibleCas() -
getBaseSofaCount
int getBaseSofaCount() -
getSofaIndexRepository
-
getSofaIndexRepository
-
setSofaIndexRepository
-
setSofaIndexRepository
-
createSofa
Deprecated.Description copied from interface:CAS
Create a Subject of Analysis. The new sofaFS is automatically added to the SofaIndex.- Specified by:
createSofa
in interfaceCAS
- Parameters:
sofaID
- -mimeType
- -- Returns:
- The sofaFS.
-
createSofa
-
createInitialSofa
-
registerInitialSofa
void registerInitialSofa() -
isInitialSofaCreated
boolean isInitialSofaCreated() -
addSofa
-
getSofa
Deprecated.Description copied from interface:CAS
Get sofaFS for given Subject of Analysis ID. -
getSofa
-
getSofa
-
ll_getSofaNum
public int ll_getSofaNum(int sofaRef) -
ll_getSofaID
-
ll_getSofaDataString
-
getBaseCAS
-
getSofaIterator
Description copied from interface:CAS
Get iterator for all SofaFS in the CAS.- Specified by:
getSofaIterator
in interfaceCAS
- Returns:
- an iterator over SofaFS.
-
setSofaFeat
public void setSofaFeat(int addr, int sofa) -
getSofaFeat
public int getSofaFeat(int addr) -
getSofaRef
public int getSofaRef() -
getSofaDataStream
-
createFilteredIterator
public <T extends FeatureStructure> FSIterator<T> createFilteredIterator(FSIterator<T> it, FSMatchConstraint cons) Description copied from interface:CAS
Create an iterator over structures satisfying a given constraint. Constraints are described in the javadocs forConstraintFactory
and related classes.- Specified by:
createFilteredIterator
in interfaceCAS
- Type Parameters:
T
- - the type of the Feature Structure- Parameters:
it
- The input iterator.cons
- The constraint specifying what structures should be returned.- Returns:
- An iterator over FSs.
-
commitTypeSystem
public void commitTypeSystem() -
setLocalFsGenerators
-
createIndexRepository
private void createIndexRepository() -
getIndexRepositoryMgr
- Specified by:
getIndexRepositoryMgr
in interfaceCASMgr
- Returns:
- a writable version of the index repository. Note that the type system must be committed before this method can be called.
-
commitFS
Deprecated.- Parameters:
fs
- -
-
createFeaturePath
Description copied from interface:CAS
Create a feature path. This is mainly useful for creatingFSMatchConstraints
.- Specified by:
createFeaturePath
in interfaceCAS
- Returns:
- A new, empty feature path.
-
getTypeSystemMgr
Description copied from interface:CASMgr
Return a writable version of the type system. This may be used to add new types and features.- Specified by:
getTypeSystemMgr
in interfaceCASMgr
- Returns:
- A writable version of the type system.
- See Also:
-
reset
public void reset()Description copied from interface:CAS
Reset the CAS, emptying it of all content. Feature structures and iterators will no longer be valid. Note: this method may only be called from an application. Calling it from an annotator will trigger a runtime exception. -
resetView
private void resetView() -
resetNoQuestions
public void resetNoQuestions() -
flush
Deprecated.Usereset()
instead.Description copied from interface:CASMgr
Flush this CAS instance of all transient data. This will delete all feature structures, but not the type system, the indexes etc. Call before processing a new document. -
getIndexRepository
Description copied from interface:CAS
Get the index repository.- Specified by:
getIndexRepository
in interfaceCAS
- Returns:
- The index repository, or
null
if none is available.
-
getBaseIndexRepository
FSIndexRepository getBaseIndexRepository() -
addSofaFsToIndex
-
registerView
-
reinit
-
fs2listIterator
Description copied from interface:CAS
Wrap a standard JavaListIterator
around an FSListIterator. Use if you feel more comfortable with java style iterators.- Specified by:
fs2listIterator
in interfaceCAS
- Type Parameters:
T
- The type of FeatureStructure- Parameters:
it
- TheFSListIterator
to be wrapped.- Returns:
- An equivalent
ListIterator
. - See Also:
-
getCAS
Description copied from interface:CASMgr
Return a non-admin version of the CAS. -
resetStringTable
void resetStringTable() -
initFSClassRegistry
private void initFSClassRegistry() -
getFSClassRegistry
-
reinit
-
clearTrackingMarks
private void clearTrackingMarks() -
reinit
void reinit(int[] heapMetadata, int[] heapArray, String[] stringTable, int[] fsIndex, byte[] byteHeapArray, short[] shortHeapArray, long[] longHeapArray) -
reinit
--------------------------------------------------------------------- see Blob Format in CASSerializer This reads in and deserializes CAS data from a stream. Byte swapping may be needed if the blob is from C++ -- C++ blob serialization writes data in native byte order.- Parameters:
istream
- -- Returns:
- -
- Throws:
CASRuntimeException
- wraps IOException
-
maybeAddBackAndRemoveFs
for Deserialization of Delta, when updating existing FSs, If the heap addr is for the next FS, re-add the previous one to those indexes where it was removed, and then maybe remove the new one (and remember which views to re-add to).- Parameters:
heapAddr
-
-
findCorrespondingFs
-
getNextFsHeapAddr
private int getNextFsHeapAddr(int fsAddr) -
readLong
- Throws:
IOException
-
readInt
- Throws:
IOException
-
readShort
- Throws:
IOException
-
reinitIndexedFSs
void reinitIndexedFSs(int[] fsIndex) -
reinitDeltaIndexedFSs
void reinitDeltaIndexedFSs(int[] fsIndex) Adds the SofaFSs to the base view Assumes "cas" refers to the base cas Processes "adds", "removes" and "reindexes" for all views- Parameters:
fsIndex
- - array of fsRefs and counts, for sofas, and all views
-
getIndexedFSs
int[] getIndexedFSs() -
getDeltaIndexedFSs
-
createStringTableFromArray
-
mapName
-
createFS
This is your link from the low-level API to the high-level API. Use this method to create a FeatureStructure object from an address. Not that the reverse is not supported by public APIs (i.e., there is currently no way to get at the address of a FeatureStructure. Maybe we will need to change that.- Type Parameters:
T
- The Java class associated with this feature structure- Parameters:
addr
- The address of the feature structure to be created.- Returns:
- A FeatureStructure object. Note that no checking whatsoever is done on the input address. There is really no way of finding out which addresses in the valid address space actually represent feature structures, and which don't.
-
ll_getArraySize
public int ll_getArraySize(int arrayFsRef) Description copied from interface:LowLevelCAS
Get the size of an array.- Specified by:
ll_getArraySize
in interfaceLowLevelCAS
- Parameters:
arrayFsRef
- The array reference.- Returns:
- The size of the array.
-
getArrayStartAddress
public final int getArrayStartAddress(int addr) Get the heap address of the first cell of this array.- Parameters:
addr
- The address of the array.- Returns:
- The address where the first cell of the array is located.
-
getArrayValue
public int getArrayValue(int addr, int index) Get a specific value out of an array.- Parameters:
addr
- The address of the array.index
- The index of the value we're interested in.- Returns:
- The value at
index
. - Throws:
ArrayIndexOutOfBoundsException
- -
-
setArrayValue
Set an array value.- Parameters:
addr
- The address of the array.index
- The index we want to set.value
- The value we want to set.- Throws:
ArrayIndexOutOfBoundsException
-
setArrayValueFromString
-
copyToArray
void copyToArray(int addr, int sourceOffset, int[] dest, int destOffset, int length) Copy the contents of an array to an externally provided array.- Parameters:
addr
- The address of the source array.sourceOffset
- The offset we want to start copying at.dest
- The destination array.destOffset
- An offset into the destination array.length
- The number of items to copy.
-
copyFromArray
void copyFromArray(int[] src, int srcOffset, int addr, int destOffset, int length) Copy the contents of an input array into a CAS array.- Parameters:
src
- The array to copy from.srcOffset
- An offset into the source from where to start copying.addr
- The address of the array we're copying to.destOffset
- Where to start copying into the destination array.length
- How many elements to copy.
-
getTypeCode
public int getTypeCode(int fsAddr) -
copyFeatures
- Throws:
CASRuntimeException
-
getHeapValue
public int getHeapValue(int addr) Get the value of an address on the heap.- Parameters:
addr
- The target address.- Returns:
- The value at the address.
-
setFeatureValue
public void setFeatureValue(int addr, int feat, int val) This is the common point where all sets of values in the heap come through It implements the check for invalid feature setting and potentially the addback. Set the value of a feature of a FS.- Parameters:
addr
- The address of the FS.feat
- The code of the feature.val
- The new value for the feature.- Throws:
ArrayIndexOutOfBoundsException
- If the feature is not a legal feature, or it is not appropriate for the type at the address.
-
setFeatureValueNoIndexCorruptionCheck
void setFeatureValueNoIndexCorruptionCheck(int addr, int feat, int val) Set the value of a feature of a FS without checking for index corruption (typically because the feature isn't one that can be used as a key, or the context is one where the FS is being created, and is guaranteed not to be in any index (yet))- Parameters:
addr
- The address of the FS.feat
- The code of the feature.val
- The new value for the feature.- Throws:
ArrayIndexOutOfBoundsException
- If the feature is not a legal feature, or it is not appropriate for the type at the address.
-
setFeatureValueNotJournaled
void setFeatureValueNotJournaled(int addr, int feat, int val) Set the value of a feature in the FS without journaling (because it's for a new FS above the mark)- Parameters:
addr
- The address of the FS.feat
- The code of the feature.val
- The new value for the feature.- Throws:
ArrayIndexOutOfBoundsException
- If the feature is not a legal feature, or it is not appropriate for the type at the address.
-
setStringValue
-
setFloatValue
public void setFloatValue(int addr, int feat, float f) -
getFeatureValue
public int getFeatureValue(int addr, int feat) -
getStringValue
-
getFloatValue
public float getFloatValue(int addr, int feat) -
getFloatValue
public float getFloatValue(int addr) -
setFeatureValue
public void setFeatureValue(int addr, int feat, byte v) -
getByteValue
public byte getByteValue(int addr, int feat) -
setFeatureValue
public void setFeatureValue(int addr, int feat, boolean v) -
getBooleanValue
public boolean getBooleanValue(int addr, int feat) -
setFeatureValue
public void setFeatureValue(int addr, int feat, short s) -
getShortValue
public short getShortValue(int addr, int feat) -
setFeatureValue
public void setFeatureValue(int addr, int feat, long s) -
getLongValue
public long getLongValue(int addr, int feat) -
setFeatureValue
public void setFeatureValue(int addr, int feat, float f) -
setFeatureValue
public void setFeatureValue(int addr, int feat, double s) -
getDoubleValue
public double getDoubleValue(int addr, int feat) -
getFeatureValueAsString
-
setFeatureValueFromString
-
int2float
public static final float int2float(int i) -
float2int
public static final int float2int(float f) -
long2double
public static final double long2double(long l) -
double2long
public static final long double2long(double d) -
getTypeSystemImpl
-
getStringForCode
-
isCreatableType
final boolean isCreatableType(int typeCode) Check if this is a regular type (i.e., not an array or a basic type).- Parameters:
typeCode
- The code to check.- Returns:
true
ifftypeCode
is a type for which a regular FS can be generated.- Throws:
NullPointerException
- IftypeCode
is not a type code.
-
addString
-
isStringType
-
isAbstractArrayType
-
isArrayType
-
isIntArrayType
-
isFloatArrayType
-
isStringArrayType
-
isBooleanArrayType
-
isByteArrayType
-
isShortArrayType
-
isLongArrayType
-
isDoubleArrayType
-
isFSArrayType
-
isIntType
-
isFloatType
-
isStringType
public boolean isStringType(int type) -
isByteType
-
isBooleanType
-
isShortType
-
isLongType
-
isDoubleType
-
isAbstractArrayType
public boolean isAbstractArrayType(int type) -
isArrayType
public boolean isArrayType(int type) -
isIntArrayType
public boolean isIntArrayType(int type) -
isFloatArrayType
public boolean isFloatArrayType(int type) -
isStringArrayType
public boolean isStringArrayType(int type) -
isByteArrayType
public boolean isByteArrayType(int type) -
isBooleanArrayType
public boolean isBooleanArrayType(int type) -
isShortArrayType
public boolean isShortArrayType(int type) -
isLongArrayType
public boolean isLongArrayType(int type) -
isDoubleArrayType
public boolean isDoubleArrayType(int type) -
isFSArrayType
public boolean isFSArrayType(int type) -
isIntType
public boolean isIntType(int type) -
isFloatType
public boolean isFloatType(int type) -
isByteType
public boolean isByteType(int type) -
isBooleanType
public boolean isBooleanType(int type) -
isShortType
public boolean isShortType(int type) -
isLongType
public boolean isLongType(int type) -
isDoubleType
public boolean isDoubleType(int type) -
getHeap
-
getByteHeap
ByteHeap getByteHeap() -
getShortHeap
ShortHeap getShortHeap() -
getLongHeap
LongHeap getLongHeap() -
getStringHeap
StringHeap getStringHeap() -
getFeatureOffset
public int getFeatureOffset(int feat) -
setupTSDefault
-
setTypeFinal
-
initCASIndexes
Description copied from interface:CASMgr
Install the standard built-in indexes into the base CAS- Specified by:
initCASIndexes
in interfaceCASMgr
- Throws:
CASException
- if an error occurs- See Also:
-
getStringTable
-
getView
-
getCurrentView
Description copied from interface:CAS
Get the Cas view that the current component should use. This should only be used by single-view components.- Specified by:
getCurrentView
in interfaceCAS
- Returns:
- the Cas view specified for the current component by Sofa mapping. Defaults to _InitialView if there is no Sofa mapping.
-
getJCas
Description copied from interface:CAS
Get the JCas for this CAS.- Specified by:
getJCas
in interfaceCAS
- Returns:
- The JCas for this CAS.
- Throws:
CASException
- -
-
getExistingJCas
Internal use only- Returns:
- corresponding JCas, assuming it exists
-
getJCas
Description copied from interface:CAS
Create a JCas view for a Sofa. Note: as of UIMA v2.0, can be replaced with getView(sofaFS).getJCas().- Specified by:
getJCas
in interfaceCAS
- Parameters:
aSofa
- a Sofa feature structure in this CAS.- Returns:
- The JCas view for the given Sofa.
- Throws:
CASException
- -
-
getJCas
Deprecated.Description copied from interface:CAS
Create a JCas view for a Sofa. Note: this is provided for convenience. It is equivalent togetView(aSofaID).getJCas()
.- Specified by:
getJCas
in interfaceCAS
- Parameters:
aSofaID
- the ID of a Sofa defined in this CAS- Returns:
- The view for the Sofa with ID
aSofaID
. - Throws:
CASException
- if no Sofa with the given ID exists in this CAS
-
getViewFromSofaNbr
-
setViewForSofaNbr
-
getInitialView
CAS getInitialView() -
createView
Description copied from interface:CAS
Create a view and its underlying Sofa (subject of analysis). The view provides access to the Sofa data and the index repository that contains metadata (annotations and other feature structures) pertaining to that Sofa.This method creates the underlying Sofa feature structure, but does not set the Sofa data. Setting ths Sofa data must be done by calling
CAS.setSofaDataArray(FeatureStructure, String)
,CAS.setSofaDataString(String, String)
orCAS.setSofaDataURI(String, String)
on the CAS view returned by this method.- Specified by:
createView
in interfaceCAS
- Parameters:
aSofaID
- the local name, before any sofa name mapping is done, for this view (note: this is the same as the associated Sofa name).- Returns:
- The view corresponding to this local name.
-
getView
Description copied from interface:CAS
Get the view for a Sofa (subject of analysis). The view provides access to the Sofa data and the index repository that contains metadata (annotations and other feature structures) pertaining to that Sofa. -
getView
Description copied from interface:CAS
Get the view for a Sofa (subject of analysis). The view provides access to the Sofa data and the index repository that contains metadata (annotations and other feature structures) pertaining to that Sofa. -
isSofaView
boolean isSofaView(int sofaAddr) -
verifySofaNameUniqueIfDeserializedViewAdded
-
ll_getTypeSystem
Description copied from interface:LowLevelCAS
Get the low-level version of the type system object. It provides access to the low-level type and feature codes you need to use the data creation and access APIs.- Specified by:
ll_getTypeSystem
in interfaceLowLevelCAS
- Returns:
- The low-level type system.
-
ll_getIndexRepository
Description copied from interface:LowLevelCAS
Get the low-level version of the index repository. Use it to gain access to low-level indexes, and thus, low-level iterators.- Specified by:
ll_getIndexRepository
in interfaceLowLevelCAS
- Returns:
- A low-level version of the index repository.
-
checkLowLevelParams
private final void checkLowLevelParams(int fsRef, int domType, int ranType, int feat) -
checkLowLevelParams
private final void checkLowLevelParams(int fsRef, int domType, int feat) -
checkDomTypeConditions
private final void checkDomTypeConditions(int domTypeCode, int featCode) -
checkTypingConditions
Check the range is appropriate for this type/feature. Throws LowLevelException if it isn't.- Parameters:
domType
- domain typeranType
- range typefeat
- feature
-
checkTypingConditions
private final void checkTypingConditions(int domTypeCode, int ranTypeCode, int featCode) -
checkFsRan
- Throws:
LowLevelException
-
checkFeature
private final void checkFeature(int featureCode) -
checkTypeAt
private final void checkTypeAt(int typeCode, int fsRef) -
checkFsRef
final void checkFsRef(int fsRef) -
ll_isRefType
public final boolean ll_isRefType(int typeCode) Description copied from interface:LowLevelCAS
Checks if the type code is that of a reference type (anything that's not a basic type, currently Integer, String and Float).- Specified by:
ll_isRefType
in interfaceLowLevelCAS
- Parameters:
typeCode
- The type code to check.- Returns:
true
ifftypeCode
is the type code of a reference type.
-
ll_getTypeClass
public final int ll_getTypeClass(int typeCode) Description copied from interface:LowLevelCAS
Determine the type class of a type. This is useful for generic CAS exploiters to determine what kind of data they're looking at. The type classes currently defined are:TYPE_CLASS_INVALID
-- Not a valid type code.TYPE_CLASS_INT
-- Integer type.TYPE_CLASS_FLOAT
-- Float type.TYPE_CLASS_STRING
-- String type.TYPE_CLASS_BOOLEAN
-- Boolean type.TYPE_CLASS_BYTE
-- Byte type.TYPE_CLASS_SHORT
-- Short type.TYPE_CLASS_LONG
-- Long type.TYPE_CLASS_DOUBLE
-- Double type.TYPE_CLASS_INTARRAY
-- Integer array.TYPE_CLASS_FLOATARRAY
-- Float array.TYPE_CLASS_STRINGARRAY
-- String array.TYPE_CLASS_BOOLEANARRAY
-- Boolean array.TYPE_CLASS_BYTEARRAY
-- Byte array.TYPE_CLASS_SHORTARRAY
-- Short array.TYPE_CLASS_LONGARRAY
-- Long array.TYPE_CLASS_DOUBLEARRAY
-- Double array.TYPE_CLASS_FSARRAY
-- FS array.TYPE_CLASS_FS
-- FS type, i.e., all other types, including all user-defined types.
- Specified by:
ll_getTypeClass
in interfaceLowLevelCAS
- Parameters:
typeCode
- The type code.- Returns:
- A type class for the type code.
TYPE_CLASS_INVALID
if the type code argument does not represent a valid type code.
-
ll_createFS
public final int ll_createFS(int typeCode) Description copied from interface:LowLevelCAS
Create a new FS on the heap.- Specified by:
ll_createFS
in interfaceLowLevelCAS
- Parameters:
typeCode
- The low-level code of the type of the FS that should be created. If thetypeCode
is not a valid type code, the results of this call are undefined.- Returns:
- The reference of the newly created FS.
-
ll_createFS
public final int ll_createFS(int typeCode, boolean doCheck) Description copied from interface:LowLevelCAS
Create a new FS on the heap.- Specified by:
ll_createFS
in interfaceLowLevelCAS
- Parameters:
typeCode
- The low-level code of the type of the FS that should be created. If thetypeCode
is not a valid type code and the type check flag is not set, the results of this call are undefined.doCheck
- -- Returns:
- The reference of the newly created FS.
-
createTempArray
public int createTempArray(int type, int len) Create a temporary (i.e., per document) array FS on the heap.- Parameters:
type
- The type code of the array to be created.len
- The length of the array to be created.- Returns:
- -
- Throws:
ArrayIndexOutOfBoundsException
- Iftype
is not a type.
-
ll_createArray
public int ll_createArray(int typeCode, int arrayLength) Description copied from interface:LowLevelCAS
Create a new array.- Specified by:
ll_createArray
in interfaceLowLevelCAS
- Parameters:
typeCode
- The type code of the array type. If this is not a valid array type code, the behavior of this call is undefined. Only works for arrays where a value is kept in the main heap (use other ll_createXxxArray for boolean, byte, short, long, and double)arrayLength
- The length of the array to be created.- Returns:
- The address of the newly created array.
-
ll_createAuxArray
public int ll_createAuxArray(int typeCode, int arrayLength) -
ll_createByteArray
public int ll_createByteArray(int arrayLength) - Specified by:
ll_createByteArray
in interfaceLowLevelCAS
-
ll_createBooleanArray
public int ll_createBooleanArray(int arrayLength) - Specified by:
ll_createBooleanArray
in interfaceLowLevelCAS
-
ll_createShortArray
public int ll_createShortArray(int arrayLength) - Specified by:
ll_createShortArray
in interfaceLowLevelCAS
-
ll_createLongArray
public int ll_createLongArray(int arrayLength) - Specified by:
ll_createLongArray
in interfaceLowLevelCAS
-
ll_createDoubleArray
public int ll_createDoubleArray(int arrayLength) - Specified by:
ll_createDoubleArray
in interfaceLowLevelCAS
-
ll_createArray
public int ll_createArray(int typeCode, int arrayLength, boolean doChecks) Description copied from interface:LowLevelCAS
Create a new array.- Specified by:
ll_createArray
in interfaceLowLevelCAS
- Parameters:
typeCode
- The type code of the array to be created.arrayLength
- The length of the array to be created.doChecks
- Switch to turn on various sanity checks.- Returns:
- The address of the newly created array.
-
isCreatableArrayType
private final boolean isCreatableArrayType(int typeCode) -
ll_getFSRef
Description copied from interface:LowLevelCAS
Get the low-level reference from an existing FS object. Use this API if you already have a FS object from somewhere, and want to apply low-level APIs to it.- Specified by:
ll_getFSRef
in interfaceLowLevelCAS
- Parameters:
fsImpl
- The FS object for which we want the reference.- Returns:
- The low-level reference of the FS object parameter.
-
ll_getFSForRef
Description copied from interface:LowLevelCAS
Return a FS object that corresponds to a low-level reference. Note that this must be a valid reference that has been obtained from the low-level APIs. If the input reference parameter does not represent a valid reference, the results of this call are undefined.- Specified by:
ll_getFSForRef
in interfaceLowLevelCAS
- Type Parameters:
T
- the Java class for the Feature Structure- Parameters:
fsRef
- The FS reference.- Returns:
- A FS object corresponding to the input reference.
-
ll_getIntValue
public final int ll_getIntValue(int fsRef, int featureCode) Description copied from interface:LowLevelCAS
Get the value of an integer valued feature.- Specified by:
ll_getIntValue
in interfaceLowLevelCAS
- Parameters:
fsRef
- The reference to the FS from which to obtain the feature value.featureCode
- The low-level code of the feature whose value is to be returned.- Returns:
- The value of the feature.
-
ll_getIntValueFeatOffset
public final int ll_getIntValueFeatOffset(int fsRef, int featureOffset) -
ll_getFloatValue
public final float ll_getFloatValue(int fsRef, int featureCode) Description copied from interface:LowLevelCAS
Get the value of a float valued feature.- Specified by:
ll_getFloatValue
in interfaceLowLevelCAS
- Parameters:
fsRef
- The reference to the FS from which to obtain the feature value.featureCode
- The low-level code of the feature whose value is to be returned.- Returns:
- The value of the feature.
-
ll_getStringValue
Description copied from interface:LowLevelCAS
Get the value of a string valued feature.- Specified by:
ll_getStringValue
in interfaceLowLevelCAS
- Parameters:
fsRef
- The reference to the FS from which to obtain the feature value.featureCode
- The low-level code of the feature whose value is to be returned.- Returns:
- The value of the feature.
-
ll_getStringValueFeatOffset
-
ll_getRefValue
public final int ll_getRefValue(int fsRef, int featureCode) Description copied from interface:LowLevelCAS
Get the value of a FS reference valued feature.- Specified by:
ll_getRefValue
in interfaceLowLevelCAS
- Parameters:
fsRef
- The reference to the FS from which to obtain the feature value.featureCode
- The low-level code of the feature whose value is to be returned.- Returns:
- The value of the feature.
-
ll_getRefValueFeatOffset
public final int ll_getRefValueFeatOffset(int fsRef, int featureOffset) -
ll_getIntValue
public final int ll_getIntValue(int fsRef, int featureCode, boolean doTypeChecks) Description copied from interface:LowLevelCAS
Get the value of an integer valued feature.- Specified by:
ll_getIntValue
in interfaceLowLevelCAS
- Parameters:
fsRef
- The reference to the FS from which to obtain the feature value.featureCode
- The low-level code of the feature whose value is to be returned.doTypeChecks
- Switch to turn on type checking.- Returns:
- The value of the feature.
-
ll_getFloatValue
public final float ll_getFloatValue(int fsRef, int featureCode, boolean doTypeChecks) Description copied from interface:LowLevelCAS
Get the value of a float valued feature.- Specified by:
ll_getFloatValue
in interfaceLowLevelCAS
- Parameters:
fsRef
- The reference to the FS from which to obtain the feature value.featureCode
- The low-level code of the feature whose value is to be returned.doTypeChecks
- Switch to turn on type checking.- Returns:
- The value of the feature.
-
ll_getStringValue
Description copied from interface:LowLevelCAS
Get the value of a string valued feature.- Specified by:
ll_getStringValue
in interfaceLowLevelCAS
- Parameters:
fsRef
- The reference to the FS from which to obtain the feature value.featureCode
- The low-level code of the feature whose value is to be returned.doTypeChecks
- Switch to turn on type checking.- Returns:
- The value of the feature.
-
ll_getRefValue
public final int ll_getRefValue(int fsRef, int featureCode, boolean doTypeChecks) Description copied from interface:LowLevelCAS
Get the value of a FS reference valued feature.- Specified by:
ll_getRefValue
in interfaceLowLevelCAS
- Parameters:
fsRef
- The reference to the FS from which to obtain the feature value.featureCode
- The low-level code of the feature whose value is to be returned.doTypeChecks
- Switch to turn on type checking.- Returns:
- The value of the feature.
-
ll_getAnnotBegin
public int ll_getAnnotBegin(int fsRef) -
ll_getAnnotEnd
public int ll_getAnnotEnd(int fsRef) -
checkForInvalidFeatureSetting
private boolean checkForInvalidFeatureSetting(int fsRef, int featureCode) This is the method all normal FS feature "setters" call before doing the set operation.The binary deserializers bypass these setters, and directly update the heap values, so they have a different impl to avoid index corruption.
It may do nothing (for performance, it needs to be enabled by a JVM property).
If enabled, it will check if the update may corrupt any index in any view. The check tests whether the feature is being used as a key in one or more indexes and if the FS is in one or more corruptable view indexes.
If true, then:
- it may remove and remember (for later adding-back) the FS from all corruptable indexes (bag indexes are not corruptable via updating, so these are skipped). The addback occurs later either via an explicit call to do so, or the end of a protectIndex block, or. (if autoIndexProtect is enabled) after the individual feature update is completed.
- it may give a WARN level message to the log. This enables users to implement their own optimized handling of this for "high performance" applications which do not want the overhead of runtime checking.
- Parameters:
fsRef
- - the FS to test if it is in the indexesfeatureCode
- - the feature being tested- Returns:
- true if something may need to be added back
-
featModWhileInIndexReport
private void featModWhileInIndexReport(int fsRef, int featureCode) -
maybeAddback
private void maybeAddback(int fsRef) Do the individual feat update addback if a) not in a block mode, and b) running with auto protect indexes c) not in block-single mode if running in block mode, the add back is delayed until the end of the block- Parameters:
fsRef
- the fs to add back
-
removeFromCorruptableIndexAnyView
A conditional remove, depends on the featCode being used as a key Skip tests if the FS is known not to be in the indexes in any view- Parameters:
fsRef
- the fstoBeAdded
- the place to record removal actionsfeatCode
- the feature code to test if it's used as a key in some index- Returns:
- true if the fs was removed
-
removeFromCorruptableIndexAnyView
Remove the fsRef from any corruptable index in any view, and remember per view whether it was actually in the index.- Parameters:
fsRef
- -toBeAdded
- -- Returns:
- true if it was removed (one or more times)
-
removeFromCorruptableIndexAnyViewSetCache
-
removeAndRecord
remove a FS from corruptable indexes in this view- Parameters:
fsRef
- the fs to be removedir
- the viewtoBeAdded
- the place to record how many times it was in the index, per view- Returns:
- true if it was removed, false if it wasn't in any corruptable index.
-
ll_setIntValue
public final void ll_setIntValue(int fsRef, int featureCode, int value) Description copied from interface:LowLevelCAS
Set the value of an integer feature.- Specified by:
ll_setIntValue
in interfaceLowLevelCAS
- Parameters:
fsRef
- The reference of the FS on which the feature should be set.featureCode
- The low-level feature code for the feature that should be set.value
- The value to be assigned to the feature.
-
ll_setFloatValue
public final void ll_setFloatValue(int fsRef, int featureCode, float value) Description copied from interface:LowLevelCAS
Set the value of a float feature.- Specified by:
ll_setFloatValue
in interfaceLowLevelCAS
- Parameters:
fsRef
- The reference of the FS on which the feature should be set.featureCode
- The low-level feature code for the feature that should be set.value
- The value to be assigned to the feature.
-
ll_setStringValue
Description copied from interface:LowLevelCAS
Set the value of a string feature.- Specified by:
ll_setStringValue
in interfaceLowLevelCAS
- Parameters:
fsRef
- The reference of the FS on which the feature should be set.featureCode
- The low-level feature code for the feature that should be set.value
- The value to be assigned to the feature.
-
ll_setRefValue
public final void ll_setRefValue(int fsRef, int featureCode, int value) Description copied from interface:LowLevelCAS
Set the value of a FS reference feature.- Specified by:
ll_setRefValue
in interfaceLowLevelCAS
- Parameters:
fsRef
- The reference of the FS on which the feature should be set.featureCode
- The low-level feature code for the feature that should be set.value
- The value to be assigned to the feature.
-
ll_setIntValue
public final void ll_setIntValue(int fsRef, int featureCode, int value, boolean doTypeChecks) Description copied from interface:LowLevelCAS
Set the value of an integer feature.- Specified by:
ll_setIntValue
in interfaceLowLevelCAS
- Parameters:
fsRef
- The reference of the FS on which the feature should be set.featureCode
- The low-level feature code for the feature that should be set.value
- The value to be assigned to the feature.doTypeChecks
- Switch to turn on type checking.
-
ll_setFloatValue
public final void ll_setFloatValue(int fsRef, int featureCode, float value, boolean doTypeChecks) Description copied from interface:LowLevelCAS
Set the value of a float feature.- Specified by:
ll_setFloatValue
in interfaceLowLevelCAS
- Parameters:
fsRef
- The reference of the FS on which the feature should be set.featureCode
- The low-level feature code for the feature that should be set.value
- The value to be assigned to the feature.doTypeChecks
- Switch to turn on type checking.
-
ll_setStringValue
Description copied from interface:LowLevelCAS
Set the value of a string feature.- Specified by:
ll_setStringValue
in interfaceLowLevelCAS
- Parameters:
fsRef
- The reference of the FS on which the feature should be set.featureCode
- The low-level feature code for the feature that should be set.value
- The value to be assigned to the feature.doTypeChecks
- Switch to turn on type checking.
-
ll_setCharBufferValue
public final void ll_setCharBufferValue(int fsRef, int featureCode, char[] buffer, int start, int length, boolean doTypeChecks) - Specified by:
ll_setCharBufferValue
in interfaceLowLevelCAS
-
ll_setCharBufferValue
public final void ll_setCharBufferValue(int fsRef, int featureCode, char[] buffer, int start, int length) - Specified by:
ll_setCharBufferValue
in interfaceLowLevelCAS
-
ll_copyCharBufferValue
public int ll_copyCharBufferValue(int fsRef, int featureCode, char[] buffer, int start) - Specified by:
ll_copyCharBufferValue
in interfaceLowLevelCAS
-
ll_getCharBufferValueSize
public int ll_getCharBufferValueSize(int fsRef, int featureCode) - Specified by:
ll_getCharBufferValueSize
in interfaceLowLevelCAS
-
ll_setRefValue
public final void ll_setRefValue(int fsRef, int featureCode, int value, boolean doTypeChecks) Description copied from interface:LowLevelCAS
Set the value of a FS reference feature.- Specified by:
ll_setRefValue
in interfaceLowLevelCAS
- Parameters:
fsRef
- The reference of the FS on which the feature should be set.featureCode
- The low-level feature code for the feature that should be set.value
- The value to be assigned to the feature.doTypeChecks
- Switch to turn on type checking.
-
ll_getIntArrayValue
public final int ll_getIntArrayValue(int fsRef, int position) Description copied from interface:LowLevelCAS
Get the value of an array at a certain position.- Specified by:
ll_getIntArrayValue
in interfaceLowLevelCAS
- Parameters:
fsRef
- The reference to the array FS.position
- The position whose value should be returned.- Returns:
- The value at
position
.
-
ll_getFloatArrayValue
public final float ll_getFloatArrayValue(int fsRef, int position) Description copied from interface:LowLevelCAS
Get the value of a float array at a certain position.- Specified by:
ll_getFloatArrayValue
in interfaceLowLevelCAS
- Parameters:
fsRef
- The reference to the array FS.position
- The position whose value should be returned.- Returns:
- The value at
position
.
-
ll_getStringArrayValue
Description copied from interface:LowLevelCAS
Get the value of a string array at a certain position.- Specified by:
ll_getStringArrayValue
in interfaceLowLevelCAS
- Parameters:
fsRef
- The reference to the array FS.position
- The position whose value should be returned.- Returns:
- The value at
position
.
-
ll_getRefArrayValue
public final int ll_getRefArrayValue(int fsRef, int position) Description copied from interface:LowLevelCAS
Get the value of a FS reference array at a certain position.- Specified by:
ll_getRefArrayValue
in interfaceLowLevelCAS
- Parameters:
fsRef
- The reference to the array FS.position
- The position whose value should be returned.- Returns:
- The value at
position
.
-
throwAccessTypeError
private void throwAccessTypeError(int fsRef, int typeCode) -
checkArrayBounds
public final void checkArrayBounds(int fsRef, int pos) -
checkArrayBounds
public final void checkArrayBounds(int fsRef, int pos, int length) -
checkNonArrayConditions
private final void checkNonArrayConditions(int fsRef, int typeCode, int featureCode) -
checkFsRefConditions
private final void checkFsRefConditions(int fsRef, int featureCode) -
checkPrimitiveArrayConditions
private final void checkPrimitiveArrayConditions(int fsRef, int typeCode, int position) -
ll_getIntArrayValue
public final int ll_getIntArrayValue(int fsRef, int position, boolean doTypeChecks) Description copied from interface:LowLevelCAS
Get the value of an integer array at a certain position.- Specified by:
ll_getIntArrayValue
in interfaceLowLevelCAS
- Parameters:
fsRef
- The reference to the array FS.position
- The position whose value should be returned.doTypeChecks
- Switch to turn on type checking.- Returns:
- The value at
position
.
-
ll_getFloatArrayValue
public float ll_getFloatArrayValue(int fsRef, int position, boolean doTypeChecks) Description copied from interface:LowLevelCAS
Get the value of a float array at a certain position.- Specified by:
ll_getFloatArrayValue
in interfaceLowLevelCAS
- Parameters:
fsRef
- The reference to the array FS.position
- The position whose value should be returned.doTypeChecks
- Switch to turn on type checking.- Returns:
- The value at
position
.
-
ll_getStringArrayValue
Description copied from interface:LowLevelCAS
Get the value of a string array at a certain position.- Specified by:
ll_getStringArrayValue
in interfaceLowLevelCAS
- Parameters:
fsRef
- The reference to the array FS.position
- The position whose value should be returned.doTypeChecks
- Switch to turn on type checking.- Returns:
- The value at
position
.
-
ll_getRefArrayValue
public int ll_getRefArrayValue(int fsRef, int position, boolean doTypeChecks) Description copied from interface:LowLevelCAS
Get the value of a FS reference array at a certain position.- Specified by:
ll_getRefArrayValue
in interfaceLowLevelCAS
- Parameters:
fsRef
- The reference to the array FS.position
- The position whose value should be returned.doTypeChecks
- Switch to turn on type checking.- Returns:
- The value at
position
.
-
ll_setIntArrayValue
public void ll_setIntArrayValue(int fsRef, int position, int value, boolean doTypeChecks) Description copied from interface:LowLevelCAS
Set the value of an integer array at a certain position.- Specified by:
ll_setIntArrayValue
in interfaceLowLevelCAS
- Parameters:
fsRef
- The FS reference of the array.position
- The position whose value will be changed.value
- The new value.doTypeChecks
- Switch to turn on type and bounds checking.
-
ll_setFloatArrayValue
public void ll_setFloatArrayValue(int fsRef, int position, float value, boolean doTypeChecks) Description copied from interface:LowLevelCAS
Set the value of an integer array at a certain position.- Specified by:
ll_setFloatArrayValue
in interfaceLowLevelCAS
- Parameters:
fsRef
- The FS reference of the array.position
- The position whose value will be changed.value
- The new value.doTypeChecks
- Switch to turn on type and bounds checking.
-
ll_setStringArrayValue
Description copied from interface:LowLevelCAS
Set the value of an integer array at a certain position.- Specified by:
ll_setStringArrayValue
in interfaceLowLevelCAS
- Parameters:
fsRef
- The FS reference of the array.position
- The position whose value will be changed.value
- The new value.doTypeChecks
- Switch to turn on type and bounds checking.
-
ll_setRefArrayValue
public void ll_setRefArrayValue(int fsRef, int position, int value, boolean doTypeChecks) Description copied from interface:LowLevelCAS
Set the value of an integer array at a certain position.- Specified by:
ll_setRefArrayValue
in interfaceLowLevelCAS
- Parameters:
fsRef
- The FS reference of the array.position
- The position whose value will be changed.value
- The new value.doTypeChecks
- Switch to turn on type and bounds checking.
-
ll_setIntArrayValue
public void ll_setIntArrayValue(int fsRef, int position, int value) Description copied from interface:LowLevelCAS
Set the value of an integer array at a certain position.- Specified by:
ll_setIntArrayValue
in interfaceLowLevelCAS
- Parameters:
fsRef
- The FS reference of the array.position
- The position whose value will be changed.value
- The new value.
-
ll_setFloatArrayValue
public void ll_setFloatArrayValue(int fsRef, int position, float value) Description copied from interface:LowLevelCAS
Set the value of an integer array at a certain position.- Specified by:
ll_setFloatArrayValue
in interfaceLowLevelCAS
- Parameters:
fsRef
- The FS reference of the array.position
- The position whose value will be changed.value
- The new value.
-
ll_setStringArrayValue
Description copied from interface:LowLevelCAS
Set the value of an integer array at a certain position.- Specified by:
ll_setStringArrayValue
in interfaceLowLevelCAS
- Parameters:
fsRef
- The FS reference of the array.position
- The position whose value will be changed.value
- The new value.
-
ll_setRefArrayValue
public void ll_setRefArrayValue(int fsRef, int position, int value) Description copied from interface:LowLevelCAS
Set the value of an integer array at a certain position.- Specified by:
ll_setRefArrayValue
in interfaceLowLevelCAS
- Parameters:
fsRef
- The FS reference of the array.position
- The position whose value will be changed.value
- The new value.
-
ll_getFSRefType
public int ll_getFSRefType(int fsRef) Description copied from interface:LowLevelCAS
Get the type code for a FS reference. No bounds checks are performed. IffsRef
is not a fs reference, the results are undefined. There is also a checked version of this call, which will give better error messages in case of problems.- Specified by:
ll_getFSRefType
in interfaceLowLevelCAS
- Parameters:
fsRef
- The FS reference.- Returns:
- The type code for the FS reference; a return value of
0
means that the fsRef is invalid, i.e.,NULL_FS_REF
(but see remarks on bounds checking for this method).
-
ll_getFSRefType
public int ll_getFSRefType(int fsRef, boolean doChecks) Description copied from interface:LowLevelCAS
Get the type code for a FS reference.- Specified by:
ll_getFSRefType
in interfaceLowLevelCAS
- Parameters:
fsRef
- The FS reference.doChecks
- Check fsRef for out-of-range errors. If this switch is not set, and the input reference is not a valid reference, the results are undefined.- Returns:
- The type code for the FS reference; a return value of
0
means that the fsRef is invalid, i.e.,NULL_FS_REF
(but see remarks on bounds checking for this method).
-
getLowLevelCAS
Description copied from interface:CAS
Get an instance of the low-level CAS. Low-level and regular CAS can be used in parallel, all data is always contained in both.Note: This is for internal use.
- Specified by:
getLowLevelCAS
in interfaceCAS
- Returns:
- A low-level CAS.
- See Also:
-
size
public int size()Description copied from interface:CAS
Estimate the memory consumption of this CAS instance (in bytes). -
getJCasClassLoader
Description copied from interface:CASMgr
Gets the ClassLoader that should be used by the JCas to load the generated FS cover classes for this CAS.- Specified by:
getJCasClassLoader
in interfaceCASMgr
- Returns:
- the JCas ClassLoder for this CAS
-
setJCasClassLoader
Description copied from interface:CASMgr
Sets the ClassLoader that should be used by the JCas to load the generated FS cover classes for this CAS.- Specified by:
setJCasClassLoader
in interfaceCASMgr
- Parameters:
classLoader
- the JCas ClassLoder for this CAS
-
switchClassLoaderLockCas
-
switchClassLoaderLockCasCL
-
switchClassLoader
-
usingBaseClassLoader
public boolean usingBaseClassLoader() -
restoreClassLoaderUnlockCas
public void restoreClassLoaderUnlockCas() -
createFeatureValuePath
Description copied from interface:CAS
Create a feature-value path from a string.- Specified by:
createFeatureValuePath
in interfaceCAS
- Parameters:
featureValuePath
- String representation of the feature-value path.- Returns:
- Feature-value path object.
- Throws:
CASRuntimeException
- If the input string is not well-formed.
-
setOwner
Description copied from class:AbstractCas_ImplBase
Provides this CAS with a handle to the CASOwner that owns it. This is called by the framework when a CAS instance is created. This handle is used to implement the release() method by returning the CAS to its CasOwner.- Overrides:
setOwner
in classAbstractCas_ImplBase
- Parameters:
aCasOwner
- -
-
release
public void release()Description copied from class:AbstractCas_ImplBase
Default implementation that returns this CAS to its CasManager by callingCasOwner.releaseCas(AbstractCas)
.- Specified by:
release
in interfaceAbstractCas
- Overrides:
release
in classAbstractCas_ImplBase
-
createByteArrayFS
Description copied from interface:CAS
Create a new Byte array.- Specified by:
createByteArrayFS
in interfaceCAS
- Parameters:
length
- The length of the array.- Returns:
- The new array.
- Throws:
CASRuntimeException
-
createBooleanArrayFS
Description copied from interface:CAS
Create a new Boolean array.- Specified by:
createBooleanArrayFS
in interfaceCAS
- Parameters:
length
- The length of the array.- Returns:
- The new array.
- Throws:
CASRuntimeException
-
createShortArrayFS
Description copied from interface:CAS
Create a new Short array.- Specified by:
createShortArrayFS
in interfaceCAS
- Parameters:
length
- The length of the array.- Returns:
- The new array.
- Throws:
CASRuntimeException
-
createLongArrayFS
Description copied from interface:CAS
Create a new Long array.- Specified by:
createLongArrayFS
in interfaceCAS
- Parameters:
length
- The length of the array.- Returns:
- The new array.
- Throws:
CASRuntimeException
-
createDoubleArrayFS
Description copied from interface:CAS
Create a new Double array.- Specified by:
createDoubleArrayFS
in interfaceCAS
- Parameters:
length
- The length of the array.- Returns:
- The new array.
- Throws:
CASRuntimeException
-
ll_getByteValue
public byte ll_getByteValue(int fsRef, int featureCode) - Specified by:
ll_getByteValue
in interfaceLowLevelCAS
-
ll_getByteValue
public byte ll_getByteValue(int fsRef, int featureCode, boolean doTypeChecks) - Specified by:
ll_getByteValue
in interfaceLowLevelCAS
-
ll_getBooleanValue
public boolean ll_getBooleanValue(int fsRef, int featureCode) - Specified by:
ll_getBooleanValue
in interfaceLowLevelCAS
-
ll_getBooleanValue
public boolean ll_getBooleanValue(int fsRef, int featureCode, boolean doTypeChecks) - Specified by:
ll_getBooleanValue
in interfaceLowLevelCAS
-
ll_getShortValue
public short ll_getShortValue(int fsRef, int featureCode) - Specified by:
ll_getShortValue
in interfaceLowLevelCAS
-
ll_getShortValue
public short ll_getShortValue(int fsRef, int featureCode, boolean doTypeChecks) - Specified by:
ll_getShortValue
in interfaceLowLevelCAS
-
ll_getLongValue
public long ll_getLongValue(int offset) -
ll_getLongValue
public long ll_getLongValue(int fsRef, int featureCode) - Specified by:
ll_getLongValue
in interfaceLowLevelCAS
-
ll_getLongValueFeatOffset
public long ll_getLongValueFeatOffset(int fsRef, int featureOffset) -
ll_getLongValue
public long ll_getLongValue(int fsRef, int featureCode, boolean doTypeChecks) - Specified by:
ll_getLongValue
in interfaceLowLevelCAS
-
ll_getDoubleValue
public double ll_getDoubleValue(int fsRef, int featureCode) - Specified by:
ll_getDoubleValue
in interfaceLowLevelCAS
-
ll_getDoubleValueFeatOffset
public double ll_getDoubleValueFeatOffset(int fsRef, int featureOffset) -
ll_getDoubleValue
public double ll_getDoubleValue(int fsRef, int featureCode, boolean doTypeChecks) - Specified by:
ll_getDoubleValue
in interfaceLowLevelCAS
-
ll_setBooleanValue
public void ll_setBooleanValue(int fsRef, int featureCode, boolean value) - Specified by:
ll_setBooleanValue
in interfaceLowLevelCAS
-
ll_setBooleanValue
public void ll_setBooleanValue(int fsRef, int featureCode, boolean value, boolean doTypeChecks) - Specified by:
ll_setBooleanValue
in interfaceLowLevelCAS
-
ll_setByteValue
public final void ll_setByteValue(int fsRef, int featureCode, byte value) - Specified by:
ll_setByteValue
in interfaceLowLevelCAS
-
ll_setByteValue
public void ll_setByteValue(int fsRef, int featureCode, byte value, boolean doTypeChecks) - Specified by:
ll_setByteValue
in interfaceLowLevelCAS
-
ll_setShortValue
public final void ll_setShortValue(int fsRef, int featureCode, short value) - Specified by:
ll_setShortValue
in interfaceLowLevelCAS
-
ll_setShortValue
public void ll_setShortValue(int fsRef, int featureCode, short value, boolean doTypeChecks) - Specified by:
ll_setShortValue
in interfaceLowLevelCAS
-
ll_setLongValue
public void ll_setLongValue(int fsRef, int featureCode, long value) - Specified by:
ll_setLongValue
in interfaceLowLevelCAS
-
ll_setLongValue
public void ll_setLongValue(int fsRef, int featureCode, long value, boolean doTypeChecks) - Specified by:
ll_setLongValue
in interfaceLowLevelCAS
-
ll_setDoubleValue
public void ll_setDoubleValue(int fsRef, int featureCode, double value) - Specified by:
ll_setDoubleValue
in interfaceLowLevelCAS
-
ll_setDoubleValue
public void ll_setDoubleValue(int fsRef, int featureCode, double value, boolean doTypeChecks) - Specified by:
ll_setDoubleValue
in interfaceLowLevelCAS
-
ll_getByteArrayValue
public byte ll_getByteArrayValue(int fsRef, int position) - Specified by:
ll_getByteArrayValue
in interfaceLowLevelCAS
-
ll_getByteArrayValue
public byte ll_getByteArrayValue(int fsRef, int position, boolean doTypeChecks) - Specified by:
ll_getByteArrayValue
in interfaceLowLevelCAS
-
ll_getBooleanArrayValue
public boolean ll_getBooleanArrayValue(int fsRef, int position) - Specified by:
ll_getBooleanArrayValue
in interfaceLowLevelCAS
-
ll_getBooleanArrayValue
public boolean ll_getBooleanArrayValue(int fsRef, int position, boolean doTypeChecks) - Specified by:
ll_getBooleanArrayValue
in interfaceLowLevelCAS
-
ll_getShortArrayValue
public short ll_getShortArrayValue(int fsRef, int position) - Specified by:
ll_getShortArrayValue
in interfaceLowLevelCAS
-
ll_getShortArrayValue
public short ll_getShortArrayValue(int fsRef, int position, boolean doTypeChecks) - Specified by:
ll_getShortArrayValue
in interfaceLowLevelCAS
-
ll_getLongArrayValue
public long ll_getLongArrayValue(int fsRef, int position) - Specified by:
ll_getLongArrayValue
in interfaceLowLevelCAS
-
ll_getLongArrayValue
public long ll_getLongArrayValue(int fsRef, int position, boolean doTypeChecks) - Specified by:
ll_getLongArrayValue
in interfaceLowLevelCAS
-
ll_getDoubleArrayValue
public double ll_getDoubleArrayValue(int fsRef, int position) - Specified by:
ll_getDoubleArrayValue
in interfaceLowLevelCAS
-
ll_getDoubleArrayValue
public double ll_getDoubleArrayValue(int fsRef, int position, boolean doTypeChecks) - Specified by:
ll_getDoubleArrayValue
in interfaceLowLevelCAS
-
ll_setByteArrayValue
public void ll_setByteArrayValue(int fsRef, int position, byte value) - Specified by:
ll_setByteArrayValue
in interfaceLowLevelCAS
-
ll_setByteArrayValue
public void ll_setByteArrayValue(int fsRef, int position, byte value, boolean doTypeChecks) - Specified by:
ll_setByteArrayValue
in interfaceLowLevelCAS
-
ll_setBooleanArrayValue
public void ll_setBooleanArrayValue(int fsRef, int position, boolean b) - Specified by:
ll_setBooleanArrayValue
in interfaceLowLevelCAS
-
ll_setBooleanArrayValue
public void ll_setBooleanArrayValue(int fsRef, int position, boolean value, boolean doTypeChecks) - Specified by:
ll_setBooleanArrayValue
in interfaceLowLevelCAS
-
ll_setShortArrayValue
public void ll_setShortArrayValue(int fsRef, int position, short value) - Specified by:
ll_setShortArrayValue
in interfaceLowLevelCAS
-
ll_setShortArrayValue
public void ll_setShortArrayValue(int fsRef, int position, short value, boolean doTypeChecks) - Specified by:
ll_setShortArrayValue
in interfaceLowLevelCAS
-
ll_setLongArrayValue
public void ll_setLongArrayValue(int fsRef, int position, long value) - Specified by:
ll_setLongArrayValue
in interfaceLowLevelCAS
-
ll_setLongArrayValue
public void ll_setLongArrayValue(int fsRef, int position, long value, boolean doTypeChecks) - Specified by:
ll_setLongArrayValue
in interfaceLowLevelCAS
-
ll_setDoubleArrayValue
public void ll_setDoubleArrayValue(int fsRef, int position, double d) - Specified by:
ll_setDoubleArrayValue
in interfaceLowLevelCAS
-
ll_setDoubleArrayValue
public void ll_setDoubleArrayValue(int fsRef, int position, double value, boolean doTypeChecks) - Specified by:
ll_setDoubleArrayValue
in interfaceLowLevelCAS
-
isAnnotationType
-
isSubtypeOfAnnotationBaseType
public boolean isSubtypeOfAnnotationBaseType(int t) - Parameters:
t
- the type code to test- Returns:
- true if that type is subsumed by AnnotationBase type
-
createAnnotation
Description copied from interface:CAS
Create a new annotation. Note that you still need to insert the annotation into the index repository yourself.- Specified by:
createAnnotation
in interfaceCAS
- Parameters:
type
- The type of the annotation.begin
- The start of the annotation.end
- The end of the annotation.- Returns:
- A new annotation object.
-
ll_createAnnotation
public int ll_createAnnotation(int typeCode, int begin, int end) -
getAnnotationIndex
The generic spec T extends AnnotationFS (rather than AnnotationFS) allows the method JCasImpl getAnnotationIndex to return Annotation instead of AnnotationFS- Specified by:
getAnnotationIndex
in interfaceCAS
- Type Parameters:
T
- the Java class associated with the annotation index- Returns:
- the annotation index
-
getAnnotationIndex
Description copied from interface:CAS
Get the standard annotation index restricted to a specific annotation type.- Specified by:
getAnnotationIndex
in interfaceCAS
- Type Parameters:
T
- the topmost Java class corresponding to the type- Parameters:
type
- The annotation type the index is restricted to.- Returns:
- The standard annotation index, restricted to
type
. - See Also:
-
getAnnotationType
Description copied from interface:CAS
Get the type object for the annotation type.- Specified by:
getAnnotationType
in interfaceCAS
- Returns:
- The annotation type.
- See Also:
-
getEndFeature
Description copied from interface:CAS
Get the feature object for the annotation end feature.- Specified by:
getEndFeature
in interfaceCAS
- Returns:
- The annotation end feature.
- See Also:
-
getBeginFeature
Description copied from interface:CAS
Get the feature object for the annotation begin feature.- Specified by:
getBeginFeature
in interfaceCAS
- Returns:
- The annotation begin feature.
- See Also:
-
createDocumentAnnotation
-
ll_createDocumentAnnotation
public int ll_createDocumentAnnotation(int length) -
ll_createDocumentAnnotationNoIndex
public int ll_createDocumentAnnotationNoIndex(int begin, int end) -
updateDocumentAnnotation
public void updateDocumentAnnotation() -
getDocumentAnnotation
Generic issue: The returned document annotation could be either an instance of DocumentAnnotation or an instance of AnnotationImpl - the Java cover class used for annotations when JCas is not being used.- Specified by:
getDocumentAnnotation
in interfaceCAS
- Type Parameters:
T
- the Java class for the document annotation. Could be the JCas cover class or FeatureStructure- Returns:
- The document annotation, or
null
if there is none. The return value is the JCas cover class or the plain Java cover class for FeatureStructures if JCas is not in use.
-
ll_getDocumentAnnotation
public int ll_getDocumentAnnotation()- Returns:
- the fs addr of the document annotation found via the index, or 0 if not there
-
getDocumentLanguage
Description copied from interface:CAS
Gets the language code for this document from the language feature of the special instance of the DocumentationAnnotation associated with this CAS.- Specified by:
getDocumentLanguage
in interfaceCAS
- Returns:
- language identifier
-
getDocumentText
Description copied from interface:CAS
Get the document text.- Specified by:
getDocumentText
in interfaceCAS
- Returns:
- The text being analyzed, or
null
if not set.
-
getSofaDataString
Description copied from interface:CAS
Get the Sofa Data String (a.k.a. the document text).- Specified by:
getSofaDataString
in interfaceCAS
- Returns:
- The Sofa data string, or
null
if not set.
-
getSofaDataArray
Description copied from interface:CAS
Get the Sofa data array.- Specified by:
getSofaDataArray
in interfaceCAS
- Returns:
- The Sofa Data being analyzed, or
null
if not set.
-
getSofaDataURI
Description copied from interface:CAS
Get the Sofa data array.- Specified by:
getSofaDataURI
in interfaceCAS
- Returns:
- The Sofa URI being analyzed, or
null
if not set.
-
getSofaDataStream
Description copied from interface:CAS
Get the Sofa data as a byte stream.- Specified by:
getSofaDataStream
in interfaceCAS
- Returns:
- A stream handle to the Sofa Data, or
null
if not set.
-
getSofaMimeType
Description copied from interface:CAS
Get the mime type of the Sofa data being analyzed.- Specified by:
getSofaMimeType
in interfaceCAS
- Returns:
- the mime type of the Sofa
-
getSofa
Description copied from interface:CAS
Get the Sofa feature structure associated with this CAS view. -
ll_getSofa
public int ll_getSofa()- Specified by:
ll_getSofa
in interfaceLowLevelCAS
- Returns:
- the addr of the sofaFS associated with this view, or 0
-
getViewName
Description copied from interface:CAS
Get the view name. The view name is the same as the name of the view's Sofa, retrieved by getSofa().getSofaID(), except for the initial View before its Sofa has been created.- Specified by:
getViewName
in interfaceCAS
- Returns:
- The name of the view
-
mySofaIsValid
private boolean mySofaIsValid() -
setDocTextFromDeserializtion
-
setDocumentLanguage
Description copied from interface:CAS
Sets the language for this document. This value sets the language feature of the special instance of DocumentAnnotation associated with this CAS.- Specified by:
setDocumentLanguage
in interfaceCAS
- Parameters:
languageCode
- -
-
setDocumentText
Description copied from interface:CAS
Set the document text. Once set, Sofa data is immutable, and cannot be set again until the CAS has been reset.- Specified by:
setDocumentText
in interfaceCAS
- Parameters:
text
- The text to be analyzed.
-
setSofaDataString
Description copied from interface:CAS
Set the document text. Once set, Sofa data is immutable, and cannot be set again until the CAS has been reset.- Specified by:
setSofaDataString
in interfaceCAS
- Parameters:
text
- The text to be analyzed.mime
- The mime type of the data- Throws:
CASRuntimeException
- If the Sofa data has already been set.
-
setSofaDataArray
Description copied from interface:CAS
Set the Sofa data as an ArrayFS. Once set, Sofa data is immutable, and cannot be set again until the CAS has been reset.- Specified by:
setSofaDataArray
in interfaceCAS
- Parameters:
array
- The ArrayFS to be analyzed.mime
- The mime type of the data- Throws:
CASRuntimeException
- If the Sofa data has already been set.
-
setSofaDataURI
Description copied from interface:CAS
Set the Sofa data as a URI. Once set, Sofa data is immutable, and cannot be set again until the CAS has been reset.- Specified by:
setSofaDataURI
in interfaceCAS
- Parameters:
uri
- The URI of the data to be analyzed.mime
- The mime type of the data- Throws:
CASRuntimeException
- If the Sofa data has already been set.
-
setCurrentComponentInfo
Description copied from interface:CAS
Informs the CAS of relevant information about the component that is currently processing it. This is called by the framework automatically; users do not need to call it.- Specified by:
setCurrentComponentInfo
in interfaceCAS
- Parameters:
info
- information about the component that is currently processing this CAS.
-
getCurrentComponentInfo
ComponentInfo getCurrentComponentInfo() -
addFsToIndexes
Description copied from interface:CAS
Add a feature structure to all appropriate indexes in the repository associated with this CAS View. If no indexes exist for the type of FS that you are adding, then a bag (unsorted) index will be automatically created.Important: after you have called
addFsToIndexes(...)
on a FS, do not change the values of any features used for indexing. If you do, the index will become corrupted and may be unusable. If you need to change an index feature value, first callremoveFsFromIndexes(...)
on the FS, change the feature values, then calladdFsToIndexes(...)
again.- Specified by:
addFsToIndexes
in interfaceCAS
- Parameters:
fs
- The Feature Structure to be added.- See Also:
-
removeFsFromIndexes
Description copied from interface:CAS
Remove a feature structure from all indexes in the repository associated with this CAS View. The remove operation removes the exact fs from the indexes, unlike operations such as moveTo which use the fs argument as a template. It is not an error if the FS is not present in the indexes.- Specified by:
removeFsFromIndexes
in interfaceCAS
- Parameters:
fs
- The Feature Structure to be removed.- See Also:
-
ll_getSofaCasView
- Specified by:
ll_getSofaCasView
in interfaceLowLevelCAS
- Parameters:
addr
- the heap address of a feature structure which is a subtype of AnnotationBase- Returns:
- the view associated with this FS where it could be indexed
-
getViewIterator
Description copied from interface:CAS
Get iterator over all views in this CAS. Each view provides access to Sofa data and the index repository that contains metadata (annotations and other feature structures) pertaining to that Sofa.- Specified by:
getViewIterator
in interfaceCAS
- Returns:
- an iterator which returns all views. Each object returned by the iterator is of type CAS.
-
getViewIterator
Description copied from interface:CAS
Get iterator over all views with the given name prefix. Each view provides access to Sofa data and the index repository that contains metadata (annotations and other feature structures) pertaining to that Sofa.When passed the prefix namePrefix, the iterator will return all views who name is either exactly equal to namePrefix or is of the form namePrefix
.
suffix, where suffix can be any String.- Specified by:
getViewIterator
in interfaceCAS
- Parameters:
localViewNamePrefix
- the local name prefix, before any sofa name mapping is done, for this view (note: this is the same as the associated Sofa name prefix).- Returns:
- an iterator which returns all views with the given name prefix. Each object returned by the iterator is of type CAS.
-
doUseJcasCache
public final boolean doUseJcasCache() -
protectIndexes
protectIndexes Within the scope of protectIndexes, feature updates are checked, and if found to be a key, and the FS is in a corruptable index, then the FS is removed from the indexes (in all necessary views) (perhaps multiple times if the FS was added to the indexes multiple times), and this removal is recorded on an new instance of FSsTobeReindexed appended to fssTobeAddedback. Later, when the protectIndexes is closed, the tobe items are added back to the indies.- Specified by:
protectIndexes
in interfaceCAS
- Returns:
- an object used to record things that need adding back
-
dropProtectIndexesLevel
void dropProtectIndexesLevel() -
addbackModifiedFSs
This design is to support normal operations where the addbacks could be nested It also handles cases where nested ones were inadvertently left open Three cases: 1) the addbacks are the last element in the stack - remove it from the stack 2) the addbacks are (no longer) in the list - leave stack alone 3) the addbacks are in the list but not at the end - remove it and all later ones If the "withProtectedindexes" approach is used, it guarantees proper nesting, but the Runnable can't throw checked exceptions. You can do your own try-finally blocks (or use the try with resources form in Java 8 to do a similar thing with no restrictions on what the body can contain.- Parameters:
addbacks
-
-
protectIndexes
Description copied from interface:CAS
Runs the code in the runnable inside a protection block, where any modifications to features done while in this block will be done in a way to protect any indexes which otherwise might become corrupted by the update action; the protection is achieved by temporarily removing the FS (if it is in the indexes), before the update happens. At the end of the block, affected indexes have any removed-under-the-covers FSs added back.- Specified by:
protectIndexes
in interfaceCAS
- Parameters:
r
- an inner block of code to be run with
-
createMarker
The current implementation only supports 1 marker call per CAS. Subsequent calls will throw an error. The design is intended to support (at some future point) multiple markers; for this to work, the intent is to extend the MarkerImpl to keep track of indexes into these IntVectors specifying where that marker starts/ends.- Specified by:
createMarker
in interfaceCAS
- Returns:
- a marker object.
-
errorMultipleMarkers
private void errorMultipleMarkers() -
logFSUpdate
-
getCurrentMark
-
getModifiedFSList
IntVector getModifiedFSList() -
getModifiedFSHeapAddrs
IntVector getModifiedFSHeapAddrs() -
getModifiedByteHeapAddrs
IntVector getModifiedByteHeapAddrs() -
getModifiedShortHeapAddrs
IntVector getModifiedShortHeapAddrs() -
getModifiedLongHeapAddrs
IntVector getModifiedLongHeapAddrs() -
toString
-
getCasResets
int getCasResets() -
getCasId
int getCasId()
-
reset()
instead.