📄 roster.html
字号:
<PRE>public int <B>getEntryCount</B>()</PRE><DL><DD>Returns a count of the entries in the roster.<P><DD><DL><DT><B>Returns:</B><DD>the number of entries in the roster.</DL></DD></DL><HR><A NAME="getEntries()"><!-- --></A><H3>getEntries</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/RosterEntry.html" title="class in org.jivesoftware.smack">RosterEntry</A>> <B>getEntries</B>()</PRE><DL><DD>Returns an unmodifiable collection of all entries in the roster, including entries that don't belong to any groups.<P><DD><DL><DT><B>Returns:</B><DD>all entries in the roster.</DL></DD></DL><HR><A NAME="getUnfiledEntryCount()"><!-- --></A><H3>getUnfiledEntryCount</H3><PRE>public int <B>getUnfiledEntryCount</B>()</PRE><DL><DD>Returns a count of the unfiled entries in the roster. An unfiled entry is an entry that doesn't belong to any groups.<P><DD><DL><DT><B>Returns:</B><DD>the number of unfiled entries in the roster.</DL></DD></DL><HR><A NAME="getUnfiledEntries()"><!-- --></A><H3>getUnfiledEntries</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/RosterEntry.html" title="class in org.jivesoftware.smack">RosterEntry</A>> <B>getUnfiledEntries</B>()</PRE><DL><DD>Returns an unmodifiable collection for the unfiled roster entries. An unfiled entry is an entry that doesn't belong to any groups.<P><DD><DL><DT><B>Returns:</B><DD>the unfiled roster entries.</DL></DD></DL><HR><A NAME="getEntry(java.lang.String)"><!-- --></A><H3>getEntry</H3><PRE>public <A HREF="../../../org/jivesoftware/smack/RosterEntry.html" title="class in org.jivesoftware.smack">RosterEntry</A> <B>getEntry</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> user)</PRE><DL><DD>Returns the roster entry associated with the given XMPP address or <tt>null</tt> if the user is not an entry in the roster.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>user</CODE> - the XMPP address of the user (eg "jsmith@example.com"). The address could be in any valid format (e.g. "domain/resource", "user@domain" or "user@domain/resource").<DT><B>Returns:</B><DD>the roster entry or <tt>null</tt> if it does not exist.</DL></DD></DL><HR><A NAME="contains(java.lang.String)"><!-- --></A><H3>contains</H3><PRE>public boolean <B>contains</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> user)</PRE><DL><DD>Returns true if the specified XMPP address is an entry in the roster.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>user</CODE> - the XMPP address of the user (eg "jsmith@example.com"). The address could be in any valid format (e.g. "domain/resource", "user@domain" or "user@domain/resource").<DT><B>Returns:</B><DD>true if the XMPP address is an entry in the roster.</DL></DD></DL><HR><A NAME="getGroup(java.lang.String)"><!-- --></A><H3>getGroup</H3><PRE>public <A HREF="../../../org/jivesoftware/smack/RosterGroup.html" title="class in org.jivesoftware.smack">RosterGroup</A> <B>getGroup</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> name)</PRE><DL><DD>Returns the roster group with the specified name, or <tt>null</tt> if the group doesn't exist.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - the name of the group.<DT><B>Returns:</B><DD>the roster group with the specified name.</DL></DD></DL><HR><A NAME="getGroupCount()"><!-- --></A><H3>getGroupCount</H3><PRE>public int <B>getGroupCount</B>()</PRE><DL><DD>Returns the number of the groups in the roster.<P><DD><DL><DT><B>Returns:</B><DD>the number of groups in the roster.</DL></DD></DL><HR><A NAME="getGroups()"><!-- --></A><H3>getGroups</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/RosterGroup.html" title="class in org.jivesoftware.smack">RosterGroup</A>> <B>getGroups</B>()</PRE><DL><DD>Returns an unmodiable collections of all the roster groups.<P><DD><DL><DT><B>Returns:</B><DD>an iterator for all roster groups.</DL></DD></DL><HR><A NAME="getPresence(java.lang.String)"><!-- --></A><H3>getPresence</H3><PRE>public <A HREF="../../../org/jivesoftware/smack/packet/Presence.html" title="class in org.jivesoftware.smack.packet">Presence</A> <B>getPresence</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> user)</PRE><DL><DD>Returns the presence info for a particular user. If the user is offline, or if no presence data is available (such as when you are not subscribed to the user's presence updates), unavailable presence will be returned.<p> <p/> If the user has several presences (one for each resource), then the presence with highest priority will be returned. If multiple presences have the same priority, the one with the "most available" presence mode will be returned. In order, that's <CODE>free to chat</CODE>, <CODE>available</CODE>, <CODE>away</CODE>, <CODE>extended away</CODE>, and <CODE>do not disturb</CODE>.<p> <p/> Note that presence information is received asynchronously. So, just after logging in to the server, presence values for users in the roster may be unavailable even if they are actually online. In other words, the value returned by this method should only be treated as a snapshot in time, and may not accurately reflect other user's presence instant by instant. If you need to track presence over time, such as when showing a visual representation of the roster, consider using a <A HREF="../../../org/jivesoftware/smack/RosterListener.html" title="interface in org.jivesoftware.smack"><CODE>RosterListener</CODE></A>.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>user</CODE> - an XMPP ID. The address could be in any valid format (e.g. "domain/resource", "user@domain" or "user@domain/resource"). Any resource information that's part of the ID will be discarded.<DT><B>Returns:</B><DD>the user's current presence, or unavailable presence if the user is offline or if no presence information is available..</DL></DD></DL><HR><A NAME="getPresenceResource(java.lang.String)"><!-- --></A><H3>getPresenceResource</H3><PRE>public <A HREF="../../../org/jivesoftware/smack/packet/Presence.html" title="class in org.jivesoftware.smack.packet">Presence</A> <B>getPresenceResource</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> userWithResource)</PRE><DL><DD>Returns the presence info for a particular user's resource, or unavailable presence if the user is offline or if no presence information is available, such as when you are not subscribed to the user's presence updates.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>userWithResource</CODE> - a fully qualified XMPP ID including a resource (user@domain/resource).<DT><B>Returns:</B><DD>the user's current presence, or unavailable presence if the user is offline or if no presence information is available.</DL></DD></DL><HR><A NAME="getPresences(java.lang.String)"><!-- --></A><H3>getPresences</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.3/docs/api/java/util/Iterator.html" title="class or interface in java.util">Iterator</A><<A HREF="../../../org/jivesoftware/smack/packet/Presence.html" title="class in org.jivesoftware.smack.packet">Presence</A>> <B>getPresences</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> user)</PRE><DL><DD>Returns an iterator (of Presence objects) for all of a user's current presences or an unavailable presence if the user is unavailable (offline) or if no presence information is available, such as when you are not subscribed to the user's presence updates.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>user</CODE> - a XMPP ID, e.g. jdoe@example.com.<DT><B>Returns:</B><DD>an iterator (of Presence objects) for all the user's current presences, or an unavailable presence if the user is offline or if no presence information is available.</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/ReconnectionManager.html" title="class in org.jivesoftware.smack"><B>PREV CLASS</B></A> <A HREF="../../../org/jivesoftware/smack/Roster.SubscriptionMode.html" title="enum 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/Roster.html" target="_top"><B>FRAMES</B></A> <A HREF="Roster.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> | 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 + -