org.apache.mahout.cf.taste.impl.model
Class MemoryIDMigrator

java.lang.Object
  extended by org.apache.mahout.cf.taste.impl.model.AbstractIDMigrator
      extended by org.apache.mahout.cf.taste.impl.model.MemoryIDMigrator
All Implemented Interfaces:
IDMigrator

public final class MemoryIDMigrator
extends AbstractIDMigrator

Implementation which stores the reverse long-to-String mapping in memory.


Constructor Summary
MemoryIDMigrator()
           
 
Method Summary
 void storeMapping(long longID, java.lang.String stringID)
          Stores the reverse long-to-String mapping in some kind of backing store.
 java.lang.String toStringID(long longID)
           
 
Methods inherited from class org.apache.mahout.cf.taste.impl.model.AbstractIDMigrator
hash, initialize, toLongID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryIDMigrator

public MemoryIDMigrator()
Method Detail

storeMapping

public void storeMapping(long longID,
                         java.lang.String stringID)
Description copied from interface: IDMigrator
Stores the reverse long-to-String mapping in some kind of backing store. Note that this must be called directly (or indirectly through IDMigrator.initialize(Iterable)) for every String that might be encountered in the application, or else the mapping will not be known.

Parameters:
longID - long ID
stringID - string ID that maps to/from that long ID

toStringID

public java.lang.String toStringID(long longID)
Returns:
the string ID most recently associated with the given long ID, or null if doesn't exist


Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.