FileDataModel extends AbstractDataModel { @Override public int getNumUsersWithPreferenceFor(long itemID) throws TasteException { return delegate.getNumUsersWithPreferenceFor(itemID); } FileDataModel(File dataFile);  FileDataModel(File dataFile, String delimiterRegex);  FileDataModel(File dataFile, boolean transpose, long minReloadIntervalMS);  FileDataModel(File dataFile, boolean transpose, long minReloadIntervalMS, String delimiterRegex); File getDataFile(); static char determineDelimiter(String line); @Override LongPrimitiveIterator getUserIDs(); @Override PreferenceArray getPreferencesFromUser(long userID); @Override FastIDSet getItemIDsFromUser(long userID); @Override LongPrimitiveIterator getItemIDs(); @Override PreferenceArray getPreferencesForItem(long itemID); @Override Float getPreferenceValue(long userID, long itemID); @Override Long getPreferenceTime(long userID, long itemID); @Override int getNumItems(); @Override int getNumUsers(); @Override int getNumUsersWithPreferenceFor(long itemID); @Override int getNumUsersWithPreferenceFor(long itemID1, long itemID2); @Override void setPreference(long userID, long itemID, float value); @Override void removePreference(long userID, long itemID); @Override void refresh(Collection<Refreshable> alreadyRefreshed); @Override boolean hasPreferenceValues(); @Override float getMaxPreference(); @Override float getMinPreference(); @Override String toString(); static final long DEFAULT_MIN_RELOAD_INTERVAL_MS; }
@Test public void testNumUsersPreferring() throws Exception { assertEquals(2, model.getNumUsersWithPreferenceFor(456)); assertEquals(0, model.getNumUsersWithPreferenceFor(111)); assertEquals(0, model.getNumUsersWithPreferenceFor(111, 456)); assertEquals(2, model.getNumUsersWithPreferenceFor(123, 234)); }