Class ObjectForReduction

Object
ObjectForReduction
All Implemented Interfaces:
Comparable<ObjectForReduction>

public final class ObjectForReduction extends Object implements Comparable<ObjectForReduction>
An object that can be reduced.
  • Field Details

    • NEWLY_ADDED

      public static final int NEWLY_ADDED
      A special index value to indicate that an object has been newly-added.

      Typically indices are non-negative, reflecting the position their position in the input list (as passed for reduction).

      See Also:
  • Constructor Details

    • ObjectForReduction

      public ObjectForReduction(LabelledWithConfidence<ObjectMask> labelled)
      Creates with a ObjectMask that is considered newly-added.
      Parameters:
      labelled - a labelled newly-added object.
    • ObjectForReduction

      public ObjectForReduction(LabelledWithConfidence<ObjectMask> labelled, int index)
      Creates a new ObjectForReduction instance.
      Parameters:
      labelled - The underlying labelled ObjectMask for input to a reduction algorithm.
      index - The index of the element in the original list for reduction, or NEWLY_ADDED if newly added.
  • Method Details

    • getElement

      public ObjectMask getElement()
      The underlying ObjectMask with whom a confidence and label is associated.
      Returns:
      the element to be passed as an input to a reduction algorithm.
    • getLabel

      public String getLabel()
      The label associated with the element.
      Returns:
      the label.
    • getConfidence

      public double getConfidence()
      The associated confidence.
      Returns:
      the confidence.
    • compareTo

      public int compareTo(ObjectForReduction other)
      Specified by:
      compareTo in interface Comparable<ObjectForReduction>
    • getLabelled

      public LabelledWithConfidence<ObjectMask> getLabelled()
      The underlying labelled ObjectMask for input to a reduction algorithm.
    • getIndex

      public int getIndex()
      The index of the element in the original list for reduction, or NEWLY_ADDED if newly added.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object