public class

SynchronizedLinkedMap

extends Object
java.lang.Object
   ↳ com.pnfsoftware.jeb.util.collect.SynchronizedLinkedMap<K, V>

Class Overview

A serializable, inefficient, fully synchronized, linked pseudo-map. The insertion order is maintained.

"Pseudo" because this class does not implement the map interface, for the primary reason that iterators on keys/values/items would not abide by the contract requested by Map (mostly, that modifying the entries while iterating also modifies the backing map). Note that this class offers a #copyOfKeySet() method which can safely be used to iterate the keys of the map at the time that method was executed. Modifying that set does not impact the map itself. Unlike synchronized maps provided by Collections, there is no need to synchronize when iterating over the Collection returned by copyOfKeySet().

Similarly to ConcurrentHashMap (but unlike LinkedHashMap), this class does not allow null key or null value.

Methods of this object are guaranteed to never raise ConcurrentModificationException.

Summary

Public Constructors
SynchronizedLinkedMap()
Public Methods
void clear()
boolean containsKey(K key)
boolean containsValue(V value)
Set<K> copyOfKeys()
List<V> copyOfValues()
K firstKey()
@return
V get(K key)
boolean isEmpty()
V put(K key, V value)
V remove(K key)
int size()
String toString()
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public SynchronizedLinkedMap ()

Public Methods

public void clear ()

public boolean containsKey (K key)

public boolean containsValue (V value)

public Set<K> copyOfKeys ()

public List<V> copyOfValues ()

public K firstKey ()

@return

Throws
NoSuchElementException if the map is empty

public V get (K key)

public boolean isEmpty ()

public V put (K key, V value)

public V remove (K key)

public int size ()

public String toString ()