esmska.persistence
Class ContactParser

java.lang.Object
  extended by javax.swing.SwingWorker<java.util.ArrayList<Contact>,java.lang.Void>
      extended by esmska.persistence.ContactParser
All Implemented Interfaces:
java.lang.Runnable, java.util.concurrent.Future<java.util.ArrayList<Contact>>, java.util.concurrent.RunnableFuture<java.util.ArrayList<Contact>>

public class ContactParser
extends javax.swing.SwingWorker<java.util.ArrayList<Contact>,java.lang.Void>

Parse contacts from csv file of different programs. Works in background thread. Returns collection of parsed contacts.


Nested Class Summary
static class ContactParser.ContactType
          Types of parseable file formats
 
Nested classes/interfaces inherited from class javax.swing.SwingWorker
javax.swing.SwingWorker.StateValue
 
Constructor Summary
ContactParser(java.io.File file, ContactParser.ContactType type)
          Creates new ContactParser.
 
Method Summary
protected  java.util.ArrayList<Contact> doInBackground()
           
 
Methods inherited from class javax.swing.SwingWorker
addPropertyChangeListener, cancel, done, 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

ContactParser

public ContactParser(java.io.File file,
                     ContactParser.ContactType type)
Creates new ContactParser.

Parameters:
file - File to parse.
type - Which program was used to save the file.
Method Detail

doInBackground

protected java.util.ArrayList<Contact> doInBackground()
                                               throws java.lang.Exception
Specified by:
doInBackground in class javax.swing.SwingWorker<java.util.ArrayList<Contact>,java.lang.Void>
Throws:
java.lang.Exception