📄 chat.html
字号:
<!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Method Detail</B></FONT></TH></TR></TABLE><A NAME="getThreadID()"><!-- --></A><H3>getThreadID</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getThreadID</B>()</PRE><DL><DD>Returns the thread id associated with this chat, which corresponds to the <tt>thread</tt> field of XMPP messages. This method may return <tt>null</tt> if there is no thread ID is associated with this Chat.<P><DD><DL><DT><B>Returns:</B><DD>the thread ID of this chat.</DL></DD></DL><HR><A NAME="getParticipant()"><!-- --></A><H3>getParticipant</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getParticipant</B>()</PRE><DL><DD>Returns the name of the user the chat is with.<P><DD><DL><DT><B>Returns:</B><DD>the name of the user the chat is occuring with.</DL></DD></DL><HR><A NAME="sendMessage(java.lang.String)"><!-- --></A><H3>sendMessage</H3><PRE>public void <B>sendMessage</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> text) throws <A HREF="../../../org/jivesoftware/smack/XMPPException.html" title="class in org.jivesoftware.smack">XMPPException</A></PRE><DL><DD>Sends the specified text as a message to the other chat participant. This is a convenience method for: <pre> Message message = chat.createMessage(); message.setBody(messageText); chat.sendMessage(message); </pre><P><DD><DL><DT><B>Parameters:</B><DD><CODE>text</CODE> - the text to send.<DT><B>Throws:</B><DD><CODE><A HREF="../../../org/jivesoftware/smack/XMPPException.html" title="class in org.jivesoftware.smack">XMPPException</A></CODE> - if sending the message fails.</DL></DD></DL><HR><A NAME="sendMessage(org.jivesoftware.smack.packet.Message)"><!-- --></A><H3>sendMessage</H3><PRE>public void <B>sendMessage</B>(<A HREF="../../../org/jivesoftware/smack/packet/Message.html" title="class in org.jivesoftware.smack.packet">Message</A> message) throws <A HREF="../../../org/jivesoftware/smack/XMPPException.html" title="class in org.jivesoftware.smack">XMPPException</A></PRE><DL><DD>Sends a message to the other chat participant. The thread ID, recipient, and message type of the message will automatically set to those of this chat.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>message</CODE> - the message to send.<DT><B>Throws:</B><DD><CODE><A HREF="../../../org/jivesoftware/smack/XMPPException.html" title="class in org.jivesoftware.smack">XMPPException</A></CODE> - if an error occurs sending the message.</DL></DD></DL><HR><A NAME="addMessageListener(org.jivesoftware.smack.MessageListener)"><!-- --></A><H3>addMessageListener</H3><PRE>public void <B>addMessageListener</B>(<A HREF="../../../org/jivesoftware/smack/MessageListener.html" title="interface in org.jivesoftware.smack">MessageListener</A> listener)</PRE><DL><DD>Adds a packet listener that will be notified of any new messages in the chat.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>listener</CODE> - a packet listener.</DL></DD></DL><HR><A NAME="removeMessageListener(org.jivesoftware.smack.MessageListener)"><!-- --></A><H3>removeMessageListener</H3><PRE>public void <B>removeMessageListener</B>(<A HREF="../../../org/jivesoftware/smack/MessageListener.html" title="interface in org.jivesoftware.smack">MessageListener</A> listener)</PRE><DL><DD><DL></DL></DD></DL><HR><A NAME="getListeners()"><!-- --></A><H3>getListeners</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Collection.html" title="class or interface in java.util">Collection</A><<A HREF="../../../org/jivesoftware/smack/MessageListener.html" title="interface in org.jivesoftware.smack">MessageListener</A>> <B>getListeners</B>()</PRE><DL><DD>Returns an unmodifiable collection of all of the listeners registered with this chat.<P><DD><DL><DT><B>Returns:</B><DD>an unmodifiable collection of all of the listeners registered with this chat.</DL></DD></DL><HR><A NAME="createCollector()"><!-- --></A><H3>createCollector</H3><PRE>public <A HREF="../../../org/jivesoftware/smack/PacketCollector.html" title="class in org.jivesoftware.smack">PacketCollector</A> <B>createCollector</B>()</PRE><DL><DD>Creates a <A HREF="../../../org/jivesoftware/smack/PacketCollector.html" title="class in org.jivesoftware.smack"><CODE>PacketCollector</CODE></A> which will accumulate the Messages for this chat. Always cancel PacketCollectors when finished with them as they will accumulate messages indefinitely.<P><DD><DL><DT><B>Returns:</B><DD>the PacketCollector which returns Messages for this chat.</DL></DD></DL><HR><A NAME="equals(java.lang.Object)"><!-- --></A><H3>equals</H3><PRE>public boolean <B>equals</B>(<A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> obj)</PRE><DL><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang">equals</A></CODE> in class <CODE><A HREF="http://java.sun.com/j2se/1.3/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></CODE></DL></DD><DD><DL></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" 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_bottom_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="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><b>Smack</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../org/jivesoftware/smack/AccountManager.html" title="class in org.jivesoftware.smack"><B>PREV CLASS</B></A> <A HREF="../../../org/jivesoftware/smack/ChatManager.html" title="class in org.jivesoftware.smack"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html?org/jivesoftware/smack/Chat.html" target="_top"><B>FRAMES</B></A> <A HREF="Chat.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: NESTED | FIELD | CONSTR | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | CONSTR | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR><i>Copyright © 2003-2007 Jive Software. </i></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -