com.h3c.util.tuple

## Class UnaryTuple<T1>

- java.lang.Object
- - com.h3c.util.tuple.UnaryTuple<T1>

- Type Parameters:
    `T1` - Type for the first element of the tuple.
  All Implemented Interfaces:
    Serializable
  Direct Known Subclasses:
    Pair

      public class UnaryTuple<T1>
      extends Object
      implements Serializable

  In mathematics and computer science a tuple captures the intuitive notion of an ordered list of elements. Depending on the mathematical foundation chosen, the formal notion differs slightly. In set theory, an (ordered) n-tuple is a sequence (or ordered list) of n elements, where n is a positive integer. The main properties that distinguish a tuple from, for example, a set are that 1. It can contain an object more than once; 2. The objects appear in a certain order; 3. It has finite size.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `UnaryTuple(T1 first)` Constructs a 1-tuple.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object obj)`
    `T1` | `getFirst()` Gets the first element of the tuple.
    `int` | `hashCode()`
    `void` | `setFirst(T1 first)` Sets the first element of the tuple.
    `String` | `toString()`
    `static <TT1> UnaryTuple<TT1>` | `valueOf(TT1 first)` Creates a new 1-tuple using the given values.

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### UnaryTuple

          protected UnaryTuple(T1 first)

      Constructs a 1-tuple.
      Parameters:
        `first` - First element in the tuple.

  - ### Method Detail

    - #### valueOf

          public static <TT1> UnaryTuple<TT1> valueOf(TT1 first)

      Creates a new 1-tuple using the given values.
      Type Parameters:
        `TT1` - the type for the first element of the tuple.
      Parameters:
        `first` - First element in the tuple.
      Returns:
        a new 1-tuple using the given values.

    - #### getFirst

          public T1 getFirst()

      Gets the first element of the tuple.
      Returns:
        The first element.

    - #### setFirst

          public void setFirst(T1 first)

      Sets the first element of the tuple.
      Parameters:
        `first` - The first element.

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object obj)

      Overrides:
        `equals` in class `Object`

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

Copyright © 2014. All Rights Reserved.