Package java.util

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


        String realPath = servlet.getServletContext().getRealPath("/");
        File resources = new File(realPath,ResourceServlet.relativePath);
        File tresources = new File(resources,path);
       
        File[] files = tresources.listFiles();
        Vector mfiles = new Vector();
        for( int i=0; i<files.length; i++ ) {
          mfiles.add(new org.nextime.ion.backoffice.bean.File(files[i]));
        }
       
        request.setAttribute("files",mfiles);
       
        // Forward to the next page
View Full Code Here

    // fill data
    try {
      Mapping.begin();

      Vector users = User.listAll();
      request.setAttribute("users",users);     
     
      Mapping.rollback();

    } catch (Exception e) {
View Full Code Here

    // 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

    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

      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

    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

    /**
       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

  /**
   * 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

   *
   * @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

TOP

Related Classes of java.util.Vector

Copyright © 2018 www.massapicom. 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.