求详解ViewerSorter接口

yongger520 2013-03-05 08:46:24
Useful APIs defined by ViewerSorter include:

category(Object) Returns the category of the given element.
compare(Viewer, Object, Object) Returns a negative, zero, or positive number depending on whether the first element is less than, equal to, or greater than the second element.

getCollator() Returns the collator used to sort strings.

isSorterProperty(Object, String)
Returns whether this viewer sorter would be affected by a change to the given property of the given element.

sort(Viewer viewer, Object[])
Sorts the given elements in place, modifying the given array
前两方法不用介绍,后三个方法哪位能介绍下,最后给例子,不知道具体作用是什么

...全文
25 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧