/*
 * Copyright (c) 2008-2016, Hazelcast, Inc. All Rights Reserved.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.hazelcast.jet.io.tuple;

import com.hazelcast.nio.serialization.DataSerializable;

/**
 * Represents abstract tuple of data
 *
 * @param <K> type of keys
 * @param <V> type of value
 */
public interface Tuple<K, V> extends DataSerializable {
    /**
     * Return key-object with specified index
     *
     * @param index specified index
     * @return corresponding key-object
     */
    K getKey(int index);

    /**
     * Return size-object with specified index
     *
     * @param index specified index
     * @return corresponding size-object
     */
    V getValue(int index);

    /**
     * @return number of elements in tuple's key part
     */
    int keySize();

    /**
     * @return number of elements in tuple's value part
     */
    int valueSize();

    /**
     * Set key object to the corresponding position of tuple
     *
     * @param index index of key-array to be affected
     * @param key   value of key
     */
    void setKey(int index, K key);

    /**
     * Set value object to the corresponding position of tuple
     *
     * @param index index of key-array to be affected
     * @param value corresponding value to be set
     */
    void setValue(int index, V value);

    /**
     * @return clone of key's part array.
     * Data will not be cloned
     */
    K[] cloneKeys();

    /**
     * @return clone of value's part array.
     * Data will not be cloned
     */
    V[] cloneValues();
}

@@ -726,41 +726,86 @@
 %0A * 
-Represents abstract tuple of data
+A record consisting (conceptually) of an array of keys and an array of values.
 %0A *%0A
@@ -822,20 +822,16 @@
 %3CK%3E 
+key 
 type
- of keys
 %0A * 
@@ -845,20 +845,17 @@
 %3CV%3E 
-type of valu
+value typ
 e%0A *
@@ -912,16 +912,17 @@
 zable %7B%0A
+%0A
     /**%0A
@@ -938,399 +938,387 @@
 turn
- key-object with specified index%0A     *%0A     * @param index specified index%0A     * @return corresponding key-object%0A     */%0A    K getKey(int index);%0A%0A    /**%0A     * Return size-object with specified index%0A     *%0A     * @param index specified index%0A     * @return corresponding size-object%0A     */%0A    V getValue(int index);%0A%0A    /**%0A     * @return number of elements in tuple's
+s the key at the given index. May return %7B@code null%7D. Allowed range for the index%0A     * is %7B@code 0 .. (keySize - 1)%7D.%0A     */%0A    K getKey(int index);%0A%0A    /**%0A     * Returns the value at the given index. May return %7B@code null%7D. Allowed range for the index%0A     * is %7B@code 0 .. (valueSize - 1)%7D.%0A     */%0A    V getValue(int index);%0A%0A    /** Returns the size of the
  key 
-p
 ar
-t%0A    
+ray.
  */%0A
@@ -1348,69 +1348,45 @@
  /**
-%0A     * @return number of elements in tuple's
+ Returns the size of the
  value 
-p
 ar
-t%0A    
+ray.
  */%0A
@@ -1418,31 +1418,31 @@
  /**
-%0A     * Set key
+ Puts the given
  object 
 to t
@@ -1441,145 +1441,32 @@
 ect 
+in
 to the 
-corresponding position of tuple%0A     *%0A     * @param index index of key-array to be affected%0A     * @param key   value of key%0A    
+given key slot.
  */%0A
@@ -1512,33 +1512,31 @@
  /**
-%0A     * Set value
+ Puts the given
  object 
 to t
@@ -1535,291 +1535,127 @@
 ect 
+in
 to the 
-corresponding position of tuple%0A     *%0A     * @param index index of key-array to be affected%0A     * @param value corresponding value to be set%0A     */%0A    void setValue(int index, V value);%0A%0A    /**%0A     * @return clone of key's part array.%0A     * Data will not be cloned%0A    
+given value slot. */%0A    void setValue(int index, V value);%0A%0A    /** Returns a shallow clone of the key array.
  */%0A
@@ -1687,23 +1687,26 @@
  /**
-%0A     * @return
+ Returns a shallow
  clo
@@ -1715,63 +1715,24 @@
  of 
+the 
 value
-'s part array.%0A     * Data will not be cloned%0A    
+ array.
  */%0A

Revise the Javadoc of Tuple