Class DefaultTraversal<TStart, TEnd>
A traversal represents a directed walk over a graph.
Inherited Members
Namespace: Gremlin.Net.Process.Traversal
Assembly: Gremlin.Net.dll
Syntax
public abstract class DefaultTraversal<TStart, TEnd> : ITraversal<TStart, TEnd>, ITraversal, IEnumerator<TEnd?>, IEnumerator, IDisposable
Type Parameters
| Name | Description |
|---|---|
| TStart | |
| TEnd |
Properties
Bytecode
Gets the Bytecode representation of this traversal.
Declaration
public abstract Bytecode Bytecode { get; }
Property Value
| Type | Description |
|---|---|
| Bytecode |
Current
Declaration
public TEnd? Current { get; }
Property Value
| Type | Description |
|---|---|
| TEnd |
IsAnonymous
Determines if this traversal was spawned anonymously or not.
Declaration
public bool IsAnonymous { get; protected set; }
Property Value
| Type | Description |
|---|---|
| bool |
TraversalStrategies
Gets or sets the ITraversalStrategy strategies of this traversal.
Declaration
protected ICollection<ITraversalStrategy> TraversalStrategies { get; set; }
Property Value
| Type | Description |
|---|---|
| ICollection<ITraversalStrategy> |
Traversers
Gets or sets the Traverser's of this traversal that hold the results of the traversal.
Declaration
public IEnumerable<Traverser>? Traversers { get; set; }
Property Value
| Type | Description |
|---|---|
| IEnumerable<Traverser> |
Methods
Dispose()
Declaration
public void Dispose()
HasNext()
Determines if the traversal contains any additional results for iteration.
Declaration
public bool HasNext()
Returns
| Type | Description |
|---|---|
| bool | True if there are more results and false otherwise. |
Iterate()
Iterates all Traverser instances in the traversal.
Declaration
public ITraversal<TStart, TEnd> Iterate()
Returns
| Type | Description |
|---|---|
| ITraversal<TStart, TEnd> | The fully drained traversal. |
MoveNext()
Declaration
public bool MoveNext()
Returns
| Type | Description |
|---|---|
| bool |
Next()
Gets the next result from the traversal.
Declaration
public TEnd? Next()
Returns
| Type | Description |
|---|---|
| TEnd | The result. |
Next(int)
Gets the next n-number of results from the traversal.
Declaration
public IEnumerable<TEnd?> Next(int amount)
Parameters
| Type | Name | Description |
|---|---|---|
| int | amount | The number of results to get. |
Returns
| Type | Description |
|---|---|
| IEnumerable<TEnd> | The n-results. |
NextTraverser()
Gets the next Traverser.
Declaration
public Traverser NextTraverser()
Returns
| Type | Description |
|---|---|
| Traverser | The next Traverser. |
Promise<TReturn>(Func<ITraversal<TStart, TEnd>, TReturn>, CancellationToken)
Starts a promise to execute a function on the current traversal that will be completed in the future.
Declaration
public Task<TReturn> Promise<TReturn>(Func<ITraversal<TStart, TEnd>, TReturn> callback, CancellationToken cancellationToken = default)
Parameters
| Type | Name | Description |
|---|---|---|
| Func<ITraversal<TStart, TEnd>, TReturn> | callback | The function to execute on the current traversal. |
| CancellationToken | cancellationToken | The token to cancel the operation. The default value is None. |
Returns
| Type | Description |
|---|---|
| Task<TReturn> | The result of the executed |
Type Parameters
| Name | Description |
|---|---|
| TReturn | The return type of the |
Reset()
Reset is not supported.
Declaration
public void Reset()
Exceptions
| Type | Condition |
|---|---|
| NotSupportedException | Thrown always as this operation is not supported. |
ToList()
Puts all the results into a List<T>.
Declaration
public IList<TEnd?> ToList()
Returns
| Type | Description |
|---|---|
| IList<TEnd> | The results in a list. |
ToSet()
Puts all the results into a HashSet<T>.
Declaration
public ISet<TEnd?> ToSet()
Returns
| Type | Description |
|---|---|
| ISet<TEnd> | The results in a set. |