# Class ContactsModel

java.lang.Object
com.codename1.ui.list.DefaultListModel
com.codename1.contacts.ContactsModel

All Implemented Interfaces:
  `ListModel, MultipleSelectionListModel`

public class ContactsModel extends DefaultListModel
This Contacts model is responsible for querying Contacts from the device and to cache the data for faster usage

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `ContactsModel(String... ids)`
  Constructor with contacts ids

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `addItem(java.lang.Object item)`
  Adds the specified item to the end of this list.
  `java.lang.Object`
  `getItemAt(int index)`
  Returns the item at the given offset
  `void`
  `removeItem(int index)`
  Removes the item at the specified position in this list.
  `void`
  `setPlaceHolderImage(Image placeHolder)`
  Sets the Contacts place holder image.

  ### Methods inherited from class DefaultListModel

  `addDataChangedListener, addItemAtIndex, addSelectedIndices, addSelectionListener, fireDataChangedEvent, getList, getSelectedIndex, getSelectedIndices, getSize, isMultiSelectionMode, removeAll, removeDataChangedListener, removeSelectedIndices, removeSelectionListener, setItem, setMultiSelectionMode, setSelectedIndex, setSelectedIndices`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### ContactsModel

    public ContactsModel(String... ids)

    Constructor with contacts ids

    ###### Parameters

    - `ids`: the contact ids we would like this model to handle

- ## Method Details

  - ### setPlaceHolderImage

    public void setPlaceHolderImage(Image placeHolder)

    Sets the Contacts place holder image.

    ###### Parameters

    - `placeHolder`: image place holder for the contacts

  - ### getItemAt

    public java.lang.Object getItemAt(int index)

    Returns the item at the given offset

    ###### Parameters

    - `index`: an index into this list

    ###### Returns

    the item at the specified index

    Specified by:
      `getItemAt` in interface `ListModel`
    Overrides:
      `getItemAt` in class `DefaultListModel`

  - ### addItem

    public void addItem(java.lang.Object item)

    Adds the specified item to the end of this list. An optional operation for mutable lists, it can throw an unsupported operation exception if a list model is not mutable.

    ###### Parameters

    - `item`: the item to be added
    Specified by:
      `addItem` in interface `ListModel`
    Overrides:
      `addItem` in class `DefaultListModel`

  - ### removeItem

    public void removeItem(int index)

    Removes the item at the specified position in this list.

    ###### Parameters

    - `index`: the index of the item to removed
    Specified by:
      `removeItem` in interface `ListModel`
    Overrides:
      `removeItem` in class `DefaultListModel`