edu.cmu.hcii.calo.model.ResourceList Class Reference

List of all members.

Detailed Description

Aggregates resources for use by tasks and the relevant info view.

Note:
Although ResourceLists are managed by the RelevantInfoManager, the ResourceList class does not subclass ManagedObject because there it is not possible to send an event about a ResourceList that is not being managed.
Author:
Brian Ellis


Public Member Functions

boolean add (Resource o)
 Adds a resource to the list if it is not already there.
Resource at (int index)
 Returns the resource at the given index.
void clear ()
 Removes all resources from the list.
boolean contains (Resource o)
 Determines whether the resource list contains the given resource.
Resource first ()
 Returns the first (most relevant) resource in the list.
Iterator< Resourceiterator ()
 Returns an iterator over the resources in the list, sorted by relevance.
Resource last ()
 Returns the last (least relevant) resource in the list.
boolean remove (Resource o)
 Removes the given resource from the list if it exists there.
int size ()
 Returns the number of resources in the list.
String toString ()
 Returns a string representation of this ResourceList.

Private Attributes

SortedSet< Resourceresources
 The resources in the list.

Static Private Attributes

static final long serialVersionUID = 8112257147108845110L
 Prevent serialization collisions.

Classes

class  ResourceListComparator
 A comparator that compares (and sorts) resources within a resource list. More...


Member Function Documentation

boolean edu.cmu.hcii.calo.model.ResourceList.add ( Resource  o  ) 

Adds a resource to the list if it is not already there.

Parameters:
o the resource to add
Returns:
true if the resource was not already in the list, false otherwise
See also:
java.util.Set.add(java.lang.Object)

Resource edu.cmu.hcii.calo.model.ResourceList.at ( int  index  ) 

Returns the resource at the given index.

Parameters:
index the index to look up
Returns:
the Resource at index

void edu.cmu.hcii.calo.model.ResourceList.clear (  ) 

Removes all resources from the list.

See also:
java.util.Set.clear()

boolean edu.cmu.hcii.calo.model.ResourceList.contains ( Resource  o  ) 

Determines whether the resource list contains the given resource.

Parameters:
o the resource to look for
Returns:
true if the resource is in the list, false otherwise
See also:
java.util.Set.contains(java.lang.Object)

Resource edu.cmu.hcii.calo.model.ResourceList.first (  ) 

Returns the first (most relevant) resource in the list.

Returns:
the first resource
See also:
java.util.SortedSet.first()

Iterator<Resource> edu.cmu.hcii.calo.model.ResourceList.iterator (  ) 

Returns an iterator over the resources in the list, sorted by relevance.

Returns:
an iterator over the resources in the list
See also:
java.util.Set.iterator()

Resource edu.cmu.hcii.calo.model.ResourceList.last (  ) 

Returns the last (least relevant) resource in the list.

Returns:
the last resource in the list
See also:
java.util.SortedSet.last()

boolean edu.cmu.hcii.calo.model.ResourceList.remove ( Resource  o  ) 

Removes the given resource from the list if it exists there.

Parameters:
o the resource to remove
Returns:
true if the resource was in the list and has been removed, false if it was not there
See also:
java.util.Set.remove(java.lang.Object)

int edu.cmu.hcii.calo.model.ResourceList.size (  ) 

Returns the number of resources in the list.

Returns:
the number of resources
See also:
java.util.Set.size()

String edu.cmu.hcii.calo.model.ResourceList.toString (  ) 

Returns a string representation of this ResourceList.

Useful only for debugging.


Member Data Documentation

final long edu.cmu.hcii.calo.model.ResourceList.serialVersionUID = 8112257147108845110L [static, private]

Prevent serialization collisions.

SortedSet<Resource> edu.cmu.hcii.calo.model.ResourceList.resources [private]

The resources in the list.


The documentation for this class was generated from the following file:
Generated on Mon Aug 13 15:06:17 2007 for CALO by  doxygen 1.5.2