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

Unified Diff: client/samples/swarm/BiIterator.dart

Issue 9314024: Final CL to kill off client/samples . (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 11 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/samples/swarm/App.dart ('k') | client/samples/swarm/CSS.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/samples/swarm/BiIterator.dart
===================================================================
--- client/samples/swarm/BiIterator.dart (revision 3770)
+++ client/samples/swarm/BiIterator.dart (working copy)
@@ -1,67 +0,0 @@
-/**
- * An iterator that allows the user to move forward and backward though
- * a set of items. (Bi-directional)
- */
-class BiIterator<E> {
-
- /**
- * Provides forward and backward iterator functionality to keep track
- * which item is currently selected.
- */
- ObservableValue<int> currentIndex;
-
- /**
- * The collection of items we will be iterating through.
- */
- List<E> list;
-
- BiIterator(this.list, [List<ChangeListener> oldListeners = null])
- : currentIndex = new ObservableValue<int>(0) {
- if (oldListeners != null) {
- currentIndex.listeners = oldListeners;
- }
- }
-
- /**
- * Returns the next section from the sections, given the current
- * position. Returns the last source if there is no next section.
- */
- E next() {
- if (currentIndex.value < list.length - 1) {
- currentIndex.value += 1;
- }
- return list[currentIndex.value];
- }
-
- /**
- * Returns the current Section (page in the UI) that the user is
- * looking at.
- */
- E get current() {
- return list[currentIndex.value];
- }
-
- /**
- * Returns the previous section from the sections, given the current
- * position. Returns the front section if we are already at the front of
- * the list.
- */
- E previous() {
- if (currentIndex.value > 0) {
- currentIndex.value -= 1;
- }
- return list[currentIndex.value];
- }
-
- /**
- * Move the iterator pointer over so that it points to a given list item.
- */
- void jumpToValue(E val) {
- for (int i = 0; i < list.length; i++) {
- if (list[i] === val) {
- currentIndex.value = i;
- break;
- }
- }
- }
-}
« no previous file with comments | « client/samples/swarm/App.dart ('k') | client/samples/swarm/CSS.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698