2 * Copyright 2000-2009 JetBrains s.r.o.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
16 package com
.intellij
.codeInsight
.guess
.impl
;
18 import com
.intellij
.codeInspection
.dataFlow
.value
.DfaValue
;
19 import com
.intellij
.codeInspection
.dataFlow
.value
.DfaValueFactory
;
20 import com
.intellij
.psi
.PsiExpression
;
21 import com
.intellij
.psi
.PsiType
;
22 import org
.jetbrains
.annotations
.NotNull
;
23 import org
.jetbrains
.annotations
.Nullable
;
28 public class DfaInstanceofValue
extends DfaValue
{
29 private final PsiExpression myExpression
;
30 private final PsiType myCastType
;
31 private final boolean myNegated
;
33 public DfaInstanceofValue(DfaValueFactory factory
, PsiExpression expression
, PsiType castType
) {
34 this(factory
, expression
, castType
, false);
37 public DfaInstanceofValue(DfaValueFactory factory
, PsiExpression expression
, PsiType castType
, boolean negated
) {
39 myExpression
= expression
;
40 myCastType
= castType
;
45 public PsiExpression
getExpression() {
50 public PsiType
getCastType() {
54 public boolean isNegated() {
59 public DfaValue
createNegated() {
60 return new DfaInstanceofValue(myFactory
, myExpression
, myCastType
, !myNegated
);