Class Resolver.Level<V extends IResolvable>

  • Type Parameters:
    V - the type of variable declarations
    Enclosing class:
    Resolver<V extends IResolvable>

    private static class Resolver.Level<V extends IResolvable>
    extends java.lang.Object
    Represents a (nested) resolution level.
    Author:
    Holger Eichelberger
    • Constructor Summary

      Constructors 
      Constructor Description
      Level​(Resolver.IContextType context)
      Creates a new level with a given context type.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean contains​(java.lang.String name)
      Returns whether this level contains a variable with the given name.
      V get​(java.lang.String name)
      Returns the variable for a given name.
      Resolver.IContextType getContextType()
      Returns the current context.
      boolean isLimited()
      Returns whether this scope is limited.
      void limitVariables()
      Indicates that subsequent resolutions within that scope shall not exceed this scope.
      void put​(java.lang.String name, V var)
      Puts a variable.
      void remove​(java.lang.String name)
      Removes a variable.
      void setContextType​(Resolver.IContextType context)
      Defines the current context.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Level

        public Level​(Resolver.IContextType context)
        Creates a new level with a given context type.
        Parameters:
        context - the context type
    • Method Detail

      • put

        public void put​(java.lang.String name,
                        V var)
        Puts a variable.
        Parameters:
        name - the name of the variable
        var - the variable (resolvable)
      • remove

        public void remove​(java.lang.String name)
        Removes a variable.
        Parameters:
        name - the name of the variable
      • contains

        public boolean contains​(java.lang.String name)
        Returns whether this level contains a variable with the given name.
        Parameters:
        name - the name to search for
        Returns:
        true if the variable is registered, false else
      • get

        public V get​(java.lang.String name)
        Returns the variable for a given name.
        Parameters:
        name - the name to return the variable for
        Returns:
        the variable (may be null)
      • setContextType

        public void setContextType​(Resolver.IContextType context)
        Defines the current context.
        Parameters:
        context - the current context
      • getContextType

        public Resolver.IContextType getContextType()
        Returns the current context.
        Returns:
        the current context
      • limitVariables

        public void limitVariables()
        Indicates that subsequent resolutions within that scope shall not exceed this scope.
      • isLimited

        public boolean isLimited()
        Returns whether this scope is limited.
        Returns:
        true if limited, false else
        See Also:
        limitVariables()