Package de.susebox.jtopas.impl

Examples of de.susebox.jtopas.impl.PatternMatcher


      }
      break;
     
    case Token.PATTERN:
      for (int index = 0; index < _patterns.size(); ++index) {
        PatternMatcher    data = (PatternMatcher)_patterns.get(index);

        prop = data.getProperty();
        if (prop.getImages()[0].equals(startImage)) {
          break;
        }
        prop = null;
      }
View Full Code Here


      }
      break;

    case Token.PATTERN:
      for (int index = 0; index < _patterns.size(); ++index) {
        PatternMatcher    data = (PatternMatcher)_patterns.get(index);

        prop = data.getProperty();
        if (prop.getImages()[0].equals(image)) {
          _patterns.remove(index);
          break;
        } else {
          prop = null;
View Full Code Here

      int                   longestMatch = 0;
      PatternHandler.Result bestResult   = null;
     
      // only get the string if pattern are available
      for (int index = 0; index < _patterns.size(); ++index) {
        PatternMatcher        data = (PatternMatcher)_patterns.get(index);
        PatternHandler.Result result = data.matches(dataProvider);

        if (result != null) {
          if (bestResult == null || bestResult.getLengthOfMatch() < result.getLengthOfMatch()) {
            bestResult = result;
          }
View Full Code Here

   * @return  the replaced pattern property or <code>null</code>
   * @throws  IllegalArgumentException if pattern matching is not available
   */
  protected TokenizerProperty addPattern(TokenizerProperty patternProp) throws IllegalArgumentException {
    // construct the pattern
    PatternMatcher  data = null;
    String          pattern = patternProp.getImages()[0];
   
    try {
      data = new PatternMatcher(patternProp, getParseFlags());
    } catch (Throwable ex) {
      throw new ExtIllegalArgumentException(ex, "Pattern matching is not available (use JDK 1.4 or above).");
    }
                                                     
    // Register pattern. First search for existing one
    for (int index = 0; index < _patterns.size(); ++index) {
      PatternMatcher    oldData = (PatternMatcher)_patterns.get(index);
      TokenizerProperty oldProp = oldData.getProperty();

      if (oldProp.getImages()[0].equals(pattern)) {
        _patterns.set(index, data);
        return oldProp;
      }
View Full Code Here

TOP

Related Classes of de.susebox.jtopas.impl.PatternMatcher

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.