comparison base/src/java/util/Collections.d @ 84:fcf926c91ca4

Added base classes
author Frank Benoit <benoit@tionex.de>
date Sat, 18 Apr 2009 09:25:29 +0200
parents 1bf55a6eb092
children bbe49769ec18
comparison
equal deleted inserted replaced
83:0628aaa2996c 84:fcf926c91ca4
71 this.it = it; 71 this.it = it;
72 } 72 }
73 public void add(Object o){ 73 public void add(Object o){
74 unsupported(); 74 unsupported();
75 } 75 }
76 public bool add(String o){ 76 public void add(String o){
77 unsupported(); 77 unsupported();
78 return false; // make compiler happy 78 return false; // make compiler happy
79 } 79 }
80 public bool hasNext(){ 80 public bool hasNext(){
81 return it.hasNext(); 81 return it.hasNext();
200 return list.toArray(); 200 return list.toArray();
201 } 201 }
202 public Object[] toArray(Object[] a){ 202 public Object[] toArray(Object[] a){
203 return list.toArray(a); 203 return list.toArray(a);
204 } 204 }
205 public String[] toArray(String[] a){
206 return list.toArray(a);
207 }
205 public int opApply (int delegate(ref Object value) dg){ 208 public int opApply (int delegate(ref Object value) dg){
206 implMissing(__FILE__, __LINE__ ); 209 implMissing(__FILE__, __LINE__ );
207 return 0; 210 return 0;
208 } 211 }
209 public int opApply (int delegate(ref Object key, ref Object value) dg){ 212 public int opApply (int delegate(ref Object key, ref Object value) dg){
210 implMissing(__FILE__, __LINE__ ); 213 implMissing(__FILE__, __LINE__ );
211 return 0; 214 return 0;
212 } 215 }
216 public String toString(){
217 return list.toString();
218 }
213 } 219 }
214 static int binarySearch(List list, Object key){ 220 static int binarySearch(List list, Object key){
215 implMissing( __FILE__, __LINE__ ); 221 implMissing( __FILE__, __LINE__ );
216 return 0; 222 return 0;
217 } 223 }
225 public static Map unmodifiableMap( Map list ){ 231 public static Map unmodifiableMap( Map list ){
226 implMissing( __FILE__, __LINE__ ); 232 implMissing( __FILE__, __LINE__ );
227 return null; 233 return null;
228 } 234 }
229 public static Set unmodifiableSet( Set list ){ 235 public static Set unmodifiableSet( Set list ){
236 implMissing( __FILE__, __LINE__ );
237 return null;
238 }
239 public static List singletonList( Object o ){
230 implMissing( __FILE__, __LINE__ ); 240 implMissing( __FILE__, __LINE__ );
231 return null; 241 return null;
232 } 242 }
233 public static Set singleton( Object o ){ 243 public static Set singleton( Object o ){
234 TreeSet res = new TreeSet(); 244 TreeSet res = new TreeSet();
278 public Object set(int index, Object element){ synchronized(this){ return this.list.set(index,element); } } 288 public Object set(int index, Object element){ synchronized(this){ return this.list.set(index,element); } }
279 public int size(){ synchronized(this){ return this.list.size(); } } 289 public int size(){ synchronized(this){ return this.list.size(); } }
280 public List subList(int fromIndex, int toIndex){ synchronized(this){ return this.list.subList(fromIndex,toIndex); } } 290 public List subList(int fromIndex, int toIndex){ synchronized(this){ return this.list.subList(fromIndex,toIndex); } }
281 public Object[] toArray(){ synchronized(this){ return this.list.toArray(); } } 291 public Object[] toArray(){ synchronized(this){ return this.list.toArray(); } }
282 public Object[] toArray(Object[] a){ synchronized(this){ return this.list.toArray(a); } } 292 public Object[] toArray(Object[] a){ synchronized(this){ return this.list.toArray(a); } }
293 public String[] toArray(String[] a){ synchronized(this){ return this.list.toArray(a); } }
294 public String toString(){ synchronized(this){ return this.list.toString(); } }
283 } 295 }
284 static List synchronizedList(List list){ 296 static List synchronizedList(List list){
285 return new SynchronizedList(list); 297 return new SynchronizedList(list);
286 } 298 }
287 299