- Some deflexing of the low-level narya stuff. More to come, as we're

going to want the minimum client to be flex-free.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4507 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2007-01-22 19:58:24 +00:00
parent d10b94df85
commit e6c38e81c6
11 changed files with 206 additions and 95 deletions
@@ -1,5 +1,7 @@
package com.threerings.util {
import flash.errors.IllegalOperationError;
/**
* Provides a generic iterator for an Array.
* No co-modification checking is done.
@@ -25,13 +27,29 @@ public class ArrayIterator
// documentation inherited from interface Iterator
public function next () :Object
{
_lastIndex = _index;
return _arr[_index++];
}
// documentation inherited from interface Iterator
public function remove () :void
{
if (_lastIndex == -1) {
throw new IllegalOperationError();
} else {
_arr.splice(_lastIndex, 1);
_lastIndex = -1;
}
}
/** The array we're iterating over. */
protected var _arr :Array;
/** The current index. */
protected var _index :int;
/** The last-removed index. */
protected var _lastIndex :int = -1;
}
}