@Test public void testGetEdgesByGraphIds() { AsciiGraphLoader<EPGMGraphHead, EPGMVertex, EPGMEdge> asciiGraphLoader = AsciiGraphLoader.fromString("g[()-[a]->()<-[b]-()],h[()-[c]->()-[d]->()]", getEPGMElementFactoryProvider()); validateCollections(asciiGraphLoader, 2, 6, 4); validateCaches(asciiGraphLoader, 2, 0, 4); EPGMGraphHead g = asciiGraphLoader.getGraphHeadByVariable("g"); EPGMGraphHead h = asciiGraphLoader.getGraphHeadByVariable("h"); Collection<EPGMEdge> edgesG = asciiGraphLoader .getEdgesByGraphIds(GradoopIdSet.fromExisting(g.getId())); Collection<EPGMEdge> edgesH = asciiGraphLoader .getEdgesByGraphIds(GradoopIdSet.fromExisting(h.getId())); Collection<EPGMEdge> edgesGH = asciiGraphLoader .getEdgesByGraphIds(GradoopIdSet.fromExisting(g.getId(), h.getId())); EPGMEdge a = asciiGraphLoader.getEdgeByVariable("a"); EPGMEdge b = asciiGraphLoader.getEdgeByVariable("b"); EPGMEdge c = asciiGraphLoader.getEdgeByVariable("c"); EPGMEdge d = asciiGraphLoader.getEdgeByVariable("d"); assertEquals("Wrong number of edges", 2, edgesG.size()); assertEquals("Wrong number of edges", 2, edgesH.size()); assertEquals("Wrong number of edges", 4, edgesGH.size()); assertTrue("EPGMEdge was not contained in graph", edgesG.contains(a)); assertTrue("EPGMEdge was not contained in graph", edgesG.contains(b)); assertTrue("EPGMEdge was not contained in graph", edgesH.contains(c)); assertTrue("EPGMEdge was not contained in graph", edgesH.contains(d)); assertTrue("EPGMEdge was not contained in graph", edgesGH.contains(a)); assertTrue("EPGMEdge was not contained in graph", edgesGH.contains(b)); assertTrue("EPGMEdge was not contained in graph", edgesGH.contains(c)); assertTrue("EPGMEdge was not contained in graph", edgesGH.contains(d)); }
public Collection<E> getEdgesByGraphIds(GradoopIdSet graphIds) { Collection<E> result = Sets.newHashSetWithExpectedSize(graphIds.size()); for (E edge : edges.values()) { if (edge.getGraphIds().containsAny(graphIds)) { result.add(edge); } } return result; }
AsciiGraphLoader { public Collection<E> getEdgesByGraphIds(GradoopIdSet graphIds) { Collection<E> result = Sets.newHashSetWithExpectedSize(graphIds.size()); for (E edge : edges.values()) { if (edge.getGraphIds().containsAny(graphIds)) { result.add(edge); } } return result; } }
AsciiGraphLoader { public Collection<E> getEdgesByGraphIds(GradoopIdSet graphIds) { Collection<E> result = Sets.newHashSetWithExpectedSize(graphIds.size()); for (E edge : edges.values()) { if (edge.getGraphIds().containsAny(graphIds)) { result.add(edge); } } return result; } private  AsciiGraphLoader(GDLHandler gdlHandler,
                           ElementFactoryProvider<G, V, E> elementFactoryProvider); }
AsciiGraphLoader { public Collection<E> getEdgesByGraphIds(GradoopIdSet graphIds) { Collection<E> result = Sets.newHashSetWithExpectedSize(graphIds.size()); for (E edge : edges.values()) { if (edge.getGraphIds().containsAny(graphIds)) { result.add(edge); } } return result; } private  AsciiGraphLoader(GDLHandler gdlHandler,
                           ElementFactoryProvider<G, V, E> elementFactoryProvider); static AsciiGraphLoader<G, V, E> fromString(String asciiGraph,
                                       ElementFactoryProvider<G, V, E> elementFactoryProvider); static AsciiGraphLoader<G, V, E> fromFile(String fileName,
                                     ElementFactoryProvider<G, V, E> elementFactoryProvider); static AsciiGraphLoader<G, V, E> fromStream(InputStream inputStream,
                                       ElementFactoryProvider<G, V, E> elementFactoryProvider); void appendFromString(String asciiGraph); Collection<G> getGraphHeads(); G getGraphHeadByVariable(String variable); Collection<G> getGraphHeadsByVariables(String... variables); Collection<V> getVertices(); V getVertexByVariable(String variable); Collection<V> getVerticesByVariables(String... variables); Collection<V> getVerticesByGraphIds(GradoopIdSet graphIds); Collection<V> getVerticesByGraphVariables(String... graphVariables); Collection<E> getEdges(); E getEdgeByVariable(String variable); Collection<E> getEdgesByVariables(String... variables); Collection<E> getEdgesByGraphIds(GradoopIdSet graphIds); Collection<E> getEdgesByGraphVariables(String... variables); Map<String, G> getGraphHeadCache(); Map<String, V> getVertexCache(); Map<String, E> getEdgeCache(); }
AsciiGraphLoader { public Collection<E> getEdgesByGraphIds(GradoopIdSet graphIds) { Collection<E> result = Sets.newHashSetWithExpectedSize(graphIds.size()); for (E edge : edges.values()) { if (edge.getGraphIds().containsAny(graphIds)) { result.add(edge); } } return result; } private  AsciiGraphLoader(GDLHandler gdlHandler,
                           ElementFactoryProvider<G, V, E> elementFactoryProvider); static AsciiGraphLoader<G, V, E> fromString(String asciiGraph,
                                       ElementFactoryProvider<G, V, E> elementFactoryProvider); static AsciiGraphLoader<G, V, E> fromFile(String fileName,
                                     ElementFactoryProvider<G, V, E> elementFactoryProvider); static AsciiGraphLoader<G, V, E> fromStream(InputStream inputStream,
                                       ElementFactoryProvider<G, V, E> elementFactoryProvider); void appendFromString(String asciiGraph); Collection<G> getGraphHeads(); G getGraphHeadByVariable(String variable); Collection<G> getGraphHeadsByVariables(String... variables); Collection<V> getVertices(); V getVertexByVariable(String variable); Collection<V> getVerticesByVariables(String... variables); Collection<V> getVerticesByGraphIds(GradoopIdSet graphIds); Collection<V> getVerticesByGraphVariables(String... graphVariables); Collection<E> getEdges(); E getEdgeByVariable(String variable); Collection<E> getEdgesByVariables(String... variables); Collection<E> getEdgesByGraphIds(GradoopIdSet graphIds); Collection<E> getEdgesByGraphVariables(String... variables); Map<String, G> getGraphHeadCache(); Map<String, V> getVertexCache(); Map<String, E> getEdgeCache();  }