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

org.apache.crunch.fn
Class SwapFn<V1,V2>

java.lang.Object
  extended by org.apache.crunch.DoFn<S,T>
      extended by org.apache.crunch.MapFn<Pair<V1,V2>,Pair<V2,V1>>
          extended by org.apache.crunch.fn.SwapFn<V1,V2>
All Implemented Interfaces:
Serializable

public class SwapFn<V1,V2>
extends MapFn<Pair<V1,V2>,Pair<V2,V1>>

Swap the elements of a Pair type.

See Also:
Serialized Form

Constructor Summary
SwapFn()
           
 
Method Summary
 Pair<V2,V1> map(Pair<V1,V2> input)
          Maps the given input into an instance of the output type.
static
<V1,V2> PType<Pair<V2,V1>>
ptype(PType<Pair<V1,V2>> pt)
           
static
<K,V> PTableType<V,K>
tableType(PTableType<K,V> ptt)
           
 
Methods inherited from class org.apache.crunch.MapFn
process, scaleFactor
 
Methods inherited from class org.apache.crunch.DoFn
cleanup, configure, disableDeepCopy, initialize, setConfiguration, setContext
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SwapFn

public SwapFn()
Method Detail

ptype

public static <V1,V2> PType<Pair<V2,V1>> ptype(PType<Pair<V1,V2>> pt)

tableType

public static <K,V> PTableType<V,K> tableType(PTableType<K,V> ptt)

map

public Pair<V2,V1> map(Pair<V1,V2> input)
Description copied from class: MapFn
Maps the given input into an instance of the output type.

Specified by:
map in class MapFn<Pair<V1,V2>,Pair<V2,V1>>


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