This project has retired. For details please refer to its Attic page.
FirstElementPObject (Apache Crunch 0.9.0 API)

org.apache.crunch.materialize.pobject
Class FirstElementPObject<T>

java.lang.Object
  extended by org.apache.crunch.materialize.pobject.PObjectImpl<T,T>
      extended by org.apache.crunch.materialize.pobject.FirstElementPObject<T>
Type Parameters:
T - The value type of this PObject.
All Implemented Interfaces:
PObject<T>

public class FirstElementPObject<T>
extends PObjectImpl<T,T>

A concrete implementation of PObjectImpl that uses the first element in the backing PCollection as the PObject value.


Constructor Summary
FirstElementPObject(PCollection<T> collect)
          Constructs a new instance of this PObject implementation.
 
Method Summary
 T process(Iterable<T> input)
          Transforms the provided Iterable, obtained from the backing PCollection, into the value encapsulated by this PObject.
 
Methods inherited from class org.apache.crunch.materialize.pobject.PObjectImpl
getValue, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FirstElementPObject

public FirstElementPObject(PCollection<T> collect)
Constructs a new instance of this PObject implementation.

Parameters:
collect - The backing PCollection for this PObject.
Method Detail

process

public T process(Iterable<T> input)
Transforms the provided Iterable, obtained from the backing PCollection, into the value encapsulated by this PObject.

Specified by:
process in class PObjectImpl<T,T>
Parameters:
input - An Iterable whose elements correspond to those of the backing PCollection.
Returns:
The value of this PObject.


Copyright © 2014 The Apache Software Foundation. All Rights Reserved.