SemWeb.Query.QueryResultBuffer

SemWeb : SemWeb.Query Namespace
QueryResultBuffer Class

A buffer for results of a query.

public class QueryResultBuffer : QueryResultSink, System.Collections.Generic.IEnumerable<SemWeb.Query.VariableBindings>

#### Remarks

This class implements the QueryResultSink interface and can be used to buffer the results of a query.

C# Example
    QueryResultBuffer buffer = new QueryResultBuffer();

    Variable a = new Variable("a"), b = new Variable("b"), c = new Variable("c");
    source.Query(
    	new Statement[] {
    		new Statement(a, "http://xmlns.com/foaf/0.1/nick", (Literal)"MyNickName"),
    		new Statement(a, b, c) },
    	, new QueryOptions(), buffer);

    foreach (VariableBindings b in buffer) {
    	Console.WriteLine("a => " + b["a"]);
    	Console.WriteLine("b => " + b["b"]);
    	Console.WriteLine();
    }

## Members

See Also: Inherited members from QueryResultSink.

### Constructors

QueryResultBuffer () Creates a new instance of this class.

### Properties

Bindings [read-only] | System.Collections.Generic.List<SemWeb.Query.VariableBindings> . The bindings that have been buffered.
Comments [read-only] | System.Collections.Generic.List<System.String> . To be added.
Variables [read-only] | SemWeb.Variable[]. A list of the variables potentially bound by the query.

### Methods

abstract | Add (VariableBindings) : bool Called to add a new result row. (Inherited from QueryResultSink.)
| AddComments (string) Adds comments about how the query has been processed. (Inherited from QueryResultSink.)
| Finished () This method is called by a Query object after the last variable binding is added. (Inherited from QueryResultSink.)
| Init (SemWeb.Variable[]) Called by the Query to initialize the result sink. (Inherited from QueryResultSink.)

## Member Details

### QueryResultBuffer Constructor

public QueryResultBuffer ()

Creates a new instance of this class.

#### Remarks

None.

### Bindings Property

public System.Collections.Generic.List<SemWeb.Query.VariableBindings> Bindings { get; }

The bindings that have been buffered.

#### Value

A list of the bindings that have been buffered by this object.

#### Remarks

None.

### Variables Property

public SemWeb.Variable[] Variables { get; }

A list of the variables potentially bound by the query.

#### Value

A list of variables that may be bound in the result bindings of the query.

#### Remarks

Even if the Bindings property is an empty list, this array will contain the variables processed by the query.

### Comments Property

public System.Collections.Generic.List<System.String> Comments { get; }

To be added.

#### Value

To be added.

#### Remarks

To be added.