net.codescore.ui.components.list.renderers
Class ListComparator<T>

java.lang.Object
  extended by net.codescore.ui.components.list.renderers.ListComparator<T>
All Implemented Interfaces:
Comparator<T>
Direct Known Subclasses:
ProbBrowseRenderer.ProblemSorter, ScoreboardRenderer.ScoreboardSorter, SimpleCompetitionRenderer.CompetitionSorter, SimplePersonRenderer.PersonSorter, SimpleSchoolRenderer.SchoolSorter, SimpleTeamRenderer.TeamSorter, TestCaseRenderer.ScoreboardSorter

public abstract class ListComparator<T>
extends Object
implements Comparator<T>


Field Summary
private  int col
           
private  FullRenderer.Direction dir
           
 
Constructor Summary
ListComparator(int c, FullRenderer.Direction d)
           
 
Method Summary
protected  int checkDir(int rv)
           
 int getCol()
           
 FullRenderer.Direction getDir()
           
 
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
compare, equals
 

Field Detail

col

private final int col

dir

private final FullRenderer.Direction dir
Constructor Detail

ListComparator

public ListComparator(int c,
                      FullRenderer.Direction d)
Method Detail

getCol

public int getCol()

getDir

public FullRenderer.Direction getDir()

checkDir

protected int checkDir(int rv)
Parameters:
rv - The return value of the comparator
Returns:
rv*-1 if dir is desc, rv if dir is asc


Copyright 2008 © Adam Cornett, Andrew Conner All Rights Reserved.