Package ca.phon.query.db.xml
Class XMLLazyResultSet
java.lang.Object
ca.phon.query.db.xml.XMLResultSet
ca.phon.query.db.xml.XMLLazyResultSet
- All Implemented Interfaces:
ResultSet
,JAXBWrapper<ResultSetType>
,Iterable<Result>
Similar to
XMLResultSet
, except loading of result set data is lazy
(i.e., delayed as long as possible).-
Field Summary
Fields inherited from class ca.phon.query.db.xml.XMLResultSet
resultSet
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add the given result to the result setgetResult
(int idx) Get the result specified by the given index.Get the JAXB element associated with this object.iterator()
Return an iterator for all results in this set.iterator
(boolean includeExcluded) Return an iterator for resultsprotected void
loadData()
Lazy loading of XML data.int
numberOfResults
(boolean includeExcluded) Returns the number of results in this set.removeResult
(int idx) Remove the result specified by the given index.int
size()
Get the number of results in this set.Methods inherited from class ca.phon.query.db.xml.XMLResultSet
getCorpus, getMetadataKeys, getSession, getSessionPath, setSessionPath, setSessionPath
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
loadData
protected void loadData()Lazy loading of XML data. -
getXMLObject
Description copied from class:XMLResultSet
Get the JAXB element associated with this object.- Specified by:
getXMLObject
in interfaceJAXBWrapper<ResultSetType>
- Overrides:
getXMLObject
in classXMLResultSet
- Returns:
- the JAXB object
-
size
public int size()Description copied from interface:ResultSet
Get the number of results in this set.- Specified by:
size
in interfaceResultSet
- Overrides:
size
in classXMLResultSet
- Returns:
- the size of the result set
-
removeResult
Description copied from interface:ResultSet
Remove the result specified by the given index.- Specified by:
removeResult
in interfaceResultSet
- Overrides:
removeResult
in classXMLResultSet
- Returns:
- the removed result
-
getResult
Description copied from interface:ResultSet
Get the result specified by the given index.- Specified by:
getResult
in interfaceResultSet
- Overrides:
getResult
in classXMLResultSet
- Returns:
- the result for the given index
-
addResult
Description copied from interface:ResultSet
Add the given result to the result set- Specified by:
addResult
in interfaceResultSet
- Overrides:
addResult
in classXMLResultSet
-
numberOfResults
public int numberOfResults(boolean includeExcluded) Description copied from interface:ResultSet
Returns the number of results in this set.- Specified by:
numberOfResults
in interfaceResultSet
- Overrides:
numberOfResults
in classXMLResultSet
- 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
-
iterator
Description copied from interface:ResultSet
Return an iterator for results- Specified by:
iterator
in interfaceResultSet
- Overrides:
iterator
in classXMLResultSet
- Returns:
- iterator
-
iterator
Description copied from interface:ResultSet
Return an iterator for all results in this set. This is the same as calling iterator(true).
-