Mercurial > projects > dwt2
comparison base/src/java/util/ArrayList.d @ 84:fcf926c91ca4
Added base classes
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 18 Apr 2009 09:25:29 +0200 |
parents | 1bf55a6eb092 |
children | e944a4cf537b |
comparison
equal
deleted
inserted
replaced
83:0628aaa2996c | 84:fcf926c91ca4 |
---|---|
170 idx_next--; | 170 idx_next--; |
171 } | 171 } |
172 public void add(Object o){ | 172 public void add(Object o){ |
173 implMissing( __FILE__, __LINE__ ); | 173 implMissing( __FILE__, __LINE__ ); |
174 } | 174 } |
175 public bool add(String o){ | 175 public void add(String o){ |
176 implMissing( __FILE__, __LINE__ ); | 176 implMissing( __FILE__, __LINE__ ); |
177 return false; | 177 return false; |
178 } | 178 } |
179 public bool hasPrevious(){ | 179 public bool hasPrevious(){ |
180 return idx_next > 0; | 180 return idx_next > 0; |
264 if( data.length < a.length ){ | 264 if( data.length < a.length ){ |
265 a[data.length] = null; | 265 a[data.length] = null; |
266 } | 266 } |
267 return a; | 267 return a; |
268 } | 268 } |
269 String[] toArray(String[] a){ | |
270 version(Tango){ | |
271 auto res = a; | |
272 if( res.length < data.length ){ | |
273 res.length = data.length; | |
274 } | |
275 int idx = 0; | |
276 foreach( o; data ){ | |
277 res[idx] = stringcast(o); | |
278 } | |
279 return res; | |
280 } else { // Phobos | |
281 implMissing( __FILE__, __LINE__ ); | |
282 return null; | |
283 } | |
284 } | |
269 | 285 |
270 // only for D | 286 // only for D |
271 public int opApply (int delegate(ref Object value) dg){ | 287 public int opApply (int delegate(ref Object value) dg){ |
272 foreach( o; data ){ | 288 foreach( o; data ){ |
273 auto res = dg( o ); | 289 auto res = dg( o ); |
274 if( res ) return res; | 290 if( res ) return res; |
275 } | 291 } |
276 return 0; | 292 return 0; |
277 } | 293 } |
294 public String toString(){ | |
295 return super.toString(); | |
296 } | |
278 } | 297 } |
279 | 298 |