JavaScript is disabled on your browser.
Skip navigation links
gnu.mapping

Class Environment

  • All Implemented Interfaces:
    Named
    Direct Known Subclasses:
    BuiltinEnvironment, SimpleEnvironment


    public abstract class Environment
    extends PropertySet 
    A mapping from EnvironmentKey to Locations. An EnvironmentKey is either a Symbol or a (Symbol, property)-pair.
    • Field Detail

      • INDIRECT_DEFINES

        public static final int INDIRECT_DEFINES
        Newly defined locations are created in inherited parent environment.
        See Also:
        Constant Field Values
      • curEnvironment

        protected static final gnu.mapping.Environment.InheritedLocal curEnvironment
    • Constructor Detail

      • Environment

        public Environment()
    • Method Detail

      • setGlobal

        public static void setGlobal(Environment env)
      • getFlags

        public int getFlags()
      • setFlag

        public void setFlag(boolean setting,
         int flag)
      • getCanDefine

        public boolean getCanDefine()
        True if new bindings (non-unbound Locations) can be added.
      • setCanDefine

        public void setCanDefine(boolean canDefine)
      • getCanRedefine

        public boolean getCanRedefine()
        True if bindings can be removed or replaced by other kinds of Location.
      • setCanRedefine

        public void setCanRedefine(boolean canRedefine)
      • isLocked

        public final boolean isLocked()
        True if this environment is locked - bindings cannot be added or removed.
      • setLocked

        public void setLocked()
      • setIndirectDefines

        public final void setIndirectDefines()
      • getLocation

        public final Location getLocation(Symbol key,
         java.lang.Object property)
        Return a location bound to (key, property). Create new unbound Location if no such Location exists.
      • getLocation

        public final Location getLocation(Symbol key)
        Return a location bound to key (and null property). Create new unbound Location if no such Location exists.
      • lookup

        public final Location lookup(Symbol key,
         java.lang.Object property)
        Return a location bound to (key, property). Return null if no such Location exists.
      • lookup

        public abstract NamedLocation lookup(Symbol name,
         java.lang.Object property,
         int hash)
      • getLocation

        public abstract NamedLocation getLocation(Symbol key,
         java.lang.Object property,
         int hash,
         boolean create)
      • getLocation

        public final NamedLocation getLocation(Symbol name,
         java.lang.Object property,
         boolean create)
      • getLocation

        public final Location getLocation(java.lang.Object key,
         boolean create)
      • isBound

        public boolean isBound(Symbol key,
         java.lang.Object property)
      • isBound

        public final boolean isBound(Symbol key)
      • containsKey

        public final boolean containsKey(java.lang.Object key)
      • getChecked

        public final java.lang.Object getChecked(java.lang.String name)
        Get the value bound to the given name.
        Throws:
        UnboundLocationException - the name has no binding
        See Also:
        get(Object)
      • get

        public java.lang.Object get(Symbol key,
         java.lang.Object property,
         java.lang.Object defaultValue)
      • get

        public final java.lang.Object get(EnvironmentKey key,
         java.lang.Object defaultValue)
      • get

        public final java.lang.Object get(java.lang.String key,
         java.lang.Object defaultValue)
      • get

        public java.lang.Object get(Symbol sym)
      • getFunction

        public final java.lang.Object getFunction(Symbol key,
         java.lang.Object defaultValue)
      • getFunction

        public final java.lang.Object getFunction(Symbol sym)
      • get

        public final java.lang.Object get(java.lang.Object key)
        Get the value bound to the given name. Returns null if the name has no binding (for compatibility with Java2 Collections framework).
        See Also:
        getChecked(String)
      • put

        public void put(Symbol key,
         java.lang.Object property,
         java.lang.Object newValue)
      • define

        public abstract void define(Symbol key,
         java.lang.Object property,
         java.lang.Object newValue)
      • put

        public final void put(Symbol key,
         java.lang.Object newValue)
      • put

        public final java.lang.Object put(java.lang.Object key,
         java.lang.Object newValue)
      • putFunction

        public final void putFunction(Symbol key,
         java.lang.Object newValue)
      • put

        public final java.lang.Object put(java.lang.String key,
         java.lang.Object value)
      • unlink

        public Location unlink(Symbol key,
         java.lang.Object property,
         int hash)
        Remove Location from this Environment. Does not explicitly undefine the location itself.
      • remove

        public java.lang.Object remove(Symbol key,
         java.lang.Object property,
         int hash)
        Remove Location from this Environment and undefine it.
      • remove

        public final java.lang.Object remove(EnvironmentKey key)
        Remove and undefine binding.
        Returns:
        Old value
      • remove

        public final java.lang.Object remove(Symbol symbol,
         java.lang.Object property)
      • remove

        public final void remove(Symbol sym)
      • removeFunction

        public final void removeFunction(Symbol sym)
      • remove

        public final java.lang.Object remove(java.lang.Object key)
      • defaultNamespace

        public Namespace defaultNamespace()
      • getSymbol

        public Symbol getSymbol(java.lang.String name)
      • getInstance

        public static Environment getInstance(java.lang.String name)
      • enumerateLocations

        public abstract LocationEnumeration enumerateLocations()
        Does not enumerate inherited Locations.
      • enumerateAllLocations

        public abstract LocationEnumeration enumerateAllLocations()
        Does enumerate inherited Locations.
      • current

        @Deprecated
        public static Environment current()
        Deprecated.
      • setCurrent

        public static void setCurrent(Environment env)
      • restoreCurrent

        public static void restoreCurrent(Environment saved)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • toStringVerbose

        public java.lang.String toStringVerbose()
        Overridden in sub-classes - useful for more verbose debug output.
Skip navigation links

AltStyle によって変換されたページ (->オリジナル) /