TextSearchResult next() {
		if (results.size() == 0) {
			findNext();
		}

		boolean isForward = options.isForward();
		if (isForward && locationIterator.hasNext()) {
			TextSearchResult result = locationIterator.next();
			if (!locationIterator.hasNext()) {
				results.clear();
				locationIterator = results.listIterator();
			}
			return result;
		}

		if (!isForward && locationIterator.hasPrevious()) {
			TextSearchResult result = locationIterator.previous();
			if (!locationIterator.hasPrevious()) {
				results.clear();
				locationIterator = results.listIterator();
			}
			return result;
		}
		return null;
	}
Constructor
@param tool the tool
@param program current program
@param startLocation location from where to begin searching
@param set address set; may be null
@param options search options
@param monitor progress monitor
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/searchtext/ListingDisplaySearcher.java