Class Bindings
java.lang.Object
com.google.errorprone.refaster.Bindings
A type-safe binding environment mapping
Bindings.Key<V> keys to values of type V.
Bindings are represented as a persistent linked chain. Adding a binding creates a new Bindings.Node pointing to the current head as its parent, and lookups traverse parent references towards
the root, naturally shadowing earlier bindings for the same key. Forking a Bindings
instance shares the underlying node chain with zero entry copying.
- Author:
- Louis Wasserman
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptioncom.google.common.collect.ImmutableMap<Bindings.Key<?>, Object> asMap()voidclearBinding(Bindings.Key<?> key) booleancontainsKey(Bindings.Key<?> key) static Bindingscreate()static BindingsvoidforEach(BiConsumer<? super Bindings.Key<?>, Object> action) <V> @Nullable VgetBinding(Bindings.Key<V> key) booleanhasBindingForLocalVar(@Nullable com.sun.tools.javac.code.Symbol symbol) booleanhasFreeIdentMatching(Predicate<com.sun.tools.javac.tree.JCTree.JCExpression> predicate) booleanisEmpty()<V> VputBinding(Bindings.Key<V> key, V value) toString()
-
Method Details
-
create
-
create
-
isEmpty
public boolean isEmpty() -
containsKey
-
getBinding
-
putBinding
-
clearBinding
-
forEach
-
hasBindingForLocalVar
public boolean hasBindingForLocalVar(@Nullable com.sun.tools.javac.code.Symbol symbol) -
hasFreeIdentMatching
public boolean hasFreeIdentMatching(Predicate<com.sun.tools.javac.tree.JCTree.JCExpression> predicate) -
asMap
-
toString
-