edu.mssm.crover.tables.treatments
Class SortTableTreatment

java.lang.Object
  |
  +--edu.mssm.crover.tables.treatments.SortTableTreatment

public class SortTableTreatment
extends java.lang.Object

The interface that all treatment must implement.


Nested Class Summary
 class SortTableTreatment.RowIteratorComparator
           
 
Field Summary
protected  java.lang.Object parameter
          Stores the optional treatment parameter.
 
Constructor Summary
SortTableTreatment()
           
SortTableTreatment(java.lang.Object param)
          Initialize a new TableTreatment, with a parameter.
 
Method Summary
protected  int comparator(Table.RowIterator a, Table.RowIterator b)
          Compares two instances of RowIterator.
 java.lang.Object getParameter()
          Returns a parameter that could have been initialized when the treatment was created.
protected  int getSortColumnIndex()
           
protected  Table getSource()
           
 void setSortColumn(Table source, java.lang.String idf)
          Sets the column index on which the sort will be made.
 Table sort(Table source, java.lang.String columnIdentifier)
          Returns a table which is sorted according to the identified column.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

parameter

protected java.lang.Object parameter
Stores the optional treatment parameter.

Constructor Detail

SortTableTreatment

public SortTableTreatment(java.lang.Object param)
Initialize a new TableTreatment, with a parameter. This class does not care.

See Also:
getParameter()

SortTableTreatment

public SortTableTreatment()
Method Detail

getParameter

public java.lang.Object getParameter()
Returns a parameter that could have been initialized when the treatment was created. You know what you pass as the parameter.


getSource

protected Table getSource()

setSortColumn

public void setSortColumn(Table source,
                          java.lang.String idf)
                   throws InvalidColumnException
Sets the column index on which the sort will be made.

InvalidColumnException

getSortColumnIndex

protected final int getSortColumnIndex()

sort

public Table sort(Table source,
                  java.lang.String columnIdentifier)
           throws TreatmentInterrupted,
                  InvalidColumnException
Returns a table which is sorted according to the identified column.

TreatmentInterrupted
InvalidColumnException

comparator

protected int comparator(Table.RowIterator a,
                         Table.RowIterator b)
Compares two instances of RowIterator. The default implementation returns 0 for any a and b, so the sort is unvariant.



Copyright @ 2003 Mount Sinai School of Medicine. All Rights Reserved.