cascading.tuple

## Class TupleStream

- java.lang.Object
- - cascading.tuple.TupleStream

-     public class TupleStream
      extends Object

  TupleStream provides helper methods to create `Tuple` `Stream` instances from `Tap` instances.

  This class is a convenience class over the methods provided on the Tap class that provide the same functionality. This class exists to help overcome any generics compiler warnings.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `TupleStream()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.util.function.ToDoubleFunction<Tuple>` | `posToDouble(int pos)` Method posToDouble returns the double value at the given tuple position.
    `static java.util.function.ToIntFunction<Tuple>` | `posToInt(int pos)` Method posToInt returns the int value at the given tuple position.
    `static java.util.function.ToLongFunction<Tuple>` | `posToLong(int pos)` Method posToLong returns the long value at the given tuple position.
    `static <R> java.util.function.Function<Tuple,? extends R>` | `posToObject(int pos)` Method posToObject returns the object at the given tuple position.
    `static java.util.stream.Stream<Tuple>` | `tupleStream(Tap tap, FlowProcess flowProcess)` Method tupleStream returns a `Stream` of `Tuple` instances from the given `Tap` instance.
    `static java.util.stream.Stream<Tuple>` | `tupleStream(Tap tap, FlowProcess flowProcess, Fields selector)` Method tupleStream returns a `Stream` of `Tuple` instances from the given `Tap` instance.
    `static java.util.stream.Stream<Tuple>` | `tupleStreamCopy(Tap tap, FlowProcess flowProcess)` Method tupleStreamCopy returns a `Stream` of `Tuple` instances from the given `Tap` instance.
    `static java.util.stream.Stream<Tuple>` | `tupleStreamCopy(Tap tap, FlowProcess flowProcess, Fields selector)` Method tupleStreamCopy returns a `Stream` of `Tuple` instances from the given `Tap` instance.
    `static Tap` | `writeDouble(java.util.stream.DoubleStream stream, java.util.function.Supplier<Tap> into, FlowProcess flowProcess)` Method writeDouble will add each `double` instance to the `TupleEntryCollector` provided by the given `Tap` instance.
    `static Tap` | `writeDouble(java.util.stream.DoubleStream stream, Tap into, FlowProcess flowProcess)` Method writeDouble will add each `double` instance to the `TupleEntryCollector` provided by the given `Tap` instance.
    `static Tap` | `writeInt(java.util.stream.IntStream stream, java.util.function.Supplier<Tap> into, FlowProcess flowProcess)` Method writeInt will add each `int` instance to the `TupleEntryCollector` provided by the given `Tap` instance.
    `static Tap` | `writeInt(java.util.stream.IntStream stream, Tap into, FlowProcess flowProcess)` Method writeInt will add each `int` instance to the `TupleEntryCollector` provided by the given `Tap` instance.
    `static Tap` | `writeLong(java.util.stream.LongStream stream, java.util.function.Supplier<Tap> into, FlowProcess flowProcess)` Method writeLong will add each `long` instance to the `TupleEntryCollector` provided by the given `Tap` instance.
    `static Tap` | `writeLong(java.util.stream.LongStream stream, Tap into, FlowProcess flowProcess)` Method writeLong will add each `long` instance to the `TupleEntryCollector` provided by the given `Tap` instance.
    `static Tap` | `writeTuple(java.util.stream.Stream<Tuple> stream, java.util.function.Supplier<Tap> into, FlowProcess flowProcess)` Method writeTuple will add each `Tuple` instance to the `TupleEntryCollector` provided by the given `Tap` instance.
    `static Tap` | `writeTuple(java.util.stream.Stream<Tuple> stream, Tap into, FlowProcess flowProcess)` Method writeTuple will add each `Tuple` instance to the `TupleEntryCollector` provided by the given `Tap` instance.

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### TupleStream

          public TupleStream()

  - ### Method Detail

    - #### tupleStream

          public static java.util.stream.Stream<Tuple> tupleStream(Tap tap,
                                                                   FlowProcess flowProcess)

      Method tupleStream returns a `Stream` of `Tuple` instances from the given `Tap` instance.

      Also see `Tap.tupleStream(FlowProcess)`.

      Parameters:
        `tap` - the Tap to open
        `flowProcess` - represents the current platform configuration
      Returns:
        a Stream of Tuple instances

    - #### tupleStreamCopy

          public static java.util.stream.Stream<Tuple> tupleStreamCopy(Tap tap,
                                                                       FlowProcess flowProcess)

      Method tupleStreamCopy returns a `Stream` of `Tuple` instances from the given `Tap` instance.

      This method returns an Tuple instance suitable for caching.

      Also see `Tap.tupleStreamCopy(FlowProcess)`.

      Parameters:
        `tap` - the Tap to open
        `flowProcess` - represents the current platform configuration
      Returns:
        a Stream of TupleEntry instances

    - #### tupleStream

          public static java.util.stream.Stream<Tuple> tupleStream(Tap tap,
                                                                   FlowProcess flowProcess,
                                                                   Fields selector)

      Method tupleStream returns a `Stream` of `Tuple` instances from the given `Tap` instance.

      Also see `Tap.tupleStream(FlowProcess)`.

      Parameters:
        `tap` - the Tap to open
        `flowProcess` - represents the current platform configuration
        `selector` - the fields to select from the underlying Tuple
      Returns:
        a Stream of TupleE instances

    - #### tupleStreamCopy

          public static java.util.stream.Stream<Tuple> tupleStreamCopy(Tap tap,
                                                                       FlowProcess flowProcess,
                                                                       Fields selector)

      Method tupleStreamCopy returns a `Stream` of `Tuple` instances from the given `Tap` instance.

      This method returns an Tuple instance suitable for caching.

      Also see `Tap.tupleStreamCopy(FlowProcess)`.

      Parameters:
        `tap` - the Tap to open
        `flowProcess` - represents the current platform configuration
        `selector` - the fields to select from the underlying Tuple
      Returns:
        a Stream of Tuple instances

    - #### posToObject

          public static <R> java.util.function.Function<Tuple,? extends R> posToObject(int pos)

      Method posToObject returns the object at the given tuple position.
      Type Parameters:
        `R` - the object type
      Parameters:
        `pos` - the ordinal position to select from
      Returns:
        the value in the given ordinal position

    - #### posToInt

          public static java.util.function.ToIntFunction<Tuple> posToInt(int pos)

      Method posToInt returns the int value at the given tuple position.
      Parameters:
        `pos` - the ordinal position to select from
      Returns:
        the value in the given ordinal position

    - #### posToLong

          public static java.util.function.ToLongFunction<Tuple> posToLong(int pos)

      Method posToLong returns the long value at the given tuple position.
      Parameters:
        `pos` - the ordinal position to select from
      Returns:
        the value in the given ordinal position

    - #### posToDouble

          public static java.util.function.ToDoubleFunction<Tuple> posToDouble(int pos)

      Method posToDouble returns the double value at the given tuple position.
      Parameters:
        `pos` - the ordinal position to select from
      Returns:
        the value in the given ordinal position

    - #### writeTuple

          public static Tap writeTuple(java.util.stream.Stream<Tuple> stream,
                                       java.util.function.Supplier<Tap> into,
                                       FlowProcess flowProcess)

      Method writeTuple will add each `Tuple` instance to the `TupleEntryCollector` provided by the given `Tap` instance.
      Parameters:
        `stream` - a Stream of Tuple instances
        `into` - a Supplier that returns the Tap to sink each entry into
        `flowProcess` - represents the current platform configuration
      Returns:
        returns the given Tap

    - #### writeTuple

          public static Tap writeTuple(java.util.stream.Stream<Tuple> stream,
                                       Tap into,
                                       FlowProcess flowProcess)

      Method writeTuple will add each `Tuple` instance to the `TupleEntryCollector` provided by the given `Tap` instance.
      Parameters:
        `stream` - a Stream of Tuple instances
        `into` - the Tap to sink each entry into
        `flowProcess` - represents the current platform configuration
      Returns:
        returns the given Tap

    - #### writeInt

          public static Tap writeInt(java.util.stream.IntStream stream,
                                     java.util.function.Supplier<Tap> into,
                                     FlowProcess flowProcess)

      Method writeInt will add each `int` instance to the `TupleEntryCollector` provided by the given `Tap` instance.
      Parameters:
        `stream` - a Stream of int values
        `into` - a Supplier that returns the Tap to sink each value into
        `flowProcess` - represents the current platform configuration
      Returns:
        returns the given Tap

    - #### writeInt

          public static Tap writeInt(java.util.stream.IntStream stream,
                                     Tap into,
                                     FlowProcess flowProcess)

      Method writeInt will add each `int` instance to the `TupleEntryCollector` provided by the given `Tap` instance.
      Parameters:
        `stream` - a Stream of int values
        `into` - the Tap to sink each value into
        `flowProcess` - represents the current platform configuration
      Returns:
        returns the given Tap

    - #### writeLong

          public static Tap writeLong(java.util.stream.LongStream stream,
                                      java.util.function.Supplier<Tap> into,
                                      FlowProcess flowProcess)

      Method writeLong will add each `long` instance to the `TupleEntryCollector` provided by the given `Tap` instance.
      Parameters:
        `stream` - a Stream of long values
        `into` - a Supplier that returns the Tap to sink each value into
        `flowProcess` - represents the current platform configuration
      Returns:
        returns the given Tap

    - #### writeLong

          public static Tap writeLong(java.util.stream.LongStream stream,
                                      Tap into,
                                      FlowProcess flowProcess)

      Method writeLong will add each `long` instance to the `TupleEntryCollector` provided by the given `Tap` instance.
      Parameters:
        `stream` - a Stream of long values
        `into` - the Tap to sink each value into
        `flowProcess` - represents the current platform configuration
      Returns:
        returns the given Tap

    - #### writeDouble

          public static Tap writeDouble(java.util.stream.DoubleStream stream,
                                        java.util.function.Supplier<Tap> into,
                                        FlowProcess flowProcess)

      Method writeDouble will add each `double` instance to the `TupleEntryCollector` provided by the given `Tap` instance.
      Parameters:
        `stream` - a Stream of double values
        `into` - a Supplier that returns the Tap to sink each value into
        `flowProcess` - represents the current platform configuration
      Returns:
        returns the given Tap

    - #### writeDouble

          public static Tap writeDouble(java.util.stream.DoubleStream stream,
                                        Tap into,
                                        FlowProcess flowProcess)

      Method writeDouble will add each `double` instance to the `TupleEntryCollector` provided by the given `Tap` instance.
      Parameters:
        `stream` - a Stream of double values
        `into` - the Tap to sink each value into
        `flowProcess` - represents the current platform configuration
      Returns:
        returns the given Tap

Copyright © 2007-2015 Xplenty, Inc. All Rights Reserved.