public static class PurityChecker.PurityResult
extends java.lang.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 java.util.List<Pair<com.sun.source.tree.Tree,java.lang.String>> |
notBothReasons |
protected java.util.List<Pair<com.sun.source.tree.Tree,java.lang.String>> |
notDetReasons |
protected java.util.List<Pair<com.sun.source.tree.Tree,java.lang.String>> |
notSEFreeReasons |
protected java.util.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(com.sun.source.tree.Tree t,
java.lang.String msgId)
Add
reason as a reason why the method is not both side-effect free and
deterministic. |
void |
addNotDetReason(com.sun.source.tree.Tree t,
java.lang.String msgId)
Add
reason as a reason why the method is not deterministic. |
void |
addNotSEFreeReason(com.sun.source.tree.Tree t,
java.lang.String msgId)
Add
reason as a reason why the method is not side-effect free. |
java.util.List<Pair<com.sun.source.tree.Tree,java.lang.String>> |
getNotBothReasons()
Get the
reason s why the method is not both side-effect-free and deterministic. |
java.util.List<Pair<com.sun.source.tree.Tree,java.lang.String>> |
getNotDetReasons()
Get the
reason s why the method is not deterministic. |
java.util.List<Pair<com.sun.source.tree.Tree,java.lang.String>> |
getNotSEFreeReasons()
Get the
reason s why the method is not side-effect-free. |
java.util.EnumSet<Pure.Kind> |
getTypes() |
boolean |
isPure(java.util.Collection<Pure.Kind> kinds)
Is the method pure w.r.t.
|
protected final java.util.List<Pair<com.sun.source.tree.Tree,java.lang.String>> notSEFreeReasons
protected final java.util.List<Pair<com.sun.source.tree.Tree,java.lang.String>> notDetReasons
protected final java.util.List<Pair<com.sun.source.tree.Tree,java.lang.String>> notBothReasons
protected java.util.EnumSet<Pure.Kind> types
public java.util.EnumSet<Pure.Kind> getTypes()
public boolean isPure(java.util.Collection<Pure.Kind> kinds)
kinds
- the varieties of purity to checkpublic java.util.List<Pair<com.sun.source.tree.Tree,java.lang.String>> getNotSEFreeReasons()
reason
s why the method is not side-effect-free.public void addNotSEFreeReason(com.sun.source.tree.Tree t, java.lang.String msgId)
reason
as a reason why the method is not side-effect free.public java.util.List<Pair<com.sun.source.tree.Tree,java.lang.String>> getNotDetReasons()
reason
s why the method is not deterministic.public void addNotDetReason(com.sun.source.tree.Tree t, java.lang.String msgId)
reason
as a reason why the method is not deterministic.public java.util.List<Pair<com.sun.source.tree.Tree,java.lang.String>> getNotBothReasons()
reason
s why the method is not both side-effect-free and deterministic.public void addNotBothReason(com.sun.source.tree.Tree t, java.lang.String msgId)
reason
as a reason why the method is not both side-effect free and
deterministic.