Package java.util

Examples of java.util.Scanner.match()


    TreeSet<Accept> acceptTree = getAcceptTree();
    Scanner acceptLanguageScanner = new Scanner(headerValue).useDelimiter(",\\s?");
    while (acceptLanguageScanner.hasNext()) {
      if (acceptLanguageScanner.hasNext(REG_EX_ACCEPT_LANGUAGES_WITH_Q_FACTOR)) {
        acceptLanguageScanner.next(REG_EX_ACCEPT_LANGUAGES_WITH_Q_FACTOR);
        MatchResult result = acceptLanguageScanner.match();
        if (result.groupCount() == 2) {
          String languagerange = result.group(1);
          double qualityFactor = result.group(2) != null ? Double.parseDouble(result.group(2)) : 1d;
          acceptTree.add(new Accept().setQuality(qualityFactor).setValue(languagerange));
        } else {
View Full Code Here


            // Split into "proxyAddr:proxyPort".
            proxyAddr = null;
            int proxyPort = 8080;
            try {
                s.findInLine("(http://|)([^:/]+)(:|)([0-9]*)(/|)");
                MatchResult m = s.match();
               
                if (m.groupCount() >= 2) {
                    proxyAddr = m.group(2);
                }
               
View Full Code Here

   
    List<Integer[]> hanguls = new ArrayList<Integer[]>();
   
    while(s.hasNextLine() && s.hasNext()) {
      if (s.findInLine("([^;\\s]*);[^;]*;[^;]*;([^;]*);[^;]*;([^;]*);.*") != null) {
        MatchResult result = s.match();
        int codepoint = Integer.parseInt(result.group(1),16);
        int cc = Integer.parseInt(result.group(2));
        if (cc != 0) {
          cc_idx.add(codepoint);
          cc_data.add(cc);
View Full Code Here

            if (line.length() == 0)
                continue;
      Scanner lineScanner = new Scanner(line);
      lineScanner.findInLine("(\\d+),(\\d+)");
            try {
                MatchResult result = lineScanner.match();
                load.add(new VariableLoad(Integer.parseInt(result.group(1)),
                                          Integer.parseInt(result.group(2))));
                // for (int i=1; i<=result.groupCount(); i++)
                //  System.out.println(result.group(i));
            } catch (IllegalStateException e) {
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.