MATSIM
HullTriangle.java
Go to the documentation of this file.
1 /* *********************************************************************** *
2  * project: org.matsim.*
3  * *
4  * *********************************************************************** *
5  * *
6  * copyright : (C) 2013 by the members listed in the COPYING, *
7  * LICENSE and WARRANTY file. *
8  * email : info at matsim dot org *
9  * *
10  * *********************************************************************** *
11  * *
12  * This program is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation; either version 2 of the License, or *
15  * (at your option) any later version. *
16  * See also COPYING, LICENSE and WARRANTY file *
17  * *
18  * *********************************************************************** */
19 
20 package org.matsim.core.network.algorithms.intersectionSimplifier.containers;
21 
22 import java.util.ArrayList;
23 import java.util.List;
24 
25 public class HullTriangle {
27  private int id;
28 
30  private List<HullEdge> edges = new ArrayList<HullEdge>();
31 
33  private List<HullTriangle> neighbours = new ArrayList<HullTriangle>();
34 
35  // vertices...
36 
40  public HullTriangle() {
41  //
42  }
43 
50  public HullTriangle(int id) {
51  this.id = id;
52  }
53 
54 
61  public int getId() {
62  return this.id;
63  }
64 
71  public void setId(int id) {
72  this.id = id;
73  }
74 
81  public List<HullEdge> getEdges() {
82  return this.edges;
83  }
84 
91  public void setEdges(List<HullEdge> edges) {
92  this.edges = edges;
93  }
94 
101  public List<HullTriangle> getNeighbours() {
102  return this.neighbours;
103  }
104 
111  public void setNeighbours(List<HullTriangle> neighbours) {
112  this.neighbours = neighbours;
113  }
114 
115 
122  public boolean addEdge(HullEdge edge) {
123  return getEdges().add(edge);
124  }
125 
132  public boolean addEdges(List<HullEdge> edges) {
133  return getEdges().addAll(edges);
134  }
135 
142  public boolean removeEdge(HullEdge edge) {
143  return getEdges().remove(edge);
144  }
145 
152  public boolean removeEdges(List<HullEdge> edges) {
153  return getEdges().removeAll(edges);
154  }
155 
156 
163  public boolean addNeighbour(HullTriangle triangle) {
164  return getNeighbours().add(triangle);
165  }
166 
173  public boolean addNeighbours(List<HullTriangle> triangles) {
174  return getNeighbours().addAll(triangles);
175  }
176 
183  public boolean removeNeighbour(HullTriangle triangle) {
184  return getNeighbours().remove(triangle);
185  }
186 
193  public boolean removeNeighbours(List<HullTriangle> triangles) {
194  return getNeighbours().removeAll(triangles);
195  }
196 }