/** * Return the value corresponding to the id. * * @param id id * @return value */ public String getIdValue(final URI id) { if (id == null) { return null; } final URI localId = id.normalize(); return idMap.get(localId); }
/** * Add topic id-value pairs to idMap. * * @param id id * @param value value */ public void addId(final URI id, final String value) { if (id != null && value != null) { final URI localId = id.normalize(); final String localValue = value.trim(); idMap.put(localId, localValue); } }
/** * Add topic id to the idMap. * * @param id topic id * @return updated topic id */ public String addId(final URI id) { if (id == null) { return null; } final URI localId = id.normalize(); index++; final String newId = PREFIX + Integer.toString(index); idMap.put(localId, newId); return newId; }
/** * Find the topic id from idMap. * * @param id topic id * @return true if find and false otherwise */ public boolean findId(final URI id) { return id != null && idMap.containsKey(id.normalize()); }
/** Resets all internal data structures. */ public void reset() { idMap.clear(); visitSet.clear(); index = 0; }