Package org.xmldb.api.base
Interface ResourceSet
-
- All Known Implementing Classes:
ResourceSetImpl
,SimpleResourceSet
public interface ResourceSet
ResourceSet is a container for a set of resources. Generally aResourceSet
is obtained as the result of a query.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addAll(ResourceSet rSet)
Adds allResource
instances in the resourceSet to this set.void
addResource(Resource res)
Adds aResource
instance to the set.void
clear()
Removes allResource
instances from the set.ResourceIterator
getIterator()
Returns an iterator over allResource
instances stored in the set.Resource
getMembersAsResource()
Returns a Resource containing an XML representation of all resources stored in the set.Resource
getResource(int index)
Returns theResource
instance stored at the index specified by index.int
getSize()
Returns the number of resources contained in the set.void
removeResource(int index)
Removes the Resource located atindex
from the set.
-
-
-
Method Detail
-
getResource
Resource getResource(int index) throws XMLDBException
Returns theResource
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.- Parameters:
index
- the index of the resource to retrieve.- Returns:
- The
Resource
instance - Throws:
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.
-
addResource
void addResource(Resource res) throws XMLDBException
Adds aResource
instance to the set.- Parameters:
res
- TheResource
to add to the set.- Throws:
XMLDBException
- with expected error codes.
ErrorCodes.VENDOR_ERROR
for any vendor specific errors that occur.
-
addAll
void addAll(ResourceSet rSet) throws XMLDBException
Adds allResource
instances in the resourceSet to this set.- Parameters:
rSet
- TheResourceSet
containing all theResource
's to add to the set.- Throws:
XMLDBException
- with expected error codes.
ErrorCodes.VENDOR_ERROR
for any vendor specific errors that occur.
-
removeResource
void removeResource(int index) throws XMLDBException
Removes the Resource located atindex
from the set.- Parameters:
index
- The index of theResource
instance to remove.- Throws:
XMLDBException
- with expected error codes.
ErrorCodes.VENDOR_ERROR
for any vendor specific errors that occur.
-
getIterator
ResourceIterator getIterator() throws XMLDBException
Returns an iterator over allResource
instances stored in the set.- Returns:
- a
ResourceIterator
over allResource
instances in the set. - Throws:
XMLDBException
- with expected error codes.
ErrorCodes.VENDOR_ERROR
for any vendor specific errors that occur.
-
getMembersAsResource
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- Returns:
- A
Resource
instance containing an XML representation of all set members. - Throws:
XMLDBException
- with expected error codes.
ErrorCodes.VENDOR_ERROR
for any vendor specific errors that occur.
-
getSize
int getSize() throws XMLDBException
Returns the number of resources contained in the set. If the underlying implementation uses a paging or streaming optimization for retrievingResource
instances. Calling this method MAY force the downloading of all set members before the size can be determined.- Returns:
- The number of
Resource
instances in the set. - Throws:
XMLDBException
- with expected error codes.
ErrorCodes.VENDOR_ERROR
for any vendor specific errors that occur.
-
clear
void clear() throws XMLDBException
Removes allResource
instances from the set.- Throws:
XMLDBException
- with expected error codes.
ErrorCodes.VENDOR_ERROR
for any vendor specific errors that occur.
-
-