Examples of NoSuchUserException


Examples of org.apache.mahout.cf.taste.common.NoSuchUserException

   */
  @Override
  public PreferenceArray getPreferencesFromUser(long userID) throws NoSuchUserException {
    PreferenceArray prefs = preferenceFromUsers.get(userID);
    if (prefs == null) {
      throw new NoSuchUserException();
    }
    return prefs;
  }
View Full Code Here

Examples of org.apache.mahout.cf.taste.common.NoSuchUserException

      while (rs.next()) {
        prefs.add(buildPreference(rs));
      }
     
      if (prefs.isEmpty()) {
        throw new NoSuchUserException();
      }
     
      return new GenericUserPreferenceArray(prefs);
     
    } catch (SQLException sqle) {
View Full Code Here

Examples of org.apache.mahout.cf.taste.common.NoSuchUserException

      while (rs.next()) {
        result.add(getLongColumn(rs, 2));
      }
     
      if (result.isEmpty()) {
        throw new NoSuchUserException();
      }
     
      return result;
     
    } catch (SQLException sqle) {
View Full Code Here

Examples of org.apache.mahout.cf.taste.common.NoSuchUserException

 
  @Override
  public float estimatePreference(long userID, long itemID) throws TasteException {
    Integer useridx = userMap.get(userID);
    if (useridx == null) {
      throw new NoSuchUserException();
    }
    Integer itemidx = itemMap.get(itemID);
    if (itemidx == null) {
      throw new NoSuchItemException();
    }
View Full Code Here

Examples of org.apache.mahout.cf.taste.common.NoSuchUserException

   */
  @Override
  public PreferenceArray getPreferencesFromUser(long userID) throws NoSuchUserException {
    FastIDSet itemIDs = preferenceFromUsers.get(userID);
    if (itemIDs == null) {
      throw new NoSuchUserException();
    }
    PreferenceArray prefArray = new BooleanUserPreferenceArray(itemIDs.size());
    int i = 0;
    LongPrimitiveIterator it = itemIDs.iterator();
    while (it.hasNext()) {
View Full Code Here

Examples of org.apache.mahout.cf.taste.common.NoSuchUserException

 
  @Override
  public FastIDSet getItemIDsFromUser(long userID) throws TasteException {
    FastIDSet itemIDs = preferenceFromUsers.get(userID);
    if (itemIDs == null) {
      throw new NoSuchUserException();
    }
    return itemIDs;
  }
View Full Code Here

Examples of org.apache.mahout.cf.taste.common.NoSuchUserException

 
  @Override
  public Float getPreferenceValue(long userID, long itemID) throws NoSuchUserException {
    FastIDSet itemIDs = preferenceFromUsers.get(userID);
    if (itemIDs == null) {
      throw new NoSuchUserException();
    }
    if (itemIDs.contains(itemID)) {
      return 1.0f;
    }
    return null;
View Full Code Here

Examples of org.apache.mahout.cf.taste.common.NoSuchUserException

    if (timestamps == null) {
      return null;
    }
    FastByIDMap<Long> itemTimestamps = timestamps.get(userID);
    if (itemTimestamps == null) {
      throw new NoSuchUserException();
    }
    return itemTimestamps.get(itemID);
  }
View Full Code Here

Examples of org.apache.mahout.cf.taste.common.NoSuchUserException

 
  @Override
  public PreferenceArray getPreferencesFromUser(long userID) throws TasteException {
    if (userID == TEMP_USER_ID) {
      if (tempPrefs == null) {
        throw new NoSuchUserException(TEMP_USER_ID);
      }
      return tempPrefs;
    }
    return delegate.getPreferencesFromUser(userID);
  }
View Full Code Here

Examples of org.apache.mahout.cf.taste.common.NoSuchUserException

 
  @Override
  public FastIDSet getItemIDsFromUser(long userID) throws TasteException {
    if (userID == TEMP_USER_ID) {
      if (tempPrefs == null) {
        throw new NoSuchUserException(TEMP_USER_ID);
      }
      return prefItemIDs;
    }
    return delegate.getItemIDsFromUser(userID);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.