org.javimmutable.collections.common
Class ArrayToMapAdaptor<T>

java.lang.Object
  extended by java.util.AbstractMap<Integer,T>
      extended by org.javimmutable.collections.common.ArrayToMapAdaptor<T>
All Implemented Interfaces:
Map<Integer,T>

@Immutable
public class ArrayToMapAdaptor<T>
extends AbstractMap<Integer,T>


Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Constructor Summary
ArrayToMapAdaptor(JImmutableArray<T> map)
           
 
Method Summary
 void clear()
           
 boolean containsKey(Object o)
           
 boolean containsValue(Object o)
          Uses O(n) traversal of the PersistentMap to search for a matching value.
 Set<Map.Entry<Integer,T>> entrySet()
           
 T get(Object o)
           
 boolean isEmpty()
           
 Set<Integer> keySet()
           
static
<V> ArrayToMapAdaptor<V>
of(JImmutableArray<V> map)
           
 T put(Integer k, T t)
           
 void putAll(Map<? extends Integer,? extends T> map)
           
 T remove(Object o)
           
 int size()
           
 Collection<T> values()
           
 
Methods inherited from class java.util.AbstractMap
clone, equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ArrayToMapAdaptor

public ArrayToMapAdaptor(JImmutableArray<T> map)
Method Detail

of

public static <V> ArrayToMapAdaptor<V> of(JImmutableArray<V> map)

size

public int size()
Specified by:
size in interface Map<Integer,T>
Overrides:
size in class AbstractMap<Integer,T>

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in interface Map<Integer,T>
Overrides:
isEmpty in class AbstractMap<Integer,T>

containsKey

public boolean containsKey(Object o)
Specified by:
containsKey in interface Map<Integer,T>
Overrides:
containsKey in class AbstractMap<Integer,T>

containsValue

public boolean containsValue(Object o)
Uses O(n) traversal of the PersistentMap to search for a matching value.

Specified by:
containsValue in interface Map<Integer,T>
Overrides:
containsValue in class AbstractMap<Integer,T>
Parameters:
o -
Returns:

get

public T get(Object o)
Specified by:
get in interface Map<Integer,T>
Overrides:
get in class AbstractMap<Integer,T>

put

public T put(Integer k,
             T t)
Specified by:
put in interface Map<Integer,T>
Overrides:
put in class AbstractMap<Integer,T>

remove

public T remove(Object o)
Specified by:
remove in interface Map<Integer,T>
Overrides:
remove in class AbstractMap<Integer,T>

putAll

public void putAll(Map<? extends Integer,? extends T> map)
Specified by:
putAll in interface Map<Integer,T>
Overrides:
putAll in class AbstractMap<Integer,T>

clear

public void clear()
Specified by:
clear in interface Map<Integer,T>
Overrides:
clear in class AbstractMap<Integer,T>

keySet

public Set<Integer> keySet()
Specified by:
keySet in interface Map<Integer,T>
Overrides:
keySet in class AbstractMap<Integer,T>

values

public Collection<T> values()
Specified by:
values in interface Map<Integer,T>
Overrides:
values in class AbstractMap<Integer,T>

entrySet

public Set<Map.Entry<Integer,T>> entrySet()
Specified by:
entrySet in interface Map<Integer,T>
Specified by:
entrySet in class AbstractMap<Integer,T>


Copyright © 2014 Burton Computer Corporation. All rights reserved.