Skip to content

Tuple Class

sequenze edited this page Jun 19, 2017 · 8 revisions

Concrete implementation of a tuple. Provides the primitives required to define a tuple.

Inheritance Hierarchy

Object

Syntax

public sealed class Tuple : ITuple, IFields

Properties

Name               Description
Fields Gets or sets the underlying array of values representing the tuple.
Size Returns the size of the tuple.
Item[Int32] Gets or sets the i'th element of the tuple.

Constructors

Name                       Description
Tuple(Object[]) Initializes a new instance of a Tuple class.

Methods

Name             Description
ToString() Returns a textual representation of the underlying tuple values.

Remarks

The Tuple class is a reference type object. However, while typical datastructures allow manipulation of the stored items that are referenced based the Space doesn't. Each Tuple returned from a Space is a unique object.

Examples

The following example demonstrates the usage of an Tuple.

    static void Main(string[] args)
    {
        FifoSpace ts = new FifoSpace();
        Tuple myTuple = new Tuple("My first tuple");
        ts.Put(myTuple);
        System.Console.WriteLine(ts.Query(typeof(string)));
        System.Console.Read();
    }
    /*
    The following is printed to the console:
    <My first tuple>
    */

See Also

ITuple, IFields

Clone this wiki locally