Returns true if and only if the specified {@link Node} values match the data contained in this {@link Pattern}
value object

@param node
@return
@throws IllegalArgumentException
If the {@link Node} is not specified
424830
public boolean matches(final Node node) throws IllegalArgumentException {
        // Precondition checks
        if (node == null) {
            throw new IllegalArgumentException("node must be specified");
        }

        if (!name.equals(node.getName())) {
            return false;
        }

        if ((text != null && node.getText() == null) || (text != null && !text.trim().equals(node.getText().trim()))) {
            return false;
        }

        if (attributes != null) {
            for (final Map.Entry<String, String> attribute : attributes.entrySet()) {
                final String attrValue = attribute.getValue();
                final String attrName = attribute.getKey();

                if (!attrValue.equals(node.getAttribute(attrName))) {
                    return false;
                }
            }
        }

        return true;
    }
701762
@Override
    public MatchType match(int level, Node node) {
        if(! (node instanceof Element)) {
            return MatchType.NOT_A_MATCH;
        }
        Element element = (Element) node;
        if(this.level != level) {
            return MatchType.NOT_A_MATCH;
        } else if(nodename.equals(element.getName())) {
            return MatchType.NODE_MATCH;
        }
        return MatchType.NOT_A_MATCH;
    }
605117
public static boolean hasBindableAnnotation(AnnotatedNode node) {
        for (AnnotationNode annotation : node.getAnnotations()) {
            if (boundClassNode.equals(annotation.getClassNode())) {
                return true;
            }
        }
        return false;
    }
612718
protected static boolean nameMatches(EObject element, String pattern) {
		if (element instanceof RuleCall) {
			return nameMatches(((RuleCall) element).getRule(), pattern);
		}
		if (element instanceof AbstractRule) {
			final String name = ((AbstractRule) element).getName();
			final Pattern compilerPattern = Pattern.compile(pattern);
			final Matcher matcher = compilerPattern.matcher(name);
			if (matcher.find()) {
				return true;
			}
		}
		return false;
	}
116716
public void doMatch() {
    boolean matchFound = false;
    for (ConsumablePattern<T> pattern : patterns) {
      if (pattern.matches(value)) {
        pattern.consume(value);
        matchFound = true;
        break;
      }
    }

    if (!matchFound) {
      throw new MatchException("No match found for " + value);
    }
  }
658333
boolean contains(DatanodeDescriptor node) {
    if (node==null) {
      return false;
    }
      
    String host = node.getHost();
    hostmapLock.readLock().lock();
    try {
      DatanodeDescriptor[] nodes = map.get(host);
      if (nodes != null) {
        for(DatanodeDescriptor containedNode:nodes) {
          if (node==containedNode) {
            return true;
          }
        }
      }
    } finally {
      hostmapLock.readLock().unlock();
    }
    return false;
  }
1369491
public static boolean matches(Collection<PathPattern> patterns, List<String> path) {
		for (PathPattern pattern : patterns)
			if (pattern.matches(path))
				return true;
		return false;
	}
361963
protected boolean nodeMatches(Node node, Class<? extends Node> cls, String uri) {
        if (node.getClass() == cls) {
            return uri == null || NodeUtil.isOriginalURI(node, uri);
        }

        return false;
    }
1141148
public boolean containsValue(Object value) {
        Node<K,V>[] tab; V v;
        if ((tab = table) != null && size > 0) {
            for (int i = 0; i < tab.length; ++i) {
                for (Node<K,V> e = tab[i]; e != null; e = e.next) {
                    if ((v = e.value) == value ||
                        (value != null && value.equals(v)))
                        return true;
                }
            }
        }
        return false;
    }
872035
public PExp caseABooleanPattern(ABooleanPattern node)
			throws AnalysisException
	{
		ABooleanConstExp b = new ABooleanConstExp();
		b.setValue(node.getValue().clone());
		addPossibleType(b, node);
		return b;
	}
968472
private static int isAlwaysDefinedBoolean(Node node) {
        switch (node.getType()) {
          case Token.FALSE:
          case Token.NULL:
            return ALWAYS_FALSE_BOOLEAN;
          case Token.TRUE:
            return ALWAYS_TRUE_BOOLEAN;
          case Token.NUMBER: {
            double num = node.getDouble();
            if (num == num && num != 0.0) {
                return ALWAYS_TRUE_BOOLEAN;
            }
            return ALWAYS_FALSE_BOOLEAN;
          }
        }
        return 0;
    }
733702
protected boolean accept(Node node)
   {
      try
      {
         return status == UserStatus.ANY || status.matches(node.canAddMixin(JCROrganizationServiceImpl.JOS_DISABLED));
      }
      catch (RepositoryException e)
      {
         if (LOG.isDebugEnabled())
         {
            String path = "unknown";
            try
            {
               path = node.getPath();
            }
            catch (RepositoryException e1)
            {
               LOG.debug("Could not get the node of the node: " + node, e1);
            }
            LOG.debug("Could not know if the mixin type " + JCROrganizationServiceImpl.JOS_DISABLED
               + " has been added to the node " + path, e);
         }
         return true;
      }
   }
1127695
public static boolean hasVetoableAnnotation(AnnotatedNode node) {
        for (AnnotationNode annotation : node.getAnnotations()) {
            if (constrainedClassNode.equals(annotation.getClassNode())) {
                return true;
            }
        }
        return false;
    }
1027596
public boolean contains(Node node) {
    if (node == null) return false;
    netlock.readLock().lock();
    try {
      Node parent = node.getParent();
      for(int level=node.getLevel(); parent!=null&&level>0;
          parent=parent.getParent(), level--) {
        if (parent == clusterMap)
          return true;
      }
    } finally {
      netlock.readLock().unlock();
    }
    return false; 
  }
1031721
public boolean match(String value) {
    value = StringUtils.removeStart(value, "/");
    value = StringUtils.removeEnd(value, "/");
    return pattern.matcher(value).matches();
  }
1072476
public ResultMatcher matches(final Matcher<?> matcher) {
        return new AbstractResultMatcher(path, configuration) {
            public void doMatch(Object actual) {
                isPresent(actual);
                Node node = getNode(actual);
                assertThat("Node \"" + path + "\" does not match.", node.getValue(), (Matcher<? super Object>) matcher);
            }
        };

    }
997105
public static boolean isWildcardLeftHandSide(final ClassNode node) {
        if (OBJECT_TYPE.equals(node) ||
                STRING_TYPE.equals(node) ||
                boolean_TYPE.equals(node) ||
                Boolean_TYPE.equals(node) ||
                CLASS_Type.equals(node)) {
            return true;
        }
        return false;
    }