proj_name
stringclasses 26
values | relative_path
stringlengths 42
165
| class_name
stringlengths 3
46
| func_name
stringlengths 2
44
| masked_class
stringlengths 80
7.9k
| func_body
stringlengths 76
5.98k
| initial_context
stringclasses 74
values | parent_class_output
stringlengths 20
1.75k
| parent_class_output_re_type
unknown | parent_class_output_re_method
unknown | func_body_re_type
unknown | func_body_re_method
unknown | relevant_context
stringlengths 0
99.1k
| relevant_context_no_cmt
stringlengths 0
36.2k
| retrieved_names
stringlengths 39
1.7k
| retrieved_types
stringlengths 2
128k
| retrieved_methods
stringlengths 2
20.3k
| similar_methods
stringlengths 2
3.74k
| func_body_re.methods
unknown | func_body_re.similar_methods
unknown | func_body_re.types
unknown | retrieved_types_grouth_truth
stringlengths 0
96.5k
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
qiujiayu_AutoLoadCache | AutoLoadCache/autoload-cache-serializer/autoload-cache-serializer-protobuf/src/main/java/com/jarvis/cache/serializer/protobuf/HeapByteBufUtil.java | HeapByteBufUtil | setIntLE | class HeapByteBufUtil {
static byte getByte(byte[] memory, int index) {
return memory[index];
}
static short getShort(byte[] memory, int index) {
return (short) (memory[index] << 8 | memory[index + 1] & 0xFF);
}
static short getShortLE(byte[] memory, int index) {
return (short) (memory[index] & 0xff | memory[index + 1] << 8);
}
static int getUnsignedMedium(byte[] memory, int index) {
return (memory[index] & 0xff) << 16 |
(memory[index + 1] & 0xff) << 8 |
memory[index + 2] & 0xff;
}
static int getUnsignedMediumLE(byte[] memory, int index) {
return memory[index] & 0xff |
(memory[index + 1] & 0xff) << 8 |
(memory[index + 2] & 0xff) << 16;
}
static int getInt(byte[] memory, int index) {
return (memory[index] & 0xff) << 24 |
(memory[index + 1] & 0xff) << 16 |
(memory[index + 2] & 0xff) << 8 |
memory[index + 3] & 0xff;
}
static int getIntLE(byte[] memory, int index) {
return memory[index] & 0xff |
(memory[index + 1] & 0xff) << 8 |
(memory[index + 2] & 0xff) << 16 |
(memory[index + 3] & 0xff) << 24;
}
static long getLong(byte[] memory, int index) {
return ((long) memory[index] & 0xff) << 56 |
((long) memory[index + 1] & 0xff) << 48 |
((long) memory[index + 2] & 0xff) << 40 |
((long) memory[index + 3] & 0xff) << 32 |
((long) memory[index + 4] & 0xff) << 24 |
((long) memory[index + 5] & 0xff) << 16 |
((long) memory[index + 6] & 0xff) << 8 |
(long) memory[index + 7] & 0xff;
}
static long getLongLE(byte[] memory, int index) {
return (long) memory[index] & 0xff |
((long) memory[index + 1] & 0xff) << 8 |
((long) memory[index + 2] & 0xff) << 16 |
((long) memory[index + 3] & 0xff) << 24 |
((long) memory[index + 4] & 0xff) << 32 |
((long) memory[index + 5] & 0xff) << 40 |
((long) memory[index + 6] & 0xff) << 48 |
((long) memory[index + 7] & 0xff) << 56;
}
static void setByte(byte[] memory, int index, int value) {
memory[index] = (byte) value;
}
static void setShort(byte[] memory, int index, int value) {
memory[index] = (byte) (value >>> 8);
memory[index + 1] = (byte) value;
}
static void setShortLE(byte[] memory, int index, int value) {
memory[index] = (byte) value;
memory[index + 1] = (byte) (value >>> 8);
}
static void setMedium(byte[] memory, int index, int value) {
memory[index] = (byte) (value >>> 16);
memory[index + 1] = (byte) (value >>> 8);
memory[index + 2] = (byte) value;
}
static void setMediumLE(byte[] memory, int index, int value) {
memory[index] = (byte) value;
memory[index + 1] = (byte) (value >>> 8);
memory[index + 2] = (byte) (value >>> 16);
}
static void setInt(byte[] memory, int index, int value) {
memory[index] = (byte) (value >>> 24);
memory[index + 1] = (byte) (value >>> 16);
memory[index + 2] = (byte) (value >>> 8);
memory[index + 3] = (byte) value;
}
static void setIntLE(byte[] memory, int index, int value) {<FILL_FUNCTION_BODY>}
static void setLong(byte[] memory, int index, long value) {
memory[index] = (byte) (value >>> 56);
memory[index + 1] = (byte) (value >>> 48);
memory[index + 2] = (byte) (value >>> 40);
memory[index + 3] = (byte) (value >>> 32);
memory[index + 4] = (byte) (value >>> 24);
memory[index + 5] = (byte) (value >>> 16);
memory[index + 6] = (byte) (value >>> 8);
memory[index + 7] = (byte) value;
}
static void setLongLE(byte[] memory, int index, long value) {
memory[index] = (byte) value;
memory[index + 1] = (byte) (value >>> 8);
memory[index + 2] = (byte) (value >>> 16);
memory[index + 3] = (byte) (value >>> 24);
memory[index + 4] = (byte) (value >>> 32);
memory[index + 5] = (byte) (value >>> 40);
memory[index + 6] = (byte) (value >>> 48);
memory[index + 7] = (byte) (value >>> 56);
}
private HeapByteBufUtil() {
}
} |
memory[index] = (byte) value;
memory[index + 1] = (byte) (value >>> 8);
memory[index + 2] = (byte) (value >>> 16);
memory[index + 3] = (byte) (value >>> 24);
|
memory[index] = (byte) value;
memory[index + 1] = (byte) (value >>> 8);
memory[index + 2] = (byte) (value >>> 16);
memory[index + 3] = (byte) (value >>> 24);
| [
91,
93
] | [
91,
93
] | [
91,
93
] | [
91,
93
] | {"similar_methods": [{"setIntLE": ""}]} | [] | [] | [] | [
91,
110,
117,
108,
108,
93
] | [
91,
34,
115,
101,
116,
73,
110,
116,
76,
69,
34,
93
] | [
91,
110,
117,
108,
108,
93
] | ||||
jitsi_jitsi | jitsi/modules/plugin/otr/src/main/java/net/java/sip/communicator/plugin/otr/OtrMetaContactMenu.java | OtrMetaContactMenu | createOtrContactMenus | class OtrMetaContactMenu
extends AbstractPluginComponent
implements ActionListener,
PopupMenuListener
{
/**
* The last known <tt>MetaContact</tt> to be currently selected and to be
* depicted by this instance and the <tt>OtrContactMenu</tt>s it contains.
*/
private MetaContact currentContact;
/**
* The indicator which determines whether the <tt>JMenu</tt> of this
* <tt>OtrMetaContactMenu</tt> is displayed in the Mac OS X screen menu bar
* and thus should work around the known problem of PopupMenuListener not
* being invoked.
*/
private final boolean inMacOSXScreenMenuBar;
/**
* The <tt>JMenu</tt> which is the component of this plug-in.
*/
private JMenu menu;
/**
* The "What's this?" <tt>JMenuItem</tt> which launches help on the subject
* of off-the-record messaging.
*/
private JMenuItem whatsThis;
public OtrMetaContactMenu(Container container,
PluginComponentFactory parentFactory)
{
super(container, parentFactory);
inMacOSXScreenMenuBar =
Container.CONTAINER_CHAT_MENU_BAR.equals(container)
&& OSUtils.IS_MAC;
}
/*
* Implements ActionListener#actionPerformed(ActionEvent). Handles the
* invocation of the whatsThis menu item i.e. launches help on the subject
* of off-the-record messaging.
*/
public void actionPerformed(ActionEvent e)
{
OtrActivator.scOtrEngine.launchHelp();
}
/**
* Creates an {@link OtrContactMenu} for each {@link Contact} contained in
* the <tt>metaContact</tt>.
*
* @param metaContact The {@link MetaContact} this
* {@link OtrMetaContactMenu} refers to.
*/
private void createOtrContactMenus(MetaContact metaContact)
{<FILL_FUNCTION_BODY>}
/*
* Implements PluginComponent#getComponent(). Returns the JMenu which is the
* component of this plug-in creating it first if it doesn't exist.
*/
public Component getComponent()
{
return getMenu();
}
/**
* Gets the <tt>JMenu</tt> which is the component of this plug-in. If it
* still doesn't exist, it's created.
*
* @return the <tt>JMenu</tt> which is the component of this plug-in
*/
private JMenu getMenu()
{
if (menu == null)
{
menu = new SIPCommMenu();
menu.setText(getName());
if (Container.CONTAINER_CONTACT_RIGHT_BUTTON_MENU
.equals(getContainer()))
{
Icon icon =
OtrActivator.resourceService
.getImage("plugin.otr.MENU_ITEM_ICON_16x16");
if (icon != null)
menu.setIcon(icon);
}
if (!inMacOSXScreenMenuBar)
menu.getPopupMenu().addPopupMenuListener(this);
}
return menu;
}
/*
* Implements PluginComponent#getName().
*/
public String getName()
{
return OtrActivator.resourceService
.getI18NString("plugin.otr.menu.TITLE");
}
/*
* Implements PopupMenuListener#popupMenuCanceled(PopupMenuEvent).
*/
public void popupMenuCanceled(PopupMenuEvent e)
{
createOtrContactMenus(null);
}
/*
* Implements PopupMenuListener#popupMenuWillBecomeInvisible(
* PopupMenuEvent).
*/
public void popupMenuWillBecomeInvisible(PopupMenuEvent e)
{
popupMenuCanceled(e);
}
/*
* Implements PopupMenuListener#popupMenuWillBecomeVisible(PopupMenuEvent).
*/
public void popupMenuWillBecomeVisible(PopupMenuEvent e)
{
createOtrContactMenus(currentContact);
JMenu menu = getMenu();
menu.addSeparator();
whatsThis = new JMenuItem();
whatsThis.setIcon(
OtrActivator.resourceService.getImage(
"plugin.otr.HELP_ICON_15x15"));
whatsThis.setText(
OtrActivator.resourceService.getI18NString(
"plugin.otr.menu.WHATS_THIS"));
whatsThis.addActionListener(this);
menu.add(whatsThis);
}
/*
* Implements PluginComponent#setCurrentContact(MetaContact).
*/
@Override
public void setCurrentContact(MetaContact metaContact)
{
if (this.currentContact != metaContact)
{
this.currentContact = metaContact;
if (inMacOSXScreenMenuBar)
popupMenuWillBecomeVisible(null);
else if ((menu != null) && menu.isPopupMenuVisible())
createOtrContactMenus(currentContact);
}
}
} |
JMenu menu = getMenu();
// Remove any existing OtrContactMenu items.
menu.removeAll();
// Create the new OtrContactMenu items.
if (metaContact != null)
{
Iterator<Contact> contacts = metaContact.getContacts();
if (metaContact.getContactCount() == 1)
{
Contact contact = contacts.next();
Collection<ContactResource> resources = contact.getResources();
if (contact.supportResources() &&
resources != null &&
resources.size() > 0)
{
for (ContactResource resource : resources)
{
new OtrContactMenu(
OtrContactManager.getOtrContact(contact, resource),
inMacOSXScreenMenuBar,
menu,
true);
}
}
else
new OtrContactMenu(
OtrContactManager.getOtrContact(contact, null),
inMacOSXScreenMenuBar,
menu,
false);
}
else
while (contacts.hasNext())
{
Contact contact = contacts.next();
Collection<ContactResource> resources =
contact.getResources();
if (contact.supportResources() &&
resources != null &&
resources.size() > 0)
{
for (ContactResource resource : resources)
{
new OtrContactMenu(
OtrContactManager.getOtrContact(
contact, resource),
inMacOSXScreenMenuBar,
menu,
true);
}
}
else
new OtrContactMenu(
OtrContactManager.getOtrContact(contact, null),
inMacOSXScreenMenuBar,
menu,
true);
}
}
| /**
* Provides an abstract base implementation of <code>PluginComponent</code> in order to take care of the implementation boilerplate and let implementers focus on the specifics of their plug-in.
* @author Lyubomir Marinov
*/
public abstract class AbstractPluginComponent implements PluginComponent {
/**
* The parent factory.
*/
private final PluginComponentFactory parentFactory;
/**
* The container in which the component of this plug-in is to be added.
*/
private final Container container;
/**
* Initializes a new <code>AbstractPluginComponent</code> which is to be added to a specific <code>Container</code>.
* @param container the container in which the component of the new plug-inis to be added
* @param parentFactory the parent <tt>PluginComponentFactory</tt> that iscreating this plugin component.
*/
protected AbstractPluginComponent( Container container, PluginComponentFactory parentFactory);
public String getConstraints();
public Container getContainer();
/**
* Implements {@link PluginComponent#getPositionIndex()}. Returns <tt>-1</tt> which indicates that the position of this <tt>AbstractPluginComponent</tt> within its <tt>Container</tt> is of no importance.
* @return <tt>-1</tt> which indicates that the position of this<tt>AbstractPluginComponent</tt> within its <tt>Container</tt> is of no importance
* @see PluginComponent#getPositionIndex()
*/
public int getPositionIndex();
public boolean isNativeComponent();
public void setCurrentContact( Contact contact);
public void setCurrentContact( Contact contact, String resourceName);
public void setCurrentContact( MetaContact metaContact);
public void setCurrentContactGroup( MetaContactGroup metaGroup);
public void setCurrentAccountID( AccountID accountID);
/**
* Returns the factory that has created the component.
* @return the parent factory.
*/
public PluginComponentFactory getParentFactory();
}
|
if (metaContact != null)
{
for (Contact contact : metaContact.getContacts())
{
OtrContactMenu otrContactMenu =
new OtrContactMenu(getContainer(), getParentFactory());
otrContactMenu.setCurrentContact(contact);
menu.add(otrContactMenu);
}
}
else
{
menu.removeAll();
}
| [
91,
34,
67,
111,
110,
116,
97,
99,
116,
34,
44,
34,
74,
77,
101,
110,
117,
34,
44,
34,
79,
116,
114,
67,
111,
110,
116,
97,
99,
116,
77,
101,
110,
117,
34,
44,
34,
77,
101,
116,
97,
67,
111,
110,
116,
97,
99,
116,
34,
93
] | [
91,
34,
115,
101,
116,
67,
117,
114,
114,
101,
110,
116,
67,
111,
110,
116,
97,
99,
116,
34,
44,
34,
114,
101,
109,
111,
118,
101,
65,
108,
108,
34,
44,
34,
97,
100,
100,
34,
44,
34,
103,
101,
116,
67,
111,
110,
116,
97,
99,
116,
115,
34,
93
] | [
91,
34,
77,
101,
116,
97,
67,
111,
110,
116,
97,
99,
116,
34,
44,
34,
67,
111,
110,
116,
97,
99,
116,
82,
101,
115,
111,
117,
114,
99,
101,
34,
44,
34,
73,
116,
101,
114,
97,
116,
111,
114,
60,
67,
111,
110,
116,
97,
99,
116,
62,
34,
44,
34,
74,
77,
101,
110,
117,
34,
44,
34,
67,
111,
108,
108,
101,
99,
116,
105,
111,
110,
60,
67,
111,
110,
116,
97,
99,
116,
82,
101,
115,
111,
117,
114,
99,
101,
62,
34,
44,
34,
67,
111,
110,
116,
97,
99,
116,
34,
93
] | [
91,
34,
115,
117,
112,
112,
111,
114,
116,
82,
101,
115,
111,
117,
114,
99,
101,
115,
34,
44,
34,
103,
101,
116,
82,
101,
115,
111,
117,
114,
99,
101,
115,
34,
44,
34,
103,
101,
116,
67,
111,
110,
116,
97,
99,
116,
67,
111,
117,
110,
116,
34,
44,
34,
104,
97,
115,
78,
101,
120,
116,
34,
44,
34,
115,
105,
122,
101,
34,
44,
34,
114,
101,
109,
111,
118,
101,
65,
108,
108,
34,
44,
34,
103,
101,
116,
79,
116,
114,
67,
111,
110,
116,
97,
99,
116,
34,
44,
34,
103,
101,
116,
67,
111,
110,
116,
97,
99,
116,
115,
34,
44,
34,
110,
101,
120,
116,
34,
93
] | /**
* A MetaContact is an abstraction used for merging multiple Contacts (most often) belonging to different <tt>ProtocolProvider</tt>s. <p> Instances of a MetaContact are read-only objects that cannot be modified directly but only through the corresponding MetaContactListService. </p>
* @author Emil Ivov
* @author Lubomir Marinov
*/
public interface MetaContact extends Comparable<MetaContact> {
/**
* Returns the default protocol specific <tt>Contact</tt> to use when communicating with this <tt>MetaContact</tt>.
* @return the default <tt>Contact</tt> to use when communicating withthis <tt>MetaContact</tt>
*/
public Contact getDefaultContact();
/**
* Returns the default protocol specific <tt>Contact</tt> to use with this <tt>MetaContact</tt> for a precise operation (IM, call, ...).
* @param operationSet the operation for which the default contact is needed
* @return the default contact for the specified operation.
*/
public Contact getDefaultContact( Class<? extends OperationSet> operationSet);
/**
* Returns a <tt>java.util.Iterator</tt> with all protocol specific <tt>Contacts</tt> encapsulated by this <tt>MetaContact</tt>. <p> Note to implementors: In order to prevent problems with concurrency, the <tt>Iterator</tt> returned by this method should not be over the actual list of contacts but rather over a copy of that list. <p>
* @return a <tt>java.util.Iterator</tt> containing all protocol specific<tt>Contact</tt>s that were registered as subcontacts for this <tt>MetaContact</tt>
*/
public Iterator<Contact> getContacts();
/**
* Returns a contact encapsulated by this meta contact, having the specified contactAddress and coming from the indicated ownerProvider.
* @param contactAddress the address of the contact who we're looking for.
* @param ownerProvider a reference to the ProtocolProviderService thatthe contact we're looking for belongs to.
* @return a reference to a <tt>Contact</tt>, encapsulated by thisMetaContact, carrying the specified address and originating from the specified ownerProvider or null if no such contact exists..
*/
public Contact getContact( String contactAddress, ProtocolProviderService ownerProvider);
/**
* Returns <tt>true</tt> if the given <tt>protocolContact</tt> is contained in this <tt>MetaContact</tt>, otherwise - returns <tt>false</tt>.
* @param protocolContact the <tt>Contact</tt> we're looking for
* @return <tt>true</tt> if the given <tt>protocolContact</tt> is containedin this <tt>MetaContact</tt>, otherwise - returns <tt>false</tt>
*/
public boolean containsContact( Contact protocolContact);
/**
* Returns the number of protocol speciic <tt>Contact</tt>s that this <tt>MetaContact</tt> contains.
* @return an int indicating the number of protocol specific contacts mergedin this <tt>MetaContact</tt>
*/
public int getContactCount();
/**
* Returns all protocol specific Contacts, encapsulated by this MetaContact and coming from the indicated ProtocolProviderService. If none of the contacts encapsulated by this MetaContact is originating from the specified provider then an empty iterator is returned. <p> Note to implementors: In order to prevent problems with concurrency, the <tt>Iterator</tt> returned by this method should not be over the actual list of contacts but rather over a copy of that list. <p>
* @param provider a reference to the <tt>ProtocolProviderService</tt>whose contacts we'd like to get.
* @return an <tt>Iterator</tt> over all contacts encapsulated in this<tt>MetaContact</tt> and originating from the specified provider.
*/
public Iterator<Contact> getContactsForProvider( ProtocolProviderService provider);
/**
* Returns all protocol specific Contacts, encapsulated by this MetaContact and supporting the given <tt>opSetClass</tt>. If none of the contacts encapsulated by this MetaContact is supporting the specified <tt>OperationSet</tt> class then an empty list is returned. <p> Note to implementors: In order to prevent problems with concurrency, the <tt>List</tt> returned by this method should not be the actual list of contacts but rather a copy of that list. <p>
* @param opSetClass the operation for which the default contact is needed
* @return a <tt>List</tt> of all contacts encapsulated in this<tt>MetaContact</tt> and supporting the specified <tt>OperationSet</tt>
*/
public List<Contact> getContactsForOperationSet( Class<? extends OperationSet> opSetClass);
/**
* Returns the MetaContactGroup currently containing this meta contact
* @return a reference to the MetaContactGroup currently containing thismeta contact.
*/
public MetaContactGroup getParentMetaContactGroup();
/**
* Returns a String identifier (the actual contents is left to implementations) that uniquely represents this <tt>MetaContact</tt> in the containing <tt>MetaContactList</tt>
* @return String
*/
public String getMetaUID();
/**
* Returns a characteristic display name that can be used when including this <tt>MetaContact</tt> in user interface.
* @return a human readable String that represents this meta contact.
*/
public String getDisplayName();
/**
* Returns the avatar of this contact, that can be used when including this <tt>MetaContact</tt> in user interface.
* @return an avatar (e.g. user photo) of this contact.
*/
public byte[] getAvatar();
/**
* Returns the avatar of this contact, that can be used when including this <tt>MetaContact</tt> in user interface. The isLazy parameter would tell the implementation if it could return the locally stored avatar or it should obtain the avatar right from the server.
* @param isLazy Indicates if this method should return the locally storedavatar or it should obtain the avatar right from the server.
* @return an avatar (e.g. user photo) of this contact.
*/
public byte[] getAvatar( boolean isLazy);
/**
* Returns a String representation of this <tt>MetaContact</tt>.
* @return a String representation of this <tt>MetaContact</tt>.
*/
public String toString();
/**
* Adds a custom detail to this contact.
* @param name name of the detail.
* @param value the value of the detail.
*/
public void addDetail( String name, String value);
/**
* Remove the given detail.
* @param name of the detail to be removed.
* @param value value of the detail to be removed.
*/
public void removeDetail( String name, String value);
/**
* Remove all details with given name.
* @param name of the details to be removed.
*/
public void removeDetails( String name);
/**
* Change the detail.
* @param name of the detail to be changed.
* @param oldValue the old value of the detail.
* @param newValue the new value of the detail.
*/
public void changeDetail( String name, String oldValue, String newValue);
/**
* Get all details with given name.
* @param name the name of the details we are searching.
* @return list of string values for the details with the given name.
*/
public List<String> getDetails( String name);
/**
* Gets the user data associated with this instance and a specific key.
* @param key the key of the user data associated with this instance to beretrieved
* @return an <tt>Object</tt> which represents the value associated withthis instance and the specified <tt>key</tt>; <tt>null</tt> if no association with the specified <tt>key</tt> exists in this instance
*/
public Object getData( Object key);
/**
* Sets a user-specific association in this instance in the form of a key-value pair. If the specified <tt>key</tt> is already associated in this instance with a value, the existing value is overwritten with the specified <tt>value</tt>. <p> 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. </p> <p> The storage of the user data is implementation-specific and is thus not guaranteed to be optimized for execution time and memory use. </p>
* @param key the key to associate in this instance with the specified value
* @param value the value to be associated in this instance with thespecified <tt>key</tt>
*/
public void setData( Object key, Object value);
}
/**
* The <tt>ContactResource</tt> class represents a resource, from which a <tt>Contact</tt> is connected.
* @author Yana Stamcheva
*/
public class ContactResource {
/**
* A static instance of this class representing the base resource. If this base resource is passed as a parameter for any operation (send message, call) the operation should explicitly use the base contact address. This is meant to force a call or a message sending to all the resources for the corresponding contact.
*/
public static ContactResource BASE_RESOURCE=new ContactResource();
/**
* The contact, to which this resource belongs.
*/
private Contact contact;
/**
* The name of this contact resource.
*/
private String resourceName;
/**
* The presence status of this contact resource.
*/
protected PresenceStatus presenceStatus;
/**
* The priority of this contact source.
*/
protected int priority;
/**
* Whether this contact resource is a mobile one.
*/
protected boolean mobile=false;
/**
* Creates an empty instance of <tt>ContactResource</tt> representing the base resource.
*/
public ContactResource();
/**
* Creates a <tt>ContactResource</tt> by specifying the <tt>resourceName</tt>, the <tt>presenceStatus</tt> and the <tt>priority</tt>.
* @param contact the parent <tt>Contact</tt> this resource is about
* @param resourceName the name of this resource
* @param presenceStatus the presence status of this resource
* @param priority the priority of this resource
*/
public ContactResource( Contact contact, String resourceName, PresenceStatus presenceStatus, int priority, boolean mobile);
/**
* Returns the <tt>Contact</tt>, this resources belongs to.
* @return the <tt>Contact</tt>, this resources belongs to
*/
public Contact getContact();
/**
* Returns the name of this resource.
* @return the name of this resource
*/
public String getResourceName();
/**
* Returns the presence status of this resource.
* @return the presence status of this resource
*/
public PresenceStatus getPresenceStatus();
/**
* Returns the priority of the resources.
* @return the priority of this resource
*/
public int getPriority();
/**
* Whether contact is mobile one. Logged in only from mobile device.
* @return whether contact is mobile one.
*/
public boolean isMobile();
@Override public int hashCode();
@Override public boolean equals( Object obj);
}
/**
* The Activator of the Contact Info bundle.
* @author Adam Goldstein
* @author Yana Stamcheva
*/
public class ContactInfoActivator extends DependentActivator {
private org.slf4j.Logger logger=org.slf4j.LoggerFactory.getLogger(ContactInfoActivator.class);
/**
* Indicates if the contact info button is enabled in the chat window.
*/
private static final String ENABLED_IN_CHAT_WINDOW_PROP="net.java.sip.communicator.plugin.contactinfo." + "ENABLED_IN_CHAT_WINDOW_PROP";
/**
* Indicates if the contact info button is enabled in the call window.
*/
private static final String ENABLED_IN_CALL_WINDOW_PROP="net.java.sip.communicator.plugin.contactinfo." + "ENABLED_IN_CALL_WINDOW_PROP";
private static BrowserLauncherService browserLauncherService;
/**
* The image loader service implementation.
*/
private static ImageLoaderService<?> imageLoaderService=null;
/**
* The contact list service implementation.
*/
private static MetaContactListService metaCListService;
static BundleContext bundleContext;
public ContactInfoActivator();
/**
* Starts this bundle.
*/
@Override public void startWithServices( BundleContext bc);
/**
* Returns the <tt>BrowserLauncherService</tt> obtained from the bundle context.
* @return the <tt>BrowserLauncherService</tt> obtained from the bundlecontext
*/
public static BrowserLauncherService getBrowserLauncher();
/**
* Returns the imageLoaderService instance, if missing query osgi for it.
* @return the imageLoaderService.
*/
public static ImageLoaderService<?> getImageLoaderService();
/**
* Returns the <tt>MetaContactListService</tt> obtained from the bundle context.
* @return the <tt>MetaContactListService</tt> obtained from the bundlecontext
*/
public static MetaContactListService getContactListService();
/**
* Contact info create factory.
*/
private class ContactInfoPluginComponentFactory extends PluginComponentFactory {
ContactInfoPluginComponentFactory( Container c);
@Override protected PluginComponent getPluginInstance();
}
}
/**
* The <tt>HelpMenu</tt> is a menu in the main application menu bar.
* @author Yana Stamcheva
* @author Lubomir Marinov
*/
public class HelpMenu extends SIPCommMenu implements ActionListener, PluginComponentListener {
private final org.slf4j.Logger logger=org.slf4j.LoggerFactory.getLogger(HelpMenu.class.getName());
/**
* Creates an instance of <tt>HelpMenu</tt>.
* @param chatWindow The parent <tt>MainFrame</tt>.
*/
public HelpMenu( ChatWindow chatWindow);
/**
* Runs clean-up for associated resources which need explicit disposal (e.g. listeners keeping this instance alive because they were added to the model which operationally outlives this instance).
*/
public void dispose();
/**
* Initialize plugin components already registered for this container.
*/
private void initPluginComponents();
/**
* Handles the <tt>ActionEvent</tt> when one of the menu items is selected.
*/
public void actionPerformed( ActionEvent e);
public void pluginComponentAdded( PluginComponentEvent event);
public void pluginComponentRemoved( PluginComponentEvent event);
}
/**
* This class represents the notion of a Contact or Buddy, that is widely used in instant messaging today. From a protocol point of view, a contact is generally considered to be another user of the service that proposes the protocol. Instances of Contact could be used for delivery of presence notifications or when addressing instant messages.
* @author Emil Ivov
*/
public interface Contact {
/**
* Returns a String that can be used for identifying the contact. The exact contents of the string depends on the protocol. In the case of SIP, for example, that would be the SIP uri (e.g. sip:alice@biloxi.com) in the case of icq - a UIN (12345653) and for AIM a screenname (mysname). Jabber (and hence Google) would be having e-mail like addresses.
* @return a String id representing and uniquely identifying the contact.
*/
public String getAddress();
/**
* Returns a String that could be used by any user interacting modules for referring to this contact. An alias is not necessarily unique but is often more human readable than an address (or id).
* @return a String that can be used for referring to this contact wheninteracting with the user.
*/
public String getDisplayName();
/**
* Returns a byte array containing an image (most often a photo or an avatar) that the contact uses as a representation.
* @return byte[] an image representing the contact.
*/
public byte[] getImage();
/**
* Returns the status of the contact as per the last status update we've received for it. Note that this method is not to perform any network operations and will simply return the status received in the last status update message. If you want a reliable way of retrieving someone's status, you should use the <tt>queryContactStatus()</tt> method in <tt>OperationSetPresence</tt>.
* @return the PresenceStatus that we've received in the last status updatepertaining to this contact.
*/
public PresenceStatus getPresenceStatus();
/**
* Returns a reference to the contact group that this contact is currently a child of or null if the underlying protocol does not support persistent presence.
* @return a reference to the contact group that this contact is currentlya child of or null if the underlying protocol does not support persistent presence.
*/
public ContactGroup getParentContactGroup();
/**
* Returns a reference to the protocol provider that created the contact.
* @return a reference to an instance of the ProtocolProviderService
*/
public ProtocolProviderService getProtocolProvider();
/**
* Determines whether or not this contact is being stored by the server. Non persistent contacts are common in the case of simple, non-persistent presence operation sets. They could however also be seen in persistent presence operation sets when for example we have received an event from someone not on our contact list. Non persistent contacts are volatile even when coming from a persistent presence op. set. They would only exist until the application is closed and will not be there next time it is loaded.
* @return true if the contact is persistent and false otherwise.
*/
public boolean isPersistent();
/**
* Determines whether or not this contact has been resolved against the server. Unresolved contacts are used when initially loading a contact list that has been stored in a local file until the presence operation set has managed to retrieve all the contact list from the server and has properly mapped contacts to their on-line buddies.
* @return true if the contact has been resolved (mapped against a buddy)and false otherwise.
*/
public boolean isResolved();
/**
* Returns a String that can be used to create a unresolved instance of this contact. Unresolved contacts are created through the createUnresolvedContact() method in the persistent presence operation set. The method may also return null if no such data is required and the contact address is sufficient for restoring the contact. <p>
* @return A <tt>String</tt> that could be used to create a unresolvedinstance of this contact during a next run of the application, before establishing network connectivity or null if no such data is required.
*/
public String getPersistentData();
/**
* Return the current status message of this contact.
* @return the current status message
*/
public String getStatusMessage();
/**
* Indicates if this contact supports resources.
* @return <tt>true</tt> if this contact supports resources, <tt>false</tt>otherwise
*/
public boolean supportResources();
/**
* Returns a collection of resources supported by this contact or null if it doesn't support resources.
* @return a collection of resources supported by this contact or nullif it doesn't support resources
*/
public Collection<ContactResource> getResources();
/**
* Adds the given <tt>ContactResourceListener</tt> to listen for events related to contact resources changes.
* @param l the <tt>ContactResourceListener</tt> to add
*/
public void addResourceListener( ContactResourceListener l);
/**
* Removes the given <tt>ContactResourceListener</tt> listening for events related to contact resources changes.
* @param l the <tt>ContactResourceListener</tt> to rmove
*/
public void removeResourceListener( ContactResourceListener l);
/**
* Returns the persistent contact address.
* @return the address of the contact.
*/
public String getPersistableAddress();
/**
* Whether contact is mobile one. Logged in only from mobile device.
* @return whether contact is mobile one.
*/
public boolean isMobile();
}
/**
* Indicates if this contact supports resources.
* @return <tt>false</tt> to indicate that this contact doesn't supportresources
*/
@Override public boolean supportResources(){
return false;
}
/**
* Returns the <tt>ResourceManagementService</tt>.
* @return the <tt>ResourceManagementService</tt>.
*/
public static ResourceManagementService getResources(){
if (resourcesService == null) resourcesService=ServiceUtils.getService(GibberishAccRegWizzActivator.bundleContext,ResourceManagementService.class);
return resourcesService;
}
/**
* Returns the number of protocol specific <tt>Contact</tt>s that this <tt>MetaContact</tt> contains.
* @return an int indicating the number of protocol specific contactsmerged in this <tt>MetaContact</tt>
*/
public int getContactCount(){
return protoContacts.size();
}
/**
* Returns <tt>true</tt> if the iteration has more elements.
* @return <tt>true</tt> if the iterator has more elements.
*/
public boolean hasNext(){
return this.currentPos + 1 < this.records.size();
}
/**
* Returns number of LdapDirectory(s) in the LdapDirectorySet.
* @return the number of LdapDirectory(s) in the LdapDirectorySet
*/
public int size(){
return this.serverMap.size();
}
/**
* Removes all entries in this contact list.
*/
public void removeAll();
public static OtrContact getOtrContact(SessionID sessionID){
return contactsMap.get(new ScSessionID(sessionID));
}
/**
* Get the full contacts list.
* @return list of <tt>GoogleContactsEntry</tt>
*/
public List<GoogleContactsEntry> getContacts();
/**
* Calculates and creates the next calendar item.
* @param previousStartDate the start date of the previous occurrence.
* @param previousEndDate the end date of the previous occurrence.
* @return the new calendar item or null if there are no more calendar itemsfrom that recurrent series.
*/
public CalendarItemTimerTask next(Date previousStartDate,Date previousEndDate){
if (dateOutOfRange(new Date())) {
return null;
}
Date startDate=previousStartDate;
Date endDate=null;
boolean executeNow=false;
long duration=sourceTask.getEndDate().getTime() - sourceTask.getStartDate().getTime();
switch (patternType) {
case Day:
{
startDate=new Date(startDate.getTime() + period * 60000);
endDate=new Date(previousEndDate.getTime() + period * 60000);
Date currentDate=new Date();
if (endDate.before(currentDate)) {
long offset=currentDate.getTime() - endDate.getTime();
offset-=offset % (period * 60000);
if (endDate.getTime() + offset < currentDate.getTime()) {
offset+=period * 60000;
}
startDate=new Date(startDate.getTime() + offset);
}
Calendar cal=Calendar.getInstance();
cal.setTime(startDate);
Calendar cal2=(Calendar)cal.clone();
cal.set(Calendar.HOUR_OF_DAY,0);
cal.set(Calendar.MINUTE,0);
cal.set(Calendar.SECOND,0);
cal.set(Calendar.MILLISECOND,0);
while (deletedInstances.contains(cal.getTime())) {
cal.add(Calendar.MINUTE,period);
cal2.add(Calendar.MINUTE,period);
}
if (dateOutOfRange(cal.getTime())) {
return null;
}
startDate=cal2.getTime();
endDate=new Date(startDate.getTime() + duration);
if (startDate.before(currentDate)) {
executeNow=true;
}
return new CalendarItemTimerTask(sourceTask.getStatus(),startDate,endDate,sourceTask.getId(),executeNow,this);
}
case Week:
{
Calendar cal=Calendar.getInstance();
cal.setFirstDayOfWeek(firstDow + 1);
cal.setTime(startDate);
int dayOfWeek=cal.get(Calendar.DAY_OF_WEEK);
int index=allowedDaysOfWeek.indexOf(dayOfWeek);
if (++index < allowedDaysOfWeek.size()) {
cal.set(Calendar.DAY_OF_WEEK,allowedDaysOfWeek.get(index));
startDate=cal.getTime();
endDate=new Date(startDate.getTime() + duration);
}
else {
cal.set(Calendar.DAY_OF_WEEK,allowedDaysOfWeek.get(0));
cal.add(Calendar.WEEK_OF_YEAR,period);
startDate=cal.getTime();
endDate=new Date(startDate.getTime() + duration);
}
Date currentDate=new Date();
if (endDate.before(currentDate)) {
cal.set(Calendar.DAY_OF_WEEK,allowedDaysOfWeek.get(0));
endDate=new Date(cal.getTimeInMillis() + duration);
long offset=(currentDate.getTime() - endDate.getTime());
offset-=offset % (period * 604800000);
if (endDate.getTime() + offset < currentDate.getTime()) {
cal.add(Calendar.WEEK_OF_YEAR,(int)(offset / (period * 604800000)));
int i=1;
while (((cal.getTimeInMillis() + duration) < (currentDate.getTime()))) {
if (i == allowedDaysOfWeek.size()) {
cal.add(Calendar.WEEK_OF_YEAR,period);
i=0;
}
cal.set(Calendar.DAY_OF_WEEK,allowedDaysOfWeek.get(i));
i++;
}
startDate=cal.getTime();
}
else {
startDate=new Date(cal.getTimeInMillis() + offset);
}
}
cal.setTime(startDate);
Calendar cal2=(Calendar)cal.clone();
cal.set(Calendar.HOUR_OF_DAY,0);
cal.set(Calendar.MINUTE,0);
cal.set(Calendar.SECOND,0);
cal.set(Calendar.MILLISECOND,0);
dayOfWeek=cal.get(Calendar.DAY_OF_WEEK);
index=allowedDaysOfWeek.indexOf(dayOfWeek) + 1;
while (deletedInstances.contains(cal.getTime())) {
if (index >= allowedDaysOfWeek.size()) {
index=0;
cal.add(Calendar.WEEK_OF_YEAR,period);
cal2.add(Calendar.WEEK_OF_YEAR,period);
}
cal.set(Calendar.DAY_OF_WEEK,allowedDaysOfWeek.get(index));
cal2.set(Calendar.DAY_OF_WEEK,allowedDaysOfWeek.get(index));
index++;
}
startDate=cal2.getTime();
endDate=new Date(startDate.getTime() + duration);
if (dateOutOfRange(endDate)) return null;
if (startDate.before(currentDate)) {
executeNow=true;
}
return new CalendarItemTimerTask(sourceTask.getStatus(),startDate,endDate,sourceTask.getId(),executeNow,this);
}
case Month:
case MonthEnd:
case HjMonth:
case HjMonthEnd:
{
return nextMonth(startDate,endDate,false);
}
case MonthNth:
case HjMonthNth:
{
if (patternSpecific1 == 0x7f && patternSpecific2 == 0x05) return nextMonth(startDate,endDate,true);
else return nextMonthN(startDate,endDate);
}
}
return null;
}
/**
* Create an the add contact menu, taking into account the number of contact details available in the given <tt>sourceContact</tt>.
* @param sourceContact the external source contact, for which we'd liketo create a menu
* @return the add contact menu
*/
public static JMenuItem createAddContactMenu(SourceContact sourceContact){
JMenuItem addContactComponentTmp=null;
List<ContactDetail> details=sourceContact.getContactDetails(OperationSetPersistentPresence.class);
final String displayName=sourceContact.getDisplayName();
if (details.size() == 0) {
return null;
}
if (details.size() == 1) {
addContactComponentTmp=new JMenuItem(GuiActivator.getResources().getI18NString("service.gui.ADD_CONTACT"),new ImageIcon(ImageLoader.getImage(ImageLoader.ADD_CONTACT_16x16_ICON)));
final ContactDetail detail=details.get(0);
addContactComponentTmp.addActionListener(new ActionListener(){
public void actionPerformed( ActionEvent e){
showAddContactDialog(detail,displayName);
}
}
);
}
else if (details.size() > 1) {
addContactComponentTmp=new JMenu(GuiActivator.getResources().getI18NString("service.gui.ADD_CONTACT"));
Iterator<ContactDetail> detailsIter=details.iterator();
while (detailsIter.hasNext()) {
final ContactDetail detail=detailsIter.next();
JMenuItem addMenuItem=new JMenuItem(detail.getDetail());
((JMenu)addContactComponentTmp).add(addMenuItem);
addMenuItem.addActionListener(new ActionListener(){
public void actionPerformed( ActionEvent e){
showAddContactDialog(detail,displayName);
}
}
);
}
}
return addContactComponentTmp;
}
| public interface MetaContact extends Comparable<MetaContact> {
public Contact getDefaultContact();
public Contact getDefaultContact( Class<? extends OperationSet> operationSet);
public Iterator<Contact> getContacts();
public Contact getContact( String contactAddress, ProtocolProviderService ownerProvider);
public boolean containsContact( Contact protocolContact);
public int getContactCount();
public Iterator<Contact> getContactsForProvider( ProtocolProviderService provider);
public List<Contact> getContactsForOperationSet( Class<? extends OperationSet> opSetClass);
public MetaContactGroup getParentMetaContactGroup();
public String getMetaUID();
public String getDisplayName();
public byte[] getAvatar();
public byte[] getAvatar( boolean isLazy);
public String toString();
public void addDetail( String name, String value);
public void removeDetail( String name, String value);
public void removeDetails( String name);
public void changeDetail( String name, String oldValue, String newValue);
public List<String> getDetails( String name);
public Object getData( Object key);
public void setData( Object key, Object value);
}
public class ContactResource {
public static ContactResource BASE_RESOURCE=new ContactResource();
private Contact contact;
private String resourceName;
protected PresenceStatus presenceStatus;
protected int priority;
protected boolean mobile=false;
public ContactResource();
public ContactResource( Contact contact, String resourceName, PresenceStatus presenceStatus, int priority, boolean mobile);
public Contact getContact();
public String getResourceName();
public PresenceStatus getPresenceStatus();
public int getPriority();
public boolean isMobile();
public int hashCode();
public boolean equals( Object obj);
}
public class ContactInfoActivator extends DependentActivator {
private org.slf4j.Logger logger=org.slf4j.LoggerFactory.getLogger(ContactInfoActivator.class);
private static final String ENABLED_IN_CHAT_WINDOW_PROP="net.java.sip.communicator.plugin.contactinfo." + "ENABLED_IN_CHAT_WINDOW_PROP";
private static final String ENABLED_IN_CALL_WINDOW_PROP="net.java.sip.communicator.plugin.contactinfo." + "ENABLED_IN_CALL_WINDOW_PROP";
private static BrowserLauncherService browserLauncherService;
private static ImageLoaderService<?> imageLoaderService=null;
private static MetaContactListService metaCListService;
static BundleContext bundleContext;
public ContactInfoActivator();
public void startWithServices( BundleContext bc);
public static BrowserLauncherService getBrowserLauncher();
public static ImageLoaderService<?> getImageLoaderService();
public static MetaContactListService getContactListService();
private class ContactInfoPluginComponentFactory extends PluginComponentFactory {
ContactInfoPluginComponentFactory( Container c);
protected PluginComponent getPluginInstance();
}
}
public class HelpMenu extends SIPCommMenu implements ActionListener, PluginComponentListener {
private final org.slf4j.Logger logger=org.slf4j.LoggerFactory.getLogger(HelpMenu.class.getName());
public HelpMenu( ChatWindow chatWindow);
public void dispose();
private void initPluginComponents();
public void actionPerformed( ActionEvent e);
public void pluginComponentAdded( PluginComponentEvent event);
public void pluginComponentRemoved( PluginComponentEvent event);
}
public interface Contact {
public String getAddress();
public String getDisplayName();
public byte[] getImage();
public PresenceStatus getPresenceStatus();
public ContactGroup getParentContactGroup();
public ProtocolProviderService getProtocolProvider();
public boolean isPersistent();
public boolean isResolved();
public String getPersistentData();
public String getStatusMessage();
public boolean supportResources();
public Collection<ContactResource> getResources();
public void addResourceListener( ContactResourceListener l);
public void removeResourceListener( ContactResourceListener l);
public String getPersistableAddress();
public boolean isMobile();
}
/**
* Indicates if this contact supports resources.
* @return <tt>false</tt> to indicate that this contact doesn't supportresources
*/
@Override public boolean supportResources(){
return false;
}
/**
* Returns the <tt>ResourceManagementService</tt>.
* @return the <tt>ResourceManagementService</tt>.
*/
public static ResourceManagementService getResources(){
if (resourcesService == null) resourcesService=ServiceUtils.getService(GibberishAccRegWizzActivator.bundleContext,ResourceManagementService.class);
return resourcesService;
}
/**
* Returns the number of protocol specific <tt>Contact</tt>s that this <tt>MetaContact</tt> contains.
* @return an int indicating the number of protocol specific contactsmerged in this <tt>MetaContact</tt>
*/
public int getContactCount(){
return protoContacts.size();
}
/**
* Returns <tt>true</tt> if the iteration has more elements.
* @return <tt>true</tt> if the iterator has more elements.
*/
public boolean hasNext(){
return this.currentPos + 1 < this.records.size();
}
/**
* Returns number of LdapDirectory(s) in the LdapDirectorySet.
* @return the number of LdapDirectory(s) in the LdapDirectorySet
*/
public int size(){
return this.serverMap.size();
}
/**
* Removes all entries in this contact list.
*/
public void removeAll();
public static OtrContact getOtrContact(SessionID sessionID){
return contactsMap.get(new ScSessionID(sessionID));
}
/**
* Get the full contacts list.
* @return list of <tt>GoogleContactsEntry</tt>
*/
public List<GoogleContactsEntry> getContacts();
/**
* Calculates and creates the next calendar item.
* @param previousStartDate the start date of the previous occurrence.
* @param previousEndDate the end date of the previous occurrence.
* @return the new calendar item or null if there are no more calendar itemsfrom that recurrent series.
*/
public CalendarItemTimerTask next(Date previousStartDate,Date previousEndDate){
if (dateOutOfRange(new Date())) {
return null;
}
Date startDate=previousStartDate;
Date endDate=null;
boolean executeNow=false;
long duration=sourceTask.getEndDate().getTime() - sourceTask.getStartDate().getTime();
switch (patternType) {
case Day:
{
startDate=new Date(startDate.getTime() + period * 60000);
endDate=new Date(previousEndDate.getTime() + period * 60000);
Date currentDate=new Date();
if (endDate.before(currentDate)) {
long offset=currentDate.getTime() - endDate.getTime();
offset-=offset % (period * 60000);
if (endDate.getTime() + offset < currentDate.getTime()) {
offset+=period * 60000;
}
startDate=new Date(startDate.getTime() + offset);
}
Calendar cal=Calendar.getInstance();
cal.setTime(startDate);
Calendar cal2=(Calendar)cal.clone();
cal.set(Calendar.HOUR_OF_DAY,0);
cal.set(Calendar.MINUTE,0);
cal.set(Calendar.SECOND,0);
cal.set(Calendar.MILLISECOND,0);
while (deletedInstances.contains(cal.getTime())) {
cal.add(Calendar.MINUTE,period);
cal2.add(Calendar.MINUTE,period);
}
if (dateOutOfRange(cal.getTime())) {
return null;
}
startDate=cal2.getTime();
endDate=new Date(startDate.getTime() + duration);
if (startDate.before(currentDate)) {
executeNow=true;
}
return new CalendarItemTimerTask(sourceTask.getStatus(),startDate,endDate,sourceTask.getId(),executeNow,this);
}
case Week:
{
Calendar cal=Calendar.getInstance();
cal.setFirstDayOfWeek(firstDow + 1);
cal.setTime(startDate);
int dayOfWeek=cal.get(Calendar.DAY_OF_WEEK);
int index=allowedDaysOfWeek.indexOf(dayOfWeek);
if (++index < allowedDaysOfWeek.size()) {
cal.set(Calendar.DAY_OF_WEEK,allowedDaysOfWeek.get(index));
startDate=cal.getTime();
endDate=new Date(startDate.getTime() + duration);
}
else {
cal.set(Calendar.DAY_OF_WEEK,allowedDaysOfWeek.get(0));
cal.add(Calendar.WEEK_OF_YEAR,period);
startDate=cal.getTime();
endDate=new Date(startDate.getTime() + duration);
}
Date currentDate=new Date();
if (endDate.before(currentDate)) {
cal.set(Calendar.DAY_OF_WEEK,allowedDaysOfWeek.get(0));
endDate=new Date(cal.getTimeInMillis() + duration);
long offset=(currentDate.getTime() - endDate.getTime());
offset-=offset % (period * 604800000);
if (endDate.getTime() + offset < currentDate.getTime()) {
cal.add(Calendar.WEEK_OF_YEAR,(int)(offset / (period * 604800000)));
int i=1;
while (((cal.getTimeInMillis() + duration) < (currentDate.getTime()))) {
if (i == allowedDaysOfWeek.size()) {
cal.add(Calendar.WEEK_OF_YEAR,period);
i=0;
}
cal.set(Calendar.DAY_OF_WEEK,allowedDaysOfWeek.get(i));
i++;
}
startDate=cal.getTime();
}
else {
startDate=new Date(cal.getTimeInMillis() + offset);
}
}
cal.setTime(startDate);
Calendar cal2=(Calendar)cal.clone();
cal.set(Calendar.HOUR_OF_DAY,0);
cal.set(Calendar.MINUTE,0);
cal.set(Calendar.SECOND,0);
cal.set(Calendar.MILLISECOND,0);
dayOfWeek=cal.get(Calendar.DAY_OF_WEEK);
index=allowedDaysOfWeek.indexOf(dayOfWeek) + 1;
while (deletedInstances.contains(cal.getTime())) {
if (index >= allowedDaysOfWeek.size()) {
index=0;
cal.add(Calendar.WEEK_OF_YEAR,period);
cal2.add(Calendar.WEEK_OF_YEAR,period);
}
cal.set(Calendar.DAY_OF_WEEK,allowedDaysOfWeek.get(index));
cal2.set(Calendar.DAY_OF_WEEK,allowedDaysOfWeek.get(index));
index++;
}
startDate=cal2.getTime();
endDate=new Date(startDate.getTime() + duration);
if (dateOutOfRange(endDate)) return null;
if (startDate.before(currentDate)) {
executeNow=true;
}
return new CalendarItemTimerTask(sourceTask.getStatus(),startDate,endDate,sourceTask.getId(),executeNow,this);
}
case Month:
case MonthEnd:
case HjMonth:
case HjMonthEnd:
{
return nextMonth(startDate,endDate,false);
}
case MonthNth:
case HjMonthNth:
{
if (patternSpecific1 == 0x7f && patternSpecific2 == 0x05) return nextMonth(startDate,endDate,true);
else return nextMonthN(startDate,endDate);
}
}
return null;
}
/**
* Create an the add contact menu, taking into account the number of contact details available in the given <tt>sourceContact</tt>.
* @param sourceContact the external source contact, for which we'd liketo create a menu
* @return the add contact menu
*/
public static JMenuItem createAddContactMenu(SourceContact sourceContact){
JMenuItem addContactComponentTmp=null;
List<ContactDetail> details=sourceContact.getContactDetails(OperationSetPersistentPresence.class);
final String displayName=sourceContact.getDisplayName();
if (details.size() == 0) {
return null;
}
if (details.size() == 1) {
addContactComponentTmp=new JMenuItem(GuiActivator.getResources().getI18NString("service.gui.ADD_CONTACT"),new ImageIcon(ImageLoader.getImage(ImageLoader.ADD_CONTACT_16x16_ICON)));
final ContactDetail detail=details.get(0);
addContactComponentTmp.addActionListener(new ActionListener(){
public void actionPerformed( ActionEvent e){
showAddContactDialog(detail,displayName);
}
}
);
}
else if (details.size() > 1) {
addContactComponentTmp=new JMenu(GuiActivator.getResources().getI18NString("service.gui.ADD_CONTACT"));
Iterator<ContactDetail> detailsIter=details.iterator();
while (detailsIter.hasNext()) {
final ContactDetail detail=detailsIter.next();
JMenuItem addMenuItem=new JMenuItem(detail.getDetail());
((JMenu)addContactComponentTmp).add(addMenuItem);
addMenuItem.addActionListener(new ActionListener(){
public void actionPerformed( ActionEvent e){
showAddContactDialog(detail,displayName);
}
}
);
}
}
return addContactComponentTmp;
}
| {"types": [{"MetaContact": "MetaContact"}, {"ContactResource": "ContactResource"}, {"Iterator<Contact>": "ContactInfoActivator"}, {"JMenu": "HelpMenu"}, {"Collection<ContactResource>": "ContactResource"}, {"Contact": "Contact"}], "methods": [{"supportResources": "supportResources"}, {"getResources": "getResources"}, {"getContactCount": "getContactCount"}, {"hasNext": "hasNext"}, {"size": "size"}, {"removeAll": "removeAll"}, {"getOtrContact": "getOtrContact"}, {"getContacts": "getContacts"}, {"next": "next"}], "similar_methods": [{"createOtrContactMenus": "createAddContactMenu"}]} | [{"MetaContact": {"retrieved_name": "MetaContact", "raw_body": "/** \n * A MetaContact is an abstraction used for merging multiple Contacts (most often) belonging to different <tt>ProtocolProvider</tt>s. <p> Instances of a MetaContact are read-only objects that cannot be modified directly but only through the corresponding MetaContactListService. </p>\n * @author Emil Ivov\n * @author Lubomir Marinov\n */\npublic interface MetaContact extends Comparable<MetaContact> {\n /** \n * Returns the default protocol specific <tt>Contact</tt> to use when communicating with this <tt>MetaContact</tt>.\n * @return the default <tt>Contact</tt> to use when communicating withthis <tt>MetaContact</tt>\n */\n public Contact getDefaultContact();\n /** \n * Returns the default protocol specific <tt>Contact</tt> to use with this <tt>MetaContact</tt> for a precise operation (IM, call, ...).\n * @param operationSet the operation for which the default contact is needed\n * @return the default contact for the specified operation.\n */\n public Contact getDefaultContact( Class<? extends OperationSet> operationSet);\n /** \n * Returns a <tt>java.util.Iterator</tt> with all protocol specific <tt>Contacts</tt> encapsulated by this <tt>MetaContact</tt>. <p> Note to implementors: In order to prevent problems with concurrency, the <tt>Iterator</tt> returned by this method should not be over the actual list of contacts but rather over a copy of that list. <p>\n * @return a <tt>java.util.Iterator</tt> containing all protocol specific<tt>Contact</tt>s that were registered as subcontacts for this <tt>MetaContact</tt>\n */\n public Iterator<Contact> getContacts();\n /** \n * Returns a contact encapsulated by this meta contact, having the specified contactAddress and coming from the indicated ownerProvider.\n * @param contactAddress the address of the contact who we're looking for.\n * @param ownerProvider a reference to the ProtocolProviderService thatthe contact we're looking for belongs to.\n * @return a reference to a <tt>Contact</tt>, encapsulated by thisMetaContact, carrying the specified address and originating from the specified ownerProvider or null if no such contact exists..\n */\n public Contact getContact( String contactAddress, ProtocolProviderService ownerProvider);\n /** \n * Returns <tt>true</tt> if the given <tt>protocolContact</tt> is contained in this <tt>MetaContact</tt>, otherwise - returns <tt>false</tt>.\n * @param protocolContact the <tt>Contact</tt> we're looking for\n * @return <tt>true</tt> if the given <tt>protocolContact</tt> is containedin this <tt>MetaContact</tt>, otherwise - returns <tt>false</tt>\n */\n public boolean containsContact( Contact protocolContact);\n /** \n * Returns the number of protocol speciic <tt>Contact</tt>s that this <tt>MetaContact</tt> contains.\n * @return an int indicating the number of protocol specific contacts mergedin this <tt>MetaContact</tt>\n */\n public int getContactCount();\n /** \n * Returns all protocol specific Contacts, encapsulated by this MetaContact and coming from the indicated ProtocolProviderService. If none of the contacts encapsulated by this MetaContact is originating from the specified provider then an empty iterator is returned. <p> Note to implementors: In order to prevent problems with concurrency, the <tt>Iterator</tt> returned by this method should not be over the actual list of contacts but rather over a copy of that list. <p>\n * @param provider a reference to the <tt>ProtocolProviderService</tt>whose contacts we'd like to get.\n * @return an <tt>Iterator</tt> over all contacts encapsulated in this<tt>MetaContact</tt> and originating from the specified provider.\n */\n public Iterator<Contact> getContactsForProvider( ProtocolProviderService provider);\n /** \n * Returns all protocol specific Contacts, encapsulated by this MetaContact and supporting the given <tt>opSetClass</tt>. If none of the contacts encapsulated by this MetaContact is supporting the specified <tt>OperationSet</tt> class then an empty list is returned. <p> Note to implementors: In order to prevent problems with concurrency, the <tt>List</tt> returned by this method should not be the actual list of contacts but rather a copy of that list. <p>\n * @param opSetClass the operation for which the default contact is needed\n * @return a <tt>List</tt> of all contacts encapsulated in this<tt>MetaContact</tt> and supporting the specified <tt>OperationSet</tt>\n */\n public List<Contact> getContactsForOperationSet( Class<? extends OperationSet> opSetClass);\n /** \n * Returns the MetaContactGroup currently containing this meta contact\n * @return a reference to the MetaContactGroup currently containing thismeta contact.\n */\n public MetaContactGroup getParentMetaContactGroup();\n /** \n * Returns a String identifier (the actual contents is left to implementations) that uniquely represents this <tt>MetaContact</tt> in the containing <tt>MetaContactList</tt>\n * @return String\n */\n public String getMetaUID();\n /** \n * Returns a characteristic display name that can be used when including this <tt>MetaContact</tt> in user interface.\n * @return a human readable String that represents this meta contact.\n */\n public String getDisplayName();\n /** \n * Returns the avatar of this contact, that can be used when including this <tt>MetaContact</tt> in user interface.\n * @return an avatar (e.g. user photo) of this contact.\n */\n public byte[] getAvatar();\n /** \n * Returns the avatar of this contact, that can be used when including this <tt>MetaContact</tt> in user interface. The isLazy parameter would tell the implementation if it could return the locally stored avatar or it should obtain the avatar right from the server.\n * @param isLazy Indicates if this method should return the locally storedavatar or it should obtain the avatar right from the server.\n * @return an avatar (e.g. user photo) of this contact.\n */\n public byte[] getAvatar( boolean isLazy);\n /** \n * Returns a String representation of this <tt>MetaContact</tt>.\n * @return a String representation of this <tt>MetaContact</tt>.\n */\n public String toString();\n /** \n * Adds a custom detail to this contact.\n * @param name name of the detail.\n * @param value the value of the detail.\n */\n public void addDetail( String name, String value);\n /** \n * Remove the given detail.\n * @param name of the detail to be removed.\n * @param value value of the detail to be removed.\n */\n public void removeDetail( String name, String value);\n /** \n * Remove all details with given name.\n * @param name of the details to be removed.\n */\n public void removeDetails( String name);\n /** \n * Change the detail.\n * @param name of the detail to be changed.\n * @param oldValue the old value of the detail.\n * @param newValue the new value of the detail.\n */\n public void changeDetail( String name, String oldValue, String newValue);\n /** \n * Get all details with given name.\n * @param name the name of the details we are searching.\n * @return list of string values for the details with the given name.\n */\n public List<String> getDetails( String name);\n /** \n * Gets the user data associated with this instance and a specific key.\n * @param key the key of the user data associated with this instance to beretrieved\n * @return an <tt>Object</tt> which represents the value associated withthis instance and the specified <tt>key</tt>; <tt>null</tt> if no association with the specified <tt>key</tt> exists in this instance\n */\n public Object getData( Object key);\n /** \n * Sets a user-specific association in this instance in the form of a key-value pair. If the specified <tt>key</tt> is already associated in this instance with a value, the existing value is overwritten with the specified <tt>value</tt>. <p> 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. </p> <p> The storage of the user data is implementation-specific and is thus not guaranteed to be optimized for execution time and memory use. </p>\n * @param key the key to associate in this instance with the specified value\n * @param value the value to be associated in this instance with thespecified <tt>key</tt>\n */\n public void setData( Object key, Object value);\n}\n", "raw_body_no_cmt": "public interface MetaContact extends Comparable<MetaContact> {\n public Contact getDefaultContact();\n public Contact getDefaultContact( Class<? extends OperationSet> operationSet);\n public Iterator<Contact> getContacts();\n public Contact getContact( String contactAddress, ProtocolProviderService ownerProvider);\n public boolean containsContact( Contact protocolContact);\n public int getContactCount();\n public Iterator<Contact> getContactsForProvider( ProtocolProviderService provider);\n public List<Contact> getContactsForOperationSet( Class<? extends OperationSet> opSetClass);\n public MetaContactGroup getParentMetaContactGroup();\n public String getMetaUID();\n public String getDisplayName();\n public byte[] getAvatar();\n public byte[] getAvatar( boolean isLazy);\n public String toString();\n public void addDetail( String name, String value);\n public void removeDetail( String name, String value);\n public void removeDetails( String name);\n public void changeDetail( String name, String oldValue, String newValue);\n public List<String> getDetails( String name);\n public Object getData( Object key);\n public void setData( Object key, Object value);\n}\n"}}, {"ContactResource": {"retrieved_name": "ContactResource", "raw_body": "/** \n * The <tt>ContactResource</tt> class represents a resource, from which a <tt>Contact</tt> is connected.\n * @author Yana Stamcheva\n */\npublic class ContactResource {\n /** \n * A static instance of this class representing the base resource. If this base resource is passed as a parameter for any operation (send message, call) the operation should explicitly use the base contact address. This is meant to force a call or a message sending to all the resources for the corresponding contact.\n */\n public static ContactResource BASE_RESOURCE=new ContactResource();\n /** \n * The contact, to which this resource belongs.\n */\n private Contact contact;\n /** \n * The name of this contact resource.\n */\n private String resourceName;\n /** \n * The presence status of this contact resource.\n */\n protected PresenceStatus presenceStatus;\n /** \n * The priority of this contact source.\n */\n protected int priority;\n /** \n * Whether this contact resource is a mobile one.\n */\n protected boolean mobile=false;\n /** \n * Creates an empty instance of <tt>ContactResource</tt> representing the base resource.\n */\n public ContactResource();\n /** \n * Creates a <tt>ContactResource</tt> by specifying the <tt>resourceName</tt>, the <tt>presenceStatus</tt> and the <tt>priority</tt>.\n * @param contact the parent <tt>Contact</tt> this resource is about\n * @param resourceName the name of this resource\n * @param presenceStatus the presence status of this resource\n * @param priority the priority of this resource\n */\n public ContactResource( Contact contact, String resourceName, PresenceStatus presenceStatus, int priority, boolean mobile);\n /** \n * Returns the <tt>Contact</tt>, this resources belongs to.\n * @return the <tt>Contact</tt>, this resources belongs to\n */\n public Contact getContact();\n /** \n * Returns the name of this resource.\n * @return the name of this resource\n */\n public String getResourceName();\n /** \n * Returns the presence status of this resource.\n * @return the presence status of this resource\n */\n public PresenceStatus getPresenceStatus();\n /** \n * Returns the priority of the resources.\n * @return the priority of this resource\n */\n public int getPriority();\n /** \n * Whether contact is mobile one. Logged in only from mobile device.\n * @return whether contact is mobile one.\n */\n public boolean isMobile();\n @Override public int hashCode();\n @Override public boolean equals( Object obj);\n}\n", "raw_body_no_cmt": "public class ContactResource {\n public static ContactResource BASE_RESOURCE=new ContactResource();\n private Contact contact;\n private String resourceName;\n protected PresenceStatus presenceStatus;\n protected int priority;\n protected boolean mobile=false;\n public ContactResource();\n public ContactResource( Contact contact, String resourceName, PresenceStatus presenceStatus, int priority, boolean mobile);\n public Contact getContact();\n public String getResourceName();\n public PresenceStatus getPresenceStatus();\n public int getPriority();\n public boolean isMobile();\n public int hashCode();\n public boolean equals( Object obj);\n}\n"}}, {"Iterator<Contact>": {"retrieved_name": "ContactInfoActivator", "raw_body": "/** \n * The Activator of the Contact Info bundle.\n * @author Adam Goldstein\n * @author Yana Stamcheva\n */\npublic class ContactInfoActivator extends DependentActivator {\n private org.slf4j.Logger logger=org.slf4j.LoggerFactory.getLogger(ContactInfoActivator.class);\n /** \n * Indicates if the contact info button is enabled in the chat window.\n */\n private static final String ENABLED_IN_CHAT_WINDOW_PROP=\"net.java.sip.communicator.plugin.contactinfo.\" + \"ENABLED_IN_CHAT_WINDOW_PROP\";\n /** \n * Indicates if the contact info button is enabled in the call window.\n */\n private static final String ENABLED_IN_CALL_WINDOW_PROP=\"net.java.sip.communicator.plugin.contactinfo.\" + \"ENABLED_IN_CALL_WINDOW_PROP\";\n private static BrowserLauncherService browserLauncherService;\n /** \n * The image loader service implementation.\n */\n private static ImageLoaderService<?> imageLoaderService=null;\n /** \n * The contact list service implementation.\n */\n private static MetaContactListService metaCListService;\n static BundleContext bundleContext;\n public ContactInfoActivator();\n /** \n * Starts this bundle.\n */\n @Override public void startWithServices( BundleContext bc);\n /** \n * Returns the <tt>BrowserLauncherService</tt> obtained from the bundle context.\n * @return the <tt>BrowserLauncherService</tt> obtained from the bundlecontext\n */\n public static BrowserLauncherService getBrowserLauncher();\n /** \n * Returns the imageLoaderService instance, if missing query osgi for it.\n * @return the imageLoaderService.\n */\n public static ImageLoaderService<?> getImageLoaderService();\n /** \n * Returns the <tt>MetaContactListService</tt> obtained from the bundle context.\n * @return the <tt>MetaContactListService</tt> obtained from the bundlecontext\n */\n public static MetaContactListService getContactListService();\n /** \n * Contact info create factory.\n */\nprivate class ContactInfoPluginComponentFactory extends PluginComponentFactory {\n ContactInfoPluginComponentFactory( Container c);\n @Override protected PluginComponent getPluginInstance();\n }\n}\n", "raw_body_no_cmt": "public class ContactInfoActivator extends DependentActivator {\n private org.slf4j.Logger logger=org.slf4j.LoggerFactory.getLogger(ContactInfoActivator.class);\n private static final String ENABLED_IN_CHAT_WINDOW_PROP=\"net.java.sip.communicator.plugin.contactinfo.\" + \"ENABLED_IN_CHAT_WINDOW_PROP\";\n private static final String ENABLED_IN_CALL_WINDOW_PROP=\"net.java.sip.communicator.plugin.contactinfo.\" + \"ENABLED_IN_CALL_WINDOW_PROP\";\n private static BrowserLauncherService browserLauncherService;\n private static ImageLoaderService<?> imageLoaderService=null;\n private static MetaContactListService metaCListService;\n static BundleContext bundleContext;\n public ContactInfoActivator();\n public void startWithServices( BundleContext bc);\n public static BrowserLauncherService getBrowserLauncher();\n public static ImageLoaderService<?> getImageLoaderService();\n public static MetaContactListService getContactListService();\n private class ContactInfoPluginComponentFactory extends PluginComponentFactory {\n ContactInfoPluginComponentFactory( Container c);\n protected PluginComponent getPluginInstance();\n }\n}\n"}}, {"JMenu": {"retrieved_name": "HelpMenu", "raw_body": "/** \n * The <tt>HelpMenu</tt> is a menu in the main application menu bar.\n * @author Yana Stamcheva\n * @author Lubomir Marinov\n */\npublic class HelpMenu extends SIPCommMenu implements ActionListener, PluginComponentListener {\n private final org.slf4j.Logger logger=org.slf4j.LoggerFactory.getLogger(HelpMenu.class.getName());\n /** \n * Creates an instance of <tt>HelpMenu</tt>.\n * @param chatWindow The parent <tt>MainFrame</tt>.\n */\n public HelpMenu( ChatWindow chatWindow);\n /** \n * Runs clean-up for associated resources which need explicit disposal (e.g. listeners keeping this instance alive because they were added to the model which operationally outlives this instance).\n */\n public void dispose();\n /** \n * Initialize plugin components already registered for this container.\n */\n private void initPluginComponents();\n /** \n * Handles the <tt>ActionEvent</tt> when one of the menu items is selected.\n */\n public void actionPerformed( ActionEvent e);\n public void pluginComponentAdded( PluginComponentEvent event);\n public void pluginComponentRemoved( PluginComponentEvent event);\n}\n", "raw_body_no_cmt": "public class HelpMenu extends SIPCommMenu implements ActionListener, PluginComponentListener {\n private final org.slf4j.Logger logger=org.slf4j.LoggerFactory.getLogger(HelpMenu.class.getName());\n public HelpMenu( ChatWindow chatWindow);\n public void dispose();\n private void initPluginComponents();\n public void actionPerformed( ActionEvent e);\n public void pluginComponentAdded( PluginComponentEvent event);\n public void pluginComponentRemoved( PluginComponentEvent event);\n}\n"}}, {"Contact": {"retrieved_name": "Contact", "raw_body": "/** \n * This class represents the notion of a Contact or Buddy, that is widely used in instant messaging today. From a protocol point of view, a contact is generally considered to be another user of the service that proposes the protocol. Instances of Contact could be used for delivery of presence notifications or when addressing instant messages.\n * @author Emil Ivov\n */\npublic interface Contact {\n /** \n * Returns a String that can be used for identifying the contact. The exact contents of the string depends on the protocol. In the case of SIP, for example, that would be the SIP uri (e.g. sip:alice@biloxi.com) in the case of icq - a UIN (12345653) and for AIM a screenname (mysname). Jabber (and hence Google) would be having e-mail like addresses.\n * @return a String id representing and uniquely identifying the contact.\n */\n public String getAddress();\n /** \n * Returns a String that could be used by any user interacting modules for referring to this contact. An alias is not necessarily unique but is often more human readable than an address (or id).\n * @return a String that can be used for referring to this contact wheninteracting with the user.\n */\n public String getDisplayName();\n /** \n * Returns a byte array containing an image (most often a photo or an avatar) that the contact uses as a representation.\n * @return byte[] an image representing the contact.\n */\n public byte[] getImage();\n /** \n * Returns the status of the contact as per the last status update we've received for it. Note that this method is not to perform any network operations and will simply return the status received in the last status update message. If you want a reliable way of retrieving someone's status, you should use the <tt>queryContactStatus()</tt> method in <tt>OperationSetPresence</tt>.\n * @return the PresenceStatus that we've received in the last status updatepertaining to this contact.\n */\n public PresenceStatus getPresenceStatus();\n /** \n * Returns a reference to the contact group that this contact is currently a child of or null if the underlying protocol does not support persistent presence.\n * @return a reference to the contact group that this contact is currentlya child of or null if the underlying protocol does not support persistent presence.\n */\n public ContactGroup getParentContactGroup();\n /** \n * Returns a reference to the protocol provider that created the contact.\n * @return a reference to an instance of the ProtocolProviderService\n */\n public ProtocolProviderService getProtocolProvider();\n /** \n * Determines whether or not this contact is being stored by the server. Non persistent contacts are common in the case of simple, non-persistent presence operation sets. They could however also be seen in persistent presence operation sets when for example we have received an event from someone not on our contact list. Non persistent contacts are volatile even when coming from a persistent presence op. set. They would only exist until the application is closed and will not be there next time it is loaded.\n * @return true if the contact is persistent and false otherwise.\n */\n public boolean isPersistent();\n /** \n * Determines whether or not this contact has been resolved against the server. Unresolved contacts are used when initially loading a contact list that has been stored in a local file until the presence operation set has managed to retrieve all the contact list from the server and has properly mapped contacts to their on-line buddies.\n * @return true if the contact has been resolved (mapped against a buddy)and false otherwise.\n */\n public boolean isResolved();\n /** \n * Returns a String that can be used to create a unresolved instance of this contact. Unresolved contacts are created through the createUnresolvedContact() method in the persistent presence operation set. The method may also return null if no such data is required and the contact address is sufficient for restoring the contact. <p>\n * @return A <tt>String</tt> that could be used to create a unresolvedinstance of this contact during a next run of the application, before establishing network connectivity or null if no such data is required.\n */\n public String getPersistentData();\n /** \n * Return the current status message of this contact.\n * @return the current status message\n */\n public String getStatusMessage();\n /** \n * Indicates if this contact supports resources.\n * @return <tt>true</tt> if this contact supports resources, <tt>false</tt>otherwise\n */\n public boolean supportResources();\n /** \n * Returns a collection of resources supported by this contact or null if it doesn't support resources.\n * @return a collection of resources supported by this contact or nullif it doesn't support resources\n */\n public Collection<ContactResource> getResources();\n /** \n * Adds the given <tt>ContactResourceListener</tt> to listen for events related to contact resources changes.\n * @param l the <tt>ContactResourceListener</tt> to add\n */\n public void addResourceListener( ContactResourceListener l);\n /** \n * Removes the given <tt>ContactResourceListener</tt> listening for events related to contact resources changes.\n * @param l the <tt>ContactResourceListener</tt> to rmove\n */\n public void removeResourceListener( ContactResourceListener l);\n /** \n * Returns the persistent contact address.\n * @return the address of the contact.\n */\n public String getPersistableAddress();\n /** \n * Whether contact is mobile one. Logged in only from mobile device.\n * @return whether contact is mobile one.\n */\n public boolean isMobile();\n}\n", "raw_body_no_cmt": "public interface Contact {\n public String getAddress();\n public String getDisplayName();\n public byte[] getImage();\n public PresenceStatus getPresenceStatus();\n public ContactGroup getParentContactGroup();\n public ProtocolProviderService getProtocolProvider();\n public boolean isPersistent();\n public boolean isResolved();\n public String getPersistentData();\n public String getStatusMessage();\n public boolean supportResources();\n public Collection<ContactResource> getResources();\n public void addResourceListener( ContactResourceListener l);\n public void removeResourceListener( ContactResourceListener l);\n public String getPersistableAddress();\n public boolean isMobile();\n}\n"}}] | [{"supportResources": {"retrieved_name": "supportResources", "raw_body": "/** \n * Indicates if this contact supports resources.\n * @return <tt>false</tt> to indicate that this contact doesn't supportresources\n */\n@Override public boolean supportResources(){\n return false;\n}\n"}}, {"getResources": {"retrieved_name": "getResources", "raw_body": "/** \n * Returns the <tt>ResourceManagementService</tt>.\n * @return the <tt>ResourceManagementService</tt>.\n */\npublic static ResourceManagementService getResources(){\n if (resourcesService == null) resourcesService=ServiceUtils.getService(GibberishAccRegWizzActivator.bundleContext,ResourceManagementService.class);\n return resourcesService;\n}\n"}}, {"getContactCount": {"retrieved_name": "getContactCount", "raw_body": "/** \n * Returns the number of protocol specific <tt>Contact</tt>s that this <tt>MetaContact</tt> contains.\n * @return an int indicating the number of protocol specific contactsmerged in this <tt>MetaContact</tt>\n */\npublic int getContactCount(){\n return protoContacts.size();\n}\n"}}, {"hasNext": {"retrieved_name": "hasNext", "raw_body": "/** \n * Returns <tt>true</tt> if the iteration has more elements.\n * @return <tt>true</tt> if the iterator has more elements.\n */\npublic boolean hasNext(){\n return this.currentPos + 1 < this.records.size();\n}\n"}}, {"size": {"retrieved_name": "size", "raw_body": "/** \n * Returns number of LdapDirectory(s) in the LdapDirectorySet.\n * @return the number of LdapDirectory(s) in the LdapDirectorySet\n */\npublic int size(){\n return this.serverMap.size();\n}\n"}}, {"removeAll": {"retrieved_name": "removeAll", "raw_body": "/** \n * Removes all entries in this contact list.\n */\npublic void removeAll();\n"}}, {"getOtrContact": {"retrieved_name": "getOtrContact", "raw_body": "public static OtrContact getOtrContact(SessionID sessionID){\n return contactsMap.get(new ScSessionID(sessionID));\n}\n"}}, {"getContacts": {"retrieved_name": "getContacts", "raw_body": "/** \n * Get the full contacts list.\n * @return list of <tt>GoogleContactsEntry</tt>\n */\npublic List<GoogleContactsEntry> getContacts();\n"}}, {"next": {"retrieved_name": "next", "raw_body": "/** \n * Calculates and creates the next calendar item.\n * @param previousStartDate the start date of the previous occurrence.\n * @param previousEndDate the end date of the previous occurrence.\n * @return the new calendar item or null if there are no more calendar itemsfrom that recurrent series.\n */\npublic CalendarItemTimerTask next(Date previousStartDate,Date previousEndDate){\n if (dateOutOfRange(new Date())) {\n return null;\n }\n Date startDate=previousStartDate;\n Date endDate=null;\n boolean executeNow=false;\n long duration=sourceTask.getEndDate().getTime() - sourceTask.getStartDate().getTime();\nswitch (patternType) {\ncase Day:\n{\n startDate=new Date(startDate.getTime() + period * 60000);\n endDate=new Date(previousEndDate.getTime() + period * 60000);\n Date currentDate=new Date();\n if (endDate.before(currentDate)) {\n long offset=currentDate.getTime() - endDate.getTime();\n offset-=offset % (period * 60000);\n if (endDate.getTime() + offset < currentDate.getTime()) {\n offset+=period * 60000;\n }\n startDate=new Date(startDate.getTime() + offset);\n }\n Calendar cal=Calendar.getInstance();\n cal.setTime(startDate);\n Calendar cal2=(Calendar)cal.clone();\n cal.set(Calendar.HOUR_OF_DAY,0);\n cal.set(Calendar.MINUTE,0);\n cal.set(Calendar.SECOND,0);\n cal.set(Calendar.MILLISECOND,0);\n while (deletedInstances.contains(cal.getTime())) {\n cal.add(Calendar.MINUTE,period);\n cal2.add(Calendar.MINUTE,period);\n }\n if (dateOutOfRange(cal.getTime())) {\n return null;\n }\n startDate=cal2.getTime();\n endDate=new Date(startDate.getTime() + duration);\n if (startDate.before(currentDate)) {\n executeNow=true;\n }\n return new CalendarItemTimerTask(sourceTask.getStatus(),startDate,endDate,sourceTask.getId(),executeNow,this);\n }\ncase Week:\n{\n Calendar cal=Calendar.getInstance();\n cal.setFirstDayOfWeek(firstDow + 1);\n cal.setTime(startDate);\n int dayOfWeek=cal.get(Calendar.DAY_OF_WEEK);\n int index=allowedDaysOfWeek.indexOf(dayOfWeek);\n if (++index < allowedDaysOfWeek.size()) {\n cal.set(Calendar.DAY_OF_WEEK,allowedDaysOfWeek.get(index));\n startDate=cal.getTime();\n endDate=new Date(startDate.getTime() + duration);\n }\n else {\n cal.set(Calendar.DAY_OF_WEEK,allowedDaysOfWeek.get(0));\n cal.add(Calendar.WEEK_OF_YEAR,period);\n startDate=cal.getTime();\n endDate=new Date(startDate.getTime() + duration);\n }\n Date currentDate=new Date();\n if (endDate.before(currentDate)) {\n cal.set(Calendar.DAY_OF_WEEK,allowedDaysOfWeek.get(0));\n endDate=new Date(cal.getTimeInMillis() + duration);\n long offset=(currentDate.getTime() - endDate.getTime());\n offset-=offset % (period * 604800000);\n if (endDate.getTime() + offset < currentDate.getTime()) {\n cal.add(Calendar.WEEK_OF_YEAR,(int)(offset / (period * 604800000)));\n int i=1;\n while (((cal.getTimeInMillis() + duration) < (currentDate.getTime()))) {\n if (i == allowedDaysOfWeek.size()) {\n cal.add(Calendar.WEEK_OF_YEAR,period);\n i=0;\n }\n cal.set(Calendar.DAY_OF_WEEK,allowedDaysOfWeek.get(i));\n i++;\n }\n startDate=cal.getTime();\n }\n else {\n startDate=new Date(cal.getTimeInMillis() + offset);\n }\n }\n cal.setTime(startDate);\n Calendar cal2=(Calendar)cal.clone();\n cal.set(Calendar.HOUR_OF_DAY,0);\n cal.set(Calendar.MINUTE,0);\n cal.set(Calendar.SECOND,0);\n cal.set(Calendar.MILLISECOND,0);\n dayOfWeek=cal.get(Calendar.DAY_OF_WEEK);\n index=allowedDaysOfWeek.indexOf(dayOfWeek) + 1;\n while (deletedInstances.contains(cal.getTime())) {\n if (index >= allowedDaysOfWeek.size()) {\n index=0;\n cal.add(Calendar.WEEK_OF_YEAR,period);\n cal2.add(Calendar.WEEK_OF_YEAR,period);\n }\n cal.set(Calendar.DAY_OF_WEEK,allowedDaysOfWeek.get(index));\n cal2.set(Calendar.DAY_OF_WEEK,allowedDaysOfWeek.get(index));\n index++;\n }\n startDate=cal2.getTime();\n endDate=new Date(startDate.getTime() + duration);\n if (dateOutOfRange(endDate)) return null;\n if (startDate.before(currentDate)) {\n executeNow=true;\n }\n return new CalendarItemTimerTask(sourceTask.getStatus(),startDate,endDate,sourceTask.getId(),executeNow,this);\n }\ncase Month:\ncase MonthEnd:\ncase HjMonth:\ncase HjMonthEnd:\n{\n return nextMonth(startDate,endDate,false);\n}\ncase MonthNth:\ncase HjMonthNth:\n{\nif (patternSpecific1 == 0x7f && patternSpecific2 == 0x05) return nextMonth(startDate,endDate,true);\n else return nextMonthN(startDate,endDate);\n}\n}\nreturn null;\n}\n"}}] | [{"createOtrContactMenus": {"retrieved_name": "createAddContactMenu", "raw_body": "/** \n * Create an the add contact menu, taking into account the number of contact details available in the given <tt>sourceContact</tt>.\n * @param sourceContact the external source contact, for which we'd liketo create a menu\n * @return the add contact menu\n */\npublic static JMenuItem createAddContactMenu(SourceContact sourceContact){\n JMenuItem addContactComponentTmp=null;\n List<ContactDetail> details=sourceContact.getContactDetails(OperationSetPersistentPresence.class);\n final String displayName=sourceContact.getDisplayName();\n if (details.size() == 0) {\n return null;\n }\n if (details.size() == 1) {\n addContactComponentTmp=new JMenuItem(GuiActivator.getResources().getI18NString(\"service.gui.ADD_CONTACT\"),new ImageIcon(ImageLoader.getImage(ImageLoader.ADD_CONTACT_16x16_ICON)));\n final ContactDetail detail=details.get(0);\n addContactComponentTmp.addActionListener(new ActionListener(){\n public void actionPerformed( ActionEvent e){\n showAddContactDialog(detail,displayName);\n }\n }\n);\n }\n else if (details.size() > 1) {\n addContactComponentTmp=new JMenu(GuiActivator.getResources().getI18NString(\"service.gui.ADD_CONTACT\"));\n Iterator<ContactDetail> detailsIter=details.iterator();\n while (detailsIter.hasNext()) {\n final ContactDetail detail=detailsIter.next();\n JMenuItem addMenuItem=new JMenuItem(detail.getDetail());\n ((JMenu)addContactComponentTmp).add(addMenuItem);\n addMenuItem.addActionListener(new ActionListener(){\n public void actionPerformed( ActionEvent e){\n showAddContactDialog(detail,displayName);\n }\n }\n);\n }\n }\n return addContactComponentTmp;\n}\n"}}] | [
91,
34,
115,
117,
112,
112,
111,
114,
116,
82,
101,
115,
111,
117,
114,
99,
101,
115,
34,
44,
34,
103,
101,
116,
82,
101,
115,
111,
117,
114,
99,
101,
115,
34,
44,
34,
103,
101,
116,
67,
111,
110,
116,
97,
99,
116,
67,
111,
117,
110,
116,
34,
44,
34,
104,
97,
115,
78,
101,
120,
116,
34,
44,
34,
115,
105,
122,
101,
34,
44,
34,
114,
101,
109,
111,
118,
101,
65,
108,
108,
34,
44,
34,
103,
101,
116,
79,
116,
114,
67,
111,
110,
116,
97,
99,
116,
34,
44,
34,
103,
101,
116,
67,
111,
110,
116,
97,
99,
116,
115,
34,
44,
34,
110,
101,
120,
116,
34,
93
] | [
91,
34,
99,
114,
101,
97,
116,
101,
79,
116,
114,
67,
111,
110,
116,
97,
99,
116,
77,
101,
110,
117,
115,
34,
93
] | [
91,
34,
77,
101,
116,
97,
67,
111,
110,
116,
97,
99,
116,
34,
44,
34,
67,
111,
110,
116,
97,
99,
116,
82,
101,
115,
111,
117,
114,
99,
101,
34,
44,
34,
73,
116,
101,
114,
97,
116,
111,
114,
60,
67,
111,
110,
116,
97,
99,
116,
62,
34,
44,
34,
74,
77,
101,
110,
117,
34,
44,
34,
67,
111,
108,
108,
101,
99,
116,
105,
111,
110,
60,
67,
111,
110,
116,
97,
99,
116,
82,
101,
115,
111,
117,
114,
99,
101,
62,
34,
44,
34,
67,
111,
110,
116,
97,
99,
116,
34,
93
] | /**
* A MetaContact is an abstraction used for merging multiple Contacts (most often) belonging to different <tt>ProtocolProvider</tt>s. <p> Instances of a MetaContact are read-only objects that cannot be modified directly but only through the corresponding MetaContactListService. </p>
* @author Emil Ivov
* @author Lubomir Marinov
*/
public interface MetaContact extends Comparable<MetaContact> {
/**
* Returns the default protocol specific <tt>Contact</tt> to use when communicating with this <tt>MetaContact</tt>.
* @return the default <tt>Contact</tt> to use when communicating withthis <tt>MetaContact</tt>
*/
public Contact getDefaultContact();
/**
* Returns the default protocol specific <tt>Contact</tt> to use with this <tt>MetaContact</tt> for a precise operation (IM, call, ...).
* @param operationSet the operation for which the default contact is needed
* @return the default contact for the specified operation.
*/
public Contact getDefaultContact( Class<? extends OperationSet> operationSet);
/**
* Returns a <tt>java.util.Iterator</tt> with all protocol specific <tt>Contacts</tt> encapsulated by this <tt>MetaContact</tt>. <p> Note to implementors: In order to prevent problems with concurrency, the <tt>Iterator</tt> returned by this method should not be over the actual list of contacts but rather over a copy of that list. <p>
* @return a <tt>java.util.Iterator</tt> containing all protocol specific<tt>Contact</tt>s that were registered as subcontacts for this <tt>MetaContact</tt>
*/
public Iterator<Contact> getContacts();
/**
* Returns a contact encapsulated by this meta contact, having the specified contactAddress and coming from the indicated ownerProvider.
* @param contactAddress the address of the contact who we're looking for.
* @param ownerProvider a reference to the ProtocolProviderService thatthe contact we're looking for belongs to.
* @return a reference to a <tt>Contact</tt>, encapsulated by thisMetaContact, carrying the specified address and originating from the specified ownerProvider or null if no such contact exists..
*/
public Contact getContact( String contactAddress, ProtocolProviderService ownerProvider);
/**
* Returns <tt>true</tt> if the given <tt>protocolContact</tt> is contained in this <tt>MetaContact</tt>, otherwise - returns <tt>false</tt>.
* @param protocolContact the <tt>Contact</tt> we're looking for
* @return <tt>true</tt> if the given <tt>protocolContact</tt> is containedin this <tt>MetaContact</tt>, otherwise - returns <tt>false</tt>
*/
public boolean containsContact( Contact protocolContact);
/**
* Returns the number of protocol speciic <tt>Contact</tt>s that this <tt>MetaContact</tt> contains.
* @return an int indicating the number of protocol specific contacts mergedin this <tt>MetaContact</tt>
*/
public int getContactCount();
/**
* Returns all protocol specific Contacts, encapsulated by this MetaContact and coming from the indicated ProtocolProviderService. If none of the contacts encapsulated by this MetaContact is originating from the specified provider then an empty iterator is returned. <p> Note to implementors: In order to prevent problems with concurrency, the <tt>Iterator</tt> returned by this method should not be over the actual list of contacts but rather over a copy of that list. <p>
* @param provider a reference to the <tt>ProtocolProviderService</tt>whose contacts we'd like to get.
* @return an <tt>Iterator</tt> over all contacts encapsulated in this<tt>MetaContact</tt> and originating from the specified provider.
*/
public Iterator<Contact> getContactsForProvider( ProtocolProviderService provider);
/**
* Returns all protocol specific Contacts, encapsulated by this MetaContact and supporting the given <tt>opSetClass</tt>. If none of the contacts encapsulated by this MetaContact is supporting the specified <tt>OperationSet</tt> class then an empty list is returned. <p> Note to implementors: In order to prevent problems with concurrency, the <tt>List</tt> returned by this method should not be the actual list of contacts but rather a copy of that list. <p>
* @param opSetClass the operation for which the default contact is needed
* @return a <tt>List</tt> of all contacts encapsulated in this<tt>MetaContact</tt> and supporting the specified <tt>OperationSet</tt>
*/
public List<Contact> getContactsForOperationSet( Class<? extends OperationSet> opSetClass);
/**
* Returns the MetaContactGroup currently containing this meta contact
* @return a reference to the MetaContactGroup currently containing thismeta contact.
*/
public MetaContactGroup getParentMetaContactGroup();
/**
* Returns a String identifier (the actual contents is left to implementations) that uniquely represents this <tt>MetaContact</tt> in the containing <tt>MetaContactList</tt>
* @return String
*/
public String getMetaUID();
/**
* Returns a characteristic display name that can be used when including this <tt>MetaContact</tt> in user interface.
* @return a human readable String that represents this meta contact.
*/
public String getDisplayName();
/**
* Returns the avatar of this contact, that can be used when including this <tt>MetaContact</tt> in user interface.
* @return an avatar (e.g. user photo) of this contact.
*/
public byte[] getAvatar();
/**
* Returns the avatar of this contact, that can be used when including this <tt>MetaContact</tt> in user interface. The isLazy parameter would tell the implementation if it could return the locally stored avatar or it should obtain the avatar right from the server.
* @param isLazy Indicates if this method should return the locally storedavatar or it should obtain the avatar right from the server.
* @return an avatar (e.g. user photo) of this contact.
*/
public byte[] getAvatar( boolean isLazy);
/**
* Returns a String representation of this <tt>MetaContact</tt>.
* @return a String representation of this <tt>MetaContact</tt>.
*/
public String toString();
/**
* Adds a custom detail to this contact.
* @param name name of the detail.
* @param value the value of the detail.
*/
public void addDetail( String name, String value);
/**
* Remove the given detail.
* @param name of the detail to be removed.
* @param value value of the detail to be removed.
*/
public void removeDetail( String name, String value);
/**
* Remove all details with given name.
* @param name of the details to be removed.
*/
public void removeDetails( String name);
/**
* Change the detail.
* @param name of the detail to be changed.
* @param oldValue the old value of the detail.
* @param newValue the new value of the detail.
*/
public void changeDetail( String name, String oldValue, String newValue);
/**
* Get all details with given name.
* @param name the name of the details we are searching.
* @return list of string values for the details with the given name.
*/
public List<String> getDetails( String name);
/**
* Gets the user data associated with this instance and a specific key.
* @param key the key of the user data associated with this instance to beretrieved
* @return an <tt>Object</tt> which represents the value associated withthis instance and the specified <tt>key</tt>; <tt>null</tt> if no association with the specified <tt>key</tt> exists in this instance
*/
public Object getData( Object key);
/**
* Sets a user-specific association in this instance in the form of a key-value pair. If the specified <tt>key</tt> is already associated in this instance with a value, the existing value is overwritten with the specified <tt>value</tt>. <p> 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. </p> <p> The storage of the user data is implementation-specific and is thus not guaranteed to be optimized for execution time and memory use. </p>
* @param key the key to associate in this instance with the specified value
* @param value the value to be associated in this instance with thespecified <tt>key</tt>
*/
public void setData( Object key, Object value);
}
/**
* The <tt>ContactResource</tt> class represents a resource, from which a <tt>Contact</tt> is connected.
* @author Yana Stamcheva
*/
public class ContactResource {
/**
* A static instance of this class representing the base resource. If this base resource is passed as a parameter for any operation (send message, call) the operation should explicitly use the base contact address. This is meant to force a call or a message sending to all the resources for the corresponding contact.
*/
public static ContactResource BASE_RESOURCE=new ContactResource();
/**
* The contact, to which this resource belongs.
*/
private Contact contact;
/**
* The name of this contact resource.
*/
private String resourceName;
/**
* The presence status of this contact resource.
*/
protected PresenceStatus presenceStatus;
/**
* The priority of this contact source.
*/
protected int priority;
/**
* Whether this contact resource is a mobile one.
*/
protected boolean mobile=false;
/**
* Creates an empty instance of <tt>ContactResource</tt> representing the base resource.
*/
public ContactResource();
/**
* Creates a <tt>ContactResource</tt> by specifying the <tt>resourceName</tt>, the <tt>presenceStatus</tt> and the <tt>priority</tt>.
* @param contact the parent <tt>Contact</tt> this resource is about
* @param resourceName the name of this resource
* @param presenceStatus the presence status of this resource
* @param priority the priority of this resource
*/
public ContactResource( Contact contact, String resourceName, PresenceStatus presenceStatus, int priority, boolean mobile);
/**
* Returns the <tt>Contact</tt>, this resources belongs to.
* @return the <tt>Contact</tt>, this resources belongs to
*/
public Contact getContact();
/**
* Returns the name of this resource.
* @return the name of this resource
*/
public String getResourceName();
/**
* Returns the presence status of this resource.
* @return the presence status of this resource
*/
public PresenceStatus getPresenceStatus();
/**
* Returns the priority of the resources.
* @return the priority of this resource
*/
public int getPriority();
/**
* Whether contact is mobile one. Logged in only from mobile device.
* @return whether contact is mobile one.
*/
public boolean isMobile();
@Override public int hashCode();
@Override public boolean equals( Object obj);
}
/**
* The Activator of the Contact Info bundle.
* @author Adam Goldstein
* @author Yana Stamcheva
*/
public class ContactInfoActivator extends DependentActivator {
private org.slf4j.Logger logger=org.slf4j.LoggerFactory.getLogger(ContactInfoActivator.class);
/**
* Indicates if the contact info button is enabled in the chat window.
*/
private static final String ENABLED_IN_CHAT_WINDOW_PROP="net.java.sip.communicator.plugin.contactinfo." + "ENABLED_IN_CHAT_WINDOW_PROP";
/**
* Indicates if the contact info button is enabled in the call window.
*/
private static final String ENABLED_IN_CALL_WINDOW_PROP="net.java.sip.communicator.plugin.contactinfo." + "ENABLED_IN_CALL_WINDOW_PROP";
private static BrowserLauncherService browserLauncherService;
/**
* The image loader service implementation.
*/
private static ImageLoaderService<?> imageLoaderService=null;
/**
* The contact list service implementation.
*/
private static MetaContactListService metaCListService;
static BundleContext bundleContext;
public ContactInfoActivator();
/**
* Starts this bundle.
*/
@Override public void startWithServices( BundleContext bc);
/**
* Returns the <tt>BrowserLauncherService</tt> obtained from the bundle context.
* @return the <tt>BrowserLauncherService</tt> obtained from the bundlecontext
*/
public static BrowserLauncherService getBrowserLauncher();
/**
* Returns the imageLoaderService instance, if missing query osgi for it.
* @return the imageLoaderService.
*/
public static ImageLoaderService<?> getImageLoaderService();
/**
* Returns the <tt>MetaContactListService</tt> obtained from the bundle context.
* @return the <tt>MetaContactListService</tt> obtained from the bundlecontext
*/
public static MetaContactListService getContactListService();
/**
* Contact info create factory.
*/
private class ContactInfoPluginComponentFactory extends PluginComponentFactory {
ContactInfoPluginComponentFactory( Container c);
@Override protected PluginComponent getPluginInstance();
}
}
/**
* The <tt>HelpMenu</tt> is a menu in the main application menu bar.
* @author Yana Stamcheva
* @author Lubomir Marinov
*/
public class HelpMenu extends SIPCommMenu implements ActionListener, PluginComponentListener {
private final org.slf4j.Logger logger=org.slf4j.LoggerFactory.getLogger(HelpMenu.class.getName());
/**
* Creates an instance of <tt>HelpMenu</tt>.
* @param chatWindow The parent <tt>MainFrame</tt>.
*/
public HelpMenu( ChatWindow chatWindow);
/**
* Runs clean-up for associated resources which need explicit disposal (e.g. listeners keeping this instance alive because they were added to the model which operationally outlives this instance).
*/
public void dispose();
/**
* Initialize plugin components already registered for this container.
*/
private void initPluginComponents();
/**
* Handles the <tt>ActionEvent</tt> when one of the menu items is selected.
*/
public void actionPerformed( ActionEvent e);
public void pluginComponentAdded( PluginComponentEvent event);
public void pluginComponentRemoved( PluginComponentEvent event);
}
/**
* This class represents the notion of a Contact or Buddy, that is widely used in instant messaging today. From a protocol point of view, a contact is generally considered to be another user of the service that proposes the protocol. Instances of Contact could be used for delivery of presence notifications or when addressing instant messages.
* @author Emil Ivov
*/
public interface Contact {
/**
* Returns a String that can be used for identifying the contact. The exact contents of the string depends on the protocol. In the case of SIP, for example, that would be the SIP uri (e.g. sip:alice@biloxi.com) in the case of icq - a UIN (12345653) and for AIM a screenname (mysname). Jabber (and hence Google) would be having e-mail like addresses.
* @return a String id representing and uniquely identifying the contact.
*/
public String getAddress();
/**
* Returns a String that could be used by any user interacting modules for referring to this contact. An alias is not necessarily unique but is often more human readable than an address (or id).
* @return a String that can be used for referring to this contact wheninteracting with the user.
*/
public String getDisplayName();
/**
* Returns a byte array containing an image (most often a photo or an avatar) that the contact uses as a representation.
* @return byte[] an image representing the contact.
*/
public byte[] getImage();
/**
* Returns the status of the contact as per the last status update we've received for it. Note that this method is not to perform any network operations and will simply return the status received in the last status update message. If you want a reliable way of retrieving someone's status, you should use the <tt>queryContactStatus()</tt> method in <tt>OperationSetPresence</tt>.
* @return the PresenceStatus that we've received in the last status updatepertaining to this contact.
*/
public PresenceStatus getPresenceStatus();
/**
* Returns a reference to the contact group that this contact is currently a child of or null if the underlying protocol does not support persistent presence.
* @return a reference to the contact group that this contact is currentlya child of or null if the underlying protocol does not support persistent presence.
*/
public ContactGroup getParentContactGroup();
/**
* Returns a reference to the protocol provider that created the contact.
* @return a reference to an instance of the ProtocolProviderService
*/
public ProtocolProviderService getProtocolProvider();
/**
* Determines whether or not this contact is being stored by the server. Non persistent contacts are common in the case of simple, non-persistent presence operation sets. They could however also be seen in persistent presence operation sets when for example we have received an event from someone not on our contact list. Non persistent contacts are volatile even when coming from a persistent presence op. set. They would only exist until the application is closed and will not be there next time it is loaded.
* @return true if the contact is persistent and false otherwise.
*/
public boolean isPersistent();
/**
* Determines whether or not this contact has been resolved against the server. Unresolved contacts are used when initially loading a contact list that has been stored in a local file until the presence operation set has managed to retrieve all the contact list from the server and has properly mapped contacts to their on-line buddies.
* @return true if the contact has been resolved (mapped against a buddy)and false otherwise.
*/
public boolean isResolved();
/**
* Returns a String that can be used to create a unresolved instance of this contact. Unresolved contacts are created through the createUnresolvedContact() method in the persistent presence operation set. The method may also return null if no such data is required and the contact address is sufficient for restoring the contact. <p>
* @return A <tt>String</tt> that could be used to create a unresolvedinstance of this contact during a next run of the application, before establishing network connectivity or null if no such data is required.
*/
public String getPersistentData();
/**
* Return the current status message of this contact.
* @return the current status message
*/
public String getStatusMessage();
/**
* Indicates if this contact supports resources.
* @return <tt>true</tt> if this contact supports resources, <tt>false</tt>otherwise
*/
public boolean supportResources();
/**
* Returns a collection of resources supported by this contact or null if it doesn't support resources.
* @return a collection of resources supported by this contact or nullif it doesn't support resources
*/
public Collection<ContactResource> getResources();
/**
* Adds the given <tt>ContactResourceListener</tt> to listen for events related to contact resources changes.
* @param l the <tt>ContactResourceListener</tt> to add
*/
public void addResourceListener( ContactResourceListener l);
/**
* Removes the given <tt>ContactResourceListener</tt> listening for events related to contact resources changes.
* @param l the <tt>ContactResourceListener</tt> to rmove
*/
public void removeResourceListener( ContactResourceListener l);
/**
* Returns the persistent contact address.
* @return the address of the contact.
*/
public String getPersistableAddress();
/**
* Whether contact is mobile one. Logged in only from mobile device.
* @return whether contact is mobile one.
*/
public boolean isMobile();
}
|
docker-java_docker-java | docker-java/docker-java-api/src/main/java/com/github/dockerjava/api/model/Device.java | Device | parse | class Device extends DockerObject implements Serializable {
private static final long serialVersionUID = 1L;
@JsonProperty("CgroupPermissions")
private String cGroupPermissions = "";
@JsonProperty("PathOnHost")
private String pathOnHost = null;
@JsonProperty("PathInContainer")
private String pathInContainer = null;
public Device() {
}
public Device(String cGroupPermissions, String pathInContainer, String pathOnHost) {
requireNonNull(cGroupPermissions, "cGroupPermissions is null");
requireNonNull(pathInContainer, "pathInContainer is null");
requireNonNull(pathOnHost, "pathOnHost is null");
this.cGroupPermissions = cGroupPermissions;
this.pathInContainer = pathInContainer;
this.pathOnHost = pathOnHost;
}
public String getcGroupPermissions() {
return cGroupPermissions;
}
public String getPathInContainer() {
return pathInContainer;
}
public String getPathOnHost() {
return pathOnHost;
}
/**
* @link https://github.com/docker/docker/blob/6b4a46f28266031ce1a1315f17fb69113a06efe1/runconfig/opts/parse_test.go#L468
*/
@Nonnull
public static Device parse(@Nonnull String deviceStr) {<FILL_FUNCTION_BODY>}
/**
* ValidDeviceMode checks if the mode for device is valid or not.
* Valid mode is a composition of r (read), w (write), and m (mknod).
*
* @link https://github.com/docker/docker/blob/6b4a46f28266031ce1a1315f17fb69113a06efe1/runconfig/opts/parse.go#L796
*/
private static boolean validDeviceMode(String deviceMode) {
Map<String, Boolean> validModes = new HashMap<>(3);
validModes.put("r", true);
validModes.put("w", true);
validModes.put("m", true);
if (deviceMode == null || deviceMode.length() == 0) {
return false;
}
for (char ch : deviceMode.toCharArray()) {
final String mode = String.valueOf(ch);
if (!Boolean.TRUE.equals(validModes.get(mode))) {
return false; // wrong mode
}
validModes.put(mode, false);
}
return true;
}
} |
String src = "";
String dst = "";
String permissions = "rwm";
final String[] arr = deviceStr.trim().split(":");
// java String.split() returns wrong length, use tokenizer instead
switch (new StringTokenizer(deviceStr, ":").countTokens()) {
case 3: {
// Mismatches docker code logic. While there is no validations after parsing, checking heregit
if (validDeviceMode(arr[2])) {
permissions = arr[2];
} else {
throw new IllegalArgumentException("Invalid device specification: " + deviceStr);
}
}
case 2: {
if (validDeviceMode(arr[1])) {
permissions = arr[1];
} else {
dst = arr[1];
}
}
case 1: {
src = arr[0];
break;
}
default: {
throw new IllegalArgumentException("Invalid device specification: " + deviceStr);
}
}
if (dst == null || dst.length() == 0) {
dst = src;
}
return new Device(permissions, dst, src);
| /**
* @see DockerObjectAccessor
*/
public abstract class DockerObject {
HashMap<String,Object> rawValues=new HashMap<>();
@JsonAnyGetter public Map<String,Object> getRawValues();
}
|
final String[] deviceParts = deviceStr.split(":");
if (deviceParts.length != 3) {
throw new IllegalArgumentException("Invalid device format: " + deviceStr);
}
final String devicePathInContainer = deviceParts[0];
final String devicePathOnHost = deviceParts[1];
final String deviceCGroupPermissions = deviceParts[2];
if (!validDeviceMode(deviceCGroupPermissions)) {
throw new IllegalArgumentException("Invalid device mode: " + deviceCGroupPermissions);
}
return new Device(deviceCGroupPermissions, devicePathInContainer, devicePathOnHost);
| [
91,
93
] | [
91,
34,
115,
112,
108,
105,
116,
34,
93
] | [
91,
93
] | [
91,
34,
108,
101,
110,
103,
116,
104,
34,
44,
34,
115,
112,
108,
105,
116,
34,
44,
34,
99,
111,
117,
110,
116,
84,
111,
107,
101,
110,
115,
34,
44,
34,
116,
114,
105,
109,
34,
93
] | @Override public long getContentLength(){
return -1;
}
public long skip(long n) throws IOException {
return delegate.skip(n);
}
/**
* @see #joinTokens
*/
@CheckForNull public SwarmJoinTokens getJoinTokens(){
return joinTokens;
}
public T transform(Map<String,String> env){
return (T)this;
}
/**
* Parses a string to an {@link InternetProtocol}.
* @param serialized the protocol, e.g. <code>tcp</code> or <code>TCP</code>
* @return an {@link InternetProtocol} described by the string
* @throws IllegalArgumentException if the argument cannot be parsed
*/
public static InternetProtocol parse(String serialized) throws IllegalArgumentException {
try {
return valueOf(serialized.toUpperCase());
}
catch ( Exception e) {
throw new IllegalArgumentException("Error parsing Protocol '" + serialized + "'");
}
}
| @Override public long getContentLength(){
return -1;
}
public long skip(long n) throws IOException {
return delegate.skip(n);
}
/**
* @see #joinTokens
*/
@CheckForNull public SwarmJoinTokens getJoinTokens(){
return joinTokens;
}
public T transform(Map<String,String> env){
return (T)this;
}
/**
* Parses a string to an {@link InternetProtocol}.
* @param serialized the protocol, e.g. <code>tcp</code> or <code>TCP</code>
* @return an {@link InternetProtocol} described by the string
* @throws IllegalArgumentException if the argument cannot be parsed
*/
public static InternetProtocol parse(String serialized) throws IllegalArgumentException {
try {
return valueOf(serialized.toUpperCase());
}
catch ( Exception e) {
throw new IllegalArgumentException("Error parsing Protocol '" + serialized + "'");
}
}
| {"methods": [{"length": "getContentLength"}, {"split": "skip"}, {"countTokens": "getJoinTokens"}, {"trim": "transform"}], "similar_methods": [{"parse": "parse"}]} | [] | [{"length": {"retrieved_name": "getContentLength", "raw_body": "@Override public long getContentLength(){\n return -1;\n}\n"}}, {"split": {"retrieved_name": "skip", "raw_body": "public long skip(long n) throws IOException {\n return delegate.skip(n);\n}\n"}}, {"countTokens": {"retrieved_name": "getJoinTokens", "raw_body": "/** \n * @see #joinTokens\n */\n@CheckForNull public SwarmJoinTokens getJoinTokens(){\n return joinTokens;\n}\n"}}, {"trim": {"retrieved_name": "transform", "raw_body": "public T transform(Map<String,String> env){\n return (T)this;\n}\n"}}] | [{"parse": {"retrieved_name": "parse", "raw_body": "/** \n * Parses a string to an {@link InternetProtocol}.\n * @param serialized the protocol, e.g. <code>tcp</code> or <code>TCP</code>\n * @return an {@link InternetProtocol} described by the string\n * @throws IllegalArgumentException if the argument cannot be parsed\n */\npublic static InternetProtocol parse(String serialized) throws IllegalArgumentException {\n try {\n return valueOf(serialized.toUpperCase());\n }\n catch ( Exception e) {\n throw new IllegalArgumentException(\"Error parsing Protocol '\" + serialized + \"'\");\n }\n}\n"}}] | [
91,
34,
108,
101,
110,
103,
116,
104,
34,
44,
34,
115,
112,
108,
105,
116,
34,
44,
34,
99,
111,
117,
110,
116,
84,
111,
107,
101,
110,
115,
34,
44,
34,
116,
114,
105,
109,
34,
93
] | [
91,
34,
112,
97,
114,
115,
101,
34,
93
] | [
91,
110,
117,
108,
108,
93
] | |
subhra74_snowflake | snowflake/muon-app/src/main/java/muon/app/ui/components/session/utilpage/services/ServiceTableCellRenderer.java | ServiceTableCellRenderer | getTableCellRendererComponent | class ServiceTableCellRenderer extends JLabel implements TableCellRenderer {
public ServiceTableCellRenderer() {
setText("HHH");
setBorder(new EmptyBorder(5, 5, 5, 5));
setOpaque(true);
}
@Override
public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {<FILL_FUNCTION_BODY>}
} |
setText(value == null ? "" : value.toString());
setBackground(isSelected ? table.getSelectionBackground() : table.getBackground());
setForeground(isSelected ? table.getSelectionForeground() : table.getForeground());
return this;
|
Service service = (Service) value;
setText(service.getName());
return this;
| [
91,
34,
74,
84,
97,
98,
108,
101,
34,
44,
34,
83,
101,
114,
118,
105,
99,
101,
34,
93
] | [
91,
34,
103,
101,
116,
78,
97,
109,
101,
34,
93
] | [
91,
34,
74,
84,
97,
98,
108,
101,
34,
93
] | [
91,
34,
103,
101,
116,
83,
101,
108,
101,
99,
116,
105,
111,
110,
70,
111,
114,
101,
103,
114,
111,
117,
110,
100,
34,
44,
34,
103,
101,
116,
70,
111,
114,
101,
103,
114,
111,
117,
110,
100,
34,
44,
34,
116,
111,
83,
116,
114,
105,
110,
103,
34,
44,
34,
103,
101,
116,
83,
101,
108,
101,
99,
116,
105,
111,
110,
66,
97,
99,
107,
103,
114,
111,
117,
110,
100,
34,
44,
34,
103,
101,
116,
66,
97,
99,
107,
103,
114,
111,
117,
110,
100,
34,
93
] | public class SearchTableRenderer implements TableCellRenderer {
private JLabel label;
private JPanel panel;
private SearchTableModel model;
private JLabel textLabel, iconLabel;
public SearchTableRenderer( SearchTableModel model);
public Component getTableCellRendererComponent( JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column);
}
public Color getDefaultSelectionForeground(){
return this.defaults.getColor("nimbusSelectedText");
}
@Override public Color getForeground(){
return getPalette().getColor(myStyleState.getForeground());
}
@Override public String toString(){
if (remoteFile != null) return remoteFile.getName();
return "";
}
public Color getDefaultSelectionBackground(){
return this.defaults.getColor("nimbusSelectionBackground");
}
public TerminalColor getBackground(){
return getBackground(null);
}
@Override public Component getTableCellRendererComponent(JTable table,Object value,boolean isSelected,boolean hasFocus,int row,int column){
setBackground(isSelected ? table.getSelectionBackground() : table.getBackground());
setForeground(isSelected ? table.getSelectionForeground() : table.getForeground());
if (column == 3) {
double mem=((Float)value) * 1024;
setText(FormatUtils.humanReadableByteCount((long)mem,true));
}
else {
setText(value.toString());
}
return this;
}
| public class SearchTableRenderer implements TableCellRenderer {
private JLabel label;
private JPanel panel;
private SearchTableModel model;
private JLabel textLabel, iconLabel;
public SearchTableRenderer( SearchTableModel model);
public Component getTableCellRendererComponent( JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column);
}
public Color getDefaultSelectionForeground(){
return this.defaults.getColor("nimbusSelectedText");
}
@Override public Color getForeground(){
return getPalette().getColor(myStyleState.getForeground());
}
@Override public String toString(){
if (remoteFile != null) return remoteFile.getName();
return "";
}
public Color getDefaultSelectionBackground(){
return this.defaults.getColor("nimbusSelectionBackground");
}
public TerminalColor getBackground(){
return getBackground(null);
}
@Override public Component getTableCellRendererComponent(JTable table,Object value,boolean isSelected,boolean hasFocus,int row,int column){
setBackground(isSelected ? table.getSelectionBackground() : table.getBackground());
setForeground(isSelected ? table.getSelectionForeground() : table.getForeground());
if (column == 3) {
double mem=((Float)value) * 1024;
setText(FormatUtils.humanReadableByteCount((long)mem,true));
}
else {
setText(value.toString());
}
return this;
}
| {"types": [{"JTable": "SearchTableRenderer"}], "methods": [{"getSelectionForeground": "getDefaultSelectionForeground"}, {"getForeground": "getForeground"}, {"toString": "toString"}, {"getSelectionBackground": "getDefaultSelectionBackground"}, {"getBackground": "getBackground"}], "similar_methods": [{"getTableCellRendererComponent": "getTableCellRendererComponent"}]} | [{"JTable": {"retrieved_name": "SearchTableRenderer", "raw_body": "public class SearchTableRenderer implements TableCellRenderer {\n private JLabel label;\n private JPanel panel;\n private SearchTableModel model;\n private JLabel textLabel, iconLabel;\n public SearchTableRenderer( SearchTableModel model);\n public Component getTableCellRendererComponent( JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column);\n}\n", "raw_body_no_cmt": "public class SearchTableRenderer implements TableCellRenderer {\n private JLabel label;\n private JPanel panel;\n private SearchTableModel model;\n private JLabel textLabel, iconLabel;\n public SearchTableRenderer( SearchTableModel model);\n public Component getTableCellRendererComponent( JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column);\n}\n"}}] | [{"getSelectionForeground": {"retrieved_name": "getDefaultSelectionForeground", "raw_body": "public Color getDefaultSelectionForeground(){\n return this.defaults.getColor(\"nimbusSelectedText\");\n}\n"}}, {"getForeground": {"retrieved_name": "getForeground", "raw_body": "@Override public Color getForeground(){\n return getPalette().getColor(myStyleState.getForeground());\n}\n"}}, {"toString": {"retrieved_name": "toString", "raw_body": "@Override public String toString(){\n if (remoteFile != null) return remoteFile.getName();\n return \"\";\n}\n"}}, {"getSelectionBackground": {"retrieved_name": "getDefaultSelectionBackground", "raw_body": "public Color getDefaultSelectionBackground(){\n return this.defaults.getColor(\"nimbusSelectionBackground\");\n}\n"}}, {"getBackground": {"retrieved_name": "getBackground", "raw_body": "public TerminalColor getBackground(){\n return getBackground(null);\n}\n"}}] | [{"getTableCellRendererComponent": {"retrieved_name": "getTableCellRendererComponent", "raw_body": "@Override public Component getTableCellRendererComponent(JTable table,Object value,boolean isSelected,boolean hasFocus,int row,int column){\n setBackground(isSelected ? table.getSelectionBackground() : table.getBackground());\n setForeground(isSelected ? table.getSelectionForeground() : table.getForeground());\n if (column == 3) {\n double mem=((Float)value) * 1024;\n setText(FormatUtils.humanReadableByteCount((long)mem,true));\n }\n else {\n setText(value.toString());\n }\n return this;\n}\n"}}] | [
91,
34,
103,
101,
116,
83,
101,
108,
101,
99,
116,
105,
111,
110,
70,
111,
114,
101,
103,
114,
111,
117,
110,
100,
34,
44,
34,
103,
101,
116,
70,
111,
114,
101,
103,
114,
111,
117,
110,
100,
34,
44,
34,
116,
111,
83,
116,
114,
105,
110,
103,
34,
44,
34,
103,
101,
116,
83,
101,
108,
101,
99,
116,
105,
111,
110,
66,
97,
99,
107,
103,
114,
111,
117,
110,
100,
34,
44,
34,
103,
101,
116,
66,
97,
99,
107,
103,
114,
111,
117,
110,
100,
34,
93
] | [
91,
34,
103,
101,
116,
84,
97,
98,
108,
101,
67,
101,
108,
108,
82,
101,
110,
100,
101,
114,
101,
114,
67,
111,
109,
112,
111,
110,
101,
110,
116,
34,
93
] | [
91,
34,
74,
84,
97,
98,
108,
101,
34,
93
] | public class SearchTableRenderer implements TableCellRenderer {
private JLabel label;
private JPanel panel;
private SearchTableModel model;
private JLabel textLabel, iconLabel;
public SearchTableRenderer( SearchTableModel model);
public Component getTableCellRendererComponent( JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column);
}
|
|
DerekYRC_mini-spring | mini-spring/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcutAdvisor.java | AspectJExpressionPointcutAdvisor | getPointcut | class AspectJExpressionPointcutAdvisor implements PointcutAdvisor {
private AspectJExpressionPointcut pointcut;
private Advice advice;
private String expression;
public void setExpression(String expression) {
this.expression = expression;
}
@Override
public Pointcut getPointcut() {<FILL_FUNCTION_BODY>}
@Override
public Advice getAdvice() {
return advice;
}
public void setAdvice(Advice advice) {
this.advice = advice;
}
} |
if (pointcut == null) {
pointcut = new AspectJExpressionPointcut(expression);
}
return pointcut;
|
if (pointcut == null) {
pointcut = new AspectJExpressionPointcut();
pointcut.setExpression(expression);
}
return pointcut;
| [
91,
34,
65,
115,
112,
101,
99,
116,
74,
69,
120,
112,
114,
101,
115,
115,
105,
111,
110,
80,
111,
105,
110,
116,
99,
117,
116,
34,
93
] | [
91,
34,
115,
101,
116,
69,
120,
112,
114,
101,
115,
115,
105,
111,
110,
34,
93
] | [
91,
34,
65,
115,
112,
101,
99,
116,
74,
69,
120,
112,
114,
101,
115,
115,
105,
111,
110,
80,
111,
105,
110,
116,
99,
117,
116,
34,
93
] | [
91,
93
] | /**
* @author derekyi
* @date 2020/12/5
*/
public class AspectJExpressionPointcut implements Pointcut, ClassFilter, MethodMatcher {
private static final Set<PointcutPrimitive> SUPPORTED_PRIMITIVES=new HashSet<PointcutPrimitive>();
static {
SUPPORTED_PRIMITIVES.add(PointcutPrimitive.EXECUTION);
}
private final PointcutExpression pointcutExpression;
public AspectJExpressionPointcut( String expression);
@Override public boolean matches( Class<?> clazz);
@Override public boolean matches( Method method, Class<?> targetClass);
@Override public ClassFilter getClassFilter();
@Override public MethodMatcher getMethodMatcher();
}
Pointcut getPointcut();
| public class AspectJExpressionPointcut implements Pointcut, ClassFilter, MethodMatcher {
private static final Set<PointcutPrimitive> SUPPORTED_PRIMITIVES=new HashSet<PointcutPrimitive>();
static {
SUPPORTED_PRIMITIVES.add(PointcutPrimitive.EXECUTION);
}
private final PointcutExpression pointcutExpression;
public AspectJExpressionPointcut( String expression);
public boolean matches( Class<?> clazz);
public boolean matches( Method method, Class<?> targetClass);
public ClassFilter getClassFilter();
public MethodMatcher getMethodMatcher();
}
Pointcut getPointcut();
| {"types": [{"AspectJExpressionPointcut": "AspectJExpressionPointcut"}], "similar_methods": [{"getPointcut": "getPointcut"}]} | [{"AspectJExpressionPointcut": {"retrieved_name": "AspectJExpressionPointcut", "raw_body": "/** \n * @author derekyi\n * @date 2020/12/5\n */\npublic class AspectJExpressionPointcut implements Pointcut, ClassFilter, MethodMatcher {\n private static final Set<PointcutPrimitive> SUPPORTED_PRIMITIVES=new HashSet<PointcutPrimitive>();\nstatic {\n SUPPORTED_PRIMITIVES.add(PointcutPrimitive.EXECUTION);\n }\n private final PointcutExpression pointcutExpression;\n public AspectJExpressionPointcut( String expression);\n @Override public boolean matches( Class<?> clazz);\n @Override public boolean matches( Method method, Class<?> targetClass);\n @Override public ClassFilter getClassFilter();\n @Override public MethodMatcher getMethodMatcher();\n}\n", "raw_body_no_cmt": "public class AspectJExpressionPointcut implements Pointcut, ClassFilter, MethodMatcher {\n private static final Set<PointcutPrimitive> SUPPORTED_PRIMITIVES=new HashSet<PointcutPrimitive>();\nstatic {\n SUPPORTED_PRIMITIVES.add(PointcutPrimitive.EXECUTION);\n }\n private final PointcutExpression pointcutExpression;\n public AspectJExpressionPointcut( String expression);\n public boolean matches( Class<?> clazz);\n public boolean matches( Method method, Class<?> targetClass);\n public ClassFilter getClassFilter();\n public MethodMatcher getMethodMatcher();\n}\n"}}] | [] | [{"getPointcut": {"retrieved_name": "getPointcut", "raw_body": "Pointcut getPointcut();\n"}}] | [
91,
110,
117,
108,
108,
93
] | [
91,
34,
103,
101,
116,
80,
111,
105,
110,
116,
99,
117,
116,
34,
93
] | [
91,
34,
65,
115,
112,
101,
99,
116,
74,
69,
120,
112,
114,
101,
115,
115,
105,
111,
110,
80,
111,
105,
110,
116,
99,
117,
116,
34,
93
] | /**
* @author derekyi
* @date 2020/12/5
*/
public class AspectJExpressionPointcut implements Pointcut, ClassFilter, MethodMatcher {
private static final Set<PointcutPrimitive> SUPPORTED_PRIMITIVES=new HashSet<PointcutPrimitive>();
static {
SUPPORTED_PRIMITIVES.add(PointcutPrimitive.EXECUTION);
}
private final PointcutExpression pointcutExpression;
public AspectJExpressionPointcut( String expression);
@Override public boolean matches( Class<?> clazz);
@Override public boolean matches( Method method, Class<?> targetClass);
@Override public ClassFilter getClassFilter();
@Override public MethodMatcher getMethodMatcher();
}
|
|
Pay-Group_best-pay-sdk | best-pay-sdk/src/main/java/com/lly835/bestpay/service/impl/wx/WxPayMicroServiceImpl.java | WxPayMicroServiceImpl | pay | "class WxPayMicroServiceImpl extends WxPayServiceImpl {\n\n /**\n * 微信付款码支付\n (...TRUNCATED) | "\n WxPayUnifiedorderRequest wxRequest = new WxPayUnifiedorderRequest();\n wxRequest.s(...TRUNCATED) | "/** \n * Created by 廖师兄 2017-07-02 13:40\n */\n@Slf4j public class WxPayServiceImpl extends B(...TRUNCATED) | "\n WxPayRequest wxPayRequest = (WxPayRequest) request;\n WxPayAsyncRequest wxPayAsync(...TRUNCATED) | [
91,
34,
87,
120,
80,
97,
121,
82,
101,
113,
117,
101,
115,
116,
34,
44,
34,
87,
120,
80,
97,
121,
65,
115,
121,
110,
99,
82,
101,
113,
117,
101,
115,
116,
34,
44,
34,
80,
97,
121,
82,
101,
113,
117,
101,
115,
116,
34,
93
] | "WyJnZXRCb2R5Iiwic2V0RGV2aWNlSW5mbyIsInNldEZlZVR5cGUiLCJzZXRUaW1lU3RhcnQiLCJnZXREZXZpY2VJbmZvIiwic2V(...TRUNCATED) | "WyJXeFBheVVuaWZpZWRvcmRlclJlcXVlc3QiLCJXeFBheUFwaSIsIlBheVJlcXVlc3QiLCJJT0V4Y2VwdGlvbiIsIkNhbGw8V3h(...TRUNCATED) | "WyJzZXROb25jZVN0ciIsInNldE9wZW5pZCIsImJvZHkiLCJzZXRBcHBpZCIsImNyZWF0ZSIsImV4ZWN1dGUiLCJnZXRNY2hJZCI(...TRUNCATED) | "/** \n * Created by 廖师兄 2017-07-02 13:42\n */\n@Data @Root(name=\"xml\",strict=false) public (...TRUNCATED) | "public class WxPayUnifiedorderRequest {\n private String appid;\n private String mchId;\n privat(...TRUNCATED) | "{\"types\": [{\"WxPayUnifiedorderRequest\": \"WxPayUnifiedorderRequest\"}, {\"WxPayApi\": \"WxPayAp(...TRUNCATED) | "[{\"WxPayUnifiedorderRequest\": {\"retrieved_name\": \"WxPayUnifiedorderRequest\", \"raw_body\": \"(...TRUNCATED) | "[{\"setNonceStr\": {\"retrieved_name\": \"setNotifyUrl\", \"raw_body\": \"public void setNotifyUrl((...TRUNCATED) | "[{\"pay\": {\"retrieved_name\": \"pay\", \"raw_body\": \"@Override public PayResponse pay(PayReques(...TRUNCATED) | "WyJzZXROb25jZVN0ciIsInNldE9wZW5pZCIsImJvZHkiLCJzZXRBcHBpZCIsImNyZWF0ZSIsImV4ZWN1dGUiLCJnZXRNY2hJZCI(...TRUNCATED) | [
91,
34,
112,
97,
121,
34,
93
] | "WyJXeFBheVVuaWZpZWRvcmRlclJlcXVlc3QiLCJXeFBheUFwaSIsIlBheVJlcXVlc3QiLCJJT0V4Y2VwdGlvbiIsIkNhbGw8V3h(...TRUNCATED) | "/** \n * Created by 廖师兄 2017-07-02 13:42\n */\n@Data @Root(name=\"xml\",strict=false) public (...TRUNCATED) |
pmd_pmd | "pmd/pmd-java/src/main/java/net/sourceforge/pmd/lang/java/rule/multithreading/DoubleCheckedLockingRu(...TRUNCATED) | DoubleCheckedLockingRule | visit | "class DoubleCheckedLockingRule extends AbstractJavaRule {\n\n @Override\n protected @NonNull (...TRUNCATED) | "\n if (node.isVoid() || node.getResultTypeNode() instanceof ASTPrimitiveType || node.getBody(...TRUNCATED) | "\n ASTMethodDeclaration method = (ASTMethodDeclaration) node;\n List<JVariableSymbol>(...TRUNCATED) | [
91,
34,
76,
105,
115,
116,
60,
74,
86,
97,
114,
105,
97,
98,
108,
101,
83,
121,
109,
98,
111,
108,
62,
34,
44,
34,
74,
86,
97,
114,
105,
97,
98,
108,
101,
83,
121,
109,
98,
111,
108,
34,
44,
34,
65,
83,
84,
77,
101,
116,
104,
111,
100,
68,
101,
99,
108,
97,
114,
97,
116,
105,
111,
110,
34,
93
] | [
91,
34,
103,
101,
116,
76,
111,
99,
97,
108,
86,
97,
114,
105,
97,
98,
108,
101,
115,
34,
93
] | "WyJBU1RJZlN0YXRlbWVudCIsIkFTVFJldHVyblN0YXRlbWVudCIsIkxpc3Q8QVNUUmV0dXJuU3RhdGVtZW50PiIsIkFTVEV4cHJ(...TRUNCATED) | "WyJkZXNjZW5kYW50cyIsImlzVm9sYXRpbGUiLCJpc051bGxDaGVjayIsImdldExlZnRPcGVyYW5kIiwiZ2V0Qm9keSIsImdldEV(...TRUNCATED) | "public final class ASTIfStatement extends AbstractPLSQLNode {\n private boolean hasElse;\n ASTIfS(...TRUNCATED) | "public final class ASTIfStatement extends AbstractPLSQLNode {\n private boolean hasElse;\n ASTIfS(...TRUNCATED) | "{\"types\": [{\"ASTIfStatement\": \"ASTIfStatement\"}, {\"ASTReturnStatement\": \"ASTReturnStatemen(...TRUNCATED) | "[{\"ASTIfStatement\": {\"retrieved_name\": \"ASTIfStatement\", \"raw_body\": \"public final class A(...TRUNCATED) | "[{\"descendants\": {\"retrieved_name\": \"descendants\", \"raw_body\": \"/** \\n * Returns a node s(...TRUNCATED) | "[{\"visit\": {\"retrieved_name\": \"visit\", \"raw_body\": \"default R visit(ASTWhenClause node,P d(...TRUNCATED) | "WyJkZXNjZW5kYW50cyIsImlzVm9sYXRpbGUiLCJpc051bGxDaGVjayIsImdldExlZnRPcGVyYW5kIiwiZ2V0Qm9keSIsImdldEV(...TRUNCATED) | [
91,
34,
118,
105,
115,
105,
116,
34,
93
] | "WyJBU1RJZlN0YXRlbWVudCIsIkFTVFJldHVyblN0YXRlbWVudCIsIkxpc3Q8QVNUUmV0dXJuU3RhdGVtZW50PiIsIkFTVEV4cHJ(...TRUNCATED) | "public final class ASTIfStatement extends AbstractPLSQLNode {\n private boolean hasElse;\n ASTIfS(...TRUNCATED) |
|
subhra74_snowflake | snowflake/muon-app/src/main/java/muon/app/ui/laf/AppSkinDark.java | AppSkinDark | initDefaultsDark | "class AppSkinDark extends AppSkin {\r\n\r\n\t/**\r\n\t * \r\n\t */\r\n\tpublic AppSkinDark() {\r\n\(...TRUNCATED) | "\r\n\r\n\t\tColor selectionColor = new Color(3, 155, 229);\r\n\t\tColor controlColor = new Color(40(...TRUNCATED) | "/** \n * @author subhro\n */\npublic abstract class AppSkin {\n protected UIDefaults defaults;\n (...TRUNCATED) | "\n\t\tdefaults.put(\"Button.background\", new Color(20, 20, 20));\n\t\tdefaults.put(\"Button.foregr(...TRUNCATED) | [
91,
93
] | [
91,
34,
112,
117,
116,
34,
93
] | [
91,
34,
67,
111,
108,
111,
114,
34,
93
] | [
91,
34,
103,
101,
116,
78,
97,
109,
101,
34,
44,
34,
112,
117,
116,
34,
93
] | "/** \n * @author traff\n */\n@SuppressWarnings(\"UseJBColor\") public abstract class ColorPalette {(...TRUNCATED) | "public abstract class ColorPalette {\n public static final ColorPalette XTERM_PALETTE=new ColorPal(...TRUNCATED) | "{\"types\": [{\"Color\": \"ColorPalette\"}], \"methods\": [{\"getName\": \"getName\"}, {\"put\": \"(...TRUNCATED) | "[{\"Color\": {\"retrieved_name\": \"ColorPalette\", \"raw_body\": \"/** \\n * @author traff\\n */\\(...TRUNCATED) | "[{\"getName\": {\"retrieved_name\": \"getName\", \"raw_body\": \"@Override public String getName(){(...TRUNCATED) | "[{\"initDefaultsDark\": {\"retrieved_name\": \"initDefaultsLight\", \"raw_body\": \"private void in(...TRUNCATED) | [
91,
34,
103,
101,
116,
78,
97,
109,
101,
34,
44,
34,
112,
117,
116,
34,
93
] | [
91,
34,
105,
110,
105,
116,
68,
101,
102,
97,
117,
108,
116,
115,
68,
97,
114,
107,
34,
93
] | [
91,
34,
67,
111,
108,
111,
114,
34,
93
] | "/** \n * @author traff\n */\n@SuppressWarnings(\"UseJBColor\") public abstract class ColorPalette {(...TRUNCATED) |
spring-cloud_spring-cloud-gateway | "spring-cloud-gateway/spring-cloud-gateway-server/src/main/java/org/springframework/cloud/gateway/fi(...TRUNCATED) | ReactiveLoadBalancerClientFilter | choose | "class ReactiveLoadBalancerClientFilter implements GlobalFilter, Ordered {\n\n\tprivate static final(...TRUNCATED) | "\n\t\tReactorLoadBalancer<ServiceInstance> loadBalancer = this.clientFactory.getInstance(serviceId,(...TRUNCATED) | "\n\t\tLoadBalancerProperties loadBalancerProperties = clientFactory.getProperties(serviceId);\n\t\t(...TRUNCATED) | "WyJMb2FkQmFsYW5jZXJDbGllbnRGYWN0b3J5IiwiTG9hZEJhbGFuY2VyQ2xpZW50IiwiTG9hZEJhbGFuY2VyUHJvcGVydGllcyI(...TRUNCATED) | "WyJnZXRMYXp5UHJvdmlkZXIiLCJjaG9vc2UiLCJvblN0YXJ0IiwiZG9Pbk5leHQiLCJnZXRJZkF2YWlsYWJsZSIsImZvckVhY2g(...TRUNCATED) | "WyJSZWFjdG9yTG9hZEJhbGFuY2VyPFNlcnZpY2VJbnN0YW5jZT4iLCJTZXQ8TG9hZEJhbGFuY2VyTGlmZWN5Y2xlPiIsIlJlcXV(...TRUNCATED) | [
91,
34,
103,
101,
116,
73,
110,
115,
116,
97,
110,
99,
101,
34,
44,
34,
111,
110,
83,
116,
97,
114,
116,
34,
44,
34,
102,
111,
114,
69,
97,
99,
104,
34,
44,
34,
99,
104,
111,
111,
115,
101,
34,
93
] | "/** \n * A {@link GlobalFilter} that allows passing the {@code} instanceId) of the{@link ServiceIn(...TRUNCATED) | "public class LoadBalancerServiceInstanceCookieFilter implements GlobalFilter, Ordered {\n private (...TRUNCATED) | "{\"types\": [{\"ReactorLoadBalancer<ServiceInstance>\": \"LoadBalancerServiceInstanceCookieFilter\"(...TRUNCATED) | "[{\"ReactorLoadBalancer<ServiceInstance>\": {\"retrieved_name\": \"LoadBalancerServiceInstanceCooki(...TRUNCATED) | "[{\"getInstance\": {\"retrieved_name\": \"getInstances\", \"raw_body\": \"@Override public Flux<Ser(...TRUNCATED) | "[{\"choose\": {\"retrieved_name\": \"options\", \"raw_body\": \"@Override public RequestHeadersUriS(...TRUNCATED) | [
91,
34,
103,
101,
116,
73,
110,
115,
116,
97,
110,
99,
101,
34,
44,
34,
111,
110,
83,
116,
97,
114,
116,
34,
44,
34,
102,
111,
114,
69,
97,
99,
104,
34,
44,
34,
99,
104,
111,
111,
115,
101,
34,
93
] | [
91,
34,
99,
104,
111,
111,
115,
101,
34,
93
] | "WyJSZWFjdG9yTG9hZEJhbGFuY2VyPFNlcnZpY2VJbnN0YW5jZT4iLCJTZXQ8TG9hZEJhbGFuY2VyTGlmZWN5Y2xlPiIsIlJlcXV(...TRUNCATED) | "/** \n * A {@link GlobalFilter} that allows passing the {@code} instanceId) of the{@link ServiceIn(...TRUNCATED) |
|
PlexPt_chatgpt-java | chatgpt-java/src/main/java/com/plexpt/chatgpt/Images.java | Images | init | "class Images {\n /**\n * keys\n */\n private String apiKey;\n\n private List<Strin(...TRUNCATED) | "\n OkHttpClient.Builder client = new OkHttpClient.Builder();\n client.addInterceptor((...TRUNCATED) | "\n this.apiClient = new Api(this.apiKey,this.apiKeyList,this.apiHost,this.okHttpClient,this.(...TRUNCATED) | [
91,
34,
80,
114,
111,
120,
121,
34,
44,
34,
79,
107,
72,
116,
116,
112,
67,
108,
105,
101,
110,
116,
34,
44,
34,
76,
105,
115,
116,
60,
83,
116,
114,
105,
110,
103,
62,
34,
44,
34,
65,
112,
105,
34,
93
] | [
91,
93
] | "WyJCYXNlUmVzcG9uc2UiLCJPa0h0dHBDbGllbnQuQnVpbGRlciIsIkxpc3Q8U3RyaW5nPiIsIlJlcXVlc3QiLCJBcGkiLCJSZXN(...TRUNCATED) | "WyJib2R5IiwiYWRkQ29udmVydGVyRmFjdG9yeSIsInBhcnNlT2JqZWN0IiwiY3JlYXRlIiwibWV0aG9kIiwibmV3QnVpbGRlciI(...TRUNCATED) | "/** \n * @author plexpt\n */\n@Data @JsonIgnoreProperties(ignoreUnknown=true) public class BaseResp(...TRUNCATED) | "public class BaseResponse<T> {\n private String object;\n private List<T> data;\n private Error (...TRUNCATED) | "{\"types\": [{\"BaseResponse\": \"BaseResponse\"}, {\"OkHttpClient.Builder\": \"ChatContextHolder\"(...TRUNCATED) | "[{\"BaseResponse\": {\"retrieved_name\": \"BaseResponse\", \"raw_body\": \"/** \\n * @author plexpt(...TRUNCATED) | "[{\"body\": {\"retrieved_name\": \"main\", \"raw_body\": \"public static void main(String[] args){\(...TRUNCATED) | "[{\"init\": {\"retrieved_name\": \"init\", \"raw_body\": \"/** \\n * \\u521d\\u59cb\\u5316\\n */\\n(...TRUNCATED) | "WyJib2R5IiwiYWRkQ29udmVydGVyRmFjdG9yeSIsInBhcnNlT2JqZWN0IiwiY3JlYXRlIiwibWV0aG9kIiwibmV3QnVpbGRlciI(...TRUNCATED) | [
91,
34,
105,
110,
105,
116,
34,
93
] | "WyJCYXNlUmVzcG9uc2UiLCJPa0h0dHBDbGllbnQuQnVpbGRlciIsIkxpc3Q8U3RyaW5nPiIsIlJlcXVlc3QiLCJBcGkiLCJSZXN(...TRUNCATED) | "/** \n * @author plexpt\n */\n@Data @JsonIgnoreProperties(ignoreUnknown=true) public class BaseResp(...TRUNCATED) |
End of preview. Expand
in Dataset Viewer.
No dataset card yet
New: Create and edit this dataset card directly on the website!
Contribute a Dataset Card- Downloads last month
- 6