Package org.apache.mahout.cf.taste.common

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


      while (rs.next()) {
        prefs.add(buildPreference(rs));
      }

      if (prefs.isEmpty()) {
        throw new NoSuchUserException(userID);
      }

      return new GenericUserPreferenceArray(prefs);

    } catch (SQLException sqle) {
View Full Code Here


      while (rs.next()) {
        result.add(getLongColumn(rs, 2));
      }

      if (result.isEmpty()) {
        throw new NoSuchUserException(userID);
      }

      return result;

    } catch (SQLException sqle) {
View Full Code Here

 
  @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

 
  @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

 
  @Override
  public Float getPreferenceValue(long userID, long itemID) throws TasteException {
    if (userID == TEMP_USER_ID) {
      if (tempPrefs == null) {
        throw new NoSuchUserException(TEMP_USER_ID);
      }
      for (int i = 0; i < tempPrefs.length(); i++) {
        if (tempPrefs.getItemID(i) == itemID) {
          return tempPrefs.getValue(i);
        }
View Full Code Here

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

 
  @Override
  public void setPreference(long userID, long itemID, float value) throws TasteException {
    if (userID == TEMP_USER_ID) {
      if (tempPrefs == null) {
        throw new NoSuchUserException(TEMP_USER_ID);
      }
      throw new UnsupportedOperationException();
    }
    delegate.setPreference(userID, itemID, value);
  }
View Full Code Here

 
  @Override
  public void removePreference(long userID, long itemID) throws TasteException {
    if (userID == TEMP_USER_ID) {
      if (tempPrefs == null) {
        throw new NoSuchUserException(TEMP_USER_ID);
      }
      throw new UnsupportedOperationException();
    }
    delegate.removePreference(userID, itemID);
  }
View Full Code Here

      if (itemIsObject && !ID_PATTERN.matcher(item.get(0)).matches()) {
        throw new IllegalArgumentException();
      }
    }
    if (!add && !isIDInModel(userID)) {
      throw new NoSuchUserException();
    }
    for (List<String> item : items) {
      if (!add && !isIDInModel(item.get(0))) {
        throw new NoSuchItemException();
      }
View Full Code Here

      SliceQuery<Long,Long,Float> query = buildValueSliceQuery(USERS_CF);
      query.setKey(userID);

      ColumnSlice<Long,Float> result = query.execute().get();
      if (result == null) {
        throw new NoSuchUserException(userID);
      }
      List<HColumn<Long,Float>> itemIDColumns = result.getColumns();
      if (itemIDColumns.isEmpty()) {
        throw new NoSuchUserException(userID);
      }
      int size = itemIDColumns.size();
      PreferenceArray prefs = new GenericUserPreferenceArray(size);
      prefs.setUserID(0, userID);
      for (int i = 0; i < size; i++) {
View Full Code Here

TOP

Related Classes of org.apache.mahout.cf.taste.common.NoSuchUserException

Copyright © 2018 www.massapicom. 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.