public class Models
extends java.lang.Object
Graphs provides several useful static methods and classes.| Modifier and Type | Class and Description |
|---|---|
static class |
Models.DirectedLink
|
protected static class |
Models.IsCommunicationPredicate
The
IsCommunicationPredicate is a Predicate that returns
true if the task implements the ICommunication interface. |
protected static class |
Models.IsProcessPredicate
The
IsCommunicationPredicate is a Predicate that returns
true if the task does not implement the ICommunication interface. |
protected static class |
Models.OnlyCommunicationIterator
The
OnlyCommunicationIterator is an iterator for tasks that only
considers communication tasks. |
protected static class |
Models.OnlyProcessIterator
The
OnlyCommunicationIterator is an iterator for tasks that only
considers process tasks. |
| Modifier and Type | Field and Description |
|---|---|
protected static Models.IsCommunicationPredicate |
isCommunicationPredicate
The instance of the
IsCommunicationPredicate class. |
protected static Models.IsProcessPredicate |
isProcessPredicate
The instance of the
IsProcessPredicate class. |
| Constructor and Description |
|---|
Models() |
| Modifier and Type | Method and Description |
|---|---|
static Specification |
clone(Specification specification) |
static <E extends Element> |
copy(Element element) |
static <M extends Mapping<?,?>> |
copy(Mapping<?,?> mapping) |
static Specification |
copy(Specification specification) |
static void |
filter(Specification specification,
java.util.Collection<Function<Task,Dependency>> functions) |
static void |
filterByFunctionName(Specification specification,
java.util.Collection<java.lang.String> functions) |
static void |
filterByFunctionName(Specification specification,
java.lang.String... functions) |
static void |
filterByResources(Specification specification,
java.util.Collection<Resource> resources) |
static java.lang.Iterable<Task> |
filterCommunications(java.lang.Iterable<Task> iterable)
Filters an
Iterable such that only communication tasks are
considered. |
static java.lang.Iterable<Task> |
filterProcesses(java.lang.Iterable<Task> iterable)
Filters an
Iterable such that only process tasks are considered. |
static <E extends Element> |
filterType(java.lang.Iterable<E> iterable,
java.lang.String... types)
Returns an
Iterable which returns only those Elements
from the given iterable which are of one of the given
types. |
static java.util.Set<Element> |
getElements(Specification specification)
Returns all
Element objects of a Specification. |
static java.util.Map<java.lang.String,Element> |
getElementsMap(Specification specification)
Returns a map of all pairs of
ids and the corresponding
Element objects. |
static java.util.List<Models.DirectedLink> |
getInLinks(Architecture<Resource,Link> architecture,
Resource r0)
Returns the list of
DirectedLink elements that have a given
destination {code Resource}. |
static java.util.List<Models.DirectedLink> |
getLinks(Architecture<Resource,Link> architecture)
Returns all
DirectedLink elements of an Architecture. |
static java.util.List<Models.DirectedLink> |
getLinks(Architecture<Resource,Link> architecture,
Link link)
Returns all
DirectedLink elements of an Architecture for
given Link. |
static java.util.List<Models.DirectedLink> |
getOutLinks(Architecture<Resource,Link> architecture,
Resource r0)
Returns the list of
DirectedLink elements that have a given
source {code Resource}. |
static boolean |
isCommunication(Task task)
Returns
true if the task is a communication. |
static boolean |
isProcess(Task task)
Returns
true if the task is a process. |
static void |
setAttributes(IAttributes e,
Attributes attributes) |
protected static Models.IsCommunicationPredicate isCommunicationPredicate
IsCommunicationPredicate class.protected static Models.IsProcessPredicate isProcessPredicate
IsProcessPredicate class.public static java.lang.Iterable<Task> filterCommunications(java.lang.Iterable<Task> iterable)
Iterable such that only communication tasks are
considered.iterable - the iterablepublic static java.lang.Iterable<Task> filterProcesses(java.lang.Iterable<Task> iterable)
Iterable such that only process tasks are considered.iterable - the iterablepublic static boolean isProcess(Task task)
true if the task is a process.task - the tasktrue if the task is a processpublic static boolean isCommunication(Task task)
true if the task is a communication.task - the tasktrue if the task is a communicationpublic static java.util.List<Models.DirectedLink> getOutLinks(Architecture<Resource,Link> architecture, Resource r0)
DirectedLink elements that have a given
source {code Resource}.architecture - the architecturer0 - the sourcepublic static java.util.List<Models.DirectedLink> getInLinks(Architecture<Resource,Link> architecture, Resource r0)
DirectedLink elements that have a given
destination {code Resource}.architecture - the architecturer0 - the sourcepublic static java.util.List<Models.DirectedLink> getLinks(Architecture<Resource,Link> architecture)
DirectedLink elements of an Architecture.architecture - the architecturepublic static java.util.List<Models.DirectedLink> getLinks(Architecture<Resource,Link> architecture, Link link)
DirectedLink elements of an Architecture for
given Link.architecture - the architecturelink - the linkpublic static java.util.Map<java.lang.String,Element> getElementsMap(Specification specification)
ids and the corresponding
Element objects.specification - the specificationpublic static java.util.Set<Element> getElements(Specification specification)
Element objects of a Specification.specification - the specificationpublic static <E extends Element> java.lang.Iterable<E> filterType(java.lang.Iterable<E> iterable, java.lang.String... types)
Iterable which returns only those Elements
from the given iterable which are of one of the given
types.E - the type of the elementiterable - the iterable over the source elementstypes - the types to filter forElement.getType()public static Specification copy(Specification specification)
public static void setAttributes(IAttributes e, Attributes attributes)
public static Specification clone(Specification specification)
public static void filterByResources(Specification specification, java.util.Collection<Resource> resources)
public static void filter(Specification specification, java.util.Collection<Function<Task,Dependency>> functions)
public static void filterByFunctionName(Specification specification, java.util.Collection<java.lang.String> functions)
public static void filterByFunctionName(Specification specification, java.lang.String... functions)