MATSIM
LinkWrapperFacilityWithSpecificCoord.java
Go to the documentation of this file.
1 
2 /* *********************************************************************** *
3  * project: org.matsim.*
4  * LinkWrapperFacility.java
5  * *
6  * *********************************************************************** *
7  * *
8  * copyright : (C) 2019 by the members listed in the COPYING, *
9  * LICENSE and WARRANTY file. *
10  * email : info at matsim dot org *
11  * *
12  * *********************************************************************** *
13  * *
14  * This program is free software; you can redistribute it and/or modify *
15  * it under the terms of the GNU General Public License as published by *
16  * the Free Software Foundation; either version 2 of the License, or *
17  * (at your option) any later version. *
18  * See also COPYING, LICENSE and WARRANTY file *
19  * *
20  * *********************************************************************** */
21 
22  package org.matsim.core.router;
23 
24 import java.util.Map;
25 import org.matsim.api.core.v01.Coord;
26 import org.matsim.api.core.v01.Id;
31 
32 /*
33  * Wraps a Link into a Facility with a specific coordinate.
34  * Useful for, e.g., Access and egress leg distance calculations
35  */
36 public final class LinkWrapperFacilityWithSpecificCoord implements Facility, Identifiable<ActivityFacility> {
37 
38  private final Link wrappedLink;
39  private final Coord wrappedCoord;
40 
41  public LinkWrapperFacilityWithSpecificCoord(final Link linkToWrap, final Coord coordToWrap) {
42  wrappedLink = linkToWrap;
43  wrappedCoord = coordToWrap;
44  }
45 
46  @Override
47  public Coord getCoord() {
48  return wrappedCoord;
49  }
50 
51  @Override
53  throw new UnsupportedOperationException();
54  }
55 
56  @Override
57  public Map<String, Object> getCustomAttributes() {
58  throw new UnsupportedOperationException();
59  }
60 
61  @Override
62  public Id<Link> getLinkId() {
63  return wrappedLink.getId();
64  }
65 
66  @Override
67  public String toString() {
68  return "[LinkWrapperFacilityWithSpecificCoord: wrappedLink="+ wrappedLink +", wrapped Coord: "+wrappedCoord+"]";
69  }
70 }