comparison dwtx/jface/text/source/AnnotationMap.d @ 162:1a5b8f8129df

...
author Frank Benoit <benoit@tionex.de>
date Mon, 08 Sep 2008 00:51:37 +0200
parents f70d9508c95c
children
comparison
equal deleted inserted replaced
161:f8d52b926852 162:1a5b8f8129df
100 private Object fLockObject; 100 private Object fLockObject;
101 /** 101 /**
102 * The internal lock object used if <code>fLockObject</code> is <code>null</code>. 102 * The internal lock object used if <code>fLockObject</code> is <code>null</code>.
103 * @since 3.2 103 * @since 3.2
104 */ 104 */
105 private const Object fInternalLockObject= new Object(); 105 private const Object fInternalLockObject;
106 106
107 /** The map holding the annotations */ 107 /** The map holding the annotations */
108 private Map fInternalMap; 108 private Map fInternalMap;
109 109
110 /** 110 /**
111 * Creates a new annotation map with the given capacity. 111 * Creates a new annotation map with the given capacity.
112 * 112 *
113 * @param capacity the capacity 113 * @param capacity the capacity
114 */ 114 */
115 public this(int capacity) { 115 public this(int capacity) {
116 fInternalLockObject= new Object();
116 fInternalMap= new HashMap(capacity); 117 fInternalMap= new HashMap(capacity);
117 } 118 }
118 119
119 /* 120 /*
120 * @see dwtx.jface.text.source.ISynchronizable#setLockObject(java.lang.Object) 121 * @see dwtx.jface.text.source.ISynchronizable#setLockObject(java.lang.Object)
255 public Collection values() { 256 public Collection values() {
256 synchronized (getLockObject()) { 257 synchronized (getLockObject()) {
257 return fInternalMap.values(); 258 return fInternalMap.values();
258 } 259 }
259 } 260 }
261
262 /// DWT extension of Collection interfaces
263
264 public bool containsKey(String key) {
265 return containsKey(stringcast(key));
266 }
267 public Object get(String key) {
268 return get(stringcast(key));
269 }
270 public Object put(String key, String value) {
271 return put(stringcast(key), stringcast(value));
272 }
273 public Object put(Object key, String value) {
274 return put(key, stringcast(value));
275 }
276 public Object put(String key, Object value) {
277 return put(stringcast(key), value);
278 }
279 public Object remove(String key) {
280 return remove(stringcast(key));
281 }
282 public int opApply (int delegate(ref Object value) dg){
283 implMissing(__FILE__,__LINE__);
284 return 0;
285 }
286 public int opApply (int delegate(ref Object key, ref Object value) dg){
287 implMissing(__FILE__,__LINE__);
288 return 0;
289 }
290
260 } 291 }