Examples of Match


Examples of org.osgi.service.device.Match

        Mockito.when( selector.select( Mockito.eq( deviceRef ), Mockito.isA(Match[].class) ) )
            .thenThrow( new RuntimeException( "test exception" ) );

        add( "org.apache.felix.driver-1.5", 1 );

        Match match = m_matcherImpl.selectBestMatch( deviceRef, selector );

        Assert.assertNull( match );

    }
View Full Code Here

Examples of org.osgi.service.device.Match

        Mockito.when( selector.select( Mockito.eq( deviceRef ), Mockito.isA(Match[].class) ) )
            .thenReturn( 0 );

        add( "org.apache.felix.driver-1.5", 2 );

        Match match = m_matcherImpl.selectBestMatch( deviceRef, selector );

        Assert.assertNotNull( match );
        Assert.assertNotNull( match.toString() );

    }
View Full Code Here

Examples of org.pathways.openciss.shared.Match

    //System.out.println("sent length of array to match: " + personalIdentifiers.length);
    //for (int i=0; i<personalIdentifiers.length; i++) {
      //System.out.println(personalIdentifiers[i]);
    //}
    // find matches for this client with these identifiers
    Match match = new Match();
    BigInteger[] matchResults = match.find(personalIdentifiers);
   
    // create JSON response of matching client ids
    ArrayNode matchedClientIDs = mapper.createArrayNode();
    System.out.println("matchResults are: " );
    for (int i=0; i<matchResults.length; i++) {
View Full Code Here

Examples of org.rstudio.core.client.regex.Match

    */
   private String removeHost(String url)
   {
      String pageUrl = Document.get().getURL();
      Pattern p = Pattern.create("^http(s?)://[^/]+");
      Match m = p.match(pageUrl, 0);
      if (m == null)
      {
         assert false : "Couldn't parse page URL: " + url;
         return url;
      }
      String prefix = m.getValue();
      if (!url.startsWith(prefix))
         return url;
      else
         return url.substring(prefix.length());
   }
View Full Code Here

Examples of org.rstudio.core.client.regex.Match

      ArrayList<String> sectionData = new ArrayList<String>();
      ArrayList<Match> sectionMatches = new ArrayList<Match>();

      int pos = 0;
      int lastHeaderStart = -1;
      Match m;
      while (null != (m = sectionHeaderPattern.match(data, pos)))
      {
         sectionMatches.add(m);

         if (lastHeaderStart >= 0)
            sectionData.add(data.substring(lastHeaderStart, m.getIndex()));

         lastHeaderStart = m.getIndex();
         pos = m.getIndex() + m.getValue().length();
      }
      if (lastHeaderStart >= 0)
         sectionData.add(data.substring(lastHeaderStart));

      sections_ = new ArrayList<Section>();
View Full Code Here

Examples of org.rstudio.core.client.regex.Match

            if (filePair == null)
            {
               // Although "Index: <filename>" appeared, no diff was actually
               // generated (e.g. binary file)
               Pattern hrule = Pattern.create("^=+$");
               Match m = hrule.match(section.data, 0);
               int startAt = (m != null) ? m.getIndex() + m.getValue().length()
                                         : 0;
               Iterable<String> lines = StringUtil.getLineIterator(
                     StringUtil.trimBlankLines(section.data.substring(startAt)));
               DiffChunk chunk = createInfoChunk(lines);
               if (lastSection != null && lastSection.isProperty)
View Full Code Here

Examples of org.rstudio.core.client.regex.Match

      int curRow = getSession().getSelection().getCursor().getRow();
      while (++curRow < getSession().getLength())
      {
         String line = getSession().getLine(curRow);
         Pattern pattern = Pattern.create("[^\\s]");
         Match match = pattern.match(line, 0);
         if (skipBlankLines && match == null)
            continue;
         int col =  (match != null) ? match.getIndex() : 0;
         getSession().getSelection().moveCursorTo(curRow, col, false);
         getSession().unfold(curRow, true);
         return true;
      }
      return false;
View Full Code Here

Examples of org.rstudio.core.client.regex.Match

   }

   private String extractIndentation(String code)
   {
      Pattern leadingWhitespace = Pattern.create("^(\\s*)");
      Match match = leadingWhitespace.match(code, 0);
      return match == null ? "" : match.getGroup(1);
   }
View Full Code Here

Examples of org.rstudio.core.client.regex.Match

      String selection = docDisplay_.getSelectionValue();

      // If any line's first non-whitespace character is not #, then the whole
      // selection should be commented. Exception: If the whole selection is
      // whitespace, then we comment out the whitespace.
      Match match = Pattern.create("^\\s*[^" + c + "\\s]").match(selection, 0);
      boolean uncomment = match == null && selection.trim().length() != 0;
      if (uncomment)
      {
         String prefix = c;
         if (prefix.equals("#"))
View Full Code Here

Examples of org.rstudio.core.client.regex.Match

   {
      String code = docDisplay_.getCode(selection);
      String[] lines = code.split("\n");
      String prefix = StringUtil.getCommonPrefix(lines, true);
      Pattern pattern = Pattern.create("^\\s*" + commentPrefix + "+('?)\\s*");
      Match match = pattern.match(prefix, 0);
      // Selection includes non-comments? Abort.
      if (match == null)
         return;
      prefix = match.getValue();
      final boolean roxygen = match.hasGroup(1);

      int cursorRowIndex = 0;
      int cursorColIndex = 0;
      if (cursorPos != null)
      {
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.