org.semanticweb.elk.util.collections
Interface Multimap<Key,Value>

Type Parameters:
Key - the keys of the multimap
Value - the values of the multimap
All Known Implementing Classes:
AbstractHashMultimap, HashListMultimap, HashSetMultimap

public interface Multimap<Key,Value>

Multimap from Keys to Collection of Values

Author:
Frantisek Simancik, Yevgeny Kazakov

Method Summary
 boolean add(Key key, Value value)
          Stores the key-value pair in this multimap
 void clear()
          Removes all key-value pairs of this multimap
 boolean contains(Key key, Value value)
          Tests if the key-value pair occurs in this multimap
 Collection<Value> get(Key key)
          Returns the collection of values associated with the given key in this multimap
 boolean isEmpty()
          Checks if this multimap is empty
 Set<Key> keySet()
           
 boolean remove(Object key, Object value)
          Removes the key-value pair from this multimap
 

Method Detail

contains

boolean contains(Key key,
                 Value value)
Tests if the key-value pair occurs in this multimap

Parameters:
key - the key of the pair
value - the value of the pair
Returns:
true if this multimap contains the pair, false otherwise

add

boolean add(Key key,
            Value value)
Stores the key-value pair in this multimap

Parameters:
key - the key of the pair
value - the value of the pair
Returns:
true if the multimap has changed as a result of the operation, fase otherwise

get

Collection<Value> get(Key key)
Returns the collection of values associated with the given key in this multimap

Parameters:
key - the key for which to retrieve the values
Returns:
the collection of values associated with the given key in this multimap

remove

boolean remove(Object key,
               Object value)
Removes the key-value pair from this multimap

Parameters:
key - the key of the pair
value - the value of the pair
Returns:
true if the multimap has changed as a result of the operation, fase otherwise

isEmpty

boolean isEmpty()
Checks if this multimap is empty

Returns:
true if this multimap is empty, false otherwise

keySet

Set<Key> keySet()

clear

void clear()
Removes all key-value pairs of this multimap



Copyright © 2011-2013 Department of Computer Science, University of Oxford. All Rights Reserved.