net.lenni0451.commons.strings.search.SearchResult Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of main Show documentation
Show all versions of main Show documentation
A java library with many useful functions and classes
The newest version!
package net.lenni0451.commons.strings.search;
import java.util.List;
/**
* Represents the result of a search by the {@link SearchEngine}.
*
* @param The type of the search results
*/
public class SearchResult {
private final String query;
private final int queryTokens;
private final ResultFilter resultFilter;
private final List results;
private final boolean emptySearch;
public SearchResult(final String query, final int queryTokens, final ResultFilter resultFilter, final List results, final boolean emptySearch) {
this.query = query;
this.queryTokens = queryTokens;
this.resultFilter = resultFilter;
this.results = results;
this.emptySearch = emptySearch;
}
/**
* @return The query that was used to search
*/
public String getQuery() {
return this.query;
}
/**
* @return The amount of tokens that were searched for
*/
public int getQueryTokens() {
return this.queryTokens;
}
/**
* @return The filter used to filter the results
*/
public ResultFilter getResultFilter() {
return this.resultFilter;
}
/**
* @return The sorted results of the search
*/
public List getResults() {
return this.results;
}
/**
* @return If the query or input was empty
*/
public boolean isEmptySearch() {
return this.emptySearch;
}
}