root/trunk/ProjectFortress/src/com/sun/fortress/useful/IMultiMap.java @ 3291

Revision 3291, 2.3 KB (checked in by dr2chase, 11 months ago)

[repository, ffi] Generated APIs now use proper import syntax, seem to pass static checking

Line 
1/*******************************************************************************
2    Copyright 2009 Sun Microsystems, Inc.,
3    4150 Network Circle, Santa Clara, California 95054, U.S.A.
4    All rights reserved.
5
6    U.S. Government Rights - Commercial software.
7    Government users are subject to the Sun Microsystems, Inc. standard
8    license agreement and applicable provisions of the FAR and its supplements.
9
10    Use is subject to license terms.
11
12    This distribution may include materials developed by third parties.
13
14    Sun, Sun Microsystems, the Sun logo and Java are trademarks or registered
15    trademarks of Sun Microsystems, Inc. in the U.S. and other countries.
16 ******************************************************************************/
17
18package com.sun.fortress.useful;
19
20import java.util.Collection;
21import java.util.Collections;
22import java.util.Map;
23import java.util.Set;
24
25public interface IMultiMap<K, V> extends Map<K, Set<V>> {
26
27    public void addInverse(Map<V, K> m);
28
29    public Set<V> putItem(K k, V v);
30
31    public Set<V> putItems(K k, Collection<V> vs);
32
33    public Set<V> removeItem(K k, V v);
34   
35    public Set<V> putKey(K k);
36
37    public final static IMultiMap EMPTY_MULTIMAP = new IMultiMap() {
38        private <T> T error() { throw new IllegalStateException("Empty IMultiMap is immutable."); }
39        public void addInverse(Map m) { error(); }
40        public Set putKey(Object k) { return error(); }
41        public Set putItem(Object k, Object v) { return error(); }
42        public Set putItems(Object k, Collection vs) { return error(); }
43        public Set removeItem(Object k, Object v) { return error(); }
44        public void clear() { error(); }
45        public boolean containsKey(Object arg0) { return false; }
46        public boolean containsValue(Object arg0) { return false; }
47        public Set entrySet() { return Collections.emptySet(); }
48        public Object get(Object arg0) { return null; }
49        public boolean isEmpty() { return false; }
50        public Set keySet() { return Collections.emptySet(); }
51        public Object put(Object arg0, Object arg1) { return error(); }
52        public void putAll(Map arg0) { error(); }
53        public Object remove(Object arg0) { return error(); }
54        public int size() { return 0; }
55        public Collection values() { return Collections.emptyMap().values(); }
56    };
57}
Note: See TracBrowser for help on using the browser.