|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.java.sip.communicator.impl.contactlist.MetaContactGroupImpl
public class MetaContactGroupImpl
A straightforward implementation of the meta contact group. The group implements a simple algorithm of sorting its children according to their status.
| Constructor Summary | |
|---|---|
MetaContactGroupImpl(MetaContactListServiceImpl mclServiceImpl,
String groupName)
Creates an instance of the root meta contact group. |
|
MetaContactGroupImpl(MetaContactListServiceImpl mclServiceImpl,
String groupName,
String metaUID)
Creates an instance of the root meta contact group assigning it the specified meta contact uid. |
|
| Method Summary | |
|---|---|
(package private) void |
addMetaContact(MetaContactImpl metaContact)
Adds the specified metaContact to ths local list of child contacts. |
(package private) void |
addProtoGroup(ContactGroup protoGroup)
Adds the specified group to the list of protocol specific groups that we're encapsulating in this meta contact group. |
(package private) void |
addSubgroup(MetaContactGroup subgroup)
Adds the specified meta group to the subgroups of this one. |
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. |
MetaContact |
findMetaContactByContact(Contact protoContact)
Returns a meta contact, a child of this group or its subgroups, that has the specified protocol specific contact. |
MetaContact |
findMetaContactByContact(String contactAddress,
String accountID)
Returns a meta contact, a child of this group or its subgroups, with address equald to contactAddress and a source protocol provider with the matching accountID. |
MetaContact |
findMetaContactByMetaUID(String metaUID)
Returns a meta contact, a child of this group or its subgroups, that has the specified metaUID. |
MetaContactGroupImpl |
findMetaContactGroupByContactGroup(ContactGroup protoContactGroup)
Returns a meta contact group, encapsulated by this group or its subgroups, that has the specified protocol specific contact. |
MetaContactGroup |
findMetaContactGroupByMetaUID(String metaUID)
Returns a meta contact group this group or some of its subgroups, that has the specified metaUID. |
Iterator<MetaContact> |
getChildContacts()
Returns a java.util.Iterator over the MetaContacts contained in this MetaContactGroup. |
ContactGroup |
getContactGroup(String grpName,
ProtocolProviderService ownerProvider)
Returns a contact group encapsulated by this meta contact group, having the specified groupName and coming from the indicated ownerProvider. |
Iterator<ContactGroup> |
getContactGroups()
Returns an iterator over all the protocol specific groups that this contact group represents. |
Iterator<ContactGroup> |
getContactGroupsForAccountID(String accountID)
Returns all protocol specific ContactGroups, encapsulated by this MetaContactGroup and coming from the provider matching the accountID param. |
Iterator<ContactGroup> |
getContactGroupsForProvider(ProtocolProviderService provider)
Returns all protocol specific ContactGroups, encapsulated by this MetaContactGroup and coming from the indicated ProtocolProviderService. |
Object |
getData(Object key)
Implements MetaContactGroup.getData(Object). |
String |
getGroupName()
Returns the name of this group. |
(package private) MetaContactListServiceImpl |
getMclServiceImpl()
Returns the implementation of the MetaContactListService, to which this group belongs. |
MetaContact |
getMetaContact(int index)
Returns the meta contact on the specified index. |
MetaContact |
getMetaContact(ProtocolProviderService provider,
String contactID)
Returns the meta contact encapsulating a contact belonging to the specified provider with the specified identifier. |
MetaContact |
getMetaContact(String metaContactID)
Returns the contact with the specified identifier |
MetaContactGroup |
getMetaContactSubgroup(int index)
Returns the MetaContactGroup with the specified index. |
MetaContactGroup |
getMetaContactSubgroup(String grpName)
Returns the MetaContactGroup with the specified name. |
MetaContactGroup |
getMetaContactSubgroupByUID(String grpUID)
Returns the MetaContactGroup with the specified groupUID. |
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 |
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 according 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. |
(package private) int |
lightAddMetaContact(MetaContactImpl metaContact)
Adds the metaContact to the local list of child contacts without setting its parrent contact and without any synchronization. |
(package private) void |
lightRemoveMetaContact(MetaContactImpl metaContact)
Removes the metaContact from the local list of child contacts without unsetting its parrent contact and without any synchronization. |
(package private) void |
removeMetaContact(MetaContactImpl metaContact)
Removes the specified metaContact from the local list of contacts. |
(package private) void |
removeProtoGroup(ContactGroup protoGroup)
Removes the specified group from the list of protocol specific groups that we're encapsulating in this meta contact group. |
(package private) MetaContactGroupImpl |
removeSubgroup(int index)
Removes the meta contact group with the specified index. |
(package private) boolean |
removeSubgroup(MetaContactGroup group)
Removes the specified group from the list of groups in this list. |
void |
setData(Object key,
Object value)
Implements MetaContactGroup.setData(Object, Object). |
(package private) void |
setGroupName(String newGroupName)
Sets the name of this group. |
String |
toString()
Returns a String representation of this group and the contacts it contains (may turn out to be a relatively long string). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
MetaContactGroupImpl(MetaContactListServiceImpl mclServiceImpl,
String groupName)
mclServiceImpl - the MetaContactListService implementation
which is to use the new MetaContactGroup instance as its rootgroupName - the name of the group to create
MetaContactGroupImpl(MetaContactListServiceImpl mclServiceImpl,
String groupName,
String metaUID)
mclServiceImpl - the implementation of the
MetaContactListService, to which this group belongsgroupName - the name of the group to createmetaUID - a UID that has been stored earlier or null when a new
UID needs to be created.| Method Detail |
|---|
public String getMetaUID()
getMetaUID in interface MetaContactGrouppublic MetaContactGroup getParentMetaContactGroup()
getParentMetaContactGroup in interface MetaContactGrouppublic boolean canContainSubgroups()
canContainSubgroups in interface MetaContactGrouppublic int countChildContacts()
countChildContacts in interface MetaContactGrouppublic int countOnlineChildContacts()
countOnlineChildContacts in interface MetaContactGrouppublic int countContactGroups()
countContactGroups in interface MetaContactGrouppublic int countSubgroups()
countSubgroups in interface MetaContactGrouppublic Iterator<MetaContact> getChildContacts()
In order to prevent problems with concurrency, the Iterator returned by this method is not over the actual list of groups but over a copy of that list.
getChildContacts in interface MetaContactGrouppublic MetaContact getMetaContact(String metaContactID)
getMetaContact in interface MetaContactGroupmetaContactID - a String identifier obtained through the
MetaContact.getMetaUID() method.
public int indexOf(MetaContact metaContact)
indexOf in interface MetaContactGroupmetaContact - the MetaContact whose index we're looking
for.
public int indexOf(MetaContactGroup metaContactGroup)
indexOf in interface MetaContactGroupmetaContactGroup - the MetaContactGroup whose index we're
looking for.
public MetaContact getMetaContact(ProtocolProviderService provider,
String contactID)
getMetaContact in interface MetaContactGroupprovider - 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.
public MetaContact findMetaContactByMetaUID(String metaUID)
metaUID - the Meta UID of the contact we're looking for.
public MetaContactGroup findMetaContactGroupByMetaUID(String metaUID)
metaUID - the Meta UID of the contact group we're looking for.
public Iterator<ContactGroup> getContactGroups()
In order to prevent problems with concurrency, the Iterator returned by this method is not over the actual list of groups but over a copy of that list.
getContactGroups in interface MetaContactGroup
public ContactGroup getContactGroup(String grpName,
ProtocolProviderService ownerProvider)
getContactGroup in interface MetaContactGroupgrpName - 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.
public Iterator<ContactGroup> getContactGroupsForProvider(ProtocolProviderService provider)
getContactGroupsForProvider in interface MetaContactGroupprovider - a reference to the ProtocolProviderService
whose ContactGroups we'd like to get.
public Iterator<ContactGroup> getContactGroupsForAccountID(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.
getContactGroupsForAccountID in interface MetaContactGroupaccountID - the id of the account whose contact groups we'd like to
retrieve.
public MetaContact findMetaContactByContact(Contact protoContact)
protoContact - the protocol specific contact whos meta contact we're
looking for.
public MetaContact findMetaContactByContact(String contactAddress,
String accountID)
contactAddress - the address of the protocol specific contact whose
meta contact we're looking for.accountID - the ID of the account that the contact we are looking
for must belong to.
public MetaContactGroupImpl findMetaContactGroupByContactGroup(ContactGroup protoContactGroup)
protoContactGroup - the protocol specific contact group whose meta
contact group we're looking for.
public MetaContact getMetaContact(int index)
throws IndexOutOfBoundsException
getMetaContact in interface MetaContactGroupindex - the index of the meta contact to return.
IndexOutOfBoundsException - in case index is not a
valid index for this group.void addMetaContact(MetaContactImpl metaContact)
metaContact - the MetaContact to add in the local vector.int lightAddMetaContact(MetaContactImpl metaContact)
metaContact - the MetaContact to add in the local vector.
void lightRemoveMetaContact(MetaContactImpl metaContact)
metaContact - the MetaContact to remove from the local
vector.void removeMetaContact(MetaContactImpl metaContact)
metaContact - the MetaContact
public MetaContactGroup getMetaContactSubgroup(int index)
throws IndexOutOfBoundsException
getMetaContactSubgroup in interface MetaContactGroupindex - the index of the group to return.
IndexOutOfBoundsException - if index is not a valid
index.public MetaContactGroup getMetaContactSubgroup(String grpName)
getMetaContactSubgroup in interface MetaContactGroupgrpName - the name of the group to return.
public MetaContactGroup getMetaContactSubgroupByUID(String grpUID)
grpUID - the uid of the group to return.
public boolean contains(MetaContact contact)
contains in interface MetaContactGroupcontact - the MetaContact whose relation to this group
we'd like to determine.
public boolean contains(MetaContactGroup group)
contains in interface MetaContactGroupgroup - the MetaContactGroup whose relation to this group
we'd like to determine.
public Iterator<MetaContactGroup> getSubgroups()
In order to prevent problems with concurrency, the Iterator returned by this method is not over the actual list of groups but over a copy of that list.
getSubgroups in interface MetaContactGrouppublic String getGroupName()
getGroupName in interface MetaContactGroupvoid setGroupName(String newGroupName)
newGroupName - a String containing the new name of this group.public String toString()
toString in interface MetaContactGrouptoString in class Objectvoid addProtoGroup(ContactGroup protoGroup)
protoGroup - the root to add to the groups merged in this meta contact
group.void removeProtoGroup(ContactGroup protoGroup)
protoGroup - the group to remove from the groups merged in this meta
contact group.void addSubgroup(MetaContactGroup subgroup)
subgroup - the MetaContactGroup to register as a subgroup to this
root meta contact group.MetaContactGroupImpl removeSubgroup(int index)
index - the index of the group to remove.
boolean removeSubgroup(MetaContactGroup group)
group - the MetaContactGroup to remove.
final MetaContactListServiceImpl getMclServiceImpl()
public Object getData(Object key)
MetaContactGroup.getData(Object).
getData in interface MetaContactGroupkey - the key of the user data associated with this instance to be
retrieved
public void setData(Object key,
Object value)
MetaContactGroup.setData(Object, Object).
setData in interface MetaContactGroupkey - the of the datavalue - the value of the datapublic boolean isPersistent()
isPersistent in interface MetaContactGroup
|
Jitsi: the OpenSource Java VoIP and Instant Messaging client. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||