|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectumontreal.iro.lecuyer.contactcenters.dialer.ContactListenerDialerList
public class ContactListenerDialerList
Implements the DialerList
interface for a finite
dialer list whose elements are obtained from an external
source. Since this class implements the
NewContactListener
interface, it can be bound
to an arrival process or any source of contacts.
When a new contact is notified to this dialer list,
it is added at the end of an internal ordered list for later use.
When calling removeFirst(int[])
, the first
element from this internal list is returned.
Constructor Summary | |
---|---|
ContactListenerDialerList()
Constructs a new empty dialer list implemented by a doubly-linked list. |
|
ContactListenerDialerList(List<Contact> dialerList)
Constructs a new dialer list using the given dialerList to store the contacts. |
Method Summary | |
---|---|
void |
clear()
Clears the contents of this dialer list. |
List<Contact> |
getList()
Returns the internal list containing the contacts to dial. |
void |
newContact(Contact contact)
Adds the new contact contact to the dialer list. |
Contact |
newInstance()
Constructs and returns a new Contact object. |
Contact |
removeFirst(int[] contactTypes)
Removes and returns the first contact with one of the desired types from the dialer list. |
void |
setList(List<Contact> dialerList)
Sets the internal list of contacts to dial to dialerList. |
int |
size(int[] contactTypes)
Returns the number of contacts of desired types stored into this dialer list. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ContactListenerDialerList()
LinkedList
class.
public ContactListenerDialerList(List<Contact> dialerList)
Contact
instances.
dialerList
- the list used to store the contacts.
NullPointerException
- if dialerList is null.Method Detail |
---|
public List<Contact> getList()
Contact
instances.
public void setList(List<Contact> dialerList)
dialerList
- the list used to store the contacts.
NullPointerException
- if dialerList is null.public int size(int[] contactTypes)
DialerList
Integer.MAX_VALUE
.
If the dialer list does not allow restriction to
specific contact types, this method throws
an UnsupportedOperationException
.
size
in interface DialerList
contactTypes
- the array of desired contact types.
public Contact removeFirst(int[] contactTypes)
DialerList
NoSuchElementException
.
If contactTypes is null,
any contact type is allowed.
If contactTypes is non-null while
the dialer list does not support restrictions to
specific contact types, this throws an
UnsupportedOperationException
.
removeFirst
in interface DialerList
contactTypes
- the array of desired contact types.
public void newContact(Contact contact)
newContact
in interface NewContactListener
contact
- the contact being added.
NullPointerException
- if contact is null.public Contact newInstance()
ContactFactory
Contact
object.
If a contact cannot be instantiated, a
ContactInstantiationException
is thrown.
newInstance
in interface ContactFactory
public String toString()
toString
in class Object
public void clear()
DialerList
clear
in interface DialerList
|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |