Nuxeo ECM Projects 5.4.3-SNAPSHOT

org.nuxeo.common.collections
Class ArrayMap<K,V>

java.lang.Object
  extended by org.nuxeo.common.collections.ArrayMap<K,V>

public class ArrayMap<K,V>
extends Object

A mixture of an array list and a map used to store small table of elements using both indices and keys.

This map accepts null values.

The map is implemented using an array of successive [key, value] pairs.

Author:
Bogdan Stefanescu

Constructor Summary
ArrayMap()
           
ArrayMap(ArrayMap<K,V> map)
           
ArrayMap(int initialCapacity)
           
ArrayMap(Map<K,V> map)
           
 
Method Summary
 void add(K key, V value)
           
 void clear()
           
 boolean equals(Object obj)
           
 V get(int i)
           
 V get(K key)
           
 Object[] getArray()
           
 K getKey(int i)
           
 K getKey(Object value)
           
 int hashCode()
           
 boolean isEmpty()
           
 V put(K key, V value)
           
 void putAll(Map<K,V> map)
           
 V remove(int index)
           
 V remove(K key)
           
 int size()
           
 void trimToSize()
           
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ArrayMap

public ArrayMap()

ArrayMap

public ArrayMap(int initialCapacity)

ArrayMap

public ArrayMap(Map<K,V> map)

ArrayMap

public ArrayMap(ArrayMap<K,V> map)
Method Detail

putAll

public void putAll(Map<K,V> map)

remove

public V remove(K key)

remove

public V remove(int index)

get

public V get(K key)

get

public V get(int i)

getKey

public K getKey(Object value)

getKey

public K getKey(int i)

put

public V put(K key,
             V value)

add

public void add(K key,
                V value)

trimToSize

public void trimToSize()

size

public int size()

isEmpty

public boolean isEmpty()

clear

public void clear()

getArray

public Object[] getArray()

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.