org.hackystat.sensorbase.resource.projects
Class ProjectStringMap

java.lang.Object
  extended by org.hackystat.sensorbase.resource.projects.ProjectStringMap

public class ProjectStringMap
extends java.lang.Object

Helper class to support Project to String mappings. We need this because I don't know how to define JAXB Project instances with a custom equals() and hashCode() method such that equal Project instances are those with the same name and owner.

Author:
Philip Johnson

Constructor Summary
ProjectStringMap()
           
 
Method Summary
 java.lang.String get(Project project)
          Returns the string associated with Project, or null if not found.
 void put(Project project, java.lang.String info)
          Puts [project, info] into the map, after removing any current project instance from the map with the same name and owner.
 void remove(Project project)
          Removes any projects with the same name and owner as Project from this data structure.
 java.util.Collection<java.lang.String> values()
          Returns the strings in this map as a Collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProjectStringMap

public ProjectStringMap()
Method Detail

put

public void put(Project project,
                java.lang.String info)
Puts [project, info] into the map, after removing any current project instance from the map with the same name and owner.

Parameters:
project - The Project to be added.
info - The associated String.

get

public java.lang.String get(Project project)
Returns the string associated with Project, or null if not found.

Parameters:
project - The project whose string is to be retrieved.
Returns:
The string, or null if Project is not found in the map.

remove

public void remove(Project project)
Removes any projects with the same name and owner as Project from this data structure.

Parameters:
project - A project specifying the projects to be removed by name and owner.

values

public java.util.Collection<java.lang.String> values()
Returns the strings in this map as a Collection.

Returns:
The strings as a collection.