public class FeatureStructureImplC extends Object implements FeatureStructureImpl
Modifier and Type | Class and Description |
---|---|
static class |
FeatureStructureImplC.PrintReferences |
Modifier and Type | Field and Description |
---|---|
CASImpl |
_casView
The view this Feature Structure was originally created in.
|
protected int |
_id |
static String |
DISABLE_RUNTIME_FEATURE_VALIDATION |
static String |
DISABLE_RUNTIME_FEATURE_VALUE_VALIDATION |
static boolean |
IS_ENABLE_RUNTIME_FEATURE_VALIDATION |
static boolean |
IS_ENABLE_RUNTIME_FEATURE_VALUE_VALIDATION |
static boolean |
IS_V2_PRETTY_PRINT |
static String |
V2_PRETTY_PRINT |
Modifier | Constructor and Description |
---|---|
|
FeatureStructureImplC() |
protected |
FeatureStructureImplC(int id)
For use in creating search keys
|
protected |
FeatureStructureImplC(JCasImpl jcasImpl)
For JCas use (done this way to allow "final")
The TypeImpl is derived from the JCas cover class name
|
protected |
FeatureStructureImplC(TypeImpl type,
CASImpl casView)
For non-JCas use, Internal Use Only, called by cas.createFS via generators
|
Modifier and Type | Method and Description |
---|---|
void |
_copyIntAndRefArraysEqTypesFrom(FeatureStructureImplC src)
copy int and ref data for two instances, each having the exact same type
|
void |
_copyIntAndRefArraysFrom(FeatureStructureImplC src) |
void |
_copyIntArrayEqTypesFrom(FeatureStructureImplC src) |
boolean |
_getBooleanValueNc(FeatureImpl fi) |
boolean |
_getBooleanValueNc(int adjOffset) |
byte |
_getByteValueNc(FeatureImpl feat) |
byte |
_getByteValueNc(int adjOffset) |
double |
_getDoubleValueNc(FeatureImpl fi) |
double |
_getDoubleValueNc(int adjOffset) |
protected FeatureImpl |
_getFeatFromAdjOffset(int adjOffset,
boolean isInInt) |
TOP |
_getFeatureValueNc(FeatureImpl feat) |
TOP |
_getFeatureValueNc(int adjOffset) |
float |
_getFloatValueNc(FeatureImpl fi) |
float |
_getFloatValueNc(int adjOffset) |
int |
_getIntLikeValue(SlotKinds.SlotKind slotKind,
FeatureImpl f)
for compressed form 4 - for getting the prev value of int-like slots
Uses unchecked forms for feature access
|
int |
_getIntValueNc(FeatureImpl feat) |
int |
_getIntValueNc(int adjOffset) |
long |
_getLongValueNc(FeatureImpl feat) |
long |
_getLongValueNc(int adjOffset) |
Object |
_getRefValueCommon(int adjOffset) |
short |
_getShortValueNc(FeatureImpl feat) |
short |
_getShortValueNc(int adjOffset) |
String |
_getStringValueNc(FeatureImpl feat) |
String |
_getStringValueNc(int adjOffset) |
int |
_getTypeCode()
starts with _
|
TypeImpl |
_getTypeImpl() |
CASImpl |
_getView() |
int |
_id()
return the unique (to this CAS) id of this feature structure
|
protected boolean |
_inSetSortedIndex() |
boolean |
_isJCasHashMapReserve() |
protected boolean |
_isPearTrampoline() |
<N extends TOP> |
_maybeGetBaseForPearFs()
Called to convert to the base FS from a Pear version
|
protected <N extends TOP> |
_maybeGetBaseForPearFs(N v)
Called when setting a FS value which might be a trampoline
|
<N extends TOP> |
_maybeGetPearFs() |
protected <N extends TOP> |
_maybeGetPearFs(N v)
Called when getting a FS value which might need to return a Pear context's trampoline
|
protected void |
_resetInSetSortedIndex()
All callers of this must insure fs is not indexed in **Any** View
|
void |
_setBooleanValueNcNj(FeatureImpl fi,
boolean v) |
void |
_setBooleanValueNcNj(int adjOffset,
boolean v) |
void |
_setBooleanValueNfc(int adjOffset,
boolean v) |
void |
_setByteValueNcNj(FeatureImpl fi,
byte v) |
void |
_setByteValueNcNj(int adjOffset,
byte v) |
void |
_setByteValueNfc(int adjOffset,
byte v) |
void |
_setDoubleValueNcNj(FeatureImpl fi,
double v) |
void |
_setDoubleValueNcNj(int adjOffset,
double v) |
protected void |
_setDoubleValueNfc(int adjOffset,
double v) |
void |
_setFeatureValueNcNj(FeatureImpl fi,
Object v) |
void |
_setFeatureValueNcNj(int adjOffset,
Object v) |
void |
_setFeatureValueNcWj(int adjOffset,
FeatureStructure v)
Nc - no check, Wj = with journaling if needed
|
void |
_setFloatValueNcNj(FeatureImpl fi,
float v) |
void |
_setFloatValueNcNj(int adjOffset,
float v) |
protected void |
_setFloatValueNfc(int adjOffset,
float v) |
protected void |
_setInSetSortedIndexed() |
void |
_setIntLikeValue(SlotKinds.SlotKind slotKind,
FeatureImpl fi,
int v)
Internal Use only
|
void |
_setIntLikeValueNcNj(SlotKinds.SlotKind slotKind,
FeatureImpl fi,
int v)
Internal Use only - no feature check, no journaling
|
protected void |
_setIntValueCJ(FeatureImpl fi,
int v)
All 3 checks
|
void |
_setIntValueNcNj(FeatureImpl fi,
int v) |
void |
_setIntValueNcNj(int adjOffset,
int v) |
void |
_setIntValueNfc(int adjOffset,
int v) |
protected void |
_setIntValueNfcCJ(int adjOffset,
int v)
2 checks, no feature check
|
protected void |
_setJCasHashMapReserve() |
protected void |
_setLongValueCJ(FeatureImpl fi,
long v)
All 3 checks for long
|
void |
_setLongValueNcNj(FeatureImpl fi,
long v) |
void |
_setLongValueNcNj(int adjOffset,
long v) |
void |
_setLongValueNfc(int adjOffset,
long v) |
protected void |
_setLongValueNfcCJ(FeatureImpl fi,
long v)
2 checks, no feature check
|
protected void |
_setPearTrampoline() |
protected void |
_setRefValueCJ(FeatureImpl fi,
Object v) |
void |
_setRefValueCommon(int adjOffset,
Object v) |
protected void |
_setRefValueCommonWj(FeatureImpl fi,
Object v) |
protected void |
_setRefValueNfcCJ(FeatureImpl fi,
Object v)
2 checks, no feature check
|
void |
_setShortValueNcNj(FeatureImpl fi,
short v) |
void |
_setShortValueNcNj(int adjOffset,
short v) |
void |
_setShortValueNfc(int adjOffset,
short v) |
void |
_setStringValueNcNj(FeatureImpl fi,
String v) |
void |
_setStringValueNcWj(int adjOffset,
String v)
Skips substring range checking, but maybe does journalling
|
void |
_setStringValueNfc(int adjOffset,
String v) |
protected void |
_setTypeImpl(TypeImpl ti) |
StringBuilder |
addStringOrPrimitive(StringBuilder sb,
FeatureImpl fi) |
void |
addToIndexes()
add the corresponding FeatureStructure to all Cas indexes in the view where this FS was created
|
void |
addToIndexes(CAS cas) |
void |
addToIndexes(JCas jcas)
add this FS to indexes in a specific view, perhaps different from the creation view
|
FeatureStructureImplC |
clone()
See http://www.javaworld.com/article/2076332/java-se/how-to-avoid-traps-and-correctly-override-methods-from-java-lang-object.html
for suggestions on avoiding bugs in implementing clone
Because we have final fields for _intData, _refData, and _id, we can't use clone.
|
static int |
compare(FeatureStructureImplC a,
FeatureStructureImplC b) |
boolean |
equals(Object obj)
A feature structure is equal to another feature structure iff it is identical in the underlying
representation.
|
int |
getAddress()
NOTE: Possible name collision
|
boolean |
getBooleanValue(Feature feat)
G E T T E R S
(The array getters are part of the Classes for the built-in arrays, here are only the non-array ones)
getXyzValue(Feature feat) - this is the standard from V2 plain API
- it does validity checking (normally) that the feature belongs to the type
getXyzValueNc(FeatureImpl feat) - skips the validity checking that the feature belongs to the type.
|
byte |
getByteValue(Feature feat)
Get the byte value of a feature.
|
CAS |
getCAS() |
CASImpl |
getCASImpl() |
double |
getDoubleValue(Feature feat)
Get the double value of a feature.
|
TOP |
getFeatureValue(Feature feat)
Get a feature value.
|
String |
getFeatureValueAsString(Feature feat)
Get the value of the feature as a string if the type of the feature is one of the primitive
type.
|
float |
getFloatValue(Feature feat)
Get the float value of a feature.
|
int |
getIntValue(Feature feat)
Get the int value of a feature.
|
long |
getLongValue(Feature feat)
Get the long value of a feature.
|
LowLevelCAS |
getLowLevelCas() |
short |
getShortValue(Feature feat)
Get the short value of a feature.
|
String |
getStringValue(Feature feat)
Get the string value under a feature.
|
Type |
getType()
Returns the UIMA TypeImpl value
|
int |
getTypeIndexID() |
int |
hashCode()
Will return a hash code that's consistent with equality, i.e., if two FSs are equal, they will
also return the same hash code.
|
void |
prettyPrint(int indent,
int incr,
StringBuffer buf,
boolean useShortNames) |
void |
prettyPrint(int indent,
int incr,
StringBuffer buf,
boolean useShortNames,
String s)
Deprecated.
use form with StringBuilder (not StringBuffer)
|
void |
prettyPrint(int indent,
int incr,
StringBuffer buf,
boolean useShortNames,
String s,
FeatureStructureImplC.PrintReferences printRefs)
Deprecated.
because uses StringBuffer, not builder, for version 2 compatibility only
|
void |
prettyPrint(int indent,
int incr,
StringBuilder buf,
boolean useShortNames) |
void |
prettyPrint(int indent,
int incr,
StringBuilder buf,
boolean useShortNames,
String s)
Top level, does computation of self-ref
Pretty prints this Feature Structure, no trailing nl
|
void |
prettyPrint(int indent,
int incr,
StringBuilder buf,
boolean useShortNames,
String s,
FeatureStructureImplC.PrintReferences printRefs) |
void |
prettyPrintShort(StringBuilder sb) |
void |
removeFromIndexes()
remove the corresponding FeatureStructure from all Cas indexes in the view where this FS was created
|
void |
removeFromIndexes(CAS cas)
remove this FS from indexes in a specific view, perhaps different from the view where this was created.
|
void |
removeFromIndexes(JCas jcas)
remove this FS from indexes in a specific view, perhaps different from the view where this was created.
|
void |
setBooleanValue(Feature feat,
boolean v)
Set the boolean value of a feature.
|
void |
setByteValue(Feature feat,
byte v)
Set the byte (8 bit) value of a feature.
|
void |
setDoubleValue(Feature feat,
double v)
Set the double value of a feature.
|
void |
setFeatureValue(Feature feat,
FeatureStructure v)
Set a feature value to another FS.
|
void |
setFeatureValueFromString(Feature feat,
String s)
Sets the value of a feature from a string input if the feature type is one of the primitive
types.
|
void |
setFloatValue(Feature feat,
float v)
Set the float value of a feature.
|
void |
setIntValue(Feature feat,
int v)
Set the int value of a feature.
|
void |
setLongValue(Feature feat,
long v)
Set the long (64 bit) value of a feature.
|
void |
setShortValue(Feature feat,
short v)
Set the short (16 bit) value of a feature.
|
void |
setStringValue(Feature feat,
String v)
Set the string value of a feature.
|
String |
toShortString() |
String |
toString() |
String |
toString(int indent) |
protected static int |
wrapGetIntCatchException(MethodHandle mh) |
finalize, getClass, notify, notifyAll, wait, wait, wait
getJCas
public static final String DISABLE_RUNTIME_FEATURE_VALIDATION
public static final boolean IS_ENABLE_RUNTIME_FEATURE_VALIDATION
public static final String DISABLE_RUNTIME_FEATURE_VALUE_VALIDATION
public static final boolean IS_ENABLE_RUNTIME_FEATURE_VALUE_VALIDATION
public static final String V2_PRETTY_PRINT
public static final boolean IS_V2_PRETTY_PRINT
protected final int _id
public final CASImpl _casView
public FeatureStructureImplC()
protected FeatureStructureImplC(int id)
id
- -protected FeatureStructureImplC(TypeImpl type, CASImpl casView)
casView
- -type
- -protected FeatureStructureImplC(JCasImpl jcasImpl)
jcasImpl
- - the view this is being created inpublic void addToIndexes()
public void addToIndexes(JCas jcas)
jcas
- the JCaspublic void addToIndexes(CAS cas)
public void removeFromIndexes()
public void removeFromIndexes(CAS cas)
cas
- the Caspublic void removeFromIndexes(JCas jcas)
jcas
- the Caspublic LowLevelCAS getLowLevelCas()
public final int getAddress()
getAddress
in interface FeatureStructure
public final int _id()
FeatureStructure
_id
in interface FeatureStructure
public Type getType()
getType
in interface FeatureStructure
public int _getTypeCode()
_getTypeCode
in interface FeatureStructure
public CASImpl _getView()
public void setBooleanValue(Feature feat, boolean v)
FeatureStructure
setBooleanValue
in interface FeatureStructure
feat
- The feature whose value we want to set.v
- The boolean value we're setting the feature to.public void _setBooleanValueNfc(int adjOffset, boolean v)
public final void _setBooleanValueNcNj(FeatureImpl fi, boolean v)
public final void _setBooleanValueNcNj(int adjOffset, boolean v)
public void setByteValue(Feature feat, byte v)
FeatureStructure
setByteValue
in interface FeatureStructure
feat
- The feature whose value we want to set.v
- The 8bit value we're setting the feature to.public void _setByteValueNfc(int adjOffset, byte v)
public void _setByteValueNcNj(FeatureImpl fi, byte v)
public void _setByteValueNcNj(int adjOffset, byte v)
public void setShortValue(Feature feat, short v)
FeatureStructure
setShortValue
in interface FeatureStructure
feat
- The feature whose value we want to set.v
- The short (16bit) value we're setting the feature to.public void _setShortValueNfc(int adjOffset, short v)
public void _setShortValueNcNj(FeatureImpl fi, short v)
public void _setShortValueNcNj(int adjOffset, short v)
public void setIntValue(Feature feat, int v)
FeatureStructure
setIntValue
in interface FeatureStructure
feat
- The feature whose value we want to set.v
- The int we're setting the feature to.public void _setIntValueNfc(int adjOffset, int v)
public void _setIntValueNcNj(FeatureImpl fi, int v)
public void _setIntValueNcNj(int adjOffset, int v)
public void setLongValue(Feature feat, long v)
FeatureStructure
setLongValue
in interface FeatureStructure
feat
- The feature whose value we want to set.v
- The long (64bit) value we're setting the feature to.public void _setLongValueNfc(int adjOffset, long v)
public void _setLongValueNcNj(FeatureImpl fi, long v)
public void _setLongValueNcNj(int adjOffset, long v)
public void setFloatValue(Feature feat, float v)
FeatureStructure
setFloatValue
in interface FeatureStructure
feat
- The feature whose value we want to set.v
- The float we're setting the feature to.protected void _setFloatValueNfc(int adjOffset, float v)
public void _setFloatValueNcNj(FeatureImpl fi, float v)
public void _setFloatValueNcNj(int adjOffset, float v)
public void setDoubleValue(Feature feat, double v)
FeatureStructure
setDoubleValue
in interface FeatureStructure
feat
- The feature whose value we want to set.v
- The double value we're setting the feature to.protected void _setDoubleValueNfc(int adjOffset, double v)
public void _setDoubleValueNcNj(FeatureImpl fi, double v)
public void _setDoubleValueNcNj(int adjOffset, double v)
public void setStringValue(Feature feat, String v)
FeatureStructure
setStringValue
in interface FeatureStructure
feat
- The feature whose value we want to set.v
- The string we're setting the feature to.public void _setStringValueNfc(int adjOffset, String v)
public void _setStringValueNcNj(FeatureImpl fi, String v)
public void _setStringValueNcWj(int adjOffset, String v)
adjOffset
- offsetv
- to setpublic void setFeatureValue(Feature feat, FeatureStructure v)
FeatureStructure
setFeatureValue
in interface FeatureStructure
feat
- The feature whose value should be set.v
- The value FS.public void _setFeatureValueNcNj(FeatureImpl fi, Object v)
public void _setFeatureValueNcNj(int adjOffset, Object v)
protected <N extends TOP> N _maybeGetBaseForPearFs(N v)
N
- the type of the FSv
- the FS to checkpublic <N extends TOP> N _maybeGetBaseForPearFs()
N
- the type of the FSprotected <N extends TOP> N _maybeGetPearFs(N v)
N
- the type of the FSv
- the FS to checkpublic <N extends TOP> N _maybeGetPearFs()
N
- the type of the FSpublic void _setFeatureValueNcWj(int adjOffset, FeatureStructure v)
adjOffset
- -v
- -public void setFeatureValueFromString(Feature feat, String s) throws CASRuntimeException
FeatureStructure
setFeatureValueFromString
in interface FeatureStructure
feat
- The feature whose value we want to set.s
- The string value that the feature will be set to.CASRuntimeException
- If feat
is not a primitive type or the value cannot be converted to
this type.protected void _setIntValueCJ(FeatureImpl fi, int v)
fi
- - the featurev
- - the valueprotected void _setLongValueCJ(FeatureImpl fi, long v)
fi
- - the featurev
- - the valueprotected void _setIntValueNfcCJ(int adjOffset, int v)
adjOffset
- - the feature offsetv
- - the valueprotected void _setLongValueNfcCJ(FeatureImpl fi, long v)
fi
- - the featurev
- - the valueprotected void _setRefValueCJ(FeatureImpl fi, Object v)
protected void _setRefValueNfcCJ(FeatureImpl fi, Object v)
fi
- - the featurev
- - the valuepublic boolean getBooleanValue(Feature feat)
getBooleanValue
in interface FeatureStructure
feat
- The feature whose value we want to get.0
if the value has not been set.public boolean _getBooleanValueNc(FeatureImpl fi)
public boolean _getBooleanValueNc(int adjOffset)
public byte getByteValue(Feature feat)
FeatureStructure
getByteValue
in interface FeatureStructure
feat
- The feature whose value we want to set.0
if the value has not been set.public byte _getByteValueNc(FeatureImpl feat)
public byte _getByteValueNc(int adjOffset)
public short getShortValue(Feature feat)
FeatureStructure
getShortValue
in interface FeatureStructure
feat
- The feature whose value we want to get.0
if the value has not been set.public short _getShortValueNc(FeatureImpl feat)
public short _getShortValueNc(int adjOffset)
public int getIntValue(Feature feat)
FeatureStructure
getIntValue
in interface FeatureStructure
feat
- The feature whose value we want to get.0
if the value has not been set.public int _getIntValueNc(FeatureImpl feat)
public int _getIntValueNc(int adjOffset)
public long getLongValue(Feature feat)
FeatureStructure
getLongValue
in interface FeatureStructure
feat
- The feature whose value we want to get.0
if the value has not been set.public long _getLongValueNc(FeatureImpl feat)
public long _getLongValueNc(int adjOffset)
public float getFloatValue(Feature feat)
FeatureStructure
getFloatValue
in interface FeatureStructure
feat
- The feature whose value we want to get.0.0
if the value has not been set.public float _getFloatValueNc(FeatureImpl fi)
public float _getFloatValueNc(int adjOffset)
public double getDoubleValue(Feature feat)
FeatureStructure
getDoubleValue
in interface FeatureStructure
feat
- The feature whose value we want to get.0
if the value has not been set.public double _getDoubleValueNc(FeatureImpl fi)
public double _getDoubleValueNc(int adjOffset)
public String getStringValue(Feature feat)
FeatureStructure
getStringValue
in interface FeatureStructure
feat
- The feature for which we want the value.null
if the value has not been set.public String _getStringValueNc(FeatureImpl feat)
public String _getStringValueNc(int adjOffset)
public TOP getFeatureValue(Feature feat)
FeatureStructure
getFeatureValue
in interface FeatureStructure
feat
- The feature whose value we want to get.null
if the value has not been set.public TOP _getFeatureValueNc(FeatureImpl feat)
public TOP _getFeatureValueNc(int adjOffset)
public CAS getCAS()
getCAS
in interface FeatureStructure
public CASImpl getCASImpl()
public FeatureStructureImplC clone() throws CASRuntimeException
clone
in interface FeatureStructure
clone
in class Object
CASRuntimeException
- (different from Object.clone()) if an exception occurspublic int hashCode()
FeatureStructure
hashCode
in interface FeatureStructure
hashCode
in class Object
public boolean equals(Object obj)
FeatureStructure
equals
in interface FeatureStructure
equals
in class Object
public String toString(int indent)
toString
in interface FeatureStructureImpl
public void prettyPrint(int indent, int incr, StringBuilder buf, boolean useShortNames)
prettyPrint
in interface FeatureStructureImpl
public void prettyPrint(int indent, int incr, StringBuffer buf, boolean useShortNames)
prettyPrint
in interface FeatureStructureImpl
@Deprecated public void prettyPrint(int indent, int incr, StringBuffer buf, boolean useShortNames, String s)
prettyPrint
in interface FeatureStructureImpl
indent
- the indent amountincr
- the amount the indent is increased for a levelbuf
- where the resulting string is builtuseShortNames
- true to use short names
- extra string to printpublic void prettyPrint(int indent, int incr, StringBuilder buf, boolean useShortNames, String s)
prettyPrint
in interface FeatureStructureImpl
indent
- the indent amountincr
- the amount the indent is increased for a levelbuf
- where the resulting string is builtuseShortNames
- true to use short names
- extra string to print@Deprecated public void prettyPrint(int indent, int incr, StringBuffer buf, boolean useShortNames, String s, FeatureStructureImplC.PrintReferences printRefs)
indent
- -incr
- -buf
- -useShortNames
- -s
- -printRefs
- -public void prettyPrint(int indent, int incr, StringBuilder buf, boolean useShortNames, String s, FeatureStructureImplC.PrintReferences printRefs)
public void prettyPrintShort(StringBuilder sb)
sb
- -public StringBuilder addStringOrPrimitive(StringBuilder sb, FeatureImpl fi)
public int getTypeIndexID()
public void _setIntLikeValue(SlotKinds.SlotKind slotKind, FeatureImpl fi, int v)
slotKind
- -fi
- -v
- -public void _setIntLikeValueNcNj(SlotKinds.SlotKind slotKind, FeatureImpl fi, int v)
slotKind
- -fi
- -v
- -public int _getIntLikeValue(SlotKinds.SlotKind slotKind, FeatureImpl f)
slotKind
- -f
- -public String getFeatureValueAsString(Feature feat)
FeatureStructure
getFeatureValueAsString
in interface FeatureStructure
feat
- The feature whose value we want to get and whose type is one of the primitive types.protected boolean _inSetSortedIndex()
protected void _setInSetSortedIndexed()
protected void _resetInSetSortedIndex()
protected void _setJCasHashMapReserve()
public boolean _isJCasHashMapReserve()
protected void _setPearTrampoline()
protected boolean _isPearTrampoline()
protected FeatureImpl _getFeatFromAdjOffset(int adjOffset, boolean isInInt)
public Object _getRefValueCommon(int adjOffset)
public void _setRefValueCommon(int adjOffset, Object v)
protected void _setRefValueCommonWj(FeatureImpl fi, Object v)
public void _copyIntAndRefArraysFrom(FeatureStructureImplC src)
src
- the FS to copy features frompublic void _copyIntAndRefArraysEqTypesFrom(FeatureStructureImplC src)
src
- the FS to copy features frompublic void _copyIntArrayEqTypesFrom(FeatureStructureImplC src)
src
- the FS to copy features frompublic String toShortString()
public final TypeImpl _getTypeImpl()
protected final void _setTypeImpl(TypeImpl ti)
public static int compare(FeatureStructureImplC a, FeatureStructureImplC b)
protected static final int wrapGetIntCatchException(MethodHandle mh)
Copyright © 2006–2021 The Apache Software Foundation. All rights reserved.