Javadoc fixes.

git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@1851 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Matt Tucker 2003-03-09 23:42:51 +00:00 committed by mtucker
parent 6b472c6145
commit 9287e1b989
4 changed files with 86 additions and 8 deletions

View File

@ -58,7 +58,8 @@ import org.jivesoftware.smack.filter.*;
import java.util.*; import java.util.*;
/** /**
* Roster. * Represents a user's roster, which is the collection of users a person receives
* presence updates for. Roster items are categorized into groups for easier management.
* *
* @see XMPPConnection#getRoster() * @see XMPPConnection#getRoster()
* @author Matt Tucker * @author Matt Tucker

View File

@ -50,7 +50,6 @@
* ==================================================================== * ====================================================================
*/ */
package org.jivesoftware.smack; package org.jivesoftware.smack;
import org.jivesoftware.smack.packet.RosterPacket; import org.jivesoftware.smack.packet.RosterPacket;
@ -59,6 +58,7 @@ import org.jivesoftware.smack.packet.IQ;
import java.util.*; import java.util.*;
/** /**
* A group of roster entries.
* *
* @see Roster#getGroup(String) * @see Roster#getGroup(String)
* @author Matt Tucker * @author Matt Tucker

View File

@ -63,12 +63,22 @@ public class RosterPacket extends IQ {
private List rosterItems = new ArrayList(); private List rosterItems = new ArrayList();
public void addRosterItem(Item entry) { /**
* Adds a roster item to the packet.
*
* @param item a roster item.
*/
public void addRosterItem(Item item) {
synchronized (rosterItems) { synchronized (rosterItems) {
rosterItems.add(entry); rosterItems.add(item);
} }
} }
/**
* Returns an Iterator for the roster items in the packet.
*
* @return and Iterator for the roster items in the packet.
*/
public Iterator getRosterItems() { public Iterator getRosterItems() {
synchronized (rosterItems) { synchronized (rosterItems) {
List entries = Collections.unmodifiableList(new ArrayList(rosterItems)); List entries = Collections.unmodifiableList(new ArrayList(rosterItems));
@ -89,6 +99,10 @@ public class RosterPacket extends IQ {
return buf.toString(); return buf.toString();
} }
/**
* A roster item, which consists of a JID, their name, the type of subscription, and
* the groups the roster item belongs to.
*/
public static class Item { public static class Item {
private String user; private String user;
@ -96,6 +110,12 @@ public class RosterPacket extends IQ {
private ItemType itemType; private ItemType itemType;
private List groupNames; private List groupNames;
/**
* Creates a new roster item.
*
* @param user the user.
* @param name the user's name.
*/
public Item(String user, String name) { public Item(String user, String name) {
this.user = user; this.user = user;
this.name = name; this.name = name;
@ -103,32 +123,68 @@ public class RosterPacket extends IQ {
groupNames = new ArrayList(); groupNames = new ArrayList();
} }
/**
* Returns the user.
*
* @return the user.
*/
public String getUser() { public String getUser() {
return user; return user;
} }
/**
* Returns the user's name.
*
* @return the user's name.
*/
public String getName() { public String getName() {
return name; return name;
} }
/**
* Sets the user's name.
*
* @param name the user's name.
*/
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
/**
* Returns the roster item type.
*
* @return the roster item type.
*/
public ItemType getItemType() { public ItemType getItemType() {
return itemType; return itemType;
} }
/**
* Sets the roster item type.
*
* @param itemType the roster item type.
*/
public void setItemType(ItemType itemType) { public void setItemType(ItemType itemType) {
this.itemType = itemType; this.itemType = itemType;
} }
/**
* Returns an Iterator for the group names (as Strings) that the roster item
* belongs to.
*
* @return an Iterator for the group names.
*/
public Iterator getGroupNames() { public Iterator getGroupNames() {
synchronized (groupNames) { synchronized (groupNames) {
return Collections.unmodifiableList(groupNames).iterator(); return Collections.unmodifiableList(groupNames).iterator();
} }
} }
/**
* Adds a group name.
*
* @param groupName the group name.
*/
public void addGroupName(String groupName) { public void addGroupName(String groupName) {
synchronized (groupNames) { synchronized (groupNames) {
if (!groupNames.contains(groupName)) { if (!groupNames.contains(groupName)) {
@ -137,6 +193,11 @@ public class RosterPacket extends IQ {
} }
} }
/**
* Removes a group name.
*
* @param groupName the group name.
*/
public void removeGroupName(String groupName) { public void removeGroupName(String groupName) {
synchronized (groupNames) { synchronized (groupNames) {
groupNames.remove(groupName); groupNames.remove(groupName);
@ -164,6 +225,9 @@ public class RosterPacket extends IQ {
} }
} }
/**
* The subscription status of a roster item.
*/
public static class ItemStatus { public static class ItemStatus {
public static final ItemStatus SUBSCRIBED = new ItemStatus("subscribed"); public static final ItemStatus SUBSCRIBED = new ItemStatus("subscribed");
@ -184,7 +248,12 @@ public class RosterPacket extends IQ {
private String value; private String value;
private ItemStatus (String value) { /**
* Returns the item status associated with the specified string.
*
* @param value the item status.
*/
private ItemStatus(String value) {
this.value = value; this.value = value;
} }
@ -194,6 +263,9 @@ public class RosterPacket extends IQ {
} }
/**
* The subscription type of a roster item.
*/
public static class ItemType { public static class ItemType {
public static final ItemType NONE = new ItemType("none"); public static final ItemType NONE = new ItemType("none");
@ -221,7 +293,12 @@ public class RosterPacket extends IQ {
private String value; private String value;
public ItemType (String value) { /**
* Returns the item type associated with the specified string.
*
* @param value the item type.
*/
public ItemType(String value) {
this.value = value; this.value = value;
} }

View File

@ -53,9 +53,9 @@
package org.jivesoftware.smack.packet; package org.jivesoftware.smack.packet;
/** /**
* Represents a XMPP error subpacket. Typically, a server responds to a request that has * Represents a XMPP error sub-packet. Typically, a server responds to a request that has
* problems by sending the packet back and including an error packet. Each error has a code * problems by sending the packet back and including an error packet. Each error has a code
* as well as as an optional text explanation. Typical error codes are as follows: * as well as as an optional text explanation. Typical error codes are as follows:<p>
* *
* <table border=1> * <table border=1>
* <tr><td><b>Code</b></td><td><b>Description</b></td></tr> * <tr><td><b>Code</b></td><td><b>Description</b></td></tr>