Home
last modified time | relevance | path

Searched refs:map (Results 1 – 25 of 67) sorted by relevance

123

/libcore/luni/src/test/java/libcore/java/util/
DOldAndroidHashMapTest.java29 private void addItems(HashMap<String, Integer> map) { in addItems() argument
30 map.put("one", ONE); in addItems()
31 map.put("two", TWO); in addItems()
32 map.put("three", THREE); in addItems()
33 map.put("four", FOUR); in addItems()
35 assertEquals(4, map.size()); in addItems()
37 assertEquals(ONE, map.get("one")); in addItems()
38 assertEquals(TWO, map.get("two")); in addItems()
39 assertEquals(THREE, map.get("three")); in addItems()
40 assertEquals(FOUR, map.get("four")); in addItems()
[all …]
DTreeMapTest.java37 TreeMap<String, String> map = new TreeMap<String, String>(); in testEntrySetSetValue() local
38 map.put("A", "a"); in testEntrySetSetValue()
39 map.put("B", "b"); in testEntrySetSetValue()
40 map.put("C", "c"); in testEntrySetSetValue()
42 Iterator<Entry<String, String>> iterator = map.entrySet().iterator(); in testEntrySetSetValue()
46 assertEquals("x", map.get("A")); in testEntrySetSetValue()
52 assertEquals("y", map.get("B")); in testEntrySetSetValue()
54 assertEquals("z", map.get("C")); in testEntrySetSetValue()
62 TreeMap<String, String> map = new TreeMap<String, String>(); in testSubMapEntrySetSetValue() local
63 map.put("A", "a"); in testSubMapEntrySetSetValue()
[all …]
DOldLinkedHashMapTest.java29 LinkedHashMap map = new LinkedHashMap<String, String>(10, 0.75f, true); in testLinkedHashMap() local
31 map.put("key1", "value1"); in testLinkedHashMap()
32 map.put("key2", "value2"); in testLinkedHashMap()
33 map.put("key3", "value3"); in testLinkedHashMap()
35 Iterator iterator = map.keySet().iterator(); in testLinkedHashMap()
37 map.get(id); in testLinkedHashMap()
49 LinkedHashMap mapClone = (LinkedHashMap) map.clone(); in testLinkedHashMap()
51 iterator = map.keySet().iterator(); in testLinkedHashMap()
DEvilMapTest.java53 HashMap<String, String> map = new HashMap<String, String>(evil); in test_48055_HashMap() local
63 Hashtable<String, String> map = new Hashtable<String, String>(evil); in test_48055_Hashtable() local
73 LinkedHashMap<String, String> map = new LinkedHashMap<String, String>(evil); in test_48055_LinkedHashMap() local
83 WeakHashMap<String, String> map = new WeakHashMap<String, String>(evil); in test_48055_WeakHashMap() local
93 IdentityHashMap<String, String> map = new IdentityHashMap<String, String>(evil); in test_48055_IdentityHashMap() local
103 ConcurrentHashMap<String, String> map = new ConcurrentHashMap<String, String>(evil); in test_48055_ConcurrentHashMap() local
DOldTreeMapTest.java241 TreeMap<Integer, Double> map = new TreeMap<Integer, Double>( in test_headMapLjava_lang_Object() local
243 map.put(1, 2.1); in test_headMapLjava_lang_Object()
244 map.put(2, 3.1); in test_headMapLjava_lang_Object()
245 map.put(3, 4.5); in test_headMapLjava_lang_Object()
246 map.put(7, 21.3); in test_headMapLjava_lang_Object()
247 map.put(null, null); in test_headMapLjava_lang_Object()
249 SortedMap<Integer, Double> smap = map.headMap(null); in test_headMapLjava_lang_Object()
421 SortedMap<String, String> map = new TreeMap<String, String>(); in test_subMapLjava_lang_ObjectLjava_lang_Object() local
422 map.put("1", "one"); in test_subMapLjava_lang_ObjectLjava_lang_Object()
423 map.put("2", "two"); in test_subMapLjava_lang_ObjectLjava_lang_Object()
[all …]
/libcore/support/src/test/java/tests/support/
DSupport_MapTest2.java25 Map<String, String> map; field in Support_MapTest2
29 map = m; in Support_MapTest2()
30 if (!map.isEmpty()) { in Support_MapTest2()
38 map.put("one", "1"); in runTest()
39 assertEquals("size should be one", 1, map.size()); in runTest()
40 map.clear(); in runTest()
41 assertEquals("size should be zero", 0, map.size()); in runTest()
42 assertTrue("Should not have entries", !map.entrySet().iterator() in runTest()
44 assertTrue("Should not have keys", !map.keySet().iterator() in runTest()
46 assertTrue("Should not have values", !map.values().iterator() in runTest()
[all …]
DSupport_UnmodifiableMapTest.java28 Map<String, Integer> map; field in Support_UnmodifiableMapTest
39 map = m; in Support_UnmodifiableMapTest()
45 assertTrue("UnmodifiableMapTest - Should contain the key \"0\"", map in runTest()
47 assertTrue("UnmodifiableMapTest - Should contain the key \"50\"", map in runTest()
50 !map.containsKey("100")); in runTest()
53 assertTrue("UnmodifiableMapTest - Should contain the value 0", map in runTest()
55 assertTrue("UnmodifiableMapTest - Should contain the value 50", map in runTest()
57 assertTrue("UnmodifiableMapTest - Should not contain value 100", !map in runTest()
61 Set<?> entrySet = map.entrySet(); in runTest()
67 map.get(me.getKey()).equals(me.getValue())); in runTest()
[all …]
/libcore/benchmarks/src/benchmarks/
DHashedCollectionsBenchmark.java33 HashMap<String, String> map = new HashMap<String, String>(); in timeHashMapGet() local
34 map.put("hello", "world"); in timeHashMapGet()
36 map.get("hello"); in timeHashMapGet()
40 HashMap<String, String> map = new HashMap<String, String>(); in timeHashMapGet_Synchronized() local
41 synchronized (map) { in timeHashMapGet_Synchronized()
42 map.put("hello", "world"); in timeHashMapGet_Synchronized()
45 synchronized (map) { in timeHashMapGet_Synchronized()
46 map.get("hello"); in timeHashMapGet_Synchronized()
51 Hashtable<String, String> map = new Hashtable<String, String>(); in timeHashtableGet() local
52 map.put("hello", "world"); in timeHashtableGet()
[all …]
DVirtualVersusInterfaceBenchmark.java32 Map<String, String> map = new HashMap<String, String>(); in timeMapPut() local
34 map.put("hello", "world"); in timeMapPut()
38 HashMap<String, String> map = new HashMap<String, String>(); in timeHashMapPut() local
40 map.put("hello", "world"); in timeHashMapPut()
/libcore/luni/src/main/java/java/util/jar/
DAttributes.java39 protected Map<Object, Object> map; field in Attributes
187 map = new HashMap<Object, Object>(); in Attributes()
199 map = (Map<Object, Object>) ((HashMap) attrib.map).clone(); in Attributes()
210 map = new HashMap<Object, Object>(size); in Attributes()
217 map.clear(); in clear()
228 return map.containsKey(key); in containsKey()
239 return map.containsValue(value); in containsValue()
249 return map.entrySet(); in entrySet()
261 return map.get(key); in get()
270 return map.isEmpty(); in isEmpty()
[all …]
/libcore/luni/src/main/java/libcore/util/
DBasicLruCache.java27 private final LinkedHashMap<K, V> map; field in BasicLruCache
35 this.map = new LinkedHashMap<K, V>(0, 0.75f, true); in BasicLruCache()
49 V result = map.get(key); in get()
57 map.put(key, result); in get()
77 V previous = map.put(key, value); in put()
83 while (map.size() > maxSize) { in trimToSize()
84 Map.Entry<K, V> toEvict = map.eldest(); in trimToSize()
88 map.remove(key); in trimToSize()
114 return new LinkedHashMap<K, V>(map); in snapshot()
/libcore/luni/src/main/java/libcore/io/
DBase64.java128 private static final byte[] map = new byte[] field in Base64
140 out[index++] = map[(in[i] & 0xff) >> 2]; in encode()
141 out[index++] = map[((in[i] & 0x03) << 4) | ((in[i+1] & 0xff) >> 4)]; in encode()
142 out[index++] = map[((in[i+1] & 0x0f) << 2) | ((in[i+2] & 0xff) >> 6)]; in encode()
143 out[index++] = map[(in[i+2] & 0x3f)]; in encode()
147 out[index++] = map[(in[end] & 0xff) >> 2]; in encode()
148 out[index++] = map[(in[end] & 0x03) << 4]; in encode()
153 out[index++] = map[(in[end] & 0xff) >> 2]; in encode()
154 out[index++] = map[((in[end] & 0x03) << 4) | ((in[end+1] & 0xff) >> 4)]; in encode()
155 out[index++] = map[((in[end+1] & 0x0f) << 2)]; in encode()
/libcore/luni/src/main/java/java/net/
DCookieStoreImpl.java32 private final Map<URI, List<HttpCookie>> map = new HashMap<URI, List<HttpCookie>>(); field in CookieStoreImpl
40 List<HttpCookie> cookies = map.get(uri); in add()
43 map.put(uri, cookies); in add()
69 List<HttpCookie> cookiesForUri = map.get(uri); in get()
82 for (Map.Entry<URI, List<HttpCookie>> entry : map.entrySet()) { in get()
106 for (List<HttpCookie> list : map.values()) { in getCookies()
120 List<URI> result = new ArrayList<URI>(map.keySet()); in getURIs()
130 List<HttpCookie> cookies = map.get(cookiesUri(uri)); in remove()
139 boolean result = !map.isEmpty(); in removeAll()
140 map.clear(); in removeAll()
/libcore/luni/src/main/java/org/apache/harmony/security/asn1/
DASN1Choice.java236 TreeMap<BigInteger, BigInteger> map = new TreeMap<BigInteger, BigInteger>(); in ASN1Choice() local
249 addIdentifier(map, choiceToAdd[0][j], index); in ASN1Choice()
256 addIdentifier(map, t.id, index); in ASN1Choice()
261 addIdentifier(map, t.constrId, index); in ASN1Choice()
266 int size = map.size(); in ASN1Choice()
268 Iterator<Map.Entry<BigInteger, BigInteger>> it = map.entrySet().iterator(); in ASN1Choice()
281 private void addIdentifier(TreeMap<BigInteger, BigInteger> map, int identifier, int index){ in addIdentifier() argument
282 if (map.put(BigInteger.valueOf(identifier), BigInteger.valueOf(index)) != null) { in addIdentifier()
/libcore/luni/src/main/java/java/sql/
DArray.java70 public Object getArray(long index, int count, Map<String, Class<?>> map) in getArray() argument
83 public Object getArray(Map<String, Class<?>> map) throws SQLException; in getArray() argument
150 Map<String, Class<?>> map) throws SQLException; in getResultSet() argument
163 public ResultSet getResultSet(Map<String, Class<?>> map) in getResultSet() argument
/libcore/harmony-tests/src/test/java/org/apache/harmony/nio/tests/java/nio/
DMappedByteBufferTest.java47 MappedByteBuffer mmb = fc.map(FileChannel.MapMode.READ_ONLY, 0, fc in testasIntBuffer()
77 MappedByteBuffer mmb = fc.map(FileChannel.MapMode.READ_ONLY, 0, fc.size()); in testEmptyBuffer()
104 mmb = fc.map(FileChannel.MapMode.READ_WRITE, 0, fc.size()); in testEmptyBuffer()
113 mmb = fc.map(FileChannel.MapMode.PRIVATE, 0, fc.size()); in testEmptyBuffer()
130 MappedByteBuffer mmbRead = fileChannelRead.map(MapMode.READ_ONLY, 0, in test_force()
137 MappedByteBuffer resultRead = fileChannelR.map(MapMode.READ_ONLY, 0, in test_force()
148 MappedByteBuffer mmbReadWrite = fileChannelReadWrite.map( in test_force()
156 MappedByteBuffer resultReadWrite = fileChannelRW.map( in test_force()
174 MappedByteBuffer mmbRead = fileChannelRead.map(MapMode.READ_ONLY, 0, in test_load()
181 MappedByteBuffer mmbReadWrite = fileChannelReadWrite.map( in test_load()
[all …]
/libcore/luni/src/test/java/tests/api/java/util/
DHashMapTest.java146 HashMap map = new HashMap(); in test_clone() local
147 map.put("key", "value"); in test_clone()
149 Set keys = map.keySet(); in test_clone()
150 Collection values = map.values(); in test_clone()
155 AbstractMap map2 = (AbstractMap) map.clone(); in test_clone()
268 HashMap map = new HashMap(); in test_getLjava_lang_Object() local
270 map.put(k, "value1"); in test_getLjava_lang_Object()
273 assertNull(map.get(k)); in test_getLjava_lang_Object()
276 assertNull(map.get(k)); in test_getLjava_lang_Object()
304 Map map = new HashMap(101); in test_keySet() local
[all …]
DIdentityHashMapTest.java140 IdentityHashMap map = new IdentityHashMap(); in test_clone() local
141 map.put("key", "value"); in test_clone()
143 Set keys = map.keySet(); in test_clone()
144 Collection values = map.values(); in test_clone()
149 AbstractMap map2 = (AbstractMap) map.clone(); in test_clone()
257 Map map = new IdentityHashMap(101); in test_keySet() local
258 map.put(new Integer(1), "1"); in test_keySet()
259 map.put(new Integer(102), "102"); in test_keySet()
260 map.put(new Integer(203), "203"); in test_keySet()
261 Iterator it = map.keySet().iterator(); in test_keySet()
[all …]
DWeakHashMapTest.java126 WeakHashMap map = new WeakHashMap(mockMap); in test_ConstructorLjava_util_Map() local
127 assertEquals("Size should be 0", 0, map.size()); in test_ConstructorLjava_util_Map()
241 WeakHashMap map = new WeakHashMap(); in test_putLjava_lang_ObjectLjava_lang_Object() local
242 map.put(null, "value"); // add null key in test_putLjava_lang_ObjectLjava_lang_Object()
246 map.remove("nothing"); // Cause objects in queue to be removed in test_putLjava_lang_ObjectLjava_lang_Object()
247 assertEquals("null key was removed", 1, map.size()); in test_putLjava_lang_ObjectLjava_lang_Object()
255 WeakHashMap map = new WeakHashMap(); in test_putAllLjava_util_Map() local
256 map.putAll(mockMap); in test_putAllLjava_util_Map()
257 assertEquals("Size should be 0", 0, map.size()); in test_putAllLjava_util_Map()
260 map.putAll(null); in test_putAllLjava_util_Map()
DAbstractMapTest.java168 private Map map = new HashMap(); in test_clone() field in AbstractMapTest.MyMap
171 return map.entrySet(); in test_clone()
175 return map.put(key, value); in test_clone()
179 return map; in test_clone()
191 MyMap map = new MyMap(); in test_clone() local
192 map.put("one", "1"); in test_clone()
193 Map.Entry entry = (Map.Entry) map.entrySet().iterator().next(); in test_clone()
196 MyMap mapClone = (MyMap) map.clone(); in test_clone()
197 assertTrue("clone not shallow", map.getMap() == mapClone.getMap()); in test_clone()
DHashtableTest.java120 Map map = new TreeMap(); in test_ConstructorLjava_util_Map() local
123 map.put("Gah", firstVal); in test_ConstructorLjava_util_Map()
124 map.put("Ooga", secondVal); in test_ConstructorLjava_util_Map()
125 Hashtable ht = new Hashtable(map); in test_ConstructorLjava_util_Map()
143 Map<String, Void> map = Collections.singletonMap("Dog", null); in test_ConversionConstructorNullValue() local
145 new Hashtable<String, Void>(map); in test_ConversionConstructorNullValue()
478 Map map = new Hashtable(101); in test_keySet() local
479 map.put(new Integer(1), "1"); in test_keySet()
480 map.put(new Integer(102), "102"); in test_keySet()
481 map.put(new Integer(203), "203"); in test_keySet()
[all …]
/libcore/luni/src/main/java/java/lang/
DSystem.java217 Map<String, String> map = new HashMap<String, String>(); in getenv() local
221 map.put(entry.substring(0, index), entry.substring(index + 1)); in getenv()
224 return new SystemEnvironment(map); in getenv()
649 private final Map<String, String> map; field in System.SystemEnvironment
651 public SystemEnvironment(Map<String, String> map) { in SystemEnvironment() argument
652 this.map = Collections.unmodifiableMap(map); in SystemEnvironment()
656 return map.entrySet(); in entrySet()
660 return map.get(toNonNullString(key)); in get()
664 return map.containsKey(toNonNullString(key)); in containsKey()
668 return map.containsValue(toNonNullString(value)); in containsValue()
/libcore/luni/src/main/java/java/util/
DIdentityHashMap.java86 private final IdentityHashMap<K,V> map; field in IdentityHashMap.IdentityHashMapEntry
88 IdentityHashMapEntry(IdentityHashMap<K,V> map, K theKey, V theValue) { in IdentityHashMapEntry() argument
90 this.map = map; in IdentityHashMapEntry()
124 map.put(key, object); in setValue()
302 public IdentityHashMap(Map<? extends K, ? extends V> map) {
303 this(map.size() < 6 ? 11 : map.size() * 2);
304 putAllImpl(map);
502 public void putAll(Map<? extends K, ? extends V> map) {
503 putAllImpl(map);
741 Map<?, ?> map = (Map) object;
[all …]
DEnumMap.java416 public EnumMap(EnumMap<K, ? extends V> map) {
417 initialization(map);
435 public EnumMap(Map<K, ? extends V> map) {
436 if (map instanceof EnumMap) {
437 initialization((EnumMap<K, V>) map);
439 if (map.isEmpty()) {
442 Iterator<K> iter = map.keySet().iterator();
450 putAllImpl(map);
653 public void putAll(Map<? extends K, ? extends V> map) {
654 putAllImpl(map);
[all …]
/libcore/dom/src/test/java/org/w3c/domts/level2/core/
DsetNamedItemNS01.java83 NamedNodeMap map; in runTest() local
91 map = testAddress.getAttributes(); in runTest()
96 setNode = map.setNamedItemNS(arg); in runTest()

123