cmu.tawc.data
Class Counter
java.lang.Object
cmu.tawc.data.Counter
public class Counter
- extends java.lang.Object
Constructor Summary |
Counter(javax.swing.table.TableModel tableModel,
int[] columnsToCount,
Dictionary dictionary)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Counter
public Counter(javax.swing.table.TableModel tableModel,
int[] columnsToCount,
Dictionary dictionary)
getProgressListener
public ProgressListener getProgressListener()
setProgressListener
public void setProgressListener(ProgressListener progressListener)
countAll
public void countAll()
countByRowsAppendData
public void countByRowsAppendData()
throws java.lang.ClassCastException,
FailedRequest
- The tableModel passed in must be a DataTableModel to do this (i.e. we have to be able to create new columns)
Appends the data for category counts as new columns to the table.
TODO clean this up. We now save all the data into categoryCountList and wordCountList, but in parallel we also save it to the table if we can -- there's no reason to be doing both. We should save to the table second, after pruning -- this is inefficient.
- Throws:
java.lang.ClassCastException
FailedRequest
calculatePercents
public void calculatePercents()
countSentence
public void countSentence(java.lang.String text)
countWord
public void countWord(java.lang.String text)
getOutput
public javax.swing.table.TableModel getOutput()
exportToXLS
public boolean exportToXLS(java.io.OutputStream outputStream)
- Exports to an excel file, using multiple sheets for word count and for Category count, which is much clearer.
I'd be tempted to put more excel features in here, but I'm not sure what yet.
- Parameters:
outputStream
-
- Returns:
main
public static final void main(java.lang.String[] args)
throws java.lang.Throwable
- Throws:
java.lang.Throwable
getSavePercent
public boolean getSavePercent()
- Get whether we will save the percentages of the count, or the count itself.
- Returns:
setSavePercent
public void setSavePercent(boolean savePercent)
- Set whether it will save the percentage of the count, or the count itself.
- Parameters:
savePercent
-
getSaveCount
public boolean getSaveCount()
setSaveCount
public void setSaveCount(boolean saveCount)
getStartColumnNamesWith
public java.lang.String getStartColumnNamesWith()
setStartColumnNamesWith
public void setStartColumnNamesWith(java.lang.String startColumnNamesWith)
getPruneColumnsWithMoreThanPercentZeros
public java.lang.Integer getPruneColumnsWithMoreThanPercentZeros()
setPruneColumnsWithMoreThanPercentZeros
public void setPruneColumnsWithMoreThanPercentZeros(java.lang.Integer pruneColumnsWithMoreThanPercentZeros)