Examples of Splitter


Examples of org.drools.runtime.pipeline.Splitter

       
        Action action = PipelineFactory.newMvelAction( "this.setValues( [0, 1, 2, 3, 4] ) " )
        Expression expr = PipelineFactory.newMvelExpression( "this.values" );
        action.setReceiver( expr );
               
        Splitter splitter = PipelineFactory.newIterateSplitter();
        expr.setReceiver( splitter );
       
        ListAdapter listAdapter = new ListAdapterImpl( list, true );       
        splitter.setReceiver( listAdapter );
       
        assertNull( mock.getValues() );
        action.receive( mock, new BasePipelineContext( Thread.currentThread().getContextClassLoader() ) );

       
View Full Code Here

Examples of org.eclipse.compare.Splitter

   */
  public Object createPartControl(Composite parent) {
    parent.setLayout(new GridLayout());
    parent.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));            

    splitter = new Splitter(parent, SWT.HORIZONTAL);
    splitter.setLayout(new FillLayout());
    splitter.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));          
   
    Composite editorContent = new Composite(splitter, SWT.NONE);
    editorContent.setLayout(new FillLayout());
View Full Code Here

Examples of org.pdfbox.util.Splitter

    private void split( String[] args ) throws Exception
    {
        String password = "";
        String split = "1";

        Splitter splitter = new Splitter();
        String pdfFile = null;
        for( int i=0; i<args.length; i++ )
        {
            if( args[i].equals( PASSWORD ) )
            {
                i++;
                if( i >= args.length )
                {
                    usage();
                }
                password = args[i];
            }
            else if( args[i].equals( SPLIT ) )
            {
                i++;
                if( i >= args.length )
                {
                    usage();
                }
                split = args[i];
            }
            else
            {
                if( pdfFile == null )
                {
                    pdfFile = args[i];
                }
            }
        }

        if( pdfFile == null )
        {
            usage();
        }
        else
        {

            InputStream input = null;
            PDDocument document = null;
            List documents = null;
            try
            {
                input = new FileInputStream( pdfFile );
                document = parseDocument( input );
   
                if( document.isEncrypted() )
                {
                    try
                    {
                        document.decrypt( password );
                    }
                    catch( InvalidPasswordException e )
                    {
                        if( args.length == 4 )//they supplied the wrong password
                        {
                            System.err.println( "Error: The supplied password is incorrect." );
                            System.exit( 2 );
                        }
                        else
                        {
                            //they didn't suppply a password and the default of "" was wrong.
                            System.err.println( "Error: The document is encrypted." );
                            usage();
                        }
                    }
                }
   
                splitter.setSplitAtPage( Integer.parseInt( split ) );
                documents = splitter.split( document );
                for( int i=0; i<documents.size(); i++ )
                {
                    PDDocument doc = (PDDocument)documents.get( i );
                    String fileName = pdfFile.substring(0, pdfFile.length()-4 ) + "-" + i + ".pdf";
                    writeDocument( doc, fileName );
View Full Code Here

Examples of org.springframework.data.hadoop.store.split.Splitter

    TextFileWriter writer = new TextFileWriter(getConfiguration(), testDefaultPath, null);
    TestUtils.writeData(writer, DATA09ARRAY, false);
    TestUtils.writeData(writer, DATA09ARRAY, false);
    TestUtils.writeData(writer, DATA09ARRAY, true);

    Splitter splitter = new StaticLengthSplitter(getConfiguration(), 110l);
    List<Split> inputSplits = splitter.getSplits(testDefaultPath);
    assertNotNull(inputSplits);
    assertThat(inputSplits.size(), is(3));

    TextFileReader reader1 = new TextFileReader(getConfiguration(), testDefaultPath, null, inputSplits.get(0), null);
    List<String> readData1 = TestUtils.readData(reader1);
View Full Code Here

Examples of org.springframework.data.hadoop.store.split.Splitter

    TextFileWriter writer = new TextFileWriter(getConfiguration(), testDefaultPath, Codecs.BZIP2.getCodecInfo());
    TestUtils.writeData(writer, DATA09ARRAY, false);
    TestUtils.writeData(writer, DATA09ARRAY, false);
    TestUtils.writeData(writer, DATA09ARRAY, true);

    Splitter splitter = new StaticLengthSplitter(getConfiguration(), 30l);
    List<Split> inputSplits = splitter.getSplits(testDefaultPath);
    assertNotNull(inputSplits);
    assertThat(inputSplits.size(), is(3));

    TextFileReader reader1 = new TextFileReader(getConfiguration(), testDefaultPath, Codecs.BZIP2.getCodecInfo(), inputSplits.get(0), null);
    List<String> readData1 = TestUtils.readData(reader1);
View Full Code Here

Examples of weka.classifiers.trees.adtree.Splitter

  private void goDownAllPathsSingle(PredictionNode currentNode,
            Instances posInstances, Instances negInstances)
    throws Exception {

    for (Enumeration e = currentNode.children(); e.hasMoreElements(); ) {
      Splitter split = (Splitter) e.nextElement();
      for (int i=0; i<split.getNumOfBranches(); i++)
  searchForBestTestSingle(split.getChildForBranch(i),
        split.instancesDownBranch(i, posInstances),
        split.instancesDownBranch(i, negInstances));
    }
  }
View Full Code Here
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.