congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
ArangoCursor.next
Code IndexAdd Tabnine to your IDE (free)

How to use
next
method
in
com.arangodb.ArangoCursor

Best Java code snippets using com.arangodb.ArangoCursor.next (Showing top 15 results out of 315)

origin: brianfrankcooper/YCSB

cursor = arangoDB.db(databaseName).query(aqlQuery, bindVars, null, VPackSlice.class);
while (cursor.hasNext()) {
 VPackSlice aDocument = cursor.next();
 HashMap<String, ByteIterator> aMap = new HashMap<String, ByteIterator>(aDocument.size());
 if (!this.fillMap(aMap, aDocument)) {
origin: arangodb/spring-data

  private Object getNext(final ArangoCursor<?> cursor) {
    return cursor.hasNext() ? cursor.next() : null;
  }
}
origin: com.arangodb/arangodb-spring-data

  private Object getNext(final ArangoCursor<?> cursor) {
    return cursor.hasNext() ? cursor.next() : null;
  }
}
origin: com.arangodb/arangodb-spring-data

/**
 * Finds one document which matches the given example object
 *
 * @param example
 *            example object to construct query with
 * @param <S>
 * @return An object representing the example if it exists, else null
 */
@Override
public <S extends T> Optional<S> findOne(final Example<S> example) {
  final ArangoCursor cursor = findAllInternal((Pageable) null, example, new HashMap());
  return cursor.hasNext() ? Optional.ofNullable((S) cursor.next()) : Optional.empty();
}
origin: arangodb/spring-data

/**
 * Finds one document which matches the given example object
 *
 * @param example
 *            example object to construct query with
 * @param <S>
 * @return An object representing the example if it exists, else null
 */
@Override
public <S extends T> Optional<S> findOne(final Example<S> example) {
  final ArangoCursor cursor = findAllInternal((Pageable) null, example, new HashMap());
  return cursor.hasNext() ? Optional.ofNullable((S) cursor.next()) : Optional.empty();
}
origin: ArangoDB-Community/arangodb-tinkerpop-provider

@SuppressWarnings("unchecked")
@Override
public IType next() {
  ArangoDBBaseDocument next = null;
  next = (ArangoDBBaseDocument) delegate.next();
  next.graph(graph);
  next.setPaired(true);
  return (IType) next;
}

origin: ArangoDB-Community/arangodb-tinkerpop-provider

@SuppressWarnings("unchecked")
@Override
public P next() {
  ArangoDBElementProperty<V> next = null;
  next = (ArangoDBElementProperty<V>) delegate.next();
  next.graph(graph);
  next.setPaired(true);
  return (P) next;
}

origin: com.arangodb/arangodb-spring-data

/**
 * Counts the number of documents in the collection which match with the given example
 *
 * @param example
 *            example object to construct query with
 * @param <S>
 * @return number of matching documents found
 */
@Override
public <S extends T> long count(final Example<S> example) {
  final Map<String, Object> bindVars = new HashMap<>();
  final String predicate = exampleConverter.convertExampleToPredicate(example, bindVars);
  final String filter = predicate.length() == 0 ? "" : " FILTER " + predicate;
  final String query = String.format("FOR e IN %s%s COLLECT WITH COUNT INTO length RETURN length",
    getCollectionName(), filter);
  final ArangoCursor<Long> cursor = arangoOperations.query(query, bindVars, null, Long.class);
  return cursor.next();
}
origin: arangodb/spring-data

/**
 * Counts the number of documents in the collection which match with the given example
 *
 * @param example
 *            example object to construct query with
 * @param <S>
 * @return number of matching documents found
 */
@Override
public <S extends T> long count(final Example<S> example) {
  final Map<String, Object> bindVars = new HashMap<>();
  final String predicate = exampleConverter.convertExampleToPredicate(example, bindVars);
  final String filter = predicate.length() == 0 ? "" : " FILTER " + predicate;
  final String query = String.format("FOR e IN %s%s COLLECT WITH COUNT INTO length RETURN length",
    getCollectionName(), filter);
  final ArangoCursor<Long> cursor = arangoOperations.query(query, bindVars, null, Long.class);
  return cursor.next();
}
origin: ArangoDB-Community/arangodb-tinkerpop-provider

@Override
public Variables variables() {
  ArangoCursor<ArangoDBGraphVariables> iter = client.getGraphVariables(this.name, variables_id);
  if (iter.hasNext()) {
    ArangoDBGraphVariables v = iter.next();
    v.graph(this);
    return v;
  }
  else {
    throw new ArangoDBGraphException("Existing graph does not have a Variables collection");
  }
}
origin: ArangoDB-Community/arangodb-tinkerpop-provider

ArangoCursor<String> iter = client.getGraphVariablesId(this.name);
if (iter.hasNext()) {
  this.variables_id = iter.next();
origin: com.arangodb/arangodb-spring-data

private Object convertResult(final ArangoCursor<?> result, final ArangoParameterAccessor accessor) {
  if (isExistsQuery()) {
    if (!result.hasNext()) {
      return false;
    }
    return (Integer) result.next() > 0;
  }
  final ArangoResultConverter resultConverter = new ArangoResultConverter(accessor, result, operations,
      domainClass);
  return resultConverter.convertResult(method.getReturnType().getType());
}
origin: arangodb/spring-data

private Object convertResult(final ArangoCursor<?> result, final ArangoParameterAccessor accessor) {
  if (isExistsQuery()) {
    if (!result.hasNext()) {
      return false;
    }
    return (Integer) result.next() > 0;
  }
  final ArangoResultConverter resultConverter = new ArangoResultConverter(accessor, result, operations,
      domainClass);
  return resultConverter.convertResult(method.getReturnType().getType());
}
origin: arangodb/spring-data

/**
 * Build a GeoResult from the given ArangoCursor
 *
 * @param cursor
 *            query result from driver
 * @return GeoResult object
 */
private GeoResult<?> buildGeoResult(final ArangoCursor<?> cursor) {
  GeoResult<?> geoResult = null;
  while (cursor.hasNext() && geoResult == null) {
    final Object object = cursor.next();
    if (!(object instanceof VPackSlice)) {
      continue;
    }
    final VPackSlice slice = (VPackSlice) object;
    final VPackSlice distSlice = slice.get("_distance");
    final Double distanceInMeters = distSlice.isDouble() ? distSlice.getAsDouble() : null;
    if (distanceInMeters == null) {
      continue;
    }
    final Object entity = operations.getConverter().read(domainClass, slice);
    final Distance distance = new Distance(distanceInMeters / 1000, Metrics.KILOMETERS);
    geoResult = new GeoResult<>(entity, distance);
  }
  return geoResult;
}
origin: com.arangodb/arangodb-spring-data

/**
 * Build a GeoResult from the given ArangoCursor
 *
 * @param cursor
 *            query result from driver
 * @return GeoResult object
 */
private GeoResult<?> buildGeoResult(final ArangoCursor<?> cursor) {
  GeoResult<?> geoResult = null;
  while (cursor.hasNext() && geoResult == null) {
    final Object object = cursor.next();
    if (!(object instanceof VPackSlice)) {
      continue;
    }
    final VPackSlice slice = (VPackSlice) object;
    final VPackSlice distSlice = slice.get("_distance");
    final Double distanceInMeters = distSlice.isDouble() ? distSlice.getAsDouble() : null;
    if (distanceInMeters == null) {
      continue;
    }
    final Object entity = operations.getConverter().read(domainClass, slice);
    final Distance distance = new Distance(distanceInMeters / 1000, Metrics.KILOMETERS);
    geoResult = new GeoResult<>(entity, distance);
  }
  return geoResult;
}
com.arangodbArangoCursornext

Popular methods of ArangoCursor

  • hasNext
  • asListRemaining
  • close
  • first
  • forEachRemaining
  • getId
  • getStats
  • getType
  • getWarnings
  • spliterator

Popular in Java

  • Running tasks concurrently on multiple threads
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getSharedPreferences (Context)
  • onRequestPermissionsResult (Fragment)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • BoxLayout (javax.swing)
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now