MATSIM
AbstractRoutingNetworkLink.java
Go to the documentation of this file.
1 /* *********************************************************************** *
2  * project: org.matsim.*
3  * AbstractRoutingNetworkLink.java
4  * *
5  * *********************************************************************** *
6  * *
7  * copyright : (C) 2012 by the members listed in the COPYING, *
8  * LICENSE and WARRANTY file. *
9  * email : info at matsim dot org *
10  * *
11  * *********************************************************************** *
12  * *
13  * This program is free software; you can redistribute it and/or modify *
14  * it under the terms of the GNU General Public License as published by *
15  * the Free Software Foundation; either version 2 of the License, or *
16  * (at your option) any later version. *
17  * See also COPYING, LICENSE and WARRANTY file *
18  * *
19  * *********************************************************************** */
20 
21 package org.matsim.core.router.util;
22 
23 import java.util.Set;
24 
25 import org.matsim.api.core.v01.Coord;
26 import org.matsim.api.core.v01.Id;
30 
31 public abstract class AbstractRoutingNetworkLink implements RoutingNetworkLink {
32 
33  private final Link link;
34  private final RoutingNetworkNode toNode;
36 
37  /*package*/ AbstractRoutingNetworkLink(Link link, RoutingNetworkNode fromNode, RoutingNetworkNode toNode) {
38  this.link = link;
39  this.fromNode = fromNode;
40  this.toNode = toNode;
41  }
42 
43  @Override
44  public double getCapacityPeriod() {
45  return link.getCapacityPeriod();
46  }
47 
48  @Override
49  public Link getLink() {
50  return link;
51  }
52 
53  @Override
54  public Id<Link> getId() {
55  return link.getId();
56  }
57 
58  @Override
60  return fromNode;
61  }
62 
63  @Override
65  return toNode;
66  }
67 
68  @Override
69  public Set<String> getAllowedModes() {
70  return link.getAllowedModes();
71  }
72 
73  @Override
74  public double getCapacity() {
75  return link.getCapacity();
76  }
77 
78  @Override
79  public double getCapacity(double time) {
80  return link.getCapacity(time);
81  }
82 
83  @Override
84  public double getFreespeed() {
85  return link.getFreespeed();
86  }
87 
88  @Override
89  public double getFreespeed(double time) {
90  return link.getFreespeed(time);
91  }
92 
93  @Override
94  public double getLength() {
95  return link.getLength();
96  }
97 
98  @Override
99  public double getNumberOfLanes() {
100  return link.getNumberOfLanes();
101  }
102 
103  @Override
104  public double getNumberOfLanes(double time) {
105  return link.getNumberOfLanes(time);
106  }
107 
108  @Override
109  public void setAllowedModes(Set<String> modes) {
110  throw new RuntimeException("Not supported operation!");
111  }
112 
113  @Override
114  public void setCapacity(double capacity) {
115  throw new RuntimeException("Not supported operation!");
116  }
117 
118  @Override
119  public void setFreespeed(double freespeed) {
120  throw new RuntimeException("Not supported operation!");
121  }
122 
123  @Override
124  public boolean setFromNode(Node node) {
125  throw new RuntimeException("Not supported operation!");
126  }
127 
128  @Override
129  public void setLength(double length) {
130  throw new RuntimeException("Not supported operation!");
131  }
132 
133  @Override
134  public void setNumberOfLanes(double lanes) {
135  throw new RuntimeException("Not supported operation!");
136  }
137 
138  @Override
139  public boolean setToNode(Node node) {
140  throw new RuntimeException("Not supported operation!");
141  }
142 
143  @Override
144  public Coord getCoord() {
145  return this.link.getCoord();
146  }
147 
148  @Override
150  return link.getAttributes();
151  }
152 }