Package org.dlese.dpc.index
Class ResultDocList
java.lang.Object
java.util.AbstractCollection
java.util.AbstractList
org.dlese.dpc.index.ResultDocList
- All Implemented Interfaces:
Iterable,Collection,List,SequencedCollection
A List of ResultDocs returned by a SimpleLucenIndex search.
- Author:
- John Weatherley
- See Also:
-
Field Summary
Fields inherited from class java.util.AbstractList
modCount -
Constructor Summary
ConstructorsConstructorDescriptionCreates an empty ResultDocList that can not be expanded.ResultDocList(org.apache.lucene.search.TopDocs topDocs, ResultDocConfig resultDocConfig) Creates a ResultDocList backed by the given search results that can not be expanded.ResultDocList(ResultDoc[] resultDocs) Creates a ResultDocList backed by the given resultDocs that can not be expanded. -
Method Summary
Modifier and TypeMethodDescriptionget(int i) Get the ResultDoc at the given location.static final StringGets a datestamp of the current time formatted for display with logs and output.static voidsetDebug(boolean db) Sets the debug attribute of the SimpleLuceneIndex objectintsize()The number of search results.toArray()Gets the ResultDocs as an array.Methods inherited from class java.util.AbstractList
add, add, addAll, clear, equals, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, removeRange, set, subListMethods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArrayMethods inherited from interface java.util.List
addAll, addFirst, addLast, contains, containsAll, getFirst, getLast, isEmpty, remove, removeAll, removeFirst, removeLast, replaceAll, retainAll, reversed, sort, spliterator, toArray
-
Constructor Details
-
ResultDocList
public ResultDocList()Creates an empty ResultDocList that can not be expanded. -
ResultDocList
Creates a ResultDocList backed by the given resultDocs that can not be expanded.- Parameters:
resultDocs- The result docs that back this ResultDocList.
-
ResultDocList
Creates a ResultDocList backed by the given search results that can not be expanded. Constructed by SimpleLuceneIndex when a search is made.- Parameters:
topDocs- The TopDocsresultDocConfig- The config
-
-
Method Details
-
get
Get the ResultDoc at the given location.- Specified by:
getin interfaceList- Specified by:
getin classAbstractList- Parameters:
i- Index- Returns:
- The ResultDoc
-
size
public int size()The number of search results.- Specified by:
sizein interfaceCollection- Specified by:
sizein interfaceList- Specified by:
sizein classAbstractCollection- Returns:
- The number of search results.
-
toArray
Gets the ResultDocs as an array. Note that this is significantly less efficient than using the List methods for access.- Specified by:
toArrayin interfaceCollection- Specified by:
toArrayin interfaceList- Overrides:
toArrayin classAbstractCollection- Returns:
- The ResultDocs
-
getDateStamp
Gets a datestamp of the current time formatted for display with logs and output.- Returns:
- A datestamp for display purposes.
-
setDebug
public static void setDebug(boolean db) Sets the debug attribute of the SimpleLuceneIndex object- Parameters:
db- The new debug value
-