Examples of Collector


Examples of com.cloudera.cdk.morphline.api.Collector

          public void run() {
            try {
              int iters = 0;
              MorphlineContext ctx = new MorphlineContext.Builder().build();
              Config config = parse("test-morphlines/convertHTML");
              Collector myCollector = new Collector();
              Command myMorphline = new PipeBuilder().build(config, null, myCollector, ctx);
             
              long start = System.currentTimeMillis();
              while (System.currentTimeMillis() < start + durationMillis) {
                Record record = new Record();
View Full Code Here

Examples of com.crashnote.core.collect.Collector

    /**
     * Create an instance of module 'Collector'
     */
    public Collector<C> getCollector() {
        return new Collector(this);
    }
View Full Code Here

Examples of com.neophob.sematrix.core.glue.Collector

               
    int msgLength = msg.length-1;
    int tmp;   
    try {
      ValidCommands cmd = ValidCommands.valueOf(msg[0]);
      Collector col = Collector.getInstance();
      switch (cmd) {
      case CHANGE_GENERATOR_A:
        try {
          int nr = col.getCurrentVisual();
          tmp=Integer.parseInt(msg[1]);
          Generator g = col.getPixelControllerGenerator().getGenerator(tmp);
          //silly check of generator exists
          g.getId();
          col.getVisual(nr).setGenerator1(g);
        } catch (Exception e) {
          LOG.log(Level.WARNING, IGNORE_COMMAND, e);
        }
        break;

      case CHANGE_GENERATOR_B:
        try {
          //the new method - used by the gui
          int nr = col.getCurrentVisual();
          tmp=Integer.parseInt(msg[1]);
          Generator g = col.getPixelControllerGenerator().getGenerator(tmp);
          g.getId();
          col.getVisual(nr).setGenerator2(g);
        } catch (Exception e) {
          LOG.log(Level.WARNING,  IGNORE_COMMAND, e);
        }
        break;

      case CHANGE_EFFECT_A:
        try {
          int nr = col.getCurrentVisual();
          tmp=Integer.parseInt(msg[1]);
          Effect e = col.getPixelControllerEffect().getEffect(tmp);
          e.getId();
          col.getVisual(nr).setEffect1(e);           
        } catch (Exception e) {
          LOG.log(Level.WARNING,  IGNORE_COMMAND, e);
        }
        break;

      case CHANGE_EFFECT_B:
        try {
          int nr = col.getCurrentVisual();
          tmp=Integer.parseInt(msg[1]);
          Effect e = col.getPixelControllerEffect().getEffect(tmp);
          e.getId();
          col.getVisual(nr).setEffect2(e);           
        } catch (Exception e) {
          LOG.log(Level.WARNING, IGNORE_COMMAND, e);
        }
        break;

      case CHANGE_MIXER:
        try {
          //the new method - used by the gui
          int nr = col.getCurrentVisual();
          tmp=Integer.parseInt(msg[1]);
          Mixer m = col.getPixelControllerMixer().getMixer(tmp);
          m.getId();
          col.getVisual(nr).setMixer(m);
        } catch (Exception e) {
          LOG.log(Level.WARNING, IGNORE_COMMAND, e);
        }
        break;

      case CHANGE_OUTPUT_VISUAL:
        try {
          int nr = col.getCurrentOutput();       
          int newFx = Integer.parseInt(msg[1]);
          int oldFx = col.getFxInputForScreen(nr);
          int nrOfVisual = col.getAllVisuals().size();
          LOG.log(Level.INFO,  "old fx: {0}, new fx {1}", new Object[] {oldFx, newFx});
          if (oldFx!=newFx && newFx>=0 && newFx<nrOfVisual) {
            LOG.log(Level.INFO,  "Change Output 0, old fx: {0}, new fx {1}", new Object[] {oldFx, newFx});
            if (startFader) {
              //start fader to change screen
              col.getOutputMappings(nr).getFader().startFade(newFx, nr);               
            } else {
              //do not fade if we load setting from present
              col.mapInputToScreen(nr, newFx);
            }
          }
        } catch (Exception e) {
          LOG.log(Level.WARNING,  IGNORE_COMMAND, e);
        }
        break;

      case CHANGE_ALL_OUTPUT_VISUAL:
        try {
            int newFx = Integer.parseInt(msg[1]);
          int size = col.getAllOutputMappings().size();         
          int nrOfVisual = col.getAllVisuals().size();
         
          if (newFx>=0 && newFx<nrOfVisual) {
                      for (int i=0; i<size; i++) {                       
                          int oldFx = col.getFxInputForScreen(i);                    
                          if (oldFx!=newFx) {
                              LOG.log(Level.INFO, "Change Output 0, old fx: {0}, new fx {1}", new Object[] {oldFx, newFx});
                              if (startFader) {
                                  //start fader to change screen
                                  col.getOutputMappings(i).getFader().startFade(newFx, i);                               
                              } else {
                                  //do not fade if we load setting from present
                                  col.mapInputToScreen(i, newFx);
                              }
                          }                      
                      }             
          }
        } catch (Exception e) {
          LOG.log(Level.WARNING,  IGNORE_COMMAND, e);
        }
        break;
       
      case CHANGE_OUTPUT_FADER:
        try {
          int nr = col.getCurrentOutput();
          tmp=Integer.parseInt(msg[1]);
          //do not start a new fader while the old one is still running
          if (!col.getOutputMappings(nr).getFader().isStarted()) {
              IFader f = col.getPixelControllerFader().getVisualFader(tmp);
              if (f!=null) {
                  col.getOutputMappings(nr).setFader(f);  
              }
          }
        } catch (Exception e) {
          LOG.log(Level.WARNING,  IGNORE_COMMAND, e);
        }
        break;

      case CHANGE_ALL_OUTPUT_FADER:
        try {
          tmp=Integer.parseInt(msg[1]);
          for (OutputMapping om: col.getAllOutputMappings()) {
            //do not start a new fader while the old one is still running
            if (!om.getFader().isStarted()) {
                IFader f = col.getPixelControllerFader().getVisualFader(tmp);
                if (f!=null) {
                    om.setFader(f);                   
                }
            }           
          }
        } catch (Exception e) {
          LOG.log(Level.WARNING,  IGNORE_COMMAND, e);
        }
        break;

      case CHANGE_SHUFFLER_SELECT:
        try {         
          int size = col.getPixelControllerShufflerSelect().getShufflerSelect().size();
          if (size>msgLength) {
            size=msgLength;
          }
          boolean b;
          String str="";
          for (int i=0; i<size; i++) {
            b = false;
            if (msg[i+1].equals("1")) {
              b = true;
              str += '1';
            } else str += '0';
           
            col.getPixelControllerShufflerSelect().setShufflerSelect(i, b);
          }
          LOG.log(Level.INFO, "Shuffler select: "+str);
        } catch (Exception e) {
          LOG.log(Level.WARNING, IGNORE_COMMAND, e);
        }
        break;

      case CHANGE_ROTOZOOM:
        try {         
          int val = Integer.parseInt(msg[1]);
          RotoZoom r = (RotoZoom)col.getPixelControllerEffect().getEffect(EffectName.ROTOZOOM);
          r.setAngle(val);         
        } catch (Exception e) {
          LOG.log(Level.WARNING, IGNORE_COMMAND, e);
        }
        break;

      case SAVE_PRESET:
        try {
          int idxs = col.getSelectedPreset();
          List<String> present = col.getCurrentStatus();
          col.getPresets().get(idxs).setPresent(present);
          col.savePresets();         
        } catch (Exception e) {
          LOG.log(Level.WARNING,  IGNORE_COMMAND, e);
        }
        break;

      case LOAD_PRESET:
        try {
          loadPreset(col.getSelectedPreset());
          col.notifyGuiUpdate();         
        } catch (Exception e) {
          LOG.log(Level.WARNING,  IGNORE_COMMAND, e);
        }
        break;

      case CHANGE_PRESET:
        try {
          int a = Integer.parseInt(msg[1]);
          if (a<Collector.NR_OF_PRESET_SLOTS) {
              col.setSelectedPreset(a);             
          }         
        } catch (Exception e) {
          LOG.log(Level.WARNING,  IGNORE_COMMAND, e);
        }
        break;

      case CHANGE_THRESHOLD_VALUE:
        try {
          int a = Integer.parseInt(msg[1]);
          if (a>255) {
            a=255;
          }
          if (a<0) {
            a=0;
          }
          col.getPixelControllerEffect().setThresholdValue(a);
        } catch (Exception e) {
          LOG.log(Level.WARNING,  IGNORE_COMMAND, e);
        }
        break;

      case BLINKEN:
        try {
          String fileToLoad = msg[1];
          col.getPixelControllerGenerator().setFileBlinken(fileToLoad);                     
        } catch (Exception e) {
          LOG.log(Level.WARNING,  IGNORE_COMMAND, e);
        }
        break;

      case IMAGE:
        try {
          String fileToLoad = msg[1];
            col.getPixelControllerGenerator().setFileImageSimple(fileToLoad);  
        } catch (Exception e) {
          LOG.log(Level.WARNING,  IGNORE_COMMAND, e);
        }
        break;
     
      case COLOR_SCROLL_OPT:
        try {
          int dir = Integer.parseInt(msg[1]);
          col.getPixelControllerGenerator().setColorScrollingDirection(dir);
        } catch (Exception e) {
          LOG.log(Level.WARNING,  IGNORE_COMMAND, e);
        }
        break;


            case TEXTDEF:
        try {
          int lut = Integer.parseInt(msg[1]);
          col.getPixelControllerEffect().setTextureDeformationLut(lut);
        } catch (Exception e) {
          LOG.log(Level.WARNING,  IGNORE_COMMAND, e);
        }
        break;
       
            case ZOOMOPT:
        try {
          int zoomMode = Integer.parseInt(msg[1]);
          col.getPixelControllerEffect().setZoomOption(zoomMode);
        } catch (Exception e) {
          LOG.log(Level.WARNING,  IGNORE_COMMAND, e);
        }
        break;
       
      case TEXTWR:
        try {
          String message = msg[1];
          col.getPixelControllerGenerator().setText(message);
        } catch (Exception e) {
          LOG.log(Level.WARNING, IGNORE_COMMAND, e);
        }
        break;

      case TEXTWR_OPTION:
        try {
          int scollerNr = Integer.parseInt(msg[1]);
          col.getPixelControllerGenerator().setTextOption(scollerNr);
        } catch (Exception e) {
          LOG.log(Level.WARNING, IGNORE_COMMAND, e);
        }
        break;
       
      case RANDOM:  //enable or disable random mode
        try {
          String onOrOff = msg[1];
          if (onOrOff.equalsIgnoreCase("ON") || onOrOff.equalsIgnoreCase("1")) {
            col.setRandomPresetMode(false);
            col.setRandomMode(true);
            LOG.log(Level.INFO, "Random Mode enabled");
          }
          if (onOrOff.equalsIgnoreCase("OFF") || onOrOff.equalsIgnoreCase("0")) {
            col.setRandomPresetMode(false);
            col.setRandomMode(false);
            LOG.log(Level.INFO, "Random Mode disabled");
          }
        } catch (Exception e) {
          LOG.log(Level.WARNING, IGNORE_COMMAND, e);
        }
        break;

      case RANDOM_PRESET_MODE:
        try {
          String onOrOff = msg[1];
          if (onOrOff.equalsIgnoreCase("ON") || onOrOff.equalsIgnoreCase("1")) {
            col.setRandomMode(false);
            col.setRandomPresetMode(true);
            LOG.log(Level.INFO, "Random Preset Mode enabled");
          }
          if (onOrOff.equalsIgnoreCase("OFF") || onOrOff.equalsIgnoreCase("0")) {
            col.setRandomMode(false);
            col.setRandomPresetMode(false);
            LOG.log(Level.INFO, "Random Preset Mode disabled");
          }
        } catch (Exception e) {
          LOG.log(Level.WARNING, IGNORE_COMMAND, e);
        }       
        break;
       
      case RANDOMIZE:  //one shot randomizer
        try {
          //save current visual buffer
          TransitionManager transition = new TransitionManager(col);
          Shuffler.manualShuffleStuff();
          transition.startCrossfader();
          col.notifyGuiUpdate();
        } catch (Exception e) {
          LOG.log(Level.WARNING, IGNORE_COMMAND, e);
        }
        break;

      case PRESET_RANDOM:  //one shot randomizer, use a pre-stored present
        try {
          int currentPreset = Shuffler.getRandomPreset();         
          loadPreset(currentPreset);
          col.setSelectedPreset(currentPreset);
          col.notifyGuiUpdate();
        } catch (Exception e) {
          LOG.log(Level.WARNING, IGNORE_COMMAND, e);
        }
        break;

      case CURRENT_VISUAL:
        //change the selected visual, need to update
        //some of the gui elements
        try {
          int a = Integer.parseInt(msg[1]);
          col.setCurrentVisual(a);
          col.notifyGuiUpdate();
        } catch (Exception e) {
          LOG.log(Level.WARNING, IGNORE_COMMAND, e);
        }
        break;

      case CURRENT_OUTPUT:
        //change the selected output, need to update
        //some of the gui elements
        try {
          int a = Integer.parseInt(msg[1]);
          col.setCurrentOutput(a);
        } catch (Exception e) {
          LOG.log(Level.WARNING, IGNORE_COMMAND, e);
        }
        break;

      case CHANGE_BRIGHTNESS:
        try {
          int a = Integer.parseInt(msg[1]);
          if (a<0 || a>100) {
            LOG.log(Level.WARNING, IGNORE_COMMAND+", invalid brightness value: "+a);
            break;
          } else {
            float f = a/100f;
            col.getPixelControllerGenerator().setBrightness(f);
          }
        } catch (Exception e) {
          LOG.log(Level.WARNING, IGNORE_COMMAND, e);
        }
        break;
       
      case GENERATOR_SPEED:
        try {
          int fpsAdjustment = Integer.parseInt(msg[1]);
          if (fpsAdjustment<0 || fpsAdjustment>200) {
            LOG.log(Level.WARNING, IGNORE_COMMAND+", invalid fps adjustment value: "+fpsAdjustment);
            break;
          } else {
            float f = fpsAdjustment/100f;
            col.getPixelControllerGenerator().setFpsAdjustment(f);
          }
        } catch (Exception e) {
          LOG.log(Level.WARNING, IGNORE_COMMAND, e);
        }
        break;
       
      //create a screenshot of all current buffers
      case SCREENSHOT:
        col.saveScreenshot();
        LOG.log(Level.INFO, "Saved some screenshots");
        break;
       
      //change current colorset
      case CURRENT_COLORSET:
        int nr = col.getCurrentVisual();
        try {
          //old method, reference colorset by index
          int newColorSetIndex = Integer.parseInt(msg[1]);                       
                  col.getVisual(nr).setColorSet(newColorSetIndex);
                  break;
        } catch (Exception e) {
          //ignore
        }
       
        try {
          //now try to reference colorset by name
          col.getVisual(nr).setColorSet(msg[1]);
        } catch (Exception e) {
          LOG.log(Level.WARNING, IGNORE_COMMAND, e);
        }

        break;
               
      //pause output, needed to create screenshots or take an image of the output
      case FREEZE:
        col.togglePauseMode();
        break;
     
      //show/hide internal visuals to save cpu power
      case TOGGLE_INTERNAL_VISUAL:
        col.toggleInternalVisual();
        break;
       
      case OSC_GENERATOR1:
        col.getPixelControllerGenerator().getOscListener1().updateBuffer(blob);
        break;
       
      case OSC_GENERATOR2:
        col.getPixelControllerGenerator().getOscListener2().updateBuffer(blob);
        break;

      case BEAT_WORKMODE:
        try {
          int workmodeId = Integer.parseInt(msg[1]);
          for (BeatToAnimation bta: BeatToAnimation.values()) {
            if (bta.getId() == workmodeId) {
              col.getPixelControllerGenerator().setBta(bta);
              LOG.log(Level.INFO, "Select beat workmode "+bta);
            }
          }

        } catch (Exception e) {
View Full Code Here

Examples of com.orientechnologies.orient.test.domain.whiz.Collector

    super.afterMethod();
  }

  public void testIndexCollection() {
    Collector collector = new Collector();
    collector.setStringCollection(Arrays.asList("spam", "eggs"));
    collector = database.save(collector);

    List<ODocument> result = database.command(new OCommandSQL("select key, rid from index:Collector.stringCollection")).execute();

    Assert.assertNotNull(result);
View Full Code Here

Examples of com.sun.enterprise.diagnostics.collect.Collector

    }
  
    public ReportGenerator createReportGenerator() throws DiagnosticException {
        analyzeInput();
        Collector harvester = createHarvester();
        HTMLReportWriter reportWriter = createHTMLReportWriter();
        return createReportGenerator(config,harvester,reportWriter);
    }
View Full Code Here

Examples of eu.stratosphere.util.Collector

      if (numOutputs != 1 || config.getOutputShipStrategy(0) != ShipStrategyType.FORWARD) {
        throw new RuntimeException("Plan Generation Bug: Found a chained stub that is not connected via an only forward connection.");
      }

      // instantiate each task
      @SuppressWarnings("rawtypes")
      Collector previous = null;
      for (int i = numChained - 1; i >= 0; --i)
      {
        // get the task first
        final ChainedDriver<?, ?> ct;
View Full Code Here

Examples of net.paoding.analysis.knife.Collector

      final Word curWord = vocabularyDictionary.get(i);
      curWord.getText().getChars(0, curWord.length(), chs, 0);
      chs[curWord.length()] = (char) -1;
      Beef beef = new Beef(chs, 0, curWord.length() + 1);
      final BitSet bs = new BitSet(curWord.length());
      knife.dissect(new Collector(){
        public void collect(String word, int offset, int end) {
          Hit hit = vocabularyDictionary.search(word, 0, word.length());
          if (hit.isHit() && hit.getWord().length() != curWord.length()) {
            for (int j = offset; j < end; j++) {
              bs.set(j, true);
View Full Code Here

Examples of org.apache.flink.util.Collector

      if (numOutputs != 1 || config.getOutputShipStrategy(0) != ShipStrategyType.FORWARD) {
        throw new RuntimeException("Plan Generation Bug: Found a chained stub that is not connected via an only forward connection.");
      }

      // instantiate each task
      @SuppressWarnings("rawtypes")
      Collector previous = null;
      for (int i = numChained - 1; i >= 0; --i)
      {
        // get the task first
        final ChainedDriver<?, ?> ct;
View Full Code Here

Examples of org.apache.lucene.search.Collector

      throw new IllegalArgumentException("query must not be null");
   
    Searcher searcher = createSearcher();
    try {
      final float[] scores = new float[1]; // inits to 0.0f (no match)
      searcher.search(query, new Collector() {
        private Scorer scorer;

        @Override
        public void collect(int doc) throws IOException {
          scores[0] = scorer.score();
View Full Code Here

Examples of org.apache.lucene.search.Collector

      // [2a] add to level words in
      String word = (String) it.next();
      TermQuery tq = new TermQuery( new Term( field, word));
      tmp.add( tq, BooleanClause.Occur.SHOULD);

      syns.search(new TermQuery( new Term(Syns2Index.F_WORD, word)), new Collector() {
        IndexReader reader;
       
        @Override
        public boolean acceptsDocsOutOfOrder() {
          return true;
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.