Examples of Vector


Examples of java.util.Vector

    // fill data | first time
    if (sform.getName() == null) {
      try {
        Mapping.begin();
        Vector groups = Group.listAll();
        Mapping.rollback();

        request.setAttribute("groups", groups);

      } catch (Exception e) {
        Mapping.rollback();
        throw new ServletException(e);
      }

      // Forward to the view page
      return (mapping.findForward("view"));
    }

    // fill data | errors
    if (errors.size() > 0) {
      try {
        Mapping.begin();
        Vector groups = Group.listAll();
        Mapping.rollback();

        request.setAttribute("groups", groups);
        request.setAttribute(ERROR_KEY, errors);
View Full Code Here

Examples of java.util.Vector

    if (keyWords != null) {
      if (!keyWords.trim().equals("")) {
        try {
          Mapping.begin();
          Vector result = Searcher.search(keyWords, "default");
          if( result.size()>0 ) {
            request.setAttribute("result", result);
          }
          Mapping.rollback();
        } catch (Exception e) {
          Mapping.rollback();
View Full Code Here

Examples of java.util.Vector

      ZipOutputStream zip =
        new ZipOutputStream(response.getOutputStream());

      // add resources
      Vector beans = Resources.getResourceXmlBeans(this);
      for (int i = 0; i < beans.size(); i++) {
        ResourceXmlBean bean = (ResourceXmlBean) beans.get(i);
        File root =
          new File(
            getServletContext().getRealPath("/"),
            resourcesPath);
        File dir = new File(root, bean.getDirectory());
        File[] files = dir.listFiles();
        for (int k = 0; k < files.length; k++) {
          File file = files[k];
          if (file.isFile()) {
            InputStream in = new FileInputStream(file);
            ZipEntry ze =
              new ZipEntry(
                "resources/"
                  + bean.getId()
                  + "/"
                  + file.getName());
            zip.putNextEntry(ze);

            // Transfer bytes from the file to the ZIP file
            int len;
            while ((len = in.read(buf)) > 0) {
              zip.write(buf, 0, len);
            }

            zip.closeEntry();
            in.close();
          }
        }
      }

      // add images
      File root =
        new File(getServletContext().getRealPath("/"), imagesPath);
      File[] files = root.listFiles();
      for (int k = 0; k < files.length; k++) {
        File file = files[k];
        if (file.isFile()) {
          InputStream in = new FileInputStream(file);
          ZipEntry ze = new ZipEntry("images/" + file.getName());
          zip.putNextEntry(ze);

          // Transfer bytes from the file to the ZIP file
          int len;
          while ((len = in.read(buf)) > 0) {
            zip.write(buf, 0, len);
          }

          zip.closeEntry();
          in.close();
        }
      }

      // add sections
      Mapping.begin();
      Vector sections = Section.listAll();
      Mapping.rollback();
      for (int i = 0; i < sections.size(); i++) {
        Section section = (Section) sections.get(i);
        try {
          URL url =
            new URL(
              frontUrl+"/section/"
                + section.getId()
                + ".html?static=true&nocache=true");
          BufferedReader reader =
            new BufferedReader(
              new InputStreamReader(url.openStream()));
          String content = "<!-- �ON static export -->";
          String line = "";
          while (line != null) {
            line = reader.readLine();
            if (line != null) {
              content += line;
            }
          }

          ZipEntry ze =
            new ZipEntry("section/" + section.getId() + ".html");
          zip.putNextEntry(ze);
          zip.write(content.getBytes());
          zip.closeEntry();
        } catch (Exception e) {
          System.out.println(
            "Static export error, section " + section.getId());
        }
      }

      // add publications
      Mapping.begin();
      Vector publications = Publication.listAll();
      Mapping.rollback();
      for (int i = 0; i < publications.size(); i++) {
        Publication publication = (Publication) publications.get(i);
        try {
          URL url =
            new URL(
              frontUrl+"/publication/"
                + publication.getId()
View Full Code Here

Examples of java.util.Vector

    return (ResourceXmlBean) roots.get(id);
  }

  protected static Vector getItems() {
    Enumeration elts = roots.elements();
    Vector retour = new Vector();
    while (elts.hasMoreElements()) {
      retour.add(elts.nextElement());
    }
    return retour;
  }
View Full Code Here

Examples of java.util.Vector

    /**
       Input fields
     **/

    // table
    Vector rules = check.getRules();
    RegExpRuleTableModel tableModel
      = new RegExpRuleTableModel(check.getRules());
    JTable table = new JTable(tableModel);
    JScrollPane scrollPane = new JScrollPane(table);
    dialogPanel.add(scrollPane);
View Full Code Here

Examples of java.util.Vector

  /**
   * Returns an enumeration describing the available options.
   * @return an enumeration of all the available options.
   **/
  public Enumeration listOptions () {
    Vector newVector = new Vector(4);
    newVector.addElement(new Option(
  "\tclass name of base learner to use for \taccuracy estimation.\n"
  + "\tPlace any classifier options LAST on the command line\n"
  + "\tfollowing a \"--\". eg.:\n"
  + "\t\t-B weka.classifiers.bayes.NaiveBayes ... -- -K\n"
  + "\t(default: weka.classifiers.rules.ZeroR)",
  "B", 1, "-B <base learner>"));
   
    newVector.addElement(new Option(
  "\tnumber of cross validation folds to use for estimating accuracy.\n"
  + "\t(default=5)",
  "F", 1, "-F <num>"));
   
    newVector.addElement(new Option(
  "\tSeed for cross validation accuracy testimation.\n"
  + "\t(default = 1)",
  "R", 1,"-R <seed>"));
   
    newVector.addElement(new Option(
  "\tthreshold by which to execute another cross validation\n"
  + "\t(standard deviation---expressed as a percentage of the mean).\n"
  + "\t(default: 0.01 (1%))",
  "T", 1, "-T <num>"));
   
    newVector.addElement(new Option(
        "\tPerformance evaluation measure to use for selecting attributes.\n" +
        "\t(Default = accuracy for discrete class and rmse for numeric class)",
        "E", 1, "-E <acc | rmse | mae | f-meas | auc>"));

    if ((m_BaseClassifier != null) &&
  (m_BaseClassifier instanceof OptionHandler)) {
      newVector.addElement(new Option("", "", 0, "\nOptions specific to scheme "
              + m_BaseClassifier.getClass().getName()
              + ":"));
      Enumeration enu = ((OptionHandler)m_BaseClassifier).listOptions();

      while (enu.hasMoreElements()) {
        newVector.addElement(enu.nextElement());
      }
    }

    return  newVector.elements();
  }
View Full Code Here

Examples of java.util.Vector

   *
   * @return an enumeration of all the available options.
   */
  public Enumeration listOptions() {

    Vector newVector = new Vector(1);

    newVector.addElement(new Option(
            "\tMaximum variance percentage allowed (default 99)",
            "M", 1, "-M <max variance %>"));


    return newVector.elements();
  }
View Full Code Here

Examples of java.util.Vector

    Hashtable                 result;
    Enumeration               enm;
    int                       i;
    StringTokenizer           tok;
    String                    clsname;
    Vector                    list;
    HierarchyPropertyParser   hpp;
    String                    separator;
    String                    root;
    String                    tmpStr;
   
    if (classes == null)
      return null;
   
    roots     = new Hashtable();
    hpp       = new HierarchyPropertyParser();
    separator = hpp.getSeperator();
   
    // go over all classnames and store them in the hashtable, with the
    // root element as the key
    tok   = new StringTokenizer(classes, ", ");
    while (tok.hasMoreElements()) {
      clsname = tok.nextToken();
      root    = getRootFromClass(clsname, separator);
      if (root == null)
        continue;
     
      // already stored?
      if (!roots.containsKey(root)) {
        list = new Vector();
        roots.put(root, list);
      }
      else {
        list = (Vector) roots.get(root);
      }
     
      list.add(clsname);
    }
   
    // build result
    result = new Hashtable();
    enm    = roots.keys();
    while (enm.hasMoreElements()) {
      root = (String) enm.nextElement();
      list = (Vector) roots.get(root);
      tmpStr = "";
      for (i = 0; i < list.size(); i++) {
        if (i > 0)
          tmpStr += ",";
        tmpStr += (String) list.get(i);
      }
      result.put(root, tmpStr);
    }
     
    return result;
View Full Code Here

Examples of java.util.Vector

   */
  public Enumeration listOptions() {

    String string = "\tThe minimum number of objects in a bucket (default: 6).";

    Vector newVector = new Vector(1);

    newVector.addElement(new Option(string, "B", 1,
            "-B <minimum bucket size>"));

    return newVector.elements();
  }
View Full Code Here

Examples of java.util.Vector

   * Returns an enumeration describing the available options.
   *
   * @return     an enumeration of all the available options.
   */
  public Enumeration listOptions() {
    Vector result = new Vector();
    Enumeration enm = super.listOptions();
    while (enm.hasMoreElements())
      result.add(enm.nextElement());

    result.addElement(new Option(
        "\tA filter to apply (can be specified multiple times).",
        "F", 1, "-F <classname [options]>"));

    result.addElement(new Option(
        "\tAn attribute range (can be specified multiple times).\n"
  + "\tFor each filter a range must be supplied. 'first' and 'last'\n"
  + "\tare valid indices. 'inv(...)' around the range denotes an\n"
  + "\tinverted range.",
        "R", 1, "-R <range>"));

    result.addElement(new Option(
        "\tFlag for leaving unused attributes out of the output, by default\n"
  + "\tthese are included in the filter output.",
        "U", 0, "-U"));

    return result.elements();
  }
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.