ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/MapImplementation.java
Revision: 1.2
Committed: Sun Sep 29 20:40:48 2019 UTC (4 years, 7 months ago) by jsr166
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +8 -2 lines
Log Message:
add MapTest.testConcurrentAccess

File Contents

# Content
1 /*
2 * Written by Doug Lea and Martin Buchholz with assistance from
3 * members of JCP JSR-166 Expert Group and released to the public
4 * domain, as explained at
5 * http://creativecommons.org/publicdomain/zero/1.0/
6 */
7
8 import java.util.Map;
9
10 /** Allows tests to work with different Map implementations. */
11 public interface MapImplementation {
12 /** Returns the Map implementation class. */
13 public Class<?> klazz();
14 /** Returns an empty map. */
15 public Map emptyMap();
16
17 // General purpose implementations can use Integers for key and value
18 default Object makeKey(int i) { return i; }
19 default Object makeValue(int i) { return i; }
20 default int keyToInt(Object key) { return (Integer) key; }
21 default int valueToInt(Object value) { return (Integer) value; }
22
23 public boolean isConcurrent();
24 default boolean remappingFunctionCalledAtMostOnce() { return true; };
25 public boolean permitsNullKeys();
26 public boolean permitsNullValues();
27 public boolean supportsSetValue();
28 }