## org.apache.mahout.cf.taste.impl.similarity
Class AbstractItemSimilarity

    java.lang.Object
      org.apache.mahout.cf.taste.impl.similarity.AbstractItemSimilarity

All Implemented Interfaces:
  Refreshable, ItemSimilarity

Direct Known Subclasses:
  CityBlockSimilarity, EuclideanDistanceSimilarity, LogLikelihoodSimilarity, PearsonCorrelationSimilarity, TanimotoCoefficientSimilarity, UncenteredCosineSimilarity

    public abstract class AbstractItemSimilarity

extends Object
implements ItemSimilarity

Constructor Summary
`protected` `AbstractItemSimilarity(DataModel dataModel)`

Method Summary
`long[]` `allSimilarItemIDs(long itemID)`
`protected DataModel` `getDataModel()`
`void` `refresh(Collection<Refreshable> alreadyRefreshed)` Triggers "refresh" -- whatever that means -- of the implementation.

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

Methods inherited from interface org.apache.mahout.cf.taste.similarity.ItemSimilarity
`itemSimilarities, itemSimilarity`

Constructor Detail

### AbstractItemSimilarity

    protected AbstractItemSimilarity(DataModel dataModel)

Method Detail

### getDataModel

    protected DataModel getDataModel()

### allSimilarItemIDs

    public long[] allSimilarItemIDs(long itemID)
                             throws TasteException

  Specified by:
    `allSimilarItemIDs` in interface `ItemSimilarity`
  Returns:
    all IDs of similar items, in no particular order
  Throws:
    `TasteException`

### refresh

    public void refresh(Collection<Refreshable> alreadyRefreshed)

  Description copied from interface: `Refreshable`

  Triggers "refresh" -- whatever that means -- of the implementation. The general contract is that any `Refreshable` should always leave itself in a consistent, operational state, and that the refresh atomically updates internal state from old to new.

  Specified by:
    `refresh` in interface `Refreshable`
  Parameters:
    `alreadyRefreshed` - `Refreshable`s that are known to have already been refreshed as a result of an initial call to a `Refreshable.refresh(Collection)` method on some object. This ensure that objects in a refresh dependency graph aren't refreshed twice needlessly.

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