Class MutablePair<T1,T2>

Object
org.apache.spark.util.MutablePair<T1,T2>
All Implemented Interfaces:
Serializable, scala.Equals, scala.Product, scala.Product2<T1,T2>

public class MutablePair<T1,T2> extends Object implements scala.Product2<T1,T2>, scala.Product, Serializable
:: DeveloperApi :: A tuple of 2 elements. This can be used as an alternative to Scala's Tuple2 when we want to minimize object allocation.

param: _1 Element 1 of this MutablePair param: _2 Element 2 of this MutablePair

See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    No-arg constructor for serialization
    MutablePair(T1 _1, T2 _2)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    _1()
     
    _2()
     
    boolean
     
     
    update(T1 n1, T2 n2)
    Updates this pair with new values and returns itself

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface scala.Equals

    equals

    Methods inherited from interface scala.Product

    productElementName, productElementNames, productIterator, productPrefix

    Methods inherited from interface scala.Product2

    _1$mcD$sp, _1$mcI$sp, _1$mcJ$sp, _2$mcD$sp, _2$mcI$sp, _2$mcJ$sp, productArity, productElement
  • Constructor Details

    • MutablePair

      public MutablePair(T1 _1, T2 _2)
    • MutablePair

      public MutablePair()
      No-arg constructor for serialization
  • Method Details

    • _1

      public T1 _1()
      Specified by:
      _1 in interface scala.Product2<T1,T2>
    • _2

      public T2 _2()
      Specified by:
      _2 in interface scala.Product2<T1,T2>
    • update

      public MutablePair<T1,T2> update(T1 n1, T2 n2)
      Updates this pair with new values and returns itself
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • canEqual

      public boolean canEqual(Object that)
      Specified by:
      canEqual in interface scala.Equals