You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2019/05/24 14:46:26 UTC
svn commit: r1859886 [12/12] - in /tinkerpop/site:
docs/3.3.7-SNAPSHOT/dev/developer/ docs/3.3.7-SNAPSHOT/dev/io/
docs/3.3.7-SNAPSHOT/dev/provider/ docs/3.3.7-SNAPSHOT/recipes/
docs/3.3.7-SNAPSHOT/reference/
docs/3.3.7-SNAPSHOT/tutorials/getting-starte...
Modified: tinkerpop/site/jsdocs/3.3.7-SNAPSHOT/process_anonymous-traversal.js.html
URL: http://svn.apache.org/viewvc/tinkerpop/site/jsdocs/3.3.7-SNAPSHOT/process_anonymous-traversal.js.html?rev=1859886&r1=1859885&r2=1859886&view=diff
==============================================================================
--- tinkerpop/site/jsdocs/3.3.7-SNAPSHOT/process_anonymous-traversal.js.html (original)
+++ tinkerpop/site/jsdocs/3.3.7-SNAPSHOT/process_anonymous-traversal.js.html Fri May 24 14:46:24 2019
@@ -60,12 +60,21 @@ const Graph = require('../structure/grap
class AnonymousTraversalSource {
/**
+ * Creates a new instance of {@link AnonymousTraversalSource}.
+ * @param {Function} [traversalSourceClass] Optional {@code GraphTraversalSource} constructor.
+ */
+ constructor(traversalSourceClass) {
+ this.traversalSourceClass = traversalSourceClass;
+ }
+
+ /**
* Constructs an {@code AnonymousTraversalSource} which will then be configured to spawn a
* {@link GraphTraversalSource}.
+ * @param {Function} [traversalSourceClass] Optional {@code GraphTraversalSource} constructor.
* @returns {AnonymousTraversalSource}.
*/
- static traversal() {
- return new AnonymousTraversalSource();
+ static traversal(traversalSourceClass) {
+ return new AnonymousTraversalSource(traversalSourceClass || GraphTraversalSource);
}
/**
@@ -85,7 +94,7 @@ class AnonymousTraversalSource {
* @return {GraphTraversalSource}
*/
withGraph(graph) {
- return new GraphTraversalSource(graph, new TraversalStrategies());
+ return new this.traversalSourceClass(graph, new TraversalStrategies());
}
}
@@ -105,7 +114,7 @@ module.exports = AnonymousTraversalSourc
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Mar 22 2019 08:31:26 GMT-0400 (EDT)
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri May 24 2019 10:44:27 GMT-0400 (EDT)
</footer>
<script> prettyPrint(); </script>
Modified: tinkerpop/site/jsdocs/3.3.7-SNAPSHOT/process_bytecode.js.html
URL: http://svn.apache.org/viewvc/tinkerpop/site/jsdocs/3.3.7-SNAPSHOT/process_bytecode.js.html?rev=1859886&r1=1859885&r2=1859886&view=diff
==============================================================================
--- tinkerpop/site/jsdocs/3.3.7-SNAPSHOT/process_bytecode.js.html (original)
+++ tinkerpop/site/jsdocs/3.3.7-SNAPSHOT/process_bytecode.js.html Fri May 24 14:46:24 2019
@@ -138,7 +138,7 @@ module.exports = Bytecode;
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Mar 22 2019 08:31:26 GMT-0400 (EDT)
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri May 24 2019 10:44:27 GMT-0400 (EDT)
</footer>
<script> prettyPrint(); </script>
Modified: tinkerpop/site/jsdocs/3.3.7-SNAPSHOT/process_graph-traversal.js.html
URL: http://svn.apache.org/viewvc/tinkerpop/site/jsdocs/3.3.7-SNAPSHOT/process_graph-traversal.js.html?rev=1859886&r1=1859885&r2=1859886&view=diff
==============================================================================
--- tinkerpop/site/jsdocs/3.3.7-SNAPSHOT/process_graph-traversal.js.html (original)
+++ tinkerpop/site/jsdocs/3.3.7-SNAPSHOT/process_graph-traversal.js.html Fri May 24 14:46:24 2019
@@ -50,26 +50,32 @@
*/
'use strict';
-const Traversal = require('./traversal').Traversal;
+const { Traversal } = require('./traversal');
const remote = require('../driver/remote-connection');
const utils = require('../utils');
const Bytecode = require('./bytecode');
-const TraversalStrategies = require('./traversal-strategy').TraversalStrategies;
+const { TraversalStrategies } = require('./traversal-strategy');
/**
* Represents the primary DSL of the Gremlin traversal machine.
*/
class GraphTraversalSource {
+
/**
+ * Creates a new instance of {@link GraphTraversalSource}.
* @param {Graph} graph
* @param {TraversalStrategies} traversalStrategies
* @param {Bytecode} [bytecode]
+ * @param {Function} [graphTraversalSourceClass] Optional {@link GraphTraversalSource} constructor.
+ * @param {Function} [graphTraversalClass] Optional {@link GraphTraversal} constructor.
*/
- constructor(graph, traversalStrategies, bytecode) {
+ constructor(graph, traversalStrategies, bytecode, graphTraversalSourceClass, graphTraversalClass) {
this.graph = graph;
this.traversalStrategies = traversalStrategies;
this.bytecode = bytecode || new Bytecode();
+ this.graphTraversalSourceClass = graphTraversalSourceClass || GraphTraversalSource;
+ this.graphTraversalClass = graphTraversalClass || GraphTraversal;
}
/**
@@ -79,7 +85,7 @@ class GraphTraversalSource {
withRemote(remoteConnection) {
const traversalStrategy = new TraversalStrategies(this.traversalStrategies);
traversalStrategy.addStrategy(new remote.RemoteStrategy(remoteConnection));
- return new GraphTraversalSource(this.graph, traversalStrategy, new Bytecode(this.bytecode));
+ return new this.graphTraversalSourceClass(this.graph, traversalStrategy, new Bytecode(this.bytecode), this.graphTraversalSourceClass, this.graphTraversalClass);
}
/**
@@ -97,7 +103,7 @@ class GraphTraversalSource {
*/
withBulk(...args) {
const b = new Bytecode(this.bytecode).addSource('withBulk', args);
- return new GraphTraversalSource(this.graph, new TraversalStrategies(this.traversalStrategies), b);
+ return new this.graphTraversalSourceClass(this.graph, new TraversalStrategies(this.traversalStrategies), b, this.graphTraversalSourceClass, this.graphTraversalClass);
}
/**
@@ -107,7 +113,7 @@ class GraphTraversalSource {
*/
withPath(...args) {
const b = new Bytecode(this.bytecode).addSource('withPath', args);
- return new GraphTraversalSource(this.graph, new TraversalStrategies(this.traversalStrategies), b);
+ return new this.graphTraversalSourceClass(this.graph, new TraversalStrategies(this.traversalStrategies), b, this.graphTraversalSourceClass, this.graphTraversalClass);
}
/**
@@ -117,7 +123,7 @@ class GraphTraversalSource {
*/
withSack(...args) {
const b = new Bytecode(this.bytecode).addSource('withSack', args);
- return new GraphTraversalSource(this.graph, new TraversalStrategies(this.traversalStrategies), b);
+ return new this.graphTraversalSourceClass(this.graph, new TraversalStrategies(this.traversalStrategies), b, this.graphTraversalSourceClass, this.graphTraversalClass);
}
/**
@@ -127,7 +133,7 @@ class GraphTraversalSource {
*/
withSideEffect(...args) {
const b = new Bytecode(this.bytecode).addSource('withSideEffect', args);
- return new GraphTraversalSource(this.graph, new TraversalStrategies(this.traversalStrategies), b);
+ return new this.graphTraversalSourceClass(this.graph, new TraversalStrategies(this.traversalStrategies), b, this.graphTraversalSourceClass, this.graphTraversalClass);
}
/**
@@ -137,7 +143,7 @@ class GraphTraversalSource {
*/
withStrategies(...args) {
const b = new Bytecode(this.bytecode).addSource('withStrategies', args);
- return new GraphTraversalSource(this.graph, new TraversalStrategies(this.traversalStrategies), b);
+ return new this.graphTraversalSourceClass(this.graph, new TraversalStrategies(this.traversalStrategies), b, this.graphTraversalSourceClass, this.graphTraversalClass);
}
/**
@@ -147,7 +153,7 @@ class GraphTraversalSource {
*/
withoutStrategies(...args) {
const b = new Bytecode(this.bytecode).addSource('withoutStrategies', args);
- return new GraphTraversalSource(this.graph, new TraversalStrategies(this.traversalStrategies), b);
+ return new this.graphTraversalSourceClass(this.graph, new TraversalStrategies(this.traversalStrategies), b, this.graphTraversalSourceClass, this.graphTraversalClass);
}
/**
@@ -157,7 +163,7 @@ class GraphTraversalSource {
*/
E(...args) {
const b = new Bytecode(this.bytecode).addStep('E', args);
- return new GraphTraversal(this.graph, new TraversalStrategies(this.traversalStrategies), b);
+ return new this.graphTraversalClass(this.graph, new TraversalStrategies(this.traversalStrategies), b);
}
/**
@@ -167,7 +173,7 @@ class GraphTraversalSource {
*/
V(...args) {
const b = new Bytecode(this.bytecode).addStep('V', args);
- return new GraphTraversal(this.graph, new TraversalStrategies(this.traversalStrategies), b);
+ return new this.graphTraversalClass(this.graph, new TraversalStrategies(this.traversalStrategies), b);
}
/**
@@ -177,7 +183,7 @@ class GraphTraversalSource {
*/
addE(...args) {
const b = new Bytecode(this.bytecode).addStep('addE', args);
- return new GraphTraversal(this.graph, new TraversalStrategies(this.traversalStrategies), b);
+ return new this.graphTraversalClass(this.graph, new TraversalStrategies(this.traversalStrategies), b);
}
/**
@@ -187,7 +193,7 @@ class GraphTraversalSource {
*/
addV(...args) {
const b = new Bytecode(this.bytecode).addStep('addV', args);
- return new GraphTraversal(this.graph, new TraversalStrategies(this.traversalStrategies), b);
+ return new this.graphTraversalClass(this.graph, new TraversalStrategies(this.traversalStrategies), b);
}
/**
@@ -197,7 +203,7 @@ class GraphTraversalSource {
*/
inject(...args) {
const b = new Bytecode(this.bytecode).addStep('inject', args);
- return new GraphTraversal(this.graph, new TraversalStrategies(this.traversalStrategies), b);
+ return new this.graphTraversalClass(this.graph, new TraversalStrategies(this.traversalStrategies), b);
}
}
@@ -1282,7 +1288,7 @@ module.exports = {
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Mar 22 2019 08:31:26 GMT-0400 (EDT)
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri May 24 2019 10:44:27 GMT-0400 (EDT)
</footer>
<script> prettyPrint(); </script>
Modified: tinkerpop/site/jsdocs/3.3.7-SNAPSHOT/process_translator.js.html
URL: http://svn.apache.org/viewvc/tinkerpop/site/jsdocs/3.3.7-SNAPSHOT/process_translator.js.html?rev=1859886&r1=1859885&r2=1859886&view=diff
==============================================================================
--- tinkerpop/site/jsdocs/3.3.7-SNAPSHOT/process_translator.js.html (original)
+++ tinkerpop/site/jsdocs/3.3.7-SNAPSHOT/process_translator.js.html Fri May 24 14:46:24 2019
@@ -134,7 +134,7 @@ module.exports = Translator;</code></pre
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Mar 22 2019 08:31:26 GMT-0400 (EDT)
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri May 24 2019 10:44:27 GMT-0400 (EDT)
</footer>
<script> prettyPrint(); </script>
Modified: tinkerpop/site/jsdocs/3.3.7-SNAPSHOT/process_traversal-strategy.js.html
URL: http://svn.apache.org/viewvc/tinkerpop/site/jsdocs/3.3.7-SNAPSHOT/process_traversal-strategy.js.html?rev=1859886&r1=1859885&r2=1859886&view=diff
==============================================================================
--- tinkerpop/site/jsdocs/3.3.7-SNAPSHOT/process_traversal-strategy.js.html (original)
+++ tinkerpop/site/jsdocs/3.3.7-SNAPSHOT/process_traversal-strategy.js.html Fri May 24 14:46:24 2019
@@ -116,7 +116,7 @@ module.exports = {
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Mar 22 2019 08:31:26 GMT-0400 (EDT)
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri May 24 2019 10:44:27 GMT-0400 (EDT)
</footer>
<script> prettyPrint(); </script>
Modified: tinkerpop/site/jsdocs/3.3.7-SNAPSHOT/process_traversal.js.html
URL: http://svn.apache.org/viewvc/tinkerpop/site/jsdocs/3.3.7-SNAPSHOT/process_traversal.js.html?rev=1859886&r1=1859885&r2=1859886&view=diff
==============================================================================
--- tinkerpop/site/jsdocs/3.3.7-SNAPSHOT/process_traversal.js.html (original)
+++ tinkerpop/site/jsdocs/3.3.7-SNAPSHOT/process_traversal.js.html Fri May 24 14:46:24 2019
@@ -178,6 +178,23 @@ class P {
return new P('or', this, arg);
}
+ static within(...args) {
+ if (args.length === 1 && Array.isArray(args[0])) {
+ return new P("within", args[0], null);
+ } else {
+ return new P("within", args, null);
+ }
+ }
+
+ static without(...args) {
+ if (args.length === 1 && Array.isArray(args[0])) {
+ return new P("without", args[0], null);
+ } else {
+ return new P("without", args, null);
+ }
+ }
+
+
/** @param {...Object} args */
static between(...args) {
return createP('between', args);
@@ -233,16 +250,6 @@ class P {
return createP('test', args);
}
- /** @param {...Object} args */
- static within(...args) {
- return createP('within', args);
- }
-
- /** @param {...Object} args */
- static without(...args) {
- return createP('without', args);
- }
-
}
function createP(operator, args) {
@@ -318,7 +325,7 @@ module.exports = {
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Mar 22 2019 08:31:26 GMT-0400 (EDT)
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri May 24 2019 10:44:27 GMT-0400 (EDT)
</footer>
<script> prettyPrint(); </script>
Modified: tinkerpop/site/jsdocs/3.3.7-SNAPSHOT/structure_graph.js.html
URL: http://svn.apache.org/viewvc/tinkerpop/site/jsdocs/3.3.7-SNAPSHOT/structure_graph.js.html?rev=1859886&r1=1859885&r2=1859886&view=diff
==============================================================================
--- tinkerpop/site/jsdocs/3.3.7-SNAPSHOT/structure_graph.js.html (original)
+++ tinkerpop/site/jsdocs/3.3.7-SNAPSHOT/structure_graph.js.html Fri May 24 14:46:24 2019
@@ -51,16 +51,18 @@
'use strict';
const gt = require('../process/graph-traversal');
-const TraversalStrategies = require('../process/traversal-strategy').TraversalStrategies;
+const { TraversalStrategies } = require('../process/traversal-strategy');
class Graph {
/**
* Returns the graph traversal source.
+ * @param {Function} [traversalSourceClass] The constructor to use for the {@code GraphTraversalSource} instance.
* @returns {GraphTraversalSource}
* @deprecated As of release 3.3.5, replaced by the traversal() anonymous function.
*/
- traversal() {
- return new gt.GraphTraversalSource(this, new TraversalStrategies());
+ traversal(traversalSourceClass) {
+ const traversalSourceConstructor = traversalSourceClass || gt.GraphTraversalSource;
+ return new traversalSourceConstructor(this, new TraversalStrategies());
}
toString() {
@@ -210,7 +212,7 @@ module.exports = {
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Mar 22 2019 08:31:26 GMT-0400 (EDT)
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri May 24 2019 10:44:27 GMT-0400 (EDT)
</footer>
<script> prettyPrint(); </script>
Modified: tinkerpop/site/jsdocs/3.3.7-SNAPSHOT/structure_io_graph-serializer.js.html
URL: http://svn.apache.org/viewvc/tinkerpop/site/jsdocs/3.3.7-SNAPSHOT/structure_io_graph-serializer.js.html?rev=1859886&r1=1859885&r2=1859886&view=diff
==============================================================================
--- tinkerpop/site/jsdocs/3.3.7-SNAPSHOT/structure_io_graph-serializer.js.html (original)
+++ tinkerpop/site/jsdocs/3.3.7-SNAPSHOT/structure_io_graph-serializer.js.html Fri May 24 14:46:24 2019
@@ -84,9 +84,7 @@ class GraphSONWriter {
adaptObject(value) {
let s;
- if (Array.isArray(value)) {
- return value.map(item => this.adaptObject(item));
- }
+
for (let i = 0; i < this._serializers.length; i++) {
const currentSerializer = this._serializers[i];
if (currentSerializer.canBeUsedFor && currentSerializer.canBeUsedFor(value)) {
@@ -94,9 +92,17 @@ class GraphSONWriter {
break;
}
}
+
if (s) {
return s.serialize(value);
}
+
+ if (Array.isArray(value)) {
+ // We need to handle arrays when there is no serializer
+ // for older versions of GraphSON
+ return value.map(item => this.adaptObject(item));
+ }
+
// Default (strings / objects / ...)
return value;
}
@@ -229,7 +235,7 @@ module.exports = {
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Mar 22 2019 08:31:26 GMT-0400 (EDT)
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri May 24 2019 10:44:27 GMT-0400 (EDT)
</footer>
<script> prettyPrint(); </script>
Modified: tinkerpop/site/jsdocs/3.3.7-SNAPSHOT/structure_io_type-serializers.js.html
URL: http://svn.apache.org/viewvc/tinkerpop/site/jsdocs/3.3.7-SNAPSHOT/structure_io_type-serializers.js.html?rev=1859886&r1=1859885&r2=1859886&view=diff
==============================================================================
--- tinkerpop/site/jsdocs/3.3.7-SNAPSHOT/structure_io_type-serializers.js.html (original)
+++ tinkerpop/site/jsdocs/3.3.7-SNAPSHOT/structure_io_type-serializers.js.html Fri May 24 14:46:24 2019
@@ -172,7 +172,7 @@ class BytecodeSerializer extends TypeSer
const result = new Array(instructions.length);
result[0] = instructions[0];
for (let i = 0; i < instructions.length; i++) {
- result[i] = this.writer.adaptObject(instructions[i]);
+ result[i] = instructions[i].map(item => this.writer.adaptObject(item));
}
return result;
}
@@ -461,7 +461,7 @@ module.exports = {
<br class="clear">
<footer>
- Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri Mar 22 2019 08:31:26 GMT-0400 (EDT)
+ Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.5.5</a> on Fri May 24 2019 10:44:27 GMT-0400 (EDT)
</footer>
<script> prettyPrint(); </script>