/*
(non-Javadoc)
@see
org.openscience.cdk.isomorphism.matchers.smarts.SMARTSAtom#matches(org
.openscience.cdk.interfaces.IAtom)
8242
@Override
    public boolean matches(IAtom atom) {
        String symbol = atom.getSymbol();
        return !(symbol.equals("C") || symbol.equals("H"));

    }
851968
public char match(ISense source, ISense target) throws MatcherLibraryException {
        String sSynset = source.getGloss();
        String tSynset = target.getGloss();
        StringTokenizer stSource = new StringTokenizer(sSynset, " ,.\"'();");
        StringTokenizer stTarget = new StringTokenizer(tSynset, " ,.\"'();");
        String lemma;
        int counter = 0;
        while (stSource.hasMoreTokens()) {
            lemma = stSource.nextToken();
            if (!meaninglessWords.contains(lemma)) {
                List<String> lemmas = target.getLemmas();
                for (String lemmaToCompare : lemmas) {
                    if (lemma.equals(lemmaToCompare)) {
                        counter++;
                    }
                }
            }
        }
        if (counter >= threshold) {
            return IMappingElement.LESS_GENERAL;
        }

        while (stTarget.hasMoreTokens()) {
            lemma = stTarget.nextToken();
            if (!meaninglessWords.contains(lemma)) {
                List<String> lemmas = source.getLemmas();
                for (String lemmaToCompare : lemmas) {
                    if (lemma.equals(lemmaToCompare)) {
                        counter++;
                    }
                }
            }
        }
        if (counter >= threshold) {
            return IMappingElement.MORE_GENERAL;
        }
        return IMappingElement.IDK;
    }
710996
@Override
    public boolean matches(IBond bond) {
        return bond.isAromatic() || bond.getOrder() == IBond.Order.SINGLE;
    }
711547
@Override
	public boolean satisfies(Match match, int... ind)
	{
		return match.get(ind[selfIndex]) == match.get(ind[ind.length-1]) ||
			super.satisfies(match, ind);
	}
292860
public boolean matches(String domain) {
        if (pattern != null) {
            return pattern.matcher(domain).matches();
        }

        return this.domain.equals(domain);
    }
519919
public final boolean matches(@NotNull final String targetPath) {
        Contract.requireArgNotNull("targetPath", targetPath);
        if (regExpr == null) {
            return true;
        }
        return regExpr.matcher(targetPath).find();
    }
682789
@Override
    public final boolean matches(Object item, Description mismatch) {
        if (matches(item)) {
            return true;
        } else {
            describeMismatch(item, mismatch);
            return false;
        }
    }
1314487
@Override
    public <I> MatchResult<I> matchResult(I item) {
        StringDescription mismatch = new StringDescription();
        if (matches(item, mismatch)) {
            return new MatchResultSuccess<>(item, this);
        } else {
            return new MatchResultMismatch<>(item, this, mismatch.toString());
        }
    }
444251
public boolean matches(Class<?>[] args) {
        int i;
        Class<?>[] paras;

        paras = getParameterTypes();
        if (args.length != paras.length) {
            return false;
        }
        for (i = 0; i < args.length; i++) {
            if (!paras[i].isAssignableFrom(args[i])) {
                return false;
            }
        }
        return true;
    }
307695
public static boolean isMatch(String match, Object paramObj) {
        return StringHelper.isBlank(match) || isTrue(match, paramObj);
    }
390846
public static void match(DatabaseClient client) throws IOException {
    // create a manager for document search criteria
    QueryManager queryMgr = client.newQueryManager();

    // specify the search criteria for the documents
    String criteria = "neighborhoods";
    StringQueryDefinition querydef = queryMgr.newStringDefinition();
    querydef.setCriteria(criteria);

    // create a manager for matching rules
    RuleManager ruleMgr = client.newRuleManager();

    // match the rules against the documents qualified by the criteria
    RuleDefinitionList matchedRules = ruleMgr.match(querydef, new RuleDefinitionList());

    // iterate over the matched rules
    Iterator<RuleDefinition> ruleItr = matchedRules.iterator();
    while (ruleItr.hasNext()) {
      RuleDefinition rule = ruleItr.next();
      System.out.println(
        "document criteria "+criteria+" matched rule "+
          rule.getName()+" with metadata "+rule.getMetadata()
      );
    }
  }
738046
@Override
	public boolean satisfies(Match match, int... ind)
	{
		assert ind.length == 1;

		return clazz.isAssignableFrom(match.get(ind[0]).getModelInterface());
	}
767865
public static boolean matches(String pattern, String value) {
        Pattern p = Pattern.compile(pattern);
        Matcher m = p.matcher(value);
        return m.matches();
    }
439859
@Override
    public boolean matches(IAtom atom) {
        // h counts should be set before match throw runtime exception?
        if (atom.getImplicitHydrogenCount() == null)
            return false;
        return atom.getImplicitHydrogenCount() == hcount;
    }
686389
@Override
	public boolean satisfies(Match match, int... ind)
	{
		BioPAXElement ele0 = match.get(ind[0]);
		BioPAXElement ele1 = match.get(ind[1]);

		if (ele1 == null) return false;

		Set vals = pa.getValueFromBean(ele0);
		return vals.contains(ele1);
	}
84928
public boolean matches(String name) {
		if (name == null) {
			return pattern.equals("");
		}
		if (all != null) {
			return all.equals(name);
		}
		if (middle != null) {
			return name.contains(middle);
		}
		if (start != null && !name.startsWith(start)) {
			return false;
		}

		return end == null || name.endsWith(end);
	}
1248887
public <A> void match(Map<A,? extends Collection<I>> samples, BiConsumer<T, A> consumer)
    {
        Map<A,Collection<I>> m = new HashMap<>(samples);
        boolean cont = true;
        while (cont)
        {
            cont = false;
            Iterator<Entry<A, Collection<I>>> iterator = m.entrySet().iterator();
            while (iterator.hasNext())
            {
                Entry<A, Collection<I>> e = iterator.next();
                T match = match(e.getValue());
                if (match != null)
                {
                    consumer.accept(match, e.getKey());
                    cont = true;
                    iterator.remove();
                }
            }
        }
    }