public static class PurityChecker.PurityResult extends Object
PurityChecker
. Can be queried regarding whether a given tree was
side-effect-free, deterministic, or both; also gives reasons if the answer is "no".Modifier and Type | Field and Description |
---|---|
protected List<Pair<Tree,String>> |
notBothReasons |
protected List<Pair<Tree,String>> |
notDetReasons |
protected List<Pair<Tree,String>> |
notSEFreeReasons |
protected EnumSet<Pure.Kind> |
types
Contains all the varieties of purity that the expression has.
|
Constructor and Description |
---|
PurityResult() |
Modifier and Type | Method and Description |
---|---|
void |
addNotBothReason(Tree t,
String msgId)
Add
reason as a reason why the method is not both side-effect free and
deterministic. |
void |
addNotDetReason(Tree t,
String msgId)
Add
reason as a reason why the method is not deterministic. |
void |
addNotSEFreeReason(Tree t,
String msgId)
Add
reason as a reason why the method is not side-effect free. |
List<Pair<Tree,String>> |
getNotBothReasons()
Get the
reason s why the method is not both side-effect-free and deterministic. |
List<Pair<Tree,String>> |
getNotDetReasons()
Get the
reason s why the method is not deterministic. |
List<Pair<Tree,String>> |
getNotSEFreeReasons()
Get the
reason s why the method is not side-effect-free. |
EnumSet<Pure.Kind> |
getTypes() |
boolean |
isPure(Collection<Pure.Kind> kinds)
Is the method pure w.r.t.
|
public boolean isPure(Collection<Pure.Kind> kinds)
kinds
- the varieties of purity to checkpublic List<Pair<Tree,String>> getNotSEFreeReasons()
reason
s why the method is not side-effect-free.public void addNotSEFreeReason(Tree t, String msgId)
reason
as a reason why the method is not side-effect free.public List<Pair<Tree,String>> getNotDetReasons()
reason
s why the method is not deterministic.public void addNotDetReason(Tree t, String msgId)
reason
as a reason why the method is not deterministic.public List<Pair<Tree,String>> getNotBothReasons()
reason
s why the method is not both side-effect-free and deterministic.