Class HashVarMapping

  • All Implemented Interfaces:
    VarMapping

    public class HashVarMapping
    extends Object
    implements VarMapping
    Imuutable var mapping hashed by sym handles.
    • Field Detail

      • EMPTY

        public static final HashVarMapping EMPTY
        The final var mapping.
    • Method Detail

      • of

        public static HashVarMapping of​(Map<Integer,​Val> mapping)
        Makes a var mapping from the map.
        Parameters:
        mapping - the mapping from sym handles to vals.
        Returns:
        a new var mapping.
      • get

        @Nullable
        public Val get​(int symHandle)
        Description copied from interface: VarMapping
        Gets the target of the var, or null if absent.
        Specified by:
        get in interface VarMapping
        Parameters:
        symHandle - the sym handle of the var.
        Returns:
        the target of the var, or null if absent.
      • has

        public boolean has​(int symHandle)
        Description copied from interface: VarMapping
        Returns true if the var mapping has the var, otherwise false.
        Specified by:
        has in interface VarMapping
        Parameters:
        symHandle - the sym handle of the var.
        Returns:
        true if the var mapping has the var, otherwise false.
      • symHandleSet

        public Set<Integer> symHandleSet()
        Description copied from interface: VarMapping
        Returns the set of the sym handles of the vars in this var mapping.
        Specified by:
        symHandleSet in interface VarMapping
        Returns:
        the set of the sym handles of the vars in this var mapping.