@Test public void testAddEdge() { GraphStore store = GraphGenerator.generateTinyUndirectedGraphStore(); UndirectedGraph graph = store.undirectedDecorator; Assert.assertNotNull(graph.getNode("1")); Assert.assertNotNull(graph.getNode("2")); Assert.assertNotNull(graph.getEdge("0")); }
@Override public boolean addEdge(Edge edge) { if (edge.isDirected()) { throw new IllegalArgumentException("Can't add a directed edge to an undirected graph"); } return store.addEdge(edge); }
UndirectedDecorator implements UndirectedGraph, UndirectedSubgraph { @Override public boolean addEdge(Edge edge) { if (edge.isDirected()) { throw new IllegalArgumentException("Can't add a directed edge to an undirected graph"); } return store.addEdge(edge); } }
UndirectedDecorator implements UndirectedGraph, UndirectedSubgraph { @Override public boolean addEdge(Edge edge) { if (edge.isDirected()) { throw new IllegalArgumentException("Can't add a directed edge to an undirected graph"); } return store.addEdge(edge); } UndirectedDecorator(GraphStore store); }
UndirectedDecorator implements UndirectedGraph, UndirectedSubgraph { @Override public boolean addEdge(Edge edge) { if (edge.isDirected()) { throw new IllegalArgumentException("Can't add a directed edge to an undirected graph"); } return store.addEdge(edge); } UndirectedDecorator(GraphStore store); @Override boolean addEdge(Edge edge); @Override boolean addNode(Node node); @Override boolean addAllEdges(Collection<? extends Edge> edges); @Override boolean addAllNodes(Collection<? extends Node> nodes); @Override boolean removeEdge(Edge edge); @Override boolean removeNode(Node node); @Override boolean removeAllEdges(Collection<? extends Edge> edges); @Override boolean removeAllNodes(Collection<? extends Node> nodes); @Override boolean contains(Node node); @Override boolean contains(Edge edge); @Override Node getNode(Object id); @Override boolean hasNode(final Object id); @Override Edge getEdge(Object id); @Override boolean hasEdge(final Object id); @Override Edge getEdge(Node node1, Node node2); @Override EdgeIterable getEdges(Node node1, Node node2); @Override Edge getEdge(Node node1, Node node2, int type); @Override EdgeIterable getEdges(Node node1, Node node2, int type); @Override NodeIterable getNodes(); @Override EdgeIterable getEdges(); @Override EdgeIterable getSelfLoops(); @Override NodeIterable getNeighbors(Node node); @Override NodeIterable getNeighbors(Node node, int type); @Override EdgeIterable getEdges(Node node); @Override EdgeIterable getEdges(Node node, int type); @Override int getNodeCount(); @Override int getEdgeCount(); @Override int getEdgeCount(int type); @Override Node getOpposite(Node node, Edge edge); @Override int getDegree(Node node); @Override boolean isSelfLoop(Edge edge); @Override boolean isDirected(Edge edge); @Override boolean isAdjacent(Node node1, Node node2); @Override boolean isAdjacent(Node node1, Node node2, int type); @Override boolean isIncident(Edge edge1, Edge edge2); @Override boolean isIncident(Node node, Edge edge); @Override void clearEdges(Node node); @Override void clearEdges(Node node, int type); @Override void clear(); @Override void clearEdges(); @Override Object getAttribute(String key); @Override Object getAttribute(String key, double timestamp); @Override Object getAttribute(String key, Interval interval); @Override Set<String> getAttributeKeys(); @Override void setAttribute(String key, Object value); @Override void setAttribute(String key, Object value, double timestamp); @Override void setAttribute(String key, Object value, Interval interval); @Override void removeAttribute(String key); @Override void removeAttribute(String key, Interval interval); @Override void removeAttribute(String key, double timestamp); @Override GraphView getView(); @Override void readLock(); @Override void readUnlock(); @Override void readUnlockAll(); @Override void writeLock(); @Override void writeUnlock(); @Override GraphModel getModel(); @Override boolean isDirected(); @Override boolean isMixed(); @Override boolean isUndirected(); @Override void union(Subgraph subGraph); @Override void intersection(Subgraph subGraph); @Override void fill(); @Override void not(); @Override Graph getRootGraph(); }
UndirectedDecorator implements UndirectedGraph, UndirectedSubgraph { @Override public boolean addEdge(Edge edge) { if (edge.isDirected()) { throw new IllegalArgumentException("Can't add a directed edge to an undirected graph"); } return store.addEdge(edge); } UndirectedDecorator(GraphStore store); @Override boolean addEdge(Edge edge); @Override boolean addNode(Node node); @Override boolean addAllEdges(Collection<? extends Edge> edges); @Override boolean addAllNodes(Collection<? extends Node> nodes); @Override boolean removeEdge(Edge edge); @Override boolean removeNode(Node node); @Override boolean removeAllEdges(Collection<? extends Edge> edges); @Override boolean removeAllNodes(Collection<? extends Node> nodes); @Override boolean contains(Node node); @Override boolean contains(Edge edge); @Override Node getNode(Object id); @Override boolean hasNode(final Object id); @Override Edge getEdge(Object id); @Override boolean hasEdge(final Object id); @Override Edge getEdge(Node node1, Node node2); @Override EdgeIterable getEdges(Node node1, Node node2); @Override Edge getEdge(Node node1, Node node2, int type); @Override EdgeIterable getEdges(Node node1, Node node2, int type); @Override NodeIterable getNodes(); @Override EdgeIterable getEdges(); @Override EdgeIterable getSelfLoops(); @Override NodeIterable getNeighbors(Node node); @Override NodeIterable getNeighbors(Node node, int type); @Override EdgeIterable getEdges(Node node); @Override EdgeIterable getEdges(Node node, int type); @Override int getNodeCount(); @Override int getEdgeCount(); @Override int getEdgeCount(int type); @Override Node getOpposite(Node node, Edge edge); @Override int getDegree(Node node); @Override boolean isSelfLoop(Edge edge); @Override boolean isDirected(Edge edge); @Override boolean isAdjacent(Node node1, Node node2); @Override boolean isAdjacent(Node node1, Node node2, int type); @Override boolean isIncident(Edge edge1, Edge edge2); @Override boolean isIncident(Node node, Edge edge); @Override void clearEdges(Node node); @Override void clearEdges(Node node, int type); @Override void clear(); @Override void clearEdges(); @Override Object getAttribute(String key); @Override Object getAttribute(String key, double timestamp); @Override Object getAttribute(String key, Interval interval); @Override Set<String> getAttributeKeys(); @Override void setAttribute(String key, Object value); @Override void setAttribute(String key, Object value, double timestamp); @Override void setAttribute(String key, Object value, Interval interval); @Override void removeAttribute(String key); @Override void removeAttribute(String key, Interval interval); @Override void removeAttribute(String key, double timestamp); @Override GraphView getView(); @Override void readLock(); @Override void readUnlock(); @Override void readUnlockAll(); @Override void writeLock(); @Override void writeUnlock(); @Override GraphModel getModel(); @Override boolean isDirected(); @Override boolean isMixed(); @Override boolean isUndirected(); @Override void union(Subgraph subGraph); @Override void intersection(Subgraph subGraph); @Override void fill(); @Override void not(); @Override Graph getRootGraph();  }