Package esmska.data

Class Contacts


  • public class Contacts
    extends java.lang.Object
    Class managing all program 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()