Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(66)

Side by Side Diff: editor/util/plugins/com.google.dart.java2dart/resources/java_core.dart

Issue 12391046: Add List.asMap(). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments. Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/serialization/lib/src/serialization_rule.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 library java.core; 1 library java.core;
2 2
3 import "dart:math" as math; 3 import "dart:math" as math;
4 import "dart:uri"; 4 import "dart:uri";
5 5
6 class JavaSystem { 6 class JavaSystem {
7 static int currentTimeMillis() { 7 static int currentTimeMillis() {
8 return (new DateTime.now()).millisecondsSinceEpoch; 8 return (new DateTime.now()).millisecondsSinceEpoch;
9 } 9 }
10 10
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after
308 elements.setRange(start, length, from, startFrom); 308 elements.setRange(start, length, from, startFrom);
309 } 309 }
310 310
311 void removeRange(int start, int length) { 311 void removeRange(int start, int length) {
312 elements.removeRange(start, length); 312 elements.removeRange(start, length);
313 } 313 }
314 314
315 void insertRange(int start, int length, [E fill]) { 315 void insertRange(int start, int length, [E fill]) {
316 elements.insertRange(start, length, fill); 316 elements.insertRange(start, length, fill);
317 } 317 }
318
319 Map<int, E> asMap() {
320 return elements.asMap();
321 }
318 } 322 }
319 323
320 class JavaIterator<E> { 324 class JavaIterator<E> {
321 Collection<E> _collection; 325 Collection<E> _collection;
322 List<E> _elements = new List<E>(); 326 List<E> _elements = new List<E>();
323 int _coPos = 0; 327 int _coPos = 0;
324 int _elPos = 0; 328 int _elPos = 0;
325 E _current = null; 329 E _current = null;
326 JavaIterator(this._collection) { 330 JavaIterator(this._collection) {
327 Iterator iterator = _collection.iterator; 331 Iterator iterator = _collection.iterator;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
375 return true; 379 return true;
376 } 380 }
377 return false; 381 return false;
378 } 382 }
379 383
380 void javaMapPutAll(Map target, Map source) { 384 void javaMapPutAll(Map target, Map source) {
381 source.forEach((k, v) { 385 source.forEach((k, v) {
382 target[k] = v; 386 target[k] = v;
383 }); 387 });
384 } 388 }
OLDNEW
« no previous file with comments | « no previous file | pkg/serialization/lib/src/serialization_rule.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698