Package ca.phon.query.db
Interface ResultSet
- All Known Implementing Classes:
XMLLazyResultSet
,XMLResultSet
Interface for a set of results from a Phon query.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add the given result to the result setGets the corpus name for this result set.String[]
Return the list of metadata keys used in the result set.getResult
(int idx) Get the result specified by the given index.Gets the session name for this result set.Gets the session path for this result set.iterator()
Return an iterator for all results in this set.iterator
(boolean includeExcluded) Return an iterator for resultsint
numberOfResults
(boolean includeExcluded) Returns the number of results in this set.removeResult
(int idx) Remove the result specified by the given index.void
setSessionPath
(String sessionPath) Sets the session path for this result set.void
setSessionPath
(String corpus, String session) Sets the session path for this result set.int
size()
Get the number of results in this set.Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
getCorpus
String getCorpus()Gets the corpus name for this result set.- Returns:
- the corpus name
-
getSession
String getSession()Gets the session name for this result set.- Returns:
- the session name
-
getSessionPath
String getSessionPath()Gets the session path for this result set. The session path should be of the form [corpus].[session]- Returns:
- the session path
-
setSessionPath
Sets the session path for this result set. The session path should be of the form [corpus].[session]- Parameters:
sessionPath
- the session path
-
setSessionPath
Sets the session path for this result set. The session path will be of the form [corpus].[session]- Parameters:
sessionPath
- the session path
-
size
int size()Get the number of results in this set.- Returns:
- the size of the result set
-
getResult
Get the result specified by the given index.- Parameters:
idx
-- Returns:
- the result for the given index
- Throws:
ArrayIndexOutOfBoundsException
-
removeResult
Remove the result specified by the given index.- Parameters:
idx
-- Returns:
- the removed result
- Throws:
ArrayIndexOutOfBoundsException
-
addResult
Add the given result to the result set- Parameters:
result
-
-
numberOfResults
int numberOfResults(boolean includeExcluded) Returns the number of results in this set.- Parameters:
includeExcluded
- include excluded results in the set. Iftrue
this will return this same value asinvalid @link
#getResults()
- Returns:
- the number of (non-excluded) results in this set
-
getMetadataKeys
String[] getMetadataKeys()Return the list of metadata keys used in the result set.- Returns:
- the list of metadata keys
-
iterator
Return an iterator for results- Parameters:
includeExcluded
-- Returns:
- iterator
-
iterator
Return an iterator for all results in this set. This is the same as calling iterator(true).
-