Interface WiredNetwork
WiredNodes, a set of connections between them, and a series
of peripherals.
Networks from a connected graph. This means there is some path between all nodes on the network. Further more, if
there is some path between two nodes then they must be on the same network. WiredNetwork will automatically
handle the merging and splitting of networks (and thus changing of available nodes and peripherals) as connections
change.
This does mean one can not rely on the network remaining consistent between subsequent operations. Consequently,
it is generally preferred to use the methods provided by WiredNode.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionbooleanDeprecated.booleandisconnect(WiredNode left, WiredNode right) Deprecated.booleanDeprecated.voidupdatePeripherals(WiredNode node, Map<String, IPeripheral> peripherals) Deprecated.
-
Method Details
-
connect
Deprecated.Create a connection between two nodes.This should only be used on the server thread.
- Parameters:
left- The first node to connectright- The second node to connect- Returns:
trueif a connection was created orfalseif the connection already exists.- Throws:
IllegalStateException- If neither node is on the network.IllegalArgumentException- Ifleftandrightare equal.- See Also:
-
disconnect
Deprecated.Destroy a connection between this node and another.This should only be used on the server thread.
- Parameters:
left- The first node in the connection.right- The second node in the connection.- Returns:
trueif a connection was destroyed orfalseif no connection exists.- Throws:
IllegalArgumentException- If either node is not on the network.IllegalArgumentException- Ifleftandrightare equal.- See Also:
-
remove
Deprecated.Sever all connections this node has, removing it from this network.This should only be used on the server thread. You should only call this on nodes that your network element owns.
- Parameters:
node- The node to remove- Returns:
- Whether this node was removed from the network. One cannot remove a node from a network where it is the only element.
- Throws:
IllegalArgumentException- If the node is not in the network.- See Also:
-
updatePeripherals
Deprecated.Update the peripherals a node provides.This should only be used on the server thread. You should only call this on nodes that your network element owns.
- Parameters:
node- The node to attach peripherals for.peripherals- The new peripherals for this node.- Throws:
IllegalArgumentException- If the node is not in the network.- See Also:
-
WiredNode.connectTo(WiredNode)