@Test public void testIsIncident() { GraphStore graphStore = GraphGenerator.generateTinyGraphStore(); GraphViewStore store = graphStore.viewStore; GraphViewImpl view = store.createView(); DirectedSubgraph graph = store.getDirectedGraph(view); view.fill(); Node n1 = graph.getNode("1"); Assert.assertTrue(graph.isIncident(n1, graph.getEdge("0"))); Edge edge = graphStore.factory.newEdge("edge", n1, n1, EdgeTypeStore.NULL_LABEL, 1.0, true); graphStore.addEdge(edge); Assert.assertTrue(graph.isIncident(edge, graph.getEdge("0"))); }
@Override public boolean isIncident(Edge edge1, Edge edge2) { graphStore.autoReadLock(); try { checkValidInViewEdgeObject(edge1); checkValidInViewEdgeObject(edge2); return graphStore.edgeStore.isIncident((EdgeImpl) edge1, (EdgeImpl) edge2); } finally { graphStore.autoReadUnlock(); } }
GraphViewDecorator implements DirectedSubgraph, UndirectedSubgraph { @Override public boolean isIncident(Edge edge1, Edge edge2) { graphStore.autoReadLock(); try { checkValidInViewEdgeObject(edge1); checkValidInViewEdgeObject(edge2); return graphStore.edgeStore.isIncident((EdgeImpl) edge1, (EdgeImpl) edge2); } finally { graphStore.autoReadUnlock(); } } }
GraphViewDecorator implements DirectedSubgraph, UndirectedSubgraph { @Override public boolean isIncident(Edge edge1, Edge edge2) { graphStore.autoReadLock(); try { checkValidInViewEdgeObject(edge1); checkValidInViewEdgeObject(edge2); return graphStore.edgeStore.isIncident((EdgeImpl) edge1, (EdgeImpl) edge2); } finally { graphStore.autoReadUnlock(); } } GraphViewDecorator(GraphStore graphStore, GraphViewImpl view, boolean undirected); }
GraphViewDecorator implements DirectedSubgraph, UndirectedSubgraph { @Override public boolean isIncident(Edge edge1, Edge edge2) { graphStore.autoReadLock(); try { checkValidInViewEdgeObject(edge1); checkValidInViewEdgeObject(edge2); return graphStore.edgeStore.isIncident((EdgeImpl) edge1, (EdgeImpl) edge2); } finally { graphStore.autoReadUnlock(); } } GraphViewDecorator(GraphStore graphStore, GraphViewImpl view, boolean undirected); @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 Edge getMutualEdge(Edge e); @Override NodeIterable getPredecessors(Node node); @Override NodeIterable getPredecessors(Node node, int type); @Override NodeIterable getSuccessors(Node node); @Override NodeIterable getSuccessors(Node node, int type); @Override EdgeIterable getInEdges(Node node); @Override EdgeIterable getInEdges(Node node, int type); @Override EdgeIterable getOutEdges(Node node); @Override EdgeIterable getOutEdges(Node node, int type); @Override boolean isAdjacent(Node source, Node target); @Override boolean isAdjacent(Node source, Node target, int type); @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 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 int getInDegree(Node node); @Override int getOutDegree(Node node); @Override boolean isSelfLoop(Edge edge); @Override boolean isDirected(Edge edge); @Override boolean isIncident(Edge edge1, Edge edge2); @Override boolean isIncident(final Node node, final 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, double timestamp); @Override void removeAttribute(String key, Interval interval); @Override GraphModel getModel(); @Override boolean isDirected(); @Override boolean isUndirected(); @Override boolean isMixed(); @Override void readLock(); @Override void readUnlock(); @Override void readUnlockAll(); @Override void writeLock(); @Override void writeUnlock(); @Override GraphView getView(); @Override void fill(); @Override void union(Subgraph subGraph); @Override void intersection(Subgraph subGraph); @Override void not(); @Override Graph getRootGraph(); }
GraphViewDecorator implements DirectedSubgraph, UndirectedSubgraph { @Override public boolean isIncident(Edge edge1, Edge edge2) { graphStore.autoReadLock(); try { checkValidInViewEdgeObject(edge1); checkValidInViewEdgeObject(edge2); return graphStore.edgeStore.isIncident((EdgeImpl) edge1, (EdgeImpl) edge2); } finally { graphStore.autoReadUnlock(); } } GraphViewDecorator(GraphStore graphStore, GraphViewImpl view, boolean undirected); @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 Edge getMutualEdge(Edge e); @Override NodeIterable getPredecessors(Node node); @Override NodeIterable getPredecessors(Node node, int type); @Override NodeIterable getSuccessors(Node node); @Override NodeIterable getSuccessors(Node node, int type); @Override EdgeIterable getInEdges(Node node); @Override EdgeIterable getInEdges(Node node, int type); @Override EdgeIterable getOutEdges(Node node); @Override EdgeIterable getOutEdges(Node node, int type); @Override boolean isAdjacent(Node source, Node target); @Override boolean isAdjacent(Node source, Node target, int type); @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 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 int getInDegree(Node node); @Override int getOutDegree(Node node); @Override boolean isSelfLoop(Edge edge); @Override boolean isDirected(Edge edge); @Override boolean isIncident(Edge edge1, Edge edge2); @Override boolean isIncident(final Node node, final 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, double timestamp); @Override void removeAttribute(String key, Interval interval); @Override GraphModel getModel(); @Override boolean isDirected(); @Override boolean isUndirected(); @Override boolean isMixed(); @Override void readLock(); @Override void readUnlock(); @Override void readUnlockAll(); @Override void writeLock(); @Override void writeUnlock(); @Override GraphView getView(); @Override void fill(); @Override void union(Subgraph subGraph); @Override void intersection(Subgraph subGraph); @Override void not(); @Override Graph getRootGraph();  }