Examples of findWithinHorizon()


Examples of java.util.Scanner.findWithinHorizon()

     *      the corresponding {@link ExceptionMessage}, or <code>null</code>
     */
    private static ExceptionMessage parseExceptionMessage( String message )
    {
        Scanner scanner = new Scanner( new ByteArrayInputStream( message.getBytes() ) );
        String foundString = scanner.findWithinHorizon( ".*line (\\d+):(\\d+): *([^\\n]*).*", message.length() ); //$NON-NLS-1$
        if ( foundString != null )
        {
            MatchResult result = scanner.match();
            if ( result.groupCount() == 3 )
            {
View Full Code Here

Examples of java.util.Scanner.findWithinHorizon()

      {
  // from : http://www.cs.princeton.edu/introcs/15inout/In.java.html
  // (?s) for DOTALL mode so . matches any character, including a line termination character
  // 1 says look only one character ahead
  // consider precompiling the pattern
  tmpStr += s.findWithinHorizon ("(?s).", 1);
      }
    myHarness.check (tmpStr.equals(fishString), "\"" + tmpStr + "\" == \"" + fishString + "\"");
    if (s.hasNext ())
      myHarness.fail ("should not has next...");
  }
View Full Code Here

Examples of java.util.Scanner.findWithinHorizon()

        fireEvent(new BasicChainEvent(this, context, EventTypes.START));
        final Scanner scanner = new Scanner(context.getSource());
        try {
            String match = "";
            while (null != match) {
                match = scanner.findWithinHorizon(CommunicationFactory
                        .getInstance().getUrlpattern(), 0);

                if (null != match && !"".equals(match.trim())) {
                    if (LOGGER.isDebugEnabled()) {
                        LOGGER.debug(match);
View Full Code Here

Examples of java.util.Scanner.findWithinHorizon()

        List<List<String>> rows = new ArrayList<List<String>>();
        List<String> row = null;
       
        Scanner scanner = new Scanner(request.getResponseStream(), "UTF-8");
        while (scanner.hasNextLine()) {
            scanner.findWithinHorizon(CSV_VALUE_PATTERN, 0);
            MatchResult match = scanner.match();
            String quotedString = match.group(2);
            String decoded = quotedString == null ? match.group(1) : quotedString.replaceAll("\"\"", "\"");
           
            if (row == null) {
View Full Code Here

Examples of java.util.Scanner.findWithinHorizon()

     *      the corresponding {@link ExceptionMessage}, or <code>null</code>
     */
    private static ExceptionMessage parseExceptionMessage( String message )
    {
        Scanner scanner = new Scanner( new ByteArrayInputStream( message.getBytes() ) );
        String foundString = scanner.findWithinHorizon( ".*line (\\d+):(\\d+): *([^\\n]*).*", message.length() ); //$NON-NLS-1$
        if ( foundString != null )
        {
            MatchResult result = scanner.match();
            if ( result.groupCount() == 3 )
            {
View Full Code Here

Examples of java.util.Scanner.findWithinHorizon()

       
        WebLink link = new WebLink(path);
       
        // Read link format attributes
        String attr = null;
        while (scanner.findWithinHorizon(DELIMITER, 1)==null && (attr = scanner.findInLine(WORD))!=null) {
          if (scanner.findWithinHorizon("=", 1) != null) {
            String value = null;
            if ((value = scanner.findInLine(QUOTED_STRING)) != null) {
              value = value.substring(1, value.length()-1); // trim " "
              if (attr.equals(TITLE)) {
View Full Code Here

Examples of java.util.Scanner.findWithinHorizon()

        WebLink link = new WebLink(path);
       
        // Read link format attributes
        String attr = null;
        while (scanner.findWithinHorizon(DELIMITER, 1)==null && (attr = scanner.findInLine(WORD))!=null) {
          if (scanner.findWithinHorizon("=", 1) != null) {
            String value = null;
            if ((value = scanner.findInLine(QUOTED_STRING)) != null) {
              value = value.substring(1, value.length()-1); // trim " "
              if (attr.equals(TITLE)) {
                link.getAttributes().addAttribute(attr, value);
View Full Code Here

Examples of java.util.Scanner.findWithinHorizon()

        // Retrieve specified resource, create if necessary
        Resource resource = new ResourceBase(path);
       
        // Read link format attributes
        LinkAttribute attr = null;
        while (scanner.findWithinHorizon(DELIMITER, 1)==null && (attr = LinkAttribute.parse(scanner))!=null) {
          resource.getAttributes().addAttribute(attr.getName(), attr.getValue());
        }
       
        root.add(resource);
      }
View Full Code Here

Examples of java.util.Scanner.findWithinHorizon()

        String regex = "tag\\d\\s*\\d+\\.\\d\\s*\\d+\\s*\\d+\\s*\\d+\\.\\d\\s*(\\d+)";
        Pattern statLinePattern = Pattern.compile(regex);
        Scanner scanner = new Scanner(new File("target/statisticsLogback.log"));

        int totalCount = 0;
        while (scanner.findWithinHorizon(statLinePattern, 0) != null) {
            totalCount += Integer.parseInt(scanner.match().group(1));
        }
        assertEquals(testThreads.length * TestLoggingThread.STOP_WATCH_COUNT, totalCount);
    }
   
View Full Code Here

Examples of java.util.Scanner.findWithinHorizon()

        String regex = "tag\\d\\s*\\d+\\.\\d\\s*\\d+\\s*\\d+\\s*\\d+\\.\\d\\s*(\\d+)";
        Pattern statLinePattern = Pattern.compile(regex);
        Scanner scanner = new Scanner(new File("target/statisticsLog.log"));

        int totalCount = 0;
        while (scanner.findWithinHorizon(statLinePattern, 0) != null) {
            totalCount += Integer.parseInt(scanner.match().group(1));
        }
        assertEquals(testThreads.length * TestLoggingThread.STOP_WATCH_COUNT, totalCount);
    }
   
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.