org.sixdml
Class SixdmlResourceSet

java.lang.Object
  |
  +--org.sixdml.SixdmlResourceSet
All Implemented Interfaces:
ResourceSet, SixdmlConstants

public class SixdmlResourceSet
extends Object
implements ResourceSet, SixdmlConstants

 SixdmlResourceSet.java

 ResourceSet is a container for a set of resources. This class isn't really a Set, but 
 instead is more like a Vector.

 Created: Thu Jan 10 20:46:09 2002
 

Version:
1.0
Author:
Dare Obasanjo

Field Summary
private  ArrayList resources
          This is the collection that holds the Resources.
 
Fields inherited from interface org.sixdml.SixdmlConstants
SIXDML_NS, SIXDML_VERSION
 
Constructor Summary
SixdmlResourceSet()
          Default constructor.
 
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.
static void main(String[] args)
          Main used for testing class.
 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, registerNatives, toString, wait, wait, wait
 

Field Detail

resources

private ArrayList resources
This is the collection that holds the Resources.
Constructor Detail

SixdmlResourceSet

public SixdmlResourceSet()
Default constructor.
Method Detail

addResource

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

clear

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

getIterator

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

getMembersAsResource

public Resource getMembersAsResource()
Returns a Resource containing an XML representation of all resources stored in the set.
Specified by:
getMembersAsResource in interface ResourceSet
Returns:
a Resource that contains an XML representation of all the resources in this set.

getResource

public Resource getResource(long index)
Returns the Resource instance stored at the index specified by index.
Specified by:
getResource in interface ResourceSet
Parameters:
index - the index from which to return the Resource.
Returns:
the Resource at the specified index.
Throws:
IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size()).

getSize

public long getSize()
Returns the number of resources contained in the set.
Specified by:
getSize in interface ResourceSet
Returns:
the number of resources in the set.

removeResource

public void removeResource(long index)
Removes the Resource located at index from the set.
Specified by:
removeResource in interface ResourceSet
Parameters:
index - the index from which to remove the Resource.
Throws:
IndexOutOfBoundsException - if the index is out of range (index < 0 || index >= size()).

main

public static void main(String[] args)
Main used for testing class.
Parameters:
args - IGNORED