public class ContactGroupJabberImpl extends AbstractContactGroupJabberImpl
Constructor and Description |
---|
ContactGroupJabberImpl(org.jivesoftware.smack.RosterGroup rosterGroup,
java.util.Iterator<org.jivesoftware.smack.RosterEntry> groupMembers,
ServerStoredContactListJabberImpl ssclCallback,
boolean isResolved)
Creates an Jabber group using the specified RosterGroup as
a source.
|
ContactGroupJabberImpl(java.lang.String id,
ServerStoredContactListJabberImpl ssclCallback)
Used when creating unresolved groups.
|
Modifier and Type | Method and Description |
---|---|
void |
addContact(ContactJabberImpl contact)
Adds the specified contact to the end of this group.
|
boolean |
canContainSubgroups()
Determines whether the group may contain subgroups or not.
|
java.util.Iterator<Contact> |
contacts()
Returns an Iterator over all contacts, member of this
ContactGroup.
|
int |
countContacts()
Returns the number of Contact members of this
ContactGroup
|
int |
countSubgroups()
Returns the number of subgroups contained by this group, which is
always 0 since sub groups in the protocol may only be contained
by the root group - RootContactGroupImpl.
|
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this group.
|
(package private) ContactJabberImpl |
findContact(java.lang.String id)
Returns the contact encapsulating with the spcieified name or
null if no such contact was found.
|
Contact |
getContact(java.lang.String id)
Returns the Contact with the specified address or
identifier.
|
ContactGroup |
getGroup(int index)
Returns the subgroup with the specified index (i.e.
|
ContactGroup |
getGroup(java.lang.String groupName)
Returns the subgroup with the specified name.
|
java.lang.String |
getGroupName()
Returns the name of this group.
|
(package private) java.lang.String |
getNameCopy()
Returns the name of the group as it was at the last call of initNameCopy.
|
ContactGroup |
getParentContactGroup()
Returns a reference to the root group which in Jabber is the parent of
any other group since the protocol does not support subgroups.
|
java.lang.String |
getPersistentData()
Returns null as no persistent data is required and the contact address is
sufficient for restoring the contact.
|
ProtocolProviderService |
getProtocolProvider()
Returns the protocol provider that this group belongs to.
|
(package private) org.jivesoftware.smack.RosterGroup |
getSourceGroup()
The source group we are encapsulating
|
java.lang.String |
getUID()
Returns a String that uniquely represents the group.
|
int |
hashCode()
Returns a hash code value for the object, which is actually the hashcode
value of the groupname.
|
boolean |
isPersistent()
Determines whether or not this contact group is being stored by the
server.
|
boolean |
isResolved()
Determines whether or not this contact group has been resolved against
the server.
|
(package private) void |
removeContact(ContactJabberImpl contact)
Removes the specified contact from this contact group
|
(package private) void |
setNameCopy(java.lang.String newName)
Sets the name copy field that we use as a means of detecting changes in
the group name.
|
(package private) void |
setResolved(org.jivesoftware.smack.RosterGroup source)
Resolve this contact group against the specified group
|
(package private) void |
setSourceGroup(org.jivesoftware.smack.RosterGroup newGroup)
Change the source group, used when renaming groups.
|
java.util.Iterator<ContactGroup> |
subgroups()
Returns an empty iterator.
|
java.lang.String |
toString()
Returns a string representation of this group, in the form
JabberGroup.GroupName[size]{ buddy1.toString(), buddy2.toString(), ...}.
|
ContactGroupJabberImpl(org.jivesoftware.smack.RosterGroup rosterGroup, java.util.Iterator<org.jivesoftware.smack.RosterEntry> groupMembers, ServerStoredContactListJabberImpl ssclCallback, boolean isResolved)
rosterGroup
- the Jabber Group corresponding to the groupgroupMembers
- the group members that we should add to the group.ssclCallback
- a callback to the server stored contact list
we're creating.isResolved
- a boolean indicating whether or not the group has been
resolved against the server.ContactGroupJabberImpl(java.lang.String id, ServerStoredContactListJabberImpl ssclCallback)
id
- the id of the group.ssclCallback
- the contact list handler that created us.public int countContacts()
public ContactGroup getParentContactGroup()
public void addContact(ContactJabberImpl contact)
addContact
in class AbstractContactGroupJabberImpl
contact
- the new contact to add to this groupvoid removeContact(ContactJabberImpl contact)
contact
- the contact to remove.public java.util.Iterator<Contact> contacts()
public Contact getContact(java.lang.String id)
id
- the address or identifier of the Contact we are
looking for.public java.lang.String getGroupName()
public boolean canContainSubgroups()
public ContactGroup getGroup(int index)
index
- the index of the ContactGroup to retrieve.public ContactGroup getGroup(java.lang.String groupName)
groupName
- the name of the ContactGroup to retrieve.public java.util.Iterator<ContactGroup> subgroups()
public int countSubgroups()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the reference object with which to compare.public ProtocolProviderService getProtocolProvider()
public java.lang.String toString()
toString
in class java.lang.Object
ContactJabberImpl findContact(java.lang.String id)
id
- the id for the contact we're looking for.void setNameCopy(java.lang.String newName)
newName
- Stringjava.lang.String getNameCopy()
public boolean isPersistent()
public java.lang.String getPersistentData()
public boolean isResolved()
void setResolved(org.jivesoftware.smack.RosterGroup source)
source
- the server stored grouppublic java.lang.String getUID()
org.jivesoftware.smack.RosterGroup getSourceGroup()
void setSourceGroup(org.jivesoftware.smack.RosterGroup newGroup)
newGroup
- RosterGroup
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.