net.sf.opendse.model
Class Mapping<T extends Task,R extends Resource>

java.lang.Object
  extended by net.sf.opendse.model.Element
      extended by net.sf.opendse.model.Mapping<T,R>
Type Parameters:
T - the type of task
R - the type of resource
All Implemented Interfaces:
IAttributes

public class Mapping<T extends Task,R extends Resource>
extends Element

The Mapping represents a mapping from a Task to a Resource.


Field Summary
protected  T source
           
protected  R target
           
 
Fields inherited from class net.sf.opendse.model.Element
attributes, id, parent, TYPE
 
Constructor Summary
Mapping(Element parent, T source, R target)
          Constructs a new mapping
Mapping(java.lang.String id, T source, R target)
          Constructs a new mapping.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 T getSource()
          Returns the source of the mapping.
 R getTarget()
          Returns the target of a mapping.
 void setSource(T task)
          Sets the source of the mapping.
 void setTarget(R resource)
          Sets the target of a mapping.
 
Methods inherited from class net.sf.opendse.model.Element
getAttribute, getAttributeNames, getAttributeParameter, getAttributes, getId, getLocalAttributeNames, getLocalAttributes, getParent, getType, hashCode, isDefined, setAttribute, setParent, setType, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

source

protected T extends Task source

target

protected R extends Resource target
Constructor Detail

Mapping

public Mapping(java.lang.String id,
               T source,
               R target)
Constructs a new mapping.

Parameters:
id - the id
source - the source task
target - the target resource

Mapping

public Mapping(Element parent,
               T source,
               R target)
Constructs a new mapping

Parameters:
parent - the parent node
source - the source
target - the destination
Method Detail

getSource

public T getSource()
Returns the source of the mapping.

Returns:
the source

setSource

public void setSource(T task)
Sets the source of the mapping.

Parameters:
task - the source

getTarget

public R getTarget()
Returns the target of a mapping.

Returns:
the target

setTarget

public void setTarget(R resource)
Sets the target of a mapping.

Parameters:
resource - the target

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class Element