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

org.apache.crunch.contrib.text
Class Extractors

java.lang.Object
  extended by org.apache.crunch.contrib.text.Extractors

public final class Extractors
extends Object

Factory methods for constructing common Extractor types.


Constructor Summary
Extractors()
           
 
Method Summary
static Extractor<Boolean> xboolean()
          Returns an Extractor for booleans.
static Extractor<Boolean> xboolean(Boolean defaultValue)
           
static
<T> Extractor<Collection<T>>
xcollect(TokenizerFactory scannerFactory, Extractor<T> extractor)
           
static
<T extends Tuple>
Extractor<T>
xcustom(Class<T> clazz, TokenizerFactory scannerFactory, Extractor... extractors)
          Returns an Extractor for a subclass of Tuple with a constructor that has the given extractor types that uses the given TokenizerFactory for parsing the sub-fields.
static Extractor<Double> xdouble()
          Returns an Extractor for doubles.
static Extractor<Double> xdouble(Double defaultValue)
           
static Extractor<Float> xfloat()
          Returns an Extractor for floats.
static Extractor<Float> xfloat(Float defaultValue)
           
static Extractor<Integer> xint()
          Returns an Extractor for integers.
static Extractor<Integer> xint(Integer defaultValue)
          Returns an Extractor for integers.
static Extractor<Long> xlong()
          Returns an Extractor for longs.
static Extractor<Long> xlong(Long defaultValue)
          Returns an Extractor for longs.
static
<K,V> Extractor<Pair<K,V>>
xpair(TokenizerFactory scannerFactory, Extractor<K> one, Extractor<V> two)
          Returns an Extractor for pairs of the given types that uses the given TokenizerFactory for parsing the sub-fields.
static
<A,B,C,D> Extractor<Tuple4<A,B,C,D>>
xquad(TokenizerFactory scannerFactory, Extractor<A> a, Extractor<B> b, Extractor<C> c, Extractor<D> d)
          Returns an Extractor for quads of the given types that uses the given TokenizerFactory for parsing the sub-fields.
static Extractor<String> xstring()
          Returns an Extractor for strings.
static Extractor<String> xstring(String defaultValue)
           
static
<A,B,C> Extractor<Tuple3<A,B,C>>
xtriple(TokenizerFactory scannerFactory, Extractor<A> a, Extractor<B> b, Extractor<C> c)
          Returns an Extractor for triples of the given types that uses the given TokenizerFactory for parsing the sub-fields.
static Extractor<TupleN> xtupleN(TokenizerFactory scannerFactory, Extractor... extractors)
          Returns an Extractor for an arbitrary number of types that uses the given TokenizerFactory for parsing the sub-fields.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Extractors

public Extractors()
Method Detail

xint

public static Extractor<Integer> xint()
Returns an Extractor for integers.


xint

public static Extractor<Integer> xint(Integer defaultValue)
Returns an Extractor for integers.


xlong

public static Extractor<Long> xlong()
Returns an Extractor for longs.


xlong

public static Extractor<Long> xlong(Long defaultValue)
Returns an Extractor for longs.


xfloat

public static Extractor<Float> xfloat()
Returns an Extractor for floats.


xfloat

public static Extractor<Float> xfloat(Float defaultValue)

xdouble

public static Extractor<Double> xdouble()
Returns an Extractor for doubles.


xdouble

public static Extractor<Double> xdouble(Double defaultValue)

xboolean

public static Extractor<Boolean> xboolean()
Returns an Extractor for booleans.


xboolean

public static Extractor<Boolean> xboolean(Boolean defaultValue)

xstring

public static Extractor<String> xstring()
Returns an Extractor for strings.


xstring

public static Extractor<String> xstring(String defaultValue)

xcollect

public static <T> Extractor<Collection<T>> xcollect(TokenizerFactory scannerFactory,
                                                    Extractor<T> extractor)

xpair

public static <K,V> Extractor<Pair<K,V>> xpair(TokenizerFactory scannerFactory,
                                               Extractor<K> one,
                                               Extractor<V> two)
Returns an Extractor for pairs of the given types that uses the given TokenizerFactory for parsing the sub-fields.


xtriple

public static <A,B,C> Extractor<Tuple3<A,B,C>> xtriple(TokenizerFactory scannerFactory,
                                                       Extractor<A> a,
                                                       Extractor<B> b,
                                                       Extractor<C> c)
Returns an Extractor for triples of the given types that uses the given TokenizerFactory for parsing the sub-fields.


xquad

public static <A,B,C,D> Extractor<Tuple4<A,B,C,D>> xquad(TokenizerFactory scannerFactory,
                                                         Extractor<A> a,
                                                         Extractor<B> b,
                                                         Extractor<C> c,
                                                         Extractor<D> d)
Returns an Extractor for quads of the given types that uses the given TokenizerFactory for parsing the sub-fields.


xtupleN

public static Extractor<TupleN> xtupleN(TokenizerFactory scannerFactory,
                                        Extractor... extractors)
Returns an Extractor for an arbitrary number of types that uses the given TokenizerFactory for parsing the sub-fields.


xcustom

public static <T extends Tuple> Extractor<T> xcustom(Class<T> clazz,
                                                     TokenizerFactory scannerFactory,
                                                     Extractor... extractors)
Returns an Extractor for a subclass of Tuple with a constructor that has the given extractor types that uses the given TokenizerFactory for parsing the sub-fields.



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