## org.apache.mahout.cf.taste.example.netflix
Class NetflixFileDataModel

    java.lang.Object
      org.apache.mahout.cf.taste.example.netflix.NetflixFileDataModel

All Implemented Interfaces:
  Serializable, Refreshable, DataModel

    public final class NetflixFileDataModel

extends Object
implements DataModel

See Also:
  Serialized Form

Constructor Summary
`NetflixFileDataModel(File dataDirectory)`

Method Summary
`LongPrimitiveIterator` `getItemIDs()`
`FastIDSet` `getItemIDsFromUser(long userID)`
`float` `getMaxPreference()`
`float` `getMinPreference()`
`int` `getNumItems()`
`int` `getNumUsers()`
`int` `getNumUsersWithPreferenceFor(long... itemIDs)`
`PreferenceArray` `getPreferencesForItem(long itemID)`
`PreferenceArray` `getPreferencesFromUser(long id)`
`Long` `getPreferenceTime(long userID, long itemID)`
`Float` `getPreferenceValue(long userID, long itemID)`
`LongPrimitiveIterator` `getUserIDs()`
`boolean` `hasPreferenceValues()`
`void` `refresh(Collection<Refreshable> alreadyRefreshed)`
`void` `removePreference(long userID, long itemID)`
`void` `setPreference(long userID, long itemID, float value)`
`String` `toString()`

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

Constructor Detail

### NetflixFileDataModel

    public NetflixFileDataModel(File dataDirectory)

Method Detail

### getUserIDs

    public LongPrimitiveIterator getUserIDs()

  Specified by:
    `getUserIDs` in interface `DataModel`

### getPreferencesFromUser

    public PreferenceArray getPreferencesFromUser(long id)

  Specified by:
    `getPreferencesFromUser` in interface `DataModel`

### getItemIDs

    public LongPrimitiveIterator getItemIDs()

  Specified by:
    `getItemIDs` in interface `DataModel`

### getItemIDsFromUser

    public FastIDSet getItemIDsFromUser(long userID)

  Specified by:
    `getItemIDsFromUser` in interface `DataModel`

### getPreferenceValue

    public Float getPreferenceValue(long userID,
                                    long itemID)

  Specified by:
    `getPreferenceValue` in interface `DataModel`

### getPreferenceTime

    public Long getPreferenceTime(long userID,
                                  long itemID)

  Specified by:
    `getPreferenceTime` in interface `DataModel`

### getPreferencesForItem

    public PreferenceArray getPreferencesForItem(long itemID)
                                          throws TasteException

  Specified by:
    `getPreferencesForItem` in interface `DataModel`
  Throws:
    `TasteException`

### getNumItems

    public int getNumItems()

  Specified by:
    `getNumItems` in interface `DataModel`

### getNumUsers

    public int getNumUsers()

  Specified by:
    `getNumUsers` in interface `DataModel`

### getNumUsersWithPreferenceFor

    public int getNumUsersWithPreferenceFor(long... itemIDs)

  Specified by:
    `getNumUsersWithPreferenceFor` in interface `DataModel`

### setPreference

    public void setPreference(long userID,
                              long itemID,
                              float value)

  Specified by:
    `setPreference` in interface `DataModel`
  Throws:
    `UnsupportedOperationException`

### removePreference

    public void removePreference(long userID,
                                 long itemID)

  Specified by:
    `removePreference` in interface `DataModel`
  Throws:
    `UnsupportedOperationException`

### refresh

    public void refresh(Collection<Refreshable> alreadyRefreshed)

  Specified by:
    `refresh` in interface `Refreshable`

### hasPreferenceValues

    public boolean hasPreferenceValues()

  Specified by:
    `hasPreferenceValues` in interface `DataModel`

### getMaxPreference

    public float getMaxPreference()

  Specified by:
    `getMaxPreference` in interface `DataModel`

### getMinPreference

    public float getMinPreference()

  Specified by:
    `getMinPreference` in interface `DataModel`

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.