Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Set : IEnumerable
- {
- public class SetEnumerator : IEnumerator
- {
- int index;
- Set set = null;
- public bool MoveNext()
- {
- index++;
- if (index >= set.GetSize())
- return false;
- else
- return true;
- }
- public object Current {
- get { return set.GetAtIndex(index); }
- }
- public void Reset()
- {
- index = -1;
- }
- public SetEnumerator(Set mySet)
- {
- this.set = mySet;
- Reset();
- }
- }
- public IEnumerator GetEnumerator()
- {
- return new SetEnumerator(this);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement