@Test public void testGetVerticesByGraphIds() { AsciiGraphLoader<EPGMGraphHead, EPGMVertex, EPGMEdge> asciiGraphLoader = AsciiGraphLoader.fromString("g[(a),(b)],h[(a),(c)]", getEPGMElementFactoryProvider()); validateCollections(asciiGraphLoader, 2, 3, 0); validateCaches(asciiGraphLoader, 2, 3, 0); EPGMGraphHead g = asciiGraphLoader.getGraphHeadByVariable("g"); EPGMGraphHead h = asciiGraphLoader.getGraphHeadByVariable("h"); Collection<EPGMVertex> vertexsG = asciiGraphLoader .getVerticesByGraphIds(GradoopIdSet.fromExisting(g.getId())); Collection<EPGMVertex> vertexsH = asciiGraphLoader .getVerticesByGraphIds(GradoopIdSet.fromExisting(h.getId())); Collection<EPGMVertex> vertexsGH = asciiGraphLoader .getVerticesByGraphIds(GradoopIdSet.fromExisting(g.getId(), h.getId())); EPGMVertex a = asciiGraphLoader.getVertexByVariable("a"); EPGMVertex b = asciiGraphLoader.getVertexByVariable("b"); EPGMVertex c = asciiGraphLoader.getVertexByVariable("c"); assertEquals("Wrong number of vertices", 2, vertexsG.size()); assertEquals("Wrong number of vertices", 2, vertexsH.size()); assertEquals("Wrong number of vertices", 3, vertexsGH.size()); assertTrue("EPGMVertex was not contained in graph", vertexsG.contains(a)); assertTrue("EPGMVertex was not contained in graph", vertexsG.contains(b)); assertTrue("EPGMVertex was not contained in graph", vertexsH.contains(a)); assertTrue("EPGMVertex was not contained in graph", vertexsH.contains(c)); assertTrue("EPGMVertex was not contained in graph", vertexsGH.contains(a)); assertTrue("EPGMVertex was not contained in graph", vertexsGH.contains(b)); assertTrue("EPGMVertex was not contained in graph", vertexsGH.contains(c)); }
public Collection<V> getVerticesByGraphIds(GradoopIdSet graphIds) { Collection<V> result = Sets.newHashSetWithExpectedSize(graphIds.size()); for (V vertex : vertices.values()) { if (vertex.getGraphIds().containsAny(graphIds)) { result.add(vertex); } } return result; }
AsciiGraphLoader { public Collection<V> getVerticesByGraphIds(GradoopIdSet graphIds) { Collection<V> result = Sets.newHashSetWithExpectedSize(graphIds.size()); for (V vertex : vertices.values()) { if (vertex.getGraphIds().containsAny(graphIds)) { result.add(vertex); } } return result; } }
AsciiGraphLoader { public Collection<V> getVerticesByGraphIds(GradoopIdSet graphIds) { Collection<V> result = Sets.newHashSetWithExpectedSize(graphIds.size()); for (V vertex : vertices.values()) { if (vertex.getGraphIds().containsAny(graphIds)) { result.add(vertex); } } return result; } private  AsciiGraphLoader(GDLHandler gdlHandler,
                           ElementFactoryProvider<G, V, E> elementFactoryProvider); }
AsciiGraphLoader { public Collection<V> getVerticesByGraphIds(GradoopIdSet graphIds) { Collection<V> result = Sets.newHashSetWithExpectedSize(graphIds.size()); for (V vertex : vertices.values()) { if (vertex.getGraphIds().containsAny(graphIds)) { result.add(vertex); } } 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<V> getVerticesByGraphIds(GradoopIdSet graphIds) { Collection<V> result = Sets.newHashSetWithExpectedSize(graphIds.size()); for (V vertex : vertices.values()) { if (vertex.getGraphIds().containsAny(graphIds)) { result.add(vertex); } } 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();  }