task
Class DuplicatesTask

java.lang.Object
  extended by javax.swing.SwingWorker<java.util.ArrayList<java.io.File>,java.util.ArrayList<java.io.File>>
      extended by task.DuplicatesTask
All Implemented Interfaces:
java.lang.Runnable, java.util.concurrent.Future<java.util.ArrayList<java.io.File>>, java.util.concurrent.RunnableFuture<java.util.ArrayList<java.io.File>>

public class DuplicatesTask
extends javax.swing.SwingWorker<java.util.ArrayList<java.io.File>,java.util.ArrayList<java.io.File>>

This class performs the task of searching for duplicate files. Duplicates are found using the DuplicateFiles class as well as a MediaFileFilter object.


Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.SwingWorker
javax.swing.SwingWorker.StateValue
 
Constructor Summary
DuplicatesTask(java.util.ArrayList<java.io.File> duplicates, SongTable table)
          Creates a new DuplicatesTask object given the Display object to show progress, an ArrayList of files to contain duplicate files found, and the SongTable object to display files that have been found to be duplicates.
DuplicatesTask(Options o)
          Creates a new DuplicatesTask object with the given Options object.
 
Method Summary
 java.util.ArrayList<java.io.File> doInBackground()
          The doInBackground method performs the search for duplicates in a folder.
protected  void done()
          Called after the doInBackground method completes.
 
Methods inherited from class javax.swing.SwingWorker
addPropertyChangeListener, cancel, execute, firePropertyChange, get, get, getProgress, getPropertyChangeSupport, getState, isCancelled, isDone, process, publish, removePropertyChangeListener, run, setProgress
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DuplicatesTask

public DuplicatesTask(java.util.ArrayList<java.io.File> duplicates,
                      SongTable table)
Creates a new DuplicatesTask object given the Display object to show progress, an ArrayList of files to contain duplicate files found, and the SongTable object to display files that have been found to be duplicates. The Song table is later used by the user to select files to process.

Parameters:
duplicates - The ArrayList of Files to store duplicate files that have been found.
table - The JTable to display files that have been found to be duplicates.

DuplicatesTask

public DuplicatesTask(Options o)
Creates a new DuplicatesTask object with the given Options object. Used in testing.

Parameters:
o - The options object to use in testing.
Method Detail

doInBackground

public java.util.ArrayList<java.io.File> doInBackground()
The doInBackground method performs the search for duplicates in a folder.

Specified by:
doInBackground in class javax.swing.SwingWorker<java.util.ArrayList<java.io.File>,java.util.ArrayList<java.io.File>>
Returns:
The Array List of files that are found be duplicates underneath the music directory.

done

protected void done()
Called after the doInBackground method completes.

Overrides:
done in class javax.swing.SwingWorker<java.util.ArrayList<java.io.File>,java.util.ArrayList<java.io.File>>