Pipe P = new Pipe (fname,x1name,x2name,x3name,oname); try { view.setText(P.Pipeit()); } catch (TransformerConfigurationException e) { //log/handle the exception } catch (TransformerException e) { //log/handle the exception } catch (SAXException e) { //log/handle the exception } catch (IOException e) { //log/handle the exception }
Pipe p = new Pipe (fname,x1name,x2name,x3name,oname); view.setText(p.pipeIt());
public void addPipe() { for (int i = 0; i < pipe.length; i++) { if (pipe[i] == null) { pipe[i] = new Pipe(this.width, (int) Math.random() * (this.height - 200)); System.out.println("Pipe Added."); numPipes += 1; } } repaint(); }
pipe[i] = new Pipe(x + i * GameUI.d, ypoints[i], 7);
Pipe pipe = new Pipe("Pipe"); pipe = new Each(pipe, new DateFilter());
public class Main { public static void main(String[] args) { Tap sourceTap = new FileTap(new TextDelimited(true, ","), "inputFile.txt"); Tap sink_one = new FileTap(new TextDelimited(true, ","), "maleFile.txt"); Tap sink_two = new FileTap(new TextDelimited(true, ","), "FemaleFile.txt"); Pipe assembly = new Pipe("inputPipe"); Pipe malePipe = new Pipe("for_male", assembly); malePipe=new Each(malePipe,new CustomFilterByGender("male")); Pipe femalePipe = new Pipe("for_female", assembly); femalePipe=new Each(femalePipe, new CustomFilterByGender("female")); List<Pipe> pipes = new ArrayList<Pipe>(2); pipes.add(malePipe); pipes.add(femalePipe); Map<String, Tap> sinks = new HashMap<String, Tap>(); sinks.put("for_male", sink_one); sinks.put("for_female", sink_two); FlowConnector flowConnector = new LocalFlowConnector(); Flow flow = flowConnector.connect(sourceTap, sinks, pipes); flow.complete(); }
Properties properties = new Properties(); AppProps.setApplicationJarClass(properties, TestCascading.class); FlowConnector flowConnector = new LocalFlowConnector(); // create the source tap FileTap inTap = new FileTap(new TextLine(), "C://Users//rain.txt"); // create the sink tap FileTap outTap = new FileTap(new TextLine(), "C://Users//out.txt"); // specify a pipe to connect the taps Pipe copyPipe = new Pipe("copy"); // connect the taps, pipes, etc., into a flow FlowDef flowDef = FlowDef.flowDef().addSource(copyPipe, inTap).addTailSink(copyPipe, outTap); // run the flow Flow flow = flowConnector.connect(flowDef); flow.complete();