public interface MetaContactGroup extends java.lang.Comparable<MetaContactGroup>
A MetaContactGroup may contain contacts and some groups may also have sub-groups as children. To verify whether or not a particular group may contain subgroups, a developer has to call the canContainSubgroups() method
Modifier and Type | Method and Description |
---|---|
boolean |
canContainSubgroups()
Determines whether or not this group can contain subgroups.
|
boolean |
contains(MetaContact contact)
Returns true if and only if contact is a direct child of this
group.
|
boolean |
contains(MetaContactGroup group)
Returns true if and only if group is a direct subgroup of this
MetaContactGroup.
|
int |
countChildContacts()
Returns the number of MetaContacts that this group contains
|
int |
countContactGroups()
Returns the number of ContactGroupss that this group
encapsulates
|
int |
countOnlineChildContacts()
Returns the number of online MetaContacts that this group
contains.
|
int |
countSubgroups()
Returns the number of subgroups that this MetaContactGroup
contains.
|
java.util.Iterator<MetaContact> |
getChildContacts()
Returns a java.util.Iterator over the MetaContacts
contained in this MetaContactGroup.
|
ContactGroup |
getContactGroup(java.lang.String groupName,
ProtocolProviderService ownerProvider)
Returns a contact group encapsulated by this meta contact group, having
the specified groupName and coming from the indicated ownerProvider.
|
java.util.Iterator<ContactGroup> |
getContactGroups()
Returns an iterator over all the protocol specific groups that this
contact group represents.
|
java.util.Iterator<ContactGroup> |
getContactGroupsForAccountID(java.lang.String accountID)
Returns all protocol specific ContactGroups, encapsulated by this
MetaContactGroup and coming from the provider matching the
accountID param.
|
java.util.Iterator<ContactGroup> |
getContactGroupsForProvider(ProtocolProviderService provider)
Returns all protocol specific ContactGroups, encapsulated by this
MetaContactGroup and coming from the indicated ProtocolProviderService.
|
java.lang.Object |
getData(java.lang.Object key)
Gets the user data associated with this instance and a specific key.
|
java.lang.String |
getGroupName()
Returns the name of this group.
|
MetaContact |
getMetaContact(int index)
Returns the meta contact on the specified index.
|
MetaContact |
getMetaContact(ProtocolProviderService provider,
java.lang.String contactID)
Returns the meta contact encapsulating a contact belonging to the
specified provider with the specified identifier.
|
MetaContact |
getMetaContact(java.lang.String metaUID)
Returns the contact with the specified identifier
|
MetaContactGroup |
getMetaContactSubgroup(int index)
Returns the MetaContactGroup with the specified index.
|
MetaContactGroup |
getMetaContactSubgroup(java.lang.String groupName)
Returns the MetaContactGroup with the specified name.
|
java.lang.String |
getMetaUID()
Returns a String identifier (the actual contents is left to
implementations) that uniquely represents this MetaContact in
the containing MetaContactList
|
MetaContactGroup |
getParentMetaContactGroup()
Returns the MetaContactGroup currently containing this group or null if
this is the root group
|
java.util.Iterator<MetaContactGroup> |
getSubgroups()
Returns an java.util.Iterator over the sub groups that this
MetaContactGroup contains.
|
int |
indexOf(MetaContact metaContact)
Returns the index of metaContact in relation to other contacts in this or
-1 if metaContact does not belong to this group.
|
int |
indexOf(MetaContactGroup metaContactGroup)
Returns the index of metaContactGroup in relation to other subgroups in
this group or -1 if metaContact does not belong to this group.
|
boolean |
isPersistent()
Determines whether or not this meta group contains only groups that are
being stored by a server.
|
void |
setData(java.lang.Object key,
java.lang.Object value)
Sets a user-specific association in this instance in the form of a
key-value pair.
|
java.lang.String |
toString()
Returns a String representation of this group and the contacts it
contains (may turn out to be a relatively long string).
|
java.util.Iterator<ContactGroup> getContactGroups()
Note to implementors: In order to prevent problems with concurrency, the Iterator returned by this method should not be over the actual list of groups but rather over a copy of that list.
java.util.Iterator<ContactGroup> getContactGroupsForProvider(ProtocolProviderService provider)
Note to implementors: In order to prevent problems with concurrency, the Iterator returned by this method should not be over the actual list of groups but rather over a copy of that list.
provider
- a reference to the ProtocolProviderService
whose ContactGroups we'd like to get.java.util.Iterator<ContactGroup> getContactGroupsForAccountID(java.lang.String accountID)
Note to implementors: In order to prevent problems with concurrency, the Iterator returned by this method should not be over the actual list of groups but rather over a copy of that list.
accountID
- the id of the account whose contact groups we'd like to
retrieve.boolean contains(MetaContact contact)
contact
- the MetaContact whose relation to this group
we'd like to determine.boolean contains(MetaContactGroup group)
group
- the MetaContactGroup whose relation to this group
we'd like to determine.ContactGroup getContactGroup(java.lang.String groupName, ProtocolProviderService ownerProvider)
groupName
- the name of the contact group who we're looking for.ownerProvider
- a reference to the ProtocolProviderService that
the contact we're looking for belongs to.java.util.Iterator<MetaContact> getChildContacts()
Note to implementors: In order to prevent problems with concurrency, the Iterator returned by this method should not be over the actual list of contacts but rather over a copy of that list.
int countChildContacts()
int countOnlineChildContacts()
int countContactGroups()
java.util.Iterator<MetaContactGroup> getSubgroups()
Note to implementors: In order to prevent problems with concurrency, the Iterator returned by this method should not be over the actual list of groups but rather over a copy of that list.
int countSubgroups()
boolean canContainSubgroups()
MetaContact getMetaContact(ProtocolProviderService provider, java.lang.String contactID)
provider
- the ProtocolProviderService that the specified
contactID is pertaining to.contactID
- a String identifier of the protocol specific contact
whose container meta contact we're looking for.MetaContact getMetaContact(java.lang.String metaUID)
metaUID
- a String identifier obtained through the
MetaContact.getMetaUID() method.
int indexOf(MetaContact metaContact)
metaContact
- the MetaContact whose index we're looking
for.int indexOf(MetaContactGroup metaContactGroup)
metaContactGroup
- the MetaContactGroup whose index we're
looking for.MetaContact getMetaContact(int index) throws java.lang.IndexOutOfBoundsException
index
- the index of the meta contact to return.java.lang.IndexOutOfBoundsException
- in case index is
not a valid index for this group.java.lang.String getGroupName()
MetaContactGroup getMetaContactSubgroup(java.lang.String groupName)
groupName
- the name of the group to return.MetaContactGroup getMetaContactSubgroup(int index) throws java.lang.IndexOutOfBoundsException
index
- the index of the group to return.java.lang.IndexOutOfBoundsException
- if index is not
a valid index.MetaContactGroup getParentMetaContactGroup()
java.lang.String toString()
toString
in class java.lang.Object
java.lang.String getMetaUID()
java.lang.Object getData(java.lang.Object key)
key
- the key of the user data associated with this instance to be
retrievedObject
which represents the value associated with
this instance and the specified key
; null
if no association with the specified key
exists in
this instancevoid setData(java.lang.Object key, java.lang.Object value)
key
is already associated
in this instance with a value, the existing value is overwritten with the
specified value
.
The user-defined association created by this method and stored in this instance is not serialized by this instance and is thus only meant for runtime use.
The storage of the user data is implementation-specific and is thus not guaranteed to be optimized for execution time and memory use.
key
- the key to associate in this instance with the specified valuevalue
- the value to be associated in this instance with the specified
key
boolean isPersistent()
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.