core
Class ContactList

java.lang.Object
  extended byjavax.swing.AbstractListModel
      extended byjavax.swing.DefaultListModel
          extended bycore.ContactList
All Implemented Interfaces:
javax.swing.ListModel, java.io.Serializable

public class ContactList
extends javax.swing.DefaultListModel

A DefaultListModel of Contact objects representing information gathered by this user about other users on the network.

Author:
hoela
See Also:
Serialized Form

Constructor Summary
ContactList()
          Default Constructor
 
Method Summary
 boolean contains(java.lang.String address)
          Returns true if the ContactList contains the Contact associated with a given virtual address.
 Contact getContact(java.lang.String address)
          Looks up a Contact in the ContactList by its virtual address.
 void loadListFromFile(java.io.File listFile)
          Loads the ContactList from a file on disk.
 void saveContactList(java.io.File listFile)
          Saves a ContactList to the File specified.
 void update()
          Updates the gui element associated with this ContactList
 
Methods inherited from class javax.swing.DefaultListModel
add, addElement, capacity, clear, contains, copyInto, elementAt, elements, ensureCapacity, firstElement, get, getElementAt, getSize, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, removeAllElements, removeElement, removeElementAt, removeRange, set, setElementAt, setSize, size, toArray, toString, trimToSize
 
Methods inherited from class javax.swing.AbstractListModel
addListDataListener, getListDataListeners, getListeners, removeListDataListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ContactList

public ContactList()
Default Constructor

Method Detail

getContact

public Contact getContact(java.lang.String address)
Looks up a Contact in the ContactList by its virtual address.

Parameters:
address - the virtual address of a contact in the contact list.
Returns:
the Contact corresponding to the virtual address

contains

public boolean contains(java.lang.String address)
Returns true if the ContactList contains the Contact associated with a given virtual address.

Parameters:
address - the virtual address
Returns:
true if the Contact exists, false otherwise.

loadListFromFile

public void loadListFromFile(java.io.File listFile)
Loads the ContactList from a file on disk.

Parameters:
listFile - the File where a ContactList is stored (usually contacts.xml).

saveContactList

public void saveContactList(java.io.File listFile)
Saves a ContactList to the File specified.

Parameters:
listFile - the File to save the ContactList to (usually contacts.xml).

update

public void update()
Updates the gui element associated with this ContactList