Class FeatureStructureImplC

  • All Implemented Interfaces:
    java.lang.Cloneable, FeatureStructure, FeatureStructureImpl
    Direct Known Subclasses:
    TOP

    public class FeatureStructureImplC
    extends java.lang.Object
    implements FeatureStructureImpl
    Feature structure implementation (for non JCas and JCas) Each FS has - int data - used for boolean, byte, short, int, long, float, double data -- long and double use 2 int slots - may be null if all slots are in JCas cover objects as fields - ref data - used for references to other Java objects, such as -- strings -- other feature structures -- arbitrary Java Objects - may be null if all slots are in JCas cover objects as fields - an id: an incrementing integer, starting at 1, per CAS, of all FSs created for that CAS - a ref to the casView where this FS was created - a ref to the TypeImpl for this class -- can't be static - may be multiple type systems in use
    • Field Detail

      • DISABLE_RUNTIME_FEATURE_VALIDATION

        public static final java.lang.String DISABLE_RUNTIME_FEATURE_VALIDATION
        See Also:
        Constant Field Values
      • IS_ENABLE_RUNTIME_FEATURE_VALIDATION

        public static final boolean IS_ENABLE_RUNTIME_FEATURE_VALIDATION
      • DISABLE_RUNTIME_FEATURE_VALUE_VALIDATION

        public static final java.lang.String DISABLE_RUNTIME_FEATURE_VALUE_VALIDATION
        See Also:
        Constant Field Values
      • IS_ENABLE_RUNTIME_FEATURE_VALUE_VALIDATION

        public static final boolean IS_ENABLE_RUNTIME_FEATURE_VALUE_VALIDATION
      • IS_V2_PRETTY_PRINT

        public static final boolean IS_V2_PRETTY_PRINT
      • traceFSs

        private static final boolean traceFSs
      • _BIT_IN_SET_SORTED_INDEX

        private static final int _BIT_IN_SET_SORTED_INDEX
        See Also:
        Constant Field Values
      • _BIT_JCASHASHMAP_RESERVE

        private static final int _BIT_JCASHASHMAP_RESERVE
        See Also:
        Constant Field Values
      • _intData

        private final int[] _intData
        Experiment: goal: speed up allocation and maybe improve locality of reference a) have _intData and _refData point to 1) for array sizes < 256, a common shared array used with an offset 2) for array sizes > 256, individual arrays as is the previous design case b) have accesses use an offset kept in the flags; allocate in blocks of 1k the larger, the less java object overhead per the larger, the less "breakage" waste the smaller, the better GC offset = 10 bits * 2 (one for int, one for ref) results: on 16-way processor (64 hyperthreaded cores), caused 2x slowdown, probably due to cache contention.
      • _refData

        private final java.lang.Object[] _refData
      • _id

        protected final int _id
      • _flags

        private int _flags
      • _casView

        public final CASImpl _casView
        The view this Feature Structure was originally created in. Feature Structures may be indexed in multiple views, or in no views. Also used to access other metadata including the type system
    • Constructor Detail

      • FeatureStructureImplC

        public FeatureStructureImplC()
      • FeatureStructureImplC

        protected FeatureStructureImplC​(int id)
        For use in creating search keys
        Parameters:
        id - -
      • FeatureStructureImplC

        protected FeatureStructureImplC​(TypeImpl type,
                                        CASImpl casView)
        For non-JCas use, Internal Use Only, called by cas.createFS via generators
      • FeatureStructureImplC

        protected FeatureStructureImplC​(JCasImpl jcasImpl)
        For JCas use (done this way to allow "final") The TypeImpl is derived from the JCas cover class name
        Parameters:
        jcasImpl - - the view this is being created in
      • FeatureStructureImplC

        protected FeatureStructureImplC​(JCasImpl jcasImpl,
                                        int aId)
        For temporary marker annotations. Does not assign an ID from the CAS ID generator and never retains the annotation. We also do not trace this annotation.
    • Method Detail

      • _allocIntData

        private int[] _allocIntData()
      • _allocRefData

        private java.lang.Object[] _allocRefData()
      • addToIndexes

        public void addToIndexes()
        add the corresponding FeatureStructure to all Cas indexes in the view where this FS was created
      • addToIndexes

        public void addToIndexes​(JCas jcas)
        add this FS to indexes in a specific view, perhaps different from the creation view
        Parameters:
        jcas - the JCas
      • addToIndexes

        public void addToIndexes​(CAS cas)
      • removeFromIndexes

        public void removeFromIndexes()
        remove the corresponding FeatureStructure from all Cas indexes in the view where this FS was created
      • removeFromIndexes

        public void removeFromIndexes​(CAS cas)
        remove this FS from indexes in a specific view, perhaps different from the view where this was created.
        Parameters:
        cas - the Cas
      • removeFromIndexes

        public void removeFromIndexes​(JCas jcas)
        remove this FS from indexes in a specific view, perhaps different from the view where this was created.
        Parameters:
        jcas - the Cas
      • getAddress

        public final int getAddress()
        NOTE: Possible name collision
        Specified by:
        getAddress in interface FeatureStructure
        Returns:
        the internal id of this fs - unique to this CAS, a positive int
      • _id

        public final int _id()
        Description copied from interface: FeatureStructure
        return the unique (to this CAS) id of this feature structure
        Specified by:
        _id in interface FeatureStructure
        Returns:
        the id
      • getType

        public Type getType()
        Returns the UIMA TypeImpl value
        Specified by:
        getType in interface FeatureStructure
        Returns:
        The type.
      • _getTypeCode

        public int _getTypeCode()
        starts with _
        Specified by:
        _getTypeCode in interface FeatureStructure
        Returns:
        the UIMA TypeImpl for this Feature Structure
      • _getView

        public CASImpl _getView()
      • checkFeatRange

        private void checkFeatRange​(Feature feat,
                                    java.lang.String shortRangeName)
        S E T T E R S 4 levels of checking: - check feature for validity (fv) -- this is skipped with feature comes from fs type info (internal calls) - check for setting something which could corrupt indexes (ci) -- this is skipped when the caller knows --- the FS is not in the index, perhaps because they just created it -- skipped when the range is not a valid index key - check for needing to log (journal) setting (jrnl) -- this is skipped when the caller knows --- no journalling is enabled or --- the FS is a new (above-the-line) FS - check the value is suitable -- this can be skipped if Java is doing the checking (via the type of the argument) -- done for string subtypes and Feature References --- skipped if the caller knows the value is OK (e.g., it is copying an existing FS) The jrnl and ic checks require the FeatureImpl. For setters using these checks, there are two versions: - one with the arg being the FeatureImpl (if it is available at the caller) and - one with the int offset (common code coverts this to the Feature Impl). all 4 checks are normally done by the standard API call in the FeatureStructure interface setXyzValue(Feature, value) Besides the standard API call, other setter methods have suffixes and prefixes to the setter name - prefix is "_" to avoid conflicting with existing other names - suffixes are: -- Nfc: skip feature validity checking, ( ! fv, jrnl, ci ) (int/Feat) -- NcNj: implies Nfc, ( ! fv, ! jrnl, ! ci ) (int/Feat) -- NcWj: implies Nfc, ( ! fv, jrnl, ! ci ) (int) The is for setters where value checking might be needed (i.e., Java checking isn't sufficient) -- NcNjNv: implies Nfc, skips all checks For JCas setters: convert offset to feature
      • setBooleanValue

        public void setBooleanValue​(Feature feat,
                                    boolean v)
        Description copied from interface: FeatureStructure
        Set the boolean value of a feature.
        Specified by:
        setBooleanValue in interface FeatureStructure
        Parameters:
        feat - The feature whose value we want to set.
        v - The boolean value we're setting the feature to.
      • _setBooleanValueNfc

        public void _setBooleanValueNfc​(int adjOffset,
                                        boolean v)
      • _setBooleanValueNcNj

        public final void _setBooleanValueNcNj​(FeatureImpl fi,
                                               boolean v)
      • _setBooleanValueNcNj

        public final void _setBooleanValueNcNj​(int adjOffset,
                                               boolean v)
      • setByteValue

        public void setByteValue​(Feature feat,
                                 byte v)
        Description copied from interface: FeatureStructure
        Set the byte (8 bit) value of a feature.
        Specified by:
        setByteValue in interface FeatureStructure
        Parameters:
        feat - The feature whose value we want to set.
        v - The 8bit value we're setting the feature to.
      • _setByteValueNfc

        public void _setByteValueNfc​(int adjOffset,
                                     byte v)
      • _setByteValueNcNj

        public void _setByteValueNcNj​(FeatureImpl fi,
                                      byte v)
      • _setByteValueNcNj

        public void _setByteValueNcNj​(int adjOffset,
                                      byte v)
      • setShortValue

        public void setShortValue​(Feature feat,
                                  short v)
        Description copied from interface: FeatureStructure
        Set the short (16 bit) value of a feature.
        Specified by:
        setShortValue in interface FeatureStructure
        Parameters:
        feat - The feature whose value we want to set.
        v - The short (16bit) value we're setting the feature to.
      • _setShortValueNfc

        public void _setShortValueNfc​(int adjOffset,
                                      short v)
      • _setShortValueNcNj

        public void _setShortValueNcNj​(FeatureImpl fi,
                                       short v)
      • _setShortValueNcNj

        public void _setShortValueNcNj​(int adjOffset,
                                       short v)
      • setIntValue

        public void setIntValue​(Feature feat,
                                int v)
        Description copied from interface: FeatureStructure
        Set the int value of a feature.
        Specified by:
        setIntValue in interface FeatureStructure
        Parameters:
        feat - The feature whose value we want to set.
        v - The int we're setting the feature to.
      • _setIntValueNfc

        public void _setIntValueNfc​(int adjOffset,
                                    int v)
      • _setIntValueNcNj

        public void _setIntValueNcNj​(FeatureImpl fi,
                                     int v)
      • _setIntValueNcNj

        public void _setIntValueNcNj​(int adjOffset,
                                     int v)
      • setLongValue

        public void setLongValue​(Feature feat,
                                 long v)
        Description copied from interface: FeatureStructure
        Set the long (64 bit) value of a feature.
        Specified by:
        setLongValue in interface FeatureStructure
        Parameters:
        feat - The feature whose value we want to set.
        v - The long (64bit) value we're setting the feature to.
      • _setLongValueNfc

        public void _setLongValueNfc​(int adjOffset,
                                     long v)
      • _setLongValueNcNj

        public void _setLongValueNcNj​(FeatureImpl fi,
                                      long v)
      • _setLongValueNcNj

        public void _setLongValueNcNj​(int adjOffset,
                                      long v)
      • setFloatValue

        public void setFloatValue​(Feature feat,
                                  float v)
        Description copied from interface: FeatureStructure
        Set the float value of a feature.
        Specified by:
        setFloatValue in interface FeatureStructure
        Parameters:
        feat - The feature whose value we want to set.
        v - The float we're setting the feature to.
      • _setFloatValueNfc

        protected void _setFloatValueNfc​(int adjOffset,
                                         float v)
      • _setFloatValueNcNj

        public void _setFloatValueNcNj​(FeatureImpl fi,
                                       float v)
      • _setFloatValueNcNj

        public void _setFloatValueNcNj​(int adjOffset,
                                       float v)
      • setDoubleValue

        public void setDoubleValue​(Feature feat,
                                   double v)
        Description copied from interface: FeatureStructure
        Set the double value of a feature.
        Specified by:
        setDoubleValue in interface FeatureStructure
        Parameters:
        feat - The feature whose value we want to set.
        v - The double value we're setting the feature to.
      • _setDoubleValueNfc

        protected void _setDoubleValueNfc​(int adjOffset,
                                          double v)
      • _setDoubleValueNcNj

        public void _setDoubleValueNcNj​(FeatureImpl fi,
                                        double v)
      • _setDoubleValueNcNj

        public void _setDoubleValueNcNj​(int adjOffset,
                                        double v)
      • setStringValue

        public void setStringValue​(Feature feat,
                                   java.lang.String v)
        Description copied from interface: FeatureStructure
        Set the string value of a feature.
        Specified by:
        setStringValue in interface FeatureStructure
        Parameters:
        feat - The feature whose value we want to set.
        v - The string we're setting the feature to.
      • _setStringValueNfc

        public void _setStringValueNfc​(int adjOffset,
                                       java.lang.String v)
      • _setStringValueNcNj

        public void _setStringValueNcNj​(FeatureImpl fi,
                                        java.lang.String v)
      • _setStringValueNcWj

        public void _setStringValueNcWj​(int adjOffset,
                                        java.lang.String v)
        Skips substring range checking, but maybe does journalling
        Parameters:
        adjOffset - offset
        v - to set
      • _setFeatureValueNcNj

        public void _setFeatureValueNcNj​(FeatureImpl fi,
                                         java.lang.Object v)
      • _setFeatureValueNcNj

        public void _setFeatureValueNcNj​(int adjOffset,
                                         java.lang.Object v)
      • _maybeGetBaseForPearFs

        protected <N extends TOP> N _maybeGetBaseForPearFs​(N v)
        Called when setting a FS value which might be a trampoline
        Type Parameters:
        N - the type of the FS
        Parameters:
        v - the FS to check
        Returns:
        the FS or if it was a trampoline, the base FS
      • _maybeGetBaseForPearFs

        public <N extends TOP> N _maybeGetBaseForPearFs()
        Called to convert to the base FS from a Pear version
        Type Parameters:
        N - the type of the FS
        Returns:
        the FS or if it was a trampoline, the base FS
      • _maybeGetPearFs

        protected <N extends TOP> N _maybeGetPearFs​(N v)
        Called when getting a FS value which might need to return a Pear context's trampoline
        Type Parameters:
        N - the type of the FS
        Parameters:
        v - the FS to check
        Returns:
        the FS or if we're in a Pear context, perhaps the trampoline (only some classes might have trampolines)
      • _maybeGetPearFs

        public <N extends TOP> N _maybeGetPearFs()
        Type Parameters:
        N - the type of the FS
        Returns:
        the FS or if we're in a Pear context and the PEAR defines a different version, the PEAR version.
      • _setFeatureValueNcWj

        public void _setFeatureValueNcWj​(int adjOffset,
                                         FeatureStructure v)
        Nc - no check, Wj = with journaling if needed
        Parameters:
        adjOffset - -
        v - -
      • setFeatureValueFromString

        public void setFeatureValueFromString​(Feature feat,
                                              java.lang.String s)
                                       throws CASRuntimeException
        Description copied from interface: FeatureStructure
        Sets the value of a feature from a string input if the feature type is one of the primitive types.
        Specified by:
        setFeatureValueFromString in interface FeatureStructure
        Parameters:
        feat - The feature whose value we want to set.
        s - The string value that the feature will be set to.
        Throws:
        CASRuntimeException - If feat is not a primitive type or the value cannot be converted to this type.
      • _setIntValueCJ

        protected void _setIntValueCJ​(FeatureImpl fi,
                                      int v)
        All 3 checks
        Parameters:
        fi - - the feature
        v - - the value
      • _setLongValueCJ

        protected void _setLongValueCJ​(FeatureImpl fi,
                                       long v)
        All 3 checks for long
        Parameters:
        fi - - the feature
        v - - the value
      • _setIntValueNfcCJ

        protected void _setIntValueNfcCJ​(int adjOffset,
                                         int v)
        2 checks, no feature check
        Parameters:
        adjOffset - - the feature offset
        v - - the value
      • _setLongValueNfcCJ

        protected void _setLongValueNfcCJ​(FeatureImpl fi,
                                          long v)
        2 checks, no feature check
        Parameters:
        fi - - the feature
        v - - the value
      • _setRefValueCJ

        protected void _setRefValueCJ​(FeatureImpl fi,
                                      java.lang.Object v)
      • _setRefValueNfcCJ

        protected void _setRefValueNfcCJ​(FeatureImpl fi,
                                         java.lang.Object v)
        2 checks, no feature check
        Parameters:
        fi - - the feature
        v - - the value
      • getBooleanValue

        public 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.
        Specified by:
        getBooleanValue in interface FeatureStructure
        Parameters:
        feat - The feature whose value we want to get.
        Returns:
        The value int; 0 if the value has not been set.
      • _getBooleanValueNc

        public boolean _getBooleanValueNc​(FeatureImpl fi)
      • _getBooleanValueNc

        public boolean _getBooleanValueNc​(int adjOffset)
      • getByteValue

        public byte getByteValue​(Feature feat)
        Description copied from interface: FeatureStructure
        Get the byte value of a feature. This method will throw an exception if the feature is not byte valued.
        Specified by:
        getByteValue in interface FeatureStructure
        Parameters:
        feat - The feature whose value we want to set.
        Returns:
        The value byte; 0 if the value has not been set.
      • _getByteValueNc

        public byte _getByteValueNc​(FeatureImpl feat)
      • _getByteValueNc

        public byte _getByteValueNc​(int adjOffset)
      • getShortValue

        public short getShortValue​(Feature feat)
        Description copied from interface: FeatureStructure
        Get the short value of a feature. This method will throw an exception if the feature is not short valued.
        Specified by:
        getShortValue in interface FeatureStructure
        Parameters:
        feat - The feature whose value we want to get.
        Returns:
        The value int; 0 if the value has not been set.
      • _getShortValueNc

        public short _getShortValueNc​(FeatureImpl feat)
      • _getShortValueNc

        public short _getShortValueNc​(int adjOffset)
      • getIntValue

        public int getIntValue​(Feature feat)
        Description copied from interface: FeatureStructure
        Get the int value of a feature. This method will throw an exception if the feature is not int valued.
        Specified by:
        getIntValue in interface FeatureStructure
        Parameters:
        feat - The feature whose value we want to get.
        Returns:
        The value int; 0 if the value has not been set.
      • _getIntValueNc

        public int _getIntValueNc​(FeatureImpl feat)
      • _getIntValueNc

        public int _getIntValueNc​(int adjOffset)
      • getLongValue

        public long getLongValue​(Feature feat)
        Description copied from interface: FeatureStructure
        Get the long value of a feature. This method will throw an exception if the feature is not long valued.
        Specified by:
        getLongValue in interface FeatureStructure
        Parameters:
        feat - The feature whose value we want to get.
        Returns:
        The value int; 0 if the value has not been set.
      • _getLongValueNc

        public long _getLongValueNc​(FeatureImpl feat)
      • _getLongValueNc

        public long _getLongValueNc​(int adjOffset)
      • getFloatValue

        public float getFloatValue​(Feature feat)
        Description copied from interface: FeatureStructure
        Get the float value of a feature. This method will throw an exception if the feature is not float valued.
        Specified by:
        getFloatValue in interface FeatureStructure
        Parameters:
        feat - The feature whose value we want to get.
        Returns:
        The value float; 0.0 if the value has not been set.
      • _getFloatValueNc

        public float _getFloatValueNc​(FeatureImpl fi)
      • _getFloatValueNc

        public float _getFloatValueNc​(int adjOffset)
      • getDoubleValue

        public double getDoubleValue​(Feature feat)
        Description copied from interface: FeatureStructure
        Get the double value of a feature. This method will throw an exception if the feature is not double valued.
        Specified by:
        getDoubleValue in interface FeatureStructure
        Parameters:
        feat - The feature whose value we want to get.
        Returns:
        The value int; 0 if the value has not been set.
      • _getDoubleValueNc

        public double _getDoubleValueNc​(FeatureImpl fi)
      • _getDoubleValueNc

        public double _getDoubleValueNc​(int adjOffset)
      • getStringValue

        public java.lang.String getStringValue​(Feature feat)
        Description copied from interface: FeatureStructure
        Get the string value under a feature.
        Specified by:
        getStringValue in interface FeatureStructure
        Parameters:
        feat - The feature for which we want the value.
        Returns:
        The value of this feature; may be null if the value has not been set.
      • _getStringValueNc

        public java.lang.String _getStringValueNc​(FeatureImpl feat)
      • _getStringValueNc

        public java.lang.String _getStringValueNc​(int adjOffset)
      • getFeatureValue

        public TOP getFeatureValue​(Feature feat)
        Description copied from interface: FeatureStructure
        Get a feature value.
        Specified by:
        getFeatureValue in interface FeatureStructure
        Parameters:
        feat - The feature whose value we want to get.
        Returns:
        The value; may be null if the value has not been set.
      • _getFeatureValueNc

        public TOP _getFeatureValueNc​(FeatureImpl feat)
      • _getFeatureValueNc

        public TOP _getFeatureValueNc​(int adjOffset)
      • getCAS

        public CAS getCAS()
        Specified by:
        getCAS in interface FeatureStructure
        Returns:
        the CAS view where this FS was created
      • getCASImpl

        public CASImpl getCASImpl()
      • clone

        public FeatureStructureImplC clone()
                                    throws CASRuntimeException
        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. Instead, we use the createFS to create the FS of the right type. This will use the generators. Strategy for cloning: Goal is to create an independent instance of some subtype of this class, with all the fields properly copied from this instance. - some fields could be in the _intData and _refData - some fields could be stored as features Subcases to handle: - arrays - these have no features. Note: CasCopier doesn't call this because it needs to do a deep copy This is not used by the framework
        Specified by:
        clone in interface FeatureStructure
        Overrides:
        clone in class java.lang.Object
        Returns:
        a new Feature Structure as a new instance of the same class, with a new _id field, with its features set to the values of the features in this Feature Structure
        Throws:
        CASRuntimeException - (different from Object.clone()) if an exception occurs
      • hashCode

        public int hashCode()
        Description copied from interface: FeatureStructure
        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.
        Specified by:
        hashCode in interface FeatureStructure
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        The hash code.
      • equals

        public boolean equals​(java.lang.Object obj)
        Description copied from interface: FeatureStructure
        A feature structure is equal to another feature structure iff it is identical in the underlying representation.
        Specified by:
        equals in interface FeatureStructure
        Overrides:
        equals in class java.lang.Object
      • getPrintRefs

        private final void getPrintRefs​(FeatureStructureImplC.PrintReferences printRefs,
                                        FeatureStructureImplC fs)
        This is called, once, at the top level thing being printed. It recursively descends any references, and updates the PrintReferences with info needed to handle circular structures
        Parameters:
        printRefs - the PrintReferences to update
        fs - the top level FS being pretty printed, to descend if needed
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • prettyPrint

        public void prettyPrint​(int indent,
                                int incr,
                                java.lang.StringBuilder buf,
                                boolean useShortNames)
        Specified by:
        prettyPrint in interface FeatureStructureImpl
      • prettyPrint

        public void prettyPrint​(int indent,
                                int incr,
                                java.lang.StringBuffer buf,
                                boolean useShortNames)
        Specified by:
        prettyPrint in interface FeatureStructureImpl
      • prettyPrint

        @Deprecated
        public void prettyPrint​(int indent,
                                int incr,
                                java.lang.StringBuffer buf,
                                boolean useShortNames,
                                java.lang.String s)
        Deprecated.
        use form with StringBuilder (not StringBuffer)
        Top level, does computation of self-ref Pretty prints this Feature Structure, no trailing nl Old form - uses string buffer.
        Specified by:
        prettyPrint in interface FeatureStructureImpl
        Parameters:
        indent - the indent amount
        incr - the amount the indent is increased for a level
        buf - where the resulting string is built
        useShortNames - true to use short name
        s - extra string to print
      • prettyPrint

        public void prettyPrint​(int indent,
                                int incr,
                                java.lang.StringBuilder buf,
                                boolean useShortNames,
                                java.lang.String s)
        Top level, does computation of self-ref Pretty prints this Feature Structure, no trailing nl
        Specified by:
        prettyPrint in interface FeatureStructureImpl
        Parameters:
        indent - the indent amount
        incr - the amount the indent is increased for a level
        buf - where the resulting string is built
        useShortNames - true to use short name
        s - extra string to print
      • prettyPrint

        @Deprecated
        public void prettyPrint​(int indent,
                                int incr,
                                java.lang.StringBuffer buf,
                                boolean useShortNames,
                                java.lang.String s,
                                FeatureStructureImplC.PrintReferences printRefs)
        Deprecated.
        because uses StringBuffer, not builder, for version 2 compatibility only
        Internal Use Only, public only for backwards compatibility
        Parameters:
        indent - -
        incr - -
        buf - -
        useShortNames - -
        s - -
        printRefs - -
      • prettyPrint

        public void prettyPrint​(int indent,
                                int incr,
                                java.lang.StringBuilder buf,
                                boolean useShortNames,
                                java.lang.String s,
                                FeatureStructureImplC.PrintReferences printRefs)
      • prettyPrintShort

        public void prettyPrintShort​(java.lang.StringBuilder sb)
        Parameters:
        sb - -
      • prettyPrint

        private void prettyPrint​(int indent,
                                 int incr,
                                 java.lang.StringBuilder buf,
                                 boolean useShortNames,
                                 java.lang.String s,
                                 FeatureStructureImplC.PrintReferences printRefs,
                                 boolean isShortForm_arg)
        recursively called by ppval
        Parameters:
        indent - -
        incr - -
        buf - -
        useShortNames - -
        s - -
        printRefs - -
        isShortForm_arg - -
      • addStringOrPrimitive

        public java.lang.StringBuilder addStringOrPrimitive​(java.lang.StringBuilder sb,
                                                            FeatureImpl fi)
      • printArrayElements

        private void printArrayElements​(int arrayLen,
                                        java.util.function.IntConsumer f,
                                        int indent,
                                        int incr,
                                        java.lang.StringBuilder buf)
        For printing arrays except FSArrays; called after printing the type:nnn prints the length if the length = 0 that's all otherwise: uses Misc.addElementsToStringBuilder to output the elements. This routine does [ + array contents + ], unless the line is too long, in which case it switches to multi-line
        Parameters:
        arrayLen - the length
        f - the feature structure
        indent - the current indent
        incr - the indent incr
        buf - the stringbuilder where the result is added
      • printFSArrayElements

        private void printFSArrayElements​(FSArray fsarray,
                                          int indent,
                                          int incr,
                                          java.lang.StringBuilder buf,
                                          boolean useShortNames,
                                          FeatureStructureImplC.PrintReferences printRefs,
                                          boolean isShortForm)
        For printing FSArrays; called after printing the type:nnn Only called if ! IS_V2_PRETTY_PRINT, since v2 didn't print the array contents prints the length if the length = 0 that's all otherwise:
        Parameters:
        arrayLen - the length
        f - the feature structure
        indent - the current indent
        incr - the indent incr
        buf - the stringbuilder where the result is added
      • appendOrNull

        private void appendOrNull​(java.lang.StringBuilder sb,
                                  java.lang.String v)
      • getTypeIndexID

        public int getTypeIndexID()
      • _setIntLikeValue

        public void _setIntLikeValue​(SlotKinds.SlotKind slotKind,
                                     FeatureImpl fi,
                                     int v)
        Internal Use only
        Parameters:
        slotKind - -
        fi - -
        v - -
      • _setIntLikeValueNcNj

        public void _setIntLikeValueNcNj​(SlotKinds.SlotKind slotKind,
                                         FeatureImpl fi,
                                         int v)
        Internal Use only - no feature check, no journaling
        Parameters:
        slotKind - -
        fi - -
        v - -
      • _getIntLikeValue

        public 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
        Parameters:
        slotKind - -
        f - -
        Returns:
        -
      • getFeatureValueAsString

        public java.lang.String getFeatureValueAsString​(Feature feat)
        Description copied from interface: FeatureStructure
        Get the value of the feature as a string if the type of the feature is one of the primitive type.
        Specified by:
        getFeatureValueAsString in interface FeatureStructure
        Parameters:
        feat - The feature whose value we want to get and whose type is one of the primitive types.
        Returns:
        A string representation of the feature value.
      • _inSetSortedIndex

        protected boolean _inSetSortedIndex()
      • _setInSetSortedIndexed

        protected void _setInSetSortedIndexed()
      • _resetInSetSortedIndex

        protected void _resetInSetSortedIndex()
        All callers of this must insure fs is not indexed in **Any** View
      • _setJCasHashMapReserve

        protected void _setJCasHashMapReserve()
      • _isJCasHashMapReserve

        public boolean _isJCasHashMapReserve()
      • _setPearTrampoline

        protected void _setPearTrampoline()
      • _isPearTrampoline

        protected boolean _isPearTrampoline()
      • _getFeatFromAdjOffset

        protected FeatureImpl _getFeatFromAdjOffset​(int adjOffset,
                                                    boolean isInInt)
      • _getIntValueCommon

        private int _getIntValueCommon​(FeatureImpl feat)
      • _getIntValueCommon

        private int _getIntValueCommon​(int adjOffset)
      • _getRefValueCommon

        private java.lang.Object _getRefValueCommon​(FeatureImpl feat)
      • _getRefValueCommon

        public java.lang.Object _getRefValueCommon​(int adjOffset)
      • _setIntValueCommon

        private void _setIntValueCommon​(FeatureImpl fi,
                                        int v)
      • _setIntValueCommon

        private void _setIntValueCommon​(int adjOffset,
                                        int v)
      • _setRefValueCommon

        private void _setRefValueCommon​(FeatureImpl fi,
                                        java.lang.Object v)
      • _setRefValueCommon

        public void _setRefValueCommon​(int adjOffset,
                                       java.lang.Object v)
      • _setRefValueCommonWj

        protected void _setRefValueCommonWj​(FeatureImpl fi,
                                            java.lang.Object v)
      • _Check_feature_defined_for_this_type

        private void _Check_feature_defined_for_this_type​(Feature feat)
        Validation checking
      • _check_feature_range_is_FeatureStructure

        private void _check_feature_range_is_FeatureStructure​(Feature feat,
                                                              FeatureStructureImplC fs)
      • featureValueValidation

        private void featureValueValidation​(Feature feat,
                                            java.lang.Object v)
      • isOkArray

        private boolean isOkArray​(TypeImpl range,
                                  java.lang.Object v)
      • subStringRangeCheck

        private void subStringRangeCheck​(Feature feat,
                                         java.lang.String v)
      • _copyIntAndRefArraysFrom

        public void _copyIntAndRefArraysFrom​(FeatureStructureImplC src)
        Parameters:
        src - the FS to copy features from
      • _copyIntAndRefArraysEqTypesFrom

        public void _copyIntAndRefArraysEqTypesFrom​(FeatureStructureImplC src)
        copy int and ref data for two instances, each having the exact same type
        Parameters:
        src - the FS to copy features from
      • _copyIntArrayEqTypesFrom

        public void _copyIntArrayEqTypesFrom​(FeatureStructureImplC src)
        Parameters:
        src - the FS to copy features from
      • toShortString

        public java.lang.String toShortString()
      • _getTypeImpl

        public final TypeImpl _getTypeImpl()
      • _setTypeImpl

        protected final void _setTypeImpl​(TypeImpl ti)
      • wrapGetIntCatchException

        protected static final int wrapGetIntCatchException​(java.lang.invoke.MethodHandle mh)