|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.autonomy.aci.businessobjects.ResultList
General container for storing IDOL responses that contain 'autn:hit's (for example from action=Query,Suggest,AgentGetResults etc).
Documents are accessed directly using the getDocumentByReference
method
while the getDocuments
and iterator
methods provide mechanisms
for processing the entire set of documents.
'Meta' information about the result set and the query that generated it is stored in MetaFields.
Depending on the parameter send with the query this can include information such as the total
number of hits that match the query, the query expansion options for the query etc.
These fields are accessible through the getMetaDataFields
and
getMetaDataFieldValue
methods although convenience methods are provided for
reading the values of the most common fields.
Field Summary | |
static java.lang.String |
QUERY_SUMMARY_AUTN_FIELD_NAME
The name of the query summary (a.k.a. |
static java.lang.String |
SPELLING_LIST_AUTN_FIELD_NAME
The name of the spelling XML element found in IDOL responses. |
static java.lang.String |
SPELLING_QUERY_AUTN_FIELD_NAME
The name of the spelling query XML element found in IDOL responses. |
static java.lang.String |
TOTAL_HITS_AUTN_FIELD_NAME
The name of the total hits XML element found in IDOL responses. |
Constructor Summary | |
ResultList()
Construct a ResultList object containing no ResultDocument s. |
|
ResultList(java.util.ArrayList alDocuments)
Construct a ResultList object containing the ResultDocument s supplied. |
Method Summary | |
void |
addDocument(ResultDocument document)
Add the specified document to the list of documents associated with this result set. |
void |
addMetaDataField(java.lang.String sMetaDataFieldName,
java.lang.String sMetaDataFieldValue)
Associate a meta data field with this result set. |
void |
clearDocuments()
Remove all the documents contained in this result set. |
void |
clearMetaDataFields()
Remove all the meta data fields associated with this result set. |
ResultDocument |
getDocumentByReference(java.lang.String sDocReference)
Retrieve the document with the matching reference from the result set. |
int |
getDocumentCount()
Calculate the number of result documents in this result set. |
java.util.ArrayList |
getDocuments()
Read all the documents contained in this result set. |
java.util.HashMap |
getMetaDataFields()
Read all the meta data fields associated with this result set. |
java.lang.String |
getMetaDataFieldValue(java.lang.String sMetaDataFieldName)
Read the value of the specified meta data field. |
java.lang.String |
getMetaDataFieldValue(java.lang.String sMetaDataFieldName,
java.lang.String sDefaultValue)
Read the value of the specified meta data field. |
java.util.ArrayList |
getQuerySummary()
Read the terms in the summary of the query that generated this result set. |
java.util.ArrayList |
getSpellingList()
Read the terms in the spelling list of the query that generated this result set. |
java.lang.String |
getSpellingQuery()
Read the contents of the corrected spelling query generated this result set. |
int |
getTotalHits()
Read the total number of hits for the query that generated this result set. |
java.util.Iterator |
iterator()
Obtain an iterator over the result documents in this result set |
void |
removeDocument(Document document)
Delete the specified document from the list of documents associated with this result set. |
void |
setDocuments(java.util.ArrayList documentList)
Set the result documents associated with this result set. |
void |
setMetaDataFields(java.util.Map metaDataFieldsMap)
Set the meta data fields associated with this result set. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String SPELLING_LIST_AUTN_FIELD_NAME
public static final java.lang.String SPELLING_QUERY_AUTN_FIELD_NAME
public static final java.lang.String QUERY_SUMMARY_AUTN_FIELD_NAME
public static final java.lang.String TOTAL_HITS_AUTN_FIELD_NAME
Constructor Detail |
public ResultList()
ResultList
object containing no ResultDocument
s.
public ResultList(java.util.ArrayList alDocuments)
ResultList
object containing the ResultDocument
s supplied.
Method Detail |
public void setMetaDataFields(java.util.Map metaDataFieldsMap)
metaDataFieldsMap
- a Map
specifying the field names and values which should
be associated with this result set.public void addMetaDataField(java.lang.String sMetaDataFieldName, java.lang.String sMetaDataFieldValue)
sMetaDataFieldName
- the name of the meta data field.sMetaDataFieldValue
- the value to give the meta data field.public void clearMetaDataFields()
public void setDocuments(java.util.ArrayList documentList)
documentList
- a List
of ResultDocument
s which should be associated
with this result set.public void addDocument(ResultDocument document)
document
- the document to add.public void removeDocument(Document document)
document
- the document to delete. The Document
object must have at least
the document reference set.public void clearDocuments()
public java.util.ArrayList getDocuments()
ArrayList
of ResultDocument
s representing the documents
retrieved by a request to an ACI server.public ResultDocument getDocumentByReference(java.lang.String sDocReference)
sDocReference
- the reference of the document to find.
null
if no matching
document could be found.public java.util.HashMap getMetaDataFields()
HashMap
containing the meta data fields as key-value pairs.public java.lang.String getMetaDataFieldValue(java.lang.String sMetaDataFieldName)
sMetaDataFieldName
- the name of the meta data field. This must include the
"autn:" namespace prefix if it is present in the ACI response.
null
if the field does not exist.public java.lang.String getMetaDataFieldValue(java.lang.String sMetaDataFieldName, java.lang.String sDefaultValue)
sMetaDataFieldName
- the name of the meta data field. This must include the
"autn:" namespace prefix if it is present in the ACI response.sDefaultValue
- the value to return if the field does not exist.
public java.util.ArrayList getSpellingList()
ArrayList
of String
s giving the query summary terms.public java.lang.String getSpellingQuery()
String
giving the query text after spelling correction.public java.util.ArrayList getQuerySummary()
ArrayList
of String
s giving the query summary terms.public int getTotalHits()
int
.public java.util.Iterator iterator()
Iterator
over the ResultDocument
s in this result list.public int getDocumentCount()
getDocuments().size()
on this
.
ResultDocument
s in this result set.public java.lang.String toString()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |