commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leo Sutic <leo.su...@gmail.com>
Subject Re: [lang] ArrayUtils monster file
Date Wed, 28 Jul 2004 12:09:09 GMT
On Wed, 28 Jul 2004 12:45:45 +0100 (BST), Stephen Colebourne
<scolebourne@btopenworld.com> wrote:
> 1) This change should only be supported if it moves
> methods not yet released.
> 
> 2) The new utils class must have a clear scope, which
> will give it a clear name.
> 
> 3) Size is not the first factor, API is.
> 
> In this case, the intent of the
> add/addAll/remove/indexOf methods is to make an array
> look and behave like a list, hence ArrayAsListUtils.

How about making it an adapter class?

public class ArrayListAdapter implements List {

    private static class IntArrayAdapter {}
    ...

    public ArrayListAdapter (Object[] array) {}
    public ArrayListAdapter (int[] array) {}
    public ArrayListAdapter (double[] array) {}
    public ArrayListAdapter (boolean[] array) {}

    public Object[] getArray () { ... }

}

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message