edu.uky.rch.ept.data
Class ResourceList

java.lang.Object
  extended byedu.uky.rch.ept.data.ResourceList

public class ResourceList
extends Object

A ResourceList is used to hold a collection of ResourceDescriptors. This class is a wrapper for java.util.TreeSet to restrict elements to the type ResourceDesciptor.


Constructor Summary
ResourceList()
          Creates an empty ResourceList object
 
Method Summary
 void add(ResourceDescriptor rd)
          Appends the specified ResourceDescriptor to the end of this ResourceList.
 void add(ResourceList rl)
           
 void clear()
          Removes all of the ResourceDescriptors from this list.
 boolean contains(ResourceDescriptor rd)
          Tests if the specified ResourceDescriptor is in this list
 Iterator elements()
          Returns an iterator on the ResourceDescriptors in this list.
 ResourceDescriptor first()
          Returns the first ResourceDescriptor in the list.
 boolean isEmpty()
          Tests if this list has no ResourceDescriptors.
 boolean remove(ResourceDescriptor rd)
          Removes the specified ResourceDescriptor from this list.
 int size()
          Returns the number of ResourceDescriptors in this list
 ResourceDescriptor[] toArray()
          Returns an array containing all of the ResourceDescriptors in this list
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResourceList

public ResourceList()
Creates an empty ResourceList object

Method Detail

add

public void add(ResourceDescriptor rd)
Appends the specified ResourceDescriptor to the end of this ResourceList.

Parameters:
rd - ResourceDescriptor to be added to this list.

add

public void add(ResourceList rl)

clear

public void clear()
Removes all of the ResourceDescriptors from this list.


contains

public boolean contains(ResourceDescriptor rd)
Tests if the specified ResourceDescriptor is in this list

Parameters:
rd - The ResourceDescriptor to look for.
Returns:
true if and only if the specified ResourceDescriptor is the same as a component in this list, false otherwise.

elements

public Iterator elements()
Returns an iterator on the ResourceDescriptors in this list.

Returns:
an iterator

isEmpty

public boolean isEmpty()
Tests if this list has no ResourceDescriptors.

Returns:
true if and only if this list has no ResourceDescriptors, that is, its size is zero; false otherwise

remove

public boolean remove(ResourceDescriptor rd)
Removes the specified ResourceDescriptor from this list. If the list does not contain the ResourceDescriptor, it is unchanged.

Parameters:
rd - the ResourceDescriptor to remove from the list.
Returns:
true if the ResourceDescriptor was found and removed from the list, false otherwise.

size

public int size()
Returns the number of ResourceDescriptors in this list

Returns:
the number of ResourceDescriptors in this list.

toArray

public ResourceDescriptor[] toArray()
Returns an array containing all of the ResourceDescriptors in this list

Returns:
ResourceDescriptors

first

public ResourceDescriptor first()
Returns the first ResourceDescriptor in the list.

Returns:
a ResourceDescriptor