-
Notifications
You must be signed in to change notification settings - Fork 2
Tuple Class
sequenze edited this page Jun 19, 2017
·
8 revisions
Concrete implementation of a tuple. Provides the primitives required to define a tuple.
Object
public sealed class Tuple : ITuple, IFields
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. |
Name | Description |
---|---|
Tuple(Object[]) | Initializes a new instance of a Tuple class. |
Name | Description |
---|---|
ToString() | Returns a textual representation of the underlying tuple values. |
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.
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>
*/