net.sourceforge.ganttproject.resource
Class HumanResourceManager

java.lang.Object
  |
  +--net.sourceforge.ganttproject.resource.HumanResourceManager
All Implemented Interfaces:
ResourceManager

public class HumanResourceManager
extends java.lang.Object
implements ResourceManager

Author:
barmeier

Constructor Summary
HumanResourceManager()
           
 
Method Summary
 void add(ProjectResource resource)
          Adds the resource to the internal list of available resources.
 void addView(ResourceView view)
          Adds a new view of this manager
 void clear()
          Removes all resources from the manager.
 ProjectResource create(java.lang.String name)
          The only thing that must be known when creating a new resource is the name of the resource.
 ProjectResource create(java.lang.String name, int i)
           
 ProjectResource getById(int id)
          Retrieves an ancestor of ProjectResource identified by an identity value.
 java.util.ArrayList getResources()
          Retrieves a list of all resources available.
 java.util.ArrayList load(java.io.InputStream source)
          Loads resources from the InputStreamReader.
 void remove(ProjectResource resource)
          Removes the resource.
 void removeById(int id)
          Removes the resource by its id.
 void save(java.io.OutputStream target)
          Writes all resources stored in the OutputStreamWriter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HumanResourceManager

public HumanResourceManager()
Method Detail

create

public ProjectResource create(java.lang.String name,
                              int i)
Specified by:
create in interface ResourceManager

create

public ProjectResource create(java.lang.String name)
Description copied from interface: ResourceManager
The only thing that must be known when creating a new resource is the name of the resource. This methods creates a ProjectResource conform object, sets the id to an unused value and sets the name to the name given by the parameter name after alle the object will be added to the list of available resources. The methods returns the generated object or null when something fails. BE AWARE Null Pointer Exceptions are waiting here ;)

Specified by:
create in interface ResourceManager
Parameters:
name - The name of the resource that should be added.
Returns:
A ProjectResource object with name and id set.
See Also:
ProjectResource

add

public void add(ProjectResource resource)
Description copied from interface: ResourceManager
Adds the resource to the internal list of available resources.

Specified by:
add in interface ResourceManager
Parameters:
resource - The resource that should be added to the list.

getById

public ProjectResource getById(int id)
Description copied from interface: ResourceManager
Retrieves an ancestor of ProjectResource identified by an identity value.

Specified by:
getById in interface ResourceManager
Parameters:
id - The id is an integer value that is unique for every resource.
Returns:
Ancestor of ProjectResource containing the requested resource.
See Also:
ProjectResource

getResources

public java.util.ArrayList getResources()
Description copied from interface: ResourceManager
Retrieves a list of all resources available.

Specified by:
getResources in interface ResourceManager
Returns:
ArrayList filled with ProjectResource ancestors.
See Also:
ProjectResource

load

public java.util.ArrayList load(java.io.InputStream source)
Description copied from interface: ResourceManager
Loads resources from the InputStreamReader. All resources already stored in the Resourcemanager are lost and will be replace with the resources loaded from the stream.

Specified by:
load in interface ResourceManager
Parameters:
source - The InputStreamReader from which the data will be read. The format and kind of data read is subject of the class implementing this interface.
Returns:
The ArrayLisr returned contains all ProjectResource ancestor that were read from the InputStreamReader.

remove

public void remove(ProjectResource resource)
Description copied from interface: ResourceManager
Removes the resource.

Specified by:
remove in interface ResourceManager
Parameters:
resource - The resource to remove.

removeById

public void removeById(int id)
Description copied from interface: ResourceManager
Removes the resource by its id.

Specified by:
removeById in interface ResourceManager
Parameters:
id - Id of the resource to remove.

save

public void save(java.io.OutputStream target)
Description copied from interface: ResourceManager
Writes all resources stored in the OutputStreamWriter. The format and kind of data written in the stream are subject of the class that implements this interface.

Specified by:
save in interface ResourceManager
Parameters:
target - Stream to write the data to.

clear

public void clear()
Description copied from interface: ResourceManager
Removes all resources from the manager.

Specified by:
clear in interface ResourceManager

addView

public void addView(ResourceView view)
Description copied from interface: ResourceManager
Adds a new view of this manager

Specified by:
addView in interface ResourceManager
Parameters:
view -


${copyright}