diff --git a/src/main/java/it/unibz/inf/isochrone/network/NodeConnection.java b/src/main/java/it/unibz/inf/isochrone/network/NodeConnection.java index 34ee245d6116881c4e0fe3728d6244e13c8b748b..cd7652ebe299d3144b04d5814541bce68f02334a 100644 --- a/src/main/java/it/unibz/inf/isochrone/network/NodeConnection.java +++ b/src/main/java/it/unibz/inf/isochrone/network/NodeConnection.java @@ -22,38 +22,6 @@ public class NodeConnection { // Getters - public Collection<Link> getAllLinks() { - final Collection<Collection<Link>> linkSet = targetRoutes.values(); - final Set<Link> resultSet = new LinkedHashSet<>(linkSet.size()); - for (final Collection<Link> lCollection : linkSet) { - resultSet.addAll(lCollection); - } - - return resultSet; - } - - public Collection<Integer> getAllTargetNodes() { - final Set<Node> nodeSet = targetRoutes.keySet(); - final Set<Integer> resultSet = new LinkedHashSet<>(nodeSet.size()); - for (final Node n : nodeSet) { - resultSet.add(n.getId()); - } - - return resultSet; - } - - public Collection<Integer> getAllRoutes() { - final Collection<Collection<Link>> linkSet = targetRoutes.values(); - final Set<Integer> resultSet = new LinkedHashSet<>(linkSet.size()); - for (final Collection<Link> lCollection : linkSet) { - for (final Link l : lCollection) { - resultSet.add(l.getRoute()); - } - } - - return resultSet; - } - public Node getSourceNode() { return sourceNode; } @@ -62,14 +30,6 @@ public class NodeConnection { return targetRoutes; } - public Node getTargetNode(final int targetNodeId) { - return getNodeById(targetNodeId); - } - - public Collection<Integer> getTargetRoutes(final int targetNodeId) { - return getRoutesToTarget(targetNodeId); - } - // Public methods public void addLink(final Node targetNode, final Link link) { @@ -107,24 +67,4 @@ public class NodeConnection { targetRoutes.put(node, c); } - private Node getNodeById(final int nodeId) { - final Set<Node> entries = targetRoutes.keySet(); - for (final Node n : entries) { - if (nodeId == n.getId()) { - return n; - } - } - - return null; - } - - private Collection<Integer> getRoutesToTarget(final int targetNodeId) { - return getRoutesToTarget(getNodeById(targetNodeId)); - } - - private Collection<Integer> getRoutesToTarget(final Node targetNode) { - final Collection<Link> linkSet = targetRoutes.get(targetNode); - return getTargetRoutes(linkSet); - } - }