Package java.util

Examples of java.util.StringTokenizer.countTokens()


     * @param ext the file extensions, separated by spaces
     * @param desc the file description
      */
    public FileFilter(String ext, String desc){
      StringTokenizer st = new StringTokenizer(ext);
      _extension = new String[st.countTokens()];
      for (int i=0; i<_extension.length; ++i){
        _extension[i] = st.nextToken().toLowerCase();
      }
      _description=desc;
      _canProcessDirectory = false;
View Full Code Here


   
    // Parse the variables
    StringTokenizer st = new StringTokenizer(variables.substring(variables.indexOf('=')+1),"\t ,;:");

    // Allocate variable names
    int numVars = st.countTokens();
    names = new String[numVars];
    for (int i=0; i<numVars; ++i) names[i] = st.nextToken();
   
    // Second line is information on the data
    String info = br.readLine();
View Full Code Here

    // Store file data
    data = new double[numVars][numPoints];
    for (int i=0; i<numPoints; ++i) {
      st = new StringTokenizer(br.readLine(), " ");
      if (st.countTokens() != numVars) throw new IOException("Invalid file format at line "+(i+3));
      try {
        for (int d=0; d<numVars; ++d) {
          data[d][i] = Double.parseDouble(st.nextToken());
          if (data[d][i]<min[d]) min[d] = data[d][i];
          if (data[d][i]>max[d]) max[d] = data[d][i];
View Full Code Here

    triangles = new int[numTri*3];
    for (int i=0; i<triangles.length; i+=3) {
      String line = br.readLine();
      while (line.trim().equals("")) line = br.readLine();
      st = new StringTokenizer(line);
      if (st.countTokens() != 3) {
        System.out.println(st.countTokens()+": "+line);
        throw new IOException("Invalid file format at line "+(i/3 + numPoints + 2));
      }
      try {
        // indices are written from 1 in the file, stored from 0 in the array
View Full Code Here

    for (int i=0; i<triangles.length; i+=3) {
      String line = br.readLine();
      while (line.trim().equals("")) line = br.readLine();
      st = new StringTokenizer(line);
      if (st.countTokens() != 3) {
        System.out.println(st.countTokens()+": "+line);
        throw new IOException("Invalid file format at line "+(i/3 + numPoints + 2));
      }
      try {
        // indices are written from 1 in the file, stored from 0 in the array
        triangles[i+0] = Integer.parseInt(st.nextToken()) - 1;
View Full Code Here

                if (!defaultPlugins.equals("")) {
                    userProperties.setString("jsynoptic.plugins", defaultPlugins);
                }
            } else {
                StringTokenizer st = new StringTokenizer(defaultPlugins, ", ;:\t|");
                int n = st.countTokens();
                int i = 0;
                if (splashSreen.isVisible()) {
                    splashSreen.setMessage(messageWriter.print0args("loadingPlugins"));
                }
                while (st.hasMoreTokens()) {
View Full Code Here

     * @param path the search path string
     * @return the resulting array of directory and JAR file URLs
     */
    public static URL[] pathToURLs(String path) {
        StringTokenizer st = new StringTokenizer(path, File.pathSeparator);
        URL[] urls = new URL[st.countTokens()];
        int count = 0;
        while (st.hasMoreTokens()) {
            URL url = fileToURL(new File(st.nextToken()));
            if (url != null) {
                urls[count++] = url;
View Full Code Here

    * Default is JdbcDriver.drivers=sun.jdbc.odbc.JdbcOdbcDriver
    */
   private void initDrivers() {
      String drivers = this.info.get("jdbc.drivers", "oracle.jdbc.driver.OracleDriver");
      StringTokenizer st = new StringTokenizer(drivers, ":");
      int numDrivers = st.countTokens();
      String driver = "";

      for (int i = 0; i < numDrivers; i++) {
         try {
            driver = st.nextToken().trim();
View Full Code Here

      domCache = new LinkedList();

      // attempt to get the mime types from the init properties
      String someMimeTypes = prop.getProperty(XPATH_MIME_TYPES, "text/xml;image/svg+xml");
      StringTokenizer st = new StringTokenizer(someMimeTypes, ";");
      ArrayList list = new ArrayList(st.countTokens() + 1);
      while (st.hasMoreTokens()) {
          list.add(st.nextToken());
      }
      mimeTypes = (String[])list.toArray(new String[list.size()]);
   }
View Full Code Here

      }

      StringTokenizer st = new StringTokenizer(line);

      // check for at least 2 arguments in the straeam
      if (st.countTokens() < 2) {
         log.severe("To few arguments in String [" + line + "]");
         return null;
      }
      // if the request starts with "get", get the next token for the oid
      if (st.nextToken().equalsIgnoreCase("get")) {
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.