Package jcascalog.example

Source Code of jcascalog.example.Split

package jcascalog.example;

import cascading.flow.FlowProcess;
import cascading.operation.FunctionCall;
import cascading.tuple.Tuple;
import cascalog.CascalogFunction;

public class Split extends CascalogFunction {
  public void operate(FlowProcess flowProcess, FunctionCall fnCall) {
    String sentence = fnCall.getArguments().getString(0);
    for (String word : sentence.split(" ")) {
      fnCall.getOutputCollector().add(new Tuple(word));
    }
  }
}
TOP

Related Classes of jcascalog.example.Split

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.