c

Custom.Tuple._library2

final class _library2[A, B] extends AnyVal

Tuple2 Library

Ordering
  1. Alphabetic
Inherited
  1. Tuple._library2
  2. scala.AnyVal
  3. scala.Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Method

  1. def apply[T](f: (A, B) ⇒ Any): (A, B)

    Process with function

    Process with function

    Processes tuple elements in functional manner

    Returns original tuple

    (2, 4)(_ * _ lp)                                // Prints: 8
    
    (3, 4).to((first, second) => first * second lp) // Prints: 12
    Definition Classes
    _library2
  2. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  3. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  4. def map1[T](f: (A) ⇒ T): (T, B)

    Map first

    Map first

    Creates new tuple with first element mapped

    (1, 2).map1(_ * 10) .lp   // Prints: (10,2)
    Definition Classes
    _library2
  5. def map2[T](f: (B) ⇒ T): (A, T)

    Map second

    Map second

    Creates new tuple with second element mapped

    (1, 2).map2(_ * 10) .lp   // Prints: (1,20)
    Definition Classes
    _library2
  6. def to[T](f: (A, B) ⇒ T): T

    Convert by function

    Convert by function

    Converts tuple elements in functional manner

    (2, 4).to(_ * _).lp                             // Prints: 8
    
    (3, 4).to((first, second) => first * second).lp // Prints: 12
    
    (0 <> 4).all.zipIdx.map(_.to(_ * _)).lp         //  Prints: ~(0, 1, 4, 9, 16)
    Definition Classes
    _library2
  7. def toString(): String
    Definition Classes
    Any

Operator

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    Any
  2. final def ##(): Int
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    Any
Linear Supertypes
AnyVal, Any
Source: _library2.scala