T - the type of tasksR - the type of resourcespublic class Mappings<T extends Task,R extends Resource> extends java.lang.Object implements java.lang.Iterable<Mapping<T,R>>
Mappings represent a set of Mapping elements.| Modifier and Type | Field and Description |
|---|---|
protected java.util.Set<Mapping<T,R>> |
mappings |
protected java.util.Map<R,java.util.Set<Mapping<T,R>>> |
resourceMappings |
protected java.util.Map<R,org.apache.commons.collections15.Bag<T>> |
sources |
protected java.util.Map<T,org.apache.commons.collections15.Bag<R>> |
targets |
protected java.util.Map<T,java.util.Set<Mapping<T,R>>> |
taskMappings |
| Constructor and Description |
|---|
Mappings() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Mapping<T,R> mapping)
Adds a mapping.
|
java.util.Set<Mapping<T,R>> |
get(R target)
Returns all mappings with the specified target.
|
java.util.Set<Mapping<T,R>> |
get(T source)
Returns all mappings with the specified source.
|
java.util.Set<Mapping<T,R>> |
get(T source,
R target)
Returns all mappings with the specified source and target.
|
java.util.Set<Mapping<T,R>> |
getAll()
Returns all mappings as a set.
|
java.util.Set<T> |
getSources(R target)
Returns all sources for a target.
|
java.util.Set<R> |
getTargets(T source)
Returns all targets for a source.
|
java.util.Iterator<Mapping<T,R>> |
iterator() |
boolean |
remove(Mapping<T,R> mapping)
Removes a mapping
|
boolean |
removeAll(java.util.Collection<Mapping<T,R>> mappings) |
int |
size()
Returns the number of mappings.
|
protected java.util.Map<T extends Task,java.util.Set<Mapping<T extends Task,R extends Resource>>> taskMappings
protected java.util.Map<R extends Resource,java.util.Set<Mapping<T extends Task,R extends Resource>>> resourceMappings
protected java.util.Map<T extends Task,org.apache.commons.collections15.Bag<R extends Resource>> targets
public void add(Mapping<T,R> mapping)
mapping - the mapping to be addedpublic boolean remove(Mapping<T,R> mapping)
mapping - the mapping to be removedtrue if the mapping was removedpublic int size()
public java.util.Set<Mapping<T,R>> get(T source)
source - the sourcepublic java.util.Set<R> getTargets(T source)
source - the sourcepublic java.util.Set<Mapping<T,R>> get(R target)
target - the targetpublic java.util.Set<T> getSources(R target)
target - the targetpublic java.util.Set<Mapping<T,R>> get(T source, R target)
source - the sourcetarget - the target