All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bigdata.search.IHitCollector Maven / Gradle / Ivy

package com.bigdata.search;

import java.util.concurrent.ConcurrentHashMap;

/**
 * Interface used to collect {@link Hit}s from the {@link ReadIndexTask}.
 * Switched over to this interface to allow for an optimization when only
 * one token is presented for search - in this case we now use a simple 
 * array of hits rather than a heavyweight ConcurrentHashMap.
 * 
 * @author mikepersonick
 *
 * @param 
 *            The generic type of the document identifier.
 */
public interface IHitCollector> {

	/**
	 * Mimic the ConcurrentHashMap method.
	 * 

* See {@link ConcurrentHashMap#putIfAbsent(Object, Object)}. * * @param v * the document identifier for the hit * @param hit * the full text hit * @return * the old value or null if there was no old value */ Hit putIfAbsent(final V v, final Hit hit); /** * Returns an array of hits collected by this instance. */ Hit[] getHits(); }





© 2015 - 2025 Weber Informatics LLC | Privacy Policy