ch.panter.li.bi.util
Interface ReadOnlyMap<K,V>

All Superinterfaces:
Iterable<V>
All Known Implementing Classes:
ShieldableLinkedMap

public interface ReadOnlyMap<K,V>
extends Iterable<V>

Contract for a map of object indexed by keys of type K and holding values of type V. Iteration will return only the values. No modifying operations on the map are defined by this interface, making it a candidate for passing out readonly references.


Method Summary
 boolean containsKey(K key)
          determines whether the map contains an entry under the given key
 V get(K key)
          gets the object stored under the given key
 boolean isEmpty()
          Determines whether this instance is empty.
 Iterator<K> keyIterator()
          Iterator over the keys in this instance
 K[] keysAsArray(K[] array)
          Returns an array containing all keys of this instance according to the contract defined in java.util.Collection#toArray(T[] a).
 int size()
          Determines the number of items in this instance.
 Iterator<V> valueIterator()
          Iterator over the values in this instance
 V[] valuesAsArray(V[] array)
          Returns an array containing all values of this instance according to the contract defined in java.util.Collection#toArray(T[] a).
 
Methods inherited from interface java.lang.Iterable
iterator
 

Method Detail

containsKey

boolean containsKey(K key)
determines whether the map contains an entry under the given key


get

V get(K key)
gets the object stored under the given key


keyIterator

Iterator<K> keyIterator()
Iterator over the keys in this instance


valueIterator

Iterator<V> valueIterator()
Iterator over the values in this instance


isEmpty

boolean isEmpty()
Determines whether this instance is empty.

Returns:
true if this instance has no items in it, false otherwise.

size

int size()
Determines the number of items in this instance.

Returns:
the number of items in this instance

keysAsArray

K[] keysAsArray(K[] array)
Returns an array containing all keys of this instance according to the contract defined in java.util.Collection#toArray(T[] a).

Parameters:
array - the target array
Returns:
an array containing all keys of this instance

valuesAsArray

V[] valuesAsArray(V[] array)
Returns an array containing all values of this instance according to the contract defined in java.util.Collection#toArray(T[] a).

Parameters:
array - the target array
Returns:
an array containing all values of this instance


Copyright 2007-2007 SourceForge. All Rights Reserved.