com.mindprod.csv
Class CSVSort.SortableCSVRow

java.lang.Object
  extended by com.mindprod.csv.CSVSort.SortableCSVRow
All Implemented Interfaces:
java.lang.Comparable<CSVSort.SortableCSVRow>
Enclosing class:
CSVSort

 class CSVSort.SortableCSVRow
extends java.lang.Object
implements java.lang.Comparable<CSVSort.SortableCSVRow>


Constructor Summary
CSVSort.SortableCSVRow(java.lang.String[] fields, java.lang.String[] leadComments, java.lang.String tailComment)
          constructor
 
Method Summary
 int compareTo(CSVSort.SortableCSVRow other)
          Sort on arbitrary list of columns.
(package private)  void emit(CSVWriter w)
          output this row to a CSVWriter, including comments
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CSVSort.SortableCSVRow

CSVSort.SortableCSVRow(java.lang.String[] fields,
                       java.lang.String[] leadComments,
                       java.lang.String tailComment)
constructor

Parameters:
fields - List of fields to sort on
leadComments - comment lines prior to the this row, without lead #
tailComment - line on tail ent of line. null if so such comment, without lead #
Method Detail

compareTo

public final int compareTo(CSVSort.SortableCSVRow other)
Sort on arbitrary list of columns. Defines default the sort order for SortableCSVRow Objects. Compare this SortableCSVRow with another SortableCSVRow with JDK 1.5+ generics. Compares key then key2 then key3. Informally, returns (this-other) or +ve if this is more positive than other.

Specified by:
compareTo in interface java.lang.Comparable<CSVSort.SortableCSVRow>
Parameters:
other - other SortableCSVRow to compare with this one
Returns:
+ve if this>other, 0 if this==other, -ve if this<other

emit

void emit(CSVWriter w)
output this row to a CSVWriter, including comments

Parameters:
w - handle to CSVWriter