adams.flow.transformer
Class SpreadSheetPlotGenerator.SortableRow

java.lang.Object
  extended by adams.flow.transformer.SpreadSheetPlotGenerator.SortableRow
All Implemented Interfaces:
Comparable<SpreadSheetPlotGenerator.SortableRow>
Enclosing class:
SpreadSheetPlotGenerator

public static class SpreadSheetPlotGenerator.SortableRow
extends Object
implements Comparable<SpreadSheetPlotGenerator.SortableRow>

Helper class for sorting rows.

Version:
$Revision: 4584 $
Author:
fracpete (fracpete at waikato dot ac dot nz)

Field Summary
protected  Comparable m_Index
          the index.
protected  boolean m_InvertSorting
          whether to invert the sorting order.
protected  SpreadSheet.Row m_Row
          the row.
 
Constructor Summary
SpreadSheetPlotGenerator.SortableRow(Comparable index, SpreadSheet.Row row, boolean invSort)
          Initializes the container.
 
Method Summary
 int compareTo(SpreadSheetPlotGenerator.SortableRow o)
          Compares this object with the specified object for order.
 Comparable getIndex()
          Returns the sort index.
 SpreadSheet.Row getRow()
          Returns the row payload.
 boolean isInvertSorting()
          Returns whether sorting is inverted.
 String toString()
          Returns a short string representation of the container.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_Index

protected Comparable m_Index
the index.


m_Row

protected SpreadSheet.Row m_Row
the row.


m_InvertSorting

protected boolean m_InvertSorting
whether to invert the sorting order.

Constructor Detail

SpreadSheetPlotGenerator.SortableRow

public SpreadSheetPlotGenerator.SortableRow(Comparable index,
                                            SpreadSheet.Row row,
                                            boolean invSort)
Initializes the container.

Parameters:
index - the index used for sorting
row - the row payload
invSort - whether to invert sorting
Method Detail

getIndex

public Comparable getIndex()
Returns the sort index.

Returns:
the index

getRow

public SpreadSheet.Row getRow()
Returns the row payload.

Returns:
the row

isInvertSorting

public boolean isInvertSorting()
Returns whether sorting is inverted.

Returns:
true if sorting is inverted

compareTo

public int compareTo(SpreadSheetPlotGenerator.SortableRow o)
Compares this object with the specified object for order. Returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object. Takes the inverted sorting into account.

Specified by:
compareTo in interface Comparable<SpreadSheetPlotGenerator.SortableRow>
Parameters:
o - the object to be compared.
Returns:
a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.
Throws:
ClassCastException - if the specified object's type prevents it from being compared to this object.
See Also:
isInvertSorting()

toString

public String toString()
Returns a short string representation of the container.

Overrides:
toString in class Object
Returns:
the string representation


Copyright © 2012 University of Waikato, Hamilton, NZ. All Rights Reserved.