"Arne Vajh?j" <arne@vajhoej.dk> wrote in message
news:4c3655fd$0$283$14726298@news.sunsite.dk...
On 08-07-2010 18:22, Boris Punk wrote:
Is there no BigList/BigHash in Java?
No.
But You can have a List<List<X>> which can then
store 4*10^18 X'es.
Or you could pretty easily build a class like
public class BigArray<T>
{
T get(long index);
void set(long index, T value);
}
backed by a two-dimensional array.[1] The reason I prefer to say "array"
rather than "List" is that random access into a sparse List is a bit
dicey, while arrays nicely let you set index 826727 even if you haven't
touched any of the earlier indices yet, and will tell you that the entry
at 6120584 is null, instead of throwing an exception.
Sure.
But the collections has the advantage of dynamic size.
I think the general trend is from arrays to collections.
With scientific computing as a major exception.