Package org.xmldb.api.base
Interface ResourceSet
-
public interface ResourceSetResourceSet is a container for a set of resources. Generally aResourceSetis obtained as the result of a query.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddAll(ResourceSet rSet)Adds allResourceinstances in the resourceSet to this set.voidaddResource(Resource res)Adds aResourceinstance to the set.voidclear()Removes allResourceinstances from the set.ResourceIteratorgetIterator()Returns an iterator over allResourceinstances stored in the set.ResourcegetMembersAsResource()Returns a Resource containing an XML representation of all resources stored in the set.ResourcegetResource(long index)Returns theResourceinstance stored at the index specified by index.longgetSize()Returns the number of resources contained in the set.voidremoveResource(long index)Removes the Resource located atindexfrom the set.
-
-
-
Method Detail
-
getResource
Resource getResource(long index) throws XMLDBException
Returns theResourceinstance 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
Resourceinstance - Throws:
XMLDBException- with expected error codes.ErrorCodes.VENDOR_ERRORfor any vendor specific errors that occur.ErrorCodes.NO_SUCH_RESOURCEif the index is out of range for the set.
-
addResource
void addResource(Resource res) throws XMLDBException
Adds aResourceinstance to the set.- Parameters:
res- TheResourceto add to the set.- Throws:
XMLDBException- with expected error codes.ErrorCodes.VENDOR_ERRORfor any vendor specific errors that occur.
-
addAll
void addAll(ResourceSet rSet) throws XMLDBException
Adds allResourceinstances in the resourceSet to this set.- Parameters:
rSet- TheResourceSetcontaining all theResource's to add to the set.- Throws:
XMLDBException- with expected error codes.ErrorCodes.VENDOR_ERRORfor any vendor specific errors that occur.
-
removeResource
void removeResource(long index) throws XMLDBExceptionRemoves the Resource located atindexfrom the set.- Parameters:
index- The index of theResourceinstance to remove.- Throws:
XMLDBException- with expected error codes.ErrorCodes.VENDOR_ERRORfor any vendor specific errors that occur.
-
getIterator
ResourceIterator getIterator() throws XMLDBException
Returns an iterator over allResourceinstances stored in the set.- Returns:
- a
ResourceIteratorover allResourceinstances in the set. - Throws:
XMLDBException- with expected error codes.ErrorCodes.VENDOR_ERRORfor 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.- Returns:
- A
Resourceinstance containing an XML representation of all set members. - Throws:
XMLDBException- with expected error codes.ErrorCodes.VENDOR_ERRORfor any vendor specific errors that occur.
-
getSize
long getSize() throws XMLDBExceptionReturns the number of resources contained in the set. If the underlying implementation uses a paging or streaming optimization for retrievingResourceinstances. Calling this method MAY force the downloading of all set members before the size can be determined.- Returns:
- The number of
Resourceinstances in the set. - Throws:
XMLDBException- with expected error codes.ErrorCodes.VENDOR_ERRORfor any vendor specific errors that occur.
-
clear
void clear() throws XMLDBExceptionRemoves allResourceinstances from the set.- Throws:
XMLDBException- with expected error codes.ErrorCodes.VENDOR_ERRORfor any vendor specific errors that occur.
-
-