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

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


 
  @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

 
  @Override
  public PreferenceArray getPreferencesFromUser(long userID) throws TasteException {
    if (userID == TEMP_USER_ID) {
      if (tempPrefs == null) {
        throw new NoSuchUserException();
      }
      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();
      }
      return prefItemIDs;
    }
    return delegate.getItemIDsFromUser(userID);
  }
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.