Example #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();
 }
Example #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);
   }
 }
Example #3
0
 /**
  * Log the content as texts to a PrintWriter.
  *
  * @param log the PrintWriter to log the content
  */
 public void logString(PrintWriter log) {
   index.logString(log);
 }
Example #4
0
 /**
  * Get the largest number of probings.
  *
  * @return the largest number of probing
  */
 public int getLongestProbing() {
   return index.getLongestProbing();
 }