Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [collections-dev] Visibility of AbstractImmutableList + sublist method

Andrew,

 

Thanks for reporting this.

This is a bug and I have created a tracking issue on GitHub: https://github.com/eclipse/eclipse-collections/issues/298

Instead of casting to an implementation, you can cast it to an interface which supports subList(). I have provided a work around on the GitHub issue as well.

 

Regarding making AbstractImmutableList visible, it is a design choice. We like to keep our immutable hierarchy as private/protected as possible.

 

Thanks,

Nikhil.

 

_________________________________________

Nikhil J. Nanivadekar

_________________________________________
The Goldman Sachs Group, Inc. All rights reserved.

See http://www.gs.com/disclaimer/global_email for important risk disclosures, conflicts of interest and other terms and conditions relating to this e-mail and your reliance on information contained in it.  This message may contain confidential or privileged information.  If you are not the intended recipient, please advise us immediately and delete this message.  See http://www.gs.com/disclaimer/email for further information on confidentiality and the risks of non-secure electronic communication.  If you cannot access these links, please notify us by reply message and we will send the contents to you.

 

 

From: collections-dev-bounces@xxxxxxxxxxx [mailto:collections-dev-bounces@xxxxxxxxxxx] On Behalf Of Andrew White
Sent: Wednesday, August 02, 2017 7:55 AM
To: collections-dev@xxxxxxxxxxx
Subject: [collections-dev] Visibility of AbstractImmutableList + sublist method

 

I am trying to build a sublist from a ListIterable. I found no clear way to do this other than to try to cast to an implementation that supports sublist and falling back on a range copy if the casts fail. However, unlike AbstractMutableList, AbstractImmutableList is not public and thus not visible to my code. 

 

First, is this by design? And second, is there a better way to get a "view" of a "slice" of a ListIterable that I am missing?

 

Thanks,

Andrew White


Back to the top