public class Network extends Object
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(Network net)
Construct a new Network out of another Network.
|
Network(String name)
Construct a new Network.
|
Modifier and Type | Method and Description |
---|---|
void |
addNode(Node node)
Add a Node to this Network.
|
void |
addRelation(Relation rel)
Add a Relation to this Network.
|
void |
addWay(Way way)
Add a Way to this Network.
|
void |
delNode(Long nodeid)
Delete a Node from this Network.
|
void |
delNode(Node node)
Delete a Node from this Network.
|
Link |
findFollowingLink(Link l)
Finds the link which follows the given link.
|
Link |
findPrecedingLink(Link l)
Finds the link which precedes the given link.
|
List<Link> |
getLinks() |
String |
getName() |
Node |
getNode(long nodeid)
Retrieve a Node from this Network.
|
HashMap<Long,Node> |
getNodes() |
List<Long> |
getNodesFromWay(Long wayid)
Retrieve a list of Nodes that form a Way from this Network.
|
Relation |
getRelation(long relid)
Retrieve a Relation from this Network.
|
HashMap<Long,Relation> |
getRelations() |
Way |
getWay(long wayid)
Retrieve a Way from this Network.
|
HashMap<Long,Way> |
getWays() |
boolean |
hasFollowingLink(Link l)
Returns true if the given link has a following link.
|
boolean |
hasPrecedingLink(Link l)
Returns true if the given link has a preceding link.
|
void |
makeLinks()
Creates links out of the ways in this network.
|
void |
removeRedundancy()
This function checks for and removes redundancies between the networks links.
|
void |
setName(String name)
Set/update the name of this Network.
|
void |
setNodes(HashMap<Long,Node> newnodes)
Set/replace the Nodes of this Network.
The provided list is not copied; the caller should not modify the list after setting it. |
public Network(String name)
name
- String; the name of the new Networkpublic Network(Network net)
net
- public final List<Long> getNodesFromWay(Long wayid) throws IOException
wayid
- long; the id of the WayIOException
- when no Way with the specified id exists in this Networkpublic final Node getNode(long nodeid) throws IOException
nodeid
- long; the id of the NodeIOException
- when no Node with the specified id exist in this Networkpublic final Relation getRelation(long relid) throws IOException
relid
- long; the id of the RelationIOException
- when no Relation with the specified id exists in this Networkpublic final HashMap<Long,Relation> getRelations()
public final Way getWay(long wayid) throws IOException
wayid
- long; the id of a WayIOException
- when no Way with the specified id exist in this networkpublic final String getName()
public final void setName(String name)
name
- String; the new namepublic final void setNodes(HashMap<Long,Node> newnodes)
newnodes
- HashMap<Long, Node>; the (new) Nodes for this Networkpublic final void addNode(Node node)
node
- Node; the node to add to this Networkpublic final void delNode(Node node)
node
- Node; the Node to deletepublic final void delNode(Long nodeid)
nodeid
- Long; the id of the Node to deletepublic final void addWay(Way way)
way
- Way; the Way to addpublic final void addRelation(Relation rel)
rel
- Relation; the relation to addpublic final void makeLinks() throws IOException
IOException
- on read errorspublic final void removeRedundancy()
public final Link findFollowingLink(Link l)
l
- public final Link findPrecedingLink(Link l)
l
- public final boolean hasPrecedingLink(Link l)
l
- public final boolean hasFollowingLink(Link l)
l
- Copyright © 2014–2015 Delft University of Technology. All rights reserved.