|| | |||Browse by category|
Why IlpTree does not re-sorted after a change to an object in the tree?
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.