## org.apache.mahout.cf.taste.impl.model
Class GenericPreference

    java.lang.Object
      org.apache.mahout.cf.taste.impl.model.GenericPreference

All Implemented Interfaces:
  Serializable, Preference

    public class GenericPreference

extends Object
implements Preference, Serializable

A simple `Preference` encapsulating an item and preference value.

See Also:
  Serialized Form

Constructor Summary
`GenericPreference(long userID, long itemID, float value)`

Method Summary
`long` `getItemID()`
`long` `getUserID()`
`float` `getValue()`
`void` `setValue(float value)` Sets the strength of the preference for this item
`String` `toString()`

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

Constructor Detail

### GenericPreference

    public GenericPreference(long userID,
                             long itemID,
                             float value)

Method Detail

### getUserID

    public long getUserID()

  Specified by:
    `getUserID` in interface `Preference`
  Returns:
    ID of user who prefers the item

### getItemID

    public long getItemID()

  Specified by:
    `getItemID` in interface `Preference`
  Returns:
    item ID that is preferred

### getValue

    public float getValue()

  Specified by:
    `getValue` in interface `Preference`
  Returns:
    strength of the preference for that item. Zero should indicate "no preference either way"; positive values indicate preference and negative values indicate dislike

### setValue

    public void setValue(float value)

  Description copied from interface: `Preference`
  Sets the strength of the preference for this item

  Specified by:
    `setValue` in interface `Preference`
  Parameters:
    `value` - new preference

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

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