net.sourceforge.jaulp.collections
Class DefaultKeySetMap<K,V>

java.lang.Object
  extended by net.sourceforge.jaulp.collections.DefaultKeySetMap<K,V>
All Implemented Interfaces:
KeySetMap<K,V>

public class DefaultKeySetMap<K,V>
extends java.lang.Object
implements KeySetMap<K,V>

The Class DefaultKeySetMap is the default implematation from the inteface KeySetMap. It wrappes a Map with a key and values. The values are Sets. So you can put in one key more unique values.


Constructor Summary
DefaultKeySetMap()
           
 
Method Summary
 void add(K key, V value)
          Adds the value in the Set from the key.
 void add(java.util.Map<? extends K,? extends java.util.Set<V>> keyListMap)
          Adds a Map to the main Map.
 boolean containsKey(K key)
          Contains key.
 java.util.Set<V> get(K key)
          Gets the Set with the values from the given key.
 java.util.Set<K> getKeys()
          Gets the keys.
 int getSize()
          Gets the size.
 boolean isEmpty()
          Checks if is empty.
 java.util.Set<V> remove(K key)
          Removes the Set from the given key.
 void removeAll(java.util.Collection<K> keys)
          Removes all keys from the Map from the given Collection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultKeySetMap

public DefaultKeySetMap()
Method Detail

add

public void add(K key,
                V value)
Adds the value in the Set from the key.

Specified by:
add in interface KeySetMap<K,V>
Parameters:
key - the key
value - the value
See Also:
KeySetMap.add(Object, Object)

add

public void add(java.util.Map<? extends K,? extends java.util.Set<V>> keyListMap)
Adds a Map to the main Map.

Specified by:
add in interface KeySetMap<K,V>
Parameters:
keyListMap - the key list map
See Also:
KeySetMap.add(java.util.Map)

containsKey

public boolean containsKey(K key)
Contains key.

Specified by:
containsKey in interface KeySetMap<K,V>
Parameters:
key - the key
Returns:
true, if successful
See Also:
KeySetMap.containsKey(Object)

get

public java.util.Set<V> get(K key)
Gets the Set with the values from the given key.

Specified by:
get in interface KeySetMap<K,V>
Parameters:
key - the key
Returns:
the set< v>
See Also:
KeySetMap.get(Object)

getKeys

public java.util.Set<K> getKeys()
Gets the keys.

Specified by:
getKeys in interface KeySetMap<K,V>
Returns:
the keys
See Also:
KeySetMap.getKeys()

getSize

public int getSize()
Gets the size.

Specified by:
getSize in interface KeySetMap<K,V>
Returns:
the size
See Also:
KeySetMap.getSize()

isEmpty

public boolean isEmpty()
Checks if is empty.

Specified by:
isEmpty in interface KeySetMap<K,V>
Returns:
true, if is empty
See Also:
KeySetMap.isEmpty()

remove

public java.util.Set<V> remove(K key)
Removes the Set from the given key.

Specified by:
remove in interface KeySetMap<K,V>
Parameters:
key - the key
Returns:
the set< v>
See Also:
KeySetMap.remove(Object)

removeAll

public void removeAll(java.util.Collection<K> keys)
Removes all keys from the Map from the given Collection.

Specified by:
removeAll in interface KeySetMap<K,V>
Parameters:
keys - the keys
See Also:
KeySetMap.removeAll(java.util.Collection)


Copyright © 2010. All Rights Reserved.