level 12
如何给一个Point2D的List按照X的大小排序。。
2013年10月03日 09点10分
1
level 12
Collections.Sort()不能用于Point2D的List
2013年10月03日 09点10分
2
level 12
我建了一个新的ArrayList专门放X的值,然后用Collection.sort,再用原来的List按照这个来排序
2013年10月03日 09点10分
3
level 12
可是这样再重新排序的时候需要一个for循环套一个for循环,会慢很多。。
2013年10月03日 09点10分
4
level 12
所以求助各位大神,怎么在不自己写一个方法的情况下给Points2D的List排序。。
2013年10月03日 09点10分
6
level 1
Collections.sort(List, Comparator),自己实现一下 Comparator 接口就能用了。
2013年10月05日 07点10分
9