org.millscript.commons.util.map
Class AbstractITreeMap<K,V,N extends ITreeMapNode<K,V>>

java.lang.Object
  extended by org.millscript.commons.util.map.AbstractIMap<K,V>
      extended by org.millscript.commons.util.map.AbstractITreeMap<K,V,N>
All Implemented Interfaces:
org.millscript.commons.alert.AlertDecorator, IMap<K,V>, ITreeMap<K,V,N>
Direct Known Subclasses:
AbstractUTreeMap, IBinaryTreeMap

public abstract class AbstractITreeMap<K,V,N extends ITreeMapNode<K,V>>
extends AbstractIMap<K,V>
implements ITreeMap<K,V,N>


Nested Class Summary
static class AbstractITreeMap.ITreeMapNodeIterator<K,V>
           
static class AbstractITreeMap.ITreeMapNodeKeyIterator<K>
           
static class AbstractITreeMap.ITreeMapNodeKeyList<K>
           
static class AbstractITreeMap.ITreeMapNodeList<V>
           
static class AbstractITreeMap.ITreeMapNodeListIterator<V>
           
static class AbstractITreeMap.ITreeMapNodeMapletIterator<K,V>
           
static class AbstractITreeMap.ITreeMapNodeMapletList<K,V>
           
static class AbstractITreeMap.ITreeMapNodeValueIterator<V>
           
static class AbstractITreeMap.ITreeMapNodeValueList<V>
           
 
Constructor Summary
AbstractITreeMap()
           
AbstractITreeMap(IMapDefault<K,V> def)
           
 
Method Summary
 boolean contains(K key, V value)
          Returns true if this map contains a mapping from the specified key to the specified value.
 boolean containsKey(K key)
          Returns true if this map contains an entry for the specified key.
 boolean containsValue(V value)
          Returns true if this map contains an entry with the specified value.
 V get(K key)
          Returns the value associated with the specified key, or the default value if no such mapping exists.
 MapIterator<K,V> iterator(boolean share)
          Returns an iterator over the mappings in this map.
protected  IList<K> sharedKeyList()
           
protected  IList<Maplet<K,V>> sharedMapletList()
           
protected  IList<V> sharedValueList()
           
 int size()
          Returns the number of mappings defined in this map.
 
Methods inherited from class org.millscript.commons.util.map.AbstractIMap
contains, containsAll, decorate, equals, getDefault, hashCode, isEmtpy, keyList, mapletList, setDefault, toString, valueList
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.millscript.commons.util.ITreeMap
find, getComparator, getRootNode
 

Constructor Detail

AbstractITreeMap

public AbstractITreeMap()

AbstractITreeMap

public AbstractITreeMap(IMapDefault<K,V> def)
Parameters:
def -
Method Detail

contains

public boolean contains(K key,
                        V value)
Description copied from interface: IMap
Returns true if this map contains a mapping from the specified key to the specified value.

Specified by:
contains in interface IMap<K,V>
Parameters:
key - the key whose presence to test
value - the value which must match that stored against the specified key
Returns:
true if this map contains a mapping for the specified key-value combination
See Also:
org.millscript.commons.util.IMap#contains(K, V)

containsKey

public boolean containsKey(K key)
Description copied from interface: IMap
Returns true if this map contains an entry for the specified key.

Specified by:
containsKey in interface IMap<K,V>
Parameters:
key - the key whose presence to test
Returns:
true if this map contains a mapping for the specified key
See Also:
org.millscript.commons.util.IMap#containsKey(K)

containsValue

public boolean containsValue(V value)
Description copied from interface: IMap
Returns true if this map contains an entry with the specified value.

Specified by:
containsValue in interface IMap<K,V>
Parameters:
value - the value whose presence to test
Returns:
true if this map contains a mapping with the specified value
See Also:
org.millscript.commons.util.IMap#containsValue(V)

get

public V get(K key)
Description copied from interface: IMap
Returns the value associated with the specified key, or the default value if no such mapping exists.

Specified by:
get in interface IMap<K,V>
Parameters:
key - the key whose associated value to return
Returns:
the value associated with the specified key, or the default value if there is no mapping for the key
See Also:
org.millscript.commons.util.IMap#get(K)

iterator

public MapIterator<K,V> iterator(boolean share)
Description copied from interface: IMap
Returns an iterator over the mappings in this map. The order of iteration is implementation dependant and should follow any ordering the implementation provides.

Specified by:
iterator in interface IMap<K,V>
Parameters:
share - if true this instances backing store should be shared with the returned list, otherwise any backing store will be copied.
Returns:
an iterator over this maps mappings
See Also:
IMap.iterator(boolean)

sharedKeyList

protected IList<K> sharedKeyList()
Specified by:
sharedKeyList in class AbstractIMap<K,V>
See Also:
AbstractIMap.sharedKeyList()

sharedMapletList

protected IList<Maplet<K,V>> sharedMapletList()
Specified by:
sharedMapletList in class AbstractIMap<K,V>
See Also:
AbstractIMap.sharedMapletList()

sharedValueList

protected IList<V> sharedValueList()
Specified by:
sharedValueList in class AbstractIMap<K,V>
See Also:
AbstractIMap.sharedValueList()

size

public int size()
Description copied from interface: IMap
Returns the number of mappings defined in this map.

Specified by:
size in interface IMap<K,V>
Returns:
the number of mappings in this map
See Also:
IMap.size()


Copyright © 2005-2007 Open World Ltd. All Rights Reserved.