我需要基于包含数字,数字字母,字母的字符串对bean arraylist进行排序。
例如,{10,11,12 ,11A,SA,AD,FF}
应该显示为10,11,11A,12,AD,FF,SA
。我尝试了下面的代码
ComparatorChain comparatorChain = new ComparatorChain();
Comparator comparator = new BeanComparator("tagId", new NullComparator(
true));
comparatorChain.addComparator(comparator);
Collections.sort(nonGroupLineROList, comparatorChain);
的结果
{10,11,2,12 ,11A,SA,AD,FF}
是
{10,11,11A,12,2,AD,FF,SA}
预期结果是
{2.10,11,11A,12,AD,FF,SA}