@Test public void testVertexExists() { try { graph.vertexExists(-1); fail(); } catch (PowsyblException e) { assertEquals("Invalid vertex -1", e.getMessage()); } assertFalse(graph.vertexExists(0)); graph.addVertex(); assertTrue(graph.vertexExists(0)); }
@Override public boolean vertexExists(int v) { if (v < 0) { throw new PowsyblException("Invalid vertex " + v); } return v < vertices.size() && vertices.get(v) != null; }
UndirectedGraphImpl implements UndirectedGraph<V, E> { @Override public boolean vertexExists(int v) { if (v < 0) { throw new PowsyblException("Invalid vertex " + v); } return v < vertices.size() && vertices.get(v) != null; } }
UndirectedGraphImpl implements UndirectedGraph<V, E> { @Override public boolean vertexExists(int v) { if (v < 0) { throw new PowsyblException("Invalid vertex " + v); } return v < vertices.size() && vertices.get(v) != null; }  }
UndirectedGraphImpl implements UndirectedGraph<V, E> { @Override public boolean vertexExists(int v) { if (v < 0) { throw new PowsyblException("Invalid vertex " + v); } return v < vertices.size() && vertices.get(v) != null; }  @Override int addVertex(); @Override void addVertexIfNotPresent(int v); @Override boolean vertexExists(int v); @Override V removeVertex(int v); @Override int getVertexCount(); @Override void removeAllVertices(); @Override int addEdge(int v1, int v2, E obj); @Override E removeEdge(int e); @Override void removeAllEdges(); @Override int getEdgeCount(); @Override int[] getVertices(); @Override int[] getEdges(); @Override int getVertexCapacity(); @Override Iterable<V> getVerticesObj(); @Override Stream<V> getVertexObjectStream(); @Override V getVertexObject(int v); @Override void setVertexObject(int v, V obj); @Override int getEdgeVertex1(int e); @Override int getEdgeVertex2(int e); @Override Iterable<E> getEdgesObject(); @Override Stream<E> getEdgeObjectStream(); @Override E getEdgeObject(int e); @Override List<E> getEdgeObjects(int v1, int v2); @Override void traverse(int v, Traverser traverser, boolean[] encountered); @Override void traverse(int v, Traverser traverser); @Override List<TIntArrayList> findAllPaths(int from, Function<V, Boolean> pathComplete, Function<E, Boolean> pathCancelled); @Override void addListener(UndirectedGraphListener l); @Override void removeListener(UndirectedGraphListener l); @Override void print(PrintStream out, Function<V, String> vertexToString, Function<E, String> edgeToString); }
UndirectedGraphImpl implements UndirectedGraph<V, E> { @Override public boolean vertexExists(int v) { if (v < 0) { throw new PowsyblException("Invalid vertex " + v); } return v < vertices.size() && vertices.get(v) != null; }  @Override int addVertex(); @Override void addVertexIfNotPresent(int v); @Override boolean vertexExists(int v); @Override V removeVertex(int v); @Override int getVertexCount(); @Override void removeAllVertices(); @Override int addEdge(int v1, int v2, E obj); @Override E removeEdge(int e); @Override void removeAllEdges(); @Override int getEdgeCount(); @Override int[] getVertices(); @Override int[] getEdges(); @Override int getVertexCapacity(); @Override Iterable<V> getVerticesObj(); @Override Stream<V> getVertexObjectStream(); @Override V getVertexObject(int v); @Override void setVertexObject(int v, V obj); @Override int getEdgeVertex1(int e); @Override int getEdgeVertex2(int e); @Override Iterable<E> getEdgesObject(); @Override Stream<E> getEdgeObjectStream(); @Override E getEdgeObject(int e); @Override List<E> getEdgeObjects(int v1, int v2); @Override void traverse(int v, Traverser traverser, boolean[] encountered); @Override void traverse(int v, Traverser traverser); @Override List<TIntArrayList> findAllPaths(int from, Function<V, Boolean> pathComplete, Function<E, Boolean> pathCancelled); @Override void addListener(UndirectedGraphListener l); @Override void removeListener(UndirectedGraphListener l); @Override void print(PrintStream out, Function<V, String> vertexToString, Function<E, String> edgeToString);  }