Other ones I'd expect an ArrayUtils to consider:

converting long[] to Long[] etc. Or List<Long>.
reversing an array. I think CollectionUtils currently has that.
some kind of 'map' method? So I would do:
ArrayUtils.map(array, function);

where function was defined as [one of your Pattern transformers?]

Interface Function:
    Object eval(Object)

except it would automatically convert down to primitives etc.

Then there would be Matrix style methods:

flipMatrix(Object) which would take say a long[3][4] and convert it to
long[4][3]. Not sure that could be easy to do as it would have to handle
long[3][4][5] as well and stuff.
Would be a map method on the Matrix style arrays too. I forget the proper
name, nested arrays? double arrays? ack.

Other ones....

Maybe something to make copying an array easier.
public Object[] arraycopy(Object[]) or
public void arraycopy(Object[], Object[]) for when you want to do a plain
copy and not all the indexes.

Possibly a typed convert method.
So:  public long[] toLongPrimitive(Long[]) so coders would do:
long[] lns =
ArrayUtils.toLongPrimitive((Long[])list.toArray(ArrayUtils.EMPTY_LONG));

ack. quite painful :)


S'all that springs to mind currently....

On Tue, 17 Sep 2002 [EMAIL PROTECTED] wrote:

> So, which project gets ArrayUtils? [lang] or [collections]?
>
> Things on an ArrayUtils would be
> - a simple toString for arrays based on the ToStringBuilder.
> - Empty array constants for the different array types
> - ...
>
> Stephen
>
> --
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>


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

Reply via email to