× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Java is very safe, you have to know the collection classes, they're
complicated. You can always do what you need to do.

On Wed, Jul 5, 2017 at 4:48 PM, John Yeung <gallium.arsenide@xxxxxxxxx>
wrote:

On Wed, Jul 5, 2017 at 1:46 PM, jacobus erps <jacobus.erps@xxxxxxxxx>
wrote:
So we *shouldn't* mutate the keys, but what if we do anyway? Can the
tree become corrupted?

I think it's just like using a Java Map.
You can put any object in it as key as long as it supports the compareTo
method (defined at Object).

When you add a key/item pair the key will be inserted inbetween the other
keys in the right order.
This order won't change; it's fixed.
So if you change the key in some way which affects the sorting order, the
sorting order won't reflect the position in the map. So yes, then it's
corrupt. You just should not do that, the same with Java.

Wow. Really? I didn't expect that Java would let you do that. I don't
know Java very well, but I thought it was supposed to be a very "safe"
language.

John Y.
--
This is the IBMi Open Source Roundtable (OpenSource) mailing list
To post a message email: OpenSource@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/opensource
or email: OpenSource-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/opensource.





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.