@Test public void testGetUserPreferences() { for (long u = 1L; u <= USERS; u++) { for (long i = 1L; i <= ITEMS; i++) { assertEquals(1.0 * u * i, dm.getUserItemPreference(u, i), 0.0); } } }
@Override public Double getUserItemPreference(U u, I i) { if (userItemPreferences.containsKey(u) && userItemPreferences.get(u).containsKey(i)) { return userItemPreferences.get(u).get(i); } return Double.NaN; }
DataModel implements DataModelIF<U, I> { @Override public Double getUserItemPreference(U u, I i) { if (userItemPreferences.containsKey(u) && userItemPreferences.get(u).containsKey(i)) { return userItemPreferences.get(u).get(i); } return Double.NaN; } }
DataModel implements DataModelIF<U, I> { @Override public Double getUserItemPreference(U u, I i) { if (userItemPreferences.containsKey(u) && userItemPreferences.get(u).containsKey(i)) { return userItemPreferences.get(u).get(i); } return Double.NaN; } DataModel(); protected  DataModel(final boolean ignoreDupPreferences); protected  DataModel(final boolean ignoreDupPreferences, final Map<U, Map<I, Double>> userItemPreference, final Set<I> itemSet); }
DataModel implements DataModelIF<U, I> { @Override public Double getUserItemPreference(U u, I i) { if (userItemPreferences.containsKey(u) && userItemPreferences.get(u).containsKey(i)) { return userItemPreferences.get(u).get(i); } return Double.NaN; } DataModel(); protected  DataModel(final boolean ignoreDupPreferences); protected  DataModel(final boolean ignoreDupPreferences, final Map<U, Map<I, Double>> userItemPreference, final Set<I> itemSet); @Override Double getUserItemPreference(U u, I i); @Override Iterable<I> getUserItems(U u); @Override void addPreference(final U u, final I i, final Double d); @Override Iterable<I> getItems(); @Override Iterable<U> getUsers(); @Override int getNumItems(); @Override int getNumUsers(); @Override void clear(); }
DataModel implements DataModelIF<U, I> { @Override public Double getUserItemPreference(U u, I i) { if (userItemPreferences.containsKey(u) && userItemPreferences.get(u).containsKey(i)) { return userItemPreferences.get(u).get(i); } return Double.NaN; } DataModel(); protected  DataModel(final boolean ignoreDupPreferences); protected  DataModel(final boolean ignoreDupPreferences, final Map<U, Map<I, Double>> userItemPreference, final Set<I> itemSet); @Override Double getUserItemPreference(U u, I i); @Override Iterable<I> getUserItems(U u); @Override void addPreference(final U u, final I i, final Double d); @Override Iterable<I> getItems(); @Override Iterable<U> getUsers(); @Override int getNumItems(); @Override int getNumUsers(); @Override void clear();  }