code: public static long getIndexMap(final File in, final Map<String, Long> map) throws IOException {
          long id = 0;
          if (in.exists()) {
              BufferedReader br = SimpleParser.getBufferedReader(in);
              String line;
              while ((line = br.readLine()) != null) {
                  String[] toks = line.split("\t");
                  long i = Long.parseLong(toks[1]);
                  map.put(toks[0], i);
                  id = Math.max(i, id);
              }
              br.close();
          }
          return id + 1;
      }
docs: Read a user/item mapping (user/item original value, user/item internal
  id) from a file and return the maximum index number in that file.
  
  @param in The file with id mapping.
  @param map The user/item mapping
  @return The largest id number.
  @throws IOException if file does not exist.