Dart.PowerTCP.Zip Namespace > Archive Class : GetEnumerator Method |
Public Function GetEnumerator() As IEnumerator
Dim instance As Archive Dim value As IEnumerator value = instance.GetEnumerator()
public IEnumerator GetEnumerator()
public: IEnumerator* GetEnumerator();
public: IEnumerator^ GetEnumerator();
Enumerators only allow reading the data in the collection. Enumerators cannot be used to modify the underlying collection.
Initially, the enumerator is positioned before the first element in the collection. IEnumerator.Resetalso brings the enumerator back to this position. At this position, calling IEnumerator.Current throws an exception. Therefore, you must call IEnumerator.MoveNext to advance the enumerator to the first element of the collection before reading the value of IEnumerator.Current.
IEnumerator.Current returns the same object until either IEnumerator.MoveNext or IEnumerator.Reset is called. IEnumerator.MoveNext sets IEnumerator.Current to the next element.
After the end of the collection is passed, the enumerator is positioned after the last element in the collection, and calling IEnumerator.MoveNext returns false. If the last call to IEnumerator.MoveNext returned false, calling IEnumerator.Current throws an exception. To set IEnumerator.Current to the first element of the collection again, you can call IEnumerator.Reset followed by IEnumerator.MoveNext.
This method is used by the "foreach" construct.