@Test public void testGetVerticesByGraphVariables() { AsciiGraphLoader<EPGMGraphHead, EPGMVertex, EPGMEdge> asciiGraphLoader = AsciiGraphLoader.fromString("g[(a),(b)],h[(a),(c)]", getEPGMElementFactoryProvider()); validateCollections(asciiGraphLoader, 2, 3, 0); validateCaches(asciiGraphLoader, 2, 3, 0); Collection<EPGMVertex> verticesG = asciiGraphLoader .getVerticesByGraphVariables("g"); Collection<EPGMVertex> verticesH = asciiGraphLoader .getVerticesByGraphVariables("h"); Collection<EPGMVertex> verticesGH = asciiGraphLoader .getVerticesByGraphVariables("g", "h"); EPGMVertex a = asciiGraphLoader.getVertexByVariable("a"); EPGMVertex b = asciiGraphLoader.getVertexByVariable("b"); EPGMVertex c = asciiGraphLoader.getVertexByVariable("c"); assertEquals("Wrong number of vertices", 2, verticesG.size()); assertEquals("Wrong number of vertices", 2, verticesH.size()); assertEquals("Wrong number of vertices", 3, verticesGH.size()); assertTrue("EPGMVertex was not contained in graph", verticesG.contains(a)); assertTrue("EPGMVertex was not contained in graph", verticesG.contains(b)); assertTrue("EPGMVertex was not contained in graph", verticesH.contains(a)); assertTrue("EPGMVertex was not contained in graph", verticesH.contains(c)); assertTrue("EPGMVertex was not contained in graph", verticesGH.contains(a)); assertTrue("EPGMVertex was not contained in graph", verticesGH.contains(b)); assertTrue("EPGMVertex was not contained in graph", verticesGH.contains(c)); }
public Collection<V> getVerticesByGraphVariables(String... graphVariables) { GradoopIdSet graphIds = new GradoopIdSet(); for (G graphHead : getGraphHeadsByVariables(graphVariables)) { graphIds.add(graphHead.getId()); } return getVerticesByGraphIds(graphIds); }
AsciiGraphLoader { public Collection<V> getVerticesByGraphVariables(String... graphVariables) { GradoopIdSet graphIds = new GradoopIdSet(); for (G graphHead : getGraphHeadsByVariables(graphVariables)) { graphIds.add(graphHead.getId()); } return getVerticesByGraphIds(graphIds); } }
AsciiGraphLoader { public Collection<V> getVerticesByGraphVariables(String... graphVariables) { GradoopIdSet graphIds = new GradoopIdSet(); for (G graphHead : getGraphHeadsByVariables(graphVariables)) { graphIds.add(graphHead.getId()); } return getVerticesByGraphIds(graphIds); } private  AsciiGraphLoader(GDLHandler gdlHandler,
                           ElementFactoryProvider<G, V, E> elementFactoryProvider); }
AsciiGraphLoader { public Collection<V> getVerticesByGraphVariables(String... graphVariables) { GradoopIdSet graphIds = new GradoopIdSet(); for (G graphHead : getGraphHeadsByVariables(graphVariables)) { graphIds.add(graphHead.getId()); } return getVerticesByGraphIds(graphIds); } 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> getVerticesByGraphVariables(String... graphVariables) { GradoopIdSet graphIds = new GradoopIdSet(); for (G graphHead : getGraphHeadsByVariables(graphVariables)) { graphIds.add(graphHead.getId()); } return getVerticesByGraphIds(graphIds); } 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();  }