-
- All Implemented Interfaces:
public final class Graph
-
-
Method Summary
Modifier and Type Method Description final static <T extends Any> Boolean
)>circularDependency(T myId, <ERROR CLASS> inbound)
Check if circular dependencies exist. final static <T extends Any> Boolean
)>hasSelfDependency(T myId, <ERROR CLASS> inbound)
Check if a device is self-referencing itself. final static <T extends Any> Boolean
)>hasTransitiveDependency(T myId, <ERROR CLASS> inbound)
Check if a device is part of a transitive circular dependency. final static <T extends Any> Boolean
,T)>greatestLowerBound(T myId, <ERROR CLASS> inbound, T nodes)
Get the greatest lower bound for a set of devices. final static <T extends Any> Boolean
)>isLeaf(T myId, <ERROR CLASS> inbound)
Check if a device is a leaf of the graph. final static <T extends Any> Boolean
)>isRoot(<ERROR CLASS> inbound)
Check if a device is a root of the graph. final static <T extends Any> Boolean
)>isParent(T myId, <ERROR CLASS> inbound)
final static <T extends Any> Boolean
,T)>leastUpperBound(T myId, <ERROR CLASS> outbound, T nodes)
Get the least upper bound for a set of devices. final static <T extends Any, U extends Any> U
,Object,U)>nbrWrapper(T myId, <ERROR CLASS> connections, Object nbrMessage, U null)
This nbrWrapper get the messages coming only from a subset of neighbors. final static Unit
spreadBoundValue(Object myId, Object connections, Object nodes)
final static Unit
intersection(Object list1, Object list2)
final static Unit
isEmpty(Object list)
final static Unit
isNotEmpty(Object list)
-
-
Method Detail
-
circularDependency
final static <T extends Any> Boolean )>circularDependency(T myId, <ERROR CLASS> inbound)
Check if circular dependencies exist.
A circular dependency exists if a device is self-referencing itself or a transitive dependency exists.
- Parameters:
myId
- device idinbound
- inbound connections
-
hasSelfDependency
final static <T extends Any> Boolean )>hasSelfDependency(T myId, <ERROR CLASS> inbound)
Check if a device is self-referencing itself.
- Parameters:
myId
- device idinbound
- inbound connections
-
hasTransitiveDependency
final static <T extends Any> Boolean )>hasTransitiveDependency(T myId, <ERROR CLASS> inbound)
Check if a device is part of a transitive circular dependency.
- Parameters:
myId
- device idinbound
- inbound connections
-
greatestLowerBound
final static <T extends Any> Boolean ,T)>greatestLowerBound(T myId, <ERROR CLASS> inbound, T nodes)
Get the greatest lower bound for a set of devices.
- Parameters:
myId
- device idinbound
- inbound connectionsnodes
- node on which estimate the greatest lower bound
-
isLeaf
final static <T extends Any> Boolean )>isLeaf(T myId, <ERROR CLASS> inbound)
Check if a device is a leaf of the graph.
A device is a leaf when none of the other devices refers to it as an inbound connection, and the device has no outbound connections.
- Parameters:
myId
- device idinbound
- inbound connections
-
isRoot
final static <T extends Any> Boolean )>isRoot(<ERROR CLASS> inbound)
Check if a device is a root of the graph.
A device is a root when it has no inbound connections.
- Parameters:
inbound
- inbound connections
-
isParent
final static <T extends Any> Boolean )>isParent(T myId, <ERROR CLASS> inbound)
- Parameters:
myId
- device idinbound
- inbound connections
-
leastUpperBound
final static <T extends Any> Boolean ,T)>leastUpperBound(T myId, <ERROR CLASS> outbound, T nodes)
Get the least upper bound for a set of devices.
- Parameters:
myId
- device idoutbound
- outbound connectionsnodes
- node on which estimate the least upper bound
-
nbrWrapper
final static <T extends Any, U extends Any> U ,Object,U)>nbrWrapper(T myId, <ERROR CLASS> connections, Object nbrMessage, U null)
This nbrWrapper get the messages coming only from a subset of neighbors. When working with graph, nbrWrabber must be used instead of nbr. Otherwise the graph logical structure is broken.
If connections is the set of inbound connections, then nbrWrapper returns only the messages coming from the parents of the current device, replacing messages from the children with null. Using outbound connections does the opposite.
- Parameters:
myId
- device idconnections
- inbound connectionsnull
- placeholder for devices which not fulfill the filtering criteria
-
spreadBoundValue
final static Unit spreadBoundValue(Object myId, Object connections, Object nodes)
-
intersection
final static Unit intersection(Object list1, Object list2)
-
isNotEmpty
final static Unit isNotEmpty(Object list)
-
-
-
-