Package esmska.data
Class Contacts
- java.lang.Object
-
- esmska.data.Contacts
-
public class Contacts extends java.lang.ObjectClass managing all program contacts
-
-
Field Summary
Fields Modifier and Type Field Description static intACTION_ADD_CONTACTnew contact addedstatic intACTION_CHANGE_CONTACTproperties of some contact changedstatic intACTION_CLEAR_CONTACTSall contacts removedstatic intACTION_REMOVE_CONTACTexisting contact removed
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanadd(Contact contact)Add new contactvoidaddActionListener(java.awt.event.ActionListener actionListener)booleanaddAll(java.util.Collection<Contact> contacts)Add new contactsvoidclear()Remove all contactsbooleancontains(Contact contact)Search for an existing contactjava.util.SortedSet<Contact>getAll()Get unmodifiable collection of all contacts sorted by namestatic ContactsgetInstance()Get shared instancebooleanisEmpty()Return if there are no contactsbooleanremove(Contact contact)Remove existing contactvoidremoveActionListener(java.awt.event.ActionListener actionListener)booleanremoveAll(java.util.Collection<Contact> contacts)Remove existing contactsintsize()Return number of contacts
-
-
-
Field Detail
-
ACTION_ADD_CONTACT
public static final int ACTION_ADD_CONTACT
new contact added- See Also:
- Constant Field Values
-
ACTION_REMOVE_CONTACT
public static final int ACTION_REMOVE_CONTACT
existing contact removed- See Also:
- Constant Field Values
-
ACTION_CLEAR_CONTACTS
public static final int ACTION_CLEAR_CONTACTS
all contacts removed- See Also:
- Constant Field Values
-
ACTION_CHANGE_CONTACT
public static final int ACTION_CHANGE_CONTACT
properties of some contact changed- See Also:
- Constant Field Values
-
-
Method Detail
-
addActionListener
public void addActionListener(java.awt.event.ActionListener actionListener)
-
removeActionListener
public void removeActionListener(java.awt.event.ActionListener actionListener)
-
getInstance
public static Contacts getInstance()
Get shared instance
-
getAll
public java.util.SortedSet<Contact> getAll()
Get unmodifiable collection of all contacts sorted by name
-
add
public boolean add(Contact contact)
Add new contact- Parameters:
contact- new contact, not null- Returns:
- See
Collection.add(E)
-
addAll
public boolean addAll(java.util.Collection<Contact> contacts)
Add new contacts- Parameters:
contacts- collection of contacts, not null- Returns:
- See
Collection.addAll(java.util.Collection<? extends E>)
-
remove
public boolean remove(Contact contact)
Remove existing contact- Parameters:
contact- contact to be removed, not null- Returns:
- See
Collection.remove(java.lang.Object)
-
removeAll
public boolean removeAll(java.util.Collection<Contact> contacts)
Remove existing contacts- Parameters:
contacts- collection of contacts to be removed, not null- Returns:
- See
Collection.removeAll(java.util.Collection<?>)
-
clear
public void clear()
Remove all contacts
-
contains
public boolean contains(Contact contact)
Search for an existing contact- Parameters:
contact- contact to be searched, not null- Returns:
- See
Collection.contains(java.lang.Object)
-
size
public int size()
Return number of contacts- Returns:
- See
Collection.size()
-
isEmpty
public boolean isEmpty()
Return if there are no contacts- Returns:
- See
Collection.isEmpty()
-
-