net.cscott.jutil

Class GenericInvertibleMultiMap<K,V>

public class GenericInvertibleMultiMap<K,V> extends Object implements InvertibleMultiMap<K,V>

GenericInvertibleMultiMap is a default implementation of InvertibleMultiMap. It returns modifiable inverted views of the mappings it maintains. Note that a GenericInvertibleMultiMap can directly replace a GenericInvertibleMap, because MultiMap correctly extends Map.

Version: $Id: GenericInvertibleMultiMap.java,v 1.3 2004/01/13 21:40:19 cananian Exp $

Author: C. Scott Ananian

Constructor Summary
GenericInvertibleMultiMap(MultiMapFactory mmf)
GenericInvertibleMultiMap(MapFactory mf, CollectionFactory cf)
GenericInvertibleMultiMap(CollectionFactory cf)
GenericInvertibleMultiMap()
GenericInvertibleMultiMap(Map<? extends K,? extends V> m)
GenericInvertibleMultiMap(MultiMap<? extends K,? extends V> mm)
Method Summary
booleanadd(K key, V value)
booleanaddAll(K key, Collection<? extends V> values)
booleanaddAll(MultiMap<? extends K,? extends V> mm)
voidclear()
booleancontains(Object a, Object b)
booleancontainsKey(Object key)
booleancontainsValue(Object value)
MultiMapSet<K,V>entrySet()
The Set returned by this method is actually an instance of MultiMapSet.
booleanequals(Object o)
Vget(Object key)
Collection<V>getValues(K key)
inthashCode()
InvertibleMultiMap<V,K>invert()
Returns an unmodifiable inverted view of this.
booleanisEmpty()
Set<K>keySet()
Vput(K key, V value)
voidputAll(Map<? extends K,? extends V> t)
Vremove(Object key)
booleanremove(Object key, Object value)
booleanremoveAll(K key, Collection<?> values)
booleanretainAll(K key, Collection<?> values)
intsize()
StringtoString()
Collection<V>values()

Constructor Detail

GenericInvertibleMultiMap

public GenericInvertibleMultiMap(MultiMapFactory mmf)

GenericInvertibleMultiMap

public GenericInvertibleMultiMap(MapFactory mf, CollectionFactory cf)

GenericInvertibleMultiMap

public GenericInvertibleMultiMap(CollectionFactory cf)

GenericInvertibleMultiMap

public GenericInvertibleMultiMap()

GenericInvertibleMultiMap

public GenericInvertibleMultiMap(Map<? extends K,? extends V> m)

GenericInvertibleMultiMap

public GenericInvertibleMultiMap(MultiMap<? extends K,? extends V> mm)

Method Detail

add

public boolean add(K key, V value)

addAll

public boolean addAll(K key, Collection<? extends V> values)

addAll

public boolean addAll(MultiMap<? extends K,? extends V> mm)

clear

public void clear()

contains

public boolean contains(Object a, Object b)

containsKey

public boolean containsKey(Object key)

containsValue

public boolean containsValue(Object value)

entrySet

public MultiMapSet<K,V> entrySet()
The Set returned by this method is actually an instance of MultiMapSet.

equals

public boolean equals(Object o)

get

public V get(Object key)

getValues

public Collection<V> getValues(K key)

hashCode

public int hashCode()

invert

public InvertibleMultiMap<V,K> invert()
Returns an unmodifiable inverted view of this.

isEmpty

public boolean isEmpty()

keySet

public Set<K> keySet()

put

public V put(K key, V value)

putAll

public void putAll(Map<? extends K,? extends V> t)

remove

public V remove(Object key)

remove

public boolean remove(Object key, Object value)

removeAll

public boolean removeAll(K key, Collection<?> values)

retainAll

public boolean retainAll(K key, Collection<?> values)

size

public int size()

toString

public String toString()

values

public Collection<V> values()
Copyright © 2003 C. Scott Ananian