lemurproject.indri.ui
Class DocsTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by lemurproject.indri.ui.DocsTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

 class DocsTableModel
extends javax.swing.table.AbstractTableModel

Table Model for the scored document results from running a query.

Author:
David Fisher

Field Summary
private  java.lang.String[] columnNames
          Labels for the columns
private  java.lang.Object[][] data
          Container for the data.
private  java.lang.String[] noScoreColumnNames
          Labels for the columns docid and title
private  java.lang.Object[][] noScoreData
          Container for the data, docid and title.
private  java.lang.String[] scoreColumnNames
          Labels for the columns score, docid and title
private  java.lang.Object[][] scoreData
          Container for the data, score, docid, and title.
(package private)  boolean showScores
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
DocsTableModel()
           
 
Method Summary
 void clear()
          Clear the data array.
 void displayScores(boolean display)
          Turn score display on or off.
 java.lang.Class getColumnClass(int c)
           
 int getColumnCount()
           
 java.lang.String getColumnName(int col)
           
 int getRowCount()
           
 java.lang.Object getValueAt(int row, int col)
           
 void resize(int row)
          Resize the data array to contain row number of rows.
 void setValueAt(int row, double score, java.lang.String doc, java.lang.String title)
          Update an entry for a row
 void setValueAt(int row, java.lang.String doc, java.lang.String title)
          Update an entry for a row
 void setValueAt(java.lang.Object obj, int row, int col)
           
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, isCellEditable, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

showScores

boolean showScores

noScoreColumnNames

private java.lang.String[] noScoreColumnNames
Labels for the columns docid and title


scoreColumnNames

private java.lang.String[] scoreColumnNames
Labels for the columns score, docid and title


columnNames

private java.lang.String[] columnNames
Labels for the columns


noScoreData

private java.lang.Object[][] noScoreData
Container for the data, docid and title.


scoreData

private java.lang.Object[][] scoreData
Container for the data, score, docid, and title.


data

private java.lang.Object[][] data
Container for the data.

Constructor Detail

DocsTableModel

DocsTableModel()
Method Detail

getColumnCount

public int getColumnCount()

getRowCount

public int getRowCount()

getColumnName

public java.lang.String getColumnName(int col)
Specified by:
getColumnName in interface javax.swing.table.TableModel
Overrides:
getColumnName in class javax.swing.table.AbstractTableModel

getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)

getColumnClass

public java.lang.Class getColumnClass(int c)
Specified by:
getColumnClass in interface javax.swing.table.TableModel
Overrides:
getColumnClass in class javax.swing.table.AbstractTableModel

resize

public void resize(int row)
Resize the data array to contain row number of rows.

Parameters:
row - Number of rows for the new array.

displayScores

public void displayScores(boolean display)
Turn score display on or off.

Parameters:
display - true to display scores, false to not

clear

public void clear()
Clear the data array.


setValueAt

public void setValueAt(java.lang.Object obj,
                       int row,
                       int col)
Specified by:
setValueAt in interface javax.swing.table.TableModel
Overrides:
setValueAt in class javax.swing.table.AbstractTableModel

setValueAt

public void setValueAt(int row,
                       java.lang.String doc,
                       java.lang.String title)
Update an entry for a row

Parameters:
row - The row index
doc - The document name
title - The document title if any

setValueAt

public void setValueAt(int row,
                       double score,
                       java.lang.String doc,
                       java.lang.String title)
Update an entry for a row

Parameters:
row - The row index
score - The document score
doc - The document name
title - The document title if any