Build 1.0_r1(from source)

java.lang
Class SystemEnvironment

java.lang.Object
  extended by java.lang.SystemEnvironment
All Implemented Interfaces:
Map

 class SystemEnvironment
extends Object
implements Map

Internal class holding the System environment variables. The Java spec mandates that this map be read-only, so we wrap our real map into this one and make sure no one touches the contents. We also check for null parameters and do some (seemingly unnecessary) type casts to fulfill the contract layed out in the spec.


Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
SystemEnvironment(Map<String,String> map)
           
 
Method Summary
 void clear()
          Removes all elements from this Map, leaving it empty.
 boolean containsKey(Object key)
          Searches this Map for the specified key.
 boolean containsValue(Object value)
          Searches this Map for the specified value.
 Set entrySet()
          Returns a Set whose elements comprise all of the mappings that are to be found in this Map.
 String get(Object key)
          Returns the value of the mapping with the specified key.
 boolean isEmpty()
          Returns if this Map has no elements, a size of zero.
 Set<String> keySet()
          Returns a Set of the keys contained in this Map.
 String put(Object key, Object value)
          Maps the specified key to the specified value.
 void putAll(Map map)
          Copies every mapping in the specified Map to this Map.
 String remove(Object key)
          Removes a mapping with the specified key from this Map.
 int size()
          Returns the number of elements in this Map.
 Collection values()
          Returns all of the current Map values in a Collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

SystemEnvironment

public SystemEnvironment(Map<String,String> map)
Method Detail

clear

public void clear()
Description copied from interface: Map
Removes all elements from this Map, leaving it empty.

Specified by:
clear in interface Map
See Also:
Map.isEmpty(), Map.size()

containsKey

public boolean containsKey(Object key)
Description copied from interface: Map
Searches this Map for the specified key.

Specified by:
containsKey in interface Map
Parameters:
key - the object to search for
Returns:
true if key is a key of this Map, false otherwise

containsValue

public boolean containsValue(Object value)
Description copied from interface: Map
Searches this Map for the specified value.

Specified by:
containsValue in interface Map
Parameters:
value - the object to search for
Returns:
true if value is a value of this Map, false otherwise

entrySet

public Set entrySet()
Description copied from interface: Map
Returns a Set whose elements comprise all of the mappings that are to be found in this Map. Information on each of the mappings is encapsulated in a separate Map.Entry instance. As the Set is backed by this Map, users should be aware that changes in one will be immediately visible in the other.

Specified by:
entrySet in interface Map
Returns:
a Set of the mappings

get

public String get(Object key)
Description copied from interface: Map
Returns the value of the mapping with the specified key.

Specified by:
get in interface Map
Parameters:
key - the key
Returns:
the value of the mapping with the specified key

isEmpty

public boolean isEmpty()
Description copied from interface: Map
Returns if this Map has no elements, a size of zero.

Specified by:
isEmpty in interface Map
Returns:
true if this Map has no elements, false otherwise
See Also:
Map.size()

keySet

public Set<String> keySet()
Description copied from interface: Map
Returns a Set of the keys contained in this Map. The set is backed by this Map so changes to one are relected by the other. The set does not support adding.

Specified by:
keySet in interface Map
Returns:
a Set of the keys

put

public String put(Object key,
                  Object value)
Description copied from interface: Map
Maps the specified key to the specified value.

Specified by:
put in interface Map
Parameters:
key - the key
value - the value
Returns:
the value of any previous mapping with the specified key or null if there was no mapping

putAll

public void putAll(Map map)
Description copied from interface: Map
Copies every mapping in the specified Map to this Map.

Specified by:
putAll in interface Map
Parameters:
map - the Map to copy mappings from

remove

public String remove(Object key)
Description copied from interface: Map
Removes a mapping with the specified key from this Map.

Specified by:
remove in interface Map
Parameters:
key - the key of the mapping to remove
Returns:
the value of the removed mapping or null if key is not a key in this Map

size

public int size()
Description copied from interface: Map
Returns the number of elements in this Map.

Specified by:
size in interface Map
Returns:
the number of elements in this Map

values

public Collection values()
Description copied from interface: Map
Returns all of the current Map values in a Collection. As the returned Collection is backed by this Map, users should be aware that changes in one will be immediately visible in the other.

Specified by:
values in interface Map
Returns:
a Collection of the values

Build 1.0_r1(from source)

Please submit a feedback, bug or feature