Tuple Class

Provides static methods for creating tuple objects.

Syntax

Declaration

public static class Tuple

Inheritance Hierarchy

Inherited Members

System.Object

, , , , , ,

Methods summary

Creates a new 1-tuple, or singleton.

Creates a new 2-tuple, or pair.

Creates a new 3-tuple, or triple.

Creates a new 4-tuple, or quadruple.

Creates a new 5-tuple, or quintuple.

Creates a new 6-tuple, or sextuple.

Creates a new 7-tuple, or septuple.

Creates a new 8-tuple, or octuple.

Methods

  • Create<T1>(T1)

    Creates a new 1-tuple, or singleton.

    public static Tuple<T1> Create<T1>(T1 item1)

    Parameters

    • item1
      T1

      The value of the only component of the tuple.

    Returns

    • Tuple<T1>

      A tuple whose value is (item1).

  • Create<T1, T2>(T1, T2)

    Creates a new 2-tuple, or pair.

    public static Tuple<T1, T2> Create<T1, T2>(T1 item1, T2 item2)

    Parameters

    • item1
      T1

      The value of the first component of the tuple.

    • item2
      T2

      The value of the second component of the tuple.

    Returns

    • Tuple<T1, T2>

      A 2-tuple whose value is (item1, item2).

  • Create<T1, T2, T3>(T1, T2, T3)

    Creates a new 3-tuple, or triple.

    public static Tuple<T1, T2, T3> Create<T1, T2, T3>(T1 item1, T2 item2, T3 item3)

    Parameters

    • item1
      T1

      The value of the first component of the tuple.

    • item2
      T2

      The value of the second component of the tuple.

    • item3
      T3

      The value of the third component of the tuple.

    Returns

    • Tuple<T1, T2, T3>

      A 3-tuple whose value is (item1, item2, item3).

  • Create<T1, T2, T3, T4>(T1, T2, T3, T4)

    Creates a new 4-tuple, or quadruple.

    public static Tuple<T1, T2, T3, T4> Create<T1, T2, T3, T4>(T1 item1, T2 item2, T3 item3, T4 item4)

    Parameters

    • item1
      T1

      The value of the first component of the tuple.

    • item2
      T2

      The value of the second component of the tuple.

    • item3
      T3

      The value of the third component of the tuple.

    • item4
      T4

      The value of the fourth component of the tuple.

    Returns

    • Tuple<T1, T2, T3, T4>

      A 4-tuple whose value is (item1, item2, item3, item4).

  • Create<T1, T2, T3, T4, T5>(T1, T2, T3, T4, T5)

    Creates a new 5-tuple, or quintuple.

    public static Tuple<T1, T2, T3, T4, T5> Create<T1, T2, T3, T4, T5>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5)

    Parameters

    • item1
      T1

      The value of the first component of the tuple.

    • item2
      T2

      The value of the second component of the tuple.

    • item3
      T3

      The value of the third component of the tuple.

    • item4
      T4

      The value of the fourth component of the tuple.

    • item5
      T5

      The value of the fifth component of the tuple.

    Returns

    • Tuple<T1, T2, T3, T4, T5>

      A 5-tuple whose value is (item1, item2, item3, item4, item5).

  • Create<T1, T2, T3, T4, T5, T6>(T1, T2, T3, T4, T5, T6)

    Creates a new 6-tuple, or sextuple.

    public static Tuple<T1, T2, T3, T4, T5, T6> Create<T1, T2, T3, T4, T5, T6>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6)

    Parameters

    • item1
      T1

      The value of the first component of the tuple.

    • item2
      T2

      The value of the second component of the tuple.

    • item3
      T3

      The value of the third component of the tuple.

    • item4
      T4

      The value of the fourth component of the tuple.

    • item5
      T5

      The value of the fifth component of the tuple.

    • item6
      T6

      The value of the sixth component of the tuple.

    Returns

    • Tuple<T1, T2, T3, T4, T5, T6>

      A 6-tuple whose value is (item1, item2, item3, item4, item5, item6).

  • Create<T1, T2, T3, T4, T5, T6, T7>(T1, T2, T3, T4, T5, T6, T7)

    Creates a new 7-tuple, or septuple.

    public static Tuple<T1, T2, T3, T4, T5, T6, T7> Create<T1, T2, T3, T4, T5, T6, T7>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7)

    Parameters

    • item1
      T1

      The value of the first component of the tuple.

    • item2
      T2

      The value of the second component of the tuple.

    • item3
      T3

      The value of the third component of the tuple.

    • item4
      T4

      The value of the fourth component of the tuple.

    • item5
      T5

      The value of the fifth component of the tuple.

    • item6
      T6

      The value of the sixth component of the tuple.

    • item7
      T7

      The value of the seventh component of the tuple.

    Returns

    • Tuple<T1, T2, T3, T4, T5, T6, T7>

      A 7-tuple whose value is (item1, item2, item3, item4, item5, item6, item7).

  • Create<T1, T2, T3, T4, T5, T6, T7, T8>(T1, T2, T3, T4, T5, T6, T7, T8)

    Creates a new 8-tuple, or octuple.

    public static Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8>> Create<T1, T2, T3, T4, T5, T6, T7, T8>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, T8 item8)

    Parameters

    • item1
      T1

      The value of the first component of the tuple.

    • item2
      T2

      The value of the second component of the tuple.

    • item3
      T3

      The value of the third component of the tuple.

    • item4
      T4

      The value of the fourth component of the tuple.

    • item5
      T5

      The value of the fifth component of the tuple.

    • item6
      T6

      The value of the sixth component of the tuple.

    • item7
      T7

      The value of the seventh component of the tuple.

    • item8
      T8

      The value of the eighth component of the tuple.

    Returns

    • Tuple<T1, T2, T3, T4, T5, T6, T7, Tuple<T8>>

      An 8-tuple (octuple) whose value is (item1, item2, item3, item4, item5, item6, item7, item8).

Details

Namespace

System

Assembly

System.Runtime.dll

See Also