|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dlese.dpc.schemedit.RecordList
public class RecordList
Class to manage a list of records (e.g. search results) as a list of RECORD IDS, rather than as ResultDoc arrays. We don't want to keep sets of ResultDocs around because they take up memory and also because they can become stale over time.
Constructor Summary | |
---|---|
RecordList()
Constructor for the RecordList object |
|
RecordList(ResultDocList resultDocs,
SimpleLuceneIndex index)
Constructor for the RecordList object given a ResultDocList and a SimpleLuceneIndex. |
|
RecordList(SimpleLuceneIndex index)
Constructor for the RecordList object |
|
RecordList(String[] ids,
SimpleLuceneIndex index)
Constructor for the RecordList object given an array of ids |
|
RecordList(String query,
SimpleLuceneIndex index)
Contructor for the RecordList object given a query string and a lucene index |
Method Summary | |
---|---|
void |
add(String id)
Add the id to this RecordLists's items |
boolean |
contains(String id)
returns true of the provided id is managed by this RecordList |
String |
getCurrentRecId()
Id of the current record. |
int |
getCurrentRecIndex()
Index of the current record in the result list. |
ResultDoc |
getCurrentResult()
Gets the current record as a ResultDoc instance. |
List |
getHits()
Returns the records as a list of ResultDocs |
List |
getHits(int start,
int length)
Returns a list of recordDocs for the specified range. |
int |
getIndexOf(String id)
Returns the index of the specified id, or -1 if it is not managed by this RecordList |
boolean |
getIsEmpty()
Gets the isEmpty attribute of the RecordList object |
List |
getItems()
List of record ids returned by the last query. |
String |
getRecId(int recIndex)
Gets the recId attribute of the RecordList object |
ResultDoc |
getResultDoc(String id)
Gets the ResultDoc given a record id via the index. |
ResultDoc |
getResultDoc(String id,
SimpleLuceneIndex index)
Gets the resultDoc for a particular record by searching the index. |
int |
getSize()
Gets the size attribute of the RecordList object |
boolean |
isEmpty()
Gets the empty attribute of the RecordList object |
Iterator |
iterator()
Returns an iterator for the current record list. |
void |
setCurrentRecId(String id)
Sets the currentRecId attribute of the RecordList object |
void |
setIndex(SimpleLuceneIndex index)
Sets the index attribute of the RecordList object |
int |
size()
The number of items |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RecordList()
public RecordList(SimpleLuceneIndex index)
index
- the indexpublic RecordList(String query, SimpleLuceneIndex index)
query
- the queryindex
- a lucene indexpublic RecordList(ResultDocList resultDocs, SimpleLuceneIndex index)
resultDocs
- the resultDocListindex
- the indexpublic RecordList(String[] ids, SimpleLuceneIndex index)
BatchOperations.handleRemoveRecords() uses this method for the values returned by request.getParameterValues().
ids
- An array of RecordIdsindex
- the indexMethod Detail |
---|
public int size()
public int getSize()
public Iterator iterator()
public boolean contains(String id)
id
- id to check against items
public void add(String id)
id
- id to addpublic boolean isEmpty()
public boolean getIsEmpty()
public int getIndexOf(String id)
id
- a record id to find the index of in this ResultList
public List getItems()
public void setIndex(SimpleLuceneIndex index)
index
- The new index valuepublic List getHits()
public List getHits(int start, int length)
start
- beginning indexlength
- length of range
public String getCurrentRecId()
public void setCurrentRecId(String id)
id
- The new currentRecId valuepublic int getCurrentRecIndex()
public ResultDoc getCurrentResult()
public ResultDoc getResultDoc(String id)
id
- the id for which to obtain a ResultDoc
public ResultDoc getResultDoc(String id, SimpleLuceneIndex index)
id
- record idindex
- the index
public String getRecId(int recIndex)
recIndex
- NOT YET DOCUMENTED
|
DLESE Tools v1.6.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |