DLESE Tools
v1.6.0

org.dlese.dpc.index
Class ResultDocList

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList
          extended by org.dlese.dpc.index.ResultDocList
All Implemented Interfaces:
Iterable, Collection, List

public class ResultDocList
extends AbstractList

A List of ResultDocs returned by a SimpleLucenIndex search.

Author:
John Weatherley
See Also:
SimpleLuceneIndex, ResultDoc

Field Summary
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
ResultDocList()
          Creates an empty ResultDocList that can not be expanded.
ResultDocList(ResultDoc[] resultDocs)
          Creates a ResultDocList backed by the given resultDocs 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.
 
Method Summary
 ResultDoc get(int i)
          Get the ResultDoc at the given location.
static String getDateStamp()
          Gets a datestamp of the current time formatted for display with logs and output.
static void setDebug(boolean db)
          Sets the debug attribute of the SimpleLuceneIndex object
 int size()
          The number of search results.
 ResultDoc[] 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, subList
 
Methods inherited from class java.util.AbstractCollection
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
addAll, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray
 

Constructor Detail

ResultDocList

public ResultDocList()
Creates an empty ResultDocList that can not be expanded.


ResultDocList

public ResultDocList(ResultDoc[] resultDocs)
Creates a ResultDocList backed by the given resultDocs that can not be expanded.

Parameters:
resultDocs - The result docs that back this ResultDocList.

ResultDocList

public ResultDocList(org.apache.lucene.search.TopDocs topDocs,
                     ResultDocConfig resultDocConfig)
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 TopDocs
resultDocConfig - The config
Method Detail

get

public ResultDoc get(int i)
Get the ResultDoc at the given location.

Specified by:
get in interface List
Specified by:
get in class AbstractList
Parameters:
i - Index
Returns:
The ResultDoc

size

public int size()
The number of search results.

Specified by:
size in interface Collection
Specified by:
size in interface List
Specified by:
size in class AbstractCollection
Returns:
The number of search results.

toArray

public ResultDoc[] toArray()
Gets the ResultDocs as an array. Note that this is significantly less efficient than using the List methods for access.

Specified by:
toArray in interface Collection
Specified by:
toArray in interface List
Overrides:
toArray in class AbstractCollection
Returns:
The ResultDocs

getDateStamp

public static final String 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

DLESE Tools
v1.6.0