Class Graph
-
- 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: unknown class> inbound)
Check if circular dependencies exist. final static <T extends Any> Boolean
)>hasSelfDependency(T myId, <Error class: unknown class> inbound)
Check if a device is self-referencing itself. final static <T extends Any> Boolean
)>hasTransitiveDependency(T myId, <Error class: unknown 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: unknown 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: unknown class> inbound)
Check if a device is a leaf of the graph. final static <T extends Any> Boolean
)>isRoot(<Error class: unknown class> inbound)
Check if a device is a root of the graph. final static <T extends Any> Boolean
)>isParent(T myId, <Error class: unknown class> inbound)
final static <T extends Any> Boolean
,T)>leastUpperBound(T myId, <Error class: unknown class> outbound, T nodes)
Get the least upper bound for a set of devices. final static <T extends Any, U extends Any> U
,java.lang.Object,U)>nbrWrapper(T myId, <Error class: unknown 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: unknown 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- Returns:
true if the device is part of a circular dependency, false otherwise
-
hasSelfDependency
final static <T extends Any> Boolean )>hasSelfDependency(T myId, <Error class: unknown class> inbound)
Check if a device is self-referencing itself.
- Parameters:
myId
- device idinbound
- inbound connections- Returns:
true if the device is self-referencing itself
-
hasTransitiveDependency
final static <T extends Any> Boolean )>hasTransitiveDependency(T myId, <Error class: unknown class> inbound)
Check if a device is part of a transitive circular dependency.
- Parameters:
myId
- device idinbound
- inbound connections- Returns:
true if the device is part of a transitive circular dependency
-
greatestLowerBound
final static <T extends Any> Boolean ,T)>greatestLowerBound(T myId, <Error class: unknown 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- Returns:
true if the device is part of greatest lower bound set of devices, false otherwise
-
isLeaf
final static <T extends Any> Boolean )>isLeaf(T myId, <Error class: unknown 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- Returns:
true if the device is a leaf, false otherwise
-
isRoot
final static <T extends Any> Boolean )>isRoot(<Error class: unknown 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- Returns:
true if the device is a root, false otherwise
-
isParent
final static <T extends Any> Boolean )>isParent(T myId, <Error class: unknown class> inbound)
- Parameters:
myId
- device idinbound
- inbound connections- Returns:
true if the device is parrent of the current device
-
leastUpperBound
final static <T extends Any> Boolean ,T)>leastUpperBound(T myId, <Error class: unknown 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- Returns:
true if the device is part of least upper bound set of devices, false otherwise
-
nbrWrapper
final static <T extends Any, U extends Any> U ,java.lang.Object,U)>nbrWrapper(T myId, <Error class: unknown 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- Returns:
filtered set of messages
-
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)
-
-
-
-