edu.northwestern.at.morphadorner.tools.tagdiff

## Class TagDiff.TagCount

- java.lang.Object
- - edu.northwestern.at.morphadorner.tools.tagdiff.TagDiff.TagCount

- All Implemented Interfaces:
    java.lang.Comparable
  Enclosing class:
    TagDiff

      static class TagDiff.TagCount
      extends java.lang.Object
      implements java.lang.Comparable

  Class to hold counts of correct and incorrect tags.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `int` | `comparisonType` Comparison type.
    `int` | `correct` Correctly tagged count.
    `int` | `incorrect` Incorrectly tagged count.
    `java.lang.String` | `tag` The tag string.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TagDiff.TagCount(java.lang.String tag)` Create tag count object.
    `TagDiff.TagCount(java.lang.String tag, int correct, int incorrect)` Create tag count object with given counts.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `compareTo(java.lang.Object object)` Compare this object to another.
    `double` | `percentageIncorrect()` Get percentage of incorrect tags.
    `void` | `setComparisonType(int comparisonType)` Set comparison type.
    `java.lang.String` | `toString()` Convert to string.
    `void` | `update(int correct, int incorrect)` Update counts.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### tag

          public java.lang.String tag

      The tag string.

    - #### correct

          public int correct

      Correctly tagged count.

    - #### incorrect

          public int incorrect

      Incorrectly tagged count.

    - #### comparisonType

          public int comparisonType

      Comparison type. = 0: compare tags = 1: compare correct counts = 2: compare incorrect counts = 3: compare incorrect percent

  - ### Constructor Detail

    - #### TagDiff.TagCount

          public TagDiff.TagCount(java.lang.String tag)

      Create tag count object.
      Parameters:
        `tag` - The tag string.

    - #### TagDiff.TagCount

          public TagDiff.TagCount(java.lang.String tag,
                          int correct,
                          int incorrect)

      Create tag count object with given counts.
      Parameters:
        `tag` - The tag string.
        `correct` - Correct tag count.
        `incorrect` - Incorrect tag count.

  - ### Method Detail

    - #### setComparisonType

          public void setComparisonType(int comparisonType)

      Set comparison type.

    - #### update

          public void update(int correct,
                    int incorrect)

      Update counts.
      Parameters:
        `correct` - Number of correct entries to add.
        `incorrect` - Number of incorrect entries to add.

    - #### percentageIncorrect

          public double percentageIncorrect()

      Get percentage of incorrect tags.
      Returns:
        correct / incorrect as a percentage.

    - #### toString

          public java.lang.String toString()

      Convert to string.
      Overrides:
        `toString` in class `java.lang.Object`

    - #### compareTo

          public int compareTo(java.lang.Object object)

      Compare this object to another.
      Specified by:
        `compareTo` in interface `java.lang.Comparable`
      Parameters:
        `object` - Other object.
      Returns:
        < 0 if the other object is greater than this one, = 0 if the two objects are equal, > 0 if the other object is less than this one.

        We only compare the tags.