Exemple #1
0
 /**
  * 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);
 }
Exemple #2
0
 /**
  * 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);
   }
 }
Exemple #3
0
 /**
  * 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;
 }
Exemple #4
0
 /**
  * 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());
 }
Exemple #5
0
 /** Resets all internal data structures. */
 public void reset() {
   idMap.clear();
   visitSet.clear();
   index = 0;
 }