Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

javax.ide.extension.spi
Class ScopedMap  view ScopedMap download ScopedMap.java

java.lang.Object
  extended byjava.util.AbstractMap
      extended byjavax.ide.extension.spi.ScopedMap
All Implemented Interfaces:
java.util.Map

public final class ScopedMap
extends java.util.AbstractMap

A map that provides support for scoping.


Nested Class Summary
 
Nested classes inherited from class java.util.AbstractMap
 
Nested classes inherited from class java.util.Map
java.util.Map.Entry
 
Field Summary
private  Stack _mapStack
           
 
Fields inherited from class java.util.AbstractMap
 
Constructor Summary
ScopedMap()
           
 
Method Summary
 void clear()
          Remove all entries from this Map (optional operation).
 void enterScope()
          Enter a new scope level.
 java.util.Set entrySet()
          Returns a set view of the mappings in this Map.
 void exitScope()
          Exit the current scope level.
 java.lang.Object get(java.lang.Object key)
          Returns the value mapped by the given key.
 java.lang.Object put(java.lang.Object key, java.lang.Object value)
          Associates the given key to the given value (optional operation).
 java.lang.Object remove(java.lang.Object key)
          Removes the mapping for this key if present (optional operation).
 
Methods inherited from class java.util.AbstractMap
clone, containsKey, containsValue, equals, hashCode, isEmpty, keySet, putAll, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

_mapStack

private final Stack _mapStack
Constructor Detail

ScopedMap

public ScopedMap()
Method Detail

enterScope

public void enterScope()
Enter a new scope level.


exitScope

public void exitScope()
Exit the current scope level. Name / value pairs that were defined in the current scope will no longer be available.


put

public java.lang.Object put(java.lang.Object key,
                            java.lang.Object value)
Description copied from class: java.util.AbstractMap
Associates the given key to the given value (optional operation). If the map already contains the key, its value is replaced. This implementation simply throws an UnsupportedOperationException. Be aware that in a map that permits null values, a null return does not always imply that the mapping was created.


get

public java.lang.Object get(java.lang.Object key)
Description copied from class: java.util.AbstractMap
Returns the value mapped by the given key. Returns null if there is no mapping. However, in Maps that accept null values, you must rely on containsKey to determine if a mapping exists. This iteration takes linear time, searching entrySet().iterator() of the key. Many implementations override this method.


remove

public java.lang.Object remove(java.lang.Object key)
Description copied from class: java.util.AbstractMap
Removes the mapping for this key if present (optional operation). This implementation iterates over the entrySet searching for a matching key, at which point it calls the iterator's remove method. It returns the result of getValue() on the entry, if found, or null if no entry is found. Note that maps which permit null values may also return null if the key was removed. If the entrySet does not support removal, this will also fail. This is O(n), so many implementations override it for efficiency.


clear

public void clear()
Description copied from class: java.util.AbstractMap
Remove all entries from this Map (optional operation). This default implementation calls entrySet().clear(). NOTE: If the entry set does not permit clearing, then this will fail, too. Subclasses often override this for efficiency. Your implementation of entrySet() should not call AbstractMap.clear unless you want an infinite loop.


entrySet

public java.util.Set entrySet()
Description copied from class: java.util.AbstractMap
Returns a set view of the mappings in this Map. Each element in the set must be an implementation of Map.Entry. The set is backed by the map, so that changes in one show up in the other. Modifications made while an iterator is in progress cause undefined behavior. If the set supports removal, these methods must be valid: Iterator.remove, Set.remove, removeAll, retainAll, and clear. Element addition is not supported via this set.