Searched refs:map (Results 1 - 25 of 166) sorted by relevance

1234567

/libcore/support/src/test/java/tests/support/
H A DSupport_MapTest2.java25 Map<String, String> map; field in class:Support_MapTest2
29 map = m;
30 if (!map.isEmpty()) {
38 map.put("one", "1");
39 assertEquals("size should be one", 1, map.size());
40 map.clear();
41 assertEquals("size should be zero", 0, map.size());
42 assertTrue("Should not have entries", !map.entrySet().iterator()
44 assertTrue("Should not have keys", !map.keySet().iterator()
46 assertTrue("Should not have values", !map
[all...]
/libcore/luni/src/test/java/libcore/java/net/
H A DOldFileNameMapTest.java26 FileNameMap map = URLConnection.getFileNameMap();
27 assertEquals("text/plain", map.getContentTypeFor("test.text"));
28 assertEquals("text/plain", map.getContentTypeFor("test.txt"));
29 assertEquals("text/html", map.getContentTypeFor("test.htm"));
30 assertEquals("text/html", map.getContentTypeFor("test.html"));
/libcore/benchmarks/src/benchmarks/
H A DHashedCollectionsBenchmark.java29 HashMap<String, String> map = new HashMap<String, String>();
30 map.put("hello", "world");
32 map.get("hello");
36 HashMap<String, String> map = new HashMap<String, String>();
37 synchronized (map) {
38 map.put("hello", "world");
41 synchronized (map) {
42 map.get("hello");
47 Hashtable<String, String> map = new Hashtable<String, String>();
48 map
[all...]
H A DVirtualVersusInterfaceBenchmark.java28 Map<String, String> map = new HashMap<String, String>();
30 map.put("hello", "world");
34 HashMap<String, String> map = new HashMap<String, String>();
36 map.put("hello", "world");
/libcore/luni/src/test/java/libcore/java/util/
H A DOldAndroidHashMapTest.java29 private void addItems(HashMap<String, Integer> map) { argument
30 map.put("one", ONE);
31 map.put("two", TWO);
32 map.put("three", THREE);
33 map.put("four", FOUR);
35 assertEquals(4, map.size());
37 assertEquals(ONE, map.get("one"));
38 assertEquals(TWO, map.get("two"));
39 assertEquals(THREE, map.get("three"));
40 assertEquals(FOUR, map
[all...]
H A DOldLinkedHashMapTest.java29 LinkedHashMap map = new LinkedHashMap<String, String>(10, 0.75f, true);
31 map.put("key1", "value1");
32 map.put("key2", "value2");
33 map.put("key3", "value3");
35 Iterator iterator = map.keySet().iterator();
37 map.get(id);
49 LinkedHashMap mapClone = (LinkedHashMap) map.clone();
51 iterator = map.keySet().iterator();
H A DTreeMapTest.java45 TreeMap<String, String> map = new TreeMap<String, String>();
46 map.put("A", "a");
47 map.put("B", "b");
48 map.put("C", "c");
50 Iterator<Entry<String, String>> iterator = map.entrySet().iterator();
54 assertEquals("x", map.get("A"));
60 assertEquals("y", map.get("B"));
62 assertEquals("z", map.get("C"));
66 * Test that the entrySet() method of a sub map produces correctly mutable
67 * entries that propagate changes to the original map
124 assertAllEntryMethodsReturnImmutableEntries(NavigableMap<String, String> map) argument
[all...]
H A DWeakHashMapTest.java30 WeakHashMap<Data, String> map = new WeakHashMap<>();
32 map.put(data[i], "");
34 map.replaceAll((k, v) -> k.value);
37 assertEquals(data[i].value, map.get(data[i]));
41 map.replaceAll(new java.util.function.BiFunction<Data, String, String>() {
44 map.put(new Data(), "");
53 map.replaceAll(null);
58 map.clear();
60 map.put(data[i], data[i].value);
63 map
[all...]
/libcore/ojluni/src/main/java/java/util/
H A DHashSet.java95 private transient HashMap<E,Object> map; field in class:HashSet
105 map = new HashMap<>();
118 map = new HashMap<>(Math.max((int) (c.size()/.75f) + 1, 16));
126 * @param initialCapacity the initial capacity of the hash map
127 * @param loadFactor the load factor of the hash map
132 map = new HashMap<>(initialCapacity, loadFactor);
144 map = new HashMap<>(initialCapacity);
153 * @param initialCapacity the initial capacity of the hash map
154 * @param loadFactor the load factor of the hash map
161 map
[all...]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
H A DSortedMapTestBase.java43 SortedMap<Integer, Integer> map; field in class:SortedMapTestBase
56 map.clear();
57 assertTrue(map.isEmpty());
63 assertEquals(ref.containsKey(key), map.containsKey(key));
71 assertEquals(ref.containsValue(value), map.containsValue(value));
78 Set<Map.Entry<Integer, Integer>> mapSet = map.entrySet();
85 assertEquals(ref.entrySet(), map.entrySet());
92 assertEquals(ref.get(key), map.get(key));
98 assertEquals(ref.keySet(), map.keySet());
100 Iterator<Integer> j = map
291 checkSubMap(SortedMap<Integer, Integer> ref, SortedMap<Integer, Integer> map) argument
324 testViews(SortedMap<Integer, Integer> ref, SortedMap<Integer, Integer> map) argument
336 compareIterators(Collection ref, Collection map) argument
[all...]
H A DAbstractMapTest.java142 AbstractMap map = new HashMap();
143 map.put(1, 1);
144 map.clear();
145 assertTrue(map.isEmpty());
175 AbstractMap map = new AMT();
177 assertFalse(map.containsKey("k"));
178 assertFalse(map.containsKey(null));
180 map.put("k", "v");
181 map.put("key", null);
182 map
[all...]
H A DIdentityHashMapTest.java145 IdentityHashMap map = new IdentityHashMap();
146 map.put("key", "value");
148 Set keys = map.keySet();
149 Collection values = map.values();
154 AbstractMap map2 = (AbstractMap) map.clone();
158 // values() and keySet() on the cloned() map should be different
240 assertTrue("Returned false for new map", new IdentityHashMap()
262 Map map = new IdentityHashMap(101);
263 map.put(new Integer(1), "1");
264 map
[all...]
/libcore/ojluni/src/main/java/java/beans/
H A DChangeListenerMap.java48 private Map<String, L[]> map; field in class:ChangeListenerMap
78 if (this.map == null) {
79 this.map = new HashMap<>();
81 L[] array = this.map.get(name);
91 this.map.put(name, clone);
103 if (this.map != null) {
104 L[] array = this.map.get(name);
113 this.map.put(name, clone);
116 this.map.remove(name);
117 if (this.map
[all...]
/libcore/jsr166-tests/src/test/java/jsr166/
H A DTreeSubMapTest.java34 * Returns a new map from Integers 1-5 to Strings "A"-"E".
37 TreeMap map = new TreeMap();
38 assertTrue(map.isEmpty());
39 map.put(zero, "Z");
40 map.put(one, "A");
41 map.put(five, "E");
42 map.put(three, "C");
43 map.put(two, "B");
44 map.put(four, "D");
45 map
[all...]
H A DConcurrentSkipListMapTest.java37 * Returns a new map from Integers 1-5 to Strings "A"-"E".
40 ConcurrentSkipListMap map = new ConcurrentSkipListMap();
41 assertTrue(map.isEmpty());
42 map.put(one, "A");
43 map.put(five, "E");
44 map.put(three, "C");
45 map.put(two, "B");
46 map.put(four, "D");
47 assertFalse(map.isEmpty());
48 assertEquals(5, map
1011 populate(NavigableMap<Integer, Integer> map, int limit) argument
1018 mutateMap(NavigableMap<Integer, Integer> map, int min, int max) argument
1043 mutateSubMap(NavigableMap<Integer, Integer> map, int min, int max) argument
1074 put(NavigableMap<Integer, Integer> map, int key) argument
1079 remove(NavigableMap<Integer, Integer> map, int key) argument
1084 bashSubMap(NavigableMap<Integer, Integer> map, int min, int max, boolean ascending) argument
1165 check(NavigableMap<Integer, Integer> map, final int min, final int max, final boolean ascending) argument
[all...]
H A DConcurrentSkipListSubMapTest.java35 * Returns a new map from Integers 1-5 to Strings "A"-"E".
38 ConcurrentSkipListMap map = new ConcurrentSkipListMap();
39 assertTrue(map.isEmpty());
40 map.put(zero, "Z");
41 map.put(one, "A");
42 map.put(five, "E");
43 map.put(three, "C");
44 map.put(two, "B");
45 map.put(four, "D");
46 map
[all...]
H A DConcurrentHashMapTest.java37 * Returns a new map from Integers 1-5 to Strings "A"-"E".
40 ConcurrentHashMap map = new ConcurrentHashMap<Integer, String>(5);
41 assertTrue(map.isEmpty());
42 map.put(one, "A");
43 map.put(two, "B");
44 map.put(three, "C");
45 map.put(four, "D");
46 map.put(five, "E");
47 assertFalse(map.isEmpty());
48 assertEquals(5, map
[all...]
H A DTreeMapTest.java36 * Returns a new map from Integers 1-5 to Strings "A"-"E".
39 TreeMap map = new TreeMap();
40 assertTrue(map.isEmpty());
41 map.put(one, "A");
42 map.put(five, "E");
43 map.put(three, "C");
44 map.put(two, "B");
45 map.put(four, "D");
46 assertFalse(map.isEmpty());
47 assertEquals(5, map
816 populate(NavigableMap<Integer, Integer> map, int limit) argument
823 mutateMap(NavigableMap<Integer, Integer> map, int min, int max) argument
848 mutateSubMap(NavigableMap<Integer, Integer> map, int min, int max) argument
879 put(NavigableMap<Integer, Integer> map, int key) argument
884 remove(NavigableMap<Integer, Integer> map, int key) argument
889 bashSubMap(NavigableMap<Integer, Integer> map, int min, int max, boolean ascending) argument
970 check(NavigableMap<Integer, Integer> map, final int min, final int max, final boolean ascending) argument
[all...]
/libcore/ojluni/src/main/java/sun/nio/ch/
H A DSocketOptionRegistry.java59 Map<RegistryKey,OptionKey> map =
61 map.put(new RegistryKey(StandardSocketOptions.SO_BROADCAST, Net.UNSPEC), new OptionKey(1, 6));
62 map.put(new RegistryKey(StandardSocketOptions.SO_KEEPALIVE, Net.UNSPEC), new OptionKey(1, 9));
63 map.put(new RegistryKey(StandardSocketOptions.SO_LINGER, Net.UNSPEC), new OptionKey(1, 13));
64 map.put(new RegistryKey(StandardSocketOptions.SO_SNDBUF, Net.UNSPEC), new OptionKey(1, 7));
65 map.put(new RegistryKey(StandardSocketOptions.SO_RCVBUF, Net.UNSPEC), new OptionKey(1, 8));
66 map.put(new RegistryKey(StandardSocketOptions.SO_REUSEADDR, Net.UNSPEC), new OptionKey(1, 2));
67 map.put(new RegistryKey(StandardSocketOptions.TCP_NODELAY, Net.UNSPEC), new OptionKey(6, 1));
68 map.put(new RegistryKey(StandardSocketOptions.IP_TOS, StandardProtocolFamily.INET), new OptionKey(0, 1));
69 map
[all...]
/libcore/luni/src/main/java/libcore/util/
H A DBasicLruCache.java27 private final LinkedHashMap<K, V> map; field in class:BasicLruCache
35 this.map = new LinkedHashMap<K, V>(0, 0.75f, true);
51 result = map.get(key);
61 // NOTE: Another thread might have already inserted a value for |key| into the map.
63 // equal keys. We will however attempt to trim the map twice, but that shouldn't be
67 map.put(key, result);
89 V previous = map.put(key, value);
95 while (map.size() > maxSize) {
96 Map.Entry<K, V> toEvict = map.eldest();
100 map
[all...]
/libcore/ojluni/src/main/java/java/time/
H A DZoneId.java175 * A map of zone overrides to enable the short time-zone names to be used.
178 * This map allows the IDs to continue to be used via the
181 * This map contains a mapping of the IDs that is in line with TZDB 2005r and
182 * later, where 'EST', 'MST' and 'HST' map to IDs which do not include daylight
216 * The map is unmodifiable.
220 Map<String, String> map = new HashMap<>(64);
221 map.put("ACT", "Australia/Darwin");
222 map.put("AET", "Australia/Sydney");
223 map.put("AGT", "America/Argentina/Buenos_Aires");
224 map
[all...]
/libcore/ojluni/src/test/java/time/test/java/time/format/
H A DZoneName.java39 Map<String, String> map = mzoneToZidL.get(mzone);
40 if (map != null && map.containsKey(locale.getCountry())) {
41 zid = map.get(locale.getCountry());
765 Map<String, String> map = mzoneToZidL.get(mzone);
766 if (map == null) {
767 map = new HashMap<>();
768 mzoneToZidL.put(mzone, map);
770 map.put(mzoneMap[i + 1], mzoneMap[i + 2]);
/libcore/ojluni/src/test/java/util/stream/test/org/openjdk/tests/java/util/stream/
H A DMapOpTest.java53 assertCountSum(countTo(0).stream().map(mId), 0, 0);
54 assertCountSum(countTo(10).stream().map(mId), 10, 55);
55 assertCountSum(countTo(10).stream().map(mZero), 10, 0);
56 assertCountSum(countTo(0).stream().map(mDoubler), 0, 0);
57 assertCountSum(countTo(10).stream().map(mDoubler), 10, 110);
58 assertCountSum(countTo(10).stream().map(mDoubler).map(mDoubler), 10, 220);
60 exerciseOps(countTo(0), s -> s.map(LambdaTestHelpers.identity()), countTo(0));
61 exerciseOps(countTo(1000), s -> s.map(LambdaTestHelpers.identity()), countTo(1000));
65 exerciseOps(countTo(1000), s -> s.map(
[all...]
/libcore/ojluni/src/main/java/java/sql/
H A DArray.java47 * <li>make an entry in a type map that contains
55 * When a type map with an entry for
58 * it contains will be used to map the elements of the <code>ARRAY</code> value.
59 * If no type map is supplied, which would typically be the case,
60 * the connection's type map is used by default.
61 * If the connection's type map or a type map supplied to a method has no entry
111 * uses the type map associated with the connection for customizations of
134 * the specified <code>map</code> for type map customization
156 getArray(java.util.Map<String,Class<?>> map) argument
219 getArray(long index, int count, java.util.Map<String,Class<?>> map) argument
276 getResultSet(java.util.Map<String,Class<?>> map) argument
344 getResultSet(long index, int count, java.util.Map<String,Class<?>> map) argument
[all...]
H A DStruct.java60 * As individual attributes are processed, this method uses the type map
64 * entry in the connection's type map that matches the structured
84 * As individual attrbutes are proccessed, this method uses the given type map
87 * entry in the given type map that matches the structured
90 * uses the type map associated with the connection.
97 * @param map a mapping of SQL type names to Java classes
104 Object[] getAttributes(java.util.Map<String,Class<?>> map) argument

Completed in 760 milliseconds

1234567