summaryrefslogtreecommitdiff
path: root/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/NotPredicate.java
diff options
context:
space:
mode:
authorTor Norbye <tnorbye@google.com>2014-07-25 13:10:36 -0700
committerTor Norbye <tnorbye@google.com>2014-07-25 13:10:36 -0700
commite5266e2343c8d275d79fa0be725180d0fe3a993c (patch)
tree0ba72f5de1949e0527874a799baa224cbe1537e0 /platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/NotPredicate.java
parentb03a5855292feb8c331815f883fe64372aacd872 (diff)
parent2e5965e996aad62ab1338b09d54caaf99ff3dd6a (diff)
downloadidea-e5266e2343c8d275d79fa0be725180d0fe3a993c.tar.gz
Merge remote-tracking branch 'aosp/upstream-master' into merge
Conflicts: .idea/modules.xml Change-Id: I5e3d04bc83cdc26b2b56fca66b44b1dd8941b143
Diffstat (limited to 'platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/NotPredicate.java')
-rw-r--r--platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/NotPredicate.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/NotPredicate.java b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/NotPredicate.java
new file mode 100644
index 000000000000..3d28a635e3af
--- /dev/null
+++ b/platform/structuralsearch/source/com/intellij/structuralsearch/impl/matcher/predicates/NotPredicate.java
@@ -0,0 +1,24 @@
+package com.intellij.structuralsearch.impl.matcher.predicates;
+
+import com.intellij.psi.PsiElement;
+import com.intellij.structuralsearch.impl.matcher.MatchContext;
+import com.intellij.structuralsearch.impl.matcher.handlers.MatchPredicate;
+
+/**
+ * Negates predicate
+ */
+public final class NotPredicate extends MatchPredicate {
+ private final MatchPredicate handler;
+
+ public NotPredicate(final MatchPredicate _handler) {
+ handler = _handler;
+ }
+
+ public boolean match(PsiElement patternNode, PsiElement matchedNode, MatchContext context) {
+ return !handler.match(patternNode,matchedNode,context);
+ }
+
+ public MatchPredicate getHandler() {
+ return handler;
+ }
+}