| | | | Browse by category |
Article ID: 2157
Last updated: 28 May, 2018
Question
Why IlpTree does not re-sorted after a change to an object in the tree?
Answer
The IlpTree is re-sorted when:
- An object is added to it or removed from it.
- The method IlpTree.sort() or IlpTree.getAdapter().sort() is invoked.
- A new comparator is set, using IlpTree.setSortComparator(). The Comparator instance must be a new instance (it must be !=). When changing the behavior of a mutable comparator, use the method IlpTree.sort() or IlpTree.getAdapter().sort() to notify the change.
The IlpTree does not sort automatically when the attributes of the objects are modified. This is by design, to improve performance. The rationale is that the sort order in a tree rarely depends on attributes that are subject to frequent changes. In the rare cases when these attributes are modified, you have to manually invoke IlpTree.sort() or IlpTree.getAdapter().sort() to notify the adapter of the change.
This article was:
Helpful |
Not helpful
Report an issue
Article ID: 2157
Last updated: 28 May, 2018
Revision: 3
Views: 637
Posted: 16 Aug, 2004 by
Dean J.
Updated: 28 May, 2018 by
Gargani A.
Also listed in
Others in this category
Powered by KBPublisher (Knowledge base software)