SortbyValor.java 360 Bytes
Newer Older
1 2 3 4 5 6 7
import java.util.Comparator;

class SortbyValor implements Comparator<Carta>
{
    // Used for sorting in ascending order of
    // Ordenar por Palo
    public int compare(Carta a, Carta b)
8 9 10 11 12 13
    {   int aux1 = a.getValorInt();
        int aux2 = b.getValorInt();
        
        if (aux1 > aux2) return 1;
            else return -1 ;
        
14
    }
15 16
   
    
17
}