You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by sc...@btopenworld.com on 2002/09/17 12:21:16 UTC

[lang][collections] ArrayUtils

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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [lang][collections] ArrayUtils

Posted by Daniel Rall <dl...@finemaltcoding.com>.
Steve Downey <st...@netfolio.com> writes:

> Many bits and pieces of util have graduated, though, into lang and 
> collections. 
> 
> I don't know how much momentum can be built around a subproject of 'useful 
> code with no natural home', which is the usual operating definition of util.
> 
> What is frustrating, though, is that almost every project has one, and there 
> is a lot of overlap.

Yes, I find it frustrating as well.  I created [util] in the first
place to try and address the overlap, and it has had success in that
it has propogated its code into more specific projects like [lang],
[collections], [io], and [codec].
-- 

Daniel Rall <dl...@finemaltcoding.com>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [lang][collections] ArrayUtils

Posted by Steve Downey <st...@netfolio.com>.
Many bits and pieces of util have graduated, though, into lang and 
collections. 

I don't know how much momentum can be built around a subproject of 'useful 
code with no natural home', which is the usual operating definition of util.

What is frustrating, though, is that almost every project has one, and there 
is a lot of overlap.


On Tuesday 17 September 2002 06:25 pm, Daniel Rall wrote:
> scolebourne@btopenworld.com writes:
> > 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
> > - ...
>
> I equate array operations more with [lang] than [collections] because
> arrays are a core element of the Java language.  The existence of
> java.util.Arrays also points to [util], but since that project may
> never graduate from the sandbox, I favor [lang].


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [lang][collections] ArrayUtils

Posted by Daniel Rall <dl...@finemaltcoding.com>.
scolebourne@btopenworld.com writes:

> 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
> - ...

I equate array operations more with [lang] than [collections] because
arrays are a core element of the Java language.  The existence of
java.util.Arrays also points to [util], but since that project may
never graduate from the sandbox, I favor [lang].
-- 

Daniel Rall <dl...@finemaltcoding.com>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [lang][collections] ArrayUtils

Posted by Henri Yandell <ba...@generationjava.com>.
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 scolebourne@btopenworld.com 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:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>