mirror of
https://github.com/vanitasvitae/Smack.git
synced 2025-09-10 09:39:39 +02:00
Improvements in entry creation and management.
git-svn-id: http://svn.igniterealtime.org/svn/repos/smack/trunk@1854 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
parent
25e4481984
commit
dd4c10ac9d
2 changed files with 44 additions and 2 deletions
|
@ -108,18 +108,38 @@ public class RosterGroup {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the number of entries in the group.
|
||||
*
|
||||
* @return the number of entries in the group.
|
||||
*/
|
||||
public int getEntryCount() {
|
||||
synchronized (entries) {
|
||||
return entries.size();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an iterator for the entries in the group.
|
||||
*
|
||||
* @return an iterator for the entries in the group.
|
||||
*/
|
||||
public Iterator getEntries() {
|
||||
return Collections.unmodifiableList(entries).iterator();
|
||||
synchronized (entries) {
|
||||
return Collections.unmodifiableList(new ArrayList(entries)).iterator();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if an entry is part of the group.
|
||||
*
|
||||
* @param entry
|
||||
* @return
|
||||
*/
|
||||
public boolean contains(RosterEntry entry) {
|
||||
return entries.contains(entry);
|
||||
synchronized (entries) {
|
||||
return entries.contains(entry);
|
||||
}
|
||||
}
|
||||
|
||||
public void addEntry(RosterEntry entry) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue