comparison base/src/java/util/TreeMap.d @ 120:536e43f63c81

Comprehensive update for Win32/Linux32 dmd-2.053/dmd-1.068+Tango-r5661 ===D2=== * added [Try]Immutable/Const/Shared templates to work with differenses in D1/D2 instead of version statements used these templates to work with strict type storage rules of dmd-2.053 * com.ibm.icu now also compilable with D2, but not tested yet * small fixes Snippet288 - shared data is in TLS ===Phobos=== * fixed critical bugs in Phobos implemention completely incorrect segfault prone fromStringz (Linux's port ruthless killer) terrible, incorrect StringBuffer realization (StyledText killer) * fixed small bugs as well Snippet72 - misprint in the snippet * implemented missed functionality for Phobos ByteArrayOutputStream implemented (image loading available) formatting correctly works for all DWT's cases As a result, folowing snippets now works with Phobos (Snippet### - what is fixed): Snippet24, 42, 111, 115, 130, 235, 276 - bad string formatting Snippet48, 282 - crash on image loading Snippet163, 189, 211, 213, 217, 218, 222 - crash on copy/cut in StyledText Snippet244 - hang-up ===Tango=== * few changes for the latest Tango trunc-r5661 * few small performance improvments ===General=== * implMissing-s for only one version changed to implMissingInTango/InPhobos * incorrect calls to Format in toString-s fixed * fixed loading \uXXXX characters in ResourceBundle * added good UTF-8 support for StyledText, TextLayout (Win32) and friends UTF functions revised and tested. It is now in java.nonstandard.*Utf modules StyledText and TextLayout (Win32) modules revised for UTF-8 support * removed small diferences in most identical files in *.swt.* folders *.swt.internal.image, *.swt.events and *.swt.custom are identical in Win32/Linux32 now 179 of 576 (~31%) files in *.swt.* folders are fully identical * Win32: snippets now have right subsystem, pretty icons and native system style controls * small fixes in snippets Snippet44 - it's not Snippet44 Snippet212 - functions work with different images and offsets arrays Win32: Snippet282 - crash on close if the button has an image Snippet293 - setGrayed is commented and others Win32: As a result, folowing snippets now works Snippet68 - color doesn't change Snippet163, 189, 211, 213, 217, 218, 222 - UTF-8 issues (see above) Snippet193 - no tabel headers
author Denis Shelomovskij <verylonglogin.reg@gmail.com>
date Sat, 09 Jul 2011 15:50:20 +0300
parents bbe49769ec18
children
comparison
equal deleted inserted replaced
119:d00e8db0a568 120:536e43f63c81
25 25
26 public this(){ 26 public this(){
27 version(Tango){ 27 version(Tango){
28 map = new MapType(); 28 map = new MapType();
29 } else { // Phobos 29 } else { // Phobos
30 implMissing( __FILE__, __LINE__ ); 30 implMissingInPhobos();
31 } 31 }
32 } 32 }
33 public this(Comparator c){ 33 public this(Comparator c){
34 implMissing( __FILE__, __LINE__ ); 34 implMissing( __FILE__, __LINE__ );
35 } 35 }
41 } 41 }
42 public void clear(){ 42 public void clear(){
43 version(Tango){ 43 version(Tango){
44 map.clear(); 44 map.clear();
45 } else { // Phobos 45 } else { // Phobos
46 implMissing( __FILE__, __LINE__ ); 46 implMissingInPhobos();
47 } 47 }
48 } 48 }
49 Comparator comparator(){ 49 Comparator comparator(){
50 implMissing( __FILE__, __LINE__ ); 50 implMissing( __FILE__, __LINE__ );
51 return null; 51 return null;
53 public bool containsKey(Object key){ 53 public bool containsKey(Object key){
54 version(Tango){ 54 version(Tango){
55 Object v; 55 Object v;
56 return map.get(key, v ); 56 return map.get(key, v );
57 } else { // Phobos 57 } else { // Phobos
58 implMissing( __FILE__, __LINE__ ); 58 implMissingInPhobos();
59 return false; 59 return false;
60 } 60 }
61 } 61 }
62 public bool containsKey(String key){ 62 public bool containsKey(String key){
63 return containsKey(stringcast(key)); 63 return containsKey(stringcast(key));
64 } 64 }
65 public bool containsValue(Object value){ 65 public bool containsValue(Object value){
66 version(Tango){ 66 version(Tango){
67 return map.contains(value); 67 return map.contains(value);
68 } else { // Phobos 68 } else { // Phobos
69 implMissing( __FILE__, __LINE__ ); 69 implMissingInPhobos();
70 return false; 70 return false;
71 } 71 }
72 } 72 }
73 public Set entrySet(){ 73 public Set entrySet(){
74 version(Tango){ 74 version(Tango){
76 foreach( k, v; map ){ 76 foreach( k, v; map ){
77 res.add( new MapEntry(this,k) ); 77 res.add( new MapEntry(this,k) );
78 } 78 }
79 return res; 79 return res;
80 } else { // Phobos 80 } else { // Phobos
81 implMissing( __FILE__, __LINE__ ); 81 implMissingInPhobos();
82 return null; 82 return null;
83 } 83 }
84 } 84 }
85 public override equals_t opEquals(Object o){ 85 public override equals_t opEquals(Object o){
86 version(Tango){ 86 version(Tango){
96 } 96 }
97 return true; 97 return true;
98 } 98 }
99 return false; 99 return false;
100 } else { // Phobos 100 } else { // Phobos
101 implMissing( __FILE__, __LINE__ ); 101 implMissingInPhobos();
102 return false; 102 return false;
103 } 103 }
104 } 104 }
105 Object firstKey(){ 105 Object firstKey(){
106 version(Tango){ 106 version(Tango){
107 foreach( k; map ){ 107 foreach( k; map ){
108 return k; 108 return k;
109 } 109 }
110 throw new tango.core.Exception.NoSuchElementException( "TreeMap.firstKey" ); 110 throw new tango.core.Exception.NoSuchElementException( "TreeMap.firstKey" );
111 } else { // Phobos 111 } else { // Phobos
112 implMissing( __FILE__, __LINE__ ); 112 implMissingInPhobos();
113 return null; 113 return null;
114 } 114 }
115 } 115 }
116 public Object get(Object key){ 116 public Object get(Object key){
117 implMissing( __FILE__, __LINE__ ); 117 implMissing( __FILE__, __LINE__ );
134 } 134 }
135 public bool isEmpty(){ 135 public bool isEmpty(){
136 version(Tango){ 136 version(Tango){
137 return map.isEmpty(); 137 return map.isEmpty();
138 } else { // Phobos 138 } else { // Phobos
139 implMissing( __FILE__, __LINE__ ); 139 implMissingInPhobos();
140 return false; 140 return false;
141 } 141 }
142 } 142 }
143 public Set keySet(){ 143 public Set keySet(){
144 version(Tango){ 144 version(Tango){
146 foreach( k; map ){ 146 foreach( k; map ){
147 res.add( k ); 147 res.add( k );
148 } 148 }
149 return res; 149 return res;
150 } else { // Phobos 150 } else { // Phobos
151 implMissing( __FILE__, __LINE__ ); 151 implMissingInPhobos();
152 return null; 152 return null;
153 } 153 }
154 } 154 }
155 Object lastKey(){ 155 Object lastKey(){
156 version(Tango){ 156 version(Tango){
159 res = k; 159 res = k;
160 } 160 }
161 if( map.size() ) return res; 161 if( map.size() ) return res;
162 throw new tango.core.Exception.NoSuchElementException( "TreeMap.lastKey" ); 162 throw new tango.core.Exception.NoSuchElementException( "TreeMap.lastKey" );
163 } else { // Phobos 163 } else { // Phobos
164 implMissing( __FILE__, __LINE__ ); 164 implMissingInPhobos();
165 return null; 165 return null;
166 } 166 }
167 } 167 }
168 public Object put(Object key, Object value){ 168 public Object put(Object key, Object value){
169 version(Tango){ 169 version(Tango){
173 return res; 173 return res;
174 } 174 }
175 map[key] = value; 175 map[key] = value;
176 return null; 176 return null;
177 } else { // Phobos 177 } else { // Phobos
178 implMissing( __FILE__, __LINE__ ); 178 implMissingInPhobos();
179 return null; 179 return null;
180 } 180 }
181 } 181 }
182 public Object put(String key, Object value){ 182 public Object put(String key, Object value){
183 return put(stringcast(key), value); 183 return put(stringcast(key), value);
197 version(Tango){ 197 version(Tango){
198 Object res; 198 Object res;
199 map.take(key,res); 199 map.take(key,res);
200 return res; 200 return res;
201 } else { // Phobos 201 } else { // Phobos
202 implMissing( __FILE__, __LINE__ ); 202 implMissingInPhobos();
203 return null; 203 return null;
204 } 204 }
205 } 205 }
206 public Object remove(String key){ 206 public Object remove(String key){
207 return remove(stringcast(key)); 207 return remove(stringcast(key));
208 } 208 }
209 public int size(){ 209 public int size(){
210 version(Tango){ 210 version(Tango){
211 return map.size(); 211 return map.size();
212 } else { // Phobos 212 } else { // Phobos
213 implMissing( __FILE__, __LINE__ ); 213 implMissingInPhobos();
214 return 0; 214 return 0;
215 } 215 }
216 } 216 }
217 SortedMap subMap(Object fromKey, Object toKey){ 217 SortedMap subMap(Object fromKey, Object toKey){
218 implMissing( __FILE__, __LINE__ ); 218 implMissing( __FILE__, __LINE__ );
228 foreach( k, v; map ){ 228 foreach( k, v; map ){
229 res.add( v ); 229 res.add( v );
230 } 230 }
231 return res; 231 return res;
232 } else { // Phobos 232 } else { // Phobos
233 implMissing( __FILE__, __LINE__ ); 233 implMissingInPhobos();
234 return null; 234 return null;
235 } 235 }
236 } 236 }
237 237
238 public int opApply (int delegate(ref Object value) dg){ 238 public int opApply (int delegate(ref Object value) dg){
239 version(Tango){ 239 version(Tango){
240 return map.opApply( dg ); 240 return map.opApply( dg );
241 } else { // Phobos 241 } else { // Phobos
242 implMissing( __FILE__, __LINE__ ); 242 implMissingInPhobos();
243 return 0; 243 return 0;
244 } 244 }
245 } 245 }
246 public int opApply (int delegate(ref Object key, ref Object value) dg){ 246 public int opApply (int delegate(ref Object key, ref Object value) dg){
247 version(Tango){ 247 version(Tango){
248 return map.opApply( dg ); 248 return map.opApply( dg );
249 } else { // Phobos 249 } else { // Phobos
250 implMissing( __FILE__, __LINE__ ); 250 implMissingInPhobos();
251 return 0; 251 return 0;
252 } 252 }
253 } 253 }
254 } 254 }
255 255