com.hammurapi.extract

## Class ComparisonResult

- java.lang.Object
- - com.hammurapi.extract.ComparisonResult

-     public class ComparisonResult
      extends Object

  Result of comparison of two extractors/predicates.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `ComparisonResult.Type` Result of extractor comparison.

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static ComparisonResult` | `EQUAL_NM`
    `static ComparisonResult` | `LESS_RESTRICTIVE_NM`
    `static ComparisonResult` | `MORE_RESTRICTIVE_NM`
    `static ComparisonResult` | `NOT_EQUAL_NM`
    `static ComparisonResult` | `OPPOSITE_LESS_RESTRICTIVE_NM`
    `static ComparisonResult` | `OPPOSITE_MORE_RESTRICTIVE_NM`
    `static ComparisonResult` | `OPPOSITE_NM`
    `static ComparisonResult` | `UNEQUAL_NM`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ComparisonResult(ComparisonResult.Type type, int[] indexMap)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `compareIndexMaps(int[] otherIndexMap)`
    `boolean` | `equals(Object obj)`
    `int[]` | `getIndexMap()`
    `ComparisonResult.Type` | `getType()`
    `int` | `hashCode()`
    `static int[]` | `inverse(int[] map, Set<Integer> parameterIndices)` Inverses index map.
    `boolean` | `isOneToOneMapping()`
    `static boolean` | `isOneToOneMapping(int[] map)`
    `String` | `toString()`

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

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

- - ### Field Detail

    - #### EQUAL_NM

          public static final ComparisonResult EQUAL_NM

    - #### UNEQUAL_NM

          public static final ComparisonResult UNEQUAL_NM

    - #### LESS_RESTRICTIVE_NM

          public static final ComparisonResult LESS_RESTRICTIVE_NM

    - #### MORE_RESTRICTIVE_NM

          public static final ComparisonResult MORE_RESTRICTIVE_NM

    - #### NOT_EQUAL_NM

          public static final ComparisonResult NOT_EQUAL_NM

    - #### OPPOSITE_NM

          public static final ComparisonResult OPPOSITE_NM

    - #### OPPOSITE_LESS_RESTRICTIVE_NM

          public static final ComparisonResult OPPOSITE_LESS_RESTRICTIVE_NM

    - #### OPPOSITE_MORE_RESTRICTIVE_NM

          public static final ComparisonResult OPPOSITE_MORE_RESTRICTIVE_NM

  - ### Constructor Detail

    - #### ComparisonResult

          public ComparisonResult(ComparisonResult.Type type,
                          int[] indexMap)

  - ### Method Detail

    - #### getIndexMap

          public int[] getIndexMap()

      Returns:
        mapping of indices of parameter extractor to this extractor. E.g. extractors `arg[0] < arg[1]` and `arg[1] > arg[0]` are equal with index mapping {1, 0}. `null` is returned for no mapping (if extractors are `NOT_EQUAL`) and for 1 to 1 mapping. In other words, if cr = e1.compareTo(e2), then new MappedExtractor(e1, cr.getIndexMap()).compareTo(e2).isOneToOneMapping()==true or return value of new MappedExtractor(e1, cr.getIndexMap()).extract() is the same as of e2.extract()

    - #### getType

          public ComparisonResult.Type getType()

    - #### isOneToOneMapping

          public boolean isOneToOneMapping()

    - #### isOneToOneMapping

          public static boolean isOneToOneMapping(int[] map)

    - #### compareIndexMaps

          public boolean compareIndexMaps(int[] otherIndexMap)

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### inverse

          public static int[] inverse(int[] map,
                      Set<Integer> parameterIndices)

      Inverses index map.
      Parameters:
        `indexMap2` -
      Returns:

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`