📄 cphonebook.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc (build 1.5.0_06) on Tue Mar 21 08:43:44 EET 2006 -->
<TITLE>
CPhoneBook (jSMSEngine API)
</TITLE>
<META NAME="keywords" CONTENT="org.jsmsengine.CPhoneBook class">
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
<SCRIPT type="text/javascript">
function windowTitle()
{
parent.document.title="CPhoneBook (jSMSEngine API)";
}
</SCRIPT>
<NOSCRIPT>
</NOSCRIPT>
</HEAD>
<BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<A NAME="navbar_top"><!-- --></A>
<A HREF="#skip-navbar_top" title="Skip navigation links"></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<TR ALIGN="center" VALIGN="top">
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../org/jsmsengine/package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD>
<TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD>
<TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD>
</TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>
<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../org/jsmsengine/COutgoingMessage.html" title="class in org.jsmsengine"><B>PREV CLASS</B></A>
<A HREF="../../org/jsmsengine/CPhoneBook.CParser.html" title="class in org.jsmsengine"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
<A HREF="../../index.html?org/jsmsengine/CPhoneBook.html" target="_top"><B>FRAMES</B></A>
<A HREF="CPhoneBook.html" target="_top"><B>NO FRAMES</B></A>
<SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
</SCRIPT>
<NOSCRIPT>
<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>
</NOSCRIPT>
</FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
SUMMARY: <A HREF="#nested_class_summary">NESTED</A> | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<A NAME="skip-navbar_top"></A>
<!-- ========= END OF TOP NAVBAR ========= -->
<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
org.jsmsengine</FONT>
<BR>
Class CPhoneBook</H2>
<PRE>
java.lang.Object
<IMG SRC="../../resources/inherit.gif" ALT="extended by "><B>org.jsmsengine.CPhoneBook</B>
</PRE>
<HR>
<DL>
<DT><PRE> class <B>CPhoneBook</B><DT>extends java.lang.Object</DL>
</PRE>
<P>
This class handles the operation of the phonebook. <br><br> The phone book is an XML file, which holds information about destinations. The phone book is created and maintained by you. When you use a phone book, it is possible to send messages to "nicknames" define in the book, instead of real phone numbers. Apart from nicknames, you can also create groups of nicknames, in order to send an SMS message to more than one destinations, with only one API call. <br><br> <strong>Note: the phone book is optional.</strong> <br><br> In the "misc" directory of the distribution tree, you will find a sample phone book file. A phone book contains: <ol> <li> <strong><phonebookentry></strong> entries, which define the association of a person with a mobile number. For each entry, you must define the code (i.e. nickname), the name (description) and the actual phone. <li> <strong><group></strong> entries. These entries group together one or more phone book entries. This way, you can define a group as the recipient of your SMS message, and your message will be send to all individual members of the group. </ol> <br> When you create a message and you want to use a phonebook nickname (for example "thanasis"), use it with a "~" symbol in front. This means, set the recipient to value "~thanasis". When jSMSEngine sees a recipient value starting with "~", it will know that you mean a nickname, and not the actual phone. However, please keep in mind that the "~" character does not appear in the phonebook XML definition file. <br><br> This class contains all the relevant function for loading the XML phonebook file in memory (linked lists), and for resolving the names to the respected numbers. <br><br> All functions of the class are used internally by jSMSEngine API and are not accecible to the user. <br><br> Comments left to be added in next release.
<P>
<P>
<DL>
<DT><B>See Also:</B><DD><A HREF="../../org/jsmsengine/CService.html#setPhoneBook(java.lang.String)"><CODE>CService.setPhoneBook(java.lang.String)</CODE></A>,
<A HREF="../../org/jsmsengine/CService.html#sendMessage(org.jsmsengine.COutgoingMessage)"><CODE>CService.sendMessage(org.jsmsengine.COutgoingMessage)</CODE></A>,
<A HREF="../../org/jsmsengine/COutgoingMessage.html" title="class in org.jsmsengine"><CODE>COutgoingMessage</CODE></A></DL>
<HR>
<P>
<!-- ======== NESTED CLASS SUMMARY ======== -->
<A NAME="nested_class_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Nested Class Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>(package private) class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/jsmsengine/CPhoneBook.CParser.html" title="class in org.jsmsengine">CPhoneBook.CParser</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>(package private) class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/jsmsengine/CPhoneBook.CPhoneBookEntry.html" title="class in org.jsmsengine">CPhoneBook.CPhoneBookEntry</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>(package private) class</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/jsmsengine/CPhoneBook.CPhoneBookGroupEntry.html" title="class in org.jsmsengine">CPhoneBook.CPhoneBookGroupEntry</A></B></CODE>
<BR>
</TD>
</TR>
</TABLE>
<!-- =========== FIELD SUMMARY =========== -->
<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Field Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private java.util.LinkedList</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/jsmsengine/CPhoneBook.html#entries">entries</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/jsmsengine/CPhoneBook.html#ENTRY_TYPE_ENTRY">ENTRY_TYPE_ENTRY</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/jsmsengine/CPhoneBook.html#ENTRY_TYPE_GROUP">ENTRY_TYPE_GROUP</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private static int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/jsmsengine/CPhoneBook.html#ENTRY_TYPE_NOTFOUND">ENTRY_TYPE_NOTFOUND</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private java.util.LinkedList</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/jsmsengine/CPhoneBook.html#groups">groups</A></B></CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private static char</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/jsmsengine/CPhoneBook.html#PHONE_BOOK_INDICATOR">PHONE_BOOK_INDICATOR</A></B></CODE>
<BR>
</TD>
</TR>
</TABLE>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../org/jsmsengine/CPhoneBook.html#CPhoneBook()">CPhoneBook</A></B>()</CODE>
<BR>
</TD>
</TR>
</TABLE>
<!-- ========== METHOD SUMMARY =========== -->
<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
<B>Method Summary</B></FONT></TH>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected java.util.LinkedList</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/jsmsengine/CPhoneBook.html#expandPhoneBookEntries(org.jsmsengine.COutgoingMessage)">expandPhoneBookEntries</A></B>(<A HREF="../../org/jsmsengine/COutgoingMessage.html" title="class in org.jsmsengine">COutgoingMessage</A> message)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected java.util.LinkedList</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/jsmsengine/CPhoneBook.html#expandPhoneBookEntries(java.util.LinkedList)">expandPhoneBookEntries</A></B>(java.util.LinkedList inList)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private <A HREF="../../org/jsmsengine/CPhoneBook.CPhoneBookEntry.html" title="class in org.jsmsengine">CPhoneBook.CPhoneBookEntry</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/jsmsengine/CPhoneBook.html#getEntry(java.lang.String)">getEntry</A></B>(java.lang.String code)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/jsmsengine/CPhoneBook.html#getEntryName(java.lang.String)">getEntryName</A></B>(java.lang.String code)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private java.lang.String</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/jsmsengine/CPhoneBook.html#getEntryPhone(java.lang.String)">getEntryPhone</A></B>(java.lang.String code)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/jsmsengine/CPhoneBook.html#getEntryType(java.lang.String)">getEntryType</A></B>(java.lang.String code)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private <A HREF="../../org/jsmsengine/CPhoneBook.CPhoneBookGroupEntry.html" title="class in org.jsmsengine">CPhoneBook.CPhoneBookGroupEntry</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/jsmsengine/CPhoneBook.html#getGroupEntry(java.lang.String)">getGroupEntry</A></B>(java.lang.String code)</CODE>
<BR>
</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>private java.util.LinkedList</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../org/jsmsengine/CPhoneBook.html#getGroupMembers(java.lang.String)">getGroupMembers</A></B>(java.lang.String code)</CODE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -