/** * @return the count of the number of items returned */ public int getResultsNum() { return getResults().size(); }
/** * Add results to the total results, * this will not allow adding results beyond the maxItemsToReturn (max) number * * @param searchResult the result to add * @return true if the item was added OR false if it was null or the max number is already added */ public boolean addResult(SearchResult searchResult) { boolean added = false; if (searchResult != null) { if (this.maxItemsToReturn <= 0 || getResults().size() < this.maxItemsToReturn) { getResults().add(searchResult); // this will ensure that the total items matched is not completely wrong if (getResults().size() > this.totalItemsMatched) { this.totalItemsMatched = getResults().size(); } added = true; } } return added; }