Esempio n. 1
0
 /**
  * Find the offsets associated with a name&state.
  *
  * @param name
  * @param state
  * @return the collection of offsets associated with the name and state
  */
 public Vector<Long> find(String name, String state) {
   NameEntry entry = index.find(new NameEntry(name, state));
   if (entry == null) {
     return null;
   }
   return entry.getOffsets();
 }
Esempio n. 2
0
 /**
  * Insert a new name&state and offset pair.
  *
  * @param name
  * @param state
  * @param offset
  */
 public void insert(String name, String state, long offset) {
   NameEntry duplicate;
   // if there is a duplicate, put the new offset into this duplicated
   // object; otherwise put the new created object in there.
   if ((duplicate = index.insert(new NameEntry(name, state, offset))) != null) {
     duplicate.addOffset(offset);
   }
 }