com.github.rinde.rinsim.geom.Graph.getIncomingConnections()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(130)

本文整理了Java中com.github.rinde.rinsim.geom.Graph.getIncomingConnections()方法的一些代码示例,展示了Graph.getIncomingConnections()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Graph.getIncomingConnections()方法的具体详情如下:
包路径:com.github.rinde.rinsim.geom.Graph
类名称:Graph
方法名:getIncomingConnections

Graph.getIncomingConnections介绍

暂无

代码示例

代码示例来源:origin: com.github.rinde/rinsim-geom

@Override
public Collection<Point> getIncomingConnections(Point node) {
 return delegate.getIncomingConnections(node);
}

代码示例来源:origin: rinde/RinSim

@Override
public Collection<Point> getIncomingConnections(Point node) {
 return delegate.getIncomingConnections(node);
}

代码示例来源:origin: rinde/RinSim

@Override
public Collection<Point> getIncomingConnections(Point node) {
 return Collections.unmodifiableCollection(delegate
  .getIncomingConnections(node));
}

代码示例来源:origin: com.github.rinde/rinsim-geom

@Override
public Collection<Point> getIncomingConnections(Point node) {
 return Collections.unmodifiableCollection(delegate
  .getIncomingConnections(node));
}

代码示例来源:origin: com.github.rinde/rinsim-geom

@Override
public void removeNode(Point node) {
 // collect data of removed connections but only if there is a listener
 final List<Connection<?>> removedConnections = newArrayList();
 if (eventDispatcher.hasListenerFor(EventTypes.REMOVE_CONNECTION)) {
  for (final Point p : delegate.getIncomingConnections(node)) {
   removedConnections.add(delegate.getConnection(p, node));
  }
  for (final Point p : delegate.getOutgoingConnections(node)) {
   removedConnections.add(delegate.getConnection(node, p));
  }
 }
 delegate.removeNode(node);
 // notify listeners
 for (final Connection<?> c : removedConnections) {
  eventDispatcher.dispatchEvent(new GraphEvent(
   EventTypes.REMOVE_CONNECTION, this, c));
 }
}

代码示例来源:origin: rinde/RinSim

@Override
public void removeNode(Point node) {
 // collect data of removed connections but only if there is a listener
 final List<Connection<?>> removedConnections = newArrayList();
 if (eventDispatcher.hasListenerFor(EventTypes.REMOVE_CONNECTION)) {
  for (final Point p : delegate.getIncomingConnections(node)) {
   removedConnections.add(delegate.getConnection(p, node));
  }
  for (final Point p : delegate.getOutgoingConnections(node)) {
   removedConnections.add(delegate.getConnection(node, p));
  }
 }
 delegate.removeNode(node);
 // notify listeners
 for (final Connection<?> c : removedConnections) {
  eventDispatcher.dispatchEvent(new GraphEvent(
   EventTypes.REMOVE_CONNECTION, this, c));
 }
}

代码示例来源:origin: rinde/RinSim

.getIncomingConnections(conn.from());

代码示例来源:origin: rinde/RinSim

conns.addAll(graph.getIncomingConnections(p));
conns.addAll(graph.getOutgoingConnections(p));

代码示例来源:origin: rinde/RinSim

@Test
public void incomingConnectionsOrder() {
 final Point incoming = new Point(0, 0);
 final Point p0 = new Point(1, 0);
 final Point p1 = new Point(2, 0);
 final Point p2 = new Point(3, 0);
 final Point p3 = new Point(4, 0);
 final Point p4 = new Point(5, 0);
 final Point p5 = new Point(6, 0);
 final List<Point> points = Arrays.asList(p0, p1, p2, p3, p4, p5);
 for (final Point p : points) {
  graph.addConnection(p, incoming);
 }
 final List<Point> incomingConn = new ArrayList<Point>(
  graph.getIncomingConnections(incoming));
 for (int i = 0; i < incomingConn.size(); i++) {
  assertSame(incomingConn.get(i), points.get(i));
 }
}

代码示例来源:origin: rinde/RinSim

@Test
public void unmodifiable() {
 final Point N = new Point(0, 5);
 final Point E = new Point(5, 0);
 final Point S = new Point(0, -5);
 final Point W = new Point(-5, 0);
 Graphs.addBiPath(graph, N, E, S, W, N);
 final Graph<LengthData> g = Graphs.unmodifiableGraph(graph);
 g.hashCode();
 assertEquals(graph, g);
 assertEquals(g, graph);
 assertFalse(g.equals(new Object()));
 assertFalse(g.isEmpty());
 for (final Point p : g.getNodes()) {
  assertArrayEquals(graph.getIncomingConnections(p).toArray(), g
   .getIncomingConnections(p).toArray());
 }
 for (final Connection<LengthData> c : g.getConnections()) {
  assertEquals(graph.connectionLength(c.from(), c.to()),
   g.connectionLength(c.from(), c.to()), DELTA);
 }
}

相关文章