----- Original Message -----
From: "Morgan Delagrange" <[EMAIL PROTECTED]>
> > yeah, I think I did mean ArrayIterator.  The simple way of doing this
> > would be to use Array.getLength(array).  That does the checking for you.
> > It also lets you calculate the length once (in the constructor) so that
> > multiple calls to hasNext does not require the overhead of
> > Array.getLength(...).
>
> OK, sounds reasonable.  FWIW, it may make sense to optimize this class
> someday, so we don't perform unnecessary reflection on Object[] arrays.

Though I didn't think you could cast all arrays to Object[] so I'd prefer to
keep the reflection based implementation - I've certainly written code
before that needs it. e.g.

int[] foo = {1,2,3};
Object[] bar = (Object[]) foo;

The above is invalid.

James


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to