[Mono-list] ArrayList.GetEnumerator

Nick Drochak ndrochak@gol.com
Sun, 4 Nov 2001 17:01:35 +0900


> May be an internal class prove to be of more 
> value than a private class since the class will then be 
> available to other classes in the assembly and if required 
> can be used in relevant places.
> 
>     What do you say Nick?

This is a good idea, except the enumerator class has to know it is
enumerating an ArrayList.  It's not that useful as an enumerator for
anything else. It also has to be an enumerator of an *instance* of an
ArrayList, so should be provided by a method of an instance.  It
wouldn't be much use for another class, even one within the same
assembly, to just create this enumerator out of thin air. 

Because of these reasons it might be best just as a private class of
ArrayList.  Any other class that provides an enumerator will probably
need to do the same.

Does this make sense?

Nick D.