本文整理了Java中com.github.rinde.rinsim.geom.Graph.isEmpty()
方法的一些代码示例,展示了Graph.isEmpty()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Graph.isEmpty()
方法的具体详情如下:
包路径:com.github.rinde.rinsim.geom.Graph
类名称:Graph
方法名:isEmpty
暂无
代码示例来源:origin: rinde/RinSim
@Override
public boolean isEmpty() {
return delegate.isEmpty();
}
代码示例来源:origin: com.github.rinde/rinsim-geom
@Override
public boolean isEmpty() {
return delegate.isEmpty();
}
代码示例来源:origin: rinde/RinSim
@Override
public Optional<ViewRect> getViewRect() {
checkState(!graph.isEmpty(),
"graph may not be empty at this point");
final List<Point> extremes = Graphs.getExtremes(graph);
return Optional.of(new ViewRect(
PointUtil.sub(extremes.get(0), margin),
PointUtil.add(extremes.get(1), margin)));
}
代码示例来源:origin: rinde/RinSim
@Override
public Optional<ViewRect> getViewRect() {
checkState(!model.getGraph().isEmpty(),
"graph may not be empty at this point");
final List<Point> extremes = Graphs.getExtremes(model.getGraph());
return Optional.of(new ViewRect(
PointUtil.sub(extremes.get(0), margin),
PointUtil.add(extremes.get(1), margin)));
}
代码示例来源:origin: rinde/RinSim
@Test
public void isEmtpy() {
assertTrue(graph.isEmpty());
graph.addConnection(new Point(0, 0), new Point(1, 0));
assertFalse(graph.isEmpty());
graph.removeConnection(new Point(0, 0), new Point(1, 0));
assertTrue(graph.isEmpty());
}
代码示例来源: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);
}
}
内容来源于网络,如有侵权,请联系作者删除!