64-bit array functionality implemented via libraries?

james lowden jl0235 at yahoo.com
Tue Jun 2 05:59:40 PDT 2009


My preference for doing something like this would be to introducted a parallel LargeList/LargeCollection interface that used 64-bit indexing but otherwise shared semantics with the extant List/Collection interfaces, and have the [] access work for either, and then do the large array via a "LargeArrayList" (or something) implementation of the large list, probably represented internally as an array-of-arrays.  I'll toss something together at some point. . .


--- On Thu, 5/28/09, Mark Thornton <mthornton at optrak.co.uk> wrote:

> From: Mark Thornton <mthornton at optrak.co.uk>
> Subject: Re: 64-bit array functionality implemented via libraries?
> To: "Joe Darcy" <Joe.Darcy at Sun.COM>, coin-dev at openjdk.java.net
> Date: Thursday, May 28, 2009, 3:35 PM
> Joe Darcy wrote:
> > Hello.
> >
> > As another point in the design space, assuming
> indexing access syntax is 
> > available for user-defined types and the existence of
> collection 
> > literals, I'd like to see what implementing 64-bit
> array functionality 
> > via libraries would look like.
> >   
> Not quite sure what you are looking for here as the public
> interface 
> seems fairly obvious apart from minor details.
> 
> public abstract class LargeArray<T extends
> LargeArray> implements 
> Cloneable, Serializable {
>     public final long length;
>     protected LargeArray(long length) {...}
>     public T clone();
> }
> 
> public class LargeObjectArray<E> extends
> LargeArray<LargeObjectArray<E>> {
>     public LargeObjectArray(long length) {...}
>     public E get(long index) {...}
>     public void set(long index, E value) {...}
> }
> 
> public class LargeIntArray extends
> LargeArray<LargeIntArray> {
>     public LargeIntArray(long length) {...}
>     public int get(long index) {...}
>     public void set(long index, int value) {...}
> }
> 
> // etc for the other primitives
> 
> However this can only be used with the proposed [] access,
> if that is 
> not based on the existing List/Collection interfaces as
> they have 
> integer rather than long size and index types.
> 
> Mark Thornton
> 
> 
> 


      



More information about the coin-dev mailing list