# InformationLoss (ARX Developer Documentation)

org.deidentifier.arx.metric

## Class InformationLoss<T>

- java.lang.Object
- - org.deidentifier.arx.metric.InformationLoss<T>

- Type Parameters:
    `T` -
  All Implemented Interfaces:
    java.io.Serializable, java.lang.Comparable<InformationLoss<?>>
  Direct Known Subclasses:
    AbstractILMultiDimensional, ILSingleDimensional

      public abstract class InformationLoss<T>
      extends java.lang.Object
      implements java.lang.Comparable<InformationLoss<?>>, java.io.Serializable

  This class implements an abstract base class for information loss.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `InformationLoss()` Creates a new instance

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `addMetadata(QualityMetadata<?> metadata)` Adds new metadata
    `abstract InformationLoss<T>` | `clone()` Returns a clone of this object.
    `abstract int` | `compareTo(InformationLoss<?> other)` Compares the loss to the other.
    `static InformationLoss<?>` | `createInformationLoss(InformationLoss<?> loss, Metric<?> metric, int minLevel, int maxLevel)` Converter method, converting information loss from version 1 to information loss from version 2, if necessary.
    `abstract boolean` | `equals(java.lang.Object obj)`
    `java.util.List<QualityMetadata<?>>` | `getMetadata()` Adds new metadata
    `abstract T` | `getValue()` Returns the value
    `abstract int` | `hashCode()`
    `abstract void` | `max(InformationLoss<?> other)` Retains the maximum of this and other.
    `abstract void` | `min(InformationLoss<?> other)` Retains the minimum of this and other.
    `abstract double` | `relativeTo(InformationLoss<?> min, InformationLoss<?> max)` Returns the value relative to the other instance.
    `abstract java.lang.String` | `toString()` Returns a string representation.

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

      `finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### InformationLoss

          protected InformationLoss()

      Creates a new instance

  - ### Method Detail

    - #### createInformationLoss

          public static InformationLoss<?> createInformationLoss(InformationLoss<?> loss,
                                                 Metric<?> metric,
                                                 int minLevel,
                                                 int maxLevel)

      Converter method, converting information loss from version 1 to information loss from version 2, if necessary.
      Parameters:
        `loss` -
        `metric` -
        `minLevel` -
        `maxLevel` -
      Returns:

    - #### addMetadata

          protected void addMetadata(QualityMetadata<?> metadata)

      Adds new metadata
      Parameters:
        `metadata` -

    - #### clone

          public abstract InformationLoss<T> clone()

      Returns a clone of this object.
      Overrides:
        `clone` in class `java.lang.Object`
      Returns:

    - #### compareTo

          public abstract int compareTo(InformationLoss<?> other)

      Compares the loss to the other.
      Specified by:
        `compareTo` in interface `java.lang.Comparable<InformationLoss<?>>`
      Parameters:
        `other` -
      Returns:

    - #### equals

          public abstract boolean equals(java.lang.Object obj)

      Overrides:
        `equals` in class `java.lang.Object`

    - #### getMetadata

          public java.util.List<QualityMetadata<?>> getMetadata()

      Adds new metadata
      Parameters:
        `metadata` -
      Returns:

    - #### getValue

          public abstract T getValue()

      Returns the value
      Returns:

    - #### hashCode

          public abstract int hashCode()

      Overrides:
        `hashCode` in class `java.lang.Object`

    - #### max

          public abstract void max(InformationLoss<?> other)

      Retains the maximum of this and other.
      Parameters:
        `other` -

    - #### min

          public abstract void min(InformationLoss<?> other)

      Retains the minimum of this and other.
      Parameters:
        `other` -

    - #### relativeTo

          public abstract double relativeTo(InformationLoss<?> min,
                          InformationLoss<?> max)

      Returns the value relative to the other instance.
      Parameters:
        `min` -
        `max` -
      Returns:

    - #### toString

          public abstract java.lang.String toString()

      Returns a string representation.
      Overrides:
        `toString` in class `java.lang.Object`
      Returns: