public class ContactGroupGibberishImpl extends java.lang.Object implements ContactGroup
Constructor and Description |
---|
ContactGroupGibberishImpl(java.lang.String groupName,
ProtocolProviderServiceGibberishImpl parentProvider)
Creates a ContactGroupGibberishImpl with the specified name.
|
Modifier and Type | Method and Description |
---|---|
void |
addContact(ContactGibberishImpl contactToAdd)
Adds the specified contact to this group.
|
void |
addSubgroup(ContactGroupGibberishImpl subgroup)
Adds the specified contact group to the contained by 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
ContactGroup.
|
(package private) static java.lang.String |
createNameFromUID(java.lang.String uid)
Ugly but tricky conversion method.
|
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one which in terms
of contact groups translates to having the equal names and matching
subgroups and child contacts.
|
ContactGibberishImpl |
findContactByID(java.lang.String id)
Returns the contact with the specified id or null if no such contact
exists.
|
ContactGroupGibberishImpl |
findContactParent(ContactGibberishImpl gibberishContact)
Returns the group that is parent of the specified gibberishContact or
null if no parent was found.
|
ContactGroupGibberishImpl |
findGroupParent(ContactGroupGibberishImpl gibberishGroup)
Returns the group that is parent of the specified gibberishGroup or null
if no parent 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.
|
ContactGroup |
getGroup(java.lang.String groupName)
Returns the subgroup with the specified name.
|
java.lang.String |
getGroupName()
Returns the name of this group.
|
ContactGroup |
getParentContactGroup()
Returns the contact group that currently contains this group or null if
this is the root contact group.
|
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.
|
java.lang.String |
getUID()
Returns a String that uniquely represnets the group inside
the current protocol.
|
int |
hashCode() |
boolean |
isPersistent()
Determines whether or not this contact group is being stored by the
server.
|
boolean |
isResolved()
Determines whether or not this contact has been resolved against the
server.
|
void |
removeContact(ContactGibberishImpl contact)
Removes the specified contact from this group.
|
void |
removeSubGroup(ContactGroupGibberishImpl subgroup)
Removes the specified contact group from the this group's subgroups.
|
void |
setGroupName(java.lang.String newGrpName)
Sets this group a new name.
|
(package private) void |
setParentGroup(ContactGroupGibberishImpl parent)
Sets the group that is the new parent of this group
|
void |
setPersistent(boolean isPersistent)
Specifies whether or not this contact group is being stored by the server.
|
void |
setResolved(boolean resolved)
Makes the group resolved or unresolved.
|
java.util.Iterator<ContactGroup> |
subgroups()
Returns an iterator over the sub groups that this
ContactGroup contains.
|
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).
|
public ContactGroupGibberishImpl(java.lang.String groupName, ProtocolProviderServiceGibberishImpl parentProvider)
groupName
- the name of the group.parentProvider
- the protocol provider that created this group.public boolean canContainSubgroups()
canContainSubgroups
in interface ContactGroup
public ProtocolProviderService getProtocolProvider()
getProtocolProvider
in interface ContactGroup
public java.util.Iterator<Contact> contacts()
contacts
in interface ContactGroup
public void addContact(ContactGibberishImpl contactToAdd)
contactToAdd
- the ContactGibberishImpl to add to this group.public int countContacts()
countContacts
in interface ContactGroup
public int countSubgroups()
countSubgroups
in interface ContactGroup
public void addSubgroup(ContactGroupGibberishImpl subgroup)
subgroup
- the ContactGroupGibberishImpl to add as a subgroup to this group.void setParentGroup(ContactGroupGibberishImpl parent)
parent
- ContactGroupGibberishImplpublic ContactGroup getParentContactGroup()
getParentContactGroup
in interface ContactGroup
public void removeSubGroup(ContactGroupGibberishImpl subgroup)
subgroup
- the ContactGroupGibberishImpl subgroup to remove.public ContactGroupGibberishImpl findGroupParent(ContactGroupGibberishImpl gibberishGroup)
gibberishGroup
- the group whose parent we're looking for.public ContactGroupGibberishImpl findContactParent(ContactGibberishImpl gibberishContact)
gibberishContact
- the contact whose parent we're looking for.public Contact getContact(java.lang.String id)
getContact
in interface ContactGroup
id
- the address or identifier of the Contact we are
looking for.public ContactGroup getGroup(int index)
getGroup
in interface ContactGroup
index
- the index of the ContactGroup to retrieve.public ContactGroup getGroup(java.lang.String groupName)
getGroup
in interface ContactGroup
groupName
- the name of the ContactGroup to retrieve.public java.lang.String getGroupName()
getGroupName
in interface ContactGroup
public void setGroupName(java.lang.String newGrpName)
newGrpName
- a String containing the new name of this group.public java.util.Iterator<ContactGroup> subgroups()
subgroups
in interface ContactGroup
public void removeContact(ContactGibberishImpl contact)
contact
- the ContactGibberishImpl to remove from this grouppublic ContactGibberishImpl findContactByID(java.lang.String id)
id
- the id of the contact we're looking for.public java.lang.String toString()
toString
in class java.lang.Object
public void setPersistent(boolean isPersistent)
isPersistent
- true if the contact group is to be persistent and
false otherwise.public boolean isPersistent()
isPersistent
in interface ContactGroup
public java.lang.String getPersistentData()
getPersistentData
in interface ContactGroup
public boolean isResolved()
isResolved
in interface ContactGroup
public void setResolved(boolean resolved)
resolved
- true to make the group resolved; false to
make it unresolvedpublic java.lang.String getUID()
getUID
in interface ContactGroup
static java.lang.String createNameFromUID(java.lang.String uid)
uid
- the uid we'd like to get a name frompublic boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the reference object with which to compare.true
if this contact group has the equal child
contacts and subgroups to those of the obj
argument.public int hashCode()
hashCode
in class java.lang.Object
Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under Apache license.