Class RebindingMap


  • public class RebindingMap
    extends Object
    A map from old bindings to new bindings, maintained during a copy() operation applied to an expression tree. When local variable bindings are copied, the mapping from old to new binding can be added to the list; when local variable references are encountered, the binding can be switched from the old binding to the new. Bindings are compared strictly using object identity. Some classes that implement the Binding interface have their own equals() method that could return true for two bindings that need to be treated as distinct.
    • Constructor Detail

      • RebindingMap

        public RebindingMap()
    • Method Detail

      • put

        public void put​(Binding oldBinding,
                        Binding newBinding)
        Add an entry to the binding map
        Parameters:
        oldBinding - the existing binding
        newBinding - the replacement binding
      • get

        public Binding get​(Binding oldBinding)
        Get the new binding corresponding to an existing binding if there is one
        Parameters:
        oldBinding - the existing binding
        Returns:
        the new binding if one exists, or null otherwise