com.motorola.iden.udm
Class PhoneBook

java.lang.Object
  extended bycom.motorola.iden.udm.PhoneBook
All Implemented Interfaces:
UDMList

public class PhoneBook
extends java.lang.Object
implements UDMList

Represents a PhoneBook list containing PhoneBookEntry elements.


MOTOROLA and the Stylized M Logo are registered trademarks of Motorola, Inc. Reg. U.S. Pat. & Tm. Off.
© Copyright 2003 Motorola, Inc. All Rights Reserved.


Field Summary
static int EXPANDED_AVAILABLE
          EXPANDED_AVAILABLE available Expanded slots in the falcon SIM.
static int NOT_AVAILABLE
          NOT_AVAILABLE Not available field in the current SIM type.
static int PHONE_AVAILABLE
          PHONE_AVAILABLE available Phone slots in the SIM.
static int PHONE_INUSE
          PHONE_INUSE Inuse Phone slots in the SIM.
static int PRIVATE_AVAILABLE
          PRIVATE_AVAILABLE available Private slots in the SIM.
static int PRIVATE_INUSE
          PRIVATE_INUSE Inuse Private slots in the SIM.
static int TALKGROUP_AVAILABLE
          TALKGROUP_AVAILABLE available Talk group slots in the SIM.
static int TALKGROUP_INUSE
          TALKGROUP_INUSE Inuse Talk group slots in the SIM.
static int TOTAL_AVAILABLE
          TOTAL_AVAILABLE Total available slots in the SIM.
static int TOTAL_INUSE
          TOTAL_INUSE Total inuse slots in the SIM.
 
Method Summary
 void close()
          Closes the list, releasing any resources for this list.
 PhoneBookEntry createPhoneBookEntry()
          Factory method to create a PhoneBookEntry for this PhoneBookEntry list.
 void deleteAllPhoneBookEntries()
          Removes all PhoneBookEntries from the list.
 java.util.Enumeration elements()
          Return an Enumeration of all elements in the list.
 int[] getAvailableStorage()
          Returns an integer array the amount of slots available on the native database.
 int getNumOfEntries()
          Returns the amount of entries (not individual numbers) in the list.
 int[] getSupportedFields()
          Returns an int array containing all field IDs supported by this list.
 int[] getSupportedTypes(int fieldID)
          Returns an integer array containing the supported type ids for the given field ID.
 PhoneBookEntry importPhoneBookEntry(PhoneBookEntry element)
          Imports the given PhoneBookEntry into this PhoneBookEntry list by making a new PhoneBookEntry for the list and filling its information with as much information as it can from the provided PhoneBookEntry.
static boolean isCurrent()
          Returns a flag indicating whether native contact database has been modified since the last native contact database update.
 boolean isSupportedField(int fieldID)
          Indicates whether or not the given fieldID is supported in this UDM list.
 void removePhoneBookEntry(PhoneBookEntry element)
          Removes a specific PhoneBookEntry from the list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOTAL_AVAILABLE

public static final int TOTAL_AVAILABLE
TOTAL_AVAILABLE Total available slots in the SIM.

Value 0 is assigned to TOTAL_AVAILABLE

See Also:
Constant Field Values

PHONE_AVAILABLE

public static final int PHONE_AVAILABLE
PHONE_AVAILABLE available Phone slots in the SIM.

Value 1 is assigned to PHONE_AVAILABLE

See Also:
Constant Field Values

PRIVATE_AVAILABLE

public static final int PRIVATE_AVAILABLE
PRIVATE_AVAILABLE available Private slots in the SIM.

Value 2 is assigned to PRIVATE_AVAILABLE

See Also:
Constant Field Values

TALKGROUP_AVAILABLE

public static final int TALKGROUP_AVAILABLE
TALKGROUP_AVAILABLE available Talk group slots in the SIM.

Value 3 is assigned to TALKGROUP_AVAILABLE

See Also:
Constant Field Values

TOTAL_INUSE

public static final int TOTAL_INUSE
TOTAL_INUSE Total inuse slots in the SIM.

Value 4 is assigned to TOTAL_INUSE

See Also:
Constant Field Values

PHONE_INUSE

public static final int PHONE_INUSE
PHONE_INUSE Inuse Phone slots in the SIM.

Value 5 is assigned to PHONE_INUSE

See Also:
Constant Field Values

PRIVATE_INUSE

public static final int PRIVATE_INUSE
PRIVATE_INUSE Inuse Private slots in the SIM.

Value 6 is assigned to PRIVATE_INUSE

See Also:
Constant Field Values

TALKGROUP_INUSE

public static final int TALKGROUP_INUSE
TALKGROUP_INUSE Inuse Talk group slots in the SIM.

Value 7 is assigned to TALKGROUP_INUSE

See Also:
Constant Field Values

EXPANDED_AVAILABLE

public static final int EXPANDED_AVAILABLE
EXPANDED_AVAILABLE available Expanded slots in the falcon SIM.

Value 8 is assigned to EXPANDED_AVAILABLE

See Also:
Constant Field Values

NOT_AVAILABLE

public static final int NOT_AVAILABLE
NOT_AVAILABLE Not available field in the current SIM type.

Value 65535 is assigned to NOT_AVAILABLE

See Also:
Constant Field Values
Method Detail

createPhoneBookEntry

public PhoneBookEntry createPhoneBookEntry()
                                    throws UDMException
Factory method to create a PhoneBookEntry for this PhoneBookEntry list. Note that creation of the PhoneBookEntry does not add the PhoneBookEntry to the list from which the element was created; a specific call to UDMEntry.commit() must be made to commit the element and its data to the list.

Throws:
UDMException - if the element cannot be created if the list is no longer accessible or closed.

importPhoneBookEntry

public PhoneBookEntry importPhoneBookEntry(PhoneBookEntry element)
                                    throws UDMException
Imports the given PhoneBookEntry into this PhoneBookEntry list by making a new PhoneBookEntry for the list and filling its information with as much information as it can from the provided PhoneBookEntry. If the input PhoneBookEntry is already in the list, a new PhoneBookEntry is still created with information similar to the input element (but not necessarily identical). Note that not all data from the input PhoneBookEntry may be supported in the new PhoneBookEntry due to field restrictions for the list instance. In this case, data fields not supported are not transferred to the new PhoneBookEntry object.

Parameters:
element - the PhoneBookEntry to import into the list.
Returns:
a newly created PhoneBookEntry after it has been persisted to the database.
Throws:
UDMException - If an error occurs or there is not enough space or the list is no longer accessible or closed.
java.lang.IllegalArgumentException - If the PhoneBookEntry is null.
java.lang.SecurityException - if the application is not given permission to write to the PhoneBookEntry list.

removePhoneBookEntry

public void removePhoneBookEntry(PhoneBookEntry element)
                          throws UDMException
Removes a specific PhoneBookEntry from the list. The element must already exist in the list for this method to succeed.

Parameters:
element - the PhoneBookEntry to be removed from the list.
Throws:
UDMException - If an error occurs deleting the item or the list is no longer accessible or closed.
java.lang.IllegalArgumentException - If the PhoneBookEntry is null.
java.lang.SecurityException - if the application is not given permission to write to the PhoneBookEntry list.

deleteAllPhoneBookEntries

public void deleteAllPhoneBookEntries()
                               throws UDMException
Removes all PhoneBookEntries from the list.

Throws:
UDMException - If an error occurs deleting the item or the list is no longer accessible or closed.
java.lang.SecurityException - if the application is not given permission to write to the PhoneBookEntry list.

close

public void close()
           throws UDMException
Closes the list, releasing any resources for this list. A UDMException is thrown for any subsequent method invocations for the class instance.

Specified by:
close in interface UDMList
Throws:
UDMException - If the list is no longer accessible.

elements

public java.util.Enumeration elements()
                               throws UDMException
Return an Enumeration of all elements in the list. The order is undefined.

Specified by:
elements in interface UDMList
Returns:
an Enumeration of all elements.
Throws:
UDMException - If an error occurs or the list is no longer accessible or closed.

isCurrent

public static boolean isCurrent()
Returns a flag indicating whether native contact database has been modified since the last native contact database update.

Returns:
true if the last PhoneBook object created is current, no new object was created. This method is not supported on Gemini product and always return true.

isSupportedField

public boolean isSupportedField(int fieldID)
                         throws UDMException
Indicates whether or not the given fieldID is supported in this UDM list. RINGER,SPEED_NUM,VOICE_NAME, IP are not supported on Gemini product.

Specified by:
isSupportedField in interface UDMList
Parameters:
fieldID - The fieldID to check, as defined by the UDMEntry subclasses.
Returns:
true if supported, false otherwise.
Throws:
java.lang.IllegalArgumentException - if fieldID is an invalid ID for this list.
UDMException - if the list is closed or is no longer accessible.

getSupportedFields

public int[] getSupportedFields()
                         throws UDMException
Returns an int array containing all field IDs supported by this list.

Specified by:
getSupportedFields in interface UDMList
Returns:
an int array containing all field IDs supported by this list.
Throws:
UDMException - - if the list is closed or is no longer accessible.

getSupportedTypes

public int[] getSupportedTypes(int fieldID)
                        throws UDMException
Returns an integer array containing the supported type ids for the given field ID. Some field IDs may have types associated with them to distinguish between different types of the same field. If there are no types to return, a zero length array is returned.

Specified by:
getSupportedTypes in interface UDMList
Parameters:
fieldID - the fieldID to check
Throws:
java.lang.IllegalArgumentException - if fieldID is is not one of the the valid field IDs for the implementing class.
UDMException - if the list is closed or is no longer accessible.

getAvailableStorage

public int[] getAvailableStorage()
                          throws UDMException
Returns an integer array the amount of slots available on the native database. This number may differ from the amount slots in the current list. This method is not supported on Gemini product.

Returns:
An array of integers representing the amount of additional slots that can be stored on the native database.
Throws:
UDMException - if the list is closed or is no longer accessible.

getNumOfEntries

public int getNumOfEntries()
                    throws UDMException
Returns the amount of entries (not individual numbers) in the list.

Specified by:
getNumOfEntries in interface UDMList
Returns:
The amount of Entry objects contained in the list
Throws:
UDMException - if the list is closed or is no longer accessible.