Class Annotation

    • Field Detail

      • typeIndexID

        public static final int typeIndexID
      • type

        public static final int type
      • _FC_begin

        private static final java.lang.invoke.CallSite _FC_begin
      • _FH_begin

        private static final java.lang.invoke.MethodHandle _FH_begin
      • _FC_end

        private static final java.lang.invoke.CallSite _FC_end
      • _FH_end

        private static final java.lang.invoke.MethodHandle _FH_end
    • Constructor Detail

      • Annotation

        @Deprecated
        protected Annotation()
        Deprecated.
      • Annotation

        public Annotation​(JCas jcas)
      • Annotation

        public Annotation​(TypeImpl t,
                          CASImpl c)
        used by generator Make a new AnnotationBase
        Parameters:
        c - -
        t - -
      • Annotation

        public Annotation​(JCas jcas,
                          int begin,
                          int end)
        Constructor with begin and end passed as arguments
        Parameters:
        jcas - JCas
        begin - begin offset
        end - end offset
      • Annotation

        private Annotation​(JCas jcas,
                           int begin,
                           int end,
                           int aId)
        Used to create temporary marker annotations.
    • Method Detail

      • getBegin

        public final int getBegin()
        Description copied from interface: AnnotationFS
        Get the start position of the annotation as character offset into the text. The smallest possible start position is 0, the offset of the first character in the text.
        Specified by:
        getBegin in interface AnnotationFS
        Returns:
        The start position.
      • setBegin

        public final void setBegin​(int v)
        Description copied from interface: AnnotationFS
        Set the start position of the annotation as character offset into the text. The smallest possible start position is 0, the offset of the first character in the text.
        Specified by:
        setBegin in interface AnnotationFS
        Parameters:
        v - The start position.
      • getEnd

        public final int getEnd()
        Description copied from interface: AnnotationFS
        Get the end position of the annotation as character offset into the text. The end position points at the first character after the annotation, such that (getEnd()-getBegin()) == getCoveredText().length().
        Specified by:
        getEnd in interface AnnotationFS
        Returns:
        The end position.
      • setEnd

        public final void setEnd​(int v)
        Description copied from interface: AnnotationFS
        Set the end position of the annotation as character offset into the text. The end position points at the first character after the annotation, such that (getEnd()-getBegin()) == getCoveredText().length().
        Specified by:
        setEnd in interface AnnotationFS
        Parameters:
        v - The end position position.
      • getCoveredText

        public java.lang.String getCoveredText()
        Description copied from interface: AnnotationFS
        Get the text covered by an annotation as a string. If docText is your document text and annot an annotation, then annot.getCoveredText().equals(docText.substring(annot.getBegin(), annot.getEnd())).
        Specified by:
        getCoveredText in interface AnnotationFS
        Returns:
        -
        See Also:
        AnnotationFS.getCoveredText()
      • getStart

        @Deprecated
        public int getStart()
        Deprecated.
        Use getBegin() instead.
        Returns:
        the Annotation "begin" feature value
      • compareAnnotation

        public final int compareAnnotation​(Annotation other)
        Compare two annotations, no type order
        Parameters:
        other - -
        Returns:
        -
      • compareAnnotation

        public final int compareAnnotation​(Annotation other,
                                           LinearTypeOrder lto)
        Compare two annotations incl type order
        Parameters:
        other - -
        lto - -
        Returns:
        -
      • compareAnnotationWithId

        public final int compareAnnotationWithId​(Annotation other)
        Compare two annotations, with id compare
        Parameters:
        other - -
        Returns:
        -
      • compareAnnotationWithId

        public final int compareAnnotationWithId​(Annotation other,
                                                 LinearTypeOrder lto)
        Compare two annotations, with type order, with id compare
        Parameters:
        other - -
        lto - -
        Returns:
        -
      • trim

        public void trim​(java.util.function.IntPredicate aIsTrimChar)
        Description copied from interface: AnnotationFS
        Strips leading and trailing characters matching the given predicate by increasing/decreasing the begin/end offsets.
        Specified by:
        trim in interface AnnotationFS
        Parameters:
        aIsTrimChar - the predicate used to identify whether a given codepoint is whitespace.
        See Also:
        AnnotationFS.trim()
      • _createMarkerAnnotation

        public static Annotation _createMarkerAnnotation​(JCas aJCas,
                                                         int aBegin,
                                                         int aEnd)
        For internal use by SelectFSs_impl