Class TermTag

    • Constructor Detail

      • TermTag

        public TermTag​(TermTag original)
        Copy constructor.
        Parameters:
        original - the original object to duplicate.
      • TermTag

        public TermTag​(String id)
        Creates a new TermTag object.
        Parameters:
        id - the id of the new term tag (cannot be null).
      • TermTag

        public TermTag​(MTag tag,
                       String type,
                       AnnotatorsRef ar)
        Creates a new opening TermTag object from an existing marker tag.
        Parameters:
        tag - the marker tag to use.
        type - the type of the annotation.
        ar - the annotator-references for this marker (can be null).
    • Method Detail

      • getDataCategoryName

        public String getDataCategoryName()
        Gets the the id/name of this data category.
        Returns:
        the id/name of this data category.
      • validate

        public void validate()
        Validates this data category.
      • setType

        public void setType​(String type)
        Description copied from class: Tag
        Sets the type of the code or marker (for both opening/closing tags).
        Overrides:
        setType in class MTag
        Parameters:
        type - the type of the code or marker this tag represents.
      • isTerm

        public boolean isTerm()
        Indicates if this is a term.
        Returns:
        true if this annotation is a term, false otherwise.
      • setTerm

        public void setTerm​(boolean term)
        Sets the flag indicating if this is a term.
        Parameters:
        term - true if this is a term, false otherwise.
      • getTermConfidence

        public Double getTermConfidence()
        Gets the confidence on whether this is a term or not.
        Returns:
        the confidence on whether this is a term or not.
      • setTermConfidence

        public void setTermConfidence​(Double termConfidence)
        Sets the confidence on whether this is a term or not.
        Parameters:
        termConfidence - the confidence on whether this is a term or not (between 0.0 and 1.0).
      • hasITSItem

        public boolean hasITSItem()
        Description copied from interface: IWithITSAttributes
        Indicates if the object has at least one ITS item.
        Specified by:
        hasITSItem in interface IWithITSAttributes
        Overrides:
        hasITSItem in class MTag
        Returns:
        true if the object has at least one ITS item.
      • getITSItems

        public ITSItems getITSItems()
        This method always return null: Only the Terminology data category can be used on a term annotation.
        Specified by:
        getITSItems in interface IWithITSAttributes
        Overrides:
        getITSItems in class MTag
        Returns:
        always null
      • setAnnotatorRef

        public void setAnnotatorRef​(String annotatorRef)
        Sets the annotator reference information for this data category.
        Parameters:
        annotatorRef - the reference string to set (can be null).
      • setAnnotatorRef

        public void setAnnotatorRef​(AnnotatorsRef ar)
        Sets the annotator reference information for this data category.
        Parameters:
        ar - the set of references read from its:annotatorsRef. If it is null, or if there is no reference for the relevant data category: no change is made.
      • getAnnotatorRef

        public String getAnnotatorRef()
        Gets the annotator reference currently set for this data category.
        Returns:
        the annotator reference currently set for this data category.
      • getTermInfo

        public String getTermInfo()
        Gets the term information for this marker. This is the same as calling MTag.getValue().
        Returns:
        the term information for this marker (can be null).
      • setTermInfo

        public void setTermInfo​(String termInfo)
        Sets the term information for this marker. Note that this call automatically calls setRef(null); because ITS terms can have only either a reference or a value but not both.
        Parameters:
        termInfo - the new information to set (can be null).
      • getTermInfoRef

        public String getTermInfoRef()
        Gets the term information reference for this marker. This is the same as calling MTag.getRef().
        Returns:
        the term information reference for this marker (can be null).
      • setTermInfoRef

        public void setTermInfoRef​(String termInfoRef)
        Sets the term information reference for this marker. Note that this call automatically calls setValue(null); because ITS terms can have only either a reference or a value but not both.
        Parameters:
        termInfoRef - the new information reference to set.
      • equals

        public boolean equals​(Object other)
        Description copied from class: Tag
        Indicates if this tag is equal to another.

        Use the == operator to test if two tags are the same.

        Overrides:
        equals in class MTag
        Parameters:
        other - the other tag to compare to this one.
        Returns:
        true if both tags are equals.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class MTag