org.xmldb.api.base
Interface ResourceSet
- ResourceSetImpl, SimpleResourceSet
public interface ResourceSet
ResourceSet is a container for a set of resources. Generally a
ResourceSet
is obtained as the result of a query.
addResource
public void addResource(Resource res)
throws XMLDBException
Adds a Resource
instance to the set.
res
- The Resource
to add to the set.
XMLDBException
- with expected error codes.
ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.
clear
public void clear()
throws XMLDBException
Removes all Resource
instances from the set.
XMLDBException
- with expected error codes.
ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.
getIterator
public ResourceIterator getIterator()
throws XMLDBException
Returns an iterator over all Resource
instances stored in the set.
- a
ResourceIterator
over all Resource
instances in the set.
XMLDBException
- with expected error codes.
ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.
getMembersAsResource
public Resource getMembersAsResource()
throws XMLDBException
Returns a Resource containing an XML representation of all resources
stored in the set.
TODO: Specify the schema used for this
- A
Resource
instance containing an XML representation
of all set members.
XMLDBException
- with expected error codes.
ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.
getResource
public Resource getResource(long index)
throws XMLDBException
Returns the
Resource
instance stored at the index specified
by index.
If the underlying implementation uses a paging or streaming optimization
for retrieving Resource instances. Calling this method MAY result in a
block until the requested Resource has been downloaded.
index
- the index of the resource to retrieve.
XMLDBException
- with expected error codes.
ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.
ErrorCodes.NO_SUCH_RESOURCE if the index is out of range for the
set.
getSize
public long getSize()
throws XMLDBException
Returns the number of resources contained in the set.
If the underlying implementation uses a paging or streaming optimization
for retrieving
Resource
instances. Calling this method MAY
force the downloading of all set members before the size can be determined.
- The number of
Resource
instances in the set.
XMLDBException
- with expected error codes.
ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.
removeResource
public void removeResource(long index)
throws XMLDBException
Removes the Resource located at index
from the set.
index
- The index of the Resource
instance to remove.
XMLDBException
- with expected error codes.
ErrorCodes.VENDOR_ERROR
for any vendor
specific errors that occur.