net.java.properties
Interface MapPropertyI<K,V>

All Known Implementing Classes:
MapProperty

public interface MapPropertyI<K,V>

A property that holds a value that is a Map. The interface denotes how to access the keys and values of that map.

It is not defined if the collection itself can be null or if the elements can be null.


Method Summary
 boolean containsKey(K key)
          Returns if key is in this map.
 boolean containsValue(V value)
          Returns if value is in this map.
 V get(K key)
          Returns the value the the key points to.
 java.util.Iterator<java.util.Map.Entry<K,V>> iterator()
          Returns an iterator that iterates over this property's entries.
 java.util.Set<K> keySet()
          Returns an, always unmodifiable, key set direct from the backing Map.
 Result<java.util.Map.Entry<K,V>> put(K key, V value)
          Associates the value with the key.
 ResultList<java.util.Map.Entry<K,V>> putAll(java.util.Map<? extends K,? extends V> elements)
          Adds a whole map to this one.
 Result<java.util.Map.Entry<K,V>> remove(K key)
          Removes the value that the key points to.
 ResultList<java.util.Map.Entry<K,V>> removeAll()
          Removes all elements in this property by iterating and removing.
 int size()
          Returns the number of elements in this property.
 java.util.Collection<V> values()
          Returns the values from the backing Map as an unmidifiable collection.
 

Method Detail

get

V get(K key)
Returns the value the the key points to.

Parameters:
key - The key.
Returns:
The value that the key points to.

put

Result<java.util.Map.Entry<K,V>> put(K key,
                                     V value)
Associates the value with the key.

Parameters:
key - The key.
value - The value.
Returns:
The result of the put operation. Never null.

putAll

ResultList<java.util.Map.Entry<K,V>> putAll(java.util.Map<? extends K,? extends V> elements)
Adds a whole map to this one.

This method iterates over the collection and adds with put(Object, Object)

Parameters:
elements - The collection which elements to add. Not null.
Returns:
All the results for the add. Never null.

remove

Result<java.util.Map.Entry<K,V>> remove(K key)
Removes the value that the key points to. Will throw a NullPointerException if the collection is null.

Parameters:
key - The key.
Returns:
The result for the remove. Never null.

removeAll

ResultList<java.util.Map.Entry<K,V>> removeAll()
Removes all elements in this property by iterating and removing.

Returns:
The results for all the removes. Never null.

keySet

java.util.Set<K> keySet()
Returns an, always unmodifiable, key set direct from the backing Map.

Returns:
The key set direct from the backing Map. Never null.

values

java.util.Collection<V> values()
Returns the values from the backing Map as an unmidifiable collection.

Returns:
The values from the backing Map as an unmidifiable collection. Never null.

containsKey

boolean containsKey(K key)
Returns if key is in this map. Will throw a NullPointerException if the collection is null.

Parameters:
key - The value to check for. May be null.
Returns:
If key is in this map.

containsValue

boolean containsValue(V value)
Returns if value is in this map. Will throw a NullPointerException if the collection is null.

Parameters:
value - The value to check for. May be null.
Returns:
If value is in this map.

iterator

java.util.Iterator<java.util.Map.Entry<K,V>> iterator()
Returns an iterator that iterates over this property's entries. Will throw a NullPointerException if the map is null.

Returns:
An iterator that iterates over this property's entries. Never null.

size

int size()
Returns the number of elements in this property. Will throw a NullPointerException if the map is null.

Returns:
The number of elements in this property.


Copyright © 2007 MiG InfoCom AB. All Rights Reserved.