public VertexQuery limit(final int limit) { this.query = this.query.limit(limit); return this; }
@Override public Iterable<AtlasVertex<Titan0Vertex, Titan0Edge>> vertices(int limit) { Preconditions.checkArgument(limit >=0, "Limit should be greater than or equals to 0"); Iterable<Vertex> vertices = vertexQuery.limit(limit).vertices(); return graph.wrapVertices(vertices); }
@Override public Iterable<AtlasEdge<Titan0Vertex, Titan0Edge>> edges(int limit) { Preconditions.checkArgument(limit >=0, "Limit should be greater than or equals to 0"); Iterable<Edge> edges = vertexQuery.limit(limit).edges(); return graph.wrapEdges(edges); }
protected Edge processNextStart() { while (true) { if (this.nextEnds.hasNext()) { return this.nextEnds.next(); } else { this.nextEnds = this.doBranchFactor ? this.starts.next().query().direction(this.direction).labels(this.labels).limit(this.branchFactor).edges().iterator() : this.starts.next().getEdges(this.direction, this.labels).iterator(); } } }
protected Vertex processNextStart() { while (true) { if (this.nextEnds.hasNext()) { return this.nextEnds.next(); } else { this.nextEnds = this.doBranchFactor ? this.starts.next().query().direction(this.direction).labels(this.labels).limit(this.branchFactor).vertices().iterator() : this.starts.next().getVertices(this.direction, this.labels).iterator(); } } }
public VertexQuery build(final Vertex vertex) { VertexQuery query = vertex.query(); for (final HasContainer hasContainer : this.hasContainers) { query = query.has(hasContainer.key, hasContainer.predicate, hasContainer.value); } return query.limit(this.limit).labels(this.labels).direction(this.direction); } }