org.opensaml.xml.util
Class LazyMap<KeyType,ValueType>

java.lang.Object
  extended by org.opensaml.xml.util.LazyMap<KeyType,ValueType>
Type Parameters:
KeyType - the type of the map keys
ValueType - the type of the map values
All Implemented Interfaces:
java.io.Serializable, java.util.Map<KeyType,ValueType>

@NotThreadSafe
public class LazyMap<KeyType,ValueType>
extends java.lang.Object
implements java.util.Map<KeyType,ValueType>, java.io.Serializable

A map that is lazy initialized. This map takes very little memory when storing zero or one item.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
java.util.Map.Entry<K,V>
 
Constructor Summary
LazyMap()
           
 
Method Summary
protected  java.util.Map<KeyType,ValueType> buildMap()
          Builds an appropriate delegate map.
 void clear()
          
 boolean containsKey(java.lang.Object key)
          
 boolean containsValue(java.lang.Object value)
          
 java.util.Set<java.util.Map.Entry<KeyType,ValueType>> entrySet()
          
 boolean equals(java.lang.Object obj)
          
 ValueType get(java.lang.Object key)
          
 int hashCode()
          
 boolean isEmpty()
          
 java.util.Set<KeyType> keySet()
          
 ValueType put(KeyType key, ValueType value)
          
 void putAll(java.util.Map<? extends KeyType,? extends ValueType> t)
          
 ValueType remove(java.lang.Object key)
          
 int size()
          
 java.lang.String toString()
          
 java.util.Collection<ValueType> values()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LazyMap

public LazyMap()
Method Detail

clear

public void clear()

Specified by:
clear in interface java.util.Map<KeyType,ValueType>

containsKey

public boolean containsKey(java.lang.Object key)

Specified by:
containsKey in interface java.util.Map<KeyType,ValueType>

containsValue

public boolean containsValue(java.lang.Object value)

Specified by:
containsValue in interface java.util.Map<KeyType,ValueType>

entrySet

public java.util.Set<java.util.Map.Entry<KeyType,ValueType>> entrySet()

Specified by:
entrySet in interface java.util.Map<KeyType,ValueType>

get

public ValueType get(java.lang.Object key)

Specified by:
get in interface java.util.Map<KeyType,ValueType>

isEmpty

public boolean isEmpty()

Specified by:
isEmpty in interface java.util.Map<KeyType,ValueType>

keySet

public java.util.Set<KeyType> keySet()

Specified by:
keySet in interface java.util.Map<KeyType,ValueType>

put

public ValueType put(KeyType key,
                     ValueType value)

Specified by:
put in interface java.util.Map<KeyType,ValueType>

putAll

public void putAll(java.util.Map<? extends KeyType,? extends ValueType> t)

Specified by:
putAll in interface java.util.Map<KeyType,ValueType>

remove

public ValueType remove(java.lang.Object key)

Specified by:
remove in interface java.util.Map<KeyType,ValueType>

size

public int size()

Specified by:
size in interface java.util.Map<KeyType,ValueType>

values

public java.util.Collection<ValueType> values()

Specified by:
values in interface java.util.Map<KeyType,ValueType>

buildMap

protected java.util.Map<KeyType,ValueType> buildMap()
Builds an appropriate delegate map.

Returns:
the delegate map

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object

hashCode

public int hashCode()

Specified by:
hashCode in interface java.util.Map<KeyType,ValueType>
Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)

Specified by:
equals in interface java.util.Map<KeyType,ValueType>
Overrides:
equals in class java.lang.Object


Copyright © 2006-2012 Internet2. All Rights Reserved.