posted 18 years ago
Hi everybody,
I'm assuming that when an object is placed into a TreeSet that uses a custom Comparator, it's position is determined by Comparator.compare(). What if the object property that compare() uses changes after the object is already inserted into the set?
For example I may be keeping a TreeSet of Document objects sorted by their lastAccessedDate, and the lastAccessedDate of an object changes. Is there a way of making the TreeSet aware of this, or should I just remove the Document from the TreeSet before changing the date and reinsert it afterwards?
Thank you,
Yuriy