Xindice API
version 1.1

org.apache.xindice.client.xmldb
Class ResourceSetImpl

java.lang.Object
  extended by org.apache.xindice.client.xmldb.ResourceSetImpl
All Implemented Interfaces:
org.xmldb.api.base.ResourceSet

public class ResourceSetImpl
extends Object
implements org.xmldb.api.base.ResourceSet

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

Version:
$Revision: 518460 $, $Date: 2007-03-15 04:47:19 +0100 (Thu, 15 Mar 2007) $

Field Summary
protected  org.xmldb.api.base.Collection collection
           
static String RESOURCE_SET_NS
           
protected  List resources
           
 
Constructor Summary
ResourceSetImpl(org.xmldb.api.base.Collection collection, org.w3c.dom.Document doc)
           
ResourceSetImpl(org.xmldb.api.base.Collection collection, SymbolTable symbols, byte[] bytes)
           
 
Method Summary
 void addAll(org.xmldb.api.base.ResourceSet rSet)
          Adds all Resource instances in the resourceSet to this set.
 void addResource(org.xmldb.api.base.Resource res)
          Adds a Resource instance to the set.
 void clear()
          Removes all Resource instances from the set.
 org.xmldb.api.base.ResourceIterator getIterator()
          Returns an iterator over all Resource instances stored in the set.
 org.xmldb.api.base.Resource getMembersAsResource()
          Returns a Resource containing an XML representation of all resources stored in the set.
 org.xmldb.api.base.Resource getResource(int index)
           
 org.xmldb.api.base.Resource getResource(long index)
          Returns the Resource instance stored at the index specified by index.
 int getSize()
          Returns the number of resources contained in the set.
protected  void initResources(org.w3c.dom.Document document)
           
 void removeResource(int index)
           
 void removeResource(long index)
          Removes the Resource located at index from the set.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RESOURCE_SET_NS

public static final String RESOURCE_SET_NS
See Also:
Constant Field Values

resources

protected List resources

collection

protected org.xmldb.api.base.Collection collection
Constructor Detail

ResourceSetImpl

public ResourceSetImpl(org.xmldb.api.base.Collection collection,
                       org.w3c.dom.Document doc)
                throws org.xmldb.api.base.XMLDBException
Throws:
org.xmldb.api.base.XMLDBException

ResourceSetImpl

public ResourceSetImpl(org.xmldb.api.base.Collection collection,
                       SymbolTable symbols,
                       byte[] bytes)
                throws org.xmldb.api.base.XMLDBException
Throws:
org.xmldb.api.base.XMLDBException
Method Detail

initResources

protected void initResources(org.w3c.dom.Document document)
                      throws org.xmldb.api.base.XMLDBException
Throws:
org.xmldb.api.base.XMLDBException

getIterator

public org.xmldb.api.base.ResourceIterator getIterator()
                                                throws org.xmldb.api.base.XMLDBException
Returns an iterator over all Resource instances stored in the set.

Specified by:
getIterator in interface org.xmldb.api.base.ResourceSet
Returns:
a ResourceIterator over all Resource instances in the set.
Throws:
org.xmldb.api.base.XMLDBException

getResource

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

Parameters:
index - the index of the resource to retrieve.
Returns:
the Resource instance.
Throws:
org.xmldb.api.base.XMLDBException

getResource

public org.xmldb.api.base.Resource getResource(int index)
                                        throws org.xmldb.api.base.XMLDBException
Specified by:
getResource in interface org.xmldb.api.base.ResourceSet
Throws:
org.xmldb.api.base.XMLDBException

getSize

public int getSize()
            throws org.xmldb.api.base.XMLDBException
Returns the number of resources contained in the set.

Specified by:
getSize in interface org.xmldb.api.base.ResourceSet
Returns:
the number of Resource instances in the set.
Throws:
org.xmldb.api.base.XMLDBException

addResource

public void addResource(org.xmldb.api.base.Resource res)
                 throws org.xmldb.api.base.XMLDBException
Adds a Resource instance to the set.

Specified by:
addResource in interface org.xmldb.api.base.ResourceSet
Throws:
org.xmldb.api.base.XMLDBException

addAll

public void addAll(org.xmldb.api.base.ResourceSet rSet)
            throws org.xmldb.api.base.XMLDBException
Adds all Resource instances in the resourceSet to this set.

Specified by:
addAll in interface org.xmldb.api.base.ResourceSet
Parameters:
rSet - The ResourceSet containing all the Resource's to add to the set.
Throws:
org.xmldb.api.base.XMLDBException - with expected error codes.
ErrorCodes.VENDOR_ERROR for any vendor specific errors that occur.

clear

public void clear()
           throws org.xmldb.api.base.XMLDBException
Removes all Resource instances from the set.

Specified by:
clear in interface org.xmldb.api.base.ResourceSet
Throws:
org.xmldb.api.base.XMLDBException

removeResource

public void removeResource(long index)
                    throws org.xmldb.api.base.XMLDBException
Removes the Resource located at index from the set.

Parameters:
index - The index of the Resource instance to remove.
Throws:
org.xmldb.api.base.XMLDBException

removeResource

public void removeResource(int index)
                    throws org.xmldb.api.base.XMLDBException
Specified by:
removeResource in interface org.xmldb.api.base.ResourceSet
Throws:
org.xmldb.api.base.XMLDBException

getMembersAsResource

public org.xmldb.api.base.Resource getMembersAsResource()
                                                 throws org.xmldb.api.base.XMLDBException
Returns a Resource containing an XML representation of all resources stored in the set.

Specified by:
getMembersAsResource in interface org.xmldb.api.base.ResourceSet
Returns:
A Resource instance containing an XML representation of all set members.
Throws:
org.xmldb.api.base.XMLDBException

Xindice API
version 1.1

Copyright (c) 1999-2007 The Apache Software Foundation. All Rights Reserved.