ch.panter.li.bi.util
Class NamedItemLinkedMap<V extends NamedItem>

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<K,V>
          extended by java.util.LinkedHashMap<String,V>
              extended by ch.panter.li.bi.util.NamedItemLinkedMap<V>
All Implemented Interfaces:
ReadOnlyNamedItemMap<V>, Serializable, Cloneable, Iterable<V>, Map<String,V>

public class NamedItemLinkedMap<V extends NamedItem>
extends LinkedHashMap<String,V>
implements ReadOnlyNamedItemMap<V>

See Also:
Serialized Form

Constructor Summary
NamedItemLinkedMap()
          Creates a new empty instance
 
Method Summary
 boolean containsKey(String key)
          determines whether the map contains an entry under the given key
 V get(String key)
          gets the object stored under the given key
 Iterator<V> iterator()
           
 Iterator<String> keyIterator()
          Iterator over the keys in this instance
 String[] keysAsArray(String[] array)
          Returns an array containing all keys of this instance according to the contract defined in java.util.Collection#toArray(T[] a).
 V put(String key, V item)
           
 V put(V item)
           
 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 class java.util.LinkedHashMap
clear, containsValue, get, removeEldestEntry
 
Methods inherited from class java.util.HashMap
clone, containsKey, entrySet, isEmpty, keySet, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ch.panter.li.bi.util.ReadOnlyNamedItemMap
isEmpty, size
 
Methods inherited from interface java.util.Map
containsKey, entrySet, equals, hashCode, isEmpty, keySet, putAll, remove, size, values
 

Constructor Detail

NamedItemLinkedMap

public NamedItemLinkedMap()
Creates a new empty instance

Method Detail

containsKey

public boolean containsKey(String key)
Description copied from interface: ReadOnlyNamedItemMap
determines whether the map contains an entry under the given key

Specified by:
containsKey in interface ReadOnlyNamedItemMap<V extends NamedItem>

get

public V get(String key)
Description copied from interface: ReadOnlyNamedItemMap
gets the object stored under the given key

Specified by:
get in interface ReadOnlyNamedItemMap<V extends NamedItem>

put

public final V put(String key,
                   V item)
Specified by:
put in interface Map<String,V extends NamedItem>
Overrides:
put in class HashMap<String,V extends NamedItem>

put

public V put(V item)

keyIterator

public Iterator<String> keyIterator()
Description copied from interface: ReadOnlyNamedItemMap
Iterator over the keys in this instance

Specified by:
keyIterator in interface ReadOnlyNamedItemMap<V extends NamedItem>

valueIterator

public Iterator<V> valueIterator()
Description copied from interface: ReadOnlyNamedItemMap
Iterator over the values in this instance

Specified by:
valueIterator in interface ReadOnlyNamedItemMap<V extends NamedItem>

keysAsArray

public String[] keysAsArray(String[] array)
Description copied from interface: ReadOnlyNamedItemMap
Returns an array containing all keys of this instance according to the contract defined in java.util.Collection#toArray(T[] a).

Specified by:
keysAsArray in interface ReadOnlyNamedItemMap<V extends NamedItem>
Parameters:
array - the target array
Returns:
an array containing all keys of this instance

valuesAsArray

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

Specified by:
valuesAsArray in interface ReadOnlyNamedItemMap<V extends NamedItem>
Parameters:
array - the target array
Returns:
an array containing all values of this instance

iterator

public Iterator<V> iterator()
Specified by:
iterator in interface Iterable<V extends NamedItem>


Copyright 2007-2007 SourceForge. All Rights Reserved.