org.apache.ignite.internal.util.lang

## Class GridTupleV

- java.lang.Object
- - org.apache.ignite.internal.util.lang.GridTupleV

All Implemented Interfaces:
  Externalizable, Serializable, Cloneable, Iterable<Object>

    public class GridTupleV
    extends Object
    implements Iterable<Object>, Externalizable, Cloneable

Constructs a tuple over a given array.

## Thread Safety

This class doesn't provide any synchronization for multi-threaded access and it is responsibility of the user of this class to provide outside synchronization, if needed.

See Also:
  `GridFunc.tv(Object...)`, Serialized Form

### Constructor Summary

Constructors
Constructor and Description
`GridTupleV()` Empty constructor required by `Externalizable`.
`GridTupleV(int cnt)` Initializes tuple with given object count.
`GridTupleV(Object... vals)` Constructs tuple around passed in array.

### Method Summary

Methods
`Object` `clone()`
`boolean` `equals(Object o)`
`<V> V` `get(int i)` Retrieves value at given index.
`Object[]` `getAll()` Gets internal array.
`int` `hashCode()`
`Iterator<Object>` `iterator()`
`void` `readExternal(ObjectInput in)`
`void` `set(int pos, Object... v)` Sets given values starting at provided position in the tuple.
`<V> void` `set(int i, V v)` Sets value at given index.
`void` `set(Object... v)` Sets given values starting at `0` position.
`String` `toString()`
`void` `writeExternal(ObjectOutput out)`

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

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

### Constructor Detail

#### GridTupleV

    public GridTupleV()

Empty constructor required by `Externalizable`.

#### GridTupleV

    public GridTupleV(int cnt)

Initializes tuple with given object count.

Parameters:
  `cnt` - Count of objects to be stored in the tuple.

#### GridTupleV

    public GridTupleV(Object... vals)

Constructs tuple around passed in array.

Parameters:
  `vals` - Values.

### Method Detail

#### get

    public <V> V get(int i)

Retrieves value at given index.

Type Parameters:
  `V` - Value type.
Parameters:
  `i` - Index of the value to get.
Returns:
  Value at given index.

#### set

    public <V> void set(int i,
               V v)

Sets value at given index.

Type Parameters:
  `V` - Value type.
Parameters:
  `i` - Index to set.
  `v` - Value to set.

#### set

    public void set(Object... v)

Sets given values starting at `0` position.

Parameters:
  `v` - Values to set.

#### set

    public void set(int pos,
           Object... v)

Sets given values starting at provided position in the tuple.

Parameters:
  `pos` - Position to start from.
  `v` - Values to set.

#### getAll

    public Object[] getAll()

Gets internal array. Changes to this array will change this tuple.

Returns:
  Internal array.

#### iterator

    public Iterator<Object> iterator()

Specified by:
  `iterator` in interface `Iterable<Object>`

#### clone

    public Object clone()

Overrides:
  `clone` in class `Object`

#### writeExternal

    public void writeExternal(ObjectOutput out)
                       throws IOException

Specified by:
  `writeExternal` in interface `Externalizable`
Throws:
  `IOException`

#### readExternal

    public void readExternal(ObjectInput in)
                      throws IOException,
                             ClassNotFoundException

Specified by:
  `readExternal` in interface `Externalizable`
Throws:
  `IOException`
  `ClassNotFoundException`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### equals

    public boolean equals(Object o)

Overrides:
  `equals` in class `Object`

#### toString

    public String toString()

Overrides:
  `toString` in class `Object`

2015 Copyright © Apache Software Foundation

Follow @ApacheIgnite

Ignite Fabric | : ver. 1.0.0-RC3
Release Date | : March 24 2015