MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / delete

Method delete

CodenameOne/src/com/codename1/io/CacheMap.java:135–150  ·  view source on GitHub ↗
(Object key)

Source from the content-addressed store, hash-verified

133 ///
134 /// - `key`: entry to remove from the cache
135 public void delete(Object key) {
136 memoryCache.remove(key);
137 weakCache.remove(key);
138 Vector storageCacheContent = getStorageCacheContent();
139 int s = storageCacheContent.size();
140 for (int iter = 0; iter < s; iter++) {
141 Object[] obj = (Object[]) storageCacheContent.elementAt(iter);
142 if (obj[1].equals(key)) {
143 Storage.getInstance().deleteStorageFile("$CACHE$" + cachePrefix + key);
144 obj[0] = Long.valueOf(Long.MIN_VALUE);
145 obj[1] = obj[0];
146 Storage.getInstance().writeObject("$CACHE$Idx" + cachePrefix, storageCacheContent);
147 return;
148 }
149 }
150 }
151
152 /// Returns the object matching the given key
153 ///

Callers 2

deleteMethod · 0.95
deleteNonExistentKeyMethod · 0.95

Calls 9

sizeMethod · 0.95
elementAtMethod · 0.95
getInstanceMethod · 0.95
valueOfMethod · 0.95
removeMethod · 0.65
equalsMethod · 0.65
deleteStorageFileMethod · 0.45
writeObjectMethod · 0.45

Tested by 2

deleteMethod · 0.76
deleteNonExistentKeyMethod · 0.76