Xindice API

org.apache.xindice.client.xmldb
Class ResourceSetImpl

java.lang.Object
  |
  +--org.apache.xindice.client.xmldb.ResourceSetImpl
All Implemented Interfaces:
ResourceSet

public class ResourceSetImpl
extends java.lang.Object
implements ResourceSet

ResourceSet contains a set of resources as returned from a query or other operation.


Field Summary
static java.lang.String RESOURCE_SET_NS
           
 
Constructor Summary
ResourceSetImpl(Collection collection, org.w3c.dom.Document doc)
           
ResourceSetImpl(Collection collection, SymbolTable symbols, byte[] bytes)
           
 
Method Summary
 void addResource(Resource res)
          Adds a Resource instance to the set.
 void clear()
          Removes all Resource instances from the set.
 ResourceIterator getIterator()
          Returns an iterator over all Resource instances stored in the set.
 Resource getMembersAsResource()
          Returns a Resource containing an XML representation of all resources stored in the set.
 Resource getResource(long index)
          Returns the Resource instance stored at the index specified by index.

 long getSize()
          Returns the number of resources contained in the set.

 void removeResource(long index)
          Removes the Resource located at index from the set.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE_SET_NS

public static final java.lang.String RESOURCE_SET_NS
Constructor Detail

ResourceSetImpl

public ResourceSetImpl(Collection collection,
                       org.w3c.dom.Document doc)
                throws XMLDBException

ResourceSetImpl

public ResourceSetImpl(Collection collection,
                       SymbolTable symbols,
                       byte[] bytes)
                throws XMLDBException
Method Detail

getIterator

public ResourceIterator getIterator()
                             throws XMLDBException
Returns an iterator over all Resource instances stored in the set.
Specified by:
getIterator in interface ResourceSet
Returns:
a ResourceIterator over all Resource instances in the set.
Throws:
XMLDBException -  

getResource

public Resource getResource(long index)
                     throws XMLDBException
Returns the Resource instance stored at the index specified by index.

Specified by:
getResource in interface ResourceSet
Parameters:
index - the index of the resource to retrieve.
Returns:
the Resource instance.
Throws:
XMLDBException -  

getSize

public long getSize()
             throws XMLDBException
Returns the number of resources contained in the set.

Specified by:
getSize in interface ResourceSet
Returns:
the number of Resource instances in the set.
Throws:
XMLDBException -  

addResource

public void addResource(Resource res)
                 throws XMLDBException
Adds a Resource instance to the set.
Specified by:
addResource in interface ResourceSet
Throws:
XMLDBException -  

clear

public void clear()
           throws XMLDBException
Removes all Resource instances from the set.
Specified by:
clear in interface ResourceSet
Throws:
XMLDBException -  

removeResource

public void removeResource(long index)
                    throws XMLDBException
Removes the Resource located at index from the set.
Specified by:
removeResource in interface ResourceSet
Parameters:
index - The index of the Resource instance to remove.
Throws:
XMLDBException -  

getMembersAsResource

public Resource getMembersAsResource()
                              throws XMLDBException
Returns a Resource containing an XML representation of all resources stored in the set.
Specified by:
getMembersAsResource in interface ResourceSet
Returns:
A Resource instance containing an XML representation of all set members.
Throws:
XMLDBException -  

Xindice API

Copyright (c) 1999-2001 The Apache Software Foundation