标签:
public List<OrderItemAttributeDispInfoBean> sortOrderItemAttributes(List<OrderItemAttributeDispInfoBean> orderItemAttributes){ Collections.sort( orderItemAttributes, new Comparator<OrderItemAttributeDispInfoBean>(){ public int compare(OrderItemAttributeDispInfoBean o1,OrderItemAttributeDispInfoBean o2){ return ( o1.getDisplaySequence() - o2.getDisplaySequence()) > 0 ? 1: -1; } } ); return orderItemAttributes; }
Collections.sort new Compartor<> 用法
标签:
原文地址:http://my.oschina.net/zzzGA/blog/382392