namespace RSG {
///
/// Provides static methods for creating tuple objects.
///
/// Tuple implementation for .NET 3.5
///
public class Tuple {
///
/// Create a new 2-tuple, or pair.
///
/// The type of the first component of the tuple.
/// The type of the second component of the tuple.
/// The value of the first component of the tuple.
/// The value of the second component of the tuple.
/// A 2-tuple whose value is (item1, item2)
public static Tuple Create(T1 item1, T2 item2) {
return new Tuple(item1, item2);
}
///
/// Create a new 3-tuple, or triple.
///
/// The type of the first component of the tuple.
/// The type of the second component of the tuple.
/// The type of the third component of the tuple.
/// The value of the first component of the tuple.
/// The value of the second component of the tuple.
/// The value of the third component of the tuple.
/// A 3-tuple whose value is (item1, item2, item3)
public static Tuple Create(T1 item1, T2 item2, T3 item3) {
return new Tuple(item1, item2, item3);
}
///
/// Create a new 4-tuple, or quadruple.
///
/// The type of the first component of the tuple.
/// The type of the second component of the tuple.
/// The type of the third component of the tuple.
/// The type of the fourth component of the tuple.
/// The value of the first component of the tuple.
/// The value of the second component of the tuple.
/// The value of the third component of the tuple.
/// The value of the fourth component of the tuple.
/// A 3-tuple whose value is (item1, item2, item3, item4)
public static Tuple Create(T1 item1, T2 item2, T3 item3, T4 item4) {
return new Tuple(item1, item2, item3, item4);
}
}
///
/// Represents a 2-tuple, or pair.
///
/// The type of the tuple's first component.
/// The type of the tuple's second component.
public class Tuple {
internal Tuple(T1 item1, T2 item2) {
this.Item1 = item1;
this.Item2 = item2;
}
///
/// Gets the value of the current tuple's first component.
///
public T1 Item1 { get; private set; }
///
/// Gets the value of the current tuple's second component.
///
public T2 Item2 { get; private set; }
}
///
/// Represents a 3-tuple, or triple.
///
/// The type of the tuple's first component.
/// The type of the tuple's second component.
/// The type of the tuple's third component.
public class Tuple {
internal Tuple(T1 item1, T2 item2, T3 item3) {
this.Item1 = item1;
this.Item2 = item2;
this.Item3 = item3;
}
///
/// Gets the value of the current tuple's first component.
///
public T1 Item1 { get; private set; }
///
/// Gets the value of the current tuple's second component.
///
public T2 Item2 { get; private set; }
///
/// Gets the value of the current tuple's third component.
///
public T3 Item3 { get; private set; }
}
///
/// Represents a 4-tuple, or quadruple.
///
/// The type of the tuple's first component.
/// The type of the tuple's second component.
/// The type of the tuple's third component.
/// The type of the tuple's fourth component.
public class Tuple {
internal Tuple(T1 item1, T2 item2, T3 item3, T4 item4) {
this.Item1 = item1;
this.Item2 = item2;
this.Item3 = item3;
this.Item4 = item4;
}
///
/// Gets the value of the current tuple's first component.
///
public T1 Item1 { get; private set; }
///
/// Gets the value of the current tuple's second component.
///
public T2 Item2 { get; private set; }
///
/// Gets the value of the current tuple's third component.
///
public T3 Item3 { get; private set; }
///
/// Gets the value of the current tuple's fourth component.
///
public T4 Item4 { get; private set; }
}
}