org.mentawai.tag.util
Class ListSorter

java.lang.Object
  extended by org.mentawai.tag.util.ListSorter
All Implemented Interfaces:
Comparator<Object>

public class ListSorter
extends Object
implements Comparator<Object>


Constructor Summary
ListSorter(String campo)
           
 
Method Summary
 int compare(Object first, Object second)
           
 int compareBy(Object primeiro, Object segundo)
           
static List<Object> sort(List<Object> lista, String campo, boolean reverse)
          Metodo responsavel por retorna uma lista de Object ordenada pelo nome do campo informado
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Comparator
equals
 

Constructor Detail

ListSorter

public ListSorter(String campo)
Method Detail

compare

public int compare(Object first,
                   Object second)
Specified by:
compare in interface Comparator<Object>

compareBy

public int compareBy(Object primeiro,
                     Object segundo)

sort

public static List<Object> sort(List<Object> lista,
                                String campo,
                                boolean reverse)
Metodo responsavel por retorna uma lista de Object ordenada pelo nome do campo informado

Parameters:
lista -
campo -
reverse -
Returns:
list sorted


Copyright © 2013. All Rights Reserved.