Skip to content

Instantly share code, notes, and snippets.

@thejavalistener
Last active August 29, 2015 13:56
Show Gist options
  • Save thejavalistener/9277135 to your computer and use it in GitHub Desktop.
Save thejavalistener/9277135 to your computer and use it in GitHub Desktop.
@Override
public int compare(T o1, T o2)
{
for(int i=0; i<keys.length; i++)
{
// tomo el i-esimo atributo de la clave
String key = keys[i][UIndex.KEY];
// obtengo los valores a comparar y comparo
Comparable<T> value1 = (Comparable<T>)UBean.invokeGetter(o1, key);
Comparable<T> value2 = (Comparable<T>)UBean.invokeGetter(o2, key);
int comp = value1.compareTo((T)value2);
// ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment