org.jbudget.gui.month
Class TableColumnSorter

java.lang.Object
  extended by org.jbudget.gui.month.TableColumnSorter
Direct Known Subclasses:
DefaultTableColumnSorter

public abstract class TableColumnSorter
extends java.lang.Object

Interface that is used by classes that can be used to sort the columns in the DatesInfoTable. Each column in this table is labeled by a MoneyPit object, so the TableColumSorter operates on these objects.

Author:
Dmitri Petrov

Field Summary
static java.lang.String xmlNodeName
          Name of the XML element that represents instances of TableColumnSorter.
 
Constructor Summary
TableColumnSorter()
           
 
Method Summary
abstract  int getInsertionPoint(org.jbudget.Core.MoneyPit item, java.util.List<org.jbudget.Core.MoneyPit> otherItems)
          Returns the index of the a given MoneyPit that should be inserted in a given list of items.
static TableColumnSorter getInstance(Element element)
          Creates a new TableColumnSorter instance using the information provided in a given JDOM Element.
abstract  Element getXmlElement()
          Returns the XML Element representing the concrete implmenetation of the TableColumnSorter interface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xmlNodeName

public static java.lang.String xmlNodeName
Name of the XML element that represents instances of TableColumnSorter.

Constructor Detail

TableColumnSorter

public TableColumnSorter()
Method Detail

getInsertionPoint

public abstract int getInsertionPoint(org.jbudget.Core.MoneyPit item,
                                      java.util.List<org.jbudget.Core.MoneyPit> otherItems)
Returns the index of the a given MoneyPit that should be inserted in a given list of items.

Parameters:
item - MoneyPit that corresponds to the colum that is inserted in table.
otherItems - The list of MoneyPit objects that correspond to the columns that already exist in the table.
Returns:
the index of the new column.

getXmlElement

public abstract Element getXmlElement()
Returns the XML Element representing the concrete implmenetation of the TableColumnSorter interface.


getInstance

public static TableColumnSorter getInstance(Element element)
                                     throws JDOMException
Creates a new TableColumnSorter instance using the information provided in a given JDOM Element.

Throws:
JDOMException - if there are parsing errors or the element does not contain all necessary information.