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

Unified Diff: client/dom/src/_Lists.dart

Issue 9845043: Rename client/{dom,html} to lib/{dom,html} . (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/dom/src/_ListIterators.dart ('k') | client/dom/src/_XMLHttpRequestUtils.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/dom/src/_Lists.dart
===================================================================
--- client/dom/src/_Lists.dart (revision 5796)
+++ client/dom/src/_Lists.dart (working copy)
@@ -1,68 +0,0 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-class _Lists {
-
- /**
- * Returns the index in the array [a] of the given [element], starting
- * the search at index [startIndex] to [endIndex] (exclusive).
- * Returns -1 if [element] is not found.
- */
- static int indexOf(List a,
- Object element,
- int startIndex,
- int endIndex) {
- if (startIndex >= a.length) {
- return -1;
- }
- if (startIndex < 0) {
- startIndex = 0;
- }
- for (int i = startIndex; i < endIndex; i++) {
- if (a[i] == element) {
- return i;
- }
- }
- return -1;
- }
-
- /**
- * Returns the last index in the array [a] of the given [element], starting
- * the search at index [startIndex] to 0.
- * Returns -1 if [element] is not found.
- */
- static int lastIndexOf(List a, Object element, int startIndex) {
- if (startIndex < 0) {
- return -1;
- }
- if (startIndex >= a.length) {
- startIndex = a.length - 1;
- }
- for (int i = startIndex; i >= 0; i--) {
- if (a[i] == element) {
- return i;
- }
- }
- return -1;
- }
-
- /**
- * Returns a sub list copy of this list, from [start] to
- * [:start + length:].
- * Returns an empty list if [length] is 0.
- * Throws an [IllegalArgumentException] if [length] is negative.
- * Throws an [IndexOutOfRangeException] if [start] or
- * [:start + length:] are out of range.
- */
- static List getRange(List a, int start, int length, List accumulator) {
- if (length < 0) throw new IllegalArgumentException('length');
- if (start < 0) throw new IndexOutOfRangeException(start);
- int end = start + length;
- if (end > a.length) throw new IndexOutOfRangeException(end);
- for (int i = start; i < end; i++) {
- accumulator.add(a[i]);
- }
- return accumulator;
- }
-}
« no previous file with comments | « client/dom/src/_ListIterators.dart ('k') | client/dom/src/_XMLHttpRequestUtils.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698