Exemple #1
1
  DecodeThread(
      CaptureActivity activity,
      Vector<BarcodeFormat> decodeFormats,
      String characterSet,
      ResultPointCallback resultPointCallback) {

    this.activity = activity;
    handlerInitLatch = new CountDownLatch(1);

    hints = new Hashtable<DecodeHintType, Object>(3);

    if (decodeFormats == null || decodeFormats.isEmpty()) {
      decodeFormats = new Vector<BarcodeFormat>();
      decodeFormats.addAll(DecodeFormatManager.ONE_D_FORMATS);
      decodeFormats.addAll(DecodeFormatManager.QR_CODE_FORMATS);
      decodeFormats.addAll(DecodeFormatManager.DATA_MATRIX_FORMATS);
    }

    hints.put(DecodeHintType.POSSIBLE_FORMATS, decodeFormats);

    if (characterSet != null) {
      hints.put(DecodeHintType.CHARACTER_SET, characterSet);
    }

    hints.put(DecodeHintType.NEED_RESULT_POINT_CALLBACK, resultPointCallback);
  }
Exemple #2
1
 public void setModel(Vector columnas, Vector vector) {
   rows.removeAllElements();
   rows.addAll(vector);
   columnNames.removeAllElements();
   columnNames.addAll(columnas);
   fireTableStructureChanged(); // Actualiza La Tabla
 }
  public void addHijos(DefaultMutableTreeNode nodo) {
    if (nodo.getChildCount() != 0) {
      nodo.removeAllChildren();
    }
    Vector<String> ListaDir = new Vector<String>();
    Vector<String> ListaArch = new Vector<String>();
    DefaultMutableTreeNode upNode =
        (nodo.isRoot()) ? nodo : (DefaultMutableTreeNode) nodo.getParent();
    String Ruta = nodo.getUserObject().toString();
    while (!upNode.isRoot()) {
      Ruta = upNode.getUserObject().toString() + "\\" + Ruta;
      upNode = (DefaultMutableTreeNode) upNode.getParent();
    }

    try {
      Process sysCall;
      BufferedReader br;
      String s = "";
      String strCmd = "cmd /c cd " + localDir + "\\" + Ruta + " & dir";
      System.out.println(strCmd);
      sysCall = Runtime.getRuntime().exec(strCmd);
      br = new BufferedReader(new InputStreamReader(sysCall.getInputStream()));
      while ((s = br.readLine()) != null) {
        System.out.println(s);
        int indexArch = "                                         ".length();
        if (s.contains("<DIR>")) {
          int indexDir = s.indexOf("<DIR>") + "<DIR>".length() + 1;
          String nomDir = s.substring(indexDir);
          ListaDir.add(nomDir.trim());
        } else {
          String nomArch = (s.length() > indexArch) ? s.substring(indexArch) : s;
          ListaArch.add(nomArch);
        }
      }
      ListaDir = new Vector<String>(ListaDir.subList(2, ListaDir.size()));
      ListaArch = new Vector<String>(ListaArch.subList(5, ListaArch.size() - 2));
      int i;
      for (i = 0; i < ListaDir.size(); i++) {
        DefaultMutableTreeNode hijo = new DefaultMutableTreeNode(ListaDir.get(i).toString());
        nodo.add(hijo);
      }
      for (i = 0; i < ListaArch.size(); i++) {
        DefaultMutableTreeNode hijo = new DefaultMutableTreeNode(ListaArch.get(i).toString());
        nodo.add(hijo);
      }
      ListaArchSup.addAll(ListaArch);
      ListaDirSup.addAll(ListaDir);
    } catch (Exception e) {
    }
  }
Exemple #4
0
  /** Sort all the painters (according to priority and name) */
  protected void sortThem() {
    sortByPriority.clear();
    sortByName.clear();

    sortByName.addAll(paintersByName.keySet());
    Collections.sort(sortByName);

    Vector<String> painterNames = new Vector<String>();
    Vector<Integer> priorities = new Vector<Integer>();

    painterNames.addAll(sortByName);
    priorities.addAll(painterPriorities.values());
    Collections.sort(priorities);

    while (!priorities.isEmpty()) {
      int prio = priorities.get(0);
      priorities.remove(0);

      for (int i = 0; i < painterNames.size(); i++) {
        if (painterPriorities.get(painterNames.get(i)) == prio) {
          sortByPriority.add(painterNames.get(i));
          painterNames.remove(i);
          break;
        }
      }
    }
  }
 /**
  * Returns a Collection of all flags supported by any of the regular-expression Compilers used by
  * the plug-in.
  *
  * @return a Collection of all flags supported by any of the regular-expression Compilers used by
  *     the plug-in
  */
 public static Collection getAllSupportedFlags() {
   Vector allFlags = new Vector();
   allFlags.addAll(MatchSetFactory.getAllFlags(JAVA_FLAVOUR));
   allFlags.addAll(MatchSetFactory.getAllFlags(ORO_PERL_FLAVOUR));
   allFlags.addAll(MatchSetFactory.getAllFlags(ORO_AWK_FLAVOUR));
   return allFlags;
 }
  public Vector getAllValidTemplates() {
    // Return templates if no imported/included stylesheets
    if (_includedStylesheets == null) {
      return _templates;
    }

    // Is returned value cached?
    if (_allValidTemplates == null) {
      Vector templates = new Vector();
      templates.addAll(_templates);
      int size = _includedStylesheets.size();
      for (int i = 0; i < size; i++) {
        Stylesheet included = (Stylesheet) _includedStylesheets.elementAt(i);
        templates.addAll(included.getAllValidTemplates());
      }
      // templates.addAll(_templates);

      // Cache results in top-level stylesheet only
      if (_parentStylesheet != null) {
        return templates;
      }
      _allValidTemplates = templates;
    }

    return _allValidTemplates;
  }
 private static void recurseDirectory(File directory, Vector<String> catTree) {
   String[] contents = directory.list();
   for (int i = 0; i < contents.length; i++) {
     File innerFile = new File(directory, contents[i]);
     if (innerFile.isFile()) {
       if ("domains".equals(contents[i])) {
         try {
           BufferedReader reader = new BufferedReader(new FileReader(innerFile));
           while (true) {
             String line = reader.readLine();
             if (line == null) break;
             Vector<String> vals = domains.get(line);
             if (vals == null) {
               Vector<String> newVals = new Vector<String>();
               newVals.addAll(catTree);
               domains.put(line, newVals);
             } else {
               vals.addAll(catTree);
               domains.put(line, vals);
             }
           }
           reader.close();
         } catch (Throwable t) {
           t.printStackTrace();
         }
         catTree.remove(catTree.size() - 1);
       }
     } else {
       System.out.println("> " + contents[i]);
       catTree.add(contents[i]);
       recurseDirectory(innerFile, catTree);
     }
   }
 }
Exemple #8
0
 public List getSupportedOptions() {
   Vector ret = new Vector();
   ret.addAll(options);
   for (int i = 0; i < elements.length; i++) {
     ret.addAll(elements[i].getSupportedOptions());
   }
   return ret;
 }
  public Vector<Byte> makeByteArray() {
    Vector<Byte> b = new Vector<Byte>();

    b.addAll(convertToByte(coffCabStart, 4));
    b.addAll(convertToByte(cCFData, 2));
    b.addAll(convertToByte(typeCompress, 2));

    return b;
  }
  /** Speichert die Standardkonfigurationsdatei. */
  private void saveCompleteConfig() {
    Vector<MulticastData> v = new Vector<MulticastData>();
    v.addAll(mc_sender_v4);
    v.addAll(mc_sender_v6);
    v.addAll(mc_receiver_v4);
    v.addAll(mc_receiver_v6);

    saveConfig("", true, v);
  }
Exemple #11
0
  /**
   * Returns an enumeration describing the available options.
   *
   * @return an enumeration of all the available options.
   */
  public Enumeration<Option> listOptions() {

    Vector<Option> result = new Vector<Option>();

    result.addElement(
        new Option("\tThe complexity constant C.\n" + "\t(default 1)", "C", 1, "-C <double>"));

    result.addElement(
        new Option(
            "\tWhether to 0=normalize/1=standardize/2=neither.\n" + "\t(default 0=normalize)",
            "N",
            1,
            "-N"));

    result.addElement(
        new Option(
            "\tOptimizer class used for solving quadratic optimization problem\n"
                + "\t(default "
                + RegSMOImproved.class.getName()
                + ")",
            "I",
            1,
            "-I <classname and parameters>"));

    result.addElement(
        new Option(
            "\tThe Kernel to use.\n"
                + "\t(default: weka.classifiers.functions.supportVector.PolyKernel)",
            "K",
            1,
            "-K <classname and parameters>"));

    result.addAll(Collections.list(super.listOptions()));

    result.addElement(
        new Option(
            "",
            "",
            0,
            "\nOptions specific to optimizer ('-I') "
                + getRegOptimizer().getClass().getName()
                + ":"));

    result.addAll(Collections.list(((OptionHandler) getRegOptimizer()).listOptions()));

    result.addElement(
        new Option(
            "",
            "",
            0,
            "\nOptions specific to kernel ('-K') " + getKernel().getClass().getName() + ":"));

    result.addAll(Collections.list(((OptionHandler) getKernel()).listOptions()));

    return result.elements();
  }
 public Vector<SSObject> getAllInactiveParticipants() {
   Vector<SSObject> all = new Vector<SSObject>();
   all.addAll(getAllInactiveTimothys());
   all.addAll(getAllInactiveRedas());
   all.addAll(getAllInactiveCodes());
   all.addAll(getAllInactiveProjs());
   all.addAll(getAllInactiveAssociatedUserStoriess());
   all.addAll(getAllInactiveReleasePlans());
   return all;
 }
Exemple #13
0
  /** Load all available data from the master into the list */
  private void fillList() {
    MeasurementHistoryController hist = master.getHistoryController();
    this.dataList.removeAll();
    Vector<String> tmp = new Vector<String>();
    tmp.addAll(hist.getDataHours().keySet());
    this.addKeys(tmp, "hours");

    tmp.removeAllElements();
    tmp.addAll(hist.getDataDays().keySet());
    this.addKeys(tmp, "days");
  }
  /**
   * add the ver id from the vToRemove to this vertex previous ids
   *
   * @param vToKeep
   * @param vToRemove
   */
  public void addToPrevIDs(SeqVertex vToKeep, SeqVertex vToRemove, int lastRealID) {
    if (_prevVerticesID.isEmpty()) {
      Vector<Integer> thisV = new Vector<Integer>();
      if (vToKeep.getID() >= lastRealID) thisV.add(vToKeep.getID());
      if (vToRemove.getID() >= lastRealID) thisV.add(vToRemove.getID());
      if (!vToKeep.getPrevVerIDs().isEmpty()) thisV.addAll(vToKeep.getPrevVerIDs().firstElement());
      if (!vToRemove.getPrevVerIDs().isEmpty())
        thisV.addAll(vToRemove.getPrevVerIDs().firstElement());

      _prevVerticesID.add(thisV);
    } else {
      assert (true);
    }
  }
 public DecoderBitmap(Context context) {
   multiFormatReader = new MultiFormatReader();
   Hashtable<DecodeHintType, Object> hints = new Hashtable<DecodeHintType, Object>(2);
   Vector<BarcodeFormat> decodeFormats = new Vector<BarcodeFormat>();
   if (decodeFormats == null || decodeFormats.isEmpty()) {
     decodeFormats = new Vector<BarcodeFormat>();
     decodeFormats.addAll(DecodeFormatManager.getBarCodeFormats());
     decodeFormats.addAll(DecodeFormatManager.getQrCodeFormats());
     decodeFormats.addAll(EnumSet.of(BarcodeFormat.AZTEC));
     decodeFormats.addAll(EnumSet.of(BarcodeFormat.PDF_417));
   }
   hints.put(DecodeHintType.POSSIBLE_FORMATS, decodeFormats);
   hints.put(DecodeHintType.CHARACTER_SET, "UTF8");
   multiFormatReader.setHints(hints);
 }
  public AColumnDisplayerModel(ObjectAdapter theAdapter) {

    adapter = theAdapter;
    parentClass = adapter.getParentAdapter().getPropertyClass();
    CompositeAdapter parentAdapter = adapter.getParentAdapter();
    BeanToRecord recordStructure = (BeanToRecord) parentAdapter.getConcreteObject();
    componentNames = recordStructure.componentNames();
    projectionGroups = adapter.getParentAdapter().getUnParsedProjectionGroups();
    processProjectionGroups();
    processComponentNames();
    dynamicCommandsVector.addAll(projectionGroupCommands);
    dynamicCommandsVector.addAll(allSiblingCommands);
    dynamicCommands = new String[0];
    dynamicCommands = dynamicCommandsVector.toArray(dynamicCommands);
  }
  @Override
  public IplImage process(IplImage img) {

    /*
    		if(convertFromColor) {
    			imageConversion.convertFromRGB(img, grayImage);
    		} else {
    			imageConversion.convertFromGray(img, grayImage);
    		}
    */

    blur.apply(grayImage, blurImage);
    IplImage bkImage = background.update(blurImage);
    if (bkImage == null) return null;

    ImageDifference.apply(bkImage, blurImage, diffImage);

    thresh.apply(diffImage, threshImage);

    synchronized (blobs) {
      Vector<Blob> allBlobs = new Vector<Blob>(newFrameBlobs.size());
      // probably should come up with some kind of double (or triple buffer) for this rather than
      // re-allocating vectors every frame
      blobs.detectBlobs(threshImage2.getData());
      for (int i = 0; i < regionMap.size(); i++) {
        Vector<Blob> detected = blobs.getDetectedBlobs(i);
        Vector<Blob> newBlobs = new Vector<Blob>(detected.size());
        newBlobs.addAll(detected);
        allBlobs.addAll(detected);
        tracker[i].queueBlobs(newBlobs);
      }
      newFrameBlobs = allBlobs;
    }

    switch (mode) {
      case raw:
        return img;
      case background:
        return bkImage;
      case diff:
        return diffImage;
      case thresh:
      case running:
        return threshImage2;
      default:
        return img;
    }
  }
Exemple #18
0
  protected void updateTransientActions() {
    Vector<Action> ta = new Vector<Action>();

    for (LabelAtomProperty p : properties) ta.addAll(p.getActions(this));

    transientActions = ta;
  }
 /**
  * Builds a {@link java.util.Vector} containing Strings which each name a file who's name matches
  * the pattern set by setPattern(String). The classpath is searched recursively, so use with
  * caution.
  *
  * @return Vector<String> containing matching filenames
  */
 public Vector<String> findMatches() {
   Vector<String> matches = new Vector<String>();
   URLClassLoader cl = getURLClassLoader();
   if (cl == null) {
     throw new XWorkException("unable to attain an URLClassLoader");
   }
   URL[] parentUrls = cl.getURLs();
   compiledPattern = (int[]) patternMatcher.compilePattern(pattern);
   for (URL url : parentUrls) {
     if (!"file".equals(url.getProtocol())) {
       continue;
     }
     URI entryURI;
     try {
       entryURI = url.toURI();
     } catch (URISyntaxException e) {
       continue;
     }
     File entry = new File(entryURI);
     Vector<String> results = checkEntries(entry.list(), entry, "");
     if (results != null) {
       matches.addAll(results);
     }
   }
   return matches;
 }
Exemple #20
0
  /**
   * Helper method to generate the signatures for binding the factory. Must account for the
   * inheritance relationships for any arguments that are classes. Ths, each argument can
   * potentially result in a range of values for type, and we have to handle the cross product of
   * all of these.
   */
  private static Vector makeFactoryNames(IXMLElement constructor) {
    String factoryName = XMLUtil.nameOf(constructor.getParent());
    Vector allPermutations = new Vector();
    for (Enumeration e = constructor.enumerateChildren(); e.hasMoreElements(); ) {
      IXMLElement element = (IXMLElement) e.nextElement();

      if (!element.getName().equals("arg")) {
        break;
      }

      String argType = XMLUtil.typeOf(element);
      Vector argTypeAlternates = new Vector();
      argTypeAlternates.add(argType);

      if (ModelAccessor.isClass(argType)) {
        List ancestors = ModelAccessor.getAncestors(argType);
        if (ancestors != null) argTypeAlternates.addAll(ancestors);
      }

      allPermutations.add(argTypeAlternates);
    }

    // Generate all the signatures
    Vector factoryNames = new Vector();
    makeFactoryNames(factoryName, allPermutations, 0, factoryNames);
    return factoryNames;
  }
Exemple #21
0
  private void deriveUprocVariables() throws Exception {
    if (isTempUprocSet) {

      Vector<Variable> varia = new Vector<Variable>();
      varia.addAll(templateCabrinUproc.getVariables());

      if (varia.size() == 3
          && varia.get(1).getName().equals("COMMAND_PART2")
          && varia.get(2).getName().equals("MAIN_JOB_TRIGGER")) {

        String command = varia.get(1).getValue();
        command = command.replace("-S00", "-S" + googleNumber);
        command = command.replace("<FILE>", fileName);
        varia.get(1).setValue(command);

        String main_job_trigger = varia.get(2).getValue();
        main_job_trigger = main_job_trigger.replace("<JOB>", relatedMainUproc);
        varia.get(2).setValue(main_job_trigger);
      }

      variables = varia;

      if (!duapi.doesUprocExist(relatedCabrinUproc)) {

        UprocId newDuplicatedUprocId = new UprocId(relatedCabrinUproc, "000");
        newDuplicatedUprocId.setId(relatedCabrinUproc);

        templateCabrinUproc.duplicate(newDuplicatedUprocId, "CABRIN");
        // duapi.duplicateUproc(templateCabrinUproc.getName(), relatedCabrinUproc,"CABRIN");
        System.out.println("Created uproc <" + relatedCabrinUproc + ">");
      }
    }
  }
 void m() {
   Vector<String> vector = new Vector<String>();
   vector.add("Hello");
   Vector<CharSequence> v2 = new Vector<CharSequence>();
   v2.add((CharSequence) null);
   v2.addAll(vector);
 }
 private void visit(Set<Edge> visited) {
   boolean fixpoint = false;
   while (!fixpoint) {
     fixpoint = true;
     Vector<Vector<Edge>> newPaths = new Vector<Vector<Edge>>();
     Vector<Vector<Edge>> delPaths = new Vector<Vector<Edge>>();
     for (Vector<Edge> path : paths) {
       Edge e = path.lastElement();
       boolean pathExtended = false;
       for (Edge succ : e.getTarget().getSucc()) {
         if (!visited.contains(succ)) {
           Vector<Edge> newPath = new Vector<Edge>();
           newPath.addAll(path);
           newPath.add(succ);
           newPaths.add(newPath);
           visited.add(succ);
           pathExtended = true;
           fixpoint = false;
         }
       }
       if (pathExtended) delPaths.add(path);
     }
     for (Vector<Edge> path : delPaths) paths.remove(path);
     paths.addAll(newPaths);
   }
 }
  /**
   * Gets the current settings of the Classifier.
   *
   * @return an array of strings suitable for passing to setOptions
   */
  @Override
  public String[] getOptions() {
    Vector<String> result;
    String[] clustererOptions;

    result = new Vector<String>();

    clustererOptions = new String[0];
    if ((m_clusterer != null) && (m_clusterer instanceof OptionHandler)) {
      clustererOptions = ((OptionHandler) m_clusterer).getOptions();
    }

    if (getClusterer() != null) {
      result.add("-W");
      result.add(getClusterer().getClass().getName());
    }

    if (getNoSizeDetermination()) {
      result.add("-no-size");
    }

    result.add("--");
    result.addAll(Arrays.asList(clustererOptions));

    return result.toArray(new String[result.size()]);
  }
  /*
   * add the given vertex info into this vertex
   * combine name and weights
   */
  public void concatVertex(SeqVertex vertex, Double w, int lastRealID) {
    int prevLen = getName().length();
    setName(getName() + vertex.getName());
    _weights.add(w);
    _weights.addAll(vertex.getWeights());
    // System.out.println(toStringWeights());
    Vector<Integer> newV = new Vector<Integer>();
    if (vertex.getID() <= lastRealID) {
      newV.add(vertex.getID());
      _prevVerticesID.add(newV);
    }
    _prevVerticesID.addAll(vertex.getPrevVerIDs());

    if (vertex.getDegenerativeFreq().size() > 0) {
      // 			System.err.println(vertex.getID()+":"+vertex.getDegenerativeFreq());
      // 			System.err.println(vertex.getID()+":"+vertex.getDegenerativeLocations());
      // 			System.err.println(vertex.getID()+":"+vertex.getDegenerativeLetters());
      // 			System.err.println(getID()+":"+getName());
      // 			System.err.println(prevLen);

      _degenerativeLocations.add(prevLen + 1);
      _degenerativeFreq.addAll(vertex.getDegenerativeFreq());
      _degenerativeLetters.addAll(vertex.getDegenerativeLetters());
    }
  }
Exemple #26
0
 protected void addSample(Sample sample) {
   boolean found = false;
   for (int i = 0; i < sessions.size(); i++) {
     if (notNewerThanThisSession(sample, sessions.get(i))) {
       if (!sessions.get(i).isDuplicate(sample, duplicatesWindow)) {
         int diffLost = sessions.get(i).numberOfLostSamples();
         sessions.get(i).receivedSample(sample);
         diffLost = sessions.get(i).numberOfLostSamples() - diffLost;
         numberOfCollectedSamples++;
         numberOfLostSamples += diffLost;
       }
       found = true;
       break;
     }
   }
   if (!found) {
     sessionId++;
     Session session = new Session(sessionId, sample);
     session.receivedSample(sample);
     sessions.add(session);
     while (sessions.size() > NUM_MAX_RECORDED_SESSIONS) {
       lostSamples.addAll(sessions.remove(0).getLostSamplesPeriods());
     }
     numberOfCollectedSamples++;
   }
 }
  // //////////////////////////////////////////////////////
  // Override
  // //////////////////////////////////////////////////////
  @SuppressWarnings({"rawtypes", "unchecked"})
  public Vector getDispatcherDefinition() {
    Vector vtReturn = new Vector();

    vtReturn.addElement(ThreadUtil.createTextParameter("deliveryUser", 30, ""));
    // vtReturn.addElement(ThreadUtil.createTextParameter("channel", 30, ""));
    vtReturn.addElement(ThreadUtil.createComboParameter("channel", "SMS,web", ""));
    vtReturn.addElement(ThreadUtil.createTextParameter("serviceAddress", 30, ""));
    vtReturn.addElement(ThreadUtil.createTextParameter("isdn", 30, ""));
    vtReturn.addElement(
        ThreadUtil.createTextParameter(
            "endIsdn",
            30,
            "If parameter is set, the simulator send order of subscribers range from isdn to endIsdn."));
    vtReturn.addElement(ThreadUtil.createTextParameter("shipTo", 30, ""));
    vtReturn.addElement(ThreadUtil.createTextParameter("keyword", 30, ""));
    vtReturn.addElement(ThreadUtil.createTextParameter("batchSize", 30, ""));
    vtReturn.addElement(ThreadUtil.createIntegerParameter("timeBetweenLoop", ""));
    vtReturn.addElement(
        ThreadUtil.createIntegerParameter("orderTimeout", "Time to live of order (s)."));

    vtReturn.addAll(ThreadUtil.createQueueParameter(this));

    return vtReturn;
  }
  public void substRef(Vector v, int pos, Vector entries) {
    KlassenMerkmale k;
    FlexMerkmal fm;
    KategorieMerkmal km;
    Enumeration e;
    Vector kmv = new Vector(); // Vector mit KategorieMerkmal - Eintr�gen

    // Hole Kategorie Merkmal
    km = (KategorieMerkmal) v.get(pos);

    // Verweis Kategorie Merkmale suchen:
    e = entries.elements();
    while (e.hasMoreElements()) {
      k = (KlassenMerkmale) e.nextElement();
      kmv.addAll(k.klassenVon(klasse));
    }

    // Flexionsinformationen ersetzen -- derzeit unvollst�ndig
    // (sollte kmv tats�chlich mehrere Elemente enthalten
    //  m�sste km entsprechend oft geclont werden
    //  und dann wieder in v eingef�gt werden ...)

    if (kmv.size() > 0) {
      fm = ((KategorieMerkmal) kmv.get(0)).getFlexInfo();
      if (fm != null) km.setFlexRef(fm);
    }
  }
  /**
   * Returns an enumeration describing the available options.
   *
   * @return an enumeration of all the available options.
   */
  @Override
  public Enumeration<Option> listOptions() {

    Vector<Option> newVector = new Vector<Option>(2);

    newVector.addElement(
        new Option(
            "\tSkips the determination of sizes (train/test/clusterer)\n"
                + "\t(default: sizes are determined)",
            "no-size",
            0,
            "-no-size"));
    newVector.addElement(
        new Option(
            "\tThe full class name of the density based clusterer.\n" + "\teg: weka.clusterers.EM",
            "W",
            1,
            "-W <class name>"));

    if ((m_clusterer != null) && (m_clusterer instanceof OptionHandler)) {
      newVector.addElement(
          new Option(
              "",
              "",
              0,
              "\nOptions specific to clusterer " + m_clusterer.getClass().getName() + ":"));
      newVector.addAll(Collections.list(((OptionHandler) m_clusterer).listOptions()));
    }
    return newVector.elements();
  }
Exemple #30
0
  private static Collection<PayloadFingerprint> parse(SetEntityParameters msg) {

    Vector<PayloadFingerprint> pf = new Vector<>();
    if (msg.getName().equals("Sidescan")) {
      boolean active = false;
      Vector<PayloadFingerprint> sidescanRanges = new Vector<>();
      for (EntityParameter p : msg.getParams()) {
        if (p.getName().equals("Range")
            || p.getName().equals("High-Frequency Range")
            || p.getName().equals("Low-Frequency Range")) {
          sidescanRanges.add(new SidescanFingerprint(Double.parseDouble(p.getValue())));
        } else if (p.getName().equals("Active")) {
          active = p.getValue().equalsIgnoreCase("true");
        }
      }
      if (active) pf.addAll(sidescanRanges);
    } else if (msg.getName().equals("Multibeam")) {
      double range = 0;
      boolean active = false;
      for (EntityParameter p : msg.getParams()) {
        if (p.getName().equals("Active")) {
          active = p.getValue().equalsIgnoreCase("true");
        } else if (p.getName().equals("Range")) {
          range = Double.parseDouble(p.getValue());
        }
      }
      if (active) {
        pf.add(new MultibeamFingerprint(range, Math.toRadians(60)));
      }
    }
    return pf;
  }