org.exist.xmldb
Class MapResourceSet

java.lang.Object
  extended by org.exist.xmldb.MapResourceSet
All Implemented Interfaces:
ResourceSet

public class MapResourceSet
extends Object
implements ResourceSet

Implementation of ResourceSet (a container of Resource objects), using internally both a Map and a Vector. The Map is keyed by the Id of each resource.

Author:
Jean-Marc Vanel (2 April 2003)

Constructor Summary
MapResourceSet()
           
MapResourceSet(Map<String,Resource> resources)
          Constructor
MapResourceSet(ResourceSet rs)
          Constructor
 
Method Summary
 void addResource(Resource resource)
          Adds a resource to the container
 void clear()
          Make the container empty
 ResourceIterator getIterator()
          Gets the iterator property
 ResourceIterator getIterator(long start)
          Gets the iterator property, starting from a given position
 Resource getMembersAsResource()
          Gets the membersAsResource property of the object
 Resource getResource(long pos)
          Gets the resource at a given position.
 Map<String,Resource> getResourcesMap()
           
 long getSize()
          Gets the size property
 void removeResource(long pos)
          Removes the resource at a given position.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MapResourceSet

public MapResourceSet()

MapResourceSet

public MapResourceSet(Map<String,Resource> resources)
Constructor


MapResourceSet

public MapResourceSet(ResourceSet rs)
               throws XMLDBException
Constructor

Throws:
XMLDBException
Method Detail

getResourcesMap

public Map<String,Resource> getResourcesMap()

addResource

public void addResource(Resource resource)
                 throws XMLDBException
Adds a resource to the container

Specified by:
addResource in interface ResourceSet
Parameters:
resource - The resource to be added to the object
Throws:
XMLDBException

clear

public void clear()
           throws XMLDBException
Make the container empty

Specified by:
clear in interface ResourceSet
Throws:
XMLDBException

getIterator

public ResourceIterator getIterator()
                             throws XMLDBException
Gets the iterator property

Specified by:
getIterator in interface ResourceSet
Returns:
The iterator value
Throws:
XMLDBException

getIterator

public ResourceIterator getIterator(long start)
                             throws XMLDBException
Gets the iterator property, starting from a given position

Parameters:
start - starting position>0 for the iterator
Returns:
The iterator value
Throws:
XMLDBException - thrown if pos is out of range

getMembersAsResource

public Resource getMembersAsResource()
                              throws XMLDBException
Gets the membersAsResource property of the object

Specified by:
getMembersAsResource in interface ResourceSet
Returns:
The membersAsResource value
Throws:
XMLDBException - Description of the Exception

getResource

public Resource getResource(long pos)
                     throws XMLDBException
Gets the resource at a given position.

Specified by:
getResource in interface ResourceSet
Parameters:
pos - position > 0
Returns:
The resource value
Throws:
XMLDBException - thrown if pos is out of range

getSize

public long getSize()
             throws XMLDBException
Gets the size property

Specified by:
getSize in interface ResourceSet
Returns:
The size value
Throws:
XMLDBException

removeResource

public void removeResource(long pos)
                    throws XMLDBException
Removes the resource at a given position.

Specified by:
removeResource in interface ResourceSet
Parameters:
pos - position > 0
Throws:
XMLDBException - thrown if pos is out of range


Copyright (C) The eXist-db Project. All rights reserved.