## org.apache.mahout.cf.taste.impl.similarity
Class GenericItemSimilarity.ItemItemSimilarity

    java.lang.Object
      org.apache.mahout.cf.taste.impl.similarity.GenericItemSimilarity.ItemItemSimilarity

All Implemented Interfaces:
  Comparable<GenericItemSimilarity.ItemItemSimilarity>

Enclosing class:
  GenericItemSimilarity

    public static final class GenericItemSimilarity.ItemItemSimilarity

extends Object
implements Comparable<GenericItemSimilarity.ItemItemSimilarity>

Encapsulates a similarity between two items. Similarity must be in the range [-1.0,1.0].

Constructor Summary
`GenericItemSimilarity.ItemItemSimilarity(long itemID1, long itemID2, double value)`

Method Summary
`int` `compareTo(GenericItemSimilarity.ItemItemSimilarity other)` Defines an ordering from highest similarity to lowest.
`boolean` `equals(Object other)`
`long` `getItemID1()`
`long` `getItemID2()`
`double` `getValue()`
`int` `hashCode()`
`String` `toString()`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### GenericItemSimilarity.ItemItemSimilarity

    public GenericItemSimilarity.ItemItemSimilarity(long itemID1,
                                                    long itemID2,
                                                    double value)

Parameters:
  `itemID1` - first item
  `itemID2` - second item
  `value` - similarity between the two
Throws:
  `IllegalArgumentException` - if value is NaN, less than -1.0 or greater than 1.0

Method Detail

### getItemID1

    public long getItemID1()

### getItemID2

    public long getItemID2()

### getValue

    public double getValue()

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

### compareTo

    public int compareTo(GenericItemSimilarity.ItemItemSimilarity other)

  Defines an ordering from highest similarity to lowest.

  Specified by:
    `compareTo` in interface `Comparable<GenericItemSimilarity.ItemItemSimilarity>`

### equals

    public boolean equals(Object other)

  Overrides:
    `equals` in class `Object`

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `Object`

Copyright © 2008–2014 The Apache Software Foundation. All rights reserved.