| Package | system.data.iterators |
| Class | public class StringIterator |
| Inheritance | StringIterator Object |
| Implements | Iterator |
Example :
import system.data.Iterator ;
import system.data.iterators.StringIterator ;
var s:String = "Hello world" ;
var it:Iterator = new StringIterator(s) ;
it.seek( 1 ) ;
while( it.hasNext() )
{
var char:String = it.next() ;
trace( it.key() + ' : ' + char ) ;
}
trace (s) ;
| Method | Defined By | ||
|---|---|---|---|
StringIterator(s:String)
Creates a new StringIterator instance. | StringIterator | ||
hasNext():Boolean
Returns true if the iteration has more elements. | StringIterator | ||
key():*
Returns the current key of the internal pointer of the iterator (optional operation). | StringIterator | ||
next():*
Returns the next element in the iteration. | StringIterator | ||
remove():*
Removes from the underlying collection the last element returned by the iterator (optional operation). | StringIterator | ||
reset():void
Reset the internal pointer of the iterator (optional operation). | StringIterator | ||
seek(position:*):void
Change the position of the internal pointer of the iterator (optional operation). | StringIterator | ||
| StringIterator | () | Constructor |
public function StringIterator(s:String)Creates a new StringIterator instance.
Parameterss:String — the String object to enumerate.
|
| hasNext | () | method |
public function hasNext():Boolean
Returns true if the iteration has more elements.
Boolean — true if the iteration has more elements.
|
| key | () | method |
public function key():*Returns the current key of the internal pointer of the iterator (optional operation).
Returns* — the current key of the internal pointer of the iterator (optional operation).
|
| next | () | method |
public function next():*Returns the next element in the iteration.
Returns* — the next element in the iteration.
|
| remove | () | method |
public function remove():*Removes from the underlying collection the last element returned by the iterator (optional operation).
Returns* |
| reset | () | method |
public function reset():voidReset the internal pointer of the iterator (optional operation).
| seek | () | method |
public function seek(position:*):voidChange the position of the internal pointer of the iterator (optional operation).
Parameters
position:* |