## org.apache.mahout.common
Class IntegerTuple

    java.lang.Object
      org.apache.mahout.common.IntegerTuple

All Implemented Interfaces:
  java.lang.Comparable<IntegerTuple>, org.apache.hadoop.io.Writable, org.apache.hadoop.io.WritableComparable<IntegerTuple>

    public final class IntegerTuple

extends java.lang.Object
implements org.apache.hadoop.io.WritableComparable<IntegerTuple>

An Ordered List of Integers which can be used in a Hadoop Map/Reduce Job

Constructor Summary
`IntegerTuple()`
`IntegerTuple(java.lang.Integer firstEntry)`
`IntegerTuple(java.lang.Integer[] entries)`
`IntegerTuple(java.lang.Iterable<java.lang.Integer> entries)`

Method Summary
`boolean` `add(java.lang.Integer entry)` add an entry to the end of the list
`int` `compareTo(IntegerTuple otherTuple)`
`boolean` `equals(java.lang.Object obj)`
`java.util.List<java.lang.Integer>` `getEntries()` Fetch the list of entries from the tuple
`int` `hashCode()`
`java.lang.Integer` `integerAt(int index)` Fetches the string at the given location
`int` `length()` Returns the length of the tuple
`void` `readFields(java.io.DataInput in)`
`java.lang.Integer` `replaceAt(int index, java.lang.Integer newInteger)` Replaces the string at the given index with the given newString
`java.lang.String` `toString()`
`void` `write(java.io.DataOutput out)`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### IntegerTuple

    public IntegerTuple()

### IntegerTuple

    public IntegerTuple(java.lang.Integer firstEntry)

### IntegerTuple

    public IntegerTuple(java.lang.Iterable<java.lang.Integer> entries)

### IntegerTuple

    public IntegerTuple(java.lang.Integer[] entries)

Method Detail

### add

    public boolean add(java.lang.Integer entry)

  add an entry to the end of the list

  Parameters:
    `entry` -
  Returns:
    true if the items get added

### integerAt

    public java.lang.Integer integerAt(int index)

  Fetches the string at the given location

  Parameters:
    `index` -
  Returns:
    String value at the given location in the tuple list

### replaceAt

    public java.lang.Integer replaceAt(int index,
                                       java.lang.Integer newInteger)

  Replaces the string at the given index with the given newString

  Parameters:
    `index` -
    `newInteger` -
  Returns:
    The previous value at that location

### getEntries

    public java.util.List<java.lang.Integer> getEntries()

  Fetch the list of entries from the tuple

  Returns:
    a List containing the strings in the order of insertion

### length

    public int length()

  Returns the length of the tuple

  Returns:
    length

### toString

    public java.lang.String toString()

  Overrides:
    `toString` in class `java.lang.Object`

### hashCode

    public int hashCode()

  Overrides:
    `hashCode` in class `java.lang.Object`

### equals

    public boolean equals(java.lang.Object obj)

  Overrides:
    `equals` in class `java.lang.Object`

### readFields

    public void readFields(java.io.DataInput in)
                    throws java.io.IOException

  Specified by:
    `readFields` in interface `org.apache.hadoop.io.Writable`
  Throws:
    `java.io.IOException`

### write

    public void write(java.io.DataOutput out)
               throws java.io.IOException

  Specified by:
    `write` in interface `org.apache.hadoop.io.Writable`
  Throws:
    `java.io.IOException`

### compareTo

    public int compareTo(IntegerTuple otherTuple)

  Specified by:
    `compareTo` in interface `java.lang.Comparable<IntegerTuple>`

Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.