ID - the ID type of the networkL - the Link type of the networkpublic class Network<ID,L extends Link<?,?>> extends HashSet<L> implements Serializable
Copyright (c) 2013-2014 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
| Constructor and Description |
|---|
Network(ID id)
Construction of an empty network.
|
Network(ID id,
Collection<? extends L> collection)
Construction of a network with an initial set of links.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addNode(Node<?,?> node)
Add a node to this Network.
|
boolean |
deleteNode(Node<?,?> deleteThis)
Delete a node from this network.
|
ID |
getId() |
Set<Node<?,?>> |
getNodeSet() |
boolean |
isInNetwork(Node<?,?> node)
Determine if a node is part of this Network.
|
void |
setNodeSet(Set<Node<?,?>> nodeSet) |
add, clear, clone, contains, isEmpty, iterator, remove, size, spliteratorequals, hashCode, removeAlladdAll, containsAll, retainAll, toArray, toArray, toStringfinalize, getClass, notify, notifyAll, wait, wait, waitaddAll, containsAll, equals, hashCode, removeAll, retainAll, toArray, toArrayparallelStream, removeIf, streampublic Network(ID id)
id - the network id.public Network(ID id, Collection<? extends L> collection)
id - the network id.collection - the initial collection of links.public final ID getId()
public final boolean isInNetwork(Node<?,?> node)
node - AbstractNode<?, ?>; the nodepublic final void addNode(Node<?,?> node) throws NetworkException
node - Node; the node that must be addedNetworkException - if the node is already part of this networkpublic boolean deleteNode(Node<?,?> deleteThis) throws NetworkException
deleteThis - AbstractNode<?, ?>; the node that must be deletedNetworkException - on network inconsistency Note: method can be overridden, e.g. by the ExpansionNetwork.Copyright © 2014–2015 Delft University of Technology. All rights reserved.