query
stringlengths
7
33.1k
document
stringlengths
7
335k
metadata
dict
negatives
sequencelengths
3
101
negative_scores
sequencelengths
3
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Constructor for Tool object, creates a Tool object Tool(String name, String id, String address) Creates a Tool object.
public Tool(String name, String id, String address, boolean isHome) { this.name = name; this.id = id; this.address = address; this.isHome = isHome; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Tool(String name, String id, String address) {\n this.name = name;\n this.id = id;\n this.address = address;\n this.isHome = false;\n }", "public Tool(ToolType type, String brand) {\n this.type = type;\n this.brand = brand;\n }", "public Tool(ToolType type, Map map)\n {\n super(type.height, type.width, map, false, false);\n this.type = type;\n }", "public Item(int id, String name, int quantity, double price, Supplier supplier){\r\n toolId = id;\r\n toolName = name;\r\n toolQuantity = quantity;\r\n toolPrice = price;\r\n toolSupplier = supplier;\r\n }", "public Tool(String itemId, Manufacturer manufacturer, String description,Category category,String stock, ToolStatus toolStatus, BigDecimal rentPrice) {\n this.itemId = itemId;\n this.manufacturer = manufacturer;\n this.description = description;\n this.category = category;\n this.stock = stock;\n this.toolStatus = toolStatus;\n this.rentPrice = rentPrice;\n }", "public ToolButton createToolButton(String path, String toolName, Tool tool);", "ToolType(String name, int sprite) {\n\t\tthis.name = name; // adds the name\n\t\tthis.sprite = sprite; // adds the sprite location number\n\t}", "public void setTool(Tool t) {\n\ttool = t;\n }", "public Tool() {\n initComponents();\n }", "protected ToolButton createToolButton(String iconName, String toolName, Tool tool) {\n return new ToolButton(this, iconName, toolName, tool);\n }", "public ToolButton createToolButton(Icon icon, Icon selectedIcon,\n String toolName, Tool tool);", "private Tool createTool(ToolType toolType, String toolCode, String brand) {\n double dailyPrice;\n boolean wkdChg;\n boolean holChg;\n\n if(toolType == ToolType.LADDER) {\n dailyPrice = LADDER_PRICE;\n wkdChg = LADDER_WKD_FREE;\n holChg = LADDER_HOL_FREE;\n } else if(toolType == ToolType.CHAINSAW) {\n dailyPrice = CHAINSAW_PRICE;\n wkdChg = CHAINSAW_WKD_FREE;\n holChg = CHAINSAW_HOL_FREE;\n } else {\n dailyPrice = JACKHAMMER_PRICE;\n wkdChg = JACKHAMMER_WKD_FREE;\n holChg = JACKHAMMER_HOL_FREE;\n }\n\n Tool tool = new Tool(toolType, toolCode, brand, dailyPrice, wkdChg, holChg);\n\n return tool;\n }", "public Tool tool(int paramInt) {\r\n\t\treturn new Tool(LeapJNI.Hand_tool(this.swigCPtr, this, paramInt), true);\r\n\t}", "public final int getToolID() {\n return toolID;\n }", "public Tool tool() {\n return fTool;\n }", "public Tool getTool() {\n\treturn tool;\n }", "protected Tool createSelectionTool() {\n return new SelectionTool(view());\n }", "public PathwayCommonsAccessTool() {\n super(PC_NAME, PC_RESOURCEID, PC_STRUCTURE);\n try {\n this.getToolResource().setResourceURL(new URL(PC_URL));\n this.getToolResource().setResourceLogo(new URL(PC_LOGO));\n this.getToolResource().setResourceElementURL(PC_ELT_URL);\n } catch (MalformedURLException e) {\n e.printStackTrace();\n }\n this.getToolResource().setResourceDescription(PC_DESCRIPTION);\n }", "public tool() {\n initComponents();\n }", "public void setToolname(String toolname) {\r\n this.toolname = toolname;\r\n }", "public ToolBar(final Map<PaintTool, ToolAction> theMap, \n final List<PaintTool> theTools,\n final JFrame theFrame,\n final DrawingPanel thePanel) { \n\n myToolBar = new JToolBar();\n createToolButtons(theMap, theTools, theFrame);\n createUndoAndRedo(thePanel);\n myBar = theFrame.getJMenuBar();\n myBar.addPropertyChangeListener(this);\n myPcs = new PropertyChangeSupport(this);\n }", "public String getTool() {\n\t\treturn tool;\n\t}", "@Override\n\tpublic String getToolName() {\n\t\treturn name;\n\t}", "public Tool getToolObject(String toolClassString) throws UnknownToolException, ClassNotFoundException, InstantiationException, IllegalAccessException {\n Tool toolObject = null;\n\n // try and get the tool from the toolsCache / if the tool is not cached yet\n if ((toolObject = toolsCache.get(toolClassString)) == null)\n {\n // if the tool wasn't in the cache, load it with the classLoader\n Class toolClass = classLoader.loadClass(toolClassString);\n // create a new Tool instance\n toolObject = (Tool) toolClass.newInstance();\n // put the tool into the toolsCache for future re-use\n toolsCache.put(toolClassString, toolObject);\n }\n\n // return the Tool object\n return toolObject;\n }", "void setActiveTool(int tool) {\n this.activeTool = tool;\n }", "public String getToolname() {\r\n return toolname;\r\n }", "public OvalTool(DrawContext context, String name, String icon) {\n\t\tsuper(context, name, icon);\n\t}", "public TeamBuildTool(String name) {\n team = new Team(name);\n run();\n }", "public MakeCPMLEditableTool(){\n\t}", "public void toolAdded(ToolGroupEvent evt) {\n SimpleTool tool = (SimpleTool)evt.getChild();\n addToolButton(tool, tool.getToolID());\n }", "private void addToolButton(Tool tool, String toolId) {\n \n String iconPath = tool.getIcon();\n\n // create the button\n JToolButton button = getToggleButton(tool, toolId);\n \n // disable if it is loading\n button.setLoaded(false);\n \n // add to the data maps\n toolIdToButtonMap.put(toolId, button);\n urlToButtonMap.put(iconPath, button);\n toolIdToToolMap.put(toolId, tool);\n\n // put the proxy image in place\n if (tool instanceof ToolGroup && !(tool instanceof ToolSwitch)) {\n \n // create the necessary icons for button state\n generateButtonIcons(button, folderImage); \n \n // allow selection\n button.setLoaded(true);\n button.addItemListener(this);\n\n } else {\n \n // set count failures to 0\n loadFailureCounts.put(iconPath, 0);\n \n String category = tool.getCategory(); \n if (category != null && !category.equals(\"Category.Loading\")) {\n \n // check the cache for the resource\n if (clientCache.doesAssetExist(iconPath)) {\n \n // call the resource loaded directly\n try {\n InputStream resourceStream =\n clientCache.retrieveAsset(iconPath);\n resourceLoaded(iconPath, resourceStream);\n } catch (IOException io) {\n errorReporter.errorReport(io.getMessage(), io);\n } \n \n } else {\n \n // now try to lazy load the actual image\n resourceLoader.loadResource(iconPath, this);\n \n }\n \n } else {\n \n // set the loading image\n button.setIcon(loadingImage);\n\n }\n\n }\n\n revalidate();\n \n }", "public AssetCreationToolEntry(String label, String shortDesc, Object template, CreationFactory factory, ImageDescriptor iconSmall, ImageDescriptor iconLarge)\n {\n super(label, shortDesc, template, factory, iconSmall, iconLarge);\n }", "public void setToolnum(String toolnum) {\r\n this.toolnum = toolnum;\r\n }", "public interface ITool extends IBuildObject, IHoldsOptions {\n\t// Schema element names\n\tpublic static final String COMMAND = \"command\";\t//$NON-NLS-1$\n\tpublic static final String COMMAND_LINE_PATTERN = \"commandLinePattern\"; //$NON-NLS-1$\n\tpublic static final String COMMAND_LINE_GENERATOR = \"commandLineGenerator\"; //$NON-NLS-1$\n\tpublic static final String DEP_CALC_ID =\"dependencyCalculator\"; //$NON-NLS-1$\n\tpublic static final String INTERFACE_EXTS = \"headerExtensions\";\t//$NON-NLS-1$\n\tpublic static final String NATURE =\t\"natureFilter\";\t//$NON-NLS-1$\n\tpublic static final String OUTPUT_FLAG = \"outputFlag\";\t//$NON-NLS-1$\n\tpublic static final String INPUT_TYPE = \"inputType\";\t//$NON-NLS-1$\n\tpublic static final String OUTPUT_TYPE = \"outputType\";\t//$NON-NLS-1$\n\tpublic static final String OUTPUT_PREFIX = \"outputPrefix\";\t//$NON-NLS-1$\n\tpublic static final String OUTPUTS = \"outputs\";\t//$NON-NLS-1$\n\tpublic static final String SOURCES = \"sources\";\t//$NON-NLS-1$\n\tpublic static final String ADVANCED_INPUT_CATEGORY = \"advancedInputCategory\";\t//$NON-NLS-1$\n\tpublic static final String CUSTOM_BUILD_STEP = \"customBuildStep\";\t//$NON-NLS-1$\n\tpublic static final String ANNOUNCEMENT = \"announcement\";\t//$NON-NLS-1$\n\tpublic static final String TOOL_ELEMENT_NAME = \"tool\";\t//$NON-NLS-1$\n\tpublic static final String WHITE_SPACE = \" \";\t//$NON-NLS-1$\n\tpublic static final String EMPTY_STRING = \"\";\t//$NON-NLS-1$\n\tpublic static final String IS_SYSTEM = \"isSystem\";\t\t\t\t\t\t\t//$NON-NLS-1$\n\t\n\tpublic static final String VERSIONS_SUPPORTED = \"versionsSupported\";\t//$NON-NLS-1$\n\tpublic static final String CONVERT_TO_ID = \"convertToId\";\t\t\t\t//$NON-NLS-1$\n\tpublic static final String OPTIONPATHCONVERTER = \"optionPathConverter\";\t\t\t\t//$NON-NLS-1$\n\t\n\tpublic static final String SUPPORTS_MANAGED_BUILD = \"supportsManagedBuild\"; //$NON-NLS-1$\n\t\n\n\tpublic static final int FILTER_C = 0;\n\tpublic static final int FILTER_CC = 1;\n\tpublic static final int FILTER_BOTH = 2;\n\n\t/**\n\t * Returns the tool-chain or resource configuration that is the parent of this tool.\n\t * \n\t * @return IBuildObject\n\t */\n\tpublic IBuildObject getParent();\n\n\t/**\n\t * Creates a child InputType for this tool.\n\t * \n\t * @param InputType The superClass, if any\n\t * @param String The id for the new InputType \n\t * @param String The name for the new InputType\n\t * @param boolean Indicates whether this is an extension element or a managed project element\n\t * \n\t * @return IInputType\n\t * @since 3.0\n\t */\n\tpublic IInputType createInputType(IInputType superClass, String Id, String name, boolean isExtensionElement);\n\n\t/**\n\t * Removes an InputType from the tool's list.\n\t * \n\t * @param type\n\t * @since 3.0\n\t */\n\tpublic void removeInputType(IInputType type);\n\t\n\t/**\n\t * Returns the complete list of input types that are available for this tool.\n\t * The list is a merging of the input types specified for this tool with the \n\t * input types of its superclasses. The lowest input type instance in the hierarchy\n\t * takes precedence. \n\t * \n\t * @return IInputType[]\n\t * @since 3.0\n\t */\n\tpublic IInputType[] getInputTypes();\n\n\t/**\n\t * Returns the <code>IInputType</code> in the tool with the specified \n\t * ID. This is an efficient search in the receiver.\n\t * \n\t * <p>If the receiver does not have an InputType with that ID, the method \n\t * returns <code>null</code>. It is the responsibility of the caller to \n\t * verify the return value. \n\t * \n\t * @param id unique identifier of the InputType to search for\n\t * @return <code>IInputType</code>\n\t * @since 3.0\n\t */\n\tpublic IInputType getInputTypeById(String id);\n\n\t/**\n\t * Returns the <code>IInputType</code> in the tool that uses the \n\t * specified extension.\n\t * \n\t * <p>If the receiver does not have an InputType that uses the extension, \n\t * the method returns <code>null</code>. It is the responsibility of the \n\t * caller to verify the return value. \n\t * \n\t * @param inputExtension File extension\n\t * @return <code>IInputType</code>\n\t * @since 3.0\n\t */\n\tpublic IInputType getInputType(String inputExtension);\n\n\t/**\n\t * Returns the primary <code>IInputType</code> in this tool\n\t * \n\t * <p>If the receiver has no InputTypes, \n\t * the method returns <code>null</code>. It is the responsibility of the \n\t * caller to verify the return value. \n\t * \n\t * @return <code>IInputType</code>\n\t * @since 3.0\n\t */\n\tpublic IInputType getPrimaryInputType();\n\n\t/**\n\t * Returns all of the additional input resources of all InputType children.\n\t * Note: This does not include the primary InputType and does not include\n\t * additional dependencies.\n\t * \n\t * @return IPath[]\n\t */\n\tpublic IPath[] getAdditionalResources();\n\n\t/**\n\t * Returns all of the additional dependency resources of all InputType children.\n\t * Note: This does not include the primary InputType and does not include \n\t * additional inputs.\n\t * \n\t * @return IPath[]\n\t */\n\tpublic IPath[] getAdditionalDependencies();\n\n\t/**\n\t * Creates a child OutputType for this tool.\n\t * \n\t * @param OutputType The superClass, if any\n\t * @param String The id for the new OutputType \n\t * @param String The name for the new OutputType\n\t * @param boolean Indicates whether this is an extension element or a managed project element\n\t * \n\t * @return IOutputType\n\t * @since 3.0\n\t */\n\tpublic IOutputType createOutputType(IOutputType superClass, String Id, String name, boolean isExtensionElement);\n\n\t/**\n\t * Removes an OutputType from the tool's list.\n\t * \n\t * @param type\n\t * @since 3.0\n\t */\n\tpublic void removeOutputType(IOutputType type);\n\t\n\t/**\n\t * Returns the complete list of output types that are available for this tool.\n\t * The list is a merging of the output types specified for this tool with the \n\t * output types of its superclasses. The lowest output type instance in the hierarchy\n\t * takes precedence. \n\t * \n\t * @return IOutputType[]\n\t * @since 3.0\n\t */\n\tpublic IOutputType[] getOutputTypes();\n\t/**\n\t * Get the <code>IOutputType</code> in the receiver with the specified \n\t * ID. This is an efficient search in the receiver.\n\t * \n\t * <p>If the receiver does not have an OutputType with that ID, the method \n\t * returns <code>null</code>. It is the responsibility of the caller to \n\t * verify the return value. \n\t * \n\t * @param id unique identifier of the OutputType to search for\n\t * @return <code>IOutputType</code>\n\t * @since 3.0\n\t */\n\tpublic IOutputType getOutputTypeById(String id);\n\n\t/**\n\t * Returns the <code>IOutputType</code> in the tool that creates the \n\t * specified extension.\n\t * \n\t * <p>If the receiver does not have an OutputType that creates the extension, \n\t * the method returns <code>null</code>. It is the responsibility of the \n\t * caller to verify the return value. \n\t * \n\t * @param outputExtension File extension\n\t * @return <code>IOutputType</code>\n\t * @since 3.0\n\t */\n\tpublic IOutputType getOutputType(String outputExtension);\n\n\t/**\n\t * Returns the primary <code>IOutputType</code> in this tool\n\t * \n\t * <p>If the receiver has no OutputTypes, \n\t * the method returns <code>null</code>. It is the responsibility of the \n\t * caller to verify the return value. \n\t * \n\t * @return <code>IOutputType</code>\n\t * @since 3.0\n\t */\n\tpublic IOutputType getPrimaryOutputType();\n\n\t/**\n\t * Returns the <code>ITool</code> that is the superclass of this\n\t * tool, or <code>null</code> if the attribute was not specified.\n\t * \n\t * @return ITool\n\t */\n\tpublic ITool getSuperClass();\n\t\n\t/**\n\t * Returns whether this element is abstract. Returns <code>false</code>\n\t * if the attribute was not specified.\n\t * @return boolean \n\t */\n\tpublic boolean isAbstract();\n\n\t/**\n\t * Sets the isAbstract attribute of the tool-chain. \n\t * \n\t * @param b\n\t */\n\tpublic void setIsAbstract(boolean b);\n\t\n\t/**\n\t * Returns a semi-colon delimited list of child Ids of the superclass'\n\t * children that should not be automatically inherited by this element.\n\t * Returns an empty string if the attribute was not specified. \n\t * @return String \n\t */\n\tpublic String getUnusedChildren();\n\n\t/**\n\t * Returns the semicolon separated list of unique IDs of the error parsers associated\n\t * with the tool.\n\t * \n\t * @return String\n\t */\n\tpublic String getErrorParserIds();\n\n\t/**\n\t * Returns the ordered list of unique IDs of the error parsers associated with the \n\t * tool.\n\t * \n\t * @return String[]\n\t */\n\tpublic String[] getErrorParserList();\n\n\t/**\n\t * Sets the semicolon separated list of error parser ids\n\t * \n\t * @param ids\n\t */\n\tpublic void setErrorParserIds(String ids);\n\t\n\t/**\n\t * Returns the list of valid source extensions this tool knows how to build.\n\t * The list may be empty but will never be <code>null</code>.\n\t * \n\t * @return List\n\t * @deprecated - use getPrimaryInputExtensions or getAllInputExtensions\n\t */\n\tpublic List getInputExtensions();\n\t\n\t/**\n\t * Returns the array of valid primary source extensions this tool knows how to build.\n\t * The array may be empty but will never be <code>null</code>.\n\t * \n\t * @return String[]\n\t */\n\tpublic String[] getPrimaryInputExtensions();\n\t\n\t/**\n\t * Returns the array of all valid source extensions this tool knows how to build.\n\t * The array may be empty but will never be <code>null</code>.\n\t * \n\t * @return String[]\n\t */\n\tpublic String[] getAllInputExtensions();\n\t\n\t/**\n\t * Returns the default input extension for the primary input of the tool\n\t * \n\t * @return String\n\t */\n\tpublic String getDefaultInputExtension();\n\t\n\t/**\n\t * Returns the array of all valid dependency extensions for this tool's inputs.\n\t * The array may be empty but will never be <code>null</code>.\n\t * \n\t * @return String[]\n\t */\n\tpublic String[] getAllDependencyExtensions();\n\t\n\t/**\n\t * Returns the list of valid header extensions for this tool.\n\t * Returns the value of the headerExtensions attribute\n\t * The list may be empty but will never be <code>null</code>.\n\t * \n\t * @return List\n\t * @deprecated - use getDependency* methods\n\t */\n\tpublic List getInterfaceExtensions();\n\n\t/**\n\t * Answers a constant corresponding to the project nature the tool should be used \n\t * for. Possible answers are:\n\t * \n\t * <dl>\n\t * <dt>ITool.FILTER_C\n\t * <dd>The tool should only be displayed for C projects. <i>Notes:</i> even \n\t * though a C++ project has a C nature, this flag will mask the tool for C++ \n\t * projects. \n\t * <dt>ITool.FILTER_CC\n\t * <dd>The tool should only be displayed for C++ projects.\n\t * <dt>ITool.FILTER_BOTH\n\t * <dd>The tool should be displayed for projects with both natures.\n\t * </dl>\n\t * \n\t * @return int\n\t */\n\tpublic int getNatureFilter();\n\t\n\t/**\n\t * Returns the array of all valid output extensions this tool can create.\n\t * The array may be empty but will never be <code>null</code>.\n\t * \n\t * @return String[]\n\t */\n\tpublic String[] getAllOutputExtensions();\n\t\n\t/**\n\t * Answers all of the output extensions that the receiver can build.\n\t * This routine returns the value if the outputs attribute.\n\t * \n\t * @return <code>String[]</code> of extensions\n\t * @deprecated - use getAllOutputExtensions\n\t */\n\tpublic String[] getOutputExtensions();\n\t\n\t/**\n\t * Answers all of the output extensions that the receiver can build,\n\t * from the value of the outputs attribute\n\t * \n\t * @return <code>String[]</code> of extensions\n\t */\n\tpublic String[] getOutputsAttribute();\n\t\n\t/**\n\t * Answer the output extension the receiver will create from the input, \n\t * or <code>null</code> if the tool does not understand that extension.\n\t * \n\t * @param inputExtension The extension of the source file. \n\t * @return String\n\t */\n\tpublic String getOutputExtension(String inputExtension);\n\t\n\t/**\n\t * Sets all of the output extensions that the receiver can build,\n\t * into the outputs attribute. Note that the outputs attribute is\n\t * ignored when one or more outputTypes are specified. \n\t * \n\t * @param String\n\t */\n\tpublic void setOutputsAttribute(String extensions);\n\t\n\t/**\n\t * Answers the argument that must be passed to a specific tool in order to \n\t * control the name of the output artifact. For example, the GCC compile and \n\t * linker use '-o', while the archiver does not. \n\t * \n\t * @return String\n\t */\n\tpublic String getOutputFlag();\n\t\n\t/**\n\t * Sets the argument that must be passed to a specific tool in order to \n\t * control the name of the output artifact. For example, the GCC compile and \n\t * linker use '-o', while the archiver does not. \n\t * \n\t * @param String\n\t */\n\tpublic void setOutputFlag(String flag);\n\n\t/**\n\t * Answers the prefix that the tool should prepend to the name of the build artifact.\n\t * For example, a librarian usually prepends 'lib' to the target.a\n\t * @return String\n\t */\n\tpublic String getOutputPrefix();\n\n\t/**\n\t * Sets the prefix that the tool should prepend to the name of the build artifact.\n\t * For example, a librarian usually prepends 'lib' to the target.a\n\t * @param String\n\t * @see {@link #setOutputPrefixForPrimaryOutput(String)} \n\t */\n\tpublic void setOutputPrefix(String prefix);\n\t\n\tpublic void setOutputPrefixForPrimaryOutput(String prefix);\n\t\n\t/**\n\t * Returns <code>true</code> if the Tool wants the MBS to display the Advanced \n\t * Input category that allows the user to specify additional input resources and\n\t * dependencies, else <code>false</code>.\n\t * \n\t * @return boolean \n\t */\n\tpublic boolean getAdvancedInputCategory();\n\t\n\t/**\n\t * Sets whether the Tool wants the MBS to display the Advanced \n\t * Input category that allows the user to specify additional input resources and\n\t * dependencies. \n\t * \n\t * @param display \n\t */\n\tpublic void setAdvancedInputCategory(boolean display);\n\t\n\t/**\n\t * Returns <code>true</code> if the Tool represents a user-define custom build\n\t * step, else <code>false</code>.\n\t * \n\t * @return boolean \n\t */\n\tpublic boolean getCustomBuildStep();\n\t\n\t/**\n\t * Sets whether the Tool represents a user-define custom build step.\n\t * \n\t * @param customBuildStep\n\t */\n\tpublic void setCustomBuildStep(boolean customBuildStep);\n\t\n\t/**\n\t * Returns the announcement string for this tool \n\t * @return String\n\t */\n\tpublic String getAnnouncement();\n\t\n\t/**\n\t * Sets the announcement string for this tool \n\t * @param announcement\n\t */\n\tpublic void setAnnouncement(String announcement);\n\t\n\t/**\n\t * Answers the command-line invocation defined for the receiver.\n\t * \n\t * @return String\n\t */\n\tpublic String getToolCommand();\n\t\n\t/**\n\t * Sets the command-line invocation command defined for this tool.\n\t * \n\t * @param String\n\t * \n\t * @return boolean if <code>true</code>, then the tool command was modified \n\t */\n\tpublic boolean setToolCommand(String command);\n\t\n\t/**\n\t * Returns command line pattern for this tool \n\t * @return String\n\t */\n\tpublic String getCommandLinePattern();\n\t\n\t/**\n\t * Sets the command line pattern for this tool \n\t * @param String\n\t */\n\tpublic void setCommandLinePattern(String pattern);\n\t\n\t/**\n\t * Returns the plugin.xml element of the commandLineGenerator extension or <code>null</code> if none. \n\t * \n\t * @return IConfigurationElement\n\t * \n\t * @deprecated - use getCommandLineGenerator\n\t */\n\tpublic IConfigurationElement getCommandLineGeneratorElement();\n\t\n\t/**\n\t * Sets the CommandLineGenerator plugin.xml element\n\t * \n\t * @param element\n\t * @deprecated\n\t */\n\tpublic void setCommandLineGeneratorElement(IConfigurationElement element);\n\t\n\t/**\n\t * Returns the command line generator specified for this tool\n\t * @return IManagedCommandLineGenerator\n\t */\n\tpublic IManagedCommandLineGenerator getCommandLineGenerator();\n\t\n\t/**\n\t * Returns the plugin.xml element of the dependencyGenerator extension or <code>null</code> if none. \n\t * \n\t * @return IConfigurationElement\n\t * @deprecated - use getDependencyGeneratorForExtension or IInputType#getDependencyGenerator method\n\t */\n\tpublic IConfigurationElement getDependencyGeneratorElement();\n\t\n\t/**\n\t * Sets the DependencyGenerator plugin.xml element\n\t * \n\t * @param element\n\t * @deprecated \n\t */\n\tpublic void setDependencyGeneratorElement(IConfigurationElement element);\n\t\n\t/**\n\t * Returns a class instance that implements an interface to generate \n\t * source-level dependencies for the tool specified in the argument. \n\t * This method may return <code>null</code> in which case, the receiver \n\t * should assume that the tool does not require dependency information \n\t * when the project is built.\n\t *\n\t * @return IManagedDependencyGenerator\n\t * @deprecated - use getDependencyGeneratorForExtension or IInputType method\n\t */\n\tpublic IManagedDependencyGenerator getDependencyGenerator();\n\t\n\t/**\n\t * Returns a class instance that implements an interface to generate \n\t * source-level dependencies for the tool specified in the argument. \n\t * This method may return <code>null</code> in which case, the receiver \n\t * should assume that the tool does not require dependency information \n\t * when the project is built.\n\t *\n\t * @param sourceExt source file extension\n\t * @return IManagedDependencyGeneratorType\n\t */\n\tpublic IManagedDependencyGeneratorType getDependencyGeneratorForExtension(String sourceExt);\n\t\n\t/**\n\t * Returns an array of command line arguments that have been specified for\n\t * the tool.\n\t * The flags contain build macros resolved to the makefile format.\n\t * That is if a user has chosen to expand all macros in the buildfile,\n\t * the flags contain all macro references resolved, otherwise, if a user has \n\t * chosen to keep the environment build macros unresolved, the flags contain\n\t * the environment macro references converted to the buildfile variable format,\n\t * all other macro references are resolved \n\t * \n\t * @return String[]\n\t * @throws BuildException\n\t * \n\t * @deprecated - use getToolCommandFlags instead\n\t */\n\tpublic String[] getCommandFlags() throws BuildException;\n\t\n\t/**\n\t * Returns the command line arguments that have been specified for\n\t * the tool.\n\t * The string contains build macros resolved to the makefile format.\n\t * That is if a user has chosen to expand all macros in the buildfile,\n\t * the string contains all macro references resolved, otherwise, if a user has \n\t * chosen to keep the environment build macros unresolved, the string contains\n\t * the environment macro references converted to the buildfile variable format,\n\t * all other macro references are resolved \n\t * \n\t * @return String\n\t * \n\t * @deprecated - use getToolCommandFlagsString instead\n\t */\n\tpublic String getToolFlags() throws BuildException ;\n\t\n\t/**\n\t * Returns an array of command line arguments that have been specified for\n\t * the tool.\n\t * The flags contain build macros resolved to the makefile format.\n\t * That is if a user has chosen to expand all macros in the buildfile,\n\t * the flags contain all macro references resolved, otherwise, if a user has \n\t * chosen to keep the environment build macros unresolved, the flags contain\n\t * the environment macro references converted to the buildfile variable format,\n\t * all other macro references are resolved \n\t * \n\t * @param inputFileLocation\n\t * @param outputFileLocation\n\t * @return\n\t * @throws BuildException\n\t */\n\tpublic String[] getToolCommandFlags(IPath inputFileLocation, IPath outputFileLocation) throws BuildException;\n\t\n\t/**\n\t * Returns the command line arguments that have been specified for\n\t * the tool.\n\t * The string contains build macros resolved to the makefile format.\n\t * That is if a user has chosen to expand all macros in the buildfile,\n\t * the string contains all macro references resolved, otherwise, if a user has \n\t * chosen to keep the environment build macros unresolved, the string contains\n\t * the environment macro references converted to the buildfile variable format,\n\t * all other macro references are resolved \n\t * \n\t * @param inputFileLocation\n\t * @param outputFileLocation\n\t * @return\n\t * @throws BuildException\n\t */\n\tpublic String getToolCommandFlagsString(IPath inputFileLocation, IPath outputFileLocation) throws BuildException;\n\n\t/**\n\t * Options are organized into categories for UI purposes.\n\t * These categories are organized into a tree. This is the root\n\t * of that tree.\n\t * \n\t * @return IOptionCategory\n\t */\n\tpublic IOptionCategory getTopOptionCategory(); \n\n\t/**\n\t * Return <code>true</code> if the receiver builds files with the\n\t * specified extension, else <code>false</code>.\n\t * \n\t * @param extension file extension of the source\n\t * @return boolean\n\t */\n\tpublic boolean buildsFileType(String extension);\n\n\t/**\n\t * Return <code>true</code> if the receiver uses files with the\n\t * specified extension as input, else <code>false</code>. This\n\t * returns true for a superset of the extensions that buildFileType\n\t * returns true for - it includes secondary inputs.\n\t * \n\t * @param extension file extension of the source\n\t * @return boolean\n\t */\n\tpublic boolean isInputFileType(String extension);\n\t\n\t/**\n\t * Answers <code>true</code> if the tool considers the file extension to be \n\t * one associated with a header file.\n\t * \n\t * @param ext file extension of the source\n\t * @return boolean\n\t */\n\tpublic boolean isHeaderFile(String ext);\n\n\t/**\n\t * Answers <code>true</code> if the receiver builds a file with the extension specified\n\t * in the argument, else <code>false</code>.\n\t * \n\t * @param outputExtension extension of the file being produced by a tool\n\t * @return boolean\n\t */\n\tpublic boolean producesFileType(String outputExtension);\n\n\t/**\n\t * Returns <code>true</code> if this tool has changes that need to \n\t * be saved in the project file, else <code>false</code>.\n\t * \n\t * @return boolean \n\t */\n\tpublic boolean isDirty();\n\t\n\t/**\n\t * Sets the element's \"dirty\" (have I been modified?) flag.\n\t * \n\t * @param isDirty\n\t */\n\tpublic void setDirty(boolean isDirty);\n\t\n\t/**\n\t * Returns <code>true</code> if this tool was loaded from a manifest file,\n\t * and <code>false</code> if it was loaded from a project (.cdtbuild) file.\n\t * \n\t * @return boolean \n\t */\n\tpublic boolean isExtensionElement();\n\t\n\t/**\n\t * Returns the 'versionsSupported' of this tool\n\t * \n\t * @return String\n\t */\n\tpublic String getVersionsSupported();\n\t\n\t/**\n\t * Returns the 'convertToId' of this tool\n\t * \n\t * @return String\n\t */\n\tpublic String getConvertToId();\n\n\t/**\n\t * Sets the 'versionsSupported' attribute of the tool. \n\t * \n\t * @param versionsSupported\n\t */\t\n\tpublic void setVersionsSupported(String versionsSupported);\n\t\n\t/**\n\t * Sets the 'convertToId' attribute of the tool. \n\t * \n\t * @param convertToId\n\t */\n\tpublic void setConvertToId(String convertToId);\n\t\n\t/**\n\t * Returns an array of the Environment Build Path variable descriptors\n\t * \n\t * @return IEnvVarBuildPath[]\n\t */\n\tpublic IEnvVarBuildPath[] getEnvVarBuildPaths();\n\t\n\t/**\n\t * Returns an IOptionPathConverter implementation for this tool\n\t * or null, if no conversion is required\n\t */\n\tpublic IOptionPathConverter getOptionPathConverter() ;\n\t\n\tCLanguageData getCLanguageData(IInputType type);\n\t\n\tCLanguageData[] getCLanguageDatas();\n\t\n\tIInputType getInputTypeForCLanguageData(CLanguageData data);\n\t\n\tIResourceInfo getParentResourceInfo();\n\t\n/*\tIInputType setSourceContentTypeIds(IInputType type, String[] ids);\n\n\tIInputType setHeaderContentTypeIds(IInputType type, String[] ids);\n\t\n\tIInputType setSourceExtensionsAttribute(IInputType type, String[] extensions);\n\n\tIInputType setHeaderExtensionsAttribute(IInputType type, String[] extensions);\n*/\n\tIInputType getEditableInputType(IInputType base);\n\t\n\tIOutputType getEditableOutputType(IOutputType base);\n\t\n\tboolean isEnabled();\n\t\n//\tboolean isReal();\n\t\n\tboolean supportsBuild(boolean managed);\n\t\n\tboolean matches(ITool tool);\n\t\n\tboolean isSystemObject();\n\t\n\tString getUniqueRealName();\n}", "public static LinkTool getTool()\n {\n if (singleton == null) {\n // new Throwable(\"Warning: LinkTool.getTool: class not initialized by VUE\").printStackTrace();\n new LinkTool();\n }\n return singleton;\n }", "public SelectMapTool() {\n this.setName(\"select\");\n this.setToolTip(\"Selecting features.\");\n eventListeners = new EventListenerList();\n super.setMapIcon(MapImages.get(\"Select32.png\").orElse(null));\n }", "public TouchTool(IResourceChangeEditor editor, ISelection selection) {\n\tmEditor = editor;\n\tmCamera = editor.getCamera();\n\tmWorld = editor.getWorld();\n\tmInvoker = editor.getInvoker();\n\tmSelection = selection;\n}", "public UtilityToolUsedEvent(UtilityTool toolUsed, Point locationUsed) {\n super(toolUsed);\n this.locationUsed = locationUsed;\n }", "public OldToolInfo(String key, Class clazz)\n {\n super(key, clazz);\n }", "public ToolsMenu() {\n\t\tsuper(\"Tools\");\n\t}", "public CommandLineTool getCommandLineToolInstance() {\n \treturn COMMAND_LINE_TOOL;\n }", "public ToolImpl(Color fgColor, Integer startX, Integer startY, Integer endX, Integer endY) {\n\t\tsuper();\n\t\tthis.startX = startX;\n\t\tthis.startY = startY;\n\t\tthis.endX = endX;\n\t\tthis.endY = endY;\n\t\tthis.fgColor = fgColor;\n\t}", "public ToolBar(final List<AbstractAction> theToolActions) {\n super();\n myToolActions = theToolActions;\n\n setupButtons();\n\n }", "public void setTooltypeid(String tooltypeid) {\r\n this.tooltypeid = tooltypeid;\r\n }", "public ToolPenProvider()\r\n {\r\n super(\"Pen2\", \"/icons/tools/pen.png\", \"/manual/tools/pen.html\");\r\n }", "public Customer(int id, String name, int age, String address) {\r\n super(id, name, age, address);\r\n }", "public void setToolparam(String toolparam) {\r\n this.toolparam = toolparam;\r\n }", "public MEKeyTool() {\n keystore = new PublicKeyStoreBuilderBase();\n }", "public void setAdornmentTool(Tool tool) {\n\t\tthis.renderingTool = tool;\n\t}", "public String getTooltypeid() {\r\n return tooltypeid;\r\n }", "public String getToolnum() {\r\n return toolnum;\r\n }", "public ToolItem (ToolBar parent, int style) {\r\n\tthis(parent, style, parent.getItemCount ());\r\n}", "public YelpTool() {\n initComponents();\n }", "protected Tool() {\n\n\t\t// A hacky way of automatically registering it AFTER the parent constructor, assuming all went okay\n\t\tnew Thread(() -> {\n\n\t\t\ttry {\n\t\t\t\tThread.sleep(3);\n\t\t\t} catch (final InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t\tfinal Tool instance = Tool.this;\n\n\t\t\tif (!isRegistered(instance))\n\t\t\t\tregister(instance);\n\t\t}).start();\n\t}", "public void setToolheadid(String toolheadid) {\r\n this.toolheadid = toolheadid;\r\n }", "public String getTooltype() {\r\n return tooltype;\r\n }", "private JToolButton getToggleButton(Tool tool, String toolId) {\n String name = tool.getName();\n JToolButton button = new JToolButton(name, tool instanceof ToolGroup);\n\n String displayName = name;\n // wrap the title\n if (!name.startsWith(\"<html>\")) {\n displayName = \"<html><div align='center'>\" + name + \"</div></html>\";\n }\n\n if (displayHoverover) {\n String hoveroverText = generateHoverover(tool);\n button.setToolTipText(hoveroverText);\n }\n \n button.setPreferredSize(\n new Dimension(\n iconSize.width, \n iconSize.height + TEXT_SPACE_SIZE));\n \n button.setBorderPainted(true);\n button.setBorder(BorderFactory.createEmptyBorder(0 ,0, 0, 0));\n button.setContentAreaFilled(false);\n\n button.setRolloverEnabled(true);\n button.setActionCommand(toolId);\n button.setText(displayName);\n button.setFont(FontColorUtils.getSmallFont());\n button.setVerticalTextPosition(AbstractButton.BOTTOM);\n button.setHorizontalTextPosition(AbstractButton.CENTER);\n button.setVerticalAlignment(AbstractButton.TOP);\n button.setHorizontalAlignment(AbstractButton.CENTER);\n button.setMargin(ICON_MARGIN);\n button.setEnabled(areEnabled);\n\n // assign the loading image\n buttonGroup.add(button);\n \n if (toolIdToButtonMap.containsKey(toolId)) {\n JToolButton tempButton = toolIdToButtonMap.get(toolId);\n remove(tempButton);\n buttonGroup.remove(tempButton);\n }\n add(button);\n\n return button;\n }", "public void setTooltype(String tooltype) {\r\n this.tooltype = tooltype;\r\n }", "public String getToolCommand();", "public ToolBridge createDirectBridge(ITool tool){\n\t\tDirectIOHandler toolBridgeIOHandler = new DirectIOHandler();\n\t\tDirectIOHandler busIOHandler = new DirectIOHandler();\n\t\t\n\t\ttoolBridgeIOHandler.setIOHandler(busIOHandler);\n\t\tbusIOHandler.setIOHandler(toolBridgeIOHandler);\n\n\t\tToolBridge toolBridge = new ToolBridge(tool);\n\t\ttoolBridge.setIOHandler(toolBridgeIOHandler);\n\t\ttoolBridgeIOHandler.setDataHandler(toolBridge);\n\t\t\n\t\tToolInstance toolInstance = new ToolInstance(busIOHandler);\n\t\tbusIOHandler.setDataHandler(toolInstance);\n\n\t\treturn toolBridge;\n\t}", "private Terrain(int id) {\n\t\tthis.id = id;\n\t}", "public String getToolheadid() {\r\n return toolheadid;\r\n }", "protected MenuTools(final Menu parent) {\r\n\t\tsuper(parent);\r\n\r\n\t\tthis.tools = this.compile0(this.compileTools());\r\n\r\n\t\tfinal int items = this.tools.size();\r\n\t\tfinal int pages = items < 9 ? 9 * 1 : items < 9 * 2 ? 9 * 2 : items < 9 * 3 ? 9 * 3 : items < 9 * 4 ? 9 * 4 : 9 * 5;\r\n\r\n\t\tthis.setSize(pages);\r\n\t\tthis.setTitle(SimpleLocalization.Menu.TITLE_TOOLS);\r\n\t}", "public Command (int id, String name) {\n if (commands[id] != null) {\n\n } else {\n commands[id] = this;\n this.name = name;\n System.out.println(\"[Command Initialization] Command \" + name + \" successfully initialized with id \"\n + id + \" and allowable arguments:\" /*allowable args will be printed here.*/);\n }\n }", "public ToolTips (String imageName)\r\n\t{\r\n\t\tthis.imageName = imageName;\r\n\t}", "public ToolList tools() {\r\n\t\treturn new ToolList(LeapJNI.Hand_tools(this.swigCPtr, this), true);\r\n\t}", "public ServiceAction(IElementManager manager, SystemID systemID, String name) {\r\n\t\tsuper(BaseUI.getText(UI_TEXT), BaseUI.getDescriptor(BaseUI.IMAGE_SERVICE));\r\n\t\tthis.manager = manager;\r\n\t\tthis.systemID = systemID;\r\n\t\tthis.name = name;\r\n\t}", "public void setToolfilename(String toolfilename) {\r\n this.toolfilename = toolfilename;\r\n }", "public void addToolListener(ToolListener listener, String toolEvent) {\n\t\t//do nothing\n\t}", "public void setToolteamid(String toolteamid) {\r\n this.toolteamid = toolteamid;\r\n }", "public int getToolFlag() {\r\n return toolFlag;\r\n }", "public ToolImpl(Color fgColor) {\n\t\tthis(fgColor, null, null, null, null);\n\t}", "public ToolbarInfo(Map<String, TacticUIInfo> globalRegistry,\n\t\t\tMap<String, DropdownInfo> dropdownRegistry,\n\t\t\tMap<String, DynamicDropdownInfo> dynDropdownRegistry, String id) {\n\t\tsuper(id);\n\t\tthis.globalRegistry = globalRegistry;\n\t\tthis.dropdownRegistry = dropdownRegistry;\n\t\tthis.dynDropdownRegistry = dynDropdownRegistry;\n\t}", "public GPFrame(String title, PaintTool gp) {\r\n super(title); // call the constructor of the super class\r\n initGUI(width, height); // initialize the GUI\r\n gra = getGraphics(); // get the Graphics object\r\n ge = gp; // set the reference to the tool\r\n System.out.println(\"calling method init() of the tool.\");\r\n ge.init(gra); // initialize the paint tool\r\n System.out.println(\"method init() of the tool executed.\");\r\n }", "public void setTooldeptid(String tooldeptid) {\r\n this.tooldeptid = tooldeptid;\r\n }", "public static interface OnToolListener {\n\n\t\t/**\n\t\t * On tool completed.\n\t\t */\n\t\tvoid onToolCompleted();\n\t}", "public void setTool(final Tool theTool) {\n removeMouseListener(myCurrentTool);\n removeMouseMotionListener(myCurrentTool);\n myCurrentTool = theTool;\n addMouseListener(myCurrentTool);\n addMouseMotionListener(myCurrentTool);\n }", "public TeamBuildTool(Team team) {\n this.team = team;\n run();\n }", "public Paint getTool(){\n return this.tool;\n }", "public Service(int title, int id) {\n mTitle = title;\n mId = id;\n }", "@GET\r\n @Path(\"/{id}\")\r\n @Produces(MediaType.APPLICATION_JSON)\r\n public Tool getInstrument(@PathParam(\"id\") Integer id) {\r\n return dao.findById(id);\r\n }", "public Component createNewToolItem() {\r\n Button button = new Button();\r\n gwtToolbarItem.addClasses(button);\r\n button.addStyleName(\"action-bar-tool-item\");\r\n return button;\r\n }", "public PencilTool() {\n super();\n myPencil = new Path2D.Double(); \n }", "private void addToolsAndCommands() {\n this.selectTargetCadastreObjectTool\n = new CadastreChangeSelectCadastreObjectTool(this.getPojoDataAccess());\n this.selectTargetCadastreObjectTool.setTargetParcelsLayer(targetParcelsLayer);\n this.selectTargetCadastreObjectTool.setCadastreObjectType(CadastreObjectTypeBean.CODE_PARCEL);\n this.getMap().addTool(this.selectTargetCadastreObjectTool, this.getToolbar(), true);\n }", "public void setOnToolListener( final OnToolListener listener ) {\n\t\tmToolListener = listener;\n\t}", "public ToolItem (ToolBar parent, int style, int index) {\r\n\tsuper (parent, checkStyle (style));\r\n\tthis.parent = parent;\r\n\tparent.createItem (this, index);\r\n}", "@Override\n\tpublic void addToolListener(ToolListener listener) {\n\t\t//do nothing\n\t}", "public Task(String id, String nameandpoints, String desc) {\n this.id = id;\n this.assignedMembers = new ArrayList<>();\n this.requiredSkills = new ArrayList<>();\n nameandpoints.trim();\n if (nameandpoints.startsWith(\"(\")) {\n try {\n this.name = nameandpoints.substring(4);\n String temp = nameandpoints.substring(1, 2);\n this.storyPoints = Integer.parseInt(temp);\n } catch (Exception e) {\n System.out.println(e.getMessage());\n this.name = nameandpoints;\n this.storyPoints = 0;\n }\n } else {\n this.name = nameandpoints;\n }\n\n if (!desc.isEmpty()) {\n if (desc.contains(\"Required Skills\")) {\n try {\n String skills = desc.substring(desc.lastIndexOf(\":\") + 1);\n addRequiredSkill(skills);\n System.out.println(requiredSkills);\n this.description = desc.substring(0, desc.indexOf(\"Required\"));\n } catch (Exception e) {\n Log.e(\"Task Creation\", \"Not expected format for desc in Task: \" + name);\n }\n } else this.description = desc;\n }\n\n }", "@Override\n public Tool insert(String id, Tool tool) {\n Tool existingTool = selectByCode(tool.getCode());\n\n if(existingTool == null) {\n Firestore dbFirestore = FirestoreClient.getFirestore();\n ApiFuture<WriteResult> collectionApiFuture = dbFirestore.collection(collection).document(id).set(tool);\n\n try {\n collectionApiFuture.get();\n if (collectionApiFuture.isDone()) {\n return tool;\n }\n } catch (InterruptedException | ExecutionException e) {\n e.printStackTrace();\n }\n }\n\n return existingTool;\n }", "static synchronized void register(Tool tool) {\n\t\tValid.checkBoolean(!isRegistered(tool), \"Tool with itemstack \" + tool.getItem() + \" already registered\");\n\n\t\ttools.add(tool);\n\t}", "private JadTool() { }", "public Tower(String name, int cost, TowerAttack attack) {\n this.name = name;\n this.cost = cost;\n this.attack = attack;\n this.active = false;\n this.sprite = GameApp.getAssetManager().get(this.name + \".png\", Texture.class);\n }", "public static void main(String[] args) {\n Tool<Student2> tool = new Tool<Student2>();\n tool.setObject(new Student2());\n Student2 stu = tool.getObject();\n\n }", "public void toolUpdated(ToolGroupEvent evt) { \n \n Tool tool = (Tool)evt.getChild();\n String toolId = tool.getToolID();\n \n if (toolIdToToolMap.containsKey(toolId)) {\n toolIdToToolMap.put(toolId, tool);\n }\n \n // get the button to update\n JToolButton button = toolIdToButtonMap.get(toolId);\n \n // update the hover-over if necessary\n String desc = tool.getDescription();\n if (displayHoverover && desc != null && !desc.equals(\"\")) {\n \n // create the hoverover and re-assign it\n String hoveroverText = generateHoverover(tool);\n button.setToolTipText(hoveroverText);\n \n }\n\n //\n // now request the icon if necessary\n //\n Boolean hiddenTool =\n (Boolean)tool.getProperty(\n Entity.DEFAULT_ENTITY_PROPERTIES,\n ChefX3DRuleProperties.HIDE_IN_CATALOG);\n \n if (hiddenTool == null || !hiddenTool) {\n \n String iconPath = tool.getIcon();\n \n // check the cache for the resource\n if (clientCache.doesAssetExist(iconPath)) {\n \n // call the resource loaded directly\n try {\n InputStream resourceStream =\n clientCache.retrieveAsset(iconPath);\n resourceLoaded(iconPath, resourceStream);\n } catch (IOException io) {\n errorReporter.errorReport(io.getMessage(), io);\n } \n \n } else {\n \n // now try to lazy load the actual image\n resourceLoader.loadResource(iconPath, this);\n \n }\n \n }\n\n }", "public void setToolStatus(ToolStatus toolStatus) {\n this.toolStatus = toolStatus;\n }", "public Tower(String name) {\n this.name = name;\n }", "public List<Tool> getTool(Object toolData);", "public Hotel(int hotelId, String name, String address, double price, boolean pool, boolean gym, boolean bar,\n\t\t\tboolean pets, int stars, String imgPath) {\n\t\tthis.hotelId = hotelId;\n\t\tthis.name = name;\n\t\tthis.address = address;\n\t\tthis.price = price;\n\t\tthis.pool = pool;\n\t\tthis.gym = gym;\n\t\tthis.bar = bar;\n\t\tthis.pets = pets;\n\t\tthis.stars = stars;\n\t\tthis.imgPath = imgPath;\n\n\t}", "public ToDoTask(String description, int id) {\n super(description, id);\n }", "public Person(String name, String address, String aadharId) {\n this.name = name;\n this.address = address;\n this.aadharId = aadharId;\n }" ]
[ "0.87245524", "0.68196845", "0.67322236", "0.66434664", "0.6410892", "0.6295353", "0.62906104", "0.6250516", "0.61368597", "0.60325086", "0.60082203", "0.59568864", "0.58454007", "0.56759095", "0.5656111", "0.5649883", "0.5647584", "0.56289405", "0.55551225", "0.5485484", "0.5472231", "0.54573804", "0.54560596", "0.54198664", "0.5408104", "0.53892326", "0.5385002", "0.5374244", "0.5362598", "0.53511024", "0.53447056", "0.5299559", "0.5271186", "0.5239037", "0.5210031", "0.519846", "0.51817566", "0.51807135", "0.5161286", "0.51231974", "0.51123947", "0.50750184", "0.5074579", "0.5072043", "0.5056075", "0.5034723", "0.5021202", "0.50172937", "0.50169396", "0.5003167", "0.49977297", "0.4996418", "0.49933606", "0.49932665", "0.49772373", "0.4954726", "0.49519658", "0.49426368", "0.4941794", "0.48961854", "0.48888946", "0.4859041", "0.48466653", "0.48424003", "0.48330817", "0.48226973", "0.48144165", "0.48133087", "0.48117968", "0.4803497", "0.48000076", "0.4794091", "0.47908536", "0.4784706", "0.47816765", "0.4779722", "0.4771774", "0.4769984", "0.47667822", "0.4756142", "0.47532904", "0.47513935", "0.4747069", "0.4739504", "0.47343883", "0.47291577", "0.47188938", "0.47177747", "0.4715178", "0.47098038", "0.4706158", "0.46946824", "0.4692989", "0.46916163", "0.46905026", "0.46855888", "0.46775928", "0.4669236", "0.46692097", "0.466244" ]
0.7898373
1
Gets the name of the calling Tool object.
public String getName() { return name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic String getToolName() {\n\t\treturn name;\n\t}", "public String getToolname() {\r\n return toolname;\r\n }", "String getExternalToolName();", "public String getTool() {\n\t\treturn tool;\n\t}", "String getCaller();", "private String getCallerInfo() {\n Optional<StackWalker.StackFrame> frame = new CallerFinder().get();\n if (frame.isPresent()) {\n return frame.get().getClassName() + \" \" + frame.get().getMethodName();\n } else {\n return name;\n }\n }", "public String getName() {\r\n \treturn this.getClass().getName();\r\n }", "public String getToolfilename() {\r\n return toolfilename;\r\n }", "public String getName() {\n return Utility.getInstance().getPackageName();\n }", "public Tool getTool() {\n\treturn tool;\n }", "public String getName() {\r\n if (target != null) {\r\n return target.getName();\r\n }\r\n\r\n if (benchmark != null) {\r\n return benchmark.getName();\r\n }\r\n\r\n return \"\";\r\n }", "public final String getName() {\n /// Since we plan to have only one wizard for each class, we use the name of the class.\n return this.getClass().getSimpleName();\n }", "public String getName() {\n // defaults to class name\n String className = getClass().getName();\n return className.substring(className.lastIndexOf(\".\")+1);\n }", "public Tool tool() {\n return fTool;\n }", "public String getToolCommand();", "public String getContext() {\n\t\treturn this.getClass().getSimpleName();\n\t}", "public String getProgramName()\r\n \t{\r\n \t\treturn m_program.m_csSimpleName;\r\n \t}", "public Tool getCurrentTool() {\n return fCurrTool;\n }", "public String getName() {\n return nameRule.getMethodName();\n }", "public final int getToolID() {\n return toolID;\n }", "String getObjectName();", "public String getToolhead() {\r\n return toolhead;\r\n }", "public String getName() {\n\t\treturn this.toString();\n\t}", "public String getToolparam() {\r\n return toolparam;\r\n }", "public String getName ()\n {\n if (__name == null)\n {\n __name = getName (getClass ());\n }\n return __name;\n }", "public Tool getActiveTool()\n {\n return GametableFrame.getGametableFrame().getGametableCanvas().getActiveTool();\n }", "public String getTooltypeid() {\r\n return tooltypeid;\r\n }", "public java.lang.String getCallingNameGenericString() {\r\n return callingNameGenericString;\r\n }", "public String getToolisuse() {\r\n return toolisuse;\r\n }", "default String getCheckName() {\n return getClass().getSimpleName();\n }", "public String getToolnum() {\r\n return toolnum;\r\n }", "default public String strandInfo() {\n\t\treturn this.getClass().getName();\n\t}", "@Override\n public String getName() {\n return this.getClass().getSimpleName();\n }", "public static String getName() {\n\t\treturn ProjectMain._name;\n\t}", "private String toolType() {\n\t\tfor (int toolId : mTools) {\n\t\t\tif (toolId == 267) return \"swords\";\n\t\t\tif (toolId == 292) return \"hoes\";\n\t\t\tif (toolId == 258) return \"axes\";\n\t\t\tif (toolId == 270) return \"pickaxes\";\n\t\t\tif (toolId == 257) return \"most picks\";\n\t\t\tif (toolId == 278) return \"high picks\";\n\t\t\tif (toolId == 256) return \"shovels\";\n\t\t}\n\t\treturn \"any tool\";\n\t}", "@Override\n public String getName() {\n return getSoftwareSystem().getName() + \" - System Context\";\n }", "public String getFullName() {\n return getAndroidPackage() + \"/\" + getInstrumentationClass();\n }", "public String getName() {\r\n return this.name();\r\n }", "public void setToolname(String toolname) {\r\n this.toolname = toolname;\r\n }", "private String getName() {\n return method.getName();\n }", "java.lang.String getInstanceName();", "public static String getCurrentClassName(){\n\t\tString s2 = Thread.currentThread().getStackTrace()[2].getClassName();\n// System.out.println(\"s0=\"+s0+\" s1=\"+s1+\" s2=\"+s2);\n\t\t//s0=java.lang.Thread s1=g1.tool.Tool s2=g1.TRocketmq1Application\n\t\treturn s2;\n\t}", "String getOutputName();", "public String getName()\n {\n return m_functionName;\n }", "public String name() {\n this.use();\n\n return name;\n }", "public String getTooltype() {\r\n return tooltype;\r\n }", "public String getCheckpointName() {\n\t\tfor(FreeVar current : specification.getBindings())\n\t\t{\n\t\t\tif(current.isBound())\n\t\t\t{\n\t\t\t\treturn getTopLevelType(current.binding());\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public final String getName() {\n if (name == null) {\n name = this.getClass().getSimpleName().substring(3);\n }\n return name;\n }", "public String getToolheadid() {\r\n return toolheadid;\r\n }", "@Override\n\tpublic java.lang.String getName() {\n\t\treturn _scienceApp.getName();\n\t}", "public String getName() {\n if (name == null && !nameExplicitlySet) {\n synchronized(this) {\n if (name == null && !nameExplicitlySet)\n name = constructComponentName();\n }\n }\n return name;\n }", "public String getName()\n {\n return underlyingClass.getName();\n }", "public String getName() {\n\t\tSharedPreferences settings = parentContext.getSharedPreferences(PREFERENCE_FILE,\n\t\t\t\tContext.MODE_PRIVATE);\n\t\treturn settings.getString(USERNAME_KEY, null);\n\t}", "public String getTypeName()\n {\n return getArgumentTypeName(type);\n }", "@Override\n\tpublic String getSymbolName()\n\t{\n\t\tVariableDeclarationContext ctx = getContext();\n\t\tNameContextExt nameContextExt = (NameContextExt)getExtendedContext(ctx.name());\n\t\treturn nameContextExt.getFormattedText();\n\t}", "public String getName() {\n return instance.getName();\n }", "String getManagerName();", "public java.lang.String getName();", "public static String getCurrentMethodName() {\n\t\tStackTraceElement stackTraceElements[] = (new Throwable()).getStackTrace();\n\t\tString fullString = stackTraceElements[1].toString();\n\t\tint stringEnd = fullString.indexOf('(');\n\t\tString fullName = fullString.substring(0, stringEnd);\n\t\tint start = fullName.lastIndexOf('.') + 1;\n\t\tString methodName = fullName.substring(start);\n\n\t\treturn methodName;\n\t}", "public String getTooldept() {\r\n return tooldept;\r\n }", "public String getToolString() {\r\n\t\treturn Utility.convertTo4Byte(ScoolConstants.NEW_WHITEBOARD_ACTION);\r\n\t}", "public static String getName() {\n return name;\n }", "public String getStartName() {// TODO remove\n\t\treturn this.getClass().getSimpleName();\n\t}", "public String getClassName() {\n\t\tString tmp = methodBase();\n\t\treturn tmp.substring(0, 1).toUpperCase()+tmp.substring(1);\n\t}", "public static String getCurrentMethodName() {\n Exception e = new Exception();\n StackTraceElement trace = e.fillInStackTrace().getStackTrace()[1];\n String name = trace.getMethodName();\n String className = trace.getClassName();\n int line = trace.getLineNumber();\n return \"[CLASS:\" + className + \" - METHOD:\" + name + \" LINE:\" + line + \"]\";\n }", "public String getNamehint() {\n return namehint;\n }", "@Override()\n public String getToolName()\n {\n return \"ldap-debugger\";\n }", "public String getName() {\n return instance.getName();\n }", "public String getName() {\n return instance.getName();\n }", "public String getName() {\n return instance.getName();\n }", "public String getName() {\r\n return getDef().getName();\r\n }", "public String getName() {\n\t\tfinal String submitterName = getSubmitterName();\n\t\tif (submitterName != null)\n\t\t\treturn ProteomeXchangeFilev2_1.MTD + TAB + \"submitter_name\" + TAB + submitterName;\n\t\treturn null;\n\t}", "protected String getName() {\n return testClass.getName();\n }", "public String getName() {\n\t\treturn JWLC.nativeHandler().wlc_output_get_name(this.to());\n\t}", "public Token getName()\n {\n if (isVersion())\n {\n return getVersion();\n }\n\n return getModule();\n }", "public String getName() {\r\n\t\treturn GDAssemblerUI.getText(UI_TEXT);\r\n\t}", "public String getToolteam() {\r\n return toolteam;\r\n }", "public String getToolfilepath() {\r\n return toolfilepath;\r\n }", "public String getName() {\n\t\treturn \"Object class name\";\n\t}", "public String getScriptName() {\n if (scriptName != null) {\n return scriptName;\n }\n\n String contextPath = getContextPath();\n if (contextPath == null) contextPath = \"\";\n return scriptName = contextPath.equals(\"/\") ? \"\" : contextPath;\n }", "public String getName()\r\n\t{\r\n\t\treturn name; // gives the value of the name to the caller\r\n\t}", "public String getName() {\n return DecoratedSortAlgo.getName();\r\n }", "public static String getCurrentMethodName(){\n\t\tString s2 = Thread.currentThread().getStackTrace()[2].getMethodName();\n// System.out.println(\"s0=\"+s0+\" s1=\"+s1+\" s2=\"+s2);\n\t\t//s0=getStackTrace s1=getCurrentMethodName s2=run\n\t\treturn s2;\n\t}", "public String getSystemName();", "String intermediateSystemName();", "@Override\n public String getName() {\n return getDeclaringClass().getName();\n }", "public CommandLineTool getCommandLineToolInstance() {\n \treturn COMMAND_LINE_TOOL;\n }", "public String getName()\r\n \t{\n \t\treturn (explicit ? (module.length() > 0 ? module + \"`\" : \"\") : \"\")\r\n \t\t\t\t+ name + (old ? \"~\" : \"\"); // NB. No qualifier\r\n \t}", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();", "String getName();" ]
[ "0.78951424", "0.753847", "0.74989617", "0.6997794", "0.6948702", "0.67201436", "0.6561952", "0.65463775", "0.64122534", "0.6404652", "0.6339101", "0.63288796", "0.6327682", "0.63194656", "0.6314043", "0.6308235", "0.6244645", "0.6222359", "0.6200541", "0.6193324", "0.61861163", "0.616696", "0.6132843", "0.61185455", "0.6110989", "0.60822296", "0.6081074", "0.60632104", "0.6055568", "0.60544705", "0.6045855", "0.6044571", "0.60418904", "0.6034255", "0.60049134", "0.59835976", "0.59536076", "0.5948774", "0.5939622", "0.5935796", "0.593082", "0.5915396", "0.59151226", "0.5910427", "0.59098995", "0.5899059", "0.5890481", "0.588313", "0.5877795", "0.5850062", "0.58424664", "0.58384436", "0.5831549", "0.5831474", "0.58208203", "0.58056575", "0.5801354", "0.5796829", "0.5794111", "0.5790766", "0.5788729", "0.57877773", "0.5784421", "0.57837594", "0.5755125", "0.5751055", "0.574829", "0.5738442", "0.5738442", "0.5738442", "0.5736375", "0.5728584", "0.57278883", "0.57277703", "0.5724425", "0.57155883", "0.56846", "0.56825036", "0.56771994", "0.5673281", "0.5671942", "0.56637913", "0.5662559", "0.5660964", "0.5660845", "0.56607574", "0.56576747", "0.5656911", "0.5656705", "0.5656705", "0.5656705", "0.5656705", "0.5656705", "0.5656705", "0.5656705", "0.5656705", "0.5656705", "0.5656705", "0.5656705", "0.5656705", "0.5656705" ]
0.0
-1
Sets the name of the calling Tool object.
public void setName(String name) { this.name = name; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic String getToolName() {\n\t\treturn name;\n\t}", "public void setToolname(String toolname) {\r\n this.toolname = toolname;\r\n }", "@Override\n\tpublic void setToolName(String typeName) throws PropertyVetoException {\n\t\tname = typeName;\n\t}", "public void setName(String name) {\n setUserProperty(\"ant.project.name\", name);\n this.name = name;\n }", "public String getToolname() {\r\n return toolname;\r\n }", "private void setName(java.lang.String name) {\n System.out.println(\"setting name \"+name);\n this.name = name;\n }", "public final void setName(java.lang.String name)\r\n\t{\r\n\t\tsetName(getContext(), name);\r\n\t}", "public final void setName(java.lang.String name)\n\t{\n\t\tsetName(getContext(), name);\n\t}", "public final void setName(String name) {_name = name;}", "public void setName(String name) {\n this.name = name; // assigning a local variable value to a global variable\r\n }", "void setName(String name_);", "public void setName(String name) {\n\t\tName = name;\n\t}", "@Override\n\tpublic void setName(String arg0) {\n\n\t}", "@Override\n\tpublic void setName(String name) {\n\t\theldObj.setName(name);\n\t}", "public void setName() {\r\n\t\tapplianceName = \"Refrigerator\";\r\n\t}", "public void setName(String name) {\n this.name = name;\n }", "public void setName(String name) { this.name = name; }", "public void setName(String name) { this.name = name; }", "public void setName(String name) { this.name = name; }", "public void setName(String name) { this.name = name; }", "@Override\r\n public void setName(String name) {\n }", "private void setName() {\n\t\t//MAKE SURE NOT TO GET ACCIDENTAL RECURSION HERE\n\t\t//DO NOT JUST MAKE A NEW TRIAD AND COMPARE TO CURRENT TRIAD\n\t\t//UNLESS ??? MAYBEDON\"T PUT SET NAME IN THE CONSTRUCTOR?\n\t\t//SIMILAR PROBLEM TO SETINVERSION\n\t\t\n\t\t//major, minor, diminished, augmented\n\t\t//this.name = name;\n\t}", "void setName(String name) {\r\n this.name = name;\r\n }", "public void setName(String name){\r\n this.name = name;\r\n }", "public void setName(String name){\r\n this.name = name;\r\n }", "public void setName(String name){\r\n this.name = name;\r\n }", "public void setName(String Name){\r\n name = Name;\r\n }", "@Override\n public void setName(String name) {\n \n }", "public void setName(String name) \n {\n this.name = name;\n }", "public void setName(String name) {\r\n this.name = name;\r\n }", "public void setName(String name) {\r\n this.name = name;\r\n }", "public void setName(String name) {\r\n this.name = name;\r\n }", "@Override\n\tpublic void setName(java.lang.String name) {\n\t\t_scienceApp.setName(name);\n\t}", "public void setName(String name);", "public void setName(String name);", "public void setName(String name);", "public void setName(String name);", "public void setName(String name);", "public void setName(String name);", "public void setName(String name);", "public void setName(String name);", "public void setName(String name);", "public void setName(String name);", "public void setName(String name);", "void setName(String name) {\n this.name = name;\n }", "public void setName(String name){\n this.name = name;\n }", "public void setName(String name){\n this.name = name;\n }", "public void setName(String name){\n this.name = name;\n }", "public void setName(String name){\n this.name = name;\n }", "public void setName(String name){\n this.name = name;\n }", "public void setName(String name){\n this.name = name;\n }", "public void setName(String name){\n this.name = name;\n }", "void setName(String name) {\n this.name = name;\n }", "protected void setName(String name) {\r\n this.name = name;\r\n }", "@Override\n\tpublic void setName(String name) {\n\t\t\n\t}", "public void setName(String name) {\r\n this.name = name;\r\n }", "public void setName(String name) {\r\n this.name = name;\r\n }", "public void setName(String name) {\r\n this.name = name;\r\n }", "public void setName(String name) {\r\n this.name = name;\r\n }", "public void setName(String name) {\r\n this.name = name;\r\n }", "public void setName(String name) {\r\n this.name = name;\r\n }", "public void setName(String name) {\r\n this.name = name;\r\n }", "public void setName(String name) {\r\n this.name = name;\r\n }", "public void setName(String name) {\r\n this.name = name;\r\n }", "public void setName(String name) {\r\n this.name = name;\r\n }", "public void setName(String name) {\r\n this.name = name;\r\n }", "public void setName(String name) {\r\n this.name = name;\r\n }", "public void setName(String name) {\r\n this.name = name;\r\n }", "public void setName(String name) {\r\n this.name = name;\r\n }", "public void setName(String name) {\r\n this.name = name;\r\n }", "public void setName(String name) {\r\n this.name = name;\r\n }", "public void setName(String name) {\r\n this.name = name;\r\n }", "public void setName(String name) {\r\n this.name = name;\r\n }", "public void setName(String name) {\r\n this.name = name;\r\n }", "public void setName(String name){\r\n\t\tthis.name = name;\r\n\t}", "public void setName(String name){\r\n\t\tthis.name = name;\r\n\t}", "public void setName(String name){\r\n\t\tthis.name = name;\r\n\t}", "void setName(String name);", "void setName(String name);", "void setName(String name);", "void setName(String name);", "void setName(String name);", "void setName(String name);", "void setName(java.lang.String name);", "void setName(java.lang.String name);", "void setName(java.lang.String name);", "@Override\n\tpublic void setName(String name) {\n\t\tsuper.setName(name);\n\t}", "@Override\n\tpublic void setName(String name) {\n\t\tsuper.setName(name);\n\t}", "public void setName (String Name);", "public void setName (String Name);", "public void setName (String Name);", "public void setName(String name) {\n this.name = name;\n }", "public void setName(String name) {\n this.name = name;\n }", "public void setName(String name) {\n this.name = name;\n }", "public void setName(String name) {\n this.name = name;\n }", "public void setName(String name) {\n this.name = name;\n }", "public void setName(String name) {\n this.name = name;\n }", "public void setName(String name) {\n this.name = name;\n }", "public void setName(String name) {\n this.name = name;\n }", "public void setName(String name) {\n this.name = name;\n }", "public void setName(String name) {\n this.name = name;\n }" ]
[ "0.73928803", "0.71717966", "0.7070622", "0.67208326", "0.6718637", "0.6604227", "0.6544306", "0.65293574", "0.64088035", "0.63936824", "0.6315861", "0.6314227", "0.6309426", "0.6290062", "0.62643445", "0.6263724", "0.626106", "0.626106", "0.626106", "0.626106", "0.62588906", "0.625715", "0.6249136", "0.6247092", "0.6247092", "0.6247092", "0.62461597", "0.624221", "0.6239388", "0.6232516", "0.6232516", "0.6232516", "0.6223962", "0.62164724", "0.62164724", "0.62164724", "0.62164724", "0.62164724", "0.62164724", "0.62164724", "0.62164724", "0.62164724", "0.62164724", "0.62164724", "0.6216192", "0.62144166", "0.62144166", "0.62144166", "0.62144166", "0.62144166", "0.62144166", "0.62144166", "0.621282", "0.62072825", "0.62050396", "0.62031204", "0.62031204", "0.62031204", "0.62031204", "0.62031204", "0.62031204", "0.62031204", "0.62031204", "0.62031204", "0.62031204", "0.62031204", "0.62031204", "0.62031204", "0.62031204", "0.62031204", "0.62031204", "0.62031204", "0.62031204", "0.62031204", "0.62026054", "0.62026054", "0.62026054", "0.6193856", "0.6193856", "0.6193856", "0.6193856", "0.6193856", "0.6193856", "0.6184003", "0.6184003", "0.6184003", "0.61832553", "0.61832553", "0.6182407", "0.6182407", "0.6182407", "0.6177453", "0.6177453", "0.6177453", "0.6177453", "0.6177453", "0.6177453", "0.6177453", "0.6177453", "0.6177453", "0.6177453" ]
0.0
-1
Gets the ID of the calling Tool object.
public String getId() { return id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final int getToolID() {\n return toolID;\n }", "String getProgramId();", "public String getTool() {\n\t\treturn tool;\n\t}", "public String getToolheadid() {\r\n return toolheadid;\r\n }", "public String getTooltypeid() {\r\n return tooltypeid;\r\n }", "public String getCallIdentifier() {\n return callIdHeader.getCallId();\n }", "public String getToolteamid() {\r\n return toolteamid;\r\n }", "public String getProgramId() {\n return pathsProvider.getProgramId();\n }", "public Integer getProgramId();", "public int getId() {\n return parameter.getId();\n }", "public String getCallId();", "public Tool getTool() {\n\treturn tool;\n }", "public Tool getCurrentTool() {\n return fCurrTool;\n }", "public long getId() {\n\t\treturn getTo(true).getId();\n\t}", "public String getToolnum() {\r\n return toolnum;\r\n }", "String getCaller();", "public String getId() {\n return this.getClass().getSimpleName() + \"@\" + this.hashCode();\n }", "@Override\n\tpublic String[] myToolIds() {\n\t\tString[] toolIds = { \"sakai.gcalendar\" };\n\t\treturn toolIds;\n\t}", "public Tool tool() {\n return fTool;\n }", "public Tool getActiveTool()\n {\n return GametableFrame.getGametableFrame().getGametableCanvas().getActiveTool();\n }", "String getContextId();", "public String getId() {\n\t\treturn Integer.toString(this.hashCode());\n\t}", "public String getUniqueId() {\n return getCurrentInstance().getViewRoot().createUniqueId();\n }", "public long getTraceId() {\n\t\treturn this.traceInformation.getTraceId();\n\t}", "public int getIndexTool() {\r\n return indexTool;\r\n }", "public String getToolname() {\r\n return toolname;\r\n }", "public String getToolparam() {\r\n return toolparam;\r\n }", "public int getId() {\n\t\treturn this.ordinal();\n\t}", "public static String id()\n {\n return _id;\n }", "@Override\n\tpublic String getToolName() {\n\t\treturn name;\n\t}", "public long getId() {\n return mServiceId;\n }", "public int getId() {\n\t\treturn ID;\n\t}", "long getSourceId();", "public String getToolId(){\n\t\treturn \"sakai.gcalendar\";\t\t\n\t}", "public java.lang.CharSequence getContextId() {\n return contextId;\n }", "public java.lang.CharSequence getContextId() {\n return contextId;\n }", "public int getId() {\n return instance.getId();\n }", "public Object getId() {\n return id;\n }", "public Object getId() {\n return id;\n }", "public int getMakerId();", "ExperimenterId getExperimenterId();", "public int getIdentifier();", "public int getId() {\n return instance.getId();\n }", "@Override\n\tpublic String getId() {\n\t\tString pName = ctx.getCallerPrincipal().getName();\n\t\tPerson p = userEJB.findPerson(pName);\n\t\tString id = p.getId()+\"\";\n\t\treturn id;\n\t\t\n\t}", "String getSourceID();", "public WindowID getIdentifier()\n {\n return ExportedWindow.CHAT_WINDOW;\n }", "public String getTooldeptid() {\r\n return tooldeptid;\r\n }", "public int getId() {\n\t\t\treturn id_;\n\t\t}", "public int getId() {\n\t\t\treturn id_;\n\t\t}", "final protected int getId() {\n\t\treturn id;\n\t}", "public String getIdentifier();", "public String getIdentifier();", "public int getId() {\n return m_module.getConfiguration().getId();\n }", "public String getId() {\n\t\treturn this.token.get(\"id\").toString();\n\t}", "String getExternalToolName();", "@Override\n\tpublic int getId() {\n\t\treturn delegate.getId();\n\t}", "public String getProductToolsInforId() {\n return productToolsInforId;\n }", "private int getId() {\r\n\t\treturn id;\r\n\t}", "@Override\n\tpublic String getCanvasID() {\n\t\treturn getID();\n\t}", "public int getCallId() {\n return this.mCallId;\n }", "public long getId() {\r\n\t\treturn id;\r\n\t}", "public long getId() {\r\n\t\treturn id;\r\n\t}", "public long getId() {\r\n\t\treturn id;\r\n\t}", "public long getId() {\r\n\t\treturn id;\r\n\t}", "public long getId() {\r\n\t\treturn id;\r\n\t}", "public long getId() {\r\n\t\treturn id;\r\n\t}", "public int getId() {\n\t\t\t\treturn id_;\n\t\t\t}", "public int getId() {\n\t\t\t\treturn id_;\n\t\t\t}", "public final long getId() {\r\n return id;\r\n }", "public String getId() {\n return _theId;\n }", "public long getId() {\n\t\treturn id;\n\t}", "public long getId() {\n\t\treturn id;\n\t}", "public long getId() {\n\t\treturn id;\n\t}", "public long getId() {\n\t\treturn id;\n\t}", "public long getId() {\n\t\treturn id;\n\t}", "public long getId() {\n\t\treturn id;\n\t}", "public long getId() {\n\t\treturn id;\n\t}", "public long getId() {\n\t\treturn id;\n\t}", "public long getId() {\n\t\treturn id;\n\t}", "public long getId() {\n\t\treturn id;\n\t}", "public long getId() {\n\t\treturn id;\n\t}", "public long getId() {\n\t\treturn id;\n\t}", "public long getId() {\n\t\treturn id;\n\t}", "public long getId() {\n\t\treturn id;\n\t}", "public long getId() {\n\t\treturn id;\n\t}", "public long getId() {\n\t\treturn id;\n\t}", "public long getId() {\n\t\treturn id;\n\t}", "public long getId() {\n\t\treturn id;\n\t}", "public long getId() {\n\t\treturn id;\n\t}", "public long getId() {\n\t\treturn id;\n\t}", "public long getId() {\n\t\treturn id;\n\t}", "long getJobIDSource();", "public int getId() {\n return id_;\n }", "public int getId() {\n return id_;\n }", "public int getId() {\n return id_;\n }", "public int getId() {\n return id_;\n }", "public int getId() {\n return id_;\n }", "public int getId() {\n return id_;\n }", "public int getId() {\n return id_;\n }", "public int getId() {\n return id_;\n }", "public int getId() {\n return id_;\n }" ]
[ "0.767498", "0.633196", "0.6328105", "0.63269615", "0.62327206", "0.6222711", "0.62016404", "0.6191895", "0.6098798", "0.6076181", "0.6072372", "0.6039357", "0.603297", "0.60210764", "0.60051614", "0.59993446", "0.5961314", "0.5948712", "0.5946208", "0.5928065", "0.5906753", "0.58958054", "0.58878493", "0.5859379", "0.58377874", "0.581507", "0.58030087", "0.57694006", "0.5768337", "0.57407486", "0.57234246", "0.5719201", "0.57171017", "0.5714672", "0.5703819", "0.570203", "0.5701668", "0.56986505", "0.56986505", "0.5697256", "0.5691749", "0.5673231", "0.5661483", "0.5651465", "0.5651055", "0.564656", "0.5644731", "0.564364", "0.564364", "0.56407756", "0.5639713", "0.5639713", "0.5635745", "0.5620191", "0.5620159", "0.561478", "0.5611023", "0.5609988", "0.56090564", "0.5603664", "0.5602739", "0.5602739", "0.5602739", "0.5602739", "0.5602739", "0.5602739", "0.5602705", "0.5602705", "0.5601132", "0.5600574", "0.5598957", "0.5598957", "0.5598957", "0.5598957", "0.5598957", "0.5598957", "0.5598957", "0.5598957", "0.5598957", "0.5598957", "0.5598957", "0.5598957", "0.5598957", "0.5598957", "0.5598957", "0.5598957", "0.5598957", "0.5598957", "0.5598957", "0.5598957", "0.5598957", "0.5598487", "0.55952394", "0.55952394", "0.55952394", "0.55952394", "0.55952394", "0.55952394", "0.55952394", "0.55952394", "0.55952394" ]
0.0
-1
Sets the ID of the calling Tool object.
public void setId(String id) { this.id = id; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setID(Object caller, int id)\n\t{\n\t\tif (caller instanceof DriverManager)\n\t\t{\n\t\t\tdriverID = id;\n\t\t}\n\t}", "public final int getToolID() {\n return toolID;\n }", "void setActiveTool(int tool) {\n this.activeTool = tool;\n }", "public void setID(int id);", "public void setId(Object id) {\n this.id = id;\n }", "public void setId(Object id) {\n this.id = id;\n }", "void setId(int id) {\n this.id = id;\n }", "public void setID(int id){\n this.ID = id;\n }", "public void setId(String id) {\n this.ide = id;\n //System.out.println(\"linkyhandler setid \" + ide);\n }", "public void setID(long id);", "public Object setID(int iD)\r\n/* */ {\r\n\t\t\t\tlogger.info(count++ + \" About to setId : \" + \"Agent\");\r\n/* 51 */ \tthis.myID = iD;\r\n/* 52 */ \treturn this;\r\n/* */ }", "public void setID(int id){\n this.id=id;\n }", "void setId(int val);", "public void set_id(int ID)\n {\n id =ID;\n }", "public void setId(ID id){\r\n\t\tthis.id = id;\r\n\t}", "public void setId(String anId) {\n _theId = anId;\n }", "public void setId(ID id)\n {\n this.id = id;\n }", "public void setToolteamid(String toolteamid) {\r\n this.toolteamid = toolteamid;\r\n }", "public final native void setId(int id) /*-{\n\t\tthis.id = id;\n\t}-*/;", "public void setID(int id)\r\n {\r\n\tthis.id = id;\r\n }", "public void setId(int id){\r\n this.id = id;\r\n }", "public void setId (long id)\r\n {\r\n _id = id;\r\n }", "public void setTool(Tool t) {\n\ttool = t;\n }", "public void setID(String newID)\r\n {\r\n id=newID;\r\n }", "void setId(int id);", "public void setID(int id) {\n this.id = id;\n }", "void setId(ID id);", "public void setId(final int id);", "public void setId(int id) {\r\n this.id = id;\r\n }", "public void setId(int id) {\r\n this.id = id;\r\n }", "public void setId(int id) {\r\n this.id = id;\r\n }", "public void setId(int id) {\r\n this.id = id;\r\n }", "public void setidnumber(int id) {\r\n idnumber = id;\r\n }", "public void setId (int id) {\r\n\t\tthis.id=id;\r\n\t}", "public void setId(long id) {\r\n this.id = id;\r\n }", "public void setId(java.lang.String param) {\n localIdTracker = true;\n\n this.localId = param;\n }", "public void setId(java.lang.String param) {\n localIdTracker = true;\n\n this.localId = param;\n }", "public void setId(int id)\n {\n this.id = id;\n }", "public void setId(int id)\n {\n this.id = id;\n }", "public void setId(int id) {\n this.id = id;\n }", "public void setId(int id) {\n this.id = id;\n }", "public void setId(int id) {\n this.id = id;\n }", "public void setId(long id) {\n this.id = id;\n }", "public void setId(long id) {\n this.id = id;\n }", "public void setID(java.lang.String ID) { throw new RuntimeException(\"Stub!\"); }", "@Override\n public void setId(final long id) {\n super.setId(id);\n }", "public void setId(long id){\n this.id = id;\n }", "public void setId(long id){\n this.id = id;\n }", "public void setToolheadid(String toolheadid) {\r\n this.toolheadid = toolheadid;\r\n }", "public void setTool(final Tool theTool) {\n removeMouseListener(myCurrentTool);\n removeMouseMotionListener(myCurrentTool);\n myCurrentTool = theTool;\n addMouseListener(myCurrentTool);\n addMouseMotionListener(myCurrentTool);\n }", "@Override\n\tpublic void setTokeId(String arg0) {\n\t\t\n\t}", "public void setId(long id);", "public void setId(long id);", "public void setId(long id);", "public void setId(long id);", "public void setId(int param){\r\n \r\n // setting primitive attribute tracker to true\r\n localIdTracker =\r\n param != java.lang.Integer.MIN_VALUE;\r\n \r\n this.localId=param;\r\n \r\n\r\n }", "@Override\n\tpublic void setId(int id) {\n\t\tthis.ID = id;\n\t}", "private void setId(int value) {\n \n id_ = value;\n }", "public void setId(int id) { this.id = id; }", "public void setId(int id) { this.id = id; }", "public void setID(int ID)\r\n {\r\n this.ID = ID;\r\n }", "public void setID() {\n\t\tthis.ID = UUID.randomUUID().toString();\n\t}", "public void setID(int value) {\n this.id = value;\n }", "public abstract void setId(int id);", "public void setID(int id) {\r\n\t\tID = id;\r\n\t}", "public void setID(int id) {\r\n\t\tID = id;\r\n\t}", "public void setId(String id) {\n }", "private void setId(int value) {\n \n id_ = value;\n }", "public void setId(int value) {\r\n this.id = value;\r\n }", "public void setId(int id) {\n this.id = id;\n }", "public void setId(int id) {\n this.id = id;\n }", "public void setId(int id) {\n this.id = id;\n }", "public void setId(int id) {\n this.id = id;\n }", "public void setId(int id) {\n this.id = id;\n }", "public void setId(int id) {\n this.id = id;\n }", "public void setId(int id) {\n this.id = id;\n }", "public void setId(int id) {\n this.id = id;\n }", "public void setId(int id) {\n this.id = id;\n }", "public void setId(int id) {\n this.id = id;\n }", "public void setId(int id) {\n this.id = id;\n }", "public void setId(int id) {\n this.id = id;\n }", "public void setId(int id) {\n this.id = id;\n }", "public void setId(int id) {\n this.id = id;\n }", "public void setId(int id) {\n this.id = id;\n }", "public void setId(int id) {\n this.id = id;\n }", "public void setId(int id) {\n this.id = id;\n }", "public void setId(int id) {\n this.id = id;\n }", "public void setId(int id) {\n this.id = id;\n }", "public void setId(int id) {\n this.id = id;\n }", "public void setId(int id) {\n this.id = id;\n }", "public void setId(int id) {\n this.id = id;\n }", "public void setId(int id) {\n this.id = id;\n }", "public void setId(int id) {\n this.id = id;\n }", "public void setId(int id) {\n this.id = id;\n }", "public void setId(int id)\n {\n this.id=id;\n }", "public void setId(int id) {\n this.id = id;\n\t}", "public void setID(Number numID);", "public void setId(int id){ this.id = id; }", "public void setId(long id) { this.id = id; }", "public void setId(long id) { this.id = id; }", "public void setId(int id) {\n this.id = String.valueOf(this.hashCode());\n }" ]
[ "0.6827995", "0.62704396", "0.61221355", "0.6063555", "0.6041825", "0.6041825", "0.60391223", "0.6021619", "0.6012623", "0.5999103", "0.59721303", "0.5960448", "0.5918304", "0.59094936", "0.5904986", "0.59022516", "0.5898416", "0.58854395", "0.5879141", "0.58588415", "0.5857379", "0.58347243", "0.5831368", "0.58208436", "0.5809719", "0.58090806", "0.5807907", "0.5804974", "0.5801372", "0.5801372", "0.5801372", "0.5801372", "0.5795417", "0.578734", "0.5772377", "0.5769745", "0.5769745", "0.57695186", "0.57695186", "0.5766006", "0.5766006", "0.5766006", "0.5760099", "0.5760099", "0.5759121", "0.57565624", "0.57561165", "0.57561165", "0.5754268", "0.57537675", "0.5743358", "0.5738054", "0.5738054", "0.5738054", "0.5738054", "0.5735102", "0.5733147", "0.5731311", "0.572999", "0.572999", "0.57236224", "0.5723256", "0.57175106", "0.5712517", "0.57097363", "0.57097363", "0.57035786", "0.5703534", "0.5700591", "0.5699113", "0.5699113", "0.5699113", "0.5699113", "0.5699113", "0.5699113", "0.5699113", "0.5699113", "0.5699113", "0.5699113", "0.5699113", "0.5699113", "0.5699113", "0.5699113", "0.5699113", "0.5699113", "0.5699113", "0.5699113", "0.5699113", "0.5699113", "0.5699113", "0.5699113", "0.5699113", "0.5699113", "0.5699113", "0.56960374", "0.56928575", "0.56913936", "0.5689034", "0.56878465", "0.56878465", "0.5687788" ]
0.0
-1
Gets the toolbox address of the calling Tool object.
public String getAddress() { return address; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getExternalToolName();", "public String getTool() {\n\t\treturn tool;\n\t}", "public String getToolname() {\r\n return toolname;\r\n }", "public Tool getTool() {\n\treturn tool;\n }", "public Tool tool() {\n return fTool;\n }", "public final int getToolID() {\n return toolID;\n }", "public String getToolparam() {\r\n return toolparam;\r\n }", "public String getToolCommand();", "@Override\n\tpublic String getToolName() {\n\t\treturn name;\n\t}", "public String getToolhead() {\r\n return toolhead;\r\n }", "public String getToolheadid() {\r\n return toolheadid;\r\n }", "public String getToolnum() {\r\n return toolnum;\r\n }", "public Tool getActiveTool()\n {\n return GametableFrame.getGametableFrame().getGametableCanvas().getActiveTool();\n }", "@Internal\n public Property<NativeToolChain> getToolChain() {\n return toolChain;\n }", "protected SARLQuickfixProvider getTools() {\n\t\treturn this.tools.get();\n\t}", "public String getTooldept() {\r\n return tooldept;\r\n }", "public String getExternalAddress();", "public String getToolisuse() {\r\n return toolisuse;\r\n }", "public Tool getCurrentTool() {\n return fCurrTool;\n }", "@Override\n\tpublic Component getComponent() {\n\t\treturn toolbox;\n\t}", "public CommandLineTool getCommandLineToolInstance() {\n \treturn COMMAND_LINE_TOOL;\n }", "public String getInternalAddress();", "public PLayer getToolLayer() {\n return toolLayer;\n }", "public String getTooltype() {\r\n return tooltype;\r\n }", "public String getToolfilepath() {\r\n return toolfilepath;\r\n }", "@Override()\n public String getToolName()\n {\n return \"ldap-debugger\";\n }", "public String getToolId(){\n\t\treturn \"sakai.gcalendar\";\t\t\n\t}", "public String getToolfilename() {\r\n return toolfilename;\r\n }", "@Override\n\tpublic String[] myToolIds() {\n\t\tString[] toolIds = { \"sakai.gcalendar\" };\n\t\treturn toolIds;\n\t}", "private String getActionAddress() \n\t{\n\t\treturn pageContext.getRequest().getParameter(ACTION_ADDRESS_PARAMETER);\n\t}", "public Toolboxspace getToolboxspace() {\n return toolboxspace;\n }", "public String address() {\n return Codegen.stringProp(\"address\").config(config).require();\n }", "String getCaller();", "public String getAddress(){\r\n\t\ttry {\r\n\t\t\treturn this.workerobj.getString(WorkerController.ADDRESS);\r\n\t\t} catch (JSONException e) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "public String getTooldeptid() {\r\n return tooldeptid;\r\n }", "public int getToolFlag() {\r\n return toolFlag;\r\n }", "public String getAddressOut() {\n\t\treturn addressOut.get();\n\t}", "public String getTooltypeid() {\r\n return tooltypeid;\r\n }", "@Override\n public InetSocketAddress localAddressFor(Handle<GameAppContext> that) \n {\n return manager.localAddressFor(that);\n }", "public String getHost() {\n return stack.stackAddress;\n }", "private String getPrefAddress() {\n\t\treturn mPreferences.getString( PREF_ADDR, DEFAULT_ADDR );\n\t}", "public String getDevelopmentToolingandEnvironmentUpdateActionTaskReference() {\n return developmentToolingandEnvironmentUpdateActionTaskReference;\n }", "public Paint getTool(){\n return this.tool;\n }", "public String getToolteamid() {\r\n return toolteamid;\r\n }", "public String getToolteam() {\r\n return toolteam;\r\n }", "public String getExecBroker() {\n Object ref = execBroker_;\n if (ref instanceof String) {\n return (String) ref;\n } else {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n execBroker_ = s;\n }\n return s;\n }\n }", "public String getYwyAddress() {\n\t\treturn null;\n\t}", "protected static String getDUnitLocatorAddress() {\n return Host.getHost(0).getHostName();\n }", "public String getFrontEndAddress() {\n //TODO(alown): should this really only get the first one?\n return (this.isSSLEnabled ? \"https://\" : \"http://\") + frontendAddressHolder.getAddresses().get(0);\n }", "java.lang.String getBitcoinAddress();", "public int getIndexTool() {\r\n return indexTool;\r\n }", "public String getToolString() {\r\n\t\treturn Utility.convertTo4Byte(ScoolConstants.NEW_WHITEBOARD_ACTION);\r\n\t}", "public Address getCurrentCallRemoteAddress();", "public String getAddress() {\n\t\tlog.info(\"NOT IMPLEMENTED\");\n\t\treturn \"\";\n\t}", "public String getExecBroker() {\n Object ref = execBroker_;\n if (!(ref instanceof String)) {\n com.google.protobuf.ByteString bs =\n (com.google.protobuf.ByteString) ref;\n String s = bs.toStringUtf8();\n if (bs.isValidUtf8()) {\n execBroker_ = s;\n }\n return s;\n } else {\n return (String) ref;\n }\n }", "private String getAddress() {\n String add = \"\";\n if (mLocationHelper != null) {\n add = getString(R.string.address, mLocationHelper.getAddress());\n }\n return add;\n }", "public static Icon getToolWindow() {\n\t\tif (ApplicationInfo.getInstance().getBuild().getBaselineVersion() >= 182) {\n\t\t\treturn IconLoader.getIcon(\"/icons/org/antlr/intellij/plugin/toolWindowAntlr.svg\");\n\t\t}\n\n\t\treturn IconLoader.getIcon(\"/icons/org/antlr/intellij/plugin/antlr.png\");\n\t}", "private String seederAddress() {\n return CEBayHelper.GetRemoteActorRef(getSelf());\n }", "public void setToolname(String toolname) {\r\n this.toolname = toolname;\r\n }", "public HelpBroker getHelpBroker() {\n return m_oDisturbanceBehaviors.getGUIManager().getHelpBroker();\n }", "public java.lang.String getAddress()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(ADDRESS$2);\n if (target == null)\n {\n return null;\n }\n return target.getStringValue();\n }\n }", "public String getHost() {\n\t\treturn this.sipStack.getHostAddress();\n\t}", "public static LinkTool getTool()\n {\n if (singleton == null) {\n // new Throwable(\"Warning: LinkTool.getTool: class not initialized by VUE\").printStackTrace();\n new LinkTool();\n }\n return singleton;\n }", "String getOnlineHelpLocation();", "public String getProviderAddress() {\n\t\treturn this.providerAddress;\n\t}", "public String getAddress() {\n return definition.getString(ADDRESS);\n }", "java.lang.String getBrokerAddress();", "public ToolBridge getToolBridge(long toolID){\n\t\tToolBridge toolBridge = null;\n\n\t\tIterator toolIterator = tools.iterator();\n\t\twhile(toolIterator.hasNext()){\n\t\t\tToolBridge tb = (ToolBridge) toolIterator.next();\n\t\t\tif(tb.getToolID() == toolID){\n\t\t\t\ttoolBridge = tb;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn toolBridge;\n\t}", "public String getBizAddr() {\n return bizAddr;\n }", "public String getRpcServerAddress() throws HMServiceException {\n return rpcServerAddress.orElseThrow(() -> new HMServiceException(\"No RPC server address given! Check builder procedure. \"\n + \"May passed the wrong path during building\"));\n }", "public String getSystemId() {\n return this.source.getURI();\n }", "public String getAddr() {\n\t\treturn addr;\n\t}", "public String getDebuggingInfo() {\n if (hasTools()) {\n if (tileImprovementPlan == null) return \"No target\";\n final String action = tileImprovementPlan.getType().getNameKey();\n return tileImprovementPlan.getTarget().getPosition().toString()\n + \" \" + action;\n } else {\n if (colonyWithTools == null) return \"No target\";\n return \"Getting tools from \" + colonyWithTools.getName();\n }\n }", "@Override\n public String getAddress() {\n\n if(this.address == null){\n\n this.address = TestDatabase.getInstance().getClientField(token, id, \"address\");\n }\n\n return address;\n }", "public ToolConsumer getConsumer() {\n\n return this.consumer;\n\n }", "public final int getToolVersion() {\n return toolVersion;\n }", "public String getThisApplicationUrl() {\n\t\tString tempFileDest = getProperties().getProperty(\"temp.file.dest\").trim();\n\t\tString thisApplicationUrl = null;\n\t\tif(tempFileDest != null && tempFileDest.contains(\"mysunflower\")){\n\t\t\tthisApplicationUrl = getPortalApplicationUrl();\n\t\t}else{\n\t\t\tthisApplicationUrl = getApplicationUrl();\n\t\t}\n\t\treturn thisApplicationUrl;\n\t}", "public Point getAddToListButtonLoc(){\r\n\t\treturn button.getLocationOnScreen();\r\n\t}", "public String getAddr() {\n return addr;\n }", "public String getAddr() {\n return addr;\n }", "public String getAddr() {\n return addr;\n }", "public LocatorIF getBase() {\n return base_address;\n }", "public org.apache.xmlbeans.XmlString xgetAddress()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlString target = null;\n target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(ADDRESS$2);\n return target;\n }\n }", "public String getHostURL() {\n return getHostURL(PAActiveObject.getActiveObjectNodeUrl(PAActiveObject.getStubOnThis()));\n }", "public String getAddress()\r\n\t{\r\n\t\treturn address.getModelObjectAsString();\r\n\t}", "public static String GetBaseAddress() {\n\t\t// Load Projects Settings XML file\n\t\tDocument doc = Utilities.LoadDocumentFromFilePath(IDE.projectFolderPath + \"\\\\ProjectSettings.xml\");\n\t\tString baseAddress = \"\";\n\t\tif (doc != null) {\n\t\t\t// Get all \"files\"\n\t\t\tNodeList baseAddressNode = doc.getDocumentElement().getElementsByTagName(\"baseAddress\");\n\t\t\t// Handle result\n\t\t\tif (baseAddressNode.getLength() > 0) {\n\t\t\t\tbaseAddress = Utilities.getXmlNodeAttribute(baseAddressNode.item(0), \"value\");\n\t\t\t}\n\t\t}\n\t\treturn baseAddress;\n\t}", "public java.lang.String getAddress () {\n\t\treturn address;\n\t}", "public String getViaHost() {\n return this.myAddress;\n }", "public String getViaHost() {\n return this.myAddress;\n }", "public String getToolstandard() {\r\n return toolstandard;\r\n }", "public final String getAddress() {\n return address;\n }", "java.lang.String getValidatorAddress();", "java.lang.String getValidatorAddress();", "public String getExternalSystem() {\n return externalSystem;\n }", "public String getToolbar() {\n\t\treturn toolbar;\n\t}", "java.lang.String getAddress();", "java.lang.String getAddress();", "java.lang.String getAddress();", "java.lang.String getAddress();", "java.lang.String getAddress();", "java.lang.String getAddress();" ]
[ "0.6714884", "0.64851874", "0.62841415", "0.6148418", "0.61391187", "0.60540426", "0.5964819", "0.5953296", "0.5900413", "0.5831096", "0.58214307", "0.57788056", "0.56255984", "0.5620427", "0.5579802", "0.55636257", "0.5520274", "0.5485335", "0.5471184", "0.54625076", "0.5426539", "0.5408736", "0.54012847", "0.5398666", "0.5385568", "0.53845996", "0.5383515", "0.53441447", "0.53316325", "0.5327984", "0.529749", "0.5293121", "0.52909523", "0.52888376", "0.5280634", "0.5257076", "0.5247939", "0.5236632", "0.5218389", "0.5205059", "0.5175934", "0.5172968", "0.5157779", "0.5150202", "0.5142708", "0.5125326", "0.51063734", "0.50989074", "0.5085175", "0.50776166", "0.50505674", "0.50414693", "0.5040312", "0.50190604", "0.50168663", "0.50124544", "0.50121886", "0.5004137", "0.49913675", "0.49880278", "0.49823073", "0.49694213", "0.4964644", "0.49596566", "0.49589232", "0.49549428", "0.49524692", "0.4951099", "0.4941468", "0.4936402", "0.49352923", "0.4928421", "0.49160275", "0.48990577", "0.4893264", "0.48926118", "0.48911747", "0.4885121", "0.48842862", "0.48842862", "0.48842862", "0.4855754", "0.4854747", "0.48545444", "0.48526487", "0.48510382", "0.48507243", "0.48473346", "0.48473346", "0.48461324", "0.48460883", "0.48441944", "0.48441944", "0.48306087", "0.48259917", "0.4820679", "0.4820679", "0.4820679", "0.4820679", "0.4820679", "0.4820679" ]
0.0
-1
Sets the toolbox address of the calling Tool object.
public void setAddress(String address) { this.address = address; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setTool(Tool t) {\n\ttool = t;\n }", "public void setExternalAddress(String address);", "public void setInternalAddress(String address);", "public void setAddress(java.lang.String param) {\r\n localAddressTracker = param != null;\r\n\r\n this.localAddress = param;\r\n }", "private void setPrefAddress( String addr ) {\n\t\tmPreferences.edit().putString( PREF_ADDR, addr ).commit();\n\t}", "public void setOnToolListener( final OnToolListener listener ) {\n\t\tmToolListener = listener;\n\t}", "protected void setTools(SARLQuickfixProvider tools) {\n\t\tthis.tools = new WeakReference<>(tools);\n\t}", "public void setToolparam(String toolparam) {\r\n this.toolparam = toolparam;\r\n }", "public void setToolname(String toolname) {\r\n this.toolname = toolname;\r\n }", "public void setAddress(org.xmlsoap.schemas.wsdl.soap.TAddress address)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.xmlsoap.schemas.wsdl.soap.TAddress target = null;\n target = (org.xmlsoap.schemas.wsdl.soap.TAddress)get_store().find_element_user(ADDRESS$0, 0);\n if (target == null)\n {\n target = (org.xmlsoap.schemas.wsdl.soap.TAddress)get_store().add_element_user(ADDRESS$0);\n }\n target.set(address);\n }\n }", "public void setBaseAddress(int targetAddress, int baseAddress);", "public void setAddr(String addr) {\n this.addr = addr;\n }", "public void setAddress(Address address) {\n this.address = address;\n }", "public void setAddress(Address address) {\n this.address = address;\n }", "public void setAddress(Address address) {\n this.address = address;\n }", "public void ClickOnPhysicalAddressCheckbox()\n\t\t{\n\t\t\tPhysicalAddressCheckbox.click();\n\t\t}", "public void setTool(final Tool theTool) {\n removeMouseListener(myCurrentTool);\n removeMouseMotionListener(myCurrentTool);\n myCurrentTool = theTool;\n addMouseListener(myCurrentTool);\n addMouseMotionListener(myCurrentTool);\n }", "public void setAddress(String address);", "public void setAddress(String address);", "public void setAddress(String address);", "public void setAddress(String address);", "public void setLocationAddress(final BwString val) {\n locationAddress = val;\n }", "HandlebarsKnotOptions setAddress(String address) {\n this.address = address;\n return this;\n }", "public void setAddress(java.lang.String newAddress) {\n\taddress = newAddress;\n}", "public void setAddress(java.lang.String newAddress) {\n\taddress = newAddress;\n}", "public void xsetAddress(org.apache.xmlbeans.XmlString address)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.XmlString target = null;\n target = (org.apache.xmlbeans.XmlString)get_store().find_attribute_user(ADDRESS$2);\n if (target == null)\n {\n target = (org.apache.xmlbeans.XmlString)get_store().add_attribute_user(ADDRESS$2);\n }\n target.set(address);\n }\n }", "public void setAddress(String address) {\n try {\n if (address == null ||\n address.equals(\"\") ||\n address.equals(\"localhost\")) {\n m_Address = InetAddress.getLocalHost().getHostName();\n }\n } catch (Exception ex) {\n log.error(\"setAddress()\",ex);\n }\n m_Address = address;\n }", "public void setBillingAddressInCart(Address addr);", "void changeBTAddress() {\n\t\t\n\t\t// if ( this.beacon.getAppType() == AppType.APPLE_GOOGLE_CONTACT_TRACING ) {\n\t\tif ( this.useRandomAddr()) {\n\t\t\t// try to change the BT address\n\t\t\t\n\t\t\t// the address is LSB..MSB and bits 47:46 are 0 i.e. bits 0 & 1 of right-most byte are 0.\n\t\t\tbyte btRandomAddr[] = getBTRandomNonResolvableAddress();\n\t\t\t\n\t\t\t// generate the hcitool command string\n\t\t\tString hciCmd = getSetRandomBTAddrCmd( btRandomAddr);\n\t\t\t\n\t\t\tlogger.info( \"SetRandomBTAddrCmd: \" + hciCmd);\n\t\t\t\n\t\t\t// do the right thing...\n\t\t\tfinal String envVars[] = { \n\t\t\t\t\"SET_RAND_ADDR_CMD=\" + hciCmd\n\t\t\t};\n\t\t\t\t\t\t\n\t\t\tfinal String cmd = \"./scripts/set_random_addr\";\n\t\t\t\n\t\t\tboolean status = runScript( cmd, envVars, this, null);\n\t\t}\n\t\t\t\n\t}", "@Override\n public void setAdress(Adress adress) {\n this.adress = adress;\n }", "public void setToolnum(String toolnum) {\r\n this.toolnum = toolnum;\r\n }", "public Tool(String name, String id, String address) {\n this.name = name;\n this.id = id;\n this.address = address;\n this.isHome = false;\n }", "void setActiveTool(int tool) {\n this.activeTool = tool;\n }", "public void setAddress(String _address){\n address = _address;\n }", "void setAdress(String generator, String address);", "public void setTool(Tool tool) {\n Tool oldTool = currentTool;\n\n currentTool = tool;\n \n if(tool == null && hiddenButton != null) {\n hiddenButton.setSelected(true);\n revalidate();\n } else if(tool != oldTool) {\n String toolId = tool.getToolID();\n JToolButton button = toolIdToButtonMap.get(toolId);\n if(button != null) {\n button.setSelected(true);\n } else {\n currentTool = null;\n if (hiddenButton != null)\n hiddenButton.setSelected(true);\n }\n }\n }", "public void setToolhead(String toolhead) {\r\n this.toolhead = toolhead;\r\n }", "public void setAddr(String addr) {\n\t\tthis.addr = addr;\n\t}", "public void setUseTool(ToolCardEvent event)\n {\n useTool = event;\n }", "Builder setAddress(String address);", "public Builder setAddress(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000008;\n address_ = value;\n onChanged();\n return this;\n }", "public void setAddress(int address)\n {\n this.address = address;\n }", "public abstract void setCustomerAddress(Address address);", "public void setShippingAddressInCart(Address addr);", "public void setBase(LocatorIF base_address) {\n this.base_address = base_address;\n }", "public void addressChanged() {\n\t\t// the variable OSCPortOut tries to get an instance of OSCPortOut\n\t\t// at the address indicated by the addressWidget\n\t\ttry {\n\t\t\toscPort =\n\t\t\t\tnew OSCPortOut(InetAddress.getByName(addressWidget.getText()));\n\t\t\t// if the oscPort variable fails to be instantiated then sent\n\t\t\t// the error message\n\t\t} catch (final Exception ex) {\n\t\t\tshowError(\"Couldn't set address\");\n\t\t}\n\t}", "public void setAddress(final URL value) {\n this.address = value;\n }", "public void setAddress(java.lang.String address)\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.apache.xmlbeans.SimpleValue target = null;\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_attribute_user(ADDRESS$2);\n if (target == null)\n {\n target = (org.apache.xmlbeans.SimpleValue)get_store().add_attribute_user(ADDRESS$2);\n }\n target.setStringValue(address);\n }\n }", "public void setAddress(final String address){\n this.address=address;\n }", "public void setRootToolGroup(ToolGroup toolGroup) {\n this.rootToolGroup = toolGroup;\n\n initialBuild();\n \n if (toolGroup != null)\n toolGroup.addToolGroupListener(this);\n }", "public void setAddress(String address) {\n this.address = address;\n }", "@FXML\n private void setAddressBox() throws SQLException {\n this.addressBox.setText(Address.toString(CurrentLogin.getInstance().getUserID()));\n }", "public Builder setBrokerAddress(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n brokerAddress_ = value;\n onChanged();\n return this;\n }", "public Tool(String name, String id, String address, boolean isHome) {\n this.name = name;\n this.id = id;\n this.address = address;\n this.isHome = isHome;\n }", "public void setAdress(Adress adr) {\r\n // Bouml preserved body begin 00040F82\r\n\t this.adress = adr;\r\n // Bouml preserved body end 00040F82\r\n }", "public void tellYourAddress(){\r\n\t\tSystem.out.println(\"Blick von innen: \" + this);\r\n\t}", "public Builder setBitcoinAddress(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000010;\n bitcoinAddress_ = value;\n onChanged();\n return this;\n }", "public void setAddress(String address) { this.address = address; }", "public void setAddress(String address)\n {\n this.address = address;\n }", "public void setRegaddress(java.lang.String param) {\r\n localRegaddressTracker = param != null;\r\n\r\n this.localRegaddress = param;\r\n }", "public void setAddress(String address) {\n this.address = address;\n }", "public void setAddress(String address) {\n this.address = address;\n }", "public void setAddress(String newAddress) {\r\n\t\tthis.address = newAddress;\r\n\t}", "public void setAddress(String address) {\r\n this.address = address;\r\n }", "public void setAddress(String address) {\r\n this.address = address;\r\n }", "public void setAddress(String address) {\r\n this.address = address;\r\n }", "void setCaller(String caller);", "@Override\n\tpublic void setAddress(String address) {\n\t\tthis.address = address;\n\t}", "public Builder setAddress(\n java.lang.String value) {\n if (value == null) { throw new NullPointerException(); }\n address_ = value;\n bitField0_ |= 0x00000020;\n onChanged();\n return this;\n }", "public Builder setAddress(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n address_ = value;\n onChanged();\n return this;\n }", "public void setToolheadid(String toolheadid) {\r\n this.toolheadid = toolheadid;\r\n }", "public void set_addr(int value) {\n setUIntElement(offsetBits_addr(), 16, value);\n }", "public void setDebuggerAddressProperty(final String debuggerAddressProperty)\n {\n this.debuggerAddressProperty = debuggerAddressProperty;\n }", "public Builder setRpcAddress(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n rpcAddress_ = value;\n onChanged();\n return this;\n }", "public Builder setAddress(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n address_ = value;\n onChanged();\n return this;\n }", "public Builder setAddress(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n address_ = value;\n onChanged();\n return this;\n }", "public void setAddress(final String address) {\n\t\tthis.address = address;\n\t}", "@Override\n\tpublic void setOnAddress(String onAddress) {\n\t\tthis.onAddress = onAddress;\n\t}", "public PathwayCommonsAccessTool() {\n super(PC_NAME, PC_RESOURCEID, PC_STRUCTURE);\n try {\n this.getToolResource().setResourceURL(new URL(PC_URL));\n this.getToolResource().setResourceLogo(new URL(PC_LOGO));\n this.getToolResource().setResourceElementURL(PC_ELT_URL);\n } catch (MalformedURLException e) {\n e.printStackTrace();\n }\n this.getToolResource().setResourceDescription(PC_DESCRIPTION);\n }", "public void setAddress(String address){\n\t\tthis.address = address;\n\t}", "public void setAddress(String address){\n\t\tthis.address = address;\n\t}", "public void setAddress(java.lang.String address) {\r\n this.address = address;\r\n }", "@Override\r\n\tpublic void setAddress(String address) {\n\t\tif (address == null) {\r\n\t\t\tthrow new IllegalArgumentException(\"Null argument is not allowed\");\r\n\t\t}\r\n\t\tif (address.equals(\"\")) {\r\n\t\t\tthrow new IllegalArgumentException(\"Empty argument is not allowed\");\r\n\t\t}\r\n\t\tthis.address = address;\r\n\t}", "@Test\n\tvoid testSetAddress() {\n\t\tassertNull(this.customer.getAddress());\n\t\t\n\t\t//sets address for customer\n\t\tthis.customer.setAddress(\"Brooklyn, NY\");\n\t\t\n\t\t//checks that address was set correctly\n\t\tassertEquals(\"Brooklyn, NY\", this.customer.getAddress());\n\t\t\n\t\t//reset address for customer\n\t\tthis.customer.setAddress(\"Cranston, RI\");\n\t\t\n\t\t//checks that address was reset correctly\n\t\tassertEquals(\"Cranston, RI\", this.customer.getAddress());\n\t}", "void setAddress(String address) throws IllegalArgumentException;", "@Generated(hash = 607080948)\n public void setAddress(Address address) {\n synchronized (this) {\n this.address = address;\n addressId = address == null ? null : address.getId();\n address__resolvedKey = addressId;\n }\n }", "protected void setToolTip(String toolTip) {\n\tthis.toolTip = toolTip;\n }", "public void editAttractionAddress(String address){\r\n this.address = address;\r\n }", "public void setAdornmentTool(Tool tool) {\n\t\tthis.renderingTool = tool;\n\t}", "public void setBaseAddress(String base_address) {\n try {\n this.base_address = new URILocator(base_address);\n } catch (MalformedURLException e) {\n throw new OntopiaRuntimeException(e);\n }\n }" ]
[ "0.6032431", "0.5937987", "0.5749941", "0.57326555", "0.5581112", "0.55326545", "0.5521428", "0.5489796", "0.54414356", "0.5328564", "0.53196", "0.5319188", "0.5318942", "0.5318942", "0.5318942", "0.52982616", "0.52928174", "0.5282918", "0.5282918", "0.5282918", "0.5282918", "0.52708423", "0.52659565", "0.524963", "0.524963", "0.52393466", "0.52300245", "0.5223879", "0.52056414", "0.52044016", "0.5193646", "0.5182093", "0.5181795", "0.51802903", "0.5157666", "0.5149008", "0.51425236", "0.5138136", "0.5118942", "0.5092619", "0.5091162", "0.50823516", "0.50784594", "0.50707954", "0.5069809", "0.505772", "0.5056844", "0.5044642", "0.5043055", "0.50301695", "0.50081134", "0.50020057", "0.49971023", "0.4993133", "0.49891979", "0.49837065", "0.49827734", "0.49721128", "0.49644196", "0.49635598", "0.4958759", "0.4958759", "0.49516568", "0.49421763", "0.49421763", "0.49421763", "0.49128318", "0.49119565", "0.49035665", "0.4902186", "0.49021354", "0.4890684", "0.48833752", "0.48622015", "0.48593107", "0.48593107", "0.48525634", "0.48523533", "0.48522025", "0.48445353", "0.48445353", "0.484372", "0.48317602", "0.48255503", "0.4823329", "0.4812326", "0.48112318", "0.48046562", "0.48037252", "0.47955996" ]
0.0
-1
Gets the isHome status of the calling Tool object.
public boolean getIsHome() { return isHome; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isHome() {\n return getHomePackageNames().contains(\n mActivityManager.getRunningTasks(1).get(0).topActivity.getPackageName());\n }", "public Boolean isInCurrentHome() throws CallError, InterruptedException {\n return (Boolean)service.call(\"isInCurrentHome\").get();\n }", "boolean isHomeIconEnabled()\n {\n return configfile.home_enabled;\n }", "public int getHome() {\n return m_home;\n }", "protected boolean isHomeRefreshable()\r\n/* 92: */ {\r\n/* 93:178 */ return false;\r\n/* 94: */ }", "public Location getHome() {\n return home;\n }", "protected boolean isHomeAsUpEnabled() {\n return true;\n }", "public boolean isHomeCollection();", "public void setAPIManagerIsHome(boolean apiManagerIsHome)\n {\n this.apiManagerIsHome = apiManagerIsHome;\n }", "public static String getHome() {\n return home;\n }", "public static final String getHome() { return home; }", "protected Object getHome()\r\n/* 75: */ throws NamingException\r\n/* 76: */ {\r\n/* 77:159 */ if ((!this.cacheHome) || ((this.lookupHomeOnStartup) && (!isHomeRefreshable()))) {\r\n/* 78:160 */ return this.cachedHome != null ? this.cachedHome : lookup();\r\n/* 79: */ }\r\n/* 80:163 */ synchronized (this.homeMonitor)\r\n/* 81: */ {\r\n/* 82:164 */ if (this.cachedHome == null)\r\n/* 83: */ {\r\n/* 84:165 */ this.cachedHome = lookup();\r\n/* 85:166 */ this.createMethod = getCreateMethod(this.cachedHome);\r\n/* 86: */ }\r\n/* 87:168 */ return this.cachedHome;\r\n/* 88: */ }\r\n/* 89: */ }", "public ToolStatus getToolStatus() { return toolStatus;\n }", "public boolean isSetHomepage() {\n return this.homepage != null;\n }", "public boolean isHomeLinkPresent() {\r\n\t\treturn isElementPresent(groupListSideBar.replace(\"Group List\", \"Home\"), SHORTWAIT);\r\n\t}", "public void setIsHome(boolean isHome) {\n this.isHome = isHome;\n }", "public TaskStack getHomeStack() {\n return this.mTaskStackContainers.getHomeStack();\n }", "public boolean isShowHomeLayout() {\n return isShowHomeLayout;\n }", "public URI getHome() {\n return this.homeSpace;\n }", "boolean isHome(IGeneticMob geneticMob);", "public void goHome() {\n shouldWork = false;\n }", "private Home getHome(final Context ctx)\r\n {\r\n return (Home) ctx.get(this.homeKey_);\r\n }", "public String getHomeTeam(){\n\t\treturn _homeTeam.getTeamName();\n\t}", "public boolean isToolChangerOpen() {\n return toolChangerOpen;\n }", "public String getHomeNum() {\n return homeNum;\n }", "public boolean getActive();", "public boolean getActive();", "public String getHomeWin(String team) {\n\n return getGameInfo(team, \"home_win\");\n }", "public boolean status() {\n return hatchkicker.get();\n }", "public Integer learnHome() throws CallError, InterruptedException {\n return (Integer)service.call(\"learnHome\").get();\n }", "public String getHomeNumber() {\r\n return homeNumber;\r\n }", "public static boolean isLoadForHome() {\n boolean isSupport = 1 == SystemProperties.getInt(\n \"ro.mtk_c2k_om_nw_sel_type\", 0) ? false : true;\n Log.d(TAG, \"isLoadForHome(): \" + isSupport);\n return isSupport;\n }", "public String getHomePage() {\r\n return this.homePage;\r\n }", "public int getToolFlag() {\r\n return toolFlag;\r\n }", "public String getHomeTeam() {\n return homeTeam;\n }", "public String getToolcheckstatus() {\r\n return toolcheckstatus;\r\n }", "private com.hps.july.trailcom.beans.OpticalHopHome ejbHome() throws java.rmi.RemoteException, javax.naming.NamingException {\n return (com.hps.july.trailcom.beans.OpticalHopHome) PortableRemoteObject.narrow(getHome(), com.hps.july.trailcom.beans.OpticalHopHome.class);\n }", "protected TableHome getTableHome() {\n return tableHome;\n }", "public Tool getActiveTool()\n {\n return GametableFrame.getGametableFrame().getGametableCanvas().getActiveTool();\n }", "private EntryStorageHome home()\r\n {\r\n if( home == null )\r\n {\r\n\t\ttry\r\n\t\t{\r\n home = (EntryStorageHome) \r\n get_storage_home().get_catalog().find_storage_home( PSS_HOME );\r\n\t\t}\r\n\t\tcatch( Throwable e )\r\n\t\t{\r\n\t\t String error = \"Could not resolve the EntryStorageHome\";\r\n\t\t throw new RuntimeException( error, e );\r\n\t\t}\r\n }\r\n return home;\r\n }", "private MatrixHome getMatrixHome() {\n\t\treturn mMatrixHome;\n\t}", "String getHome(ObjectStorage storage);", "public static boolean isEnterHomeSent() {\n return mSent;\n }", "public String getHomeClassName()\n {\n if (_homeClass != null)\n return _homeClass.getName();\n else\n return getAPIClassName();\n }", "public TaskStack getHomeStack() {\n if (this.mHomeStack == null && DisplayContent.this.mDisplayId == 0) {\n Slog.e(DisplayContent.TAG, \"getHomeStack: Returning null from this=\" + this);\n }\n return this.mHomeStack;\n }", "public HomeGroup getHomeGroup() {\n\t\treturn homeGroup;\n\t}", "public String getHomeTeam();", "public int getHomeId() {\n return controller.getHomeId();\n }", "public Integer goToHome() throws CallError, InterruptedException {\n return (Integer)service.call(\"goToHome\").get();\n }", "public String getHomeAddress() {\n return homeAddress;\n }", "boolean hasStartingInfo();", "public boolean isThisThingOn(){\r\n return isActive;\r\n }", "public boolean isLaunched();", "public File getHome() {\r\n\t\treturn homeDir;\r\n\t}", "private Home getPackageHistoryHome(final Context ctx)\r\n {\r\n return (Home) ctx.get(PackageMgmtHistoryHome.class);\r\n }", "public File getHome() {\n return home;\n }", "boolean hasHasInstitutionHomePage();", "boolean hasHeadGear();", "public void gotoHome(){ application.gotoHome(); }", "String getOssHomepage();", "public String getHomeState()\n {\n return homeState;\n}", "boolean getHealthy();", "boolean isActive();", "boolean isActive();", "boolean isActive();", "private void returnHome(){\n if (Boolean.toString(UpdatedHomePage.updatedHomeStarted).equals(\"false\")) {\n startActivity(new Intent(FinalPlan.this, Home.class));\n } else {\n Intent intent = new Intent(this, UpdatedHomePage.class);\n Bundle extras = new Bundle();\n extras.putBoolean(\"filtered\", true);\n intent.putExtras(extras);\n startActivity(intent);\n }\n }", "public static String home() {\n\n String treefsHome = stringValue(\"treefs.home\");\n if(isNullOrEmpty(treefsHome)) {\n // default home location\n treefsHome = System.getProperty(\"user.dir\");\n }\n\n return treefsHome;\n }", "int isActive();", "public boolean isStartingUp() {\r\n\t\treturn isStartingUp;\r\n\t}", "public boolean isActive();", "public boolean isActive();", "public boolean isActive();", "public boolean isActive();", "public boolean isActive();", "public boolean isActive();", "public boolean isActive();", "public boolean isActive();", "public boolean isActive();", "public boolean isActive();", "public boolean isActive();", "public boolean isActive();", "public boolean isActive();", "public boolean isActive();", "public boolean isActive();", "public boolean check_Home_Buttom_AppBar_Presence() {\r\n\t\tWebElement bottomMenu_Home_Icon = driver.findElementByAccessibilityId(\"HomeAppBarButton\");\r\n\t\treturn IsElementVisibleStatus(bottomMenu_Home_Icon);\r\n\t}", "public Tool getCurrentTool() {\n return fCurrTool;\n }", "public boolean isScreenOn() {\n return mPowerManager.isScreenOn();\n }", "public void setLookupHomeOnStartup(boolean lookupHomeOnStartup)\r\n/* 24: */ {\r\n/* 25: 72 */ this.lookupHomeOnStartup = lookupHomeOnStartup;\r\n/* 26: */ }", "boolean getStatus();", "boolean getStatus();", "boolean getStatus();", "public boolean isOnLand() {\r\n\t\treturn isOnLand;\r\n\t}", "boolean hasActive();", "public String getCurrentHome(){\r\n \tfor (DisplayResolveInfo info : mList) {\r\n \t\tif (true == info.bDefault) {\r\n \t\t\tmPm.clearPackagePreferredActivities(info.ri.activityInfo.packageName);\r\n\t\t\t\t\r\n\t\t\t\treturn info.ri.activityInfo.packageName;\r\n \t\t} \r\n \t} \t\r\n\t\treturn null;\r\n\t}", "public Boolean isActive();", "public boolean isOnMenu ();", "private Home getImsiHistoryHome(final Context ctx)\r\n {\r\n return (Home) ctx.get(ImsiMgmtHistoryHome.class);\r\n }", "public boolean isLanding() {\n\t\treturn isLanding;\n\t}", "public Tool tool() {\n return fTool;\n }", "private boolean isConsumerHomePage() throws Exception {\n\n\t\tif (wh.isElementPresent(HomePageUI.verifyHomepage, 3) || \n\t\t\t\twh.isElementPresent(HomePageUI.verifyHomepage1, 3)) {\n\n\t\t\treturn true;\n\t\t} else {\n\n\t\t\treturn false;\n\t\t}\n\t}" ]
[ "0.74085104", "0.7353796", "0.64917713", "0.6377354", "0.6289554", "0.62747914", "0.62076336", "0.61250126", "0.60639656", "0.60412747", "0.6016993", "0.5931957", "0.5924294", "0.59205073", "0.5918548", "0.5892069", "0.587571", "0.58752036", "0.58673364", "0.5867266", "0.5817053", "0.5737471", "0.5720746", "0.56664187", "0.56580925", "0.5632639", "0.5632639", "0.5621139", "0.5611083", "0.5583593", "0.55614823", "0.55385906", "0.55205995", "0.5503241", "0.55011255", "0.549891", "0.5492295", "0.54735076", "0.54706615", "0.54691243", "0.545425", "0.5431716", "0.54271007", "0.542622", "0.54209423", "0.5401889", "0.5397396", "0.5395381", "0.53870916", "0.53815705", "0.53638136", "0.5354007", "0.5348318", "0.5347282", "0.53210175", "0.5313903", "0.53135496", "0.53053236", "0.52856076", "0.52650887", "0.52644557", "0.52583915", "0.52524173", "0.52524173", "0.52524173", "0.52522707", "0.52492976", "0.5244624", "0.5240023", "0.5240021", "0.5240021", "0.5240021", "0.5240021", "0.5240021", "0.5240021", "0.5240021", "0.5240021", "0.5240021", "0.5240021", "0.5240021", "0.5240021", "0.5240021", "0.5240021", "0.5240021", "0.52175134", "0.52145195", "0.51916665", "0.51679045", "0.51672065", "0.51672065", "0.51672065", "0.5164708", "0.5160061", "0.5157928", "0.5154637", "0.5152444", "0.5150407", "0.51468873", "0.51257294", "0.51253664" ]
0.75826496
0
Sets the status of whether the tool is inside its assigned toolbox of the calling Tool object.
public void setIsHome(boolean isHome) { this.isHome = isHome; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setToolStatus(ToolStatus toolStatus) {\n this.toolStatus = toolStatus;\n }", "void setActiveTool(int tool) {\n this.activeTool = tool;\n }", "public void setTool(Tool t) {\n\ttool = t;\n }", "public ToolStatus getToolStatus() { return toolStatus;\n }", "public void assignUserMaintOK(final boolean val) {\n userMaintOK = val;\n }", "public void setTool(Tool tool) {\n Tool oldTool = currentTool;\n\n currentTool = tool;\n \n if(tool == null && hiddenButton != null) {\n hiddenButton.setSelected(true);\n revalidate();\n } else if(tool != oldTool) {\n String toolId = tool.getToolID();\n JToolButton button = toolIdToButtonMap.get(toolId);\n if(button != null) {\n button.setSelected(true);\n } else {\n currentTool = null;\n if (hiddenButton != null)\n hiddenButton.setSelected(true);\n }\n }\n }", "public boolean setToolCommand(String command);", "public void setOnToolListener( final OnToolListener listener ) {\n\t\tmToolListener = listener;\n\t}", "public boolean isToolChangerOpen() {\n return toolChangerOpen;\n }", "public void toolDone() {\n setTool(fDefaultToolButton.tool(), fDefaultToolButton.name());\n setSelected(fDefaultToolButton);\n }", "public void setToolcheckstatus(String toolcheckstatus) {\r\n this.toolcheckstatus = toolcheckstatus;\r\n }", "private void setComponentStatus() {}", "boolean supportsExternalTool();", "@Override\n public void propertyChange( PropertyChangeEvent ev ) {\n if (ev.getPropertyName().equals( BaseLayerEditorTool.PROP_LAYER_ACTIVATED )) {\n // delay triggerTool() until UI has been created\n Polymap.getSessionDisplay().asyncExec( new Runnable() {\n public void run() {\n boolean activate = false;\n boolean enable = false;\n // Polygone?\n if (parentTool.getDrawControl().getHandler() instanceof PolygonHandler) {\n enable = true;\n activate = Objects.firstNonNull( \n getSite().getMemento().getBoolean( PROP_ACTIVE ),\n Boolean.FALSE ).booleanValue();\n }\n \n // reset tool if layer of parentTool has changed\n if (isActive() && activate) {\n getSite().triggerTool( getSite().getToolPath(), false );\n }\n\n getSite().enableTool( getSite().getToolPath(), enable );\n getSite().triggerTool( getSite().getToolPath(), activate );\n }\n });\n }\n }", "public void setUseTool(ToolCardEvent event)\n {\n useTool = event;\n }", "public int getToolFlag() {\r\n return toolFlag;\r\n }", "public void setToolChangerOpen(boolean toolChangerOpen) {\n this.toolChangerOpen = toolChangerOpen;\n }", "protected void doToggleMinimap() {\r\n\t\trenderer.minimapMode = ui.viewSymbolicBuildings.isSelected();\r\n\t\trenderer.repaint();\r\n\t}", "public void toolUpdated(ToolGroupEvent evt) { \n \n Tool tool = (Tool)evt.getChild();\n String toolId = tool.getToolID();\n \n if (toolIdToToolMap.containsKey(toolId)) {\n toolIdToToolMap.put(toolId, tool);\n }\n \n // get the button to update\n JToolButton button = toolIdToButtonMap.get(toolId);\n \n // update the hover-over if necessary\n String desc = tool.getDescription();\n if (displayHoverover && desc != null && !desc.equals(\"\")) {\n \n // create the hoverover and re-assign it\n String hoveroverText = generateHoverover(tool);\n button.setToolTipText(hoveroverText);\n \n }\n\n //\n // now request the icon if necessary\n //\n Boolean hiddenTool =\n (Boolean)tool.getProperty(\n Entity.DEFAULT_ENTITY_PROPERTIES,\n ChefX3DRuleProperties.HIDE_IN_CATALOG);\n \n if (hiddenTool == null || !hiddenTool) {\n \n String iconPath = tool.getIcon();\n \n // check the cache for the resource\n if (clientCache.doesAssetExist(iconPath)) {\n \n // call the resource loaded directly\n try {\n InputStream resourceStream =\n clientCache.retrieveAsset(iconPath);\n resourceLoaded(iconPath, resourceStream);\n } catch (IOException io) {\n errorReporter.errorReport(io.getMessage(), io);\n } \n \n } else {\n \n // now try to lazy load the actual image\n resourceLoader.loadResource(iconPath, this);\n \n }\n \n }\n\n }", "public void setIsInPlatform(boolean val){\n setInPlatform(val);\n }", "public void itemStateChanged(ItemEvent evt) {\n if(evt.getStateChange() != ItemEvent.SELECTED)\n return;\n\n JToolButton button = (JToolButton)evt.getSource();\n\n String toolId = button.getActionCommand();\n Tool tool = toolIdToToolMap.get(toolId);\n if(currentTool != tool) {\n ViewManager viewManager = ViewManager.getViewManager();\n viewManager.setTool(tool);\n\n int type = tool.getToolType();\n if (type != Entity.TYPE_WORLD) {\n\t ToolBarManager toolManager = ToolBarManager.getToolBarManager();\n\t toolManager.setTool(tool);\n }\n }\n }", "private boolean hasTools() {\n return hasTools(getAIUnit());\n }", "public void setToolname(String toolname) {\r\n this.toolname = toolname;\r\n }", "public void doIt() {\n status = true;\n }", "boolean isSetSystem();", "boolean isSetTarget();", "public void setAdornmentTool(Tool tool) {\n\t\tthis.renderingTool = tool;\n\t}", "void setIsManaged(boolean isManaged);", "void toggleToolboxButton(JButton button){\r\n // Reset Selections\r\n Selection.setSelected(false);\r\n Wire.setSelected(false);\r\n RotateRight.setEnabled(true);\r\n RotateLeft.setEnabled(true);\r\n InsertSubComponent.setSelected(false);\r\n\r\n // Select this button\r\n button.setSelected(true);\r\n \r\n optionsPanel.setVisible(false);\r\n circuitPanel.removeUnfixedComponents();\r\n }", "public void setActive(){\n paycheckController.setActive();\n }", "public boolean isSelectionToolAllowedToChangeResourceType() {\n\treturn true;\n}", "public void confirmLightning() {\n selectedLightning = true;\n }", "public void triggerPickedUp(boolean b);", "public void pickUpFlag(IRobot robot) {\n String objectName = getObjectNameOnPos(tiledMap, robot.getPos());\n if(objectName != null && objectName.contains(\"Flag\")){\n robot.addFlag(objectName);\n }\n }", "public void setEnabled (boolean enabled) {\r\n\tcheckWidget ();\r\n\tint topHandle = topHandle ();\r\n\tint flags = enabled ? 0 : OS.Pt_BLOCKED | OS.Pt_GHOST;\r\n\tOS.PtSetResource (topHandle, OS.Pt_ARG_FLAGS, flags, OS.Pt_BLOCKED | OS.Pt_GHOST);\r\n}", "public void setWorking(boolean working) {}", "protected void doToggleBuildings() {\r\n\t\trenderer.showBuildings = ui.viewShowBuildings.getState();\r\n\t\trepaint();\r\n\t}", "public String getToolcheckstatus() {\r\n return toolcheckstatus;\r\n }", "public void checkInside() {\n checkInsideDone = false;\n }", "public void setRootToolGroup(ToolGroup toolGroup) {\n this.rootToolGroup = toolGroup;\n\n initialBuild();\n \n if (toolGroup != null)\n toolGroup.addToolGroupListener(this);\n }", "void setCheckedOut(boolean checkedOut);", "public void setToolparam(String toolparam) {\r\n this.toolparam = toolparam;\r\n }", "@Override\n protected void setInitiallyEnabled(boolean forConstruction)\n {\n super.setInitiallyEnabled(forConstruction);\n\n setEnabled(CogToolLID.NewWidget,\n ListenerIdentifierMap.ALL,\n MenuUtil.ENABLED);\n setEnabled(CogToolLID.NewWidgetJustWarn,\n ListenerIdentifierMap.ALL,\n MenuUtil.ENABLED);\n setEnabled(CogToolLID.AddDesignDevices,\n ListenerIdentifierMap.ALL,\n MenuUtil.ENABLED);\n setEnabled(CogToolLID.ZoomToFit,\n ListenerIdentifierMap.ALL,\n MenuUtil.ENABLED);\n setEnabled(CogToolLID.ZoomNormal,\n ListenerIdentifierMap.ALL,\n MenuUtil.ENABLED);\n setEnabled(CogToolLID.ZoomIn,\n ListenerIdentifierMap.ALL,\n MenuUtil.ENABLED);\n setEnabled(CogToolLID.ZoomOut,\n ListenerIdentifierMap.ALL,\n MenuUtil.ENABLED);\n setEnabled(CogToolLID.SetBackgroundImage,\n ListenerIdentifierMap.ALL,\n MenuUtil.ENABLED);\n setEnabled(CogToolLID.SetWidgetColor,\n ListenerIdentifierMap.ALL,\n MenuUtil.ENABLED);\n\n setEnabled(CogToolLID.SkinNone,\n ListenerIdentifierMap.ALL,\n MenuUtil.ENABLED);\n setEnabled(CogToolLID.SkinWireFrame,\n ListenerIdentifierMap.ALL,\n MenuUtil.ENABLED);\n setEnabled(CogToolLID.SkinWinXP,\n ListenerIdentifierMap.ALL,\n MenuUtil.ENABLED);\n setEnabled(CogToolLID.SkinMacOSX,\n ListenerIdentifierMap.ALL,\n MenuUtil.ENABLED);\n setEnabled(CogToolLID.SkinPalm,\n ListenerIdentifierMap.ALL,\n MenuUtil.ENABLED);\n\n setEnabled(CogToolLID.RenderAll,\n ListenerIdentifierMap.ALL,\n MenuUtil.ENABLED);\n setEnabled(CogToolLID.UnRender,\n ListenerIdentifierMap.ALL,\n MenuUtil.ENABLED);\n\n boolean enable = (frame.getBackgroundImage() == null)\n ? MenuUtil.DISABLED\n : MenuUtil.ENABLED;\n\n setEnabled(CogToolLID.RemoveBackgroundImage,\n ListenerIdentifierMap.ALL,\n enable);\n\n view.setIsBackgroundAvailable(enable);\n\n setViewEnabledState(selection, ListenerIdentifierMap.NORMAL);\n }", "public void setVmAttachedToPool(boolean value) {\n if (value) {\n // ==General Tab==\n getDataCenterWithClustersList().setIsChangeable(!value);\n getQuota().setIsChangeable(false);\n getCpuProfiles().setIsChangeable(false);\n\n getVmId().setIsChangeable(false);\n\n getNumOfDesktops().setIsChangeable(false);\n getPrestartedVms().setIsChangeable(false);\n getMaxAssignedVmsPerUser().setIsChangeable(false);\n\n getBaseTemplate().setIsChangeable(false);\n getTemplateWithVersion().setIsChangeable(false);\n getInstanceTypes().setIsChangeable(false);\n getMemSize().setIsChangeable(false);\n getTotalCPUCores().setIsChangeable(false);\n\n getCustomCpu().setIsChangeable(false);\n getEmulatedMachine().setIsChangeable(false);\n\n getCoresPerSocket().setIsChangeable(false);\n getNumOfSockets().setIsChangeable(false);\n getThreadsPerCore().setIsChangeable(false);\n getSerialNumberPolicy().setIsChangeable(false);\n\n getOSType().setIsChangeable(false);\n getIsStateless().setIsChangeable(false);\n getIsRunAndPause().setIsChangeable(false);\n getIsDeleteProtected().setIsChangeable(false);\n\n // ==Initial run Tab==\n getTimeZone().setIsChangeable(false);\n\n // ==Console Tab==\n getDisplayType().setIsChangeable(false);\n getGraphicsType().setIsChangeable(false);\n getUsbPolicy().setIsChangeable(false);\n getConsoleDisconnectAction().setIsChangeable(false);\n getNumOfMonitors().setIsChangeable(false);\n getIsSingleQxlEnabled().setIsChangeable(false);\n getIsSmartcardEnabled().setIsChangeable(false);\n getAllowConsoleReconnect().setIsChangeable(false);\n getVncKeyboardLayout().setIsChangeable(false);\n getSsoMethodNone().setIsChangeable(false);\n getSsoMethodGuestAgent().setIsChangeable(false);\n\n // ==Host Tab==\n getIsAutoAssign().setIsChangeable(false);\n getDefaultHost().setIsChangeable(false);\n getHostCpu().setIsChangeable(false);\n getMigrationMode().setIsChangeable(false);\n getCpuPinning().setIsChangeable(false);\n getMigrationDowntime().setIsChangeable(false);\n\n // ==Resource Allocation Tab==\n getMinAllocatedMemory().setIsChangeable(false);\n getProvisioning().setIsChangeable(false);\n getProvisioningThin_IsSelected().setIsChangeable(false);\n getProvisioningClone_IsSelected().setIsChangeable(false);\n getDisksAllocationModel().setIsChangeable(false);\n getIoThreadsEnabled().setIsChangeable(false);\n getNumOfIoThreads().setIsChangeable(false);\n\n // ==Boot Options Tab==\n getFirstBootDevice().setIsChangeable(false);\n getSecondBootDevice().setIsChangeable(false);\n getCdAttached().setIsChangeable(false);\n getCdImage().setIsChangeable(false);\n getKernel_path().setIsChangeable(false);\n getInitrd_path().setIsChangeable(false);\n getKernel_parameters().setIsChangeable(false);\n\n // ==Random Generator Tab==\n getIsRngEnabled().setIsChangeable(false);\n getRngPeriod().setIsChangeable(false);\n getRngBytes().setIsChangeable(false);\n getRngSourceRandom().setIsChangeable(false);\n getRngSourceHwrng().setIsChangeable(false);\n\n // ==Custom Properties Tab==\n getCustomProperties().setIsChangeable(false);\n getCustomPropertySheet().setIsChangeable(false);\n\n // ==Icon Tab==\n getIcon().setIsChangeable(false);\n\n vmAttachedToPool = true;\n }\n }", "public void setWorking() {\n working = true;\n }", "@Override\r\n\t@Test(groups = {\"function\",\"setting\"} ) \r\n\tpublic boolean checkAbout() {\n\t\tboolean flag = oTest.checkAbout();\r\n\t\tAssertion.verifyEquals(flag, true);\r\n\t\treturn flag;\r\n\t}", "public boolean activate();", "public void setup(){\n\t\tgui.getCenter().setText(\"No book info is yet available. Submit some!\");\n\t\tconstrain(gui.getGroups());\n\t\t\n\t\tgui.getMasterCheck().selectedProperty().addListener(new ChangeListener<Boolean>() {\n\t\t @Override\n\t\t public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) {\n\t\t for (InputGroup group: gui.getGroups()){\n\t\t \tgroup.getCheck().setSelected(newValue);\n\t\t }\n\t\t }\n\t\t});\n\t}", "@Override\n public boolean equals(Object object) {\n if (!(object instanceof Tools)) {\n return false;\n }\n Tools other = (Tools) object;\n if ((this.toolid == null && other.toolid != null) || (this.toolid != null && !this.toolid.equals(other.toolid))) {\n return false;\n }\n return true;\n }", "public void setToolnum(String toolnum) {\r\n this.toolnum = toolnum;\r\n }", "void setManualCheck (boolean value);", "void notifySpyModeToggle();", "public void setTool(final Tool theTool) {\n removeMouseListener(myCurrentTool);\n removeMouseMotionListener(myCurrentTool);\n myCurrentTool = theTool;\n addMouseListener(myCurrentTool);\n addMouseMotionListener(myCurrentTool);\n }", "public void enable(){\r\n\t\tthis.activ = true;\r\n\t}", "void setPowerBox(boolean powerBox);", "public void setUpdatingTaskStatusUpdatesResourceStatus(boolean flag)\r\n {\r\n m_updatingTaskStatusUpdatesResourceStatus = flag;\r\n }", "public static void setXmlEnableValidationFromGui(Boolean inputStatus)\r\n {\r\n enableValidationFromGui = inputStatus;\r\n }", "public void enableSelfView(boolean val);", "public void operationSet() {\r\n\r\n\t\t// Pane aktivieren\r\n\t\tdisableContentPanes();\r\n\t\tpaneOperation.setVisible(true);\r\n\r\n\t\t// Neue Operation anlegen\r\n\t\tif (listOperation.getSelectionModel().getSelectedItem()\r\n\t\t\t\t.equals(\"hinzufügen...\")) {\r\n\t\t\tstatusFeldText.setText(\"Neue Operationen hinzufügen...\");\r\n\t\t}\r\n\r\n\t\t// Operation bearbeiten\r\n\t\telse {\r\n\t\t\tstatusFeldText.setText(listOperation.getSelectionModel()\r\n\t\t\t\t\t.getSelectedItems() + \" bearbeiten...\");\r\n\t\t}\r\n\r\n\t}", "public void setStatus(boolean newstatus){activestatus = newstatus;}", "public void toolAdded(ToolGroupEvent evt) {\n SimpleTool tool = (SimpleTool)evt.getChild();\n addToolButton(tool, tool.getToolID());\n }", "public void setCheckingDirtyChildPainters(boolean b)\n/* */ {\n/* 265 */ boolean old = isCheckingDirtyChildPainters();\n/* 266 */ this.checkForDirtyChildPainters = b;\n/* 267 */ firePropertyChange(\"checkingDirtyChildPainters\", Boolean.valueOf(old), Boolean.valueOf(isCheckingDirtyChildPainters()));\n/* */ }", "public void setToolbarVisible(boolean b)\n {\n // The north panel is the one containing the toolbar and contact photo.\n toolbarPanel.setVisible(b);\n }", "public void status(boolean b) {\n status = b;\n }", "boolean isSetPowerBox();", "private void setButtonDisabled() {\n final boolean areProjects = mainController.selectedOrganisationProperty().getValue().getProjects().size() > 0;\n final boolean areTeams = mainController.selectedOrganisationProperty().getValue().getTeams().size() > 0;\n //allocateTeamButton.setDisable(!(areProjects && areTeams));\n }", "public void setEnabled(boolean aFlag) { _enabled = aFlag; }", "boolean isSetLastrun();", "void setEnabledStates(boolean commandStarted) {\n final boolean lockingTargetsState = !commandStarted;\n for (JMenuItem item : lockingTargets) {\n item.setEnabled(lockingTargetsState);\n }\n final boolean unlockingTargetsState = commandStarted;\n for (JMenuItem item : unlockingTargets) {\n item.setEnabled(unlockingTargetsState);\n }\n }", "public void setStable() {\n this.unstable = false;\n this.unstableTimeline.stop();\n this.statusLed.setFastBlink(false);\n if (this.shutdownButton.isSelected() == true) {\n this.statusLed.setStatus(\"off\");\n } else if (this.offlineButton.isSelected() == true) {\n this.statusLed.setStatus(\"warning\");\n } else {\n this.statusLed.setStatus(\"ok\");\n } \n }", "public void setBusy(boolean flag) {\n isBusy = flag;\n }", "private void setActiveActions() {\n\t\tnewBinaryContext.setEnabled(true);\n\t\tnewValuedContext.setEnabled(true);\n\t\tnewNestedContext.setEnabled(true);\n\t\topenContext.setEnabled(true);\n\t\tsaveContext.setEnabled(true);\n\t\tsaveAsContext.setEnabled(true);\n\t\tsaveAllContexts.setEnabled(true);\n\t\tcloseContext.setEnabled(true);\n\t\tcloseAllContexts.setEnabled(true);\n\t\tquitViewer.setEnabled(true);\n\n\t\tif (contextPanes.size() == 0) {\n\t\t\t/* Boutons de la toolbar */\n\t\t\tsaveBtn.setEnabled(false);\n\t\t\topenBtn.setEnabled(true);\n\t\t\tnewBinCtxBtn.setEnabled(true);\n\t\t\tremoveCtxBtn.setEnabled(false);\n\t\t\tnewAttributeBtn.setEnabled(false);\n\t\t\tnewObjectBtn.setEnabled(false);\n\t\t\tdelAttributeBtn.setEnabled(false);\n\t\t\tdelObjectBtn.setEnabled(false);\n\t\t\tshowLatBtn.setEnabled(false);\n\t\t\tshowRulesBtn.setEnabled(false);\n\n\t\t\t/* Elements du menu \"Edit\" */\n\t\t\taddEmptyLevel.setEnabled(false);\n\t\t\taddContextLevel.setEnabled(false);\n\t\t\tremoveLevel.setEnabled(false);\n\t\t\torderLevels.setEnabled(false);\n\t\t\taddObject.setEnabled(false);\n\t\t\taddAttribute.setEnabled(false);\n\t\t\tmergeAttributes.setEnabled(false);\n\t\t\tlogicalAttribute.setEnabled(false);\n\t\t\tcompareAttributes.setEnabled(false);\n\t\t\tremoveObject.setEnabled(false);\n\t\t\tremoveAttribute.setEnabled(false);\n\t\t\tcreateClusters.setEnabled(false);\n\t\t\tconvertToBinary.setEnabled(false);\n\t\t\tconvertToNested.setEnabled(false);\n\n\t\t\t/* Elements du menu \"Lattice\" */\n\t\t\tshowLatticeMenu.setEnabled(false);\n\n\t\t\t/* Elements du menu \"Rules\" */\n\t\t\tshowRulesMenu.setEnabled(false);\n\t\t\treturn;\n\t\t}\n\n\t\tContextTableScrollPane selectedPane = contextPanes\n\t\t\t\t.elementAt(currentContextIdx);\n\t\tContext currentContext = ((ContextTableModel) selectedPane\n\t\t\t\t.getContextTable().getModel()).getContext();\n\n\t\tif (currentContext instanceof NestedContext) {\n\t\t\t/* Boutons de la toolbar */\n\t\t\tsaveBtn.setEnabled(true);\n\t\t\topenBtn.setEnabled(true);\n\t\t\tnewBinCtxBtn.setEnabled(true);\n\t\t\tremoveCtxBtn.setEnabled(true);\n\t\t\tnewAttributeBtn.setEnabled(false);\n\t\t\tnewObjectBtn.setEnabled(false);\n\t\t\tdelAttributeBtn.setEnabled(false);\n\t\t\tdelObjectBtn.setEnabled(false);\n\t\t\tshowLatBtn.setEnabled(true);\n\t\t\tshowRulesBtn.setEnabled(true);\n\n\t\t\t/* Elements du menu \"Edit\" */\n\t\t\taddEmptyLevel.setEnabled(true);\n\t\t\taddContextLevel.setEnabled(true);\n\t\t\tremoveLevel.setEnabled(true);\n\t\t\torderLevels.setEnabled(true);\n\t\t\taddObject.setEnabled(false);\n\t\t\taddAttribute.setEnabled(false);\n\t\t\tmergeAttributes.setEnabled(false);\n\t\t\tlogicalAttribute.setEnabled(false);\n\t\t\tcompareAttributes.setEnabled(false);\n\t\t\tremoveObject.setEnabled(false);\n\t\t\tremoveAttribute.setEnabled(false);\n\t\t\tcreateClusters.setEnabled(false);\n\t\t\tconvertToBinary.setEnabled(true);\n\t\t\tconvertToNested.setEnabled(false);\n\n\t\t\t/* Elements du menu \"Lattice\" */\n\t\t\tshowLatticeMenu.setEnabled(true);\n\n\t\t\t/* Elements du menu \"Rules\" */\n\t\t\tshowRulesMenu.setEnabled(true);\n\t\t}\n\n\t\telse if (currentContext instanceof BinaryContext) {\n\t\t\t/* Boutons de la toolbar */\n\t\t\tsaveBtn.setEnabled(true);\n\t\t\topenBtn.setEnabled(true);\n\t\t\tnewBinCtxBtn.setEnabled(true);\n\t\t\tremoveCtxBtn.setEnabled(true);\n\t\t\tnewAttributeBtn.setEnabled(true);\n\t\t\tnewObjectBtn.setEnabled(true);\n\t\t\tdelAttributeBtn.setEnabled(true);\n\t\t\tdelObjectBtn.setEnabled(true);\n\t\t\tshowLatBtn.setEnabled(true);\n\t\t\tshowRulesBtn.setEnabled(true);\n\n\t\t\t/* Elements du menu \"Edit\" */\n\t\t\taddEmptyLevel.setEnabled(false);\n\t\t\taddContextLevel.setEnabled(false);\n\t\t\tremoveLevel.setEnabled(false);\n\t\t\torderLevels.setEnabled(false);\n\t\t\taddObject.setEnabled(true);\n\t\t\taddAttribute.setEnabled(true);\n\t\t\tmergeAttributes.setEnabled(true);\n\t\t\tlogicalAttribute.setEnabled(true);\n\t\t\tremoveObject.setEnabled(true);\n\t\t\tremoveAttribute.setEnabled(true);\n\t\t\tcreateClusters.setEnabled(true);\n\t\t\tcompareAttributes.setEnabled(true);\n\t\t\tconvertToBinary.setEnabled(false);\n\t\t\tconvertToNested.setEnabled(true);\n\n\t\t\t/* Elements du menu \"Lattice\" */\n\t\t\tshowLatticeMenu.setEnabled(true);\n\n\t\t\t/* Elements du menu \"Rules\" */\n\t\t\tshowRulesMenu.setEnabled(true);\n\t\t}\n\n\t\telse if (currentContext instanceof ValuedContext) {\n\t\t\t/* Boutons de la toolbar */\n\t\t\tsaveBtn.setEnabled(true);\n\t\t\topenBtn.setEnabled(true);\n\t\t\tnewBinCtxBtn.setEnabled(true);\n\t\t\tremoveCtxBtn.setEnabled(true);\n\t\t\tnewAttributeBtn.setEnabled(true);\n\t\t\tnewObjectBtn.setEnabled(true);\n\t\t\tdelAttributeBtn.setEnabled(true);\n\t\t\tdelObjectBtn.setEnabled(true);\n\t\t\tshowLatBtn.setEnabled(false);\n\t\t\tshowRulesBtn.setEnabled(false);\n\n\t\t\t/* Elements du menu \"Edit\" */\n\t\t\taddEmptyLevel.setEnabled(false);\n\t\t\taddContextLevel.setEnabled(false);\n\t\t\tremoveLevel.setEnabled(false);\n\t\t\torderLevels.setEnabled(false);\n\t\t\taddObject.setEnabled(true);\n\t\t\taddAttribute.setEnabled(true);\n\t\t\tmergeAttributes.setEnabled(true);\n\t\t\tlogicalAttribute.setEnabled(false);\n\t\t\tcompareAttributes.setEnabled(false);\n\t\t\tremoveObject.setEnabled(true);\n\t\t\tremoveAttribute.setEnabled(true);\n\t\t\tcreateClusters.setEnabled(false);\n\t\t\tconvertToBinary.setEnabled(true);\n\t\t\tconvertToNested.setEnabled(false);\n\n\t\t\t/* Elements du menu \"Lattice\" */\n\t\t\tshowLatticeMenu.setEnabled(false);\n\n\t\t\t/* Elements du menu \"Rules\" */\n\t\t\tshowRulesMenu.setEnabled(false);\n\t\t}\n\n\t\telse {\n\t\t\t/* Boutons de la toolbar */\n\t\t\tsaveBtn.setEnabled(false);\n\t\t\topenBtn.setEnabled(false);\n\t\t\tnewBinCtxBtn.setEnabled(false);\n\t\t\tremoveCtxBtn.setEnabled(false);\n\t\t\tnewAttributeBtn.setEnabled(false);\n\t\t\tnewObjectBtn.setEnabled(false);\n\t\t\tdelAttributeBtn.setEnabled(false);\n\t\t\tdelObjectBtn.setEnabled(false);\n\t\t\tshowLatBtn.setEnabled(false);\n\t\t\tshowRulesBtn.setEnabled(false);\n\n\t\t\t/* Elements du menu \"Edit\" */\n\t\t\taddEmptyLevel.setEnabled(false);\n\t\t\taddContextLevel.setEnabled(false);\n\t\t\tremoveLevel.setEnabled(false);\n\t\t\torderLevels.setEnabled(false);\n\t\t\taddObject.setEnabled(false);\n\t\t\taddAttribute.setEnabled(false);\n\t\t\tmergeAttributes.setEnabled(false);\n\t\t\tlogicalAttribute.setEnabled(false);\n\t\t\tcompareAttributes.setEnabled(false);\n\t\t\tremoveObject.setEnabled(false);\n\t\t\tremoveAttribute.setEnabled(false);\n\t\t\tcreateClusters.setEnabled(false);\n\t\t\tconvertToBinary.setEnabled(false);\n\t\t\tconvertToNested.setEnabled(false);\n\n\t\t\t/* Elements du menu \"Lattice\" */\n\t\t\tshowLatticeMenu.setEnabled(false);\n\n\t\t\t/* Elements du menu \"Rules\" */\n\t\t\tshowRulesMenu.setEnabled(false);\n\t\t}\n\t}", "public void loadStatus() {\r\n\r\n\t\ttry {\r\n\t\t\tRemoteOffice objRemoteOffice = Application.UNITY_CLIENT_APPLICATION.getreRemoteOffice();\r\n\t\t\tif (objRemoteOffice != null) {\r\n\t\t\t\tlogTrace(this.getClass().getName(), \"loadStaus()\", \"Going to load the status of the components from broadworks.\");\r\n\r\n\t\t\t\tboolean isActive = objRemoteOffice.isActive();\r\n\t\t\t\tString phnumber = objRemoteOffice.getPhoneNumber();\r\n\t\t\t\tobjRemoteOfficeEnableJCheckBox.setSelected(isActive);\r\n\t\t\t\tobjRemoteOfficeJTextField.setText(phnumber);\r\n\r\n\t\t\t\tif (objRemoteOfficeEnableJCheckBox.isSelected()) {\r\n\t\t\t\t\tobjRemoteOfficeJTextField.setEnabled(true);\r\n\t\t\t\t\tobjRemoteOfficeJLabel.setEnabled(true);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tobjRemoteOfficeJTextField.setEnabled(false);\r\n\t\t\t\t\tobjRemoteOfficeJLabel.setEnabled(false);\r\n\t\t\t\t}\r\n\t\t\t\tlogTrace(this.getClass().getName(), \"loadStaus()\", \"component status loaded successfully\");\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\r\n\t\t\tlogTrace(this.getClass().getName(), \"loadStaus()\", \"component status not loaded successfully\");\r\n\t\t}\r\n\t}", "public void activate(){\r\n\t\tactive=true;\r\n\t}", "@FXML\n void selectChecking(ActionEvent event) {\n \tdirectDep.setSelected(false);\n \tisLoyal.setSelected(false);\n \tdirectDep.setDisable(false);\n \tisLoyal.setDisable(true);\n }", "public void setActive(int id){\r\n\t\tif(_elementList.containsKey(id)){\r\n\t\t\t_elementList.get(id).isHit=false;\r\n\t\t\t_elementList.get(id).isActive=true;\t\t\t\r\n\t//\t\tSystem.out.println(\"active Checkpoint id\"+id);\r\n\t\t}else{\r\n\t\t\tSystem.out.println(\"Error CheckpointPool.setActive(\"+Integer.toHexString(id)+\") there is no such checkpoint\");\r\n\t\t}\r\n\t}", "private void refreshIdentifyButtonEnabledStatus() {\n if (detected && mPersonGroupId != null) {\n setIdentifyButtonEnabledStatus(true);\n } else {\n setIdentifyButtonEnabledStatus(false);\n }\n }", "default void setNeedToBeUpdated(boolean flag)\n {\n getUpdateState().update(flag);\n }", "void markInactive();", "public void setCargoIntookState() {\n redLED.set(true);\n greenLED.set(false);\n blueLED.set(false);\n }", "private void checkEnabled() {\n }", "public void setActive() {\n setState(true);\n }", "void xsetPowerBox(org.apache.xmlbeans.XmlBoolean powerBox);", "private void setUIState(WorkoutServiceStatus status) {\n\n\t\tboolean shouldEnableTimer = false;\n\n\t\t// If we can't start a new workout, and we're not monitoring, then we're in the \"setup\" phase.\n\t\tif (status == null || !(status.canStartNewWorkout() || status.isMonitoring())) {\n\t\t\t//symptoms and notifications are disabled\n//\t\t\tbtnSymptoms.setEnabled(false);\n//\t\t\tbtnNotifications.setEnabled(false);\n\t\t\tbtnSelectWorkout.setEnabled(false);\n\t\t\tbtnStartWorkout.setVisibility(View.INVISIBLE);\n\t\t\tbtnStopWorkout.setVisibility(View.INVISIBLE);\n\t\t}\n\n\t\t// If we're monitoring, we're in the \"workout\" phase.\n\t\telse if (status.isMonitoring()) {\n//\t\t\tbtnSymptoms.setEnabled(true);\n//\t\t\tbtnNotifications.setEnabled(true);\n\t\t\tbtnSelectWorkout.setEnabled(false);\n\t\t\tbtnStartWorkout.setVisibility(View.INVISIBLE);\n\t\t\tbtnStopWorkout.setVisibility(View.VISIBLE);\n\t\t\tshouldEnableTimer = true;\n\t\t}\n\n\t\t// if we're not monitoring (but we can start a new workout), we're in the \"ready\" phase.\n\t\telse {\n//\t\t\tbtnSymptoms.setEnabled(false);\n//\t\t\tbtnNotifications.setEnabled(false);\n\t\t\tbtnSelectWorkout.setEnabled(true);\n\t\t\tbtnStartWorkout.setVisibility(View.VISIBLE);\n\t\t\tbtnStopWorkout.setVisibility(View.INVISIBLE);\n\t\t}\n\n\t\t// If we're not fully connected to both Odin and the Bioharness, show the connection dialog.\n\t\tif (status == null || status.getBioharnessConnectivityStatus() != BHConnectivityStatus.CONNECTED) {\n\t\t\t//\tTODO: REMOVE ODIN CONNECTION\n//\t\t\t\t|| status.getOdinConnectivityStatus() != EndpointConnectionStatus.CONNECTED) {\n\n\n\t\t\tif (this.connectionDialog == null) {\n\t\t\t\tthis.connectionDialog = new ConnectionProgressDialogFragment();\n\n\t\t\t\tif (activityVisible) {\n\t\t\t\t\tthis.connectionDialog.show(this.getSupportFragmentManager(), \"ConnectionDialog\");\n\t\t\t\t} else {\n\t\t\t\t\tdismissConnectionDialogOnResume = false;\n\t\t\t\t\tshowConnectionDialogOnResume = true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (status != null) {\n\t\t\t\tthis.connectionDialog.setBioharnessConnectionStatus(status.getBioharnessConnectivityStatus());\n\t\t\t\t//\tTODO: REMOVE ODIN CONNECTION\n//\t\t\t\tthis.connectionDialog.setOdinConnectionStatus(status.getOdinConnectivityStatus());\n\t\t\t} else {\n\t\t\t\tthis.connectionDialog.setBioharnessConnectionStatus(BHConnectivityStatus.DISCONNECTED);\n\t\t\t\tthis.connectionDialog.setOdinConnectionStatus(EndpointConnectionStatus.DISCONNECTED);\n\t\t\t}\n\n\t\t}\n\n\t\t// Otherwise, hide it.\n\t\telse {\n\t\t\tif (this.connectionDialog != null) {\n\t\t\t\tif (activityVisible) {\n\t\t\t\t\tthis.connectionDialog.dismiss();\n\t\t\t\t\tthis.connectionDialog = null;\n\t\t\t\t} else {\n\t\t\t\t\tdismissConnectionDialogOnResume = true;\n\t\t\t\t\tshowConnectionDialogOnResume = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If the timer should be enabled, but isn't, enable it now. Also enable navigation\n\t\tif (shouldEnableTimer && timerUpdateThread == null) {\n\t\t\ttimerUpdateThread = new Thread(timerUpdateTask);\n\t\t\ttimerUpdateThread.setDaemon(true);\n\t\t\ttimerUpdateThread.start();\n\t\t\tisPaused = false;\n\t\t\tWorkoutService.setIsPaused(false);\n\t\t}\n\n\t\t// If the timer should be disabled, but is enabled, disable it now.\n\t\telse if (!shouldEnableTimer && timerUpdateThread != null) {\n\t\t\ttimerUpdateThread.interrupt();\n\t\t\ttry {\n\t\t\t\ttimerUpdateThread.join();\n\t\t\t} catch (InterruptedException e) {\n\t\t\t}\n\t\t\ttimerUpdateThread = null;\n\t\t\tisPaused = true;\n\t\t\tWorkoutService.setIsPaused(true);\n\t\t}\n\n\t}", "public abstract void setCheck(Boolean check);", "public void assignAddingCalSuite(final boolean val) {\n addingCalSuite = val;\n }", "void gui(){\n _hasGUI = true;\n }", "private void setDirty(boolean flag) {\n\tmain.getState().dirty = flag;\n\tif (main.bSave != null)\n\t main.bSave.setEnabled(flag);\n }", "public void tellChanged(SearchTool searchTool) {\n updateAll();\n }", "public void changeAvailability() {\n\t\tavailability = !availability;\n\t}", "static synchronized boolean isRegistered(Tool tool) {\n\t\treturn getTool(tool.getItem()) != null;\n\t}", "public static interface OnToolListener {\n\n\t\t/**\n\t\t * On tool completed.\n\t\t */\n\t\tvoid onToolCompleted();\n\t}", "public void onFlagCheck(IRobot robot){\n TiledMapTileLayer flagLayer = (TiledMapTileLayer) tiledMap.getLayers().get(\"Flag\");\n if(flagLayer.getCell(robot.getXPos(),robot.getYPos()) != null){\n robot.heal();\n robot.setRespawnPoint(robot.getPos());\n }\n }", "private void addToolButton(Tool tool, String toolId) {\n \n String iconPath = tool.getIcon();\n\n // create the button\n JToolButton button = getToggleButton(tool, toolId);\n \n // disable if it is loading\n button.setLoaded(false);\n \n // add to the data maps\n toolIdToButtonMap.put(toolId, button);\n urlToButtonMap.put(iconPath, button);\n toolIdToToolMap.put(toolId, tool);\n\n // put the proxy image in place\n if (tool instanceof ToolGroup && !(tool instanceof ToolSwitch)) {\n \n // create the necessary icons for button state\n generateButtonIcons(button, folderImage); \n \n // allow selection\n button.setLoaded(true);\n button.addItemListener(this);\n\n } else {\n \n // set count failures to 0\n loadFailureCounts.put(iconPath, 0);\n \n String category = tool.getCategory(); \n if (category != null && !category.equals(\"Category.Loading\")) {\n \n // check the cache for the resource\n if (clientCache.doesAssetExist(iconPath)) {\n \n // call the resource loaded directly\n try {\n InputStream resourceStream =\n clientCache.retrieveAsset(iconPath);\n resourceLoaded(iconPath, resourceStream);\n } catch (IOException io) {\n errorReporter.errorReport(io.getMessage(), io);\n } \n \n } else {\n \n // now try to lazy load the actual image\n resourceLoader.loadResource(iconPath, this);\n \n }\n \n } else {\n \n // set the loading image\n button.setIcon(loadingImage);\n\n }\n\n }\n\n revalidate();\n \n }", "public Tool getTool() {\n\treturn tool;\n }", "@Override\n public void walletBusyChange(boolean newWalletIsBusy) {\n if (super.bitcoinController.getModel().getActivePerWalletModelData().isBusy()) {\n // Wallet is busy with another operation that may change the private keys - Action is disabled.\n putValue(SHORT_DESCRIPTION, this.bitcoinController.getLocaliser().getString(\"multiBitSubmitAction.walletIsBusy\", \n new Object[]{controller.getLocaliser().getString(this.bitcoinController.getModel().getActivePerWalletModelData().getBusyTaskKey())}));\n setEnabled(false); \n } else {\n // Enable unless wallet has been modified by another process.\n if (!super.bitcoinController.getModel().getActivePerWalletModelData().isFilesHaveBeenChangedByAnotherProcess()) {\n putValue(SHORT_DESCRIPTION, this.bitcoinController.getLocaliser().getString(\"createNewReceivingAddressSubmitAction.tooltip\"));\n setEnabled(true);\n }\n \n // Make sure the cancel button is enabled.\n createNewReceivingAddressPanel.getCancelButton().setEnabled(true);\n }\n }", "public boolean isNeedsAlert() {\n return current.needsAlert();\n }", "public void updateVisible(){\n if (serviceManager.isCustomerQueMode() == true && serviceManager.isManagerMode() == false) {\n this.setVisible(true);\n } else {\n this.setVisible(false);\n }\n// System.out.println(serviceManager.isCustomerQueMode());\n }", "public void setBusy() {\n\t\tlabelReady.setEnabled(false);\n\t\tlabelBusy.setEnabled(true);\n\t\tsetStatusBar(WAIT_MOVE_MSG);\n\t}", "@Override\n public boolean activate() {\n //When will this activate?\n return Areas.FALADOR.contains(ctx.players.local().tile())\n && ctx.widgets.component(1371,0).visible()\n && !ctx.objects.select().name(\"Waterpump\").within(6.0).isEmpty();\n }", "public void setAvailable(boolean x){\n availabile = x;\n }" ]
[ "0.65698856", "0.62035424", "0.6010128", "0.5903436", "0.5750689", "0.5608171", "0.5598315", "0.5596144", "0.5593652", "0.555964", "0.54366666", "0.5397872", "0.5373154", "0.5367052", "0.53474426", "0.5310991", "0.52596813", "0.5222443", "0.521712", "0.5213102", "0.5194611", "0.5176794", "0.51501817", "0.5148741", "0.51387197", "0.5130702", "0.513036", "0.5118104", "0.5115758", "0.5095672", "0.5082189", "0.5073312", "0.5061298", "0.5041352", "0.50319874", "0.50165164", "0.5016111", "0.50140935", "0.49954158", "0.4982611", "0.49819624", "0.4956597", "0.49487346", "0.49443057", "0.49397466", "0.49394163", "0.49363035", "0.4933767", "0.49295235", "0.49254122", "0.49178877", "0.49077722", "0.49044955", "0.48969266", "0.48941728", "0.48940572", "0.48916596", "0.4890782", "0.48890918", "0.4883065", "0.4880287", "0.4871988", "0.48710227", "0.48675695", "0.486364", "0.48634708", "0.48462287", "0.4842095", "0.48379037", "0.4835758", "0.4835416", "0.48347142", "0.4833758", "0.482082", "0.4818881", "0.48032126", "0.479893", "0.47850856", "0.47827086", "0.4781748", "0.4779889", "0.4778277", "0.47733977", "0.47698206", "0.47682312", "0.47641692", "0.47627592", "0.47577202", "0.4755861", "0.475387", "0.47486687", "0.47482026", "0.47472093", "0.4744833", "0.47393876", "0.47380048", "0.47378427", "0.47357994", "0.47262287", "0.47242925", "0.472351" ]
0.0
-1
Separates the string by the first instance of the given character.
private static String[] partition(String str, char character) { int index = str.indexOf(character); String[] pair = new String[2]; if (index > -1) { // Gets rid of a space in the end of the first partition. pair[0] = str.substring(0, index).trim(); pair[1] = str.substring(index + 1).trim(); } else { // If there exists no '/' in the string, set the tail of the pair as an empty string. pair[0] = str; pair[1] = ""; } return pair; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static char first(String s) {\n return s.charAt(0);\n }", "public static char first(String s) {\n\treturn s.charAt(0);\n\t}", "public static String beforeFirst(final String s, final char c)\n\t{\n\t\tif (s == null)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\tfinal int index = s.indexOf(c);\n\n\t\tif (index == -1)\n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\n\t\treturn s.substring(0, index);\n\t}", "char getFirstChar(String input) {\n\t\tchar firstChar = input.charAt(0), temp;\n\t\tint count;\n\t\tfor(int index=0; index<input.length(); index++) {\n\t\t\ttemp = input.charAt(index);\n\t\t\tcount=0;\n\t\t\tfor(int innerIndex=0; innerIndex<input.length(); innerIndex++) {\n\t\t\t\tif(temp == input.charAt(innerIndex)) \n\t\t\t\t\tcount++;\n\t\t\t}\n\t\t\tif(count==1) {\n\t\t\t\tfirstChar = temp;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn firstChar;\n\t}", "public static char firstLetter(String s){\r\n\t\tchar firstLetter = 0;\r\n\t\tfor (int i = 0; i < s.length(); i++) {\r\n\t\t\tif(Character.isLetter(s.charAt(i))){\r\n\t\t\tfirstLetter = s.charAt(i);\r\n\t\t\treturn firstLetter;\r\n\t\t\t}\r\n\t\t}return firstLetter;\r\n\t}", "public void firstCharacter() {\n\t\tString name = \"martin\";\n\t\tchar letter = name.charAt(5);\n\t\tSystem.out.println(letter);\n\t}", "private String removeFirstChar(String name) {\n\t\treturn name.substring(1, name.length());\n\t}", "public String atFirst(String str) {\r\n return str.length() > 1 ? str.substring(0, 2) : (str + \"@@\").substring(0, 2);\r\n }", "public static String delFirstChar(String word){\n\t\tif(word.length() <= 1){\n\t\t\treturn word;\n\t\t}\n\t\tword = word.substring(1, word.length());\n\t\tguessPW(word);\n\t\treturn word;\n\n\t}", "private Token scanString(LocatedChar firstChar) {\n\t\tStringBuffer buffer = new StringBuffer();\n\t\tappendSubsequentString(buffer);\n\t\tLocatedChar ch = input.peek();\n\t\tif(ch.matchChar('\"')) {\n\t\t\tinput.next();\n\t\t\treturn StringToken.make(firstChar, buffer.toString());\n\t\t} else {\n\t\t\tlexicalError(ch, \"malformed string\");\n\t\t\treturn findNextToken();\n\t\t}\n\t}", "public static String[] splitOnce(char c, String cs) {\n int max = cs.length();\n if (max == 0) {\n return new String[0];\n }\n int splitAt = -1;\n for (int i = 0; i < cs.length(); i++) {\n if (c == cs.charAt(i)) {\n splitAt = i;\n break;\n }\n }\n if (splitAt == -1) {\n return new String[]{cs};\n }\n String left = cs.subSequence(0, splitAt).toString();\n if (splitAt < max - 1) {\n String right = cs.subSequence(splitAt + 1, max).toString();\n return new String[]{left, right};\n }\n return new String[]{left};\n }", "public static String afterFirst(final String s, final char c)\n\t{\n\t\tif (s == null)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\tfinal int index = s.indexOf(c);\n\n\t\tif (index == -1)\n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\n\t\treturn s.substring(index + 1);\n\t}", "private String firstSentenceSplitting(String s) {\n // Double new-line means a new sentence:\n s = paragraph.matcher(s).replaceAll(\"$1\" + EOS);\n // Punctuation followed by whitespace means a new sentence:\n s = punctWhitespace.matcher(s).replaceAll(\"$1\" + EOS);\n // New (compared to the perl module): Punctuation followed by uppercase followed\n // by non-uppercase character (except dot) means a new sentence:\n s = punctUpperLower.matcher(s).replaceAll(\"$1\" + EOS + \"$2\");\n // Break also when single letter comes before punctuation:\n s = letterPunct.matcher(s).replaceAll(\"$1\" + EOS);\n return s;\n }", "public static List<String> splitString(String s, char c) {\r\n List<String> result = new ArrayList<String>();\r\n int startPos = 0;\r\n while (true) {\r\n int pos = s.indexOf(c, startPos);\r\n if (pos == -1) {\r\n break;\r\n }\r\n result.add(s.substring(startPos, pos));\r\n startPos = pos + 1;\r\n }\r\n if (startPos != s.length()) {\r\n result.add(s.substring(startPos, s.length()));\r\n }\r\n return result;\r\n }", "public String sortTheCharInString(String s){\n\n\t\treturn Stream.of(s.split(\"\"))\n\t\t\t\t.sorted()\n\t\t\t\t.collect(Collectors.joining());\n\t}", "public char getFirstChar(String hanyuString) {\n\t\tchar firstChar = getPinyin(hanyuString, HanyuPinyinCaseType.UPPERCASE).charAt(0);\n\t\tif (firstChar == ' ') {\n\t\t\tfirstChar = '#';\n\t\t}\n\t\treturn firstChar;\n\n\t}", "public static String firstPathComponent(final String path, final char separator)\n\t{\n\t\tfinal int index = path.indexOf(separator);\n\n\t\tif (index == -1)\n\t\t{\n\t\t\treturn path;\n\t\t}\n\n\t\treturn path.substring(0, index);\n\t}", "public String firstHalf(String str) {\r\n return str.substring(0, str.length() / 2);\r\n }", "public static String[] split(final String s, final char c)\n\t{\n\t\tif (s == null)\n\t\t{\n\t\t\treturn new String[0];\n\t\t}\n\t\tfinal List<String> strings = new ArrayList<String>();\n\t\tint pos = 0;\n\t\twhile (true)\n\t\t{\n\t\t\tint next = s.indexOf(c, pos);\n\t\t\tif (next == -1)\n\t\t\t{\n\t\t\t\tstrings.add(s.substring(pos));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tstrings.add(s.substring(pos, next));\n\t\t\t}\n\t\t\tpos = next + 1;\n\t\t}\n\t\tfinal String[] result = new String[strings.size()];\n\t\tstrings.toArray(result);\n\t\treturn result;\n\t}", "public static String capFirstChar(String word) {\n \tif(word == null || word.length() == 0)\n \t\treturn word;\n\n \tword = word.toLowerCase().replace('_', ' ');\n\t\treturn Character.valueOf(Character.toUpperCase(word.charAt(0))).toString() + word.substring(1);\n }", "char startChar();", "public static String firstLettertoUpperCase(String letter) {\n return letter.substring(0, 1).toUpperCase() + letter.substring(1);\n }", "public static String lowerCaseFirstChar(String str){\r\n\t\treturn str.substring(0, 1).toLowerCase() + str.substring(1); \r\n\t}", "public static char getLetter(String s){\n //A variable used in the helper method\n int i = 0;\n return getLetter(codeTree, s, i);\n }", "public static CharSequence[] splitOnce(char c, CharSequence cs) {\n int max = cs.length();\n if (max == 0) {\n return new CharSequence[0];\n }\n int splitAt = -1;\n for (int i = 0; i < cs.length(); i++) {\n if (c == cs.charAt(i)) {\n splitAt = i;\n break;\n }\n }\n if (splitAt == -1) {\n return new CharSequence[]{cs};\n }\n CharSequence left = cs.subSequence(0, splitAt);\n if (splitAt < max - 1) {\n CharSequence right = cs.subSequence(splitAt + 1, max);\n return new CharSequence[]{left, right};\n }\n return new CharSequence[]{left};\n }", "private Token scanChar(LocatedChar firstChar) {\n\t\tStringBuffer buffer = new StringBuffer();\n\t\tif(input.peek().matchChar('#')) {\n\t\t\tbuffer.append(input.next().getCharacter());\n\t\t\tLocatedChar next = input.peek();\n\t\t\tif(next.matchChar('#') || Character.isDigit(next.getCharacter())) {\n\t\t\t\tbuffer.append(input.next().getCharacter());\n\t\t\t\treturn CharToken.make(firstChar, buffer.toString(),next.getCharacter());\n\t\t\t} \n\t\t\telse {\n\t\t\t\tlexicalError(firstChar, \"malformed char of form ##[0..9#]\");\n\t\t\t\treturn findNextToken();\n\t\t\t}\n\t\t} \n\t\telse if(input.peek().isOctal()) {\n\t\t\tappendSubsequentOctals(buffer);\n\t\t\tint val;\n\t\t\ttry {\n\t\t\t\tval = Integer.parseInt(buffer.toString(), 8);\n\t\t\t} catch (NumberFormatException e) {\n\t\t\t\tlexicalError(firstChar, \"char value out of integer bounds\");\n\t\t\t\treturn findNextToken();\n\t\t\t}\n\t\t\tif(isPrintableChar((char)val)) {\n\t\t\t\treturn CharToken.make(firstChar, buffer.toString(), (char)val);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlexicalError(firstChar, \"char value not printable\");\n\t\t\t\treturn findNextToken();\n\t\t\t}\n\t\t}\n\t\telse if(isPrintableChar(input.peek().getCharacter())){\n\t\t\tLocatedChar next = input.next();\n\t\t\tbuffer.append(next.getCharacter());\n\t\t\treturn CharToken.make(firstChar, buffer.toString(), next.getCharacter());\n\t\t}\n\t\telse {\n\t\t\tlexicalError(firstChar, \"malformed char of form #@\");\n\t\t\treturn findNextToken();\n\t\t}\n\t}", "public char readChar(){\n\t\tscanner.useDelimiter(EMPTY_PATTERN);\n\t\ttry {\n\t\t\tString ch=scanner.next();\n\t\t\tassert ch.length()==1:\"In.readChar() error\";\n\t\t\tscanner.useDelimiter(WHITESPACE_PATTERN);\n\t\t\treturn ch.charAt(0);\n\t\t}catch (NoSuchElementException e){\n\t\t\tthrow new NoSuchElementException(\"noSuchElement\");\n\t\t}\n\t}", "public static String[] splitString(char delim, String string) {\n\t Vector<String> res = new Vector<String>();\n\t int len = string.length();\n\t int start = 0;\n\t for (int i=0; i<len; i++) {\n\t\t if (string.charAt(i) == delim) {\n\t\t\t res.add(string.substring(start, i));\n\t\t\t start = i+1;\n\t\t }\n\t }\n\t res.add(start==len ? \"\" : string.substring(start));\n\t return res.toArray(new String[res.size()]);\n }", "public static String firstPathComponent(final String path, final char separator)\n\t{\n\t\tif (path == null)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\tfinal int index = path.indexOf(separator);\n\n\t\tif (index == -1)\n\t\t{\n\t\t\treturn path;\n\t\t}\n\n\t\treturn path.substring(0, index);\n\t}", "public static Character getFirstUniqueCharacter( String stringToAnalyze ) {\n\n Character firstUniqueChar = null;\n\n // If the string provided is not null\n if( stringToAnalyze != null ) {\n\n // Store the length of the string\n int lenOfStr = stringToAnalyze.length();\n\n // If it's a valid string with at least one character, we can continue\n if( lenOfStr > 0 ) {\n\n // Create a TreeMap to hold the characters in the string and how often they appear\n TreeMap<Character, Integer> charCount = new TreeMap<Character, Integer>();\n\n // loop through the string\n for (int i = 0; i < lenOfStr; i++) {\n // Get the character at the current index\n char currentCharInStr = stringToAnalyze.charAt(i);\n // Put in the map, or increase the count if it's already in the map\n charCount.put(currentCharInStr, charCount.getOrDefault(currentCharInStr, 0) + 1);\n }\n\n // Go through the string once more\n for (int i = 0; i < lenOfStr; i++) {\n // Get the character at the current index\n char currentCharInStr = stringToAnalyze.charAt(i);\n // If it's a character that appears only once\n if (charCount.get(currentCharInStr) == 1) {\n // Set this as the first unique character\n firstUniqueChar = currentCharInStr;\n //Break out of the loop so that we don't replace this with future unique characters\n break;\n }\n }\n\n }\n\n }\n\n return firstUniqueChar;\n\n }", "public static char leerCaracter() { \n\t\tchar letra = sc.nextLine().charAt(0); // Lee una cadena y obtiene el primer caracter\n\t\treturn letra;\n\t}", "public static String getDigits(String s, String splitChar)\r\n {\r\n if(isEmpty(s))\r\n return s;\r\n \r\n StringBuffer buf = new StringBuffer();\r\n int len = s.length();\r\n boolean noPreDigit = false,firstDigit=true;\r\n for(int n=0; n < len; n++)\r\n {\r\n char c = s.charAt(n);\r\n if(Character.isDigit(c))\r\n {\r\n if(noPreDigit && !firstDigit)\r\n {\r\n buf.append(splitChar);\r\n } \r\n buf.append(c);\r\n noPreDigit = false;\r\n firstDigit = false;\r\n }\r\n else\r\n {\r\n noPreDigit = true;\r\n }\r\n }\r\n \r\n return buf.toString();\r\n }", "public static char toChar(String str) {\n/* 173 */ if (StringUtils.isEmpty(str)) {\n/* 174 */ throw new IllegalArgumentException(\"The String must not be empty\");\n/* */ }\n/* 176 */ return str.charAt(0);\n/* */ }", "public static Letter fromString(String character) {\n try {\n return Letter.valueOf(character);\n }\n catch (Exception e) {\n return null;\n }\n }", "public int firstUniqChar(String s) {\r\n int res = s.length();\r\n for (char c = 'a'; c <= 'z'; c++) {\r\n int index = s.indexOf(c);\r\n if (index != -1 && index == s.lastIndexOf(c)) res = Math.min(res, index);\r\n }\r\n\r\n return res == s.length() ? -1 : res;\r\n }", "public static String[] splitFirst(String source, String splitter)\n\t {\n\t Vector<String> rv = new Vector<String>();\n\t int last = 0;\n\t int next = 0;\n\n\t // find first splitter in source\n\t next = source.indexOf(splitter, last);\n\t if (next != -1)\n\t {\n\t // isolate from last thru before next\n\t rv.add(source.substring(last, next));\n\t last = next + splitter.length();\n\t }\n\n\t if (last < source.length())\n\t {\n\t rv.add(source.substring(last, source.length()));\n\t }\n\n\t // convert to array\n\t return (String[]) rv.toArray(new String[rv.size()]);\n\t }", "public static String beforeLast(final String s, final char c)\n\t{\n\t\tif (s == null)\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t\tfinal int index = s.lastIndexOf(c);\n\n\t\tif (index == -1)\n\t\t{\n\t\t\treturn \"\";\n\t\t}\n\n\t\treturn s.substring(0, index);\n\t}", "public static String[] split(char c, String value) {\n\t\t int count,idx;\n\t\t for(count=1,idx=value.indexOf(c);idx>=0;idx=value.indexOf(c,++idx),++count);\n\t\t String[] rv = new String[count];\n\t\t if(count==1) {\n\t\t\t rv[0]=value;\n\t\t } else {\n\t\t\t int last=0;\n\t\t\t count=-1;\n\t\t\t for(idx=value.indexOf(c);idx>=0;idx=value.indexOf(c,idx)) {\n\t\t\t\t rv[++count]=value.substring(last,idx);\n\t\t\t\t last = ++idx;\n\t\t\t }\n\t\t\t rv[++count]=value.substring(last);\n\t\t }\n\t\t return rv;\n\t }", "public static String[] split(final String s, final char c)\n\t{\n\t\tfinal List strings = new ArrayList();\n\t\tint pos = 0;\n\t\twhile (true)\n\t\t{\n\t\t\tint next = s.indexOf(c, pos);\n\t\t\tif (next == -1)\n\t\t\t{\n\t\t\t\tstrings.add(s.substring(pos));\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tstrings.add(s.substring(pos, next));\n\t\t\t}\n\t\t\tpos = next + 1;\n\t\t}\n\t\tfinal String[] result = new String[strings.size()];\n\t\tstrings.toArray(result);\n\t\treturn result;\n\t}", "@Override\n public final char first() {\n if (upper == lower) {\n return DONE;\n }\n return text.charAt(index = lower);\n }", "public char FirstAppearingOnce()\n {\n \n for(int i = 0; i < stringstream.size(); i++){\n char ch = stringstream.get(i);\n\t\t\tif(!rep.contains(ch)){\n return ch;\n }\n }\n return '#';\n }", "public Token delimiterMachine (int character) throws IOException {\n\t\tFileManipulator fileManipulator = FileManipulator.getInstance();\n\t\t// Variáveis de apoio\n\t\tString tokenValue = \"\";\n\t\ttokenValue += (char) character;\n\t\treturn new DelimiterToken(tokenValue, fileManipulator.getLineCounter(), fileManipulator.getColumnCounter());\n\t}", "public char getSponsorFirstChar() {\r\n\t\treturn sponsorFirstChar;\r\n\t}", "public static char inputChar(String p) {\n String c;\n while (true) {\n System.out.print(p);\n c = in.nextLine();\n if (c.length() == 1) {\n return c.charAt(0);\n } else {\n System.err.print(\"Must enter character, enter again! \");\n }\n }\n }", "public static String[] split(String s, char token) {\n\t\tint tokenCount = 0;\n\t\tfor(int i=0;i<s.length();i++) {\n\t\t\tif(s.charAt(i) == token) {\n\t\t\t\ttokenCount++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tString[] splits = new String[tokenCount+1];\n\t\t\n\t\tString temp = \"\";\n\t\tint tokenItr = 0;\n\t\tfor(int i=0;i<s.length();i++) {\n\t\t\tif(s.charAt(i) == token) {\n\t\t\t\tsplits[tokenItr] = temp;\n\t\t\t\ttokenItr++;\n\t\t\t\ttemp = \"\";\n\t\t\t} else {\n\t\t\t\ttemp+=s.charAt(i);\n\t\t\t}\n\t\t}\n\t\tsplits[tokenItr] = temp; //For the left over strings in s\n\t\t\n\t\treturn splits;\n\t}", "public abstract char getStarterChar();", "static String cutName(String input) { return input.split(\" \")[0]; }", "public char nextChar() {\n this.inputStr = this.s.nextLine();\n\n if (!inputStr.isEmpty()) {\n for (int i = 0; i < inputStr.length(); i++) {\n if (inputStr.charAt(i) >= 'A' && inputStr.charAt(i) <= 'Z') {\n return inputStr.charAt(i);\n } else if (inputStr.charAt(i) >= 'a' && inputStr.charAt(i) <= 'z') {\n return inputStr.charAt(i);\n }\n }\n }\n return ' ';\n }", "public char findFirstUniqueCharacter (String string) { // O(n*n)\n for (int i = 0; i < string.length(); i++) {\n char currentChar = string.charAt(i);\n\n if (i == string.lastIndexOf(currentChar)) {\n return currentChar;\n }\n }\n\n return '\\n';\n }", "int getStartCharIndex();", "public char FirstAppearingOnce_1(){\n char[] ch = sb.toString().toCharArray();\n for(char i : ch){\n if(chs[i] == 1){\n return i;\n }\n }\n return '#';\n }", "public String firstAlphabeticalTitleLetter(String title){\n\t\t int first = 0;\n if ( title.toLowerCase().startsWith(\"the \") ) { first = 4; }\n\t\t return title.substring(first, (first + 1));\n\t }", "private static char firstNonRepeatingCharacterV1(String str) {\n if(str == null) return '_';\n Map<Character, Integer> charCountMap = new HashMap<>();\n Set<Character> linkedHashSet = new LinkedHashSet<>();\n\n for(int i = 0; i < str.length(); i++) {\n char ch = str.charAt(i);\n if(charCountMap.containsKey(ch)) {\n charCountMap.put(ch, charCountMap.get(ch) + 1); // do not need this step\n } else {\n charCountMap.put(ch, 1);\n }\n }\n for(int i = 0; i < str.length(); i++) {\n char ch = str.charAt(i);\n if(charCountMap.get(ch) == 1) {\n return ch;\n }\n }\n return '_';\n }", "private Token scanIdentifier(LocatedChar firstChar) {\n\t\tStringBuffer buffer = new StringBuffer();\n\t\tbuffer.append(firstChar.getCharacter());\n\t\tappendSubsequentIdentifierChars(buffer);\n\n\t\tString lexeme = buffer.toString();\n\t\tif(Keyword.isAKeyword(lexeme)) {\n\t\t\treturn LextantToken.make(firstChar, lexeme, Keyword.forLexeme(lexeme));\n\t\t}\n\t\telse {\n\t\t\treturn IdentifierToken.make(firstChar, lexeme);\n\t\t}\n\t}", "public String firstAlphabeticalTitlePseudoLetter(String title){\n\t\t int first = 0;\n if ( title.toLowerCase().startsWith(\"the\") && !title.toLowerCase().startsWith(\"the \") ) { first = 3; }\n\t\t return title.substring(first, (first + 1));\n\t }", "public char FirstAppearingOnce()\n {\n String s1 = sb.toString();\n for (int i = 0; i < s1.length(); i++){\n String s2 = s1.replace(String.valueOf(s1.charAt(i)),\"\");//用空代替第i位出现的所有字符\n //如果某个字符出现一次,则s1和s2的长度只差1,如果有多个字符,那么不差1\n if (s1.length()-s2.length() == 1) return s1.charAt(i);\n }\n return '#';\n }", "private static int firstUniqChar1(String s) {\n int[] counts = new int[128];\n for (int i = 0; i < s.length(); i++) {\n int c = s.charAt(i);\n counts[c] = counts[c] + 1;\n }\n\n int uniqueIdx = -1;\n for (int i = 0; i < s.length(); i++) {\n if (counts[(int) s.charAt(i)] == 1) {\n uniqueIdx = i;\n break;\n }\n }\n\n return uniqueIdx;\n }", "public static ComparableCharSequence singleChar(char c) {\n switch (c) {\n case '\\n':\n return CR;\n case ',':\n return COMMA;\n case '.':\n return DOT;\n case ':':\n return COLON;\n case '{':\n return OPEN_CURLY;\n case '}':\n return CLOSE_CURLY;\n case '(':\n return OPEN_PAREN;\n case ')':\n return CLOSE_PAREN;\n case '[':\n return OPEN_SQUARE;\n case ']':\n return CLOSE_SQUARE;\n case '/':\n return SLASH;\n case '\\u2026':\n return ELLIPSIS;\n default:\n return new SingleCharSequence(c);\n }\n }", "private Token(char firstChar) {\r\n\t\tthis.text += firstChar;\r\n\t}", "private static char firstNonRepeatingCharacterV2(String str) {\n if(str == null) return '_';\n Map<Character, Integer> charCountMap = new HashMap<>();\n Set<Character> linkedHashSet = new LinkedHashSet<>();\n\n for(int i = 0; i < str.length(); i++) {\n char ch = str.charAt(i);\n if(charCountMap.containsKey(ch)) {\n charCountMap.put(ch, charCountMap.get(ch) + 1); // do not need this step\n linkedHashSet.remove(ch);\n } else {\n charCountMap.put(ch, 1);\n linkedHashSet.add(ch);\n }\n }\n //The first character in the linkedHashSet will be the firstNonRepeatingCharacter.\n Iterator<Character> itr = linkedHashSet.iterator();\n if(itr.hasNext()){\n return itr.next();\n } else {\n return '_';\n }\n }", "private int findSplit(String input) {\n char[] buffer = input.toCharArray();\n int pos = 0;\n for (int i = 0; i < buffer.length; i++) {\n if (this.isLetter(buffer[i])) {\n pos = i;\n break;\n }\n }\n return pos;\n }", "public char firstAppearingOnce() { //思路与FirstNotRepeatingChar.java相同\n char[] charArray = s.toString().toCharArray();\n HashMap<Character, Integer> map = new HashMap<Character, Integer>(); //利用一个HashMap散列表存储每个字符出现的次数,字符为键次数为值\n int count;\n //遍历字符串,如果散列表中没有该字符的键就新建一个该字符的键,将值即出现次数设为1,若有说明该字符出现过,将值加一更新出现次数\n for (int i = 0; i < charArray.length; i++) {\n if (map.containsKey(charArray[i])) {\n count = map.get(charArray[i]);\n map.put(charArray[i], ++count); //++在前是因为先将出现次数加1,再更新该字符的出现次数\n } else {\n map.put(charArray[i], 1);\n }\n }\n for (int i = 0; i < charArray.length; i++) {\n if (map.get(charArray[i]) == 1) { //遍历字符数组,对每一个当前字符都去查找散列表对应键的值是不是1,找到就返回该字符\n return charArray[i];\n }\n }\n return '#';\n }", "public static char nextChar (Scanner s) throws NullPointerException {\n return s.findWithinHorizon(DOT, 1).charAt(0);\n }", "private boolean isSplitChar(char inChar) {\r\n\t\tif (inChar == ' ' || inChar == ',' || inChar == '.') {\r\n\t\t\treturn true;\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}", "public static char getChar() throws IOException {\n\t\nString s = getString();\nreturn s.charAt(0);\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Returns the first letter of the string, to help idiot proof it.\n\n}", "public static Character findFirstNonRepetedCharacter(String str){\n Map<Character,Integer> map = new HashMap<>();\n\n char[] chars = str.toCharArray();\n for(Character ch: chars){\n //Terinery operator if chracter contains value increment by one\n var count = map.containsKey(ch) ? map.get(ch) : 0;\n map.put(ch,count +1);\n }\n\n //due to hashfunction map store these values in different places in memory( not sequentially)\n //now match the character in String from first to end corresponding to Map values\n for(Character ch: chars){\n //first non repeated value a green apple in string | in { =2, p=2, a=2, r=1, e=3, g=1, l=1, n=1}\n if(map.get(ch)==1) return ch; // ^\n }\n\n return Character.MIN_VALUE; // a default value when cant find any 1st repeated\n }", "public static char SingletonChar(String set)\n\t{\n\t\tDebug.Assert(IsSingleton(set) || IsSingletonInverse(set), \"Tried to get the singleton char out of a non singleton character class\");\n\t\treturn set.charAt(SETSTART);\n\t}", "public static char toChar(final String s) throws StringValueConversionException\n\t{\n\t\tif (s != null)\n\t\t{\n\t\t\tif (s.length() == 1)\n\t\t\t{\n\t\t\t\treturn s.charAt(0);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tthrow new StringValueConversionException(\"Expected single character, not \\\"\" + s\n\t\t\t\t\t\t+ \"\\\"\");\n\t\t\t}\n\t\t}\n\n\t\tthrow new StringValueConversionException(\"Character value was null\");\n\t}", "public static String truncateLeadingChar(java.lang.String str, char leadingchar) {\n\t\tString fin = null;\n\t\tif (str != null && str != \"\") {\n\t\t\tstr = str.trim();\n\t\t\tfin = str;\n\t\t\tfor (int i = 0; i < str.length(); i++) {\n\t\t\t\tif (str.charAt(i) == leadingchar) {\n\t\t\t\t\tfin = str.substring(i + 1, str.length());\n\t\t\t\t} else {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn fin;\n\t}", "public String deFront(String str) {\r\n if (!str.isEmpty()) {\r\n if (str.length() > 1) {\r\n if (str.charAt(0) == 'a' && str.charAt(1) != 'b') {\r\n\r\n return \"a\" + str.substring(2);\r\n } else if (str.charAt(0) != 'a' && str.charAt(1) == 'b') {\r\n\r\n return str.substring(1);\r\n } else if (str.charAt(1) != 'b') {\r\n\r\n return str.substring(2);\r\n }\r\n }\r\n if (str.length() == 1) {\r\n if (str.charAt(0) != 'a') {\r\n\r\n return \"\";\r\n }\r\n }\r\n }\r\n\r\n return str;\r\n }", "public abstract boolean isStarterChar(char c);", "public static int firstUniqChar(String s) {\n Map<Character, Integer> map = new HashMap<>();\n for (int i = 0; i < s.length(); i++) {\n char c = s.charAt(i);\n if (map.containsKey(c)) {\n map.put(c, map.get(c) + 1);\n } else {\n map.put(c, 1);\n }\n }\n\n for (int i = 0; i < s.length(); i++) {\n char c = s.charAt(i);\n if (map.get(c) == 1) {\n return i;\n }\n }\n return -1;\n\n }", "public static void split(char delim, CharSequence seq, Predicate<CharSequence> proc) {\n Checks.notNull(\"seq\", seq);\n Checks.notNull(\"proc\", proc);\n int lastStart = 0;\n int max = seq.length();\n if (max == 0) {\n return;\n }\n for (int i = 0; i < max; i++) {\n char c = seq.charAt(i);\n if (delim == c || i == max - 1) {\n if (lastStart != i) {\n int offset = i == max - 1 ? i + 1 : i;\n if (i == max - 1 && delim == c) {\n offset--;\n }\n CharSequence sub = seq.subSequence(lastStart, offset);\n if (!proc.test(sub)) {\n return;\n }\n } else {\n if (!proc.test(\"\")) {\n return;\n }\n }\n lastStart = i + 1;\n }\n }\n }", "public static String parseExpressionForFirstFraction(String expression) {\n int space = expression.indexOf(\" \");\n String frac1 = expression.substring(0, space);\n return frac1;\n }", "private String cutString(String value){\n String [] strings = value.split(\" \");\n System.out.println(strings[0]);\n return strings[0];\n }", "public static char readChar()\n {\n \tString ch = scanner.next();\n \treturn ch.charAt(0);\n }", "public char getChar(String key)\n {\n return getChar(key, '\\0');\n }", "private String getFirstCardName(String cardName) {\n return cardName.contains(\"//\")\n ? cardName.substring(0, cardName.indexOf(\"//\") - 1)\n : cardName;\n }", "public void setComboFirstChar(char comboFirstChar) {\n\n\n this.comboFirstChar = comboFirstChar;\n\n // chargeparent.data();\n\n\n }", "public void startCharacter() {\n\t\tString name = \"martin\";\n\t\tboolean startWith = name.startsWith(\"mart\");\n\t\tif(startWith) {\n\t\t\tSystem.out.println(\"it starts with the character\");\n\t\t}\n\t}", "public static Token string(char firstChar, Source source) {\r\n\t\tToken token = new Token(firstChar); // the leading '\r\n\t\ttoken.lineNumber = source.lineNumber();\r\n\t\tchar ch;\r\n\t\t// True when we find a ' character that could be used as an escape;\r\n\t\tboolean escaped = false; // Mainly represents whether ' was the previous character\r\n\r\n\t\t// Loop to append the rest of the characters of the string\r\n\t\t// unless we reach a closing ' or the EOF\r\n\t\tfor (ch = source.nextChar(); ch != Source.EOF; ch = source.nextChar()) {\r\n\t\t\t// If the previous char was ', but the current char isn't ',\r\n\t\t\t// so we know we're at the end of a string\r\n\t\t\tif (escaped && ch != '\\'')\r\n\t\t\t\tbreak;\r\n\t\t\telse if (escaped && ch == '\\'') {\r\n\t\t\t\t// The previous char was ', and the current char is ',\r\n\t\t\t\t// so we know the previous was an escape char\r\n\t\t\t\tescaped = false;\r\n\t\t\t\ttoken.text += ch;\r\n\t\t\t} else if (ch == '\\'') {\r\n\t\t\t\t// The current char is ', so it's either an escape char,\r\n\t\t\t\t// or it's the end of the string\r\n\t\t\t\tescaped = true;\r\n\t\t\t} else\r\n\t\t\t\ttoken.text += ch; // Standard case\r\n\t\t}\r\n\r\n\t\t// Is the token a single character surrounded by two quotes?\r\n\t\t// If so, it's a Character (size = 3)\r\n\t\tif (ch == Source.EOF) {\r\n\t\t\ttoken.type = TokenType.STRING;\r\n\t\t\ttokenError(token, \"String not closed\");\r\n\t\t} else {\r\n\t\t\ttoken.text += '\\''; // Append the closing ' (it has already been consumed)\r\n\t\t\t// Don't include the leading and trailing ' in the value.\r\n\t\t\ttoken.value = token.text.substring(1, token.text.length() - 1);\r\n\t\t\tif (token.text.length() == 3)\r\n\t\t\t{\r\n\t\t\t token.type = TokenType.CHARACTER;\r\n\t\t\t token.value = token.text.charAt(1);\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\telse\r\n\t\t\t\ttoken.type = TokenType.STRING; // If not, it's a String\r\n\t\t}\r\n\r\n\t\treturn token;\r\n\t}", "String first(String collection);", "private static String delimit(String s, char c) {\n int i = s.indexOf(c);\n while (i != -1) {\n if (i == 0 || s.charAt(i - 1) != '\\\\') {\n s = s.substring(0, i) + '\\\\' + s.substring(i);\n i = s.indexOf(c, i + 2);\n } else {\n i = s.indexOf(c, i + 1);\n }\n }\n return s;\n }", "public final static String truncateAfterFirst(String text, String delim) {\r\n\t\tif (text == null) return null;\r\n\r\n\t\tint idx = text.indexOf(delim);\r\n\t\tif (idx != -1) {\r\n\t\t\ttext = text.substring(0, idx);\r\n\t\t}\r\n\t\treturn text;\r\n\t}", "public static char scanChar(String s) {\n\t\tCharacter key = null;\n\t\tMap<Character, String> mapping = new HashMap<>();\n\t\tfor (char c = 'A'; c <= '?'; c++) {\n\t\t\tmapping.put(c, AsciiArt.printChar(c));\n\t\t}\n\n\t\tfor (Map.Entry entry : mapping.entrySet()) {\n\t\t\tif (s.equals(entry.getValue())) {\n\t\t\t\tkey = (char) entry.getKey();\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\tkey = '?';\n\t\t\t}\n\t\t}\n\n\t\treturn key;\n\n\t}", "@Test\r\n\tpublic void findUserByFirstLetter(){\n\t\tSystem.out.println(userMapper.findUserByFirstLetter('c'));\r\n\t}", "public static Character toCharacterObject(String str) {\n/* 109 */ if (StringUtils.isEmpty(str)) {\n/* 110 */ return null;\n/* */ }\n/* 112 */ return Character.valueOf(str.charAt(0));\n/* */ }", "public static String cut(String s, String seperator, double size, FontMetrics fontMetrics,String startString,boolean addSeperatorFirst){\n\t\t\n\t\tString origin = s;\n\t\tif (s==null) return s;\n\t\tif (s.equals(\"\")) return s;\n\t\tif (addSeperatorFirst) size = size - fontMetrics.stringWidth(seperator); \n\t\t\n\t\twhile (fontMetrics.stringWidth(s+startString)>size && s.contains(seperator)){\n\t\t\ts=s.substring(s.indexOf(seperator)+1, s.length());\n\t\t}\n\t\tif (s.equals(origin)) return s;\n\t\tif (addSeperatorFirst) s=seperator +s;\n\t\ts=startString+s;\n\n\t\treturn s;\n\t\t\n\t}", "public Character next() {\n if (!hasNext())\n throw new NoSuchElementException();\n return string.charAt(index++);\n }", "public String firstHalf(String str) {\n int length = str.length();\n \n boolean isEven = length % 2 == 0;\n \n int adj = (isEven) ? 0 : 1;\n \n int halfIndex = (int)(length / 2) + adj;\n \n return str.substring(0, halfIndex);\n }", "public char charAt(int index);", "public String processChar(char character, int modifier)\n {\n character = ModCase.setCase(character);\n String output = computeOutput(modifier, character);\n return output;\n }", "public static Vector<String> splitString(String str, String delimiter) {\n Vector<String> strVec = new Vector<>();\n int p = 0, dp;\n do {\n dp = str.indexOf(delimiter, p);\n if (dp == -1) dp = str.length();\n if (dp == p) {\n strVec.add(\"\");\n p += delimiter.length();\n } else {\n strVec.add(str.substring(p, dp));\n p = dp + 1;\n }\n } while(p < str.length());\n return strVec;\n }", "public char charAt(int index) {\n/* 121 */ return this.m_str.charAt(index);\n/* */ }", "public static char findFirstDuplicates(String str){\n //a green apple\n // ^ now set contains 'e'\n Set<Character> set = new HashSet<>();\n\n for(Character ch:str.toCharArray()){\n if(set.contains(ch)) return ch;\n\n set.add(ch);\n }\n return Character.MIN_VALUE;\n\n }", "public static void splitOnChar(String input, String pathToSave, char delimiter) throws IOException {\n int indexLastKey = 0;\n\n int indexCurrentKey = 0;\n // char delimiter = '@'; // example from test file\n int fileIndexName = 0;\n for (int i = 0; i < input.length(); i++) {\n if(input.charAt(i) == '@') {\n indexCurrentKey = i;\n PrintWriter writer = new PrintWriter(pathToSave + \"Test\" + fileIndexName + fileEnding, StandardCharsets.UTF_8);\n String substring = input.substring(indexLastKey,indexCurrentKey);\n indexLastKey = indexCurrentKey;\n writer.print(substring);\n writer.close();\n fileIndexName++;\n }\n }\n }", "public static String[] explode(char separator, String string) {\n\t if (string == null) return null;\n\t int len = string.length();\n\t int start = 0;\n\t int end;\n\t ArrayList<String> res = new ArrayList<String>(5);\n\t while (start < len) {\n\t\t end = string.indexOf(separator, start);\n\t\t if (end < 0) end = len;\n\t\t res.add(string.substring(start, end));\n\t\t start = end + 1;\n\t }\n\t return res.toArray(new String[res.size()]);\n }", "private final static String stripDash( String s ) {\n\n StringTokenizer tokDash = new StringTokenizer(s, \"-\");\n\n if (tokDash.countTokens() > 1) {\n return tokDash.nextToken();\n } else {\n return s;\n }\n\n }", "public char getComboFirstChar() {\n\n\n return comboFirstChar;\n\n\n }", "public int firstUniqChar(String s) {\n int[] freq = new int[26];\n \n for (char c : s.toCharArray())\n freq[c - 'a']++;\n \n for (int i = 0; i < s.length(); i++)\n if (freq[s.charAt(i) - 'a'] == 1) return i;\n \n return -1;\n }" ]
[ "0.67090774", "0.66526306", "0.6366479", "0.60483193", "0.60140955", "0.5920976", "0.57708305", "0.57346493", "0.5675045", "0.56656945", "0.5627731", "0.56152236", "0.55707914", "0.5519343", "0.54938644", "0.54419255", "0.54362994", "0.5375448", "0.5367981", "0.5317564", "0.53090703", "0.5288165", "0.52798235", "0.52707046", "0.5222336", "0.52172965", "0.5197538", "0.51913446", "0.51768005", "0.51751065", "0.51739395", "0.5173258", "0.5154345", "0.51540345", "0.51305884", "0.512389", "0.5107263", "0.5102428", "0.5068201", "0.5066675", "0.5062209", "0.50617963", "0.50575155", "0.50557774", "0.50521106", "0.5049109", "0.50453985", "0.5030912", "0.5027285", "0.5026235", "0.5022851", "0.5012964", "0.50057054", "0.499039", "0.49881455", "0.49790737", "0.49760756", "0.4961565", "0.49483326", "0.49433154", "0.49324366", "0.49297437", "0.49211183", "0.49168485", "0.49166304", "0.49142316", "0.49110398", "0.4910534", "0.4907258", "0.48879787", "0.48727548", "0.48725423", "0.48574626", "0.48561135", "0.48544282", "0.48531622", "0.48486245", "0.4830877", "0.48274827", "0.48226482", "0.4814033", "0.480964", "0.48019543", "0.4790506", "0.4786269", "0.47852853", "0.47849658", "0.47845474", "0.47834793", "0.47804713", "0.47800067", "0.4776285", "0.47761282", "0.4774523", "0.47662786", "0.476457", "0.47627604", "0.4758968", "0.47488418", "0.474108" ]
0.611027
3
Partitions the string into 2, seperated by the first '/'.
public static String[] slashPartition(String str) { return partition(str, '/'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static String[] partition(String str, char character) {\n int index = str.indexOf(character);\n\n String[] pair = new String[2];\n\n if (index > -1) {\n // Gets rid of a space in the end of the first partition.\n pair[0] = str.substring(0, index).trim();\n pair[1] = str.substring(index + 1).trim();\n } else {\n // If there exists no '/' in the string, set the tail of the pair as an empty string.\n pair[0] = str;\n pair[1] = \"\";\n }\n return pair;\n }", "public static String getSecondPart(String str) {\n\t\t// we assume that str argument will only have even(length) strings\n\t\t// return second part of the string \n\t\t\n\t\t// str.substring(2); // abcd -> cd : 4 / 2 = 2\n\t\t// str.substring(3); // banana : 6 / 2 = 3\n\t\t// str.substring(4); // 12345678 : 8 / 2 =4\n\t\t\n\t\tint len = str.length();\n\t\tstr = str.substring(len / 2);\n\t\treturn str;\n\t}", "public String firstHalf(String str) {\r\n return str.substring(0, str.length() / 2);\r\n }", "public static String secondName(String s) {\n\t\tint s0 = s.indexOf(FILE_SEP);\n\t\tint s1 = s.lastIndexOf(FILE_SEP);\n\t\tif (s0 != -1 && s1 != -1 ){\n\t\t\tif (s0 != s1) \treturn s.substring(s0 + 1, s1);//1\n\t\t\tif (s0 == s1) \treturn s.substring(s0 + 1);//2\n\t\t}\n\t\treturn \"\";\n\t}", "public static String[] splitPath(String path){\n if(org.apache.commons.lang3.StringUtils.isEmpty(path)){\n return new String[0];\n }\n\n int first = path.indexOf('.');\n\n if(first >=0 ){\n String firstPart = path.substring(0,first);\n if(path.length() > (first+1)) {\n String restPart = path.substring(first + 1, path.length());\n return new String[]{firstPart,restPart};\n }else{\n return new String[]{firstPart};\n }\n }else{\n return new String[]{path};\n }\n }", "public String middleTwo(String str) {\r\n return str.length() > 1 ? str.substring(str.length() / 2 - 1, str.length() / 2 + 1) : str;\r\n }", "public String simplifyPath2(String path) {\n\t\tString[] strs = path.split(\"/\");\n\t\tLinkedList<String> l = new LinkedList<String>();\n\n\t\tfor (String s : strs) {\n\t\t\tif (s.equals(\"..\")) {\n\t\t\t\tif (!l.isEmpty())\n\t\t\t\t\tl.removeLast();\n\t\t\t} else if (s.equals(\"\") || s.equals(\".\"))\n\t\t\t\tcontinue;\n\t\t\telse\n\t\t\t\tl.addLast(s);\n\n\t\t}\n\t\tStringBuilder sb = new StringBuilder();\n\t\tfor (String s : l) {\n\t\t\tsb.append('/');\n\t\t\tsb.append(s);\n\t\t}\n\t\tif (l.size() == 0)\n\t\t\tsb.append('/');\n\t\treturn sb.toString();\n\t}", "public String split(String s1,String s2) {\n\t\treturn s1.split(s2, 1).toString();\n\t}", "public String[] separatePathName(String path) {\r\n // check if this is the path to the root\r\n if (path.equals(\"/\")) {\r\n return new String[]{\"/\", \"\"};\r\n }\r\n String name, parentPath;\r\n int lastSlash = path.lastIndexOf('/');\r\n if (lastSlash == path.length() - 1) {\r\n lastSlash = path.lastIndexOf('/', lastSlash - 1);\r\n }\r\n if (lastSlash == -1) {\r\n // path is relative\r\n name = path;\r\n parentPath = workingDirectory.getData();\r\n } else if (path.charAt(0) == '/') {\r\n // path is absolute\r\n name = path.substring(lastSlash + 1);\r\n parentPath = path.substring(0, lastSlash + 1);\r\n } else {\r\n name = path.substring(lastSlash + 1);\r\n parentPath =\r\n workingDirectory.getData() + path.substring(0, lastSlash + 1);\r\n }\r\n return new String[]{name, parentPath};\r\n }", "public String getMidleTwo(String str) {\n\t\tString mid = \"\";\n\t\tif (str.length() % 2 == 0) {\n\t\t\tmid = str.substring(str.length() / 2 - 1, str.length() / 2 + 1);\n\t\t\treturn mid;\n\n\t\t} else if (str.length() % 2 == 1) {\n\t\t\tmid = str.substring(str.length() / 2, str.length() / 2 + 1);\n\t\t}\n\n\t\treturn mid;\n\t}", "public String left2(String str) {\r\n return str.length() > 2 ? str.substring(2) + str.substring(0, 2) : str;\r\n }", "private String[] splitResource(String resource, String delimiter)\r\n {\r\n String[] retval = new String[2];\r\n String head, tail;\r\n\r\n int delLen = (delimiter.equals(TIGHT_BINDING)) ? TIGHT_BINDING_LEN :\r\n LOOSE_BINDING_LEN ;\r\n // find the first delimiter\r\n int index = resource.indexOf(delimiter);\r\n\r\n if (index != -1)\r\n {\r\n // split into head and tail\r\n head = resource.substring(0, index);\r\n tail = resource.substring(index+delLen);\r\n }\r\n else\r\n {\r\n // there is no tail, only a head\r\n head = resource;\r\n tail = null;\r\n }\r\n\r\n retval[0] = head;\r\n retval[1] = tail;\r\n\r\n return retval;\r\n }", "public String right2(String str) {\r\n String lastTwoChars = str.substring(str.length() - 2);\r\n String frontPart = str.substring(0, str.length() - 2);\r\n\r\n return str.length() > 2 ? lastTwoChars + frontPart : str;\r\n }", "public String firstTwo(String str) {\r\n return str.length() < 2 ? str : str.substring(0, 2);\r\n }", "private static int getDividingIndex(String fullPath) {\n int baseEnd = fullPath.lastIndexOf(\"/\");\n if (fullPath.substring(0, baseEnd).endsWith(COMMAND_PATH)) {\n baseEnd = fullPath.substring(0, baseEnd).lastIndexOf(\"/\");\n }\n return baseEnd;\n }", "private String sep(String path) {\n return path == null ? \"\" : \"/\" + path;\n }", "@Test\n public void testPathParsing_withAlternateSeparator() {\n PathService windowsPathService = PathServiceTest.fakeWindowsPathService();\n assertEquals(\n windowsPathService.parsePath(\"foo\\\\bar\\\\baz\"), windowsPathService.parsePath(\"foo/bar/baz\"));\n assertEquals(\n windowsPathService.parsePath(\"C:\\\\foo\\\\bar\"), windowsPathService.parsePath(\"C:\\\\foo/bar\"));\n assertEquals(\n windowsPathService.parsePath(\"c:\\\\foo\\\\bar\\\\baz\"),\n windowsPathService.parsePath(\"c:\", \"foo/\", \"bar/baz\"));\n }", "public String firstHalf(String str) {\n int length = str.length();\n \n boolean isEven = length % 2 == 0;\n \n int adj = (isEven) ? 0 : 1;\n \n int halfIndex = (int)(length / 2) + adj;\n \n return str.substring(0, halfIndex);\n }", "private static final String subPath(String path, int fromSegmentIndex) {\n if (path == null) {\n return null;\n }\n int index = 0;\n int segment = 0;\n while (segment++ < fromSegmentIndex) {\n index = path.indexOf('/', index) + 1;\n if (index <= 0) {\n if (segment == fromSegmentIndex) {\n index = path.length();\n } else {\n throw new IllegalArgumentException(\n \"Path \\\"\" + path + \"\\\" does not contain \" + fromSegmentIndex + \" segments.\");\n }\n }\n }\n return path.substring(index);\n }", "public static String filenamePart(String path) {\n char sep = System.getProperty(\"file.separator\", \"/\").charAt(0);\n int i = path.lastIndexOf(sep);\n return (i < 0)? path : path.substring(i+1);\n }", "public void testUptoSegment() {\n \tIPath anyPath = new Path(\"/first/second/third\");\r\n \r\n \tassertEquals(\"1.0\", Path.EMPTY, anyPath.uptoSegment(0));\r\n \tassertEquals(\"1.1\", new Path(\"/first\"), anyPath.uptoSegment(1));\r\n \tassertEquals(\"1.2\", new Path(\"/first/second\"), anyPath.uptoSegment(2));\r\n \tassertEquals(\"1.3\", new Path(\"/first/second/third\"), anyPath.uptoSegment(3));\r\n \tassertEquals(\"1.4\", new Path(\"/first/second/third\"), anyPath.uptoSegment(4));\r\n \r\n \t//Case 2, absolute path with trailing separator\r\n \tanyPath = new Path(\"/first/second/third/\");\r\n \r\n \tassertEquals(\"2.0\", Path.EMPTY, anyPath.uptoSegment(0));\r\n \tassertEquals(\"2.1\", new Path(\"/first/\"), anyPath.uptoSegment(1));\r\n \tassertEquals(\"2.2\", new Path(\"/first/second/\"), anyPath.uptoSegment(2));\r\n \tassertEquals(\"2.3\", new Path(\"/first/second/third/\"), anyPath.uptoSegment(3));\r\n \tassertEquals(\"2.4\", new Path(\"/first/second/third/\"), anyPath.uptoSegment(4));\r\n }", "private static String normalize(String pathString) {\n if (pathString.contains(\"//\") || pathString.indexOf('\\\\') >= 0) {\n pathString = pathString.replaceAll(\"[\\\\\\\\/]+\", \"/\");\n }\n\n // Strip leading './'\n if (pathString.startsWith(\"./\")) {\n pathString = pathString.substring(2);\n }\n\n // Strip trailing '/.', '/'\n if (pathString.endsWith(\"/.\")) {\n pathString = pathString.substring(0, pathString.length() - 2);\n } else if (pathString.endsWith(\"/\")) {\n pathString = pathString.substring(0, pathString.length() - 1);\n }\n\n return pathString;\n }", "public static String[] splitDescFilePath(String descFilePath) {\r\n String[] parts = null;\r\n if (descFilePath != null) {\r\n parts = new String[2];\r\n String[] paths = descFilePath.split(\"#\");\r\n if (paths.length == 1) {\r\n parts[0] = paths[0];\r\n parts[1] = null;\r\n } else if (paths.length == 2) {\r\n parts[0] = paths[0];\r\n parts[1] = paths[1];\r\n } else {\r\n String last = paths[paths.length - 1];\r\n parts[0] = descFilePath.replace(\"#\" + last, \"\");\r\n parts[1] = last;\r\n }\r\n }\r\n return parts;\r\n }", "public String path(String path1, String path2);", "public static List<String> splitPathElements(final String path) {\n final List<String> pathElements = new ArrayList<String>();\n\n if (!isNullOrEmpty(path)) {\n final StringTokenizer tokenizer = new StringTokenizer(path, \"/\");\n\n while (tokenizer.hasMoreTokens()) {\n pathElements.add(tokenizer.nextToken());\n }\n }\n return pathElements;\n }", "public String simplifyPath(String path) {\n String resString=\"\";\n String[] steRes=path.split(\"/|\\\\.\");\n if (steRes.length==0)\n return \"/\";\n return '/'+steRes[steRes.length-1];\n }", "private String normalizePath(String path)\n {\n return path.replaceAll(\"\\\\\\\\{1,}\", \"/\");\n }", "public static ArthurString divide(ArthurString one, ArthurNumber two) {\n int x = Math.abs((int) Math.round(two.val));\n int lastPos = Math.max(0, one.str.length() - x);\n String cut = one.str.substring(lastPos);\n return new ArthurString(cut);\n }", "private static String createDir(String s) {\r\n \tint len = s.length() - 1;\r\n \tString tempBuff;\r\n \tString result;\r\n \tif (s.charAt(len) != '/') {\r\n \t\ttempBuff = String.format(\"%s/\", s);\r\n \t}\r\n \telse {\r\n \t\ttempBuff = s;\r\n \t}\r\n \tresult = tempBuff;\r\n \treturn result;\r\n }", "public String withouEnd2(String str) {\r\n return str.length() > 2 ? str.substring(1, str.length() - 1) : \"\";\r\n }", "public static void main(String[] args) {\n\n Scanner scan = new Scanner(System.in);\n String word= scan.next();\n // HELLO = 5/2=2 the half index for odd char count\n //JAVA = 4/2 = 2 the half index for even char count\n\n int halfIndex = word.length()/2;\n String halfWord = word.substring(0, halfIndex);\n System.out.println(halfWord + halfWord);\n\n\n\n }", "private static String normalizePathString(String path) {\n String noUnion = removePrefix(path, \"union:/\");\n // Remove scheme marker\n String noScheme = removeAndBefore(noUnion, \"//\");\n // Remove '%2370!' that forge has, example:\n // union:/C:/Users/natan/.gradle/caches/fabric-loom/1.17.1/net.fabricmc.yarn.1_17_1.1.17.1+build.61-v2-forge-1.17.1-37.0.69/forge-1.17.1-37.0.69-minecraft-mapped.jar%2371!\n // We use 'removeLastPercentSymbol' instead of removing everything after last occurrence of '%' so it works with spaces as well\n // (the last space will be 'deleted', but that doesn't matter for our purposes)\n String noPercent = removeLastPercentSymbol(noScheme);\n // Remove trailing '/' and '!'\n return removeSuffix(removeSuffix(noPercent, \"/\"), \"!\");\n }", "public static String tail(String string) {\n int i = string.lastIndexOf('/');\n return (i < 0) ? string : string.substring(i + 1);\n }", "public static final List<?> split(final String string, final String divider) {\n\t\t\n\t\tif (string == null) {\n\t\t\treturn null;\n\t\t}\n\t\tfinal List<String> result = new ArrayList<>();\n\t\tfinal int length = divider.length();\n\t\tif (length == 1) {\n\t\t\tfor (final StringTokenizer st = new StringTokenizer(string, divider); st.hasMoreTokens();) {\n\t\t\t\tresult.add(st.nextToken());\n\t\t\t}\n\t\t} else {\n\t\t\tint start = 0;\n\t\t\tint end = 0;\n\t\t\tfor (;;) {\n\t\t\t\tstart = string.indexOf(divider, end);\n\t\t\t\tif (start == -1) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tresult.add(string.substring(end, start));\n\t\t\t\tend = start + length;\n\t\t\t}\n\t\t\tif (end < string.length()) {\n\t\t\t\tresult.add(string.substring(end));\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "private static String trim (String urlString) {\n int ix = urlString.lastIndexOf('/');\n boolean trimTrailingSlash = ix == urlString.length() - 1;\n if (trimTrailingSlash) {\n ix = urlString.lastIndexOf('/', ix - 1);\n }\n String result;\n if (ix > 0) {\n result = urlString.substring(ix + 1);\n } else {\n result = urlString;\n }\n if (trimTrailingSlash && result.length() > 1) {\n result = result.substring(0, result.length() - 1);\n }\n return result;\n }", "public static ArthurString divide(ArthurString one, ArthurString two) {\n String twoReverse = new StringBuilder(two.str).reverse().toString();\n return multiply(one, new ArthurString(twoReverse));\n }", "static String division (String s1, String s2) {\r\n if (s2==null || s2.length()==0) return s1;\r\n return product (s1, invert(s2));\r\n }", "private String YYYYMMDD(String str) {\n\t\tString[] s = str.split(\"/\");\n\t\treturn s[0] + parseToTwoInteger(Integer.parseInt(s[1].trim())) + parseToTwoInteger(Integer.parseInt(s[2].trim()));\n\t}", "public static String normalizePath(String path)\r\n {\r\n StringBuilder result = new StringBuilder();\r\n char nextChar;\r\n for(int i = 0; i < path.length(); i++)\r\n {\r\n nextChar = path.charAt(i);\r\n if((nextChar == '\\\\'))\r\n {\r\n // Convert the Windows style path separator to the standard path separator\r\n result.append('/');\r\n }\r\n else\r\n {\r\n result.append(nextChar);\r\n }\r\n }\r\n \r\n return result.toString();\r\n }", "public static String afterFirstPathComponent(final String path, final char separator)\n\t{\n\t\treturn afterFirst(path, separator);\n\t}", "public static String afterFirstPathComponent(final String path, final char separator)\n\t{\n\t\treturn afterFirst(path, separator);\n\t}", "private String convertDate(String date){\r\n String arrDate[] = date.split(\"/\");\r\n date = arrDate[2] + \"-\" + arrDate[1] + \"-\" + arrDate[0];\r\n return date;\r\n }", "public static String rest(String s) {\n\treturn s.substring(1);\n\t}", "public static String toFolderPathFormat( String inStr ) {\r\n\t\tif( inStr == null ||\r\n\t\t\tinStr.length() == 0\t)\r\n\t\t{\r\n\t\t\treturn \"/\";\r\n\t\t}\r\n\t\t\r\n\t\tif( inStr.charAt( inStr.length() - 1 ) != '/' )\r\n\t\t{\r\n\t\t\treturn inStr + \"/\";\r\n\t\t}\r\n\t\t\r\n\t\treturn inStr;\r\n\t}", "public String extraFront(String str) {\r\n String base = str.length() > 2 ? str.substring(0, 2) : str;\r\n\r\n return base + base + base;\r\n }", "public static final String normalizePath(String path) {\n\t\t// Normalize the slashes and add leading slash if necessary\n\t\tString normalized = path;\n\t\tif (normalized.indexOf('\\\\') >= 0) {\n\t\t\tnormalized = normalized.replace('\\\\', '/');\n\t\t}\n\n\t\tif (!normalized.startsWith(\"/\")) {\n\t\t\tnormalized = \"/\" + normalized;\n\t\t}\n\n\t\t// Resolve occurrences of \"//\" in the normalized path\n\t\twhile (true) {\n\t\t\tint index = normalized.indexOf(\"//\");\n\t\t\tif (index < 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tnormalized = normalized.substring(0, index)\n\t\t\t\t\t+ normalized.substring(index + 1);\n\t\t}\n\n\t\t// Resolve occurrences of \"%20\" in the normalized path\n\t\twhile (true) {\n\t\t\tint index = normalized.indexOf(\"%20\");\n\t\t\tif (index < 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tnormalized = normalized.substring(0, index) + \" \"\n\t\t\t\t\t+ normalized.substring(index + 3);\n\t\t}\n\n\t\t// Resolve occurrences of \"/./\" in the normalized path\n\t\twhile (true) {\n\t\t\tint index = normalized.indexOf(\"/./\");\n\t\t\tif (index < 0) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tnormalized = normalized.substring(0, index)\n\t\t\t\t\t+ normalized.substring(index + 2);\n\t\t}\n\n\t\twhile (true) {\n\t\t\tint index = normalized.indexOf(\"/../\");\n\t\t\tif (index < 0)\n\t\t\t\tbreak;\n\t\t\tif (index == 0) {\n\t\t\t\treturn (null); // Trying to go outside our context\n\t\t\t}\n\t\t\tint index2 = normalized.lastIndexOf('/', index - 1);\n\t\t\tnormalized = normalized.substring(0, index2)\n\t\t\t\t\t+ normalized.substring(index + 3);\n\t\t}\n\n\t\t// Return the normalized path that we have completed\n\t\treturn (normalized);\n\t}", "public String extraFront(String str) {\n\t\tString result=\"\";\r\n\t\t\r\n\t\t//only store result if string has at least 2 characters\r\n\t\t//else if string has less than 2 characters concatenate what there is\r\n\t\tif(str.length()>1) result = str.substring(0, 2) + str.substring(0, 2)\r\n\t\t\t+str.substring(0, 2);\r\n\t\telse result = str+str+str;\r\n\t\treturn result;\r\n\t}", "public static String removePrecedingSlash(String url) {\n if (url.startsWith(\"/\")) {\n return url.substring(1);\n } else {\n return url;\n }\n }", "public static String rest(String s) {\n return s.substring(1);\n }", "private String m2343a(String str, String str2) {\n StringBuilder sb;\n String replace = str2.replace(Constants.URL_PATH_DELIMITER, \"_\");\n String G = this.f2759a.mo9869G();\n if (C1277l.m3042b(G)) {\n StringBuilder sb2 = new StringBuilder();\n sb2.append(G);\n sb2.append(replace);\n replace = sb2.toString();\n }\n File a = this.f2761d.mo10273a(replace, this.f2745b.mo10179D());\n if (a == null) {\n return null;\n }\n String str3 = \"file://\";\n if (a.exists()) {\n this.f2763f.mo10021b(a.length());\n sb = new StringBuilder();\n } else {\n StringBuilder sb3 = new StringBuilder();\n sb3.append(str);\n sb3.append(str2);\n if (!this.f2761d.mo10278a(a, sb3.toString(), Arrays.asList(new String[]{str}), this.f2763f)) {\n return null;\n }\n sb = new StringBuilder();\n }\n sb.append(str3);\n sb.append(a.getAbsolutePath());\n return sb.toString();\n }", "public static String joinPath(String... parts) {\n StringBuilder sb = new StringBuilder();\n if (parts.length > 0) {\n sb.append(parts[0]);\n }\n for (int i = 1; i < parts.length; i++) {\n String part = parts[i];\n if (part.isEmpty() || (part.length() == 1 && part.charAt(0) == '/')) {\n continue;\n }\n boolean gotTrailingSlash = sb.length() == 0 ? false : sb.charAt(sb.length() - 1) == '/';\n boolean gotLeadingSlash = part.charAt(0) == '/';\n if (gotTrailingSlash != !gotLeadingSlash) {\n sb.append(part);\n } else {\n if (!gotTrailingSlash) {\n sb.append('/');\n } else {\n sb.append(part.substring(1));\n }\n }\n }\n return sb.toString();\n }", "private String normalizePath(String path) {\n boolean absolute = path.startsWith(\"/\");\n int cwdl = cwd.length();\n \n // NOTE: This isn't just a fast path, it handles cases the code below doesn't\n if(!path.startsWith(\".\") && path.indexOf(\"./\") == -1 && path.indexOf(\"//\") == -1 && !path.endsWith(\".\"))\n return absolute ? path.substring(1) : cwdl == 0 ? path : path.length() == 0 ? cwd : cwd + \"/\" + path;\n \n char[] in = new char[path.length()+1];\n char[] out = new char[in.length + (absolute ? -1 : cwd.length())];\n path.getChars(0,path.length(),in,0);\n int inp=0, outp=0;\n \n if(absolute) {\n do { inp++; } while(in[inp] == '/');\n } else if(cwdl != 0) {\n cwd.getChars(0,cwdl,out,0);\n outp = cwdl;\n }\n\n while(in[inp] != 0) {\n if(inp != 0) {\n while(in[inp] != 0 && in[inp] != '/') { out[outp++] = in[inp++]; }\n if(in[inp] == '\\0') break;\n while(in[inp] == '/') inp++;\n }\n \n // Just read a /\n if(in[inp] == '\\0') break;\n if(in[inp] != '.') { out[outp++] = '/'; out[outp++] = in[inp++]; continue; }\n // Just read a /.\n if(in[inp+1] == '\\0' || in[inp+1] == '/') { inp++; continue; }\n if(in[inp+1] == '.' && (in[inp+2] == '\\0' || in[inp+2] == '/')) { // ..\n // Just read a /..{$,/}\n inp += 2;\n if(outp > 0) outp--;\n while(outp > 0 && out[outp] != '/') outp--;\n //System.err.println(\"After ..: \" + new String(out,0,outp));\n continue;\n }\n // Just read a /.[^.] or /..[^/$]\n inp++;\n out[outp++] = '/';\n out[outp++] = '.';\n }\n if(outp > 0 && out[outp-1] == '/') outp--;\n //System.err.println(\"normalize: \" + path + \" -> \" + new String(out,0,outp) + \" (cwd: \" + cwd + \")\");\n int outStart = out[0] == '/' ? 1 : 0;\n return new String(out,outStart,outp - outStart);\n }", "public static String[] strParts(String string, String delim) {\r\n //StringTokenizer st = new StringTokenizer(string);\r\n String[] strings = string.split(delim);\r\n return removeSpaces(strings);\r\n }", "static String morganAndString(String a, String b) {\n\n\t\tString result = \"\";\n\n\t\tint pointerA = 0, pointerB = 0;\n\n\t\touter:\n\t\t\twhile ( pointerA < a.length() || pointerB < b.length()){\n\t\t\t\tif ( pointerA == a.length()) {\n\t\t\t\t\tresult = result + b.charAt(pointerB++);\n\t\t\t\t}\n\t\t\t\telse if ( pointerB == b.length()) {\n\t\t\t\t\tresult = result + a.charAt(pointerA++);\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tchar ca = a.charAt ( pointerA );\n\t\t\t\t\tchar cb = b.charAt ( pointerB );\n\n\t\t\t\t\tif ( ca < cb ) {\n\t\t\t\t\t\tresult = result + ca;\n\t\t\t\t\t\tpointerA++;\n\t\t\t\t\t}\n\t\t\t\t\telse if ( cb < ca ){\n\t\t\t\t\t\tresult = result + cb;\n\t\t\t\t\t\tpointerB++;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t// Find the smallest successor.\n\t\t\t\t\t\tint extraPointer = 1;\n\t\t\t\t\t\twhile ( pointerA + extraPointer < a.length() && pointerB + extraPointer < b.length()){\n\t\t\t\t\t\t\tchar cEa = a.charAt ( pointerA + extraPointer);\n\t\t\t\t\t\t\tchar cEb = b.charAt ( pointerB + extraPointer);\n\n\t\t\t\t\t\t\tif ( cEa < cEb ){\n\t\t\t\t\t\t\t\tresult = result + cEa;\n\t\t\t\t\t\t\t\tpointerA++;\n\t\t\t\t\t\t\t\tcontinue outer;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse if ( cEb < cEa ){\n\t\t\t\t\t\t\t\tresult = result + cEb;\n\n\n\t\t\t\t\t\t\t\tpointerB++;\n\t\t\t\t\t\t\t\tcontinue outer;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\textraPointer++;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// We got to the point in which both are the same.\n\t\t\t\t\t\tif ( pointerA + extraPointer == a.length() && pointerB + extraPointer == b.length()){\n\t\t\t\t\t\t\t// Both are equal. It doesn't matter which one I take it from.\n\t\t\t\t\t\t\tresult = result + ca;\n\t\t\t\t\t\t\tpointerA++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tif ( pointerA + extraPointer == a.length() ){\n\t\t\t\t\t\t\t\t// Compare the current one of B with the next letter.\n\t\t\t\t\t\t\t\t// If next letter is smaller than current one, cut from here.\n\t\t\t\t\t\t\t\t// else, cut from A.\n\t\t\t\t\t\t\t\tif ( b.charAt ( pointerB + extraPointer ) > b.charAt ( pointerB + extraPointer + 1)){\n\t\t\t\t\t\t\t\t\tresult = result + cb;\n\t\t\t\t\t\t\t\t\tpointerB++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tresult = result + ca;\n\t\t\t\t\t\t\t\t\tpointerA++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t// The opposite.\n\t\t\t\t\t\t\t\t// Compare the current one of B with the next letter.\n\t\t\t\t\t\t\t\t// If next letter is smaller than current one, cut from here.\n\t\t\t\t\t\t\t\t// else, cut from A.\n\t\t\t\t\t\t\t\tif ( a.charAt ( pointerA + extraPointer ) > a.charAt ( pointerA + extraPointer + 1)){\n\t\t\t\t\t\t\t\t\tresult = result + ca;\n\t\t\t\t\t\t\t\t\tpointerA++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\tresult = result + cb;\n\t\t\t\t\t\t\t\t\tpointerB++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\treturn result;\n\n\n\t}", "private static void huffmanStringSplit(Node x, String value)\r\n {\r\n if (x == null)\r\n {\r\n return;\r\n }\r\n\r\n if (x.isLeaf()) //if it's a leaf or not\r\n {\r\n secondMap.put(x.character, value);\r\n }\r\n else\r\n {\r\n huffmanStringSplit(x.right, (value + \"1\"));\r\n huffmanStringSplit(x.left, (value + \"0\"));\r\n }\r\n }", "public static String beforeLastPathComponent(final String path, final char separator)\n\t{\n\t\treturn beforeLast(path, separator);\n\t}", "public static String beforeLastPathComponent(final String path, final char separator)\n\t{\n\t\treturn beforeLast(path, separator);\n\t}", "private String [] splitString(String name) {\r\n String [] parts = {\"\", \"\"};\r\n if (name != null) {\r\n String [] t = StringExtend.toArray(name, \".\", false);\r\n if (t.length == 3) {\r\n parts [0] = t [0] + \".\" + t [1];\r\n parts [1] = t [2];\r\n }\r\n else if (t.length == 2) {\r\n parts [0] = t [0]; parts [1] = t [1];\r\n }\r\n else if (t.length == 1) {\r\n parts [1] = t [0];\r\n }\r\n }\r\n\r\n return parts;\r\n }", "public String simplifyPath(String path) {\n String[] s = path.split(\"/\");\n StringBuilder sb = new StringBuilder(\"/\");\n for(String S:s){\n if(S.equals(\"\")||S.equals(\".\")){\n continue;\n }\n else if(S.equals(\"..\")){\n if(sb.charAt(sb.length()-1) != '/')\n {\n sb.deleteCharAt(sb.length()-1);\n }\n else{\n sb.delete(sb.length()-2, sb.length()-1);\n }\n\n }\n else{\n sb.append(S);\n sb.append('/');\n }\n }\n sb.deleteCharAt(sb.length()-1);\n return sb.toString();\n }", "public static byte[] preparePath(final byte[] path) {\n String p = MetaData.normPath(string(path));\n if(Strings.endsWith(p, '/')) p = p.substring(0, p.length() - 1);\n return concat(SLASH, token(p));\n }", "@Test\n public void testCaseNumberSplit() {\n String caseNumber1 = \"NTN-57930\";\n String[] parts1 = caseNumber1.split( \"-\" );\n //String[] parts2 = caseNumber2.split(\"-\");\n //String[] parts3 = caseNumber3.split(\"-\");\n System.out.println( parts1.length );\n //System.out.println( parts2.length);\n //System.out.println( parts3.length);\n if (parts1.length > 2) {\n System.out.println( parts1[0] );\n String case1 = caseNumber1.substring( caseNumber1.indexOf( caseNumber1.split( \"-\" )[0] ), caseNumber1.indexOf( caseNumber1.split( \"-\" )[2] ) - 1 );\n System.out.println( case1 );\n } else {\n String case1 = caseNumber1;\n System.out.println( case1 );\n }\n }", "public String without2(String str) {\r\n if (str.length() > 2 && str.substring(0, 2).equals(str.substring(str.length() - 2))) {\r\n return str.substring(2);\r\n }\r\n\r\n if (str.length() == 2) {\r\n return \"\";\r\n }\r\n\r\n return str;\r\n }", "public String front22(String str) {\n String front2;\n if (str.length() <= 2) {\n front2 = str;\n } else {\n front2 = str.substring(0, 2);\n }\n \n return front2 + str + front2;\n}", "String getBeginSplited();", "private String doDivision(String answer)\n\t{\n\t\tint signSpot;\n\t\tString stringToDelete;\n\t\tdouble number1;\n\t\tdouble number2;\n\t\tint minValue = 0;\n\t\tint maxValue = 0;\n\n\t\twhile (answer.contains(\"/\"))\n\t\t{\n\t\t\tsignSpot = answer.indexOf(\"/\");\n\n\t\t\t// start\n\t\t\tfor (int count = signSpot - 1; count >= 0; count -= 1)\n\t\t\t{\n\t\t\t\tif (isNumeric(answer.substring(count, count + 1)) == true\n\t\t\t\t\t\t|| answer.substring(count, count + 1).equals(\".\"))\n\t\t\t\t{\n\t\t\t\t\tminValue = count;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// finish\n\t\t\tfor (int count = signSpot + 2; count <= answer.length(); count += 1)\n\t\t\t{\n\t\t\t\tif (isNumeric(answer.substring(count - 1, count)) == true\n\t\t\t\t\t\t|| answer.substring(count - 1, count).equals(\".\"))\n\t\t\t\t{\n\t\t\t\t\tmaxValue = count;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tstringToDelete = answer.substring(minValue, maxValue);\n\t\t\tString myString = answer.substring(minValue, signSpot);\n\t\t\tnumber1 = Double.parseDouble(myString);\n\t\t\tmyString = answer.substring(signSpot + 1, maxValue);\n\t\t\tnumber2 = Double.parseDouble(myString);\n\t\t\tDouble numberAnswer1 = number1 / number2;\n\t\t\tanswer = answer.replace(stringToDelete, \"\" + numberAnswer1);\n\t\t\tSystem.out.println(answer);\n\t\t}\n\t\treturn answer;\n\t}", "public String lastTwo(String str) {\r\n return str.length() > 1 ? str.substring(0, str.length() - 2) + str.charAt(str.length() - 1)\r\n + str.charAt(str.length() - 2) : str;\r\n }", "public static String formatPath(ServletContext context, Document dom, String application, Hashtable hash, String pathSrc, char separator) throws IOException {\n String ret = null;\r\n try\r\n {\r\n String listPathSrc[] = UtilString.split(pathSrc, separator);\r\n int len = UtilSafe.safeListSize(listPathSrc);\r\n // Trace.DEBUG(getInstance(), (new StringBuilder(\"formatPath listPathSrc:\")).append(listPathSrc).append(\" len:\").append(len).toString());\r\n if(len > 0)\r\n {\r\n File filePath = null;\r\n String path = null;\r\n int iDeb = 0;\r\n int iFin = 0;\r\n int iPos = 0;\r\n StringBuffer stb = new StringBuffer();\r\n for(int i = 0; i < len; i++)\r\n {\r\n path = (String)UtilSafe.safeListGetElementAt(listPathSrc, i);\r\n for(iPos = 0; iPos >= 0; iPos = iFin)\r\n {\r\n iDeb = path.indexOf('[', 0);\r\n iFin = path.indexOf(']', iDeb);\r\n // Trace.DEBUG(getInstance(), (new StringBuilder(\"formatPath path:\")).append(path).append(\" iPos:\").append(iPos).append(\" iDeb:\").append(iDeb).append(\" iFin:\").append(iFin).toString());\r\n if(iDeb >= 0 && iFin >= 0)\r\n {\r\n String szApplication = path.substring(iDeb + 1, iFin);\r\n String filePathMain = (String)hash.get(szApplication);\r\n if(filePathMain == null)\r\n if(context == null)\r\n filePathMain = AdpXmlApplication.getPathMain(dom, szApplication);\r\n else\r\n filePathMain = AdpXmlApplication.getFormatedPathMain(context, dom, szApplication);\r\n // Trace.DEBUG(getInstance(), (new StringBuilder(\"formatPath szApplication:\")).append(szApplication).append(\" filePathMain:\").append(filePathMain).toString());\r\n if(UtilString.isNotEmpty(filePathMain))\r\n {\r\n // Trace.DEBUG(getInstance(), (new StringBuilder(\"formatPath filePathMain isNotEmpty:\")).append(filePathMain).toString());\r\n hash.put(szApplication, filePathMain);\r\n if(!filePathMain.toUpperCase().startsWith(\"FTP://\"))\r\n {\r\n path = (new StringBuffer(path)).replace(iDeb, iFin + 1, filePathMain).toString();\r\n path = path.replace(File.separatorChar != '\\\\' ? '\\\\' : '/', File.separatorChar);\r\n } else\r\n {\r\n path = filePath.getCanonicalPath();\r\n }\r\n }\r\n } else\r\n if(UtilString.isNotEmpty(application) && !UtilFile.isPathAbsolute(path))\r\n {\r\n // Trace.DEBUG(getInstance(), (new StringBuilder(\"formatPath application isNotEmpty:\")).append(application).toString());\r\n String filePathApp = null;\r\n if(context == null)\r\n filePathApp = AdpXmlApplication.getPathMain(dom, application);\r\n else\r\n filePathApp = AdpXmlApplication.getFormatedPathMain(context, dom, application);\r\n path = (new File(filePathApp, path)).getCanonicalPath();\r\n }\r\n // Trace.DEBUG(getInstance(), (new StringBuilder(\"formatPath path:\")).append(path).toString());\r\n }\r\n\r\n if(stb.length() > 0)\r\n stb.append(\";\");\r\n stb.append(path);\r\n }\r\n\r\n ret = stb.toString();\r\n }\r\n }\r\n catch(Exception ex)\r\n {\r\n Trace.ERROR(ex);\r\n }\r\n return ret;\r\n }", "String getRealPath(String path);", "public static String m212a(String str) {\n if (TextUtils.isEmpty(str)) {\n return str;\n }\n int lastIndexOf = str.lastIndexOf(File.separator);\n return lastIndexOf == -1 ? \"\" : str.substring(0, lastIndexOf);\n }", "private Version splitHelper(Version commit1, Version commit2) {\n\t\tif (commit1.getID() == commit2.getID()) {\n\t\t\treturn commit1;\n\t\t} else if (commit1.getID() < commit2.getID()) {\n\t\t\treturn splitHelper(commit1, commit2.getParent());\n\t\t} else\n\t\t\treturn splitHelper(commit1.getParent(), commit2);\n\t}", "public static String foo2 ( String s )\r\n\t{\r\n\t\tif ( s.length() == 0 )\r\n\t\t\treturn \"even\";\r\n\t\telse if ( s.length() == 1 )\r\n\t\t\treturn \"odd\";\r\n\t\telse\r\n\t\t\treturn foo2( s.substring(0, s.length() - 1 ) );\r\n\t\t\r\n\t}", "private static String delimit(String s, char c) {\n int i = s.indexOf(c);\n while (i != -1) {\n if (i == 0 || s.charAt(i - 1) != '\\\\') {\n s = s.substring(0, i) + '\\\\' + s.substring(i);\n i = s.indexOf(c, i + 2);\n } else {\n i = s.indexOf(c, i + 1);\n }\n }\n return s;\n }", "public void testCanonicalize() {\n \tassertEquals(\"//\", new Path(\"///////\").toString());\r\n \tassertEquals(\"/a/b/c\", new Path(\"/a/b//c\").toString());\r\n \tassertEquals(\"//a/b/c\", new Path(\"//a/b//c\").toString());\r\n \tassertEquals(\"a/b/c/\", new Path(\"a/b//c//\").toString());\r\n \r\n \t// Test collapsing single dots\r\n \tassertEquals(\"2.0\", \"/\", new Path(\"/./././.\").toString());\r\n \tassertEquals(\"2.1\", \"/a/b/c\", new Path(\"/a/./././b/c\").toString());\r\n \tassertEquals(\"2.2\", \"/a/b/c\", new Path(\"/a/./b/c/.\").toString());\r\n \tassertEquals(\"2.3\", \"a/b/c\", new Path(\"a/./b/./c\").toString());\r\n \r\n \t// Test collapsing double dots\r\n \tassertEquals(\"3.0\", \"/a/b\", new Path(\"/a/b/c/..\").toString());\r\n \tassertEquals(\"3.1\", \"/\", new Path(\"/a/./b/../..\").toString());\r\n }", "public String getRelativePath (String path1, String path2) { \n if (path1 == null || path2 == null)\n return null;\n if (path1.equals(path2))\n return null;\n \n String lastDir = \"../\";\n String result = \"\";\n String[] allPath1 = path1.split(\"/\");\n String[] allPath2 = path2.split(\"/\");\n int i = 0;\n for ( i = 0; i < allPath1.length - 1; i++) {\n if (i >= allPath2.length - 1 || (!allPath1[i].equals(allPath2[i]))) {\n for (int j = i; j < allPath1.length - 1; j++) {\n result += lastDir;\n }\n break;\n }\n }\n for (int j = i ; j < allPath2.length; j++) {\n result += allPath2[j];\n if (j != allPath2.length - 1)\n result += \"/\";\n }\n return result;\n }", "public static String addToPath(String path, String path2) { return path + \"/\" + path2; }", "public List<String> decode(String s) {\n List<String> res = new ArrayList<String>();\n int i = 0;\n while(i < s.length())\n {\n int pre = i;\n while(s.charAt(i)!='/') ++i;\n int len = Integer.valueOf(s.substring(pre,i));\n ++i;\n res.add(s.substring(i,i+len));\n i = i+len;\n }\n return res;\n }", "public String removeSeparadorData(String data) {\r\n if(data.contains(\"/\")) {\r\n data = data.replaceAll(\"/\", \"\");\r\n \r\n } else if(data.contains(\"-\")) {\r\n data = data.replace(\"-\", \"\");\r\n }\r\n return data;\r\n }", "public static String stringMiddle(String str) {\r\n boolean isEven = (str.length() % 2 == 1);\r\n int begin = (str.length() - 1) / 2;\r\n int end = isEven ? 1 : 2;\r\n return str.substring(begin, begin + end);\r\n }", "public static String[] getDatabaseTableAndPartition(String path) {\n\t\tif(path == null){\n\t\t\treturn null;\n\t\t}\n\t\tif(path.equals(\"/\")){\n\t\t\treturn new String[]{};\n\t\t}else if (path.startsWith(\"/\")) {\n\t\t\treturn path.substring(1).split(\"/\");\n\t\t} else if (path.contains(\"/\")) {\n\t\t\treturn path.split(\"/\");\n\t\t} else {\n\t\t\tString[] paths = new String[] { path };\n\t\t\treturn paths;\n\t\t}\n\t}", "private String cutString(String value){\n String [] strings = value.split(\" \");\n System.out.println(strings[0]);\n return strings[0];\n }", "private String fixSlashes(String str) {\n\t\tstr = str.replace('\\\\', '/');\r\n\t\t// compress multiples into singles;\r\n\t\t// do in 2 steps with dummy string\r\n\t\t// to avoid infinte loop\r\n\t\tstr = replaceString(str, \"//\", \"_____\");\r\n\t\tstr = replaceString(str, \"_____\", \"/\");\r\n\t\treturn str;\r\n\t}", "public static int parseSlashIndex(String sentence) {\n return sentence.indexOf(\"/\");\n }", "private static final String appendSeparatorIfNeeded(String path) {\n if (path.length() > 0) {\n return (path.charAt(path.length() - 1) == File.separatorChar ? path : path.concat(File.separator));\n } else {\n return path;\n }\n }", "private ArrayList<PathItem> parsePath(String path) {\n\t\tArrayList<PathItem> pathItems = new ArrayList<PathItem>();\n\t\tString[] items = path.split(\"~\\\\\\\\\");\n\t\tString[] item;\n\t\tfor (int i = 0; i < items.length; i++) {\n\t\t\titem = items[i].split(\"~\");\n\t\t\tif (item.length >= 2)\n\t\t\t\tpathItems.add(new PathItem(item[0], item[1]));\n\t\t}\n\t\treturn pathItems;\n\t}", "private String fixPath(String Path) {\n\n // Nothing to do if we're running the plugin on a Windows machine.\n if (Global.IsWindowsOS()) {\n return Path;\n }\n\n // Replace all of the Windows separator characters with linux separator characters.\n String NewPath = Path.replaceAll(\"\\\\\\\\\", File.separator);\n\n Log.getInstance().write(Log.LOGLEVEL_TRACE, \"RecordingEpisode.fixPath: \" + Path + \"->\" + NewPath);\n \n return NewPath;\n }", "public List<List<String>> partition(String s) {\n if(s == null || s.length() == 0){\n return output;\n }\n \n helper(s, 0, new ArrayList<String>());\n \n return output;\n }", "private static Location buildSplitPath(Location tableLocation, AddFileEntry addAction)\n {\n URI uri = URI.create(addAction.getPath());\n String path = uri.getPath();\n\n // org.apache.hadoop.fs.azurebfs.AzureBlobFileSystem encodes the path as URL when opening files\n // https://issues.apache.org/jira/browse/HADOOP-18580\n Optional<String> scheme = tableLocation.scheme();\n if (scheme.isPresent() && (scheme.get().equals(\"abfs\") || scheme.get().equals(\"abfss\"))) {\n // Replace '+' with '%2B' beforehand. Otherwise, the character becomes a space ' ' by URL decode.\n path = URLDecoder.decode(path.replace(\"+\", \"%2B\"), UTF_8);\n }\n return tableLocation.appendPath(path);\n }", "private String[] split(String string){\n\t\tString[] split = string.split( \" \" );\n\t\t\n\t\tfor(int i = 0; i < split.length; i++){\n\t\t\tString index = split[i];\n\t\t\tindex = index.trim();\n\t\t}\n\t\t\n\t\treturn split;\n\t}", "@Test\n public void testSplitURL_String() throws Exception {\n System.out.println(\"splitURL\");\n String URLString = \"http://user:[email protected]:8080/to/path/document?arg1=val1&arg2=val2#part\";\n Map<URLParser.URLParts, String> expResult = new HashMap<>();\n expResult.put(URLParser.URLParts.PROTOCOL, \"http\");\n expResult.put(URLParser.URLParts.PATH, \"/to/path/document\");\n expResult.put(URLParser.URLParts.HOST, \"www.example.com\");\n expResult.put(URLParser.URLParts.PORT, \"8080\");\n expResult.put(URLParser.URLParts.USERINFO, \"user:password\");\n expResult.put(URLParser.URLParts.FILENAME, \"/to/path/document?arg1=val1&arg2=val2\");\n expResult.put(URLParser.URLParts.QUERY, \"arg1=val1&arg2=val2\");\n expResult.put(URLParser.URLParts.AUTHORITY, \"user:[email protected]:8080\");\n expResult.put(URLParser.URLParts.REF, \"part\");\n \n Map<URLParser.URLParts, String> result = URLParser.splitURL(URLString);\n assertEquals(expResult, result);\n }", "public Path resolve(String part) {\n return Paths.get(part);\n }", "public String atFirst(String str) {\r\n return str.length() > 1 ? str.substring(0, 2) : (str + \"@@\").substring(0, 2);\r\n }", "private void processPath(String str) {\r\n if (str.equals(\"\")) {\r\n return;\r\n }\r\n\r\n int id1 = Integer.valueOf(str.split(\"->\")[0].trim());\r\n int id2 = Integer.valueOf(str.split(\"->\")[1].trim());\r\n Node node1 = null;\r\n Node node2 = null;\r\n\r\n // Find node according to its id\r\n for (Node node : NodeSet) {\r\n if (node.getID() == id1) {\r\n node1 = node;\r\n } else if (node.getID() == id2) {\r\n node2 = node;\r\n }\r\n }\r\n\r\n g.add(new Edge(node1, node2));\r\n }", "private static String flipEndChars(String str) {\n if (str.length() < 2) {\n return \"Incompatible.\";\n }\n char firstChar = str.charAt(0);\n char lastChar = str.charAt(str.length() - 1);\n if (firstChar == lastChar) {\n return \"Two\\'s a pair.\";\n }\n return lastChar + str.substring(1, str.length() - 1) + firstChar;\n }", "String divideAtWhite()[]{ return null; }", "private String trimLeadingPath(String filename) {\n return filename.substring(Math.max(filename.lastIndexOf('/'), filename.lastIndexOf('\\\\')) + 1);\n }", "public static void main(String[] args){\n\n String fileName = \"abc.jpeg\";\n String[] parts = fileName.split(\"\\\\.\");\n\n System.out.println(parts[1]);\n\n\n\n }", "private static String handleUrl(String s) {\n if (s.endsWith(\"/..\")) {\n int idx = s.lastIndexOf('/');\n s = s.substring(0, idx - 1);\n idx = s.lastIndexOf('/');\n String gs = s.substring(0, idx);\n if (!gs.equals(\"smb:/\")) {\n s = gs;\n }\n }\n if (!s.endsWith(\"/\")) {\n s += \"/\";\n }\n System.out.println(\"now its \" + s);\n return s;\n }", "public static String parseExpressionForSecondFraction(String expression) {\n int space = expression.indexOf(\" \");\n String frac1 = expression.substring(0, space);\n String operator = expression.substring(space + 1, space + 2);\n int length = expression.length();\n String frac2 = expression.substring(space + 3, length);\n return frac2;\n }", "public String twoChar(String str, int index) {\r\n return index > 0 && index < str.length() - 1 ? str.substring(index, index + 2) : str.substring(\r\n 0, 2);\r\n }", "String getSeparator();" ]
[ "0.67879504", "0.6406187", "0.594003", "0.57572854", "0.5681553", "0.55932873", "0.5491975", "0.54808974", "0.54406106", "0.5431049", "0.5405538", "0.5387782", "0.5372398", "0.5351486", "0.5346287", "0.5331758", "0.5304434", "0.5254239", "0.5243943", "0.51949257", "0.51701087", "0.51338995", "0.5106197", "0.5095009", "0.5075912", "0.50740826", "0.5054101", "0.50315684", "0.5029737", "0.50256246", "0.50198835", "0.501595", "0.49819276", "0.4965799", "0.4943092", "0.49362043", "0.49263647", "0.49155802", "0.49104786", "0.48924407", "0.48924407", "0.48906934", "0.48871958", "0.48838288", "0.48607168", "0.48572183", "0.48420778", "0.48413813", "0.4839782", "0.48219877", "0.48182237", "0.48151225", "0.4796858", "0.4796756", "0.47738805", "0.47731617", "0.47731617", "0.47579837", "0.4756882", "0.47432464", "0.47361952", "0.47240797", "0.4720274", "0.47183457", "0.469671", "0.46930072", "0.4692804", "0.46911788", "0.46871158", "0.46869573", "0.468172", "0.46651024", "0.46616635", "0.46610993", "0.46578962", "0.46513495", "0.4646328", "0.4638208", "0.46370894", "0.4620328", "0.46194565", "0.4616882", "0.46152994", "0.46149153", "0.46120733", "0.46103457", "0.46076843", "0.45988798", "0.45931506", "0.45879084", "0.45855972", "0.45830673", "0.4575315", "0.45719197", "0.45689294", "0.45670378", "0.4566577", "0.45632887", "0.45604312", "0.45599824" ]
0.668161
1
Returns the first word and everything after the first ' ' of the String.
public static String[] wordSeparator(String input) { return partition(input, ' '); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private String firstWord(String userMessage) {\n if (userMessage.contains(\" \"))\n return userMessage.substring(0, userMessage.indexOf(\" \"));\n return userMessage;\n }", "public static String delFirstChar(String word){\n\t\tif(word.length() <= 1){\n\t\t\treturn word;\n\t\t}\n\t\tword = word.substring(1, word.length());\n\t\tguessPW(word);\n\t\treturn word;\n\n\t}", "public static String capitalizeAllFirstLetters(String s)\n {\n char firstLetter;\n String result, word, capitalizedWord;\n String [] array;\n\n result = \"\";\n\n if(s.length() > 0)\n {\n array = s.split(\" \");\n\n for(int i =0; i < array.length; i++)\n {\n word = array[i];\n firstLetter = Character.toUpperCase(word.charAt(0));\n capitalizedWord = firstLetter + word.substring(1);\n\n result += capitalizedWord + \" \";\n }\n }\n\n return result;\n }", "static String cutName(String input) { return input.split(\" \")[0]; }", "private String firstSentenceSplitting(String s) {\n // Double new-line means a new sentence:\n s = paragraph.matcher(s).replaceAll(\"$1\" + EOS);\n // Punctuation followed by whitespace means a new sentence:\n s = punctWhitespace.matcher(s).replaceAll(\"$1\" + EOS);\n // New (compared to the perl module): Punctuation followed by uppercase followed\n // by non-uppercase character (except dot) means a new sentence:\n s = punctUpperLower.matcher(s).replaceAll(\"$1\" + EOS + \"$2\");\n // Break also when single letter comes before punctuation:\n s = letterPunct.matcher(s).replaceAll(\"$1\" + EOS);\n return s;\n }", "public String trim(String str) {\n\n return str.replaceFirst(\" \", \"\");\n\n }", "public static String the(String str)\n\t{\t\t\n\t\tif (str.startsWith(\"the \")) return str;\n\t\telse if (str.startsWith(\"The \")) return str;\n\t\telse if (str.toLowerCase().charAt(0) == str.charAt(0)) return \"the \" + str;\n\t\telse return \"The \" + str.toLowerCase();\n\t}", "public static String getWord(String sentence, char word) {\n\t\tString[] words;\n\t\twords = sentence.split(\" \");\n\t\tString cleanedWord=\"\";\n\t\t\n\t\tif(word=='f') {//return the first word\n\t\t\tString temp = words[0];\n\t\t\t\n\t\t\tfor(int i=0; i < temp.length(); i++) {\n\t\t\t\tif(Character.isLetter(temp.charAt(i))) {\n\t\t\t\t\tcleanedWord+= Character.toString(temp.charAt(i));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}else {//return the last word\n\t\t\tString temp = words[words.length -1];\n\t\t\t\n\t\t\tfor(int i=0; i < temp.length(); i++) {\n\t\t\t\tif(Character.isLetter(temp.charAt(i))) {\n\t\t\t\t\tcleanedWord+= Character.toString(temp.charAt(i));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn cleanedWord;\n\t}", "private String cutString(String value){\n String [] strings = value.split(\" \");\n System.out.println(strings[0]);\n return strings[0];\n }", "public static void main(String args[])\n {\n String s = \"Bharat mata ki jai\";\n char[] c = s.toCharArray();\n\n for(int i =0; i<c.length;i++)\n {\n if(c[i]!=' ' && (i == 0 || c[i-1]==' '))\n {\n System.out.print(c[i]+\" \");\n }\n }\n\n\n\n\n }", "private static String capitaliseSingleWord(String word) {\n String capitalisedFirstLetter = word.substring(0, 1).toUpperCase();\n String lowercaseRemaining = word.substring(1).toLowerCase();\n return capitalisedFirstLetter + lowercaseRemaining;\n }", "public String atFirst(String str) {\r\n return str.length() > 1 ? str.substring(0, 2) : (str + \"@@\").substring(0, 2);\r\n }", "public String getSingleSpaceString(String sInputString) {\n String sOutputString = \"\";\n try {\n\n //loop replace all TAB by single space\n while (sInputString.contains(\"\t\")) {\n sInputString = sInputString.replaceAll(\"\t\", \" \").trim();\n }\n\n //loop to replace all double space by single space\n while (sInputString.contains(\" \")) {\n sInputString = sInputString.replaceAll(\" \", \" \").trim();\n }\n\n } catch (Exception e) {\n\n } finally {\n sOutputString = sInputString;\n sInputString = null;\n return sOutputString;\n }\n }", "public static String capFirstChar(String word) {\n \tif(word == null || word.length() == 0)\n \t\treturn word;\n\n \tword = word.toLowerCase().replace('_', ' ');\n\t\treturn Character.valueOf(Character.toUpperCase(word.charAt(0))).toString() + word.substring(1);\n }", "static String trimStart(String s) {\n StringBuilder sb = new StringBuilder(s);\n while(sb.length() > 0 && (sb.charAt(0) == '\\u005cr'\n || sb.charAt(0) == '\\u005cn'\n || sb.charAt(0) == '\\u005ct'\n || sb.charAt(0) == ' ')) {\n sb.deleteCharAt(0);\n }\n return sb.toString();\n }", "String trimLeft( String txt ){\r\n // trim\r\n int start = 0;\r\n WHITESPACE: for( int i=0; i < txt.length(); i++ ){\r\n char ch = txt.charAt(i);\r\n if( Character.isWhitespace(ch)){\r\n continue;\r\n }\r\n else {\r\n start = i;\r\n break WHITESPACE;\r\n }\r\n }\r\n return txt.substring(start); \r\n }", "public static String cleanString(String s) {\n\t\ts = s.trim();\n\t\tString newStr = \"\";\n\t\tboolean lastWasSpace = false;\n\t\tfor(int i = 0; i < s.length(); i++) {\n\t\t\tchar c = s.charAt(i);\n\t\t\tif(c == ' ' && lastWasSpace) {\n\t\t\t\t//Ignore\n\t\t\t} else if (c == ' ' && !lastWasSpace) {\n\t\t\t\tnewStr+=c;\n\t\t\t\tlastWasSpace = true;\n\t\t\t} else {\n\t\t\t\tnewStr+=c;\n\t\t\t\tlastWasSpace = false;\n\t\t\t}\n\t\t}\n\t\ts = newStr;\n\t\treturn s;\n\t}", "public static char first(String s) {\n\treturn s.charAt(0);\n\t}", "public static char first(String s) {\n return s.charAt(0);\n }", "private String makeFirstLetterCapital(String str) {\n\t\tchar ch[] = str.toCharArray();\r\n\t\tfor (int i = 0; i < str.length(); i++) {\r\n\r\n\t\t\t// If first character of a word is found\r\n\t\t\tif (i == 0 && ch[i] != ' ' || ch[i] != ' ' && ch[i - 1] == ' ') {\r\n\r\n\t\t\t\t// If it is in lower-case\r\n\t\t\t\tif (ch[i] >= 'a' && ch[i] <= 'z') {\r\n\r\n\t\t\t\t\t// Convert into Upper-case\r\n\t\t\t\t\tch[i] = (char) (ch[i] - 'a' + 'A');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// If apart from first character\r\n\t\t\t// Any one is in Upper-case\r\n\t\t\telse if (ch[i] >= 'A' && ch[i] <= 'Z')\r\n\r\n\t\t\t\t// Convert into Lower-Case\r\n\t\t\t\tch[i] = (char) (ch[i] + 'a' - 'A');\r\n\t\t} \r\n\r\n\t\t// Convert the char array to equivalent String\r\n\t\tString st = new String(ch);\r\n\t\treturn st;\r\n\r\n\t\t// return sb.toString();\r\n\t}", "private String stripQuotes(String word) {\n\t\tString workWord = new String (word);\n\t\tif (workWord != null && workWord.length() > 1) {\n\t\t\tif (workWord.endsWith(new String(\"\\'\")) || workWord.endsWith(new String(\"\\\"\"))) {\n\t\t\t\tworkWord = workWord.substring(0, workWord.length()-1);\n\t\t\t}\n\t\t\telse if (workWord.endsWith(new String(\"\\'s\")) || workWord.endsWith(new String(\"\\'d\")) ) {\n\t\t\t\tworkWord = workWord.substring(0, workWord.length()-2);\n\t\t\t}\n\t\t\tif (workWord.startsWith(new String(\"\\'\")) || workWord.startsWith(new String(\"\\\"\")) && workWord.length() > 1) {\n\t\t\t workWord = workWord.substring(1);\n\t\t\t}\n\t\t}\n\t return workWord;\n\t}", "private String scan() {\n line = line.trim();\n if (line.length() == 0)\n return \"\";\n\n int i = 0;\n while (i < line.length() && line.charAt(i) != ' ' && line.charAt(i) != '\\t') {\n i = i + 1;\n }\n String word = line.substring(0, i);\n line = line.substring(i);\n return word;\n }", "public String firstHalf(String str) {\r\n return str.substring(0, str.length() / 2);\r\n }", "public String removeLastWord(String text) {\n return text.substring(0, text.lastIndexOf(\" \"));\n }", "private Token scanString(LocatedChar firstChar) {\n\t\tStringBuffer buffer = new StringBuffer();\n\t\tappendSubsequentString(buffer);\n\t\tLocatedChar ch = input.peek();\n\t\tif(ch.matchChar('\"')) {\n\t\t\tinput.next();\n\t\t\treturn StringToken.make(firstChar, buffer.toString());\n\t\t} else {\n\t\t\tlexicalError(ch, \"malformed string\");\n\t\t\treturn findNextToken();\n\t\t}\n\t}", "public char getFirstChar(String hanyuString) {\n\t\tchar firstChar = getPinyin(hanyuString, HanyuPinyinCaseType.UPPERCASE).charAt(0);\n\t\tif (firstChar == ' ') {\n\t\t\tfirstChar = '#';\n\t\t}\n\t\treturn firstChar;\n\n\t}", "protected static String reduceString(String input) {\n String newString = input.toLowerCase();\n int len = newString.length();\n String retval = \"\";\n for (int i = 0; i < len; i++) {\n if (newString.charAt(i) == ' ' || newString.charAt(i) == '\\t') continue; else retval += newString.charAt(i);\n }\n return retval;\n }", "private static String firstUpperCase(String word) {\n\t\tif (word == null || word.isEmpty()) {\n\t\t\treturn \"\";\n\t\t}\n\t\treturn word.substring(0, 1).toUpperCase() + word.substring(1);\n\t}", "public static char firstLetter(String s){\r\n\t\tchar firstLetter = 0;\r\n\t\tfor (int i = 0; i < s.length(); i++) {\r\n\t\t\tif(Character.isLetter(s.charAt(i))){\r\n\t\t\tfirstLetter = s.charAt(i);\r\n\t\t\treturn firstLetter;\r\n\t\t\t}\r\n\t\t}return firstLetter;\r\n\t}", "public String firstAlphabeticalTitleLetter(String title){\n\t\t int first = 0;\n if ( title.toLowerCase().startsWith(\"the \") ) { first = 4; }\n\t\t return title.substring(first, (first + 1));\n\t }", "public static String cutSpaces(String s){\n\t\tString res = s;\n\t\t\n\t\twhile ((res.startsWith(\" \")||(res.startsWith(\"\\n\")))&& res.length()>0) {\n\t\t\tres=res.substring(1);\n\t\t}\n\t\treturn res;\n\t}", "private static String cutTextAtLastSpace(String lastTxt) {\n\t\tint idx = lastTxt.lastIndexOf(\" \");\n\t\t// if no space is found, cut on length\n\t\tif (idx > 0) {\n\t\t\tlastTxt = lastTxt.substring(0, idx);\n\t\t}\n\t\treturn lastTxt;\n\t}", "public String reverseWords(String s) {\n\t\ts = s.trim();\n\t\tStringBuffer result = new StringBuffer();\n\t\tString[] buffer = s.split(\" \");\n\t\tfor (int i = buffer.length - 1; i >= 0; i--) {\n\t\t\tif (!buffer[i].equals(\"\")) {\n\t\t\t\tresult.append(buffer[i]);\n\t\t\t\tresult.append(\" \");\n\t\t\t}\n\t\t}\n\t\tString r = result.toString();\n\t\tif (!r.equals(\"\")) {\n\t\t\treturn r.substring(0, r.length() - 1);\n\t\t}\n\t\telse {\n\t\t\treturn r;\n\t\t}\n\t}", "public static String extractAbbreviationFromString(String s) {\n\t\tint abbreviationIndex = s.indexOf(' ', 5) + 4;\n\t\treturn s.substring(abbreviationIndex, s.indexOf(' ', abbreviationIndex));\n\t}", "public static String removeSpaces(String s) {\r\n StringTokenizer stt = new StringTokenizer(s);\r\n String res = \"\";\r\n\r\n while (stt.hasMoreTokens()) {\r\n String tok = stt.nextToken().trim();\r\n res += tok;\r\n }\r\n return res;\r\n }", "public String trimOne(String str) {\n return trim(str, 1);\n }", "public String getWordUnderCursor() {\r\n\t\t\r\n\t\t//we cannot search backward, so we start from the beginning: \r\n\t\tString text = getAllText();\r\n\t\tint index = getCaretPosition();\r\n\t\tPattern pattern = Pattern.compile(\"[a-zA-Z]+\"); //test version, this is not perfect. For example words between quotes\r\n\t\tMatcher matcher = pattern.matcher(text);\r\n\t\twhile(matcher.find()) {\r\n\t\t\tif(matcher.start() > index)\r\n\t\t\t\treturn \"\";\r\n\t\t\tif(matcher.start() <= index && matcher.end() >= index)\r\n\t\t\t\treturn getText(matcher.start(), matcher.end()-matcher.start());\r\n\t\t}\r\n\t\treturn \"\";\r\n\t}", "private static String formattingWhitespace(String string) {\n // Splitting the String.\n String[] stringSplits = string.split(\" \");\n\n StringBuilder formattedString = new StringBuilder();\n for (int word = 0; word < stringSplits.length; word++) {\n // If the element is not an empty String.\n if (!stringSplits[word].isEmpty()) {\n // Checking if the word is not the last word of the sentence.\n if (word < stringSplits.length - 1) {\n // Adding a space after the word.\n formattedString.append(stringSplits[word]).append(\" \");\n }\n // If last word of the sentence.\n else {\n // Last word does not have a space after it.\n formattedString.append(stringSplits[word]);\n }\n }\n }\n // Returning a formatted String.\n return formattedString.toString();\n }", "private static String[] seperateStr(String str)\r\n\t{\r\n\t\tboolean doubleSpace = false;\r\n\t\tint wordCount = 0;\r\n\t\tStringBuffer sb = new StringBuffer();\r\n\t\tif (str == null || str.length() == 0)\r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tfor (int j = 0; j < str.length(); j++)\r\n\t\t{\r\n\t\t\tif (str.charAt(j) == ' ')\r\n\t\t\t{\r\n\t\t\t\tif (!doubleSpace)\r\n\t\t\t\t\twordCount++;\r\n\r\n\t\t\t\tdoubleSpace = true;\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tdoubleSpace = false;\r\n\t\t}\r\n\t\tString st[] = new String[wordCount + 1];\r\n\t\tint i = 0;\r\n\r\n\t\tdoubleSpace = false;\r\n\t\tString ch = \"\";\r\n\t\tfor (int j = 0; j < str.length(); j++)\r\n\t\t{\r\n\t\t\tif (str.charAt(j) == ' ')\r\n\t\t\t{\r\n\t\t\t\tif (!doubleSpace)\r\n\t\t\t\t{\r\n\t\t\t\t\tst[i] = sb.toString();\r\n\t\t\t\t\tsb.delete(0, sb.length());\r\n\t\t\t\t\ti++;\r\n\t\t\t\t}\r\n\t\t\t\tdoubleSpace = true;\r\n\t\t\t\tcontinue;\r\n\t\t\t} else\r\n\t\t\t{\r\n\t\t\t\tsb.append(str.charAt(j));\r\n\t\t\t}\r\n\t\t\tdoubleSpace = false;\r\n\t\t}\r\n\r\n\t\tst[i] = sb.toString();\r\n\t\t;\r\n\t\treturn st;\r\n\t}", "public static Token string(char firstChar, Source source) {\r\n\t\tToken token = new Token(firstChar); // the leading '\r\n\t\ttoken.lineNumber = source.lineNumber();\r\n\t\tchar ch;\r\n\t\t// True when we find a ' character that could be used as an escape;\r\n\t\tboolean escaped = false; // Mainly represents whether ' was the previous character\r\n\r\n\t\t// Loop to append the rest of the characters of the string\r\n\t\t// unless we reach a closing ' or the EOF\r\n\t\tfor (ch = source.nextChar(); ch != Source.EOF; ch = source.nextChar()) {\r\n\t\t\t// If the previous char was ', but the current char isn't ',\r\n\t\t\t// so we know we're at the end of a string\r\n\t\t\tif (escaped && ch != '\\'')\r\n\t\t\t\tbreak;\r\n\t\t\telse if (escaped && ch == '\\'') {\r\n\t\t\t\t// The previous char was ', and the current char is ',\r\n\t\t\t\t// so we know the previous was an escape char\r\n\t\t\t\tescaped = false;\r\n\t\t\t\ttoken.text += ch;\r\n\t\t\t} else if (ch == '\\'') {\r\n\t\t\t\t// The current char is ', so it's either an escape char,\r\n\t\t\t\t// or it's the end of the string\r\n\t\t\t\tescaped = true;\r\n\t\t\t} else\r\n\t\t\t\ttoken.text += ch; // Standard case\r\n\t\t}\r\n\r\n\t\t// Is the token a single character surrounded by two quotes?\r\n\t\t// If so, it's a Character (size = 3)\r\n\t\tif (ch == Source.EOF) {\r\n\t\t\ttoken.type = TokenType.STRING;\r\n\t\t\ttokenError(token, \"String not closed\");\r\n\t\t} else {\r\n\t\t\ttoken.text += '\\''; // Append the closing ' (it has already been consumed)\r\n\t\t\t// Don't include the leading and trailing ' in the value.\r\n\t\t\ttoken.value = token.text.substring(1, token.text.length() - 1);\r\n\t\t\tif (token.text.length() == 3)\r\n\t\t\t{\r\n\t\t\t token.type = TokenType.CHARACTER;\r\n\t\t\t token.value = token.text.charAt(1);\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\telse\r\n\t\t\t\ttoken.type = TokenType.STRING; // If not, it's a String\r\n\t\t}\r\n\r\n\t\treturn token;\r\n\t}", "public static String stringMiddle(String str) {\r\n boolean isEven = (str.length() % 2 == 1);\r\n int begin = (str.length() - 1) / 2;\r\n int end = isEven ? 1 : 2;\r\n return str.substring(begin, begin + end);\r\n }", "public void getFirstAndLastName( String name ){//\r\n String nameNew = name.trim();\r\n String[] arr = nameNew.split(\"\\\\s\");\r\n firstName = arr[0];\r\n lastName = arr[1];\r\n }", "public static String shortestWord(Scanner s){\n\t\t\n\t\t//assume the first word is shortest\n\t\tString shortest = s.next();\n\t\t\n\t\twhile(s.hasNext()){\n\t\t\t\n\t\t\tString temp = s.next();\n\t\t\t\n\t\t\t//check to see if 'temp' is shorter than the current shortest string\n\t\t\tif ( temp.length()< shortest.length()){\n\t\t\t\tshortest = temp;\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn shortest;\n\t}", "public String startWord(String str, String word) {\r\n if (str.length() > 0 && word.length() > 0) {\r\n String strSub = str.substring(1);\r\n String wordSub = word.substring(1);\r\n\r\n if (strSub.startsWith(wordSub)) {\r\n\r\n return str.charAt(0) + wordSub;\r\n }\r\n }\r\n\r\n return \"\";\r\n }", "public static String removePunctuation( String word )\n {\n while(word.length() > 0 && !Character.isAlphabetic(word.charAt(0)))\n {\n word = word.substring(1);\n }\n while(word.length() > 0 && !Character.isAlphabetic(word.charAt(word.length()-1)))\n {\n word = word.substring(0, word.length()-1);\n }\n \n return word;\n }", "public static String capitalizeFirstLetter(String str) {\n if (TextUtils.isEmpty(str)) {\n return str;\n }\n\n char c = str.charAt(0);\n return (!Character.isLetter(c) || Character.isUpperCase(c)) ? str\n : new StringBuilder(str.length()).append(Character.toUpperCase(c)).append(str.substring(1)).toString();\n }", "private static int firstWhitespaceIndexOf(String text) {\n return minIndex(\n text.indexOf(' '),\n text.indexOf('\\n'),\n text.indexOf('\\r'),\n text.indexOf('\\t')\n );\n }", "public String parseTitle(String goods) {\n return goods.split(\"\\\\s+\")[1];\n }", "public static boolean isFirstWordInSentence(String word) {\n return word.matches(\"\\\\p{Punct}*\\\\p{Lu}[\\\\p{L}&&[^\\\\p{Lu}]]*\");\n }", "private static String removeFirstLastQuotations(String string)\n\t{\n\t\tint firstIndex = string.indexOf('\\\"');\n\t\tint lastIndex = string.lastIndexOf('\\\"');\n\t\tif (firstIndex == 0 && lastIndex == string.length() - 1)\n\t\t\treturn string.substring(1, lastIndex);\n\t\t\n\t\treturn string;\n\t}", "public static String middle(String s) {\n return s.substring(1, s.length() - 1);\n }", "public String reverseWords(String s) {\n\t\tString ans=\"\";\n\t\tString temp[];\n\t\tif(s.isEmpty())\n\t\t\treturn \"\";\n\t\ttemp=s.split(\" \");\n\t\tfor(int i=temp.length-1;i>=0;i--) {\n\t\t\tif(!temp[i].isEmpty()) {\n\t\t\t\tans+=temp[i]+\" \";\n\t\t\t}\n\t\t}\n\t\treturn ans.trim();\n\t}", "public static String lowerFirst(String value) {\r\n\t\tif(value == null || value.length() == 0) {\r\n\t\t\treturn value;\r\n\t\t}\r\n\t\tif(value.length() == 1) {\r\n\t\t\treturn value.toLowerCase();\r\n\t\t}\r\n\t\treturn Character.toLowerCase(value.charAt(0)) + value.substring(1); \r\n\t}", "public String firstAlphabeticalTitlePseudoLetter(String title){\n\t\t int first = 0;\n if ( title.toLowerCase().startsWith(\"the\") && !title.toLowerCase().startsWith(\"the \") ) { first = 3; }\n\t\t return title.substring(first, (first + 1));\n\t }", "public static String lowerCaseFirstChar(String str){\r\n\t\treturn str.substring(0, 1).toLowerCase() + str.substring(1); \r\n\t}", "public static String ltrim(String s)\r\n {\r\n if (s == null)\r\n return null;\r\n \r\n for (int k = 0; k < s.length(); k++)\r\n {\r\n if (!Character.isWhitespace(s.charAt(k)))\r\n return (k == 0 ? s : s.substring(k));\r\n }\r\n return \"\";\r\n }", "public static String stringBefore (String in, String token) {\n\t\tint index = in.indexOf(token);\n\t\tif (index == -1)\n\t\t\treturn in; // not found, returning full String\n\t\telse\n\t\t\treturn in.substring(0, index);\n\t}", "static String capitalizeFirstLetter( String str ) {\n if ( str == null || str.length() <= 0 )\n return str;\n\n char chars[] = str.toCharArray();\n chars[0] = Character.toUpperCase(chars[0]);\n return new String(chars);\n }", "private String capitalizeFirstLetter(String aString){\n\t\t// pre-conditon\n\t\tif(aString == null || aString.length() == 0) return aString;\n\t\t// Main code\n\t\treturn aString.substring(0, 1).toUpperCase() + aString.substring(1);\n\t}", "private String removeFirstChar(String name) {\n\t\treturn name.substring(1, name.length());\n\t}", "public String reorderSpaces(String text) {\n\t\tchar[] newStr = new char[text.length()];\n\t\tString[] splitStr = text.split(\" \");\n\t\tint wordCount = 0;\n\t\tint spaceCount = 0;\n\n\t\tfor (int i = 0; i < text.length(); i++) {\n\t\t\tif (text.charAt(i) == ' ') {\n\t\t\t\tspaceCount++;\n\t\t\t}\n\t\t}\n\n\t\tfor (String word : splitStr) {\n\t\t\tif (!word.trim().isEmpty()) {\n\t\t\t\twordCount++;\n\t\t\t}\n\t\t}\n\n\t\tint space = wordCount <= 1 ? spaceCount : spaceCount / (wordCount - 1);\n\t\tint extraSpace = wordCount <= 1 ? 0 : spaceCount % (wordCount - 1);\n\t\tint k = 0;\n\n\t\tfor (String word : splitStr) {\n\t\t\tif (!word.trim().isEmpty()) {\n\t\t\t\tfor (int i = 0; i < word.trim().length(); i++) {\n\t\t\t\t\tnewStr[k++] = word.trim().charAt(i);\n\t\t\t\t}\n\n\t\t\t\tfor (int i = 0; k < text.length() && i < space; i++) {\n\t\t\t\t\tnewStr[k++] = ' ';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; k < text.length() && i < extraSpace; i++) {\n\t\t\tnewStr[k++] = ' ';\n\t\t}\n\n\t\treturn new String(newStr);\n\t}", "public String cleanStr(String s) {\n\t\t\n\t\tString fixed = s;\n\t\tif(s.contains(\"\\\"\")) {\n\t\t\tfixed = s.strip().split(\"\\\"\")[1];\n\t\t}\n\t\treturn fixed;\n\t}", "char getFirstChar(String input) {\n\t\tchar firstChar = input.charAt(0), temp;\n\t\tint count;\n\t\tfor(int index=0; index<input.length(); index++) {\n\t\t\ttemp = input.charAt(index);\n\t\t\tcount=0;\n\t\t\tfor(int innerIndex=0; innerIndex<input.length(); innerIndex++) {\n\t\t\t\tif(temp == input.charAt(innerIndex)) \n\t\t\t\t\tcount++;\n\t\t\t}\n\t\t\tif(count==1) {\n\t\t\t\tfirstChar = temp;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn firstChar;\n\t}", "public static String rest(String s) {\n return s.substring(1);\n }", "private static String wordCap(String str) {\r\n\t\tif(str.isEmpty()) {\r\n\t\t\treturn \"\";\r\n\t\t}else if(str.length()==1) {\r\n\t\t\treturn str.toUpperCase();\r\n\t\t}else {\r\n\t\t\treturn (str.substring(0,1)).toUpperCase() + (str.substring(1,str.length()).toLowerCase());\r\n\t\t}\r\n\t}", "public void stringToAl(String s){\n\t\tfor(int i=0, j=0; i<s.length(); i++){\n\t\t\tif(s.charAt(i) == ' ' || i == s.length()-1){\n\t\t\t\tString temp;\n\t\t\t\tif(i == s.length() - 1){\n\t\t\t\t\ttemp =s.substring(j,i+1);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\ttemp =s.substring(j,i);\n\t\t\t\t}\n\t\t\t\t//System.out.println(temp);\n\t\t\t\twords.add(temp);\n\t\t\t\tj = i + 1;\n\n\t\t\t}\n\t\t}\n\n\t}", "private String removeLeadingWhitespace(String input) {\n for (int index = 0; index < input.length(); index++) {\n if (!Character.isWhitespace(input.charAt(index))) {\n return input.substring(index);\n }\n }\n return input;\n }", "public static String formatString(String str){\n String[] arr = str.split(\" \");\n String resultant = \"\";\n for(int i = 0; i < arr.length;i++){\n if(arr[i].length() == 1)\n arr[i] = arr[i].toUpperCase();\n else if(arr[i].length() == 0)\n continue;\n else{\n arr[i] = Character.toUpperCase(arr[i].charAt(0)) + arr[i].substring(1);\n }\n }\n for(String s : arr)\n resultant += s + \" \";\n return resultant.trim();\n }", "public static String noSpaces(String strIn){\n String result = \"\";\n\n if (strIn.length() != 0){\n\n String[] segs = strIn.split(\" \");\n\n for (String s: segs){\n result += s;\n }\n }\n\n return result;\n }", "public String getFirstLongestConcatenatedWord() {\n return concatenatedWords.get(0);\n }", "public String nextToken()\n\t{\n\t\tif (current >\tmax) return\t\"\";\n\t\t\n\t\tcurrentToken++;\n\t\t\n\t\tif (current == max) return str.substring(current,++current);\n\n\t\tint nextDel=this.str.indexOf(this.firstDelimiters, current);\n\t\t\n\t\tString returnString;\n\t\t\n\t\tif (nextDel < 0)\n\t\t{\n\t\t\treturnString=this.str.substring(current, this.str.length());\n\t\t\tcurrent=max+1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturnString=this.str.substring(current, nextDel);\n\t\t\tcurrent=nextDel+1;\n\t\t}\n\t\treturn returnString;\n\t}", "public static int indexOfSecondSpace(String str) {\n return 1;\n }", "private String trimLeft(String html) {\n int start = 0;\n for (int i = 0; i < html.length(); ++i) {\n char c = html.charAt(i);\n if (Character.isWhitespace(c) || c == 0xA0) { // nbsp\n start = i;\n } else {\n break;\n }\n }\n\n if (html.charAt(start) == 0xA0) {\n return html.substring(start + 1);\n } else {\n return html.substring(start); // left one space\n }\n }", "public static String middle(String s) {\n\treturn s.substring(1, s.length() - 1);\n\t}", "public static String firstUpcase(String s) {\n if (s.equals(\"\")) {\n return \"\";\n } else {\n return new String(Character.toUpperCase(s.charAt(0))+s.substring(1));\n }\n }", "public static String trim(String s) {\r\n\t\treturn Escape.collapseWhitespace(Escape.forDoubleQuotedString(s, true).trim());\r\n\t}", "public String getWord (int wordIndex) {\n if (wordIndex < 0 ) {\n return \"\";\n } else {\n int s = getWordStart (wordIndex);\n int e = indexOfNextSeparator (tags, s, true, true, slashToSeparate);\n if (e > s) {\n return tags.substring (s, e);\n } else {\n return \"\";\n }\n }\n }", "public static String rest(String s) {\n\treturn s.substring(1);\n\t}", "java.lang.String getWord();", "private static String trim(String s) {\n return s.replace(\" \", \"\");\n }", "public String getAnyWordStartingWith(String s) {\n TrieNode temp = searchNode(s);\n if (temp == null){\n return \"noWord\";\n }\n while (!temp.isWord){\n for (String c: temp.children.keySet()){\n temp = temp.children.get(c);\n s += c;\n break;\n }\n }\n return s;\n }", "public static Token word(char firstChar, Source source) {\r\n\t\tToken token = new Token(firstChar);\r\n\t\ttoken.lineNumber = source.lineNumber();\r\n\r\n\t\t// Loop to get the rest of the characters of the word token.\r\n\t\t// Append letters and digits to the token.\r\n\t\tfor (char ch = source.nextChar(); Character.isLetterOrDigit(ch); ch = source.nextChar()) {\r\n\t\t\ttoken.text += ch;\r\n\t\t}\r\n\r\n\t\t// Is it a reserved word or an identifier?\r\n\t\ttoken.type = reservedWords.get(token.text.toUpperCase());\r\n\t\tif (token.type == null)\r\n\t\t\ttoken.type = TokenType.IDENTIFIER;\r\n\r\n\t\treturn token;\r\n\t}", "public static String parseLastString(String s) {\n String[] ss = RegEx.SPACES.split(s);\n // guaranteed at least one element\n return ss[ss.length - 1];\n }", "public static String uppercaseFirstLetters(String str) {\n boolean prevWasWhiteSp = true;\n char[] chars = str.toCharArray();\n for (int i = 0; i < chars.length; i++) {\n if (Character.isLetter(chars[i])) {\n if (prevWasWhiteSp) {\n chars[i] = Character.toUpperCase(chars[i]);\n }\n prevWasWhiteSp = false;\n } else {\n prevWasWhiteSp = Character.isWhitespace(chars[i]);\n }\n }\n return new String(chars);\n }", "public String nextToken()\n {\n\n if (currentPosition >= maxPosition)\n {\n throw new NoSuchElementException();\n }\n\n int start = currentPosition;\n\n while ((currentPosition < maxPosition)\n && Character.isLetterOrDigit(str.charAt(currentPosition)))\n {\n currentPosition++;\n }\n\n if ((start == currentPosition)\n && (!Character.isLetterOrDigit(str.charAt(currentPosition))))\n {\n currentPosition++;\n }\n\n return str.substring(start, currentPosition);\n }", "public static String toTitleCase(String s) {\n if (s != null && !s.isEmpty()) {\n int length = s.length();\n String str = \"\";\n String strTemp = \"\";\n for (int i = 0; i < length; i++) {\n char ch = s.charAt(i);\n if (ch == ' ') {\n strTemp += ch;\n str = str.concat(toSentenceCase(strTemp));\n strTemp = \"\";\n } else {\n strTemp += ch;\n }\n }\n str = str.concat(toSentenceCase(strTemp));\n return str;\n } else\n return \"\";\n }", "public String acronym(String phrase) {\n /*StringBuilder acronymFeed = new StringBuilder(\"\");\n String wordHolder = \"\";\n int spaceIndex;\n char firstLetter;\n do{\n spaceIndex = phrase.indexOf(\" \");\n wordHolder = phrase.substring(0,spaceIndex);\n acronymFeed.append(wordHolder.charAt(0));\n phrase = phrase.replaceFirst(wordHolder, \"\");\n } while (spaceIndex != -1 && wordHolder != \"\" && phrase != \"\");\n \n \n \n \n \n String acronymResult = acronymFeed.toString().toUpperCase();\n return acronymResult;\n */\n \n char[] letters = phrase.toCharArray();\n String firstLetters = \"\";\n firstLetters += String.valueOf(letters[0]);\n for (int i = 1; i < phrase.length();i++){\n if (letters[i-1] == ' '){\n firstLetters += String.valueOf(letters[i]);\n }\n }\n firstLetters = firstLetters.toUpperCase();\n return firstLetters;\n }", "public static void main(String[] args) {\n\t\tString str=\"Sneha is a good girl\";\n\t\tString finalStr=\"\";\n\t\tString str1=str;\n\t\tString str2=str.replace(\" \", \"\");\n\t\t\n\t\tSystem.out.println(\"Final string is \"+str2);\n\n\t}", "public static String reverseWordWise(String input) {\n String output = \"\";\n int index = 0;\n \n for (int i = 0; i < input.length(); i++) {\n if (input.charAt(i) == ' ') {\n index = i+1;\n output += input.charAt(i);\n } else {\n output = output.substring(0,index) + input.charAt(i) + output.substring(index);\n }\n }\n return output;\n\n\t}", "public void shingleStrippedString(String s) {\n\t\t\n\t\tString s_stripped = s.replaceAll(\"\\\\s\",\"\");\n//\t\tSystem.out.println(s_stripped);\n\t\tthis.shingleString(s_stripped);\n\t}", "private final static String stripQuote( String s ) {\n\n char[] ca = s.toCharArray();\n char[] ca2 = new char [ca.length];\n char letter;\n int i2 = 0;\n\n for ( int i=0; i<ca.length; i++ ) {\n letter = ca[i];\n if ( letter != '\"' ) {\n ca2[i2] = letter; // save good letter\n i2++;\n }\n }\n\n char[] ca3 = new char [i2];\n\n for ( int i=0; i<i2; i++ ) {\n letter = ca2[i]; // get from first array\n ca3[i] = letter; // move to correct size array\n }\n\n return new String (ca3);\n\n }", "private static String _stripWhitespace(String str)\n {\n if (str == null)\n return null;\n\n int length = str.length();\n int startIndex = 0;\n\n while (startIndex < length)\n {\n if (Character.isWhitespace(str.charAt(startIndex)))\n startIndex++;\n else\n break;\n }\n\n int endIndex = length;\n while (endIndex > 0)\n {\n if (Character.isWhitespace(str.charAt(endIndex - 1)))\n endIndex--;\n else\n break;\n }\n\n if ((startIndex == 0) && (endIndex == length))\n return str;\n\n return str.substring(startIndex, endIndex);\n }", "private static int lengthOfLastWord(String s) {\n int count = 0;\n char[] arr = s.trim().toCharArray();\n\n for (int i = arr.length - 1; i >= 0; i--) {\n if (arr[i] == ' ') { break; }\n count++;\n }\n return count;\n }", "public static String firstLowerCase(String value) {\n\t\tif (value == null || value.length() == 0) {\n\t return value;\n\t }\n\t\tchar[] c = value.toCharArray();\n\t\tc[0] += 32;\n\t\treturn new String(c);\n\t}", "public static String condense(String str){\n Matcher matcher = condensePattern.matcher(str);\n return matcher.replaceAll(\" \");\n }", "public static String replaceAllWhiteWithOne(String sInput) {\n\t\tString strTmp = sInput.trim();\n\t\tString strResult = \"\";\n\t\tfor (int i = 0; i < strTmp.length(); i++) {\n\t\t\tchar ch = strTmp.charAt(i);\n\t\t\tif (ch == ' ') {\n\t\t\t\tfor (int j = i; j < strTmp.length(); j++) {\n\t\t\t\t\tchar ch2 = strTmp.charAt(j);\n\t\t\t\t\tif (ch2 != ' ') {\n\t\t\t\t\t\ti = j;\n\t\t\t\t\t\tstrResult = strResult + ' ' + ch2;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tstrResult = strResult + ch;\n\t\t\t}\n\t\t}\n\t\treturn strResult;\n\t}", "public static String replaceAllWhiteWithOne(String sInput) {\n\t\tString strTmp = sInput.trim();\n\t\tString strResult = \"\";\n\t\tfor (int i = 0; i < strTmp.length(); i++) {\n\t\t\tchar ch = strTmp.charAt(i);\n\t\t\tif (ch == ' ') {\n\t\t\t\tfor (int j = i; j < strTmp.length(); j++) {\n\t\t\t\t\tchar ch2 = strTmp.charAt(j);\n\t\t\t\t\tif (ch2 != ' ') {\n\t\t\t\t\t\ti = j;\n\t\t\t\t\t\tstrResult = strResult + ' ' + ch2;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tstrResult = strResult + ch;\n\t\t\t}\n\t\t}\n\t\treturn strResult;\n\t}", "public String firstTwo(String str) {\r\n return str.length() < 2 ? str : str.substring(0, 2);\r\n }", "public String firstHalf(String str) {\n int length = str.length();\n \n boolean isEven = length % 2 == 0;\n \n int adj = (isEven) ? 0 : 1;\n \n int halfIndex = (int)(length / 2) + adj;\n \n return str.substring(0, halfIndex);\n }", "public static String[] splitIntoWords(String s) {\n String[] words = s.split(\" \");\n return words;\n }", "public String trim(String string)\n\t{\n\t\tString result = string;\n\t\t\n\t\tif (string.length() > 0)\n\t\t{\n\t\t\t// Find first non-white space character\n\t\t\tchar[] charArray = string.toCharArray();\n\t\t\t\n\t\t\tint charIndex = 0;\n\t\t\tchar currentChar = charArray[charIndex];\n\t\t\t\n\t\t\twhile ((charIndex < charArray.length) && (charArray[charIndex] > STYLE_RED) && (charArray[charIndex] <= ' '))\n\t\t\t{\n\t\t\t\tcharIndex++;\n\t\t\t}\n\t\t\t\n\t\t\tint startIndex = charIndex;\n\t\t\t\n\t\t\tif (startIndex < charArray.length)\n\t\t\t{\n\t\t\t\t// Find the last non-white space character\n\t\t\t\tcharIndex = charArray.length - 1;\n\t\t\t\t\n\t\t\t\twhile ((charIndex >= 0) && (charArray[charIndex] > STYLE_RED) && (charArray[charIndex] <= ' '))\n\t\t\t\t{\n\t\t\t\t\tcharIndex--;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tresult = string.substring(startIndex, charIndex + 1);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tresult = \"\";\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn result;\n\t}" ]
[ "0.70881677", "0.6151715", "0.6095337", "0.6086085", "0.6029805", "0.60193706", "0.5932983", "0.5926542", "0.59107417", "0.58838755", "0.5882156", "0.58720815", "0.58637035", "0.58517706", "0.5827723", "0.5818877", "0.5797424", "0.57929313", "0.57852286", "0.5781225", "0.5751559", "0.5703397", "0.5665908", "0.5661318", "0.56611687", "0.5642605", "0.56390345", "0.5636629", "0.56301445", "0.5628424", "0.5612392", "0.5591404", "0.55884445", "0.5583518", "0.55693346", "0.5566595", "0.55631167", "0.55332696", "0.5528518", "0.55135643", "0.55040246", "0.5501899", "0.5499206", "0.54714763", "0.54679227", "0.5453506", "0.5452222", "0.54394656", "0.54376066", "0.5434858", "0.54304457", "0.5425389", "0.54249245", "0.54217434", "0.5407833", "0.54076207", "0.53918535", "0.538353", "0.5381057", "0.53587407", "0.5344538", "0.53390676", "0.5334219", "0.5331519", "0.5330169", "0.5322186", "0.53210676", "0.5318153", "0.5311526", "0.530657", "0.5304922", "0.52971137", "0.52923524", "0.52918106", "0.52901495", "0.52745837", "0.5271062", "0.5268494", "0.52671844", "0.5265725", "0.5262236", "0.52514917", "0.52510476", "0.5248631", "0.524806", "0.52462846", "0.5244826", "0.5224146", "0.52071124", "0.5206215", "0.5199894", "0.5199877", "0.5198746", "0.5197718", "0.5196702", "0.5192568", "0.5192568", "0.5182579", "0.51800436", "0.51775736", "0.51702774" ]
0.0
-1
Returns everything after the first instance of a period.
public static String everythingAfterDot(String str) { int index = str.indexOf('.'); if (index > -1) { return str.substring(index + 1).trim(); } else { return str; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Period getNextPeriod() throws PeriodNotFoundException;", "public org.drip.analytics.cashflow.CompositePeriod firstPeriod()\n\t{\n\t\treturn periods().get (0);\n\t}", "public org.drip.analytics.cashflow.CompositePeriod lastPeriod()\n\t{\n\t\tjava.util.List<org.drip.analytics.cashflow.CompositePeriod> lsCouponPeriod = periods();\n\n\t\treturn lsCouponPeriod.get (lsCouponPeriod.size() - 1);\n\t}", "double getPeriod();", "int getPeriod();", "public int getPeriod()\r\n\t{\r\n\t\treturn period;\r\n\t}", "public int getPeriod() {\n return period;\n }", "public Period getPeriod() {\n return period;\n }", "public double getPeriod() {\n return period;\n }", "public String getPeriod() {\n return period;\n }", "public String getPeriod() {\n return this.period;\n }", "public static void testPeriod() {\n LocalDate date1 = LocalDate.now();\n System.out.println(\"Current date: \" + date1);\n\n //add 1 month to the current date\n LocalDate date2 = date1.plus(1, ChronoUnit.MONTHS);\n System.out.println(\"Next month: \" + date2);\n\n Period period = Period.between(date2, date1);\n System.out.println(\"Period: \" + period);\n }", "@Override // com.google.android.exoplayer2.source.AbstractConcatenatedTimeline\n public int getFirstPeriodIndexByChildIndex(int i) {\n if (i == 0) {\n return 0;\n }\n return this.sourcePeriodOffsets[i - 1];\n }", "public org.hl7.fhir.Period getPeriod()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.hl7.fhir.Period target = null;\n target = (org.hl7.fhir.Period)get_store().find_element_user(PERIOD$2, 0);\n if (target == null)\n {\n return null;\n }\n return target;\n }\n }", "org.hl7.fhir.Period getAppliesPeriod();", "public TimePeriod getPeriod();", "public void period() {\n\t\tPeriod annually = Period.ofYears(1);\n\t\tPeriod quarterly = Period.ofMonths(3);\n\t\tPeriod everyThreeWeeks = Period.ofWeeks(3);\n\t\tPeriod everyOtherDay = Period.ofDays(2);\n\t\tPeriod everyYearAndAWeek = Period.of(1, 0, 7);\n\t\tLocalDate date = LocalDate.of(2014, Month.JANUARY, 20);\n\t\tdate = date.plus(annually);\n\t\tSystem.out.println(date);\n\t\tSystem.out.println(Period.of(0, 20, 47)); // P20M47D\n\t\tSystem.out.println(Period.of(2, 20, 47)); // P2Y20M47D\n\t}", "public void setPeriod(String period) {\n this.period = period;\n }", "public void setPeriod(String period) {\n this.period = period;\n }", "public static String removePeriod(String s)\r\n/* 119: */ {\r\n/* 120:115 */ s = s.trim();\r\n/* 121:116 */ char last = s.charAt(s.length() - 1);\r\n/* 122:117 */ if (\".?!\".indexOf(last) >= 0) {\r\n/* 123:118 */ return s.substring(0, s.length() - 1).trim();\r\n/* 124: */ }\r\n/* 125:120 */ return s;\r\n/* 126: */ }", "private Periodo getPeriodoCorte() {\n String valor = parametrosDao.obtenerTodosParametros().get(\"integrador.periodo.arranque\");\r\n\r\n return Periodo.parse(valor, \"yyyyMM\");\r\n }", "protected int getNumberOfPeriods()\n {\n return 2;\n }", "public org.hl7.fhir.Period getWhenGiven()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.hl7.fhir.Period target = null;\n target = (org.hl7.fhir.Period)get_store().find_element_user(WHENGIVEN$8, 0);\n if (target == null)\n {\n return null;\n }\n return target;\n }\n }", "org.hl7.fhir.Period getValuePeriod();", "public Long getPeriod() {\n return this.Period;\n }", "@Test\n void deve_retornar_o_periodo_first_period_out() {\n List<LocalTime> localTimes = Arrays.asList(LocalTime.parse(\"10:30:00\"));\n TimeCourseEnum response = timeService.addPeriod(localTimes);\n Assert.assertEquals(TimeCourseEnum.FIRST_PERIOD_OUT, response);\n }", "public void unsetPeriod()\n {\n synchronized (monitor())\n {\n check_orphaned();\n get_store().remove_element(PERIOD$2, 0);\n }\n }", "@Test\n void deve_retornar_o_periodo_first_period_in() {\n List<LocalTime> localTimes = new ArrayList<>();\n TimeCourseEnum response = timeService.addPeriod(localTimes);\n Assert.assertEquals(TimeCourseEnum.FIRST_PERIOD_IN, response);\n }", "public interface Period {\n\n\tDate getStart();\n\n\tDate getEnd();\n}", "LastProcessingDate findFirstByDateIsNotNull();", "public void setBefore(Period before) {\n from = LocalDate.now(ZoneOffset.UTC).minus(before).atStartOfDay();\n }", "public void setPeriod(int period) {\n this.period = period;\n }", "public String LastTimePeriod() {\n String finalTime = \"24:00-24:00\"; // Generate the same format to re-use the function.\n return CreateBlankPeroid(finalTime);\n }", "public org.drip.analytics.cashflow.CompositePeriod period (\n\t\tfinal int iIndex)\n\t{\n\t\ttry {\n\t\t\treturn periods().get (iIndex);\n\t\t} catch (java.lang.Exception e) {\n\t\t}\n\n\t\treturn null;\n\t}", "public org.hl7.fhir.Period addNewPeriod()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.hl7.fhir.Period target = null;\n target = (org.hl7.fhir.Period)get_store().add_element_user(PERIOD$2);\n return target;\n }\n }", "public Period period() {\n return getObject(Period.class, FhirPropertyNames.PROPERTY_PERIOD);\n }", "public Period period() {\n return getObject(Period.class, FhirPropertyNames.PROPERTY_PERIOD);\n }", "public Period period() {\n return getObject(Period.class, FhirPropertyNames.PROPERTY_PERIOD);\n }", "public Period period() {\n return getObject(Period.class, FhirPropertyNames.PROPERTY_PERIOD);\n }", "public int getHowManyInPeriod();", "public Period onsetPeriod() {\n return getObject(Period.class, FhirPropertyNames.PROPERTY_ONSET_PERIOD);\n }", "public Period period() {\n return getObject(Period.class, FhirPropertyNames.PROPERTY_PERIOD);\n }", "public List<Period> getPeriods() throws PeriodNotFoundException;", "public TimePeriod notWorking(TimePeriod period);", "org.hl7.fhir.Period addNewValuePeriod();", "BigInteger getPeriod();", "@Override // com.google.android.exoplayer2.source.AbstractConcatenatedTimeline\n public int getChildIndexByPeriodIndex(int i) {\n return Util.binarySearchFloor(this.sourcePeriodOffsets, i, true, false) + 1;\n }", "public long period() throws TimeWindowException {\n return div();\n }", "public org.hl7.fhir.Period addNewWhenGiven()\n {\n synchronized (monitor())\n {\n check_orphaned();\n org.hl7.fhir.Period target = null;\n target = (org.hl7.fhir.Period)get_store().add_element_user(WHENGIVEN$8);\n return target;\n }\n }", "public org.drip.analytics.date.JulianDate firstCouponDate()\n\t{\n\t\ttry {\n\t\t\treturn new org.drip.analytics.date.JulianDate (_lsPeriod.get (0).endDate());\n\t\t} catch (java.lang.Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn null;\n\t}", "public void setPeriod(double value) {\n this.period = value;\n }", "public DR getBillingPeriod() { \r\n\t\tDR retVal = this.getTypedField(26, 0);\r\n\t\treturn retVal;\r\n }", "void getCurrentPeriodo();", "public void setPeriod(Long Period) {\n this.Period = Period;\n }", "long getSamplePeriod();", "public Period toPeriod(PeriodType type) {\r\n return new Period(getStartMillis(), getEndMillis(), type, getChronology());\r\n }", "Optional<ReportingPeriod> getCurrentReportingPeriod();", "org.apache.xmlbeans.XmlDateTime xgetSearchRecurrenceStart();", "public AdjustmentPeriodTypeId getPeriod() {\n return this.period;\n }", "public Period bornPeriod() {\n return getObject(Period.class, FhirPropertyNames.PROPERTY_BORN_PERIOD);\n }", "public IdDt getConditionFirstRep() {\n\t\tif (getCondition().isEmpty()) {\n\t\t\treturn addCondition();\n\t\t}\n\t\treturn getCondition().get(0); \n\t}", "public Optional<Instant> getAfter() {\n\t\t\treturn after;\n\t\t}", "public Optional<Instant> getAfter() {\n\t\treturn after;\n\t}", "public void setAfter(Period after) {\n to = LocalDate.now(ZoneOffset.UTC).plus(after).plusDays(1).atStartOfDay();\n }", "public Period getFixedLegPeriod() {\n return _fixedLegPeriod;\n }", "public static String addPeriod(Object o)\r\n/* 81: */ {\r\n/* 82: 78 */ String s = o.toString().trim();\r\n/* 83: 79 */ if (s.isEmpty()) {\r\n/* 84: 80 */ return \"\";\r\n/* 85: */ }\r\n/* 86: 82 */ char last = s.charAt(s.length() - 1);\r\n/* 87: 83 */ if (\">\".indexOf(last) >= 0) {\r\n/* 88: 84 */ return s;\r\n/* 89: */ }\r\n/* 90: 86 */ if (\":\".indexOf(last) >= 0) {\r\n/* 91: 87 */ return s.trim() + \" \";\r\n/* 92: */ }\r\n/* 93: 89 */ if (\".?!\".indexOf(last) >= 0) {\r\n/* 94: 90 */ return s + \" \";\r\n/* 95: */ }\r\n/* 96: 92 */ return s + \". \";\r\n/* 97: */ }", "@Updatable\n public Integer getPeriod() {\n return period;\n }", "@Override\n\tpublic long getTimePeriod() {\n\t\treturn 0;\n\t}", "public Period getFixedLegPeriod() {\n return _index.getFixedLegPaymentTenor().getPeriod();\n }", "public LocalDateTime CalcLastDay()\n {\n if (!Repeats) {\n // then use the end of the period\n return CalcFirstPeriodEndDay();\n }\n\n //else its forever or if its set\n return LastDay == null ? LocalDateTime.MAX : LastDay;\n }", "public O after(O a)\r\n {\r\n int index = indexOf(a);\r\n if (index != -1 && index != size()-1) //is defined and not last\r\n return get(index+1);\r\n else return null;\r\n }", "protected CaBillingPeriod getCaBillingPeriod(Integer periodId)\n {\n List<CaBillingPeriod> periodList=getCaBillingPeriodList(periodId);\n if(CommonUtil.isNotEmpty(periodList)){\n return periodList.get(0);\n }else{\n return null;\n }\n }", "public Series getSeriesFirstRep() {\n\t\tif (getSeries().isEmpty()) {\n\t\t\treturn addSeries();\n\t\t}\n\t\treturn getSeries().get(0); \n\t}", "E last() throws NoSuchElementException;", "void unsetAppliesPeriod();", "public OccurrenceInfo getLastOccurrence() throws ServiceLocalException {\n\t\treturn (OccurrenceInfo) this.getPropertyBag()\n\t\t\t\t.getObjectFromPropertyDefinition(\n\t\t\t\t\t\tAppointmentSchema.FirstOccurrence);\n\t}", "private Date determineBeginDate(Employee employee){\n\t\tList<PtoPeriod> ptoPeriods = ptoPeriodRepository.findPtoPeriodForEmployee(employee.getId());\n\t\tfor(PtoPeriod p : ptoPeriods){\n\t\t\tlog.info(\"Pto Period Found: End Date: \" + p.getEndDate());\n\t\t}\n\t\t\n\t\t//If more than one period found, select the second latest date as the start date\n\t\t//Otherwise return the employee hire date\n\t\t\n\t\treturn ZonedDateTimeToDateConverter.INSTANCE.convert(employee.getHireDate());\n\t}", "public Period toPeriod() {\r\n return new Period(getStartMillis(), getEndMillis(), getChronology());\r\n }", "List<Book> getBooksFromPeriod(LocalDate from,LocalDate to);", "Constant getCyclePeriodConstant();", "private static String getLastToken(String s)\r\n {\r\n int index = s.lastIndexOf('.');\r\n if (index == -1)\r\n {\r\n return null;\r\n }\r\n return s.substring(index+1);\r\n }", "public static LocalDate getFirstOfNextMonth() {\n\t\treturn LocalDate.now().with(TemporalAdjusters.firstDayOfNextMonth());\n\t}", "public SeriesInstance getInstanceFirstRep() {\n\t\tif (getInstance().isEmpty()) {\n\t\t\treturn addInstance();\n\t\t}\n\t\treturn getInstance().get(0); \n\t}", "@Override\n\tpublic java.lang.String getNoticePeriod() {\n\t\treturn _candidate.getNoticePeriod();\n\t}", "public double getPrecedingTime( final double time )\n\t{\n\t\tdouble precedingDate = Double.NaN;\n\t\tfinal Entry< Double, V > entry = getPrecedingEntry( time );\n\t\tif( entry != null )\n\t\t{\n\t\t\tprecedingDate = entry.getKey();\n\t\t}\n\t\treturn precedingDate;\n\t}", "@Test\n void calculatePeriodLessThanOneMonth() throws ParseException {\n LocalDate testDateStart = LocalDate.parse(\"2015-03-07\");\n LocalDate testDateEnd = LocalDate.parse(\"2015-04-01\");\n Map<String, String> periodMap = datesHelper.calculatePeriodRange(testDateStart, testDateEnd, false);\n assertEquals(\"1 month\", periodMap.get(PERIOD_START));\n assertEquals(\"1 April 2015\", periodMap.get(PERIOD_END));\n }", "org.apache.xmlbeans.XmlDouble xgetSignalPeriod();", "private int getNamespaceEnd() {\n int index = data.substring(tokenStart, tokenEnd).indexOf(\".\");\n return index != -1 ? index + tokenStart : tokenEnd;\n }", "public long getPeriodId() {\n return periodId;\n }", "public Optional<Instant> getBefore() {\n\t\treturn before;\n\t}", "public double period()\n\t{\n\t\tdouble n = meanMotion();\n\t\tdouble period = 2.0 * Constants.pi / n;\n\t\treturn period;\n\t}", "public static LocalDate getLastOfNextMonth() {\n\t\treturn BusinessDateUtility.getFirstOfNextMonth().with(TemporalAdjusters.lastDayOfMonth());\n\t}", "public static void main(String[] args) {\n System.out.println(\"************\");\n System.out.println(\"Example01\");\n System.out.println(\"************\");\n System.out.println();\n System.out.print(\"100 days ago: \");\n System.out.println(LocalDate.now().plusDays(-100));\n System.out.print(\"Today: \");\n System.out.println(LocalDate.now());\n System.out.print(\"100 days later: \");\n System.out.println(LocalDate.now().plusDays(100));\n System.out.println();\n System.out.println();\n System.out.println();\n System.out.println(\"************\");\n System.out.println(\"Example02\");\n System.out.println(\"************\");\n System.out.println();\n \n Period period = Period.between(LocalDate.now(), LocalDate.of(LocalDate.now().getYear(), 12, 25));\n System.out.print(period.getMonths());\n System.out.print(\" Months \");\n System.out.print(period.getDays());\n System.out.print(\" Days to Cristmas!\");\n }", "void unsetValuePeriod();", "private BillingPeriod getBillingPeriod() {\n\t\treturn (BillingPeriod) this.getBean();\n\t}", "public Optional<Instant> getBefore() {\n\t\t\treturn before;\n\t\t}", "public org.drip.analytics.cashflow.CompositePeriod containingPeriod (\n\t\tfinal int iDate)\n\t{\n\t\ttry {\n\t\t\tfor (org.drip.analytics.cashflow.CompositePeriod cp : _lsPeriod) {\n\t\t\t\tif (cp.contains (iDate)) return cp;\n\t\t\t}\n\t\t} catch (java.lang.Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\treturn null;\n\t}", "public void setPeriod(int period) {\r\n\t\tif (isValidPeriod(period)) {\r\n\t\t\tthis.period = period;\r\n\t\t}\r\n\t}", "public DR getPsl26_BillingPeriod() { \r\n\t\tDR retVal = this.getTypedField(26, 0);\r\n\t\treturn retVal;\r\n }", "@Override\n public int getRecurringPeriod() {\n if (recurringType.equals(RecurringType.NONE)) {\n return NO_RECURRING_PERIOD;\n }\n return recurringPeriod;\n }", "double getSignalPeriod();" ]
[ "0.6578036", "0.6543789", "0.59326994", "0.5924293", "0.5820947", "0.57277346", "0.56833744", "0.56588954", "0.5638413", "0.5606383", "0.558221", "0.5575395", "0.55479985", "0.55277663", "0.55214655", "0.54929084", "0.54613304", "0.54536986", "0.54536986", "0.5416479", "0.5402994", "0.54010874", "0.53788316", "0.5368056", "0.5325605", "0.53170377", "0.5300954", "0.5293468", "0.52807194", "0.52704644", "0.52396", "0.5237832", "0.52340895", "0.5199", "0.5167367", "0.51666605", "0.51666605", "0.51666605", "0.51666605", "0.5148191", "0.51406896", "0.5132301", "0.512979", "0.5076201", "0.50616884", "0.50522554", "0.50509346", "0.49680448", "0.4965169", "0.49301055", "0.4917048", "0.4884762", "0.48842606", "0.48708764", "0.48635077", "0.4833719", "0.48336205", "0.48047814", "0.4785822", "0.47825038", "0.47821704", "0.4781195", "0.477267", "0.47622877", "0.47451434", "0.47450435", "0.4744876", "0.47421578", "0.47419617", "0.47399956", "0.4733757", "0.472733", "0.4717995", "0.46794146", "0.4678551", "0.4671727", "0.46713683", "0.46677718", "0.46585843", "0.46469387", "0.46302038", "0.46287686", "0.46245712", "0.46155384", "0.46140218", "0.4607038", "0.45955408", "0.4581648", "0.45802096", "0.45720175", "0.45703027", "0.45649704", "0.45636874", "0.4552105", "0.45486122", "0.45452368", "0.45438486", "0.45434538", "0.45415613", "0.4529783", "0.45295554" ]
0.0
-1
Converts the input string from 24hour time to 12hour time representation.
private static String convertTime(String timeString) { try { int timeIn24hRepresentation = Integer.parseInt(timeString); int hours = timeIn24hRepresentation / 100; int minutes = timeIn24hRepresentation % 100; boolean isOutOfBounds = hours < 0 || hours > 24 || minutes < 0 || minutes > 60; boolean cannotConvertToTime = timeString.length() != 4; if (isOutOfBounds || cannotConvertToTime) { return timeString; } else { return convertTimeToStringRepresentation(hours, minutes); } } catch (NumberFormatException e) { return timeString; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "static String timeConversion(String s) {\n if(s.indexOf('P') >= 0 && s.substring(0, 2).equals(\"12\")){\n }\n else if(s.indexOf('P') >= 0){\n Integer n = Integer.parseInt(s.substring(0, 2));\n s = removeHour(s);\n n += 12;\n String hour = Integer.toString(n);\n s = hour + s;\n }\n else if (s.indexOf('A') >= 0 && s.substring(0, 2).equals(\"12\")){\n s = \"00\" + s.substring(2);\n }\n return removeHourFormat(s);\n }", "public static String convertTo24HoursFormat(String twelveHourTime)\n throws ParseException {\n return TWENTY_FOUR_TF.format(TWELVE_TF.parse(twelveHourTime));\n }", "public static String timeConversion(String s) {\n // Write your code here\n String end = s.substring(2, s.length() - 2);\n String ans = s.substring(0, s.length() - 2);\n if (s.charAt(8) == 'A') {\n return s.startsWith(\"12\") ? \"00\" + end : ans;\n }\n\n return s.startsWith(\"12\") ? ans : (Integer.parseInt(s.substring(0, 2)) + 12) + end;\n }", "public static String convertTo12HoursFormat(String twentyFourHourTime)\n throws ParseException {\n return TWELVE_TF.format(TWENTY_FOUR_TF.parse(twentyFourHourTime));\n }", "static String timeConversion(String s) {\n String[] sTime = s.split(\":\");\n\n int x = 0;\n\n // if PM and hours >12, add additional 12 to hours\n // for AM and hour = 12, set hour to 00\n if(sTime[sTime.length - 1].contains(\"PM\") && !sTime[0].equals(\"12\"))\n x = 12;\n\n String val1 = \"\";\n if(x == 12)\n val1 = (Integer.parseInt(sTime[0]) + x) + \"\";\n else {\n if(sTime[0].equals(\"12\") && sTime[sTime.length - 1].contains(\"AM\"))\n val1 = \"00\";\n else\n val1 = sTime[0];\n }\n\n // merge the string and return the result\n String result = val1 + \":\" + sTime[1] + \":\" + sTime[2].substring(0,2);\n return result;\n }", "static String timeConversion(String s) {\n\n\t\tStringBuilder sb = new StringBuilder();\n\t\tboolean isAm = s.contains(\"AM\");\n\t\t\n\t\ts = s.replace(\"AM\", \"\");\n\t\ts = s.replace(\"PM\", \"\");\n\t\t\n\t\tString str[] = s.split(\":\");\n\t\tint time = Integer.parseInt(str[0]);\n\t\t\n\t\t\n\t\tif(time < 12 && !isAm) {\n\t\t\ttime = time + 12;\n\t\t\tsb.append(time).append(\":\");\n\t\t}else if(time == 12 && isAm) {\n\t\t\tsb.append(\"00:\");\n\t\t}else {\n\t\t\tif (time < 10) sb.append(\"0\").append(time).append(\":\");\n\t\t\telse sb.append(time).append(\":\");\n\t\t}\n\n\t\tsb.append(str[1]).append(\":\").append(str[2]);\n\t\treturn sb.toString();\n\t}", "static String timeConversion(String s) {\n String[] timeSplit = s.split(\":\");\n String hours = timeSplit[0];\n String minutes = timeSplit[1];\n String seconds = timeSplit[2].substring(0, 2);\n String ampm = timeSplit[2].substring(2, 4);\n\n String newHours;\n if (ampm.equals(\"AM\")) {\n newHours = hours.equals(\"12\") ? \"00\" : hours;\n\n } else {\n newHours = hours.equals(\"12\") ? hours : String.valueOf(Integer.parseInt(hours) + 12);\n }\n\n return newHours + \":\" + minutes + \":\" + seconds;\n\n }", "static String timeConversion(String s) {\n /*\n * Write your code here.\n */\n String conversion = \"\";\n String time = s.substring(s.length()-2,s.length());\n String hour = s.substring(0,2);\n if(time.equals(\"AM\")){\n if(Integer.parseInt(hour)==12){\n conversion = \"00\"+s.substring(2,s.length()-2);\n }\n else{\n conversion = s.substring(0,s.length()-2);\n }\n }else{\n if(Integer.parseInt(hour)==12){\n conversion = \"12\"+s.substring(2,s.length()-2);\n }\n else{\n conversion = (Integer.parseInt(hour)+12) + s.substring(2,s.length()-2);\n }\n }\n\n return conversion;\n }", "static String timeConversion1(String s) {\n String[] timeSplit = s.split(\":\");\n String hours = timeSplit[0];\n String minutes = timeSplit[1];\n String seconds = timeSplit[2].substring(0, 2);\n String ampm = timeSplit[2].substring(2);\n\n int hour = Integer.parseInt(hours);\n\n int differential = 0;\n if (\"PM\".equals(ampm) && hour != 12) {\n differential = 12;\n }\n\n\n hour += differential;\n hour = hour % 24;\n\n hours = String.format(\"%02d\", hour);\n\n return hours + \":\" + minutes + \":\" + seconds;\n\n }", "private String covertTo12hrFormat(String hoursString, String minutesString, boolean showMeridiem) {\n\t\tint hours = Integer.parseInt(hoursString);\n\t\t//If hours valued > 12 will return hours differed by 12 and preceded by string PM\n\t\tif(hours>12)\n\t\t{\n\t\t\thours=hours-12;\n\t\t\t\n\t\t\treturn hours+ \":\" + minutesString +( showMeridiem ? \" \"+getAM_PM_Locale(\"PM\")+\"\" : \"\");\n\t\t\t//return ( hours<10 ? ( \"0\" + hours) : hours ) + \":\" + minutesString +( showMeridiem ? \" PM\" : \"\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t/*\n\t\t\t * If hours value = 0 will return hours as 12 and preceded by string PM\n\t\t\t * If hours value = 12 will return hours and preceded by string AM\n\t\t\t * If hours value < 12 will return hours and preceded by string AM\n\t\t\t */\n\t\t\tif(hours==0)\n\t\t\t\treturn \"12:\" + minutesString +( showMeridiem ? \" \"+getAM_PM_Locale(\"AM\")+\"\" : \"\");\n\t\t\telse if( hours == 12)\n\t\t\t\treturn hours + \":\" + minutesString +( showMeridiem ? \" \"+getAM_PM_Locale(\"PM\")+\"\" : \"\");\n\t\t\telse\n\t\t\t\treturn hours + \":\" + minutesString +( showMeridiem ? \" \"+getAM_PM_Locale(\"AM\")+\"\" : \"\");\n\t\t\t\t//return ( hours<10 ? ( \"0\" + hours) : hours ) + \":\" + minutesString +( showMeridiem ? \" AM\" : \"\");\n\t\t}\n\n\t}", "static String timeConversion(String s) {\n /*\n * Write your code here.\n */\n String res = \"\";\n String hrs = s.substring(0, 2);\n String min = s.substring(3, 5);\n String sec = s.substring(6, 8);\n String ampm = s.substring(8);\n int hr = Integer.parseInt(hrs);\n if((ampm.equalsIgnoreCase(\"PM\")) && (hr != 12)) {\n hr += 12;\n if(hr >= 24) {\n hr = 24 - hr;\n }\n }\n else if(ampm.equalsIgnoreCase(\"AM\")) {\n if(hr == 12) {\n hr = 0;\n }\n }\n if(hr < 10) {\n res = res + \"0\" + Integer.toString(hr);\n }\n else {\n res += Integer.toString(hr);\n }\n res = res +\":\" +min +\":\" + sec;\n return res;\n }", "private String convertToAMPM(Date time) {\r\n\r\n String modifier = \"\";\r\n String dateTime = Util.formateDate(time, \"yyyy-MM-dd HH:mm\");\r\n\r\n\r\n // Get the raw time\r\n String rawTime = dateTime.split(\" \")[1];\r\n // Get the hour as 24 time and minutes\r\n String hour24 = rawTime.split(\":\")[0];\r\n String minutes = rawTime.split(\":\")[1];\r\n // Convert the hour\r\n Integer hour = Integer.parseInt(hour24);\r\n\r\n if (hour != 12 && hour != 0) {\r\n modifier = hour < 12 ? \"am\" : \"pm\";\r\n hour %= 12;\r\n } else {\r\n modifier = (hour == 12 ? \"pm\" : \"am\");\r\n hour = 12;\r\n }\r\n // Concat and return\r\n return hour.toString() + \":\" + minutes + \" \" + modifier;\r\n }", "public static Date convert_string_time_into_original_time(String hhmmaa) {\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"HH:mm aa\");\n Date convertedDate = new Date();\n try {\n convertedDate = dateFormat.parse(hhmmaa);\n } catch (ParseException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n return convertedDate;\n }", "public static boolean isTime24HourFormat( Activity act ) {\r\n\t\tContentResolver cr = act.getContentResolver();\r\n\t\tString v = Settings.System.getString( cr, android.provider.Settings.System.TIME_12_24 );\r\n\t\tif ( v == null || v.isEmpty() || v.equals( \"12\" ) ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public static void main(String[] args) {\n\t\tString s = \"12:45:54PM\";\r\n\t\tString temp=\":\";\r\n\t\tString Result=\"\";\r\n\t\t\r\n\t\tif(s.charAt(8)=='P' || s.charAt(8)=='p')\r\n\t\t {\r\n\t\t\tString s1[] = s.split(\":\");\r\n\t int Hour = Integer.parseInt(s1[0]);\r\n\t String Actual_Hour = \"\";\r\n\t if(Hour == 12)\r\n\t {\r\n\t \tActual_Hour = \"12\";\r\n\t }\r\n\t else\r\n\t {\r\n\t \tint data = 12 + Hour;\r\n\t \tActual_Hour = String.valueOf(data);\r\n\t }\r\n\t \r\n\t \r\n\t Result = Actual_Hour +temp+s1[1]+temp+s1[2].substring(0, 2);\r\n\t\t }\r\n\t\t else\r\n\t\t {\r\n\t\t \tString s1[] = s.split(\":\");\r\n\t\t \tint Hour = Integer.parseInt(s1[0]);\r\n\t\t String Actual_Hour = \"\";\r\n\t\t if(Hour == 12)\r\n\t\t {\r\n\t\t \tActual_Hour = \"00\";\r\n\t\t \tResult = Actual_Hour +temp+s1[1]+temp+s1[2].substring(0, 2); \r\n\t\t }\r\n\t\t else {\r\n\t\t \tString s2[] = s.split(\"AM\");\r\n\t\t\t for(int i=0; i<s2.length; i++)\r\n\t\t\t {\r\n\t\t\t \tResult = s2[i];\r\n\t\t\t }\t\r\n\t\t }\r\n\t\t \t\r\n\t\t }\r\n\t\t\r\n\t\t\t\tSystem.out.println(Result);\r\n}", "static String timeConversion(String s) throws ParseException {\n SimpleDateFormat to = new SimpleDateFormat(\"HH:mm:ss\");\n SimpleDateFormat from = new SimpleDateFormat(\"hh:mm:ssa\");\n Date parse = from.parse(s);\n return to.format(parse);\n\n }", "public static Time fromString(String str) {\n checkFormat(str);\n int h = Integer.parseInt(str.substring(0, 2));\n int m = Integer.parseInt(str.substring(3, 5));\n String mStr = str.substring(6);\n boolean b = mStr.equals(\"PM\");\n\n return new Time(h, m, b);\n }", "public static String getHHMM(String time)\r\n\t{\r\n\t\tString finalTime = \"00/00 AM/PM\";\r\n\t\tString hh = time.substring(0, 2);\r\n\t\tString mm = time.substring(3, 5);\r\n\r\n\t\tint newHH = Integer.parseInt(hh);\r\n\t\tint newMM = Integer.parseInt(mm);\r\n\r\n\t\tnewMM = newMM % 60;\r\n\r\n\t\tif (newHH == 0)\r\n\t\t{\r\n\t\t\tfinalTime = \"12:\" + newMM + \" PM\";\r\n\t\t} else\r\n\t\t{\r\n\r\n\t\t\tif (newHH > 12)\r\n\t\t\t{\r\n\t\t\t\tnewHH = newHH % 12;\r\n\t\t\t\tfinalTime = newHH + \":\" + newMM + \" PM\";\r\n\t\t\t} else\r\n\t\t\t\tfinalTime = newHH + \":\" + newMM + \" AM\";\r\n\t\t}\r\n\r\n\t\tString HH = finalTime.substring(0, finalTime.indexOf(\":\"));\r\n\t\tString MM = finalTime.substring(finalTime.indexOf(\":\") + 1, finalTime\r\n\t\t\t\t.indexOf(\" \"));\r\n\t\tString AMPM = finalTime.substring(finalTime.indexOf(\" \"), finalTime\r\n\t\t\t\t.length());\r\n\r\n\t\tif (MM.length() == 1)\r\n\t\t\tMM = \"0\" + MM;\r\n\r\n\t\tfinalTime = HH + \":\" + MM /*+ \" \" */+ AMPM;\r\n\r\n\t\treturn (finalTime);\r\n\t}", "public static void set24HourTimeFormat(boolean use24HourTimeFormat) {\n Settings.System.putInt(Robolectric.application.getContentResolver(), Settings.System.TIME_12_24, use24HourTimeFormat ? 24 : 12);\n }", "private int parseTime(String timeString){\n\n if(timeString != null) {\n String[] parseTime = timeString.split(\":|\\\\s\");\n String intTime = parseTime[0] + parseTime[1];\n int time = Integer.parseInt((intTime));\n if (time != 1200 && parseTime[2].equals(\"PM\")) {\n time += 1200;\n } else if (time == 1200 && parseTime[2].equals(\"AM\")) {\n time = 0;\n }\n return time;\n\n } else {\n return 0;\n }\n }", "private static int stringToHour(String stringDay) {\r\n\t\tswitch (stringDay) {\r\n\t\tcase \"6am\":\r\n\t\t\treturn 0;\r\n\t\tcase \"7am\":\r\n\t\t\treturn 1;\r\n\t\tcase \"8am\":\r\n\t\t\treturn 2;\r\n\t\tcase \"9am\":\r\n\t\t\treturn 3;\r\n\t\tcase \"10am\":\r\n\t\t\treturn 4;\r\n\t\tcase \"11am\":\r\n\t\t\treturn 5;\r\n\t\tcase \"12pm\":\r\n\t\t\treturn 6;\r\n\t\tcase \"1pm\":\r\n\t\t\treturn 7;\r\n\t\tcase \"2pm\":\r\n\t\t\treturn 8;\r\n\t\tcase \"3pm\":\r\n\t\t\treturn 9;\r\n\t\tcase \"4pm\":\r\n\t\t\treturn 10;\r\n\t\tcase \"5pm\":\r\n\t\t\treturn 11;\r\n\t\tcase \"6pm\":\r\n\t\t\treturn 12;\r\n\t\tcase \"7pm\":\r\n\t\t\treturn 13;\r\n\t\tcase \"8pm\":\r\n\t\t\treturn 14;\r\n\t\tdefault:\r\n\t\t\treturn -1;\r\n\t\t}// end switch\r\n\t}", "public static String parseTime(String sTime) {\n\t\treturn sTime.substring(4, 6);\n\t}", "public static void set24Hour( boolean hour24 ) {\n AM_PM = !hour24;\n }", "private String doValidTimeCheck(String pDateTime) {\n String aDateTime = pDateTime;\n\n if (pDateTime.length() > 0) {\n String aTime = pDateTime.substring(8);\n if (aTime.matches(\"240000\")) {\n aDateTime = pDateTime.substring(0,8) + \"235900\";\n }\n }\n return aDateTime;\n }", "public void convertEndCivilianTimeToMilitaryTime(String endHour, String endMinute, String endAmOrPm) {\n String timeFormat = endHour + \" \" + endMinute + \" \" + endAmOrPm;\n DateFormat df = new SimpleDateFormat(\"hh mm aa\");\n String[] newTime = new String[3];\n newTime[0] = \"0\";\n newTime[1] = \"0\";\n\n Date date = null;\n try {\n date = df.parse(timeFormat);\n } catch (Exception e) {\n //pass\n\n }\n\n try {\n String time[] = date.toString().split(\" \");\n newTime = time[3].split(\":\");\n } catch (Exception e) {\n //pass\n }\n endMilitaryHour = Integer.parseInt(newTime[0]);\n endMilitaryMinute = Integer.parseInt(newTime[1]);\n this.endAmOrPm = endAmOrPm;\n\n }", "protected static String expandTimeString(String time) {\n StringBuilder expandedTime = new StringBuilder(13);\n\n expandedTime.append(\"000000\");\n\n switch (time.length()) {\n case 4:\n expandedTime.insert(0, '2').append(time).append(\"00\");\n break;\n case 5:\n expandedTime.insert(0, time.substring(0, 1)).append(time.substring(1)).append(\"00\");\n break;\n case 6:\n expandedTime.insert(0, '2').append(time);\n break;\n case 7:\n expandedTime.insert(0, time.substring(0, 1)).append(time.substring(1));\n break;\n default:\n throw new IllegalArgumentException(\"Given VDEW encoded Time-String must have between 4 to 7 characters, but we got \" + time.length() + \" characters being '\" + time + \"'\");\n }\n\n return expandDateTimeString(expandedTime.toString());\n }", "public static void main(String[] args) {\n\t\tScanner scn = new Scanner(System.in);\n\t\t// input in form of hh:mm:ss(AM/PM)\n\t\t// don't use any bracket in input\n\t\tString s = scn.nextLine();\n\t\tint hour = s.charAt(0) - '0';\n\t\thour = hour * 10 + s.charAt(1) - '0';\n\t\t// System.out.println(hour);\n\t\tString rv = new String();\n\t\tif (s.charAt(s.length() - 2) == 'A') {\n\t\t\tif (hour == 12) {\n\t\t\t\trv = s.substring(0, s.length() - 2);\n\t\t\t\trv = rv.substring(2, rv.length());\n\t\t\t\tint newh = 0;\n\t\t\t\trv = newh + rv;\n\t\t\t\trv = 0 + rv;\n\n\t\t\t} else {\n\t\t\t\trv = s.substring(0, s.length() - 2);\n\t\t\t}\n\n\t\t} else {\n\t\t\tif (hour == 12) {\n\t\t\t\trv = s.substring(0, s.length() - 2);\n\t\t\t} else {\n\t\t\t\trv = s.substring(0, s.length() - 2);\n\t\t\t\trv = rv.substring(2, rv.length());\n\t\t\t\tint newhour = hour + 12;\n\t\t\t\trv = newhour + rv;\n\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(rv);\n\n\t}", "private static String formatTime(String time) {\n\t\treturn String.format(\"%s:%s\", time.substring(0, 2), time.substring(2));\n\t}", "@Override\n\tpublic String convertTime(String aTime) {\n\n\t\tif (aTime == null)\n\t\t\tthrow new IllegalArgumentException(NO_TIME);\n\n\t\tString[] times = aTime.split(\":\", 3);\n\n\t\tif (times.length != 3)\n\t\t\tthrow new IllegalArgumentException(INVALID_TIME);\n\n\t\tint hours, minutes, seconds = 0;\n\n\t\ttry {\n\t\t\thours = Integer.parseInt(times[0]);\n\t\t\tminutes = Integer.parseInt(times[1]);\n\t\t\tseconds = Integer.parseInt(times[2]);\n\t\t} catch (NumberFormatException e) {\n\t\t\tthrow new IllegalArgumentException(NUMERIC_TIME);\n\t\t}\n\n\t\tif (hours < 0 || hours > 24)\n\t\t\tthrow new IllegalArgumentException(\"Invalid value of Hour\");\n\t\tif (minutes < 0 || minutes > 59)\n\t\t\tthrow new IllegalArgumentException(\"Invalid value of Minutes\");\n\t\tif (seconds < 0 || seconds > 59)\n\t\t\tthrow new IllegalArgumentException(\"Invalid value of Seconds\");\n\n\t\tString line1 = (seconds % 2 == 0) ? \"Y\" : \"O\";\n\t\tString line2 = rowString(hours / 5, 4, \"R\").replace('0', 'O');\n\t\tString line3 = rowString(hours % 5, 4, \"R\").replace('0', 'O');\n\t\tString line4 = rowString(minutes / 5, 11, \"Y\").replaceAll(\"YYY\", \"YYR\").replace('0', 'O');\n\t\tString line5 = rowString(minutes % 5, 4, \"Y\").replace('0', 'O');\n\n\t\tString cTime = String.join(NEW_LINE, Arrays.asList(line1, line2, line3, line4, line5));\n\n\t\tSystem.out.println(cTime);\n\n\t\treturn cTime;\n\t}", "public static Time fromString( String timeStr ) {\n int hour, minute;\n\n String[] parts = timeStr.split( \":\" );\n if ( parts.length != 2 ) throw new NumberFormatException( timeStr );\n hour = Integer.parseInt( parts[ 0 ] );\n\n String[] subParts = parts[ 1 ].split( \" \" );\n if ( subParts.length > 2 ) throw new NumberFormatException( timeStr );\n minute = Integer.parseInt( subParts[ 0 ] );\n\n if ( subParts.length == 2 ) { // Meridiem indicator is present.\n switch ( subParts[ 1 ] ) {\n case \"AM\":\n case \"am\":\n if ( hour == Time.HALF_DAY_HRS ) {\n hour = 0;\n }\n break;\n case \"PM\":\n case \"pm\":\n if ( hour != Time.HALF_DAY_HRS ) {\n hour += Time.HALF_DAY_HRS;\n }\n break;\n default:\n throw new NumberFormatException( timeStr );\n }\n }\n if (\n hour < 0 || hour >= Time.HRS_PER_DAY ||\n minute < 0 || minute >= Time.MINS_PER_HR\n ) {\n throw new NumberFormatException( \"Bad time \" + hour + ':' + minute );\n }\n return new Time( hour, minute );\n }", "public static String longToHHMM(long longTime)\r\n/* 150: */ {\r\n/* 151:219 */ SimpleDateFormat formatter = new SimpleDateFormat(\"HH:mm\");\r\n/* 152:220 */ Date strtodate = new Date(longTime);\r\n/* 153:221 */ return formatter.format(strtodate);\r\n/* 154: */ }", "private String prettyTime() {\n String[] dt = time.split(\"T\");\n String[] ymd = dt[0].split(\"-\");\n String[] hms = dt[1].split(\":\");\n\n int hour = Integer.parseInt(hms[0]);\n\n String date = getMonth(Integer.parseInt(ymd[1])) + \" \" + ymd[2] + \", \" + ymd[0];\n String time = (hour > 12 ? hour - 12 : hour) + \":\" + hms[1] + \":\" + hms[2].substring(0, hms[2].indexOf(\".\"));\n return date + \" at \" + time;\n }", "public static String convert_minutes_to_hours(String minutess) {\n int hours = Integer.parseInt(minutess) / 60; //since both are ints, you get an int\n int minutes = Integer.parseInt(minutess) % 60;\n System.out.printf(\"%d:%02d\", hours, minutes);\n return hours + \":\" + minutes;\n }", "public static String m128354a(String str) {\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"yyyy-MM-dd-HHmmssSSS\", Locale.US);\n Calendar instance = Calendar.getInstance(TimeZone.getTimeZone(\"GMT+8\"));\n C7573i.m23582a((Object) instance, \"calendar\");\n Date time = instance.getTime();\n StringBuilder sb = new StringBuilder();\n sb.append(simpleDateFormat.format(time));\n sb.append(str);\n return sb.toString();\n }", "public final void mRULE_TWELVEHRSTIME() throws RecognitionException {\n try {\n int _type = RULE_TWELVEHRSTIME;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // InternalDSL.g:16739:20: ( '0' .. '1' '0' .. '9' ':' '0' .. '5' '0' .. '9' ( ':' '0' .. '6' '0' .. '9' ( '.' '0' .. '9' '0' .. '9' '0' .. '9' )? )? ( 'am' | 'pm' ) )\n // InternalDSL.g:16739:22: '0' .. '1' '0' .. '9' ':' '0' .. '5' '0' .. '9' ( ':' '0' .. '6' '0' .. '9' ( '.' '0' .. '9' '0' .. '9' '0' .. '9' )? )? ( 'am' | 'pm' )\n {\n matchRange('0','1'); \n matchRange('0','9'); \n match(':'); \n matchRange('0','5'); \n matchRange('0','9'); \n // InternalDSL.g:16739:62: ( ':' '0' .. '6' '0' .. '9' ( '.' '0' .. '9' '0' .. '9' '0' .. '9' )? )?\n int alt30=2;\n int LA30_0 = input.LA(1);\n\n if ( (LA30_0==':') ) {\n alt30=1;\n }\n switch (alt30) {\n case 1 :\n // InternalDSL.g:16739:63: ':' '0' .. '6' '0' .. '9' ( '.' '0' .. '9' '0' .. '9' '0' .. '9' )?\n {\n match(':'); \n matchRange('0','6'); \n matchRange('0','9'); \n // InternalDSL.g:16739:85: ( '.' '0' .. '9' '0' .. '9' '0' .. '9' )?\n int alt29=2;\n int LA29_0 = input.LA(1);\n\n if ( (LA29_0=='.') ) {\n alt29=1;\n }\n switch (alt29) {\n case 1 :\n // InternalDSL.g:16739:86: '.' '0' .. '9' '0' .. '9' '0' .. '9'\n {\n match('.'); \n matchRange('0','9'); \n matchRange('0','9'); \n matchRange('0','9'); \n\n }\n break;\n\n }\n\n\n }\n break;\n\n }\n\n // InternalDSL.g:16739:121: ( 'am' | 'pm' )\n int alt31=2;\n int LA31_0 = input.LA(1);\n\n if ( (LA31_0=='a') ) {\n alt31=1;\n }\n else if ( (LA31_0=='p') ) {\n alt31=2;\n }\n else {\n NoViableAltException nvae =\n new NoViableAltException(\"\", 31, 0, input);\n\n throw nvae;\n }\n switch (alt31) {\n case 1 :\n // InternalDSL.g:16739:122: 'am'\n {\n match(\"am\"); \n\n\n }\n break;\n case 2 :\n // InternalDSL.g:16739:127: 'pm'\n {\n match(\"pm\"); \n\n\n }\n break;\n\n }\n\n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "public static Date strToTime(String strDate)\r\n/* 135: */ {\r\n/* 136:192 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMdd HH:mm:ss\");\r\n/* 137:193 */ ParsePosition pos = new ParsePosition(0);\r\n/* 138:194 */ Date strtodate = formatter.parse(strDate, pos);\r\n/* 139:195 */ return strtodate;\r\n/* 140: */ }", "public String timeFormatter(String time) throws ParseException {\n\t\tfinal String oldFormat = \"HH mm\";\n\t\tfinal String newFormat = \"HH:mm:ss\";\n\t\tString newTimeString;\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(oldFormat);\n\t\tDate d = sdf.parse(time);\n\t\tsdf.applyPattern(newFormat);\n\t\tnewTimeString = sdf.format(d);\n\t\treturn newTimeString;\t\n\t}", "public static String formatTime(String userTime, String date) {\r\n\r\n\t\t\tint n = Integer.parseInt(userTime.substring(0, 2)) + 5;\r\n\r\n\t\t\tswitch (n) {\r\n\r\n\t\t\tcase 24:\r\n\t\t\t\tn = 0;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 25:\r\n\t\t\t\tn = 1;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 26:\r\n\t\t\t\tn = 2;\r\n\t\t\t\tbreak;\r\n\r\n\t\t\tcase 27:\r\n\t\t\t\tn = 3;\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t}\r\n\r\n\t\t\t// extracting hour\r\n\t\t\tString hourChange = String.valueOf(n);\r\n\r\n\t\t\tStringBuilder time = new StringBuilder(userTime);\r\n\r\n\t\t\tif (hourChange.length() == 1) {\r\n\r\n\t\t\t\ttime.replace(0, 2, \"0\" + hourChange);\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\ttime.replace(0, 2, hourChange);\r\n\r\n\t\t\t}\r\n\r\n\t\t\tString formattedString = date + \" \" + time + \":00\";\r\n\r\n\t\t\treturn formattedString;\r\n\r\n\t\t}", "public String parseTime(String time) {\n Date date = null;\n try {\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\", Locale.getDefault());\n String todaysDate = new SimpleDateFormat(\"yyyy-MM-dd\", Locale.getDefault()).format(new Date());\n date = simpleDateFormat.parse(todaysDate + \" \" + time.split(\" \")[0]);\n\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\", Locale.getDefault());\n sdf.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n return sdf.format(date);\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n return null;\n }", "public static String toHH_MM(String draftDate) {\r\n\t\tif (draftDate == null || draftDate.length() < 19) {\r\n\t\t\treturn draftDate;\r\n\t\t}\r\n\t\treturn draftDate.substring(11, 16);\r\n\t}", "public String getTime() {\n boolean pastNoon = hour >= 12;\n if(pastNoon && hour == 12) {\n return hour + \"pm\";\n }\n else if(pastNoon) {\n return (hour - 12) + \"pm\";\n }\n else if(hour == 0) {\n return \"12am\";\n }\n else {\n return hour + \"am\";\n }\n }", "public static SimpleDateFormat getHourFormat() {\n return new SimpleDateFormat(\"HH:mm\");\n }", "public static int secondsAfterMidnight(String t) {\n int seconds; //initializing seconds, will be returned to main.\n t.toLowerCase(); //setting all input to lowercase so it is easier to handle.\n if (t.length() == 10){ //if input is 10 characters\n // if statement below checks whether each character is appropriate before continuing.\n if((t.startsWith(\"0\") || t.startsWith(\"1\"))&& Character.isDigit(t.charAt(1))&& \n t.charAt(2) == ':' && Character.isDigit(t.charAt(3))&& Character.isDigit(t.charAt(4))&&\n t.charAt(5) == ':' && Character.isDigit(t.charAt(6))&& Character.isDigit(t.charAt(7))&&\n (t.endsWith(\"am\") || t.endsWith(\"pm\"))){\n // Characters converted to numeric values and hours, minutes, and seconds are\n // calculated below.\n int hours = Character.getNumericValue(t.charAt(0))*10 \n + Character.getNumericValue(t.charAt(1));\n //if hours is equal to 12 such as 12:35, switched to 0:35, for easier calc.\n if(hours == 12){ \n hours = 0;\n }\n int minutes = Character.getNumericValue(t.charAt(3))*10 \n + Character.getNumericValue(t.charAt(4));\n seconds = Character.getNumericValue(t.charAt(6))*10 \n + Character.getNumericValue(t.charAt(7)); \n if(minutes < 60 && seconds < 60){//checks whether minute and second input is below 60.\n if(t.endsWith(\"pm\")){ //adding 43200 (12 hours in seconds) if time is pm.\n seconds = hours*3600 + minutes*60 + seconds + 43200;\n }else{\n seconds = hours*3600 + minutes*60 + seconds; \n }\n }else{\n seconds = -1; //if proper input is not given, seconds set to -1.\n }\n } else {\n seconds = -1; //improper input leads to seconds set to -1.\n }\n //below is for input that has 9 characters, such as 9:12:23am, instead of 09:12:23am. The code below\n // is very similar to to code for 10 characters above. \n }else if (t.length() == 9){\n if(Character.isDigit(t.charAt(0))&& t.charAt(1) == ':' && Character.isDigit(t.charAt(2))\n && Character.isDigit(t.charAt(3))&& t.charAt(4) == ':' && Character.isDigit(t.charAt(5))\n && Character.isDigit(t.charAt(6))&&(t.endsWith(\"am\") || t.endsWith(\"pm\"))){\n int hours = Character.getNumericValue(t.charAt(0));\n int minutes = Character.getNumericValue(t.charAt(2))*10 \n + Character.getNumericValue(t.charAt(3));\n seconds = Character.getNumericValue(t.charAt(5))*10 \n + Character.getNumericValue(t.charAt(6)); \n if(minutes < 60 && seconds < 60){\n if(t.endsWith(\"pm\")){\n seconds = hours*3600 + minutes*60 + seconds + 43200;\n }else{\n seconds = hours*3600 + minutes*60 + seconds; \n }\n }else{\n seconds = -1;\n }\n } else {\n seconds = -1;\n }\n }else{ // if input has neither 10 or 9 characters, input not proper.\n seconds = -1;\n }\n return seconds; //seconds is returned to main.\n}", "private static void checkFormat(String str) {\n if (str.length() != 8)\n throw new IllegalArgumentException(\"length has too be 8\");\n try {\n Integer.parseInt(str.substring(0,2)); //Hours\n Integer.parseInt(str.substring(3,5)); //Minutes\n } catch (NumberFormatException e) {\n throw new IllegalArgumentException(\"These numbers are wrong\");\n }\n if (str.charAt(2) != ':') {\n throw new IllegalArgumentException(\"requires colon between times\");\n }\n if (str.charAt(5) != ' ') {\n throw new IllegalArgumentException(\"requires space between time and period\");\n }\n String mStr = str.substring(6);\n if (!mStr.equals(\"PM\") && !mStr.equals(\"AM\")) {\n throw new IllegalArgumentException(\"Must be AM or PM\");\n }\n }", "private String extractHourMinute(String dateTime)\n {\n String[] aux = dateTime.split(\"T\");\n String[] auxTime = aux[1].split(\":\");\n\n return auxTime[0] + \":\" + auxTime[1];\n }", "public static String toHHmm(LocalTime localTime) {\n if (null != localTime) {\n return localTime.format(DateTimeFormatter.ofPattern(Constant.HH_MM));\n }\n return \"\";\n }", "private void normalGmtStringToMinutes() {\n int i = Integer.parseInt(gmtString.substring(4, 6));\n offsetMinutes = i * 60;\n i = Integer.parseInt(gmtString.substring(7));\n offsetMinutes += i;\n if (gmtString.charAt(3) == MINUS) {\n offsetMinutes *= -1;\n }\n }", "private static void m1() {\n\n String d = \"2019/03/22 10:00-11:00\";\n DateFormat df = new SimpleDateFormat(\"yyyy/MM/dd HH:mm-HH:mm\");\n try {\n Date parse = df.parse(d);\n System.out.println(df.format(parse));\n } catch (ParseException e) {\n e.printStackTrace();\n }\n }", "public static double parse_time(String s) {\n double tm = -1;\n String patternStr = \"[:]\";\n String [] fields2 = s.split(patternStr);\n if (fields2.length >= 3) {\n tm = parse_double(fields2[2]) + 60 * parse_double(fields2[1]) + 3600 * parse_double(fields2[0]); // hrs:min:sec\n } else if (fields2.length == 2) {\n tm = parse_double(fields2[1]) + 60 * parse_double(fields2[0]); // min:sec\n } else if (fields2.length == 1){\n tm = parse_double(fields2[0]); //getColumn(_sec, head[TM_CLK]);\n }\n return tm;\n }", "@Test public void toOffsetTime_24() {\n OffsetTime expected = OffsetTime.of(0, 0, 0, 0, ZoneOffset.ofHoursMinutes(0, 0));\n Datetime dt = new Datetime(24, expected.getMinute(), expected.getSecond(), 0);\n dt.setNanosecond(expected.getNano());\n dt.setTimezoneOffsetMinutes(0);\n\n OffsetTime actual = DateUtils.toOffsetTime(dt);\n\n assertEquals(actual, expected);\n }", "public static String getHHMM()\r\n/* 74: */ {\r\n/* 75: 94 */ String nowTime = \"\";\r\n/* 76: 95 */ Date now = new Date();\r\n/* 77: 96 */ SimpleDateFormat formatter = new SimpleDateFormat(\"HH:mm\");\r\n/* 78: 97 */ nowTime = formatter.format(now);\r\n/* 79: 98 */ return nowTime;\r\n/* 80: */ }", "public void twelveHour() {\n\n //Date format 12 hour\n DateFormat twelveHour = new SimpleDateFormat(\"hh:mm aa\", Locale.ENGLISH);\n\n setTimeZone();\n\n Calendar s = Calendar.getInstance(sydney);\n twelveHour.setTimeZone(sydney);\n\n String timeS = twelveHour.format(s.getTime());\n sydneyTime = findViewById(R.id.sydneytime);\n sydneyTime.setText(timeS);\n\n Calendar t = Calendar.getInstance(tokyo);\n twelveHour.setTimeZone(tokyo);\n\n String timeT = twelveHour.format(t.getTime());\n tokyoTime = findViewById(R.id.tokyotime);\n tokyoTime.setText(timeT);\n\n Calendar a = Calendar.getInstance(auckland);\n twelveHour.setTimeZone(auckland);\n\n String timeA = twelveHour.format(a.getTime());\n aucklandTime = findViewById(R.id.aucklandtime);\n aucklandTime.setText(timeA);\n\n Calendar d = Calendar.getInstance(dubai);\n twelveHour.setTimeZone(dubai);\n\n String timeD = twelveHour.format(d.getTime());\n dubaiTime = findViewById(R.id.dubaitime);\n dubaiTime.setText(timeD);\n\n Calendar n = Calendar.getInstance(newyork);\n twelveHour.setTimeZone(newyork);\n\n String timeN = twelveHour.format(n.getTime());\n newyorkTime = findViewById(R.id.newyorktime);\n newyorkTime.setText(timeN);\n }", "public String FormatTime(int hour, int minute) {\n\n String time;\n time = \"\";\n String formattedMinute;\n\n if (minute / 10 == 0) {\n formattedMinute = \"0\" + minute;\n } else {\n formattedMinute = \"\" + minute;\n }\n\n\n if (hour == 0) {\n time = \"12\" + \":\" + formattedMinute + \" AM\";\n } else if (hour < 12) {\n time = hour + \":\" + formattedMinute + \" AM\";\n } else if (hour == 12) {\n time = \"12\" + \":\" + formattedMinute + \" PM\";\n } else {\n int temp = hour - 12;\n time = temp + \":\" + formattedMinute + \" PM\";\n }\n\n\n return time;\n }", "private int[] parseHours(String str) {\n try {\n return enumerate(str, 0, 23);\n } catch (IllegalArgumentException e) {\n throw new IllegalArgumentException(\"Error parsing hours: \" + e.getMessage());\n }\n }", "public int parseTimeForHour(String time)\n\t{\n\t\ttry {\n\t\t\tDate date = new SimpleDateFormat(\"hh:mma\", Locale.ENGLISH).parse(time);\n\t\t\t\n\t\t\t@SuppressWarnings(\"deprecation\")\n\t\t\tint hour = date.getHours();\n\t\t\treturn hour;\n\t\t} catch (ParseException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn -1;\n\t}", "public static String fromDate(String s){\n \t\t\n \t\tString[] date = s.split(\"T\");\n \t\tString time = date[1].substring(0,5);\n \t\tString[] dates = date[0].split(\"-\"); \n \t\tString month = dates[1];\n \t\tString day = dates[2];\n \t\t\n \t\treturn day + \"/\" + month + \", kl: \" + time;\n \t}", "private AbsTime(String t) throws NumberFormatException, Time.Ex_TimeNotAvailable\n {\n // Parse the string.\n parse(t);\n }", "public String amOrpm() {\n\t\tif (this.total % 24 < 12) {\n\t\t\treturn \"AM\";\n\t\t} else {\n\t\t\treturn \"PM\";\n\t\t}\n\t}", "private String formatTime(String dateObject){\n\n SimpleDateFormat input = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss'Z'\"); // format kita \"HARUS SAMA TIDAK BOLEH FORMATNYA BEDA BAHKAN 1 CHAR PUN\n SimpleDateFormat output= new SimpleDateFormat(\"h:mm a\");\n Date jam = null;\n try {\n jam = input.parse(dateObject);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n return output.format(jam);\n }", "private void parse(String str) throws NumberFormatException, Time.Ex_TimeNotAvailable\n {\n // Remove any extraneous whitespace before parsing\n str = str.trim();\n\n // Apply some heuristics to str to figure out what format it\n // is in, then call the appropriate parsing function.\n if ((str.length() >= 3) && (str.substring(0, 2).equals(\"0x\"))) {\n // If the string begins with \"0x\", then it should be HEX_BAT.\n parseHexBAT(str);\n } else if (str.charAt(4) == ' ') {\n // Fifth character is a space, therefore should be in FORMATTED_BAT\n // format.\n parseFormattedBAT(str);\n } else if (str.charAt(4) == '-') {\n // Fifth character is a \"-\", therefore should be in UTC_STRING format.\n parseUTCString(str);\n } else if (str.indexOf('.') != -1) {\n // The string contains a \".\" charcater. Try to parse it as SECS_BAT.\n parseSecsBAT(str);\n } else {\n // Fall through to DECIMAL_BAT format.\n parseDecimalBAT(str);\n }\n // Check that we didn't create an ASAP or NEVER by mistake.\n if (isASAP() || isNEVER()) {\n throw new NumberFormatException(\"absolute time reserved value: \\\"\" + str + \"\\\"\");\n }\n }", "private static int getHours(String time) {\n\t\treturn (Character.getNumericValue(time.charAt(0)) * 10) + Character.getNumericValue(time.charAt(1));\n\t}", "public String toString()\r\n {\r\n DecimalFormat twoDigits = new DecimalFormat( \"00\" );\r\n\r\n return ( this.getHour() == 12 || this.getHour() == 0 ?\r\n 12 : this.getHour() % 12 ) + \":\" +\r\n twoDigits.format( this.getMinute() ) + \":\" +\r\n twoDigits.format( this.getSecond() ) +\r\n ( this.getHour() < 12 ? \" AM\" : \" PM\" );\r\n }", "public static Date stringToTime(String time)\r\n/* 43: */ {\r\n/* 44: */ try\r\n/* 45: */ {\r\n/* 46: 54 */ return sdfTime.parse(time);\r\n/* 47: */ }\r\n/* 48: */ catch (ParseException e)\r\n/* 49: */ {\r\n/* 50: 56 */ log.fatal(\"DateUtil.stringToTime抛出异常\", e);\r\n/* 51: */ }\r\n/* 52: 57 */ return new Date();\r\n/* 53: */ }", "public static String TimeFormate() {\n\t\tString time;\n\t\tSimpleDateFormat dateFormat1 = new SimpleDateFormat();\n\t dateFormat1.setTimeZone(TimeZone.getTimeZone(\"US/Eastern\"));\n\t Calendar cal = Calendar.getInstance();\n\t cal.add(Calendar.MINUTE, 3);\n String n=dateFormat1.format(cal.getTime());\n //n=\"03/09/20 8:30 AM\";\n System.out.println(\"Full Date = \" +n);\n int colonindex=n.indexOf(\":\");\n //System.out.println(\": placed= \" +colonindex);\n //String tt =n.substring(colonindex, n.length());\n //System.out.println(\"tt= \" +tt);\n String tt1 =n.substring(colonindex-2,colonindex-1);\n System.out.println(\"tt1= \" +tt1);\n if(tt1.equals(\"1\")) {\n \t time=n.substring(colonindex-2, n.length());\n \t System.out.println(\"Time with two digits in hours= \" +time);\n }\n else {\n \t time=n.substring(colonindex-1, n.length());\n \t System.out.println(\"Time with one digit in hours= \" +time);\n }\n return time;\n\t}", "public static DateTime parseTime(String str) {\n if (str.indexOf('.') == -1) {\n return DateTimeFormat.forPattern(\"HH:mm:ss\").withZoneUTC().parseDateTime(str);\n } else {\n return DateTimeFormat.forPattern(\"HH:mm:ss.SSS\").withZoneUTC().parseDateTime(str);\n }\n }", "public void setTime(String newHour) { // setTime sets the appointment's hour in standard time\n \n // this divides the newHour string into the hour part and the 'am'/'pm' part\n int timeHour = Integer.parseInt(newHour.substring(0, newHour.length()-2)); // the number of the hour\n String timeAmPm = newHour.substring(newHour.length()-2); // whether it is 'am' or 'pm'\n\n // 4 possible cases exist and are handled in this order:\n // 1. after midnight/before noon\n // 2. midnight (12am)\n // 3. noon (12pm)\n // 4. afternoon\n if(timeAmPm.equalsIgnoreCase(\"am\") && timeHour != 12) {\n this.hour = timeHour;\n }\n else if(timeAmPm.equalsIgnoreCase(\"am\")) {\n this.hour = 0;\n }\n else if(timeHour == 12){\n this.hour = timeHour;\n }\n else {\n this.hour = timeHour + 12;\n }\n }", "private String unixToHHMMSS(String unixTime){\r\n\t\tlong unixSeconds = Long.parseLong(unixTime);\r\n\t\tDate date = new Date(unixSeconds*1000L); // convert seconds to milliseconds\r\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"HH:mm:ss\"); // date format\r\n\r\n\t\tString formattedDate = sdf.format(date);\r\n\t\treturn formattedDate;\r\n\t}", "public void mo13027a(String str) {\n Intrinsics.checkNotNullParameter(str, \"timeKeyId\");\n mo13030a(str, true);\n TimeKeyParams a = TimeKeyParams.Companion.mo60138a(this.f1030a);\n C0878g.m459a(this.f1030a, a.getNotificationChannelId(), a.getNotificationTitle(), a.getEndNotification(), a.getIconId());\n }", "private static String intToHour(int intHour) {\r\n\t\tswitch (intHour) {\r\n\t\tcase 1:\r\n\t\t\treturn \"6am\";\r\n\t\tcase 2:\r\n\t\t\treturn \"7am\";\r\n\t\tcase 3:\r\n\t\t\treturn \"8am\";\r\n\t\tcase 4:\r\n\t\t\treturn \"9am\";\r\n\r\n\t\tcase 5:\r\n\t\t\treturn \"10am\";\r\n\r\n\t\tcase 6:\r\n\t\t\treturn \"11am\";\r\n\r\n\t\tcase 7:\r\n\t\t\treturn \"12pm\";\r\n\r\n\t\tcase 8:\r\n\t\t\treturn \"1pm\";\r\n\r\n\t\tcase 9:\r\n\t\t\treturn \"2pm\";\r\n\r\n\t\tcase 10:\r\n\t\t\treturn \"3pm\";\r\n\r\n\t\tcase 11:\r\n\t\t\treturn \"4pm\";\r\n\r\n\t\tcase 12:\r\n\t\t\treturn \"5pm\";\r\n\r\n\t\tcase 13:\r\n\t\t\treturn \"6pm\";\r\n\r\n\t\tcase 14:\r\n\t\t\treturn \"7pm\";\r\n\r\n\t\tcase 15:\r\n\t\t\treturn \"8pm\";\r\n\t\tdefault:\r\n\t\t\treturn \"\";\r\n\t\t}// end switch\r\n\t}", "public static String fixAutoTime(String time) {\n if (time.length() < 3) {\n return fixAutoTime(\"0\".concat(time));\n }\n return time;\n }", "@Override\n\tpublic String convertTime(String aTime) {\n\t\tBerlinClock berlinClock = new BerlinClockImpl();\n\t\treturn berlinClock.convertTime(aTime);\n\t}", "public static Timestamp changeStrToDate(String strInput)\n\t{\n\t\tSimpleDateFormat sdfmt1 = new SimpleDateFormat(\"MM/dd/yyyy hh:mm a\");\n\t\tSimpleDateFormat sdfmt2= new SimpleDateFormat(\"yyyy-MM-dd HH:mm\");\n\t\tjava.util.Date dDate = new Date();\n\t\ttry {\n\t\t\tdDate = sdfmt1.parse( strInput );\n\t\t} catch (ParseException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tString strOutput = sdfmt2.format( dDate );\n\t\tDateTimeFormatter formattert = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm\");\n\t\tLocalDateTime ldt = LocalDateTime.parse(strOutput,formattert);\n\t\tTimestamp dt = Timestamp.valueOf(ldt);\n\t\t//System.out.println(dDate + \" \" + strOutput + \" \" + dt);\n\t\t//System.out.println(dt);\n\t\treturn dt;\n\n\t}", "public String parseTimeToTimeDate(String time) {\n Date date = null;\n try {\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\", Locale.getDefault());\n String todaysDate = new SimpleDateFormat(\"yyyy-MM-dd\", Locale.getDefault()).format(new Date());\n date = simpleDateFormat.parse(todaysDate + \" \" + time);\n\n SimpleDateFormat sdf = new SimpleDateFormat(\"HH:mm dd,MMM\", Locale.getDefault());\n //sdf.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n return sdf.format(date);\n\n } catch (ParseException e) {\n e.printStackTrace();\n }\n return null;\n }", "private boolean timeValidation(String time){\n if(! time.matches(\"(?:[0-1][0-9]|2[0-4]):[0-5]\\\\d\")){\n return false;\n }\n return true;\n }", "public String convertDateToTime(String date){\n Date test = null;\n if(date !=null) {\n try {\n test = sdf.parse(date);\n } catch (ParseException e) {\n System.out.println(\"Parse not working: \" + e);\n }\n calendar.setTime(test);\n return String.format(\"%02d:%02d\",\n calendar.get(Calendar.HOUR_OF_DAY),\n calendar.get(Calendar.MINUTE)\n );\n }\n return \"n\";\n }", "private boolean checkValidTime(String inputTime) {\n int hour = Integer.parseInt(inputTime.substring(0,2));\n int minute = Integer.parseInt(inputTime.substring(2,4));\n \n if ((hour >= 0 && hour <= 23) && (minute >= 0 && minute <= 59)) {\n return true;\n } else {\n return false;\n }\n }", "public String timeFormatter(int hour, int min) {\n String minString = String.valueOf(min);\n String amOrPm = \"AM\";\n if (hour > 12) {\n hour -= 12;\n amOrPm = \"PM\";\n }\n if (minString.length() < 2) {\n minString = \"0\" + minString;\n }\n return (String.valueOf(hour) + \":\" + minString + \" \" + amOrPm);\n\n }", "public static String[] validateHours(String hours) {\n\tString[] hourString=new String[2];\r\n\tStringTokenizer st=new StringTokenizer(hours,\"-\");\r\n\ttry{\r\n\t\thourString[0]=st.nextToken();\r\n\t\thourString[1]=st.nextToken();\r\n\t}\r\n\tcatch(Exception e){\r\n\t\tSystem.out.println(\"Hours are not proper:\");\r\n\t\thourString[0]=null;\r\n\t\treturn hourString;\r\n\t}\r\n\tboolean validHour=validInteger(hourString[0]);\r\n\tif(!validHour || hourString[0].length()!=4){\r\n\t\tSystem.out.println(\"Invalid Start Time\");\r\n\t\thourString[0]=null;\r\n\t\treturn hourString;\r\n\t}\r\n\tvalidHour=validInteger(hourString[1]);\r\n\tif(!validHour || hourString[1].length()!=4){\r\n\t\tSystem.out.println(\"Invalid End Time Time\");\r\n\t\thourString[0]=null;\r\n\t\treturn hourString;\r\n\t}\r\n\tString time=hourString[0].substring(0, 2)+\":\"+hourString[0].substring(2, 4);\r\n\thourString[0]=time;\r\n\tSystem.out.println(\"Start Time : \"+time);\r\n\ttime=null;\r\n\ttime=hourString[1].substring(0, 2)+\":\"+hourString[1].substring(2, 4);\r\n\thourString[1]=time;\r\n\treturn hourString;\r\n}", "public static double getAttHour(String time1, String time2)\r\n/* 178: */ throws ParseException\r\n/* 179: */ {\r\n/* 180:258 */ double hour = 0.0D;\r\n/* 181:259 */ DateFormat fulDate = new SimpleDateFormat(\"HH:mm\");\r\n/* 182:260 */ long t12 = fulDate.parse(\"12:00\").getTime();\r\n/* 183:261 */ long t13 = fulDate.parse(\"13:00\").getTime();\r\n/* 184:262 */ long t1 = fulDate.parse(time1).getTime();\r\n/* 185:263 */ long PERHOUR = 3600000L;\r\n/* 186:264 */ if (time2 == null)\r\n/* 187: */ {\r\n/* 188:265 */ if (t12 - t1 > 0L) {\r\n/* 189:266 */ hour = (t12 - t1) / PERHOUR;\r\n/* 190: */ }\r\n/* 191: */ }\r\n/* 192: */ else\r\n/* 193: */ {\r\n/* 194:269 */ long t2 = fulDate.parse(time2).getTime();\r\n/* 195:270 */ if ((t1 <= t12) && (t2 >= t12) && (t2 <= t13)) {\r\n/* 196:271 */ hour = (t12 - t1) / PERHOUR;\r\n/* 197:272 */ } else if ((t1 <= t12) && (t2 >= t13)) {\r\n/* 198:273 */ hour = (t2 - t1) / PERHOUR - 1.0D;\r\n/* 199:274 */ } else if ((t1 >= t12) && (t1 <= t13) && (t2 >= t12) && (t2 <= t13)) {\r\n/* 200:275 */ hour = 0.0D;\r\n/* 201:276 */ } else if ((t1 >= t12) && (t1 <= t13) && (t2 >= t13)) {\r\n/* 202:277 */ hour = (t2 - t13) / PERHOUR;\r\n/* 203: */ } else {\r\n/* 204:279 */ hour = (t2 - t1) / PERHOUR;\r\n/* 205: */ }\r\n/* 206: */ }\r\n/* 207:282 */ DecimalFormat df = new DecimalFormat(\"#.0\");\r\n/* 208:283 */ return Double.parseDouble(df.format(hour));\r\n/* 209: */ }", "private boolean get24HourMode() {\n return android.text.format.DateFormat.is24HourFormat(getContext());\n }", "public static boolean isValidTime(String time) throws NumberFormatException {\n\n int timeInt = Integer.parseInt(time); //throws NumberFormatException if \"time\" contains non-digit characters\n\n if (time.length() != 4) {\n return false;\n }\n\n char[] timeArray = time.toCharArray();\n int hour = Integer.parseInt(new String(timeArray, 0, 2));\n\n int minute = 10 * Integer.parseInt(Character.toString(timeArray[2]))\n + Integer.parseInt(Character.toString(timeArray[3]));\n\n return hour >= 0 && hour < 24 && minute >= 0 && minute < 60;\n\n }", "public static Time toTime(Object obj, String pattern) {\n return toTime(obj, pattern, (TimeZone) null);\n }", "public static String getParsableTime(String rawDateTime) throws InvalidTimeFormatException {\n try {\n String[] separatedDateTime = rawDateTime.split(\" \");\n if (separatedDateTime[1].length() < 4) {\n separatedDateTime[1] = \"0\" + separatedDateTime[1];\n }\n String hour = separatedDateTime[1].substring(0, 2);\n if (hour.equals(\"24\")) {\n hour = \"00\";\n }\n String minute = separatedDateTime[1].substring(2, 4);\n String formattedTime = hour + \":\" + minute + \":00\";\n return formattedTime;\n } catch (Exception e) {\n throw new InvalidTimeFormatException(TIME_FORMAT_ERROR_MESSAGE);\n }\n }", "public static String convertDateAndTime(String inputString) {\n String trimmedInputString = inputString.trim();\n\n if (trimmedInputString.length() < 10) {\n return convertTime(inputString);\n } else {\n String dateString = trimmedInputString.substring(0, 10).trim();\n String timeString = trimmedInputString.substring(10).trim();\n try {\n String date = LocalDate.parse(dateString).format(DateTimeFormatter.ofPattern(\"d MMM yyyy\"));\n\n if (timeString.length() == 4) {\n return date + \" \" + convertTime(timeString);\n }\n\n return date + timeString;\n } catch (DateTimeParseException e) {\n return inputString;\n }\n }\n }", "public static String getNowTimeHHMM() {\n\t\tSimpleDateFormat timeFormat = new SimpleDateFormat(\"HH:mm\");\n\t\treturn timeFormat.format(new Date());\n\t}", "public String getRegDepTime(){\n\t\tString[] regularTime = this.depTime.split(\":\");\n\t\t\n\t\tint hours = Integer.parseInt(regularTime[0]);\n\t\tint depTimeHours;\n\t\tif(hours<12){\n\t\t\tdepTimeHours = hours;\n\t\t\treturn regularTime[0] + \":\" + regularTime[1] + \"AM\";\n\t\t\t\n\t\t}\n\t\telse if(hours == 12){\n\t\t\tdepTimeHours = hours;\t\t\n\t\t\treturn regularTime[0] + \":\" + regularTime[1] + \"PM\";\n\t\t}\n\t\telse{\n\t\t depTimeHours = hours-12;\n\t\t\tregularTime[0] = String.valueOf(depTimeHours);\n\t\t\treturn regularTime[0] + \":\" + regularTime[1] + \"PM\";\n\t\t}\n\t}", "private String TimeConversion() {\n\n int hours, minutes, seconds, dayOfWeek, date, month, year;\n\n seconds = ((raw[27] & 0xF0) >> 4) + ((raw[28] & 0x03) << 4);\n minutes = ((raw[28] & 0xFC) >> 2);\n hours = (raw[29] & 0x1F);\n dayOfWeek = ((raw[29] & 0xE0) >> 5);\n date = (raw[30]) & 0x1F;\n month = ((raw[30] & 0xE0) >> 5) + ((raw[31] & 0x01) << 3);\n year = (((raw[31] & 0xFE) >> 1) & 255) + 2000;\n\n\n\n return hR(month) + \"/\" + hR(date) + \"/\" + year + \" \" + hR(hours) + \":\" + hR(minutes) + \":\" + hR(seconds) + \":00\";\n }", "public static void timeConversion(String time)\r\n {\n\r\n if (ticks >= 0)\r\n {\r\n time = day;\r\n } else if (ticks >= 12000)\r\n {\r\n time = sunset;\r\n } else if (ticks >= 12610)\r\n {\r\n time = dusk;\r\n } else if (ticks >= 17843)\r\n {\r\n time = midnight;\r\n } else if (ticks >= 23041)\r\n {\r\n time = dawn;\r\n }\r\n }", "private String formatTime(Date dateObject) {\n @SuppressLint(\"SimpleDateFormat\") SimpleDateFormat timeFormat = new SimpleDateFormat(\"h:mm a\");\n return timeFormat.format(dateObject);\n }", "protected static int getHour(String dateTime) {\n return Integer.parseInt(dateTime.substring(7, 9));\n }", "private void parseFormattedBAT(String str) throws NumberFormatException\n {\n // A trimed version of the input string.\n String trimStr;\n\n // Check for first char is \"-\", since this would make a valid\n // long, but which we don't want to be a valid time.\n if (str.charAt(0) == '-') {\n throw new NumberFormatException(\"bad absolute time: \\\"\" + str + \"\\\"\");\n }\n\n // Remove all the spaces.\n trimStr = removeWhitespace(str);\n\n // Should be ok now to parse the string as a hex long.\n try {\n itsValue = Long.parseLong(trimStr, 16);\n } catch (NumberFormatException e) {\n throw new NumberFormatException(\"bad absolute time: \\\"\" + str + \"\\\"\");\n }\n }", "public interface ConversationalTimeFormatter {\n public String transform(Integer hour, Integer minutes);\n}", "public static void main(String[] args) {\n\n String time =\"16:49:40\".substring(0,2);\n System.out.println(time);\n\n }", "private java.sql.Time getSqlTimeFromLabel(CharSequence text) {\n String timeString = text.toString()+\":00\";\n return java.sql.Time.valueOf(timeString);\n }", "private String formatTime(Date dateObject) {\r\n SimpleDateFormat timeFormat = new SimpleDateFormat(\"h:mm a\");\r\n return timeFormat.format(dateObject);\r\n }", "public void testFormatDateStringFromTimestamp_todayDoubleMinutePm() {\n calendar.set(Calendar.HOUR_OF_DAY, 22);\n calendar.set(Calendar.MINUTE, 18);\n assertEquals(\"10:18 PM\",\n ContactInteractionUtil.formatDateStringFromTimestamp(calendar.getTimeInMillis(),\n getContext()));\n }", "private Integer timeStringToInt(String time) {\n\t\t\n\t\tif(time.equals(\"TBA\")) {\n\t\t\treturn -1;\n\t\t}\n\t\t\n\t\tString[] t = time.split(\":\");\n\t\tInteger hours = Integer.parseInt(t[0]) * 100;\n\t\tInteger minutes = Integer.parseInt(t[1]);\n\t\treturn hours + minutes;\n\t}", "public static long TimeInformationToSeconds(String info){\n\t\tif(info.indexOf(':') > 0){\n\t\t\tString[] data = info.split(\":\");\n\t\t\tlong hours = Long.parseLong(data[0]);\n\t\t\tlong minutes = Long.parseLong(data[1]);\n\t\t\tlong seconds = Long.parseLong(data[2].split(\"[.]\")[0]);\n\t\t\tlong milliseconds = Long.parseLong(data[2].split(\"[.]\")[1]);\n\t\t\treturn (hours * 3600000) + (minutes * 60000) + (seconds * 1000) + milliseconds;\n\t\t}else{\n\t\t\n\t\t/*\n\t\tSystem.out.println(info.substring(0, info.indexOf(\"day\")));\n\t\tSystem.out.println(info.substring(0, info.indexOf(\"day\")));\n\t\tSystem.out.println(info.substring(info.indexOf(\" \"), info.indexOf(\":\")));\n\t\tSystem.out.println(info.substring(info.indexOf(':'), info.lastIndexOf(':')));\n\t\tSystem.out.println(info.substring(info.lastIndexOf(':'), info.indexOf('.')));\n\t\tSystem.out.println(info.substring(info.indexOf('.')));\n/*\t\tlong days = Long.parseLong(info.substring(0, info.indexOf(\"day\")));\n\t\tlong hours = Long.parseLong(info.substring(info.indexOf(\" \"), info.indexOf(\":\")));\n\t\tlong minutes = Long.parseLong(info.substring(info.indexOf(':'), info.lastIndexOf(':')));\n\t\tlong seconds = Long.parseLong(info.substring(info.lastIndexOf(':'), info.indexOf('.')));\n\t\tlong milliseconds = Long.parseLong(info.substring(info.indexOf('.')));\n\t*/\t\n\t\t}\n\t\treturn 1;//(days * 86400000) + (hours * 3600000) + (minutes * 60000) + (seconds * 1000) + milliseconds;\n\t}", "@Test\n\tpublic void convertToTimeTest(){\n\t\tDjikstrasMap m = new DjikstrasMap();\t//Creates new DjikstrasMap object\n\t\tdouble time = 1.85;\t\t\n\t\tassertEquals(\"2 hour and .51 minutes\", m.convertToTime(time));\t//Checks that the convertToTime method formats the time correctly\n\t}", "public Date Transfertime(String timetmp) {\n Date timedatetmp = new Date();\n try {\n timedatetmp = sdftime.parse(timetmp);\n }\n catch (ParseException e) { \n e.printStackTrace();\n }\n return timedatetmp;\n }" ]
[ "0.73401636", "0.7046488", "0.6805074", "0.6731536", "0.66776335", "0.6666095", "0.665531", "0.6651135", "0.6636756", "0.6465022", "0.62368315", "0.60621023", "0.6045909", "0.5939168", "0.57889456", "0.5773447", "0.57701993", "0.5607969", "0.55086017", "0.5484195", "0.54830825", "0.5435227", "0.54338", "0.53534067", "0.5341024", "0.52760446", "0.52695966", "0.5265136", "0.5251016", "0.5242473", "0.52281666", "0.51654977", "0.5157274", "0.51433915", "0.5138883", "0.51037925", "0.510075", "0.508515", "0.50824916", "0.50491834", "0.50428367", "0.50194585", "0.5013633", "0.4994389", "0.49621117", "0.49604484", "0.49434486", "0.49331948", "0.49117187", "0.4909455", "0.49029374", "0.48977587", "0.48957494", "0.4874608", "0.48665404", "0.4854997", "0.48320302", "0.4819405", "0.4795397", "0.47857216", "0.4777316", "0.47649726", "0.4754475", "0.4738111", "0.47283173", "0.47160438", "0.46722963", "0.46718025", "0.4637423", "0.46336305", "0.46261144", "0.4625566", "0.46129894", "0.45939344", "0.45924032", "0.45869943", "0.45814216", "0.45800278", "0.45588884", "0.4541111", "0.4540043", "0.45372868", "0.45343325", "0.45269814", "0.4520386", "0.4506966", "0.45050377", "0.44854665", "0.44534317", "0.4452374", "0.44484967", "0.4443704", "0.44430172", "0.44363117", "0.44174966", "0.44173327", "0.44146907", "0.44145578", "0.44137868", "0.4411718" ]
0.62820464
10
Converts the inputString into DD MMM YYYY format, or 12hour time representation if applicable.
public static String convertDateAndTime(String inputString) { String trimmedInputString = inputString.trim(); if (trimmedInputString.length() < 10) { return convertTime(inputString); } else { String dateString = trimmedInputString.substring(0, 10).trim(); String timeString = trimmedInputString.substring(10).trim(); try { String date = LocalDate.parse(dateString).format(DateTimeFormatter.ofPattern("d MMM yyyy")); if (timeString.length() == 4) { return date + " " + convertTime(timeString); } return date + timeString; } catch (DateTimeParseException e) { return inputString; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static String convertDate(String input) {\n String res = \"\";\n\n String[] s = input.split(\" \");\n\n res += s[2] + \"-\";\n switch (s[1]) {\n case \"January\":\n res += \"01\";\n break;\n case \"February\":\n res += \"02\";\n break;\n case \"March\":\n res += \"03\";\n break;\n case \"April\":\n res += \"04\";\n break;\n case \"May\":\n res += \"05\";\n break;\n case \"June\":\n res += \"06\";\n break;\n case \"July\":\n res += \"07\";\n break;\n case \"August\":\n res += \"08\";\n break;\n case \"September\":\n res += \"09\";\n break;\n case \"October\":\n res += \"10\";\n break;\n case \"November\":\n res += \"11\";\n break;\n case \"December\":\n res += \"12\";\n break;\n default:\n res += \"00\";\n break;\n }\n\n res += \"-\";\n if (s[0].length() == 1) {\n res += \"0\" + s[0];\n }\n else {\n res += s[0];\n }\n return res;\n }", "public static String dateStr(String input ){\n String mm = input.substring(0,2);\n String dd = input.substring(3,5);\n String yyyy = input.substring(6,10);\n return dd + \" - \" + mm + \" - \" + yyyy;\n }", "public static String parseDate(String input) {\n String year = input.substring(0, 4);\n String month = input.substring(5, 7);\n String day = input.substring(8, 10);\n return year + \"-\" + month + \"-\" + day;\n }", "protected String getDateTimeString(String input) {\n String result;\n DateTimeFormatter datePattern = DateTimeFormatter.ofPattern(\"MMM dd yyyy\");\n if (dateTime == null) {\n result = input;\n } else {\n String date = getDate().format(datePattern);\n String time = getTime().toString();\n result = date + Constants.SPACE + time;\n }\n return result;\n }", "public String changeDateTimeFormat(String dateStr) {\n String inputPattern = \"MMM-dd-yyyy hh:mm a\";\n String outputPattern = \"MMMM dd, yyyy hh:mm a\";\n SimpleDateFormat inputFormat = new SimpleDateFormat(inputPattern);\n SimpleDateFormat outputFormat = new SimpleDateFormat(outputPattern);\n\n Date date = null;\n String str = null;\n\n try {\n date = inputFormat.parse(dateStr);\n str = outputFormat.format(date);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n return str;\n\n }", "private String convertToDateFormat(String inputDateString) throws DateTimeParseException {\n\t\treturn inputDateString;\n\t}", "private String formatDate(String dateString) {\n DateTimeFormatter dateTimeFormatter = DateTimeFormatter.ofPattern(\"LLL dd, yyyy\");\n LocalDate localDate = LocalDate.parse(dateString.substring(0, 10));\n return dateTimeFormatter.format(localDate);\n }", "public String changeDateFormat(String dateStr) {\n String inputPattern = \"MMM-dd-yyyy\";\n String outputPattern = \"MMMM dd, yyyy\";\n SimpleDateFormat inputFormat = new SimpleDateFormat(inputPattern);\n SimpleDateFormat outputFormat = new SimpleDateFormat(outputPattern);\n\n Date date = null;\n String str = null;\n\n try {\n date = inputFormat.parse(dateStr);\n str = outputFormat.format(date);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n return str;\n\n }", "public static Timestamp changeStrToDate(String strInput)\n\t{\n\t\tSimpleDateFormat sdfmt1 = new SimpleDateFormat(\"MM/dd/yyyy hh:mm a\");\n\t\tSimpleDateFormat sdfmt2= new SimpleDateFormat(\"yyyy-MM-dd HH:mm\");\n\t\tjava.util.Date dDate = new Date();\n\t\ttry {\n\t\t\tdDate = sdfmt1.parse( strInput );\n\t\t} catch (ParseException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\tString strOutput = sdfmt2.format( dDate );\n\t\tDateTimeFormatter formattert = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm\");\n\t\tLocalDateTime ldt = LocalDateTime.parse(strOutput,formattert);\n\t\tTimestamp dt = Timestamp.valueOf(ldt);\n\t\t//System.out.println(dDate + \" \" + strOutput + \" \" + dt);\n\t\t//System.out.println(dt);\n\t\treturn dt;\n\n\t}", "private String getDate(String str) {\n String[] arr = str.split(\"T\");\n DateFormat formatter = new SimpleDateFormat(\"yyyy-mm-d\", Locale.US);\n Date date = null;\n try {\n date = formatter.parse(arr[0]);\n } catch (java.text.ParseException e) {\n Log.e(LOG_TAG, \"Could not parse date\", e);\n }\n SimpleDateFormat dateFormatter = new SimpleDateFormat(\"MMM d, yyyy\", Locale.US);\n\n return dateFormatter.format(date);\n }", "public static String parseMmDdYyyyToYyyyMmDD(String dateString) {\n try {\n // Date is MM-DD-YYYY, convert to YYYY-MM-DD\n return String.format(\"%s-%s-%s\", dateString.substring(6, 10), dateString.substring(0, 2),\n dateString.substring(3, 5));\n } catch (StringIndexOutOfBoundsException e) {\n return dateString;\n }\n }", "static String timeConversion(String s) {\n if(s.indexOf('P') >= 0 && s.substring(0, 2).equals(\"12\")){\n }\n else if(s.indexOf('P') >= 0){\n Integer n = Integer.parseInt(s.substring(0, 2));\n s = removeHour(s);\n n += 12;\n String hour = Integer.toString(n);\n s = hour + s;\n }\n else if (s.indexOf('A') >= 0 && s.substring(0, 2).equals(\"12\")){\n s = \"00\" + s.substring(2);\n }\n return removeHourFormat(s);\n }", "public Date stringToDate(String d)\n\t{\n\t\tSimpleDateFormat format = new SimpleDateFormat(\"MMM-yyyy\");\n\t\t\n\t\tDate date = new Date();\n\t\t\n\t\ttry \n\t\t{\n\t\t\tdate = format.parse(d);\n\t\t} \n\t\tcatch (ParseException e) \n\t\t{\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\treturn date;\n\t}", "public static Date strToTime(String strDate)\r\n/* 135: */ {\r\n/* 136:192 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMdd HH:mm:ss\");\r\n/* 137:193 */ ParsePosition pos = new ParsePosition(0);\r\n/* 138:194 */ Date strtodate = formatter.parse(strDate, pos);\r\n/* 139:195 */ return strtodate;\r\n/* 140: */ }", "public static String fromDate(String s){\n \t\t\n \t\tString[] date = s.split(\"T\");\n \t\tString time = date[1].substring(0,5);\n \t\tString[] dates = date[0].split(\"-\"); \n \t\tString month = dates[1];\n \t\tString day = dates[2];\n \t\t\n \t\treturn day + \"/\" + month + \", kl: \" + time;\n \t}", "static String timeConversion(String s) {\n String[] sTime = s.split(\":\");\n\n int x = 0;\n\n // if PM and hours >12, add additional 12 to hours\n // for AM and hour = 12, set hour to 00\n if(sTime[sTime.length - 1].contains(\"PM\") && !sTime[0].equals(\"12\"))\n x = 12;\n\n String val1 = \"\";\n if(x == 12)\n val1 = (Integer.parseInt(sTime[0]) + x) + \"\";\n else {\n if(sTime[0].equals(\"12\") && sTime[sTime.length - 1].contains(\"AM\"))\n val1 = \"00\";\n else\n val1 = sTime[0];\n }\n\n // merge the string and return the result\n String result = val1 + \":\" + sTime[1] + \":\" + sTime[2].substring(0,2);\n return result;\n }", "public String getDDMMMYYYYDate(String date) throws Exception {\n HashMap<Integer, String> month = new HashMap<Integer, String>();\n month.put(1, \"Jan\");\n month.put(2, \"Feb\");\n month.put(3, \"Mar\");\n month.put(4, \"Apr\");\n month.put(5, \"May\");\n month.put(6, \"Jun\");\n month.put(7, \"Jul\");\n month.put(8, \"Aug\");\n month.put(9, \"Sep\");\n month.put(10, \"Oct\");\n month.put(11, \"Nov\");\n month.put(12, \"Dec\");\n\n try {\n String[] dtArray = date.split(\"-\");\n return dtArray[1] + \"-\" + month.get(Integer.parseInt(dtArray[1])) + \"-\" + dtArray[0];\n } catch (Exception e) {\n throw new Exception(\"getDDMMMYYYYDate : \" + date + \" : \" + e.toString());\n }\n\n }", "public static String dateToFullMonthNameInDate(LocalDate inputStringDate) {\n\t\tlog.info(\"input Date ::{}\", inputStringDate);\n\t\tDateTimeFormatter dtf = DateTimeFormatter.ofPattern(\"yyyy-MM-dd\");\n\t\tDateTimeFormatter dateFormat = DateTimeFormatter.ofPattern(\"dd MMMM yyyy\");\n\t\treturn dateFormat.format(inputStringDate);\n\t}", "private String formatReleaseDate(String releaseDate) {\n SimpleDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd\");\n Date dateObject;\n try {\n dateObject = format.parse(releaseDate);\n }\n catch (ParseException pe) {\n Log.e(LOG_TAG, \"Error while retrieving movie information\");\n return releaseDate;\n }\n format = new SimpleDateFormat(\"LLL dd, yyyy\");\n\n return format.format(dateObject);\n }", "public LocalDateTime parseLocalDateTime(String inputString){\r\n LocalDateTime dateTime = null;\r\n\r\n //handle cases like Thu Oct 9 09:43:23 2016 where dayOfMonth has one digit\r\n Pattern patternDateTime1 = Pattern.compile(\"(Mon|Tue|Wed|Thu|Fri|Sat|Sun)\\\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\\\s{1,2}\\\\d\\\\s\\\\d{2}:\\\\d{2}:\\\\d{2}\\\\s\\\\d{4}\"); //date pattern\r\n DateTimeFormatter formatter1 = DateTimeFormatter.ofPattern(\"EEE MMM d HH:mm:ss yyyy\");\r\n Matcher matcherDateTime1 = patternDateTime1.matcher(inputString);\r\n\r\n //handle cases like Thu Oct 19 09:43:23 2016 where dayOfMonth has two digit\r\n Pattern patternDateTime2 = Pattern.compile(\"(Mon|Tue|Wed|Thu|Fri|Sat|Sun)\\\\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\\\s{1,2}\\\\d{2}\\\\s\\\\d{2}:\\\\d{2}:\\\\d{2}\\\\s\\\\d{4}\"); //date pattern\r\n DateTimeFormatter formatter2 = DateTimeFormatter.ofPattern(\"EEE MMM dd HH:mm:ss yyyy\");\r\n Matcher matcherDateTime2 = patternDateTime2.matcher(inputString);\r\n\r\n if (matcherDateTime1.find()){\r\n try {\r\n dateTime = LocalDateTime.parse(matcherDateTime1.group(),formatter1);\r\n } catch (Exception e) {\r\n return null;\r\n }\r\n }else if(matcherDateTime2.find()){\r\n try {\r\n dateTime = LocalDateTime.parse(matcherDateTime2.group(),formatter2);\r\n } catch (Exception e) {\r\n return null;\r\n }\r\n }\r\n return dateTime;\r\n }", "public static String convertDateToSend(String gotdate){\n Calendar calendar = Calendar.getInstance();\n calendar.setTimeInMillis(Long.parseLong(gotdate));\n SimpleDateFormat inputFormat = new SimpleDateFormat(\"yyyyMMddHHmmss\");\n SimpleDateFormat outputFormat = new SimpleDateFormat(\"dd MMM yyyy\");\n /*Date parsedDate = null;\n try {\n parsedDate = inputFormat.parse(gotdate);\n } catch (ParseException e) {\n e.printStackTrace();\n }*/\n String formattedDate = outputFormat.format(calendar.getTime());\n return formattedDate;\n }", "private static String convertDate(String dateString) {\n String date = null;\n\n try {\n //Parse the string into a date variable\n Date parsedDate = new SimpleDateFormat(\"yyyy-MM-dd'T'HH:mm:ss\").parse(dateString);\n\n //Now reformat it using desired display pattern:\n date = new SimpleDateFormat(DATE_FORMAT).format(parsedDate);\n\n } catch (ParseException e) {\n Log.e(TAG, \"getDate: Error parsing date\", e);\n e.printStackTrace();\n }\n\n return date;\n }", "public static String timeConversion(String s) {\n // Write your code here\n String end = s.substring(2, s.length() - 2);\n String ans = s.substring(0, s.length() - 2);\n if (s.charAt(8) == 'A') {\n return s.startsWith(\"12\") ? \"00\" + end : ans;\n }\n\n return s.startsWith(\"12\") ? ans : (Integer.parseInt(s.substring(0, 2)) + 12) + end;\n }", "static String timeConversion(String s) {\n\n\t\tStringBuilder sb = new StringBuilder();\n\t\tboolean isAm = s.contains(\"AM\");\n\t\t\n\t\ts = s.replace(\"AM\", \"\");\n\t\ts = s.replace(\"PM\", \"\");\n\t\t\n\t\tString str[] = s.split(\":\");\n\t\tint time = Integer.parseInt(str[0]);\n\t\t\n\t\t\n\t\tif(time < 12 && !isAm) {\n\t\t\ttime = time + 12;\n\t\t\tsb.append(time).append(\":\");\n\t\t}else if(time == 12 && isAm) {\n\t\t\tsb.append(\"00:\");\n\t\t}else {\n\t\t\tif (time < 10) sb.append(\"0\").append(time).append(\":\");\n\t\t\telse sb.append(time).append(\":\");\n\t\t}\n\n\t\tsb.append(str[1]).append(\":\").append(str[2]);\n\t\treturn sb.toString();\n\t}", "public static String getYearMonthFormat(String strFormat) {\n String yearMonthFormat = \"\";\n String etemp = \"\";\n String regex = \".*[^a-zA-Z0-9]\";\n int epos = strFormat.lastIndexOf(\"d\");\n\n if (epos + 1 < strFormat.length()) {\n etemp = strFormat.substring(epos + 1, epos + 2);\n }\n\n yearMonthFormat = strFormat.replaceAll(\"d\", \"\");\n yearMonthFormat = yearMonthFormat.replaceAll(\"m\", \"M\");\n\n if (etemp.length() > 0)\n yearMonthFormat = yearMonthFormat.replaceFirst(etemp, \"\");\n\n if (yearMonthFormat.matches(regex)) {\n yearMonthFormat = yearMonthFormat.substring(0, yearMonthFormat.length() - 1);\n if (yearMonthFormat.matches(regex)) {\n yearMonthFormat = yearMonthFormat.substring(0, yearMonthFormat.length() - 1);\n }\n }\n return yearMonthFormat;\n }", "public String getDateConvert() {\n SimpleDateFormat dateFormat1 = new SimpleDateFormat(\"MMM dd yyyy - hh:mm\");\n SimpleDateFormat dateFormat2 = new SimpleDateFormat(\"a\");\n String date = dateFormat1.format(this.timePost) + dateFormat2.format(this.timePost).toLowerCase();\n return date;\n }", "public static java.util.Date convertFromStringToDate(String strDate){\n\t\tSimpleDateFormat format = new SimpleDateFormat(\"dd-MMM-yyyy\"); /*This stringDate is come from UI*/\n\t\tjava.util.Date date = null;\n\t\tif(strDate != null && !strDate.trim().isEmpty()){\n\t\t\ttry {\n\t\t\t\tdate = format.parse(strDate);\n\t\t\t\tSystem.out.println(strDate);\n\t\t\t} catch (ParseException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\t\n\t\treturn date;\n\t}", "public static String convertDateFormat (String dateStr, String fromFormatPattern, String toFormatPattern) {\n\t\tDateFormat fromFormat = new SimpleDateFormat(fromFormatPattern);\n\t\tDateFormat toFormat = new SimpleDateFormat(toFormatPattern);\n\t\ttoFormat.setLenient(false);\n\t\tDate date;\n\t\ttry {\n\t\t\tdate = fromFormat.parse(dateStr);\n\t\t\treturn toFormat.format(date);\n\t\t} catch (ParseException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\tLog.d(\"ERROR\", \"Date formatting Error\");\n\t\t}\n\t\treturn null;\n\t}", "public static String dateStr(String str)\n {\n String month = str.split(\"/\")[0];\n String day = str.split(\"/\")[1];\n String year = str.split(\"/\")[2];\n return day + \"-\" + month + \"-\" + year;\n }", "public static String ddmmyyyyToyyyymmddd(String strDate) {\n DateFormat formatter = new SimpleDateFormat(\"dd-MM-yyyy\");\n Date date = null;\n try {\n date = (Date) formatter.parse(strDate);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n SimpleDateFormat newFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\n String finalString = newFormat.format(date);\n return finalString;\n }", "private Date convertStringToDate(String dateInString){\n DateFormat format = new SimpleDateFormat(\"d-MM-yyyy HH:mm\", Locale.ENGLISH);\n Date date = null;\n try {\n date = format.parse(dateInString);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n return date;\n }", "private String formatDateTime(String inputDateTime) throws ParseException {\n SimpleDateFormat simpleDateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n simpleDateFormat.setTimeZone(TimeZone.getTimeZone(\"UTC\"));\n Date myDate = simpleDateFormat.parse(inputDateTime);\n DateFormat outputFormat = new SimpleDateFormat(\"M/d/yy, h:mm aa\");\n DateFormat todayFormat = new SimpleDateFormat(\"h:mm aa\");\n String outputDateStr = \"\";\n if (isToday(inputDateTime.split(\" \")[0])){\n outputDateStr = \"Today, \" + todayFormat.format(myDate);\n } else {\n outputDateStr = outputFormat.format(myDate);\n }\n return outputDateStr;\n }", "public static String m24132a(Context context, Date date, String str) {\n return context != null ? new SimpleDateFormat(str, Locale.US).format(date) : \"\";\n }", "public static String yyyymmdddToddmmyyyy(String strDate) {\n DateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd\");\n Date date = null;\n try {\n date = (Date) formatter.parse(strDate);\n } catch (ParseException e) {\n e.printStackTrace();\n }\n SimpleDateFormat newFormat = new SimpleDateFormat(\"dd-MM-yyyy\");\n String finalString = newFormat.format(date);\n return finalString;\n }", "protected void guessDateFormat(String dateStr) {\n if (log4j.isDebugEnabled()) {log4j.debug(BaseMessages.getString(PKG, \"MVSFileParser.DEBUG.Guess.Date\"));} //$NON-NLS-1$\n String[] dateSplit = dateStr.split(\"/\"); //$NON-NLS-1$\n String yrFmt = null;\n int yrPos = -1;\n int dayPos = -1;\n // quick look for either yyyy/xx/xx or xx/xx/yyyy\n for (int i=0; i<dateSplit.length; i++) {\n int aDigit = Integer.parseInt(dateSplit[i]); \n if (dateSplit[i].length() == 4) {\n yrFmt = \"yyyy\"; //$NON-NLS-1$\n yrPos = i;\n } else if (aDigit>31) {\n // found 2-digit year\n yrFmt = \"yy\"; //$NON-NLS-1$\n yrPos = i;\n } else if (aDigit > 12) {\n // definitely found a # <=31,\n dayPos = i;\n }\n }\n if (yrFmt != null) {\n StringBuffer fmt = new StringBuffer();\n if (dayPos >=0) {\n // OK, we know everything.\n String[] tmp = new String[3];\n tmp[yrPos] = yrFmt;\n tmp[dayPos] = \"dd\"; //$NON-NLS-1$\n for (int i=0; i<tmp.length; i++) {\n fmt.append(i>0?\"/\":\"\"); //$NON-NLS-1$ //$NON-NLS-2$\n fmt.append(tmp[i] == null ? \"MM\":tmp[i]); //$NON-NLS-1$\n }\n if (log4j.isDebugEnabled()) {log4j.debug(BaseMessages.getString(PKG, \"MVSFileParser.DEBUG.Guess.Date.Obvious\"));} //$NON-NLS-1$\n } else {\n // OK, we have something like 2010/01/01 - I can't\n // tell month from day. So, we'll guess. If it doesn't work on a later\n // date, we'll flip it (the alternate).\n \n StringBuffer altFmt = new StringBuffer();\n if (yrPos == 0) {\n fmt.append(yrFmt).append(\"/MM/dd\"); //$NON-NLS-1$\n altFmt.append(yrFmt).append(\"/dd/MM\"); //$NON-NLS-1$\n } else {\n fmt.append(\"MM/dd/\").append(yrFmt); //$NON-NLS-1$\n altFmt.append(\"dd/MM/\").append(yrFmt); //$NON-NLS-1$\n }\n this.alternateFormatString = altFmt.toString();\n if (log4j.isDebugEnabled()) {log4j.debug(BaseMessages.getString(PKG, \"MVSFileParser.DEBUG.Guess.Date.Ambiguous\"));} //$NON-NLS-1$\n }\n this.dateFormatString = fmt.toString();\n this.dateFormat = new SimpleDateFormat(dateFormatString);\n if (log4j.isDebugEnabled()) {log4j.debug(BaseMessages.getString(PKG, \"MVSFileParser.DEBUG.Guess.Date.Decided\", this.dateFormatString));} //$NON-NLS-1$\n try {\n dateFormat.parse(dateStr);\n } catch (ParseException ex) {\n if (log4j.isDebugEnabled()) {log4j.debug(BaseMessages.getString(PKG, \"MVSFileParser.DEBUG.Guess.Date.Unparsable\", dateStr));} //$NON-NLS-1$\n }\n } else {\n // looks ilke something like 01/02/05 - where's the year?\n if (log4j.isDebugEnabled()) {log4j.debug(BaseMessages.getString(PKG, \"MVSFileParser.DEBUG.Guess.Date.Year.Ambiguous\"));} //$NON-NLS-1$\n return;\n }\n \n }", "public static Date strToDate(String strDate)\r\n/* 127: */ {\r\n/* 128:178 */ SimpleDateFormat formatter = new SimpleDateFormat(\"yyyyMMdd\");\r\n/* 129:179 */ ParsePosition pos = new ParsePosition(0);\r\n/* 130:180 */ Date strtodate = formatter.parse(strDate, pos);\r\n/* 131:181 */ return strtodate;\r\n/* 132: */ }", "static String timeConversion(String s) {\n /*\n * Write your code here.\n */\n String conversion = \"\";\n String time = s.substring(s.length()-2,s.length());\n String hour = s.substring(0,2);\n if(time.equals(\"AM\")){\n if(Integer.parseInt(hour)==12){\n conversion = \"00\"+s.substring(2,s.length()-2);\n }\n else{\n conversion = s.substring(0,s.length()-2);\n }\n }else{\n if(Integer.parseInt(hour)==12){\n conversion = \"12\"+s.substring(2,s.length()-2);\n }\n else{\n conversion = (Integer.parseInt(hour)+12) + s.substring(2,s.length()-2);\n }\n }\n\n return conversion;\n }", "@Override\n\tpublic Date convert(String source) {\n\t\tif (StringUtils.isValid(source)) {\n\t\t\tDateFormat dateFormat;\n\t\t\tif (source.indexOf(\":\") != -1) {\n\t\t\t\tdateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t\t\t} else {\n\t\t\t\tdateFormat = new SimpleDateFormat(\"yyyy-MM-dd\"); \n\t\t\t}\n\t\t\t//日期转换为严格模式\n\t\t dateFormat.setLenient(false); \n\t try {\n\t\t\t\treturn dateFormat.parse(source);\n\t\t\t} catch (ParseException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} \n\t\t}\n\t\treturn null;\n\t}", "public static String convertDateFormat(String date) {\n DateFormat originalFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\n DateFormat targetFormat = new SimpleDateFormat(\"MMMM dd, yyyy\", Locale.ENGLISH);\n Date oldDate;\n try {\n oldDate = originalFormat.parse(date);\n } catch (ParseException e) {\n e.printStackTrace();\n return null;\n }\n return targetFormat.format(oldDate);\n }", "public Timestamp changeDateFormat(String inputDate) {\n String input = inputDate;\n\n String INPUT_FORMAT = \"yyyy-MM-dd\";\n String OUTPUT_FORMAT = \"yyyy-MM-dd HH:mm:ss.SSS\";\n\n DateFormat inputFormatter = new SimpleDateFormat(INPUT_FORMAT);\n DateFormat outputFormatter = new SimpleDateFormat(OUTPUT_FORMAT);\n\n java.util.Date date = null;\n String output = null;\n Timestamp ts = null;\n try {\n date = inputFormatter.parse(input);\n\n output = outputFormatter.format(date);\n\n ts = Timestamp.valueOf(output);\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return ts;\n }", "private Date stringToDate(String s) throws ParseException{\r\n\t\tSimpleDateFormat fmt = new SimpleDateFormat(DATE_FORMAT);\r\n\t\treturn fmt.parse(s);\r\n\t}", "private String validateDateString(String dateString) {\n String returnValue = null;\n DateFormat dateFormat1 = new SimpleDateFormat(\"yyyy-MM-dd\");\n DateFormat dateFormat2 = new SimpleDateFormat(\"yyyy-MM\");\n DateFormat dateFormat3 = new SimpleDateFormat(\"yyyy\");\n Date date = null;\n \n if (dateString == null || dateString.equals(\"\")) {\n return dateString;\n }\n else {\n try {\n date = dateFormat1.parse(dateString);\n returnValue = dateFormat1.format(date);\n }\n catch (ParseException e1) {\n try {\n date = dateFormat2.parse(dateString);\n returnValue = dateFormat2.format(date);\n }\n catch (ParseException e2) {\n try {\n date = dateFormat3.parse(dateString);\n returnValue = dateFormat3.format(date);\n }\n catch (ParseException e3) {\n logger.warn(\"Couldn't parse date string using any of the recognized formats: \" + dateString);\n } \n }\n }\n }\n \n return returnValue;\n }", "public static String formartDateMpesa(String mDate) {\n\t\t\tSimpleDateFormat inSDF = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\n\t\t\tSimpleDateFormat outSDF = new SimpleDateFormat(\"dd-MM-yyyy\");\n\n\t\t\t String outDate = \"\";\n\t\t\t if (mDate != null) {\n\t\t\t try {\n\t\t\t Date date = inSDF.parse(mDate);\n\t\t\t outDate = outSDF.format(date);\n\t\t\t } catch (Exception ex){ \n\t\t\t \tex.printStackTrace();\n\t\t\t }\n\t\t\t }\n\t\t\t return outDate;\n\t\t}", "private static Date convertFromString(String dateString) throws ParseException {\n return new SimpleDateFormat(\"yyyyMMddHHmm\").parse(dateString);\n }", "public static String checkDateTime(String dateTimeDetails) {\n try {\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"MMM d yyyy HH:mm\");\n LocalDateTime dateTime = LocalDateTime.parse(dateTimeDetails);\n dateTimeDetails = dateTime.format(formatter);\n } catch (java.time.format.DateTimeParseException e) {\n Ui.printInvalidDateTimeErrorMessage();\n }\n return dateTimeDetails;\n }", "private LocalDateTime parseDate(String s) {\n String[] splitDate = s.split(\" \", 2);\n // Split day, month, year\n String[] splitDateElements = splitDate[0].split(\"/\", 3);\n int day = parseInt(splitDateElements[0]);\n int month = parseInt(splitDateElements[1]);\n int year = parseInt(splitDateElements[2]);\n // Split hours and minutes\n int hours = parseInt(splitDate[1].substring(0, 2));\n int mins = parseInt(splitDate[1].substring(2, 4));\n return LocalDateTime.of(year, month, day, hours, mins);\n }", "public static Date parse(String input) throws java.text.ParseException {\n\t\treturn new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss.S\").parse(input);\n\n\t}", "public static Date StringToDate(String dateString) {\n int y = new Integer(dateString.substring(0, 4));\n int m = new Integer(dateString.substring(4, 6));\n int d = new Integer(dateString.substring(6, 8));\n int h = new Integer(dateString.substring(8, 10));\n int min = new Integer(dateString.substring(10, 12));\n\n try {\n Calendar convCal = Calendar.getInstance();\n convCal.set(y, m - 1, d, h, min);\n Date date = convCal.getTime();\n\n return date;\n } catch (Exception ex) {\n System.out.println(\"BwInfo.convertStringToDate() \" + ex);\n return null;\n }\n\n }", "private String formatDate(String dateStr) {\n try {\n SimpleDateFormat fmt = new SimpleDateFormat(Properties.DATE_FORMAT_ALL);\n Date date = fmt.parse(dateStr);\n SimpleDateFormat fmtOut = new SimpleDateFormat(Properties.DATE_FORMAT);\n return fmtOut.format(date);\n } catch (ParseException e) {\n System.out.println( Properties.K_WARNING + \" \" + e.getMessage());\n }\n return \"\";\n }", "@Override\r\n\tpublic Time convert(String input, Class<? extends Time> targetType,\r\n\t\t\tCollection<ValidationError> errors) {\r\n\r\n\t\tinput = input.trim();\r\n\r\n\t\tDate date = null;\r\n\r\n\t\tfor (DateFormat format : this.formats) {\r\n\t\t\ttry {\r\n\t\t\t\tdate = format.parse(input);\r\n\t\t\t\tbreak;\r\n\t\t\t} catch (ParseException pe) {} /* Do nothing, we'll get lots of these. */\r\n\t\t}\r\n\t\t\r\n\t\t// If we successfully parsed, convert date to time and return, \r\n\t\t// otherwise send back an error\r\n\t\tif (date != null) {\r\n\t\t\treturn new Time(date.getTime());\r\n\t\t} else {\r\n\t\t\terrors.add(new ScopedLocalizableError(\"converter.time\",\"invalidTime\"));\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "public static String formatDate(String strDate) {\n return formatDate(strDate, false);\n }", "public static String parseStringDate(String s, String myPattern) {\n\n\t\tString pattern = \"\";\n\t\tLocale locale = null;\n\t\tif (s.indexOf(':') >= 0) {\n\t\t\tif (s.length() > 23) {\n\n\t\t\t\tpattern = \"EEE MMM dd HH:mm:ss Z yyyy\";\n\t\t\t\tlocale = Locale.ENGLISH;\n\n\t\t\t} else if (s.length() > 20) {\n\n\t\t\t\tpattern = \"yyyy-MM-dd HH:mm:ss.SSS\";\n\n\t\t\t} else {\n\t\t\t\tpattern = DD_MM_YYYY_HH_MM_SS;\n\n\t\t\t}\n\t\t} else {\n\t\t\tpattern = DD_MM_YYYY;\n\t\t}\n\n\t\tSimpleDateFormat sdfSource = null;\n\t\tif (pattern.length() > 23) {\n\t\t\tsdfSource = new SimpleDateFormat(pattern, locale);\n\t\t} else {\n\t\t\tsdfSource = new SimpleDateFormat(pattern);\n\t\t}\n\n\t\tDate date = null;\n\t\ttry {\n\t\t\tdate = sdfSource.parse(s);\n\t\t} catch (ParseException e) {\n\t\t\tLOGGER.error(e);\n\t\t}\n\n\t\tSimpleDateFormat sdfDestination = new SimpleDateFormat(myPattern);\n\n\t\treturn sdfDestination.format(date);\n\t}", "public String convertDateFormate(String dt) {\n String formatedDate = \"\";\n if (dt.equals(\"\"))\n return \"1970-01-01\";\n String[] splitdt = dt.split(\"-\");\n formatedDate = splitdt[2] + \"-\" + splitdt[1] + \"-\" + splitdt[0];\n \n return formatedDate;\n \n }", "public static String formatMonth(String time) {\n Date tempTime = DateUtils.parseStringToDateYYMMDD(time);\n DateFormat format = new SimpleDateFormat(MONTH);\n return format.format(tempTime);\n }", "private String YYYYMMDD(String str) {\n\t\tString[] s = str.split(\"/\");\n\t\treturn s[0] + parseToTwoInteger(Integer.parseInt(s[1].trim())) + parseToTwoInteger(Integer.parseInt(s[2].trim()));\n\t}", "public static void main(String[] args) throws ParseException {\n\n\t\tString startPattern = \"MMM yyyy\";\n\n\t\tString endPattern = \"MM-dd-yyyy\";\n\n\t\tString str = formateDate(\"mar 2019\", startPattern, endPattern);\n\t\tSystem.out.println(str);\n\n\t}", "public static String getFormattedMonthDay(String dateStr){\n\n Pattern fixDate = Pattern.compile(\"(\\\\d{4})(\\\\d{1,2})(\\\\d{1,2})\");\n Matcher correctDate = fixDate.matcher(dateStr);\n correctDate.find();\n\n String Nowiscorrect = String.format(\"%s/%s/%s\",\n correctDate.group(1),\n correctDate.group(2),\n correctDate.group(3));\n\n String MonthAndDay = currentDate.getdateWithMonthLetters(Nowiscorrect);\n\n\n Pattern rtl_CHARACTERS = Pattern.compile(\"^[۱-۹]+\");\n Matcher findTheYear = rtl_CHARACTERS.matcher(MonthAndDay);\n boolean isDone = findTheYear.find();\n\n return isDone ? findTheYear.replaceAll(\"\") : \"\";\n\n }", "public static Date stringToDate(String dateString) {\n for(String format: DATE_FORMATS){\n try {\n return new SimpleDateFormat(format).parse(dateString);\n }\n catch (Exception e){}\n }\n throw new IllegalArgumentException(\"Date is not parsable\");\n }", "private static void m1() {\n\n String d = \"2019/03/22 10:00-11:00\";\n DateFormat df = new SimpleDateFormat(\"yyyy/MM/dd HH:mm-HH:mm\");\n try {\n Date parse = df.parse(d);\n System.out.println(df.format(parse));\n } catch (ParseException e) {\n e.printStackTrace();\n }\n }", "public static String getddmmyyDate(String dt) {\n String dd = \"\", mm = \"\", yy = \"\";\n int i = 0;\n try {\n for (String retval : dt.split(\"-\")) {\n if (i == 0)\n yy = retval;\n else if (i == 1)\n mm = retval;\n else\n dd = retval;\n\n i++;\n }\n return (yy + \"-\" + mm + \"-\" + dd).toString();\n } catch (Exception e) {\n e.printStackTrace();\n return \"\";\n }\n }", "public static Date convert_string_time_into_original_time(String hhmmaa) {\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"HH:mm aa\");\n Date convertedDate = new Date();\n try {\n convertedDate = dateFormat.parse(hhmmaa);\n } catch (ParseException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n return convertedDate;\n }", "private String convertToMdy(String fechaDocumento)\n {\n String ahnio = fechaDocumento.substring(0, 4);\n String mes = fechaDocumento.substring(4, 6);\n String dia = fechaDocumento.substring(6, 8);\n \n return String.format( \"%s-%s-%s\", ahnio, mes, dia );\n }", "public static long getTimeFromString(String flightDate, String hhmmString) throws ParseException {\n\n\t\tif(hhmmString.length() == 3){\n\t\t\thhmmString = \"0\"+hhmmString;\n\t\t}else if(hhmmString.length() == 2) {\n\t\t\thhmmString = hhmmString + \"00\";\n\t\t}else if(hhmmString.length() == 1) {\n\t\t\thhmmString = hhmmString + \"000\";\n\t\t}\n\t\tString fomrattedDate = flightDate + \" \" + hhmmString.substring(0,2) + \":\" + hhmmString.substring(2);\n\t\tDate date;\n\t\tif(flightDate.contains(\"-\")) { \n\t\t\tdate = format2.parse(fomrattedDate);\n\t\t}\n\t\telse { \n\t\t\tdate = format1.parse(fomrattedDate);\n\t\t}\n\t\treturn date.getTime();\n\n\t}", "public Date parse (String dateAsString , String dateFormat) throws Exception ;", "public static Date FormatStringToDate(String dateString) {\r\n SimpleDateFormat dF = new SimpleDateFormat(\"dd/mm/yyyy HH:mm:ss\");\r\n Date date = null;\r\n try {\r\n date = dF.parse(dateString);\r\n } catch (ParseException e) {\r\n e.printStackTrace();\r\n }\r\n return date;\r\n }", "public static Date stringToTime(String time)\r\n/* 43: */ {\r\n/* 44: */ try\r\n/* 45: */ {\r\n/* 46: 54 */ return sdfTime.parse(time);\r\n/* 47: */ }\r\n/* 48: */ catch (ParseException e)\r\n/* 49: */ {\r\n/* 50: 56 */ log.fatal(\"DateUtil.stringToTime抛出异常\", e);\r\n/* 51: */ }\r\n/* 52: 57 */ return new Date();\r\n/* 53: */ }", "static String timeConversion(String s) {\n String[] timeSplit = s.split(\":\");\n String hours = timeSplit[0];\n String minutes = timeSplit[1];\n String seconds = timeSplit[2].substring(0, 2);\n String ampm = timeSplit[2].substring(2, 4);\n\n String newHours;\n if (ampm.equals(\"AM\")) {\n newHours = hours.equals(\"12\") ? \"00\" : hours;\n\n } else {\n newHours = hours.equals(\"12\") ? hours : String.valueOf(Integer.parseInt(hours) + 12);\n }\n\n return newHours + \":\" + minutes + \":\" + seconds;\n\n }", "public static String toHH_MM(String draftDate) {\r\n\t\tif (draftDate == null || draftDate.length() < 19) {\r\n\t\t\treturn draftDate;\r\n\t\t}\r\n\t\treturn draftDate.substring(11, 16);\r\n\t}", "static String timeConversion1(String s) {\n String[] timeSplit = s.split(\":\");\n String hours = timeSplit[0];\n String minutes = timeSplit[1];\n String seconds = timeSplit[2].substring(0, 2);\n String ampm = timeSplit[2].substring(2);\n\n int hour = Integer.parseInt(hours);\n\n int differential = 0;\n if (\"PM\".equals(ampm) && hour != 12) {\n differential = 12;\n }\n\n\n hour += differential;\n hour = hour % 24;\n\n hours = String.format(\"%02d\", hour);\n\n return hours + \":\" + minutes + \":\" + seconds;\n\n }", "public static Date convert(String timeString){\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"dd/MMM/yyyy:HH:mm:ss ZZZZ\");\n // set default timezone to be runtime independent\n TimeZone.setDefault(TimeZone.getTimeZone(\"UTC\"));\n try {\n return dateFormat.parse(timeString);\n } catch (ParseException e) {\n LOGGER.log(Level.SEVERE, \"Date cannot be parsed: \"+ timeString, e);\n return null;\n }\n }", "public static String formatDateTime(String date) {\n\t\tif(date == null) return \"\";\n\t\tdate = date.trim();\n\t\tif(date.equals(\"&nbsp;\")) return \"\";\n\t\tif (date.length() == 0 || date.length() != 14) return date;\n\t\tdate = date.substring(0,4) + \"/\" + date.substring(4,6) \n\t\t\t\t+ \"/\" + date.substring(6,8)\n\t\t\t\t+\" \"+date.substring(8,10)\n\t\t\t\t+\":\"+date.substring(10,12)\n\t\t\t\t+\":\"+date.substring(12,14);\n\t\treturn date;\n\t}", "private void monthFormat() {\n\t\ttry {\n\t\t\tString currentMonth = monthFormat.format(new Date()); //Get current month\n\t\t\tstartDate = monthFormat.parse(currentMonth); //Parse to first of the month\n\t\t\tString[] splitCurrent = currentMonth.split(\"-\");\n\t\t\tint month = Integer.parseInt(splitCurrent[0]) + 1; //Increase the month\n\t\t\tif (month == 13) { //If moving to next year\n\t\t\t\tint year = Integer.parseInt(splitCurrent[1]) + 1;\n\t\t\t\tendDate = monthFormat.parse(\"01-\" + year);\n\t\t\t} else {\n\t\t\t\tendDate = monthFormat.parse(month + \"-\" + splitCurrent[1]);\n\t\t\t}\n\t\t\t//Create SQL times\n\t\t\tstartDateSQL = new java.sql.Date(startDate.getTime());\n\t\t\tendDateSQL = new java.sql.Date(endDate.getTime());\n\t\t\tmonthString = new SimpleDateFormat(\"MMMM\").format(startDate);\n\t\t} catch (ParseException e) {\n\t\t\t_.log(Level.SEVERE, GameMode.Sonic, \"Failed to parse dates. Monthly leaderboard disabled.\");\n\t\t}\n\t}", "private String covertTo12hrFormat(String hoursString, String minutesString, boolean showMeridiem) {\n\t\tint hours = Integer.parseInt(hoursString);\n\t\t//If hours valued > 12 will return hours differed by 12 and preceded by string PM\n\t\tif(hours>12)\n\t\t{\n\t\t\thours=hours-12;\n\t\t\t\n\t\t\treturn hours+ \":\" + minutesString +( showMeridiem ? \" \"+getAM_PM_Locale(\"PM\")+\"\" : \"\");\n\t\t\t//return ( hours<10 ? ( \"0\" + hours) : hours ) + \":\" + minutesString +( showMeridiem ? \" PM\" : \"\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t/*\n\t\t\t * If hours value = 0 will return hours as 12 and preceded by string PM\n\t\t\t * If hours value = 12 will return hours and preceded by string AM\n\t\t\t * If hours value < 12 will return hours and preceded by string AM\n\t\t\t */\n\t\t\tif(hours==0)\n\t\t\t\treturn \"12:\" + minutesString +( showMeridiem ? \" \"+getAM_PM_Locale(\"AM\")+\"\" : \"\");\n\t\t\telse if( hours == 12)\n\t\t\t\treturn hours + \":\" + minutesString +( showMeridiem ? \" \"+getAM_PM_Locale(\"PM\")+\"\" : \"\");\n\t\t\telse\n\t\t\t\treturn hours + \":\" + minutesString +( showMeridiem ? \" \"+getAM_PM_Locale(\"AM\")+\"\" : \"\");\n\t\t\t\t//return ( hours<10 ? ( \"0\" + hours) : hours ) + \":\" + minutesString +( showMeridiem ? \" AM\" : \"\");\n\t\t}\n\n\t}", "public static String convertDate(String inputdate, String fromtimezone, String totimezone)\n\n {\n String sDateinto = \"\";\n try {\n SimpleDateFormat formatter = new SimpleDateFormat(DATE_FORMAT);\n\n String dateInString = inputdate.substring(0, 22) ;\n\n formatter.setTimeZone(TimeZone.getTimeZone(fromtimezone));\n Date date = formatter.parse(dateInString);\n Log.i(\"FromDate String : \", formatter.format(date));\n\n\n SimpleDateFormat totime = new SimpleDateFormat(DATE_FORMAT);\n //TimeZone tzlocaltime = TimeZone.getDefault();\n totime.setTimeZone(TimeZone.getTimeZone(totimezone));\n\n sDateinto = totime.format(date); // Convert to String first\n Date dateInTo = formatter.parse(sDateinto); // Create a new Date object\n\n // Log.i(\"ToDate String: \", sDateinto);\n Log.i(\"ToDate Object: \", formatter.format(dateInTo));\n return sDateinto ;\n }\n catch (ParseException e)\n {\n Log.i(\"Date Conversion\" ,\"Error in parsing\" );\n return \"Date parsing error\" ;\n }\n\n }", "public void parseDate(String d)\n {\n\tdate.set(d);\n String [] dateList = d.split(\"-\");\n \n year.set(Integer.valueOf(dateList[0]));\n month.set(Integer.valueOf(dateList[1]));\n day.set(Integer.valueOf(dateList[2]));\n }", "public String getMonth(String x){\n\n if(x.contains(\"Apr\")){\n return \"April\";\n }\n else if(x.contains(\"Mar\")){\n return \"March\";\n }\n else if(x.contains(\"Jan\")){\n return \"January\";\n }\n else if(x.contains(\"Feb\")){\n return \"February\";\n }\n else if(x.contains(\"May\")){\n return \"May\";\n }\n else if(x.contains(\"Jun\")){\n return \"June\";\n }\n else if(x.contains(\"Jul\")){\n return \"July\";\n }\n else if(x.contains(\"Aug\")){\n return \"August\";\n }\n else if(x.contains(\"Sep\")){\n return \"September\";}\n else if(x.contains(\"Oct\")){\n return \"October\";}\n else if(x.contains(\"Nov\")){\n return \"November\";}\n else{\n return \"December\";}\n }", "Date HTMLDateToDatetime(String s)\n\t{\n\t\ttry\n\t\t{\n\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"EEE, dd MMM yyyy HH:mm:ss z\", java.util.Locale.US);\n\t\t\tjava.util.TimeZone tz = java.util.TimeZone.getTimeZone(\"GMT\");\n\t\t\tsdf.setTimeZone(tz);\n\t\t\treturn sdf.parse(s);\n\t\t\t\n\t\t}\n\t\tcatch(ParseException p)\n\t\t{\n\t\t\tlogger.warn(\"Could not parse RFC Date\", p);\n\t\t\treturn new Date();\n\t\t}\n\t}", "public String convertCalendarDateFormatFromNumbersToMonthDayComaYear(String stringDate) throws ParseException {\n\t\t\t\tDateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\t\t\tDate date = formatter.parse(stringDate);\n\t\t\t\tlong mills = date.getTime();\n\t\t\t\tformatter = new SimpleDateFormat(\"MMM dd, yyyy\");\n\t\t\t\tdate = new Date(mills);\n\t\t\t\treturn formatter.format(date);\n\t\t\t}", "static String timeConversion(String s) {\n /*\n * Write your code here.\n */\n String res = \"\";\n String hrs = s.substring(0, 2);\n String min = s.substring(3, 5);\n String sec = s.substring(6, 8);\n String ampm = s.substring(8);\n int hr = Integer.parseInt(hrs);\n if((ampm.equalsIgnoreCase(\"PM\")) && (hr != 12)) {\n hr += 12;\n if(hr >= 24) {\n hr = 24 - hr;\n }\n }\n else if(ampm.equalsIgnoreCase(\"AM\")) {\n if(hr == 12) {\n hr = 0;\n }\n }\n if(hr < 10) {\n res = res + \"0\" + Integer.toString(hr);\n }\n else {\n res += Integer.toString(hr);\n }\n res = res +\":\" +min +\":\" + sec;\n return res;\n }", "public static String convertTo12HoursFormat(String twentyFourHourTime)\n throws ParseException {\n return TWELVE_TF.format(TWENTY_FOUR_TF.parse(twentyFourHourTime));\n }", "public static Date toDateFormat_2(String dateString) {\r\n\t\treturn stringToDate(dateString, DATE_FORMAT_2);\r\n\t}", "public static String convertToDateStringWithsdf(String unformateddate, SimpleDateFormat sdf) {\n Date date = null;\n String dateStr = unformateddate;\n try {\n\n date = sdf.parse(unformateddate);\n dateStr = new SimpleDateFormat(\"dd MMM yyyy\").format(date);\n } catch (Exception e) {\n // TODO: handle exception\n e.printStackTrace();\n }\n\n return dateStr;\n }", "public static Date stringToDate(String date)\r\n/* 29: */ {\r\n/* 30: 39 */ log.debug(\"DateUtil.stringToDate()\");\r\n/* 31: */ try\r\n/* 32: */ {\r\n/* 33: 41 */ return sdfDate.parse(date);\r\n/* 34: */ }\r\n/* 35: */ catch (ParseException e)\r\n/* 36: */ {\r\n/* 37: 43 */ log.fatal(\"DateUtil.stringToDate抛出异常\", e);\r\n/* 38: */ }\r\n/* 39: 44 */ return new Date();\r\n/* 40: */ }", "public static Date convertirStringADateUtil(String s){\n\t\tFORMATO_FECHA.setLenient(false);\n\t\tDate fecha = null;\n\t\ttry {\n\t\t\tfecha = FORMATO_FECHA.parse(s);\n\t\t} catch (ParseException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn fecha;\n\t}", "public static String formartDate(String mDate) {\n\t\t\t// TODO Auto-generated method stub\n\t\t\t\n\t\t\tSimpleDateFormat inSDF = new SimpleDateFormat(\"mm/dd/yyyy\");\n\t\t\t SimpleDateFormat outSDF = new SimpleDateFormat(\"yyyy-mm-dd\");\n\n\t\t\t \n\t\t\t String outDate = \"\";\n\t\t\t \n\t\t\t if (mDate != null) {\n\t\t\t try {\n\t\t\t Date date = inSDF.parse(mDate);\n\t\t\t outDate = outSDF.format(date);\n\t\t\t \n\t\t\t \n\t\t\t } catch (Exception ex){ \n\t\t\t \tex.printStackTrace();\n\t\t\t }\n\t\t\t }\n\t\t\t return outDate;\n\t\t}", "public static Date converteStringInvertidaSemBarraAAAAMMDDParaDate(String data) {\r\n\t\tDate retorno = null;\r\n\r\n\t\tString dataInvertida = data.substring(6, 8) + \"/\" + data.substring(4, 6) + \"/\" + data.substring(0, 4);\r\n\r\n\t\tSimpleDateFormat dataTxt = new SimpleDateFormat(\"dd/MM/yyyy\");\r\n\r\n\t\ttry {\r\n\t\t\tretorno = dataTxt.parse(dataInvertida);\r\n\t\t} catch (ParseException e) {\r\n\t\t\tthrow new IllegalArgumentException(data + \" não tem o formato dd/MM/yyyy.\");\r\n\t\t}\r\n\t\treturn retorno;\r\n\t}", "public static String timeFormatConvert(String fromFormat1, String toFormat2, String time) {\n\t\tString datestr = \"\";\n\t\t\n\t\tif(time!=null && time.trim().length()==fromFormat1.length())\n\t\t{\n\t\t\ttry {\n\t\t\t\tSimpleDateFormat sdf = new SimpleDateFormat(fromFormat1/* \"yyyy MMM dd HH:mm:ss\" */, Locale.US);\n\t\t\t\tDate date = sdf.parse(time);\n\t\t\t\tsdf = new SimpleDateFormat(toFormat2/* \"yyyyMMddHHmmss\" */);\n\t\t\t\tdatestr = sdf.format(date);\n\t\t\t} catch (Exception ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t\tSystem.out.println(\"fromFormat1=\"+fromFormat1+\" time=\"+time);\n\t\treturn datestr;\n\t}", "public static LocalDateTime parseDateTime(String input) {\n\n if (input.contains(\"Weekly\")) {\n WeeklyFlag = true;\n input = input.replace(\"Weekly\",\"\");\n }\n LocalDateTime dateTime = null;\n ArrayList<String> patterns = getPatterns(false);\n for (String pattern : patterns) {\n if (dateTime == null) {\n try {\n dateTime = LocalDateTime.parse(input.trim(), DateTimeFormatter.ofPattern(pattern));\n } catch (Exception e) {\n e.addSuppressed(new CommandException()); // do nothing basically.\n }\n } else {\n break;\n }\n }\n if (dateTime == null) {\n patterns = getPatterns(true);\n for (String datePattern : patterns) {\n if (dateTime == null) {\n try {\n dateTime = LocalDate.parse(input.trim(),\n DateTimeFormatter.ofPattern(datePattern)).atStartOfDay();\n } catch (Exception e) {\n e.addSuppressed(new CommandException()); // do nothing basically.\n }\n } else {\n break;\n }\n }\n }\n return dateTime;\n }", "public static void main(String[] args) {\n\t\t LocalDate ldt = LocalDate.of(2016,12,21);\n DateTimeFormatter format = DateTimeFormatter.ofPattern(\"yyyy-MMM-dd\");\n DateTimeFormatter format1 = DateTimeFormatter.ofPattern(\"YYYY-mmm-dd\");\n System.out.println(ldt.format(format));\n System.out.println(ldt.format(format1));\n\t}", "public static Date dateFromShortString(String dateString) {\n SimpleDateFormat fmt = new SimpleDateFormat(\"dd-MMM-yyyy\", Locale.getDefault());\n try {\n return fmt.parse(dateString);\n } catch (ParseException e) {\n e.printStackTrace();\n return new Date();\n }\n }", "private int caBeDate(String str){\n if(!isNumber(str)){\n return 0;\n }if(str.length()<2){\n return 0;\n }if(str.length()==2){\n return 1;\n }if(str.length() == 3){\n return 2;\n }if(str.length() == 4){\n return 3;\n }if(str.length()>4){\n return 6;\n }\n return 0;\n }", "private static String toDateTime(String dateSubmitted) {\n\t\tString[] extracted = dateSubmitted.split(\" \");\n\t\t\n\t\tString[] date = extracted[0].split(\"/\");\n\t\t\n\t\tif(date[0].length() == 1)\n\t\t\tdate[0] = \"0\" + date[0];\n\t\tif(date[1].length() == 1)\n\t\t\tdate[1] = \"0\" + date[1];\n\t\t\n\t\treturn date[2] + \"-\" + date[0] + \"-\" + date[1] + \" \" + extracted[1];\n\t}", "private static void checkFormat(String str) {\n if (str.length() != 8)\n throw new IllegalArgumentException(\"length has too be 8\");\n try {\n Integer.parseInt(str.substring(0,2)); //Hours\n Integer.parseInt(str.substring(3,5)); //Minutes\n } catch (NumberFormatException e) {\n throw new IllegalArgumentException(\"These numbers are wrong\");\n }\n if (str.charAt(2) != ':') {\n throw new IllegalArgumentException(\"requires colon between times\");\n }\n if (str.charAt(5) != ' ') {\n throw new IllegalArgumentException(\"requires space between time and period\");\n }\n String mStr = str.substring(6);\n if (!mStr.equals(\"PM\") && !mStr.equals(\"AM\")) {\n throw new IllegalArgumentException(\"Must be AM or PM\");\n }\n }", "@SuppressLint(\"SimpleDateFormat\") public static String parse(String date, String format){\r\n\t\ttry {\r\n\t\t\tSimpleDateFormat localFormatter= new SimpleDateFormat(format);\r\n\t\t\tlocalFormatter.setLenient(false);\r\n\t\t\tString formattedDate=localFormatter.parse(date).toString();\r\n\t\t\t\r\n\t\t\t//days, months, years\r\n\t\t\tif(format.equals(formats[0])) return convertDate(formattedDate);\r\n\t\t\t\r\n\t\t\t//hours, minutes, seconds\r\n\t\t\telse if(format.equals(formats[1])) return convertHoursMinsSecs(formattedDate);\t\r\n\t\t\t\r\n\t\t\t//hours, minutes\r\n\t\t\telse if(format.equals(formats[2])) return convertHoursMins(formattedDate);\t\r\n\t\t\t\r\n\t\t\treturn \"\";\r\n\t\t\r\n\t\t} catch (ParseException e) {\r\n\t\t\t//e.printStackTrace();\r\n\t\t\treturn \"\";\r\n\t\t}\r\n\t}", "private static String checkFormat(String date){\r\n\t\tif(date.length()==0) return \"\";\r\n\t\tint dateChars=0,timeChars=0;\r\n\t\tchar currenChar;\r\n\t\t\r\n\t\t//check if the first and the last character of the string is a number, it must always be\r\n\t\tif(!Character.isDigit(date.charAt(0))) return \"\";\r\n\t\tif(!Character.isDigit(date.charAt((date.length()-1)))) return \"\";\r\n\t\t\r\n\t\t\r\n\t\tfor(int i=1; i<date.length()-1;i++){\r\n\t\t\tcurrenChar=date.charAt(i);\r\n\t\t\t\r\n\t\t\t//check if every character is / or : or number\t\t\r\n\t\t\tif(!(Character.isDigit(currenChar) || currenChar==':' || currenChar=='/')) return \"\";\r\n\t\t\t//check if there is a number between // or ::, if not it returns false\r\n\t\t\tif((currenChar==':' || currenChar=='/') && (date.charAt(i+1)==':' || date.charAt(i+1)=='/')) return \"\";\r\n\t\t\t\r\n\t\t\t//count the / and :\r\n\t\t\tif(currenChar==':') timeChars++; \r\n\t\t\telse if(currenChar=='/') dateChars++;\r\n\t\t}\r\n\t\t\r\n\t\t//if it is time with one :\r\n\t\tif(timeChars==1 && dateChars==0){\r\n\t\t\t//check if one of the numbers has more than 2 digits, then it is invalid\r\n\t\t\tint index=0;\r\n\t\t\tfor(String s:splitWords(date.replaceAll(\":\", \" \"))){\r\n\t\t\t\tif( index==0 && s.length()!=1 && s.length()!=2) return \"\";\r\n\t\t\t\telse if(index>0 && s.length()!=2 ) return \"\";\r\n\t\t\t\tindex++;\r\n\t\t\t}\r\n\r\n\t\t\treturn formats[2];\r\n\t\t}\r\n\t\t\r\n\t\t//if it is time with two :\r\n\t\telse if(timeChars==2 && dateChars==0){\r\n\t\t\t//check if one of the numbers has more than 2 digits, then it is invalid\r\n\t\t\tint index=0;\r\n\t\t\tfor(String s:splitWords(date.replaceAll(\":\", \" \"))){\r\n\t\t\t\tif( index==0 && s.length()!=1 && s.length()!=2) return \"\";\r\n\t\t\t\telse if(index>0 && s.length()!=2 ) return \"\";\r\n\t\t\t\tindex++;\r\n\t\t\t}\r\n\r\n\t\t\treturn formats[1];\r\n\t\t}\r\n\t\t\r\n\t\t//if it is a date with two /\r\n\t\telse if(dateChars==2 && timeChars==0){\r\n\t\t\t//check if one of the numbers have the right amount of digits\r\n\t\t\tString[] numbers= splitWords(date.replaceAll(\"/\", \" \"));\r\n\t\t\tif(numbers[0].length()>2) return \"\";\r\n\t\t\tif(numbers[1].length()>2) return \"\";\r\n\t\t\tif(numbers[2].length()>4) return \"\";\r\n\t\t\t\r\n\t\t\treturn formats[0];\r\n\t\t}\r\n\t\t\r\n\t\telse return \"\";\t\t\r\n\t}", "public Date formatForDate(String data) throws ParseException{\n //definindo a forma da Data Recebida\n DateFormat formatUS = new SimpleDateFormat(\"dd-MM-yyyy\");\n return formatUS.parse(data);\n }", "private static String convertTime(String timeString) {\n try {\n int timeIn24hRepresentation = Integer.parseInt(timeString);\n int hours = timeIn24hRepresentation / 100;\n int minutes = timeIn24hRepresentation % 100;\n boolean isOutOfBounds = hours < 0 || hours > 24 || minutes < 0 || minutes > 60;\n boolean cannotConvertToTime = timeString.length() != 4;\n\n if (isOutOfBounds || cannotConvertToTime) {\n return timeString;\n } else {\n return convertTimeToStringRepresentation(hours, minutes);\n }\n } catch (NumberFormatException e) {\n return timeString;\n }\n }", "public boolean isMonth(String input){\r\n if(!isInteger(input)) return false;\r\n int month = Integer.parseInt(input);\r\n if(12 < month) return false;\r\n return true;\r\n }", "public static Date toDateFormat_1(String dateString) {\r\n\t\treturn stringToDate(dateString, DATE_FORMAT_1);\r\n\t}", "@Test\n\t@DisplayName(\"string to date\")\n\tpublic void testStringToDate() throws ParseException\n\t{\n\t\tDateConverter d = new DateConverter(string1);\n\t\t\n\t\tString dateInString = \"1997-03-19\";\n\t\tSimpleDateFormat formatter = new SimpleDateFormat(\"yyyy-MM-dd\");\n\t\ttry {\n\t\t date1 = formatter.parse(dateInString);\n\t\t} catch (ParseException e) {\n\t\t //handle exception if date is not in \"dd-MMM-yyyy\" format\n\t\t}\n\t\tassertEquals(date1, d.getDate());\n\t}" ]
[ "0.68444556", "0.6744341", "0.6692371", "0.66062033", "0.6541916", "0.651194", "0.62109613", "0.6210488", "0.6097323", "0.6016005", "0.5871649", "0.5848959", "0.58139694", "0.5775481", "0.5682097", "0.5664201", "0.565421", "0.5644746", "0.56277204", "0.5627475", "0.5620134", "0.5609979", "0.5605221", "0.5591482", "0.55802864", "0.55752283", "0.55628055", "0.5556524", "0.550946", "0.55091417", "0.5498523", "0.54680705", "0.54666716", "0.5463249", "0.5431729", "0.5422482", "0.5412648", "0.5404121", "0.53854024", "0.53778595", "0.53594655", "0.5353714", "0.5350884", "0.5335877", "0.5321424", "0.5307839", "0.5304275", "0.5283324", "0.5268936", "0.52530235", "0.5252677", "0.525188", "0.5232038", "0.5230745", "0.5218155", "0.5215802", "0.5202217", "0.51709473", "0.51628083", "0.51600635", "0.51542366", "0.51457846", "0.5138631", "0.51383036", "0.51146454", "0.51135856", "0.51121926", "0.51051474", "0.5103568", "0.5096095", "0.50861603", "0.5075266", "0.5063927", "0.50521916", "0.5052112", "0.50418776", "0.5030144", "0.5029187", "0.50252086", "0.5021627", "0.5011871", "0.50113815", "0.5009046", "0.50043166", "0.49954805", "0.49868333", "0.49860287", "0.49831042", "0.4967849", "0.4964001", "0.49541056", "0.49486583", "0.49480665", "0.49392945", "0.49371094", "0.49349922", "0.4928731", "0.49246907", "0.49155068", "0.49111065" ]
0.7301813
0
Compares two string by their ASCII values, and returns either 0, 1, or 1.
public static int compareString(String firstString, String secondString) { if (isEmptyString(firstString) || isEmptyString(secondString)) { if (isEmptyString(firstString) && isEmptyString(secondString)) { return 0; } else if (isEmptyString(firstString)) { return 1; } else if (isEmptyString(secondString)) { return -1; } } char charOfFirst = firstString.charAt(0); char charOfSecond = secondString.charAt(0); int result = compareChar(charOfFirst, charOfSecond); if (result == 0) { return compareString(firstString.substring(1), secondString.substring(1)); } return result; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected int stringCompare(String s1,String s2)\r\n\t{\r\n\t\tint shortLength=Math.min(s1.length(), s2.length());\r\n\t\tfor(int i=0;i<shortLength;i++)\r\n\t\t{\r\n\t\t\tif(s1.charAt(i)<s2.charAt(i))\r\n\t\t\t\treturn 0;\r\n\t\t\telse if(s1.charAt(i)>s2.charAt(i))\r\n\t\t\t\treturn 1;\t\r\n\t\t}\r\n\t\t//if the first shrotLenghtTH characters of s1 and s2 are same \r\n\t\tif(s1.length()<=s2.length()) //it's a close situation. \r\n\t\t\treturn 0;\r\n\t\telse \r\n\t\t\treturn 1; \r\n\t\t\r\n\t}", "private static int cmp( String str1, String str2 )\n \t\t{\n \t\t\tif ( str1==null && str2==null )\n \t\t\t\treturn 0;\n \t\t\tif ( str1==null )\n \t\t\t\treturn -1;\n \t\t\tif ( str2==null )\n \t\t\t\treturn 1;\n \t\t\t\n \t\t\tint p1 = 0;\n \t\t\tint p2 = 0;\n \t\t\tfor ( ;; ) {\n \t\t\t\tif ( p1>=str1.length() ) {\n \t\t\t\t\tif ( p2>=str2.length() )\n \t\t\t\t\t\treturn 0;\n \t\t\t\t\treturn 1;\n \t\t\t\t}\n \t\t\t\tif ( p2>=str2.length() )\n \t\t\t\t\treturn -1;\n \t\t\t\tchar ch1 = str1.charAt(p1);\n \t\t\t\tchar ch2 = str2.charAt(p2);\n \t\t\t\tif ( ch1>='0' && ch1<='9' && ch2>='0' && ch2<='9' ) {\n \t\t\t\t\tint n1 = 0;\n \t\t\t\t\tint n2 = 0;\n \t\t\t\t\twhile ( ch1>='0' && ch1<='9' ) {\n \t\t\t\t\t\tp1++;\n \t\t\t\t\t\tn1 = n1 * 10 + (ch1-'0');\n \t\t\t\t\t\tif ( p1>=str1.length() )\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\tch1 = str1.charAt(p1);\n \t\t\t\t\t}\n \t\t\t\t\twhile ( ch2>='0' && ch2<='9' ) {\n \t\t\t\t\t\tp2++;\n \t\t\t\t\t\tn2 = n2 * 10 + (ch2-'0');\n \t\t\t\t\t\tif ( p2>=str2.length() )\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\tch2 = str2.charAt(p2);\n \t\t\t\t\t}\n \t\t\t\t\tint c = cmp(n1, n2);\n \t\t\t\t\tif ( c!=0 )\n \t\t\t\t\t\treturn c;\n \t\t\t\t} else {\n \t\t\t\t\tif ( ch1<ch2 )\n \t\t\t\t\t\treturn -1;\n \t\t\t\t\tif ( ch1>ch2 )\n \t\t\t\t\t\treturn 1;\n \t\t\t\t\tp1++;\n \t\t\t\t\tp2++;\n \t\t\t\t}\n \t\t\t}\n \t\t}", "private static int alphaNumericCompare( String s1, String s2 )\n\t{\n\t\tString[] words1 = splitIntoAlphasAndNums( s1 );\n\t\tString[] words2 = splitIntoAlphasAndNums( s2 );\n\t\tfor ( int j = 0; j < Math.min( words1.length, words2.length ); j++ )\n\t\t{\n\t\t\tint c;\n\t\t\tfinal String sp1 = words1[ j ];\n\t\t\tfinal String sp2 = words2[ j ];\n\n\t\t\t// First look for special alpha sequences (e.g., \"alpha\" or \"beta\" or \"rc\"):\n\t\t\tint subScore1 = calculateScore( sp1 );\n\t\t\tint subScore2 = calculateScore( sp2 );\n\t\t\tc = subScore1 - subScore2;\n\t\t\tif ( c != 0 )\n\t\t\t{\n\t\t\t\treturn c;\n\t\t\t}\n\n\t\t\t// Since splitIntoAlphasAndNums() was called, that means that if 1st char is a digit, then\n\t\t\t// all characters are digits:\n\t\t\tif ( startsWithDigit( sp1 ) || startsWithDigit( sp2 ) )\n\t\t\t{\n\t\t\t\tComparable<Long> v1 = toLong( sp1 );\n\t\t\t\tLong v2 = toLong( sp2 );\n\t\t\t\tif ( v1 != null && v2 != null )\n\t\t\t\t{\n\t\t\t\t\tc = v1.compareTo( v2 );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// null == null, and null is smaller than non-null\n\t\t\t\t\tc = v1 == v2 ? 0 : v1 == null ? -1 : 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Both are pure non-numerics, so use regular lexicographic compare:\n\t\t\t\tc = sp1.compareTo( sp2 );\n\t\t\t}\n\n\t\t\tif ( c != 0 )\n\t\t\t{\n\t\t\t\treturn c;\n\t\t\t}\n\t\t}\n\n\t\t// Last resort comparision: sub-splitting array length.\n\t\treturn words1.length - words2.length;\n\t}", "static int compare(String a, String b) {\n if (a == null) a = \"\";\n if (b == null) b = \"\";\n\n int i = 0;\n while (i < a.length() && i < b.length()) {\n char x = a.charAt(i), y = b.charAt(i);\n if (x != y) return x - y;\n i++;\n }\n return a.length() - b.length();\n }", "public int String_Compare(String A, String B) {\n\t\t\n\t\tint shorter_length;\n\t\tif(A.length() >= B.length()) {\n\t\t\tshorter_length=B.length();\n\t\t}\n\t\telse {\n\t\t\tshorter_length=A.length();\n\t\t}\n\t\t\n\n\t\t\n\t\t\n\t\tint i = 0;\n\t\tint A_char;\n\t\tint B_char;\n\t\t\n\t\twhile(i < shorter_length ) {\n\t\t\tA_char = (int)A.charAt(i);\n\t\t\tB_char = (int)B.charAt(i);\n\n\t\t\tif(A_char != B_char) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\ti+=1;\n\t\t}\n\t\treturn 0;\n\t}", "public int compare(String str1, String str2) {\n\t\t\t\ttry{\r\n\t\t\t\t\treturn Integer.parseInt(str1) - Integer.parseInt(str2) > 0 ? 1 : -1;\r\n\t\t\t\t}\r\n\t\t\t\tcatch (Exception e){\r\n\t\t\t\t\tSystem.out.print(e.getMessage());\r\n\t\t\t\t}\t\r\n\t\t\t\treturn 1;\r\n\t\t\t}", "public boolean isIsomorphic(String str1, String str2) {\r\n if(str1.length() != str2.length()) return false;\r\n \r\n int[] arr1 = new int[256];\r\n int[] arr2 = new int[256];\r\n \r\n Arrays.fill(arr1, -1);\r\n Arrays.fill(arr2, -1);\r\n \r\n for(int i=0;i<str1.length();i++){\r\n int value1 = str1.charAt(i);\r\n int value2 = str2.charAt(i);\r\n if(arr1[value1]== -1){\r\n arr1[value1] = value2;\r\n } else {\r\n if(arr1[value1] != value2) return false;\r\n }\r\n \r\n if(arr2[value2]== -1){\r\n arr2[value2] = value1;\r\n } else {\r\n if(arr2[value2] != value1) return false;\r\n }\r\n \r\n }\r\n return true;\r\n \r\n}", "public void testCompareIntegerStrings() {\n\t\tString one = 1+\"\";\n\t\tString two = 2+\"\";\n\t\t//1 ist kleiner 2\n\t\tassertTrue(comp.compareInteger(one, two) == -1);\n\t\tassertTrue(comp.compareInteger(one, one) == 0);\n\t\tassertTrue(comp.compareInteger(two, one) == 1);\n\t}", "@Override\n public int compare(String left, String right) {\n int result = 0;\n int length = left.length() > right.length()\n ? right.length() : left.length();\n for (int i = 0; i < length; i++) {\n result = Character.compare(left.charAt(i), right.charAt(i));\n if (result != 0) {\n break;\n }\n }\n if (result == 0) {\n result = left.length() - right.length();\n }\n return result;\n\n }", "public static String xor(String firstInput, String secondInput) { \n StringBuilder result = new StringBuilder();\n\n for (int i = 0; i < firstInput.length(); i++) {\n if (firstInput.charAt(i) == secondInput.charAt(i)) {\n result.append(\"0\");\n } else {\n result.append(\"1\");\n }\n }\n\n return result.toString();\n }", "@Override\npublic int compare(String first, String second) {\n\tint ans= Integer.compare(first.length(), second.length());\n\t//\n\t\n\t\n\t\n\t\n\treturn ans;\n\t//\n\t\n\t\n}", "@Test\n public void testComp1()\n {\n System.out.println(\"comp\");\n String compString = \"A+1\";\n assertEquals(\"0110111\", N2TCode.comp(compString));\n }", "public static boolean timingSafeEquals(String first, String second) {\n if (first == null) {\n return second == null;\n } else if (second == null) {\n return false;\n } else if (second.length() <= 0) {\n return first.length() <= 0;\n }\n char[] firstChars = first.toCharArray();\n char[] secondChars = second.toCharArray();\n char result = (char) ((firstChars.length == secondChars.length) ? 0 : 1);\n int j = 0;\n for (int i = 0; i < firstChars.length; ++i) {\n result |= firstChars[i] ^ secondChars[j];\n j = (j + 1) % secondChars.length;\n }\n return result == 0;\n }", "private int compare(String str1, String str2) {\n int result;\n\n if (str1 == null) {\n result = (str2 == null) ? 0 : -1;\n\n } else if (str2 == null) {\n result = 1;\n\n } else {\n result = str1.compareTo( str2 );\n }\n return result;\n }", "private static int strStr(String a, String b)\n\t{\n\t\tint aL=a.length();\n\t\tint bL=b.length();\n\t\tif(a.equals(b)){\n\t\t\treturn 0;\n\t\t}\n\t\tfor(int i=0;i<aL;i++){\n\t\t\tint j=i+bL;\n\t\t\tif(j<=aL){\n\t\t\t\tString subStr=a.substring(i, j);\n\t\t\t\tif(subStr.equals(b)){\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "@Test\n public void testComp2()\n {\n System.out.println(\"comp\");\n String compString = \"D+M\";\n assertEquals(\"1000010\", N2TCode.comp(compString));\n }", "public static int compareIgnoreCase(String firstString, String secondString){\n\t\tif(firstString.equalsIgnoreCase(secondString)){\n\t\t\treturn 0;\n\t\t}\n\t\tchar[] firstStringCharArray = firstString.toLowerCase().toCharArray();\n\t\tchar[] secondStringCharArray = secondString.toLowerCase().toCharArray();\n\t\tif(firstStringCharArray.length > 0 && !HaikuGenerator.isAWordCharacter(firstStringCharArray[0])\n\t\t\t\t&& secondStringCharArray.length > 0 && HaikuGenerator.isAWordCharacter(secondStringCharArray[0])){\n\t\t\t// First string starts with a non-word character (such as a number) while the second starts with a word-character (such as 'a')\n\t\t\t// -> the second string should be before the first string\n\t\t\treturn -1;\n\t\t}\n\t\tif(firstStringCharArray.length > 0 && HaikuGenerator.isAWordCharacter(firstStringCharArray[0])\n\t\t\t\t&& secondStringCharArray.length > 0 && !HaikuGenerator.isAWordCharacter(secondStringCharArray[0])){\n\t\t\t// First string starts with a word-character (such as 'a') while the second starts with a non-word character (such as a number)\n\t\t\t// -> the first string should be before the second string\n\t\t\treturn 1;\n\t\t}\n\t\tint i = 0;\n\t\twhile(true){\n\t\t\tif(firstStringCharArray[i] < secondStringCharArray[i]){\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tif(firstStringCharArray[i] > secondStringCharArray[i]){\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif(firstStringCharArray.length == i+1){\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tif(secondStringCharArray.length == i+1){\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t}", "public static int compareStrings(String s1, String s2) {\n\t if (s1 == null) {\n\t\t return (s2 == null) ? 0 : -1;\n\t } else if (s2 == null) return 1;\n\t return s1.compareTo(s2);\n }", "private int compareInternal(String shorter, String longer) {\n int lengthDiff = longer.length() - shorter.length();\n\n for (int compareStartIndexInsideLonger = 0; compareStartIndexInsideLonger <= lengthDiff; compareStartIndexInsideLonger++) {\n String compariosonPartFromLonger = longer.substring(compareStartIndexInsideLonger, compareStartIndexInsideLonger + shorter.length());\n //we have found an answer if they are not equal\n int result = shorter.compareTo(compariosonPartFromLonger);\n if (result != 0) {\n return result;\n }\n }\n\n //the are equal\n return 0;\n }", "public static int getVeryLongCompare(String a, String b) {\r\n\t\tif(a.equals(b))\r\n\t\t\treturn 0;\r\n\t\telse {\r\n\t\t\tint result = 0;\r\n\t\t\tboolean minus = false;\r\n\t\t\tif(a.charAt(0) == 45 && b.charAt(0) != 45) return -1;\r\n\t\t\tif(a.charAt(0) != 45 && b.charAt(0) == 45) return 1;\r\n\t\t\tif(a.charAt(0) == 45 && b.charAt(0) == 45) { \r\n\t\t\t\tminus = true;\r\n\t\t\t\ta = a.substring(1,a.length());\r\n\t\t\t\tb = b.substring(1,b.length());\r\n\t\t\t}\r\n\t\t\tif (a.charAt(0) == 46) a = \"0\" + a;\r\n\t\t\tif (b.charAt(0) == 46) b = \"0\" + b;\r\n\t\t\twhile(a.charAt(0) == 48 && a.charAt(1) != 46)\r\n\t\t\t\ta = a.substring(1,a.length());\r\n\t\t\twhile(b.charAt(0) == 48 && b.charAt(1) != 46)\r\n\t\t\t\tb = b.substring(1,b.length());\r\n\t\t\tboolean done = false;\r\n\t\t\tint aPointPos = a.indexOf(\".\");\r\n\t\t\tint bPointPos = b.indexOf(\".\");\r\n\t\t\tint aLength = a.length();\r\n\t\t\tint bLength = b.length();\r\n\t\t\tint aIntegerPart = aLength; \r\n\t\t\tint bIntegerPart = bLength;\r\n\t\t\tint aCurDigit = 0;\r\n\t\t\tint bCurDigit = 0;\r\n\t\t\tif (aPointPos > -1) {\r\n\t\t\t\taIntegerPart = aPointPos;\r\n\t\t\t}\r\n\t\t\tif (bPointPos > -1) {\r\n\t\t\t\tbIntegerPart = bPointPos;\r\n\t\t\t}\r\n\t\t\tif (aIntegerPart != bIntegerPart) {\r\n\t\t\t\tdone = true;\r\n\t\t\t\tif(aIntegerPart > bIntegerPart)\tresult = 1;\r\n\t\t\t\telse result = -1;\r\n\t\t\t} else {\r\n\t\t\t\tfor (int i = 0; i < aIntegerPart; i++) {\r\n\t\t\t\t\taCurDigit = a.charAt(i) - 48;\r\n\t\t\t\t\tbCurDigit = b.charAt(i) - 48;\r\n\t\t\t\t\tif(aCurDigit != bCurDigit) {\r\n\t\t\t\t\t\tdone = true;\r\n\t\t\t\t\t\tif(aCurDigit > bCurDigit) { result = 1; }\r\n\t\t\t\t\t\telse { result = -1; }\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tint maxFloatPart = Math.max(aLength - aIntegerPart - 1, bLength - bIntegerPart - 1);\r\n\t\t\t\tif(!done) {\r\n\t\t\t\t\tfor (int i = 0; i < maxFloatPart; i++) {\r\n\t\t\t\t\t\tif(aLength < aIntegerPart + i + 2) {\r\n\t\t\t\t\t\t\taCurDigit = 0;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\taCurDigit = a.charAt(aIntegerPart + i + 1) - 48;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(bLength < bIntegerPart + i + 2) {\r\n\t\t\t\t\t\t\tbCurDigit = 0;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tbCurDigit = b.charAt(bIntegerPart + i + 1) - 48;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(aCurDigit != bCurDigit) {\r\n\t\t\t\t\t\t\tdone = true;\r\n\t\t\t\t\t\t\tif(aCurDigit > bCurDigit) { result = 1; }\r\n\t\t\t\t\t\t\telse { result = -1; }\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(minus) result = 0 - result;\r\n\t\t\treturn result;\r\n\t\t}\r\n\t}", "public int compare(String[] string1, String[] string2){\r\n\t\tint returnValue = 0;\r\n\t\tint int1 = 0;\r\n\t\tint int2 = 0;\r\n\t\t\r\n\t\tfor(int i = 0; i < string1.length; i++){\r\n\t\t\ttry{\r\n\t\t\t\tint1 = Integer.parseInt(string1[i]);\r\n\t\t\t\tint2 = Integer.parseInt(string2[i]);\r\n\t\t\t\t\r\n\t\t\t\tif(int1 < int2) {\r\n\t\t\t\t\treturnValue = -1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcatch(Exception e){}\r\n\r\n\t\t}\r\n\t\treturn returnValue;\r\n\t}", "public static void main(String[] args) {\nString a = \"aab\";\nString b = \"baa\";\nSystem.out.println(compare(a,b));\n\t}", "int compareStrings(String s1, String s2) {\n if (s1 == null) {\n return s2 == null ? 0 : -1;\n } else if (caseInsensitive) {\n return s1.compareToIgnoreCase(s2);\n } else {\n return s1.compareTo(s2);\n }\n }", "public void testCompareStrings() {\n\t\tString one = \"Hello\";\n\t\tString two = \"in the house\";\n\t\t//Gro▀schreibung vor Kleinschreibung\n\t\tassertTrue(comp.compareStrings(one, two) < 0);\n\t\tassertEquals(0, comp.compareStrings(one, one));\n\t\tassertTrue(comp.compareStrings(two, one) > 0);\n\t}", "public int diff(char a, char b) {\n return (a == b ? 0 : 1);\n }", "@Override\n public int compare(String str1, String str2) {\n String digitRegex = \".*\\\\d+.*\";\n boolean hasDigits1 = str1.matches(digitRegex);\n boolean hasDigits2 = str2.matches(digitRegex);\n int result = -Boolean.valueOf(hasDigits1).compareTo(hasDigits2);\n\n if (result == 0) {\n // Secondary order: length, descending\n result = -Integer.valueOf(str1.length()).compareTo(str2.length());\n }\n\n return result;\n }", "static void cmp_with_reg(String passed){\n\t\tint val1 = hexa_to_deci(registers.get('A'));\n\t\tint val2 = hexa_to_deci(registers.get(passed.charAt(4)));\n\t\tS = val1>=val2?false:true;\n\t\tval2 = 256-val2;\n\t\tval2%=256;\n\t\tval1+=val2;\n\t\tCS = val1>255?true:false;\n\t\tString b = Integer.toBinaryString(val1);\n\t\tint ones=0;\n\t\tfor(int i=0;i<b.length();i++)\n\t\t\tif(b.charAt(i)=='1')\n\t\t\t\tones++;\n\t\tZ = ones==0?true:false;\n\t\tP = ones%2==0?true:false;\n\t}", "@Override\n\tpublic int compare(String s1, String s2) {\n\t\t// if s1 = s2 returns 0\n\t\t// if s1 > s2 returns 1\n\t\t// if s1 < s2 returns -1\n\n\t\tint len1 = s1.length();\n\t\tint len2 = s2.length();\n\n\t\tif (len1 > len2) {\n\t\t\treturn 1;\n\t\t} else if (len1 < len2) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn 0;\n\t}", "public int stringMatch(String a, String b) {\n int result = 0;\n int end = (a.length()<=b.length()? a.length():b.length());\n for (int i = 0; i <end-1 ; i++){\n if (a.substring(i, i + 2).equals(b.substring(i, i + 2))) {\n result++;\n }\n }\n return result;\n }", "boolean checkChar(String s1, String s2);", "static String twoStrings(String s1, String s2){\n // Complete this function\n String letters = \"abcdefghijklmnopqrstuvwxyz\";\n for(int i=0;i<letters.length();i++){\n char lettersChar = letters.charAt(i); \n if(s1.indexOf(lettersChar) > -1 && s2.indexOf(lettersChar) > -1){\n return \"YES\";\n }\n }\n \n return \"NO\";\n }", "public int compare(String str1, String str2) {\r\n int num1 = Integer.parseInt(str1.substring(4, str1.length()));\r\n int num2 = Integer.parseInt(str2.substring(4, str2.length()));\r\n\r\n return num1 - num2;\r\n\r\n }", "public static boolean timingSafeEquals(CharSequence first, CharSequence second) {\n if (first == null) {\n return second == null;\n } else if (second == null) {\n return false;\n } else if (second.length() <= 0) {\n return first.length() <= 0;\n }\n int firstLength = first.length();\n int secondLength = second.length();\n char result = (char) ((firstLength == secondLength) ? 0 : 1);\n int j = 0;\n for (int i = 0; i < firstLength; ++i) {\n result |= first.charAt(i) ^ second.charAt(j);\n j = (j + 1) % secondLength;\n }\n return result == 0;\n }", "public static int commonCharacterCount(String s1, String s2) {\n\t int count = 0;\n\t int auxArray[] = new int[s2.length()];\n\t for (int i = 0; i < auxArray.length; i++){\n\t\tauxArray[i] = 0;\n\t }\n\t \n\t for(int i = 0; i < s1.length(); i++){\n\t\tfor(int j = 0; j < s2.length(); j++){\n\t\t if( auxArray[j] == 1){\n\t\t continue;\n\t\t }\n\t\t else{\n\t\t if(s1.charAt(i) == s2.charAt(j)){\n\t\t auxArray[j] = 1;\n\t\t count += 1;\n\t\t break;\n\t\t }\n\t\t }\n\t\t}\n\t }\n\t return count;\n\t}", "@Test\n public void testEqualChars2() {\n char a = 'a';\n char b = 'b';\n char c = '1';\n char d = '2';\n\n boolean result1 = offByOne.equalChars(a, b);\n boolean result2 = offByOne.equalChars(c, d);\n\n assertTrue(result1);\n assertTrue(result2);\n }", "public boolean compare_same(String x, String y) {\n\t\tint fuzzy = 0;\n\t\tif (x.length() != y.length()) return false;\n\t\tfor (int i = 0, j = 0; i<x.length() && j<y.length();) {\n\t\t\tif (i>0 && x.charAt(i-1)=='_' && '0'<=x.charAt(i) && x.charAt(i)<='9') {\n\t\t\t\twhile (i<x.length() && '0'<=x.charAt(i) && x.charAt(i)<='9') i++;\n\t\t\t}\n\t\t\tif (j>0 && y.charAt(j-1)=='_' && '0'<=y.charAt(j) && y.charAt(j)<='9') {\n\t\t\t\twhile (j<y.length() && '0'<=y.charAt(j) && y.charAt(j)<='9') j++;\n\t\t\t}\n\t\t\tif (i<x.length() && j<y.length() && x.charAt(i) != y.charAt(j)) {\t\t\t\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\ti++; j++;\n\t\t}\n\t\treturn true;\n\t}", "public static void main(String[] args) {\n\r\n\t\tString s1=\"abcd\";\r\n\t\tString s2=\"vbvabcdqwe\";\r\n\t\tchar arr1[]=s1.toCharArray();\r\n\t\tchar arr2[]=s2.toCharArray();\r\n\r\n\t\tint flag=0;\r\n\t\tfor(int i=0;i<arr1.length;i++)\r\n\t\t{\r\n\t\t\tfor(int j=i;j<arr2.length;j++)\r\n\t\t\t{\r\n\t\t\t\tif(arr1[i]==arr2[j])\r\n\t\t\t\t{\r\n\t\t\t\t\t\r\n\t\t\t\t}\t\r\n\t\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "@Override\n public int compare(String s1, String s2) {\n String soString1 = s1.replaceAll(\"[\\\\d.]\",\"\");\n String soString2 = s2.replaceAll(\"[\\\\d.]\",\"\");\n if (soString1.equals(soString2)){\n Integer soNumero1 = Integer.parseInt(s1.replaceAll(\"\\\\D\", \"\"));\n Integer soNumero2 = Integer.parseInt(s2.replaceAll(\"\\\\D\", \"\"));\n return soNumero1.compareTo(soNumero2) * this.reverse;\n }\n return soString1.compareTo(soString2) * this.reverse;\n }", "public static boolean isAnagram1(String s1, String s2) {\r\n int[] arr = new int[256]; //Number of Ascii Values\r\n\r\n for (int i = 0; i < s1.length(); i++) {\r\n arr[s1.charAt(i)]++;\r\n arr[s2.charAt(i)]--;\r\n }\r\n\r\n for (int i = 0; i < arr.length; i++) {\r\n if (arr[i] != 0) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }", "@Override\n public int compare(Character char1, Character char2) {\n if(char1.charValue() == char2.charValue()){\n return 0;\n }\n int char1Index = findIndex(char1);\n int char2Index = findIndex(char2);\n if(char1Index >= 0 && char2Index >= 0){\n return char1Index < char2Index ? -1: 1;\n }\n // char1 exists in S and char2 doesn't,then char1 should come first.\n if(char1Index >=0 && char2Index == -1){\n return -1;\n }\n else if(char1Index == -1 && char2Index >=0){\n return 1;\n }\n else{\n return 0;\n }\n }", "public static int compare(byte[] s1, byte[] s2) {\n int i;\n int len1 = s1.length;\n int len2 = s2.length;\n if (len1 > len2) {\n return 1;\n }\n if (len2 > len1) {\n return -1;\n }\n int acc = 0;\n for (i = 0; i < len1; i++) {\n acc += s1[i];\n acc -= s2[i];\n if (acc != 0) {\n return acc;\n }\n }\n return 0;\n }", "public static int compareCharSequences(CharSequence a, CharSequence b, boolean ignoreCase) {\n if (a == b) {\n return 0;\n }\n if (a instanceof String && b instanceof String) {\n return ((String) a).compareTo((String) b);\n }\n int aLength = a.length();\n int bLength = b.length();\n if (aLength == 0 && bLength == 0) {\n return 0;\n }\n int max = Math.min(aLength, bLength);\n for (int i = 0; i < max; i++) {\n char ac = ignoreCase ? Character.toLowerCase(a.charAt(i)) : a.charAt(i);\n char bc = ignoreCase ? Character.toLowerCase(b.charAt(i)) : b.charAt(i);\n int result = Character.compare(ac, bc);\n if (result != 0) {\n return result;\n }\n }\n if (aLength == bLength) {\n return 0;\n } else if (aLength > bLength) {\n return 1;\n } else {\n return -1;\n }\n }", "static String twoStrings(String s1, String s2) {\n Hashtable<Character, Integer> shortDict = null;\n Hashtable<Character, Integer> longDict = null;\n \n boolean isCommonSubset = false;\n \n String longerString = s1.length() >= s2.length() ? s1 : s2;\n String shorterString = s1.length() < s2.length() ? s1 : s2;\n \n longDict = prepareHashtable(longerString);\n shortDict = prepareHashtable(shorterString);\n \n for (char ch: shortDict.keySet()) {\n if (longDict.containsKey(ch)) {\n isCommonSubset = true;\n break;\n }\n }\n \n return isCommonSubset ? \"YES\" : \"NO\";\n }", "public static int compareString(NodeValue nv1, NodeValue nv2) {\n return calcReturn(nv1.getString().compareTo(nv2.getString())) ;\n }", "private static int strCompare(char[] paramArrayOfChar1, int paramInt1, int paramInt2, char[] paramArrayOfChar2, int paramInt3, int paramInt4, boolean paramBoolean)\n/* */ {\n/* 2157 */ int i = paramInt1;\n/* 2158 */ int j = paramInt3;\n/* */ \n/* */ \n/* */ \n/* 2162 */ int i4 = paramInt2 - paramInt1;\n/* 2163 */ int i5 = paramInt4 - paramInt3;\n/* */ \n/* */ int i6;\n/* */ \n/* 2167 */ if (i4 < i5) {\n/* 2168 */ i6 = -1;\n/* 2169 */ k = i + i4;\n/* 2170 */ } else if (i4 == i5) {\n/* 2171 */ i6 = 0;\n/* 2172 */ k = i + i4;\n/* */ } else {\n/* 2174 */ i6 = 1;\n/* 2175 */ k = i + i5;\n/* */ }\n/* */ \n/* 2178 */ if (paramArrayOfChar1 == paramArrayOfChar2) {\n/* 2179 */ return i6;\n/* */ }\n/* */ int n;\n/* */ int i2;\n/* */ for (;;) {\n/* 2184 */ if (paramInt1 == k) {\n/* 2185 */ return i6;\n/* */ }\n/* */ \n/* 2188 */ n = paramArrayOfChar1[paramInt1];\n/* 2189 */ i2 = paramArrayOfChar2[paramInt3];\n/* 2190 */ if (n != i2) {\n/* */ break;\n/* */ }\n/* 2193 */ paramInt1++;\n/* 2194 */ paramInt3++;\n/* */ }\n/* */ \n/* */ \n/* 2198 */ int k = i + i4;\n/* 2199 */ int m = j + i5;\n/* */ \n/* */ int i1;\n/* */ int i3;\n/* 2203 */ if ((n >= 55296) && (i2 >= 55296) && (paramBoolean))\n/* */ {\n/* */ \n/* 2206 */ if ((n > 56319) || (paramInt1 + 1 == k) || \n/* */ \n/* 2208 */ (!UTF16.isTrailSurrogate(paramArrayOfChar1[(paramInt1 + 1)])))\n/* */ {\n/* 2210 */ if ((!UTF16.isTrailSurrogate(n)) || (i == paramInt1) || \n/* 2211 */ (!UTF16.isLeadSurrogate(paramArrayOfChar1[(paramInt1 - 1)])))\n/* */ {\n/* */ \n/* */ \n/* */ \n/* */ \n/* 2217 */ i1 = (char)(n - 10240);\n/* */ }\n/* */ }\n/* 2220 */ if ((i2 > 56319) || (paramInt3 + 1 == m) || \n/* */ \n/* 2222 */ (!UTF16.isTrailSurrogate(paramArrayOfChar2[(paramInt3 + 1)])))\n/* */ {\n/* 2224 */ if ((!UTF16.isTrailSurrogate(i2)) || (j == paramInt3) || \n/* 2225 */ (!UTF16.isLeadSurrogate(paramArrayOfChar2[(paramInt3 - 1)])))\n/* */ {\n/* */ \n/* */ \n/* */ \n/* */ \n/* 2231 */ i3 = (char)(i2 - 10240);\n/* */ }\n/* */ }\n/* */ }\n/* */ \n/* 2236 */ return i1 - i3;\n/* */ }", "private static int compare(String st1, String st2) {\n if (st1.length() < st2.length()) {\n return -1;\n } else {\n return st1.compareTo(st2);\n }\n }", "static String twoStrings(String s1, String s2) {\n String bigstr = s1.length() > s2.length() ? s1 : s2;\n String smallstr = s1.length() > s2.length() ? s2 : s1;\n int bigstrSize = bigstr.length();\n int smallstrSize = smallstr.length();\n\n boolean string_check[] = new boolean[1000];\n\n for (int i = 0; i < bigstrSize; i++) {\n string_check[bigstr.charAt(i) - 'A'] = true;\n }\n // if at least one char is present in boolean array\n for (int i = 0; i < smallstrSize; i++) {\n if (string_check[smallstr.charAt(i) - 'A'] == true) {\n return \"YES\";\n }\n }\n return \"NO\";\n }", "public boolean checkPermutaionOfStr(String str1, String str2){\n\tArrayList<Integer> word_cnt1 = new ArrayList<Integer>();\n\tArrayList<Integer> word_cnt2 = new ArrayList<Integer>();\n\t\n\tif(str1.length() != str2.length())\n\t\treturn false;\n\tfor(int i = 0; i< 256; i++){\n\t\tword_cnt1.add(0);\n\t\tword_cnt2.add(0);\n\t}\n\t\n\tfor(int i = 0; i< str1.length(); i++){\n\t\tcntStrChar(str1, word_cnt1, i);\n\t\tcntStrChar(str2, word_cnt2, i);\n\t}\n\t\n\tfor(int i = 0; i< 256; i++){\n\t\tif (word_cnt1.get(i) != word_cnt2.get(i) )\n\t\t\treturn false;\n\t}\n\treturn true;\n}", "@Override\r\n\tpublic int compare(String str0, String str1) {\n\t\tString[] tempStr0 = str0.split(\",\", 2);\r\n\t\tString[] tempStr1 = str1.split(\",\", 2);\r\n\r\n\t\t// Hilbert code comparison\r\n\t\tint hilbertComparedValue = _hibertComp.compare(tempStr0[0], tempStr1[0]);\r\n\r\n\t\tif (hilbertComparedValue != 0) \r\n\t\t{\r\n\t\t\treturn hilbertComparedValue;\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\treturn tempStr0[1].compareTo(tempStr1[1]);\r\n\t\t}\t\t\r\n\t}", "public static int getCommonStrLength(String str1, String str2) {\n\t\t\n\t\tint len1 = str1.length();\n\t\tint len2 = str2.length();\n\t\t\n\t\tif (len1<=0 || len2<=0) {\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t\tchar[] s1 = str1.toLowerCase().toCharArray();\n\t\tchar[] s2 = str2.toLowerCase().toCharArray();\n\t\tint[][] dp = new int[len1][len2];\n\t\tint result = 0;\n\t\t\n\t\tfor (int i=0; i<len1; i++) {\n\t\t\tfor (int j=0; j<len2; j++) {\n\t\t\t\tif (s1[i] == s2[j]) {\n\t\t\t\t\tif (i==0 || j==0) {\n\t\t\t\t\t\tdp[i][j] = 1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tdp[i][j] = dp[i-1][j-1] + 1;\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tdp[i][j] = 0;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (dp[i][j] > result) {\n\t\t\t\t\tresult = dp[i][j];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn result;\n\t\t\t\n\t}", "public boolean compare2StringsIgnoringCasses(String s1, String s2)\r\n {\r\n String a=s1.toLowerCase();\r\n String b=s2.toLowerCase();\r\n if(a.length()!= b.length())\r\n {\r\n return false;\r\n }\r\n else\r\n {\r\n for(int i=0; i<a.length(); i++)\r\n {\r\n if(!comparet2Chars(a.charAt(i),b.charAt(i)))\r\n {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n }", "private static int cmpNotNullFirst( String str1, String str2 )\n \t\t{\n \t\t\tif ( str1==null && str2==null )\n \t\t\t\treturn 0;\n \t\t\tif ( str1==null )\n \t\t\t\treturn 1;\n \t\t\tif ( str2==null )\n \t\t\t\treturn -1;\n \t\t\treturn cmp(str1, str2);\n \t\t}", "private static int textCompare(final Resource r1, final Resource r2) throws IOException {\n try (BufferedReader in1 =\n new BufferedReader(new InputStreamReader(r1.getInputStream()));\n BufferedReader in2 = new BufferedReader(\n new InputStreamReader(r2.getInputStream()))) {\n\n String expected = in1.readLine();\n while (expected != null) {\n final String actual = in2.readLine();\n if (!expected.equals(actual)) {\n if (actual == null) {\n return 1;\n }\n return expected.compareTo(actual);\n }\n expected = in1.readLine();\n }\n return in2.readLine() == null ? 0 : -1; //NOSONAR\n }\n }", "public String comp(String s) {\n\t\tif(s.equals(\"0\")) {\n\t\t\treturn \"0101010\";\n\t\t} else if(s.equals(\"1\")) {\n\t\t\treturn \"0111111\";\n\t\t} else if(s.equals(\"-1\")) {\n\t\t\treturn \"0111010\";\n\t\t} else if(s.equals(\"D\")) {\n\t\t\treturn \"0001100\";\n\t\t} else if(s.equals(\"A\")) {\n\t\t\treturn \"0110000\";\n\t\t} else if(s.equals(\"M\")) {\n\t\t\treturn \"1110000\";\n\t\t} else if(s.equals(\"!D\")) {\n\t\t\treturn \"0001101\";\n\t\t} else if(s.equals(\"!A\")) {\n\t\t\treturn \"0110001\";\n\t\t} else if(s.equals(\"!M\")) {\n\t\t\treturn \"1110001\";\n\t\t} else if(s.equals(\"-D\")) {\n\t\t\treturn \"0001111\";\n\t\t} else if(s.equals(\"-A\")) {\n\t\t\treturn \"0110011\";\n\t\t} else if (s.equals(\"-M\")) {\n\t\t\treturn \"1110011\";\n\t\t} else if(s.equals(\"D+1\")) {\n\t\t\treturn \"0011111\";\n\t\t} else if(s.equals(\"A+1\")) {\n\t\t\treturn \"0110111\";\n\t\t} else if (s.equals(\"M+1\")) {\n\t\t\treturn \"1110111\";\n\t\t} else if(s.equals(\"D-1\")) {\n\t\t\treturn \"0001110\";\n\t\t} else if(s.equals(\"A-1\")) {\n\t\t\treturn \"0110010\";\n\t\t} else if(s.equals(\"M-1\")) {\n\t\t\treturn \"1110010\";\n\t\t} else if(s.equals(\"D+A\")) {\n\t\t\treturn \"0000010\";\n\t\t} else if(s.equals(\"D+M\")) {\n\t\t\treturn \"1000010\";\n\t\t} else if(s.equals(\"D-A\")) {\n\t\t\treturn \"0010011\";\n\t\t} else if(s.equals(\"D-M\")) {\n\t\t\treturn \"1010011\";\n\t\t} else if(s.equals(\"A-D\")) {\n\t\t\treturn \"0000111\";\n\t\t} else if(s.equals(\"M-D\")) {\n\t\t\treturn \"1000111\";\n\t\t} else if(s.equals(\"D&A\")) {\n\t\t\treturn \"0000000\";\n\t\t} else if(s.equals(\"D&M\")) {\n\t\t\treturn \"1000000\";\n\t\t} else if(s.equals(\"D|A\")) {\n\t\t\treturn \"0010101\";\n\t\t} else if(s.equals(\"D|M\")) {\n\t\t\treturn \"1010101\";\n\t\t}\n\t\telse {\n\t\t\treturn \"\";\n\t\t}\n\t}", "static int type_of_cmp(String passed){\n\t\tif(general_registers.contains(passed.charAt(4)))\n\t\t\treturn 1;\n\t\telse if(passed.charAt(4)=='M')\n\t\t\treturn 2;\n\t\telse\n\t\t\treturn 0;\n\t}", "@Test\n public void testEqualChars1() {\n char a = 'a';\n char b = 'a';\n char c = 'z';\n char d = 'B';\n\n boolean result1 = offByOne.equalChars(a, b);\n boolean result2 = offByOne.equalChars(a, c);\n boolean result3 = offByOne.equalChars(a, d);\n\n assertFalse(result1);\n assertFalse(result2);\n assertFalse(result3);\n }", "public static int approach1(String str) {\n\t\tint strLength = str.length();\n\t\tfor(int i = 0; i < strLength; i++) {\n\t\t\tfor(int j = i+1; j < strLength; j++) {\n\t\t\t\tif(str.charAt(i) == str.charAt(j)) {\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "public int match(String s1, String s2) {\n\t\tchar ch1;\n\t\t\n\t\tif (s1.length() == 0 && s2.length() == 0) // s1,s2がともにからであれば0を返す\n\t\t\treturn 0;\n\t\tfor (int i1 = 0; i1 < s1.length(); i1++) {\n\t\t\tch1 = s1.charAt(i1);\n\n\t\t\tif (s2.length() > 0) {\n\t\t\t\tif (s2.charAt(0) == ch1) {\n\t\t\t\t\tif (matchChar(s1, s2, i1)) {\n\t\t\t\t\t\treturn i1;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (s2.length() == 0) {\n\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\n\t\treturn -1;\n\t}", "@Override\n public int compare(String str1, String str2) {\n int count1 = mSSIDMatchCounts.containsKey(str1) ? mSSIDMatchCounts.get(str1) : 0;\n int count2 = mSSIDMatchCounts.containsKey(str2) ? mSSIDMatchCounts.get(str2) : 0;\n\n\n int result = -Integer.valueOf(count1).compareTo(count2);\n if (result == 0) {\n // Secondary order: lexicographical, ascending\n result = str1.compareTo(str2);\n }\n return result;\n }", "public static boolean isEqual(String s1, String s2) {\r\tif(s1.length() != s2.length()){\r\t return false;\r\t}\r\tfor(int i = 0; i< s1.length();i++){\r\t if (s1.charAt(i) != s2.charAt(i)){\r\t\treturn false;\r\t }\r\t}\r\treturn true;\r }", "@Override\r\n\t\t\tpublic int compare(String o1, String o2) {\n\t\t\t\tString[] values = o1.split(\";\");\r\n\t\t\t\t//Take the second string and do the same thing\r\n\t\t\t\tString[] values2 = o2.split(\";\");\r\n\t\t\t\t//Compare strings according to their integer values\r\n\t\t\t\treturn Integer.valueOf(values[0].replace(\"\\\"\", \"\")).compareTo(Integer.valueOf(values2[0].replace(\"\\\"\", \"\")));\r\n\t\t\t}", "@SuppressWarnings(\"rawtypes\")\r\n\t@Override\r\n\tpublic int compare(WritableComparable a, WritableComparable b)\r\n\t{\n\t\tText left = (Text)a;\r\n\t\tText right = (Text)b;\r\n\t\t\r\n\t\tText realLeft = new Text(left.toString().split(\"-,-\")[1]);\r\n\t\tText realRight = new Text(right.toString().split(\"-,-\")[1]);\r\n\t\t\t\t\r\n\t\tint result = tc.compare(realLeft, realRight);\r\n\t\t\t\t\r\n\t\treturn result;\r\n\t}", "public int compare(String a, String b) {\n if (base.get(a) >= base.get(b)) {\n return -1;\n } else {\n return 1;\n } // returning 0 would merge keys\n }", "public static int compareChar(char firstChar, char secondChar) {\n return Character.compare(secondChar, firstChar);\n }", "public static int helper(String str) {\n\t\t// null & illegal checking here\n\t\tif(str == null){\n\t\t\treturn 0;\n\t\t}\n\t \n\t\tif(str.length() == 1){\n\t\t\treturn 1;\n\t\t}\n\t \n\t\tchar[] arr = str.toCharArray();\n\t\tchar p = arr[arr.length - 1];\n\t\tint result = 1;\n\t \n\t\tfor (int i = arr.length - 2; i >= 0; i--) {\n\t\t\tif (p == arr[i]) {\n\t\t\t\tresult++;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t \n\t\treturn result;\n\t}", "private static boolean diffOne(String s1, String s2) {\n int count = 0;\n for (int i = 0; i < s1.length(); i++) {\n if (s1.charAt(i) != s2.charAt(i)) count++;\n if (count > 1) return false;\n }\n return count == 1;\n }", "@Test\r\n public void test8() {\r\n String s1 = \"Abc\";\r\n String s2 = \"abc\";\r\n String s3 = \"Abcd\";\r\n System.out.println(s1.compareTo(s2));\r\n System.out.println(s1.compareTo(s3));\r\n }", "public static String contains(String input1, String input2){\n\t\tif((input1 == null && input2 ==null)){\n\t\t\treturn \"yes\";\n\t\t}else if (input1 == null || input2 == null){\n\t\t\treturn \"no\";\n\t\t}\n\t\tchar []input1Arr = input1.toCharArray();\n\t\tchar []input2Arr = input2.toCharArray();\n\t\tint []charMap = new int [256];\n\t\tfor (char ch:input1Arr){\n\t\t\tcharMap[ch] ++;\n\t\t}\n\t\tfor (char ch:input2Arr){\n\t\t\tif(charMap[ch]>=1){\n\t\t\t\tcharMap[ch]--;\n\t\t\t}else {\n\t\t\t\treturn \"no\";\n\t\t\t}\n\t\t}\n\t\treturn \"yes\";\n\t}", "public static boolean isAnagramFuncApproach(String str1, String str2) {\n List<String> list1 = str1.chars()\n .sorted()\n .mapToObj(c -> Character.valueOf((char) c))\n .map(object -> Objects.toString(object, null))\n .collect(Collectors.toList());\n\n List<String> list2 = str2.chars()\n .sorted()\n .mapToObj(c -> Character.valueOf((char) c))\n .map(object -> Objects.toString(object, null))\n .collect(Collectors.toList());\n\n return list1.equals(list2);\n }", "public static void main(String[] args) {\nScanner sc=new Scanner(System.in);\r\nString a=sc.nextLine();\r\nString b=sc.nextLine();\r\nchar ch1[]=a.toCharArray();\r\nchar ch2[]=b.toCharArray();\r\nint l1=ch1.length;\r\nint l2=ch2.length;\r\nint n=0;\r\nif(l1==l2)\r\n{\r\n\tfor(int i=0;i<l1;i++)\r\n\t{\r\n\t\tif(ch1[i]!=ch2[i])\r\n\t\t{\r\n\t\t\tn=n+1;\r\n\t\t}\r\n\t}\r\n\tif(n==1)\r\n\t\tSystem.out.println(\"yes\");\r\n\telse\r\n\t\tSystem.out.println(\"no\");\r\n}\r\nelse\r\n\tSystem.out.println(\"no\");\r\n\t}", "private static int coutSubst(char c1, char c2)\n {\n if (c1 == c2) return 0;\n return 1;\n }", "public abstract int compare(String s1, String s2) throws NumberFormatException, ParseException;", "boolean equal(String s1, String s2) {\n return compareStrings(s1, s2) == 0;\n }", "public static void main (String[]args){\n\t\t \r\n\t\tString s1= \"ratan\";\r\n\t\tString s2=\"anu\";\r\n\t\tString s3=\"ratan\";\r\n\t\tSystem.out.println(s1.equals(s2));\r\n\t\tSystem.out.println(s1.equals(s3));\r\n\t\tSystem.out.println(s3.equals(s2));\r\n\t\tSystem.out.println(\"Ratan\".equals(\"ratan\"));// ratan as a string or s1 is also work\r\n\t\tSystem.out.println(\"Ratan\".equalsIgnoreCase(s1));\r\n\t\t\r\n\t\t\r\n\t\t// Compareto ---------> return +value or -value\r\n\t\tSystem.out.println(s1.compareTo(s2));\r\n\t\tSystem.out.println(s1.compareTo(s3));\r\n\t\tSystem.out.println(s2.compareTo(s3));\r\n\t\t\r\n\t\tSystem.out.println(\"Ratan\".compareTo(\"ratan\"));// ratan or s1 also work as shown here\r\n\t\tSystem.out.println(\"Ratan\".compareToIgnoreCase(s1));\r\n\r\n}", "private boolean translateWith2ExchangedChars(String input1, String input2) {\n if (StringUtils.isBlank(input1) || StringUtils.isBlank(input2) || input1.length() != input2.length()) {\n return false;\n }\n if (input1.equals(input2)) {\n for (int i = 0; i < input1.length(); i++) {\n char current = input1.charAt(i);\n if (input1.lastIndexOf(current) != i) {\n return true;\n }\n }\n return false;\n } else {\n int first = -1, second = -1;\n for (int i = 0; i < input1.length(); i++) {\n if (input1.charAt(i) != input2.charAt(i)) {\n if (first == -1) {\n first = i;\n } else if (second == -1) {\n second = i;\n } else {\n return false;\n }\n }\n }\n return input1.charAt(first) == input2.charAt(second)\n && input1.charAt(second) == input2.charAt(first);\n }\n }", "@Test\n public void testCompareTo_1() {\n LOGGER.info(\"testCompareTo_1\");\n final AtomString atomString1 = new AtomString();\n final AtomString atomString2 = new AtomString();\n final int actual = atomString1.compareTo(atomString2);\n final int expected = 0;\n assertEquals(expected, actual);\n }", "public static void main(String[] args) {\nString s1= \"adya\";\nString s2= \"adyass\"+\"a\";\nString s3= \"adyassa\";\nSystem.out.println(s3==s2);\n\t}", "@Test\r\n public void testEqualChars(){\r\n boolean res1=offByOne.equalChars('c','b');\r\n assertTrue(\"should be true\",res1);\r\n boolean res2=offByOne.equalChars('a','c');\r\n assertFalse(\"should be false\",res2);\r\n }", "private boolean equalsChars(char[] first, char[] second) {\n for (int i = 0; i < second.length; i++)\n if (first[i] != second[i])\n return false;\n return true;\n }", "public boolean isEqual(StringNum a, StringNum b) {\n\t\tif(a.getNumber().equalsIgnoreCase(b.getNumber())) {\n\t\t\treturn true;\n\t\t}\n\t\telse {\n\t\t\treturn false;\n\t\t}\n\t}", "private boolean compareActualAndExpectedOutputs(String string,\r\n\t\t\tString string2) {\r\n\t\treturn string.equals(string2);\r\n\t}", "public int compare(String o1, String o2) {\n\t\t\t\t\t\tif (o1.compareTo(o2) > 0) {\n\t\t\t\t\t\t\treturn 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}", "public static void main(String[] args) {\n\n\t\t\n\t\tfinal char b = (char) (126+12);\n\t\t//es una variable de tipo comnstante la cual no acepta cambios \n\t\tfinal String str1 = \"hola\";\n\t\tfinal String str2 = \"mundo\";\n\t\t\n\t\tSystem.out.println(\"holamundo\"==(str1+str2));\n\t\tSystem.out.println(b);\n\t}", "@Override\n public int compare(String o1, String o2) {\n return Integer.compare(o1.length(), o2.length());\n }", "public void testCompareIgnoreCase() {\n\t\tString one = \"hello\";\n\t\tString two = \"In the house\";\n\t\t//h vor i\n\t\tassertTrue(comp.compareStrings(one, two) > 0);\n\t\tassertEquals(0, comp.compareStrings(one, one));\n\t\tassertTrue(comp.compareStrings(two, one) < 0);\n\t}", "@Override\n public int compare(String o1, String o2) {\n return Integer.compare(o2.length(), o1.length());\n }", "public static int levenshtein(String a, String b) {\n a = a.toLowerCase();\n b = b.toLowerCase();\n\n if (a.equals(b)) {\n return 0;\n }\n\n return lev(a, b, a.length(), b.length());\n }", "int mo23352v(String str, String str2);", "public static int diff(String s1, String s2) {\n if (s1 == null || s2 == null) return -1;\n int len1 = s1.length();\n int len2 = s2.length();\n \n int len = (len1<len2) ? len1 : len2;\n \n \n for (int i=0; i<len; i++) {\n if (s1.charAt(i) != s2.charAt(i)) return i;\n }\n \n return (len1==len2) ? -1 : len;\n }", "int stringsConstruction(String a, String b){\n a=\" \"+a+\" \";\n b=\" \"+b+\" \";\n int output = b.split(\"\"+a.charAt(1)).length - 1;\n for(char i = 'a'; i <= 'z'; i++) {\n if (a.split(\"\"+i).length > 1) {\n int tempOut = (b.split(\"\"+i).length - 1) / (a.split(\"\"+i).length - 1);\n if (output > tempOut) {\n output = tempOut;\n }//if (output > tempOut) {\n }//if (a.split(\"\"+i).length > 1) {\n }//for(char i = 'a'; i <= 'z'; i++) {\n return output;\n }", "public int compare(WritableComparable o1, WritableComparable o2) {\r\n\t\tText key1 = (Text) o1;\r\n\t\tText key2 = (Text) o2;\r\n\t\tint t1char = key1.charAt(0); \r\n\t\tint t2char = key2.charAt(0); \r\n\t\tif (t1char < t2char) return 1;\r\n\t\telse if (t1char > t2char) return -1;\r\n\t\telse return 0;\r\n\t}", "@Test\n public void testEqualChar3() {\n char a = '%';\n char b = '!';\n char c = '\\t';\n char d = '\\n';\n\n boolean result1 = offByOne.equalChars(a, b);\n boolean result2 = offByOne.equalChars(c, d);\n\n assertFalse(result1);\n assertTrue(result2);\n }", "public int compare(String a, String b) {\n\t if (base.get(a) >= base.get(b)) {\n\t return -1;\n\t } else {\n\t return 1;\n\t } // returning 0 would merge keys\n\t }", "static boolean areSame(String expr1, String expr2)\n\t{\n\n\t\t// Create a vector for all operands and\n\t\t// initialize the vector as 0.\n\t\tint[] v = new int[MAX_CHAR];\n\n\t\t// Put signs of all operands in expr1\n\t\teval(expr1, v, true);\n\n\t\t// Subtract signs of operands in expr2\n\t\teval(expr2, v, false);\n\n\t\t// If expressions are same, vector must\n\t\t// be 0.\n\t\tfor (int i = 0; i < MAX_CHAR; i++)\n\t\t\tif (v[i] != 0)\n\t\t\t\treturn false;\n\n\t\treturn true;\n\t}", "int mo23353w(String str, String str2);", "private boolean alphabCheck(String first, String second) {\n\t\tif (first.length() == 1 || second.length() == 1) {\n\t\t\tif (first.compareTo(second) < 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif (first.substring(0, 1).compareTo(second.substring(0,1)) < 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (first.substring(0, 1).compareTo(second.substring(0,1)) == 0) {\n\t\t\t\t\treturn alphabCheck(first.substring(1, first.length()),second.substring(1,second.length()));\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public static boolean compareLetters(String romConcat, char smallNum, char bigNum) {\n\t\tint checkSmall = 0, checkBig = 0;\r\n\t\t\r\n\t\tif(romConcat.indexOf(smallNum) > -1) {\r\n\t\t\tcheckSmall = romConcat.indexOf(smallNum);\r\n\t\t}\r\n\t\t\r\n\t\tif(romConcat.indexOf(bigNum) > -1) {\r\n\t\t\tcheckBig = romConcat.indexOf(bigNum);\r\n\t\t}\r\n\t\t\r\n\t\tif(checkSmall == 0 || checkBig == 0) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse if(checkSmall < checkBig) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n\t\tCharacter c1 = new Character('A');\n\t\tCharacter c2 =new Character('b');\n\t\tSystem.out.println(c1+\"与\"+c2+\"相等吗?\"+c1.equals(c2));\n\t\tSystem.out.println(c1+\"小写是 \"+c1.toLowerCase(c1));\n\t\tSystem.out.println(c2+\"小写是 \"+c2.toLowerCase(c2));\n\t}", "public int compare(String a, String b) {\r\n\t\t\t\tint result = map.get(b).compareTo(map.get(a));\r\n\t\t\t\tif(result == 0)\r\n\t\t\t\t\treturn 1;\r\n\t\t\t\telse\r\n\t\t\t\t\treturn result;\r\n\t\t\t}", "public final int compare(final Term first, final Term second) {\n return first.getHebrewString().compareTo(second.getHebrewString());\n }" ]
[ "0.70637155", "0.6983216", "0.6943817", "0.68078923", "0.6762574", "0.6738679", "0.6650553", "0.6648068", "0.66438615", "0.65790194", "0.6558607", "0.6524934", "0.6408694", "0.64045876", "0.63873196", "0.6372934", "0.6367376", "0.6296292", "0.6272736", "0.627199", "0.6269141", "0.6265793", "0.6264248", "0.625726", "0.6254869", "0.62403595", "0.6218514", "0.62115055", "0.62006974", "0.61709034", "0.61706674", "0.6163143", "0.6159142", "0.60830605", "0.6071353", "0.60686505", "0.60508585", "0.6039278", "0.6032578", "0.6007833", "0.6007578", "0.599649", "0.59944165", "0.5991504", "0.5990878", "0.5985463", "0.5979687", "0.5973731", "0.5938831", "0.59285986", "0.59241545", "0.5905272", "0.5904957", "0.5885489", "0.58789134", "0.58741355", "0.58696955", "0.58553094", "0.58535475", "0.58415157", "0.5838507", "0.58354557", "0.5833644", "0.58293605", "0.5828042", "0.582469", "0.5824486", "0.5819369", "0.58156514", "0.5806902", "0.5805976", "0.58026856", "0.5799748", "0.579144", "0.57913494", "0.5790071", "0.5789954", "0.5788207", "0.57828814", "0.5777522", "0.5776113", "0.57724065", "0.5767199", "0.57621074", "0.5754959", "0.57473236", "0.57460874", "0.57431144", "0.57370824", "0.5730747", "0.57180357", "0.57171875", "0.5700321", "0.5698194", "0.5693419", "0.56903976", "0.56882435", "0.56873643", "0.5681586", "0.5681209" ]
0.6786173
4
Compares two characters by their ASCII values, and returns either 0, 1 or 1.
public static int compareChar(char firstChar, char secondChar) { return Character.compare(secondChar, firstChar); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int diff(char a, char b) {\n return (a == b ? 0 : 1);\n }", "private static int alphaNumericCompare( String s1, String s2 )\n\t{\n\t\tString[] words1 = splitIntoAlphasAndNums( s1 );\n\t\tString[] words2 = splitIntoAlphasAndNums( s2 );\n\t\tfor ( int j = 0; j < Math.min( words1.length, words2.length ); j++ )\n\t\t{\n\t\t\tint c;\n\t\t\tfinal String sp1 = words1[ j ];\n\t\t\tfinal String sp2 = words2[ j ];\n\n\t\t\t// First look for special alpha sequences (e.g., \"alpha\" or \"beta\" or \"rc\"):\n\t\t\tint subScore1 = calculateScore( sp1 );\n\t\t\tint subScore2 = calculateScore( sp2 );\n\t\t\tc = subScore1 - subScore2;\n\t\t\tif ( c != 0 )\n\t\t\t{\n\t\t\t\treturn c;\n\t\t\t}\n\n\t\t\t// Since splitIntoAlphasAndNums() was called, that means that if 1st char is a digit, then\n\t\t\t// all characters are digits:\n\t\t\tif ( startsWithDigit( sp1 ) || startsWithDigit( sp2 ) )\n\t\t\t{\n\t\t\t\tComparable<Long> v1 = toLong( sp1 );\n\t\t\t\tLong v2 = toLong( sp2 );\n\t\t\t\tif ( v1 != null && v2 != null )\n\t\t\t\t{\n\t\t\t\t\tc = v1.compareTo( v2 );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// null == null, and null is smaller than non-null\n\t\t\t\t\tc = v1 == v2 ? 0 : v1 == null ? -1 : 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Both are pure non-numerics, so use regular lexicographic compare:\n\t\t\t\tc = sp1.compareTo( sp2 );\n\t\t\t}\n\n\t\t\tif ( c != 0 )\n\t\t\t{\n\t\t\t\treturn c;\n\t\t\t}\n\t\t}\n\n\t\t// Last resort comparision: sub-splitting array length.\n\t\treturn words1.length - words2.length;\n\t}", "boolean checkChar(String s1, String s2);", "private static int cmp( String str1, String str2 )\n \t\t{\n \t\t\tif ( str1==null && str2==null )\n \t\t\t\treturn 0;\n \t\t\tif ( str1==null )\n \t\t\t\treturn -1;\n \t\t\tif ( str2==null )\n \t\t\t\treturn 1;\n \t\t\t\n \t\t\tint p1 = 0;\n \t\t\tint p2 = 0;\n \t\t\tfor ( ;; ) {\n \t\t\t\tif ( p1>=str1.length() ) {\n \t\t\t\t\tif ( p2>=str2.length() )\n \t\t\t\t\t\treturn 0;\n \t\t\t\t\treturn 1;\n \t\t\t\t}\n \t\t\t\tif ( p2>=str2.length() )\n \t\t\t\t\treturn -1;\n \t\t\t\tchar ch1 = str1.charAt(p1);\n \t\t\t\tchar ch2 = str2.charAt(p2);\n \t\t\t\tif ( ch1>='0' && ch1<='9' && ch2>='0' && ch2<='9' ) {\n \t\t\t\t\tint n1 = 0;\n \t\t\t\t\tint n2 = 0;\n \t\t\t\t\twhile ( ch1>='0' && ch1<='9' ) {\n \t\t\t\t\t\tp1++;\n \t\t\t\t\t\tn1 = n1 * 10 + (ch1-'0');\n \t\t\t\t\t\tif ( p1>=str1.length() )\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\tch1 = str1.charAt(p1);\n \t\t\t\t\t}\n \t\t\t\t\twhile ( ch2>='0' && ch2<='9' ) {\n \t\t\t\t\t\tp2++;\n \t\t\t\t\t\tn2 = n2 * 10 + (ch2-'0');\n \t\t\t\t\t\tif ( p2>=str2.length() )\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\tch2 = str2.charAt(p2);\n \t\t\t\t\t}\n \t\t\t\t\tint c = cmp(n1, n2);\n \t\t\t\t\tif ( c!=0 )\n \t\t\t\t\t\treturn c;\n \t\t\t\t} else {\n \t\t\t\t\tif ( ch1<ch2 )\n \t\t\t\t\t\treturn -1;\n \t\t\t\t\tif ( ch1>ch2 )\n \t\t\t\t\t\treturn 1;\n \t\t\t\t\tp1++;\n \t\t\t\t\tp2++;\n \t\t\t\t}\n \t\t\t}\n \t\t}", "@Test\n public void testEqualChars2() {\n char a = 'a';\n char b = 'b';\n char c = '1';\n char d = '2';\n\n boolean result1 = offByOne.equalChars(a, b);\n boolean result2 = offByOne.equalChars(c, d);\n\n assertTrue(result1);\n assertTrue(result2);\n }", "protected int stringCompare(String s1,String s2)\r\n\t{\r\n\t\tint shortLength=Math.min(s1.length(), s2.length());\r\n\t\tfor(int i=0;i<shortLength;i++)\r\n\t\t{\r\n\t\t\tif(s1.charAt(i)<s2.charAt(i))\r\n\t\t\t\treturn 0;\r\n\t\t\telse if(s1.charAt(i)>s2.charAt(i))\r\n\t\t\t\treturn 1;\t\r\n\t\t}\r\n\t\t//if the first shrotLenghtTH characters of s1 and s2 are same \r\n\t\tif(s1.length()<=s2.length()) //it's a close situation. \r\n\t\t\treturn 0;\r\n\t\telse \r\n\t\t\treturn 1; \r\n\t\t\r\n\t}", "public static String xor(String firstInput, String secondInput) { \n StringBuilder result = new StringBuilder();\n\n for (int i = 0; i < firstInput.length(); i++) {\n if (firstInput.charAt(i) == secondInput.charAt(i)) {\n result.append(\"0\");\n } else {\n result.append(\"1\");\n }\n }\n\n return result.toString();\n }", "final public int compare(final char c, final char other) {\n return this.maybeLowercase(c) - this.maybeLowercase(other);\n }", "static void cmp_with_reg(String passed){\n\t\tint val1 = hexa_to_deci(registers.get('A'));\n\t\tint val2 = hexa_to_deci(registers.get(passed.charAt(4)));\n\t\tS = val1>=val2?false:true;\n\t\tval2 = 256-val2;\n\t\tval2%=256;\n\t\tval1+=val2;\n\t\tCS = val1>255?true:false;\n\t\tString b = Integer.toBinaryString(val1);\n\t\tint ones=0;\n\t\tfor(int i=0;i<b.length();i++)\n\t\t\tif(b.charAt(i)=='1')\n\t\t\t\tones++;\n\t\tZ = ones==0?true:false;\n\t\tP = ones%2==0?true:false;\n\t}", "static int compare(String a, String b) {\n if (a == null) a = \"\";\n if (b == null) b = \"\";\n\n int i = 0;\n while (i < a.length() && i < b.length()) {\n char x = a.charAt(i), y = b.charAt(i);\n if (x != y) return x - y;\n i++;\n }\n return a.length() - b.length();\n }", "@Override\n public int compare(Character char1, Character char2) {\n if(char1.charValue() == char2.charValue()){\n return 0;\n }\n int char1Index = findIndex(char1);\n int char2Index = findIndex(char2);\n if(char1Index >= 0 && char2Index >= 0){\n return char1Index < char2Index ? -1: 1;\n }\n // char1 exists in S and char2 doesn't,then char1 should come first.\n if(char1Index >=0 && char2Index == -1){\n return -1;\n }\n else if(char1Index == -1 && char2Index >=0){\n return 1;\n }\n else{\n return 0;\n }\n }", "public static boolean timingSafeEquals(CharSequence first, CharSequence second) {\n if (first == null) {\n return second == null;\n } else if (second == null) {\n return false;\n } else if (second.length() <= 0) {\n return first.length() <= 0;\n }\n int firstLength = first.length();\n int secondLength = second.length();\n char result = (char) ((firstLength == secondLength) ? 0 : 1);\n int j = 0;\n for (int i = 0; i < firstLength; ++i) {\n result |= first.charAt(i) ^ second.charAt(j);\n j = (j + 1) % secondLength;\n }\n return result == 0;\n }", "@Override\n public int compare(String left, String right) {\n int result = 0;\n int length = left.length() > right.length()\n ? right.length() : left.length();\n for (int i = 0; i < length; i++) {\n result = Character.compare(left.charAt(i), right.charAt(i));\n if (result != 0) {\n break;\n }\n }\n if (result == 0) {\n result = left.length() - right.length();\n }\n return result;\n\n }", "public static boolean timingSafeEquals(String first, String second) {\n if (first == null) {\n return second == null;\n } else if (second == null) {\n return false;\n } else if (second.length() <= 0) {\n return first.length() <= 0;\n }\n char[] firstChars = first.toCharArray();\n char[] secondChars = second.toCharArray();\n char result = (char) ((firstChars.length == secondChars.length) ? 0 : 1);\n int j = 0;\n for (int i = 0; i < firstChars.length; ++i) {\n result |= firstChars[i] ^ secondChars[j];\n j = (j + 1) % secondChars.length;\n }\n return result == 0;\n }", "@Test\n public void testComp1()\n {\n System.out.println(\"comp\");\n String compString = \"A+1\";\n assertEquals(\"0110111\", N2TCode.comp(compString));\n }", "@Test\n public void testEqualChars1() {\n char a = 'a';\n char b = 'a';\n char c = 'z';\n char d = 'B';\n\n boolean result1 = offByOne.equalChars(a, b);\n boolean result2 = offByOne.equalChars(a, c);\n boolean result3 = offByOne.equalChars(a, d);\n\n assertFalse(result1);\n assertFalse(result2);\n assertFalse(result3);\n }", "private boolean equalsChars(char[] first, char[] second) {\n for (int i = 0; i < second.length; i++)\n if (first[i] != second[i])\n return false;\n return true;\n }", "@Test\r\n public void testEqualChars(){\r\n boolean res1=offByOne.equalChars('c','b');\r\n assertTrue(\"should be true\",res1);\r\n boolean res2=offByOne.equalChars('a','c');\r\n assertFalse(\"should be false\",res2);\r\n }", "public int String_Compare(String A, String B) {\n\t\t\n\t\tint shorter_length;\n\t\tif(A.length() >= B.length()) {\n\t\t\tshorter_length=B.length();\n\t\t}\n\t\telse {\n\t\t\tshorter_length=A.length();\n\t\t}\n\t\t\n\n\t\t\n\t\t\n\t\tint i = 0;\n\t\tint A_char;\n\t\tint B_char;\n\t\t\n\t\twhile(i < shorter_length ) {\n\t\t\tA_char = (int)A.charAt(i);\n\t\t\tB_char = (int)B.charAt(i);\n\n\t\t\tif(A_char != B_char) {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\ti+=1;\n\t\t}\n\t\treturn 0;\n\t}", "@Test\n public void testComp2()\n {\n System.out.println(\"comp\");\n String compString = \"D+M\";\n assertEquals(\"1000010\", N2TCode.comp(compString));\n }", "private static int coutSubst(char c1, char c2)\n {\n if (c1 == c2) return 0;\n return 1;\n }", "@Test\n public void testEqualChar3() {\n char a = '%';\n char b = '!';\n char c = '\\t';\n char d = '\\n';\n\n boolean result1 = offByOne.equalChars(a, b);\n boolean result2 = offByOne.equalChars(c, d);\n\n assertFalse(result1);\n assertTrue(result2);\n }", "public boolean isEquivalent(char character, char anothercharacter);", "public static void main(String[] args) {\n\t\tCharacter c1 = new Character('A');\n\t\tCharacter c2 =new Character('b');\n\t\tSystem.out.println(c1+\"与\"+c2+\"相等吗?\"+c1.equals(c2));\n\t\tSystem.out.println(c1+\"小写是 \"+c1.toLowerCase(c1));\n\t\tSystem.out.println(c2+\"小写是 \"+c2.toLowerCase(c2));\n\t}", "@Override\npublic int compare(String first, String second) {\n\tint ans= Integer.compare(first.length(), second.length());\n\t//\n\t\n\t\n\t\n\t\n\treturn ans;\n\t//\n\t\n\t\n}", "public static int compareString(String firstString, String secondString) {\n if (isEmptyString(firstString) || isEmptyString(secondString)) {\n if (isEmptyString(firstString) && isEmptyString(secondString)) {\n return 0;\n } else if (isEmptyString(firstString)) {\n return 1;\n } else if (isEmptyString(secondString)) {\n return -1;\n }\n }\n\n char charOfFirst = firstString.charAt(0);\n char charOfSecond = secondString.charAt(0);\n int result = compareChar(charOfFirst, charOfSecond);\n\n if (result == 0) {\n return compareString(firstString.substring(1), secondString.substring(1));\n }\n\n return result;\n }", "public int compare(String str1, String str2) {\n\t\t\t\ttry{\r\n\t\t\t\t\treturn Integer.parseInt(str1) - Integer.parseInt(str2) > 0 ? 1 : -1;\r\n\t\t\t\t}\r\n\t\t\t\tcatch (Exception e){\r\n\t\t\t\t\tSystem.out.print(e.getMessage());\r\n\t\t\t\t}\t\r\n\t\t\t\treturn 1;\r\n\t\t\t}", "public static int commonCharacterCount(String s1, String s2) {\n\t int count = 0;\n\t int auxArray[] = new int[s2.length()];\n\t for (int i = 0; i < auxArray.length; i++){\n\t\tauxArray[i] = 0;\n\t }\n\t \n\t for(int i = 0; i < s1.length(); i++){\n\t\tfor(int j = 0; j < s2.length(); j++){\n\t\t if( auxArray[j] == 1){\n\t\t continue;\n\t\t }\n\t\t else{\n\t\t if(s1.charAt(i) == s2.charAt(j)){\n\t\t auxArray[j] = 1;\n\t\t count += 1;\n\t\t break;\n\t\t }\n\t\t }\n\t\t}\n\t }\n\t return count;\n\t}", "public void testCompareIntegerStrings() {\n\t\tString one = 1+\"\";\n\t\tString two = 2+\"\";\n\t\t//1 ist kleiner 2\n\t\tassertTrue(comp.compareInteger(one, two) == -1);\n\t\tassertTrue(comp.compareInteger(one, one) == 0);\n\t\tassertTrue(comp.compareInteger(two, one) == 1);\n\t}", "public boolean isIsomorphic(String str1, String str2) {\r\n if(str1.length() != str2.length()) return false;\r\n \r\n int[] arr1 = new int[256];\r\n int[] arr2 = new int[256];\r\n \r\n Arrays.fill(arr1, -1);\r\n Arrays.fill(arr2, -1);\r\n \r\n for(int i=0;i<str1.length();i++){\r\n int value1 = str1.charAt(i);\r\n int value2 = str2.charAt(i);\r\n if(arr1[value1]== -1){\r\n arr1[value1] = value2;\r\n } else {\r\n if(arr1[value1] != value2) return false;\r\n }\r\n \r\n if(arr2[value2]== -1){\r\n arr2[value2] = value1;\r\n } else {\r\n if(arr2[value2] != value1) return false;\r\n }\r\n \r\n }\r\n return true;\r\n \r\n}", "private static int ind(char a, char b) {\n return (a == b) ? 1 : 0;\n }", "@Test\n public void testEqualChars2()\n {\n assertTrue(offBy2.equalChars('a', 'c')); // true\n assertTrue(offBy2.equalChars('c', 'a')); // true\n assertTrue(offBy2.equalChars('e', 'g')); // true\n\n assertFalse(offBy2.equalChars('C', 'c')); // false\n assertFalse(offBy2.equalChars('a', 'e')); // false\n assertFalse(offBy2.equalChars('z', 'a')); // false\n assertFalse(offBy2.equalChars('k', 's')); // false\n }", "private boolean translateWith2ExchangedChars(String input1, String input2) {\n if (StringUtils.isBlank(input1) || StringUtils.isBlank(input2) || input1.length() != input2.length()) {\n return false;\n }\n if (input1.equals(input2)) {\n for (int i = 0; i < input1.length(); i++) {\n char current = input1.charAt(i);\n if (input1.lastIndexOf(current) != i) {\n return true;\n }\n }\n return false;\n } else {\n int first = -1, second = -1;\n for (int i = 0; i < input1.length(); i++) {\n if (input1.charAt(i) != input2.charAt(i)) {\n if (first == -1) {\n first = i;\n } else if (second == -1) {\n second = i;\n } else {\n return false;\n }\n }\n }\n return input1.charAt(first) == input2.charAt(second)\n && input1.charAt(second) == input2.charAt(first);\n }\n }", "public static void main(String[] args) {\n\n\t\t\n\t\tfinal char b = (char) (126+12);\n\t\t//es una variable de tipo comnstante la cual no acepta cambios \n\t\tfinal String str1 = \"hola\";\n\t\tfinal String str2 = \"mundo\";\n\t\t\n\t\tSystem.out.println(\"holamundo\"==(str1+str2));\n\t\tSystem.out.println(b);\n\t}", "public static void main(String[] args) {\nString a = \"aab\";\nString b = \"baa\";\nSystem.out.println(compare(a,b));\n\t}", "private int compareInternal(String shorter, String longer) {\n int lengthDiff = longer.length() - shorter.length();\n\n for (int compareStartIndexInsideLonger = 0; compareStartIndexInsideLonger <= lengthDiff; compareStartIndexInsideLonger++) {\n String compariosonPartFromLonger = longer.substring(compareStartIndexInsideLonger, compareStartIndexInsideLonger + shorter.length());\n //we have found an answer if they are not equal\n int result = shorter.compareTo(compariosonPartFromLonger);\n if (result != 0) {\n return result;\n }\n }\n\n //the are equal\n return 0;\n }", "public static boolean compareLetters(String romConcat, char smallNum, char bigNum) {\n\t\tint checkSmall = 0, checkBig = 0;\r\n\t\t\r\n\t\tif(romConcat.indexOf(smallNum) > -1) {\r\n\t\t\tcheckSmall = romConcat.indexOf(smallNum);\r\n\t\t}\r\n\t\t\r\n\t\tif(romConcat.indexOf(bigNum) > -1) {\r\n\t\t\tcheckBig = romConcat.indexOf(bigNum);\r\n\t\t}\r\n\t\t\r\n\t\tif(checkSmall == 0 || checkBig == 0) {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse if(checkSmall < checkBig) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse {\r\n\t\t\treturn true;\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\nScanner sc=new Scanner(System.in);\r\nString a=sc.nextLine();\r\nString b=sc.nextLine();\r\nchar ch1[]=a.toCharArray();\r\nchar ch2[]=b.toCharArray();\r\nint l1=ch1.length;\r\nint l2=ch2.length;\r\nint n=0;\r\nif(l1==l2)\r\n{\r\n\tfor(int i=0;i<l1;i++)\r\n\t{\r\n\t\tif(ch1[i]!=ch2[i])\r\n\t\t{\r\n\t\t\tn=n+1;\r\n\t\t}\r\n\t}\r\n\tif(n==1)\r\n\t\tSystem.out.println(\"yes\");\r\n\telse\r\n\t\tSystem.out.println(\"no\");\r\n}\r\nelse\r\n\tSystem.out.println(\"no\");\r\n\t}", "public static int getVeryLongCompare(String a, String b) {\r\n\t\tif(a.equals(b))\r\n\t\t\treturn 0;\r\n\t\telse {\r\n\t\t\tint result = 0;\r\n\t\t\tboolean minus = false;\r\n\t\t\tif(a.charAt(0) == 45 && b.charAt(0) != 45) return -1;\r\n\t\t\tif(a.charAt(0) != 45 && b.charAt(0) == 45) return 1;\r\n\t\t\tif(a.charAt(0) == 45 && b.charAt(0) == 45) { \r\n\t\t\t\tminus = true;\r\n\t\t\t\ta = a.substring(1,a.length());\r\n\t\t\t\tb = b.substring(1,b.length());\r\n\t\t\t}\r\n\t\t\tif (a.charAt(0) == 46) a = \"0\" + a;\r\n\t\t\tif (b.charAt(0) == 46) b = \"0\" + b;\r\n\t\t\twhile(a.charAt(0) == 48 && a.charAt(1) != 46)\r\n\t\t\t\ta = a.substring(1,a.length());\r\n\t\t\twhile(b.charAt(0) == 48 && b.charAt(1) != 46)\r\n\t\t\t\tb = b.substring(1,b.length());\r\n\t\t\tboolean done = false;\r\n\t\t\tint aPointPos = a.indexOf(\".\");\r\n\t\t\tint bPointPos = b.indexOf(\".\");\r\n\t\t\tint aLength = a.length();\r\n\t\t\tint bLength = b.length();\r\n\t\t\tint aIntegerPart = aLength; \r\n\t\t\tint bIntegerPart = bLength;\r\n\t\t\tint aCurDigit = 0;\r\n\t\t\tint bCurDigit = 0;\r\n\t\t\tif (aPointPos > -1) {\r\n\t\t\t\taIntegerPart = aPointPos;\r\n\t\t\t}\r\n\t\t\tif (bPointPos > -1) {\r\n\t\t\t\tbIntegerPart = bPointPos;\r\n\t\t\t}\r\n\t\t\tif (aIntegerPart != bIntegerPart) {\r\n\t\t\t\tdone = true;\r\n\t\t\t\tif(aIntegerPart > bIntegerPart)\tresult = 1;\r\n\t\t\t\telse result = -1;\r\n\t\t\t} else {\r\n\t\t\t\tfor (int i = 0; i < aIntegerPart; i++) {\r\n\t\t\t\t\taCurDigit = a.charAt(i) - 48;\r\n\t\t\t\t\tbCurDigit = b.charAt(i) - 48;\r\n\t\t\t\t\tif(aCurDigit != bCurDigit) {\r\n\t\t\t\t\t\tdone = true;\r\n\t\t\t\t\t\tif(aCurDigit > bCurDigit) { result = 1; }\r\n\t\t\t\t\t\telse { result = -1; }\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tint maxFloatPart = Math.max(aLength - aIntegerPart - 1, bLength - bIntegerPart - 1);\r\n\t\t\t\tif(!done) {\r\n\t\t\t\t\tfor (int i = 0; i < maxFloatPart; i++) {\r\n\t\t\t\t\t\tif(aLength < aIntegerPart + i + 2) {\r\n\t\t\t\t\t\t\taCurDigit = 0;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\taCurDigit = a.charAt(aIntegerPart + i + 1) - 48;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(bLength < bIntegerPart + i + 2) {\r\n\t\t\t\t\t\t\tbCurDigit = 0;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tbCurDigit = b.charAt(bIntegerPart + i + 1) - 48;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tif(aCurDigit != bCurDigit) {\r\n\t\t\t\t\t\t\tdone = true;\r\n\t\t\t\t\t\t\tif(aCurDigit > bCurDigit) { result = 1; }\r\n\t\t\t\t\t\t\telse { result = -1; }\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(minus) result = 0 - result;\r\n\t\t\treturn result;\r\n\t\t}\r\n\t}", "public static int compareCharSequences(CharSequence a, CharSequence b, boolean ignoreCase) {\n if (a == b) {\n return 0;\n }\n if (a instanceof String && b instanceof String) {\n return ((String) a).compareTo((String) b);\n }\n int aLength = a.length();\n int bLength = b.length();\n if (aLength == 0 && bLength == 0) {\n return 0;\n }\n int max = Math.min(aLength, bLength);\n for (int i = 0; i < max; i++) {\n char ac = ignoreCase ? Character.toLowerCase(a.charAt(i)) : a.charAt(i);\n char bc = ignoreCase ? Character.toLowerCase(b.charAt(i)) : b.charAt(i);\n int result = Character.compare(ac, bc);\n if (result != 0) {\n return result;\n }\n }\n if (aLength == bLength) {\n return 0;\n } else if (aLength > bLength) {\n return 1;\n } else {\n return -1;\n }\n }", "@Test\n public void testToChar() {\n Object[][] datas = new Object[][]{\n {1, '1'},\n {5, '5'},\n {10, 'A'},\n {11, 'B'},\n {12, 'C'},\n {13, 'D'},\n {14, 'E'},\n {15, 'F'}\n };\n for (Object[] data : datas) {\n char result = Tools.toChar((Integer) data[0]);\n char expResult = (Character) data[1];\n assertEquals(result, expResult);\n System.out.println(\"testToChar()\");\n }\n }", "private boolean alphabCheck(String first, String second) {\n\t\tif (first.length() == 1 || second.length() == 1) {\n\t\t\tif (first.compareTo(second) < 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tif (first.substring(0, 1).compareTo(second.substring(0,1)) < 0) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif (first.substring(0, 1).compareTo(second.substring(0,1)) == 0) {\n\t\t\t\t\treturn alphabCheck(first.substring(1, first.length()),second.substring(1,second.length()));\n\t\t\t\t}\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "private static int way(char charAt, char charAt2) {\n\t\tStringBuilder sb = new StringBuilder();\r\n\t\tsb.append(charAt);\r\n\t\tsb.append(charAt2);\r\n\t\t\r\n\t\tif(Integer.parseInt(sb.toString()) <= 26) return 1;\r\n\t\treturn 0;\r\n\t}", "public int isSameCharaters(String input) {\n\t\tif(input.length() > 1 && input.charAt(0) == input.charAt(input.length() - 1)) {\n\t\t\treturn 1;\n\t\t} else {\n\t\t\treturn -1;\n\t\t}\n\t}", "public static void main(String[] args) {\n\r\n\t\tString s1=\"abcd\";\r\n\t\tString s2=\"vbvabcdqwe\";\r\n\t\tchar arr1[]=s1.toCharArray();\r\n\t\tchar arr2[]=s2.toCharArray();\r\n\r\n\t\tint flag=0;\r\n\t\tfor(int i=0;i<arr1.length;i++)\r\n\t\t{\r\n\t\t\tfor(int j=i;j<arr2.length;j++)\r\n\t\t\t{\r\n\t\t\t\tif(arr1[i]==arr2[j])\r\n\t\t\t\t{\r\n\t\t\t\t\t\r\n\t\t\t\t}\t\r\n\t\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "static String twoStrings(String s1, String s2){\n // Complete this function\n String letters = \"abcdefghijklmnopqrstuvwxyz\";\n for(int i=0;i<letters.length();i++){\n char lettersChar = letters.charAt(i); \n if(s1.indexOf(lettersChar) > -1 && s2.indexOf(lettersChar) > -1){\n return \"YES\";\n }\n }\n \n return \"NO\";\n }", "private int compare(String str1, String str2) {\n int result;\n\n if (str1 == null) {\n result = (str2 == null) ? 0 : -1;\n\n } else if (str2 == null) {\n result = 1;\n\n } else {\n result = str1.compareTo( str2 );\n }\n return result;\n }", "public int compare(WritableComparable o1, WritableComparable o2) {\r\n\t\tText key1 = (Text) o1;\r\n\t\tText key2 = (Text) o2;\r\n\t\tint t1char = key1.charAt(0); \r\n\t\tint t2char = key2.charAt(0); \r\n\t\tif (t1char < t2char) return 1;\r\n\t\telse if (t1char > t2char) return -1;\r\n\t\telse return 0;\r\n\t}", "public boolean compare_same(String x, String y) {\n\t\tint fuzzy = 0;\n\t\tif (x.length() != y.length()) return false;\n\t\tfor (int i = 0, j = 0; i<x.length() && j<y.length();) {\n\t\t\tif (i>0 && x.charAt(i-1)=='_' && '0'<=x.charAt(i) && x.charAt(i)<='9') {\n\t\t\t\twhile (i<x.length() && '0'<=x.charAt(i) && x.charAt(i)<='9') i++;\n\t\t\t}\n\t\t\tif (j>0 && y.charAt(j-1)=='_' && '0'<=y.charAt(j) && y.charAt(j)<='9') {\n\t\t\t\twhile (j<y.length() && '0'<=y.charAt(j) && y.charAt(j)<='9') j++;\n\t\t\t}\n\t\t\tif (i<x.length() && j<y.length() && x.charAt(i) != y.charAt(j)) {\t\t\t\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\ti++; j++;\n\t\t}\n\t\treturn true;\n\t}", "static int type_of_cmp(String passed){\n\t\tif(general_registers.contains(passed.charAt(4)))\n\t\t\treturn 1;\n\t\telse if(passed.charAt(4)=='M')\n\t\t\treturn 2;\n\t\telse\n\t\t\treturn 0;\n\t}", "public int minCharacters(String a, String b) {\n int[] c1 = new int[26];\n int[] c2 = new int[26];\n for (char c: a.toCharArray()) {\n c1[c-'a']++;\n }\n for (char c: b.toCharArray()) {\n c2[c-'a']++;\n }\n\n // initialize res\n int m = a.length();\n int n = b.length();\n int res = m + n;\n\n // 1. make string a and b only consist of distinct character\n for (int i = 0; i < 26; ++i) {\n // means operations to change all characters(m+n) to character i (c1[i] and c2[i])\n res = Math.min(res, m + n - c1[i] - c2[i]);\n }\n\n // cal prefix sum\n // this prefix sum represents the frequency of all characters less than i;\n for (int i = 1; i < 26; ++i) {\n c1[i] += c1[i - 1];\n c2[i] += c2[i - 1];\n }\n\n // 2,3 a less than b or b less than a\n // why the up-limit is 25? cos, the character 'z' can not be the base character. there is no one\n for (int i = 0; i < 25; ++i) {\n // c1[i] for freq of characters less than or equal to i in a\n // c2[i] for freq of characters less than or equal to i in b\n\n // 2. make a < b\n // replace all characters less or equal to i in `b` to larger ones and all characters grater than i in `a` to less ones\n res = Math.min(res, c2[i] + m - c1[i]);\n // 3. make a > b\n // replace all characters less or equal to i in `a` to larger ones and all characters grater than i in `b` to less ones\n res = Math.min(res, c1[i] + n - c2[i]);\n }\n return res;\n }", "public static int compare(byte[] s1, byte[] s2) {\n int i;\n int len1 = s1.length;\n int len2 = s2.length;\n if (len1 > len2) {\n return 1;\n }\n if (len2 > len1) {\n return -1;\n }\n int acc = 0;\n for (i = 0; i < len1; i++) {\n acc += s1[i];\n acc -= s2[i];\n if (acc != 0) {\n return acc;\n }\n }\n return 0;\n }", "public static boolean isAnagram1(String s1, String s2) {\r\n int[] arr = new int[256]; //Number of Ascii Values\r\n\r\n for (int i = 0; i < s1.length(); i++) {\r\n arr[s1.charAt(i)]++;\r\n arr[s2.charAt(i)]--;\r\n }\r\n\r\n for (int i = 0; i < arr.length; i++) {\r\n if (arr[i] != 0) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n }", "public char test(char c) {\n\t\tchar[] lower = { '-', '+' };\n\t\tchar[] higher = { '*', '/' };\n\t\tfor (int i = 0; i < 2; i++) {\n\t\t\tif (lower[i] == c) {\n\t\t\t\treturn 'l';\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i < 2; i++) {\n\t\t\tif (higher[i] == c) {\n\t\t\t\treturn 'h';\n\t\t\t}\n\t\t}\n\t\t// just to make the method work , no meaning for the 'n'\n\t\treturn 'n';\n\t}", "public static int compareIgnoreCase(String firstString, String secondString){\n\t\tif(firstString.equalsIgnoreCase(secondString)){\n\t\t\treturn 0;\n\t\t}\n\t\tchar[] firstStringCharArray = firstString.toLowerCase().toCharArray();\n\t\tchar[] secondStringCharArray = secondString.toLowerCase().toCharArray();\n\t\tif(firstStringCharArray.length > 0 && !HaikuGenerator.isAWordCharacter(firstStringCharArray[0])\n\t\t\t\t&& secondStringCharArray.length > 0 && HaikuGenerator.isAWordCharacter(secondStringCharArray[0])){\n\t\t\t// First string starts with a non-word character (such as a number) while the second starts with a word-character (such as 'a')\n\t\t\t// -> the second string should be before the first string\n\t\t\treturn -1;\n\t\t}\n\t\tif(firstStringCharArray.length > 0 && HaikuGenerator.isAWordCharacter(firstStringCharArray[0])\n\t\t\t\t&& secondStringCharArray.length > 0 && !HaikuGenerator.isAWordCharacter(secondStringCharArray[0])){\n\t\t\t// First string starts with a word-character (such as 'a') while the second starts with a non-word character (such as a number)\n\t\t\t// -> the first string should be before the second string\n\t\t\treturn 1;\n\t\t}\n\t\tint i = 0;\n\t\twhile(true){\n\t\t\tif(firstStringCharArray[i] < secondStringCharArray[i]){\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tif(firstStringCharArray[i] > secondStringCharArray[i]){\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\tif(firstStringCharArray.length == i+1){\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t\tif(secondStringCharArray.length == i+1){\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t}", "public boolean highOrLow(char c1, char c2) {\n\t\tc1 = test(c1);\n\t\tc2 = test(c2);\n\n\t\tif (c2 < c1)\n\t\t\treturn true;\n\t\telse\n\t\t\treturn false;\n\t}", "public static void main(String[] args) {\n\t\tCharacter c1=new Character('F');\n\t\tCharacter c2=new Character('E');\n\t\tSystem.out.println(c1.equals(c2));\n\t\tc1=Character.toLowerCase(c1);\n\t\tc2=Character.toLowerCase(c2);\n\t\tSystem.out.println(c1.equals(c2));\n\t}", "private static boolean isEnglishAlphabetPermutation(String str1, String str2) {\r\n if (!validate(str1, str2)) {\r\n return false;\r\n }\r\n if (str1.isEmpty() && str2.isEmpty()) { // simple case\r\n return true;\r\n }\r\n str1 = str1.toLowerCase();\r\n str2 = str2.toLowerCase();\r\n\r\n // we can use array instead of hash map\r\n // because we definitely know amount of characters\r\n int[] counter = new int[CHARS_AMOUNT];\r\n int startCode = Character.codePointAt(\"a\", 0);\r\n for (int i = 0; i < str1.length(); i++) {\r\n int idx = str1.codePointAt(i) - startCode;\r\n if (idx < 0 || idx >= CHARS_AMOUNT) {\r\n throw new IllegalArgumentException(\"Unsupported character.\");\r\n }\r\n counter[idx]++;\r\n }\r\n // no need to create another array for checking\r\n for (int i = 0; i < str2.length(); i++) {\r\n int idx = str2.codePointAt(i) - startCode;\r\n if (idx < 0 || idx >= CHARS_AMOUNT) {\r\n throw new IllegalArgumentException(\"Unsupported character.\");\r\n }\r\n int checkValue = --counter[idx];\r\n if (checkValue < 0) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "private static int strCompare(char[] paramArrayOfChar1, int paramInt1, int paramInt2, char[] paramArrayOfChar2, int paramInt3, int paramInt4, boolean paramBoolean)\n/* */ {\n/* 2157 */ int i = paramInt1;\n/* 2158 */ int j = paramInt3;\n/* */ \n/* */ \n/* */ \n/* 2162 */ int i4 = paramInt2 - paramInt1;\n/* 2163 */ int i5 = paramInt4 - paramInt3;\n/* */ \n/* */ int i6;\n/* */ \n/* 2167 */ if (i4 < i5) {\n/* 2168 */ i6 = -1;\n/* 2169 */ k = i + i4;\n/* 2170 */ } else if (i4 == i5) {\n/* 2171 */ i6 = 0;\n/* 2172 */ k = i + i4;\n/* */ } else {\n/* 2174 */ i6 = 1;\n/* 2175 */ k = i + i5;\n/* */ }\n/* */ \n/* 2178 */ if (paramArrayOfChar1 == paramArrayOfChar2) {\n/* 2179 */ return i6;\n/* */ }\n/* */ int n;\n/* */ int i2;\n/* */ for (;;) {\n/* 2184 */ if (paramInt1 == k) {\n/* 2185 */ return i6;\n/* */ }\n/* */ \n/* 2188 */ n = paramArrayOfChar1[paramInt1];\n/* 2189 */ i2 = paramArrayOfChar2[paramInt3];\n/* 2190 */ if (n != i2) {\n/* */ break;\n/* */ }\n/* 2193 */ paramInt1++;\n/* 2194 */ paramInt3++;\n/* */ }\n/* */ \n/* */ \n/* 2198 */ int k = i + i4;\n/* 2199 */ int m = j + i5;\n/* */ \n/* */ int i1;\n/* */ int i3;\n/* 2203 */ if ((n >= 55296) && (i2 >= 55296) && (paramBoolean))\n/* */ {\n/* */ \n/* 2206 */ if ((n > 56319) || (paramInt1 + 1 == k) || \n/* */ \n/* 2208 */ (!UTF16.isTrailSurrogate(paramArrayOfChar1[(paramInt1 + 1)])))\n/* */ {\n/* 2210 */ if ((!UTF16.isTrailSurrogate(n)) || (i == paramInt1) || \n/* 2211 */ (!UTF16.isLeadSurrogate(paramArrayOfChar1[(paramInt1 - 1)])))\n/* */ {\n/* */ \n/* */ \n/* */ \n/* */ \n/* 2217 */ i1 = (char)(n - 10240);\n/* */ }\n/* */ }\n/* 2220 */ if ((i2 > 56319) || (paramInt3 + 1 == m) || \n/* */ \n/* 2222 */ (!UTF16.isTrailSurrogate(paramArrayOfChar2[(paramInt3 + 1)])))\n/* */ {\n/* 2224 */ if ((!UTF16.isTrailSurrogate(i2)) || (j == paramInt3) || \n/* 2225 */ (!UTF16.isLeadSurrogate(paramArrayOfChar2[(paramInt3 - 1)])))\n/* */ {\n/* */ \n/* */ \n/* */ \n/* */ \n/* 2231 */ i3 = (char)(i2 - 10240);\n/* */ }\n/* */ }\n/* */ }\n/* */ \n/* 2236 */ return i1 - i3;\n/* */ }", "@Override\n\tpublic int compare(String s1, String s2) {\n\t\t// if s1 = s2 returns 0\n\t\t// if s1 > s2 returns 1\n\t\t// if s1 < s2 returns -1\n\n\t\tint len1 = s1.length();\n\t\tint len2 = s2.length();\n\n\t\tif (len1 > len2) {\n\t\t\treturn 1;\n\t\t} else if (len1 < len2) {\n\t\t\treturn -1;\n\t\t}\n\t\treturn 0;\n\t}", "@SuppressWarnings(\"rawtypes\")\r\n\t@Override\r\n\tpublic int compare(WritableComparable a, WritableComparable b)\r\n\t{\n\t\tText left = (Text)a;\r\n\t\tText right = (Text)b;\r\n\t\t\r\n\t\tText realLeft = new Text(left.toString().split(\"-,-\")[1]);\r\n\t\tText realRight = new Text(right.toString().split(\"-,-\")[1]);\r\n\t\t\t\t\r\n\t\tint result = tc.compare(realLeft, realRight);\r\n\t\t\t\t\r\n\t\treturn result;\r\n\t}", "static boolean areSame(String expr1, String expr2)\n\t{\n\n\t\t// Create a vector for all operands and\n\t\t// initialize the vector as 0.\n\t\tint[] v = new int[MAX_CHAR];\n\n\t\t// Put signs of all operands in expr1\n\t\teval(expr1, v, true);\n\n\t\t// Subtract signs of operands in expr2\n\t\teval(expr2, v, false);\n\n\t\t// If expressions are same, vector must\n\t\t// be 0.\n\t\tfor (int i = 0; i < MAX_CHAR; i++)\n\t\t\tif (v[i] != 0)\n\t\t\t\treturn false;\n\n\t\treturn true;\n\t}", "public static int bccomp (String _left_operand , String _right_operand, int _scale) {\n//\t\treturn _left_operand.compareTo(_right_operand);\n\t\treturn ZendUtils.natsort(_left_operand, _right_operand);\n\t}", "private static boolean checkIfCanBreak( String s1, String s2 ) {\n\n if (s1.length() != s2.length())\n return false;\n\n Map<Character, Integer> map = new HashMap<>();\n for (Character ch : s2.toCharArray()) {\n map.put(ch, map.getOrDefault(ch, 0) + 1);\n }\n\n for (Character ch : s1.toCharArray()) {\n\n char c = ch;\n while ((int) (c) <= 122 && !map.containsKey(c)) {\n c++;\n }\n\n if (map.containsKey(c)) {\n map.put(c, map.getOrDefault(c, 0) - 1);\n\n if (map.get(c) <= 0)\n map.remove(c);\n }\n }\n\n return map.size() == 0;\n }", "public void testCompareStrings() {\n\t\tString one = \"Hello\";\n\t\tString two = \"in the house\";\n\t\t//Gro▀schreibung vor Kleinschreibung\n\t\tassertTrue(comp.compareStrings(one, two) < 0);\n\t\tassertEquals(0, comp.compareStrings(one, one));\n\t\tassertTrue(comp.compareStrings(two, one) > 0);\n\t}", "public boolean checkPermutaionOfStr(String str1, String str2){\n\tArrayList<Integer> word_cnt1 = new ArrayList<Integer>();\n\tArrayList<Integer> word_cnt2 = new ArrayList<Integer>();\n\t\n\tif(str1.length() != str2.length())\n\t\treturn false;\n\tfor(int i = 0; i< 256; i++){\n\t\tword_cnt1.add(0);\n\t\tword_cnt2.add(0);\n\t}\n\t\n\tfor(int i = 0; i< str1.length(); i++){\n\t\tcntStrChar(str1, word_cnt1, i);\n\t\tcntStrChar(str2, word_cnt2, i);\n\t}\n\t\n\tfor(int i = 0; i< 256; i++){\n\t\tif (word_cnt1.get(i) != word_cnt2.get(i) )\n\t\t\treturn false;\n\t}\n\treturn true;\n}", "@Override\n public int compare(String str1, String str2) {\n String digitRegex = \".*\\\\d+.*\";\n boolean hasDigits1 = str1.matches(digitRegex);\n boolean hasDigits2 = str2.matches(digitRegex);\n int result = -Boolean.valueOf(hasDigits1).compareTo(hasDigits2);\n\n if (result == 0) {\n // Secondary order: length, descending\n result = -Integer.valueOf(str1.length()).compareTo(str2.length());\n }\n\n return result;\n }", "static void cmp_with_mem(String passed){\n\t\tint val1 = hexa_to_deci(registers.get('A'));\n\t\tint val2 = hexa_to_deci(memory.get(memory_address_hl()));\n\t\tS = val1>=val2?false:true;\n\t\tval2 = 256-val2;\n\t\tval2%=256;\n\t\tval1+=val2;\n\t\tCS = val1>255?true:false;\n\t\tString b = Integer.toBinaryString(val1);\n\t\tint ones=0;\n\t\tfor(int i=0;i<b.length();i++)\n\t\t\tif(b.charAt(i)=='1')\n\t\t\t\tones++;\n\t\tZ = ones==0?true:false;\n\t\tP = ones%2==0?true:false;\n\t}", "public boolean compare2StringsIgnoringCasses(String s1, String s2)\r\n {\r\n String a=s1.toLowerCase();\r\n String b=s2.toLowerCase();\r\n if(a.length()!= b.length())\r\n {\r\n return false;\r\n }\r\n else\r\n {\r\n for(int i=0; i<a.length(); i++)\r\n {\r\n if(!comparet2Chars(a.charAt(i),b.charAt(i)))\r\n {\r\n return false;\r\n }\r\n }\r\n }\r\n return true;\r\n }", "public static int helper(String str) {\n\t\t// null & illegal checking here\n\t\tif(str == null){\n\t\t\treturn 0;\n\t\t}\n\t \n\t\tif(str.length() == 1){\n\t\t\treturn 1;\n\t\t}\n\t \n\t\tchar[] arr = str.toCharArray();\n\t\tchar p = arr[arr.length - 1];\n\t\tint result = 1;\n\t \n\t\tfor (int i = arr.length - 2; i >= 0; i--) {\n\t\t\tif (p == arr[i]) {\n\t\t\t\tresult++;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t \n\t\treturn result;\n\t}", "private static boolean letterDifferByOne(String word1, String word2) {\n if (word1.length() != word2.length()) {\n return false;\n }\n\n int differenceCount = 0;\n for (int i = 0; i < word1.length(); i++) {\n if (word1.charAt(i) != word2.charAt(i)) {\n differenceCount++;\n }\n }\n return (differenceCount == 1);\n }", "private static int strStr(String a, String b)\n\t{\n\t\tint aL=a.length();\n\t\tint bL=b.length();\n\t\tif(a.equals(b)){\n\t\t\treturn 0;\n\t\t}\n\t\tfor(int i=0;i<aL;i++){\n\t\t\tint j=i+bL;\n\t\t\tif(j<=aL){\n\t\t\t\tString subStr=a.substring(i, j);\n\t\t\t\tif(subStr.equals(b)){\n\t\t\t\t\treturn i;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "public boolean anagram(char [] a, char [] b);", "public static boolean isAnagramFuncApproach(String str1, String str2) {\n List<String> list1 = str1.chars()\n .sorted()\n .mapToObj(c -> Character.valueOf((char) c))\n .map(object -> Objects.toString(object, null))\n .collect(Collectors.toList());\n\n List<String> list2 = str2.chars()\n .sorted()\n .mapToObj(c -> Character.valueOf((char) c))\n .map(object -> Objects.toString(object, null))\n .collect(Collectors.toList());\n\n return list1.equals(list2);\n }", "public int compare(String a, String b) {\n if (base.get(a) >= base.get(b)) {\n return -1;\n } else {\n return 1;\n } // returning 0 would merge keys\n }", "public final int compare(final Term first, final Term second) {\n return first.getHebrewString().compareTo(second.getHebrewString());\n }", "public String comp(String s) {\n\t\tif(s.equals(\"0\")) {\n\t\t\treturn \"0101010\";\n\t\t} else if(s.equals(\"1\")) {\n\t\t\treturn \"0111111\";\n\t\t} else if(s.equals(\"-1\")) {\n\t\t\treturn \"0111010\";\n\t\t} else if(s.equals(\"D\")) {\n\t\t\treturn \"0001100\";\n\t\t} else if(s.equals(\"A\")) {\n\t\t\treturn \"0110000\";\n\t\t} else if(s.equals(\"M\")) {\n\t\t\treturn \"1110000\";\n\t\t} else if(s.equals(\"!D\")) {\n\t\t\treturn \"0001101\";\n\t\t} else if(s.equals(\"!A\")) {\n\t\t\treturn \"0110001\";\n\t\t} else if(s.equals(\"!M\")) {\n\t\t\treturn \"1110001\";\n\t\t} else if(s.equals(\"-D\")) {\n\t\t\treturn \"0001111\";\n\t\t} else if(s.equals(\"-A\")) {\n\t\t\treturn \"0110011\";\n\t\t} else if (s.equals(\"-M\")) {\n\t\t\treturn \"1110011\";\n\t\t} else if(s.equals(\"D+1\")) {\n\t\t\treturn \"0011111\";\n\t\t} else if(s.equals(\"A+1\")) {\n\t\t\treturn \"0110111\";\n\t\t} else if (s.equals(\"M+1\")) {\n\t\t\treturn \"1110111\";\n\t\t} else if(s.equals(\"D-1\")) {\n\t\t\treturn \"0001110\";\n\t\t} else if(s.equals(\"A-1\")) {\n\t\t\treturn \"0110010\";\n\t\t} else if(s.equals(\"M-1\")) {\n\t\t\treturn \"1110010\";\n\t\t} else if(s.equals(\"D+A\")) {\n\t\t\treturn \"0000010\";\n\t\t} else if(s.equals(\"D+M\")) {\n\t\t\treturn \"1000010\";\n\t\t} else if(s.equals(\"D-A\")) {\n\t\t\treturn \"0010011\";\n\t\t} else if(s.equals(\"D-M\")) {\n\t\t\treturn \"1010011\";\n\t\t} else if(s.equals(\"A-D\")) {\n\t\t\treturn \"0000111\";\n\t\t} else if(s.equals(\"M-D\")) {\n\t\t\treturn \"1000111\";\n\t\t} else if(s.equals(\"D&A\")) {\n\t\t\treturn \"0000000\";\n\t\t} else if(s.equals(\"D&M\")) {\n\t\t\treturn \"1000000\";\n\t\t} else if(s.equals(\"D|A\")) {\n\t\t\treturn \"0010101\";\n\t\t} else if(s.equals(\"D|M\")) {\n\t\t\treturn \"1010101\";\n\t\t}\n\t\telse {\n\t\t\treturn \"\";\n\t\t}\n\t}", "public static String contains(String input1, String input2){\n\t\tif((input1 == null && input2 ==null)){\n\t\t\treturn \"yes\";\n\t\t}else if (input1 == null || input2 == null){\n\t\t\treturn \"no\";\n\t\t}\n\t\tchar []input1Arr = input1.toCharArray();\n\t\tchar []input2Arr = input2.toCharArray();\n\t\tint []charMap = new int [256];\n\t\tfor (char ch:input1Arr){\n\t\t\tcharMap[ch] ++;\n\t\t}\n\t\tfor (char ch:input2Arr){\n\t\t\tif(charMap[ch]>=1){\n\t\t\t\tcharMap[ch]--;\n\t\t\t}else {\n\t\t\t\treturn \"no\";\n\t\t\t}\n\t\t}\n\t\treturn \"yes\";\n\t}", "static int makeAnagram(String a, String b) {\n int[] letters = new int[26];\n\n for (char c: a.toCharArray()){\n letters[c-'a']++;\n }\n\n for (char c: b.toCharArray()){\n letters[c-'a']--;\n }\n\n int sum = 0;\n\n for (int x:letters){\n sum+=Math.abs(x);\n }\n return sum;\n\n }", "private static boolean isAnagram(String a, String b) {\n\t\tint[] charsA = new int[26];\n\t\tint[] charsB = new int[26];\n\t\t\n\t\tfor(int i = 0 ; i < a.length(); i++)\n\t\t\tcharsA[a.charAt(i) - 'a']++;\n\t\tfor(int i = 0 ; i < b.length(); i++)\n\t\t\tcharsB[b.charAt(i) - 'a']++;\n\t\t\n\t\tfor(int i = 0 ; i < 26 ; i++) \n\t\t\tif(charsA[i] != charsB[i])\n\t\t\t\treturn false;\n\t\treturn true;\n\t}", "private static int textCompare(final Resource r1, final Resource r2) throws IOException {\n try (BufferedReader in1 =\n new BufferedReader(new InputStreamReader(r1.getInputStream()));\n BufferedReader in2 = new BufferedReader(\n new InputStreamReader(r2.getInputStream()))) {\n\n String expected = in1.readLine();\n while (expected != null) {\n final String actual = in2.readLine();\n if (!expected.equals(actual)) {\n if (actual == null) {\n return 1;\n }\n return expected.compareTo(actual);\n }\n expected = in1.readLine();\n }\n return in2.readLine() == null ? 0 : -1; //NOSONAR\n }\n }", "public static void main (String[] args) throws java.lang.Exception\n\t{\n\t\tScanner s = new Scanner(System.in);\n\t\tString s1=\"wipro\";\n\t\tString s2=\"technologies\";\n\t\tint i,j,temp;\n\t int a = s.nextInt();\n\t char[] c = s1.toCharArray();\n\t char[] d = s2.toCharArray();\n\t if(a==1)\n\t {\n\t \tfor(i=0;i<c.length;i++)\n\t \t{\n\t \t\tfor(j=0;j<d.length||j<c.length;j++)\n\t \t\t{\n\t \t\t\tif(c[i]==d[j])\n\t \t\t\t{\n\t \t\t\t\tSystem.out.println(c[i]);\n\t \t\t\t\tc[i]+='A'-'a';\n\t \t\t\t\td[j]+='A'-'a';\n\t \t\t\t\t\n\t \t\t\t\t\n\t \t\t\t}\n\t \t\t}\n\t \t}\n\t }\n\t \n\t else if(a==0)\n\t {\n\t \tfor(i=0;i<c.length;i++)\n\t \t{\n\t \t\tfor(j=0;j<d.length||j<c.length;j++)\n\t \t\t{\n\t \t\t\tif(c[i]!=d[j])\n\t \t\t\t{\n\t \t\t\t c[i]+='A'-'a';\n\t \t\t\t \n\t \t\t\t}\n\n\t \t\t}\n\t \t}\n\t for(i=0;i<d.length;i++)\n\t {\n\t \tfor(j=0;j<c.length;j++)\n\t \t\t{\n\t \t\t\tif(d[i]!=c[j])\n\t \t\t\t{\n\t \t\t\t d[i]+='A'-'a';\n\t \t\t\t \n\t \t\t\t}\n\n\t \t\t}\n\t \t}\n\t \t\n\t }\n\telse\n\t{\n\tSystem.out.println(\"no accepted value\");\n\t}\n\t \n\t \tSystem.out.print(c);\n\t \n\t \n\t \n\t \tSystem.out.print(d);\n\t \n\t}", "int compareStrings(String s1, String s2) {\n if (s1 == null) {\n return s2 == null ? 0 : -1;\n } else if (caseInsensitive) {\n return s1.compareToIgnoreCase(s2);\n } else {\n return s1.compareTo(s2);\n }\n }", "static int compareBytes(byte[] bs1, byte[] bs2) {\n int size = Math.min(bs1.length, bs2.length);\n int ret = compare(bs1, bs2, size);\n if (ret != 0) {\n return ret;\n }\n\n ret = bs1.length - bs2.length;\n if (ret != 0) {\n byte[] bs = (ret > 0) ? bs1 : bs2;\n for (int i = size; i < bs.length; i++) {\n if (bs[i] != (byte)0x0) {\n return ret;\n }\n }\n }\n return 0;\n }", "public static boolean isEqual(String s1, String s2) {\r\tif(s1.length() != s2.length()){\r\t return false;\r\t}\r\tfor(int i = 0; i< s1.length();i++){\r\t if (s1.charAt(i) != s2.charAt(i)){\r\t\treturn false;\r\t }\r\t}\r\treturn true;\r }", "public int stringMatch(String a, String b) {\n int result = 0;\n int end = (a.length()<=b.length()? a.length():b.length());\n for (int i = 0; i <end-1 ; i++){\n if (a.substring(i, i + 2).equals(b.substring(i, i + 2))) {\n result++;\n }\n }\n return result;\n }", "static int asciiCalc(String s) {\n\n\t\tint val = 0;\n\t\tfor (int i = 0; i < s.length(); i++) {\n\t\t\tif (s.charAt(i) % 2 == 0) {\n\t\t\t\t// if ascii value is even, mutiply by 1003\n\t\t\t\tval += s.charAt(i) * 1003;\n\t\t\t} else {\n\t\t\t\t// if ascii value is odd, multiply by 803\n\t\t\t\tval += s.charAt(i) * 803;\n\t\t\t}\n\n\t\t}\n\t\treturn val;\n\t}", "int getIndex(Character c)\n{\n int a = Character.getNumericValue('a');\n int z = Character.getNumericValue('z');\n int val = Character.getNumericValue(c);\n \n if (a <= val && val <= z) return val - a;\n return -1;\n}", "private static boolean diffOne(String s1, String s2) {\n int count = 0;\n for (int i = 0; i < s1.length(); i++) {\n if (s1.charAt(i) != s2.charAt(i)) count++;\n if (count > 1) return false;\n }\n return count == 1;\n }", "public static void main (String[]args){\n\t\t \r\n\t\tString s1= \"ratan\";\r\n\t\tString s2=\"anu\";\r\n\t\tString s3=\"ratan\";\r\n\t\tSystem.out.println(s1.equals(s2));\r\n\t\tSystem.out.println(s1.equals(s3));\r\n\t\tSystem.out.println(s3.equals(s2));\r\n\t\tSystem.out.println(\"Ratan\".equals(\"ratan\"));// ratan as a string or s1 is also work\r\n\t\tSystem.out.println(\"Ratan\".equalsIgnoreCase(s1));\r\n\t\t\r\n\t\t\r\n\t\t// Compareto ---------> return +value or -value\r\n\t\tSystem.out.println(s1.compareTo(s2));\r\n\t\tSystem.out.println(s1.compareTo(s3));\r\n\t\tSystem.out.println(s2.compareTo(s3));\r\n\t\t\r\n\t\tSystem.out.println(\"Ratan\".compareTo(\"ratan\"));// ratan or s1 also work as shown here\r\n\t\tSystem.out.println(\"Ratan\".compareToIgnoreCase(s1));\r\n\r\n}", "@Override\n public int compareTo(@Nonnull Letter other) {\n return ComparisonChain.start().compare(this.getContent(), other.getContent()).result();\n }", "static void perform_cmp(String passed){\n\t\tint type = type_of_cmp(passed);\n\t\tswitch(type){\n\t\tcase 1:\n\t\t\tcmp_with_reg(passed);\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tcmp_with_mem(passed);\n\t\t\tbreak;\n\t\t}\n\t}", "@Test\r\n public void test8() {\r\n String s1 = \"Abc\";\r\n String s2 = \"abc\";\r\n String s3 = \"Abcd\";\r\n System.out.println(s1.compareTo(s2));\r\n System.out.println(s1.compareTo(s3));\r\n }", "public int compare(String[] string1, String[] string2){\r\n\t\tint returnValue = 0;\r\n\t\tint int1 = 0;\r\n\t\tint int2 = 0;\r\n\t\t\r\n\t\tfor(int i = 0; i < string1.length; i++){\r\n\t\t\ttry{\r\n\t\t\t\tint1 = Integer.parseInt(string1[i]);\r\n\t\t\t\tint2 = Integer.parseInt(string2[i]);\r\n\t\t\t\t\r\n\t\t\t\tif(int1 < int2) {\r\n\t\t\t\t\treturnValue = -1;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tcatch(Exception e){}\r\n\r\n\t\t}\r\n\t\treturn returnValue;\r\n\t}", "@Override\r\n\tpublic int compare(String o1, String o2) {\n\t\treturn sortChars(o1).compareTo(sortChars(o2));\r\n\t}", "public int compare(Data d, Data d1) {\n return (int) d.character - (int) d1.character;\n }", "private static int binaryCompare(final Resource r1, final Resource r2) throws IOException {\n try (InputStream in1 = new BufferedInputStream(r1.getInputStream());\n InputStream in2 =\n new BufferedInputStream(r2.getInputStream())) {\n\n for (int b1 = in1.read(); b1 != -1; b1 = in1.read()) {\n final int b2 = in2.read();\n if (b1 != b2) {\n return b1 > b2 ? 1 : -1;\n }\n }\n return in2.read() == -1 ? 0 : -1;\n }\n }", "public static boolean isAnagram(String strOne, String strTwo) throws IllegalArgumentException {\n if (strOne == null || strTwo == null)\n throw new IllegalArgumentException(\"One or both strings is null\");\n\n /**\n * Replace spaces and lower case the strings, note that we could\n * do this check while building up the map, but this is somewhat simpler\n * to understand/read, and it also allows us to not have to check to index\n * out of bounds issues when iterating through characters\n */\n String strOneCopy = strOne.replaceAll(\"\\\\s\", \"\").toLowerCase();\n String strTwoCopy = strTwo.replaceAll(\"\\\\s\", \"\").toLowerCase();\n\n if (strOne.isEmpty() || strTwo.isEmpty())\n return false;\n\n int strOneLen = strOneCopy.length();\n int strTwoLen = strTwoCopy.length();\n\n // If the strings aren't the same length they cannot be anagrams\n if (strOneLen != strTwoLen)\n return false;\n\n HashMap<Character, Integer> charCount = new HashMap<Character, Integer>();\n\n\n /**\n * Build a map of the counts of each character.\n *\n * The count will be positive if a character appears in first string one or more\n * times more than it appears in the second string\n *\n * The count will be negative if a character appears in second string one or more\n * times more than it appears in the first string\n */\n for (int i = 0; i < strOneLen; i++) {\n\n /**\n * Get the character from string one, we're not worried about out of bound index issues here\n * as we've already checked that the strings are the same length so there should\n * be characters at every index here for both strings\n */\n char charValKey = strOneCopy.charAt(i);\n\n int charKeyCount = 0;\n\n // Check if we've already seen this character and get the existing count if so\n if (charCount.containsKey(charValKey))\n charKeyCount = charCount.get(charValKey);\n\n // Increment the count\n charCount.put(charValKey, ++charKeyCount);\n\n\n /**\n * Get the character from string two, we're not worried about out of bound index issues here\n * as we've already checked that the strings are the same length so there should\n * be characters at every index here for both strings\n */\n charValKey = strTwoCopy.charAt(i);\n charKeyCount = 0;\n\n // Check if we've already seen this character and get the existing count if so\n if (charCount.containsKey(charValKey))\n charKeyCount = charCount.get(charValKey);\n\n // Decrement the count\n charCount.put(charValKey, --charKeyCount);\n\n }\n\n\n for (int value : charCount.values()) {\n if (value != 0)\n return false;\n }\n\n return true;\n }", "private boolean oneCharOff( String word1, String word2 )\n {\n if( word1.length( ) != word2.length( ) )\n return false;\n int diffs = 0;\n for( int i = 0; i < word1.length( ); i++ )\n if( word1.charAt( i ) != word2.charAt( i ) )\n if( ++diffs > 1 )\n return false;\n return diffs == 1;\n }", "public static int compareStrings(String s1, String s2) {\n\t if (s1 == null) {\n\t\t return (s2 == null) ? 0 : -1;\n\t } else if (s2 == null) return 1;\n\t return s1.compareTo(s2);\n }" ]
[ "0.7013739", "0.6802726", "0.6648712", "0.6580633", "0.6507326", "0.6490616", "0.6482074", "0.6449149", "0.64477396", "0.6447352", "0.64140326", "0.6377382", "0.63710177", "0.63432574", "0.63425493", "0.63376385", "0.63369936", "0.62964803", "0.6295281", "0.6290428", "0.62704736", "0.62434864", "0.62098384", "0.6207413", "0.620178", "0.61377394", "0.6120856", "0.60968876", "0.6063281", "0.6018958", "0.60056263", "0.5999335", "0.59744614", "0.59525484", "0.5952464", "0.59311604", "0.5911391", "0.5897768", "0.5882901", "0.58750117", "0.58639896", "0.58498347", "0.58438075", "0.5832156", "0.5830543", "0.58214337", "0.58106244", "0.58084863", "0.57981503", "0.57970744", "0.57883036", "0.5777543", "0.5753069", "0.57449466", "0.57419974", "0.5739405", "0.5730194", "0.5723343", "0.571676", "0.56936496", "0.56654066", "0.5646281", "0.56439084", "0.56356573", "0.5625056", "0.5623356", "0.56142175", "0.561388", "0.5613789", "0.5603398", "0.5603301", "0.56009686", "0.5600797", "0.5595374", "0.5587838", "0.55819875", "0.5578326", "0.5564097", "0.55544734", "0.5542394", "0.5540172", "0.5537283", "0.55345035", "0.5533234", "0.5531907", "0.55300593", "0.55203664", "0.5520288", "0.55099076", "0.5508351", "0.5503899", "0.54976195", "0.5488445", "0.548719", "0.54828703", "0.5474169", "0.5471976", "0.5464027", "0.54591954", "0.54547036" ]
0.69269437
1
TODO Autogenerated method stub
public List<Usuario> getUsuarios() { return getUsuarioDAO().listarTodos(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
public void addUsuario(Usuario usuario) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
public void updateUsuario(Usuario usuario) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
public void deleteUsuario(Usuario usuario) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
TODO Autogenerated method stub
public Boolean verificarUsuario(int id, String password) { return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
/a cat Main class constructor
public Cat(final String name){ super(name); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Main() {\r\n\t}", "public Main() {\n\t\tsuper();\n\t}", "public Main() {\r\n }", "public Main() {\r\n }", "public Main() {}", "private Main() {\n\n super();\n }", "public Main() {\n }", "public Main() {\n }", "public Main() {\n }", "private Main ()\n {\n super ();\n }", "private Cat() {\n\t\t\n\t}", "public Main() {\n \n \n }", "public Main() {\r\n\t\tsuper();\r\n\t\tinitialize();\r\n\r\n\t}", "public Main() {\n // Required empty public constructor\n }", "private Main() {}", "private Main() {\n }", "public static void main(String[] args) {\n\t\tthisconstructor rv = new thisconstructor();\n\t\n\t\n\t}", "private Main()\n {{\n System.err.println ( \"Internal error: \"+\n\t \"unexpected call to default constructor for Main.\" );\n System.exit(-127);\n }}", "public static void main(String[] args) {\n\t\tConstructor cn=new Constructor(); \r\n\t\t// Note: no need to create object for constructor\r\n\t\r\n\t}", "ConstructorPractice () {\n\t\tSystem.out.println(\"Default Constructor\");\n\t}", "public static void main(String[] args) {\n\t\tnew FirstConstructor();\r\n\t\tnew FirstConstructor(\"Baxter\");\r\n\t}", "public static void main(String[] args) {\n\t\tcats a=new cats();\r\n\t\tSystem.out.println(a.cats(\"xxx\"));\r\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tConstructor obj = new Constructor(1);\n\t\t\n\t\n\t\t\n\t\t\n\n\t}", "public static void main(String[] args) {\n new Main();\n }", "public static void main(String[] args) {\n int a = 0;\n new Constr(a);\n\n\n\n }", "public static void main(String[] args) {\n\t\tCat cat=new Cat(\"Kira\",8); \n\t\tSystem.out.println(cat); \n\t\tcat.getSound(); \n\t\tcat.eat(); \n\t\tcat.eat(\"wiskas\"); \n\t}", "public static void main(String[] args) {\n\t\tnew Compo();\r\n\t}", "public static void main(String[] args){\r\n\t\tnew Book();\r\n\t}", "public LearnConstrouctor(){\n System.out.println(\" hello\");\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tStudentConstructor S=new StudentConstructor(101,\"ABC\");\r\n\t}", "private CommandLine() {\n\t}", "public static void main(String[] args) {\n ConstructorIntro obj2 = new ConstructorIntro(10);\n\n }", "Car()\r\n\t{\r\n\t\tSystem.out.println(\"hello\");\r\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\tdefaultconstructor d = new defaultconstructor();\r\n\tSystem.out.println(d.Age);\t\r\n\tSystem.out.println(d.Name);\r\n\r\n\t\t\r\n\t\t\r\n\r\n\t}", "public Constructor(){\n\t\t\n\t}", "public static void main(String[] args) {\n new Main();\r\n }", "public Main() {\n this(DEFAULT_SIZE);\n }", "public Main() {\n this(DEFAULT_SIZE);\n }", "public ProgramWilmaa()\n\t{\n\t}", "public static void main(String[] args) {\n\t\tnew Actions();\r\n\t\t//call constructor\r\n\t}", "public static void main(String[] args) {\n\r\n\t\tDefaultEx d = new DefaultEx();\r\n\t\tnew DefaultEx();\r\n\t\tSystem.out.println(\"Constructor Done\");\r\n\t}", "Cab(){\n\t\tSystem.out.println(\"Cab Object Constructed..\");\n\t}", "public static void main(String[] args) {\n Animal animal= new Animal(\"Animal\", 1,1,5,5);\n Dog dog= new Dog(\"Dingo\", 8,20,2,4,1,20, \"long silky\");\n \n }", "public static void main(String[] args) {\n\t\tConstructorTest a = new ConstructorTest();\r\n\r\n\t}", "public Cat(){\n\t\tsuper();\n\t}", "public static void main(String[] args) {\nnew Employee();// Calling the Constructor.\r\n\t}", "public static void main(String[] args) {\n\t\tCar car = new Car(2);\n\t}", "public static void main(String[] args) {\n\t\tCats c = new Cats(\"cats\");\n\t\tc.bark();\n\t\tString c_name=c.getName();\n\t\tSystem.out.println(c_name);\n\t\t\n\t}", "public static void main(String args[]) {\n Subclass subc = new Subclass();\r\n }", "public static void main(String[] args) \r\n\t{\n one obj = new one();\r\n\t}", "public static void main(String[] args) {\n\t\tConstructor con=new Constructor();\n\t\tcon.Print();\n\t\tConstructor co=new Constructor(10,25);\n\t\tco.Print();\n\t\t\n\t\t\n\n\t}", "public static void main(String[] args) {\n new C();\n }", "TypesOfConstructor(){\n System.out.println(\"This is default constructor\");\n }", "ConstuctorOverloading(){\n\t\tSystem.out.println(\"I am non=argument constructor\");\n\t}", "public static void main(String[] args) throws IOException {\n\t\t// creating local class objects \n\t\t\n\t}", "public static void main(String[] args) {\n\n\t\t\n\t\tSystem.out.println(\"This is my class \");\n\t}", "private ThoseMain()\n {\n // Do nothing\n }", "public Animal(){\n System.out.println(\"An animal has been created...\");\n }", "public CyanSus() {\n\n }", "public static void main(String[] args) {\n My obj2=new My(9);//--->called overloaded Constructor\n }", "public static void main(String[] args) {\n\t\t\r\n\t\tLion l = new Lion();\r\n\t\tSystem.out.println(l);\r\n\t}", "public static void main(String[] args) {\n\r\n ContaEspecial contaEspecial1 = new ContaEspecial(\"\", \"\");\r\n // ContaEspecial contaEspecial2 = new ContaEspecial();\r\n }", "public static void main(String[] args)\n\t{\n\t\tJavaClass jc=new JavaClass();\n\t\tjc.name=null;\n\t\tjc.id=0;\n\t\t//constructor\n\t\tJavaClass jc2=new JavaClass();\n\t\t//method\n\t\tJavaClass jc3=new JavaClass();\n\t\tjc3.intiailize();\n\t\t\n\t\t//anonymous object\n\t\tnew JavaClass().intiailize();\n\t\n\t\t//copy constructor\n\t\t\n\t\tJavaClass copyConstructor=new JavaClass(jc2);\n\t\tSystem.out.println(copyConstructor.name);\n\t\t\n\n\t}", "public Overview() {\n\t\t// It will work whenever i create object with using no parameter const\n\t\tSystem.out.println(\"This is constructor\");\n\t}", "private MainConst() {\n super(\"\");\n }", "public static void main(String[] args) {\n\t\tnew TestConstructor2();\r\n\r\n\t}", "public static void main(String[] args) {\n\t\tnew Leaf();\n\t\t\n\t\tSystem.out.println(\"--------------------\");\n\t\tnew Leaf();\n\t\tSystem.out.println(\"--------------------\");\n\t\tnew Leaf();\n\t}", "public static void main(String[] args) {\n\t\tnew Main();\n\t}", "public static void main(String[] args) {\n\t\tnew Main();\n\t}", "public static void main(String[] args) {\n\t\tnew Main();\n\t}", "public static void main(String[] args) {\n\t\tnew Main();\n\t}", "public static void main(String[] args) {\n\t\tnew Main();\n\t}", "public static void main(String[] args) {\r\n\t\t\r\n\t\tnew CC(1000);\r\n\t}", "private void __sep__Constructors__() {}", "Constructor() {\r\n\t\t \r\n\t }", "public static void main(String[] args) {\n\t\tCat Horace = new Cat(\"Horace\");\n\n // 1. Make the Cat meow\n\t\tHorace.meow();\n\t\t\n\t\t// 2. Get the Cat to print it's name\n\t\tHorace.printName();\n\n\t\t// 3. Kill the Cat!\n\t\tHorace.kill();\n\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tnew Main();\n\t\t\n\t}", "public static void main(String [] args){\n Main m = new Main(args);\n }", "public static void main(String[] args) {\n\t\tnew main();\n\t}", "public static void main(String[] args) {\n\t\tnew AjoutLigue();\r\n\t}", "public Chick() {\n\t}", "public void main(){\n }", "private Human() {\n\t\tSystem.out.println(\"Human no args constructor called\");\n\t\thumanCounter++;\n\t}", "public FeatureSynthesisMain() {\n super();\n }", "public void Main(){\n }", "public static void main(String[] args) {\n\t\tdog d = new dog();\n\t\t//System.out.println(d.pig);\n\t}", "public Human() { // has to be name of class — COnstuctor\n\t\t\n\t\tname = \"\";\n\t\tage = 0;\n\t\tSystem.out.println(\"CONSTRUCTOR HERE\");\n\t\t\n\t}", "public static void main(String[] args) {\n for(int i=0; i<10; i++){\n Constructor c=new Constructor (i);\n c.Constructor(\"Who\");\n \n } \n }", "public static void main(String[] args){\n Rectangle obj = new Rectangle(5, 3);\n }", "public TennisCoach () {\n\t\tSystem.out.println(\">> inside default constructor.\");\n\t}", "public static void main( String[] args )\n {\n System.out.println(\"hi there.\");\n new Kal();\n }", "public static void main(String[] args) {\n new Program();\n }", "public static void main(String[] args) {\n MainIntrence mainintrence = new MainIntrence();\r\n\r\n\r\n\r\n }", "public static void main(String[] args) {\n\t\tAnimal cat = new Cat();\n\t\tcat.eat();\n\t\t\n\t\tSystem.out.println(\"----------\");\n\t\t\n\t\tCat c1 = new Cat(\"吾皇\", 4);\n\t\tSystem.out.println(c1.getName()+\" - \"+c1.getAge());\n\t\tc1.eat();\n\t\tc1.play();\n\t\t\n\t\tSystem.out.println(\"----------\");\n\t\t\n\t\tDog d1 = new Dog(\"巴匝黑\",3);\n\t\tSystem.out.println(d1.getName()+\" - \"+d1.getAge());\n\t\td1.eat();\n\t\td1.grant();\n\t}", "public static void main(String[] args) {\n\t\tPerson p = new Person();\n\t\tp.name = \"张三\";\n\t\tp.age = 20;\n\t\tp.address = \"USA\";\n\t\tp.introduce();\n\n\t}", "public static void main(String[] args) {\n\t\t\n\t\t\n\t\tBullDog b = new BullDog();\n\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tMainAnimal mainAnimal = new MainAnimal();\r\n\t\tmainAnimal.init();\r\n\t}", "public static void main(String[] args) {\n\t\tStudent stu = new Student();\n\t\t\n\t}", "public Demo() {\n\t\t\n\t}", "public HelloWorldProgramOutput ()\n {\n initialize();\n }" ]
[ "0.77789074", "0.7682776", "0.7648717", "0.7648717", "0.7593279", "0.75718004", "0.7565792", "0.75654995", "0.75654995", "0.7550237", "0.74117565", "0.7390179", "0.7370868", "0.7294764", "0.7266308", "0.7248286", "0.71934193", "0.71009004", "0.70782083", "0.7074966", "0.70453936", "0.7025054", "0.69324285", "0.68826973", "0.6813711", "0.68048185", "0.67685807", "0.674078", "0.6731935", "0.67072827", "0.6705207", "0.6702731", "0.66616994", "0.6660775", "0.66222197", "0.661666", "0.66044164", "0.66044164", "0.6598935", "0.6593379", "0.65887123", "0.6574156", "0.65667003", "0.65502244", "0.65363514", "0.6535435", "0.6535116", "0.6507628", "0.6502546", "0.6495086", "0.6478535", "0.6466967", "0.64598274", "0.64511967", "0.6449881", "0.64459276", "0.6421014", "0.6420184", "0.6414993", "0.6406718", "0.6402244", "0.6400978", "0.63989747", "0.63987696", "0.6383189", "0.6382271", "0.6372233", "0.6368828", "0.6368828", "0.6368828", "0.6368828", "0.6368828", "0.63685364", "0.6359442", "0.6350415", "0.6334041", "0.6325718", "0.6322333", "0.6318724", "0.63092643", "0.6304953", "0.62846595", "0.62692004", "0.62673557", "0.6264177", "0.626244", "0.6262182", "0.6256792", "0.62564665", "0.62525654", "0.62518305", "0.6250489", "0.62469", "0.62463784", "0.62443775", "0.6240002", "0.6238602", "0.6238063", "0.62359804", "0.6230934" ]
0.62759906
82
Class constructor with no parameters
public Cat(){ super(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@SuppressWarnings(\"unused\")\n public NoConstructor() {\n // Empty\n }", "defaultConstructor(){}", "void DefaultConstructor(){}", "private Instantiation(){}", "public Constructor(){\n\t\t\n\t}", "Reproducible newInstance();", "private SingleObject(){}", "public Method() {\n }", "private SingleObject()\r\n {\r\n }", "public Generic(){\n\t\tthis(null);\n\t}", "public Basic() {}", "public Clade() {}", "ConstuctorOverloading(){\n\t\tSystem.out.println(\"I am non=argument constructor\");\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "public Classe() {\r\n }", "public Person() {}", "public CyanSus() {\n\n }", "public ClassTemplate() {\n\t}", "public no() {}", "DefaultConstructor(int a){}", "public Curso() {\r\n }", "public Member() {}", "public Parser()\n {\n //nothing to do\n }", "ConstructorPractice () {\n\t\tSystem.out.println(\"Default Constructor\");\n\t}", "public Orbiter() {\n }", "public Demo3() {}", "public SpeakerSerivceImpl() {\n\t\tSystem.out.println(\"No args in constructor\");\n\t}", "public Pasien() {\r\n }", "public Student()\r\n {\r\n //This is intended to be empty\r\n }", "public GTFTranslator()\r\n {\r\n // do nothing - no variables to instantiate\r\n }", "public Parser()\n{\n //nothing to do\n}", "public AllDifferent()\n {\n this(0);\n }", "public God() {}", "public Parameters() {\n\t}", "private ATCres() {\r\n // prevent to instantiate this class\r\n }", "public Student(){}", "private static Constructor getZeroArgumentConstructor(Class cls) {\n \t\treturn ClassUtils.getConstructor(cls, new Class[] { }, zeroArgumentConstructors);\n \t}", "private SingleObject(){\n }", "public Person()\n {\n //intentionally left empty\n }", "VehicleClass() {}", "public lo() {}", "private void __sep__Constructors__() {}", "private Params()\n {\n }", "public Member() {\n //Empty constructor!\n }", "public Instance() {\n }", "public User() {\r\n this(\"\", \"\");\r\n }", "public PSRelation()\n {\n }", "public Person() {\n\t\t\n\t}", "public TestUser() {//NOPMD\n }", "public Sad() {\n }", "Classroom() {}", "public Overview() {\n\t\t// It will work whenever i create object with using no parameter const\n\t\tSystem.out.println(\"This is constructor\");\n\t}", "public Customer(){}", "public Postoj() {}", "public Classroom() {\n\t}", "public ObjectFactory() {\n\t}", "public ObjectFactory() {\r\n\t}", "public Implementor(){}", "public Vector() {\n construct();\n }", "MyEncodeableWithoutPublicNoArgConstructor() {}", "public Account() {\n this(0, 0.0, \"Unknown name\"); // Invole the 2-param constructor\n }", "public Data() {\n \n }", "public Test() {\n }", "public Node(){\n }", "public Data() {}", "public None()\n {\n \n }", "@Test\r\n\tpublic void test002_EmptyArgumentConstructor() {\r\n\t\tCustomer c = new Customer( \"\", \"\", \"\" );\r\n\t\tassertEquals( c.getId(), \"\" );\r\n\t\tassertEquals( c.getFirstName(), \"\" );\r\n\t\tassertEquals( c.getLastName(), \"\" );\r\n\t\tassertEquals( c.getContact(), \"\" );\r\n\t}", "public SgaexpedbultoImpl()\n {\n }", "public User(){\n this(null, null);\n }", "public Chick() {\n\t}", "public Node() {\n\t}", "@Test\n public void constructorDefault() {\n final CourseType courseType = new CourseType();\n\n assertNull(courseType.getId());\n assertNull(courseType.getName());\n assertNull(courseType.getPicture());\n assertNull(courseType.getPosition());\n assertNull(courseType.getStatus());\n assertNull(courseType.getCourses());\n assertNull(courseType.getAllowedDishes());\n }", "protected abstract void construct();", "public Person() {\n }", "public Person() {\n }", "public Person() {\n }", "public Person() {\n }", "public Spec__1() {\n }", "public TTau() {}", "public Identity()\n {\n super( Fields.ARGS );\n }", "private Consts(){\n //this prevents even the native class from \n //calling this ctor as well :\n throw new AssertionError();\n }", "public Node() {\r\n\t}", "public Node() {\r\n\t}", "public Rol() {}", "public Test()\n {\n }", "public Complex() {\n this(0);\n }", "public Bicycle() {\n // You can also call another constructor:\n // this(1, 50, 5, \"Bontrager\");\n System.out.println(\"Bicycle.Bicycle- no arguments\");\n gear = 1;\n cadence = 50;\n speed = 5;\n name = \"Bontrager\";\n }", "O() { super(null); }", "public JsonFactory() { this(null); }", "public Model() {\n\t}", "public Model() {\n\t}", "public Component() {\n }", "public Member() {\r\n\t}", "@SuppressWarnings(\"unused\")\r\n\tprivate Person() {\r\n\t}", "public Car() {\r\n this(\"\", \"\", \"\", 0, Category.EMPTY, 0.00, \"\", 0, \"\", 0.00, \"\", DriveTrain.EMPTY,\r\n Aspiration.EMPTY, 0.00, 0.00, 0.00, 0.00, 0.0, 0.0, 0.0, 0.0, 0.0);\r\n }", "public Operation() {\n\t}", "TypesOfConstructor(){\n System.out.println(\"This is default constructor\");\n }", "public Node() {}", "public Node() {}", "public Node() {}", "public Node() {}" ]
[ "0.79663783", "0.76110965", "0.7569161", "0.75166535", "0.7199728", "0.7143023", "0.711625", "0.70975965", "0.70728356", "0.7071158", "0.70085084", "0.6993913", "0.69661903", "0.6903352", "0.686188", "0.6851326", "0.6821186", "0.68019694", "0.67955595", "0.67636293", "0.67617434", "0.6749858", "0.67448676", "0.6743986", "0.67416227", "0.67380893", "0.6729537", "0.67217624", "0.6716915", "0.6705928", "0.6698876", "0.6694053", "0.6687209", "0.6685906", "0.6677234", "0.6669933", "0.66664267", "0.6660567", "0.6644039", "0.66391015", "0.66347754", "0.6632435", "0.66312146", "0.66283953", "0.66160405", "0.6614065", "0.6613611", "0.6612092", "0.6607825", "0.6596086", "0.6594393", "0.6594059", "0.65903217", "0.65890837", "0.6588739", "0.6585537", "0.6571878", "0.6571229", "0.6547519", "0.6545089", "0.65450513", "0.65394646", "0.6536704", "0.6536628", "0.6525496", "0.65244716", "0.6524031", "0.65222955", "0.65218437", "0.65200347", "0.65187347", "0.65142304", "0.65075326", "0.64987737", "0.64987737", "0.64987737", "0.64987737", "0.64960194", "0.64918053", "0.6490493", "0.64890724", "0.6481347", "0.6481347", "0.6477057", "0.6476376", "0.64734125", "0.647066", "0.6468333", "0.6467593", "0.64669824", "0.64669824", "0.6465905", "0.6464814", "0.6461044", "0.64566493", "0.64546293", "0.6451612", "0.6451131", "0.6451131", "0.6451131", "0.6451131" ]
0.0
-1
/ Say you have an array for which the ith element is the price of a given stock on day i. If you were only permitted to complete at most one transaction (ie, buy one and sell one share of the stock), design an algorithm to find the maximum profit.
public static int getMaxProfit(int[] values) { // We are allowed to compute only one transaction. So we will find min // and max value and will return the differrence. if (values == null || values.length <= 1) return 0; int min = values[0]; int profit = 0; for (int i = 1; i < values.length; i++) { profit = Math.max(profit, values[i] - min); min = Math.min(min, values[i]); } return profit; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int maxProfit(int[] prices) {\n int N = prices.length;\n int res = 0; // min, buy and sell on the same day\n for (int i = 0; i < N; i++) {\n for (int j = i; j < N; j++) {\n res = Math.max(res, prices[j] - prices[i]);\n }\n }\n return res;\n }", "public static int maxProfit(int[] prices) {\n\n //no stock can be sold\n if (prices == null) {\n return 0;\n }\n\n int buyDay = 0;\n int maxProfit = 0;\n for (int day = 1; day < prices.length; day++) {\n //update maxProfit\n int currentProfit = prices[day] - prices[buyDay];\n if (currentProfit > maxProfit) {\n maxProfit = currentProfit;\n } else if (currentProfit < 0) {\n //update buyDay\n buyDay = day;\n }\n }\n return maxProfit;\n }", "public static int findMaxProfit(int [] prices){\n int max_profit = 0;\r\n for (int i = 0;i<prices.length-1;i++){\r\n if(prices [i] < prices [i+1]){\r\n max_profit = max_profit + (prices[i+1]-prices[i]);\r\n }\r\n }\r\n return max_profit;\r\n }", "static int maxProfit(int[] prices)\n\t{\n\t\tint len = prices.length;\n\t\tint min = Integer.MAX_VALUE;\n\t\tint profit = 0;\n\t\tfor (int i = 0; i < len; i++)\n\t\t{\n\t\t\tmin = min > prices[i] ? prices[i] : min;\n\t\t\tprofit = prices[i] - min > profit ? prices[i] - min : profit; \n\t\t}\n\t\treturn profit;\n\t}", "public int maxProfit(int[] prices) {\n if (prices.length == 0) {\n return 0;\n }\n int days = prices.length;\n \n int[] profit1 = new int[days]; // I must sell on day i\n int[] profit2 = new int[days]; // I must rest on day i\n \n profit1[0] = 0; // Buy and sell immediately\n profit2[0] = 0; // Just do nothing\n \n for (int i = 1; i < days; i++) { // Not implemented yet\n profit1[i] = Math.max(profit2[i - 1] + prices[i], -1);\n profit2[i] = Math.max(profit1[i - 1], profit2[i - 1]);\n }\n \n return -1;\n }", "private static int maxProfit(int[] prices) {\n\t\tint profit = 0;\n\t\tint buyPrice = prices[0]; //min price to buy the stock\n\t\tfor(int i=1; i< prices.length; i++) {\n\t\t\tbuyPrice = Math.min(buyPrice, prices[i]);\n\t\t\tprofit = Math.max(profit, (prices[i]-buyPrice));\n\t\t}\n\t\treturn profit;\n\t}", "public int maxProfit(int[] prices) {\n \n \n int highestProfit = 0;\n\n //1\n int lengthIndex = prices.length-1;\n int[] lowest = getLowestPricesInTerm(prices);\n int[] highest = getHighestPricesInTerm(Arrays.copyOfRange(prices,lowest[1],lengthIndex));\n highestProfit = Math.max(highestProfit, highest[0]-lowest[0]);\n int[] secondLow;\n int[] secondHigh;\n\n // need to consider \"index out of bounds\"\n //2\n if(lowest[1]+1<=highest[1]-1){\n secondLow = getLowestPricesInTerm(Arrays.copyOfRange(prices,lowest[1]+1,highest[1]-1));\n secondHigh = getLowestPricesInTerm(Arrays.copyOfRange(prices,secondLow[1],highest[1]-1));\n highestProfit = Math.max(highestProfit, secondHigh[0]-lowest[0] + highest[0]-secondLow[0]);\n }\n \n //3\n if(lowest[1]-1>0){\n secondLow = getLowestPricesInTerm(Arrays.copyOfRange(prices,0,lowest[1]-1));\n secondHigh = getLowestPricesInTerm(Arrays.copyOfRange(prices,secondLow[1],lowest[1]-1));\n highestProfit = Math.max(highestProfit, secondHigh[0]-secondLow[0] + highest[0]-lowest[0]);\n }\n \n //4\n if(highest[1]+1<lengthIndex){\n secondLow = getLowestPricesInTerm(Arrays.copyOfRange(prices,highest[1]+1,lengthIndex));\n secondHigh = getLowestPricesInTerm(Arrays.copyOfRange(prices,secondLow[1],lengthIndex));\n highestProfit = Math.max(highestProfit, secondHigh[0]-secondLow[0] + highest[0]-lowest[0]);\n }\n \n \n return highestProfit;\n\n }", "public int maxProfit(int[] prices){\n int maxprofit = 0;\n for (int i=1;i<prices.length;i++){\n if(prices[i]>prices[i-1]){\n maxprofit += prices[i]-prices[i-1];\n }\n }\n return maxprofit;\n }", "public int maxProfitII(int[] prices) {\n if (prices == null || prices.length == 0) return 0;\n int profit = 0;\n int buyInPrice = prices[0];\n int sellPrice = prices[0];\n for (int i : prices) {\n if (i > sellPrice) {\n profit += i - sellPrice;\n buyInPrice = i;\n sellPrice = i;\n }\n if (i < buyInPrice) {\n buyInPrice = i;\n sellPrice = i;\n }\n }\n return profit;\n }", "public static int maxProfit2(int[] prices) {\n if (prices == null) {\n return 0;\n }\n\n int currentProfit = 0;\n int maxProfit = 0;\n for (int day = 1; day < prices.length; day++) {\n //update maxProfit\n int delta = prices[day] - prices[day - 1];\n currentProfit = Math.max(0, currentProfit + delta);\n maxProfit = Math.max(currentProfit, maxProfit);\n }\n return maxProfit;\n }", "public int maxProfit(int[] prices) {\n if(prices.length==0){\n return 0;\n }\n int max = 0;\n int valley = prices[0];\n int peak = prices[0];\n int i=0;\n while(i < prices.length-1){\n while(i<prices.length-1 && prices[i]>=prices[i+1])\n i++;\n valley = prices[i];\n while(i<prices.length-1 && prices[i]<=prices[i+1])\n i++;\n peak = prices[i];\n max += peak- valley;\n }\n return max;\n }", "public int maxProfitBF(int prices[]) {\n int maxprofit = 0;\n for (int i = 0; i < prices.length - 1; i++) {\n for (int j = i + 1; j < prices.length; j++) {\n int profit = prices[j] - prices[i];\n if (profit > maxprofit)\n maxprofit = profit;\n }\n }\n return maxprofit;\n }", "public int maxProfit(int[] prices) {\n\n if(prices.length==0) return 0;\n\n int[] dp = new int[3];\n\n dp[0] = -prices[0];\n\n dp[1] = Integer.MIN_VALUE;\n\n dp[2] = 0;\n\n for(int i=1; i<prices.length; i++){\n\n int hold = Math.max(dp[0], dp[2]- prices[i]);\n\n int coolDown = dp[0] + prices[i];\n\n int notHold = Math.max(dp[2], dp[1]);\n\n dp[0] = hold;\n\n dp[1] = coolDown;\n\n dp[2] = notHold;\n\n\n }\n\n return Math.max(Math.max(dp[0],dp[1]),dp[2]);\n\n }", "public int maxProfitOP(int prices[]) {\n int minprice = Integer.MAX_VALUE;\n int maxprofit = 0;\n for (int i = 0; i < prices.length; i++) {\n if (prices[i] < minprice)\n minprice = prices[i];\n else if (prices[i] - minprice > maxprofit)\n maxprofit = prices[i] - minprice;\n }\n return maxprofit;\n }", "@EpiTest(testDataFile = \"buy_and_sell_stock.tsv\")\n public static double computeMaxProfit(List<Double> prices) {\n\t Double min_price = Double.MAX_VALUE;\n\t double max_profit = 0;\n\t \n\t for(Double price : prices) {\n\t\t if(price< min_price) {\n\t\t\t min_price = price;\n\t\t }else {\n\t\t\t max_profit = Math.max(max_profit, price - min_price);\n\t\t }\n\t }\n return max_profit;\n }", "public int maxProfit(int[] prices) {\n if (prices == null || prices.length == 0) return 0;\n int profit = 0;\n int cur = prices[0];\n for (int i : prices) {\n if (i > cur) profit = Math.max(profit, i - cur);\n else cur = i;\n }\n return profit;\n }", "public int maxProfit(int[] prices) {\n if(prices.length==0) return 0;\n int T0=0;\n int T1=-(int)1e8;\n for(int val:prices){\n T0=Math.max(T0,T1 + val);\n T1=Math.max(T1,0 - val);\n }\n return T0;\n }", "public int maxProfit(int[] prices) {\n // IMPORTANT: Please reset any member data you declared, as\n // the same Solution instance will be reused for each test case.\n int profit = 0, previous = Integer.MAX_VALUE;\n \n for (int index = 0; index < prices.length; index++) {\n if(prices[index] > previous) {\n profit += prices[index] - previous;\n }\n previous = prices[index];\n }\n \n return profit;\n }", "static int findMaxProfit(int numOfPredictedDays, int[] predictedSharePrices) {\n int max = 0;\n for(int i = 0; i< numOfPredictedDays -1; i++)\n {\n for (int j = i+1; j< numOfPredictedDays;j++)\n {\n int temp = predictedSharePrices[j] - predictedSharePrices[i];\n if(temp > max)\n {\n max = temp;\n }\n }\n }\n return max;\n }", "public int maxProfit(int[] prices) {\n\t if(prices.length == 0){\n\t return 0;\n\t }\n\t int s0 = 0, s0prev = 0;\n\t int s1 = 0, s1prev=-prices[0];\n\t int s2 = 0, s2prev=Integer.MIN_VALUE;\n\t for(int p : prices){\n\t s0 = Math.max(s0prev,s2prev);\n\t s1 = Math.max(s1prev,s0prev-p);\n\t s2 = Math.max(s2prev,s1prev+p);\n\t s0prev=s0;\n\t s1prev=s1;\n\t s2prev=s2;\n\t }\n\t return Math.max(s0,s2);\n\t}", "public int maxProfit(int[] prices) {\n if(prices == null || prices.length == 0){\n return 0;\n }\n \n int buyPrice = prices[0];\n int max = 0;\n \n int len = prices.length;\n for(int i = 0; i < len; i++){\n if(prices[i] < buyPrice){\n buyPrice = prices[i];\n } else {\n int profit = prices[i] - buyPrice;\n max = profit > max ? profit : max;\n }\n }\n \n return max;\n }", "public int maxProfit(int[] prices) {\n if (prices == null || prices.length == 0) return 0;\n\n int profit = 0;\n for (int i = 1; i < prices.length; i++) {\n if (prices[i] > prices[i-1]) {\n profit += (prices[i] - prices[i-1]);\n }\n }\n\n return profit;\n }", "public int maxProfit(int[] prices) {\n if (prices == null || prices.length == 0) {\n return 0;\n }\n int res = 0, buy = Integer.MAX_VALUE;\n for (int price : prices) {\n buy = Math.min(buy, price);\n res = Math.max(res, price - buy);\n }\n return res;\n }", "public int maxProfit(int[] prices) {\n\t\tif( prices.length == 0 ) return 0;\n\t\tint profit = 0;\n\t\tfor( int i = 0; i < prices.length - 1; ++i )\n\t\t{\n\t\t\tif( prices[i] < prices[i+1] )\n\t\t\t\tprofit += prices[i+1] - prices[i];\n\t\t}\n\t\treturn profit;\n\t}", "public static int calculateMaximumProfit(int[] input) {\n int minPrice = Integer.MAX_VALUE;\n int maxPrice = Integer.MIN_VALUE;\n\n if (input == null || input.length <= 1) {\n return 0;\n }\n\n for (int currentPrice : input) {\n minPrice = getMinPrice(minPrice, currentPrice);\n maxPrice = getMaxPrice(maxPrice, currentPrice);\n }\n return maxPrice - minPrice;\n }", "public static long stockmax(List<Integer> prices) {\n\t\t// Write your code here\n\t\tlong profit=0L;\n\t\tlong maxSoFar=0L;\n\t\t for (int i = prices.size() - 1; i > -1 ; i--) {\n\t if (prices.get(i) >= maxSoFar) {\n\t maxSoFar = prices.get(i);\n\t }\n\t profit += maxSoFar - prices.get(i);\n\t }\n\t return profit;\n\t}", "public static int maximumProfit(int[] input){\n\t\tint maxTotalProfit = 0;\n\t\tList<Integer> firstBuySellProfits = new ArrayList<Integer>();\n\t\tint minPriceSoFar = Integer.MAX_VALUE;\n\t\tfor(int i = 0; i < input.length; i++){\n\t\t\tminPriceSoFar = Math.min(minPriceSoFar, input[i]);\n\t\t\tmaxTotalProfit = Math.max(maxTotalProfit, input[i] - minPriceSoFar);\n\t\t\tfirstBuySellProfits.add(maxTotalProfit);\n\t\t}\n\n\t\tint maxPriceSoFar = Integer.MIN_VALUE;\n\t\tfor(int i = input.length-1; i > 0; i--){\n\t\t\tmaxPriceSoFar = Math.max(maxPriceSoFar, input[i]);\n\t\t\tmaxTotalProfit = Math.max(maxTotalProfit, maxPriceSoFar - input[i] + firstBuySellProfits.get(i - 1));\n\t\t}\n\t\treturn maxTotalProfit;\n\t}", "public int maxProfit(int[] prices){\n\t\tif(prices.length == 0){\n\t\t\treturn 0;\n\t\t}\n\n\t\tint maxPro = 0;\n\n\t\tfor(int i = 1; i < prices.length; i++){\n\t\t\tmaxPro += Math.max(0, prices[i] - prices[i-1]);\n\t\t}\n\t\treturn maxPro;\n\t}", "public int maxProfit(int[] prices) {\n if (prices == null || prices.length < 2)\n return 0;\n\n int min = prices[0];\n int maxDiff = 0;\n for (int i = 1; i < prices.length; i++) {\n if ((prices[i] - min) > maxDiff) {\n maxDiff = prices[i] - min;\n } else if (prices[i] < min) {\n min = prices[i];\n }\n }\n\n return maxDiff;\n }", "public List<Interval> findMaximumProfit(int[] prices){\n\n if(prices == null || prices.length ==0){\n return Collections.EMPTY_LIST;\n }\n int i=0;\n int n = prices.length;\n ArrayList<Interval> solutions = new ArrayList<>();\n while(i<n-1){\n while(i<n-1 && prices[i]>=prices[i+1]){\n i++;\n }\n if(i== n-1){\n return Collections.EMPTY_LIST;\n }\n Interval interval = new Interval();\n interval.buy = i;\n i++;\n while(i<=n-1 && prices[i]>=prices[i-1]){\n i++;\n }\n interval.sell = i-1;\n solutions.add(interval);\n }\n return solutions;\n }", "public int maxProfit_improved_1(int[] prices) {\n if (prices == null || prices.length == 0) return 0;\n\n int profit = 0;\n for (int i = 1; i < prices.length; i++) {\n profit += Math.max(prices[i] - prices[i-1], 0);\n }\n\n return profit;\n }", "private static int maxProfit2(int[] prices) {\n\t\tint profit = 0;\n\t\t\n\t\tint[] leftProfit = new int[prices.length];\n\t\tleftProfit[0] = 0;\n\t\tint leftBuyPrice = prices[0];\n\t\tfor(int i=1; i< prices.length; i++) {\n\t\t\tleftBuyPrice = Math.min(prices[i], leftBuyPrice);\n\t\t\tleftProfit[i] = Math.max(leftProfit[i-1], (prices[i]-leftBuyPrice));\n\t\t}\n\t\t\n\t\tint[] rightProfit = new int[prices.length];\n\t\trightProfit[prices.length-1] = 0;\n\t\tint rightSellPrice = prices[prices.length-1];\n\t\tfor(int i=prices.length-2; i>=0; i--) {\n\t\t\trightSellPrice = Math.max(prices[i], rightSellPrice);\n\t\t\trightProfit[i] = Math.max(rightProfit[i+1], (rightSellPrice-prices[i]));\n\t\t}\n\t\t\n\t\tfor(int i=0; i<prices.length; i++) {\n\t\t\tprofit = Math.max(profit, leftProfit[i]+rightProfit[i]);\n\t\t}\n\t\treturn profit;\n\t}", "public static int maxProfit(int[] a) {\n int minSofar = a[0];\n int maxProfit = 0;\n int profit = 0;\n\n for (int i = 0; i < a.length - 1; i++) {\n minSofar = Math.min(minSofar, a[i]);\n profit = a[i] - minSofar;\n maxProfit = Math.max(maxProfit, profit);\n\n }\n return maxProfit;\n\n\n }", "public int maxProfit(int[] prices, int fee) {\n\n int[] hold = new int[prices.length];\n int[] unhold = new int[prices.length];\n hold[0] = -prices[0];\n \n \n for (int i=1; i< prices.length; i++){\n hold[i] = Math.max(unhold[i-1] - prices[i], hold[i-1]);\n unhold[i] = Math.max(unhold[i-1], hold[i-1] + prices[i]- fee);\n }\n return unhold[prices.length-1];\n \n }", "public static void main(String[] args) {\n\t\tint prices[] = {7,1,5,5,5,5,5,4};\r\n\t\tSystem.out.println(maxProfitOneTrade(prices));\r\n\t\t\r\n\t\tint prices1[] = {1,3,2,5};\r\n\t\tSystem.out.println(maxProfitOneTrade(prices1));\r\n\t\t\r\n\t\tint prices2[] = {7,6,4,3,1};\r\n\t\tSystem.out.println(maxProfitOneTrade(prices2));\r\n\t\t\r\n\t\tint prices3[] = {0,0,0,0,1};\r\n\t\tSystem.out.println(maxProfitOneTrade(prices3));\r\n\t}", "public int maxProfit(int k, int[] prices) {\n if(prices.length==0) return 0;\n if(k>(prices.length>>>1)){\n int T0=0;\n int T1=-(int)1e8;\n for(int val:prices){\n T0=Math.max(T0,T1 + val);\n T1=Math.max(T1,T0 - val);\n }\n return T0;\n }\n int Ti0[]=new int[k+1];\n int Ti1[]=new int[k+1];\n Arrays.fill(Ti1,(int)-1e8);\n for(int val:prices){\n for(int K=k;K>0;K--){\n Ti0[K]=Math.max(Ti0[K],Ti1[K]+val);\n Ti1[K]=Math.max(Ti1[K],Ti0[K-1] - val);\n }\n }\n return Ti0[k];\n }", "public static int maxProfit(int[] prices) {\n if (prices.length < 2) {\n return 0;\n }\n\n int[] leftProfit = new int[prices.length], rightProfit = new int[prices.length];\n\n int low = prices[0], high = prices[prices.length - 1], maxProfit = 0;\n\n for (int j = prices.length - 2; j >=0; j--) {\n high = Math.max(high, prices[j]);\n rightProfit[j] = Math.max(high - prices[j], rightProfit[j + 1]);\n }\n\n for (int i = 1; i < prices.length; i++) {\n low = Math.min(low, prices[i]);\n leftProfit[i] = Math.max(prices[i] - low, leftProfit[i - 1]);\n }\n\n for (int i = 1; i < prices.length - 2; i++) {\n maxProfit = Math.max(maxProfit, leftProfit[i] + rightProfit[i + 1]);\n }\n\n return Math.max(maxProfit, Math.max(leftProfit[leftProfit.length - 1], rightProfit[0]));\n }", "private static int buyLowSellHigh(int[] prices) {\n int minPrice = Integer.MAX_VALUE;\n int maxProfit = Integer.MIN_VALUE;\n\n for (int v : prices) {\n if (minPrice == Integer.MAX_VALUE) {\n // update min price for the first time\n minPrice = v;\n } else if (v > minPrice) {\n // calculate profit since the stock price is > minPrice\n int profit = v - minPrice;\n maxProfit = Math.max(maxProfit, profit);\n } else {\n // either v is equal to or smaller than minPrice, then update it\n minPrice = v;\n }\n }\n System.out.printf(\"minPrice: %d\\n\", minPrice);\n return maxProfit;\n }", "public int maxProfit2(int[] prices) {\n // input validation\n if (prices == null || prices.length <= 1) {\n return 0;\n }\n\n // record the min up util now\n int min = Integer.MAX_VALUE;\n int res = 0;\n for (int i : prices) {\n min = Math.min(min, i);\n res = Math.max(res, i - min);\n }\n return res;\n }", "public static int maxProfit(int arr[]) {\n\t\t\n\t\tint mpif[]=new int[arr.length];\n\t\tint maxProfit=0;\n\t\tint minCurrent=Integer.MAX_VALUE;\n\t\t\n\t\t\n\t\tfor(int i=0;i<mpif.length;i++) {\n\t\t\t\n\t\t\tif(arr[i]<minCurrent) {\n\t\t\t\tminCurrent=arr[i];\n\t\t\t}\n\t\t\tif(arr[i]-minCurrent>maxProfit) {\n\t\t\t\tint tempProfit=arr[i]-minCurrent;\n\t\t\t\tmaxProfit=Math.max(maxProfit, tempProfit);\n\t\t\t\tmpif[i]=maxProfit;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tmpif[i]=Math.max(maxProfit, arr[i]-minCurrent);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tint mpat=0;\n\t\tint currentMAx=arr[arr.length-1];\n\t\tint mpbf[]=new int[arr.length];\n\t\tfor(int i=arr.length-2;i>=0;i--) {\n\t\t\tif(arr[i]>currentMAx) {\n\t\t\t\tcurrentMAx=arr[i];\n\t\t\t}\n\t\t\tif(currentMAx-arr[i]>mpat) {\n\t\t\t\tint temp=currentMAx-arr[i];\n\t\t\t\tmpat=Math.max(mpat, temp);\n\t\t\t\tmpbf[i]=mpat;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tmpbf[i]=Math.max(mpat, currentMAx-arr[i]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tint ans[]=new int[arr.length];\n\t\tint max_=0;\n\t\tfor(int i=0;i<ans.length;i++) {\n\t\t\tint sum=mpbf[i]+mpif[i];\n\t\t\tans[i]=sum;\n\t\t\tif(sum>max_) {\n\t\t\t\tmax_=sum;\n\t\t\t}\n\t\t}\n\t\t\n\t\tfor(int i=0;i<ans.length;i++) {\n\t\t\tSystem.out.print(mpif[i]+\" \");\n\t\t}\n\t\tSystem.out.println();\n\t\t\n\t\tfor(int i=0;i<ans.length;i++) {\n\t\t\tSystem.out.print(mpbf[i]+\" \");\n\t\t}\n\t\tSystem.out.println();\n\t\t\n\t\t\n\t\t\n\t\tfor(int i=0;i<ans.length;i++) {\n\t\t\tSystem.out.print(ans[i]+\" \");\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t\t\n\t\treturn max_;\n\t\t\n\t\t\n\t\t\n\t}", "public static void main(String args[] ) throws Exception {\n int[] stockPricesYesterday = new int[] {10, 7, 5, 8, 11, 9};\n //{10, 6, 18, 7, 5, 8, 11, 9}\n System.out.println(findMaxProfit(stockPricesYesterday));\n\n }", "private static long profit(long[] a) {\n\t\tlong b=0,bought=0,profit=0;\n\t\tfor(int i=0;i<a.length;i++)\n\t\t{\n\t\t if(!sell[i])\n\t\t {\n\t\t\t bought+=a[i];\n\t\t\t b++;\n\t\t }\t\n\t\t else\n\t\t {\n\t\t\tprofit+=a[i]*b-bought;\n\t\t\tbought=0;\n\t\t\tb=0;\n\t\t }\n\t\t\n\t\t}\n\t\treturn profit;\n\t\t\n\t}", "public int maxProfit3(int[] prices) {\n // input validation\n if (prices == null || prices.length == 0) {\n return 0;\n }\n\n // calculate the result\n int sum = 0;\n int res = 0;\n for (int i = 0; i < prices.length; i++) {\n int diff = prices[i + 1] - prices[i]; // get the diff\n sum = Math.max(0, sum + diff); // local\n res = Math.max(res, sum); // global\n }\n return res;\n }", "public int maxProfit(int[] prices, int fee) {\n int dp0 = 0;\n int dp1 = Integer.MIN_VALUE;\n for (int i = 0; i < prices.length; i++) {\n dp0 = Math.max(dp0, dp1 + prices[i]);\n dp1 = Math.max(dp1, dp0 - prices[i] - fee);\n }\n return dp0;\n }", "public int max(int[] prices){\n int sum = 0;\n for(int i=1;i<prices.length;i++){\n if((prices[i]-prices[i-1])>0){\n sum += (prices[i]-prices[i-1]);\n }\n }\n return sum;\n }", "int findMaxProfit(Job arr[], int n)\n {\n // Sort jobs according to finish time\n sort(arr, arr+n, myfunction);\n\n // Create an array to store solutions of subproblems. table[i]\n // stores the profit for jobs till arr[i] (including arr[i])\n int *table = new int[n];\n table[0] = arr[0].profit;\n\n // Fill entries in M[] using recursive property\n for (int i=1; i<n; i++)\n {\n // Find profit including the current job\n int inclProf = arr[i].profit;\n int l = latestNonConflict(arr, i);\n if (l != -1)\n inclProf += table[l];\n\n // Store maximum of including and excluding\n table[i] = max(inclProf, table[i-1]);\n }\n\n // Store result and free dynamic memory allocated for table[]\n int result = table[n-1];\n delete[] table;\n\n return result;\n }", "int findMaxProfit(Job arr[], int n)\n {\n // Sort jobs according to finish time\n sort(arr, arr+n, myfunction);\n\n return findMaxProfitRec(arr, n);\n }", "static void displayMaxProfitableStock(ForeighStockHolding array[])\r\n\t{\n\t\tForeighStockHolding temp = array[0];\r\n\t\t\r\n\t\t//traversing the array to find the max profitable stock\r\n\t\tfor(int i=1; i<array.length; i++)\r\n\t\t{\r\n\t\t\tif((temp.valueInDollars()-temp.costInDollars()) < (array[i].valueInDollars()-array[i].costInDollars()))\r\n\t\t\t{\r\n\t\t\t\ttemp = array[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//printing the maximum profitable stock\r\n\t\tSystem.out.println(\"Maximum Profitable Stock :\");\r\n\t\tSystem.out.println(\"Company Name : \"+temp.companyName);\r\n\t\tSystem.out.println(\"Purchase Share Price : \"+temp.purchaseSharePrice);\r\n\t\tSystem.out.println(\"Current Share Price : \"+temp.currentSharePrice);\r\n\t\tSystem.out.println(\"Number of Shares : \"+temp.numberOfShares);\r\n\t\tSystem.out.println(\"Conversion Rate : \"+temp.conversionRate);\r\n\t\tSystem.out.println();\r\n\t}", "public static void findBestDaysToTrade(int[] values) {\n\n int highestDiff = 0;\n int dayToBuy = -1, dayToSell = -1;\n\n int curSmallInx = 0;\n int curSmallValue = values[0];\n\n for (int inx = 1; inx < values.length; inx++) {\n int curValue = values[inx];\n\n // If we find smaller index, record it & continue\n if (curValue < curSmallValue) {\n curSmallValue = curValue;\n curSmallInx = inx;\n continue;\n }\n\n // If we find a greater difference value, then record it\n if ((curValue-curSmallValue) > highestDiff) {\n highestDiff = curSmallValue = curValue;\n dayToBuy = curSmallInx;\n dayToSell = inx;\n }\n }\n\n System.out.println (\"dayToBuy: \" + (dayToBuy+1) + \", dayToSell: \" + (dayToSell+1) + \", margin: \" + highestDiff);\n }", "public int maxProfit(int k, int[] prices) {\n int n = prices.length;\n // validate input 1\n if (k <= 0 || n == 0) return 0;\n\n // validate input 2 : if k is large enough, the question will be the same as question II.\n if (k >= n / 2) {\n int result = 0;\n for (int i = 1; i < n; ++i) {\n if (prices[i] - prices[i - 1] > 0) {\n result += prices[i] - prices[i - 1];\n }\n }\n return result;\n }\n int[][][] dp = new int[prices.length + 1][k + 1][2];\n for (int i = 0; i < dp.length; i++) {\n dp[i][0][1] = Integer.MIN_VALUE;\n }\n for (int i = 0; i < dp[0].length; i++) {\n dp[0][i][1] = Integer.MIN_VALUE;\n }\n for (int i = 1; i < dp.length; i++) {\n for (int j = 1; j < dp[0].length; j++) {\n dp[i][j][0] = Math.max(dp[i - 1][j][1] + prices[i - 1], dp[i - 1][j][0]);\n dp[i][j][1] = Math.max(dp[i - 1][j - 1][0] - prices[i - 1], dp[i - 1][j][1]);\n }\n }\n return dp[dp.length - 1][k][0];\n }", "Price getHighestPricedTrade(Collection<Trade> trades);", "public static int maxProfit(final List<Integer> a) {\n if(a == null || a.size() == 0)\n return 0;\n int profit = 0;\n \n int minElement = Integer.MAX_VALUE;\n for(int i = 0; i < a.size(); i++){\n profit = Math.max(profit, a.get(i) - minElement);\n minElement = Math.min(minElement, a.get(i));\n }\n return profit;\n \n }", "public static double max(double[] prices) {\n\t\tdouble biggest = 0;\n\n\t\tfor (int i = 0; i < prices.length; i++) {\n\t\t\tif (prices[i] > biggest) {\n\t\t\t\tbiggest = prices[i];\n\t\t\t}\n\t\t}\n\n\t\treturn biggest\n\t}", "public static void main(String[] args) {\n int k = 10 ;\n int[] prices = {1, 2, 3, 4, 5} ;\n\n Solution solution = new Solution();\n int i = solution.maxProfit(k, prices);\n\n System.out.println(\"the work is: \" + i);\n }", "@SuppressWarnings(\"unused\")\r\n\tprivate int[] helper(int buyId, int[] price) {\r\n\t\tint maxProfit = 0;\r\n\t\tint sellDay = -1;\r\n\t\tfor (int i = buyId + 1; i < price.length; i++) {\r\n\t\t\tint currentProfit = price[i] - price[buyId];\r\n\t\t\tif (currentProfit >= 0 && currentProfit >= maxProfit) {\r\n\t\t\t\tmaxProfit = currentProfit;\r\n\t\t\t\tsellDay = i;\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn new int[] { maxProfit, sellDay };\r\n\t}", "private int[] getHighestPricesInTerm(int[] prices){\n int highest = -1;\n int index = -1;\n for(int i=0;i<prices.length;i++){\n if(prices[i]>highest){\n highest = prices[i];\n index = i;\n }\n }\n return new int[]{highest,index};\n }", "public static void main(String... args) {\n int[] a = {7, 5, 13, 2, 3, 8};\n System.out.println(maxProfit(a));\n }", "public int maxProfit(final List<Integer> A) {\n \n int max = 0;\n \n for(int i=1;i<A.size();i++){\n max += A.get(i) > A.get(i-1) ? A.get(i) - A.get(i-1) : 0; \n }\n return max;\n }", "public static int mostMoney(int[][] a) { \n double[] totals = new double[3]; \n double rowTotal = 0.0;\n double rowTotal1 = 0.0;\n double rowTotal2 = 0.0;\n \n \n for(int i = 0; i<4; i++){\n rowTotal += a[0][i];\n totals[0] = rowTotal;}\n \n for(int j = 0; j<4; j++){\n rowTotal1 += a[1][j];\n totals[1] = rowTotal1;}\n \n for(int k = 0; k<4; k++){\n rowTotal2 += a[0][k];\n totals[2] = rowTotal2;}\n \n int indexOfBest=0; //used to find index of best year\n double best = totals[0];\n for(int i =0; i < 3; i++) {\n if(totals[i] >= best){\n best = totals[i];\n indexOfBest = i;}\n \n } return indexOfBest;\n }", "private static Pair<Double, Integer> findMaxEntry(double[] array) {\n int index = 0;\n double max = array[0];\n for (int i = 1; i < array.length; i++) {\n if ( array[i] > max ) {\n max = array[i];\n index = i;\n }\n }\n return new Pair<Double, Integer>(max, index);\n }", "int findMaxProfitRec(Job arr[], int n)\n {\n // Base case\n if (n == 1) return arr[n-1].profit;\n\n // Find profit when current job is inclueded\n int inclProf = arr[n-1].profit;\n int i = latestNonConflict(arr, n);\n if (i != -1)\n inclProf += findMaxProfitRec(arr, i+1);\n\n // Find profit when current job is excluded\n int exclProf = findMaxProfitRec(arr, n-1);\n\n return max(inclProf, exclProf);\n }", "public static void highestPrice(DeluxePizza todaysPizza[])\n\t\t{\n\t\t\tboolean empty = true;\n\t\t\tfor(DeluxePizza x:todaysPizza)\n\t\t\t{\n\t\t\t\tif(x != null)\n\t\t\t\t\tempty = false;\n\t\t\t}\n\t\t\tif(!empty){\n\t\t\tdouble expensive = 0;\n\t\t\tint index = 0;\n\t\t\tfor(int i = 0; i <= todaysPizza.length - 1; ++i)\n\t\t\t{\n\t\t\t\tif(todaysPizza[i] == null)\n\t\t\t\t{\n\t\t\t\t\texpensive += 0;\n\t\t\t\t}\n\t\t\t\telse if(todaysPizza[i].calcCost() > expensive)\n\t\t\t\t{\n\t\t\t\t\texpensive = todaysPizza[i].calcCost();\n\t\t\t\t\tindex = i;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"The most expensive pizza is pizza # \" + (index + 1) + \" at $\" + expensive);\n\t\t\treturn;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tSystem.out.println(\"You haven't made any pizzas yet!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t}", "public Book mostExpensive() {\n //create variable that stores the book thats most expensive\n Book mostExpensive = bookList.get(0);//most expensive book is set as the first in the array\n for (Book book : bookList) {\n if(book.getPrice() > mostExpensive.getPrice()){\n mostExpensive = book;\n }\n } return mostExpensive;//returns only one (theFIRST) most expensive in the array if tehre are several with the same price\n }", "public T findHighest(){\n T highest = array[0];\n for (int i=0;i<array.length; i++)\n {\n if (array[i].doubleValue()>highest.doubleValue())\n {\n highest = array[i];\n } \n }\n return highest;\n }", "public static void main(String[] args) {\n\t\tint []prices = {1, 2, 3, 0, 2,20};\n\t\tSystem.out.println(maxProfit(prices));\n\t}", "public static void cutRod() {\n\t\tint[] price = {1,5,8,9,13};\n\t\tint N = price.length;\n\t\tint[] val = new int[N+1];\n\t\tval[0] = 0;\n\t\tfor(int i=1; i<=N; i++) {\n\t\t\tint max = Integer.MIN_VALUE;\n\t\t\tfor(int j=0; j<i; j++) {\n\t\t\t\tmax = Math.max(max, price[j]+val[i-j-1]);\n\t\t\t}\n\t\t\tval[i] = max;\n\t\t}\n\t\tSystem.out.println(\"max val \"+val[N]);\n\t}", "static double getMax(double[] array) {\n\t\tif (array.length < 0) {\n\t\t\tthrow new IndexOutOfBoundsException(\"Arrays start from index 0\");\n\t\t}\n\t\tdouble max = 0;\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tif (max < array[i]) {\n\t\t\t\tmax = array[i];\n\t\t\t}\n\t\t}\n\t\treturn max;\n\t}", "public static void main(String[] args) {\n\t\tint[] prices = {200,80,100,3,5};\n\t\tSystem.out.println(maxProfit(prices));\n\n\t}", "public static void main(String[] args) {\n\t\tint[] arr = { 2, 3, 5, 1, 4 };\n\t\tint[][] dp = new int[arr.length][arr.length];\n\n\t\tSystem.out.println(MaxProfit(arr, 0, arr.length - 1, 1, dp));\n\t\tSystem.out.println(MaxProfitBU(arr));\n\n\t}", "public static float maxStockProfit(List<Float> values) {\n\t\tif (values.size() < 2) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\tfloat profit = 0.0F, min = values.get(0);\n\t\tfor (int i = 1; i<values.size(); i++) {\n\t\t\tprofit = Math.max(profit, values.get(i) - min);\n\t\t\tmin = Math.min(min, values.get(i));\n\t\t}\n\t\treturn profit;\n\t}", "public static int maxSale(int[] arr, int m) {\n Queue<Integer> queue = new PriorityQueue<Integer>(new Comparator<Integer>(){\n @Override\n public int compare(Integer a, Integer b) {\n return b - a;\n }\n });\n // (a,b) -> (b,a));\n for(int ticket : arr) {\n queue.offer(ticket);\n }\n int sum = 0;\n while (m > 0) {\n if (queue.isEmpty()) {\n break;\n }\n int max = queue.poll();\n int top = (queue.isEmpty() ? 0 : queue.peek());\n for(; m > 0 && max >= top; m--, max--) {\n sum += max;\n }\n if (max > 0) {\n queue.offer(max);\n }\n }\n return sum;\n }", "public long findMax(long[] incomes) {\n long current_max_index = 0;\n long current_max = incomes[0];\n for (long income : incomes)\n if (current_max < income)\n current_max = income;\n return current_max;\n }", "public static double getMax(double[] arr) \n { \n double max = arr[0]; \n for(int i=1;i<arr.length;i++) \n { \n if(arr[i]>max) \n max = arr[i]; \n } \n return max; \n }", "public static void main(String[] args) {\n\t\tint arr [] = {1,2};\n\t\tint result = maxProfit(arr);\n\t\tSystem.out.println(result);\n\t\t\n\t}", "public int solve(String infile) {\r\n\r\n\t\ttry {\r\n\t\t\treadData(infile);\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t//A temporary object array of bids\r\n\t\tBids[] numBids = populateBids();\r\n\t\t//A temporary integer array to hold the maximum value\r\n\t\tint[] storeMaxRev = new int[numBids.length];\r\n\t\t//A temporary variable for the maximum revenue that will be updated in the main loop.\r\n\t\tint maxRev = 0;\r\n\t\t\r\n\t\t//Invokes the comparator method defined earlier\r\n\t\tLotComparator compareFinishTimes = new LotComparator();\r\n\t\tArrays.sort(numBids,compareFinishTimes);\r\n\t\t\r\n\t\t\r\n\t\t//Edge case check if the number of bids is less than 0\r\n\t\tif(numBids.length <= 0) {\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t\t\r\n\t\t//Choose the first bid in the object array.\r\n\t\tstoreMaxRev[0] = numBids[0].priceOfLot;\r\n\t\t\r\n\t\t//From the second element of the object array, iterate through the array and store the price\r\n\t\t//of the element that is larger than the previous element\r\n\t\tfor(int i = 1; i < numBids.length; i++) {\r\n\t\t\tstoreMaxRev[i] = Math.max(numBids[i].priceOfLot, storeMaxRev[i - 1]);\r\n\t\t\t\r\n\t\t\t//Iterating backwards from the second last element relative to i, check if the current element is compatible.\r\n\t\t\t//A compatible bid is when the ending lot number is less than the starting lot number of the next bid.\r\n\t\t\t//If it is an compatible bid, add the price of the current bid to the previous bid and take the maximum price out of the two.\r\n\t\t\tfor(int j = i - 1; j >= 0; j--) {\r\n\t\t\t\tif(numBids[j].endLot < numBids[i].beginningLot) {\r\n\t\t\t\t\tstoreMaxRev[i] = Math.max(storeMaxRev[i], numBids[i].priceOfLot + storeMaxRev[j]);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t//Once all of the bids in numBid object array is processed, we get an integer array that will contain the maximum revenue.\r\n\t\t//This loop iterates through storeMaxRev and selects the largest integer which is then set to the variable maxRev and returned as the answer\r\n\t\tfor(int priceIdx = 0; priceIdx < storeMaxRev.length; priceIdx++) {\r\n\t\t\tif(maxRev < storeMaxRev[priceIdx]) {\r\n\t\t\t\tmaxRev = storeMaxRev[priceIdx];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn maxRev;\r\n\t}", "private static int maxMoney(int[] coins,int coinsCount,int startIndex){\n int maxScore = 0;\n if(coinsCount==1) maxScore = coins[startIndex];\n else{\n maxScore = Math.max(coins[startIndex]+sum(coins,coinsCount-1, startIndex+1)-maxMoney(coins,coinsCount-1, startIndex+1),\n coins[coinsCount+startIndex-1]+sum(coins,coinsCount-1,startIndex)-maxMoney(coins,coinsCount-1,startIndex));\n }return maxScore;\n }", "private static double max(Double[] darray){\n\t\tdouble max = darray[0];\n\t\tfor ( double dd : darray){\n\t\t\tmax = Math.max(max,dd);\n\t\t}\n\t\treturn max;\n\t}", "public static double max(double[] array) {\n\t\tif (array.length==0) return Double.NEGATIVE_INFINITY;\n\t\tdouble re = array[0];\n\t\tfor (int i=1; i<array.length; i++)\n\t\t\tre = Math.max(re, array[i]);\n\t\treturn re;\n\t}", "static void displayMaxValue (ForeighStockHolding array[])\r\n\t{\n\t\tForeighStockHolding temp = array[0];\r\n\t\t\r\n\t\t//traversing the array to find the max value stock\r\n\t\tfor(int i=1; i<array.length; i++)\r\n\t\t{\r\n\t\t\tif(temp.valueInDollars() < array[i].valueInDollars())\r\n\t\t\t{\r\n\t\t\t\ttemp = array[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//printing the maximum value stock\r\n\t\tSystem.out.println(\"Maximum Value Stock :\");\r\n\t\tSystem.out.println(\"Company Name : \"+temp.companyName);\r\n\t\tSystem.out.println(\"Purchase Share Price : \"+temp.purchaseSharePrice);\r\n\t\tSystem.out.println(\"Current Share Price : \"+temp.currentSharePrice);\r\n\t\tSystem.out.println(\"Number of Shares : \"+temp.numberOfShares);\r\n\t\tSystem.out.println(\"Conversion Rate : \"+temp.conversionRate);\r\n\t\tSystem.out.println();\r\n\t}", "public static double getMax(double[] array)\r\n\t{\r\n\t\tdouble max = Double.NEGATIVE_INFINITY;\r\n\t\tfor (int i = 0; i < array.length; i++)\r\n\t\t\tif (max < array[i])\r\n\t\t\t\tmax = array[i];\r\n\t\treturn max;\r\n\t}", "private synchronized Price determineLastSalePrice(HashMap<String, FillMessage> fills) throws InvalidDataException {\n\t\tif (fills == null) throw new InvalidDataException(\"Fills cannot be null\");\n\t\tArrayList<FillMessage> msgs = new ArrayList<FillMessage>(fills.values());\n\t\tCollections.sort(msgs);\n\t\treturn msgs.get(0).getPrice();\n\t}", "static long maxProduct(int[] arr, int n) {\n long maxproduct=arr[0], temp1=0, temp2=0;\n long mintillhere=arr[0], maxtillhere=arr[0];\n for(int i=1; i<n; i++){\n // if(arr[i] > 0){\n // product *= arr[i];\n // if(product > maxproduct) maxproduct = product;\n // System.out.println(\"Arr[i] \" + arr[i] + \"Product \" + product + \"maxproduct\" + maxproduct);\n // }\n \n // else if(arr[i] < 0){\n // if(negative*arr[i] > 0) {\n // product = negative*arr[i];\n // if(product > maxproduct) maxproduct = product;\n // System.out.println(\"Arr[i] \" + arr[i] + \"Product \" + product + \"Negative \" + negative + \"maxproduct \" + maxproduct);\n // negative=product;\n // }\n // else {\n // negative = product*arr[i];\n // product = 1; \n // System.out.println(\"Arr[i] \" + arr[i] + \"Product \" + product + \"Negative \" + negative);\n \n // }\n // }\n \n // else if(arr[i] == 0){\n // product = 1;\n // negative = 1;\n // } \n temp1 = maxtillhere*arr[i];\n temp2 = mintillhere*arr[i];\n maxtillhere = Math.max(arr[i], Math.max(temp1, temp2));\n mintillhere = Math.min(arr[i], Math.min(temp1, temp2));\n if(maxtillhere > maxproduct) maxproduct = maxtillhere;\n }\n return maxproduct;\n }", "public static double max(double[] v) {\n double max = v[0];\n for (int ktr = 0; ktr < v.length; ktr++) {\n if (v[ktr] > max) {\n max = v[ktr];\n }\n }\n return max;\n}", "public static void main(String[] args) {\n\t\tint myArr[]= {1,2,3,4,5};\n\t\tmaxProfit(myArr);\n\t\t\n\t}", "public int _maxProfitAssignment(int[] difficulty, int[] profit, int[] worker) {\n Integer [] indexes = new Integer [difficulty.length];\n for (int idx = 0; idx < indexes.length; idx ++) indexes [idx] = idx;\n\n Arrays.sort(indexes, (a, b) -> difficulty [a] != difficulty [b] ?\n difficulty [a] - difficulty [b] :\n (profit [b] - profit [a]));\n // maxprofit is not working until we sort difficulty properly.\n\n int [] maxProfit = new int [profit.length];\n maxProfit [0] = profit [indexes [0]];\n\n for (int idx = 1; idx < indexes.length; idx ++)\n maxProfit [idx] = Math.max(maxProfit [idx - 1], profit [indexes [idx]]);\n\n int ans = 0;\n for (int val : worker) {\n int idx = binarySearch(indexes, difficulty, val);\n if (idx >= 0) ans += maxProfit [idx];\n }\n return ans;\n }", "static RodCuttingRevenue findCuttingWaysToGetMaximumRevenue(int[] prices, int priceToCut) {\n int len = prices.length;\n int[] optimalCuts = new int[len+1];\n int[] revenue = new int[len+1];\n for(int i=1; i<=len; i++) {\n int max = prices[i-1];\n optimalCuts[i] = i;\n for(int j=0;j<i; j++) {\n int price = prices[j] + revenue[i-j-1] - priceToCut;\n if(max<price) {\n max = price;\n optimalCuts[i] = j+1;\n }\n }\n revenue[i] = max;\n }\n return new RodCuttingRevenue(revenue[len], optimalCuts);\n }", "public int _maxProfitAssignmentBetter(int[] difficulty, int[] profit, int[] worker) {\n int n = difficulty.length;\n int [][] dp = new int [n][];\n\n for (int i = 0; i < n; i ++)\n dp [i] = new int[] { difficulty[i], profit[i] };\n\n Arrays.sort(dp, (a, b) -> (a [0] != b [0]) ? (a [0] - b [0]) : -(a [1] - b [1]));\n\n int[] xs = new int[n];\n for (int i = 0; i < n; i ++) xs [i] = dp [i][0];\n for (int i = 1; i < n; i ++) dp[i][1] = Math.max(dp [i][1], dp [i - 1][1]);\n\n int ret = 0;\n for(int w : worker){\n int ind = Arrays.binarySearch(xs, w);\n if (ind < 0) ind = -ind - 2;\n if (ind >= 0)\n ret += dp[ind][1];\n }\n return ret;\n }", "static void displayMinProfitableStock(ForeighStockHolding array[])\r\n\t{\n\t\tForeighStockHolding temp = array[0];\r\n\t\t\r\n\t\t//traversing the array to find the min profitable stock\r\n\t\tfor(int i=1; i<array.length; i++)\r\n\t\t{\r\n\t\t\tif((temp.valueInDollars()-temp.costInDollars()) > (array[i].valueInDollars()-array[i].costInDollars()))\r\n\t\t\t{\r\n\t\t\t\ttemp = array[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//printing the minimum profitable stock\r\n\t\tSystem.out.println(\"Minimum Profitable Stock :\");\r\n\t\tSystem.out.println(\"Company Name : \"+temp.companyName);\r\n\t\tSystem.out.println(\"Purchase Share Price : \"+temp.purchaseSharePrice);\r\n\t\tSystem.out.println(\"Current Share Price : \"+temp.currentSharePrice);\r\n\t\tSystem.out.println(\"Number of Shares : \"+temp.numberOfShares);\r\n\t\tSystem.out.println(\"Conversion Rate : \"+temp.conversionRate);\r\n\t\tSystem.out.println();\r\n\t}", "public int _maxProfitAssignmentBest(int[] difficulty, int[] profit, int[] worker) {\n // value index reverse array\n int [] dp = new int [100001];\n\n // nice strategy to use in multi-array approach\n // using difficulty as index, profit as value.\n // (difficulty array sorted by default, effort saved)\n for (int idx = 0; idx < difficulty.length; idx ++) {\n // overwrite profit values and keep the max one. (in case of conflict)\n dp [difficulty [idx]] = Math.max (dp [difficulty [idx]], profit [idx]);\n }\n\n // maximize profits stored linearly\n for (int idx = 1; idx < dp.length; idx ++)\n dp [idx] = Math.max (dp [idx - 1], dp [idx]);\n\n // build ans\n int ans = 0;\n for (int w : worker)\n ans += dp [w];\n\n return ans;\n }", "public double max(){\r\n\t\t//variable for max val\r\n\t\tdouble max = this.data[0];\r\n\t\t\r\n\t\tfor (int i = 1; i < this.data.length; i++){\r\n\t\t\t//if the maximum is less than the current index, change max to that value\r\n\t\t\tif (max < this.data[i]){\r\n\t\t\t\tmax = this.data[i];\r\n\t\t\t}\r\n\t\t}\r\n\t\t//return the maximum val\r\n\t\treturn max;\r\n\t}", "static int getMaxCoinValGeeks(int arr[], int n)\n {\n // Create a table to store solutions of subproblems\n int table[][] = new int[n][n];\n int gap, gapStartIndx, gapEndIndx, x, y, z;\n\n // Fill table using above recursive formula.\n // Note that the tableis filled in diagonal\n // fashion (similar to http://goo.gl/PQqoS),\n // from diagonal elements to table[0][n-1]\n // which is the result.\n for (gap = 0; gap < n; ++gap)\n {\n // both gapStartIndx and gapEndIndx are incremented in each loop iteration\n // for each gap, gapStartIndx keeps moving\n // gapEndIndx is always gap more than the gapStartIndx\n // when gap == 0, gapStartIndx = gapEndIndx\n // table[i,j] identifies the max value obtained by the player who picks first\n // first player = i to get val[i] , range of coins left = i+1, j\n // second player max value = table[i+1,j], range of coins left = i+2, j\n // first player max value = table[i+2,j]. So total value for player 1 is\n // val[i] + table[i+2, j]\n // first player picks j to get val[j], range of coins left i, j-1.\n // second player max = table[i, j-1] range of coins left i, j-2\n // first player max = table[i,j-2]\n // so for finding max value for a p\n for (gapStartIndx = 0, gapEndIndx = gap; gapEndIndx < n; ++gapStartIndx, ++gapEndIndx)\n {\n // Here x is value of F(i+2, j),\n // y is F(i+1, j-1) and z is\n // F(i, j-2) in above recursive formula\n // if gapStartIndx and gapEndIndx are two or more apart\n x = ((gapStartIndx + 2) <= gapEndIndx) ? table[gapStartIndx + 2][gapEndIndx] : 0;\n y = ((gapStartIndx + 1) <= (gapEndIndx - 1)) ? table[gapStartIndx +1 ][gapEndIndx - 1] : 0;\n z = (gapStartIndx <= (gapEndIndx - 2)) ? table[gapStartIndx][gapEndIndx - 2]: 0;\n\n table[gapStartIndx][gapEndIndx] = Math.max(arr[gapStartIndx] +\n Math.min(x, y), arr[gapEndIndx] +\n Math.min(y, z));\n }\n }\n\n return table[0][n - 1];\n }", "public double getProfit() {\n\n\n double difference = maxRange * GAS_RATE;\n double sum = super.getProfit();\n\n return sum - difference;\n\n }", "public FoodItem mostExpensive() {\n FoodItem mostExpensive = null;\n for (int i = 0; i < this._noOfItems; i++) {\n FoodItem currentItem = this._stock[i];\n // if not first, compare the most expensive yet to current,\n // and change the most expensive if current's price is grater\n if (i != 0) {\n // if price is bigger than all tested yet\n if (currentItem.getPrice() > mostExpensive.getPrice()) {\n // set it as biggest yet\n mostExpensive = new FoodItem(currentItem); // avoid aliasing\n }\n }\n else \n mostExpensive = new FoodItem(currentItem); //avoid aliasing\n }\n // return biggest\n return mostExpensive;\n }", "static int getMaxCoinValMine(int vals[], int n) {\n int[][] maxVals = new int[n][n];\n for(int wind = 0; wind < n; wind++) {\n // start is always less than or equal to end\n for(int start=0, end = start+wind; end<n; start++,end++ ) {\n // no elements element\n if(wind==0) {\n maxVals[start][end] = 0;\n }\n else if(start == end) {\n // only single element\n maxVals[start][end] = vals[start];\n }\n else {\n // start >=0\n // calculate wind[start][end]\n // chose end, then value is val[end] for P1, val[start][end-1] for P2 and val[start][end-2] for P1\n int valEnd = vals[end] + (( start < end-2)? maxVals[start][end-2]:0);\n // chose start, then value is val[start] for P1, val[start+1][end] for P2 and val[start+2][end] for P1\n int valStart = vals[start] + ((start+2 < end)? maxVals[start+2][end]:0);\n maxVals[start][end] = max(valEnd, valStart);\n }\n }\n }\n return maxVals[0][n-1];\n\n }", "public Money findMaxPrice(long n) {\n\t\tif (!hashMap.containsKey(n)) {\n\t\t\treturn new Money();\n\t\t}\n\t\tTreeSet<Long> idSet = hashMap.get(n);\n\t\tMoney max = new Money();\n\t\tboolean flag = false;\n\t\tfor (Long id : idSet) {\n\t\t if(treeMap.containsKey(id)){\n\t\t\tMoney current = treeMap.get(id).price;\n\t\t\tif (max.compareTo(current) == -1 || !flag) {\n\t\t\t\tmax = current;\n\t\t\t\tflag = true;\n\t\t\t}\n\t\t}\n\t\t}\n\t\treturn max;\n\t}", "public static void main (String [] args) throws IOException {\n BufferedReader f = new BufferedReader(new FileReader(\"buylow.in\"));\n // input file name goes above\n PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(\"buylow.out\")));\n // Use StringTokenizer vs. readLine/split -- lots faster\n StringTokenizer st = new StringTokenizer(f.readLine());\n // Get line, break into tokens\n int n = Integer.parseInt(st.nextToken());\n int[] price = new int[n];\n int[] dp = new int[n];\n BigInteger[] times = new BigInteger[n];\n for(int i = 0; i < n; i++){\n times[i] = BigInteger.ZERO;\n }\n st = new StringTokenizer(f.readLine());\n for(int i = 0; i < n; i++){\n if(!st.hasMoreTokens())\n st = new StringTokenizer(f.readLine());\n int current = Integer.parseInt(st.nextToken());\n price[i] = current;\n int max = 1;\n for(int j = i - 1; j >= 0; j--){\n if(price[j] > current){\n if(dp[j] + 1 > max){\n max = dp[j] + 1;\n }\n }\n }\n dp[i] = max;\n if(max == 1){\n times[i] = BigInteger.ONE;\n }\n else {\n HashSet<Integer> got = new HashSet<>();\n for(int j = i - 1; j >= 0; j--){\n if(price[j] > current)\n if(dp[j] + 1 == max){\n if(!got.contains(price[j])){\n got.add(price[j]);\n times[i] = times[i].add(times[j]);\n }\n }\n }\n }\n }\n int max = 0;\n for(int i = 0; i < n; i++){\n if(dp[i] > max)\n max = dp[i];\n }\n BigInteger result = BigInteger.ZERO;\n HashSet<Integer> got = new HashSet<>();\n for(int i = n - 1; i >= 0; i--){\n if(dp[i] == max)\n if(!got.contains(price[i])){\n got.add(price[i]);\n result = result.add(times[i]);\n }\n }\n out.println(max + \" \" + result.toString()); // output result\n out.close(); // close the output file\n }", "@Override\n public double getProfit() {\n double revenue = 0;\n int maxRange = 0;\n double cost = 0;\n double profit;\n if (getPackages().size() == 0) {\n return 0;\n }\n for (int i = 0; i < getPackages().size(); i++) {\n revenue += getPackages().get(i).getPrice();\n }\n for (int i = 0; i < getPackages().size(); i++) {\n int zip = getPackages().get(i).getDestination().getZipCode();\n int distance = Math.abs(zip - getZipDest());\n if (distance >= maxRange) {\n maxRange = distance;\n }\n }\n cost = maxRange * gasRate;\n profit = (revenue - cost);\n\n return (profit);\n }", "public static TempResult max(int allowedWeight, Set<Item> items) {\n\t\tint[] values=new int[items.size()];\n\t\tint[] weights=new int[items.size()];\n\t\t\n\n\t\tArrayList<Item> items2=new ArrayList<Item>(items);\n\t\tfor (int i=0; i<items2.size(); i++) {\n\t\t\tvalues[i]=items2.get(i).value;\n\t\t\tweights[i]=items2.get(i).weight;\n\t\t}\n\t\t\n int[][] totalValue = new int[values.length+1][allowedWeight+1];\n boolean[][] includedorNot = new boolean[values.length+1][allowedWeight+1];\n \n //We introduce item one by one to the system.\n //For each introduced item, we consider the maximal profit\n //for weight=[0:allowedWeight]\n for (int i=0; i<values.length; i++) {\n \t//introduce item i into the system.\n \tint val=values[i];\n \tint weight=weights[i];\n \t\n \tint itemIndex=i+1;\n \t\n \tfor (int w=1; w<=allowedWeight; w++) {\n \t\t\n \t\t//Zero copy of ith item; i-1 is calculated already\n \t\tint profit1=totalValue[itemIndex-1][w];\n \t\t\n \t\t//one copy of ith item.\n \t\tint profit2=Integer.MIN_VALUE;\n \t\tif (w-weight>=0) {\n \t\t\t//for a particular targeted weight, add item i does not overflow the targeted weight.\n \t\t\tprofit2=totalValue[itemIndex-1][w-weight]+val;\n \t\t}\n \t\t\n \t\tif (profit1>profit2) {\n \t\t\tincludedorNot[itemIndex][w]=false;\n \t\t\ttotalValue[itemIndex][w]=profit1;\n \t\t} else {\n \t\t\tincludedorNot[itemIndex][w]=true;\n \t\t\ttotalValue[itemIndex][w]=profit2;\n \t\t}\n \t}\n }\n\t\t\n \n TempResult result=new TempResult(0, 0);\n result.value=totalValue[values.length][allowedWeight];\n result.items=new LinkedList<>();\n int w=allowedWeight;\n for (int itemIndex=values.length; itemIndex>0; itemIndex--) {\n \tif (includedorNot[itemIndex][w]) {\n \t\tresult.items.add(items2.get(itemIndex-1));\n \t\tw=w-weights[itemIndex-1];\n \t} \n }\n \n return result;\n \n\t}", "private static int maxSubArrayGolden(int[] nums) {\n if (nums == null || nums.length == 0) {\n return 0;\n }\n // in case the result is negative.\n int max = Integer.MIN_VALUE;\n int sum = 0;\n for (int num : nums) {\n sum += num;\n max = Math.max(sum, max);\n sum = Math.max(sum, 0);\n }\n return max;\n }", "public static int getMax(int[] inputArray){ \n int maxValue = inputArray[0]; \n for(int i=1;i < inputArray.length;i++){ \n if(inputArray[i] > maxValue){ \n maxValue = inputArray[i]; \n } \n } \n return maxValue; \n }" ]
[ "0.8101878", "0.79293525", "0.78784347", "0.7843724", "0.78413844", "0.78395283", "0.7803638", "0.78001654", "0.7789381", "0.7751813", "0.7711552", "0.76502365", "0.75593555", "0.7549037", "0.7547693", "0.7544801", "0.753796", "0.7530283", "0.7517044", "0.7513256", "0.7498185", "0.7492983", "0.74730605", "0.7469837", "0.74603266", "0.74471354", "0.73543316", "0.73521894", "0.73203397", "0.72802186", "0.7274675", "0.7252548", "0.7241049", "0.7222328", "0.7143558", "0.71064013", "0.70943177", "0.7093481", "0.70905596", "0.70228887", "0.701588", "0.6991469", "0.6970497", "0.69614583", "0.6954495", "0.6949279", "0.68799734", "0.6866617", "0.6866394", "0.6819621", "0.681292", "0.67647016", "0.6758357", "0.66595495", "0.66023254", "0.6548625", "0.6538338", "0.6516837", "0.6514806", "0.65102416", "0.6409217", "0.63908863", "0.6385116", "0.63579094", "0.6327408", "0.63084996", "0.6284023", "0.62157565", "0.6209046", "0.6169832", "0.6165377", "0.6163986", "0.6161145", "0.6158362", "0.6099858", "0.6022721", "0.59580326", "0.594597", "0.5919148", "0.59092975", "0.5891351", "0.5884961", "0.5883144", "0.58699226", "0.58694327", "0.58606684", "0.58323354", "0.58128446", "0.5769019", "0.5765002", "0.57611287", "0.5747803", "0.57460535", "0.57370794", "0.5731237", "0.57244694", "0.5721233", "0.5711044", "0.5710328", "0.5704212" ]
0.69179916
46
Affiche la moyenne des distances des tournees qui passent par tous les points de la liste nbTournees sont generees pour calculer la moyenne
private static void calculDistanceTournees(List<Point> points, int nbTournees) { long time = System.currentTimeMillis(); double distance = 0; Random rand = new Random(0); for(int i=0; i<nbTournees; i++) { distance += calculDistanceTourneeAlea(points, rand); } long deltaTime = System.currentTimeMillis() - time; System.out.println("Calcul de la moyenne des distances pour "+nbTournees+ " tournees"); System.out.println("La moyenne vaut : "+distance/nbTournees); System.out.println("La moyenne est calculee en "+deltaTime+" ms"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static double calculDistanceTourneeAlea(List<Point> points, Random rand) {\n double distance = 0;\n Collections.shuffle(points, rand);\n Point courant = points.get(0);\n Point suivant;\n for(int i=1; i<points.size(); i++) {\n suivant = points.get(i);\n distance += courant.getDistance(suivant);\n courant = suivant;\n }\n suivant = points.get(0);\n distance += courant.getDistance(suivant);\n return distance;\n }", "private void calculateDistances() {\n for (int point = 0; point < ntree.size(); point++) {\n calculateDistances(point);\n }\n }", "int[][] Naive(int m, Pointd[] points){\n int[][] tours = new int[m][];\n for(int i=0; i<m; i++){\n if(i<points.length%m) tours[i] = new int[points.length/m+1];\n else tours[i] = new int[points.length/m];\n }\n\n //Select the first point, find the next closest point, find the next closest point to that etc\n boolean[] alreadyInTour = new boolean[points.length];\n double minDistance;\n double distance;\n Pointd pointA;\n Pointd pointB;\n int index = 0;\n int n;\n\n for(int k=0; k<m; k++){\n //Each row of tours, first find a node that isn't in a tour\n n = 0;\n while(alreadyInTour[n]) n++;\n pointA = points[n];\n tours[k][0] = n;\n alreadyInTour[n] = true;\n\n int iterate = 0;\n int j=1;\n while(j<tours[k].length){\n if(!alreadyInTour[iterate]){\n minDistance = Double.MAX_VALUE;\n //Find next closest point to pointA\n for(int i=0; i<points.length; i++){\n pointB = points[i];\n if(!alreadyInTour[i]){\n distance = Math.sqrt( Math.pow(pointA.x - pointB.x, 2) + Math.pow(pointA.y - pointB.y, 2) );\n if(distance < minDistance){\n minDistance = distance;\n index = i;\n }\n }\n }\n //System.out.println(index);\n tours[k][j] = index;\n alreadyInTour[index] = true;\n j++;\n }\n iterate++;\n if(iterate >= points.length) iterate = 0;\n }\n }\n for(int i=0; i<tours.length; i++){\n //System.out.println(Arrays.toString(tours[i]));\n }\n return tours;\n }", "public void compute() {\n\n this.jddPtsInflexion.clear();\n ILineString lsInitialee = this.geom;\n\n ILineString lsInitiale = Operateurs.resampling(lsInitialee, 1);\n ILineString lsLisse = GaussianFilter.gaussianFilter(lsInitiale, 5, 1);\n\n double sumOfDistances = 0;\n double length = 70;// 200 m max\n double sumOfAngels = 0;\n // ArrayList<Double> angels=new ArrayList<Double>();\n ArrayList<Double> differences = new ArrayList<Double>();\n\n ArrayList<Double> distances = new ArrayList<Double>();\n\n IDirectPosition p1 = lsInitiale.coord().get(0);\n IDirectPosition p2 = lsInitiale.coord().get(1);\n\n distances.add(p1.distance2D(p2));\n sumOfDistances += distances.get(distances.size() - 1);\n\n double angel = Math.atan2(p1.getY() - p2.getY(), p1.getX() - p2.getX());\n\n angel = (angel + Math.PI) * 180 / Math.PI;\n\n // angels.add(angel);\n\n for (int i = 1; i < lsInitiale.coord().size() - 1; i++) {\n\n p1 = lsInitiale.coord().get(i);\n p2 = lsInitiale.coord().get(i + 1);\n\n distances.add(p1.distance2D(p2));\n sumOfDistances += distances.get(distances.size() - 1);\n\n double newAngel = Math\n .atan2(p1.getY() - p2.getY(), p1.getX() - p2.getX());\n\n // give the value that varie from 0 to 360-epsilon\n newAngel = (newAngel + Math.PI) * 180 / Math.PI;\n\n // angels.add(newAngel);\n\n while (sumOfDistances > length && differences.size() > 0) {\n sumOfDistances -= distances.get(0);\n\n sumOfAngels -= differences.get(0);\n\n distances.remove(0);\n // System.out.println(\"olddiff=\" + differences.get(0));\n differences.remove(0);\n\n }\n\n double diff = newAngel - angel;\n\n if (diff > 180)\n diff = -360 + diff;// for the case of angel=10 and newAngel=350;\n else if (diff < -180)\n diff = 360 + diff;\n\n differences.add(diff);\n sumOfAngels += diff;\n angel = newAngel;\n // System.out.println(\"sumOfAngels=\" + sumOfAngels);\n // System.out.println(\"angel=\" + newAngel);\n // System.out.println(\"diff=\" + diff);\n\n /*\n * for(int k=0;k<angels.size();k++){ double diff2=newAngel-angels.get(k));\n * if(diff2>180)diff2=360-diff2;// for the case of angel=10 and\n * newAngel=350; else if(diff2<-180)diff2=-360-diff2;\n * if(Math.abs(newAngel->200) {\n * \n * }\n * \n * \n * }\n */\n\n if (Math.abs(sumOfAngels) > 100) {\n\n double maxOfDiff = 0;\n int indexOfMaxOfDiff = -1;\n for (int k = 0; k < differences.size(); k++) {\n if (differences.get(k) > maxOfDiff) {\n maxOfDiff = differences.get(k);\n indexOfMaxOfDiff = k;\n\n }\n\n }\n double maxDistance = -1;\n int maxDistancePointIndex = -1;\n // if(i+differences.size()-indexOfMaxOfDiff-1>=jddPtsInflexion.size())\n for (int jj = 0; jj < differences.size(); jj++) {\n // jddPtsInflexion.add(lsInitiale.coord().get(i+differences.size()-indexOfMaxOfDiff-2));\n if (i + jj - indexOfMaxOfDiff >= 0\n && i + jj - indexOfMaxOfDiff < lsInitiale.coord().size()) {\n int currIndex = i + jj - indexOfMaxOfDiff;\n double distance = lsInitiale.coord().get(currIndex).distance2D(\n lsLisse.coord().get(currIndex));\n if (distance > maxDistance) {\n maxDistance = distance;\n maxDistancePointIndex = currIndex;\n }\n\n }\n\n }\n\n if (maxDistancePointIndex >= 0)\n this.jddPtsInflexion.add(lsInitiale.coord()\n .get(maxDistancePointIndex));\n\n differences.clear();\n sumOfDistances = distances.get(distances.size() - 1);\n distances.clear();\n sumOfAngels = 0;\n i++;\n\n }\n\n }\n\n }", "public static void main(String[] args) {\n\t\tCustomer depot = new Customer();\n\t\tdepot.x = 50;\n\t\tdepot.y = 50;\n\t\tdepot.demand = 0;\n\n\n\t\tint myBirthNumber = 8021994;\n\n\t\tRandom ran = new Random (myBirthNumber); \n\n\t\tint numberOfCustomers = 30;\n\n\t\t//Creating the list with the customers\t\t\n\t\tArrayList <Customer> customers = new ArrayList<>(); // with this code we initialize the new ArrayList, which is called \"customers\"\n\t\tfor (int i = 1 ; i <= numberOfCustomers; i++)\n\t\t{\n\t\t\tCustomer cust = new Customer();\n\t\t\tcust.x = ran.nextInt(100);\n\t\t\tcust.y = ran.nextInt(100); \n\t\t\tcust.demand = 4 + ran.nextInt(7); \n\t\t\tcustomers.add(cust);\n\t\t}\n\n\t\t//Build the allCustomers array and the corresponding distance matrix\n\t\tArrayList <Customer> allCustomers = new ArrayList<Customer>();\n\n\n\t\tallCustomers.add(depot);\n\t\tfor (int i = 0 ; i < customers.size(); i++)\n\t\t{\n\t\t\tCustomer cust = customers.get(i);\n\t\t\tallCustomers.add(cust);\n\t\t}\n\n\t\tfor (int i = 0 ; i < allCustomers.size(); i++)\n\t\t{\n\t\t\tCustomer nd = allCustomers.get(i);\n\t\t\tnd.ID = i;\n\t\t}\n\n\n\t\t// This is a 2-D array which will hold the distances between node pairs\n\t\t// The [i][j] element of this array is the distance required for moving \n\t\t// from the i-th node of allNodes (node with id : i)\n\t\t// to the j-th node of allNodes list (node with id : j)\n\t\tdouble [][] distanceMatrix = new double [allCustomers.size()][allCustomers.size()];\n\t\tfor (int i = 0 ; i < allCustomers.size(); i++)\n\t\t{\n\t\t\tCustomer from = allCustomers.get(i);\n\n\t\t\tfor (int j = 0 ; j < allCustomers.size(); j++)\n\t\t\t{\n\t\t\t\tCustomer to = allCustomers.get(j);\n\n\t\t\t\tdouble Delta_x = (from.x - to.x);\n\t\t\t\tdouble Delta_y = (from.y - to.y);\n\t\t\t\tdouble distance = Math.sqrt((Delta_x * Delta_x) + (Delta_y * Delta_y));\n\n\t\t\t\tdistance = Math.round(distance);\n\n\t\t\t\tdistanceMatrix[i][j] = distance;\n\n\t\t\t}\n\t\t}\n\n\n\n\t\t// This is the solution object - It will store the solution as it is iteratively generated\n\t\t// The constructor of Solution class will be executed\n\t\tSolution s = new Solution();\n\n\t\tint numberOfVehicles = 10;\n\n\t\t//Let rtList be the ArrayList of Vehicles assigned to the solution \"s\".\t\t\n\t\tArrayList <Route> rtList = s.routes; \n\t\tfor (int i = 1 ; i <= numberOfVehicles; i++)\n\t\t{\n\t\t\tRoute routeTemp = new Route();\n\t\t\trouteTemp.load = 0;\n\t\t\trouteTemp.capacity = 50;\n\t\t\trouteTemp.cost = 0;\n\t\t\trtList.add(routeTemp);\n\t\t}\n\n\t\t// indicate that all customers are non-routed\n\t\tfor (int i = 0 ; i < customers.size(); i++)\n\t\t{\n\t\t\tcustomers.get(i).isRouted = false;\n\t\t}\n\n\n\t\t/* \n\t\t * ##################\n\t\t * # INITIALIZATION #\n\t\t * ##################\n\t\t * */\n\n\t\t// Setting a count for customers who are not inserted in the solution yet\n\t\tint notInserted = numberOfCustomers;\n\n\t\tfor (int j=0; j < numberOfVehicles; j++)\n\t\t{\n\t\t\tArrayList <Customer> nodeSequence = rtList.get(j).customers;\n\t\t\tnodeSequence.add(depot);\t\n\n\t\t\tint capacity = rtList.get(j).capacity; // The capacity of this vehicle (=50)\n\t\t\tint load = rtList.get(j).load; // The initial load of this vehicle (=0)\n\t\t\t// Setting a boolean variable that shows the assignment is not final yet.\n\t\t\tboolean isFinal = false;\n\t\t\t// If we have no more customers to insert, we add the depot at the end of the sequence. \n\t\t\tif (notInserted == 0) {\n\t\t\t\tisFinal = true;\n\t\t\t\tnodeSequence.add(depot);\n\t\t\t}\n\t\t\twhile (isFinal == false)\t\t\t{\n\t\t\t\t//this will be the position of the nearest neighbor customer -- initialization to -1\n\t\t\t\tint positionOfTheNextOne = -1;\n\t\t\t\t// This will hold the minimal cost for moving to the next customer - initialized to something very large\n\t\t\t\tdouble bestCostForTheNextOne = Double.MAX_VALUE;\n\t\t\t\t//This is the last customer of the route (or the depot if the route is empty)\n\t\t\t\tCustomer lastInTheRoute = nodeSequence.get(nodeSequence.size() - 1);\n\t\t\t\t//identify nearest non-routed customer\n\t\t\t\tfor (int k = 0 ; k < customers.size(); k++)\n\t\t\t\t{\n\t\t\t\t\t// The examined customer is called candidate\n\t\t\t\t\tCustomer candidate = customers.get(k);\n\t\t\t\t\t// if this candidate has not been visited by a vehicle\n\t\t\t\t\tif (candidate.isRouted == false)\t\t\t\t\t{\n\t\t\t\t\t\t//This is the cost for moving from the last visited customer to the candidate customer\n\t\t\t\t\t\tdouble trialCost = distanceMatrix[lastInTheRoute.ID][candidate.ID];\n\t\t\t\t\t\t//If this is the minimal cost found so far -> store this cost and the position of this best candidate\n\t\t\t\t\t\tif (trialCost < bestCostForTheNextOne && candidate.demand<= capacity)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tpositionOfTheNextOne = k;\n\t\t\t\t\t\t\tbestCostForTheNextOne = trialCost;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} // moving on to the next (candidate) customer\n\n\t\t\t\t// Step 2: Push the customer in the solution\n\t\t\t\t// We have found the customer to be pushed.\n\t\t\t\t// He is located in the positionOfTheNextOne position of the customers list\n\t\t\t\t// Let's inert him and update the cost of the solution and of the route, accordingly\n\n\t\t\t\tif (positionOfTheNextOne != -1 )\n\t\t\t\t{\n\t\t\t\t\tCustomer insertedNode = customers.get(positionOfTheNextOne);\n\t\t\t\t\t//Push the customer in the sequence\n\t\t\t\t\tnodeSequence.add(insertedNode);\n\t\t\t\t\t\n\t\t\t\t\trtList.get(j).cost = rtList.get(j).cost + bestCostForTheNextOne;\n\t\t\t\t\ts.cost = s.cost + bestCostForTheNextOne;\n\t\t\t\t\tinsertedNode.isRouted = true;\n\t\t\t\t\tcapacity = capacity - insertedNode.demand;\n\t\t\t\t\trtList.get(j).load = load + insertedNode.demand;\n\t\t\t\t\tload = load + insertedNode.demand;\n\t\t\t\t\tnotInserted = notInserted - 1;\n\t\t\t\t\t\n\t\t\t\t} else \n\t\t\t\t{ \n\t\t\t\t\t//if the positionOfTheNextOne = -1, it means there is no suitable candidate for this vehicle. So, we add the depot.\n\t\t\t\t\tnodeSequence.add(depot);\n\t\t\t\t\trtList.get(j).cost = rtList.get(j).cost + distanceMatrix[lastInTheRoute.ID][0];\n\t\t\t\t\ts.cost = s.cost + distanceMatrix[lastInTheRoute.ID][0];\n\t\t\t\t\tisFinal = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/* \n\t\t * ###########\n\t\t * # RESULTS #\n\t\t * ###########\n\t\t * */\n\n\n\t\tfor (int j=0; j<numberOfVehicles; j++)\n\t\t{\n\t\t\tint vehicle_number = j+1;\n\t\t\tSystem.out.println(\"Route for Vehicle #\" + vehicle_number);\n\t\t\tfor (int k=0; k<s.routes.get(j).customers.size(); k++) \n\t\t\t{\n\t\t\t\tSystem.out.print(s.routes.get(j).customers.get(k).ID + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t\tSystem.out.println(\"Route Cost = \" + s.routes.get(j).cost);\n\t\t\tSystem.out.println(\"Final Load: \" + s.routes.get(j).load);\n\t\t\tSystem.out.println(\"Final Remaining Capacity = \" + (rtList.get(j).capacity - s.routes.get(j).load));\n\t\t\tSystem.out.println(\"----------------------------------------\");\n\n\t\t}\t\t\n\t\tSystem.out.println(\"Total Solution Cost = \" + s.cost);\n\n\t\t// End of GCS Instance\n\n\n\t\t/* \n\t\t * ###################################################\n\t\t * # LOCAL SEARCH USING INTER+INTRA-RELOCATION MOVES #\n\t\t * ###################################################\n\t\t * */\n\n\n\t\t//this is a boolean flag (true/false) for terminating the local search procedure\n\t\tboolean terminationCondition = false;\n\n\t\t//this is a counter for holding the local search iterator\n\t\tint localSearchIterator = 0;\n\n\t\t//Here we apply the best relocation move local search scheme\n\t\t//This is an object for holding the best relocation move that can be applied to the candidate solution\n\t\tRelocationMove rm = new RelocationMove(); // in order to apply one relocation move for all routes - dont want to lose previous if i change vehicle\n\n\t\t//Initialize the relocation move rm\n\t\trm.positionOfRelocated = -1;\n\t\trm.positionToBeInserted = -1;\n\t\trm.fromRoute = 0;\n\t\trm.toRoute = 0;\n\t\trm.fromMoveCost = Double.MAX_VALUE;\n\t\trm.toMoveCost = Double.MAX_VALUE;\n\n\t\t// Until the termination condition is set to true repeat the following block of code\n\t\twhile (terminationCondition == false)\n\t\t{\n\t\t\t//With this function we look for the best relocation move\n\t\t\t//the characteristics of this move will be stored in the object rm\n\t\t\tfindBestRelocationMove(rm, s, distanceMatrix, numberOfVehicles);\n\n\t\t\t// If rm (the identified best relocation move) is a cost improving move, or in other words\n\t\t\t// if the current solution is not a local optimum\n\t\t\tif (rm.moveCost < 0)\n\t\t\t{\n\t\t\t\t//This is a function applying the relocation move rm to the candidate solution\n\t\t\t\tapplyRelocationMove(rm, s, distanceMatrix);\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//if no cost improving relocation move was found,\n\t\t\t\t//or in other words if the current solution is a local optimum\n\t\t\t\t//terminate the local search algorithm\n\t\t\t\tterminationCondition = true;\n\t\t\t}\n\n\t\t\tlocalSearchIterator = localSearchIterator + 1;\n\t\t}\n\n\n\t\t/* \n\t\t * ###########\n\t\t * # RESULTS #\n\t\t * ###########\n\t\t * */\n\t\t\n\t\t\n\t\tSystem.out.println(\"\");\n\t\tfor (int j=0; j<numberOfVehicles; j++)\n\t\t{\n\t\t\tint vehicle_number = j+1;\n\t\t\tSystem.out.println(\"Updated Route for Vehicle #\" + vehicle_number);\n\t\t\tfor (int k=0; k<s.routes.get(j).customers.size(); k++) \n\t\t\t{\n\t\t\t\tSystem.out.print(s.routes.get(j).customers.get(k).ID + \" \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t\tSystem.out.println(\"Route Cost = \" + s.routes.get(j).cost);\n\t\t\tSystem.out.println(\"Final Load: \" + s.routes.get(j).load);\n\t\t\tSystem.out.println(\"Final Remaining Capacity = \" + (rtList.get(j).capacity - s.routes.get(j).load));\n\t\t\tSystem.out.println(\"----------------------------------------\");\n\n\t\t}\t\t\n\t\tSystem.out.println(\"Total Solution Cost = \" + s.cost);\n\t\tSystem.out.println(\"Total Local Search Iterations = \" + localSearchIterator);\n\t\tSystem.out.println(\"Total Local Search Relocations = \" + (localSearchIterator-1));\n\n\n\n\t}", "private static List<Point> genererPointsAlea(int nbPoints) {\n /*List<Point> points = new ArrayList<>();\n Random rand = new Random(0);\n for(int i=0; i<nbPoints; i++) {\n Point p = new Point(rand.nextDouble(), rand.nextDouble());\n points.add(p);\n }\n return points;*/\n return null;\n }", "public static void ITdistances()\n\t{\n\t\t//System.err.println(\"Position\");\n\n\t\tclade = clad[k];\n\n\t\tclade.tipDistance = 0;\n\t\tclade.intDistance = 0;\n\t\tclade.tipDisNested = 0;\n\t\tclade.intDisNested = 0;\n\t\tclade.indTipClades = 0;\n\t\tclade.indIntClades = 0;\n\n\n\t\tif(clade.check != (double) clade.numSubClades && clade.check != 0)\n\t\t{ \n\t\t\tfor(i = 0; i < clade.numSubClades; i++)\n\t\t\t{\n\t\t\t\tif (clade.Position[i] == tip)\n\t\t\t\t\tclade.indTipClades += clade.rowTotal[i];\n\t\t\t\telse\n\t\t\t\t\tclade.indIntClades += clade.rowTotal[i];\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tfor(i = 0; i < clade.numSubClades; i++)\n\t\t\t{\n\t\t\t\t// weigthing within class\n\t\t\t\tclade.tipDistance += clade.Position[i] * clade.Dc[i] * (double) clade.rowTotal[i] / (double) clade.indTipClades;\n\t\t\t\tclade.tipDisNested += clade.Position[i] * clade.Dn[i] * (double) clade.rowTotal[i] / (double) clade.indTipClades;\n\t\t\t\tclade.intDistance += (1 - clade.Position[i]) * clade.Dc[i] * (double) clade.rowTotal[i] / (double) clade.indIntClades;\n\t\t\t\tclade.intDisNested += (1 - clade.Position[i]) * clade.Dn[i] * (double) clade.rowTotal[i] / (double) clade.indIntClades;\t\n\t\t\t\t\n\t\t\t\t// unweighted\n\t\t\t\t//clade.tipDistance += clade.Position[i] * clade.Dc[i] / (double) clade.check;\n\t\t\t\t//clade.tipDisNested += clade.Position[i] * clade.Dn[i] / (double) clade.check;\n\t\t\t\t//clade.intDistance += (1 - clade.Position[i]) * clade.Dc[i] / (double) (clade.numSubClades - clade.check);\n\t\t\t\t//clade.intDisNested += (1 - clade.Position[i]) * clade.Dn[i] / (double) (clade.numSubClades - clade.check);\t\n\t\t\t}\n\n\t\t clade.tipIntDistance = clade.intDistance - clade.tipDistance;\n\t\t clade.tipIntDisNested = clade.intDisNested - clade.tipDisNested;\n\t\t if(verbose){\n\t\t\tlogfile.println(\"\\nIT \" + clade.cladeName + \" indTipClades = \" + clade.indTipClades\n\t\t\t\t+ \" indIntClades + \" + clade.indIntClades);\n\t\t\tlogfile.println(\"\\nITc \" + clade.cladeName + \" meanInt = \" + clade.intDistance\n\t\t\t\t+ \" meanTip = \" + clade.tipDistance);\n\t\t\tlogfile.println(\"ITn \" + clade.cladeName + \" meanInt = \" + clade.intDisNested\n\t\t\t\t+ \" meanTip = \" + clade.tipDisNested);\n\t\t }\n\t\t}\n\n\t\t//System.err.println(\"IT clade \" + clade.cladeName + \" meanInt = \" + clade.intDistance + \" meanTip = \" + clade.tipDistance);\n\n\t}", "public void calcularFitness() {\n double fit = 0;\r\n for (int x=0; x < this.genotipo.length;x++){\r\n if (x!=this.genotipo.length-1){\r\n fit+=distancias[this.genotipo[x]][this.genotipo[x+1]];\r\n }else{\r\n fit+=distancias[this.genotipo[x]][this.genotipo[0]];\r\n }\r\n }\r\n this.fitness = fit;\r\n }", "private Map<Vertice<T>, Integer> caminosMinimoDikstra(Vertice<T> origen) {\n \tMap<Vertice<T>, Integer> distancias = new HashMap<Vertice<T>, Integer>();\n \tfor(Vertice<T> unVertice : this.vertices) {\n \t\tdistancias.put(unVertice, Integer.MAX_VALUE);\n \t}\n \tdistancias.put(origen, 0);\n \t\n \t// guardo visitados y pendientes de visitar\n \tSet<Vertice<T>> visitados = new HashSet<Vertice<T>>();\n \tTreeMap<Integer,Vertice<T>> aVisitar= new TreeMap<Integer,Vertice<T>>();\n\n \taVisitar.put(0,origen);\n \t \n \twhile (!aVisitar.isEmpty()) {\n \t\tEntry<Integer, Vertice<T>> nodo = aVisitar.pollFirstEntry();\n \t\tvisitados.add(nodo.getValue());\n \t\t\n \tint nuevaDistancia = Integer.MIN_VALUE;\n \tList<Vertice<T>> adyacentes = this.getAdyacentes(nodo.getValue());\n \t\n \tfor(Vertice<T> unAdy : adyacentes) {\n if(!visitados.contains(unAdy)) {\n Arista<T> enlace = this.buscarArista(nodo.getValue(), unAdy);\n if(enlace !=null) {\n nuevaDistancia = enlace.getValor().intValue();\n }\n int distanciaHastaAdy = distancias.get(nodo.getValue()).intValue();\n int distanciaAnterior = distancias.get(unAdy).intValue();\n if(distanciaHastaAdy + nuevaDistancia < distanciaAnterior ) {\n distancias.put(unAdy, distanciaHastaAdy + nuevaDistancia);\n aVisitar.put(distanciaHastaAdy + nuevaDistancia,unAdy);\n }\n }\n } \t\t\n \t}\n \tSystem.out.println(\"DISTANCIAS DESDE \"+origen);\n \tSystem.out.println(\"Resultado: \"+distancias);\n \treturn distancias;\n }", "private void calculateDistances(int point) {\n int start = getDistanceIndex(point);\n\n for (int i = 0; i < point; i++) {\n distances[start + i] = getDistance(ntree.get(point), ntree.get(i));\n }\n\n int numPoints = getNumPoints();\n\n for (int i = point + 1; i < numPoints; i++) {\n start = getDistanceIndex(i);\n distances[start + point] = getDistance(ntree.get(point),\n ntree.get(i));\n }\n }", "public double getDistanceMoyenne() {\n\t\treturn getDistanceTotale () / 12;\n\t}", "void calculate_distance()\n {\n \t\n \tfor(int i = 0; i<V ; i++)\n \t{\n \t\tfor(int j = 0; j<E ; j++)\n \t\t{\n \t\t\trelax(edge[j].src, edge[j].destination, edge[j].weight);\n \t\t}\n \t\tsp[i] = dist[i];\n \t\tx[i] = dist[i];\n \t}\n \tSystem.out.println();\n }", "public void genererchemin() {\r\n\t\tRandom hauteur1 = new Random();\r\n\t\tRandom longueur2 = new Random();\r\n\t\tRandom choix = new Random();\r\n\t\tArrayList chemin = new ArrayList();\r\n\t\tSystem.out.println(this.getHauteur());\r\n\t\tSystem.out.println(this.getLargeur());\r\n\t\tint milieu = getLargeur() / 2;\r\n\t\t//System.out.println(milieu);\r\n\t\tCoordonnees c = new Coordonnees(milieu, hauteur1.nextInt(\r\n\t\t\t\tgetLargeur()));\r\n\t\tchemin.add(c);\r\n\t\tchemin.add(new Coordonnees(0, 0));\r\n\t\tchemin.add(new Coordonnees(getLargeur() - 1, getHauteur() - 1));\r\n\t\tCoordonnees droite = new Coordonnees(milieu + 1, c.getHauteur());\r\n\t\tchemin.add(droite);\r\n\t\tCoordonnees gauche = new Coordonnees(milieu - 1, c.getHauteur());\r\n\t\tchemin.add(gauche);\r\n\t\tCoordonnees base1 = new Coordonnees(0, 0);\r\n\t\tCoordonnees base2 =new Coordonnees(getLargeur() - 1, getHauteur() - 1);\r\n\r\n\t\twhile (!gauche.equals(base1)) {\r\n\t\t\tif (gauche.getLargeur() == 0) {\r\n\t\t\t\tgauche = new Coordonnees(0, gauche.getHauteur() - 1);\r\n\t\t\t\tchemin.add(gauche);\r\n\t\t\t} else if (gauche.getHauteur() == 0) {\r\n\t\t\t\tgauche = new Coordonnees(gauche.getLargeur() - 1, 0);\r\n\t\t\t\tchemin.add(gauche);\r\n\t\t\t}\r\n\t\t\telse if (choix.nextInt(2) == 0) {\r\n\t\t\t\tgauche = new Coordonnees(gauche.getLargeur() - 1, \r\n\t\t\t\t\t\tgauche.getHauteur());\r\n\t\t\t\tchemin.add(gauche);\r\n\t\t\t} else {\r\n\t\t\t\tgauche = new Coordonnees(gauche.getLargeur(), \r\n\t\t\t\t\t\tgauche.getHauteur() - 1);\r\n\t\t\t\tchemin.add(gauche);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\twhile (!droite.equals(base2)) {\r\n\t\t\tif (droite.getLargeur() == (this.largeur -1)) {\r\n\t\t\t\tdroite = new Coordonnees(droite.getLargeur(), \r\n\t\t\t\t\t\tdroite.getHauteur() + 1);\r\n\t\t\t\tchemin.add(droite);\r\n\r\n\t\t\t} else if (droite.getHauteur() == (this.hauteur -1)) {\r\n\t\t\t\tdroite = new Coordonnees(droite.getLargeur() + 1, \r\n\t\t\t\t\t\tdroite.getHauteur());\r\n\t\t\t\tchemin.add(droite);\r\n\t\t\t\t//System.out.println(\"fais chier\");\r\n\t\t\t}\r\n\t\t\telse if (choix.nextInt(2) == 0) {\r\n\t\t\t\tdroite = new Coordonnees(droite.getLargeur() + 1, \r\n\t\t\t\t\t\tdroite.getHauteur());\r\n\t\t\t\tchemin.add(droite);\r\n\t\t\t} else {\r\n\t\t\t\tdroite = new Coordonnees(droite.getLargeur(), \r\n\t\t\t\t\t\tdroite.getHauteur() + 1);\r\n\t\t\t\tchemin.add(droite);\r\n\t\t\t}\r\n\t\t}\r\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tSystem.out.println(\"Quel est le pourcentage d'obstacle souhaite :\");\r\n\t\tint pourcentage = sc.nextInt();\r\n\t\tint ctp = getHauteur() * getLargeur() * pourcentage / 100;\r\n\t\twhile(ctp >0){\r\n\t\t\tCoordonnees obstacle = new Coordonnees(longueur2.nextInt(getLargeur()), \r\n\t\t\t\t\thauteur1.nextInt(getHauteur()));\r\n\t\t\t//System.out.println(!chemin.contains(obstacle));\r\n\t\t\tif (!chemin.contains(obstacle)) {\r\n\t\t\t\tthis.plateau[obstacle.getHauteur()][obstacle.getLargeur()] = new Obstacle(\r\n\t\t\t\t\t\tobstacle.getHauteur(), obstacle.getLargeur());\r\n\t\t\t\tctp--;\r\n\t\t\t} else {\r\n\t\t\t\t//System.out.println(obstacle + \"est sur le chemin\");\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private double calculeDistanceLinaire(int[] tableauDeIntRandom) {\n double resultat = 0;\n for (int i = 0; i < tableauDeIntRandom.length; i++) {\n resultat += Math.abs(tableauDeIntRandom[i] - tableauDeIntRandom[(i + 1) % tableauDeIntRandom.length]);\n }\n return resultat;\n }", "public static void main(String[] args) \n {\n int[] numOfPoints = { 1000, 10000, 7000, 10000, 13000 };\n for(int count = 0; count < numOfPoints.length; count++)\n {\n List<Point> pointsTobeUsed = new ArrayList<Point>();\n int current = numOfPoints[count];\n int inc = 0;\n \n //creating list of points to be used\n for(int x = 0; x <= current; x++)\n {\n \n if(x <= current/2)\n {\n pointsTobeUsed.add(new Point(x,x));\n \n }\n else\n {\n pointsTobeUsed.add(new Point(x, x - (1 + 2*(inc)) ) );\n inc++;\n }\n }\n \n //n logn implementation of Pareto optimal\n long timeStart = System.currentTimeMillis();\n \n // n logn quicksort\n pointsTobeUsed = quickSort(pointsTobeUsed, 0, pointsTobeUsed.size() -1 );\n \n \n \n ParetoOptimal(pointsTobeUsed);\n \n \n long timeEnd = System.currentTimeMillis();\n System.out.println(\"final:\" + \" exper: \" + (timeEnd - timeStart) + \" N: \" + current ); \n }\n }", "@Test\r\n\tpublic void testDistancia0() \r\n\t{\r\n\t\tAssert.assertEquals(1.41, new Ponto(3,3).dist(new Ponto(4,2)), EPSILON);\r\n\t\tAssert.assertEquals(26.20, new Ponto(-7,-4).dist(new Ponto(17,6.5)), EPSILON);\t\r\n\t\tAssert.assertEquals(0.00, new Ponto(0,0).dist(new Ponto(0,0)), EPSILON);\t\r\n\t}", "void MontaValores(){\r\n // 0;0;-23,3154166666667;-51,1447783333333;0 // Extrai os valores e coloca no objetos\r\n // Dis;Dir;Lat;Long;Velocidade\r\n // Quebra de Rota lat=-999.999 long=-999.999 ==> Marca ...\r\n \r\n int ind=0;\r\n NMEAS=NMEA.replace(\",\" , \".\");\r\n \r\n //1)\r\n dists=NMEAS.substring(ind,NMEAS.indexOf(\";\",ind));\r\n Distancia=Double.valueOf(dists);\r\n ind=ind+dists.length()+1;\r\n \r\n //2)\r\n dirs=NMEAS.substring(ind,NMEAS.indexOf(\";\",ind+1));\r\n Direcao=Double.valueOf(dirs);\r\n ind=ind+dirs.length()+1;\r\n \r\n //3)\r\n lats=NMEAS.substring(ind,NMEAS.indexOf(\";\",ind+1));\r\n Lat=Double.valueOf(lats);\r\n ind=ind+lats.length()+1;\r\n \r\n //4)\r\n longs=NMEAS.substring(ind,NMEAS.indexOf(\";\",ind+1));\r\n Long=Double.valueOf(longs);\r\n ind=ind+longs.length()+1;\r\n \r\n //5)\r\n vels=NMEAS.substring(ind,NMEAS.length());\r\n // Transforma de Knots para Km/h\r\n Velocidade=Double.valueOf(vels)/100*1.15152*1.60934;\r\n vels=String.valueOf(Velocidade);\r\n ind=ind+vels.length()+1;\r\n \r\n }", "public static long calculateTotalDistance(ObservableArrayList<LatLng> points) {\n double result = 0;\n\n for (int i = 1; i < points.size(); i++) {\n result += distance(points.get(i), points.get(i - 1), 'K');\n }\n\n return (long) (result * 1000);\n }", "public static long journeyToMoon(int n, List<List<Integer>> astronaut) {\n // Write your code here\n Map<Integer, Node<Integer>> countryMap = new HashMap<>();\n for(List<Integer> pairs: astronaut) {\n Node<Integer> node1 = countryMap.computeIfAbsent(pairs.get(0), Node::new);\n Node<Integer> node2 = countryMap.computeIfAbsent(pairs.get(1), Node::new);\n node1.connected.add(node2);\n node2.connected.add(node1);\n }\n\n List<Integer> countryCluster = new ArrayList<>();\n for(Node<Integer> node: countryMap.values()) {\n if(node.connected.size() == 0) {\n countryCluster.add(1);\n } else if(!node.visited){\n countryCluster.add(getNodeCount3(node));\n }\n }\n List<Integer> countryNodes = countryMap.values().stream().map(nn -> nn.value).collect(Collectors.toList());\n List<Integer> missingNodes = new ArrayList<>();\n for(int i=0; i < n; i++) {\n if(!countryNodes.contains(i))\n missingNodes.add(i);\n }\n\n for(int i=0; i < missingNodes.size(); i++) {\n countryCluster.add(1);\n }\n\n long ans = 0;\n //For one country we cannot pair with any other astronauts\n if(countryCluster.size() >= 2) {\n ans = (long) countryCluster.get(0) * countryCluster.get(1);\n if(countryCluster.size() > 2) {\n int sum = countryCluster.get(0) + countryCluster.get(1);\n for(int i=2; i < countryCluster.size(); i++) {\n ans += (long) sum * countryCluster.get(i);\n sum += countryCluster.get(i);\n }\n }\n }\n\n /*\n permutation of two set with size A and B = AxB\n permutation of three set with size A,B,C = AxB + AxC + BxC = AxB + (A+B)xC\n permutation of four set with size A,B,C,D = AxB + AxC + AxD + BxC + BxD + CxD = AxB + (A+B)xC + (A+B+C)xD\n */\n /*\n if(keys.length == 1) {\n ans = keys[0].size();\n } else {\n ans = keys[0].size() * keys[1].size();\n if(keys.length > 2) {\n int sum = keys[0].size() + keys[1].size();\n for (int i = 2; i < keys.length; i++) {\n ans += sum * keys[i].size();\n sum += keys[i].size();\n }\n }\n }\n */\n return ans;\n }", "private void getDistance() {\n\n float dist = 0;\n Location location = \n locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);\n while (location==null) { //If we don't know where we are right now\n Toast.makeText(this, \"No last known location. Aborting...\", \n Toast.LENGTH_LONG).show();\n location = \n locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);\n }\n\n createPositions();\n\n dist = location.distanceTo(mPositions.get(0).toLocation());\n distanceList.add(dist);\n\n dist = mPositions.get(0).toLocation().distanceTo(mPositions.get(1).toLocation());\n distanceList.add(dist);\n dist = mPositions.get(1).toLocation().distanceTo(mPositions.get(2).toLocation());\n distanceList.add(dist);\n dist = mPositions.get(2).toLocation().distanceTo(mPositions.get(3).toLocation());\n distanceList.add(dist);\n dist = mPositions.get(3).toLocation().distanceTo(mPositions.get(4).toLocation());\n distanceList.add(dist);\n \n }", "public static void main(String[] args) {\r\n\t\tPosition p2 = new Position(47.984393, 0.236012);\r\n\t\t/*graine*/\r\n\t\tPosition p1 = new Position(47.987444,0.253475);\r\n\t\t\r\n\t\tFourmi fourmi = new Fourmi();\r\n\t\tChemin trackAllerGraine1;\r\n\t\tChemin trackRetourGraine1;\r\n\t\t\r\n\t\tChemin c = new Chemin();\r\n\t\tChemin c1 = new Chemin();\r\n\t\ttry {\r\n\t\t\tc.calculItineraire(p2,p1);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tc.add(p1);\r\n\t\ttrackAllerGraine1 = fourmi.creerTrack(c);\r\n\t\r\n\t\t\r\n\r\n\t\tfor(int i=0;i<trackAllerGraine1.size()-1;i++) {\r\n\t\t\tSystem.out.println(\"\\np\"+i+\" : \"+trackAllerGraine1.get(i).lat+\",\"+trackAllerGraine1.get(i).lon);\r\n\t\t\tSystem.out.println(trackAllerGraine1.get(i).getTimestamp());\r\n\t\t\tSystem.out.println(\"La distance entre ces deux points est de \"+p1.longueurEnM(trackAllerGraine1.get(i),trackAllerGraine1.get(i+1))+\"m\");\r\n\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(\"p\"+(trackAllerGraine1.size()-1)+\" : \"+trackAllerGraine1.get(trackAllerGraine1.size()-1).lat+\",\"+trackAllerGraine1.get(trackAllerGraine1.size()-1).lon);\r\n\t\tSystem.out.println(trackAllerGraine1.get(trackAllerGraine1.size()-1).getTimestamp());\r\n\t\t\r\n\t\ttry {\r\n\t\t\tc1.calculItineraire(p1, p2);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\tc1.add(p2);\r\n\t\ttrackRetourGraine1=fourmi.creerTrack(c1);\r\n\t\t\r\n\t\tfor(int i=0;i<trackRetourGraine1.size()-1;i++) {\r\n\t\t\tSystem.out.println(\"\\np\"+i+\" : \"+trackRetourGraine1.get(i).lat+\",\"+trackRetourGraine1.get(i).lon);\r\n\t\t\tSystem.out.println(trackRetourGraine1.get(i).getTimestamp());\r\n\t\t\tSystem.out.println(\"La distance entre ces deux points est de \"+p1.longueurEnM(trackRetourGraine1.get(i),trackRetourGraine1.get(i+1))+\"m\");\r\n\t\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(\"p\"+(trackRetourGraine1.size()-1)+\" : \"+trackRetourGraine1.get(trackRetourGraine1.size()-1).lat+\",\"+trackRetourGraine1.get(trackRetourGraine1.size()-1).lon);\r\n\t\tSystem.out.println(trackRetourGraine1.get(trackRetourGraine1.size()-1).getTimestamp());\r\n\t}", "@Override\n public double calculaTributos() {\n // TODO Auto-generated method stub\n return 10;\n }", "public double[] obtenerDistancias (List<NaveDTO> naveDTOS){\n logger.debug(\"MensajeService::obtenerDistancias()\");\n double[] array = new double[naveDTOS.size()];\n for (int i = 0; i<naveDTOS.size(); i++){\n array[i] = naveDTOS.get(i).getDistance();\n }\n return array;\n }", "private static void statistique(){\n\t\tfor(int i = 0; i<7; i++){\n\t\t\tfor(int j = 0; j<7; j++){\n\t\t\t\tfor(int l=0; l<jeu.getJoueurs().length; l++){\n\t\t\t\t\tif(jeu.cases[i][j].getCouleurTapis() == jeu.getJoueurs()[l].getNumJoueur()){\n\t\t\t\t\t\tjeu.getJoueurs()[l].setTapis(jeu.getJoueurs()[l].getTapisRest()+1);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tJoueur j;\n\t\tSystem.out.println(\"// Fin de la partie //\");\n\t\tfor(int i=0; i<jeu.getJoueurs().length; i++) {\n\t\t\tj =jeu.getJoueurs()[i];\n\t\t\tSystem.out.println(\"Joueur \"+ (j.getNumJoueur()+1) + \" a obtenue \"+j.getTapisRest()+j.getMonnaie()+\" points\" );\n\t\t}\n\t}", "void berechneUmfang() {\r\n\t\tfor (int i = 1; i < m_ANZAHL_POINTS; i++) {\r\n\t\t\tm_umfang += m_pointArray[i].distance(m_pointArray[i-1]);\t\t\r\n\t\t}\r\n\t}", "public double calcDistBetweenStops(){\n List<Location> locs = destinations.getLocationList();\r\n double totalDist = 0;\r\n for (int i = 0; i < (locs.size() - 1); i++){\r\n double distance = locs.get(i).DistanceTo(locs.get(i+1));\r\n totalDist += distance;\r\n }\r\n return totalDist;\r\n }", "public static void main(String[] args) {\n Scanner sc = new Scanner(System.in);\n \n mNodes = sc.nextInt();\n mEdges = sc.nextInt();\n \n mDistances = new int[mNodes+1][mNodes+1];\n \n for (int i =1; i <= mNodes; i++)\n {\n \n for (int j =1; j <=mNodes;j++)\n {\n mDistances[i][j] = Integer.MAX_VALUE;\n \n }\n }\n \n for (int i =1; i <= mNodes; i++)\n {\n mDistances[i][i] =0;\n }\n \n for (int i = 0 ; i < mEdges; i++)\n {\n int from = sc.nextInt();\n int to = sc.nextInt();\n \n mDistances[from][to] = sc.nextInt();\n \n \n }\n \n \n //FW\n \n for (int k = 1; k <= mNodes; k++)\n {\n \n for (int i = 1; i <= mNodes; i++)\n {\n \n for (int j = 1; j <= mNodes; j++)\n {\n \n if (mDistances[i][k]!= Integer.MAX_VALUE && mDistances[k][j] != Integer.MAX_VALUE )\n {\n if (mDistances[i][j] > mDistances[i][k] + mDistances[k][j])\n {\n \n mDistances[i][j] = mDistances[i][k] + mDistances[k][j];\n }\n \n }\n \n }\n }\n \n }\n \n mQueries = sc.nextInt();\n \n for (int i =0; i < mQueries; i++)\n {\n int dist = mDistances[sc.nextInt()][sc.nextInt()];\n \n if (dist == Integer.MAX_VALUE)\n {\n dist = -1;\n }\n \n System.out.println(dist);\n \n }\n \n \n \n \n \n \n \n \n \n }", "public void run() {\n PopulationFGA<Integer> poblacionActual = new PopulationFGA<>(funcionBorn,\n funcionFitness,\n problema.getDimension(),\n 1);\n poblacionActual.incializa(200);\n while(!condTerminacion.conditionReached(poblacionActual)) {\n System.out.println(\"Generacion Actual: \" + poblacionActual.getGeneracion());\n poblacionActual = iteration(poblacionActual);\n }\n ArrayList<IndividualFGA<Integer>> individuos = poblacionActual.generaIndividuos();\n IndividualFGA<Integer> mejor = individuos.get(0);\n for (IndividualFGA<Integer> e : individuos) {\n if (mejor.getFitness() <= e.getFitness())\n mejor = e;\n }\n System.out.println(\"Mejor solucion \" + '\\n' + mejor.toString());\n //System.out.println(\"Fitness \" + mejor.getFitness());\n int dim = problema.getDimension();\n int costo = 0;\n int obj1;\n int obj2;\n Phenotype<Integer> fenotipo = mejor.getRepActual();\n for (int i = 0; i < (dim - 1); i++) {\n obj1 = fenotipo.getAllele(i).intValue() - 1;\n for (int j = i + 1; j < dim; j++) {\n obj2 =fenotipo.getAllele(j).intValue() - 1; \n costo = costo + problema.getDistanciaEntre(i,j) * problema.getFlujoEntre(obj1,obj2);\n }\n }\n System.out.println(\"Costo de la solucion: \" + costo);\n\n }", "public int manhattan() {\n int dist = 0;\n for(int x = 0; x < n; x++) {\n for(int y = 0; y < n; y++) {\n if(tiles[x][y] != goal[x][y] && tiles[x][y] != 0) {\n int target = tiles[x][y] -1;\n int dest_row = target/n;\n int dest_col = target%n;\n dist += Math.abs((x-dest_col)) + Math.abs(y-dest_row);\n }\n }\n }\n return dist;\n }", "private void cheminMin (ArrayList<Integer> parcours, ArrayList<Integer> sommets, int n, double dist){\r\n\t\t\r\n\t\t//condition d'arret\r\n\t\tif (sommets.size()>=1){\r\n\t\t\tif (n != super.g.getDim()){\r\n\t\t\t\t\r\n\t\t\t\t//test si le parcours n'est pas sup�rieur au parcours total\r\n\t\t\t\tif (dist<super.dist){\r\n\t\t\t\t\tfor (int ind=0; ind<sommets.size(); ind++) {\r\n\t\t\t\t\t\tdouble dist2 = dist + super.g.calculDist(parcours.get(parcours.size()-1), sommets.get(ind));\r\n\t\t\t\t\t\tArrayList<Integer> sommets2 = new ArrayList<Integer>();\r\n\t\t\t\t\t\tArrayList<Integer> parcours2 = new ArrayList<Integer>();\r\n\t\t\t\t\t\tparcours2 = super.copieListe(parcours);\r\n\t\t\t\t\t\tsommets2 = super.copieListe(sommets);\r\n\t\t\t\t\t\tparcours2.add(sommets2.get(ind));\r\n\t\t\t\t\t\tsommets2.remove(ind);\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t//appel r�cursif avec les copies avec ajout du sommet dans le parcours\r\n\t\t\t\t\t\tcheminMin(parcours2, sommets2, n-1,dist2);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tArrayList<Integer> sommets2 = new ArrayList<Integer>();\r\n\t\t\t\tArrayList<Integer> parcours2 = new ArrayList<Integer>();\r\n\t\t\t\tparcours2 = super.copieListe(parcours);\r\n\t\t\t\tsommets2 = super.copieListe(sommets);\r\n\t\t\t\tparcours2.add(0);\r\n\t\t\t\t\r\n\t\t\t\t//appel r�cursif avec les copies\r\n\t\t\t\tcheminMin(parcours2, sommets2, n-1, dist);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tdouble dist2 = super.g.calculDist(0, parcours.get(parcours.size()-1))+dist;\r\n\t\t\tif (dist2<super.dist || super.dist == -1){\r\n\t\t\t\tsuper.dist = dist2;\r\n\t\t\t\tsuper.parcoursMin = super.copieListe(parcours);\r\n\t\t\t\tsuper.parcoursMin.add(0);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n public void run() {\n Point current = remainingPoints.remove(0); // always start at first point\n solutionOfAntK.add(current);\n Point next;\n double[] imaginaryDistances;\n double imaginaryDistance;\n int x, y; // -> index of points: -> to get the correct values form the matrices T & D\n int indexToRemove;\n for (int i = 0; i < tourSize - 1; i++) {\n imaginaryDistances = new double[remainingPoints.size()];\n imaginaryDistance = 0;\n for (int j = 0; j < remainingPoints.size(); j++) {\n next = remainingPoints.get(j);\n x = current.getId();\n y = next.getId();\n imaginaryDistances[j] = (Math.pow(T.get(x, y), alpha)) / (Math.pow(D.get(x, y), beta));\n imaginaryDistance += imaginaryDistances[j];\n }\n indexToRemove = getNextPoint(imaginaryDistances, imaginaryDistance);\n tourLengthOfAntK += utils.Utils.euclideanDistance2D(remainingPoints.get(indexToRemove), current);\n current = remainingPoints.remove(indexToRemove);\n solutionOfAntK.add(current);\n\n }\n // add distance from last point to start points\n tourLengthOfAntK += utils.Utils.euclideanDistance2D(solutionOfAntK.get(-1 + solutionOfAntK.size()), startPoint);\n\n }", "private ArrayList<Point> geraDeltas(ArrayList<Point> pontos) {\n\t\tArrayList<Point> deltas = new ArrayList<Point>();\n\t\tfor (int i = 0; i+1 < pontos.size(); i++) {\n\t\t\tPoint p = new Point((int)(pontos.get(i+1).getX() - pontos.get(i).getX()), (int) (pontos.get(i+1).getY() - pontos.get(i).getY()));\n\t\t\tdeltas.add(p);\n\t\t}\n\t\tSystem.out.println(\"Deltas derivada: \" +deltas);\n\t\treturn deltas;\n\t}", "private void calcularDistanciaRecorrer(){\r\n\t\tfloat diferenciax = siguientePunto.x - posicion.x;\r\n\t\tfloat diferenciay = siguientePunto.y - posicion.y;\r\n\t\tdistanciaRecorrer = (float) Math.sqrt(diferenciax*diferenciax+diferenciay*diferenciay);\r\n\t}", "public int calculerKgsNourritureParJour(){\r\n\t\treturn noms.size() * 10;\r\n\t}", "double getDistanceInMiles();", "public Transition[] computeDistances(){\n\t\tSystem.out.println(\"Computing Transitions...\");\n\t\tTransition[] instanceTransitions = new Transition[nbBd*(nbBd-1)*4];\n\t\t//i sera l'indice de la cellule du tableau\n\t\tint i=0;\n\t\tfor (Strip aStrip : tabStrips){\n\t\t\tfor (Strip anotherStrip : tabStrips)\n\t\t\t\tif (aStrip != anotherStrip){\n\t\t\t\t\tdouble dist = Math.sqrt(Math.pow(anotherStrip.getX0() - aStrip.getX0(), 2) + Math.pow(aStrip.getY0() - anotherStrip.getY0(), 2));\n\t\t\t\t\tdist = 2*(Math.atan(dist/((double)2000*indAltitude)));\n\t\t\t\t\tinstanceTransitions[i] = new Transition(aStrip.getInd(), false, anotherStrip.getInd(), false, (int)((indDMin + (dist / indVr))*1000), i);\n\t\t\t\t\ti++;\n\t\t\t\t\tdist = Math.sqrt(Math.pow(anotherStrip.getX1() - aStrip.getX0(), 2) + Math.pow(aStrip.getY0() - anotherStrip.getY1(), 2));\n\t\t\t\t\tdist = 2*(Math.atan(dist/((double)2000*indAltitude)));\n\t\t\t\t\tinstanceTransitions[i] = new Transition(aStrip.getInd(), false, anotherStrip.getInd(), true, (int)((indDMin + (dist / indVr))*1000), i);\n\t\t\t\t\ti++;\n\t\t\t\t\tdist = Math.sqrt(Math.pow(anotherStrip.getX0() - aStrip.getX1(), 2) + Math.pow(aStrip.getY1() - anotherStrip.getY0(), 2));\n\t\t\t\t\tdist = 2*(Math.atan(dist/((double)2000*indAltitude)));\n\t\t\t\t\tinstanceTransitions[i] = new Transition(aStrip.getInd(), true, anotherStrip.getInd(), false, (int)((indDMin + (dist / indVr))*1000), i);\n\t\t\t\t\ti++;\n\t\t\t\t\tdist = Math.sqrt(Math.pow(anotherStrip.getX1() - aStrip.getX1(), 2) + Math.pow(aStrip.getY1() - anotherStrip.getY1(), 2));\n\t\t\t\t\tdist = 2*(Math.atan(dist/((double)2000*indAltitude)));\n\t\t\t\t\tinstanceTransitions[i] = new Transition(aStrip.getInd(), true, anotherStrip.getInd(), true, (int)((indDMin + (dist / indVr))*1000), i);\n\t\t\t\t\ti++;\n\t\t\t\t}//i != j\n\t\t\t//calcul de indMiddleTMin au fur et a mesure en utilisant des coefficients \n\t\t\t//pour eviter de depasser la taille maximale des int \n\t\t\tint divider = ((2*i) / ((nbBd-1) * 4));\n\t\t\tindMiddleTMin = ((indMiddleTMin * (divider - 2)) + (aStrip.indTMin0 + aStrip.indTMin1)) / divider;\n\t\t}//for\n\t\treturn instanceTransitions;\n\t}", "public double getDistance(ArrayList<Integer> e, ArrayList<Integer> f) {\n double distance =0;\n if(e.size()>2 || f.size()>2){\n \n ArrayList<Double> aux = new ArrayList<>();\n aux.add (Math.sqrt(Math.pow(e.get(0) - f.get(0), 2) + Math.pow(e.get(1) - f.get(1), 2)));\n aux.add(Math.sqrt(Math.pow(e.get(0) - f.get(2), 2) + Math.pow(e.get(1) - f.get(3), 2)));\n aux.add(Math.sqrt(Math.pow(e.get(0) - f.get(4), 2) + Math.pow(e.get(1) - f.get(5), 2)));\n aux.add(Math.sqrt(Math.pow(e.get(0) - f.get(6), 2) + Math.pow(e.get(1) - f.get(7), 2)));\n Collections.sort(aux);\n distance = aux.get(0);\n \n }\n else{\n\n distance = Math.sqrt(Math.pow(e.get(0) - f.get(0), 2) + Math.pow(e.get(1) - f.get(1), 2));\n //distancia entre dois pontos\n }\n return distance;\n\n }", "private void setDistanceValues(){\n float [] sumDistances = new float[1];\n\n distanceValue =0.0;\n\n for(int i= 0; i < trackingList.size()-1;i++){\n double startLong = trackingList.get(i).getLongtitude();\n double startLat = trackingList.get(i).getLatitude();\n double endLong = trackingList.get(i+1).getLongtitude();\n double endLat = trackingList.get(i+1).getLatitude();\n\n Location.distanceBetween(startLat,startLong,endLat,endLong,sumDistances);\n \n distanceValue += sumDistances[0];\n }\n\n }", "public void calculaMatrizCostes() {\n int i, j;\n double xd, yd;\n costes = new int[n][n];\n for (i = 0; i < n; i++) {\n for (j = 0; j < n; j++) {\n xd = vx[i] - vx[j];\n yd = vy[i] - vy[j];\n costes[i][j] = (int) Math.round(Math.sqrt((xd * xd) + (yd * yd)));\n }\n }\n }", "double getDistance();", "public double distance(){\n return DistanceTraveled;\n }", "@Test\n public void test_distanceLinaireSurY_ParcourOptimum_Pour_4villes() {\n\n Pays pays = new Pays(4);\n\n int positionX = (int) (Math.random() * 50);\n\n pays.setPositionVille(0, new Point(positionX, 2));\n pays.setPositionVille(1, new Point(positionX, 3));\n pays.setPositionVille(2, new Point(positionX, 4));\n pays.setPositionVille(3, new Point(positionX, 5));\n\n brutForceV3.recherche(pays, 0);\n\n assertEquals(\"0>1>2>3>0\", brutForceV3.getParcours().getVillesEmprunté());\n assertEquals(brutForceV3.getParcours().getDistance(),\n parcoursVilles(pays, brutForceV3.getParcours().getVillesEmprunté(),\">\"));\n\n }", "public static void main(String[] args) {\n ArrayList<Persona> cola = new ArrayList<>();\r\n \r\n generarCola(cola);\r\n \r\n //Creamos variables que nos seran útiles\r\n double recaudacion;\r\n double recaudacionTotal=0;\r\n Persona espectadorActual;\r\n int edadActual;\r\n int contadorPersonas=0;\r\n \r\n //Creamos el iterator\r\n Iterator<Persona> it=cola.iterator();\r\n \r\n \r\n //Recorremos la cola\r\n while(it.hasNext()){\r\n \r\n espectadorActual=it.next();\r\n \r\n //\"Atendemos\" al espectador para que pague\r\n edadActual=espectadorActual.getEdad();\r\n \r\n //Comprobamosla edad\r\n if(edadActual>=5 && edadActual<=10) { \r\n \trecaudacion=1; \r\n } else if(edadActual>=11 && edadActual<=17) {\r\n \trecaudacion=2.5;\r\n } else {\r\n \trecaudacion=3.5;\r\n }\r\n contadorPersonas++;\r\n recaudacionTotal+=recaudacion;\r\n \r\n System.out.println(\"Una persona de \"+edadActual+\" años se le ha cobrado \" +recaudacion+ \" euros\");\r\n \r\n }\r\n \r\n //Mostramos el resultado\r\n System.out.println(\"La recaudación es de \"+recaudacionTotal+\" euros y han venido \"+contadorPersonas);\r\n \r\n }", "@Override\n public ArrayList<ArrayList<String>> getNeighborhood(ArrayList<String> point, double argument1, double argument2) {\n ArrayList<ArrayList<String>> neighborhood = new ArrayList<>();\n String[] moves = {\"U\", \"D\", \"L\", \"R\"};\n if(point.size() == 0){\n point.add(moves[(int)(Math.random()*4)]);\n }\n\n //kazde rozwiązanie powstaje przez wstawienie każdego ruchu w środku ścieżki\n for(int i = 0; i<point.size(); i++){\n for(String move : moves){\n ArrayList<String> newPath = arrayListDeepCopy(point);\n newPath.add(i, move);\n newPath = cleanUpPath(newPath);\n if(testFunction.check(newPath)) neighborhood.add(newPath);\n }\n for(String move : moves){\n ArrayList<String> newPath = arrayListDeepCopy(point);\n newPath.add(i, move);\n newPath.add(i, move);\n newPath = cleanUpPath(newPath);\n if(testFunction.check(newPath)) neighborhood.add(newPath);\n }\n }\n\n //kazde rozwiązanie powstaje przez usunięcie jednego elementu\n for(int i=0; i<point.size(); i++){\n ArrayList<String> newPath = arrayListDeepCopy(point);\n newPath.remove(i);\n newPath = cleanUpPath(newPath);\n if(testFunction.check(newPath)) neighborhood.add(newPath);\n }\n\n //kazde rozwiązanie powstaje przez swapowanie wszystkich z losowym\n int random = (int)(Math.random()*point.size());\n for(int i=0; i<point.size(); i++){\n ArrayList<String> newPath = arrayListDeepCopy(point);\n newPath.set(i, point.get(random));\n newPath.set(random, point.get(i));\n newPath = cleanUpPath(newPath);\n if(testFunction.check(newPath)) neighborhood.add(newPath);\n }\n\n //System.out.println(neighborhood.size());\n\n ArrayList<ArrayList<String>> newNeighborhood = new ArrayList<>();\n for (int i = 0; i < neighborhood.size(); i++) {\n newNeighborhood.add(shortenPath(neighborhood.get(i)));\n }\n\n return newNeighborhood;\n }", "@Test\n public void test_distanceLinaireSurX_distanceLinaireSurX_ParcourOptimum_Pour_4villes() {\n\n Pays pays = new Pays(4);\n\n int positionY = (int) (Math.random() * 50);\n\n pays.setPositionVille(0, new Point(2, positionY));\n pays.setPositionVille(1, new Point(3, positionY));\n pays.setPositionVille(2, new Point(4, positionY));\n pays.setPositionVille(3, new Point(5, positionY));\n\n brutForceV3.recherche(pays, 0);\n\n assertEquals(\"0>1>2>3>0\", brutForceV3.getParcours().getVillesEmprunté());\n assertEquals(brutForceV3.getParcours().getDistance(),\n parcoursVilles(pays, brutForceV3.getParcours().getVillesEmprunté(),\">\"));\n\n }", "private void laskeMatkojenKesto() {\n matkojenkesto = 0.0;\n\n for (Matka m : matkat) {\n matkojenkesto += m.getKesto();\n }\n }", "private void calculateDistances(int pDistancia,int pMetrica,int k)\n\t{\n\t\tDistance dist = null;\n\t\t\n\t\tfor (int i = 0; i < clusterList.size(); i++)\n\t\t{\n\t\t\tfor (int j = i+1; j < clusterList.size(); j++)\n\t\t\t{\n\t\t\t\tdist = new Distance(clusterList.get(i), clusterList.get(j));\n\t\t\t\tdist.calculateDistance(pDistancia, pMetrica, k);\n\t\t\t\tdistanceList.addLast(dist);\n\t\t\t}\n\t\t}\n\t\tCollections.sort(distanceList);\n\t}", "void stampaStatisticheNodo() {\r\n for(Object obj : this.nodes)\r\n {\r\n Nodo n = (Nodo)obj;\r\n \r\n TransportLayer tl = n.myTransportLayer;\r\n tl.stampaStatistiche();\r\n \r\n // System.out.println(\"=====STAMPA STATISTICHE NODO NETWORK LAYER====\");\r\n NetworkLayer nl = n.myNetLayer;\r\n // String s = nl.getStat();\r\n nl.stampaStatistiche();\r\n // System.out.println(s);\r\n // System.out.println(\"=====FINE====\");\r\n \r\n physicalLayer pl = n.myPhyLayer;\r\n pl.stampaStatistiche();\r\n }\r\n }", "public int distBonus(){\n Player currentplayer = state.getCurrentPlayer();\n Maze maze = state.getMaze();\n Cell[][] tabcells = maze.getCells();\n ArrayList<GameObject> listObjectsOnCurrentCell;\n GameObject objectOnCell;\n int distTmp;\n int dist= tabcells.length+tabcells[0].length;\n for(int i=0;i<tabcells.length;i++){\n for(int j=0;j<tabcells[0].length;j++){\n listObjectsOnCurrentCell = tabcells[i][j].getGameObjects();\n for(GameObject object: listObjectsOnCurrentCell){\n if(object instanceof Bonus || object instanceof BonusWall){\n distTmp = manhattan(object,currentplayer);\n if(distTmp<dist){\n dist = distTmp;\n }\n }\n }\n }\n }\n return dist;\n }", "public static Tour NN (double distancematrix [][], List<Point> pointList) {\n Stack<Integer> stack= new Stack<Integer>();\n Tour tour = new Tour(0);\n\n int numbernodes;\n numbernodes = pointList.size();\n int visited[] = new int[numbernodes];\n int randomNum = ThreadLocalRandom.current().nextInt(1, numbernodes);\n int pointNumber = pointList.get(randomNum - 1).getPointNumber();\n\n visited[pointNumber - 1] = 1;\n tour.addPoint(pointList.get(randomNum - 1));\n int element, dst = 0, i, pos = 0;\n stack.push(pointNumber);\n element = stack.peek() - 1;\n boolean minFlag = false;\n while (!stack.isEmpty()) {\n double min = Integer.MAX_VALUE;\n for (i = 0; i < pointList.size(); i++) {\n int cityIndex = pointList.get(i).getPointNumber() - 1;\n if (distancematrix[element][cityIndex] > 0 && visited[i] == 0) {\n if (min > distancematrix[element][cityIndex]) {\n min = distancematrix[element][cityIndex];\n dst = cityIndex + 1;\n pos = i;\n minFlag = true;\n }\n }\n }\n if (minFlag) {\n visited[dst - 1] = 1;\n stack.push(dst);\n element = stack.peek() - 1;\n tour.addPoint(pointList.get(pos));\n minFlag = false;\n continue;\n }\n stack.pop();\n }\n return tour;\n }", "@Override\n\tpublic double calculaTributos() {\n\t\treturn numeroDePacientes * 10;\n\t}", "private void laskeMatkojenPituus() {\n matkojenpituus = 0.0;\n\n for (Matka m : matkat) {\n matkojenpituus += m.getKuljettumatka();\n }\n\n }", "public int manhattan() {\n int distance = 0;\n for (int i = 0; i < _N; i++) {\n for (int j = 0; j < _N; j++) {\n int value = _tiles[i][j];\n if (value != 0) {\n int yDim = (value - 1) % _N;\n int xDim = (value - 1) / _N;\n distance = distance + Math.abs(xDim - i) + Math.abs(yDim - j);\n }\n }\n }\n return distance;\n }", "public int generatePassengers() {\n int passengersAdded = 0;\n int probSize = getProbs().size();\n int stopSize = this.getStops().size();\n int stopIndex = this.getStops().get(0).getId();\n int lastStopIndex = this.getStops().get(this.getStops().size() - 1).getId();\n int probCount = 0;\n int stopCount = 0;\n while (probCount < probSize && stopCount < stopSize) {\n // Get this stop's probability\n double initialGenerationProbability = getProbs().get(probCount);\n double currentGenerationProbability = initialGenerationProbability;\n // while there is still a (>.01%) chance of generating a passenger, try\n while (currentGenerationProbability > 0.0001 && stopIndex != lastStopIndex) {\n // Generate a random double value\n Random rand = new Random();\n double generationValue = 0;\n if (RandomPassengerGenerator.DETERMINISTIC) {\n generationValue = RandomPassengerGenerator.DETERMINISTIC_VALUE;\n } else {\n generationValue = rand.nextDouble();\n }\n if (generationValue < currentGenerationProbability) {\n Passenger p = PassengerFactory.generate(stopIndex, lastStopIndex);\n passengersAdded += this.getStops().get(stopCount).addPassengers(p);\n }\n currentGenerationProbability *= initialGenerationProbability;\n }\n stopIndex++;\n probCount++;\n stopCount++;\n }\n return passengersAdded;\n }", "public int fondMagasin(){\n\tint total =this.jeton;\n\tfor(Caisse c1 : this.lesCaisses){\n\ttotal = c1.getTotal()+total;\n\t}\n\treturn total;\n}", "public int getKMSelanjutnya(){\n\t\treturn (getDistance() - N * 1000) * costPerKm / 1000;\n\t}", "private float distanceMoyenne(DMatchVector bestMatches){\n\n float DM=0.0f;\n for(int i=0;i<bestMatches.size();i++){\n\n DM+=bestMatches.get(i).distance();\n }\n\n DM=DM/bestMatches.size();\n return DM;\n\n }", "private int calcDistance()\n\t{\n\t\tint distance = 0;\n\n\t\t// Generate a sum of all of the difference in locations of each list element\n\t\tfor(int i = 0; i < listSize; i++) \n\t\t{\n\t\t\tdistance += Math.abs(indexOf(unsortedList, sortedList[i]) - i);\n\t\t}\n\n\t\treturn distance;\n\t}", "private void nourrireLePeuple() {\n\t\t\tint totalDepense = (int)((population * 1) + (populationColoniale * 0.8) + ((armee + armeeDeployee()) * nourritureParArmee));\r\n\t\t\tnourriture -= totalDepense;\r\n\t\t\tenFamine = (nourriture > 0) ? false : true;\r\n\t\t}", "public static void Agrupar() {\n\t\tArrayList<ArrayList<Double>> distancias_centroids = new ArrayList<ArrayList<Double>>();\n\t\tfor (int i=0;i<centroids.size();i++) {\n\t\t\tArrayList<Double> distancias= new ArrayList<Double>();\n\t\t\tfor (int j=0;j<petalas.size();j++) {\n\t\t\t\tdouble x1= centroids.get(i).petal_length;\n\t\t\t\tdouble x2= petalas.get(j).petal_length;\n\t\t\t\tdouble y1= centroids.get(i).petal_width;\n\t\t\t\tdouble y2= petalas.get(j).petal_width;\n\t\t\t\tdouble cateto1= x1-x2;\n\t\t\t\tdouble cateto2= y1-y2;\n\t\t\t\tdouble hipotenusa = Math.sqrt(cateto1*cateto1+cateto2*cateto2);\n\t\t\t\tdistancias.add(hipotenusa);\n\t\t\t\t/*\n\t\t\t\tSystem.out.println(\"cateto1: \"+cateto1);\n\t\t\t\tSystem.out.println(\"cateto2: \"+cateto2);\n\t\t\t\tSystem.out.println(\"hipotenusa: \"+hipotenusa);\n\t\t\t\t*/\n\t\t\t\t\t\t\t}\n\t\t\t\n\t\t\tdistancias_centroids.add(distancias);\t\t\t\n\t\t}\n\t\t/*\n\t\tSystem.out.println(\"Distancias Centroids:\");\n\t\tfor (int i=0;i<distancias_centroids.size();i++) {\n\t\t\tSystem.out.println(\"Centroid \"+i);\n\t\t\tfor (int j=0;j<distancias_centroids.get(i).size();j++) {\n\t\t\t\tSystem.out.println(distancias_centroids.get(i).get(j));\n\t\t\t}\n\t\t}\n\t\t*/\n\t\t//Para qual centroid pertece cada ponto\n\t\tArrayList<ArrayList<Petala>> pontos_de_cada_centroid = new ArrayList<ArrayList<Petala>>();\n\t\tfor (int i=0;i<centroids.size();i++) {\n\t\t\tArrayList<Petala> p = new ArrayList<Petala>();\n\t\t\tpontos_de_cada_centroid.add(p); \n\t\t}\n\t\tfor (int i=0;i<petalas.size();i++) {\n\t\t\tdouble menor =100;\n\t\t\tint centroid_menor=0;\n\t\t\tfor (int j=0;j<centroids.size();j++) {\n\t\t\t\tif (distancias_centroids.get(j).get(i)<menor) {\n\t\t\t\t\tmenor = distancias_centroids.get(j).get(i);\n\t\t\t\t\tcentroid_menor=j;\n\t\t\t\t}\n\t\t\t}\n\t\t\tpontos_de_cada_centroid.get(centroid_menor).add(petalas.get(i));\n\t\t}\n\t\t/*\n\t\tfor (int i=0;i<pontos_de_cada_centroid.size();i++) {\n\t\t\tSystem.out.println(\"Centroid \"+i);\n\t\t\tSystem.out.println(\"Petalas: \");\n\t\t\tSystem.out.println(pontos_de_cada_centroid.get(i));\n\t\t}\n\t\t*/\n\t\t//Novos centroids\n\t\tArrayList<Petala> novos_centroids = new ArrayList<Petala>();\n\t\tfor (int i=0;i<pontos_de_cada_centroid.size();i++) {\n\t\t\tdouble soma_x=0;\n\t\t\tdouble soma_y=0;\n\t\t\tfor (int j=0;j<pontos_de_cada_centroid.get(i).size();j++) {\n\t\t\t\tsoma_x+=pontos_de_cada_centroid.get(i).get(j).petal_length;\n\t\t\t\tsoma_y+=pontos_de_cada_centroid.get(i).get(j).petal_width;\n\t\t\t}\n\t\t\tdouble novo_x=soma_x/pontos_de_cada_centroid.get(i).size();\n\t\t\tdouble novo_y=soma_y/pontos_de_cada_centroid.get(i).size();\n\t\t\tPetala novo_centroid = new Petala(novo_x,novo_y);\n\t\t\tnovos_centroids.add(novo_centroid);\n \t\t}\n\t\t\n\t\t//Gravar Geracao\n\t\tArrayList<Petala> gc= new ArrayList<Petala>();\n\t\tfor (int i=0;i<centroids.size();i++) {\n\t\t\tgc.add(centroids.get(i));\n\t\t}\n\t\tGeracao geracao = new Geracao(gc,pontos_de_cada_centroid);\n\t\tgeracoes.add(geracao);\n\t\t//Condicao de Parada\n\t\tboolean terminou = true;\n\t\tfor (int i=0; i<centroids.size();i++) {\n\t\t\tif (centroids.get(i).petal_length!=novos_centroids.get(i).petal_length) {\n\t\t\t\tterminou = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (centroids.get(i).petal_width!=novos_centroids.get(i).petal_width) {\n\t\t\t\tterminou = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (terminou) {\n\t\t\t/*\n\t\t\tSystem.out.println(\"Novos centroids:\");\n\t\t\tSystem.out.println(novos_centroids);\n\t\t\t\n\t\t\tSystem.out.println(\"FIM!\");\n\t\t*/\n\t\t}else {\n\t\t\tcentroids.clear();\n\t\t\tfor (int i=0;i<novos_centroids.size();i++) {\n\t\t\t\tcentroids.add(novos_centroids.get(i));\n\t\t\t}\n\t\tgeracao_atual++;\n\t\t\tAgrupar();\n\t\t}\n\t}", "private void generateMap () {\n for (int i = 0 ; i < n ; i++) {\n mapCoordinate[i] = new CoordinateInfo(100 * random.nextFloat(), 100 * random.nextFloat());\n\n for (int j = 0 ; j <= i ; j++) {\n mapDistance[i][j] = mapDistance[j][i] = getDistance(mapCoordinate[i], mapCoordinate[j]);\n }\n }\n }", "public int getPoints()\n {\n return (10000 - this.points);\n }", "public static Tour Farthest (double distancematrix [][], List<Point> pointList) {\n Tour tour = new Tour(0);\n int numbernodes;\n numbernodes = pointList.size();\n int visited[] = new int[numbernodes];\n int randomNum = ThreadLocalRandom.current().nextInt(1, numbernodes);\n int pointNumber = pointList.get(randomNum - 1).getPointNumber();\n double max;\n int chosenPoint = 0;\n int pos = -1;\n\n\n if (pointList.size() == 1){\n tour.addPoint(pointList.get(0));\n } else {\n visited[pointNumber - 1] = 1;\n tour.addPoint(pointList.get(randomNum - 1));\n while (tour.getSize() != numbernodes) {\n int point = 1;\n int insertPoint = 1;\n max =0;\n for (int i = 0; i < numbernodes; i++) {\n double minimum = Double.MAX_VALUE;\n\n int cityIndex = pointList.get(i).getPointNumber() - 1;\n if (visited[i] == 1) {\n } else {\n double distance;\n\n for (int j = 1; j <= tour.getSize(); j++) {\n int vor = tour.getPoint((j - 1)).getPointNumber() - 1;\n distance = distancematrix[vor][cityIndex];\n if (distance < minimum) {\n minimum = distance;\n point = j;\n pos = i;\n }\n }\n if (minimum > max){\n max = minimum;\n chosenPoint = pos;\n insertPoint = point;\n }\n }\n }\n tour.insertPoint(insertPoint, pointList.get(chosenPoint));\n visited[chosenPoint] = 1;\n }\n }\n return tour;\n }", "protected long travel() {\n\n return Math.round(((1 / Factory.VERTEX_PER_METER_RATIO) / (this.speed / 3.6)) * 1000);\n }", "public float getMetric(){\n float distance = 0.0f;\n MeasurementService.DataPoint prv = center;\n\n for(MeasurementService.DataPoint d : list){\n distance += Math.sqrt(\n Math.pow(prv.getX() - d.getX(),2) +\n Math.pow(prv.getY() - d.getY(),2)\n );\n prv = d;\n }\n\n return distance;\n }", "@Override\n public int estimatedDistanceToGoal() {\n return manhattan();\n }", "int getUsedPoints();", "int getUsedPoints();", "int getUsedPoints();", "public int[] getDistances(){\n\t\treturn distances;\n\t}", "private static double nearestNeighbour(List<Point> points, Point startPoint, Point endPoint) {\n double tentative_distance; // to evaluate nearest neighbour\n double cummulative_distance = 0; // cummulative distance of tour\n double dist; // temporary variable\n Point current = startPoint;\n //System.out.println(\"start at: #\" + current.getId());\n\n int indexToRemove = 0;\n int numberOfLoops = points.size() - 1;\n\n for (int i = 0; i <= numberOfLoops; i++) {\n //System.out.println(\"outerloop #\" + i);\n tentative_distance = Double.MAX_VALUE;\n // evaluate nearest neighbour\n for (int j = 0; j < points.size(); j++) {\n dist = getDistance(points.get(j), current);\n if (dist < tentative_distance) {\n tentative_distance = dist;\n indexToRemove = j;\n }\n }\n //System.out.println(\"next point: #\" + points.get(indexToRemove).getId());\n cummulative_distance += getDistance(points.get(indexToRemove), current);\n current = points.remove(indexToRemove);\n }\n // add distance to endpoint\n cummulative_distance += getDistance(current, endPoint);\n return cummulative_distance;\n }", "@Test\n public void testMesurerDistanceCoordonnees() {\n System.out.println(\"MesurerDistanceCoordonnees\");\n double lat1 = 0.0;\n double lon1 = 0.0;\n double lat2 = 0.0;\n double lon2 = 0.0;\n double expResult = 0.0;\n double result = Utils.MesurerDistanceCoordonnees(lat1, lon1, lat2, lon2);\n assertEquals(expResult, result, 0.0);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "@Override\r\n\tpublic final void calculateSpawnAmount() {\r\n\t\tthis.spawnsRequired = 0;\r\n\t\tfor (final Genome genome : this.members) {\r\n\t\t\tthis.spawnsRequired += genome.getAmountToSpawn();\r\n\t\t}\r\n\r\n\t}", "public void ajaTesti() {\n \n long summa1 = 0;\n long summa2 = 0;\n int laskuri1=0; //test\n int laskuri2=0;\n \n Taytto tulosN = null;\n TayttoDP tulosDP = null;\n \n //rotatoidaan testien suoritusjärjestystä kerran\n int rot = 2;\n for (int i=0;i<rot;i++) {\n //random järjestys\n //Tavara[] ar = shuffleTavarat();\n\n Tavara[] ar = this.tavarat;\n Taytto tayttoN = new Taytto(ar, sakki);\n TayttoDP tayttoDP = new TayttoDP(ar, sakki);\n\n long aikaAlussa = 0;\n long aikaLopussa = 0;\n long aika = 0;\n\n int sisatoisto=this.toistokoe;\n //rotatoidaan testien ajojärjestys\n long sum1=0; \n long sum2=0; \n\n //ignoorataan 10 ensimmäistä tuloksista, lisätään siksi 10 ylimääräistä toistokierrosta\n for (int j=0;j<sisatoisto;j++) {\n\n if (i%2==0) {\n laskuri1++;\n\n // Mittaus naivi-algoritmi\n aikaAlussa = System.nanoTime();\n tayttoN.etsiMaksimiArvoJaJono(); \n aikaLopussa = System.nanoTime(); \n\n aika=aikaLopussa-aikaAlussa;\n //ignoorataan 10 ensimmäistä tuloksista\n if(j>=0) sum1+=aika;\n\n // Mittaus DP -algoritmi\n aikaAlussa = System.nanoTime();\n tayttoDP.etsiMaksimiArvoJaJono(); \n aikaLopussa = System.nanoTime(); \n\n aika=aikaLopussa-aikaAlussa;\n if(j>=0) sum2+=aika;\n }\n else {\n laskuri2++; //test\n\n // Mittaus DP -algoritmi\n aikaAlussa = System.nanoTime();\n tayttoDP.etsiMaksimiArvoJaJono(); \n aikaLopussa = System.nanoTime(); \n\n aika=aikaLopussa-aikaAlussa;\n if(j>=0) sum2+=aika;\n \n // Mittaus naivi-algoritmi\n aikaAlussa = System.nanoTime();\n tayttoN.etsiMaksimiArvoJaJono(); \n aikaLopussa = System.nanoTime(); \n\n aika=aikaLopussa-aikaAlussa;\n if (j>=0) sum1+=aika;\n }\n\n //Tarkistus, että tulos sama kummallakin algoritmilla\n if (tayttoN.annaMaxArvo()!=tayttoDP.annaMaxArvo()) {\n System.out.println(\"Taytto1: Arvo: \" + tayttoN.annaMaxArvo() + \" , jono :\" + tayttoN.annaMaxJono());\n System.out.println(\"Taytto2: Arvo: \" + tayttoDP.annaMaxArvo() + \" , jono :\" + tayttoDP.annaMaxJono()); \n break;\n }\n \n \n }\n summa1+=sum1/(sisatoisto);\n summa2+=sum2/(sisatoisto);\n \n tulosN=tayttoN;\n tulosDP=tayttoDP;\n \n }\n// System.out.println(laskuri1);\n// System.out.println(laskuri2);\n\n \n long keskiarvo1 = summa1/rot;\n long keskiarvo2 = summa2/rot;\n\n String[] kootN = tulosN.annaMaxJono().split(\" \");\n int kokoN = 0;\n for (int i = 0; i < kootN.length; i++) {\n try {\n kokoN += this.tavarat[Integer.parseInt(kootN[i])-1].annaKoko();\n } catch (NumberFormatException nfe) {};\n } \n \n String[] kootDP = tulosDP.annaMaxJono().split(\" \");\n int kokoDP = 0;\n for (int i = 0; i < kootDP.length; i++) {\n try {\n kokoDP += this.tavarat[Integer.parseInt(kootDP[i])-1].annaKoko();\n } catch (NumberFormatException nfe) {};\n } \n\n System.out.println(this.nimi);\n System.out.println(\"Tavarat: \" + annaTavaroidenKokoJaArvo());\n System.out.println(\"Sakki \" + this.sakki.annaKoko() + \", lkm \" + this.koko + \", toistot \" + toistokoe);\n System.out.println(\"Keskiarvo (ms) Naiivi: \" + keskiarvo1/1000 + \", DP: \" + keskiarvo2/1000);\n System.out.println(\"Tulos Naiivi: maksimiarvo: \" + tulosN.annaMaxArvo() + \" koko: \" + kokoN + \" maksimiarvon toteuttavien travaroiden järjestysnumerot: \"); \n System.out.println(tulosN.annaMaxJono());\n System.out.println(\"Tulos DP: maksimiarvo: \" + tulosDP.annaMaxArvo() + \" koko: \" + kokoDP + \" maksimiarvon toteuttavien travaroiden järjestysnumerot: \");\n System.out.println(tulosDP.annaMaxJono());\n \n }", "private void computeDistances() {\n for (int i = 0; i < groundTruthInstant.size(); ++i)\n for (int j = 0; j < estimatedInstant.size(); ++j) {\n float currentDist = groundTruthInstant.get(i).getDistanceTo(estimatedInstant.get(j).getPos());\n if (currentDist < distToClosestEstimate[i][0]) {\n distToClosestEstimate[i][0] = currentDist;\n distToClosestEstimate[i][1] = j;\n }\n }\n }", "private double[][] makeMSTDouble(GaneshaLakeId[] gla, GaneshaLakeDist[] gla1, GaneshaGaneshaDist[] gla2, int noofganesha, int nooflakes, Ganesha[] ganesha, Lake[] lake, PrintWriter pw) {\n double[][] resultPlot = new double[noofganesha+nooflakes+1][5];\n int re = 1;\n \n boolean visited[] = new boolean[noofganesha];\n \n// int lid = 1;\n// \n// int minvaldist=Integer.MAX_VALUE;\n// int misvalganeshaat = -1;\n// for(int i=0;i<noofganesha;i++){\n//// pw.println(gla[i].lakeId +\"--\"+ lid );\n// if(gla[i].lakeId == lid && minvaldist>gla1[lid*noofganesha+i].distance){\n// minvaldist = gla1[lid*noofganesha+i].distance;\n// misvalganeshaat = i;\n// }\n// }\n \n// for(int lid =0;lid<nooflakes;lid++){\n// int countCO1Lake = countClusterOfOneLake(gla,lid);\n// for(int i=0;i<noofganesha;i++){\n// at = 'k';\n// mintill = Integer.MAX_VALUE;\n// minisat = 0;\n// int start = lid*noofganesha;\n// for(int j=start;j<start+noofganesha;j++){\n// if(mintill > gla1[j].distance && !visited[gla[j].ganesha] && gla[gla[j].ganesha].lakeId == lid){\n// minisat=lid;\n// mintill=gla1[j].distance;\n// at='k';\n// minis=j;\n// }\n// }\n// }\n\n for(int i=0;i<nooflakes;i++)\n {\n \n int minvaldist=Integer.MAX_VALUE;\n int misvalganeshaat = -1;\n int noofginclust = 0;\n for(int ij=0;ij<noofganesha;ij++){\n// pw.println(gla[i].lakeId +\"--\"+ lid );\n if(gla[ij].lakeId == i && minvaldist>gla1[i*noofganesha+ij].distance){\n minvaldist = gla1[i*noofganesha+ij].distance;\n misvalganeshaat = ij;\n noofginclust++;\n }\n }\n newClass nc[]=new newClass[noofganesha+1];\n int p=0;\n nc[0]=new newClass();\n nc[0].isLake=true;\n nc[0].lakeId=i;\n Ganesha g[]=new Ganesha[noofganesha];\n int k1=0;\n for(int j=0;j<noofganesha;j++)\n {\n if(gla[j].lakeId == i)\n {\n g[k1]=new Ganesha();\n g[k1].ganeshaId=j;\n \n// pw.println(j+\" j+++\");\n k1++;\n \n }\n }\n pw.println(k1+\" k1+++\");\n for(int k=0;k<k1;k++)\n {\n int min=Integer.MAX_VALUE;\n int minIs=0;\n// pw.println(gla2.length);\n for(int l=0;l<gla2.length;l++)\n {\n if( g[k]!=null && gla2[l].ganesha1==g[k].ganeshaId && gla[gla2[l].ganesha2].lakeId == i)\n {\n// pw.println( gla[g[k].ganeshaId].lakeId+\" lakeid\");\n if(min>gla2[l].distance && visited[gla2[l].ganesha2]==false && gla2[l].distance !=0)\n {\n// pw.println(gla2[l].ganesha2+\"--\"+i);\n minIs=l;\n min=gla2[l].distance;\n visited[gla2[l].ganesha2]=true;\n }\n }\n }\n newClass nc1=new newClass();\n nc1.lakeId=i;\n nc1.ganeshaId=gla2[minIs].ganesha2;\n nc1.src=g[k].ganeshaId;\n nc1.isLake=false;\n p++;\n nc[p]=nc1;\n }\n if(misvalganeshaat != -1){\n resultPlot[re][0] = lake[i].lan;\n resultPlot[re][1] = lake[i].lng;\n resultPlot[re][2] = ganesha[misvalganeshaat].lan;\n resultPlot[re][3] = ganesha[misvalganeshaat].lng;\n \n resultPlot[re][4] = lake[i].lakeId;\n re++;\n pw.println(\"Lake: \"+i+\" (lan, log): (\"+lake[i].lan+\", \"+lake[i].lng+\" to ganesha: \"+misvalganeshaat+\" (lan, log): (\"+ganesha[misvalganeshaat].lan+\", \"+ganesha[misvalganeshaat].lng+\")\");\n for(int k=1;k<p;k++)\n {\n \n resultPlot[re][0] = ganesha[nc[k].src].lan;\n resultPlot[re][1] = ganesha[nc[k].src].lng;\n resultPlot[re][2] = ganesha[nc[k].ganeshaId].lan;\n resultPlot[re][3] = ganesha[nc[k].ganeshaId].lng;\n //change 1\n resultPlot[re][4] = lake[i].lakeId;\n re++;\n // pw.println(\"ganesha\\t\"+nc[k].ganeshaId+\"\\t from\\t ganesha: \"+nc[k].src);\n pw.println(\"ganesha: \"+nc[k].src+\"(lan, lng): (\"+ganesha[nc[k].src].lan+\", \"+ganesha[nc[k].src].lng+\") to ganesha: \"+nc[k].ganeshaId+\"(lan, lng): (\"+ganesha[nc[k].ganeshaId].lan+\", \"+ganesha[nc[k].ganeshaId].lng+\")\");\n }\n }\n else{\n \n resultPlot[re][0] = lake[i].lan;\n resultPlot[re][1] = lake[i].lng;\n resultPlot[re][2] = lake[i].lan;\n resultPlot[re][3] = lake[i].lng;\n resultPlot[re][4] = lake[i].lakeId;\n re++;\n pw.println(\"Lake \"+i+\" (lan, log): (\"+lake[i].lan+\", \"+lake[i].lng+\") is Too Far.\");\n }\n pw.println();\n }\n resultPlot[0][0] = re;\n \n// for(int j=0;j<noofganesha;j++){\n// int k1 = j*noofganesha;\n// for(int k=j*noofganesha;k<(j+1)*noofganesha;k++){\n// if((mintill>gla2[k].distance)&& !visited[j] && gla[j].lakeId==lid){\n// minisat = j;\n// mintill = gla2[j].distance;\n// minis = k1-j;\n// at = 'g';\n// }\n// }\n// }\n// for(int i=0;i<noofganesha;i++){\n// int j = i;\n// pw.println(gla[i].lakeId+\" - \"+lid);\n// if(gla[i].lakeId == lid)\n// while(j<gla2.length){\n// pw.println(mintill+\" - \"+gla2[j].distance+\" - \"+visited[gla2[j].ganesha1]+\" + \"+gla[gla2[j].ganesha1].lakeId);\n// if((mintill>gla2[j].distance)&& gla2[j].distance != 0 &&\n// visited[gla2[j].ganesha1] && lid==gla[gla2[j].ganesha1].lakeId && lid==gla[gla2[j].ganesha2].lakeId){\n// minisat = gla2[j].ganesha2;;\n// mintill = gla2[j].distance;\n// minis = gla2[j].ganesha1;\n// at = 'g';\n// }\n// j = j + noofganesha;\n// }\n// pw.println(\"+\"+minis);\n// visited[minis]=true;\n// pw.println(minisat +\"-\"+at+\"\\t---------------->\"+minis);\n// \n// }\n// pw.println(\"#\");\n// \n return resultPlot;\n }", "public abstract double distance(AbstractPoisson o2);", "public void generateNeighborhood(TSPSolution s){\r\n\t\tint [] rounte = new int[problem.city_num+1];\r\n\t\tfor(int i=0;i<problem.city_num;i++) rounte[i] = s.route[i];\r\n\t\trounte[problem.city_num] = rounte[0];\r\n\t\tint [] pos = new int[problem.city_num];\r\n\t\tproblem.calculatePosition(rounte, pos);\r\n\t\tint pos1 = 0;\r\n\t\tint pos2 = 0;\r\n\t\tfor(int k=0;k<problem.city_num;k++){\r\n\t\t\tint i = k;\r\n\t\t\tpos1 = i;\r\n\t\t\tint curIndex = rounte[i];\r\n\t\t\tint nextIndex = rounte[i+1];\r\n\t\t\tArrayList<Integer> candidate = problem.candidateList.get(curIndex);\r\n\t\t\tIterator<Integer> iter = candidate.iterator();\r\n\t\t\twhile(iter.hasNext()){\r\n\t\t\t\tint next = iter.next();\r\n\t\t\t\tpos2 = pos[next];\r\n\t\t\t\tint curIndex1 = rounte[pos2];\r\n\t\t\t\tint nextIndex1 = rounte[pos2+1];\r\n\t\t\t\tif(curIndex == nextIndex1) continue;\r\n\t\t\t\tif(curIndex == curIndex1) continue;\r\n\t\t\t\tif(nextIndex == nextIndex1) continue;\r\n\t\t\t\tif(curIndex1 == nextIndex) continue;\r\n\t\t\t\tint betterTimes = 0;\r\n\t\t\t\tTSPSolution solution = new TSPSolution(problem.city_num, problem.obj_num, -1);\r\n\t\t\t\tfor(int j=0;j<problem.obj_num;j++){\r\n\t\t\t\t\tint gain = problem.disMatrix[j*problem.city_num*problem.city_num+curIndex*problem.city_num+curIndex1] +\r\n\t\t\t\t\t\t\tproblem.disMatrix[j*problem.city_num*problem.city_num+nextIndex*problem.city_num+nextIndex1] - \r\n\t\t\t\t\t\t\t(problem.disMatrix[j*problem.city_num*problem.city_num+curIndex*problem.city_num+nextIndex]+\r\n\t\t\t\t\t\t\tproblem.disMatrix[j*problem.city_num*problem.city_num+curIndex1*problem.city_num+nextIndex1]);\r\n\t\t\t\t\tif(gain<0) betterTimes++;\r\n\t\t\t\t\tsolution.object_val[j] = s.object_val[j] + gain;\r\n\t\t\t\t}\r\n\t\t\t\tif(betterTimes==0) continue;\r\n\t\t\t\tsolution.route = s.route.clone();\r\n\r\n\t\t\t\tif(problem.kdSet.add(solution)){\r\n\t\t\t\t\tproblem.converse(pos1, pos2, solution.route, 0);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public float getDistance();", "double distance() {\r\n\t double dist_total = 0;\r\n\t for (int i = 0; i < index.length - 1; i++) {\r\n\t dist_total += city(i).distance(city(i + 1));\r\n\t }\r\n\t \r\n\t return dist_total;\r\n\t}", "public void zeichnen_kavalier() {\n /**\n * Abrufen der Koordinaten aus den einzelnen\n * Point Objekten des Objekts Tetraeder.\n */\n double[] A = t1.getTetraeder()[0].getPoint();\n double[] B = t1.getTetraeder()[1].getPoint();\n double[] C = t1.getTetraeder()[2].getPoint();\n double[] D = t1.getTetraeder()[3].getPoint();\n\n /**\n * Aufrufen der Methode sortieren\n */\n double[][] sP = cls_berechnen.sortieren(A, B, C, D);\n\n A = sP[0];\n B = sP[1];\n C = sP[2];\n D = sP[3];\n\n /**Wenn alle z Koordinaten gleich sind, ist es kein Tetraeder. */\n if (A[2] == D[2] || (A[2]==B[2] && C[2]==D[2])) {\n System.out.println(\"kein Tetraeder\");\n return;\n }\n\n /** Transformiert x,y,z Koordinaten zu x,y Koordinaten */\n double ax, ay, bx, by, cx, cy, dx, dy;\n ax = (A[0] + (A[2] / 2));\n ay = (A[1] + (A[2] / 2));\n bx = (B[0] + (B[2] / 2));\n by = (B[1] + (B[2] / 2));\n cx = (C[0] + (C[2] / 2));\n cy = (C[1] + (C[2] / 2));\n dx = (D[0] + (D[2] / 2));\n dy = (D[1] + (D[2] / 2));\n\n tetraederzeichnen(ax, ay, bx, by, cx, cy, dx, dy);\n }", "public double computeDistance(Object o){\n \n if (o!=null && o.getClass()==this.getClass()){\n NDimensionalPoint newPoint = (NDimensionalPoint) o;\n if (newPoint.values.size()==values.size()){\n double dist = 0.0;\n for (int i=0;i<values.size();i++){\n dist+=Math.pow(newPoint.getValues().get(i) -values.get(i),2);\n }\n return Math.sqrt(dist);\n }else\n {\n return MAX_DIST;\n }\n }else{\n return MAX_DIST;\n }\n }", "public int GetNPoints();", "int updateCount(double dist);", "public static Tour Cheapest (double distancematrix [][], List<Point> pointList) {\n Tour tour = new Tour(0);\n\n if (pointList.size() == 1){\n tour.addPoint(pointList.get(0));\n } else {\n\n int numbernodes;\n numbernodes = pointList.size();\n int visited[] = new int[numbernodes];\n int randomNum = ThreadLocalRandom.current().nextInt(1, numbernodes);\n int pointNumber = pointList.get(randomNum - 1).getPointNumber();;\n\n visited[pointNumber - 1] = 1;\n tour.addPoint(pointList.get(randomNum - 1));\n\n for (int i = 0; i < numbernodes; i++) {\n int cityIndex = pointList.get(i).getPointNumber() - 1;\n int pos = -1;\n if (visited[i] == 1) {\n } else {\n double distance;\n double minimum = Double.MAX_VALUE;\n int insertPoint = 0;\n for (int j = 1; j <= tour.getSize(); j++) {\n int vor = tour.getPoint((j - 1) % tour.getSize()).getPointNumber() - 1;\n int nach = tour.getPoint((j) % tour.getSize()).getPointNumber() - 1;\n distance = distancematrix[vor][cityIndex] + distancematrix[cityIndex][nach];\n if (distance < minimum) {\n minimum = distance;\n insertPoint = j % tour.getSize();\n pos = i;\n }\n }\n tour.insertPoint(insertPoint, pointList.get(i));\n visited[pos] = 1;\n }\n }\n }\n return tour;\n }", "public void sumaPuntos() {\r\n int rojo = 0;\r\n int azul = 0;\r\n for (int i = 1; i < 10; i++) {\r\n\r\n if (tablero[1][i].getTipo().equals(\"Rojo\")) {\r\n rojo += tablero[1][i].getValor();\r\n }\r\n\r\n if (tablero[8][i].getTipo().equals(\"Azul\")) {\r\n azul += tablero[8][i].getValor();\r\n }\r\n\r\n }\r\n if (rojo > azul) {\r\n this.setResultado(\"Rojo\");\r\n this.agregarVictoria(jugadorRojo);\r\n }\r\n if (azul > rojo) {\r\n this.setResultado(\"Azul\");\r\n this.agregarVictoria(jugadorAzul);\r\n }\r\n \r\n this.setReplay(true);\r\n }", "public int getTotDistance(){\r\n\t \treturn this.totDistance;\r\n\t }", "public static void main(String[] args) {\n \t \t Scanner sc=new Scanner(System.in);\n \t \t int n=sc.nextInt();\n \t \t int[] petrol=new int[n];int[] dist=new int[n];\n \t \t for(int i=0;i<n;i++)petrol[i]=sc.nextInt();\n \t \t for(int i=0;i<n;i++)dist[i]=sc.nextInt();\n \t \t System.out.println(mustangTour(petrol,dist));\n \t }", "private int obliczDowoz() {\n int x=this.klient.getX();\n int y=this.klient.getY();\n double odl=Math.sqrt((Math.pow((x-189),2))+(Math.pow((y-189),2)));\n int kilometry=(int)(odl*0.5); //50 gr za kilometr\n return kilometry;\n }", "private static void ajouterRoutes(List<Point> points) {\n long time = System.currentTimeMillis();\n Set<Point> ensPoints = new HashSet<>(points);\n for(Point p : points) {\n p.ajouterRoutes(ensPoints);\n // Supposons que l'on essaye d'ajouter plusieurs fois les memes destinations ...\n p.ajouterRoutes(ensPoints);\n p.ajouterRoutes(ensPoints);\n }\n long deltaTime = System.currentTimeMillis() - time;\n System.out.println(\"Les routes sont ajoutées en \"+deltaTime+\" ms\");\n }", "@Override\n\tpublic double mangeLegumes() {\n\t\treturn quantiteLegumes*this.getPoids();\n\t}", "public void iterate() {\n\n\t\tArrayList<int[]> pts = new ArrayList<int[]>();\n\t\tfor (int i = 0; i < POINTS_PER_ITER; i++) {\n\t\t\tint x = Window.mathRandom.nextInt(width);\n\t\t\tint y = Window.mathRandom.nextInt(width);\n\t\t\tpts.add(new int[] { x, y });\n\t\t}\n\n\t\tint[] bestPoint = new int[] {};\n\t\tdouble maxDist = 0;\n\t\tfor (int[] point : pts) {\n\t\t\tdouble dist = getDistFromOthers(point);\n\t\t\tif (dist > maxDist) {\n\t\t\t\tmaxDist = dist;\n\t\t\t\tbestPoint = point;\n\t\t\t}\n\t\t}\n\t\tif (check(bestPoint)) {\n\t\t\tpoints.add(bestPoint);\n\t\t} else {\n\t\t\tremainingPoints += 1;\n\t\t}\n\t}", "private void obtenerGastosDiariosMes() {\n\t\t// Obtenemos las fechas actuales inicial y final\n\t\tCalendar calendar = Calendar.getInstance();\n calendar.setTime(new Date());\n int diaFinalMes = calendar.getActualMaximum(Calendar.DAY_OF_MONTH);\n\n\t\tList<Movimiento> movimientos = this.movimientoService.obtenerMovimientosFechaUsuario(idUsuario, LocalDate.of(LocalDate.now().getYear(),LocalDate.now().getMonthValue(),1),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLocalDate.of(LocalDate.now().getYear(),LocalDate.now().getMonthValue(), diaFinalMes));\n\t\tList<Double> listaGastos = new ArrayList<Double>();\n\t\tList<String> listaFechas = new ArrayList<String>();\n\t\t\n\t\tDate fechaUtilizadaActual = null;\n\t\tdouble gastoDiario = 0;\n\t\t\n\t\tfor (Iterator iterator = movimientos.iterator(); iterator.hasNext();) {\n\t\t\tMovimiento movimiento = (Movimiento) iterator.next();\n\t\t\tif(fechaUtilizadaActual == null) { //Comprobamos si se acaba de entrar en el bucle para inicializar la fecha del movimiento\n\t\t\t\tfechaUtilizadaActual = movimiento.getFecha();\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// Si hemos cambiado de fecha del movimiento se procede a guardar los datos recogidos\n\t\t\tif(!fechaUtilizadaActual.equals(movimiento.getFecha())) {\n\t\t\t\tlistaGastos.add(gastoDiario);\n\t\t\t\tlistaFechas.add(fechaUtilizadaActual.getDate()+\"/\"+Utils.getMonthForInt(fechaUtilizadaActual.getMonth()).substring(0, 3));\n\t\t\t\tgastoDiario = 0; // Reiniciamos el contador del gasto\n\t\t\t\tfechaUtilizadaActual = movimiento.getFecha(); // Almacenemos la fecha del nuevo gasto\n\t\t\t}\n\t\t\t\n\t\t\t// Si el movimiento que se ha realizado es un gasto lo sumamos al contador de gasto\n\t\t\tif(movimiento.getTipo().equals(TipoMovimiento.GASTO)) {\n\t\t\t\tgastoDiario += movimiento.getCantidad();\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t// Comprobamos si es el ultimo item del iterador y almacenamos sus datos\n\t\t\tif(!iterator.hasNext()) {\n\t\t\t\tlistaGastos.add(gastoDiario);\n\t\t\t\tlistaFechas.add(fechaUtilizadaActual.getDate()+\"/\"+Utils.getMonthForInt(fechaUtilizadaActual.getMonth()).substring(0, 3));\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tthis.listadoGastosDiariosDiagrama = new Double[listaGastos.size()];\n\t\tthis.listadoGastosDiariosDiagrama = listaGastos.toArray(this.listadoGastosDiariosDiagrama);\n\t\tthis.fechasDiagrama = new String[listaFechas.size()];\n\t\tthis.fechasDiagrama = listaFechas.toArray(this.fechasDiagrama);\n\t\t\n\t}", "public double distancia(Ponto p){\n double dx = Math.pow((p.x - this.x), 2);\n double dy = Math.pow((p.y - this.y), 2);\n return Math.sqrt((dx+dy));\n }", "public static void main(String[] args) {\n City city = new City(60, 200);\n\n City city2 = new City(180, 200);\n\n City city3 = new City(80, 180);\n City city4 = new City(140, 180);\n\n City city5 = new City(20, 160);\n\n City city6 = new City(100, 160);\n\n City city7 = new City(200, 160);\n\n City city8 = new City(140, 140);\n\n City city9 = new City(40, 120);\n\n City city10 = new City(100, 120);\n\n City city11 = new City(180, 100);\n\n City city12 = new City(60, 80);\n\n City city13 = new City(120, 80);\n City city14 = new City(180, 60);\n City city15 = new City(20, 40);\n\n City city16 = new City(100, 40);\n\n City city17 = new City(200, 40);\n City city18 = new City(20, 20);\n\n City city19 = new City(60, 20);\n City city20 = new City(160, 20);\n List<City> list=new ArrayList<City>();\n list.add(city);list.add(city2);\n list.add(city3);\n list.add(city4);\n list.add(city5);\n list.add(city6);\n list.add(city7);\n list.add(city8);\n list.add(city9);\n list.add(city10);\n list.add(city11);\n list.add(city12);\n list.add(city13);\n list.add(city14);\n list.add(city15);\n list.add(city16);\n list.add(city17);\n list.add(city18);\n list.add(city19);\n list.add(city20);\n\n // Initialize population\n Population pop = new Population(100, true,list);\n System.out.println(\"Initial distance: \" + pop.getBestTour().getDistance());\n\n // Evolve population for 100 generations\n pop = Ga.evolvePopulation(pop);\n for (int i = 0; i < 500; i++) {\n pop = Ga.evolvePopulation(pop);\n System.out.println(\"第\"+i+\"代\"+pop.getBestTour().getDistance());\n }\n\n // Print final results\n System.out.println(\"Finished\");\n System.out.println(\"Final distance: \" + pop.getBestTour().getDistance());\n System.out.println(\"Solution:\");\n System.out.println(pop.getBestTour());\n }", "public Approx(int numPoints) {\n numNodes = numPoints;\n\n // Initialize bestDist.\n bestDist = Integer.MAX_VALUE;\n\n // Initialize bestTour and currTour.\n bestTour = new ArrayList<>();\n currTour = new ArrayList<>();\n\n // Calculate distance matrix.\n matrix = FileIo.calDistMat(FileIo.getType(), FileIo.getPoints(), numPoints, \"Approx\");\n }", "@Override\n\t\t\t\tpublic List<KinderGarten> chercherParZone(Double longi, Double lat,Double rayon) {\n\t\t\t\t\tList<KinderGarten> list = new ArrayList<>();\n\t\t\t\t\tList<KinderGarten> list2 =(List<KinderGarten>) kindergartenRepo.findAll();\n\t\t\t\t\tfor(int i=0;i<list2.size();i++)\n\t\t\t\t\t\t\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(calculDis(longi,lat,list2.get(i).getLongi(),list2.get(i).getLatitude()));\n\t\t\t\t\t\tif(calculDis(longi,lat,list2.get(i).getLongi(),list2.get(i).getLatitude()) <= rayon)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlist.add(list2.get(i));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t// long/lat/r\n\t\t\t\t\t//coord bd Ariana long:10.182733 lat: 36.900635 // long:10.804493 lat2 :36.460875\n\t\t\t\t\t\n\t\t\t\t\t//test 1 Ariana 10.1852049/36.8989212/1 \n\t\t\t\t\t\n\t\t\t\t\t//test 2 A GHANA 10.181863/36.806459/1 // long2:10.182039 lat2: 36.806021 \n\t\t\t\t\t//\n\t\t\t\t\treturn list;\n\t\t\t\t}", "public int distTo(Site s) {\n\t\treturn distTo[s.getX()][s.getY()];\n\t}", "private static void nbRoutesPremierPoint(List<Point> points) {\n if(points == null || points.isEmpty()) {\n System.out.println(\"Aucun point dans l'ensemble des points ...\");\n return;\n }\n Iterator<Point> iter = points.iterator();\n Point p1 = iter.next();\n System.out.println(\"Il y a \"+p1.getNbRoutes()+\" routes qui partent du point p1\");\n }", "Execution getFarthestDistance();" ]
[ "0.64764315", "0.6202107", "0.5982875", "0.5962642", "0.59379345", "0.5909574", "0.59079564", "0.5906635", "0.58929926", "0.58635724", "0.58282524", "0.5791848", "0.57838285", "0.5762473", "0.5737058", "0.5703453", "0.56958383", "0.5659932", "0.565797", "0.5649974", "0.5640998", "0.561828", "0.55777854", "0.556282", "0.5541008", "0.5540163", "0.5533136", "0.5529993", "0.5517506", "0.55168045", "0.55004835", "0.5485437", "0.547471", "0.54672426", "0.5455792", "0.5449349", "0.5424294", "0.54175407", "0.5414142", "0.54081374", "0.5405295", "0.539613", "0.5393774", "0.53871536", "0.53843385", "0.5382614", "0.5357851", "0.5349119", "0.5346716", "0.5341098", "0.53343946", "0.5323977", "0.53077084", "0.5307538", "0.53037184", "0.52981156", "0.529254", "0.5282496", "0.52797097", "0.52636135", "0.52555305", "0.5247948", "0.5247279", "0.52348214", "0.52344555", "0.5212069", "0.5209792", "0.5209792", "0.5209792", "0.5207034", "0.5205765", "0.5191753", "0.51845616", "0.51803946", "0.51789385", "0.51781976", "0.5174536", "0.51690376", "0.51665676", "0.515829", "0.51576036", "0.5153303", "0.514914", "0.51413894", "0.513703", "0.5136352", "0.51110655", "0.5108334", "0.5102098", "0.509966", "0.5094382", "0.5093876", "0.50923157", "0.50871885", "0.5079411", "0.50767255", "0.50765485", "0.5073388", "0.5071838", "0.5071176" ]
0.8064112
0
Calcul la distance d'une tournee qui passe par tous les points de la liste Au prealable la liste est melangee aleatoirement
private static double calculDistanceTourneeAlea(List<Point> points, Random rand) { double distance = 0; Collections.shuffle(points, rand); Point courant = points.get(0); Point suivant; for(int i=1; i<points.size(); i++) { suivant = points.get(i); distance += courant.getDistance(suivant); courant = suivant; } suivant = points.get(0); distance += courant.getDistance(suivant); return distance; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void calculDistanceTournees(List<Point> points, int nbTournees) {\n long time = System.currentTimeMillis();\n double distance = 0;\n Random rand = new Random(0);\n for(int i=0; i<nbTournees; i++) {\n distance += calculDistanceTourneeAlea(points, rand);\n }\n long deltaTime = System.currentTimeMillis() - time;\n System.out.println(\"Calcul de la moyenne des distances pour \"+nbTournees+ \" tournees\");\n System.out.println(\"La moyenne vaut : \"+distance/nbTournees);\n System.out.println(\"La moyenne est calculee en \"+deltaTime+\" ms\");\n }", "private int calcDistance()\n\t{\n\t\tint distance = 0;\n\n\t\t// Generate a sum of all of the difference in locations of each list element\n\t\tfor(int i = 0; i < listSize; i++) \n\t\t{\n\t\t\tdistance += Math.abs(indexOf(unsortedList, sortedList[i]) - i);\n\t\t}\n\n\t\treturn distance;\n\t}", "public double getDistance(ArrayList<Integer> e, ArrayList<Integer> f) {\n double distance =0;\n if(e.size()>2 || f.size()>2){\n \n ArrayList<Double> aux = new ArrayList<>();\n aux.add (Math.sqrt(Math.pow(e.get(0) - f.get(0), 2) + Math.pow(e.get(1) - f.get(1), 2)));\n aux.add(Math.sqrt(Math.pow(e.get(0) - f.get(2), 2) + Math.pow(e.get(1) - f.get(3), 2)));\n aux.add(Math.sqrt(Math.pow(e.get(0) - f.get(4), 2) + Math.pow(e.get(1) - f.get(5), 2)));\n aux.add(Math.sqrt(Math.pow(e.get(0) - f.get(6), 2) + Math.pow(e.get(1) - f.get(7), 2)));\n Collections.sort(aux);\n distance = aux.get(0);\n \n }\n else{\n\n distance = Math.sqrt(Math.pow(e.get(0) - f.get(0), 2) + Math.pow(e.get(1) - f.get(1), 2));\n //distancia entre dois pontos\n }\n return distance;\n\n }", "private void getDistance() {\n\n float dist = 0;\n Location location = \n locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);\n while (location==null) { //If we don't know where we are right now\n Toast.makeText(this, \"No last known location. Aborting...\", \n Toast.LENGTH_LONG).show();\n location = \n locationManager.getLastKnownLocation(LocationManager.GPS_PROVIDER);\n }\n\n createPositions();\n\n dist = location.distanceTo(mPositions.get(0).toLocation());\n distanceList.add(dist);\n\n dist = mPositions.get(0).toLocation().distanceTo(mPositions.get(1).toLocation());\n distanceList.add(dist);\n dist = mPositions.get(1).toLocation().distanceTo(mPositions.get(2).toLocation());\n distanceList.add(dist);\n dist = mPositions.get(2).toLocation().distanceTo(mPositions.get(3).toLocation());\n distanceList.add(dist);\n dist = mPositions.get(3).toLocation().distanceTo(mPositions.get(4).toLocation());\n distanceList.add(dist);\n \n }", "public double calcDistBetweenStops(){\n List<Location> locs = destinations.getLocationList();\r\n double totalDist = 0;\r\n for (int i = 0; i < (locs.size() - 1); i++){\r\n double distance = locs.get(i).DistanceTo(locs.get(i+1));\r\n totalDist += distance;\r\n }\r\n return totalDist;\r\n }", "public void compute() {\n\n this.jddPtsInflexion.clear();\n ILineString lsInitialee = this.geom;\n\n ILineString lsInitiale = Operateurs.resampling(lsInitialee, 1);\n ILineString lsLisse = GaussianFilter.gaussianFilter(lsInitiale, 5, 1);\n\n double sumOfDistances = 0;\n double length = 70;// 200 m max\n double sumOfAngels = 0;\n // ArrayList<Double> angels=new ArrayList<Double>();\n ArrayList<Double> differences = new ArrayList<Double>();\n\n ArrayList<Double> distances = new ArrayList<Double>();\n\n IDirectPosition p1 = lsInitiale.coord().get(0);\n IDirectPosition p2 = lsInitiale.coord().get(1);\n\n distances.add(p1.distance2D(p2));\n sumOfDistances += distances.get(distances.size() - 1);\n\n double angel = Math.atan2(p1.getY() - p2.getY(), p1.getX() - p2.getX());\n\n angel = (angel + Math.PI) * 180 / Math.PI;\n\n // angels.add(angel);\n\n for (int i = 1; i < lsInitiale.coord().size() - 1; i++) {\n\n p1 = lsInitiale.coord().get(i);\n p2 = lsInitiale.coord().get(i + 1);\n\n distances.add(p1.distance2D(p2));\n sumOfDistances += distances.get(distances.size() - 1);\n\n double newAngel = Math\n .atan2(p1.getY() - p2.getY(), p1.getX() - p2.getX());\n\n // give the value that varie from 0 to 360-epsilon\n newAngel = (newAngel + Math.PI) * 180 / Math.PI;\n\n // angels.add(newAngel);\n\n while (sumOfDistances > length && differences.size() > 0) {\n sumOfDistances -= distances.get(0);\n\n sumOfAngels -= differences.get(0);\n\n distances.remove(0);\n // System.out.println(\"olddiff=\" + differences.get(0));\n differences.remove(0);\n\n }\n\n double diff = newAngel - angel;\n\n if (diff > 180)\n diff = -360 + diff;// for the case of angel=10 and newAngel=350;\n else if (diff < -180)\n diff = 360 + diff;\n\n differences.add(diff);\n sumOfAngels += diff;\n angel = newAngel;\n // System.out.println(\"sumOfAngels=\" + sumOfAngels);\n // System.out.println(\"angel=\" + newAngel);\n // System.out.println(\"diff=\" + diff);\n\n /*\n * for(int k=0;k<angels.size();k++){ double diff2=newAngel-angels.get(k));\n * if(diff2>180)diff2=360-diff2;// for the case of angel=10 and\n * newAngel=350; else if(diff2<-180)diff2=-360-diff2;\n * if(Math.abs(newAngel->200) {\n * \n * }\n * \n * \n * }\n */\n\n if (Math.abs(sumOfAngels) > 100) {\n\n double maxOfDiff = 0;\n int indexOfMaxOfDiff = -1;\n for (int k = 0; k < differences.size(); k++) {\n if (differences.get(k) > maxOfDiff) {\n maxOfDiff = differences.get(k);\n indexOfMaxOfDiff = k;\n\n }\n\n }\n double maxDistance = -1;\n int maxDistancePointIndex = -1;\n // if(i+differences.size()-indexOfMaxOfDiff-1>=jddPtsInflexion.size())\n for (int jj = 0; jj < differences.size(); jj++) {\n // jddPtsInflexion.add(lsInitiale.coord().get(i+differences.size()-indexOfMaxOfDiff-2));\n if (i + jj - indexOfMaxOfDiff >= 0\n && i + jj - indexOfMaxOfDiff < lsInitiale.coord().size()) {\n int currIndex = i + jj - indexOfMaxOfDiff;\n double distance = lsInitiale.coord().get(currIndex).distance2D(\n lsLisse.coord().get(currIndex));\n if (distance > maxDistance) {\n maxDistance = distance;\n maxDistancePointIndex = currIndex;\n }\n\n }\n\n }\n\n if (maxDistancePointIndex >= 0)\n this.jddPtsInflexion.add(lsInitiale.coord()\n .get(maxDistancePointIndex));\n\n differences.clear();\n sumOfDistances = distances.get(distances.size() - 1);\n distances.clear();\n sumOfAngels = 0;\n i++;\n\n }\n\n }\n\n }", "private double calculeDistanceLinaire(int[] tableauDeIntRandom) {\n double resultat = 0;\n for (int i = 0; i < tableauDeIntRandom.length; i++) {\n resultat += Math.abs(tableauDeIntRandom[i] - tableauDeIntRandom[(i + 1) % tableauDeIntRandom.length]);\n }\n return resultat;\n }", "private void calculateDistances() {\n for (int point = 0; point < ntree.size(); point++) {\n calculateDistances(point);\n }\n }", "private ArrayList<Point> geraDeltas(ArrayList<Point> pontos) {\n\t\tArrayList<Point> deltas = new ArrayList<Point>();\n\t\tfor (int i = 0; i+1 < pontos.size(); i++) {\n\t\t\tPoint p = new Point((int)(pontos.get(i+1).getX() - pontos.get(i).getX()), (int) (pontos.get(i+1).getY() - pontos.get(i).getY()));\n\t\t\tdeltas.add(p);\n\t\t}\n\t\tSystem.out.println(\"Deltas derivada: \" +deltas);\n\t\treturn deltas;\n\t}", "public static double getDistance(ArrayList<City> routine){ \n double totalDistance = 0.0;\n for (int i = 0; i < routine.size() - 1; i++) {\n totalDistance += routine.get(i).distance(routine.get(i+1));\n }\n return totalDistance;\n }", "double getDistance();", "private void setDistanceValues(){\n float [] sumDistances = new float[1];\n\n distanceValue =0.0;\n\n for(int i= 0; i < trackingList.size()-1;i++){\n double startLong = trackingList.get(i).getLongtitude();\n double startLat = trackingList.get(i).getLatitude();\n double endLong = trackingList.get(i+1).getLongtitude();\n double endLat = trackingList.get(i+1).getLatitude();\n\n Location.distanceBetween(startLat,startLong,endLat,endLong,sumDistances);\n \n distanceValue += sumDistances[0];\n }\n\n }", "public static long calculateTotalDistance(ObservableArrayList<LatLng> points) {\n double result = 0;\n\n for (int i = 1; i < points.size(); i++) {\n result += distance(points.get(i), points.get(i - 1), 'K');\n }\n\n return (long) (result * 1000);\n }", "@Override\n\tpublic double getDistance(ArrayList<Point> r, ArrayList<Point> s) {\n\t\tArrayList<Point> r_clone = DistanceService.clonePointsList(r);\n\t\tArrayList<Point> s_clone = DistanceService.clonePointsList(s);\n\t\t\n\t\t// Time range (parameters - given)\n\t\tlong t1 = getTimeIni(r_clone, s_clone);\n\t\tlong tn = getTimeEnd(r_clone, s_clone);\n\n\t\treturn getDISSIM(r_clone, s_clone, t1, tn);\n\t}", "private void calcularDistanciaRecorrer(){\r\n\t\tfloat diferenciax = siguientePunto.x - posicion.x;\r\n\t\tfloat diferenciay = siguientePunto.y - posicion.y;\r\n\t\tdistanciaRecorrer = (float) Math.sqrt(diferenciax*diferenciax+diferenciay*diferenciay);\r\n\t}", "private double distanceResult(double preLng, double preLat, double nextLng, double nextLat) {\n\t\treturn Math.sqrt((preLng - nextLng) * (preLng - nextLng) + (preLat - nextLat) * (preLat - nextLat));\n\t}", "public void calcDistance() {\n if (DataManager.INSTANCE.getLocation() != null && location.getLength() == 2) {\n Log.e(\"asdf\", DataManager.INSTANCE.getLocation().getLength() + \"\");\n Log.e(\"asdf\", DataManager.INSTANCE.getLocation().getLength() + \"\");\n double dLat = Math.toRadians(location.getLatitude() - DataManager.INSTANCE.getLocation().getLatitude()); // deg2rad below\n double dLon = Math.toRadians(location.getLongitude() - DataManager.INSTANCE.getLocation().getLongitude());\n double a =\n Math.sin(dLat / 2) * Math.sin(dLat / 2) +\n Math.cos(Math.toRadians(location.getLatitude()))\n * Math.cos(Math.toRadians(location.getLatitude()))\n * Math.sin(dLon / 2)\n * Math.sin(dLon / 2);\n double c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1 - a));\n double d = KM_IN_RADIUS * c; // Distance in km\n distance = (float) d;\n } else distance = null;\n }", "public float getDistance();", "double distance() {\r\n\t double dist_total = 0;\r\n\t for (int i = 0; i < index.length - 1; i++) {\r\n\t dist_total += city(i).distance(city(i + 1));\r\n\t }\r\n\t \r\n\t return dist_total;\r\n\t}", "double getDistance(Point p);", "public float getMetric(){\n float distance = 0.0f;\n MeasurementService.DataPoint prv = center;\n\n for(MeasurementService.DataPoint d : list){\n distance += Math.sqrt(\n Math.pow(prv.getX() - d.getX(),2) +\n Math.pow(prv.getY() - d.getY(),2)\n );\n prv = d;\n }\n\n return distance;\n }", "double dist(pair p1){\n\t\tdouble dx=(p1.x-centre.x);\n\t\tdouble dy=(p1.y-centre.y);\n\t\tcount++;\n\t\treturn java.lang.Math.sqrt((dx*dx)+(dy*dy));\n\t}", "double distance (double px, double py);", "public ArrayList<Pair<Landmark, Double>> locationWithDistance(Pair<Double, Double> userLocation) {\n ArrayList<Pair<Landmark, Double>> distanceList = new ArrayList<>();\n for(int i = 0; i < this.list.size(); i++){\n Landmark landmark = list.get(i);\n double latitude = landmark.getLatitude();\n double longitude = landmark.getLongitude();\n Pair<Double, Double> coordinate = new Pair<>(latitude, longitude);\n // TODO use latitude and longitude explicitly\n double dist = distanceBetween(userLocation, coordinate);\n distanceList.add(new Pair<>(this.list.get(i), dist));\n }\n for( int i = 0; i < distanceList.size()-1; i++ ){\n for( int j = i+1; j < distanceList.size(); j++ ){\n if(distanceList.get(i).second > distanceList.get(j).second){\n Collections.swap(distanceList, i, j);\n }\n }\n }\n return distanceList;\n }", "public double distance(DataInstance d1, DataInstance d2, List<Attribute> attributeList);", "private ArrayList sortTriangleListByDistance(ArrayList triangleList, E3DVector3F startPos, E3DVector3F endPos)\r\n\t{\r\n\t\tSortedMap triangleDistanceMap = new TreeMap(); //create a map of the triangles keyed off of distance\r\n\r\n\t\t//create a map keyed off of distance from avg distance of startPos + distance endPos. use the closest vertex as the distance\r\n\t\tE3DTriangle triangle = null;\r\n\t\tE3DVector3F pointToVertexVector = null;\r\n\r\n\t\tint i=0, v=0;\r\n\t\tdouble distanceStart = 0.0;\r\n\t\tdouble avg = 0.0;\r\n\t\tdouble closestDistance = -1.0;\r\n\t\tDouble key = null;\r\n\t\tfor(i=0; i<triangleList.size(); i++)\r\n\t\t{\r\n\t\t\ttriangle = (E3DTriangle)triangleList.get(i);\r\n\t\t\t\r\n\t\t\tfor(v = 0; v < 3; v++)\r\n\t\t\t{\r\n\t\t\t\tpointToVertexVector = endPos.subtract(startPos);\r\n\t//\t\t\tpointToVertexVector = triangle.getVertex()[v].subtract(startPos);\r\n\t\t\t\t//\t\t\tdistanceStart = pointToVertexVector.getLengthSquared();\r\n\t//\t\t\tpointToVertexVector = triangle.getVertex()[v].subtract(endPos);\r\n\t//\t\t\tdistanceEnd = pointToVertexVector.getLengthSquared();\r\n\t\t\r\n\t\t\t\tdistanceStart = Math.abs(pointToVertexVector.dotProduct(triangle.getVertexPos(v)));\r\n\t\t\t\tif(closestDistance < 0)\r\n\t\t\t\t\tclosestDistance = distanceStart; //(distanceStart + distanceEnd) / 2;\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tavg = distanceStart; //(distanceStart + distanceEnd) / 2;\r\n\r\n\t\t\t\t\tif(avg < closestDistance)\r\n\t\t\t\t\t\tclosestDistance = avg;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//Since there can be multiple with the same closest distance, we need a list of triangles for each distance key\r\n\t\t\tkey = new Double(closestDistance);\r\n\t\t\tif(triangleDistanceMap.containsKey(key))\r\n\t\t\t\t((ArrayList)triangleDistanceMap.get(key)).add(triangle);\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tArrayList thisDistanceTriangleList = new ArrayList();\r\n\t\t\t\tthisDistanceTriangleList.add(triangle);\r\n\t\t\t\ttriangleDistanceMap.put(key, thisDistanceTriangleList);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Create the arraylist out of this sorted map\r\n\r\n\t\tArrayList retList = new ArrayList();\r\n\t\tMap.Entry entry = null;\r\n\t\tArrayList keysList = null;\r\n\t\tIterator it = triangleDistanceMap.entrySet().iterator();\r\n\t\twhile(it.hasNext())\r\n\t\t{\r\n\t\t\tentry = (Map.Entry)it.next();\r\n\t\t\tkeysList = (ArrayList)entry.getValue();\r\n\t\t\t\r\n\t\t\tretList.addAll(keysList);\r\n\t\t}\r\n\t\treturn retList;\r\n\t}", "double getDistanceInMiles();", "private double distance() {\n\t\tdouble dist = 0;\n\t\tdist = Math.sqrt(Math.abs((xOrigin - x) * (xOrigin - x) + (yOrigin - y) * (yOrigin - y)));\n\t\treturn dist;\n\t}", "public double[] obtenerDistancias (List<NaveDTO> naveDTOS){\n logger.debug(\"MensajeService::obtenerDistancias()\");\n double[] array = new double[naveDTOS.size()];\n for (int i = 0; i<naveDTOS.size(); i++){\n array[i] = naveDTOS.get(i).getDistance();\n }\n return array;\n }", "void calculate_distance()\n {\n \t\n \tfor(int i = 0; i<V ; i++)\n \t{\n \t\tfor(int j = 0; j<E ; j++)\n \t\t{\n \t\t\trelax(edge[j].src, edge[j].destination, edge[j].weight);\n \t\t}\n \t\tsp[i] = dist[i];\n \t\tx[i] = dist[i];\n \t}\n \tSystem.out.println();\n }", "public double distance(){\n return DistanceTraveled;\n }", "private static double nearestNeighbour(List<Point> points, Point startPoint, Point endPoint) {\n double tentative_distance; // to evaluate nearest neighbour\n double cummulative_distance = 0; // cummulative distance of tour\n double dist; // temporary variable\n Point current = startPoint;\n //System.out.println(\"start at: #\" + current.getId());\n\n int indexToRemove = 0;\n int numberOfLoops = points.size() - 1;\n\n for (int i = 0; i <= numberOfLoops; i++) {\n //System.out.println(\"outerloop #\" + i);\n tentative_distance = Double.MAX_VALUE;\n // evaluate nearest neighbour\n for (int j = 0; j < points.size(); j++) {\n dist = getDistance(points.get(j), current);\n if (dist < tentative_distance) {\n tentative_distance = dist;\n indexToRemove = j;\n }\n }\n //System.out.println(\"next point: #\" + points.get(indexToRemove).getId());\n cummulative_distance += getDistance(points.get(indexToRemove), current);\n current = points.remove(indexToRemove);\n }\n // add distance to endpoint\n cummulative_distance += getDistance(current, endPoint);\n return cummulative_distance;\n }", "public double distancia(Ponto p){\n double dx = Math.pow((p.x - this.x), 2);\n double dy = Math.pow((p.y - this.y), 2);\n return Math.sqrt((dx+dy));\n }", "public int distBonus(){\n Player currentplayer = state.getCurrentPlayer();\n Maze maze = state.getMaze();\n Cell[][] tabcells = maze.getCells();\n ArrayList<GameObject> listObjectsOnCurrentCell;\n GameObject objectOnCell;\n int distTmp;\n int dist= tabcells.length+tabcells[0].length;\n for(int i=0;i<tabcells.length;i++){\n for(int j=0;j<tabcells[0].length;j++){\n listObjectsOnCurrentCell = tabcells[i][j].getGameObjects();\n for(GameObject object: listObjectsOnCurrentCell){\n if(object instanceof Bonus || object instanceof BonusWall){\n distTmp = manhattan(object,currentplayer);\n if(distTmp<dist){\n dist = distTmp;\n }\n }\n }\n }\n }\n return dist;\n }", "public Double getDistance(List<Double> target, List<Double> current) {\n int dim = target.size();\n\n // loop through coordinates to find euclidean distance\n double distance = 0;\n for (int i = 0; i < dim; i++) {\n distance += this.axisDistance(target, current, i);\n }\n\n return distance;\n }", "public static double totalDistance(ArrayList<Edge> tree) {\n double accumDistance = 0;\n \n \tfor (Edge e : tree) {\n \t\taccumDistance += e.distance();\n \t}\n \n \treturn accumDistance;\n }", "private void calculateDistances(int pDistancia,int pMetrica,int k)\n\t{\n\t\tDistance dist = null;\n\t\t\n\t\tfor (int i = 0; i < clusterList.size(); i++)\n\t\t{\n\t\t\tfor (int j = i+1; j < clusterList.size(); j++)\n\t\t\t{\n\t\t\t\tdist = new Distance(clusterList.get(i), clusterList.get(j));\n\t\t\t\tdist.calculateDistance(pDistancia, pMetrica, k);\n\t\t\t\tdistanceList.addLast(dist);\n\t\t\t}\n\t\t}\n\t\tCollections.sort(distanceList);\n\t}", "public float influence(ArrayList<String> s)\n {\n HashMap<Integer, Integer> distances = new HashMap<>();\n HashMap<String, Integer> nodeDistances = new HashMap<>();\n\n for(String node : s){\n if(!graphVertexHashMap.containsKey(node)) continue;\n //At the end nodeDistances will contain min distance from all nodes to all other nodes\n getMinDistances(node, distances, nodeDistances);\n }\n distances = new HashMap<>();\n Iterator it = nodeDistances.entrySet().iterator();\n while(it.hasNext()){\n Map.Entry entry = (Map.Entry) it.next();\n Integer distance = (Integer) entry.getValue();\n if(distances.containsKey(distance)){\n distances.put(distance, distances.get(distance)+1);\n }else{\n distances.put(distance, 1);\n }\n }\n return getTotal(distances);\n\n\n\n// float sum = 0.0f;\n// for(int i =0; i < numVertices; i++){\n// int y = gety(s, i);\n//// System.out.println(\"i is \" + i + \" and nodes at distance are \" + y);\n// sum += (1/(Math.pow(2,i)) * y);\n// }\n// return sum;\n }", "public PVector Separate(ArrayList<Animal> animals)\n {\n float desiredSeperationDistance = separationDist; \n PVector sum = new PVector();\n int count = 0;\n for (Animal other : animals)\n {\n float d = PVector.dist(pos, other.pos); \n if((d > 0) && (d < desiredSeperationDistance))\n {\n PVector diff = PVector.sub(pos, other.pos);\n diff.normalize();\n diff.div(d); // The closer the other animal is, the more we should steer away from it\n sum.add(diff);\n count++;\n }\n }\n if (count > 0)\n {\n // lav et gennemsnit af alle retningerne\n sum.div(count);\n sum.normalize();\n sum.mult(maxSpeed);\n sum.sub(velocity);\n sum.limit(maxForce); \n if(debugging)\n {\n //line(pos.x, pos.y, other.pos.x, other.pos.y);\n PVector drawSum = sum.copy();\n drawSum.mult(100);\n stroke(0xffFF0000);\n line(pos.x, pos.y, pos.x + drawSum.x, pos.y + drawSum.y);\n stroke(0xff000000);\n }\n }\n return sum; \n }", "double getDistance(int i, int j){\r\n\tdouble d = (coord[i][0]-coord[j][0])*(coord[i][0]-coord[j][0])+ (coord[i][1]-coord[j][1])*(coord[i][1]-coord[j][1]);\r\n\td = Math.sqrt(d);\r\n\treturn d;\r\n}", "private float distanceTo(BasicEvent event) {\n final float dx = event.x - location.x;\n final float dy = event.y - location.y;\n// return Math.abs(dx)+Math.abs(dy);\n return distanceMetric(dx, dy);\n// dx*=dx;\n// dy*=dy;\n// float distance=(float)Math.sqrt(dx+dy);\n// return distance;\n }", "private double distantziaKalkulatu() {\r\n\t\tdouble lurrarenRadioa = 6371;// kilometrotan Lurraren radioa\r\n\t\tdouble dLat = Math.toRadians(terLat - latitudea); //\r\n\t\tdouble dLng = Math.toRadians(termLong - longitudea);\r\n\t\tdouble sindLat = Math.sin(dLat / 2);\r\n\t\tdouble sindLng = Math.sin(dLng / 2);\r\n\t\tdouble va1 = Math.pow(sindLat, 2)\r\n\t\t\t\t+ Math.pow(sindLng, 2) * Math.cos(Math.toRadians(terLat)) * Math.cos(Math.toRadians(latitudea));\r\n\t\tdouble va2 = 2 * Math.atan2(Math.sqrt(va1), Math.sqrt(1 - va1));\r\n\t\tdouble distancia = lurrarenRadioa * va2;\r\n\r\n\t\treturn distancia;\r\n\t}", "public static void ITdistances()\n\t{\n\t\t//System.err.println(\"Position\");\n\n\t\tclade = clad[k];\n\n\t\tclade.tipDistance = 0;\n\t\tclade.intDistance = 0;\n\t\tclade.tipDisNested = 0;\n\t\tclade.intDisNested = 0;\n\t\tclade.indTipClades = 0;\n\t\tclade.indIntClades = 0;\n\n\n\t\tif(clade.check != (double) clade.numSubClades && clade.check != 0)\n\t\t{ \n\t\t\tfor(i = 0; i < clade.numSubClades; i++)\n\t\t\t{\n\t\t\t\tif (clade.Position[i] == tip)\n\t\t\t\t\tclade.indTipClades += clade.rowTotal[i];\n\t\t\t\telse\n\t\t\t\t\tclade.indIntClades += clade.rowTotal[i];\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tfor(i = 0; i < clade.numSubClades; i++)\n\t\t\t{\n\t\t\t\t// weigthing within class\n\t\t\t\tclade.tipDistance += clade.Position[i] * clade.Dc[i] * (double) clade.rowTotal[i] / (double) clade.indTipClades;\n\t\t\t\tclade.tipDisNested += clade.Position[i] * clade.Dn[i] * (double) clade.rowTotal[i] / (double) clade.indTipClades;\n\t\t\t\tclade.intDistance += (1 - clade.Position[i]) * clade.Dc[i] * (double) clade.rowTotal[i] / (double) clade.indIntClades;\n\t\t\t\tclade.intDisNested += (1 - clade.Position[i]) * clade.Dn[i] * (double) clade.rowTotal[i] / (double) clade.indIntClades;\t\n\t\t\t\t\n\t\t\t\t// unweighted\n\t\t\t\t//clade.tipDistance += clade.Position[i] * clade.Dc[i] / (double) clade.check;\n\t\t\t\t//clade.tipDisNested += clade.Position[i] * clade.Dn[i] / (double) clade.check;\n\t\t\t\t//clade.intDistance += (1 - clade.Position[i]) * clade.Dc[i] / (double) (clade.numSubClades - clade.check);\n\t\t\t\t//clade.intDisNested += (1 - clade.Position[i]) * clade.Dn[i] / (double) (clade.numSubClades - clade.check);\t\n\t\t\t}\n\n\t\t clade.tipIntDistance = clade.intDistance - clade.tipDistance;\n\t\t clade.tipIntDisNested = clade.intDisNested - clade.tipDisNested;\n\t\t if(verbose){\n\t\t\tlogfile.println(\"\\nIT \" + clade.cladeName + \" indTipClades = \" + clade.indTipClades\n\t\t\t\t+ \" indIntClades + \" + clade.indIntClades);\n\t\t\tlogfile.println(\"\\nITc \" + clade.cladeName + \" meanInt = \" + clade.intDistance\n\t\t\t\t+ \" meanTip = \" + clade.tipDistance);\n\t\t\tlogfile.println(\"ITn \" + clade.cladeName + \" meanInt = \" + clade.intDisNested\n\t\t\t\t+ \" meanTip = \" + clade.tipDisNested);\n\t\t }\n\t\t}\n\n\t\t//System.err.println(\"IT clade \" + clade.cladeName + \" meanInt = \" + clade.intDistance + \" meanTip = \" + clade.tipDistance);\n\n\t}", "public double calculaDistancia(double latitude, double longitude)\n\t{\n\t\tdouble menorDistancia = Double.MAX_VALUE;\n\t\t\n\t\tif (posicoes.size() < 2)\n\t\t\treturn menorDistancia;\n\t\t\n\t\tPosicaoMapa posicaoAnterior = posicoes.get(0);\n\t\t\n\t\tfor (int i = 1; i < posicoes.size(); i++)\n\t\t{\n\t\t\tPosicaoMapa posicaoAtual = posicoes.get(i);\n\t\t\tdouble distancia = Geodesic.trackDistance(latitude, longitude, posicaoAnterior.getLatitude(), posicaoAnterior.getLongitude(), posicaoAtual.getLatitude(), posicaoAtual.getLongitude());\n\t\t\t\t\t\n\t\t\tif (distancia < menorDistancia)\n\t\t\t\tmenorDistancia = distancia;\n\t\t\t\n\t\t\tposicaoAnterior = posicaoAtual;\n\t\t}\n\t\t\n\t\treturn menorDistancia;\n\t}", "private void calculateDistances(int point) {\n int start = getDistanceIndex(point);\n\n for (int i = 0; i < point; i++) {\n distances[start + i] = getDistance(ntree.get(point), ntree.get(i));\n }\n\n int numPoints = getNumPoints();\n\n for (int i = point + 1; i < numPoints; i++) {\n start = getDistanceIndex(i);\n distances[start + point] = getDistance(ntree.get(point),\n ntree.get(i));\n }\n }", "public double calDistance()\n {\n double closest = poly[0].getD();\n\n for(int i = 1; i < sides; i++)\n {\n if(closest > poly[i].getD())\n {\n closest = poly[i].getD();\n }\n }\n this.distance = closest;\n\n return closest;\n }", "@Override\r\n public Double calcDistance(List<Point> src, List<Point> dst) {\r\n // Local Variables\r\n Double shortestDistance = Double.MAX_VALUE;\r\n Double currentDistance;\r\n\r\n // for each point in source\r\n for (Point p1:src) {\r\n // for each point in destination\r\n for (Point p2:dst) {\r\n // calc distance\r\n currentDistance = p1.distanceFrom(p2);\r\n\r\n // current < shortest -> update\r\n if(currentDistance < shortestDistance ){\r\n shortestDistance = currentDistance;\r\n }\r\n\r\n }\r\n }\r\n\r\n return shortestDistance;\r\n }", "private void getOriginalAndPedalData(List<Point> originalList) {\n\t\tfor (int i = 0; i < originalList.size() - 1; i++) {\n\t\t\tPoint point = (Point) originalList.get(i);\n\t\t\tPoint pedalPoint = getSpecificPedalByPoint(point);\n\t\t\t// int result = getVectorValue(pedalPoint, point, (Point) originalList.get(i + 1));\n\t\t\t\n\t\t\tdouble tmp = getDistance(point, pedalPoint);\n\t\t\t// double tmp = getHeightDistance(point, pedalPoint);\n\t\t\t\n\t\t\tthis.countM++;\n\t\t\t\n\t\t\tthis.aij += tmp;\n\t\t\tthis.dij += tmp;\n\t\t\tthis.sij += Math.abs(tmp - (this.aij / this.countM));\n\t\t}\n\t}", "public ArrayList<Pair<Landmark, Double>> nearestLocations(Pair<Double, Double> userLocation, int num){\n ArrayList<Pair<Landmark, Double>> nearestList = new ArrayList<>();\n for(int i = 0; i < this.list.size(); i++){\n Landmark landmark = list.get(i);\n double latitude = landmark.getLatitude();\n double longitude = landmark.getLongitude();\n Pair<Double, Double> coordinate = new Pair<>(latitude, longitude);\n // TODO use latitude and longitude explicitly\n double dist = distanceBetween(userLocation, coordinate);\n int origin = nearestList.size();\n for( int j = 0; j < nearestList.size(); j++ ){\n if( dist < nearestList.get(j).second ){\n nearestList.add(j, new Pair<>(this.list.get(i), dist));\n if(nearestList.size() > num){\n nearestList.remove(num);\n }\n break;\n }\n }\n if( origin == nearestList.size() ){\n if( nearestList.size() < num ){\n nearestList.add(new Pair<>(this.list.get(i), dist));\n }\n }\n }\n return nearestList;\n }", "public double calcDistance(Planet p){\n double sq_dis = (xxPos - p.xxPos) * (xxPos - p.xxPos) + (yyPos - p.yyPos) * (yyPos - p.yyPos);\n double distance = Math.sqrt(sq_dis);\n return distance;\n }", "public abstract double distanceFrom(double x, double y);", "public double getDistance() {\n\t\tdouble sum = 0;\n\t\tfor(int i = 0; i < ordering.size() - 1; i++) {\n\t\t\tsum += cost[ordering.get(i) - 1][ordering.get(i+1) - 1];\n\t\t}\n\t\treturn sum;\n\t}", "public double calcDist(int [] colorList){\r\n\t\t\r\n\t\tdouble red = colorList[0] - 186;\r\n\t\tdouble green = colorList[1] - 149;\r\n\t\tdouble blue = colorList[2] - 107;\r\n\t\tdouble dist = Math.sqrt(red * red + green * green +\r\n\t\t\t\tblue * blue);\r\n\t\t\r\n\t\tdouble red1 = colorList[0] - 91.0;\r\n\t\tdouble green1 = colorList[1] - 70.0;\r\n\t\tdouble blue1 = colorList[2] - 45.0;\r\n\t\tdouble dist1 = Math.sqrt(red1 * red1 + green1 * green1 +\r\n\t\t\t\tblue1 * blue1);\r\n\t\treturn Math.min(dist, dist1) ;\r\n\t}", "void berechneUmfang() {\r\n\t\tfor (int i = 1; i < m_ANZAHL_POINTS; i++) {\r\n\t\t\tm_umfang += m_pointArray[i].distance(m_pointArray[i-1]);\t\t\r\n\t\t}\r\n\t}", "public double calcDistance(Planet p){\n\t\treturn(Math.sqrt((this.xxPos-p.xxPos)*(this.xxPos-p.xxPos)\n\t\t\t+(this.yyPos-p.yyPos)*(this.yyPos-p.yyPos)));\n\t}", "private float findDistance(Balloon balloons) {\r\n\t\tfloat xDistance = Math.abs(balloons.getX() - x);\r\n\t\tfloat yDistance = Math.abs(balloons.getY() - y);\r\n\t\treturn xDistance + yDistance;\r\n\t}", "public double calcDistance(Planet p){\n\t\t\tdouble dx = this.xxPos - p.xxPos;\n\t\t\tdouble dy = this.yyPos - p.yyPos;\n\t\treturn Math.sqrt(dx*dx + dy*dy);\n\t}", "public double ComputeDistance(){ \n\t\tdouble lat1 = this.depAirportCity.getLatDegs() + (double)(this.depAirportCity.getLatMins())/60; \n\t\tdouble lon1 = this.depAirportCity.getLongDegs() + (double)(this.depAirportCity.getLongMins())/60;\n\t\tdouble lat2 = this.arrAirportCity.getLatDegs() + (double)(this.arrAirportCity.getLatMins())/60; \n\t\tdouble lon2 = this.arrAirportCity.getLongDegs() + (double)(this.arrAirportCity.getLongMins())/60;\n\t\t\n\t\tdouble distance = Haversine.getMiles(lat1, lon1, lat2, lon2);\n\t\treturn distance;\n\t}", "public int distance(Coord coord1, Coord coord2);", "public double getDistance(){\r\n\t\treturn Math.sqrt(\r\n\t\t\t\t(\r\n\t\t\t\t\tMath.pow(\r\n\t\t\t\t\t\tthis.getFirstObject().getCenterX()\r\n\t\t\t\t\t\t- this.getSecondObject().getCenterX()\r\n\t\t\t\t\t, 2 )\r\n\t )\r\n\t\t\t\t+ (\r\n\t\t\t\t\tMath.pow(\r\n\t\t\t\t\t\tthis.getFirstObject().getCenterY()\r\n\t\t\t\t\t\t- this.getSecondObject().getCenterY()\r\n\t\t\t\t\t, 2 )\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t}", "public double calcDistance(Planet p){\n\t\tdouble dx=-(xxPos-p.xxPos);\n\t\tdouble dy=-(yyPos-p.yyPos);\n\t\treturn Math.sqrt(dx*dx+dy*dy);\n\t}", "public double getEuclideanDistanceTo(Position other) {\n\n double sum = 0;\n //POEY comment: values.length = the number of extraction functions\n //find different values of every object's values in each function (round-robin tournament event itself)\n for (int i = 0; i < values.length; i++) {\n double value = values[i];\n double otherValue = other.values[i];\n double diff = value - otherValue;\n sum += (diff * diff);\n }\n\n return Math.sqrt(sum);\n \n }", "private void set_distance() {\n int[] k = new int[getQueue().length];\n distance = 0.0;\n for (int i = 1; i < getQueue().length; i++) {\n distance += getPoints().get(way[i]).distance(getPoints().get(way[i - 1]));\n }\n distance += getPoints().get(getQueue()[getPoints().size() - 1]).distance(getPoints().get(0));\n enterd = true;\n }", "public double calcDistance(Planet p){\n\t\tdouble dx = p.xxPos - this.xxPos;\n\t\tdouble dy = p.yyPos - this.yyPos ;\n\t\treturn Math.sqrt(dx * dx + dy * dy);\n\n\t}", "public static double BruteForceClosestPairs(ArrayList<Point> P) {\n\n\t\t//Assume closest distance is very large\n\t\tdouble distance = Double.POSITIVE_INFINITY;\n\t\t//Size of Arraylist\n\t\tint size = P.size();\n\t\t// New minimum \n\t\tdouble distchange = 0.0;\n\n\t\tfor (int i = 0; i < size - 1; i++) {\n\t\t\tfor (int j = i + 1; j < size; j++) {\n\n\t\t\t\tdistchange = distance;\n\t\t\t\t// Calculate distance between two points\n\t\t\t\tdistance = Math.min(Math.sqrt(Math.pow(P.get(i).getX() - P.get(j).getX(), 2) \n\t\t\t\t\t\t + Math.pow(P.get(i).getY() - P.get(j).getY(), 2)), distance);\n\t\t\t\t\n\t\t\t\tif (distchange != distance) {\n\t\t\t\t\t// If a new min was found, assign the new points \n\t\t\t\t\t// used for output to get \"coordinates of closest pair\"\n\t\t\t\t\tcoordinatepairs = \"(\" + P.get(i).getX() + \", \" + P.get(i).getY()+ \"), \" +\n\t\t\t\t\t\t\t\t \"(\" + P.get(j).getX() + \", \" + P.get(j).getY() + \")\";\n\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\treturn distance;\t\t\t\n\t}", "private double distance (double lata, double lona, double latb, double lonb) { \r\n return Math.acos(Math.sin(lata)*Math.sin(latb)+Math.cos(lata)*Math.cos(latb)*Math.cos(lonb-lona))*6371;\r\n }", "public double getDistance()\n {\n return Math.abs(getDifference());\n }", "public double distance(Customer i, Customer j);", "public double distance() {\n \tif (dist == -1) {\n \t\tdist = distance(vertex1, vertex2);\n \t}\n \n \treturn dist;\n }", "public ArrayList<Elemento> getPosicionesAdyacentes(){\n ArrayList <Elemento> result = new ArrayList<>();\n int[] coordenada_i = {0,1,1,1,0,-1,-1,-1};\n int[] coordenada_j = {1,1,0,-1,-1,-1,0,1};\n int nueva_posicion_fila = 0;\n int nueva_posicion_columna = 0;\n for(int k=0; k<8; k++){\n nueva_posicion_fila = fila + coordenada_i[k];\n nueva_posicion_columna = columna + coordenada_j[k];\n \n if((0 <= nueva_posicion_fila) && (nueva_posicion_fila < automata.getAutomata().length) && \n (0<= nueva_posicion_columna) && (nueva_posicion_columna < automata.getAutomata()[0].length)){\n result.add(automata.getElemento(nueva_posicion_fila,nueva_posicion_columna));\n \n }\n \n }\n return result;\n }", "Execution getClosestDistance();", "public double getDist(){\n double dist=0;\n double DA = 0;\n double minDist = this.getMotors()[0].getTargetPosition();\n for(int i =0;i<this.getMotors().length;i++) {\n double current = this.getMotors()[i].getCurrentPosition();\n double target = this.getMotors()[i].getTargetPosition();\n DA = Math.abs(target) - Math.abs(current);\n dist = target - current;\n if(Math.abs(DA)<Math.abs(minDist)){\n minDist = dist;\n }\n }\n return (minDist);\n }", "int furthestDist(GamePiece from, ArrayList<GamePiece> connect) {\n HashMap<GamePiece, Integer> dists = this.distanceMap(from);\n return dists.get(this.furthestPiece(from, connect));\n }", "public double getAbsoluteDistance( ArrayList< Double > a, ArrayList< Double > b )\n {\n double dist = -1.0;\n\n if( a.size() == b.size() )\n {\n dist = 0;\n for( int k=0; k<a.size(); k++ )\n {\n dist += Math.abs( a.get( k ) - b.get( k ) );\n }\n }\n\n return dist;\n }", "public int getDistance(){\n if (distance == 0) {\n int tourDistance = 0;\n // Loop through our tour's cities\n for (int cityIndex=0; cityIndex < tourSize(); cityIndex++) {\n // Get city we're travelling from\n City fromCity = getCity(cityIndex);\n // City we're travelling to\n City destinationCity;\n // Check we're not on our tour's last city, if we are set our \n // tour's final destination city to our starting city\n if(cityIndex+1 < tourSize()){\n destinationCity = getCity(cityIndex+1);\n }\n else{\n destinationCity = getCity(0);\n }\n // Get the distance between the two cities\n tourDistance += fromCity.distanceTo(destinationCity);\n }\n distance = tourDistance;\n }\n return distance;\n }", "public double distance(double x, double y);", "private static double getDISSIM(ArrayList<Point> r, ArrayList<Point> s, long t1, long tn){\n\t\tif(r.size() < 2 || s.size() < 2){\n\t\t\treturn INFINITY;\n\t\t}\n\t\t\n\t\tArrayList<Double> dist_t = new ArrayList<Double>();\n\t\tint index_r = 0, index_s = 0;\n\t\tfor(long t = t1; t <= tn; t += TIME_INCREMENT){\n\t\t\tPoint r_p1 = r.get(index_r);\n\t\t\tPoint r_p2 = r.get(index_r+1);\n\t\t\tPoint s_p1 = s.get(index_s);\n\t\t\tPoint s_p2 = s.get(index_s+1);\n\t\t\t\n\t\t\t// get the 'distance' between the two trajectories at time t\n\t\t\tdist_t.add(getDistance(r_p1, r_p2, s_p1, s_p2, t));\n\t\t\t\n\t\t\t// current time reached the time of the next point\n\t\t\tif(t > r_p2.timeLong && index_r < r.size()-2){\n\t\t\t\tindex_r++;\n\t\t\t}\n\t\t\tif(t > s_p2.timeLong && index_s < s.size()-2){\n\t\t\t\tindex_s++;\n\t\t\t}\n\t\t}\n\t\t\n\t\tdouble dissim = 0;\n\t\tfor(int i=0; i<dist_t.size()-1; i++) {\n\t\t\tdissim += (dist_t.get(i) + dist_t.get(i+1))*TIME_INCREMENT;\n\t\t}\n\t\t\n\t\treturn dissim/2;\n\t}", "private void dist2Pos3Beacons()\n {\n //Betrachtung bei 3 Empfaengern\n double dist12 = Math.sqrt(Math.pow(posReceiver[0][0] - posReceiver[1][0], 2) + Math.pow(posReceiver[0][1] - posReceiver[1][1], 2));\n double dist13 = Math.sqrt(Math.pow(posReceiver[0][0] - posReceiver[2][0], 2) + Math.pow(posReceiver[0][1] - posReceiver[2][1], 2));\n double dist23 = Math.sqrt(Math.pow(posReceiver[1][0] - posReceiver[2][0], 2) + Math.pow(posReceiver[1][1] - posReceiver[2][1], 2));\n\n boolean temp12 = Math.abs(radius[0] - radius[1]) > dist12;\n boolean temp23 = Math.abs(radius[1] - radius[2]) > dist23;\n boolean temp13 = Math.abs(radius[0] - radius[2]) > dist13;\n\n //Zwei Kreise innerhalb eines anderen Kreises\n if ((temp12 && temp23) || (temp12 && temp13) || (temp23 && temp13))\n {\n double f0 = (dist12 / radius[0] + dist13 / radius[0]) / 2;\n double f1 = (dist12 / radius[1] + dist23 / radius[1]) / 2;\n double f2 = (dist12 / radius[2] + dist13 / radius[2]) / 2;\n\n radius[0] = radius[0] * f0;\n radius[1] = radius[1] * f1;\n radius[2] = radius[2] * f2;\n }\n //Kreis 2 in Kreis 1\n if ((Math.abs(radius[0] - radius[1]) > dist12) && (radius[0] > radius[1]))\n {\n double[][] posRec = new double[][]{{posReceiver[0][0],posReceiver[0][1]},{posReceiver[1][0],posReceiver[1][1]},{posReceiver[2][0],posReceiver[2][1]}};\n double[] rad =new double[]{radius[0],radius[1],radius[2]};\n calcCircleInCircle(posRec, rad, dist13);\n }\n //Kreis 1 in Kreis 2\n else if ((Math.abs(radius[0] - radius[1]) > dist12) && (radius[1] > radius[0]))\n {\n double[][] posRec = new double[][]{{posReceiver[1][0],posReceiver[1][1]},{posReceiver[0][0],posReceiver[0][1]},{posReceiver[2][0],posReceiver[2][1]}};\n double[] rad =new double[]{radius[1],radius[0],radius[2]};\n calcCircleInCircle(posRec, rad, dist23);\n }\n //Kreis 3 in Kreis 1\n else if ((Math.abs(radius[0] - radius[2]) > dist13) && (radius[0] > radius[2]))//Kreis 3 in 1\n {\n double[][] posRec = new double[][]{{posReceiver[2][0],posReceiver[2][1]},{posReceiver[0][0],posReceiver[0][1]},{posReceiver[1][0],posReceiver[1][1]}};\n double[] rad =new double[]{radius[2],radius[0],radius[1]};\n calcCircleInCircle(posRec, rad, dist12);\n }\n //Kreis 1 in Kreis 3\n else if ((Math.abs(radius[0] - radius[2]) > dist13) && (radius[2] > radius[0]))//Kreis 1 in 3\n {\n double[][] posRec = new double[][]{{posReceiver[0][0],posReceiver[0][1]},{posReceiver[2][0],posReceiver[2][1]},{posReceiver[1][0],posReceiver[1][1]}};\n double[] rad =new double[]{radius[0],radius[2],radius[1]};\n calcCircleInCircle(posRec, rad, dist23);\n }\n //Kreis 3 in Kreis 2\n else if ((Math.abs(radius[1] - radius[2]) > dist23) && (radius[1] > radius[2]))//Kreis 3 in 2\n {\n double[][] posRec = new double[][]{{posReceiver[2][0],posReceiver[2][1]},{posReceiver[1][0],posReceiver[1][1]},{posReceiver[0][0],posReceiver[0][1]}};\n double[] rad =new double[]{radius[2],radius[1],radius[0]};\n calcCircleInCircle(posRec, rad, dist12);\n }\n //Kreis 2 in Kreis 3\n else if ((Math.abs(radius[1] - radius[2]) > dist23) && (radius[2] > radius[1]))//Kreis 2 ind 3\n {\n double[][] posRec = new double[][]{{posReceiver[1][0],posReceiver[1][1]},{posReceiver[2][0],posReceiver[2][1]},{posReceiver[0][0],posReceiver[0][1]}};\n double[] rad =new double[]{radius[1],radius[2],radius[0]};\n calcCircleInCircle(posRec, rad, dist13);\n }\n //Kein Kreis liegt innerhalb eines Anderen\n else\n {\n\n if ((dist12 > (radius[0] + radius[1])) && (dist13 > (radius[0] + radius[2])) && (dist23 > (radius[1] + radius[2])))\n {\n double p1[] = new double[2];\t//x\n double p2[] = new double[2];\t//y\n\n double norm12 = norm(posReceiver[0][0], posReceiver[0][1], posReceiver[1][0], posReceiver[1][1]);\n // Verbindungspunkte Kreis 1 und 2\n p1[0] = posReceiver[0][0] + (radius[0]/ norm12) * (posReceiver[1][0] - posReceiver[0][0]); //x-P1\n p1[1] = posReceiver[0][1] + (radius[0]/ norm12) * (posReceiver[1][1] - posReceiver[0][1]); //y-P1\n p2[0] = posReceiver[1][0] + (radius[1]/ norm12) * (posReceiver[0][0] - posReceiver[1][0]); //x-P2\n p2[1] = posReceiver[1][1] + (radius[1]/ norm12) * (posReceiver[0][1] - posReceiver[1][1]); //y-P2\n double m12[] = new double[2];\n m12[0] = p1[0] + 0.5 * (p2[0] - p1[0]);\t//x\n m12[1] = p1[1] + 0.5 * (p2[1] - p1[1]);\t//y\n\n\n double norm23 = norm(posReceiver[1][0], posReceiver[1][1], posReceiver[2][0], posReceiver[2][1]);\n // Verbindungspunkte Kreis 2 und 3\n p1[0] = posReceiver[1][0] + (radius[1]/ norm23) * (posReceiver[2][0] - posReceiver[1][0]); //x-P1\n p1[1] = posReceiver[1][1] + (radius[1]/ norm23) * (posReceiver[2][1] - posReceiver[1][1]); //y-P1\n p2[0] = posReceiver[2][0] + (radius[2]/ norm23) * (posReceiver[1][0] - posReceiver[2][0]); //x-P2\n p2[1] = posReceiver[2][1] + (radius[2]/ norm23) * (posReceiver[1][1] - posReceiver[2][1]); //y-P2\n double m23[] = new double[2];\n m23[0] = p1[0] + 0.5 * (p2[0] - p1[0]);\t//x\n m23[1] = p1[1] + 0.5 * (p2[1] - p1[1]);\t//y\n\n\n double norm31 = norm(posReceiver[2][0], posReceiver[2][1], posReceiver[0][0], posReceiver[0][1]);\n // Verbindungspunkte Kreis 3 und 1\n p1[0] = posReceiver[2][0] + (radius[2]/ norm31) * (posReceiver[0][0] - posReceiver[2][0]); //x-P1\n p1[1] = posReceiver[2][1] + (radius[2]/ norm31) * (posReceiver[0][1] - posReceiver[2][1]); //y-P1\n p2[0] = posReceiver[0][0] + (radius[0]/ norm31) * (posReceiver[2][0] - posReceiver[0][0]); //x-P2\n p2[1] = posReceiver[0][1] + (radius[0]/ norm31) * (posReceiver[2][1] - posReceiver[0][1]); //y-P2\n double m31[] = new double[2];\n m31[0] = p1[0] + 0.5 * (p2[0] - p1[0]);\t//x\n m31[1] = p1[1] + 0.5 * (p2[1] - p1[1]);\t//y\n\n\n // Norm der drei Punkte berechnen\n double a_p = Math.sqrt((m12[0] * m12[0]) + (m12[1] * m12[1]));\n double b_p = Math.sqrt((m23[0] * m23[0]) + (m23[1] * m23[1]));\n double c_p = Math.sqrt((m31[0] * m31[0]) + (m31[1] * m31[1]));\n\n double denominator = 2 * (((m12[0] * m23[1]) - (m12[1] * m23[0])) + (m23[0] * m31[1] - m23[1] * m31[0]) + (m31[0] * m12[1] - m31[1] * m12[0]));\n xPos_func = (1/ denominator)*(((b_p * b_p - c_p * c_p)*(-m12[1]) + (c_p * c_p - a_p * a_p)* (-m23[1]) + (a_p * a_p - b_p * b_p)*(-m31[1])));\n yPos_func = (1/ denominator)*(((b_p * b_p - c_p * c_p)*m12[0] + (c_p * c_p - a_p * a_p)* m23[0] + (a_p * a_p - b_p * b_p)*m31[0]));\n errRad_func = norm(xPos_func, yPos_func, m12[0], m12[1]);\n\n }\n // Kreis 1 und 3 schneiden sich\n else if ((dist12 > (radius[0] + radius[1])) && (dist23 > (radius[1] + radius[2])))\n {\n double[][] posRec = new double[][]{{posReceiver[0][0],posReceiver[0][1]},{posReceiver[2][0],posReceiver[2][1]},{posReceiver[1][0],posReceiver[1][1]}};\n double[] rad = new double[]{radius[0],radius[2],radius[1]};\n calc2Circle(posRec,rad);\n }\n //Kreis 2 und 3 schneide sich\n else if ((dist12 > (radius[0] + radius[1])) && (dist13 > (radius[0] + radius[2])))\n {\n double[][] posRec = new double[][]{{posReceiver[1][0],posReceiver[1][1]},{posReceiver[2][0],posReceiver[2][1]},{posReceiver[0][0],posReceiver[0][1]}};\n double[] rad = new double[]{radius[1],radius[2],radius[0]};\n calc2Circle(posRec,rad);\n }\n //Kreis 1 und 2 schneiden sich\n else if ((dist13 > (radius[0] + radius[2])) && (dist23 > (radius[1] + radius[2])))\n {\n double[][] posRec = new double[][]{{posReceiver[0][0],posReceiver[0][1]},{posReceiver[1][0],posReceiver[1][1]},{posReceiver[2][0],posReceiver[2][1]}};\n double[] rad = new double[]{radius[0],radius[1],radius[2]};\n calc2Circle(posRec,rad);\n }\n else if ((dist12 > (radius[0] + radius[1])))\n {\n double[][] posRec = new double[][]{\n {posReceiver[0][0],posReceiver[0][1]},\n {posReceiver[1][0],posReceiver[1][1]},\n {posReceiver[2][0],posReceiver[2][1]}};\n double[] rad = new double[]{radius[0],radius[1],radius[2]};\n calc1Circle(posRec,rad);\n }\n else if ((dist23 > (radius[1] + radius[2])))\n {\n double[][] posRec = new double[][]{\n {posReceiver[1][0],posReceiver[1][1]},\n {posReceiver[2][0],posReceiver[2][1]},\n {posReceiver[0][0],posReceiver[0][1]}};\n double[] rad = new double[]{radius[1],radius[2],radius[0]};\n calc1Circle(posRec,rad);\n }\n else if ((dist13 > (radius[0] + radius[2])))\n {\n double[][] posRec = new double[][]{\n {posReceiver[0][0],posReceiver[0][1]},\n {posReceiver[2][0],posReceiver[2][1]},\n {posReceiver[1][0],posReceiver[1][1]}};\n double[] rad = new double[]{radius[0],radius[2],radius[1]};\n calc1Circle(posRec,rad);\n }\n else\n {\n double x1 = 0, y1 = 0, x2 = 0, y2 = 0, x3 = 0, y3 = 0;\n //Kreisschnittpunkte\n //Kreisschnittpunkte\n //Kreisschnittpunkte\n double pos12[][] = circlepoints2(posReceiver[0][0], posReceiver[0][1], posReceiver[1][0], posReceiver[1][1], radius[0], radius[1]);\n double pos23[][] = circlepoints2(posReceiver[1][0], posReceiver[1][1], posReceiver[2][0], posReceiver[2][1], radius[1], radius[2]);\n double pos13[][] = circlepoints2(posReceiver[0][0], posReceiver[0][1], posReceiver[2][0], posReceiver[2][1], radius[0], radius[2]);\n\n if(radius[0] >= norm(pos23[0][0],pos23[0][1], posReceiver[0][0],posReceiver[0][1]))\n {\n x1 = pos23[0][0];\n y1 = pos23[0][1];\n }\n else if(radius[0] >= norm(pos23[1][0], pos23[1][1], posReceiver[0][0],posReceiver[0][1]))\n {\n x1 = pos23[1][0];\n y1 = pos23[1][1];\n }\n\n if(radius[1] >= norm(pos13[0][0], pos13[0][1], posReceiver[1][0],posReceiver[1][1]))\n {\n x2 = pos13[0][0];\n y2 = pos13[0][1];\n }\n else if(radius[1] >= norm(pos13[1][0], pos13[1][1], posReceiver[1][0],posReceiver[1][1]))\n {\n x2 = pos13[1][0];\n y2 = pos13[1][1];\n }\n\n if(radius[2] >= norm(pos12[0][0], pos12[0][1], posReceiver[2][0],posReceiver[2][1]))\n {\n x3 = pos12[0][0];\n y3 = pos12[0][1];\n }\n else if(radius[2] >= norm(pos12[1][0], pos12[1][1], posReceiver[2][0],posReceiver[2][1]))\n {\n x3 = pos12[1][0];\n y3 = pos12[1][1];\n }\n\n double tempD = x1 * y2 + x2 * y3 + x3 * y1 - x1 * y3 - x2 * y1 - x3 * y2;\n\n xPos_func = (0.5*(\n -y1*(y2*y2)\n +y1*(y3*y3)\n -y1*(x2*x2)\n +y1*(x3*x3)\n\n +y2*(y1*y1)\n -y2*(y3*y3)\n +y2*(x1*x1)\n -y2*(x3*x3)\n\n -y3*(y1*y1)\n +y3*(y2*y2)\n -y3*(x1*x1)\n +y3*(x2*x2)\n ))/ tempD;\n\n yPos_func = (0.5*(\n +x1*(x2*x2)\n -x1*(x3*x3)\n +x1*(y2*y2)\n -x1*(y3*y3)\n\n -x2*(x1*x1)\n +x2*(x3*x3)\n -x2*(y1*y1)\n +x2*(y3*y3)\n\n +x3*(x1*x1)\n -x3*(x2*x2)\n +x3*(y1*y1)\n -x3*(y2*y2)\n ))/ tempD;\n\n errRad_func = norm(x1, y1, xPos_func, yPos_func);\n }\n }\n }", "private float distanceMoyenne(DMatchVector bestMatches){\n\n float DM=0.0f;\n for(int i=0;i<bestMatches.size();i++){\n\n DM+=bestMatches.get(i).distance();\n }\n\n DM=DM/bestMatches.size();\n return DM;\n\n }", "public int calculateDistance(GraphNodeAL<MapPoint> l1, GraphNodeAL<MapPoint> l2){\n double x1 = l1.data.getxCo();\n double y1 = l1.data.getyCo();\n double x2 = l2.data.getxCo();\n double y2 = l2.data.getyCo();\n double dist = Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));\n return (int) dist;\n }", "private float getDistance(SXRNode object)\n {\n float x = object.getTransform().getPositionX();\n float y = object.getTransform().getPositionY();\n float z = object.getTransform().getPositionZ();\n return (float) Math.sqrt(x * x + y * y + z * z);\n }", "public int CalcDistance ( )\r\n\t{\r\n\t\tfor ( int i = 0; i<size; i++ )\r\n\t\t{\r\n\t\t\tfor ( int offR = 0; offR <= size/2; offR++ )\r\n\t\t\t{\r\n\t\t\t\tfor ( int c = 0; c <= size/2; c++ )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( offR == 0 && maze [offR] [c].isOpenUp() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenUp() && maze [offR-1] [c].isOpenDown() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR-1] [c].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( c == 0 && maze [offR] [c].isOpenLeft() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenLeft() && maze [offR] [c-1].isOpenRight() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR] [c-1].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tfor ( int c = size-1; c >= size/2; c-- )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( offR == 0 && maze [offR] [c].isOpenUp() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenUp() && maze [offR-1] [c].isOpenDown() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR-1] [c].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( c == size-1 && maze [offR] [c].isOpenRight() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenRight() && maze [offR] [c+1].isOpenLeft() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR] [c+1].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfor ( int offR = size-1; offR >= size/2; offR-- )\r\n\t\t\t{\r\n\t\t\t\tfor ( int c = 0; c <= size/2; c++ )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( offR == size-1 && maze [offR] [c].isOpenDown() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenDown() && maze [offR+1] [c].isOpenUp() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR+1] [c].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( c == 0 && maze [offR] [c].isOpenLeft() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenLeft() && maze [offR] [c-1].isOpenRight() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR] [c-1].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tfor ( int c = size-1; c >= size/2; c-- )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( offR == size-1 && maze [offR] [c].isOpenDown() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenDown() && maze [offR+1] [c].isOpenUp() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR+1] [c].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t\tif ( c == size-1 && maze [offR] [c].isOpenRight() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( 1 );\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if ( maze [offR] [c].isOpenRight() && maze [offR] [c+1].isOpenLeft() )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tmaze [offR] [c].setDistanceToExit( \r\n\t\t\t\t\t\t\t\tMath.min( maze [offR] [c+1].getDistanceToExit()+1,\r\n\t\t\t\t\t\t\t\t\t\t maze [offR] [c].getDistanceToExit() ) );\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn maze [currentRow] [currentCol].getDistanceToExit();\r\n\t}", "public static double getDistance( GameObject one, GameObject two )\n {\n double deltaX = getDeltaX( one, two );\n double deltaY = getDeltaY( one, two );\n return Math.sqrt( deltaX * deltaX + deltaY * deltaY );\n }", "private void computeDistances() {\n for (int i = 0; i < groundTruthInstant.size(); ++i)\n for (int j = 0; j < estimatedInstant.size(); ++j) {\n float currentDist = groundTruthInstant.get(i).getDistanceTo(estimatedInstant.get(j).getPos());\n if (currentDist < distToClosestEstimate[i][0]) {\n distToClosestEstimate[i][0] = currentDist;\n distToClosestEstimate[i][1] = j;\n }\n }\n }", "public void buildDistances(ArrayList<ParentVertex> allVertices){\n distances = new ArrayList<>();\n \n // For all vertices in this graph\n for (int i = 0; i < allVertices.size(); i++){\n \n // If the vertex at hand is not the same vertex\n if (this.key != allVertices.get(i).getKey()){\n double distanceToAdd = \n // Euclidean distance function (this vertex to list vertex)\n Math.sqrt(\n Math.pow((allVertices.get(i).getXPos() - this.xPos), 2) + \n Math.pow((allVertices.get(i).getYPos() - this.yPos), 2));\n\n // If this is the first distance pair, add it in\n if (distances.size() == 0){\n distances.add(new VertexDistancePair(allVertices.get(i).getKey(), distanceToAdd));\n }\n\n else {\n // Place this new vertexDistancePair where it belongs:\n // nearest to furthest distance\n for (int j = 0; j < distances.size(); j++){\n if (distanceToAdd <= distances.get(j).distance){\n distances.add(j, new VertexDistancePair(allVertices.get(i).getKey(), distanceToAdd));\n break;\n }\n else if (j == distances.size()-1){\n distances.add(new VertexDistancePair(allVertices.get(i).getKey(), distanceToAdd));\n break;\n }\n }\n }\n }\n }\n }", "private double Distance(Point first, Point second){ // distance between two points \n\t\treturn Math.sqrt(Math.pow(second.getY()-first.getY(),2) + Math.pow(second.getX()-first.getX(),2));\n\t}", "public static double distancia(Entidade e1,Entidade e2){\r\n\t\tdouble dx = e1.getPosicaoX() - e2.getPosicaoX();\r\n\t\tdouble dy = e1.getPosicaoY() - e2.getPosicaoY();\r\n\t\tdouble d = Math.sqrt(dx*dx + dy*dy);\r\n\t\treturn d;\r\n\t}", "public void getTotalDistance(ArrayList<NewLocation> arrLocations){\n double sumOfDistances = 0;\n //traverse through each point saved in the array of locations\n for (int i = 0; i < arrLocations.size() - 1; i++) {\n sumOfDistances += getDistanceBetween_2points(arrLocations.get(i).getLatitude(),\n arrLocations.get(i).getLongitude(),\n arrLocations.get(i+1).getLatitude(),\n arrLocations.get(i+1).getLongitude());\n }\n Log.d(TAG, \"getTotalDistance: \" + sumOfDistances);\n //set a new format for the results\n DecimalFormat df = new DecimalFormat(\"#.##\");\n df.setRoundingMode(RoundingMode.CEILING);\n totalDistanceView.setText(df.format(sumOfDistances)+\" m\");\n }", "public int distance() {\n return distance;\n }", "public double computeDistance(Object o){\n \n if (o!=null && o.getClass()==this.getClass()){\n NDimensionalPoint newPoint = (NDimensionalPoint) o;\n if (newPoint.values.size()==values.size()){\n double dist = 0.0;\n for (int i=0;i<values.size();i++){\n dist+=Math.pow(newPoint.getValues().get(i) -values.get(i),2);\n }\n return Math.sqrt(dist);\n }else\n {\n return MAX_DIST;\n }\n }else{\n return MAX_DIST;\n }\n }", "@Override\n public double distance(NumberVector o1, NumberVector o2) {\n double dt = Math.abs(o1.doubleValue(0) - o2.doubleValue(0));\n // distance value of earth coordinates in meter\n double dc = getDistance(o1.doubleValue(1), o1.doubleValue(2), o2.doubleValue(1), o2.doubleValue(2));\n return dt + dc;\n }", "public abstract double distance(AbstractPoisson o2);", "Execution getFarthestDistance();", "public float fieldDistance(ArrayList<LatLng> path){\n return dronePath.fieldDistance(path);\n }", "static double distanceToOrigin ( Posn p ) {\n\t// return ... p.x ... p.y ... ;\n\treturn Math.sqrt(Math.pow(p.x,2) + Math.pow(p.y,2)) ;\n }", "public int distanceTo(final int one) {\n int total = 0;\n for (Edge each : pathTo(one)) {\n total += each.getWeight();\n }\n return total;\n }", "@Override\n public float distanceAdjacent(int x1, int y1, int x2, int y2) {\n float duration = 0;\n\n if (x1 == x2 || y1 == y2) {\n MapTile.Instance fromTile = getTileData(x1, y1);\n MapTile.Instance toTile = getTileData(x2, y2);\n assert fromTile != null && toTile != null;\n\n Direction move = Direction.get(x2 - x1, y2 - y1);\n\n int fromHeight = fromTile.heightOf(move);\n int toHeight = toTile.heightOf(move.inverse());\n\n // steepness\n float t1inc = (fromHeight - fromTile.getHeight()) / (TILE_SIZE / 2);\n float t2inc = (toHeight - toTile.getHeight()) / (TILE_SIZE / 2);\n\n // actual duration of walking\n float walkSpeedT1 = (1f / hypoLength(t1inc)) * walkSpeed;\n float walkSpeedT2 = (1f / hypoLength(t2inc)) * walkSpeed;\n\n // duration += walkspeed(steepness_1) * dist + walkspeed(steepness_2) * dist\n duration += (walkSpeedT1 + walkSpeedT2) * TILE_SIZE;\n\n // height difference on the sides of the tiles\n float cliffHeight = (toHeight - fromHeight) * TILE_SIZE_Z;\n\n // climbing if more than 'an acceptable height'\n if (cliffHeight > 0) {\n duration += (cliffHeight / climbSpeed);\n }\n\n } else {\n // TODO allow diagonal tracing\n Logger.WARN.print(String.format(\n \"Pathfinding (%s) asked for non-adjacent tiles (%d, %d) (%d, %d)\",\n getClass(), x1, y1, x2, y2\n ));\n\n return Float.POSITIVE_INFINITY;\n }\n\n return duration;\n }", "@Transactional \n\tpublic List<PharmacyDto> getTheNeartsPharmacy(double userLon, double userLat, double userdistance) {\n\t\t\n\t\t\n\t\tIterator <PharmacyDto> pharmacyListDto = pharmacyRepository1.getAllPharmaciesDto().iterator();\n\t\t\n\t\tList <PharmacyDto> nearestList = new ArrayList<PharmacyDto>() ;\n\t\t\n\t\twhile (pharmacyListDto.hasNext()) {\n\t\t\t\n\t\t\tPharmacyDto pharmacyToAdd = pharmacyListDto.next();\n\t\t\t\n\t\t\tNearLocationBusiness userlocation = new NearLocationBusiness(userLon,userLat);\n\t\t\t\n\t\t\tNearLocationBusiness pharmacy = new NearLocationBusiness(pharmacyToAdd.getLonLocation(),pharmacyToAdd.getLatLocation());\n\t\t\t\n\t\t\tdouble distance= pharmacy.distanceTo(userlocation);\n\t\t\t\n\t\t\tif(distance<userdistance) {\n\t\t\t\tnearestList.add(pharmacyToAdd);\n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\treturn nearestList;\n\t}", "public abstract double distanceTo (Object object);", "public static void Agrupar() {\n\t\tArrayList<ArrayList<Double>> distancias_centroids = new ArrayList<ArrayList<Double>>();\n\t\tfor (int i=0;i<centroids.size();i++) {\n\t\t\tArrayList<Double> distancias= new ArrayList<Double>();\n\t\t\tfor (int j=0;j<petalas.size();j++) {\n\t\t\t\tdouble x1= centroids.get(i).petal_length;\n\t\t\t\tdouble x2= petalas.get(j).petal_length;\n\t\t\t\tdouble y1= centroids.get(i).petal_width;\n\t\t\t\tdouble y2= petalas.get(j).petal_width;\n\t\t\t\tdouble cateto1= x1-x2;\n\t\t\t\tdouble cateto2= y1-y2;\n\t\t\t\tdouble hipotenusa = Math.sqrt(cateto1*cateto1+cateto2*cateto2);\n\t\t\t\tdistancias.add(hipotenusa);\n\t\t\t\t/*\n\t\t\t\tSystem.out.println(\"cateto1: \"+cateto1);\n\t\t\t\tSystem.out.println(\"cateto2: \"+cateto2);\n\t\t\t\tSystem.out.println(\"hipotenusa: \"+hipotenusa);\n\t\t\t\t*/\n\t\t\t\t\t\t\t}\n\t\t\t\n\t\t\tdistancias_centroids.add(distancias);\t\t\t\n\t\t}\n\t\t/*\n\t\tSystem.out.println(\"Distancias Centroids:\");\n\t\tfor (int i=0;i<distancias_centroids.size();i++) {\n\t\t\tSystem.out.println(\"Centroid \"+i);\n\t\t\tfor (int j=0;j<distancias_centroids.get(i).size();j++) {\n\t\t\t\tSystem.out.println(distancias_centroids.get(i).get(j));\n\t\t\t}\n\t\t}\n\t\t*/\n\t\t//Para qual centroid pertece cada ponto\n\t\tArrayList<ArrayList<Petala>> pontos_de_cada_centroid = new ArrayList<ArrayList<Petala>>();\n\t\tfor (int i=0;i<centroids.size();i++) {\n\t\t\tArrayList<Petala> p = new ArrayList<Petala>();\n\t\t\tpontos_de_cada_centroid.add(p); \n\t\t}\n\t\tfor (int i=0;i<petalas.size();i++) {\n\t\t\tdouble menor =100;\n\t\t\tint centroid_menor=0;\n\t\t\tfor (int j=0;j<centroids.size();j++) {\n\t\t\t\tif (distancias_centroids.get(j).get(i)<menor) {\n\t\t\t\t\tmenor = distancias_centroids.get(j).get(i);\n\t\t\t\t\tcentroid_menor=j;\n\t\t\t\t}\n\t\t\t}\n\t\t\tpontos_de_cada_centroid.get(centroid_menor).add(petalas.get(i));\n\t\t}\n\t\t/*\n\t\tfor (int i=0;i<pontos_de_cada_centroid.size();i++) {\n\t\t\tSystem.out.println(\"Centroid \"+i);\n\t\t\tSystem.out.println(\"Petalas: \");\n\t\t\tSystem.out.println(pontos_de_cada_centroid.get(i));\n\t\t}\n\t\t*/\n\t\t//Novos centroids\n\t\tArrayList<Petala> novos_centroids = new ArrayList<Petala>();\n\t\tfor (int i=0;i<pontos_de_cada_centroid.size();i++) {\n\t\t\tdouble soma_x=0;\n\t\t\tdouble soma_y=0;\n\t\t\tfor (int j=0;j<pontos_de_cada_centroid.get(i).size();j++) {\n\t\t\t\tsoma_x+=pontos_de_cada_centroid.get(i).get(j).petal_length;\n\t\t\t\tsoma_y+=pontos_de_cada_centroid.get(i).get(j).petal_width;\n\t\t\t}\n\t\t\tdouble novo_x=soma_x/pontos_de_cada_centroid.get(i).size();\n\t\t\tdouble novo_y=soma_y/pontos_de_cada_centroid.get(i).size();\n\t\t\tPetala novo_centroid = new Petala(novo_x,novo_y);\n\t\t\tnovos_centroids.add(novo_centroid);\n \t\t}\n\t\t\n\t\t//Gravar Geracao\n\t\tArrayList<Petala> gc= new ArrayList<Petala>();\n\t\tfor (int i=0;i<centroids.size();i++) {\n\t\t\tgc.add(centroids.get(i));\n\t\t}\n\t\tGeracao geracao = new Geracao(gc,pontos_de_cada_centroid);\n\t\tgeracoes.add(geracao);\n\t\t//Condicao de Parada\n\t\tboolean terminou = true;\n\t\tfor (int i=0; i<centroids.size();i++) {\n\t\t\tif (centroids.get(i).petal_length!=novos_centroids.get(i).petal_length) {\n\t\t\t\tterminou = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (centroids.get(i).petal_width!=novos_centroids.get(i).petal_width) {\n\t\t\t\tterminou = false;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t\tif (terminou) {\n\t\t\t/*\n\t\t\tSystem.out.println(\"Novos centroids:\");\n\t\t\tSystem.out.println(novos_centroids);\n\t\t\t\n\t\t\tSystem.out.println(\"FIM!\");\n\t\t*/\n\t\t}else {\n\t\t\tcentroids.clear();\n\t\t\tfor (int i=0;i<novos_centroids.size();i++) {\n\t\t\t\tcentroids.add(novos_centroids.get(i));\n\t\t\t}\n\t\tgeracao_atual++;\n\t\t\tAgrupar();\n\t\t}\n\t}" ]
[ "0.71367085", "0.71249956", "0.70009536", "0.69611025", "0.6931163", "0.6829798", "0.65194714", "0.6295145", "0.62745595", "0.6257012", "0.6248518", "0.62428164", "0.61695194", "0.6152057", "0.6143431", "0.6098522", "0.6027017", "0.6022844", "0.60227317", "0.601737", "0.6001334", "0.60007083", "0.5996362", "0.5983187", "0.59667575", "0.5937151", "0.5937112", "0.59306693", "0.5925153", "0.59144527", "0.5901295", "0.58989793", "0.5897365", "0.5888162", "0.58793324", "0.58783907", "0.58430856", "0.5841965", "0.5806934", "0.580068", "0.579342", "0.57925916", "0.57861745", "0.57836443", "0.57800704", "0.5776718", "0.5776107", "0.5772983", "0.57683104", "0.5765643", "0.57526743", "0.5748121", "0.5741245", "0.5738665", "0.5737235", "0.5721402", "0.5718646", "0.5711892", "0.57079875", "0.56987506", "0.56953317", "0.5687059", "0.56812257", "0.56722975", "0.5671794", "0.5663776", "0.5656184", "0.5652318", "0.5616406", "0.56084543", "0.5600451", "0.5591152", "0.5582788", "0.55630237", "0.5561341", "0.5558884", "0.555875", "0.5557862", "0.55533415", "0.55505687", "0.5550441", "0.55490893", "0.5545016", "0.5540813", "0.55406106", "0.55299574", "0.5528507", "0.55273277", "0.552303", "0.5514373", "0.55113333", "0.55073994", "0.54991287", "0.5498646", "0.54983115", "0.549062", "0.54873693", "0.54857695", "0.54848903", "0.54819167" ]
0.7327822
0
Affiche le nombre de routes qui partent du premier point de la liste
private static void nbRoutesPremierPoint(List<Point> points) { if(points == null || points.isEmpty()) { System.out.println("Aucun point dans l'ensemble des points ..."); return; } Iterator<Point> iter = points.iterator(); Point p1 = iter.next(); System.out.println("Il y a "+p1.getNbRoutes()+" routes qui partent du point p1"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int getNombreLiaison()\t{\r\n \treturn this.routes.size();\r\n }", "private int countPossibleRoutes(){\n\tint totPossRoutes =0;\n\tfor(int i=0;i<ConditionTree.length;i++){\n\t\tif(ConditionTree[i][5].equals(\"Y\")){\n\t\t\ttotPossRoutes++;\n\t\t}\n\t}\n\t\n\treturn totPossRoutes;\n}", "public int entries(){\n\t\treturn routeTable.size();\n\t}", "void countPaths (int inicio) {\r\n\t\tint n = lisAdy.keySet().size();\r\n\t\tint paths[] = new int[n];\r\n\t\tvisitados = new boolean[n];\r\n\t\tcola = new ArrayDeque<> ();\r\n\t\t\r\n\t\ttoposort(inicio);\r\n\t\tpaths[inicio] = 1;\r\n\t\tfor (int i : cola) {\r\n\t\t\tfor (int v : lisAdy.get(i)) \r\n\t\t\t\tpaths[v] += paths[i];\r\n\t\t}\r\n\t}", "public int getNumberOfPaths(){ \r\n HashMap<FlowGraphNode, Integer> number = new HashMap<>();\r\n LinkedList<FlowGraphNode> queue = new LinkedList<>();\r\n HashMap<FlowGraphNode, Integer> label = new HashMap<>();\r\n \r\n label.put(start,1);\r\n queue.add(start);\r\n do{\r\n FlowGraphNode node = queue.pop();\r\n for(FlowGraphNode child : node.to){\r\n int count = number.getOrDefault(child, child.inDeg()) -1;\r\n if(count == 0){\r\n queue.add(child);\r\n number.remove(child);\r\n //label\r\n int sum = 0;\r\n for(FlowGraphNode anc : child.from){\r\n sum += label.get(anc);\r\n }\r\n label.put(child,sum);\r\n }else{\r\n number.put(child, count);\r\n }\r\n }\r\n }while(!queue.isEmpty());\r\n \r\n if(!number.isEmpty()){\r\n //there has to be a loop in the graph\r\n return -1;\r\n }\r\n \r\n return label.get(end);\r\n }", "@java.lang.Override\n @java.lang.Deprecated public int getRouteCount() {\n return route_.size();\n }", "public List<String> getRouteList();", "public String getRoutingNo();", "int getWayCount();", "List<Route> getAllRoute();", "private void drawRoutes () {\n // Lay ngay cua tour\n Date tourDate = OnlineManager.getInstance().mTourList.get(tourOrder).getmDate();\n // Kiem tra xem ngay dien ra tour la truoc hay sau hom nay. 0: hom nay, 1: sau, -1: truoc\n int dateEqual = Tour.afterToday(tourDate);\n // Kiem tra xem tour da dien ra chua\n if (dateEqual == -1) {\n // Tour da dien ra, khong ve gi ca\n } else if (dateEqual == 1) {\n // Tour chua dien ra, khong ve gi ca\n } else {\n // Tour dang dien ra thi kiem tra gio\n /* Chang sap toi mau do, today nam trong khoang src start va src end\n Chang dang di chuyen mau xanh, today nam trong khoang src end va dst start\n Chang vua di qua mau xam, today nam trong khoang dst start va dst end */\n ArrayList<TourTimesheet> timesheets = OnlineManager.getInstance().mTourList.get(tourOrder).getmTourTimesheet();\n // Danh dau chang dang di qua\n int changDangDiQuaOrder = -1;\n // Danh dau chang sap di qua\n int changSapDiQuaOrder = -1;\n if(Tour.afterCurrentHour(timesheets.get(0).getmStartTime()) == 1){\n // Chang sap di qua mau do\n // Neu chua ve chang sap di, ve duong mau do\n if (timesheets.size() >= 2) {\n drawRoute(Color.RED, timesheets.get(0).getmBuildingLocation(), timesheets.get(1).getmBuildingLocation());\n }\n } else {\n for (int i = 0; i < timesheets.size() - 1; i++) {\n // Kiem tra xem chang hien tai la truoc hay sau gio nay. 0: gio nay, 1: gio sau, -1: gio truoc\n int srcStartEqual = Tour.afterCurrentHour(timesheets.get(i).getmStartTime());\n int srcEndEqual = Tour.afterCurrentHour(timesheets.get(i).getmEndTime());\n int dstStartEqual = Tour.afterCurrentHour(timesheets.get(i + 1).getmStartTime());\n // 2 vi tri chang\n LatLng srcLocation = timesheets.get(i).getmBuildingLocation();\n LatLng dstLocation = timesheets.get(i + 1).getmBuildingLocation();\n if (srcStartEqual == -1 && srcEndEqual == 1) {\n // Chang dang di qua mau xanh\n // Neu chua ve chang dang di, ve duong mau xanh\n drawRoute(Color.BLUE, srcLocation, dstLocation);\n // Danh dau chang dang di qua\n changDangDiQuaOrder = i;\n // Thoat khoi vong lap\n break;\n } else if (srcEndEqual == -1 && dstStartEqual == 1) {\n // Chang sap toi mau do\n // Neu chua ve chang sap toi, ve duong mau do\n drawRoute(Color.RED, srcLocation, dstLocation);\n // Danh dau chang sap di qua\n changSapDiQuaOrder = i;\n // Thoat khoi vong lap\n break;\n }\n }\n }\n // Kiem tra xem da ve duoc nhung duong nao roi\n if (changDangDiQuaOrder != - 1) {\n // Neu ve duoc chang dang di qua roi thi ve tiep 2 chang con lai\n if (changDangDiQuaOrder < timesheets.size() - 2) {\n // Neu khong phai chang ket thuc thi ve tiep chang sap di qua\n // 2 vi tri chang\n LatLng srcLocation = timesheets.get(changDangDiQuaOrder + 1).getmBuildingLocation();\n LatLng dstLocation = timesheets.get(changDangDiQuaOrder + 2).getmBuildingLocation();\n drawRoute(Color.RED, srcLocation, dstLocation);\n }\n if (changDangDiQuaOrder > 0) {\n // Neu khong phai chang bat dau thi ve tiep chang da di qua\n // 2 vi tri chang\n LatLng srcLocation = timesheets.get(changDangDiQuaOrder - 1).getmBuildingLocation();\n LatLng dstLocation = timesheets.get(changDangDiQuaOrder).getmBuildingLocation();\n drawRoute(Color.GRAY, srcLocation, dstLocation);\n }\n }\n if (changSapDiQuaOrder != - 1) {\n // Neu ve duoc chang sap di qua roi thi ve tiep 2 chang con lai\n if (changSapDiQuaOrder > 0) {\n // Neu khong phai chang bat dau thi ve tiep chang dang di qua\n // 2 vi tri chang\n LatLng srcLocation = timesheets.get(changSapDiQuaOrder - 1).getmBuildingLocation();\n LatLng dstLocation = timesheets.get(changSapDiQuaOrder).getmBuildingLocation();\n drawRoute(Color.BLUE, srcLocation, dstLocation);\n }\n if (changSapDiQuaOrder > 1) {\n // Neu khong phai chang bat dau thi ve tiep chang da di qua\n // 2 vi tri chang\n LatLng srcLocation = timesheets.get(changSapDiQuaOrder - 2).getmBuildingLocation();\n LatLng dstLocation = timesheets.get(changSapDiQuaOrder - 1).getmBuildingLocation();\n drawRoute(Color.GRAY, srcLocation, dstLocation);\n }\n }\n }\n }", "int getLocationsCount();", "int getPathsCount();", "@java.lang.Override\n public int getWaypointsCount() {\n return waypoints_.size();\n }", "@java.lang.Deprecated public int getRouteCount() {\n if (routeBuilder_ == null) {\n return route_.size();\n } else {\n return routeBuilder_.getCount();\n }\n }", "synchronized public Vector<Route> getRoutePossibleDePrendre(Joueur joueur){\n\t\tVector<Route> tmp = new Vector<Route>();\n\t\tfor(Route v : routes)\n\t\t\tif(v != null ){\n\t\t\t\tif(v instanceof Route){\n\t\t\t\t\tif(v.isRoutePosseder())\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif(v.nbWagonNecessaire <= joueur.compterNbCarteDeTelleCouleur(v.couleurNecessaireRoute))\n\t\t\t\t\t\ttmp.add(v);\n\t\t\t\t}\n\t\t\t\tif(v instanceof RouteDouble){\n\t\t\t\t\tif(((RouteDouble)v).possederPar2 != null)\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\tif(v.nbWagonNecessaire <= joueur.compterNbCarteDeTelleCouleur(v.couleurNecessaireRoute))\n\t\t\t\t\t\ttmp.add(v);\n\t\t\t\t}\n\t\t\t}\n\t\treturn tmp;\n\t}", "private static int numBusesToDestination(int[][] routes, int S, int T) {\n if (routes == null || routes.length == 0) {\n return 0;\n }\n\n if (S == T) {\n return 0;\n }\n\n // map a stop to routes\n // 1 -> 0, stop 1 belongs to route 0\n // 7 -> 0, 1 stop 7 belongs to route 0 and 1\n Map<Integer, List<Integer>> graph = new HashMap<>();\n for (int i = 0; i < routes.length; i++) {\n for (int stop: routes[i]) {\n if (!graph.containsKey(stop)) {\n graph.put(stop, new ArrayList<>());\n }\n graph.get(stop).add(i); // stop, routeid\n }\n }\n\n Queue<Integer> queue = new LinkedList<>(); // bus stop\n Set<Integer> visited = new HashSet<>(); // visited routes\n\n queue.offer(S);\n\n int level = 1;\n\n while (!queue.isEmpty()) {\n int size = queue.size();\n\n for (int i = 0; i < size; i++) {\n int cur = queue.poll(); // current stop\n\n // get all routes available from the current stop\n for (int routeId: graph.get(cur)) {\n if (!visited.contains(routeId)) {\n visited.add(routeId);\n\n // get all stops from this route\n for (int stop: routes[routeId]) {\n if (stop == T) {\n return level;\n }\n queue.offer(stop);\n }\n }\n }\n }\n level++;\n }\n\n return -1;\n }", "public ArrayList<ArrayList<ModuleElement>> getAllShortestRoutes(Biochip grid, ModuleElement dest){\n\t\tArrayList<ArrayList<ModuleElement>> route_list = new ArrayList<ArrayList<ModuleElement>>(); \n\t\tArrayList<ModuleElement> crt_route = new ArrayList<ModuleElement>();\n\t\tdouble crt_value = grid.getCell(dest.x, dest.y).value; \n\t\tcrt_route.add(dest);\n\t\troute_list.add(crt_route);\n\t\t//this.printGrid(grid);\n\t\t//System.out.println(grid.getCell(dest.x, dest.y).value); \n\t\t//System.out.println(\"Get sh_route for dest = \" + dest.x + dest.y + \"crt_value=\" + crt_value); \n\n\t\twhile(crt_value>0){\n\t\t\tArrayList<ArrayList<ModuleElement>> new_route_list = new ArrayList<ArrayList<ModuleElement>>(); \n\t\t\tcrt_value --; \n\t\t\tfor (int k=0; k<route_list.size();k++){\n\t\t\t\t//System.out.println(\"k=\" + k); \n\t\t\t\tcrt_route = route_list.get(k); \n\t\t\t\tint i = crt_route.get(crt_route.size()-1).x;\n\t\t\t\tint j = crt_route.get(crt_route.size()-1).y;\n\t\t\t\t// neighbors\n\t\t\t\tif (j+1<grid.width){\n\t\t\t\t\tCell right_n = grid.getCell(i, j+1);\n\t\t\t\t\tArrayList<ModuleElement> r_route = this.createNewRoute(grid, crt_route, right_n, crt_value); \n\t\t\t\t\tif (r_route!=null) new_route_list.add(r_route); \t\n\t\t\t\t}\n\t\t\t\tif (j-1>=0) {\n\t\t\t\t\tCell left_n = grid.getCell(i, j-1);\n\t\t\t\t\tArrayList<ModuleElement> l_route = this.createNewRoute(grid, crt_route, left_n, crt_value); \n\t\t\t\t\tif (l_route!=null) new_route_list.add(l_route); \n\t\t\t\t} \n\t\t\t\tif (i-1>=0) {\n\t\t\t\t\tCell up_n = grid.getCell(i-1, j);\n\t\t\t\t\tArrayList<ModuleElement> u_route = this.createNewRoute(grid, crt_route, up_n, crt_value); \n\t\t\t\t\tif (u_route!=null) new_route_list.add(u_route); \n\t\t\t\t} \n\t\t\t\tif (i+1<grid.height) {\n\t\t\t\t\tCell down_n = grid.getCell(i+1, j);\n\t\t\t\t\tArrayList<ModuleElement> d_route = this.createNewRoute(grid, crt_route, down_n, crt_value); \n\t\t\t\t\tif (d_route!=null) new_route_list.add(d_route); \t\n\t\t\t\t} \n\t\t\t\t//System.out.println(\"new_route_list = \" + new_route_list); \n\t\t\t}\n\t\t\troute_list = new_route_list; \n\t\t}\n\t\t\n\t\treturn route_list; \n\t}", "public static void printShortestPath(List<Town> sp) {\n\t\tint size = sp.size();\n\t\tif ( size>1 ) {\n\t\t\tfor( int i = 1; i <= size; i++) {\n\t\t\t\tif( i != size ) {\n\t\t\t\t\tSystem.out.print( sp.get(size-i).getName()+\"-\" );\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print( sp.get(size-i).getName());\n\t\t\t\t} \n\t\t\t}\t\t\t\n\t\t}else {\n\t\t\tSystem.out.println(\"There is no possible route\");\n\t\t}\n\t}", "List<ConnectingFlights> getPossibleRoutes(int loc_start_id, int loc_end_id);", "int airportConnections (List<String> airports, List<List<String>> routes, String startAirport) {\n // create the graph\n Map<String, AirportNode> airportGraph = createAirportGraph(airports, routes);\n // get all unreachable airports starting from the starting airport\n List<AirportNode> unreachableAirportNodes =\n getUnreachableAirportNodes(airportGraph,airports,startAirport);\n // assign scores to each unreachable airport(find all airports reachable from unreachable airport)\n markUnreachableConnections(airportGraph,unreachableAirportNodes);\n // get the min number of connections\n return getMinNumberofNewConnections(airportGraph, unreachableAirportNodes);\n }", "public void shortestPathsNodes() {\n for (int sourceNode = 0; sourceNode < wordGraph.V(); sourceNode++) {\n BreadthFirstDirectedPaths bfs = new BreadthFirstDirectedPaths(wordGraph, sourceNode);\n\n for (int goalNode = 0; goalNode < wordGraph.V(); goalNode++) {\n Iterable<Integer> shortestPath = bfs.pathTo(goalNode);\n int pathLength = -1;\n if (shortestPath != null) {\n for (int edge : shortestPath) {\n pathLength++;\n }\n }\n if (pathLength != -1) {\n }\n System.out.println(pathLength);\n }\n }\n }", "private String printRoute() {\n String r = String.valueOf(this.route.get(0));\n int index = 1;\n while (index < this.route.size()) {\n r = r + \" - \" + this.route.get(index);\n index++;\n }\n return r;\n }", "public static void printNumberDifferentRoutes(int routes) {\n\t\t\n\t\tif ( routes>0 ) {\n\t\t\tSystem.out.println(routes);\t\t\t\n\t\t}else {\n\t\t\tSystem.out.println(\"There is no possible route\");\n\t\t}\n\t}", "@Test\n\tpublic void checkNumberOfDifferentRoutes() {\n\t\tassertEquals(Trains.numberDifferentRoutes(\"C\",\"C\",30), 7);\n\t}", "int getBlockLocationsCount();", "private void analyzeRoute(ArrayList<LatLng> route) {\n if (route == null) route = this.route;\n double runningDistance = 0;\n if (waypoints == null) waypoints = new Stack<>();\n\n ArrayList<LatLng> reverseRoute = new ArrayList<>();\n reverseRoute.addAll(route);\n Collections.reverse(reverseRoute);\n\n LatLng previousWaypoint = new LatLng(0, 0);\n Iterator<LatLng> it = reverseRoute.iterator();\n if (it.hasNext())\n previousWaypoint = it.next();\n\n mMap.addMarker(new MarkerOptions().position(previousWaypoint).title(\"Destination\").icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_GREEN)));\n\n while (it.hasNext()) {\n LatLng waypoint = it.next();\n double distance = directionsHelper.getDistanceInMeters(waypoint, previousWaypoint);\n runningDistance += distance;\n previousWaypoint = waypoint;\n waypoints.push(new Waypoint(waypoint.latitude, waypoint.longitude, runningDistance));\n }\n }", "int getIndexEndpointsCount();", "public List<Integer> getRoute(int start, int destination, Map<Transport, Integer> tickets) {\n\n List<Node<Integer>> nodes = graph.getNodes();\n //Initialisation\n Map<Node<Integer>, Double> unvisitedNodes = new HashMap<Node<Integer>, Double>();\n Map<Node<Integer>, Double> distances = new HashMap<Node<Integer>, Double>();\n Map<Node<Integer>, Node<Integer>> previousNodes = new HashMap<Node<Integer>, Node<Integer>>();\n Node<Integer> currentNode = graph.getNode(start);\n\n for (Node<Integer> node : nodes) {\n if (!currentNode.getIndex().equals(node.getIndex())) {\n distances.put(node, Double.POSITIVE_INFINITY);\n } else {\n distances.put(node, 0.0);\n }\n Integer location = node.getIndex();\n try {\n unvisitedNodes.put(node, (1/pageRank.getPageRank(location)));\n } catch (Exception e) {\n System.err.println(e);\n }\n previousNodes.put(node, null);\n }\n //Search through the graph\n while (unvisitedNodes.size() > 0) {\n Node<Integer> m = minDistance(distances, unvisitedNodes);\n if (m == null) break;\n currentNode = m;\n if (currentNode.getIndex().equals(destination)) break;\n unvisitedNodes.remove(currentNode);\n\n step(graph, distances, unvisitedNodes, currentNode, previousNodes, tickets);\n }\n\n //Move backwards finding the shortest route\n List<Integer> route = new ArrayList<Integer>();\n while (previousNodes.get(currentNode) != null) {\n route.add(0, currentNode.getIndex());\n currentNode = previousNodes.get(currentNode);\n }\n route.add(0, currentNode.getIndex());\n return route;\n }", "public List<String> displayNeighbours(String parolaInserita) {\n\t\t/*List<String> risultato=new ArrayList<String>();\n\t\t\n\t\tbackVisit=new HashMap<>();\n\t\t\n\t\t//creo l'iteratore\n\t\tGraphIterator<String, DefaultEdge>iterator=new DepthFirstIterator<>(this.grafo, parolaInserita);\n\t\t\n\t\t//aggiungo all'iteratore il listener\n\t\titerator.addTraversalListener(new Model.EdgeListenerParoleSimili());\n\t\t\n\t\tbackVisit.put(parolaInserita, null);//tutti i nodi hanno un padre, tranne la radice che ne ha zero\n\t\t\n\t\twhile(iterator.hasNext()) {\n\t\t\trisultato.add(iterator.next());\n\t\t}\n\t\t\n\t\treturn risultato;\n\t\t\n\t\t//System.err.println(\"displayNeighbours -- TODO\");\n\t\t//return new ArrayList<String>();*/\n\t\t\n\t\tif(parolaInserita.length()!=listWordsFixedLength.get(0).length()) {\n\t\t\tthrow new RuntimeException(\"La parola inserita ha un numero di lettere diverso dal numero inserito\\n\");\n\t\t}\n\t\tList<String>paroleVicine=new ArrayList<String>();\n\t\tparoleVicine.addAll(Graphs.neighborListOf(grafo, parolaInserita));\n\t\t\n\t\treturn paroleVicine;\n\t}", "public int size() {\n return trips.size();\n }", "private static void ajouterRoutes(List<Point> points) {\n long time = System.currentTimeMillis();\n Set<Point> ensPoints = new HashSet<>(points);\n for(Point p : points) {\n p.ajouterRoutes(ensPoints);\n // Supposons que l'on essaye d'ajouter plusieurs fois les memes destinations ...\n p.ajouterRoutes(ensPoints);\n p.ajouterRoutes(ensPoints);\n }\n long deltaTime = System.currentTimeMillis() - time;\n System.out.println(\"Les routes sont ajoutées en \"+deltaTime+\" ms\");\n }", "public static int numberOfStops() {\n return getAllStops().size();\n }", "public int getTotalRouteCost() {\n return totalRouteCost;\n }", "public ArrayList<Integer> path(int startVertex, int stopVertex) {\n// you supply the body of this method\n int start = startVertex;\n int stop = stopVertex;\n int previous;\n ArrayList<Integer> list = new ArrayList<>();\n HashMap<Integer, Integer> route = new HashMap<>();\n Stack<Integer> visited = new Stack<>();\n Stack<Integer> reverse = new Stack<>();\n int parent;\n if(!pathExists(startVertex,stopVertex)){\n return new ArrayList<Integer>();\n }\n else if(startVertex == stopVertex){\n list.add(startVertex);\n return list;\n }\n else{\n while(!neighbors(start).contains(stopVertex)){\n List neighbor = neighbors(start);\n for (Object a: neighbor) {\n if(!pathExists((int)a,stopVertex)){\n continue;\n }\n if(visited.contains(a)){\n continue;\n }\n else {\n route.put((int) a, start);\n visited.push(start);\n start = (int) a;\n break;\n }\n }\n }\n route.put(stopVertex,start);\n list.add(stopVertex);\n previous = route.get(stopVertex);\n list.add(previous);\n while(previous!=startVertex){\n int temp = route.get(previous);\n list.add(temp);\n previous = temp;\n }\n for(int i=0; i<list.size(); i++){\n reverse.push(list.get(i));\n }\n int i=0;\n while(!reverse.empty()){\n int temp = reverse.pop();\n list.set(i,temp);\n i++;\n }\n//list.add(startVertex);\n return list;\n }\n }", "public String[] getRoutes() {\n\t\treturn routes;\r\n\t}", "public String printRouteStops()\r\n {\r\n String route_output = \"-> \";\r\n for (Stop s : stops_map)\r\n {\r\n route_output = route_output + s.getId() + \" ->\";\r\n }\r\n\r\n return route_output;\r\n }", "public void roadList(){\n for(int i = 0; i < roads.size(); i++){\n System.out.println(i + \" \" + roads.get(i).start.getCityName() + \", \" + roads.get(i).end.getCityName());\n }\n }", "public int getNumOfPath(){\r\n\t\treturn numOfPath;\r\n\t}", "@GetMapping(\"/route/list\")\n public String allRoutesPage() {\n return \"admin/route_list\";\n }", "public ArrayList getRoutes(){\r\n ArrayList routeDataList = new ArrayList();\r\n Cursor getData = getReadableDatabase().rawQuery(\"select _id, route_long_name from routes\", null);\r\n // Make sure to begin at the first element of the returned data\r\n getData.moveToFirst();\r\n while (getData.moveToNext()){\r\n routeDataList.add(getData.getString(1));\r\n }\r\n\r\n getData.close();\r\n\r\n return routeDataList;\r\n }", "private void generateRoute(String json) {\n try {\n JSONObject jsonObject = new JSONObject(json);\n JSONArray routes = jsonObject.optJSONArray(\"routes\");\n if (null == routes || routes.length() == 0) {\n return;\n }\n JSONObject route = routes.getJSONObject(0);\n // get route bounds\n JSONObject bounds = route.optJSONObject(\"bounds\");\n if (null != bounds && bounds.has(\"southwest\") && bounds.has(\"northeast\")) {\n JSONObject southwest = bounds.optJSONObject(\"southwest\");\n JSONObject northeast = bounds.optJSONObject(\"northeast\");\n assert southwest != null;\n LatLng sw = new LatLng(southwest.optDouble(\"lat\"), southwest.optDouble(\"lng\"));\n assert northeast != null;\n LatLng ne = new LatLng(northeast.optDouble(\"lat\"), northeast.optDouble(\"lng\"));\n mLatLngBounds = new LatLngBounds(sw, ne);\n }\n // get paths\n JSONArray paths = route.optJSONArray(\"paths\");\n assert paths != null;\n for (int i = 0; i < paths.length(); i++) {\n JSONObject path = paths.optJSONObject(i);\n List<LatLng> mPath = new ArrayList<>();\n JSONArray steps = path.optJSONArray(\"steps\");\n distanceText = path.getString(\"distanceText\");\n durationText = path.getString(\"durationText\");\n assert steps != null;\n for (int j = 0; j < steps.length(); j++) {\n JSONObject step = steps.optJSONObject(j);\n JSONArray polyline = step.optJSONArray(\"polyline\");\n assert polyline != null;\n for (int k = 0; k < polyline.length(); k++) {\n if (j > 0 && k == 0) {\n continue;\n }\n JSONObject line = polyline.getJSONObject(k);\n double lat = line.optDouble(\"lat\");\n double lng = line.optDouble(\"lng\");\n LatLng latLng = new LatLng(lat, lng);\n mPath.add(latLng);\n }\n }\n mPaths.add(i, mPath);\n }\n mHandler.sendEmptyMessage(ROUTE_PLANNING_SUCCESS);\n } catch (JSONException e) {\n }\n }", "@Override\n\tpublic int getNbClients() {\n\t\t// TODO Auto-generated method stub\n\t\tint nbClients=0;\n\t\tfor (ArrayList<TC> quantite : salle.values()) {\t\t//On parcours l'ensemble de la liste pour connaître à chaque tour de\n\t\t\tnbClients += quantite.size();\t\t\t\t\t//boucle le nombre de personne prioritaire.\n\t\t}\n\t\treturn nbClients;\n\t\t\n\t\t// on cherche a donner le nombre de clients dans la salle à l'instant T, pour ce faire on fait la somme de la taille de chaque file d'attente \n// int res=0;\n// for(int i=0;i<maxPrio;i++) {\n// res += salle.get(i).size(); // on fait un get sur la salle d'indice i (correspondant a 1 niveau de priorité) ce qui rend l'ArrayList puis on prend la size de ce get. \n// }\n\t}", "public int getNumRoads() {\n \t\treturn roads.size();\n \t}", "public List<Tile> getRoute() {\n List<Tile> currentRoute = new ArrayList<Tile>();\n for (int i = 0; i < route.size(); i++) {\n currentRoute.add(route.get(i));\n }\n return currentRoute;\n }", "@Override\r\n\tpublic int getNumberOfNodes() {\r\n\t\tint contador = 0;// Contador para el recursivo\r\n\t\treturn getNumberOfNodesRec(contador, raiz);\r\n\t}", "static int displayN(Node node)\r\n {\r\n return node.neighbors.size();\r\n }", "@Test\r\n void findRouteSameLine() {\r\n List<Station> route = model.findRoute(1, 20);\r\n assertNotNull(route);\r\n assertEquals(6, route.size());\r\n assertEquals(\"OakGrove\", route.get(0).getName());\r\n assertEquals(\"NorthStation\", route.get(5).getName());\r\n }", "public Collection<Route> getRoutes() {\n Iterator<KeyValuePair<Route>> it =\n routeTable.getKeyValuePairsForKeysStartingWith(\"\").iterator();\n\n List<Route> routes = new LinkedList<>();\n\n while (it.hasNext()) {\n KeyValuePair<Route> entry = it.next();\n routes.add(entry.getValue());\n }\n\n return routes;\n }", "List<Route> getDirectRoutes(String departure, String arrival);", "public List<Route> getRoutes() {\n // use Optional to prevent returning a null list.\n HttpHeaders headers = new HttpHeaders();\n headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON));\n HttpEntity<String> entity = new HttpEntity<String>(headers);\n String response =\n restTemplate.exchange(BASE_URL_ROUTES, HttpMethod.GET, entity, String.class).getBody();\n\n List<Route> results = new ArrayList<>();\n try {\n results = parse(response);\n } catch (IOException e) {\n e.printStackTrace();\n }\n final List<Route> finalResults = Optional.ofNullable(results).orElseGet(ArrayList::new);\n return finalResults;\n }", "int getTransitFlightsCount();", "public static void calculate(Route pRoute)\r\n {\r\n //System.out.println(pRoute.size());\r\n for(int i=0; i<pRoute.size()-1; i++)\r\n {\r\n pRoute.addLeg(calculateLeg(pRoute.getWaypoint(i),pRoute.getWaypoint(i+1),pRoute.getSpeed())); \r\n }\r\n }", "public int getPathCount() {\n return path_.size();\n }", "@GET(\"/routecollection/{startLocation}\")\n void getRoutes(@Path(\"startLocation\")String startLocation, Callback<Routes> routes);", "public void calculateRoute() {\n SKRouteSettings route = new SKRouteSettings();\n route.setStartCoordinate(start);\n route.setDestinationCoordinate(end);\n route.setNoOfRoutes(1);\n switch (routingType) {\n case SHORTEST:\n route.setRouteMode(SKRouteSettings.SKRouteMode.BICYCLE_SHORTEST);\n break;\n case FASTEST:\n route.setRouteMode(SKRouteSettings.SKRouteMode.BICYCLE_FASTEST);\n break;\n case QUIET:\n route.setRouteMode(SKRouteSettings.SKRouteMode.BICYCLE_QUIETEST);\n break;\n }\n route.setRouteExposed(true);\n SKRouteManager.getInstance().calculateRoute(route);\n }", "public int getPathCount() {\n return path_.size();\n }", "public java.util.List<java.util.AbstractMap.SimpleImmutableEntry<Street,Stop>> getRoute()\r\n {\r\n List<java.util.AbstractMap.SimpleImmutableEntry<Street,Stop>> roads_map = new ArrayList<java.util.AbstractMap.SimpleImmutableEntry<Street,Stop>>();\r\n java.util.AbstractMap.SimpleImmutableEntry<Street,Stop> entry = new java.util.AbstractMap.SimpleImmutableEntry<Street,Stop>(null, null);\r\n\r\n for (Street s : streets_map)\r\n {\r\n if (s.getStops().isEmpty() == false)\r\n {\r\n for (int i = 0; i < s.getStops().size(); i++)\r\n {\r\n entry = new java.util.AbstractMap.SimpleImmutableEntry<Street,Stop>(s,s.getStops().get(i));\r\n }\r\n\r\n }\r\n else\r\n {\r\n entry = new java.util.AbstractMap.SimpleImmutableEntry<Street,Stop>(s,null);\r\n }\r\n\r\n roads_map.add(entry);\r\n\r\n }\r\n\r\n return roads_map;\r\n\r\n }", "Set<McastRoute> getRoutes();", "@Test\r\n void findRouteDifferentLine() {\r\n List<Station> route = model.findRoute(9, 60);\r\n assertNotNull(route);\r\n assertEquals(10, route.size());\r\n assertEquals(\"SuffolkDowns\", route.get(0).getName());\r\n assertEquals(\"Broadway\", route.get(9).getName());\r\n }", "private static List<Element> getXMLStaticRoutes(Model model) {\n Set<StaticRoute> routes = new TreeSet<>(Comparators.objectsById());\n routes.addAll(model.getStaticRoutes(null));\n List<Element> result = new ArrayList<>(routes.size());\n for (StaticRoute curRoute : routes) {\n Element routeElement = new Element(\"staticRoute\");\n routeElement.setAttribute(\"id\", String.valueOf(curRoute.getId()));\n routeElement.setAttribute(\"name\", curRoute.getName());\n for (TCSObjectReference<Point> curRef : curRoute.getHops()) {\n Element hopElement = new Element(\"hop\");\n hopElement.setAttribute(\"name\", curRef.getName());\n routeElement.addContent(hopElement);\n }\n for (Map.Entry<String, String> curEntry\n : curRoute.getProperties().entrySet()) {\n Element propertyElement = new Element(\"property\");\n propertyElement.setAttribute(\"name\", curEntry.getKey());\n propertyElement.setAttribute(\"value\", curEntry.getValue());\n routeElement.addContent(propertyElement);\n }\n result.add(routeElement);\n }\n return result;\n }", "private List<RouteInfo> createList() {\r\n\r\n List<RouteInfo> results = new ArrayList<>();\r\n\r\n for (String temp [] : stops) {\r\n\r\n RouteInfo info = new RouteInfo();\r\n info.setTitle(temp[0]);\r\n info.setRouteName(\"Stop ID: \" + temp[1]);\r\n info.setRouteDescription(\"Next bus at: \");\r\n results.add(info);\r\n }\r\n\r\n return results;\r\n }", "public List<Route> getRoutes(){\n return routeDAO.findAll();\n }", "public ArrayList<String> getNodeRouteList(String code);", "public int ListLength(){\n int j = 0;\n // Get index of the first element with value\n int i = StaticLinkList[MAXSIZE-1].cur;\n while (i!=0)\n {\n i = StaticLinkList[i].cur;\n j++;\n }\n return j;\n }", "@Override\n\tpublic List<Route> listAllRoutes() {\n\t\tConnection con = null;\n\t\tList<Route> routes = new ArrayList<Route>();\n\t\ttry {\n\t\t\tcon = getMySqlConnection();\n\t\t\tCallableStatement callableStatement = con\n\t\t\t\t\t.prepareCall(\"call listAllRoutes()\");\n\t\t\tcallableStatement.executeQuery();\n\n\t\t\tResultSet result = callableStatement.getResultSet();\n\t\t\twhile (result.next()) {\n\t\t\t\tRoute route = new Route();\n\t\t\t\troute.setRouteId(result.getLong(1));\n\t\t\t\troute.setFromCity(new City(result.getString(2)));\n\t\t\t\troute.setToCity(new City(result.getString(3)));\n\t\t\t\troute.getFromCity().setCityId(result.getLong(4));\n\t\t\t\troute.getToCity().setCityId(result.getLong(5));\n\t\t\t\troutes.add(route);\n\t\t\t}\n\n\t\t} catch (SQLException s) {\n\t\t\ts.printStackTrace();\n\n\t\t} catch (ClassNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn routes;\n\t}", "public Graph runNumberOfPathThroughAnyLink(AdjacencyMatrix m){\r\n\t\tGraph graph = new Graph(m);\r\n\t\treturn PathCount.getNumberOfPathThroughAnyLink(graph);\r\n\t}", "public List<BaggageRoute> getBaggageRoutes(BaggageProcessor processor);", "int getNumSegments();", "private void QueryDirections() {\n\t\tshowProgress(true, \"正在搜索导航路线...\");\n\t\t// Spawn the request off in a new thread to keep UI responsive\n\t\tfor (final FloorInfo floorInfo : floorList) {\n\t\t\tif (floorInfo.getPoints() != null\n\t\t\t\t\t&& floorInfo.getPoints().length >= 2) {\n\n\t\t\t\tThread t = new Thread() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t// Start building up routing parameters\n\t\t\t\t\t\t\tRouteTask routeTask = RouteTask\n\t\t\t\t\t\t\t\t\t.createOnlineRouteTask(\n\t\t\t\t\t\t\t\t\t\t\tfloorInfo.getRouteServerPath(),\n\t\t\t\t\t\t\t\t\t\t\tnull);\n\n\t\t\t\t\t\t\tRouteParameters rp = routeTask\n\t\t\t\t\t\t\t\t\t.retrieveDefaultRouteTaskParameters();\n\t\t\t\t\t\t\tNAFeaturesAsFeature rfaf = new NAFeaturesAsFeature();\n\t\t\t\t\t\t\t// Convert point to EGS (decimal degrees)\n\t\t\t\t\t\t\t// Create the stop points (start at our location, go\n\t\t\t\t\t\t\t// to pressed location)\n\t\t\t\t\t\t\t// StopGraphic point1 = new StopGraphic(mLocation);\n\t\t\t\t\t\t\t// StopGraphic point2 = new StopGraphic(p);\n\t\t\t\t\t\t\trfaf.setFeatures(floorInfo.getPoints());\n\t\t\t\t\t\t\trfaf.setCompressedRequest(true);\n\t\t\t\t\t\t\trp.setStops(rfaf);\n\n\t\t\t\t\t\t\t// Set the routing service output SR to our map\n\t\t\t\t\t\t\t// service's SR\n\t\t\t\t\t\t\trp.setOutSpatialReference(wm);\n\t\t\t\t\t\t\trp.setFindBestSequence(true);\n\t\t\t\t\t\t\trp.setPreserveFirstStop(true);\n\t\t\t\t\t\t\tif (floorInfo.getEndPoint() != null) {\n\t\t\t\t\t\t\t\trp.setPreserveLastStop(true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Solve the route and use the results to update UI\n\t\t\t\t\t\t\t// when received\n\t\t\t\t\t\t\tfloorInfo.setRouteResult(routeTask.solve(rp));\n\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\tmException = e;\n\t\t\t\t\t\t\t// mHandler.post(mUpdateResults);\n\t\t\t\t\t\t}\n\t\t\t\t\t\trouteIndex++;\n\t\t\t\t\t\tif (routeIndex >= routeCount) {\n\t\t\t\t\t\t\tmHandler.post(mSetCheckMap);\n\t\t\t\t\t\t\tmHandler.post(mUpdateResults);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\t// Start the operation\n\t\t\t\tt.start();\n\t\t\t}\n\t\t}\n\n\t}", "public int getActiveRunwaysCount();", "private void createRoutes(Scenario scenario, LeastCostPathCalculator router, int numOrigins) {\n\t\tfor (int i = 0; i < numOrigins; i++) {\n\t\t\tfor (int j = 0; j < numOrigins; j++) {\n\t\t\t\tRoute route;\n\t\t\t\tif (i == j) {\n\t\t\t\t\tId<Link> fromLinkId = Id.create(startLinkIds[i], Link.class);\n\t\t\t\t\tId<Link> toLinkId = fromLinkId;\n\t\t\t\t\t\n\t\t\t\t\troute = new LinkNetworkRouteFactory().createRoute(fromLinkId, toLinkId);\n\t\t\t\t\troute.setDistance(0.0);\n\t\t\t\t\troute.setTravelTime(0.0);\n\t\t\t\t} else {\n\t\t\t\t\tId<Link> fromLinkId = Id.create(startLinkIds[i], Link.class);\n\t\t\t\t\tId<Link> toLinkId = Id.create(endLinkIds[j], Link.class);\n\t\t\t\t\tLink fromLink = scenario.getNetwork().getLinks().get(fromLinkId);\n\t\t\t\t\tLink toLink = scenario.getNetwork().getLinks().get(toLinkId);\n\t\t\t\t\t\t\t\n\t\t\t\t\tPath path = router.calcLeastCostPath(fromLink.getToNode(), toLink.getFromNode(), 0.0, null, null);\n\t\t\t\t\troute = new LinkNetworkRouteFactory().createRoute(fromLinkId, toLinkId);\n\t\t\t\t\t\n\t\t\t\t\tdouble distance = RouteUtils.calcDistance((NetworkRoute) route, scenario.getNetwork());\n\t\t\t\t\troute.setDistance(distance);\n\t\t\t\t\troute.setTravelTime(path.travelTime);\n\n\t\t\t\t\t((NetworkRoute) route).setLinkIds(fromLink.getId(), NetworkUtils.getLinkIds(path.links), toLink.getId());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\troutes.put(startLinkIds[i] + \"_\" + endLinkIds[j], route);\n\t\t\t\t\n\t\t\t\tprintRoute(scenario, route, startLinkIds[i], endLinkIds[j]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// fix bad routes\n\t\tString routeString;\n\t\tString[] links;\n\t\tList<Id<Link>> linkIds;\n\t\tNetworkRoute networkRoute;\n\t\t\t\n\t\trouteString = \"17560000130806FT_17560000126838FT\";\n\t\t//17560000130806FT - start link \n\t\t//17560000126838FT - end link \n\t\tlinks = new String[]{\"17560001813912FT\", \"17560001813913FT\", \"17560002100968FT\", \"17560000122288FT\", \"17560000122328FT\",\n\t\t\t\t\"17560001368986TF\", \"17560001786482TF\", \"17560001862499FT\", \"17560000125722FT\", \"17560001812124FT\", \"17560002102719FT\",\n\t\t\t\t\"17560001838515FT\", \"17560001984994FT\", \"17560001984995FT\", \"17560001812144FT\", \"17560001834645FT\", \"17560000126288FT\",\n\t\t\t\t\"17560002102725FT\", \"17560002102726FT\", \"17560001368914FT\", \"17560001368915FT\", \"17560001846187FT\"};\n\t\tlinkIds = new ArrayList<Id<Link>>();\n\t\tfor (String link : links) linkIds.add(Id.create(link, Link.class));\n\t\tnetworkRoute = (NetworkRoute) routes.get(routeString);\n\t\tnetworkRoute.setLinkIds(networkRoute.getStartLinkId(), linkIds, networkRoute.getEndLinkId());\n\t}", "public int getWaypointsCount() {\n if (waypointsBuilder_ == null) {\n return waypoints_.size();\n } else {\n return waypointsBuilder_.getCount();\n }\n }", "public java.math.BigInteger getFrequencyOfRoute() {\r\n return frequencyOfRoute;\r\n }", "int getLinksCount();", "public int getPathsCount() {\n return paths_.size();\n }", "void onSucceedFindDirection(List<RouteBeetweenTwoPointsDTO> route);", "private Vector<Route> getRouteRelieAVille(Ville ville){\n\t\tVector<Route> tmp = new Vector<Route>();\n\t\tfor(Route v : routes)\n\t\t\tif(v != null)\n\t\t\t\tif(v.ville1.equals(ville) || v.ville2.equals(ville))\n\t\t\t\t\ttmp.add(v);\n\t\treturn tmp;\n\t}", "public Route parseRoutes(JSONObject jObject) {\n //Route route = new Route();\n List<Route> routeList = new ArrayList<>();\n //List<String> polylines = new ArrayList<>();\n List<List<HashMap<String, String>>> routes = new ArrayList<>();\n JSONArray jRoutes;\n JSONArray jLegs;\n JSONArray jSteps;\n\n try {\n\n jRoutes = jObject.getJSONArray(\"routes\");\n /** Traversing all routes */\n for (int i = 0; i < jRoutes.length(); i++) {\n Route route = new Route();\n routeList.add(route);\n\n JSONObject boundsObj = ((JSONObject) jRoutes.get(i)).getJSONObject(\"bounds\");\n JSONObject norteastObj = boundsObj.getJSONObject(\"northeast\");\n JSONObject southwestObj = boundsObj.getJSONObject(\"southwest\");\n LatLng norteast = new LatLng(norteastObj.getDouble(\"lat\"), norteastObj.getDouble(\"lng\"));\n LatLng southwest = new LatLng(southwestObj.getDouble(\"lat\"), southwestObj.getDouble(\"lng\"));\n List<LatLng> bounds = new ArrayList<>();\n bounds.add(norteast);\n bounds.add(southwest);\n route.setBounds(bounds);\n\n jLegs = ((JSONObject) jRoutes.get(i)).getJSONArray(\"legs\");\n\n List path = new ArrayList<>();\n List<Leg> legs = new ArrayList<>();\n route.setLegs(legs);\n\n /** Traversing all legs */\n for (int j = 0; j < jLegs.length(); j++) {\n JSONObject jLeg = (JSONObject) jLegs.get(j);\n JSONObject distanceObj = jLeg.getJSONObject(\"distance\");\n JSONObject durationObj = jLeg.getJSONObject(\"distance\");\n JSONObject startLocObj = jLeg.getJSONObject(\"start_location\");\n JSONObject endLocObj = jLeg.getJSONObject(\"end_location\");\n\n TextValue distance = new TextValue(distanceObj.getString(\"text\"), distanceObj.getString(\"value\"));\n TextValue duration = new TextValue(durationObj.getString(\"text\"), durationObj.getString(\"value\"));\n LatLng startLocation = new LatLng(startLocObj.getDouble(\"lat\"), startLocObj.getDouble(\"lng\"));\n LatLng endLocation = new LatLng(endLocObj.getDouble(\"lat\"), endLocObj.getDouble(\"lng\"));\n\n route.setDistance(distance);\n route.setDuration(duration);\n Leg leg = new Leg();\n legs.add(leg);\n leg.setDistance(distance);\n leg.setDuration(duration);\n leg.setStart_location(startLocation);\n leg.setEnd_location(endLocation);\n\n jSteps = jLeg.getJSONArray(\"steps\");\n List<Step> steps = new ArrayList<>();\n leg.setSteps(steps);\n\n /** Traversing all steps */\n for (int k = 0; k < jSteps.length(); k++) {\n Step step = new Step();\n steps.add(step);\n\n JSONObject jStep = (JSONObject) jSteps.get(k);\n JSONObject distanceObjS = jStep.getJSONObject(\"distance\");\n JSONObject durationObjS = jStep.getJSONObject(\"distance\");\n JSONObject startLocObjS = jStep.getJSONObject(\"start_location\");\n JSONObject endLocObjS = jStep.getJSONObject(\"end_location\");\n\n TextValue distanceS = new TextValue(distanceObjS.getString(\"text\"), distanceObjS.getString(\"value\"));\n TextValue durationS = new TextValue(durationObjS.getString(\"text\"), durationObjS.getString(\"value\"));\n LatLng startLocationS = new LatLng(startLocObjS.getDouble(\"lat\"), startLocObjS.getDouble(\"lng\"));\n LatLng endLocationS = new LatLng(endLocObjS.getDouble(\"lat\"), endLocObjS.getDouble(\"lng\"));\n\n step.setDistance(distanceS);\n step.setDuration(durationS);\n step.setStart_location(startLocationS);\n step.setEnd_location(endLocationS);\n\n String polyline = \"\";\n polyline = (String) ((JSONObject) ((JSONObject) jSteps.get(k)).get(\"polyline\")).get(\"points\");\n step.setPolyline(polyline);\n path.addAll(step.getPath());\n /*List<LatLng> list = decodePoly(polyline);\n\n /** Traversing all points /\n for(int l=0;l<list.size();l++){\n HashMap<String, String> hm = new HashMap<>();\n hm.put(\"lat\", Double.toString((list.get(l)).latitude) );\n hm.put(\"lng\", Double.toString((list.get(l)).longitude) );\n path.add(hm);\n }*/\n }\n routes.add(path);\n }\n route.setRoutes(routes);\n }\n } catch (JSONException e) {\n e.printStackTrace();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return getBestRoute(routeList);\n }", "public java.util.List getWaypoints();", "public int get_nr_of_segments() {\n return nr_of_segments;\n }", "public static int count() {\n return segmentList.size();\n }", "public int claimPoints() {\n return Constants.ROUTE_CLAIM_POINTS.get(length);\n }", "public Graph runNumberOfPathThroughAnyNode(AdjacencyMatrix m){\r\n\t\tGraph graph = new Graph(m);\r\n\t\treturn PathCount.getNumberOfPathThroughAnyNode(graph);\t\r\n\t}", "public int getPathsCount() {\n return paths_.size();\n }", "public int getNumberInboundStops(){\n\t \treturn 0;\n\t \t\n\t }", "public ArrayList<String> transportLinePathIDs()\r\n {\r\n Coordinate next_street1 = null;\r\n Coordinate next_street2 = null;\r\n Street next_street = null;\r\n ArrayList<String> line_coordinates_ids = new ArrayList<String>();\r\n\r\n for (int i = 0; i < getStreetsMap().size(); i++)\r\n {\r\n Street s = getStreetsMap().get(i);\r\n Coordinate this_street1 = s.getCoordinates().get(0);\r\n Coordinate this_street2 = s.getCoordinates().get(2);\r\n\r\n if (i + 1 < getStreetsMap().size())\r\n {\r\n next_street = getStreetsMap().get(i+1);\r\n next_street1 = next_street.getCoordinates().get(0);\r\n next_street2 = next_street.getCoordinates().get(2);\r\n }\r\n else\r\n {\r\n break;\r\n }\r\n\r\n for (Stop stop : getStopsMap())\r\n {\r\n if (stop.getStreet().equals(s))\r\n {\r\n line_coordinates_ids.add(stop.getId());\r\n }\r\n }\r\n\r\n if (s.getCoordinates().get(1) != null)\r\n {\r\n line_coordinates_ids.add(s.getId());\r\n }\r\n\r\n //11\r\n if (this_street1.getX() == next_street1.getX() && this_street1.getY() == next_street1.getY())\r\n {\r\n line_coordinates_ids.add(s.getId());\r\n }\r\n //12\r\n else if (this_street1.getX() == next_street2.getX() && this_street1.getY() == next_street2.getY())\r\n {\r\n line_coordinates_ids.add(s.getId());\r\n }\r\n // 21\r\n else if (this_street2.getX() == next_street1.getX() && this_street2.getY() == next_street1.getY())\r\n {\r\n line_coordinates_ids.add(s.getId());\r\n }\r\n //22\r\n else if (this_street2.getX() == next_street2.getX() && this_street2.getY() == next_street2.getY())\r\n {\r\n line_coordinates_ids.add(s.getId());\r\n }\r\n }\r\n\r\n line_coordinates_ids.add(getStopsMap().get(getStopsMap().size()-1).getId());\r\n return line_coordinates_ids;\r\n }", "private List<Point> getPath(int index) {\n\t\t \n\t \n\t\t Node fromNode = oEdge.fromNode;\n\t\t Node toNode = oEdge.toNode;\n\t\t float x1 = fromNode.longitude;\n\t\t float x2 = toNode.longitude;\n\t\t float y1 = fromNode.latitude;\n\t\t float y2 = toNode.latitude;\n\t\t double slope, angle;\n\t\t if(x1!=x2) {\n\t\t\t slope = (y2-y1)/(x2-x1);\n\t\t\t \tangle = Math.atan(slope);\n\t\t\t \t} else {\n\t\t\t \t\tangle = Math.PI/2;\n\t\t\t \t}\n\t\t Double L = Math.sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));\n\t\t float offsetPixels=0;\n\t\t if(Math.toDegrees(angle)>Math.toDegrees(90)) {\n\t\t\t if (index==0){\n\t\t\t\t offsetPixels=roadWidth*6/10;\n\t\t\t }\n\t\t\t else if(index==1){\n\t\t\t\t offsetPixels=roadWidth*11/10;\n\t\t\t }\n\t\t\t else if(index==-1){\n\t\t\t\t offsetPixels=roadWidth*1/10;\n\t\t\t }\n\t\t\t \n\t\t } else {\n\t\t\t \n\t\t\t if (index==0){\n\t\t\t\t offsetPixels=-roadWidth*6/10;\n\t\t\t }\n\t\t\t else if(index==1){\n\t\t\t\t offsetPixels=-roadWidth*11/10;\n\t\t\t }\n\t\t\t else if(index==-1){\n\t\t\t\t offsetPixels=-roadWidth*1/10;\n\t\t\t }\n\t\t }\n\t\t \n\t\t // This is the first parallel line\n\t\t float x1p1 = x1 + offsetPixels * (y2-y1) / L.floatValue();\n\t\t float x2p1 = x2 + offsetPixels * (y2-y1) / L.floatValue();\n\t\t float y1p1 = y1 + offsetPixels * (x1-x2) / L.floatValue();\n\t\t float y2p1 = y2 + offsetPixels * (x1-x2) / L.floatValue();\n//\t\t if(oEdge.edgeID==16) {\n//\t\t\t System.out.println(\"testing\");\n//\t\t }\n\t\t \n\t\t Point P1 = new Point(x1p1,y1p1);\n\t\t Point P2 = new Point(x2p1,y2p1);\n\t\t List<Point> gP = GetPoints(P1, P2);\n\t\t return gP;\n\t \n\t}", "public Collection<Route> getRoutesForNextHop(IpAddress ip) {\n return routes.values()\n .stream()\n .filter(route -> route.nextHop().equals(ip))\n .collect(Collectors.toSet());\n }", "int sizeOfLanesArray();", "public List<String> displayNeighbours(String parolaInserita) {\n\t\tList<String> resultString = new ArrayList<String>();\n\t\tSet<DefaultEdge> result = grafo.edgesOf(parolaInserita);\n\t\tfor(DefaultEdge tmp : result) {\n\t\t\tresultString.add(tmp.toString());\n\t\t}\n\t\treturn resultString;\n\t}", "public void testRoute() {\r\n\t\tLog.i(\"JUNIT\", \"Routing test started\");\r\n\t\t// create route with known points\r\n\t\tRoute pr = new Route(new GeoLocation(49.904005, 10.859725),\r\n\t\t\t\tnew GeoLocation(49.902637, 10.870646));\r\n\t\tList<GeoLocation> listLocations = new LinkedList<GeoLocation>();\r\n\t\t// retrieve path\r\n\t\tlistLocations = pr.getPath();\r\n\r\n\t\t// check maneuver count == 7\r\n\t\t// assertEquals(listLocations.size(),7);\r\n\t\tassertTrue(listLocations.size() > 0);\r\n\t}", "public List<RouteDTO> viewRouteDetails() throws FRSException\r\n\t{\n\t\treturn dao.getRouteList();\r\n\t}", "public void dfs(int startV,int end, double maxCost, double maxHops,LinkedList<Edge>[] routes,double cost,double distance,double hops,int totRoutes,LinkedList<Edge>edges) {\n marked[startV] = true;\n if(startV == end){\n Routes newRo = new Routes(hops,cost,distance, edges);\n finRoutes.add(newRo);\n return; \n }\n\n if(hops<maxHops){\n for (Edge w : adj(startV)) {\n //System.out.println(w.toString());\n //if(startV==w.other(w.either()))\n int e = w.other(w.either());\n int v =w.either();\n int next;\n\n if(startV == e)\n next=v;\n else next =e;\n if(!marked[next]) {\n double nc = cost + w.cost();\n if(nc<=maxCost){\n hops++;\n //routes[totRoutes].add(w);\n edges.add(w);\n //distance+=w.distance();\n double nd = distance+w.distance();\n //dfs(next,end,maxCost,maxHops,routes,cost,distance,hops,totRoutes,edges);\n dfs(next,end,maxCost,maxHops,routes,nc,nd,hops,totRoutes,edges);\n \n marked[next]=false;\n hops--;\n //if(routes[totRoutes].size()>0)\n // routes[totRoutes].remove(routes[totRoutes].size()-1);\n if(edges.size()>0)\n edges.remove(edges.size()-1);\n }\n //edgeTo[w.either()] = startV;\n //dfs( startV);\n \n }\n }\n }\n \n }", "private String printRoute(Rota r) {\n StringBuilder s = new StringBuilder();\n\n for (String d : r.getPontos()) {\n s.append(d + \"->\");\n }\n s = s.replace(s.length() - 2, s.length(), \".\");\n\n return s.toString();\n }", "public int numberOfSegments() {\n return segments.size();\n }", "public ArrayList<Coordinate> transportLinePath()\r\n {\r\n Coordinate next_street1 = null;\r\n Coordinate next_street2 = null;\r\n Street next_street = null;\r\n ArrayList<Coordinate> line_coordinates = new ArrayList<Coordinate>();\r\n\r\n for (int i = 0; i < getStreetsMap().size(); i++)\r\n {\r\n Street s = getStreetsMap().get(i);\r\n Coordinate this_street1 = s.getCoordinates().get(0);\r\n Coordinate this_street2 = s.getCoordinates().get(2);\r\n\r\n if (i + 1 < getStreetsMap().size())\r\n {\r\n next_street = getStreetsMap().get(i+1);\r\n next_street1 = next_street.getCoordinates().get(0);\r\n next_street2 = next_street.getCoordinates().get(2);\r\n }\r\n else\r\n {\r\n break;\r\n }\r\n\r\n for (Stop stop : getStopsMap())\r\n {\r\n if (stop.getStreet().equals(s))\r\n {\r\n line_coordinates.add(stop.getCoordinate());\r\n }\r\n }\r\n\r\n if (s.getCoordinates().get(1) != null)\r\n {\r\n line_coordinates.add(s.getCoordinates().get(1));\r\n }\r\n\r\n //11\r\n if (this_street1.getX() == next_street1.getX() && this_street1.getY() == next_street1.getY())\r\n {\r\n line_coordinates.add(this_street1);\r\n }\r\n //12\r\n else if (this_street1.getX() == next_street2.getX() && this_street1.getY() == next_street2.getY())\r\n {\r\n line_coordinates.add(this_street1);\r\n }\r\n // 21\r\n else if (this_street2.getX() == next_street1.getX() && this_street2.getY() == next_street1.getY())\r\n {\r\n line_coordinates.add(this_street2);\r\n }\r\n //22\r\n else if (this_street2.getX() == next_street2.getX() && this_street2.getY() == next_street2.getY())\r\n {\r\n line_coordinates.add(this_street2);\r\n }\r\n\r\n }\r\n\r\n line_coordinates.add(getStopsMap().get(getStopsMap().size()-1).getCoordinate());\r\n return line_coordinates;\r\n }", "public int getNumGruppoPacchetti();", "int getNodesCount();", "int getNodesCount();" ]
[ "0.7344507", "0.67442375", "0.66906637", "0.6282351", "0.61354613", "0.6132629", "0.61264163", "0.6064359", "0.60592264", "0.60445994", "0.59669465", "0.59381", "0.59231687", "0.59070367", "0.5900045", "0.5887882", "0.58210456", "0.58112574", "0.5801249", "0.579351", "0.577355", "0.5748106", "0.57273513", "0.57241625", "0.57209027", "0.5719818", "0.5708178", "0.5675141", "0.56538266", "0.56517416", "0.5638885", "0.56383723", "0.5631794", "0.56057256", "0.55738384", "0.5569801", "0.5569234", "0.5558349", "0.5552721", "0.55494446", "0.5545847", "0.5545506", "0.5540613", "0.554025", "0.5540109", "0.553882", "0.5520642", "0.55181247", "0.55181116", "0.5516858", "0.5513209", "0.55126876", "0.5502409", "0.55019206", "0.55018157", "0.54978544", "0.54950136", "0.5487954", "0.5455848", "0.5452889", "0.5450099", "0.54481465", "0.54469234", "0.5445872", "0.5439207", "0.54362386", "0.5428069", "0.54271334", "0.5426934", "0.5425442", "0.5417802", "0.54032403", "0.5398971", "0.5376106", "0.5366608", "0.53636515", "0.53501534", "0.53404814", "0.5336177", "0.5320986", "0.53163075", "0.5313793", "0.5313546", "0.53111565", "0.5304701", "0.5301657", "0.5300579", "0.52983594", "0.52870816", "0.5287012", "0.52855116", "0.52788204", "0.527672", "0.5265507", "0.5263799", "0.5255662", "0.5254387", "0.52510375", "0.52463526", "0.52463526" ]
0.7710266
0
Cette methode ajoute pour chaque point les routes vers chaque autre point. L'ajout est repete trois fois afin de verifier que la methode d'ajout des routes est correcte ! Une seule route doit etre ajoutee et non trois !
private static void ajouterRoutes(List<Point> points) { long time = System.currentTimeMillis(); Set<Point> ensPoints = new HashSet<>(points); for(Point p : points) { p.ajouterRoutes(ensPoints); // Supposons que l'on essaye d'ajouter plusieurs fois les memes destinations ... p.ajouterRoutes(ensPoints); p.ajouterRoutes(ensPoints); } long deltaTime = System.currentTimeMillis() - time; System.out.println("Les routes sont ajoutées en "+deltaTime+" ms"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void newRoutePoint(RoutePointDTO routePointDTO, RouteDTO routeDTO, List<RoutePointDTO> points);", "public void testRoute() {\r\n\t\tLog.i(\"JUNIT\", \"Routing test started\");\r\n\t\t// create route with known points\r\n\t\tRoute pr = new Route(new GeoLocation(49.904005, 10.859725),\r\n\t\t\t\tnew GeoLocation(49.902637, 10.870646));\r\n\t\tList<GeoLocation> listLocations = new LinkedList<GeoLocation>();\r\n\t\t// retrieve path\r\n\t\tlistLocations = pr.getPath();\r\n\r\n\t\t// check maneuver count == 7\r\n\t\t// assertEquals(listLocations.size(),7);\r\n\t\tassertTrue(listLocations.size() > 0);\r\n\t}", "void onSucceedFindDirection(List<RouteBeetweenTwoPointsDTO> route);", "@Override\n public void AddRoute(Route route) {\n routes.add(route);\n }", "Long addRoute(Route route);", "public boolean addNewRoute(RouteInformation route) {\n\t\treturn false;\n\t}", "private void drawRoutes () {\n // Lay ngay cua tour\n Date tourDate = OnlineManager.getInstance().mTourList.get(tourOrder).getmDate();\n // Kiem tra xem ngay dien ra tour la truoc hay sau hom nay. 0: hom nay, 1: sau, -1: truoc\n int dateEqual = Tour.afterToday(tourDate);\n // Kiem tra xem tour da dien ra chua\n if (dateEqual == -1) {\n // Tour da dien ra, khong ve gi ca\n } else if (dateEqual == 1) {\n // Tour chua dien ra, khong ve gi ca\n } else {\n // Tour dang dien ra thi kiem tra gio\n /* Chang sap toi mau do, today nam trong khoang src start va src end\n Chang dang di chuyen mau xanh, today nam trong khoang src end va dst start\n Chang vua di qua mau xam, today nam trong khoang dst start va dst end */\n ArrayList<TourTimesheet> timesheets = OnlineManager.getInstance().mTourList.get(tourOrder).getmTourTimesheet();\n // Danh dau chang dang di qua\n int changDangDiQuaOrder = -1;\n // Danh dau chang sap di qua\n int changSapDiQuaOrder = -1;\n if(Tour.afterCurrentHour(timesheets.get(0).getmStartTime()) == 1){\n // Chang sap di qua mau do\n // Neu chua ve chang sap di, ve duong mau do\n if (timesheets.size() >= 2) {\n drawRoute(Color.RED, timesheets.get(0).getmBuildingLocation(), timesheets.get(1).getmBuildingLocation());\n }\n } else {\n for (int i = 0; i < timesheets.size() - 1; i++) {\n // Kiem tra xem chang hien tai la truoc hay sau gio nay. 0: gio nay, 1: gio sau, -1: gio truoc\n int srcStartEqual = Tour.afterCurrentHour(timesheets.get(i).getmStartTime());\n int srcEndEqual = Tour.afterCurrentHour(timesheets.get(i).getmEndTime());\n int dstStartEqual = Tour.afterCurrentHour(timesheets.get(i + 1).getmStartTime());\n // 2 vi tri chang\n LatLng srcLocation = timesheets.get(i).getmBuildingLocation();\n LatLng dstLocation = timesheets.get(i + 1).getmBuildingLocation();\n if (srcStartEqual == -1 && srcEndEqual == 1) {\n // Chang dang di qua mau xanh\n // Neu chua ve chang dang di, ve duong mau xanh\n drawRoute(Color.BLUE, srcLocation, dstLocation);\n // Danh dau chang dang di qua\n changDangDiQuaOrder = i;\n // Thoat khoi vong lap\n break;\n } else if (srcEndEqual == -1 && dstStartEqual == 1) {\n // Chang sap toi mau do\n // Neu chua ve chang sap toi, ve duong mau do\n drawRoute(Color.RED, srcLocation, dstLocation);\n // Danh dau chang sap di qua\n changSapDiQuaOrder = i;\n // Thoat khoi vong lap\n break;\n }\n }\n }\n // Kiem tra xem da ve duoc nhung duong nao roi\n if (changDangDiQuaOrder != - 1) {\n // Neu ve duoc chang dang di qua roi thi ve tiep 2 chang con lai\n if (changDangDiQuaOrder < timesheets.size() - 2) {\n // Neu khong phai chang ket thuc thi ve tiep chang sap di qua\n // 2 vi tri chang\n LatLng srcLocation = timesheets.get(changDangDiQuaOrder + 1).getmBuildingLocation();\n LatLng dstLocation = timesheets.get(changDangDiQuaOrder + 2).getmBuildingLocation();\n drawRoute(Color.RED, srcLocation, dstLocation);\n }\n if (changDangDiQuaOrder > 0) {\n // Neu khong phai chang bat dau thi ve tiep chang da di qua\n // 2 vi tri chang\n LatLng srcLocation = timesheets.get(changDangDiQuaOrder - 1).getmBuildingLocation();\n LatLng dstLocation = timesheets.get(changDangDiQuaOrder).getmBuildingLocation();\n drawRoute(Color.GRAY, srcLocation, dstLocation);\n }\n }\n if (changSapDiQuaOrder != - 1) {\n // Neu ve duoc chang sap di qua roi thi ve tiep 2 chang con lai\n if (changSapDiQuaOrder > 0) {\n // Neu khong phai chang bat dau thi ve tiep chang dang di qua\n // 2 vi tri chang\n LatLng srcLocation = timesheets.get(changSapDiQuaOrder - 1).getmBuildingLocation();\n LatLng dstLocation = timesheets.get(changSapDiQuaOrder).getmBuildingLocation();\n drawRoute(Color.BLUE, srcLocation, dstLocation);\n }\n if (changSapDiQuaOrder > 1) {\n // Neu khong phai chang bat dau thi ve tiep chang da di qua\n // 2 vi tri chang\n LatLng srcLocation = timesheets.get(changSapDiQuaOrder - 2).getmBuildingLocation();\n LatLng dstLocation = timesheets.get(changSapDiQuaOrder - 1).getmBuildingLocation();\n drawRoute(Color.GRAY, srcLocation, dstLocation);\n }\n }\n }\n }", "@Test\n void calculateRoute() {\n GPSObject n2 = new GPSObject(\"Centenary 2\");\n Location n1 = new Location(\"Centenary 2\",\"0\",n2);\n GPSObject n3 = new GPSObject(\"Thuto 1-5\");\n Location n4 = new Location(\"Thuto 1-5\",\"1\",n3);\n Locations loc = new Locations();\n assertNotNull(roo.calculateRoute(loc));\n }", "private void makeRoute(Route route, AbstractPort location1, AbstractPort location2) {\n route.add(location1);\n route.add(closestCrossing(location1.getLocation(), location2.getLocation()));\n route.add(location2);\n registerGameObject(route);\n }", "public void ajouter() {\n position = graph.edges.ajouterElement(this);\n origine.successeurs.inserer(destination);\n destination.predecesseurs.inserer(origine);\n origine.aretes_sortantes.inserer(this);\n destination.aretes_entrantes.inserer(this);\n }", "private void planningPaths(String url) {\n removePolyline();\n JSONObject json = new JSONObject();\n JSONObject origin = new JSONObject();\n JSONObject destination = new JSONObject();\n try {\n origin.put(\"lng\", 2.334595);\n origin.put(\"lat\", 48.893478);\n destination.put(\"lng\", destinationLng);\n destination.put(\"lat\", destinationLat);\n json.put(\"origin\", origin);\n json.put(\"destination\", destination);\n } catch (JSONException e) {\n }\n RequestBody body = RequestBody.create(MediaType.parse(\"application/json; charset=utf-8\"), String.valueOf(json));\n OkHttpClient client = new OkHttpClient();\n Request request = new Request.Builder().url(url).post(body).build();\n client.newCall(request).enqueue(new Callback() {\n @Override\n public void onFailure(Call call, IOException e) {\n Message msg = Message.obtain();\n Bundle bundle = new Bundle();\n bundle.putString(\"errorMsg\", e.getMessage());\n msg.what = ROUTE_PLANNING_FAILED;\n msg.setData(bundle);\n mHandler.sendMessage(msg);\n }\n\n @Override\n public void onResponse(Call call, Response response) throws IOException {\n try {\n String json = response.body().string();\n generateRoute(json);\n } catch (Exception e) {\n e.getMessage();\n }\n }\n });\n }", "public void saveRoute() {\n\t\t/** if internet then store this in the database */\n\t\tif (Internet.isNetworkAvailable(LoginActivity.getAppContext())) {\n\t\t\tHTIDatabaseConnection lHtiDbConnection = HTIDatabaseConnection\n\t\t\t\t\t.getInstance();\n\t\t\tif (lHtiDbConnection.getRoute(this.mRouteId) == null) {\n\t\t\t\tString errors = lHtiDbConnection.addRoute(this);\n\t\t\t\tif (errors != null) {\n\t\t\t\t\tLog.w(LogTag.WRITEDB,\n\t\t\t\t\t\t\t\"Errors during add route in the database : \\n\"\n\t\t\t\t\t\t\t\t\t+ errors);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tLog.w(LogTag.WRITEDB, \"The route with the id (\" + this.mRouteId\n\t\t\t\t\t\t+ \") already exist in the database.\");\n\t\t\t}\n\t\t}\n\t\t/** else store this in a JSON file (FILENAMEROUTE) */\n\t\telse {\n\t\t\tJsonManager.addRoutesInJson(MainActivity.FILENAMEROUTE, this,\n\t\t\t\t\tLoginActivity.getAppContext());\n\t\t}\n\t}", "public void setRoute(List route) \n {\n this.route = route;\n }", "private static void nbRoutesPremierPoint(List<Point> points) {\n if(points == null || points.isEmpty()) {\n System.out.println(\"Aucun point dans l'ensemble des points ...\");\n return;\n }\n Iterator<Point> iter = points.iterator();\n Point p1 = iter.next();\n System.out.println(\"Il y a \"+p1.getNbRoutes()+\" routes qui partent du point p1\");\n }", "public void suggestTourPlan(Tour alternativeRoute) throws JSONException, ParseException {\n String tourId = alternativeRoute.getTourName(); //get this from session\n Tour tourDetails = new TourDAOs().getTour(alternativeRoute.getTourName());\n System.out.println(\"Tour Details :\" + tourDetails.getStartDate() + \" \" + tourDetails.getEndDate());\n \n String start = tourDetails.getStartDate().substring(8);\n String end = tourDetails.getEndDate().substring(8);\n int tourDuration = Integer.parseInt(end) - Integer.parseInt(start);\n System.out.println(\"REAL DATE :\" + start + \" \" + end + \" \" + tourDuration);\n\n //get premium route details\n List<Route> routeDetails = new LocationRouteDAO().getDefaultRoute(tourId);\n //to print the locations of default route\n for (Route route : routeDetails) {\n System.out.println(\"Default Route list :\" + route.getLocationId());\n //System.out.println(location.getPoints());\n }\n\n int position = 0;\n int i = 0;\n ArrayList<Route> finalRoutes = new ArrayList<Route>();\n Route r = new Route();\n\n Route hotel = new Route();\n hotel.setDestinationPlaceName(routeDetails.get(0).getSourcePlaceName());\n hotel.setDestinationLatitude(routeDetails.get(0).getSourceLatitude());\n hotel.setDestinationLongitude(routeDetails.get(0).getSourceLongitude());\n finalRoutes.add(hotel);\n\n System.out.println(\"before proceeding with the loop :\" + finalRoutes.get(0).getDestinationPlaceName());\n\n //new code starts here\n for (Route route : routeDetails) {\n\n //get the location name of each location of the premium route\n String locName = route.getDestinationPlaceName();\n\n //find the category of the locName\n String locNameCategory = new LocationDAOs().getCategoryLocName(locName);\n\n //get all the locations that belongs to that category\n List<Location> categoryLocList = new ArrayList();\n categoryLocList = new LocationDAOs().getAllLocationsCategory(locNameCategory);\n\n //the location array that sends to the route generator algorithm\n ArrayList<Location> locations_details_ontology = new ArrayList();\n\n //to add the accommodation location as the first to the ontology array\n i++;\n\n Location loc1 = new Location();\n loc1.setLocationName(finalRoutes.get(finalRoutes.size() - 1).getDestinationPlaceName());\n loc1.setLatitude(finalRoutes.get(finalRoutes.size() - 1).getDestinationLatitude());\n loc1.setLongitude(finalRoutes.get(finalRoutes.size() - 1).getDestinationLongitude());\n locations_details_ontology.add(loc1);\n \n \n for (Location loc : categoryLocList) {\n\n if (!locations_details_ontology.get(0).getLocationName().equals(loc.getLocationName())) {\n Location l = new Location();\n l.setLocationName(loc.getLocationName());\n l.setLatitude(loc.getLatitude());\n l.setLongitude(loc.getLongitude());\n locations_details_ontology.add(l);\n }\n }\n \n //to print locations_details_ontology\n for (Location location : locations_details_ontology) {\n System.out.println(location.getLocationName() + \"----\"\n + location.getLatitude() + \"----\" + location.getLongitude());\n //System.out.println(location.getPoints());\n }\n\n //call the lagorithm to find out nearest locations to the first location in ontology array\n ArrayList<Route> routes = new RouteGenerator().RouteFinder(locations_details_ontology);\n\n // Loop all the routes to take the minimum distance of route.\n double min = 0;\n for (int k = 0; k < routes.size(); k++) {\n\n System.out.println(routes.get(k).getDistance());\n min = routes.get(0).getDistance();\n if (min >= routes.get(k).getDistance()) {\n min = routes.get(k).getDistance();\n r = routes.get(k);\n }\n }\n position++;\n r.setPosition(Integer.toString(position));\n\n boolean res = false;\n for (Route avail : finalRoutes) {\n\n if (r.getDestinationPlaceName().equals(avail.getDestinationPlaceName())) {\n res = true;\n }\n\n }\n if (res == false) {\n finalRoutes.add(r);\n }\n \n //to print final routes array\n for (Route fr : finalRoutes) {\n System.out.println(\"FINAL ROUTES ARRAY SANDUNI :\" + fr.getDestinationPlaceName());\n }\n\n }\n\n //get all location list from the database\n List<Location> allLocationList = new LocationDAOs().getAllLocationsList();\n // finalRoutes = new CustomizeRoute().DayPlanner(finalRoutes, allLocationList);\n\n //int m=0;\n //for (int es = 0; es <= m; es++) {\n for (int es = 0; es <= 4; es++) {\n finalRoutes = new CustomizeRoute().DayPlanner(finalRoutes, allLocationList);\n\n int estimatedDuration = Integer.parseInt(finalRoutes.get(finalRoutes.size() - 1).getDate());\n\n if (tourDuration < estimatedDuration) {\n finalRoutes.remove(finalRoutes.size() - 1);\n //m++;\n\n }\n }\n\n //print final routes array after customizing routes\n for (Route fr : finalRoutes) {\n System.out.println(\"FINAL ROUTES ARRAY ACCORDING TO DA PLAN :\" + fr.getDestinationPlaceName() + \" \" + fr.getDate());\n }\n\n //add alternative route to db\n int res = new LocationRouteDAO().addAlternativeRoute(finalRoutes, alternativeRoute.getTourName());\n\n if (res == 1) {\n System.out.println(\"SUCCESS!\");\n } else {\n System.out.println(\"FAILED!\");\n }\n\n }", "public void invalidRoute() \n {\n validRoute = false;\n }", "private void buildRoutes(String type) {\r\n\t\tswitch (type.charAt(0)) {\r\n\t\tcase 'F':\r\n\t\t\tthis.wwd.firePropertyChange(\"step\", \"\", \"Création des routes FIR\");\r\n\t\t\tbreak;\r\n\t\tcase 'U':\r\n\t\t\tthis.wwd.firePropertyChange(\"step\", \"\", \"Création des routes UIR\");\r\n\t\t\tbreak;\r\n\t\t}\r\n\t}", "private void installRoute(List<NodePortTuple> path, OFMatch match) {\r\n\r\n\t\tOFMatch m = new OFMatch();\r\n\r\n\t\tm.setDataLayerType(Ethernet.TYPE_IPv4)\r\n\t\t\t\t.setNetworkSource(match.getNetworkSource())\r\n\t\t\t\t.setNetworkDestination(match.getNetworkDestination());\r\n\r\n\t\tfor (int i = 0; i <= path.size() - 1; i += 2) {\r\n\t\t\tshort inport = path.get(i).getPortId();\r\n\t\t\tm.setInputPort(inport);\r\n\t\t\tList<OFAction> actions = new ArrayList<OFAction>();\r\n\t\t\tOFActionOutput outport = new OFActionOutput(path.get(i + 1)\r\n\t\t\t\t\t.getPortId());\r\n\t\t\tactions.add(outport);\r\n\r\n\t\t\tOFFlowMod mod = (OFFlowMod) floodlightProvider\r\n\t\t\t\t\t.getOFMessageFactory().getMessage(OFType.FLOW_MOD);\r\n\t\t\tmod.setCommand(OFFlowMod.OFPFC_ADD)\r\n\t\t\t\t\t.setIdleTimeout((short) 0)\r\n\t\t\t\t\t.setHardTimeout((short) 0)\r\n\t\t\t\t\t.setMatch(m)\r\n\t\t\t\t\t.setPriority((short) 105)\r\n\t\t\t\t\t.setActions(actions)\r\n\t\t\t\t\t.setLength(\r\n\t\t\t\t\t\t\t(short) (OFFlowMod.MINIMUM_LENGTH + OFActionOutput.MINIMUM_LENGTH));\r\n\t\t\tflowPusher.addFlow(\"routeFlow\" + uniqueFlow, mod,\r\n\t\t\t\t\tHexString.toHexString(path.get(i).getNodeId()));\r\n\t\t\tuniqueFlow++;\r\n\t\t}\r\n\t}", "public int addRoute(RouteEntry rtEntry);", "public void append(Route another) throws PointNotNearException {\n Point last_point = route.get(route.size() - 1);\n Point connection_point = another.route.get(0);\n int dx = connection_point.x - last_point.x;\n int dy = connection_point.y - last_point.y;\n int m_distance = Math.abs(dx) + Math.abs(dy);\n\n if (m_distance == 0) {\n // The starting of another route is the ending of this route.\n route.addAll(another.route.subList(1, another.route.size()));\n } else if (m_distance == 1) {\n // The starting of another route is next to this route.\n route.addAll(another.route);\n } else {\n // Invalid another route.\n throw new PointNotNearException();\n }\n }", "@Override\n public void onActivityResult(int requestCode, int resultCode, Intent data) {\n super.onActivityResult(requestCode, resultCode, data);\n if(resultCode == Activity.RESULT_OK) {\n try {\n if(requestCode == CREATE_WAYPOINT_REQUEST) {\n Bundle extras = data.getExtras();\n String descText = data.getStringExtra(\"DESC_TEXT\");\n String[] images = data.getStringArrayExtra(\"IMAGES_LIST\");\n\n Waypoint waypoint = new Waypoint(currentRoute.getId());\n waypoint.setDescription(descText);\n waypoint.setPhoto(images);\n waypoint.setTimestamp(System.currentTimeMillis());\n waypoint.setLat(this.lat);\n waypoint.setLng(this.lng);\n /*\n GPS CODE - OR getLastKnownPosition()\n */\n\n\n DatabaseHandler bhhandle = new DatabaseHandler(this.getApplicationContext());\n bhhandle.addWaypoint(waypoint);\n\n\n //Toast.makeText(this.getApplicationContext(),descText,1000);\n //STORE IN DATABASE\n //SEND TO SERVER\n //SUMMON CTHULHU\n } else if (requestCode == CREATE_WALK_REQUEST) {\n\t /*Handle the new route*/\n\t Bundle extras = data.getExtras();\n\t\n\t String shortDes = data.getStringExtra(\"SHORT_STRING\");\n\t String longDes = data.getStringExtra(\"LONG_STRING\");\n\t String title = data.getStringExtra(\"TITLE_STRING\");\n\t\n\t this.currentRoute = new Route(title,shortDes,longDes);\n\t\n\t DatabaseHandler db = new DatabaseHandler(this.getApplicationContext());\n\t currentRoute.setId(db.addRoute(currentRoute));\n\t TextView label = (TextView) findViewById(R.id.txtTourRunning);\n\t label.setText(\"Current Tour: \" + currentRoute.getTitle());\n\t\n\t if(currentRoute.getId() <= 0) {\n\t Toast.makeText(MainActivity.this,\"Database Write Failure\", Toast.LENGTH_LONG).show();\n } else {\n \t\n \t}\n \t}\n \t} catch (NullPointerException e) {\n Toast.makeText(MainActivity.this, \"Something bad happened\", Toast.LENGTH_LONG).show();\n }\n }\n }", "void btnGenerateRoute();", "public void findNewAStarPath(PedSimCity state) {\n\n\t\tRouteData route = new RouteData();\n\t\troute.origin = originNode.getID();\n\t\troute.destination = destinationNode.getID();\n\t\t//\t\toriginNode = PedSimCity.nodesMap.get(9406);\n\t\t//\t\tdestinationNode = PedSimCity.nodesMap.get(4456);\n\n\t\tif (UserParameters.empiricalABM) {\n\t\t\tSystem.out.println(\" Agent nr. \"+this.agentID + \" group \" + this.agp.groupName + \" OD \" + originNode.getID()+\" \" +destinationNode.getID());\n\t\t\tagp.defineRouteChoiceParameters();\n\t\t\tCombinedNavigation combinedNavigation = new CombinedNavigation();\n\t\t\tnewPath = combinedNavigation.path(originNode, destinationNode, agp);\n\t\t\troute.group = this.agp.groupID;\n\t\t\troute.localH = this.agp.localHeuristic;\n\t\t\troute.routeID = this.agentID.toString()+\"-\"+originNode.getID().toString()+\"-\"+destinationNode.getID().toString();\n\t\t}\n\t\telse {\n\t\t\tSystem.out.println(originNode.getID() + \" \"+ destinationNode.getID()+ \" \"+ap.routeChoice);\n\t\t\tselectRouteChoice();\n\t\t\troute.routeChoice = ap.routeChoice;\n\t\t\t//\t\t\troute.routeID = numTrips;\n\t\t}\n\n\t\tList<Integer> sequenceEdges = new ArrayList<Integer>();\n\n\t\tfor (GeomPlanarGraphDirectedEdge o : newPath) {\n\t\t\t// update edge data\n\t\t\tupdateEdgeData((EdgeGraph) o.getEdge());\n\t\t\tint edgeID = ((EdgeGraph) o.getEdge()).getID();\n\t\t\tsequenceEdges.add(edgeID);\n\t\t}\n\t\troute.sequenceEdges = sequenceEdges;\n\t\tPedSimCity.routesData.add(route);\n\t\tindexOnPath = 0;\n\t\tpath = newPath;\n\n\t\t// set up how to traverse this first link\n\t\tEdgeGraph firstEdge = (EdgeGraph) newPath.get(0).getEdge();\n\t\tsetupEdge(firstEdge); //Sets the Agent up to proceed along an Edge\n\n\t\t// update the current position for this link\n\t\tupdatePosition(segment.extractPoint(currentIndex));\n\t\tnumTrips += 1;\n\t}", "private void actionRoute(final GoogleMap googleMap){\n mMap = googleMap;\n PengajianApi pengajianApi = ServiceGenerator.getPengajianApi();\n Call<JadwalPengajianResponse> responseCall = pengajianApi.jadwalPengajian();\n responseCall.enqueue(new Callback<JadwalPengajianResponse>() {\n @Override\n public void onResponse(Call<JadwalPengajianResponse> call, Response<JadwalPengajianResponse> response) {\n if (response.isSuccessful()){\n// // tampung response ke variable\n\n int total= response.body().getMenuPengajians().size();\n\n for (int a=0;a<total;a++){\n Double model1 = Double.valueOf(response.body().getMenuPengajians().get(a).getLatitude());\n Double model2 = Double.valueOf(response.body().getMenuPengajians().get(a).getLongitude());\n MarkerOptions markerOptions = new MarkerOptions();\n LatLng latLng = new LatLng(model1,model2);\n markerOptions.position(latLng);\n Marker m = mMap.addMarker(markerOptions);\n googleMap.moveCamera(CameraUpdateFactory.newLatLng(latLng));\n googleMap.animateCamera(CameraUpdateFactory.zoomTo(11));\n// menuPengajians.add(model);\n }\n// JadwalPengajianResponse item = new JadwalPengajianResponse(menuPengajians);\n// jadwalPengajianResponses.add(item);\n////\n\n////\n\n }\n\n }\n\n @Override\n public void onFailure(Call<JadwalPengajianResponse> call, Throwable t) {\n\n }\n });\n\n\n\n }", "public OptInfo createInitialRoutes() {\t\n\t\t//OptInfo has old and new attributes\n\t\tOptInfo info = new OptInfo();\n\t\tTSPDepot currDepot = null; //current depot\n\t\tTSPShipment currShip = null; //current shipment\n\t\t//int countLoop=0;\n\n\t\t//check if selection and insertion type methods have been selected\n\t\tif (ProblemInfo.selectShipType == null) {\n\t\t\tSettings.printDebug(Settings.ERROR,\n\t\t\t\t\t\"No selection shipment type has been assigned\");\n\n\t\t}\n\t\tif (ProblemInfo.insertShipType == null) {\n\t\t\tSettings.printDebug(Settings.ERROR,\n\t\t\t\t\t\"No insertion shipment type has been assigned\");\n\t\t}\n\n\t\t//capture the old attributes\n\t\tinfo.setOldAttributes(mainDepots.getAttributes());\n\t\twhile (!mainShipments.isAllShipsAssigned()) {\n\n\n\t\t\tcurrDepot = (TSPDepot) mainDepots.getTSPHead();\n\t\t\t//Send the entire mainDepots and mainShipments to get the next shipment\n\t\t\t//to be inserted including the current depot\n\t\t\tTSPShipment theShipment = mainShipments.getNextInsertShipment(mainDepots,\n\t\t\t\t\tcurrDepot, mainShipments, currShip);\n\t\t\tif (theShipment == null) { //shipment is null, print error message\n\t\t\t\tSettings.printDebug(Settings.COMMENT, \"No shipment was selected\");\n\t\t\t}\n\t\t\t//The selected shipment will be inserted into the route\n\t\t\tif (!mainDepots.insertShipment(theShipment)) {\n\t\t\t\tSettings.printDebug(Settings.COMMENT, \"The Shipment: <\" + theShipment.getIndex() +\n\t\t\t\t\t\t\"> cannot be routed\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\t//Settings.printDebug(Settings.COMMENT,\n\t\t\t\t//\t\t\"The Shipment: <\" + theShipment.getIndex() +// \" \" + theShipment +\n\t\t\t\t//\t\t\"> was routed\");\n\t\t\t\t//tag the shipment as being routed\n\t\t\t\ttheShipment.setIsAssigned(true);\n\t\t\t}\n\t\t}\n\t\tProblemInfo.depotLLLevelCostF.calculateTotalsStats(mainDepots);\n\t\tinfo.setNewAtributes(mainDepots.getAttributes());\n\t\treturn info;\n\t}", "@Override\n\tpublic void onCalculateRouteSuccess() {\n\t\tnaviActivity();\n\t}", "@Override\n public void onDirectionSuccess(List<Points> point) {\n for (Points points:point){\n PolylineOptions polyLineOptions = new PolylineOptions().geodesic(true).color(Color.BLUE\n ).width(15);\n for (int i = 0; i < points.points.size(); i++)\n polyLineOptions.add(points.points.get(i));\n\n polylinePaths.add(mMap.addPolyline(polyLineOptions));\n\n }\n\n }", "private void addWaypoint(int a_x, int a_y)\n {\n if(!isObstacle(m_grid[a_x][a_y]) && m_waypoints.size() < m_maxNumWaypoints)\n {\n m_grid[a_x][a_y] = Map.WAYPOINT;\n m_waypoints.add(new Vector2d(a_x,a_y));\n frame.updateNumWaypoints(m_waypoints.size());\n }\n }", "private void addRouteMArkers()\n {\n //routeMarker.add(new MarkerOptions().position(new LatLng(geo1Dub,geo2Dub)));\n\n }", "@Then(\"^I can create a route called \\\"([^\\\"]*)\\\"$\")\n public void iCanCreateARouteCalled(String routeName) throws Throwable {\n createStopPoint(sp1Name);\n createStopPoint2();\n createRoute(routeName);\n }", "boolean hasRoute();", "public void configureButtonAddToMyRoutes(Context context, String userId, BikeEvent bikeEvent) {\n\n if(bikeEvent.getRoute()!=null) {\n if(bikeEvent.getRoute().getTypeRoute()!=null){\n if(UtilsGoogleMaps.routeNotInDatabase(context, userId, bikeEvent.getRoute())) {\n buttonAddRoute.setVisibility(View.VISIBLE);\n buttonAddRoute.setOnClickListener(v -> {\n Action.addEventRouteToMyRoutes(bikeEvent, userId, context);\n buttonAddRoute.setVisibility(View.INVISIBLE);\n Toast.makeText(context, context.getResources().getString(R.string.route_added_to_my_routes), Toast.LENGTH_SHORT).show();\n });\n }\n }\n }\n }", "org.landxml.schema.landXML11.RoadwayDocument.Roadway addNewRoadway();", "private void createRoutes(Scenario scenario, LeastCostPathCalculator router, int numOrigins) {\n\t\tfor (int i = 0; i < numOrigins; i++) {\n\t\t\tfor (int j = 0; j < numOrigins; j++) {\n\t\t\t\tRoute route;\n\t\t\t\tif (i == j) {\n\t\t\t\t\tId<Link> fromLinkId = Id.create(startLinkIds[i], Link.class);\n\t\t\t\t\tId<Link> toLinkId = fromLinkId;\n\t\t\t\t\t\n\t\t\t\t\troute = new LinkNetworkRouteFactory().createRoute(fromLinkId, toLinkId);\n\t\t\t\t\troute.setDistance(0.0);\n\t\t\t\t\troute.setTravelTime(0.0);\n\t\t\t\t} else {\n\t\t\t\t\tId<Link> fromLinkId = Id.create(startLinkIds[i], Link.class);\n\t\t\t\t\tId<Link> toLinkId = Id.create(endLinkIds[j], Link.class);\n\t\t\t\t\tLink fromLink = scenario.getNetwork().getLinks().get(fromLinkId);\n\t\t\t\t\tLink toLink = scenario.getNetwork().getLinks().get(toLinkId);\n\t\t\t\t\t\t\t\n\t\t\t\t\tPath path = router.calcLeastCostPath(fromLink.getToNode(), toLink.getFromNode(), 0.0, null, null);\n\t\t\t\t\troute = new LinkNetworkRouteFactory().createRoute(fromLinkId, toLinkId);\n\t\t\t\t\t\n\t\t\t\t\tdouble distance = RouteUtils.calcDistance((NetworkRoute) route, scenario.getNetwork());\n\t\t\t\t\troute.setDistance(distance);\n\t\t\t\t\troute.setTravelTime(path.travelTime);\n\n\t\t\t\t\t((NetworkRoute) route).setLinkIds(fromLink.getId(), NetworkUtils.getLinkIds(path.links), toLink.getId());\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\troutes.put(startLinkIds[i] + \"_\" + endLinkIds[j], route);\n\t\t\t\t\n\t\t\t\tprintRoute(scenario, route, startLinkIds[i], endLinkIds[j]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// fix bad routes\n\t\tString routeString;\n\t\tString[] links;\n\t\tList<Id<Link>> linkIds;\n\t\tNetworkRoute networkRoute;\n\t\t\t\n\t\trouteString = \"17560000130806FT_17560000126838FT\";\n\t\t//17560000130806FT - start link \n\t\t//17560000126838FT - end link \n\t\tlinks = new String[]{\"17560001813912FT\", \"17560001813913FT\", \"17560002100968FT\", \"17560000122288FT\", \"17560000122328FT\",\n\t\t\t\t\"17560001368986TF\", \"17560001786482TF\", \"17560001862499FT\", \"17560000125722FT\", \"17560001812124FT\", \"17560002102719FT\",\n\t\t\t\t\"17560001838515FT\", \"17560001984994FT\", \"17560001984995FT\", \"17560001812144FT\", \"17560001834645FT\", \"17560000126288FT\",\n\t\t\t\t\"17560002102725FT\", \"17560002102726FT\", \"17560001368914FT\", \"17560001368915FT\", \"17560001846187FT\"};\n\t\tlinkIds = new ArrayList<Id<Link>>();\n\t\tfor (String link : links) linkIds.add(Id.create(link, Link.class));\n\t\tnetworkRoute = (NetworkRoute) routes.get(routeString);\n\t\tnetworkRoute.setLinkIds(networkRoute.getStartLinkId(), linkIds, networkRoute.getEndLinkId());\n\t}", "boolean updateRoute(RouteBean route);", "private void generateRoute(String json) {\n try {\n JSONObject jsonObject = new JSONObject(json);\n JSONArray routes = jsonObject.optJSONArray(\"routes\");\n if (null == routes || routes.length() == 0) {\n return;\n }\n JSONObject route = routes.getJSONObject(0);\n // get route bounds\n JSONObject bounds = route.optJSONObject(\"bounds\");\n if (null != bounds && bounds.has(\"southwest\") && bounds.has(\"northeast\")) {\n JSONObject southwest = bounds.optJSONObject(\"southwest\");\n JSONObject northeast = bounds.optJSONObject(\"northeast\");\n assert southwest != null;\n LatLng sw = new LatLng(southwest.optDouble(\"lat\"), southwest.optDouble(\"lng\"));\n assert northeast != null;\n LatLng ne = new LatLng(northeast.optDouble(\"lat\"), northeast.optDouble(\"lng\"));\n mLatLngBounds = new LatLngBounds(sw, ne);\n }\n // get paths\n JSONArray paths = route.optJSONArray(\"paths\");\n assert paths != null;\n for (int i = 0; i < paths.length(); i++) {\n JSONObject path = paths.optJSONObject(i);\n List<LatLng> mPath = new ArrayList<>();\n JSONArray steps = path.optJSONArray(\"steps\");\n distanceText = path.getString(\"distanceText\");\n durationText = path.getString(\"durationText\");\n assert steps != null;\n for (int j = 0; j < steps.length(); j++) {\n JSONObject step = steps.optJSONObject(j);\n JSONArray polyline = step.optJSONArray(\"polyline\");\n assert polyline != null;\n for (int k = 0; k < polyline.length(); k++) {\n if (j > 0 && k == 0) {\n continue;\n }\n JSONObject line = polyline.getJSONObject(k);\n double lat = line.optDouble(\"lat\");\n double lng = line.optDouble(\"lng\");\n LatLng latLng = new LatLng(lat, lng);\n mPath.add(latLng);\n }\n }\n mPaths.add(i, mPath);\n }\n mHandler.sendEmptyMessage(ROUTE_PLANNING_SUCCESS);\n } catch (JSONException e) {\n }\n }", "private void addRoute(Route newRoute) {\n boolean inData = false;\n int[] newCode = new int[2];\n newCode[0] = newRoute.getSourceAirportID();\n newCode[1] = newRoute.getDestinationAirportID();\n if (routeCodes.size() > newRoute.getAirlineID()) {\n ArrayList<int[]> searchList = routeCodes.get(newRoute.getAirlineID());\n for (int[] existingCode : searchList) {\n if (existingCode[0] == newCode[0] && existingCode[1] == newCode[1]) {\n inData = true;\n errorCounter(10);\n break;\n }\n }\n }\n if (!inData) {\n parserData.add(newRoute);\n addToRouteCodes(newRoute);\n }\n }", "private void DrawRoute(final DirectionsResult result){\n new Handler(Looper.getMainLooper()).post(new Runnable() {\n @Override\n public void run() {\n if(RouteArrayList.size() > 0 ){\n\n //this for loop removes all the other routes\n //so when a new route is created, all previous routes will be removed\n for(Route route : RouteArrayList){\n route.getPolyline().remove();\n }\n RouteArrayList.clear();\n RouteArrayList = new ArrayList<>();\n }\n\n\n\n for(DirectionsRoute route: result.routes){\n //get the encoded path ( get all the points along each rote)in order to build the polyline\n\n List<com.google.maps.model.LatLng> decodedPath = PolylineEncoding.decode(route.overviewPolyline.getEncodedPath());\n\n List<LatLng> newPath = new ArrayList<>();\n\n for(com.google.maps.model.LatLng latLng: decodedPath){\n newPath.add(new LatLng(latLng.lat,latLng.lng));\n }\n\n Polyline polyline = mMap.addPolyline(new PolylineOptions().addAll(newPath).color(Color.GRAY).width(10));\n\n //make it clickable show that the info about distance/duration will show\n polyline.setClickable(true);\n\n RouteArrayList.add(new Route(polyline, route.legs[0]));\n //keep track of routes.legs[0] too.., diction - key being the polyline id?\n }\n }\n });\n }", "public Route(Point starting) {\n route = new ArrayList<>();\n route.add(starting);\n }", "private void addRoute(Route rte) {\n\t\trteTbl.add(rte);\n\t}", "@Override\n public void onLongPress(MotionEvent event) { Place a new Route Point\n //\n switch (event.getActionMasked())\n {\n case MotionEvent.ACTION_DOWN:\n {\n //Log.i(\"onLongPress\", \"This is a onLongPress (ACTION_DOWN) event...\");\n if (routeVisuals.selectedWaypoint != null) {\n movingRoutePoint = true;\n placingRoutePoint = false;\n }\n else {\n placingRoutePoint = true;\n movingRoutePoint = false;\n }\n\n super.getLocationForPoint(new PointF(event.getX(), event.getY()), new LocationReceiver() {\n @Override\n public void receiveLocation(Location location) {\n if (!movingRoutePoint) {\n Log.w(\"onLongPress\", \"lon:\" + location.longitude + \" lat:\" + location.latitude);\n Coordinate c = new Coordinate(location.longitude, location.latitude);\n WithinAirspaceCheck check = new WithinAirspaceCheck(MyMapView.this.context, c);\n check.SetOnFoundAirspace(new WithinAirspaceCheck.OnFoundAirspace() {\n @Override\n public void OnFoundAirspace(Airspace airspace) {\n Log.i(TAG, \"Found: \" + airspace.Name);\n if (onFoundAirspace != null)\n onFoundAirspace.OnFoundAirspace(airspace);\n }\n\n @Override\n public void OnFoundAllAirspaces(Airspaces airspaces) {\n Log.i(TAG, \"Total airspaces : \" + airspaces.size());\n if (onFoundAirspace != null)\n onFoundAirspace.OnFoundAllAirspaces(airspaces);\n }\n });\n\n\n check.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR);\n }\n\n }\n });\n\n break;\n }\n }\n\n// super.getLocationForPoint(new PointF(event.getX(), event.getY()), new ConvertPointCallback(){\n// @Override\n// public void convertComplete(Location loc) {\n// //Log.w(\"onLongPress\", \"lon:\" + loc.longitude + \" lat:\" + loc.latitude);\n//\n// if (placingRoutePoint) {\n// String name = loc.longitude + \",\" + loc.latitude;\n// routeVisuals.AddWaypoint(name, loc);\n//\n// //placingRoutePoint = false;\n// movingRoutePoint = true;\n// // insert the new point\n//\n// }\n//\n//\n// }});\n\n super.onLongPress(event);\n }", "public void addRoutes(Collection<Route> routes) {\n this.routes = new HashSet<>(routes);\n for (Route route : routes) {\n neighbors.add(route.getOther(this));\n }\n }", "public void append(Point next_point) throws PointNotNearException {\n append(new Route(next_point));\n }", "private void requestRoute() {\n Intent requestIntent = new Intent(RouteService.CREATE_ROUTE);\n requestIntent.putExtra(\"startLocation\", mStartLocation);\n requestIntent.putExtra(\"category\", mRouteCategory);\n requestIntent.putExtra(\"limitType\", mLimitType); // Enums are serializable. No probs here.\n requestIntent.putExtra(\"limit\", mLimitType == LimitType.DISTANCE ? mLimit : mLimit * 60);\n\n LocalBroadcastManager.getInstance(getSherlockActivity()).sendBroadcast(requestIntent);\n\n ViewSwitcher bottomSwitcher = (ViewSwitcher) getView().findViewById(R.id.switcher_route_options);\n if (bottomSwitcher.getNextView().getId() == R.id.switcher_item_progress) {\n bottomSwitcher.showNext();\n }\n\n ViewSwitcher topSwitcher = (ViewSwitcher) getView().findViewById(R.id.switcher_route_category);\n if (topSwitcher.getNextView().getId() == R.id.route_info_container) {\n topSwitcher.showNext();\n }\n\n // Set Image\n String categoryString;\n switch (mRouteCategory) {\n case WALKING:\n categoryString = \"walking\";\n break;\n case DRINKS:\n categoryString = \"drinks\";\n break;\n case SHOPPING:\n categoryString = \"shopping\";\n break;\n default:\n categoryString = \"\";\n break;\n }\n\n setRouteInfo(mRouteCategory, \"\", \"\", String.format(\"Creating a %s route...\", categoryString));\n\n ViewGroup buttonsContainer = (ViewGroup) topSwitcher.findViewById(R.id.category_buttons_container);\n for (int i = 0; i < buttonsContainer.getChildCount(); i++) {\n if (buttonsContainer.getChildAt(i) instanceof ImageButton) {\n ImageButton button = (ImageButton) buttonsContainer.getChildAt(i);\n button.setBackgroundResource(R.drawable.abs__list_selector_holo_light);\n }\n }\n }", "@Override\n\tpublic void onReCalculateRouteForTrafficJam() {\n\n\t}", "@Override\n public void onAllRoutesCompleted() {\n\n }", "public void addRoute(Route route) {\n routes.add(route);\n neighbors.add(route.getOther(this));\n }", "static public Feedback createFeedbackRoute(RegisteredUser sender, int idRoute, String message, String date)\t{\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tboolean b = UserManager.checkUserRoute(sender.getId(), idRoute);\r\n\t\t\tif (b == false) {\r\n\t\t\t\treturn new FeedbackRoute();\r\n\t\t\t}\t\r\n\t\t\tlogger.info(\"Sono in createFeedbackRoute\");\r\n\t\t\tRoute receiver = RouteManager.fetchRoute(idRoute);\r\n\t\t\tFeedback feedback = null;\r\n\t\t\tif(receiver != null) {\r\n\t\t\t\tfeedback = new FeedbackRoute(sender, message, date,receiver);\r\n\t\t\t\tFeedbackManager.saveFeedbackToDB(feedback);\r\n\t\t\t}\r\n\t\t\treturn feedback;\r\n\t\t} catch (SQLException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn null;\r\n\t\t} catch (DBException e){\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn new FeedbackRoute();\r\n\t\t}\r\n\t}", "public void calculateRoute() {\n SKRouteSettings route = new SKRouteSettings();\n route.setStartCoordinate(start);\n route.setDestinationCoordinate(end);\n route.setNoOfRoutes(1);\n switch (routingType) {\n case SHORTEST:\n route.setRouteMode(SKRouteSettings.SKRouteMode.BICYCLE_SHORTEST);\n break;\n case FASTEST:\n route.setRouteMode(SKRouteSettings.SKRouteMode.BICYCLE_FASTEST);\n break;\n case QUIET:\n route.setRouteMode(SKRouteSettings.SKRouteMode.BICYCLE_QUIETEST);\n break;\n }\n route.setRouteExposed(true);\n SKRouteManager.getInstance().calculateRoute(route);\n }", "public static void main(String[] args) {\n PointNode A = new PointNode(\"A\",0,0);\r\n PointNode B = new PointNode(\"B\",20,10);\r\n PointNode C = new PointNode(\"C\",40,20);\r\n PointNode D = new PointNode(\"D\",30,30);\r\n PointNode E = new PointNode(\"E\",20,50);\r\n PointNode F = new PointNode(\"F\",-10,40);\r\n PointNode G = new PointNode(\"G\",10,20);\r\n PointNode H = new PointNode(\"H\",10,40);\r\n PointNode I = new PointNode(\"I\",30,40);\r\n PointNode K = new PointNode(\"K\",30,20);\r\n PointNode L = new PointNode(\"L\",40,40);\r\n\r\n A.connectWithPoint(B);\r\n A.connectWithPoint(G);\r\n G.connectWithPoint(F);\r\n G.connectWithPoint(H);\r\n G.connectWithPoint(D);\r\n K.connectWithPoint(L);\r\n B.connectWithPoint(C);\r\n D.connectWithPoint(I);\r\n D.connectWithPoint(E);\r\n L.connectWithPoint(E);\r\n F.connectWithPoint(E);\r\n H.connectWithPoint(E);\r\n I.connectWithPoint(E);\r\n A.connectWithPoint(K);\r\n\r\n Route route = searchWay(A, E);\r\n System.out.println(route);\r\n }", "private void QueryDirections() {\n\t\tshowProgress(true, \"正在搜索导航路线...\");\n\t\t// Spawn the request off in a new thread to keep UI responsive\n\t\tfor (final FloorInfo floorInfo : floorList) {\n\t\t\tif (floorInfo.getPoints() != null\n\t\t\t\t\t&& floorInfo.getPoints().length >= 2) {\n\n\t\t\t\tThread t = new Thread() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t// Start building up routing parameters\n\t\t\t\t\t\t\tRouteTask routeTask = RouteTask\n\t\t\t\t\t\t\t\t\t.createOnlineRouteTask(\n\t\t\t\t\t\t\t\t\t\t\tfloorInfo.getRouteServerPath(),\n\t\t\t\t\t\t\t\t\t\t\tnull);\n\n\t\t\t\t\t\t\tRouteParameters rp = routeTask\n\t\t\t\t\t\t\t\t\t.retrieveDefaultRouteTaskParameters();\n\t\t\t\t\t\t\tNAFeaturesAsFeature rfaf = new NAFeaturesAsFeature();\n\t\t\t\t\t\t\t// Convert point to EGS (decimal degrees)\n\t\t\t\t\t\t\t// Create the stop points (start at our location, go\n\t\t\t\t\t\t\t// to pressed location)\n\t\t\t\t\t\t\t// StopGraphic point1 = new StopGraphic(mLocation);\n\t\t\t\t\t\t\t// StopGraphic point2 = new StopGraphic(p);\n\t\t\t\t\t\t\trfaf.setFeatures(floorInfo.getPoints());\n\t\t\t\t\t\t\trfaf.setCompressedRequest(true);\n\t\t\t\t\t\t\trp.setStops(rfaf);\n\n\t\t\t\t\t\t\t// Set the routing service output SR to our map\n\t\t\t\t\t\t\t// service's SR\n\t\t\t\t\t\t\trp.setOutSpatialReference(wm);\n\t\t\t\t\t\t\trp.setFindBestSequence(true);\n\t\t\t\t\t\t\trp.setPreserveFirstStop(true);\n\t\t\t\t\t\t\tif (floorInfo.getEndPoint() != null) {\n\t\t\t\t\t\t\t\trp.setPreserveLastStop(true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t// Solve the route and use the results to update UI\n\t\t\t\t\t\t\t// when received\n\t\t\t\t\t\t\tfloorInfo.setRouteResult(routeTask.solve(rp));\n\n\t\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\t\tmException = e;\n\t\t\t\t\t\t\t// mHandler.post(mUpdateResults);\n\t\t\t\t\t\t}\n\t\t\t\t\t\trouteIndex++;\n\t\t\t\t\t\tif (routeIndex >= routeCount) {\n\t\t\t\t\t\t\tmHandler.post(mSetCheckMap);\n\t\t\t\t\t\t\tmHandler.post(mUpdateResults);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\t// Start the operation\n\t\t\t\tt.start();\n\t\t\t}\n\t\t}\n\n\t}", "void setRoutes(List<RouteType> routes);", "@Test\n public void createNeighbourWithSuccess() {\n Neighbour newNeighbour = new Neighbour(13, \"Toto\", \"https://i.pravatar.cc/150?u=a042581f4e29026704d\", \"Saint-Pierre-du-Mont ; 5km\",\n \"+33 6 00 00 00 00 \", \"Bonjour !Je souhaiterais faire de la marche nordique...\");\n //when: I add the newNeighbour to the neighbourList\n service.addNeighbour(newNeighbour);\n List<Neighbour> neighbours = service.getNeighbours();\n assertTrue(neighbours.contains(newNeighbour));\n }", "@Override\r\n\tpublic void onReCalculateRouteForTrafficJam() {\n\r\n\t}", "@Override\n\tpublic void onCalculateMultipleRoutesSuccess(int[] arg0) {\n\n\t}", "@Override\n protected void setUp() throws Exception { // creating method setUp for initialize data\n route = new ArrayList<>(); // initialize List route\n\n Line line1 = new Line(1, \"Первая\"); // creating line1\n Line line2 = new Line(2, \"Вторая\"); // creating line2\n route.add(new Station(\"Петровская\", line1)); // add new station to the array\n route.add(new Station(\"Арбузная\", line1));\n route.add(new Station(\"Морковная\", line2));\n route.add(new Station(\"Яблочная\", line2));\n\n }", "void storeRoute(McastRoute route);", "TradeRoute(String aStartPoint, String anEndPoint, int anId){\n startPoint = aStartPoint;\n endPoint = anEndPoint;\n id = anId;\n }", "private void launchAlternativeRouteCalculation() {\n SKRouteSettings route = new SKRouteSettings();\n route.setStartCoordinate(new SKCoordinate(-122.392284, 37.787189));\n route.setDestinationCoordinate(new SKCoordinate(-122.484378, 37.856300));\n // number of alternative routes specified here\n route.setNoOfRoutes(3);\n route.setRouteMode(SKRouteSettings.SKROUTE_CAR_FASTEST);\n route.setRouteExposed(true);\n SKRouteManager.getInstance().setRouteListener(this);\n SKRouteManager.getInstance().calculateRoute(route);\n }", "@Override\n\t\t\t\tpublic void onCalculateMultipleRoutesSuccess(int[] arg0) {\n\t\t\t\t\t\n\t\t\t\t}", "@Test\n\tpublic void addRoadTest(){\n\t\tDjikstrasMap m = new DjikstrasMap();\t//Creates new DjikstrasMap object\n\t\tLocation l1 = new Location(\"Guildford\");\n\t\tLocation l2 = new Location(\"Portsmouth\");\n\t\t\n\t\tm.addRoad(\"Guildford\", \"Portsmouth\", 20.5, \"M3\");\t//Adds a road from Guildford to portsmouth to the map\n m.addRoad(\"Portsmouth\", \"Guildford\", 20.5, \"M3\");\n \n assertEquals(l1.getName(), m.getNode(\"Guildford\").getName());\t//Tests that the method added the roads correctly to teh map\n assertEquals(l2.getName(), m.getNode(\"Portsmouth\").getName());\n\t}", "public static void addNewRoute(Realm realm, RouteListModel mRouteListModel) {\n try {\n App.showLog(\"========insert-set-as-new route=====\");\n\n realm.beginTransaction();\n RouteListModel RouteListModel = realm.copyToRealmOrUpdate(mRouteListModel);\n realm.commitTransaction();\n\n } catch (Exception e) {\n e.printStackTrace();\n try {\n realm.commitTransaction();\n } catch (Exception e2) {\n e2.printStackTrace();\n }\n }\n }", "private void processRoutes(ParticipantDataResponse response) throws SQLException {\n\t\tif (response.getRoutes() != null) {\n\n\t\t\t// Get the DAO for Routes data.\n\t\t\tDao<Route, String> routeDao = dbHelper.getRoutesDAO();\n\n\t\t\t// For each returned route...\n\t\t\tfor (RouteData routeDataFromOdin : response.getRoutes()) {\n\t\t\t\tRoute routeFromOdin = routeDataFromOdin.route;\n\n\t\t\t\t// Search the DB for a local one that matches.\n\t\t\t\tRoute localRoute = routeDao.queryForId(routeFromOdin.getId());\n\n\t\t\t\t// If there isn't, then save it to the db.\n\t\t\t\tif (localRoute == null) {\n\n\t\t\t\t\trouteDao.assignEmptyForeignCollection(routeFromOdin, \"gpsCoordinates\");\n\t\t\t\t\trouteDao.create(routeFromOdin);\n\n\t\t\t\t\tfor (RouteCoordinate coord : routeDataFromOdin.coords) {\n\t\t\t\t\t\tcoord.setRoute(routeFromOdin);\n\t\t\t\t\t\trouteFromOdin.getGpsCoordinates().add(coord);\n\t\t\t\t\t}\n\n\t\t\t\t\tlogger.info(\"doInBackground(): Route from Odin wasn't found in local DB and will be added now (ID = \"\n\t\t\t\t\t\t\t+ routeFromOdin.getId() + \")\");\n\n\t\t\t\t}\n\n\t\t\t\telse {\n\t\t\t\t\tlogger.info(\"doInBackground(): Route from Odin was already in local DB (ID = \"\n\t\t\t\t\t\t\t+ routeFromOdin.getId() + \")\");\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}", "public void setRoute(Route route) {\n this.route = route;\n }", "public void drawRoute(Set<Waypoint> waypoints, List<GeoPosition> track) {\r\n\t\tRoutePainter routePainter = new RoutePainter(track);\r\n\t\t\r\n WaypointPainter<Waypoint> waypointPainter = new WaypointPainter<Waypoint>();\r\n waypointPainter.setWaypoints(waypoints);\r\n \r\n List<Painter<JXMapViewer>> painters = new ArrayList<Painter<JXMapViewer>>();\r\n painters.add(routePainter);\r\n painters.add(waypointPainter);\r\n\r\n CompoundPainter<JXMapViewer> painter = new CompoundPainter<JXMapViewer>(painters);\r\n mapViewer.setOverlayPainter(painter);\r\n\t}", "public static void calculate(Route pRoute)\r\n {\r\n //System.out.println(pRoute.size());\r\n for(int i=0; i<pRoute.size()-1; i++)\r\n {\r\n pRoute.addLeg(calculateLeg(pRoute.getWaypoint(i),pRoute.getWaypoint(i+1),pRoute.getSpeed())); \r\n }\r\n }", "public void onClick(View v) {\n if (destinationMarker != null) {\n\n if (startingpoint == 1) {\n nextStep = true;\n disableButton(1);\n\n showCustomDialog(getResources().getString(R.string.alert_title_create_geofence), getResources().getString(R.string.alert_msg_create_geofence));\n buttonConfirm.setText(getResources().getString(R.string.button_confirm_geofence));\n\n }\n\n // If a geofence markers minimal 3 exists (minimal bikin triangle):\n if (markers.size() >= 3) {\n\n if(pointInPolygon(locationMarker.getPosition(), polygon) && pointInPolygon(destinationMarker.getPosition(), polygon)){\n\n // Try Catch for Uploading geofence data, destination point, and notification data to Firebase\n try {\n\n geofenceReference = FirebaseDatabase.getInstance().getReference().child(\"trackingSession/\" + id);\n\n geofenceReference.addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n if (!dataSnapshot.hasChild(\"geofence\") && !isSent) {\n isSent = true;\n\n AlertDialog.Builder alertDialogBuilder = new AlertDialog.Builder(AppointmentActivity.this);\n alertDialogBuilder.setMessage(getResources().getString(R.string.alert_title_save_quick_route));\n alertDialogBuilder.setPositiveButton(getResources().getString(R.string.button_yes),\n new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface arg0, int arg1) {\n saveQuickRoute = true;\n sendtoFirebase(saveQuickRoute);\n\n Intent intent = new Intent(AppointmentActivity.this, TrackingActivity.class);\n intent.putExtra(EXTRA_MESSAGE_ID, id);\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n // Set the new task and clear flags\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n startActivity(intent);\n }\n });\n\n alertDialogBuilder.setNegativeButton(getResources().getString(R.string.button_no),\n new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n saveQuickRoute = false;\n sendtoFirebase(saveQuickRoute);\n\n Intent intent = new Intent(AppointmentActivity.this, TrackingActivity.class);\n intent.putExtra(EXTRA_MESSAGE_ID, id);\n intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n // Set the new task and clear flags\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TASK);\n startActivity(intent);\n }\n });\n\n AlertDialog alertDialog = alertDialogBuilder.create();\n alertDialog.setCancelable(false);\n alertDialog.show();\n\n } else if (!isSent) {\n Alerter.create(AppointmentActivity.this).setTitle(getResources().getString(R.string.alert_title_geofence)).setText(getResources().getString(R.string.alert_msg_geofence)).setBackgroundColorRes(R.color.colorAccent).show();\n }\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n\n }\n });\n\n\n } catch (Exception e) {\n Alerter.create(AppointmentActivity.this).setTitle(getResources().getString(R.string.alert_title_failed_set_object)).setText(getResources().getString(R.string.alert_msg_failed_set_object)).setBackgroundColorRes(R.color.colorAccent).show();\n }\n } else {\n Alerter.create(AppointmentActivity.this).setTitle(getResources().getString(R.string.alert_title_outside_geofence)).setText(getResources().getString(R.string.alert_msg_outside_geofence)).setBackgroundColorRes(R.color.colorAccent).show();\n }\n }\n }\n }", "public void createRoute(Route route) throws SQLException {\n\t\trDb.createRoute(route);\n\t}", "void setRoute(Shape route);", "@java.lang.Override\n public boolean hasRoute() {\n return stepInfoCase_ == 7;\n }", "private void requestAddLocationPoint(final String point, final String lPoint , final String city , final String country ) {\n\n // Utils.showLoadingPopup(getActivity());\n if(checkExistLocationPoint(point,lPoint))\n {\n return ;\n }\n String url=\"\";\n HashMap<String, String> data = new HashMap<>();\n switch(point)\n {\n case \"loading\":\n url= Constants.BASE_URL + \"add_loding_point\";\n data.put(\"loding_point\",lPoint);\n data.put(\"loding_city\",city);\n data.put(\"loading_country\",country);\n data.put(\"status\",\"1\");\n break ;\n\n case \"destination\" :\n url= Constants.BASE_URL + \"add_destination_point\";\n data.put(\"destination_point\",lPoint);\n data.put(\"destination_city\",city);\n data.put(\"destination_country\",country);\n data.put(\"status\",\"1\");\n break ;\n }\n\n\n\n HttpPostRequest.doPost(getActivity(), url, Utils.newGson().toJson(data), new HttpRequestCallback() {\n @Override\n public void response(String errorMessage, String responseData) {\n\n // Utils.hideLoadingPopup();\n\n try {\n\n JSONObject jobj = new JSONObject(responseData);\n Boolean status = jobj.getBoolean(\"status\");\n if (status) {\n LocationPointModel locationPointModel = new LocationPointModel();\n locationPointModel.locPoint = lPoint ;\n locationPointModel.city = city ;\n locationPointModel.country = country ;\n switch(point)\n {\n\n case \"loading\" :\n locationPointModel.locId = jobj.getString(\"loding_point_id\") ;\n appGlobal.listLoadingnPoint.add(locationPointModel);\n break ;\n\n case \"destination\" :\n locationPointModel.locId = jobj.getString(\"destination_point_id\") ;\n appGlobal.listDestinationPoint.add(locationPointModel);\n break ;\n }\n\n Toast.makeText(getActivity(), jobj.getString(\"msg\").toString(), Toast.LENGTH_SHORT).show();\n\n } else {\n Toast.makeText(getActivity(), jobj.getString(\"msg\").toString(), Toast.LENGTH_SHORT).show();\n }\n } catch (Exception e) {\n Toast.makeText(getActivity(), \"Error getting Data\", Toast.LENGTH_SHORT).show();\n e.printStackTrace();\n }\n }\n\n @Override\n public void onError(String errorMessage) {\n\n }\n });\n\n }", "@Override\n public void onMapReady(GoogleMap googleMap) {\n Polyline polyline = googleMap.addPolyline(new PolylineOptions().width(4).color(Color.BLACK));\n if(postions.size() > 2){\n polyline.setPoints(postions);\n googleMap.moveCamera(CameraUpdateFactory.newLatLngZoom(getCenterOfPolygon(postions), 15));\n }\n else{\n Toast.makeText(this, \"Route too short\", Toast.LENGTH_LONG).show();\n }\n }", "@Test\r\n\t public void addAnExistingRouteFather(){\r\n\t\tRouteFather toAdd = new RouteFather();\r\n\t\ttoAdd = routeFatherDAO.create(toAdd);\r\n\t\tAssert.assertNull(toAdd);\r\n\t\t\r\n\t }", "@Test\r\n void findRouteSameLine() {\r\n List<Station> route = model.findRoute(1, 20);\r\n assertNotNull(route);\r\n assertEquals(6, route.size());\r\n assertEquals(\"OakGrove\", route.get(0).getName());\r\n assertEquals(\"NorthStation\", route.get(5).getName());\r\n }", "public void addPath(int startRoom, int door, int destinationRoom){\r\n\t\tEdge e= new Edge(startRoom,door,destinationRoom);\r\n\t\tprint(\"Adding edge \"+e);\r\n\t\tBoolean flag=false;\r\n\t\tif(startPaths.containsKey(startRoom)){\r\n\t\t\tprint(\"Start path contains \"+startRoom);\r\n\t\t\tfor(int i=0;i<startPaths.get(startRoom).size();i++){\r\n\t\t\t\tif(e.equals(startPaths.get(i))){\r\n\t\t\t\t\tflag=true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(flag==false){\r\n\t\t\tstartPaths.get(startRoom).add(e);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\tVector<Edge> v= new Vector<Edge>();\r\n\t\t\tv.add(e);\r\n\t\t\tstartPaths.put(startRoom, v);\r\n\t\t}\r\n\r\n\t\tif(destinationPaths.containsKey(destinationRoom)){\r\n\t\t\tprint(\"Destination path contains \"+destinationRoom);\r\n\t\t\tfor(int i=0;i<destinationPaths.get(destinationRoom).size();i++){\r\n\t\t\t\tif(e.equals(destinationPaths.get(i))){\r\n\t\t\t\t\tflag=true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif(flag==false){\r\n\t\t\t\tdestinationPaths.get(destinationRoom).add(e);\r\n\t\t\t}\r\n\t\t}\r\n\t\telse{\r\n\t\t\tVector<Edge> v= new Vector<Edge>();\r\n\t\t\tv.add(e);\r\n\t\t\tdestinationPaths.put(destinationRoom, v);\r\n\t\t}\r\n\t}", "private void analyzeRoute(ArrayList<LatLng> route) {\n if (route == null) route = this.route;\n double runningDistance = 0;\n if (waypoints == null) waypoints = new Stack<>();\n\n ArrayList<LatLng> reverseRoute = new ArrayList<>();\n reverseRoute.addAll(route);\n Collections.reverse(reverseRoute);\n\n LatLng previousWaypoint = new LatLng(0, 0);\n Iterator<LatLng> it = reverseRoute.iterator();\n if (it.hasNext())\n previousWaypoint = it.next();\n\n mMap.addMarker(new MarkerOptions().position(previousWaypoint).title(\"Destination\").icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_GREEN)));\n\n while (it.hasNext()) {\n LatLng waypoint = it.next();\n double distance = directionsHelper.getDistanceInMeters(waypoint, previousWaypoint);\n runningDistance += distance;\n previousWaypoint = waypoint;\n waypoints.push(new Waypoint(waypoint.latitude, waypoint.longitude, runningDistance));\n }\n }", "synchronized public Route getRouteLaPlusProcheDuPoint(final int x,final int y){\n\t\t//int i=0;\n\t\tfloat min=9999999.0f, calc = 999999.0f;\n\t\tRoute tmp = null;\n\t\tfor(Route v : routes){\n\t\t\tif(v != null){\n\t\t\t\tcalc = v.distance(x, y);\n\t\t\t\tif(calc < min && calc < 30.0f){\n\t\t\t\t\tmin = calc;\n\t\t\t\t\t//i+=1;\n\t\t\t\t\ttmp=v;\n\t\t\t\t\t//System.out.println(\"Routes cliquer: \"+v.getNomVille1()+\" \"+v.getNomVille2()+\" i\"+i);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn tmp;\n\t\t//return routes.get(i);\n\t\t/*\n\t\tif(i<0)\n\t\t\treturn null;\n\t\t\n\t\tif(routes.get(i) instanceof RouteDouble)\n\t\t\treturn new RouteDouble((RouteDouble)(routes.get(i)));\n\t\treturn new Route(routes.get(i));\n\t\t//*/\n\t}", "public Route(Vektor anfang, Vektor ende){\n\t\tthis.setAnfang(anfang);\n\t\tthis.setEnde(ende);\n\t}", "@Test\r\n void findRouteDifferentLine() {\r\n List<Station> route = model.findRoute(9, 60);\r\n assertNotNull(route);\r\n assertEquals(10, route.size());\r\n assertEquals(\"SuffolkDowns\", route.get(0).getName());\r\n assertEquals(\"Broadway\", route.get(9).getName());\r\n }", "private Route append(Map<QualifiedName, PathParamDescriptor> pathParamDescriptors, String path) throws MalformedRouteException\n {\n if (path.length() == 0 || path.charAt(0) != '/')\n {\n throw new MalformedRouteException();\n }\n\n //\n int pos = path.length();\n int level = 0;\n List<Integer> start = new ArrayList<Integer>();\n List<Integer> end = new ArrayList<Integer>();\n for (int i = 1;i < path.length();i++)\n {\n char c = path.charAt(i);\n if (c == '{')\n {\n if (level++ == 0)\n {\n start.add(i);\n }\n }\n else if (c == '}')\n {\n if (--level == 0)\n {\n end.add(i);\n }\n }\n else if (c == '/')\n {\n if (level == 0)\n {\n pos = i;\n break;\n }\n }\n }\n\n //\n Route next;\n if (start.isEmpty())\n {\n String segment = path.substring(1, pos);\n SegmentRoute route = new SegmentRoute(router, segment);\n add(route);\n next = route;\n }\n else\n {\n if (start.size() == end.size())\n {\n PatternBuilder builder = new PatternBuilder();\n builder.expr(\"^\").expr('/');\n List<String> chunks = new ArrayList<String>();\n List<PathParam> parameterPatterns = new ArrayList<PathParam>();\n\n //\n int previous = 1;\n for (int i = 0;i < start.size();i++)\n {\n builder.litteral(path, previous, start.get(i));\n chunks.add(path.substring(previous, start.get(i)));\n String parameterName = path.substring(start.get(i) + 1, end.get(i));\n\n //\n QualifiedName parameterQName = QualifiedName.parse(parameterName);\n\n // Now get path param metadata\n PathParamDescriptor parameterDescriptor = pathParamDescriptors.get(parameterQName);\n\n //\n PathParam param;\n if (parameterDescriptor != null)\n {\n param = PathParam.create(parameterDescriptor, router);\n }\n else\n {\n param = PathParam.create(parameterQName, router);\n }\n\n // Append routing regex to the route regex surrounded by a non capturing regex\n // to isolate routingRegex like a|b or a(.)b\n builder.expr(\"(?:\").expr(param.routingRegex).expr(\")\");\n\n // Add the path param with the rendering regex\n parameterPatterns.add(param);\n previous = end.get(i) + 1;\n }\n\n //\n builder.litteral(path, previous, pos);\n\n // We want to satisfy one of the following conditions\n // - the next char after the matched expression is '/'\n // - the expression matched until the end\n // - the match expression is the '/' expression\n builder.expr(\"(?:(?<=^/)|(?=/)|$)\");\n\n //\n chunks.add(path.substring(previous, pos));\n PatternRoute route = new PatternRoute(router, router.compile(builder.build()), parameterPatterns, chunks);\n\n // Wire\n add(route);\n\n //\n next = route;\n }\n else\n {\n throw new UnsupportedOperationException(\"Report error\");\n }\n }\n\n //\n if (pos < path.length())\n {\n return next.append(pathParamDescriptors, path.substring(pos));\n }\n else\n {\n return next;\n }\n }", "public interface RoutesProcessor {\n RoutesProcessor addRoute(Route route);\n}", "@Test\r\n public void testGetRoute() {\r\n // Test 1 (Short Path)\r\n Path route = backend.getRoute(\"Observatory & Babcock\", \"Liden & Babcock\");\r\n // Verify distance is correct\r\n if(route.getDistance() != 460)\r\n fail(\"Failed to get shortest path\");\r\n // Verify path starts at 'Observatory & Babcock' and ends at 'Liden & Babcock'\r\n if(!route.getPath().get(0).getName().equalsIgnoreCase(\"Observatory & Babcock\") ||\r\n !route.getPath().get(1).getName().equalsIgnoreCase(\"Liden & Babcock\"))\r\n fail(\"Failed to get shortest path\");\r\n\r\n //Test 2 (Short Path w/ POIs)\r\n route = backend.getRoute(\"Mills & Johnson\", \"Brooks & Johnson\");\r\n // Verify distance is correct\r\n if(route.getDistance() != 441)\r\n fail(\"Failed to get shortest path\");\r\n // Verify point of interest\r\n if(!route.getPOI().get(0).equalsIgnoreCase(\"Grand Central\"))\r\n fail(\"Failed to find point of interest\");\r\n }", "private void insertServiceRequest() {\n Random rand = new Random();\r\n service_id = rand.nextInt(Integer.MAX_VALUE);\r\n int tokenSeed = rand.nextInt(Integer.MAX_VALUE);\r\n current_token = md5(tokenSeed + \"\");\r\n\r\n Calendar cal = Calendar.getInstance();\r\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd HH:mm:ss\");\r\n\r\n String fecha = sdf.format(cal.getTime());\r\n\r\n int deliver_state = 1;\r\n\r\n int costo = (int) Math.round(destinations.get(0).total_price);\r\n\r\n ArrayList<String> param = new ArrayList<>();\r\n param.add(service_id + \"\");\r\n param.add(current_token);\r\n param.add(fecha);\r\n param.add(deliver_state + \"\");\r\n param.add(id_cliente + \"\");\r\n param.add(costo + \"\");\r\n param.add(\"0\");\r\n RestClient.get().executeCommand(\"8\", param.toString(), new Callback<Response>() {\r\n @Override\r\n public void success(Response response, retrofit.client.Response response2) {\r\n\r\n insertRoutes();\r\n }\r\n\r\n @Override\r\n public void failure(RetrofitError error) {\r\n hideOverlay();\r\n showDialog(\r\n getResources().getString(\r\n R.string.msg_serverError_title),\r\n getResources().getString(\r\n R.string.msg_serverError), false, false);\r\n }\r\n });\r\n\r\n\r\n }", "public synchronized void addRoute(String to, String via) {\n\tif(routeExists(to, via)) {\n\t return;\n\t}\n\taddForwardEntry(to, via);\n\tinverseTable.add(via, to);\n }", "@java.lang.Override\n public boolean hasRoute() {\n return stepInfoCase_ == 7;\n }", "org.landxml.schema.landXML11.RoadsideDocument.Roadside addNewRoadside();", "public void makeOfferRouteStata() {\n\t\tlog(String.format(\"Making DEBUG Offer for Vassar-1\"));\n\n\t\tResRequest res = new ResRequest(mId, ResRequest.RES_GET, \"Stata-1\");\n\t\tres = new ResRequest(mId, ResRequest.RES_GET, \"Stata-1\");\n\t\tres.done = true;\n\t\tres.completed = getTime();\n\t\tres.tokenString = \"DEBUG\";\n\t\tres.signature = \"DEBUG\";\n\t\tres.issued = getTime();\n\t\tres.expires = getTime() + 30 * 60 * 1000;\n\t\tres.hardDeadline = res.completed\n\t\t\t\t+ Globals.REQUEST_DIRECT_PUT_DEADLINE_FROM_NOW;\n\t\tthis.offers.add(res);\n\n\t\tlog(String.format(\"Added to offers: %s\", res.regionId));\n\t}", "private void drawRoute(LatLng prevCoords, LatLng curCoords) {\n\n if(!isRequiredMetersComplete()){\n map.addPolyline(new PolylineOptions()\n .add(prevCoords, curCoords)\n .width(10)\n .color(getResources().getColor(R.color.colorPrimary)));\n }\n else{\n if(isOverPace){\n map.addPolyline(new PolylineOptions()\n .add(prevCoords, curCoords)\n .width(10)\n .color(getResources().getColor(R.color.goodGreen)));\n }else{\n map.addPolyline(new PolylineOptions()\n .add(prevCoords, curCoords)\n .width(10)\n .color(getResources().getColor(R.color.badRed)));\n }\n }\n }", "@Override\n public void onRoutePlanFailed() {\n\n }", "public static void pushRouteToDatabase() {\n Database database = Database.getInstance();\n long distance = calculateTotalDistance(LocationService.getLocationPoints());\n long time = stopStart.getStopTime() - stopStart.getStartTime();\n database.addToDailyDistance(distance);\n database.addToDailyTime(time);\n }", "@Test\n public void shouldLogRouteAddedAndStopped() throws Exception {\n context.start();\n\n //when adding a new route2\n DateTime startTime = DateTime.now();\n context.addRoutes(new RouteBuilder() {\n @Override\n public void configure() throws Exception {\n from(\"direct://route1\").routeId(\"route1\").to(\"mock:result\");\n from(\"direct://route2\").routeId(\"route2\").to(\"mock:result2\");\n }\n });\n\n //should have tried to find it\n doReturn(null).when(repository).findRoute(\"route1\");\n doReturn(null).when(repository).findRoute(\"route2\");\n verify(repository, times(1)).findRoute(\"route1\");\n verify(repository, times(1)).findRoute(\"route2\");\n\n //then the startup should be stored\n ArgumentCaptor<Route> routeArgumentCaptor = ArgumentCaptor.forClass(Route.class);\n verify(repository, times(2)).save(routeArgumentCaptor.capture());\n // with route1\n Route route = routeArgumentCaptor.getAllValues().get(0);\n assertThat(route.getRouteId()).isEqualTo(\"route1\");\n assertThat(route.getUri()).isEqualTo(\"direct://route1\");\n assertThat(route.getDefinition()).isNotNull();\n assertThat(route.getDefinition()).isNotEmpty();\n SortedMap<String, String> steps = route.getSteps();\n assertThat(steps).hasSize(1);\n assertThat(steps.get(steps.keySet().iterator().next())).isEqualTo(\"mock:result\");\n // then route2\n Route route2 = routeArgumentCaptor.getAllValues().get(1);\n assertThat(route2.getRouteId()).isEqualTo(\"route2\");\n assertThat(route2.getUri()).isEqualTo(\"direct://route2\");\n assertThat(route2.getDefinition()).isNotNull();\n assertThat(route2.getDefinition()).isNotEmpty();\n steps = route2.getSteps();\n assertThat(steps).hasSize(1);\n assertThat(steps.get(steps.keySet().iterator().next())).isEqualTo(\"mock:result2\");\n //and a log of the state and time\n ArgumentCaptor<RouteState> routeStateArgumentCaptor = ArgumentCaptor.forClass(RouteState.class);\n verify(repository, times(2)).save(routeStateArgumentCaptor.capture());\n // for route1\n RouteState routeState = routeStateArgumentCaptor.getAllValues().get(0);\n assertThat(routeState.getRouteId()).isEqualTo(\"route1\");\n assertThat(routeState.getState()).isEqualTo(State.Started);\n DateTime timestamp = new DateTime(routeState.getTimestamp());\n assertThat(timestamp.isBeforeNow()).isTrue();\n assertThat(timestamp.isAfter(startTime)).isTrue();\n // and route2\n RouteState routeState2 = routeStateArgumentCaptor.getAllValues().get(0);\n assertThat(routeState2.getRouteId()).isEqualTo(\"route1\");\n assertThat(routeState2.getState()).isEqualTo(State.Started);\n DateTime timestamp2 = new DateTime(routeState2.getTimestamp());\n assertThat(timestamp2.isBeforeNow()).isTrue();\n assertThat(timestamp2.isAfter(startTime)).isTrue();\n }", "public void saveWalk() {\n try {\n long id = this.currentRoute.getId();\n DatabaseHandler db = new DatabaseHandler(this.getApplicationContext());\n currentRoute.setWaypoints(db.getAllWaypoints(id));\n\n HTTPPostSender postSender = new HTTPPostSender();\n postSender.buildString(currentRoute, this.getContentResolver());\n postSender.cm = (ConnectivityManager) getSystemService(this.getApplicationContext().CONNECTIVITY_SERVICE);\n\n\n\n\n if(isOnline()) {\n postSender.execute(this.currentRoute);\n Toast.makeText(this.getApplicationContext(),\"Walk successfully sent to server\",Toast.LENGTH_LONG).show();\n\n } else {\n //oh god why..\n Toast.makeText(this.getApplicationContext(),\"Something bad happened\",Toast.LENGTH_LONG).show();\n }\n } catch(Exception e) {\n Toast.makeText(this.getApplicationContext(),e.getMessage(),Toast.LENGTH_LONG).show();\n }\n }", "@Override\n public void onMapClick(@NonNull LatLng point) {\n \n if (destinationMarker != null) {\n map.removeMarker(destinationMarker);\n }\n\n destinationMarker = map.addMarker(new MarkerOptions().position(point));\n\n destinationPosition = Point.fromLngLat(fLon.get(fLon.size()-1), fLat.get(fLon.size()-1));\n originPosition = Point.fromLngLat(originLocation.getLongitude(), originLocation.getLatitude());\n getRoute(originPosition, destinationPosition);\n\n }", "public static void main(String[] args) throws CantAdd, CoronaWarn {\n\t\tTravelAgency TravelAgency = new TravelAgency();\r\n\r\n\t\tPlane p=new Plane(200,2,\"first plane max travelers\");\r\n\t\tPlane p1=new Plane(100,1,\"second plan min traelers\");\r\n\r\n\t\tTrip i=new Trip(p,Country.Australia,Country.Canada);\r\n\t\tTrip io=new Trip(p1,Country.Australia,Country.Canada);\r\n\t\t \r\n\t\tDate date=new Date(1,2,5);\r\n\t\tPassport passprt1=new Passport(\"anton\",44,date);\r\n\t\tPassport passprt2=new Passport(\"abdo\",44,date);\r\n\t\tPassport passprt3=new Passport(\"julie\",44,date);\r\n\t\tPassport passprt4=new Passport(\"juliana\",44,date);\r\n\t\tPassport passprt5=new Passport(\"bella\",44,date);\r\n\t\tPassport passprt6=new Passport(\"geris\",44,date);\r\n\t\tTraveler t1=new Traveler(passprt1,true,true);\r\n\t\tTraveler t2=new Traveler(passprt2,true,true);\r\n\t\tTraveler t3=new Traveler(passprt3,true,true);\r\n\t\tTraveler t4=new Traveler(passprt4,true,true);\r\n\t\tTraveler t5=new Traveler(passprt5,true,true);\r\n\t\tTraveler t6=new Traveler(passprt6,true,true);\r\n\t\t\r\n\t\t\r\n\t\tio.addTraveler(t1);\r\n\t\tio.addTraveler(t2);\r\n\t\tio.addTraveler(t3);\r\n\t\tio.addTraveler(t6);\r\n\t\tio.addTraveler(t5);\r\n\t\tio.addTraveler(t4);\r\n\t\tio.addTraveler(t6);\r\n \r\n\t\ti.addTraveler(t1);\r\n\t\ti.addTraveler(t2);\r\n\t\ti.addTraveler(t3);\r\n\t\ti.addTraveler(t4);\r\n\t\r\n\t\ti.addTraveler(t6);\r\n\t\t\r\n\t\tTravelAgency.addTrip(i);\t\r\n\t\tTravelAgency.addTrip(io);\r\n\t\tSystem.out.print(TravelAgency.findUnsafeTrips());\r\n\r\n\t\t\r\n\t\tTravelAgency.AddTraveler(t1);\r\n\t\tTravelAgency.AddTraveler(t2);\r\n\t\tTravelAgency.AddTraveler(t3);\r\n\t\tTravelAgency.AddTraveler(t4);\r\n\t\tTravelAgency.AddTraveler(t5);\r\n\t\tTravelAgency.AddTraveler(t6);\r\n\t\t\r\n\t}", "@Then(\"^I can create a route called \\\"([^\\\"]*)\\\" with no stop points$\")\n public void iCanCreateARouteCalledWithNoStopPoints(String routeName) throws Throwable {\n stopPointList = new ArrayList<>();\n route = new Route(routeName, stopPointList);\n }", "@Test\n\tpublic void testWithAnUnexistenceRoute() {\n\t\tassertEquals(Trains.distanceRoute(\"A\", \"E\", \"D\"), \"NO SUCH ROUTE\");\n\t}", "public void registerRoute(RouteHandler handler) {\n Class<? extends RouteHandler> clazz = handler.getClass();\n if (clazz.isAnonymousClass()) {\n throw new RouteException(\"Handler class cannot be anonymous!\");\n }\n\n Method method = handler.getMethod();\n Route route = new Route(clazz, handler.getTemplate(), handler, method);\n List<Route> routes = methodRoutes.get(method);\n if (routes == null) {\n routes = new ArrayList<>();\n routes.add(route);\n methodRoutes.put(method, routes);\n } else {\n routes.add(route);\n }\n\n // we only need to sort if a route with variable segments is inserted\n if (route.getRouteTemplate().getParameterSegmentCount() != 0) {\n routes.sort((a, b) -> {\n int segCountA = a.getRouteTemplate().getParameterSegmentCount();\n int segCountB = b.getRouteTemplate().getParameterSegmentCount();\n return segCountA - segCountB;\n });\n }\n }", "protected void creaNavigatori() {\n /* variabili e costanti locali di lavoro */\n Navigatore nav;\n\n try { // prova ad eseguire il codice\n nav = new NavigatoreRisultati(this);\n this.addNavigatore(nav);\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n }// fine del blocco try-catch\n\n }", "@Test\n\tpublic void checkShortestRoute() {\n\t\tassertEquals(Trains.shortestRoute(\"A\",\"C\"), 9);\n\t\t//assertEquals(Trains.shortestRoute(\"B\",\"B\"), 9);\n\t}", "void setDropLocations(RouteDTO routeDTO, List<RoutePointDTO> points);" ]
[ "0.68826705", "0.6369164", "0.6199664", "0.6196404", "0.6190221", "0.6070374", "0.60549235", "0.6013442", "0.5960286", "0.59343046", "0.5926548", "0.5884793", "0.58726937", "0.5853024", "0.5834168", "0.5735438", "0.57295525", "0.57169324", "0.5697557", "0.56940484", "0.56875134", "0.5680084", "0.5661256", "0.5658878", "0.5638683", "0.562426", "0.56222034", "0.5612358", "0.5611132", "0.5609097", "0.56084126", "0.56035024", "0.56012285", "0.5585593", "0.5538489", "0.55265236", "0.55206025", "0.551526", "0.5502352", "0.54832953", "0.5468314", "0.5446881", "0.544494", "0.5442536", "0.5413018", "0.5405859", "0.54038393", "0.54037195", "0.53899044", "0.53832304", "0.5371509", "0.536646", "0.53510535", "0.5347796", "0.53461206", "0.5340952", "0.5331904", "0.5327924", "0.5325772", "0.531928", "0.5313634", "0.53075504", "0.5306011", "0.53019345", "0.5293321", "0.5293168", "0.52924544", "0.52747095", "0.52697784", "0.52568257", "0.5246164", "0.5244475", "0.52374935", "0.5234297", "0.52334833", "0.5230583", "0.52305114", "0.5229627", "0.5229051", "0.52288353", "0.52285886", "0.5227538", "0.52118224", "0.5203705", "0.5203289", "0.5201972", "0.5201904", "0.52018046", "0.520026", "0.519214", "0.51849806", "0.5182374", "0.51819205", "0.51814073", "0.5176052", "0.5172312", "0.5169682", "0.51612777", "0.5160663", "0.51487964" ]
0.6960296
0
Cette methode utilise un generateur de nombre aleatoires afin de renvoyer une liste de points avec des coordooonees aleatoires
private static List<Point> genererPointsAlea(int nbPoints) { /*List<Point> points = new ArrayList<>(); Random rand = new Random(0); for(int i=0; i<nbPoints; i++) { Point p = new Point(rand.nextDouble(), rand.nextDouble()); points.add(p); } return points;*/ return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List<Point> generatePointList(){\r\n\t\t//Can move up to 3 squares horizontally or vertically, but cannot move diagonally.\r\n List<Point> pointList = new ArrayList<>();\r\n int pointCount = 0;\r\n int px = (int)getCoordinate().getX();\r\n int py = (int)getCoordinate().getY();\r\n\r\n for (int i=px-3;i<=px+3;i++){\r\n for(int j=py-3;j<=py+3;j++){\r\n if((i>=0) && (i<9) && (j>=0) && (j<9) && ((i!=px)||(j!=py))){\r\n if ((i==px)||(j==py)){\r\n pointList.add(pointCount, new Point(i,j));\r\n pointCount+=1;\r\n } \r\n }\r\n }\r\n }\r\n return pointList;\r\n }", "public static void instantiate(){\n listOfpoints = new ArrayList<>(12);\n listOfPolygons = new ArrayList<>(listOfpoints.size());\n\n for ( int i= 0 ; i < 70; i++ ){\n listOfpoints.add(new ArrayList<LatLng>());\n }\n\n listOfpoints.get(0).add(new LatLng(44.4293595,26.1035863));\n listOfpoints.get(0).add(new LatLng(44.4295434,26.1035434));\n listOfpoints.get(0).add(new LatLng(44.4297579,26.103479));\n listOfpoints.get(0).add(new LatLng(44.431566,26.1033503));\n listOfpoints.get(0).add(new LatLng(44.4327305,26.1031572));\n listOfpoints.get(0).add(new LatLng(44.4337724,26.1029211));\n listOfpoints.get(0).add(new LatLng(44.4342474,26.1028138));\n listOfpoints.get(0).add(new LatLng( 44.4348756,26.1025563));\n listOfpoints.get(0).add(new LatLng(44.4353199,26.1023203));\n listOfpoints.get(0).add(new LatLng( 44.4353046,26.101977));\n listOfpoints.get(0).add(new LatLng( 44.4352893,26.1015478));\n listOfpoints.get(0).add(new LatLng(44.4351974,26.1010758));\n listOfpoints.get(0).add(new LatLng(44.4350595,26.100432));\n listOfpoints.get(0).add(new LatLng(44.4348756,26.0995523));\n listOfpoints.get(0).add(new LatLng(44.4346458,26.0983292));\n listOfpoints.get(0).add(new LatLng(44.4343547,26.098415));\n listOfpoints.get(0).add(new LatLng( 44.4340176,26.0983506));\n listOfpoints.get(0).add(new LatLng( 44.4327918,26.0975996));\n listOfpoints.get(0).add(new LatLng(44.4318878,26.0972134));\n listOfpoints.get(0).add(new LatLng( 44.4307692,26.0968701));\n listOfpoints.get(0).add(new LatLng( 44.4300644,26.0968271));\n listOfpoints.get(0).add(new LatLng( 44.4298498,26.0972992));\n listOfpoints.get(0).add(new LatLng(44.4297732,26.0977713));\n listOfpoints.get(0).add(new LatLng(44.4296966,26.0985867));\n listOfpoints.get(0).add(new LatLng (44.4296506,26.0994235));\n listOfpoints.get(0).add(new LatLng (44.4295587,26.1002389));\n listOfpoints.get(0).add(new LatLng (44.4294361,26.1007754));\n listOfpoints.get(0).add(new LatLng (44.4292369,26.1016766));\n listOfpoints.get(0).add(new LatLng (44.429099,26.1025778));\n listOfpoints.get(0).add(new LatLng (44.4289917,26.1033717));\n\n\n listOfpoints.get(1).add(new LatLng (44.4356099,26.1021262));\n listOfpoints.get(1).add(new LatLng (44.43630606,26.1017829));\n listOfpoints.get(1).add(new LatLng (44.4370654,26.101461));\n listOfpoints.get(1).add(new LatLng (44.4382451,26.1007958));\n listOfpoints.get(1).add(new LatLng (44.4393176,26.1002379));\n listOfpoints.get(1).add(new LatLng (44.4406045,26.0996371));\n listOfpoints.get(1).add(new LatLng (44.4418301,26.0990792));\n listOfpoints.get(1).add(new LatLng (44.4415084,26.0983067));\n listOfpoints.get(1).add(new LatLng (44.4412173,26.0977059));\n listOfpoints.get(1).add(new LatLng (44.4409875,26.097148));\n listOfpoints.get(1).add(new LatLng (44.4406811,26.0965472));\n listOfpoints.get(1).add(new LatLng (44.4404207,26.0959893));\n listOfpoints.get(1).add(new LatLng (44.4400989,26.0963326));\n listOfpoints.get(1).add(new LatLng (44.4393636,26.0968691));\n listOfpoints.get(1).add(new LatLng (44.4390725,26.0969549));\n listOfpoints.get(1).add(new LatLng (44.4381532,26.0971051));\n listOfpoints.get(1).add(new LatLng (44.4372952,26.0975557));\n listOfpoints.get(1).add(new LatLng (44.4365598,26.0977703));\n listOfpoints.get(1).add(new LatLng (44.4358244,26.0977918));\n listOfpoints.get(1).add(new LatLng (44.435043,26.0980063));\n listOfpoints.get(1).add(new LatLng (44.4348132,26.0979205));\n listOfpoints.get(1).add(new LatLng (44.4348591,26.0983497));\n listOfpoints.get(1).add(new LatLng (44.4352115,26.1003452));\n listOfpoints.get(1).add(new LatLng (44.435472,26.1017185));\n listOfpoints.get(1).add(new LatLng (44.4356099,26.1021262));\n\n\n listOfpoints.get(2).add(new LatLng (44.4358071,26.1034753));\n listOfpoints.get(2).add(new LatLng (44.435899,26.1039688));\n listOfpoints.get(2).add(new LatLng (44.4360216,26.1044623));\n listOfpoints.get(2).add(new LatLng (44.4360982,26.1049988));\n listOfpoints.get(2).add(new LatLng (44.4362361,26.1055781));\n listOfpoints.get(2).add(new LatLng (44.4363127,26.1059));\n listOfpoints.get(2).add(new LatLng (44.4364506,26.1063721));\n listOfpoints.get(2).add(new LatLng (44.4365425,26.1067583));\n listOfpoints.get(2).add(new LatLng (44.4367264,26.1068441));\n listOfpoints.get(2).add(new LatLng (44.4369715,26.1071016));\n listOfpoints.get(2).add(new LatLng (44.4374312,26.1073591));\n listOfpoints.get(2).add(new LatLng (44.4380593,26.1076381));\n listOfpoints.get(2).add(new LatLng (44.4386722,26.1078741));\n listOfpoints.get(2).add(new LatLng (44.439239,26.1080672));\n listOfpoints.get(2).add(new LatLng (44.4399744,26.1083033));\n listOfpoints.get(2).add(new LatLng (44.4406485,26.1084106));\n listOfpoints.get(2).add(new LatLng (44.4407557,26.1080458));\n listOfpoints.get(2).add(new LatLng (44.440817,26.1075737));\n listOfpoints.get(2).add(new LatLng (44.440863,26.1070373));\n listOfpoints.get(2).add(new LatLng (44.4410928,26.1070587));\n listOfpoints.get(2).add(new LatLng (44.4419814,26.1071016));\n listOfpoints.get(2).add(new LatLng (44.4422877,26.1071875));\n listOfpoints.get(2).add(new LatLng (44.4432069,26.107445));\n listOfpoints.get(2).add(new LatLng (44.443498,26.107402));\n listOfpoints.get(2).add(new LatLng (44.4433754,26.10693));\n listOfpoints.get(2).add(new LatLng (44.4432988,26.1065008));\n listOfpoints.get(2).add(new LatLng (44.4431763,26.1059858));\n listOfpoints.get(2).add(new LatLng (44.4429465,26.1052992));\n listOfpoints.get(2).add(new LatLng (44.4429312,26.1044838));\n listOfpoints.get(2).add(new LatLng (44.4429312,26.1036469));\n listOfpoints.get(2).add(new LatLng (44.4429618,26.1029818));\n listOfpoints.get(2).add(new LatLng (44.4432069,26.1027457));\n listOfpoints.get(2).add(new LatLng (44.4431303,26.1025311));\n listOfpoints.get(2).add(new LatLng (44.4429618,26.1022737));\n listOfpoints.get(2).add(new LatLng (44.4427627,26.101866));\n listOfpoints.get(2).add(new LatLng (44.4426707,26.1015656));\n listOfpoints.get(2).add(new LatLng (44.4426554,26.101072));\n listOfpoints.get(2).add(new LatLng (44.4427014,26.1002781));\n listOfpoints.get(2).add(new LatLng (44.4427933,26.0989692));\n listOfpoints.get(2).add(new LatLng (44.4420426,26.0993125));\n listOfpoints.get(2).add(new LatLng (44.4412,26.0997202));\n listOfpoints.get(2).add(new LatLng (44.4400663,26.100321));\n listOfpoints.get(2).add(new LatLng (44.4390399,26.100836));\n listOfpoints.get(2).add(new LatLng (44.4382279,26.1012651));\n listOfpoints.get(2).add(new LatLng (44.4374924,26.1016514));\n listOfpoints.get(2).add(new LatLng (44.4366038,26.1021449));\n listOfpoints.get(2).add(new LatLng (44.4358071,26.1026384));\n listOfpoints.get(2).add(new LatLng (44.4357305,26.1027886));\n listOfpoints.get(2).add(new LatLng (44.4358071,26.1034753));\n\n\n listOfpoints.get(3).add(new LatLng (44.4290806,26.1040332));\n listOfpoints.get(3).add(new LatLng (44.4295709,26.1054494));\n listOfpoints.get(3).add(new LatLng (44.4302604,26.1070373));\n listOfpoints.get(3).add(new LatLng (44.4307508,26.1080887));\n listOfpoints.get(3).add(new LatLng (44.432804,26.111994));\n listOfpoints.get(3).add(new LatLng (44.4329113,26.1123373));\n listOfpoints.get(3).add(new LatLng (44.4330798,26.1136248));\n listOfpoints.get(3).add(new LatLng (44.4332483,26.1150195));\n listOfpoints.get(3).add(new LatLng (44.433325,26.1158349));\n listOfpoints.get(3).add(new LatLng (44.4347959,26.1162855));\n listOfpoints.get(3).add(new LatLng (44.4359143,26.1166288));\n listOfpoints.get(3).add(new LatLng (44.4365272,26.1168005));\n listOfpoints.get(3).add(new LatLng (44.4367723,26.1168434));\n listOfpoints.get(3).add(new LatLng (44.4373852,26.1166503));\n listOfpoints.get(3).add(new LatLng (44.43809,26.1163713));\n listOfpoints.get(3).add(new LatLng (44.4378755,26.1154272));\n listOfpoints.get(3).add(new LatLng (44.435516,26.1027672));\n listOfpoints.get(3).add(new LatLng (44.433708,26.1034109));\n listOfpoints.get(3).add(new LatLng (44.4330032,26.1035826));\n listOfpoints.get(3).add(new LatLng (44.4321451,26.1038401));\n listOfpoints.get(3).add(new LatLng (44.4309959,26.1039259));\n listOfpoints.get(3).add(new LatLng (44.4302451,26.1039903));\n listOfpoints.get(3).add(new LatLng (44.4296628,26.1039903));\n listOfpoints.get(3).add(new LatLng(44.4290806,26.1040332));\n\n\n\n listOfpoints.get(4).add(new LatLng ( 44.4343669 ,26.0798289));\n listOfpoints.get(4).add(new LatLng (44.434229 ,26.0801508));\n listOfpoints.get(4).add(new LatLng (44.4335088 ,26.0905363));\n listOfpoints.get(4).add(new LatLng (44.4333862 ,26.092124));\n listOfpoints.get(4).add(new LatLng ( 44.433233 ,26.0926177));\n listOfpoints.get(4).add(new LatLng ( 44.4329879 ,26.0932614));\n listOfpoints.get(4).add(new LatLng (44.4327427 , 26.0936906));\n listOfpoints.get(4).add(new LatLng (44.4301838 ,26.0965659));\n listOfpoints.get(4).add(new LatLng (44.4301685 ,26.0967161));\n listOfpoints.get(4).add(new LatLng (44.4305209 ,26.096759));\n listOfpoints.get(4).add(new LatLng (44.4311338 ,26.0968878));\n listOfpoints.get(4).add(new LatLng (44.4317468 ,26.097038));\n listOfpoints.get(4).add(new LatLng (44.4323137 ,26.0972955));\n listOfpoints.get(4).add(new LatLng (44.4327427 ,26.0974457));\n listOfpoints.get(4).add(new LatLng (44.4333709 ,26.0978534));\n listOfpoints.get(4).add(new LatLng (44.4338919 ,26.0981538));\n listOfpoints.get(4).add(new LatLng (44.434229 ,26.0982611));\n listOfpoints.get(4).add(new LatLng ( 44.4345354 ,26.0982611));\n listOfpoints.get(4).add(new LatLng (44.4346886 ,26.0981752));\n listOfpoints.get(4).add(new LatLng (44.4345814, 26.0918667));\n listOfpoints.get(4).add(new LatLng (44.4343669 ,26.0798289));\n\n\n listOfpoints.get(5).add(new LatLng (44.4348405,26.097773));\n listOfpoints.get(5).add(new LatLng (44.435043,26.0980063));\n listOfpoints.get(5).add(new LatLng (44.4365598,26.0977703));\n listOfpoints.get(5).add(new LatLng (44.4372952, 26.0975557));\n listOfpoints.get(5).add(new LatLng (44.4381532, 26.0971051));\n listOfpoints.get(5).add(new LatLng ( 44.4393636,26.0968691));\n listOfpoints.get(5).add(new LatLng(44.4397739, 26.0964855));\n listOfpoints.get(5).add(new LatLng (44.4402029,26.0960993));\n listOfpoints.get(5).add(new LatLng (44.4406778,26.0956487));\n listOfpoints.get(5).add(new LatLng(44.4405706,26.0952195));\n listOfpoints.get(5).add(new LatLng (44.4403408 ,26.0942539));\n listOfpoints.get(5).add(new LatLng (44.440065 ,26.0931811));\n listOfpoints.get(5).add(new LatLng (44.4400497, 26.0919151));\n listOfpoints.get(5).add(new LatLng (44.4398199 ,26.0897693));\n listOfpoints.get(5).add(new LatLng (44.4397893 ,26.0891041));\n listOfpoints.get(5).add(new LatLng (44.4399271 , 26.0879668));\n listOfpoints.get(5).add(new LatLng (44.4399731 ,26.0873017));\n listOfpoints.get(5).add(new LatLng (44.4399884 ,26.0867223));\n listOfpoints.get(5).add(new LatLng (44.4365719, 26.0887179));\n listOfpoints.get(5).add(new LatLng (44.434672 ,26.0898337));\n listOfpoints.get(5).add(new LatLng (44.4348405 ,26.097773));\n\n\n listOfpoints.get(6).add(new LatLng (44.4365425,26.1067583));\n listOfpoints.get(6).add(new LatLng (44.4365354,26.1075151));\n listOfpoints.get(6).add(new LatLng (44.4375926,26.113137));\n listOfpoints.get(6).add(new LatLng (44.4378224,26.114167));\n listOfpoints.get(6).add(new LatLng (44.4435828,26.1191452));\n listOfpoints.get(6).add(new LatLng (44.4440117, 26.1184585));\n listOfpoints.get(6).add(new LatLng (44.4448849, 26.1172784));\n listOfpoints.get(6).add(new LatLng (44.4457888,26.1161411));\n listOfpoints.get(6).add(new LatLng (44.4462483, 26.1149395));\n listOfpoints.get(6).add(new LatLng (44.4466773, 26.113137));\n listOfpoints.get(6).add(new LatLng (44.4467998, 26.1121929));\n listOfpoints.get(6).add(new LatLng (44.4467539, 26.1112917));\n listOfpoints.get(6).add(new LatLng (44.4469683, 26.1101973));\n listOfpoints.get(6).add(new LatLng (44.4458041, 26.1093176));\n listOfpoints.get(6).add(new LatLng (44.4453905, 26.1091888));\n listOfpoints.get(6).add(new LatLng (44.4448083, 26.1089099));\n listOfpoints.get(6).add(new LatLng (44.4442109, 26.1084163));\n listOfpoints.get(6).add(new LatLng (44.4435828, 26.1076224));\n listOfpoints.get(6).add(new LatLng (44.4433377, 26.107558));\n listOfpoints.get(6).add(new LatLng (44.4420662,26.1072791));\n listOfpoints.get(6).add(new LatLng (44.440863,26.1070373));\n listOfpoints.get(6).add(new LatLng (44.4407946,26.1082018));\n listOfpoints.get(6).add(new LatLng ( 44.4406107,26.1085451));\n listOfpoints.get(6).add(new LatLng (44.43986, 26.1084163));\n listOfpoints.get(6).add(new LatLng (44.4384659, 26.1079014));\n listOfpoints.get(6).add(new LatLng (44.4372095, 26.1073864));\n listOfpoints.get(6).add(new LatLng (44.4365425, 26.1067583));\n\n\n listOfpoints.get(7).add(new LatLng (44.4268641,26.1040563));\n listOfpoints.get(7).add(new LatLng ( 44.4265883,26.1107511));\n listOfpoints.get(7).add(new LatLng (44.4261898,26.118905));\n listOfpoints.get(7).add(new LatLng (44.4274311,26.1189909));\n listOfpoints.get(7).add(new LatLng (44.4276303,26.1189265));\n listOfpoints.get(7).add(new LatLng (44.4285497,26.1191625));\n listOfpoints.get(7).add(new LatLng (44.4288408,26.1193342));\n listOfpoints.get(7).add(new LatLng (44.4294997,26.1199564));\n listOfpoints.get(7).add(new LatLng (44.4297909, 26.1200852));\n listOfpoints.get(7).add(new LatLng (44.4303272,26.1203427));\n listOfpoints.get(7).add(new LatLng (44.431124, 26.1205787));\n listOfpoints.get(7).add(new LatLng (44.4328861, 26.1207289));\n listOfpoints.get(7).add(new LatLng (44.4329933, 26.1206431));\n listOfpoints.get(7).add(new LatLng (44.4331159, 26.1194844));\n listOfpoints.get(7).add(new LatLng (44.4331925,26.118154));\n listOfpoints.get(7).add(new LatLng (44.4332844,26.1160512));\n listOfpoints.get(7).add(new LatLng (44.4328094,26.112339));\n listOfpoints.get(7).add(new LatLng (44.4327022, 26.1120171));\n listOfpoints.get(7).add(new LatLng (44.4299135, 26.1064596));\n listOfpoints.get(7).add(new LatLng (44.4289634,26.1040778));\n listOfpoints.get(7).add(new LatLng (44.4281819,26.1039705));\n listOfpoints.get(7).add(new LatLng (44.4268641,26.1040563));\n\n\n\n\n listOfpoints.get(8).add (new LatLng (44.4262461,26.1007836));\n listOfpoints.get(8).add (new LatLng (44.4260163,26.1014488));\n listOfpoints.get(8).add (new LatLng (44.4259397,26.1023715));\n listOfpoints.get(8).add (new LatLng (44.4258784,26.103616));\n listOfpoints.get(8).add (new LatLng (44.426001,26.1039593));\n listOfpoints.get(8).add (new LatLng (44.42643,26.1039593));\n listOfpoints.get(8).add (new LatLng (44.4272882,26.1038735));\n listOfpoints.get(8).add (new LatLng (44.4282995,26.1038306));\n listOfpoints.get(8).add (new LatLng (44.4289278,26.1035731));\n listOfpoints.get(8).add (new LatLng (44.4289431,26.1028006));\n listOfpoints.get(8).add (new LatLng (44.4291423,26.1015132));\n listOfpoints.get(8).add (new LatLng (44.4286366,26.1007836));\n listOfpoints.get(8).add (new LatLng (44.4284834,26.1010196));\n listOfpoints.get(8).add (new LatLng (44.4271043,26.1008694));\n listOfpoints.get(8).add (new LatLng (44.4262461, 26.1007836));\n\n\n\n listOfpoints.get(9).add(new LatLng (44.4262461,26.1007836));\n listOfpoints.get(9).add(new LatLng (44.4284834,26.1010196));\n listOfpoints.get(9).add(new LatLng (44.4290094,26.1000479));\n listOfpoints.get(9).add(new LatLng (44.4292545,26.0986961));\n listOfpoints.get(9).add(new LatLng (44.4293465,26.0971726));\n listOfpoints.get(9).add(new LatLng (44.4294844,26.0964216));\n listOfpoints.get(9).add(new LatLng (44.4301739,26.0956276));\n listOfpoints.get(9).add(new LatLng (44.432411,26.0931385));\n listOfpoints.get(9).add(new LatLng (44.4327022,26.0925163));\n listOfpoints.get(9).add(new LatLng (44.4328401,26.0919584));\n listOfpoints.get(9).add(new LatLng (44.4329014, 26.0913576));\n listOfpoints.get(9).add(new LatLng (44.4260059,26.0907353));\n listOfpoints.get(9).add(new LatLng (44.4262051,26.091658));\n listOfpoints.get(9).add(new LatLng (44.4265882, 26.0922588));\n listOfpoints.get(9).add(new LatLng (44.4269867,26.0926879));\n listOfpoints.get(9).add(new LatLng (44.4267108,26.0998763));\n listOfpoints.get(9).add(new LatLng (44.4262461,26.1007836));\n\n\n listOfpoints.get(10).add(new LatLng (44.4260059,26.0907353));\n listOfpoints.get(10).add(new LatLng (44.4215507, 26.0903665));\n listOfpoints.get(10).add(new LatLng (44.4255811,26.0980483));\n listOfpoints.get(10).add(new LatLng ( 44.4265772,26.0999795));\n listOfpoints.get(10).add(new LatLng (44.4266998,26.099722));\n listOfpoints.get(10).add(new LatLng (44.4269867, 26.0926879));\n listOfpoints.get(10).add(new LatLng (44.4265882,26.0922588));\n listOfpoints.get(10).add(new LatLng (44.4262051,26.091658));\n listOfpoints.get(10).add(new LatLng (44.4260059,26.0907353));\n\n\n listOfpoints.get(11).add(new LatLng (44.4214281, 26.0905382));\n listOfpoints.get(11).add(new LatLng (44.4207385, 26.0915467));\n listOfpoints.get(11).add(new LatLng (44.4199568, 26.0929629));\n listOfpoints.get(11).add(new LatLng (44.4192059,26.0943576));\n listOfpoints.get(11).add(new LatLng (44.4187155,26.095409));\n listOfpoints.get(11).add(new LatLng (44.4186235,26.0957524));\n listOfpoints.get(11).add(new LatLng (44.4189607, 26.0968253));\n listOfpoints.get(11).add(new LatLng (44.4212442,26.1039063));\n listOfpoints.get(11).add(new LatLng (44.4227001,26.1039921));\n listOfpoints.get(11).add(new LatLng (44.4251367,26.1039921));\n listOfpoints.get(11).add(new LatLng (44.425765,26.103799));\n listOfpoints.get(11).add(new LatLng (44.425811,26.1027476));\n listOfpoints.get(11).add(new LatLng (44.4259182,26.101503));\n listOfpoints.get(11).add(new LatLng (44.4260715,26.1009237));\n listOfpoints.get(11).add(new LatLng (44.4264086,26.1001297));\n listOfpoints.get(11).add(new LatLng (44.4260255, 26.0993143));\n listOfpoints.get(11).add(new LatLng (44.4252899, 26.0978981));\n listOfpoints.get(11).add(new LatLng (44.424064,26.0955593));\n listOfpoints.get(11).add(new LatLng (44.4230372,26.0935851));\n listOfpoints.get(11).add(new LatLng (44.4214281,26.0905382));\n\n\n listOfpoints.get(12).add(new LatLng (44.4213365,26.1040423));\n listOfpoints.get(12).add(new LatLng (44.4216123,26.1052654));\n listOfpoints.get(12).add(new LatLng (44.4226851,26.1084411));\n listOfpoints.get(12).add(new LatLng (44.4237731,26.1117241));\n listOfpoints.get(12).add(new LatLng (44.4244168,26.11181));\n listOfpoints.get(12).add(new LatLng (44.4263629,26.1118743));\n listOfpoints.get(12).add(new LatLng (44.4264242,26.1109946));\n listOfpoints.get(12).add(new LatLng (44.4265315,26.1078832));\n listOfpoints.get(12).add(new LatLng (44.4267154,26.1041496));\n listOfpoints.get(12).add(new LatLng (44.4254588, 26.1042354));\n listOfpoints.get(12).add(new LatLng (44.4242482,26.1041925));\n listOfpoints.get(12).add(new LatLng (44.4213365,26.1040423));\n\n\n\n listOfpoints.get(13).add(new LatLng (44.4212442, 26.1039063));\n listOfpoints.get(13).add(new LatLng (44.4208987, 26.1041756));\n listOfpoints.get(13).add(new LatLng (44.4155345,26.1045404));\n listOfpoints.get(13).add(new LatLng (44.4156111, 26.1051198));\n listOfpoints.get(13).add(new LatLng (44.4156724, 26.106257));\n listOfpoints.get(13).add(new LatLng (44.4157184,26.1068793));\n listOfpoints.get(13).add(new LatLng (44.4157797, 26.1071153));\n listOfpoints.get(13).add(new LatLng (44.415841, 26.1077805));\n listOfpoints.get(13).add(new LatLng (44.4159024,26.1090465));\n listOfpoints.get(13).add(new LatLng (44.416025,26.1110635));\n listOfpoints.get(13).add(new LatLng (44.4161629,26.1116643));\n listOfpoints.get(13).add(new LatLng (44.4163468, 26.112072));\n listOfpoints.get(13).add(new LatLng (44.4166993,26.1127158));\n listOfpoints.get(13).add(new LatLng (44.4170518, 26.1133595));\n listOfpoints.get(13).add(new LatLng (44.4177109, 26.1127158));\n listOfpoints.get(13).add(new LatLng (44.4184006,26.1118575));\n listOfpoints.get(13).add(new LatLng (44.4190136,26.1112566));\n listOfpoints.get(13).add(new LatLng (44.4199331, 26.1107846));\n listOfpoints.get(13).add(new LatLng (44.4215883,26.1101838));\n listOfpoints.get(13).add(new LatLng (44.4229369,26.10954));\n listOfpoints.get(13).add(new LatLng (44.422753, 26.1089178));\n listOfpoints.get(13).add(new LatLng (44.4222626,26.1074372));\n listOfpoints.get(13).add(new LatLng (44.4217262,26.1059137));\n listOfpoints.get(13).add(new LatLng (44.4212442, 26.1039063));\n\n\n\n listOfpoints.get(14).add(new LatLng (44.4172379,26.1135832));\n listOfpoints.get(14).add(new LatLng (44.4169314,26.1139266));\n listOfpoints.get(14).add(new LatLng (44.4177284,26.1143128));\n listOfpoints.get(14).add(new LatLng (44.4185253,26.1147205));\n listOfpoints.get(14).add(new LatLng (44.4237666,26.1189047));\n listOfpoints.get(14).add(new LatLng (44.4237819,26.1191408));\n listOfpoints.get(14).add(new LatLng (44.4240425,26.1191622));\n listOfpoints.get(14).add(new LatLng (44.4258814,26.1192481));\n listOfpoints.get(14).add(new LatLng (44.425912,26.1188404));\n listOfpoints.get(14).add(new LatLng (44.426004,26.1167804));\n listOfpoints.get(14).add(new LatLng (44.4261113,26.1148063));\n listOfpoints.get(14).add(new LatLng (44.4262798,26.1120812));\n listOfpoints.get(14).add(new LatLng (44.4238739,26.1119525));\n listOfpoints.get(14).add(new LatLng (44.4235674,26.1115662));\n listOfpoints.get(14).add(new LatLng (44.4230157,26.109914));\n listOfpoints.get(14).add(new LatLng (44.4218817,26.1103646));\n listOfpoints.get(14).add(new LatLng (44.4200733,26.1110512));\n listOfpoints.get(14).add(new LatLng (44.4187246,26.1118666));\n listOfpoints.get(14).add(new LatLng (44.4172379,26.1135832));\n\n\n listOfpoints.get(15).add(new LatLng (44.4329128,26.0911565));\n listOfpoints.get(15).add(new LatLng (44.4334184,26.0843973));\n listOfpoints.get(15).add(new LatLng (44.4305378,26.0839467));\n listOfpoints.get(15).add(new LatLng (44.4304765,26.0840969));\n listOfpoints.get(15).add(new LatLng (44.4305531,26.0845475));\n listOfpoints.get(15).add(new LatLng (44.4306604,26.0853844));\n listOfpoints.get(15).add(new LatLng (44.4302773,26.0908131));\n listOfpoints.get(15).add(new LatLng (44.4304765,26.0910277));\n listOfpoints.get(15).add(new LatLng (44.4329128,26.0911565));\n\n\n listOfpoints.get(16).add(new LatLng (44.4254029,26.0786466));\n listOfpoints.get(16).add(new LatLng (44.4252956,26.0790543));\n listOfpoints.get(16).add(new LatLng (44.4246213,26.0901265));\n listOfpoints.get(16).add(new LatLng (44.4247746,26.0905127));\n listOfpoints.get(16).add(new LatLng (44.4298621,26.0909634));\n listOfpoints.get(16).add(new LatLng (44.4300919,26.0907273));\n listOfpoints.get(16).add(new LatLng (44.430475,26.0853414));\n listOfpoints.get(16).add(new LatLng ( 44.4291112,26.0806422));\n listOfpoints.get(16).add(new LatLng (44.428391,26.0795693));\n listOfpoints.get(16).add(new LatLng (44.4277781,26.0794835));\n listOfpoints.get(16).add(new LatLng (44.42574,26.0784535));\n listOfpoints.get(16).add(new LatLng (44.4254029,26.0786466));\n\n\n listOfpoints.get(17).add(new LatLng (44.4334039,26.1159853));\n listOfpoints.get(17).add(new LatLng (44.433312,26.1178736));\n listOfpoints.get(17).add(new LatLng (44.4331128,26.1208562));\n listOfpoints.get(17).add(new LatLng (44.4327757,26.1238603));\n listOfpoints.get(17).add(new LatLng (44.4325765,26.1256413));\n listOfpoints.get(17).add(new LatLng (44.4354264,26.1251477));\n listOfpoints.get(17).add(new LatLng (44.4389196,26.122723));\n listOfpoints.get(17).add(new LatLng (44.4391954,26.1224012));\n listOfpoints.get(17).add(new LatLng (44.4381383,26.1165003));\n listOfpoints.get(17).add(new LatLng (44.4368666,26.1169724));\n listOfpoints.get(17).add(new LatLng (44.4364683,26.1169295));\n listOfpoints.get(17).add(new LatLng (44.4334039,26.1159853));\n\n\n listOfpoints.get(18).add(new LatLng (44.4454662,26.0911104));\n listOfpoints.get(18).add(new LatLng (44.4453896, 26.0909388));\n listOfpoints.get(18).add(new LatLng (44.4444245,26.0918185));\n listOfpoints.get(18).add(new LatLng (44.4428313, 26.093342));\n listOfpoints.get(18).add(new LatLng (44.4413912,26.0947797));\n listOfpoints.get(18).add(new LatLng (44.4405333,26.0959169));\n listOfpoints.get(18).add(new LatLng (44.4419274,26.0990069));\n listOfpoints.get(18).add(new LatLng (44.4433368,26.0983202));\n listOfpoints.get(18).add(new LatLng (44.4452824,26.0973761));\n listOfpoints.get(18).add(new LatLng (44.446707,26.0966894));\n listOfpoints.get(18).add(new LatLng (44.4468296,26.0961959));\n listOfpoints.get(18).add(new LatLng (44.4465385,26.0945651));\n listOfpoints.get(18).add(new LatLng (44.4462628,26.0935351));\n listOfpoints.get(18).add(new LatLng (44.4454662,26.0911104));\n\n\n listOfpoints.get(19).add(new LatLng (44.4401196,26.0817507));\n listOfpoints.get(19).add(new LatLng (44.4401043,26.0831669));\n listOfpoints.get(19).add(new LatLng (44.4402115,26.0846046));\n listOfpoints.get(19).add(new LatLng (44.440089,26.0863641));\n listOfpoints.get(19).add(new LatLng (44.4399358,26.0894755));\n listOfpoints.get(19).add(new LatLng ( 44.4402115, 26.0932949));\n listOfpoints.get(19).add(new LatLng (44.4407937,26.0953763));\n listOfpoints.get(19).add(new LatLng (44.440855,26.0952047));\n listOfpoints.get(19).add(new LatLng (44.4450832,26.0910419));\n listOfpoints.get(19).add(new LatLng (44.4454509,26.0905698));\n listOfpoints.get(19).add(new LatLng (44.4445011,26.0879949));\n listOfpoints.get(19).add(new LatLng (44.4437964,26.0862783));\n listOfpoints.get(19).add(new LatLng (44.4434287,26.0840681));\n listOfpoints.get(19).add(new LatLng (44.443061, 26.0812143));\n listOfpoints.get(19).add(new LatLng (44.4423257, 26.0809997));\n listOfpoints.get(19).add(new LatLng (44.4419887, 26.0810211));\n listOfpoints.get(19).add(new LatLng (44.4411767, 26.0813215));\n listOfpoints.get(19).add(new LatLng (44.4401196, 26.0817507));\n\n\n listOfpoints.get(20).add(new LatLng (44.418527,26.0958537));\n listOfpoints.get(20).add(new LatLng (44.4145114,26.0985144));\n listOfpoints.get(20).add(new LatLng (44.4143275,26.098729));\n listOfpoints.get(20).add(new LatLng (44.4143275,26.0990294));\n listOfpoints.get(20).add(new LatLng (44.4143735, 26.0993727));\n listOfpoints.get(20).add(new LatLng (44.4144195, 26.0998233));\n listOfpoints.get(20).add(new LatLng (44.4142969, 26.1008104));\n listOfpoints.get(20).add(new LatLng (44.4140976,26.1009177));\n listOfpoints.get(20).add(new LatLng (44.4138983,26.1008962));\n listOfpoints.get(20).add(new LatLng (44.4138064,26.1006602));\n listOfpoints.get(20).add(new LatLng (44.4137451,26.1000379));\n listOfpoints.get(20).add(new LatLng (44.4130247,26.098729));\n listOfpoints.get(20).add(new LatLng (44.4127335,26.0984286));\n listOfpoints.get(20).add(new LatLng (44.4113386,26.0985144));\n listOfpoints.get(20).add(new LatLng (44.4102503, 26.0985788));\n listOfpoints.get(20).add(new LatLng (44.414021,26.1043509));\n listOfpoints.get(20).add(new LatLng (44.4143122,26.1043938));\n listOfpoints.get(20).add(new LatLng (44.4159522,26.1042865));\n listOfpoints.get(20).add(new LatLng (44.4191554,26.104029));\n listOfpoints.get(20).add(new LatLng (44.4210711,26.1038574));\n listOfpoints.get(20).add(new LatLng (44.4208259,26.1030205));\n listOfpoints.get(20).add(new LatLng (44.4203508,26.1016258));\n listOfpoints.get(20).add(new LatLng (44.4198297,26.1000379));\n listOfpoints.get(20).add(new LatLng (44.4192167, 26.0981067));\n listOfpoints.get(20).add(new LatLng (44.418527,26.0958537));\n\n\n listOfpoints.get(21).add(new LatLng (44.410189,26.0984071));\n listOfpoints.get(21).add(new LatLng (44.4103883,26.0984715));\n listOfpoints.get(21).add(new LatLng (44.4128867,26.0983213));\n listOfpoints.get(21).add(new LatLng (44.4138524, 26.1000594));\n listOfpoints.get(21).add(new LatLng (44.4138524,26.1004671));\n listOfpoints.get(21).add(new LatLng (44.4139597,26.1007246));\n listOfpoints.get(21).add(new LatLng (44.4141742,26.1007246));\n listOfpoints.get(21).add(new LatLng (44.4142662,26.1003812));\n listOfpoints.get(21).add(new LatLng (44.4143275,26.0996946));\n listOfpoints.get(21).add(new LatLng (44.4141589,26.0986646));\n listOfpoints.get(21).add(new LatLng (44.418435,26.0957464));\n listOfpoints.get(21).add(new LatLng (44.4190021,26.0946306));\n listOfpoints.get(21).add(new LatLng (44.4183737,26.0934504));\n listOfpoints.get(21).add(new LatLng (44.4176534, 26.0933431));\n listOfpoints.get(21).add(new LatLng (44.4165652, 26.0933431));\n listOfpoints.get(21).add(new LatLng (44.4155996,26.0927423));\n listOfpoints.get(21).add(new LatLng (44.4149406,26.0921415));\n listOfpoints.get(21).add(new LatLng (44.4142662,26.0919055));\n listOfpoints.get(21).add(new LatLng (44.412994, 26.0920986));\n listOfpoints.get(21).add(new LatLng (44.4098211,26.0943945));\n listOfpoints.get(21).add(new LatLng (44.4096679,26.0947164));\n listOfpoints.get(21).add(new LatLng (44.4096985, 26.0953816));\n listOfpoints.get(21).add(new LatLng (44.4088401, 26.0962399));\n listOfpoints.get(21).add(new LatLng (44.4088248,26.0966047));\n listOfpoints.get(21).add(new LatLng (44.410189, 26.0984071));\n\n\n listOfpoints.get(22).add(new LatLng (44.4238034,26.0734041));\n listOfpoints.get(22).add(new LatLng (44.4252745,26.0779102));\n listOfpoints.get(22).add(new LatLng (44.426102,26.0783394));\n listOfpoints.get(22).add(new LatLng (44.4286458, 26.079541));\n listOfpoints.get(22).add(new LatLng (44.4293813,26.0807855));\n listOfpoints.get(22).add(new LatLng (44.4303313,26.0837038));\n listOfpoints.get(22).add(new LatLng (44.4329668,26.08409));\n listOfpoints.get(22).add(new LatLng (44.4335797,26.0839613));\n listOfpoints.get(22).add(new LatLng (44.4337023,26.0821159));\n listOfpoints.get(22).add(new LatLng (44.4339474,26.0797556));\n listOfpoints.get(22).add(new LatLng (44.434499,26.078039));\n listOfpoints.get(22).add(new LatLng (44.4358473,26.0748632));\n listOfpoints.get(22).add(new LatLng (44.4351732,26.073962));\n listOfpoints.get(22).add(new LatLng (44.433212,26.0710867));\n listOfpoints.get(22).add(new LatLng (44.4312201,26.0683401));\n listOfpoints.get(22).add(new LatLng (44.4299329,26.067396));\n listOfpoints.get(22).add(new LatLng (44.4283087,26.0655506));\n listOfpoints.get(22).add(new LatLng (44.4274812,26.0668381));\n listOfpoints.get(22).add(new LatLng (44.4261633,26.0691984));\n listOfpoints.get(22).add(new LatLng (44.4249374,26.0715587));\n listOfpoints.get(22).add(new LatLng (44.4238034,26.0734041));\n\n\n listOfpoints.get(23).add(new LatLng (44.4205851,26.0657652));\n listOfpoints.get(23).add(new LatLng (44.4169069,26.0695417));\n listOfpoints.get(23).add(new LatLng (44.4131364,26.073447));\n listOfpoints.get(23).add(new LatLng (44.4139948,26.0749491));\n listOfpoints.get(23).add(new LatLng (44.4156807,26.0782106));\n listOfpoints.get(23).add(new LatLng (44.4178265,26.0819443));\n listOfpoints.get(23).add(new LatLng (44.4184089,26.0840471));\n listOfpoints.get(23).add(new LatLng (44.4213514,26.0900982));\n listOfpoints.get(23).add(new LatLng (44.4240486, 26.0903986));\n listOfpoints.get(23).add(new LatLng (44.424447,26.0897978));\n listOfpoints.get(23).add(new LatLng (44.4252132,26.0783394));\n listOfpoints.get(23).add(new LatLng (44.4236808, 26.0737474));\n listOfpoints.get(23).add(new LatLng (44.4205851,26.0657652));\n\n\n\n listOfpoints.get(24).add(new LatLng (44.4427933,26.0989692));\n listOfpoints.get(24).add(new LatLng (44.442854,26.1011417));\n listOfpoints.get(24).add(new LatLng (44.4434668,26.1027725));\n listOfpoints.get(24).add(new LatLng (44.4430685, 26.1033304));\n listOfpoints.get(24).add(new LatLng (44.4430685,26.1047895));\n listOfpoints.get(24).add(new LatLng (44.4437732,26.1076648));\n listOfpoints.get(24).add(new LatLng (44.4446617,26.1085661));\n listOfpoints.get(24).add(new LatLng (44.4461629,26.1092956));\n listOfpoints.get(24).add(new LatLng (44.447174,26.1100252));\n listOfpoints.get(24).add(new LatLng (44.4473272,26.108609));\n listOfpoints.get(24).add(new LatLng (44.4480624,26.107064));\n listOfpoints.get(24).add(new LatLng (44.4480931,26.1060341));\n listOfpoints.get(24).add(new LatLng (44.4476948,26.1029871));\n listOfpoints.get(24).add(new LatLng (44.448522, 26.1028583));\n listOfpoints.get(24).add(new LatLng (44.4499006,26.102515));\n listOfpoints.get(24).add(new LatLng (44.4509729, 26.101485));\n listOfpoints.get(24).add(new LatLng (44.4529335,26.1007555));\n listOfpoints.get(24).add(new LatLng (44.452719,26.0935457));\n listOfpoints.get(24).add(new LatLng (44.4521063,26.0865934));\n listOfpoints.get(24).add(new LatLng (44.4506359,26.0897262));\n listOfpoints.get(24).add(new LatLng (44.4472046,26.0966785));\n listOfpoints.get(24).add(new LatLng (44.4465306,26.0971077));\n listOfpoints.get(24).add(new LatLng (44.4427933,26.0989692));\n\n\n listOfpoints.get(25).add(new LatLng (44.3944544,26.1201103));\n listOfpoints.get(25).add(new LatLng (44.3948837,26.1205394));\n listOfpoints.get(25).add(new LatLng (44.400587,26.1207969));\n listOfpoints.get(25).add(new LatLng (44.4069336,26.1209686));\n listOfpoints.get(25).add(new LatLng (44.4075468,26.1204536));\n listOfpoints.get(25).add(new LatLng (44.4081599,26.119252));\n listOfpoints.get(25).add(new LatLng (44.4083439, 26.1177499));\n listOfpoints.get(25).add(new LatLng (44.4084665, 26.1148317));\n listOfpoints.get(25).add(new LatLng (44.4090183,26.1131151));\n listOfpoints.get(25).add(new LatLng (44.4102139, 26.1109693));\n listOfpoints.get(25).add(new LatLng (44.411992,26.106549));\n listOfpoints.get(25).add(new LatLng (44.4128197, 26.105562));\n listOfpoints.get(25).add(new LatLng (44.4140152, 26.1047037));\n listOfpoints.get(25).add(new LatLng (44.4105512, 26.099468));\n listOfpoints.get(25).add(new LatLng (44.4088344, 26.0971077));\n listOfpoints.get(25).add(new LatLng (44.4074854,26.0960777));\n listOfpoints.get(25).add(new LatLng (44.4067803, 26.0957773));\n listOfpoints.get(25).add(new LatLng (44.4047262, 26.096936));\n listOfpoints.get(25).add(new LatLng (44.4024267, 26.098481));\n listOfpoints.get(25).add(new LatLng (44.4015068, 26.0996826));\n listOfpoints.get(25).add(new LatLng (44.3998818, 26.1055191));\n listOfpoints.get(25).add(new LatLng (44.3944544, 26.1201103));\n\n\n\n listOfpoints.get(26).add(new LatLng (44.4523651,26.0865441));\n listOfpoints.get(26).add(new LatLng (44.4526408,26.0898486));\n listOfpoints.get(26).add(new LatLng (44.4530697,26.0983887));\n listOfpoints.get(26).add(new LatLng (44.4558573,26.0971013));\n listOfpoints.get(26).add(new LatLng ( 44.4622592,26.0925522));\n listOfpoints.get(26).add(new LatLng ( 44.4635762, 26.0910073));\n listOfpoints.get(26).add(new LatLng (44.4658121,26.0865441));\n listOfpoints.get(26).add(new LatLng (44.4631474,26.0864153));\n listOfpoints.get(26).add(new LatLng (44.4534067,26.0861578));\n listOfpoints.get(26).add(new LatLng (44.4523651,26.0865441));\n\n\n\n listOfpoints.get(27).add(new LatLng (44.4346864, 26.0895482));\n listOfpoints.get(27).add(new LatLng (44.4398343, 26.0864583));\n listOfpoints.get(27).add(new LatLng (44.439865,26.0816947));\n listOfpoints.get(27).add(new LatLng (44.4420098,26.0807076));\n listOfpoints.get(27).add(new LatLng (44.4429903, 26.0808793));\n listOfpoints.get(27).add(new LatLng (44.4426532,26.0791626));\n listOfpoints.get(27).add(new LatLng (44.4405084, 26.0729399));\n listOfpoints.get(27).add(new LatLng (44.440202, 26.0727253));\n listOfpoints.get(27).add(new LatLng (44.4384555, 26.0702363));\n listOfpoints.get(27).add(new LatLng (44.4362186, 26.0744849));\n listOfpoints.get(27).add(new LatLng (44.4344413,26.0792914));\n listOfpoints.get(27).add(new LatLng (44.4346864,26.0895482));\n\n\n\n listOfpoints.get(28).add(new LatLng (44.443266, 26.0812226));\n listOfpoints.get(28).add(new LatLng (44.443061,26.0812143));\n listOfpoints.get(28).add(new LatLng (44.4437562,26.0855141));\n listOfpoints.get(28).add(new LatLng (44.4440626,26.0866299));\n listOfpoints.get(28).add(new LatLng (44.444798, 26.0884753));\n listOfpoints.get(28).add(new LatLng (44.4465443,26.0937539));\n listOfpoints.get(28).add(new LatLng (44.4468813,26.0958138));\n listOfpoints.get(28).add(new LatLng (44.4471264,26.0961142));\n listOfpoints.get(28).add(new LatLng (44.4492097, 26.0919943));\n listOfpoints.get(28).add(new LatLng (44.4507109,26.0889473));\n listOfpoints.get(28).add(new LatLng (44.4519056, 26.0864153));\n listOfpoints.get(28).add(new LatLng (44.4518137,26.0848275));\n listOfpoints.get(28).add(new LatLng (44.4481987, 26.0827246));\n listOfpoints.get(28).add(new LatLng (44.4455026,26.081523));\n listOfpoints.get(28).add(new LatLng (44.443266, 26.0812226));\n\n\n\n listOfpoints.get(29).add(new LatLng (44.4380283, 26.1146959));\n listOfpoints.get(29).add(new LatLng (44.437967, 26.115168));\n listOfpoints.get(29).add(new LatLng (44.4410924, 26.131905));\n listOfpoints.get(29).add(new LatLng (44.4413375,26.1327204));\n listOfpoints.get(29).add(new LatLng (44.443758, 26.1284717));\n listOfpoints.get(29).add(new LatLng (44.4467299, 26.1259827));\n listOfpoints.get(29).add(new LatLng (44.4480167,26.1254248));\n listOfpoints.get(29).add(new LatLng (44.4491809, 26.124266));\n listOfpoints.get(29).add(new LatLng (44.4380283, 26.1146959));\n\n\n listOfpoints.get(30).add(new LatLng (44.4129016,26.0735409));\n listOfpoints.get(30).add(new LatLng (44.4072915,26.0791628));\n listOfpoints.get(30).add(new LatLng (44.4031525,26.0816948));\n listOfpoints.get(30).add(new LatLng (44.4003317,26.0844414));\n listOfpoints.get(30).add(new LatLng (44.3973268,26.0850422));\n listOfpoints.get(30).add(new LatLng (44.4005463,26.0880463));\n listOfpoints.get(30).add(new LatLng (44.4017115, 26.0912221));\n listOfpoints.get(30).add(new LatLng (44.4043176,26.0963719));\n listOfpoints.get(30).add(new LatLng (44.4048695, 26.096329));\n listOfpoints.get(30).add(new LatLng (44.4060652,26.0956423));\n listOfpoints.get(30).add(new LatLng (44.4070462,26.0953848));\n listOfpoints.get(30).add(new LatLng (44.4084871, 26.096329));\n listOfpoints.get(30).add(new LatLng (44.4094682, 26.0951703));\n listOfpoints.get(30).add(new LatLng (44.4094375, 26.0944836));\n listOfpoints.get(30).add(new LatLng (44.4132388, 26.09178));\n listOfpoints.get(30).add(new LatLng (44.4145263, 26.091737));\n listOfpoints.get(30).add(new LatLng (44.4163656,26.0929387));\n listOfpoints.get(30).add(new LatLng (44.4183273,26.0930674));\n listOfpoints.get(30).add(new LatLng (44.4189404,26.0941832));\n listOfpoints.get(30).add(new LatLng (44.4212086, 26.0904067));\n listOfpoints.get(30).add(new LatLng (44.4210553,26.0898488));\n listOfpoints.get(30).add(new LatLng (44.4186339, 26.0850852));\n listOfpoints.get(30).add(new LatLng (44.4181741,26.0840123));\n listOfpoints.get(30).add(new LatLng (44.4176836, 26.0822527));\n listOfpoints.get(30).add(new LatLng (44.4171932,26.0813944));\n listOfpoints.get(30).add(new LatLng (44.4150781, 26.077575));\n listOfpoints.get(30).add(new LatLng (44.4129016, 26.0735409));\n\n\n\n listOfpoints.get(31).add(new LatLng (44.4152528, 26.1045537));\n listOfpoints.get(31).add(new LatLng (44.4142412, 26.1048541));\n listOfpoints.get(31).add(new LatLng (44.4125552,26.1062274));\n listOfpoints.get(31).add(new LatLng (44.4118501,26.1074291));\n listOfpoints.get(31).add(new LatLng (44.4107158,26.1103473));\n listOfpoints.get(31).add(new LatLng (44.4093976,26.1127935));\n listOfpoints.get(31).add(new LatLng (44.4087844, 26.1144243));\n listOfpoints.get(31).add(new LatLng (44.4085392, 26.1156259));\n listOfpoints.get(31).add(new LatLng (44.4085392,26.1170421));\n listOfpoints.get(31).add(new LatLng (44.4083246, 26.1195741));\n listOfpoints.get(31).add(new LatLng (44.4074355, 26.1209903));\n listOfpoints.get(31).add(new LatLng (44.409183, 26.1223636));\n listOfpoints.get(31).add(new LatLng (44.4168774, 26.1136518));\n listOfpoints.get(31).add(new LatLng (44.4158658, 26.1113344));\n listOfpoints.get(31).add(new LatLng (44.4156513, 26.1077295));\n listOfpoints.get(31).add(new LatLng (44.4152528,26.1045537));\n\n\n listOfpoints.get(32).add(new LatLng (44.4169364, 26.1141937));\n listOfpoints.get(32).add(new LatLng (44.4164766, 26.114537));\n listOfpoints.get(32).add(new LatLng (44.4110201,26.120631));\n listOfpoints.get(32).add(new LatLng (44.4094872,26.122648));\n listOfpoints.get(32).add(new LatLng (44.4131046, 26.1296003));\n listOfpoints.get(32).add(new LatLng (44.4151891, 26.1329906));\n listOfpoints.get(32).add(new LatLng (44.4171203, 26.1348789));\n listOfpoints.get(32).add(new LatLng (44.4201242, 26.1365526));\n listOfpoints.get(32).add(new LatLng (44.4204001,26.1351364));\n listOfpoints.get(32).add(new LatLng (44.4206759, 26.1333339));\n listOfpoints.get(32).add(new LatLng (44.42181,26.1313169));\n listOfpoints.get(32).add(new LatLng (44.4228827, 26.1314028));\n listOfpoints.get(32).add(new LatLng (44.4255799, 26.1284845));\n listOfpoints.get(32).add(new LatLng (44.4256412, 26.1274975));\n listOfpoints.get(32).add(new LatLng (44.4257638, 26.1234634));\n listOfpoints.get(32).add(new LatLng (44.425917, 26.1195152));\n listOfpoints.get(32).add(new LatLng (44.4238635, 26.1194294));\n listOfpoints.get(32).add(new LatLng (44.4193273,26.115567));\n listOfpoints.get(32).add(new LatLng (44.4169364, 26.1141937));\n\n\n listOfpoints.get(33).add(new LatLng (44.4261929,26.1191112));\n listOfpoints.get(33).add(new LatLng (44.4255799,26.1284845));\n listOfpoints.get(33).add(new LatLng (44.4318104,26.1386596));\n listOfpoints.get(33).add(new LatLng (44.4320863,26.1385309));\n listOfpoints.get(33).add(new LatLng (44.4313814,26.1329948));\n listOfpoints.get(33).add(new LatLng (44.4316879,26.129819));\n listOfpoints.get(33).add(new LatLng (44.4326992,26.1229526));\n listOfpoints.get(33).add(new LatLng (44.4328861,26.1207289));\n listOfpoints.get(33).add(new LatLng (44.4300024, 26.1205493));\n listOfpoints.get(33).add(new LatLng (44.4288684,26.1196481));\n listOfpoints.get(33).add(new LatLng (44.4275797,26.1191541));\n listOfpoints.get(33).add(new LatLng (44.4261929,26.1191112));\n\n\n listOfpoints.get(34).add(new LatLng (44.4202782, 26.1364709));\n listOfpoints.get(34).add(new LatLng (44.4204314,26.1366855));\n listOfpoints.get(34).add(new LatLng (44.4255806,26.1375009));\n listOfpoints.get(34).add(new LatLng (44.4293579,26.1390888));\n listOfpoints.get(34).add(new LatLng (44.4303615,26.139196));\n listOfpoints.get(34).add(new LatLng (44.4317406,26.1386596));\n listOfpoints.get(34).add(new LatLng (44.4266686,26.1303877));\n listOfpoints.get(34).add(new LatLng (44.4255882,26.128596));\n listOfpoints.get(34).add(new LatLng (44.4250212,26.1291968));\n listOfpoints.get(34).add(new LatLng (44.4230214, 26.1315571));\n listOfpoints.get(34).add(new LatLng (44.4227685,26.1316644));\n listOfpoints.get(34).add(new LatLng (44.4217877,26.1315678));\n listOfpoints.get(34).add(new LatLng (44.4207762,26.1334668));\n listOfpoints.get(34).add(new LatLng (44.4202782,26.1364709));\n\n\n listOfpoints.get(35).add(new LatLng (44.4438143,26.1191764));\n listOfpoints.get(35).add(new LatLng (44.4437985,26.1194425));\n listOfpoints.get(35).add(new LatLng (44.4469926,26.1222749));\n listOfpoints.get(35).add(new LatLng (44.4492443, 26.1240881));\n listOfpoints.get(35).add(new LatLng (44.4504315,26.123144));\n listOfpoints.get(35).add(new LatLng (44.4512893,26.1217492));\n listOfpoints.get(35).add(new LatLng (44.451421, 26.1212347));\n listOfpoints.get(35).add(new LatLng (44.4523401, 26.1180161));\n listOfpoints.get(35).add(new LatLng (44.4527077, 26.1145399));\n listOfpoints.get(35).add(new LatLng (44.452944, 26.1009052));\n listOfpoints.get(35).add(new LatLng (44.4516573,26.1013558));\n listOfpoints.get(35).add(new LatLng (44.4510217,26.1016777));\n listOfpoints.get(35).add(new LatLng (44.4500413,26.1025574));\n listOfpoints.get(35).add(new LatLng (44.449712,26.1027291));\n listOfpoints.get(35).add(new LatLng (44.4477666,26.1031153));\n listOfpoints.get(35).add(new LatLng (44.4479198,26.1042526));\n listOfpoints.get(35).add(new LatLng (44.448027,26.1051967));\n listOfpoints.get(35).add(new LatLng (44.4481419,26.1058619));\n listOfpoints.get(35).add(new LatLng (44.4481189, 26.1070206));\n listOfpoints.get(35).add(new LatLng (44.448004,26.1073425));\n listOfpoints.get(35).add(new LatLng (44.4473836,26.1088338));\n listOfpoints.get(35).add(new LatLng (44.4472917,26.1100569));\n listOfpoints.get(35).add(new LatLng (44.4471385, 26.1102929));\n listOfpoints.get(35).add(new LatLng (44.4469241,26.1116877));\n listOfpoints.get(35).add(new LatLng (44.4469394,26.1122456));\n listOfpoints.get(35).add(new LatLng (44.4467403,26.1136403));\n listOfpoints.get(35).add(new LatLng (44.445959,26.1161938));\n listOfpoints.get(35).add(new LatLng (44.4448254,26.1176744));\n listOfpoints.get(35).add(new LatLng (44.4438143,26.1191764));\n\n\n listOfpoints.get(36).add(new LatLng (44.4391967, 26.1225882));\n listOfpoints.get(36).add(new LatLng (44.4372662,26.123983));\n listOfpoints.get(36).add(new LatLng (44.4356115, 26.1252275));\n listOfpoints.get(36).add(new LatLng (44.4344471, 26.1254207));\n listOfpoints.get(36).add(new LatLng (44.4324705,26.1258069));\n listOfpoints.get(36).add(new LatLng (44.4315052, 26.1327377));\n listOfpoints.get(36).add(new LatLng (44.432256,26.1385742));\n listOfpoints.get(36).add(new LatLng (44.4351059,26.1373511));\n listOfpoints.get(36).add(new LatLng (44.4376339, 26.1363641));\n listOfpoints.get(36).add(new LatLng (44.4389822, 26.1353985));\n listOfpoints.get(36).add(new LatLng (44.4401772,26.1345402));\n listOfpoints.get(36).add(new LatLng (44.4411883, 26.1334458));\n listOfpoints.get(36).add(new LatLng (44.4402231, 26.1281458));\n listOfpoints.get(36).add(new LatLng (44.4398861,26.126279));\n listOfpoints.get(36).add(new LatLng (44.4391967, 26.1225882));\n\n\n\n listOfpoints.get(37).add(new LatLng (44.3978822,26.1102715));\n listOfpoints.get(37).add(new LatLng (44.3977135, 26.1097995));\n listOfpoints.get(37).add(new LatLng (44.3909519,26.1099282));\n listOfpoints.get(37).add(new LatLng (44.3874558, 26.1100784));\n listOfpoints.get(37).add(new LatLng (44.3877779, 26.1129538));\n listOfpoints.get(37).add(new LatLng (44.3881766, 26.1154428));\n listOfpoints.get(37).add(new LatLng (44.3886059, 26.1165586));\n listOfpoints.get(37).add(new LatLng (44.3894799, 26.1180178));\n listOfpoints.get(37).add(new LatLng (44.3906606, 26.1193052));\n listOfpoints.get(37).add(new LatLng (44.3927152, 26.1205927));\n listOfpoints.get(37).add(new LatLng (44.3936352, 26.1206785));\n listOfpoints.get(37).add(new LatLng (44.3940339, 26.1202279));\n listOfpoints.get(37).add(new LatLng (44.3978822,26.1102715));\n\n\n\n listOfpoints.get(38).add(new LatLng (44.389256,26.0917973));\n listOfpoints.get(38).add(new LatLng (44.3892556,26.0920523));\n listOfpoints.get(38).add(new LatLng (44.4003643, 26.0970731));\n listOfpoints.get(38).add(new LatLng (44.4008548, 26.0971482));\n listOfpoints.get(38).add(new LatLng (44.4030625, 26.0971601));\n listOfpoints.get(38).add(new LatLng (44.4043195,26.0965593));\n listOfpoints.get(38).add(new LatLng (44.4019587, 26.0920531));\n listOfpoints.get(38).add(new LatLng (44.4005636,26.0883195));\n listOfpoints.get(38).add(new LatLng (44.3987104,26.0864919));\n listOfpoints.get(38).add(new LatLng (44.3972443, 26.0851884));\n listOfpoints.get(38).add(new LatLng (44.3961557,26.0851884));\n listOfpoints.get(38).add(new LatLng (44.3946992,26.0841584));\n listOfpoints.get(38).add(new LatLng (44.3918473,26.0856819));\n listOfpoints.get(38).add(new LatLng (44.3912493,26.08639));\n listOfpoints.get(38).add(new LatLng (44.389256, 26.0917973));\n\n\n\n listOfpoints.get(39).add(new LatLng (44.4029942,26.0973363));\n listOfpoints.get(39).add(new LatLng (44.4011008,26.0974224));\n listOfpoints.get(39).add(new LatLng (44.399997,26.0972078));\n listOfpoints.get(39).add(new LatLng (44.389065,26.0922189));\n listOfpoints.get(39).add(new LatLng (44.3863339,26.0922418));\n listOfpoints.get(39).add(new LatLng (44.387806,26.0981212));\n listOfpoints.get(39).add(new LatLng (44.3887261,26.1004386));\n listOfpoints.get(39).add(new LatLng (44.3889714,26.1023269));\n listOfpoints.get(39).add(new LatLng (44.3887567,26.1040435));\n listOfpoints.get(39).add(new LatLng (44.3875607,26.1097513));\n listOfpoints.get(39).add(new LatLng (44.3977341,26.1097306));\n listOfpoints.get(39).add(new LatLng (44.3979142,26.1101973));\n listOfpoints.get(39).add(new LatLng (44.397964,26.1101222));\n listOfpoints.get(39).add(new LatLng (44.3996198,26.1059165));\n listOfpoints.get(39).add(new LatLng (44.4016128,26.0990715));\n listOfpoints.get(39).add(new LatLng (44.4030402,26.0978593));\n listOfpoints.get(39).add(new LatLng (44.4029942,26.0973363));\n\n\n\n listOfpoints.get(40).add(new LatLng (44.4496116, 26.1241839));\n listOfpoints.get(40).add(new LatLng (44.4494277,26.1245701));\n listOfpoints.get(40).add(new LatLng (44.4610682, 26.1325953));\n listOfpoints.get(40).add(new LatLng (44.4618646,26.1326811));\n listOfpoints.get(40).add(new LatLng (44.4644374, 26.1345265));\n listOfpoints.get(40).add(new LatLng (44.4660607, 26.1368439));\n listOfpoints.get(40).add(new LatLng (44.4665813,26.1365435));\n listOfpoints.get(40).add(new LatLng (44.4663976,26.1354277));\n listOfpoints.get(40).add(new LatLng (44.4667345, 26.1349985));\n listOfpoints.get(40).add(new LatLng (44.4681739, 26.1354277));\n listOfpoints.get(40).add(new LatLng (44.4701952, 26.1371014));\n listOfpoints.get(40).add(new LatLng (44.4719714, 26.1368868));\n listOfpoints.get(40).add(new LatLng (44.4730739, 26.1358998));\n listOfpoints.get(40).add(new LatLng (44.4731964,26.1346981));\n listOfpoints.get(40).add(new LatLng (44.4687252,26.1305783));\n listOfpoints.get(40).add(new LatLng (44.466857,26.1310932));\n listOfpoints.get(40).add(new LatLng (44.4662751, 26.1310932));\n listOfpoints.get(40).add(new LatLng (44.4658769, 26.1300633));\n listOfpoints.get(40).add(new LatLng (44.4666426, 26.129162));\n listOfpoints.get(40).add(new LatLng (44.4689089,26.1285183));\n listOfpoints.get(40).add(new LatLng (44.4697971, 26.1290333));\n listOfpoints.get(40).add(new LatLng (44.4723389, 26.1319945));\n listOfpoints.get(40).add(new LatLng (44.4743294,26.1327669));\n listOfpoints.get(40).add(new LatLng (44.4750338,26.1320374));\n listOfpoints.get(40).add(new LatLng (44.4756462,26.1297199));\n listOfpoints.get(40).add(new LatLng (44.4742376,26.1249563));\n listOfpoints.get(40).add(new LatLng (44.4742988, 26.1238835));\n listOfpoints.get(40).add(new LatLng (44.4741457,26.1231968));\n listOfpoints.get(40).add(new LatLng (44.4676533,26.1269734));\n listOfpoints.get(40).add(new LatLng (44.4668876,26.1267588));\n listOfpoints.get(40).add(new LatLng (44.4649275,26.1207506));\n listOfpoints.get(40).add(new LatLng (44.4648662,26.120064));\n listOfpoints.get(40).add(new LatLng (44.4674389,26.118562));\n listOfpoints.get(40).add(new LatLng (44.4689089,26.1177895));\n listOfpoints.get(40).add(new LatLng (44.4710833,26.1160729));\n listOfpoints.get(40).add(new LatLng (44.4714202,26.1163304));\n listOfpoints.get(40).add(new LatLng (44.4722777,26.116502));\n listOfpoints.get(40).add(new LatLng (44.4729208,26.1131117));\n listOfpoints.get(40).add(new LatLng (44.4723083,26.1107084));\n listOfpoints.get(40).add(new LatLng (44.4725227,26.1095926));\n listOfpoints.get(40).add(new LatLng (44.4733801,26.1087343));\n listOfpoints.get(40).add(new LatLng (44.4735945, 26.1082194));\n listOfpoints.get(40).add(new LatLng (44.4700727,26.1101076));\n listOfpoints.get(40).add(new LatLng (44.4533184,26.1047861));\n listOfpoints.get(40).add(new LatLng (44.4531039,26.105344));\n listOfpoints.get(40).add(new LatLng (44.4528589,26.1152146));\n listOfpoints.get(40).add(new LatLng (44.4526138,26.1174891));\n listOfpoints.get(40).add(new LatLng (44.452093,26.1197207));\n listOfpoints.get(40).add(new LatLng (44.4508982,26.1229822));\n listOfpoints.get(40).add(new LatLng (44.4496116, 26.1241839));\n\n\n listOfpoints.get(41).add(new LatLng (44.4531249,26.1045259));\n listOfpoints.get(41).add(new LatLng (44.4550165,26.1051764));\n listOfpoints.get(41).add(new LatLng (44.4698103,26.1097469));\n listOfpoints.get(41).add(new LatLng (44.4709588,26.1093392));\n listOfpoints.get(41).add(new LatLng (44.4739216,26.1077299));\n listOfpoints.get(41).add(new LatLng (44.4734929,26.1050262));\n listOfpoints.get(41).add(new LatLng (44.4721455,26.105155));\n listOfpoints.get(41).add(new LatLng (44.4701242,26.1040392));\n listOfpoints.get(41).add(new LatLng (44.467521, 26.101593));\n listOfpoints.get(41).add(new LatLng (44.4673067, 26.1001768));\n listOfpoints.get(41).add(new LatLng (44.4664185,26.099061));\n listOfpoints.get(41).add(new LatLng (44.4660816,26.0979023));\n listOfpoints.get(41).add(new LatLng (44.4662041,26.0968294));\n listOfpoints.get(41).add(new LatLng (44.4671535,26.0960569));\n listOfpoints.get(41).add(new LatLng (44.4677661,26.0958853));\n listOfpoints.get(41).add(new LatLng (44.4680723,26.0951986));\n listOfpoints.get(41).add(new LatLng (44.4691748,26.0952415));\n listOfpoints.get(41).add(new LatLng (44.4720536,26.0967865));\n listOfpoints.get(41).add(new LatLng (44.4742278,26.0964861));\n listOfpoints.get(41).add(new LatLng (44.4749015, 26.0951986));\n listOfpoints.get(41).add(new LatLng (44.4747178,26.0948124));\n listOfpoints.get(41).add(new LatLng (44.4719617,26.0923662));\n listOfpoints.get(41).add(new LatLng (44.4714717,26.0908642));\n listOfpoints.get(41).add(new LatLng (44.4717167,26.0897913));\n listOfpoints.get(41).add(new LatLng (44.4723598,26.0888901));\n listOfpoints.get(41).add(new LatLng (44.4732479,26.0894909));\n listOfpoints.get(41).add(new LatLng (44.4732785,26.0900917));\n listOfpoints.get(41).add(new LatLng (44.4732479,26.0907783));\n listOfpoints.get(41).add(new LatLng (44.4735235,26.0912075));\n listOfpoints.get(41).add(new LatLng (44.4740135,26.0907354));\n listOfpoints.get(41).add(new LatLng (44.4734316,26.0891046));\n listOfpoints.get(41).add(new LatLng (44.4724211,26.0881176));\n listOfpoints.get(41).add(new LatLng (44.4661428,26.0866585));\n listOfpoints.get(41).add(new LatLng (44.4639989,26.09095));\n listOfpoints.get(41).add(new LatLng (44.4621305,26.0931387));\n listOfpoints.get(41).add(new LatLng (44.4558053,26.0973375));\n listOfpoints.get(41).add(new LatLng (44.4531632,26.0985928));\n listOfpoints.get(41).add(new LatLng (44.4531249,26.1045259));\n\n\n\n listOfpoints.get(42).add(new LatLng (44.4386598, 26.0701274));\n listOfpoints.get(42).add(new LatLng (44.4404676, 26.072638));\n listOfpoints.get(42).add(new LatLng (44.4426125, 26.0786676));\n listOfpoints.get(42).add(new LatLng (44.4427656, 26.0791182));\n listOfpoints.get(42).add(new LatLng (44.4429801, 26.0806202));\n listOfpoints.get(42).add(new LatLng (44.4461972, 26.0758781));\n listOfpoints.get(42).add(new LatLng ( 44.4465955, 26.0753846));\n listOfpoints.get(42).add(new LatLng ( 44.4468405, 26.0753202));\n listOfpoints.get(42).add(new LatLng (44.4474227, 26.0759639));\n listOfpoints.get(42).add(new LatLng (44.4501186, 26.0695052));\n listOfpoints.get(42).add(new LatLng ( 44.4472848, 26.063776));\n listOfpoints.get(42).add(new LatLng ( 44.4461972,26.0623597));\n listOfpoints.get(42).add(new LatLng (44.4454925, 26.0618233));\n listOfpoints.get(42).add(new LatLng ( 44.4442057,26.0612654));\n listOfpoints.get(42).add(new LatLng (44.4432099,26.0609435));\n listOfpoints.get(42).add(new LatLng ( 44.4429035,26.062467));\n listOfpoints.get(42).add(new LatLng (44.4385679, 26.0699558));\n listOfpoints.get(42).add(new LatLng (44.4386598, 26.0701274));\n\n\n\n listOfpoints.get(43).add(new LatLng ( 44.4430787,26.0806953));\n listOfpoints.get(43).add(new LatLng ( 44.443126, 26.0810753));\n listOfpoints.get(43).add(new LatLng ( 44.4455924,26.0813757));\n listOfpoints.get(43).add(new LatLng (44.4467107,26.0816761));\n listOfpoints.get(43).add(new LatLng (44.4514593,26.0842939));\n listOfpoints.get(43).add(new LatLng (44.4518575,26.0844441));\n listOfpoints.get(43).add(new LatLng (44.4519188,26.0818906));\n listOfpoints.get(43).add(new LatLng (44.4520107,26.0813971));\n listOfpoints.get(43).add(new LatLng (44.452026,26.0767193));\n listOfpoints.get(43).add(new LatLng (44.4527, 26.0732861));\n listOfpoints.get(43).add(new LatLng ( 44.4511682,26.0706039));\n listOfpoints.get(43).add(new LatLng (44.4503219, 26.069692));\n listOfpoints.get(43).add(new LatLng (44.4502719,26.0698017));\n listOfpoints.get(43).add(new LatLng (44.4475595, 26.0760068));\n listOfpoints.get(43).add(new LatLng (44.447414, 26.0761356));\n listOfpoints.get(43).add(new LatLng (44.4468242, 26.0754811));\n listOfpoints.get(43).add(new LatLng (44.4465485, 26.0755562));\n listOfpoints.get(43).add(new LatLng (44.4462728, 26.0759746));\n listOfpoints.get(43).add(new LatLng (44.4430787,26.0806953));\n\n\n\n listOfpoints.get(44).add(new LatLng (44.4283234, 26.0653913));\n listOfpoints.get(44).add(new LatLng (44.4299706,26.0672689));\n listOfpoints.get(44).add(new LatLng (44.431342,26.068213));\n listOfpoints.get(44).add(new LatLng (44.4358314, 26.0745752));\n listOfpoints.get(44).add(new LatLng (44.4382828,26.0698974));\n listOfpoints.get(44).add(new LatLng (44.4353105,26.0630095));\n listOfpoints.get(44).add(new LatLng (44.435096,26.0616792));\n listOfpoints.get(44).add(new LatLng (44.4344678, 26.0595763));\n listOfpoints.get(44).add(new LatLng (44.4320315, 26.0595334));\n listOfpoints.get(44).add(new LatLng (44.4316178, 26.0600913));\n listOfpoints.get(44).add(new LatLng (44.4291968, 26.0639));\n listOfpoints.get(44).add(new LatLng (44.4283234, 26.0653913));\n\n\n listOfpoints.get(45).add(new LatLng (44.4413922,26.133057));\n listOfpoints.get(45).add(new LatLng (44.441285, 26.1333359));\n listOfpoints.get(45).add(new LatLng (44.4414535,26.1345376));\n listOfpoints.get(45).add(new LatLng (44.4428936,26.1475195));\n listOfpoints.get(45).add(new LatLng (44.443154,26.1493863));\n listOfpoints.get(45).add(new LatLng (44.4434451, 26.149794));\n listOfpoints.get(45).add(new LatLng (44.4437515,26.1497082));\n listOfpoints.get(45).add(new LatLng (44.4445175,26.1494721));\n listOfpoints.get(45).add(new LatLng (44.4454979,26.1488713));\n listOfpoints.get(45).add(new LatLng (44.4459574,26.1481847));\n listOfpoints.get(45).add(new LatLng (44.447091,26.147262));\n listOfpoints.get(45).add(new LatLng (44.448148,26.1456527));\n listOfpoints.get(45).add(new LatLng (44.4520847, 26.1353101));\n listOfpoints.get(45).add(new LatLng (44.4529577,26.1321129));\n listOfpoints.get(45).add(new LatLng (44.4531262,26.1316623));\n listOfpoints.get(45).add(new LatLng (44.4536776, 26.1311473));\n listOfpoints.get(45).add(new LatLng (44.4547192, 26.1298813));\n listOfpoints.get(45).add(new LatLng (44.455148,26.1288513));\n listOfpoints.get(45).add(new LatLng (44.449833, 26.1251177));\n listOfpoints.get(45).add(new LatLng (44.4491437, 26.12471));\n listOfpoints.get(45).add(new LatLng (44.4477038,26.1259545));\n listOfpoints.get(45).add(new LatLng (44.4462332, 26.1266841));\n listOfpoints.get(45).add(new LatLng (44.4447013, 26.1279501));\n listOfpoints.get(45).add(new LatLng (44.4436596, 26.129259));\n listOfpoints.get(45).add(new LatLng (44.4413922,26.133057));\n\n\n\n listOfpoints.get(46).add(new LatLng (44.4322314,26.1388506));\n listOfpoints.get(46).add(new LatLng (44.4335155,26.1535014));\n listOfpoints.get(46).add(new LatLng (44.4338066,26.1552395));\n listOfpoints.get(46).add(new LatLng (44.434971,26.1596598));\n listOfpoints.get(46).add(new LatLng (44.4350966, 26.1598576));\n listOfpoints.get(46).add(new LatLng (44.4421748,26.1571969));\n listOfpoints.get(46).add(new LatLng (44.4425731, 26.1570252));\n listOfpoints.get(46).add(new LatLng (44.4429102, 26.1561669));\n listOfpoints.get(46).add(new LatLng (44.443477, 26.1502231));\n listOfpoints.get(46).add(new LatLng (44.4429255, 26.1494077));\n listOfpoints.get(46).add(new LatLng (44.442328, 26.144215));\n listOfpoints.get(46).add(new LatLng (44.4418837, 26.1404384));\n listOfpoints.get(46).add(new LatLng (44.4412556, 26.1349882));\n listOfpoints.get(46).add(new LatLng (44.4411331, 26.1338295));\n listOfpoints.get(46).add(new LatLng (44.4406428,26.1344732));\n listOfpoints.get(46).add(new LatLng (44.4388656, 26.1357821));\n listOfpoints.get(46).add(new LatLng (44.4374868, 26.1367048));\n listOfpoints.get(46).add(new LatLng (44.4350813, 26.137606));\n listOfpoints.get(46).add(new LatLng (44.4322314, 26.1388506));\n\n\n\n listOfpoints.get(47).add(new LatLng (44.4202257, 26.1368063));\n listOfpoints.get(47).add(new LatLng (44.4179627,26.1463187));\n listOfpoints.get(47).add(new LatLng (44.4227749, 26.149709));\n listOfpoints.get(47).add(new LatLng (44.4231734, 26.1503527));\n listOfpoints.get(47).add(new LatLng (44.4237251, 26.1504386));\n listOfpoints.get(47).add(new LatLng (44.4261157, 26.1495373));\n listOfpoints.get(47).add(new LatLng (44.4262996, 26.1508463));\n listOfpoints.get(47).add(new LatLng (44.4268206, 26.1524341));\n listOfpoints.get(47).add(new LatLng (44.4283937, 26.1547449));\n listOfpoints.get(47).add(new LatLng (44.433251, 26.1534574));\n listOfpoints.get(47).add(new LatLng (44.4320712, 26.1388662));\n listOfpoints.get(47).add(new LatLng (44.430401,26.139467));\n listOfpoints.get(47).add(new LatLng (44.4295736, 26.1393812));\n listOfpoints.get(47).add(new LatLng (44.4254668, 26.137686));\n listOfpoints.get(47).add(new LatLng (44.4241642,26.1374929));\n listOfpoints.get(47).add(new LatLng (44.4202257,26.1368063));\n\n\n\n listOfpoints.get(48).add(new LatLng (44.4234516,26.1510693));\n listOfpoints.get(48).add(new LatLng (44.425076, 26.1630856));\n listOfpoints.get(48).add(new LatLng (44.4292135,26.1619484));\n listOfpoints.get(48).add(new LatLng(44.4286618, 26.1578285));\n listOfpoints.get(48).add(new LatLng (44.4287078,26.156026));\n listOfpoints.get(48).add(new LatLng (44.4286925,26.1557042));\n listOfpoints.get(48).add(new LatLng (44.4269762, 26.1532151));\n listOfpoints.get(48).add(new LatLng (44.4262407, 26.151713));\n listOfpoints.get(48).add(new LatLng (44.4259189, 26.1499535));\n listOfpoints.get(48).add(new LatLng (44.4237122, 26.1506402));\n listOfpoints.get(48).add(new LatLng (44.4234516, 26.1510693));\n\n\n\n listOfpoints.get(49).add(new LatLng (44.4285513, 26.1548459));\n listOfpoints.get(49).add(new LatLng (44.4286925, 26.1557042));\n listOfpoints.get(49).add(new LatLng (44.4287964, 26.1580645));\n listOfpoints.get(49).add(new LatLng (44.4290876, 26.1602317));\n listOfpoints.get(49).add(new LatLng (44.4302981,26.1670124));\n listOfpoints.get(49).add(new LatLng (44.4357222, 26.1692654));\n listOfpoints.get(49).add(new LatLng (44.4362584,26.1689865));\n listOfpoints.get(49).add(new LatLng (44.4366108, 26.1683857));\n listOfpoints.get(49).add(new LatLng (44.4367794,26.1675274));\n listOfpoints.get(49).add(new LatLng (44.433332, 26.1536442));\n listOfpoints.get(49).add(new LatLng (44.4285513, 26.1548459));\n\n\n\n listOfpoints.get(50).add(new LatLng (44.4178742, 26.14650));\n listOfpoints.get(50).add(new LatLng (44.4142265, 26.15554));\n listOfpoints.get(50).add(new LatLng (44.41369, 26.1578359));\n listOfpoints.get(50).add(new LatLng (44.4131842,26.1635008));\n listOfpoints.get(50).add(new LatLng (44.4133221, 26.1636295));\n listOfpoints.get(50).add(new LatLng (44.4154679, 26.1645951));\n listOfpoints.get(50).add(new LatLng (44.4169393, 26.1648526));\n listOfpoints.get(50).add(new LatLng (44.4181654, 26.1648097));\n listOfpoints.get(50).add(new LatLng (44.420403, 26.1642732));\n listOfpoints.get(50).add(new LatLng (44.4248319, 26.1631574));\n listOfpoints.get(50).add(new LatLng (44.4232688, 26.151227));\n listOfpoints.get(50).add(new LatLng (44.4226558, 26.1500253));\n listOfpoints.get(50).add(new LatLng (44.4178742, 26.1465063));\n\n\n listOfpoints.get(51).add(new LatLng (44.409177,26.1228262));\n listOfpoints.get(51).add(new LatLng (44.4079354,26.1261736));\n listOfpoints.get(51).add(new LatLng (44.3993506, 26.1595188));\n listOfpoints.get(51).add(new LatLng (44.4000559,26.1602484));\n listOfpoints.get(51).add(new LatLng (44.407077,26.1638962));\n listOfpoints.get(51).add(new LatLng (44.4081807, 26.1641108));\n listOfpoints.get(51).add(new LatLng (44.4091004, 26.1638104));\n listOfpoints.get(51).add(new LatLng (44.4114916, 26.162995));\n listOfpoints.get(51).add(new LatLng (44.4129018, 26.16351));\n listOfpoints.get(51).add(new LatLng (44.413147, 26.1608063));\n listOfpoints.get(51).add(new LatLng (44.4135762, 26.1567723));\n listOfpoints.get(51).add(new LatLng (44.4148943, 26.1529957));\n listOfpoints.get(51).add(new LatLng (44.4176838,26.1461722));\n listOfpoints.get(51).add(new LatLng (44.4183121,26.1435329));\n listOfpoints.get(51).add(new LatLng (44.4200133, 26.1367523));\n listOfpoints.get(51).add(new LatLng (44.4175152,26.1354433));\n listOfpoints.get(51).add(new LatLng (44.4159825, 26.1342417));\n listOfpoints.get(51).add(new LatLng (44.4146031,26.1324822));\n listOfpoints.get(51).add(new LatLng (44.4113383,26.1266242));\n listOfpoints.get(51).add(new LatLng (44.409177,26.1228262));\n\n\n listOfpoints.get(52).add(new LatLng (44.3988714,26.159323));\n listOfpoints.get(52).add(new LatLng (44.4079468,26.1248191));\n listOfpoints.get(52).add(new LatLng (44.4088665, 26.1225875));\n listOfpoints.get(52).add(new LatLng (44.4080694,26.1217721));\n listOfpoints.get(52).add(new LatLng (44.4065059,26.1213858));\n listOfpoints.get(52).add(new LatLng (44.3941185, 26.120785));\n listOfpoints.get(52).add(new LatLng (44.3862678, 26.1391528));\n listOfpoints.get(52).add(new LatLng (44.3887826,26.1415131));\n listOfpoints.get(52).add(new LatLng (44.3886293, 26.1448605));\n listOfpoints.get(52).add(new LatLng (44.3891813, 26.1464484));\n listOfpoints.get(52).add(new LatLng (44.389304, 26.1472209));\n listOfpoints.get(52).add(new LatLng (44.3927079, 26.155761));\n listOfpoints.get(52).add(new LatLng (44.3941492, 26.1572631));\n listOfpoints.get(52).add(new LatLng (44.3985648, 26.16031));\n listOfpoints.get(52).add(new LatLng (44.3988714, 26.159323));\n\n\n\n listOfpoints.get(53).add(new LatLng (44.3886499, 26.1177499));\n listOfpoints.get(53).add(new LatLng (44.3892939, 26.1179645));\n listOfpoints.get(53).add(new LatLng (44.3881592, 26.1159046));\n listOfpoints.get(53).add(new LatLng (44.3876838,26.1132224));\n listOfpoints.get(53).add(new LatLng (44.3873311, 26.1100895));\n listOfpoints.get(53).add(new LatLng (44.3887879, 26.1032445));\n listOfpoints.get(53).add(new LatLng (44.3888645, 26.1022789));\n listOfpoints.get(53).add(new LatLng (44.3886192, 26.1005838));\n listOfpoints.get(53).add(new LatLng (44.3883738,26.0998542));\n listOfpoints.get(53).add(new LatLng (44.3876225,26.097923));\n listOfpoints.get(53).add(new LatLng (44.3869478, 26.0954554));\n listOfpoints.get(53).add(new LatLng (44.3862577, 26.0924299));\n listOfpoints.get(53).add(new LatLng (44.3860584, 26.0924299));\n listOfpoints.get(53).add(new LatLng (44.3789427, 26.0917003));\n listOfpoints.get(53).add(new LatLng (44.3757526,26.1157758));\n listOfpoints.get(53).add(new LatLng (44.375998,26.1173208));\n listOfpoints.get(53).add(new LatLng (44.3765195,26.1189945));\n listOfpoints.get(53).add(new LatLng (44.3769183,26.1194665));\n listOfpoints.get(53).add(new LatLng (44.3775624, 26.1194236));\n listOfpoints.get(53).add(new LatLng (44.3786973,26.1184366));\n listOfpoints.get(53).add(new LatLng (44.3824393,26.1150248));\n listOfpoints.get(53).add(new LatLng (44.3831447, 26.114939));\n listOfpoints.get(53).add(new LatLng (44.3840802, 26.1151106));\n listOfpoints.get(53).add(new LatLng (44.3879598, 26.1175568));\n listOfpoints.get(53).add(new LatLng (44.3886499,26.1177499));\n\n\n listOfpoints.get(54).add(new LatLng ( 44.3939843, 26.1207857));\n listOfpoints.get(54).add(new LatLng (44.3928679,26.120861));\n listOfpoints.get(54).add(new LatLng (44.3916643, 26.1202602));\n listOfpoints.get(54).add(new LatLng (44.3901386, 26.1189727));\n listOfpoints.get(54).add(new LatLng (44.3894869, 26.1181573));\n listOfpoints.get(54).add(new LatLng (44.3881836, 26.1178784));\n listOfpoints.get(54).add(new LatLng (44.3839589, 26.1153034));\n listOfpoints.get(54).add(new LatLng (44.3830541, 26.1151318));\n listOfpoints.get(54).add(new LatLng (44.382479, 26.1153034));\n listOfpoints.get(54).add(new LatLng (44.3814899, 26.1160544));\n listOfpoints.get(54).add(new LatLng (44.3792585,26.1181466));\n listOfpoints.get(54).add(new LatLng (44.3765793, 26.1204638));\n listOfpoints.get(54).add(new LatLng (44.3792479, 26.1275449));\n listOfpoints.get(54).add(new LatLng (44.379524,26.135098));\n listOfpoints.get(54).add(new LatLng (44.3856888, 26.1398616));\n listOfpoints.get(54).add(new LatLng (44.3939843,26.1207857));\n\n\n listOfpoints.get(55).add(new LatLng (44.3777851, 26.0469458));\n listOfpoints.get(55).add(new LatLng (44.3767422, 26.0507223));\n listOfpoints.get(55).add(new LatLng (44.3901146,26.0632536));\n listOfpoints.get(55).add(new LatLng (44.4006018,26.0712359));\n listOfpoints.get(55).add(new LatLng (44.4064272, 26.0638544));\n listOfpoints.get(55).add(new LatLng (44.4054461,26.0626528));\n listOfpoints.get(55).add(new LatLng (44.3997432, 26.0485766));\n listOfpoints.get(55).add(new LatLng (44.3817726,26.0459158));\n listOfpoints.get(55).add(new LatLng (44.3777851, 26.0469458));\n\n\n listOfpoints.get(56).add(new LatLng (44.406462, 26.0640051));\n listOfpoints.get(56).add(new LatLng (44.4007746, 26.0715552));\n listOfpoints.get(56).add(new LatLng (44.3971564,26.0688944));\n listOfpoints.get(56).add(new LatLng (44.3905634, 26.0639591));\n listOfpoints.get(56).add(new LatLng (44.3862699, 26.078207));\n listOfpoints.get(56).add(new LatLng (44.38124,26.0855027));\n listOfpoints.get(56).add(new LatLng (44.3802585, 26.0858031));\n listOfpoints.get(56).add(new LatLng (44.3797064, 26.0867901));\n listOfpoints.get(56).add(new LatLng (44.3790009,26.091425));\n listOfpoints.get(56).add(new LatLng (44.3848591,26.091897));\n listOfpoints.get(56).add(new LatLng (44.3890301,26.0918541));\n listOfpoints.get(56).add(new LatLng (44.3909928, 26.0865755));\n listOfpoints.get(56).add(new LatLng (44.3915141,26.0856314));\n listOfpoints.get(56).add(new LatLng (44.3946727, 26.0839608));\n listOfpoints.get(56).add(new LatLng (44.3961445,26.0850122));\n listOfpoints.get(56).add(new LatLng (44.3967425,26.0849907));\n listOfpoints.get(56).add(new LatLng (44.4002074, 26.0843041));\n listOfpoints.get(56).add(new LatLng (44.4029362, 26.0816648));\n listOfpoints.get(56).add(new LatLng (44.4055576,26.0799267));\n listOfpoints.get(56).add(new LatLng (44.4070752,26.0791113));\n listOfpoints.get(56).add(new LatLng (44.4130379,26.0732319));\n listOfpoints.get(56).add(new LatLng (44.406462, 26.0640051));\n\n\n listOfpoints.get(57).add(new LatLng (44.4005004, 26.0494378));\n listOfpoints.get(57).add(new LatLng (44.4056207, 26.0623124));\n listOfpoints.get(57).add(new LatLng (44.4131623,26.0729554));\n listOfpoints.get(57).add(new LatLng (44.4204884,26.0654452));\n listOfpoints.get(57).add(new LatLng (44.4181895,26.0583212));\n listOfpoints.get(57).add(new LatLng (44.4005004, 26.0494378));\n\n\n listOfpoints.get(58).add(new LatLng (44.414413, 26.0354062));\n listOfpoints.get(58).add(new LatLng (44.415394, 26.0475512));\n listOfpoints.get(58).add(new LatLng (44.4158231,26.0502978));\n listOfpoints.get(58).add(new LatLng (44.4181221,26.0576363));\n listOfpoints.get(58).add(new LatLng (44.4207888, 26.0658331));\n listOfpoints.get(58).add(new LatLng (44.4237005, 26.0731287));\n listOfpoints.get(58).add(new LatLng (44.4298608,26.0624857));\n listOfpoints.get(58).add(new LatLng (44.4293091,26.0617562));\n listOfpoints.get(58).add(new LatLng (44.4290027,26.0610266));\n listOfpoints.get(58).add(new LatLng (44.4275316, 26.0600825));\n listOfpoints.get(58).add(new LatLng (44.426275, 26.0585375));\n listOfpoints.get(58).add(new LatLng (44.4259379,26.0566922));\n listOfpoints.get(58).add(new LatLng (44.4253862, 26.0520573));\n listOfpoints.get(58).add(new LatLng (44.4242829,26.0473366));\n listOfpoints.get(58).add(new LatLng (44.4229037,26.0406847));\n listOfpoints.get(58).add(new LatLng (44.4221374,26.0347624));\n listOfpoints.get(58).add(new LatLng (44.4165281,26.0346766));\n listOfpoints.get(58).add(new LatLng (44.414413,26.0354062));\n\n\n listOfpoints.get(59).add(new LatLng (44.4224216, 26.0344395));\n listOfpoints.get(59).add(new LatLng (44.422437, 26.0360274));\n listOfpoints.get(59).add(new LatLng (44.423004,26.040276));\n listOfpoints.get(59).add(new LatLng (44.4255632,26.0522065));\n listOfpoints.get(59).add(new LatLng (44.4259156,26.055468));\n listOfpoints.get(59).add(new LatLng (44.42636,26.0583219));\n listOfpoints.get(59).add(new LatLng (44.4274787,26.059781));\n listOfpoints.get(59).add(new LatLng (44.4290264, 26.0608325));\n listOfpoints.get(59).add(new LatLng (44.4293328,26.0616264));\n listOfpoints.get(59).add(new LatLng (44.4299764,26.0623989));\n listOfpoints.get(59).add(new LatLng (44.4319071,26.0594162));\n listOfpoints.get(59).add(new LatLng (44.4345885, 26.0593948));\n listOfpoints.get(59).add(new LatLng (44.4342361, 26.0348472));\n listOfpoints.get(59).add(new LatLng (44.4273254, 26.0330877));\n listOfpoints.get(59).add(new LatLng (44.4237396,26.0342893));\n listOfpoints.get(59).add(new LatLng (44.4224216,26.0344395));\n\n\n listOfpoints.get(60).add(new LatLng (44.4345371,26.034714));\n listOfpoints.get(60).add(new LatLng (44.4343687, 26.0351665));\n listOfpoints.get(60).add(new LatLng (44.4347671,26.059757));\n listOfpoints.get(60).add(new LatLng (44.435334, 26.0617097));\n listOfpoints.get(60).add(new LatLng (44.4355025, 26.0629327));\n listOfpoints.get(60).add(new LatLng (44.4356864,26.0635979));\n listOfpoints.get(60).add(new LatLng (44.4371728, 26.0669608));\n listOfpoints.get(60).add(new LatLng (44.4383602, 26.0697182));\n listOfpoints.get(60).add(new LatLng (44.4427184,26.0621798));\n listOfpoints.get(60).add(new LatLng (44.4429329,26.0609782));\n listOfpoints.get(60).add(new LatLng (44.447161,26.0392201));\n listOfpoints.get(60).add(new LatLng (44.4427491,26.0356152));\n listOfpoints.get(60).add(new LatLng (44.4345371,26.034714));\n\n\n listOfpoints.get(61).add(new LatLng (44.4053059, 26.0112059));\n listOfpoints.get(61).add(new LatLng (44.384914, 26.0334789));\n listOfpoints.get(61).add(new LatLng (44.3778596, 26.0462677));\n listOfpoints.get(61).add(new LatLng (44.3811722,26.0454952));\n listOfpoints.get(61).add(new LatLng (44.399879, 26.0482418));\n listOfpoints.get(61).add(new LatLng (44.4002162, 26.0489714));\n listOfpoints.get(61).add(new LatLng (44.4169858,26.0575115));\n listOfpoints.get(61).add(new LatLng (44.4180893, 26.0579407));\n listOfpoints.get(61).add(new LatLng (44.4156984,26.0508167));\n listOfpoints.get(61).add(new LatLng (44.4151773,26.0472977));\n listOfpoints.get(61).add(new LatLng (44.414135,26.0356247));\n listOfpoints.get(61).add(new LatLng (44.4110082, 26.0104334));\n listOfpoints.get(61).add(new LatLng (44.4061643,26.0117208));\n listOfpoints.get(61).add(new LatLng (44.4053059,26.0112059));\n\n\n listOfpoints.get(62).add(new LatLng (44.4103691, 26.0025379));\n listOfpoints.get(62).add(new LatLng (44.4103304, 26.0034906));\n listOfpoints.get(62).add(new LatLng (44.4127522,26.0228884));\n listOfpoints.get(62).add(new LatLng (44.4144076,26.0351192));\n listOfpoints.get(62).add(new LatLng (44.4167986,26.0343897));\n listOfpoints.get(62).add(new LatLng (44.4221013, 26.0343038));\n listOfpoints.get(62).add(new LatLng (44.4271277, 26.0328018));\n listOfpoints.get(62).add(new LatLng (44.4343295, 26.0347544));\n listOfpoints.get(62).add(new LatLng (44.4344597, 26.0345399));\n listOfpoints.get(62).add(new LatLng (44.436423, 26.0347646));\n listOfpoints.get(62).add(new LatLng (44.4424747, 26.0213321));\n listOfpoints.get(62).add(new LatLng (44.4459215, 26.0171264));\n listOfpoints.get(62).add(new LatLng (44.4457043,26.0167004));\n listOfpoints.get(62).add(new LatLng (44.4252662, 25.9987613));\n listOfpoints.get(62).add(new LatLng (44.4235193, 25.9990188));\n listOfpoints.get(62).add(new LatLng (44.4103691, 26.0025379));\n\n\n listOfpoints.get(63).add(new LatLng (44.450683, 26.0692569));\n listOfpoints.get(63).add(new LatLng (44.4530725,26.0733768));\n listOfpoints.get(63).add(new LatLng (44.4523986, 26.0762092));\n listOfpoints.get(63).add(new LatLng (44.4522454,26.0783979));\n listOfpoints.get(63).add(new LatLng (44.4521842,26.0858652));\n listOfpoints.get(63).add(new LatLng (44.4658762, 26.0861656));\n listOfpoints.get(63).add(new LatLng (44.4661262, 26.0856151));\n listOfpoints.get(63).add(new LatLng (44.4670374, 26.0787379));\n listOfpoints.get(63).add(new LatLng (44.467496, 26.0777089));\n listOfpoints.get(63).add(new LatLng (44.4773875,26.0721728));\n listOfpoints.get(63).add(new LatLng (44.4779387,26.0720012));\n listOfpoints.get(63).add(new LatLng (44.482103,26.0611007));\n listOfpoints.get(63).add(new LatLng (44.4811232,26.0571525));\n listOfpoints.get(63).add(new LatLng (44.4748153, 26.0461661));\n listOfpoints.get(63).add(new LatLng (44.4716917, 26.0438487));\n listOfpoints.get(63).add(new LatLng (44.4690579,26.0436771));\n listOfpoints.get(63).add(new LatLng (44.4667916, 26.0449645));\n listOfpoints.get(63).add(new LatLng (44.4519663, 26.0668513));\n listOfpoints.get(63).add(new LatLng (44.450683,26.0692569));\n\n\n listOfpoints.get(64).add(new LatLng (44.4663308, 26.0857322));\n listOfpoints.get(64).add(new LatLng (44.466193, 26.0862472));\n listOfpoints.get(64).add(new LatLng (44.4723947,26.0878994));\n listOfpoints.get(64).add(new LatLng (44.4731756,26.0883715));\n listOfpoints.get(64).add(new LatLng (44.4739718,26.090131));\n listOfpoints.get(64).add(new LatLng (44.4744158, 26.090882));\n listOfpoints.get(64).add(new LatLng (44.4748292,26.0909678));\n listOfpoints.get(64).add(new LatLng (44.4753498,26.0906889));\n listOfpoints.get(64).add(new LatLng (44.4774321, 26.0888006));\n listOfpoints.get(64).add(new LatLng (44.4801879,26.0864832));\n listOfpoints.get(64).add(new LatLng (44.4868014,26.0859682));\n listOfpoints.get(64).add(new LatLng (44.4880873,26.0854532));\n listOfpoints.get(64).add(new LatLng (44.489618,26.0824491));\n listOfpoints.get(64).add(new LatLng (44.4904753, 26.0788443));\n listOfpoints.get(64).add(new LatLng (44.4890057,26.0784151));\n listOfpoints.get(64).add(new LatLng (44.478167, 26.0727074));\n listOfpoints.get(64).add(new LatLng (44.4678468, 26.0779216));\n listOfpoints.get(64).add(new LatLng (44.467219, 26.0788228));\n listOfpoints.get(64).add(new LatLng (44.4663308, 26.0857322));\n\n\n listOfpoints.get(65).add(new LatLng (44.4432698,26.0604113));\n listOfpoints.get(65).add(new LatLng (44.443222,26.0605852));\n listOfpoints.get(65).add(new LatLng (44.4450067,26.0611538));\n listOfpoints.get(65).add(new LatLng (44.4465463,26.062173));\n listOfpoints.get(65).add(new LatLng (44.4472816,26.0631386));\n listOfpoints.get(65).add(new LatLng (44.448913,26.0666577));\n listOfpoints.get(65).add(new LatLng (44.4502551,26.0690373));\n listOfpoints.get(65).add(new LatLng (44.4664896,26.0448331));\n listOfpoints.get(65).add(new LatLng (44.4688479,26.0434168));\n listOfpoints.get(65).add(new LatLng (44.469491,26.0403269));\n listOfpoints.get(65).add(new LatLng (44.4702566,26.037237));\n listOfpoints.get(65).add(new LatLng (44.4701035,26.0353058));\n listOfpoints.get(65).add(new LatLng (44.4613441,26.0305422));\n listOfpoints.get(65).add(new LatLng (44.4611297,26.0346621));\n listOfpoints.get(65).add(new LatLng (44.4606089,26.0350913));\n listOfpoints.get(65).add(new LatLng (44.4595369,26.0350913));\n listOfpoints.get(65).add(new LatLng (44.458618,26.0354775));\n listOfpoints.get(65).add(new LatLng (44.4545745,26.0376233));\n listOfpoints.get(65).add(new LatLng (44.4501632,26.0417002));\n listOfpoints.get(65).add(new LatLng (44.4494892,26.0417002));\n listOfpoints.get(65).add(new LatLng (44.4485701,26.039297));\n listOfpoints.get(65).add(new LatLng (44.4477429,26.0380953));\n listOfpoints.get(65).add(new LatLng (44.4466093,26.0430306));\n listOfpoints.get(65).add(new LatLng (44.4432698,26.0604113));\n\n\n\n listOfpoints.get(66).add(new LatLng (44.4742952,26.0910108));\n listOfpoints.get(66).add(new LatLng (44.4741016,26.0912642));\n listOfpoints.get(66).add(new LatLng (44.4741016,26.0917148));\n listOfpoints.get(66).add(new LatLng (44.4743313,26.0922513));\n listOfpoints.get(66).add(new LatLng (44.4750816,26.0927019));\n listOfpoints.get(66).add(new LatLng (44.4758471,26.0937962));\n listOfpoints.get(66).add(new LatLng (44.4762758,26.0947189));\n listOfpoints.get(66).add(new LatLng (44.4766127,26.0962853));\n listOfpoints.get(66).add(new LatLng (44.4765514,26.0971436));\n listOfpoints.get(66).add(new LatLng (44.4761227,26.0977444));\n listOfpoints.get(66).add(new LatLng (44.4753878,26.0985169));\n listOfpoints.get(66).add(new LatLng (44.4745457,26.0985384));\n listOfpoints.get(66).add(new LatLng (44.4734585,26.0989675));\n listOfpoints.get(66).add(new LatLng (44.4729073,26.0990104));\n listOfpoints.get(66).add(new LatLng (44.4718508,26.0986671));\n listOfpoints.get(66).add(new LatLng (44.471223,26.0980663));\n listOfpoints.get(66).add(new LatLng (44.469263,26.0970792));\n listOfpoints.get(66).add(new LatLng (44.4689567,26.0971651));\n listOfpoints.get(66).add(new LatLng (44.468773,26.0975728));\n listOfpoints.get(66).add(new LatLng (44.4687424,26.0981092));\n listOfpoints.get(66).add(new LatLng (44.4688955,26.0985169));\n listOfpoints.get(66).add(new LatLng (44.4692017,26.0986886));\n listOfpoints.get(66).add(new LatLng (44.4694774,26.0985598));\n listOfpoints.get(66).add(new LatLng (44.4704268,26.0990319));\n listOfpoints.get(66).add(new LatLng (44.4707483,26.0994396));\n listOfpoints.get(66).add(new LatLng (44.4719733,26.1024651));\n listOfpoints.get(66).add(new LatLng (44.4735963,26.1028943));\n listOfpoints.get(66).add(new LatLng (44.474071,26.1035809));\n listOfpoints.get(66).add(new LatLng (44.4741322,26.1042676));\n listOfpoints.get(66).add(new LatLng (44.4735351,26.1047396));\n listOfpoints.get(66).add(new LatLng (44.474071,26.1077866));\n listOfpoints.get(66).add(new LatLng (44.4738413,26.1079583));\n listOfpoints.get(66).add(new LatLng (44.473826,26.1085591));\n listOfpoints.get(66).add(new LatLng (44.4733667,26.1097822));\n listOfpoints.get(66).add(new LatLng (44.4732595,26.1107478));\n listOfpoints.get(66).add(new LatLng (44.4734432,26.1111555));\n listOfpoints.get(66).add(new LatLng (44.4763087,26.1089172));\n listOfpoints.get(66).add(new LatLng (44.4946789,26.1040249));\n listOfpoints.get(66).add(new LatLng (44.4968217,26.0792198));\n listOfpoints.get(66).add(new LatLng (44.490592,26.0788336));\n listOfpoints.get(66).add(new LatLng (44.4898573,26.0820737));\n listOfpoints.get(66).add(new LatLng (44.4894593,26.0830178));\n listOfpoints.get(66).add(new LatLng (44.4882229,26.0855306));\n listOfpoints.get(66).add(new LatLng (44.4870595,26.0860456));\n listOfpoints.get(66).add(new LatLng (44.4801439,26.0866335));\n listOfpoints.get(66).add(new LatLng (44.4761173,26.090174));\n listOfpoints.get(66).add(new LatLng (44.4751527,26.0912469));\n listOfpoints.get(66).add(new LatLng (44.4742952,26.0910108));\n\n listOfpoints.get(67).add(new LatLng (44.4671287, 26.121282));\n listOfpoints.get(67).add(new LatLng (44.46768,26.1231274));\n listOfpoints.get(67).add(new LatLng (44.4696095,26.1234278));\n listOfpoints.get(67).add(new LatLng (44.4712938,26.1224408));\n listOfpoints.get(67).add(new LatLng (44.4723657,26.1229557));\n listOfpoints.get(67).add(new LatLng (44.4727944, 26.1226553));\n listOfpoints.get(67).add(new LatLng (44.4740193, 26.1226982));\n listOfpoints.get(67).add(new LatLng (44.4745399,26.1236424));\n listOfpoints.get(67).add(new LatLng (44.4743668,26.1243164));\n listOfpoints.get(67).add(new LatLng (44.4747037, 26.1250031));\n listOfpoints.get(67).add(new LatLng (44.4751324,26.1257541));\n listOfpoints.get(67).add(new LatLng (44.4758673,26.1267626));\n listOfpoints.get(67).add(new LatLng (44.4761736, 26.127578));\n listOfpoints.get(67).add(new LatLng (44.491758,26.1285221));\n listOfpoints.get(67).add(new LatLng (44.4931662, 26.1377919));\n listOfpoints.get(67).add(new LatLng (44.494452,26.1444008));\n listOfpoints.get(67).add(new LatLng (44.4947581,26.1462033));\n listOfpoints.get(67).add(new LatLng (44.4958601, 26.1472332));\n listOfpoints.get(67).add(new LatLng (44.4969009, 26.1458599));\n listOfpoints.get(67).add(new LatLng (44.4984926, 26.1450875));\n listOfpoints.get(67).add(new LatLng (44.5000231,26.1446583));\n listOfpoints.get(67).add(new LatLng (44.5006353,26.1435425));\n listOfpoints.get(67).add(new LatLng (44.5012475,26.1424267));\n listOfpoints.get(67).add(new LatLng (44.5057774, 26.144315));\n listOfpoints.get(67).add(new LatLng (44.5070629, 26.137191));\n listOfpoints.get(67).add(new LatLng (44.5066956, 26.1233723));\n listOfpoints.get(67).add(new LatLng (44.502227,26.1044896));\n listOfpoints.get(67).add(new LatLng (44.4952479,26.1044896));\n listOfpoints.get(67).add(new LatLng (44.4782558,26.1086953));\n listOfpoints.get(67).add(new LatLng (44.4765716,26.1090386));\n listOfpoints.get(67).add(new LatLng (44.4734175,26.1114848));\n listOfpoints.get(67).add(new LatLng (44.4739994,26.1124289));\n listOfpoints.get(67).add(new LatLng (44.4744587,26.1137163));\n listOfpoints.get(67).add(new LatLng (44.474275,26.1152613));\n listOfpoints.get(67).add(new LatLng (44.4738156,26.1171067));\n listOfpoints.get(67).add(new LatLng (44.4729582,26.1180937));\n listOfpoints.get(67).add(new LatLng (44.4705695, 26.1195099));\n listOfpoints.get(67).add(new LatLng (44.4677826,26.1202395));\n listOfpoints.get(67).add(new LatLng (44.4671287,26.121282));\n\n\n //Stockholm\n listOfpoints.get(68).add(new LatLng(59.339281, 18.005316));\n listOfpoints.get(68).add(new LatLng(59.263986, 18.253591));\n listOfpoints.get(68).add(new LatLng(59.260869, 17.878596));\n\n //Stockholm\n listOfpoints.get(69).add(new LatLng(59.342841, 18.040179));\n listOfpoints.get(69).add(new LatLng(59.355275, 17.884694));\n listOfpoints.get(69).add(new LatLng(59.423065, 18.075748));\n\n\n for(int i = 0 ; i < listOfpoints.size(); i++){\n listOfPolygons.add( MapsActivity.instance.mMap.addPolygon(new PolygonOptions()\n .addAll(listOfpoints.get(i))\n .strokeWidth(0)\n .fillColor(Color.argb(50, 0, 250, 0))) );\n }\n\n\n\n\n }", "public void addPoints(int i, List<Point2D> points);", "public void addPoints(List<Point2D> points);", "public void setPoints(List<GeoPoint> points){\n\t\tclearPath();\n\t\tint size = points.size();\n\t\tmOriginalPoints = new int[size][2];\n\t\tfor (int i=0; i<size; i++){\n\t\t\tGeoPoint p = points.get(i);\n\t\t\tmOriginalPoints[i][0] = p.getLatitudeE6();\n\t\t\tmOriginalPoints[i][1] = p.getLongitudeE6();\n\t\t\tif (!mGeodesic){\n\t\t\t\taddPoint(p);\n\t\t\t} else {\n\t\t\t\tif (i>0){\n\t\t\t\t\t//add potential intermediate points:\n\t\t\t\t\tGeoPoint prev = points.get(i-1);\n\t\t\t\t\tfinal int greatCircleLength = prev.distanceTo(p);\n\t\t\t\t\t//add one point for every 100kms of the great circle path\n\t\t\t\t\tfinal int numberOfPoints = greatCircleLength/100000;\n\t\t\t\t\taddGreatCircle(prev, p, numberOfPoints);\n\t\t\t\t}\n\t\t\t\taddPoint(p);\n\t\t\t}\n\t\t}\n\t}", "public CoordinateObjects(List<T> points) {\n this.points = new ArrayList<>(points);\n }", "private static ArrayList<Coordinates> geoPath1() {\n return new ArrayList<Coordinates>() {\n {\n add(new Coordinates(\"-122.19170793,47.77509422,5.156\"));\n add(new Coordinates(\"-122.19171484,47.77509255,5.476\"));\n add(new Coordinates(\"-122.19172476,47.77509815,5.583\"));\n add(new Coordinates(\"-122.19172741,47.77510382,6.077\"));\n add(new Coordinates(\"-122.19172688,47.77510897,6.424\"));\n add(new Coordinates(\"-122.19172704,47.77511101,6.121\"));\n add(new Coordinates(\"-122.19172543,47.77511046,6.235\"));\n add(new Coordinates(\"-122.19172222,47.77511072,6.225\"));\n add(new Coordinates(\"-122.19172067,47.77510953,5.974\"));\n add(new Coordinates(\"-122.19171935,47.77511130,6.508\"));\n add(new Coordinates(\"-122.19171873,47.77511341,6.090\"));\n add(new Coordinates(\"-122.19171924,47.77511293,5.968\"));\n add(new Coordinates(\"-122.19171637,47.77511664,5.461\"));\n add(new Coordinates(\"-122.19171588,47.77511801,5.518\"));\n add(new Coordinates(\"-122.19171639,47.77511835,5.652\"));\n add(new Coordinates(\"-122.19171667,47.77511857,5.647\"));\n add(new Coordinates(\"-122.19171678,47.77511865,5.648\"));\n add(new Coordinates(\"-122.19172518,47.77511628,6.074\"));\n add(new Coordinates(\"-122.19173954,47.77511533,5.472\"));\n add(new Coordinates(\"-122.19175207,47.77511346,5.836\"));\n add(new Coordinates(\"-122.19176251,47.77510782,5.669\"));\n add(new Coordinates(\"-122.19177163,47.77510015,2.049\"));\n add(new Coordinates(\"-122.19177831,47.77509499,2.910\"));\n add(new Coordinates(\"-122.19178524,47.77509168,2.794\"));\n add(new Coordinates(\"-122.19179816,47.77509009,3.440\"));\n add(new Coordinates(\"-122.19181022,47.77508805,3.016\"));\n add(new Coordinates(\"-122.19182115,47.77508458,5.258\"));\n add(new Coordinates(\"-122.19182976,47.77508305,5.820\"));\n add(new Coordinates(\"-122.19183812,47.77508189,5.615\"));\n add(new Coordinates(\"-122.19184640,47.77507857,3.568\"));\n add(new Coordinates(\"-122.19185497,47.77506742,2.922\"));\n add(new Coordinates(\"-122.19186602,47.77506459,3.923\"));\n add(new Coordinates(\"-122.19187867,47.77506429,3.785\"));\n add(new Coordinates(\"-122.19188979,47.77506426,5.388\"));\n add(new Coordinates(\"-122.19190159,47.77506575,4.811\"));\n add(new Coordinates(\"-122.19191428,47.77506995,3.867\"));\n add(new Coordinates(\"-122.19192458,47.77507421,3.806\"));\n add(new Coordinates(\"-122.19193359,47.77507565,5.697\"));\n add(new Coordinates(\"-122.19194828,47.77507599,6.091\"));\n add(new Coordinates(\"-122.19196187,47.77507556,6.160\"));\n add(new Coordinates(\"-122.19197799,47.77507586,5.827\"));\n add(new Coordinates(\"-122.19199669,47.77507708,6.263\"));\n add(new Coordinates(\"-122.19201547,47.77507900,5.519\"));\n add(new Coordinates(\"-122.19203652,47.77508125,5.318\"));\n add(new Coordinates(\"-122.19205394,47.77508798,4.972\"));\n add(new Coordinates(\"-122.19206817,47.77509514,5.112\"));\n add(new Coordinates(\"-122.19208170,47.77510678,5.183\"));\n add(new Coordinates(\"-122.19209617,47.77511995,6.227\"));\n add(new Coordinates(\"-122.19211126,47.77512566,6.331\"));\n add(new Coordinates(\"-122.19212836,47.77513235,6.249\"));\n add(new Coordinates(\"-122.19214476,47.77513787,7.192\"));\n add(new Coordinates(\"-122.19215712,47.77514375,6.008\"));\n add(new Coordinates(\"-122.19216472,47.77514855,5.879\"));\n add(new Coordinates(\"-122.19217137,47.77514377,6.426\"));\n add(new Coordinates(\"-122.19217457,47.77513335,7.248\"));\n add(new Coordinates(\"-122.19217502,47.77511706,7.483\"));\n add(new Coordinates(\"-122.19218040,47.77510219,10.228\"));\n add(new Coordinates(\"-122.19218656,47.77509117,10.560\"));\n add(new Coordinates(\"-122.19219800,47.77508689,10.466\"));\n add(new Coordinates(\"-122.19221646,47.77507476,11.119\"));\n add(new Coordinates(\"-122.19223178,47.77505389,12.674\"));\n add(new Coordinates(\"-122.19223875,47.77504801,14.667\"));\n add(new Coordinates(\"-122.19224629,47.77504536,13.339\"));\n add(new Coordinates(\"-122.19224798,47.77504041,13.908\"));\n add(new Coordinates(\"-122.19224916,47.77503913,14.065\"));\n add(new Coordinates(\"-122.19225069,47.77503675,14.247\"));\n add(new Coordinates(\"-122.19224858,47.77502843,14.488\"));\n add(new Coordinates(\"-122.19224608,47.77502116,15.172\"));\n add(new Coordinates(\"-122.19224071,47.77501315,15.223\"));\n add(new Coordinates(\"-122.19223317,47.77500694,14.840\"));\n add(new Coordinates(\"-122.19222227,47.77500383,13.775\"));\n add(new Coordinates(\"-122.19221226,47.77499910,12.827\"));\n add(new Coordinates(\"-122.19220317,47.77499372,13.307\"));\n add(new Coordinates(\"-122.19219567,47.77498511,13.107\"));\n add(new Coordinates(\"-122.19219183,47.77497813,13.144\"));\n add(new Coordinates(\"-122.19218998,47.77497165,14.620\"));\n add(new Coordinates(\"-122.19219011,47.77496235,9.166\"));\n add(new Coordinates(\"-122.19218887,47.77495353,8.299\"));\n add(new Coordinates(\"-122.19218520,47.77494321,9.052\"));\n add(new Coordinates(\"-122.19218124,47.77493245,9.915\"));\n add(new Coordinates(\"-122.19218070,47.77492023,9.391\"));\n add(new Coordinates(\"-122.19217970,47.77490970,10.372\"));\n add(new Coordinates(\"-122.19217945,47.77490501,7.722\"));\n add(new Coordinates(\"-122.19217823,47.77489981,8.715\"));\n add(new Coordinates(\"-122.19218090,47.77489589,8.714\"));\n add(new Coordinates(\"-122.19218635,47.77488849,11.030\"));\n add(new Coordinates(\"-122.19219339,47.77487849,13.062\"));\n add(new Coordinates(\"-122.19219717,47.77486996,13.102\"));\n add(new Coordinates(\"-122.19219654,47.77486340,13.562\"));\n add(new Coordinates(\"-122.19219260,47.77485669,14.090\"));\n add(new Coordinates(\"-122.19218765,47.77484862,12.973\"));\n add(new Coordinates(\"-122.19218777,47.77484328,13.137\"));\n add(new Coordinates(\"-122.19218893,47.77483642,13.518\"));\n add(new Coordinates(\"-122.19218715,47.77483230,13.557\"));\n add(new Coordinates(\"-122.19218676,47.77482973,13.560\"));\n add(new Coordinates(\"-122.19218203,47.77482544,12.554\"));\n add(new Coordinates(\"-122.19217214,47.77482073,12.209\"));\n add(new Coordinates(\"-122.19216229,47.77481373,12.975\"));\n add(new Coordinates(\"-122.19215766,47.77481203,10.715\"));\n add(new Coordinates(\"-122.19214837,47.77480695,10.188\"));\n add(new Coordinates(\"-122.19213505,47.77480208,9.988\"));\n add(new Coordinates(\"-122.19212451,47.77479761,10.080\"));\n add(new Coordinates(\"-122.19211571,47.77479427,11.799\"));\n add(new Coordinates(\"-122.19210976,47.77478996,12.827\"));\n add(new Coordinates(\"-122.19211063,47.77478275,12.455\"));\n add(new Coordinates(\"-122.19210867,47.77477966,11.972\"));\n add(new Coordinates(\"-122.19209880,47.77477701,11.224\"));\n add(new Coordinates(\"-122.19208860,47.77477571,11.174\"));\n add(new Coordinates(\"-122.19208772,47.77477829,10.066\"));\n add(new Coordinates(\"-122.19208174,47.77477082,9.116\"));\n add(new Coordinates(\"-122.19207288,47.77476146,6.540\"));\n add(new Coordinates(\"-122.19206631,47.77474937,5.343\"));\n add(new Coordinates(\"-122.19206107,47.77474020,7.509\"));\n add(new Coordinates(\"-122.19205903,47.77473648,7.923\"));\n add(new Coordinates(\"-122.19206261,47.77474166,6.203\"));\n add(new Coordinates(\"-122.19206450,47.77474194,5.918\"));\n add(new Coordinates(\"-122.19205951,47.77473670,4.994\"));\n add(new Coordinates(\"-122.19204892,47.77472567,2.787\"));\n }\n };\n }", "public void initSpawnPoints() {\n this.spawnPointList = new ArrayList<Node>();\n \n //Player spawn point location (5,0,47) In Ready Room\n this.addSpawnPoint(5.5f,0,47.5f,90, true);\n //Mob spawn point location (16,0,47) In Zone 2\n this.addSpawnPoint(16.5f, 0, 47.5f, 270, false); \n //Mob spawn point location (21,0,43)\n this.addSpawnPoint(21.5f, 0, 43.5f, 0,false);\n \n //Mob spawners in Zone 3\n this.addSpawnPoint(17.5f, 0, 37.5f, 90, false);\n this.addSpawnPoint(29.5f, 0, 37.5f, 90, false);\n this.addSpawnPoint(17.5f, 0, 29.5f, 270, false);\n \n //Mob spawners in Zone 4\n this.addSpawnPoint(12.5f, 0, 29.5f, 90, false);\n this.addSpawnPoint(6.5f, 0, 20.5f, 0, false);\n \n //Mob spawners in Zone 5\n this.addSpawnPoint(9.5f, 0, 6.5f, 0, false);\n this.addSpawnPoint(17.5f, 0, 6.5f, 0, false);\n this.addSpawnPoint(24.5f, 0, 8.5f, 270, false);\n this.addSpawnPoint(24.5f, 0, 11.5f, 270, false);\n this.addSpawnPoint(24.5f, 0, 14.5f, 270, false);\n }", "private static ImmutableList<WorldCoord> generateVertexList()\r\n {\n\t return ShapeReader.getWorldCoordsFromResource(RESOURCE);\r\n }", "public void afficherPoints(){\n for(Point point : pointArrayList){\n getMapPane().getChildren().add(point.getImageView());\n visualObjects.add(point);\n }\n }", "public void genererchemin() {\r\n\t\tRandom hauteur1 = new Random();\r\n\t\tRandom longueur2 = new Random();\r\n\t\tRandom choix = new Random();\r\n\t\tArrayList chemin = new ArrayList();\r\n\t\tSystem.out.println(this.getHauteur());\r\n\t\tSystem.out.println(this.getLargeur());\r\n\t\tint milieu = getLargeur() / 2;\r\n\t\t//System.out.println(milieu);\r\n\t\tCoordonnees c = new Coordonnees(milieu, hauteur1.nextInt(\r\n\t\t\t\tgetLargeur()));\r\n\t\tchemin.add(c);\r\n\t\tchemin.add(new Coordonnees(0, 0));\r\n\t\tchemin.add(new Coordonnees(getLargeur() - 1, getHauteur() - 1));\r\n\t\tCoordonnees droite = new Coordonnees(milieu + 1, c.getHauteur());\r\n\t\tchemin.add(droite);\r\n\t\tCoordonnees gauche = new Coordonnees(milieu - 1, c.getHauteur());\r\n\t\tchemin.add(gauche);\r\n\t\tCoordonnees base1 = new Coordonnees(0, 0);\r\n\t\tCoordonnees base2 =new Coordonnees(getLargeur() - 1, getHauteur() - 1);\r\n\r\n\t\twhile (!gauche.equals(base1)) {\r\n\t\t\tif (gauche.getLargeur() == 0) {\r\n\t\t\t\tgauche = new Coordonnees(0, gauche.getHauteur() - 1);\r\n\t\t\t\tchemin.add(gauche);\r\n\t\t\t} else if (gauche.getHauteur() == 0) {\r\n\t\t\t\tgauche = new Coordonnees(gauche.getLargeur() - 1, 0);\r\n\t\t\t\tchemin.add(gauche);\r\n\t\t\t}\r\n\t\t\telse if (choix.nextInt(2) == 0) {\r\n\t\t\t\tgauche = new Coordonnees(gauche.getLargeur() - 1, \r\n\t\t\t\t\t\tgauche.getHauteur());\r\n\t\t\t\tchemin.add(gauche);\r\n\t\t\t} else {\r\n\t\t\t\tgauche = new Coordonnees(gauche.getLargeur(), \r\n\t\t\t\t\t\tgauche.getHauteur() - 1);\r\n\t\t\t\tchemin.add(gauche);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\twhile (!droite.equals(base2)) {\r\n\t\t\tif (droite.getLargeur() == (this.largeur -1)) {\r\n\t\t\t\tdroite = new Coordonnees(droite.getLargeur(), \r\n\t\t\t\t\t\tdroite.getHauteur() + 1);\r\n\t\t\t\tchemin.add(droite);\r\n\r\n\t\t\t} else if (droite.getHauteur() == (this.hauteur -1)) {\r\n\t\t\t\tdroite = new Coordonnees(droite.getLargeur() + 1, \r\n\t\t\t\t\t\tdroite.getHauteur());\r\n\t\t\t\tchemin.add(droite);\r\n\t\t\t\t//System.out.println(\"fais chier\");\r\n\t\t\t}\r\n\t\t\telse if (choix.nextInt(2) == 0) {\r\n\t\t\t\tdroite = new Coordonnees(droite.getLargeur() + 1, \r\n\t\t\t\t\t\tdroite.getHauteur());\r\n\t\t\t\tchemin.add(droite);\r\n\t\t\t} else {\r\n\t\t\t\tdroite = new Coordonnees(droite.getLargeur(), \r\n\t\t\t\t\t\tdroite.getHauteur() + 1);\r\n\t\t\t\tchemin.add(droite);\r\n\t\t\t}\r\n\t\t}\r\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tSystem.out.println(\"Quel est le pourcentage d'obstacle souhaite :\");\r\n\t\tint pourcentage = sc.nextInt();\r\n\t\tint ctp = getHauteur() * getLargeur() * pourcentage / 100;\r\n\t\twhile(ctp >0){\r\n\t\t\tCoordonnees obstacle = new Coordonnees(longueur2.nextInt(getLargeur()), \r\n\t\t\t\t\thauteur1.nextInt(getHauteur()));\r\n\t\t\t//System.out.println(!chemin.contains(obstacle));\r\n\t\t\tif (!chemin.contains(obstacle)) {\r\n\t\t\t\tthis.plateau[obstacle.getHauteur()][obstacle.getLargeur()] = new Obstacle(\r\n\t\t\t\t\t\tobstacle.getHauteur(), obstacle.getLargeur());\r\n\t\t\t\tctp--;\r\n\t\t\t} else {\r\n\t\t\t\t//System.out.println(obstacle + \"est sur le chemin\");\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void setPoints(int numOfIter) {\n\t\tint x = getX();\n\t\tint y = getY();\n\t\tint w = getW();\n\t\tint h = getH();\n\t\th = ((int) (getH() - w*0.29));\n\t\tint numOfSides = 3 * power(4, numOfIter);\n\t\n\t\t\n\t\tif(numOfIter == 0) {\n\t\t\txPointsD = new double[numOfSides];\n\t\t\tyPointsD = new double[numOfSides];\n\t\t\t\n\t\t\txPointsD[2] = x;\n\t\t\tyPointsD[2] = y + h;\n\t\t\t\n\t\t\txPointsD[1] = (double) x + ((double) w)/2;\n\t\t\tyPointsD[1] = y;\n\t\t\t\n\t\t\txPointsD[0] = x + w;\n\t\t\tyPointsD[0] = y + h;\n\t\t} else {\n\t\t\tsetPoints(numOfIter - 1);\n\t\t\tint numOfSidesBefore = xPoints.length;\n\t\t\tdouble[] xPointsDB = xPointsD;\n\t\t\tdouble[] yPointsDB = yPointsD;\n\t\t\txPointsD = new double[numOfSides];\n\t\t\tyPointsD = new double[numOfSides];\n\t\t\t\n\t\t\tfor(int i = 0; i < numOfSidesBefore; i++) {\n\t\t\t\txPointsD[4*i] = xPointsDB[i];\n\t\t\t\tyPointsD[4*i] = yPointsDB[i];\n\t\t\t\t\n\t\t\t\tdouble nextXPointsDB;\n\t\t\t\tdouble nextYPointsDB;\n\t\t\t\tif(i < numOfSidesBefore - 1) {\n\t\t\t\t\tnextXPointsDB = xPointsDB[i+1];\n\t\t\t\t\tnextYPointsDB = yPointsDB[i+1];\n\t\t\t\t} else {\n\t\t\t\t\tnextXPointsDB = xPointsDB[0];\n\t\t\t\t\tnextYPointsDB = yPointsDB[0];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//4i + 1 --> U = (2A+B)/3\n\t\t\t\txPointsD[4*i + 1] = (2 * xPointsDB[i] + nextXPointsDB)/3;\n\t\t\t\tyPointsD[4*i + 1] = (2 * yPointsDB[i] + nextYPointsDB)/3;\n\t\t\t\t\n\t\t\t\t//4i + 2 --> this one is complicated --> V = U + (AB/3)*(cos(ang(AB) + pi.3), sin(ang(AB) + pi/3))\n\t\t\t\tdouble angAB = Math.atan2(nextYPointsDB-yPointsDB[i], nextXPointsDB-xPointsDB[i]);\n\t\t\t\txPointsD[4*i + 2] = xPointsD[4*i + 1] + \n\t\t\t\t\t\t(Math.sqrt((nextXPointsDB - xPointsDB[i])*(nextXPointsDB - xPointsDB[i]) +\n\t\t\t\t\t\t\t\t(nextYPointsDB - yPointsDB[i])*(nextYPointsDB - yPointsDB[i]))/3.0) *\n\t\t\t\t\t\tMath.cos(angAB + Math.PI/3.0); \n\t\t\t\t\n\t\t\t\tyPointsD[4*i + 2] = yPointsD[4*i + 1] + \n\t\t\t\t\t\t(Math.sqrt((nextXPointsDB - xPointsDB[i])*(nextXPointsDB - xPointsDB[i]) +\n\t\t\t\t\t\t\t\t(nextYPointsDB - yPointsDB[i])*(nextYPointsDB - yPointsDB[i]))/3.0) *\n\t\t\t\t\t\tMath.sin(angAB + Math.PI/3.0);\n\t\t\t\t\n\t\t\t\t//4i + 3 --> W = (A + 2B)/3\n\t\t\t\txPointsD[4*i + 3] = (xPointsDB[i] + 2 * nextXPointsDB)/3;\n\t\t\t\tyPointsD[4*i + 3] = (yPointsDB[i] + 2 * nextYPointsDB)/3;\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\txPoints = new int[numOfSides];\n\t\tyPoints = new int[numOfSides];\n\t\tfor(int i = 0; i < numOfSides; i++) {\n\t\t\txPoints[i] = (int) xPointsD[i];\n\t\t\tyPoints[i] = (int) yPointsD[i];\n\t\t}\n\t\t\n\t}", "private void CreaCoordinate(){\n \n this.punto = new Point(80, 80);\n \n }", "public static List<Point> generateTestPoints()\n {\n List<Point> points = new ArrayList<>();\n double r = 1.0;\n int k = 0; // for naming the points.\n for (int i = 0; i <= 360; i += 10) {\n double t = (i)* Math.PI / 180.0;\n double x = r * Math.cos(t);\n double y = r * Math.sin(t);\n String name = \"Point-\" + k;\n Point p = new Point(name, x, y);\n points.add(p);\n k++;\n }\n return points;\n }", "private double[] generateRandomCoordinates() {\n return generateRandomCoordinates(CoordinateDomain.GEOGRAPHIC, 0.05f);\n }", "Collection<Point> getAllCoordinates();", "public void generate() {\n\t\tLocation location0 = new Location();\n\t\tlocation0.setAddress(\"Zhong Nan Hai\");\n\n\t\tlocation0.setLatitude(0.0);\n\t\tlocation0.setLongitude(0.0);\n;\n\t\tTestDriver.locationList.add(location0);\n\t\t\n\t\t\n\t\tLocation location1 = new Location();\n\t\tlocation1.setAddress(\"Tian An Men\");\n\t\tlocation1.setLatitude(0.1);\n\t\tlocation1.setLongitude(0.1);\n\n\t\tTestDriver.locationList.add(location1);\n\t\t\n\t\t\n\t\tLocation location2 = new Location();\n\t\tlocation2.setAddress(\"White House\");\n\t\tlocation2.setLatitude(100.21);\n\t\tlocation2.setLongitude(102.36);\n\t\tTestDriver.locationList.add(location2);\n\t}", "public GridPoint digitise() {\n\n Location myLocation = myLocation();\n GridPoint myGP = myGridPoint();\n //myLocationClick();\n points.add(myGridPoint());\n if (points.size() > 2) {\n\n\n mFinishButton.setVisibility(View.VISIBLE);\n\n }\n double latitude = myGridPoint().x;\n double longitude = myGridPoint().y;\n String stringLat = Double.toString(latitude);\n String stringLong = Double.toString(longitude);\n String coordPair = \" \" + stringLat + \",\" + stringLong;\n collectedPoints.add(coordPair);\n locations.add(myLocation);\n\n return myGP;\n\n }", "private void intElementCoordinates() throws InvalidLevelCharacterException, NoGhostSpawnPointException, NoPacmanSpawnPointException, NoItemsException {\n\n\t\tint ps = 0;// player spawn point counter\n\t\tint gs = 0;// ghost spawn point counter\n\t\tint item = 0;// item counter\n\t\t\n\t\t\tfor (int i = 0; i < height; i++) {\n\t\t\t\tfor (int j = 0; j < width; j++) {\n\t\t\t\t\t// j*MAPDENSITY as x coordinate, i*MAPDENSITY as y\n\t\t\t\t\t// coordinate\n\t\t\t\t\tfloat[] xy = { j * MAPDENSITY, i * MAPDENSITY };\n\t\t\t\t\t// add coordinates in to right category\n\t\t\t\t\tif (mapElementStringArray[i][j].equals(\"X\")) {\n\t\t\t\t\t\tmapElementArray[i][j] = new Wall(new Vector2f(xy), getWallType(\n\t\t\t\t\t\t\t\ti, j));\n\t\t\t\t\t} else if (mapElementStringArray[i][j].equals(\" \")) {\n\t\t\t\t\t\tmapElementArray[i][j] = new Dot(new Vector2f(xy), getForksForPacman(i, j), getForksForGhost(i, j));\n\t\t\t\t\t\tdots.add((Dot)mapElementArray[i][j]);\n\t\t\t\t\t\titem++;\n\t\t\t\t\t} else if (mapElementStringArray[i][j].equals(\"P\")) {\n\t\t\t\t\t\tmapElementArray[i][j] = new PlayerSpawnPoint(new Vector2f(xy), getForksForPacman(i, j), getForksForGhost(i, j));\n\t\t\t\t\t\tplayerSpawnPoints.add((PlayerSpawnPoint)mapElementArray[i][j]);\n\t\t\t\t\t\taPlayerSpawnPointRow=i;\n\t\t\t\t\t\taPlayerSpawnPointCol=j;\n\t\t\t\t\t\tps++;\n\t\t\t\t\t} else if (mapElementStringArray[i][j].equals(\"G\")) {\n\t\t\t\t\t\tmapElementArray[i][j] = new GhostSpawnPoint(new Vector2f(xy),getForksForPacman(i, j), getForksForGhost(i, j));\n\t\t\t\t\t\tghostSpawnPoints.add((GhostSpawnPoint)mapElementArray[i][j]);\n\t\t\t\t\t\tgs++;\n\t\t\t\t\t} else if (mapElementStringArray[i][j].equals(\"B\"))\n\t\t\t\t\t\tmapElementArray[i][j] = new InvisibleWall(new Vector2f(xy), getForksForPacman(i, j), getForksForGhost(i, j));\n\t\t\t\t\telse if (mapElementStringArray[i][j].equals(\"S\")) {\n\t\t\t\t\t\tmapElementArray[i][j] = new SpeedUp(new Vector2f(xy), getForksForPacman(i, j), getForksForGhost(i, j));\n\t\t\t\t\t\tspeedUps.add((SpeedUp)mapElementArray[i][j]);\n\t\t\t\t\t\titem++;\n\t\t\t\t\t} else if (mapElementStringArray[i][j].equals(\"T\")){\n\t\t\t\t\t\tmapElementArray[i][j] = new Teleporter(new Vector2f(xy),getForksForPacman(i, j), getForksForGhost(i, j));\n\t\t\t\t\t\tteleporters.add((Teleporter)mapElementArray[i][j]);\n\t\t\t\t\t}\n\t\t\t\t\telse if (mapElementStringArray[i][j].equals(\"U\")) {\n\t\t\t\t\t\tmapElementArray[i][j] = new PowerUp(new Vector2f(xy), getForksForPacman(i, j), getForksForGhost(i, j));\n\t\t\t\t\t\tpowerUps.add((PowerUp)mapElementArray[i][j]);\n\t\t\t\t\t\titem++;\n\t\t\t\t\t} else\n\t\t\t\t\t\t// thrwo invalidLevelCharacterException\n\t\t\t\t\t\tthrow new InvalidLevelCharacterException(\n\t\t\t\t\t\t\t\tmapElementStringArray[i][j].charAt(0));\n\n\t\t\t\t}\n\t\t\t}\n\t\t\t// check for PacmanSpawnPoint, GhostSpawnPoint and item exceptions\n\t\t\tif (gs == 0)\n\t\t\t\tthrow new NoGhostSpawnPointException();\n\t\t\tif (ps == 0)\n\t\t\t\tthrow new NoPacmanSpawnPointException();\n\t\t\tif (item == 0)\n\t\t\t\tthrow new NoItemsException();\n\t\t\n\t}", "public void drawCircle() {\n mMap.clear();\n // Generate the points\n mMap.addPolygon(new PolygonOptions().addAll(points).strokeWidth(5).strokeColor(Color.RED).fillColor(Color.TRANSPARENT));\n // Create and return the polygon\n for (int i=0;i<points.size();i++){\n Log.v(\"DrawCircle\",\"drwaakmdaskfmlsmn\"+points.get(i));\n }\n\n\n\n }", "void drawPointArr(Graphics2D g2d, ArrayList<Point2D.Double> l){\r\n\t\tfor(int i=0; i<l.size()-1; i++){\r\n\t\t\tLine2D.Double line=new Line2D.Double(l.get(i), l.get(i+1));\r\n\t\t\tg2d.draw(line);\r\n\t\t}\r\n\r\n\t}", "private static Point[] generateRandomPointArray(final int quantity) {\n\t\tfinal int min = -200;\n\t\tfinal int max = 200;\n\t\tfinal Random random = new Random();\n\t\tPoint[] pointArray = new Point[quantity];\n\t\t\n\t\tSystem.out.println(\"Using \" + quantity + \" of random co-linear points.\");\n\t\t\n\t\tfor(int i = 0; i < quantity; i++) {\n\t\t\tint x = random.nextInt(max + 1 - min) + min;\n\t\t\tint y = random.nextInt(max + 1 - min) + min;\n\t\t\tpointArray[i] = new Point(x, y);\n\t\t}\n\t\t\n\t\treturn pointArray;\n\t}", "public abstract int[] getCoords();", "public static Point[] init_starting_points(boolean red){\n \n Point corner = red ? Map.red_corner : Map.blue_corner;\n ArrayList<Point> list_points = new ArrayList<>();\n Point[] ret_points;\n for (int x = 0; x < MAP_HEIGHT; x++){\n for (int y = 0; y < MAP_WIDTH; y++){\n if (Point.distance(corner, x,y) < spawn_size ){\n\n boolean valid = true;\n for (int _x = x-2; _x < x+2 && valid; _x++){\n for (int _y = y-2; _y < y + 2 && valid; _y++){\n if (Point.distance(x,y,_x,_y) > 2)\n continue;\n try {\n if (global_map[_x][_y] != Terrain.GRASS)\n valid = false;\n\n }\n catch (Exception e){\n valid = false;\n }\n }\n }\n\n if (valid)\n list_points.add(new Point(x,y));\n\n }\n }\n }\n \n \n ret_points = new Point[list_points.size()];\n ret_points = list_points.toArray(ret_points);\n return ret_points;\n\n }", "private void setupEnemySpawnPoints() {\n float ring = ProtectConstants.VIEWPORT_WIDTH / 2 + (ProtectConstants.GAME_OBJECT_SIZE * 2);\n float angle = 18; // start angle\n for(int i = 1; i < ProtectConstants.COLUMNS + 1; i++){\n enemySpawnPoints.add(divideCircle(ring, angle));\n angle += 360 / ProtectConstants.COLUMNS;\n }\n enemySpawnPoints.shuffle();\n }", "private List<LatLng> getCoordinates() {\n\n List<LatLng> list = new ArrayList<>();\n SharedPreferences.Editor editor = walkingSharedPreferences.edit();\n int size = walkingSharedPreferences.getInt(user.getUsername(), 0);\n for(int actual = 0; actual < size; actual++) {\n String pos = walkingSharedPreferences.getString(user.getUsername() + \"_\" + actual, \"\");\n editor.remove(user.getUsername() + \"_\" + actual);\n String[] splitPos = pos.split(\" \");\n LatLng latLng = new LatLng(Double.parseDouble(splitPos[LAT]), Double.parseDouble(splitPos[LNG]));\n list.add(latLng);\n }\n editor.remove(user.getUsername());\n editor.apply();\n return list;\n\n }", "public Collection <Point> getAllPoints(){\n Collection <Point> points = new ArrayList<>();\n for(int i = 0; i < width; i++){\n for(int j = 0; j < height; j++){\n points.add(new Point(i, j));\n }\n }\n return points;\n }", "private void drawMembersLocation () {\n // Ve tat ca cac vi tri thanh vien tren ban do\n ArrayList<TourMember> tourMembers = OnlineManager.getInstance().mTourList.get(tourOrder).getmTourMember();\n for (int i = 0; i < tourMembers.size(); i++) {\n TourMember tourMember = tourMembers.get(i);\n // Neu khong co vi tri thi khong ve\n if (tourMember.getmLocation() == null) {\n break;\n }\n // Thay doi mau vi tri thanh vien\n MapMemberPositionLayoutBinding memberLocationLayoutBinding = DataBindingUtil.inflate(getLayoutInflater(), R.layout.map_member_position_layout, null, false);\n // Thay doi trang thai markup\n // Kiem tra xem vai tro cua thanh vien trong tour\n int function = tourMember.getmFunction();\n // Kiem tra xem tour da dien ra chua\n if (function == 1) {\n // Truong doan, thay doi mau sac markup thanh do\n memberLocationLayoutBinding.memberLocationImage.setColorFilter(Color.RED, PorterDuff.Mode.SRC_ATOP);\n } else {\n // Cac thanh vien con lai, thay doi mau sac markup thanh xanh\n memberLocationLayoutBinding.memberLocationImage.setColorFilter(Color.BLUE, PorterDuff.Mode.SRC_ATOP);\n }\n // Marker google map\n View markerView = memberLocationLayoutBinding.getRoot();\n // Khoi tao marker\n MarkerOptions markerOptions = new MarkerOptions()\n .draggable(false)\n .title(tourMember.getUserInfo().getFullName())\n .position(tourMember.getmLocation())\n .icon(BitmapDescriptorFactory.fromBitmap(getMemberLocationBitmapFromView(markerView)));\n if (tourMember.getmFunction() == 0) {\n // Thanh vien\n markerOptions.snippet(getString(R.string.tour_function_member));\n } else if (tourMember.getmFunction() == 1) {\n // Truong doan\n markerOptions.snippet(getString(R.string.tour_function_leader));\n } else if (tourMember.getmFunction() == 2) {\n // Pho doan\n markerOptions.snippet(getString(R.string.tour_function_vice_leader));\n } else {\n // Phu huynh\n markerOptions.snippet(getString(R.string.tour_function_parent));\n }\n mMap.addMarker(markerOptions);\n\n // Goi su kien khi nhan vao tieu de thanh vien\n mMap.setOnInfoWindowClickListener(new GoogleMap.OnInfoWindowClickListener() {\n @Override\n public void onInfoWindowClick(Marker marker) {\n // TODO: Chuyen sang man hinh nhan tin khi nhan vao tieu de thanh vien\n return;\n// openTimesheetInfo(marker.getTitle());\n }\n });\n }\n }", "private void definePoints(){\n defineLinePoints(x1, y1, x2, y2);\n defineLinePoints(x1,y1, x3, y3);\n defineLinePoints(x2,y2, x3, y3);\n }", "public void setCoords() \r\n {\r\n \tthis.coordX = rand.nextInt(10);\r\n \tthis.coordY = rand.nextInt(10);\r\n }", "public void newCoord() {\n\t\tx = Data.generateRandomX();\n\t\ty = Data.generateRandomY();\n\t}", "private void createRandomGame() {\n ArrayList<int[]> usedCoordinates = new ArrayList<>();\n\n // make sure the board is empty\n emptyBoard();\n\n //find different coordinates\n while (usedCoordinates.size() < 25) {\n int[] temp = new int[]{randomNumberGenerator.generateInteger(size), randomNumberGenerator.generateInteger(size)};\n\n // default contains(arraylist) doesn't work because it compares hashcodes\n if (! contains(usedCoordinates, temp)) {\n usedCoordinates.add(temp);\n }\n }\n\n for (int[] usedCoordinate : usedCoordinates) {\n board.setSquare(usedCoordinate[0], usedCoordinate[1], randomNumberGenerator.generateInteger(size) + 1);\n }\n\n //save start locations\n startLocations = usedCoordinates;\n }", "private void generateMap () {\n for (int i = 0 ; i < n ; i++) {\n mapCoordinate[i] = new CoordinateInfo(100 * random.nextFloat(), 100 * random.nextFloat());\n\n for (int j = 0 ; j <= i ; j++) {\n mapDistance[i][j] = mapDistance[j][i] = getDistance(mapCoordinate[i], mapCoordinate[j]);\n }\n }\n }", "private List<GCSPoint> toListOfGCSPoints(List<LatLng> coordinatesLatLng) {\n List<GCSPoint> pathCoordiantesEV = new ArrayList<>();\n for (LatLng latLng : coordinatesLatLng) {\n pathCoordiantesEV.add(new GCSPoint(latLng.latitude, latLng.longitude));\n }\n\n return pathCoordiantesEV;\n }", "public abstract List<Point2D> getInterpolatedPoints();", "Collection<Point> getCoordinates(int... ids);", "private void transformPoints() {\r\n\r\n\t\t// angle between x-axis and the line between start and goal\r\n//\t\tthis.angle = inverse_tan (slope)\r\n\t\tthis.angle = (int) Math.toDegrees(Math.atan2(goal.getY()-robot.getY(), goal.getX()-robot.getX()));\r\n\r\n\t\t// deviation of start point's x-axis from (0,0)\r\n\t\tthis.deviation = this.robot;\r\n\r\n\t\tthis.robot = new Robot(GA_PathPlanning.Transform(robot, -deviation.x, -deviation.y));\r\n\t\tthis.robot = new Robot(Rotate(robot, -angle));\r\n\t\t \r\n\t\tthis.goal = GA_PathPlanning.Transform(goal, -deviation.x, -deviation.y);\r\n\t\tthis.goal = GA_PathPlanning.Rotate(goal, -angle);\r\n\t\t\r\n\t\tfor(int i=0;i<obstacles.length;i++)\r\n\t\t{\r\n\t\t\tthis.obstacles[i]= new Obstacle(GA_PathPlanning.Transform(obstacles[i], -deviation.x, -deviation.y));\r\n\t\t\tthis.obstacles[i]= new Obstacle(GA_PathPlanning.Rotate(obstacles[i], -angle));\r\n\t\t}\r\n\t\t// make start point as (0,0)\r\n\t\t// transform xy-axis to axis of the straight line between start and goal\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n\tpublic AbstractGeometryData createGeometries(float recX01, float recY01, float recX02, float recY02, double seed) {\n\t\tfloat gridRecLeft = ceilGrid(((recX01 < recX02) ? recX01 : recX02)) - 1;\n\t\tfloat gridRecRight = floorGrid(((recX01 > recX02) ? recX01 : recX02)) + 1;\n\t\tfloat gridRecBottom = ceilGrid((recY01 < recY02) ? recY01 : recY02) - 1;\n\t\tfloat gridRecTop = floorGrid((recY01 > recY02) ? recY01 : recY02) + 1;\n\n\t\tint gridPointCountX = (int) (Math.abs(gridRecRight - gridRecLeft)) + 1;\n\t\tint gridPointCountY = (int) (Math.abs(gridRecTop - gridRecBottom)) + 1;\n\n\t\tList<Float> pointsList = new ArrayList<Float>();\n\n\t\tfor (int gridOffsetX = 0; gridOffsetX < gridPointCountX; gridOffsetX++) {\n\t\t\tfor (int gridOffsetY = 0; gridOffsetY < gridPointCountY; gridOffsetY++) {\n\n\t\t\t\tfloat gridX = gridRecLeft + gridOffsetX;\n\t\t\t\tfloat gridY = gridRecBottom + gridOffsetY;\n\n\t\t\t\tfloat x = randomizePosition(gridX, gridY, seed) + (c.gridSize * gridX);\n\t\t\t\tfloat y = randomizePosition(-gridX, -gridY, seed) + (c.gridSize * gridY);\n\n\t\t\t\tif (MathE.isPointInRect(x, y, recX01, recY01, recX02, recY02)) {\n\t\t\t\t\tpointsList.add(x);\n\t\t\t\t\tpointsList.add(y);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfloat[] array = new float[pointsList.size()];\n\t\tfor(int i = 0; i < pointsList.size(); i++) array[i] = pointsList.get(i);\n\t\treturn new PointList(config.id, seed, array);\n\t}", "public void genererObstacle(char grille[][]){\r\n int i;\r\n\t\tint j;\r\n\t\tRandom random = new Random();\r\n\t\tfor(i=0 ;i<grille.length; i++){\r\n int x = random.nextInt(19);\r\n int y = random.nextInt(19);\r\n\t\t\tfor(j=0 ;j<grille.length; j++){\r\n if(x==j)\r\n grille[i][j] = 'P';\r\n if(y==j) \r\n grille[i][j] = 'C';\r\n \r\n \r\n }\r\n }\r\n }", "public void generete() {\n int minQuantFig = 1,\r\n maxQuantFig = 10,\r\n minNum = 1,\r\n maxNum = 100,\r\n minColor = 0,\r\n maxColor = (int)colors.length - 1,\r\n\r\n // Initialize figures property for random calculations\r\n randomColor = 0,\r\n randomFigure = 0,\r\n\r\n // Squere property\r\n randomSideLength = 0,\r\n\r\n // Circle property\r\n randomRadius = 0,\r\n \r\n // IsoscelesRightTriangle property \r\n randomHypotenus = 0,\r\n \r\n // Trapizoid properties\r\n randomBaseA = 0,\r\n randomBaseB = 0,\r\n randomAltitude = 0;\r\n\r\n // Generate random number to set figueres's quantaty\r\n setFigureQuantaty( generateWholoeNumInRange(minQuantFig, maxQuantFig) );\r\n\r\n for( int i = 0; i < getFigureQuantaty(); i++ ) {\r\n\r\n // Convert double random value to int and close it in range from 1 to number of elements in array\r\n randomFigure = (int)( Math.random() * figures.length );\r\n \r\n randomColor = generateWholoeNumInRange( minColor, maxColor ); // Get random color's index from colors array\r\n\r\n // Create new figure depending on randomFigure \r\n switch (figures[randomFigure]) {\r\n\r\n case \"Circle\":\r\n\r\n randomRadius = generateWholoeNumInRange( minNum, maxNum ); // Get random value of circle's radius;\r\n\r\n Circle newCircle = new Circle( colors[randomColor], randomRadius ); // Initialize Circle with random parameters\r\n\r\n newCircle.drawFigure();\r\n \r\n break;\r\n\r\n case \"Squere\":\r\n\r\n randomSideLength = generateWholoeNumInRange( minNum, maxNum ); // Get random value of side length;\r\n\r\n Squere newSquere = new Squere( colors[randomColor], randomSideLength ); // Initialize Circle with random parameters\r\n\r\n newSquere.drawFigure();\r\n\r\n break;\r\n\r\n case \"Triangle\":\r\n\r\n randomSideLength = generateWholoeNumInRange( minNum, maxNum ); // Get random value of side length;\r\n\r\n randomHypotenus = generateWholoeNumInRange( minNum, maxNum ); // Get random value of hypotenus;\r\n\r\n IsoscelesRightTriangle newTriangle = new IsoscelesRightTriangle( colors[randomColor], randomSideLength, randomHypotenus ); // Initialize Circle with random parameters\r\n\r\n newTriangle.drawFigure();\r\n\r\n break;\r\n\r\n case \"Trapezoid\":\r\n\r\n randomBaseA = generateWholoeNumInRange( minNum, maxNum ); // Get random value of trapizoid's side A;\r\n\r\n randomBaseB = generateWholoeNumInRange( minNum, maxNum ); // Get random value of trapizoid's side B;\r\n\r\n randomAltitude = generateWholoeNumInRange( minNum, maxNum ); // Get random value of trapizoid's altitude;\r\n\r\n Trapezoid newTrapezoid = new Trapezoid( colors[randomColor], randomBaseA, randomBaseB, randomAltitude ); // Create new Trapezoid with random parameters\r\n\r\n newTrapezoid.drawFigure();\r\n\r\n break;\r\n\r\n };\r\n };\r\n }", "City(){\n x_coordinate = (int)(Math.random()*200);\n y_coordinate = (int)(Math.random()*200);\n }", "public void pointsCollected(List<Point> points);", "public static ArrayList<Point> createPoints(ArrayList<Point> P, int numPoints, double max_x, double max_y) {\n\t\t\t\t\t\t\n\t\tRandom r = new Random();\n\t\t//Create new point objects and add them to 'point'\n\t for (int i = 0; i < numPoints; i++) {\n\t P.add(new Point(r.nextDouble() * max_x, r.nextDouble() * max_y));\n\t }\n\t \n\t return P;\n\t}", "private void generate()\r\n {\r\n mapPieces = myMap.Generate3();\r\n mapWidth = myMap.getMapWidth();\r\n mapHeight = myMap.getMapHeight();\r\n }", "private void paintCourbePoints() {\n\t\tfloat x, y;\n\t\tint i, j;\n\t\t\n\t\tfor(x=xMin; x<=xMax; x++) {\n\t\t\ty = parent.getY(x);\n\t\t\t\n\t\t\tif(y>yMin && y<yMax) {\n\t\t\t\ti = convertX(x);\n\t\t\t\tj = convertY(y);\n\t\t\t\t\n\t\t\t\t//Utilisation d'un carre/losange pour simuler un point \n\t\t\t\t//de taille superieur a un pixel car celui-ci est peu visible.\n\t\t\t\tpaintPointInColor(i-2, j);\n\t\t\t\tpaintPointInColor(i-1, j-1);\t\t\t\t\n\t\t\t\tpaintPointInColor(i-1, j);\n\t\t\t\tpaintPointInColor(i-1, j+1);\n\t\t\t\tpaintPointInColor(i, j-2);\t//\t *\n\t\t\t\tpaintPointInColor(i, j-1);\t//\t * * *\n\t\t\t\tpaintPointInColor(i, j);\t//\t* * * * *\n\t\t\t\tpaintPointInColor(i, j+1);\t//\t * * *\n\t\t\t\tpaintPointInColor(i, j+2);\t//\t *\n\t\t\t\tpaintPointInColor(i+1, j-1);\n\t\t\t\tpaintPointInColor(i+1, j);\n\t\t\t\tpaintPointInColor(i+1, j+1);\n\t\t\t\tpaintPointInColor(i+2, j);\n\t\t\t}\n\t\t}\t\t\n\t}", "public void createList () {\n imageLocs = new ArrayList <Location> ();\n for (int i = xC; i < xLength * getPixelSize() + xC; i+=getPixelSize()) {\n for (int j = yC; j < yLength * getPixelSize() + yC; j+=getPixelSize()) {\n Location loc = new Location (i, j, LocationType.POWERUP, true);\n\n imageLocs.add (loc);\n getGridCache().add(loc);\n \n }\n }\n }", "public static ArrayList<Point2D> losujPunkty(int ile, Canvas canvas) {\n double w = canvas.getWidth();\n double h = canvas.getHeight();\n ArrayList<Point2D> wylosowane = new ArrayList<>();\n for (int i = 0; i < ile; i++) {\n double x = Math.random() * w;\n double y = Math.random() * h;\n Point2D nowy = new Point2D(x, y);\n wylosowane.add(nowy);\n }\n\n return wylosowane;\n }", "public List<PuzzleInstance> generateInstance() {\n\n final String[] POSITION = {\"Up\", \"Down\", \"Left\", \"Right\"};// In this order\n List<PuzzleInstance> puzzleInstances = new ArrayList<>();\n\n for (String traverse : POSITION) {\n int tempI=-1, tempJ=-1;\n switch (traverse) {\n case \"Up\":\n tempI = row - 1; \n tempJ = coloum;\n break;\n case \"Down\":\n tempI = row + 1; \n tempJ = coloum;\n break;\n case \"Left\":\n tempI = row; \n tempJ = coloum - 1;\n break;\n case \"Right\":\n tempI = row; \n tempJ = coloum + 1;\n break;\n }\n \n if((tempI < 0 || tempJ <0)|| (tempI >= rowColoumSize || tempJ >=rowColoumSize )){\n System.out.println(\"Out of bound\");\n // skip it nothing to add in the list\n }else{\n final Integer[][] puzzleGenerator = cloneArray(puzzle); \n int temp = puzzleGenerator [tempI][tempJ];\n puzzleGenerator[tempI][tempJ] = 0;\n puzzleGenerator[row][coloum] = temp;\n \n PuzzleInstance puzzleInstance = new PuzzleInstance(cloneArray(puzzleGenerator),rowColoumSize,cost_of_path+1,traverse, this);\n puzzleInstances.add(puzzleInstance); \n }\n }\n\n return puzzleInstances;\n \n \n }", "@Override\n public void onDirectionSuccess(List<Points> point) {\n for (Points points:point){\n PolylineOptions polyLineOptions = new PolylineOptions().geodesic(true).color(Color.BLUE\n ).width(15);\n for (int i = 0; i < points.points.size(); i++)\n polyLineOptions.add(points.points.get(i));\n\n polylinePaths.add(mMap.addPolyline(polyLineOptions));\n\n }\n\n }", "private void generatePointPairs() {\n\t\tfinal int mod = SIZE_OF_ORIGINAL_LIST * 8; \n\t\t\n\t\tif(DEBUG) System.out.println(\"----- Generating Point Pairs...\");\n\n\t\tint counter = 0;\n\t\tint j = 0;\n\t\t\n\t\tfor(int i = 0; i < myPoints.length; i++) {\n\t\t\t//while(j++ < myPoints.length) {\n\t\t\tfor( ; j < myPoints.length; j++) {\n\t\t\t\t// i and j are the same point, so ignore that pair.\n\t\t\t\tif(i != j) {\n\t\t\t\t\tmyPairs.add(new PointPair(myPoints[i], myPoints[j]));\n\t\t\t\t\tif(DEBUG && ++counter % mod == 0) System.out.print(\"pair \");\n\t\t\t\t}\n\t\t\t\t// Not yet colinear, just a unique pair to use later.\n\t\t\t}\n\n\t\t}\n\t\tif(DEBUG) System.out.println(\"\\n----- ----- \" + counter + \" pairs found.\\n\");\n\t}", "void newRoutePoint(RoutePointDTO routePointDTO, RouteDTO routeDTO, List<RoutePointDTO> points);", "public void generateRandomPosition() {\n\t\tx.set((int)(Math.floor(Math.random()*23+1)));\n\t\ty.set((int)(Math.floor(Math.random()*23+1)));\n\n\t}", "private Vector2d generateNewPositionForChild()\n {\n\n Random generator = new Random();\n List<Vector2d> freePositions = new LinkedList<>(); //tutaj przechowywane sa wolne pozycje wokol\n Vector2d position;\n Directions directionToAdd;\n\n for(int i = 0; i<8; i++)\n {\n directionToAdd = new Directions(i); //wykorzystujemy klase directions do generowania pozycji wokol\n position = this.position.add(directionToAdd.move());\n if(map.animalsAt(position).isEmpty())\n {\n freePositions.add(position);\n }\n }\n\n if(freePositions.isEmpty()) //jezeli nie ma wolnych pozycji\n {\n //jesli nie ma wolnych pozycji\n int x = generator.nextInt(8);\n directionToAdd = new Directions(x);\n return this.position.add(directionToAdd.move());\n }\n\n //jezeli mamy wolne pozycje to generujemy dowolna z listy\n int x = generator.nextInt(freePositions.size());\n Vector2d newPosition = freePositions.get(x);\n\n return newPosition;\n }", "public void limpaPontos() {\n\t\tthis.pontos = new ArrayList<Point>();\n\t}", "public void getSeriesForPoints(){\n\n int lenght = cluster_polygon_coordinates.length;\n\n x_latitude = new Number[lenght];\n y_longitude = new Number[lenght];\n\n //x_latitude[lenght-1] = cluster_polygon_coordinates[0].x;\n //y_longitude[lenght-1] = cluster_polygon_coordinates[0].y;\n for (int i=0;i<lenght;i++) {\n\n x_latitude[i] = cluster_polygon_coordinates[i].x;\n y_longitude[i] = cluster_polygon_coordinates[i].y;\n// Log.d(TAG, Double.toString(cluster_polygon_coordinates[i].x));\n// Log.d(TAG, Double.toString(cluster_polygon_coordinates[i].y));\n// Log.d(TAG, Double.toString(cluster_polygon_coordinates[i].z));\n }\n\n }", "public static void main(String[] args) {\n\t\tArrayList<Points> pointsPath = new ArrayList<>();\r\n\t\tPoints p = new Points();\r\n\t\tpointsPath.add(new Points(p));\r\n\t\tp.move(4, 4);\r\n\t\tpointsPath.add(new Points(p));\r\n\t\tp.move(10, 10);\r\n\t\tpointsPath.add(new Points(p));\r\n\t\tIterator<Points> it = pointsPath.iterator();\r\n\t\twhile(it.hasNext()){\r\n\t\t\tSystem.out.println(\r\n\t\t\t\t\t it.next());\r\n\t\t}\r\n\t\t\r\n\t}", "public void creationPlateau() {\n for (int i = 0; i < 10; i++) {\n int X = rand.nextInt(14);\n int Y = rand.nextInt(14);\n if (plateau[X][Y] == null && espacementMonstre(X,Y,plateau)) {\n int monstreAleatoire = 1 + (int)(Math.random() * ((3 - 1) + 1));\n switch (monstreAleatoire) {\n case 1:\n Personnage monstreD = new Dragonnet(X,Y);\n plateau[X][Y] = monstreD;\n this.monstre.add(monstreD);\n System.out.println(\"Dragonnet ajouté en position : \"+X+\" \"+Y);\n break;\n case 2:\n Personnage monstreL = new Loup(X,Y);\n plateau[X][Y] = monstreL;\n this.monstre.add(monstreL);\n System.out.println(\"Loup ajouté en position : \"+X+\" \"+Y);\n\n break;\n case 3:\n Personnage monstreO = new Orque(X,Y);\n plateau[X][Y] = monstreO;\n this.monstre.add(monstreO);\n System.out.println(\"Orque ajouté en position : \"+X+\" \"+Y);\n break;\n }\n } else {\n i --;\n }\n }\n }", "public void setPoints(String points);", "public ColinearTrioV2(Point[] thePoints) {\n\t\t myPoints = thePoints;\n\t\t myPairs = new ArrayList<PointPair>();\n\t\t map = new HashMap<>(thePoints.length);\n\t\t SIZE_OF_ORIGINAL_LIST = thePoints.length; // just a pointer to the original list.\n\t\t start();\n\t}", "private void defineLinePoints(int x1, int y1,int x2,int y2){\n Line line1 = new Line(x1, y1, x2, y2);\n for(int i = 0; i < line1.points.size(); i++){\n super.points.add(line1.points.get(i));\n }\n }", "@Override\n public ArrayList<ArrayList<String>> getNeighborhood(ArrayList<String> point, double argument1, double argument2) {\n ArrayList<ArrayList<String>> neighborhood = new ArrayList<>();\n String[] moves = {\"U\", \"D\", \"L\", \"R\"};\n if(point.size() == 0){\n point.add(moves[(int)(Math.random()*4)]);\n }\n\n //kazde rozwiązanie powstaje przez wstawienie każdego ruchu w środku ścieżki\n for(int i = 0; i<point.size(); i++){\n for(String move : moves){\n ArrayList<String> newPath = arrayListDeepCopy(point);\n newPath.add(i, move);\n newPath = cleanUpPath(newPath);\n if(testFunction.check(newPath)) neighborhood.add(newPath);\n }\n for(String move : moves){\n ArrayList<String> newPath = arrayListDeepCopy(point);\n newPath.add(i, move);\n newPath.add(i, move);\n newPath = cleanUpPath(newPath);\n if(testFunction.check(newPath)) neighborhood.add(newPath);\n }\n }\n\n //kazde rozwiązanie powstaje przez usunięcie jednego elementu\n for(int i=0; i<point.size(); i++){\n ArrayList<String> newPath = arrayListDeepCopy(point);\n newPath.remove(i);\n newPath = cleanUpPath(newPath);\n if(testFunction.check(newPath)) neighborhood.add(newPath);\n }\n\n //kazde rozwiązanie powstaje przez swapowanie wszystkich z losowym\n int random = (int)(Math.random()*point.size());\n for(int i=0; i<point.size(); i++){\n ArrayList<String> newPath = arrayListDeepCopy(point);\n newPath.set(i, point.get(random));\n newPath.set(random, point.get(i));\n newPath = cleanUpPath(newPath);\n if(testFunction.check(newPath)) neighborhood.add(newPath);\n }\n\n //System.out.println(neighborhood.size());\n\n ArrayList<ArrayList<String>> newNeighborhood = new ArrayList<>();\n for (int i = 0; i < neighborhood.size(); i++) {\n newNeighborhood.add(shortenPath(neighborhood.get(i)));\n }\n\n return newNeighborhood;\n }", "private void readPoints(List<Element> pointElements, Model model)\n throws ObjectExistsException {\n // Add the points.\n for (int i = 0; i < pointElements.size(); i++) {\n Element curPointElement = pointElements.get(i);\n String attrVal;\n Integer pointID;\n try {\n pointID = Integer.valueOf(curPointElement.getAttributeValue(\"id\"));\n }\n catch (NumberFormatException e) {\n pointID = null;\n }\n Point curPoint = model.createPoint(pointID);\n TCSObjectReference<Point> pointRef = curPoint.getReference();\n String pointName = curPointElement.getAttributeValue(\"name\");\n if (pointName == null || pointName.isEmpty()) {\n pointName = \"PointName\" + i + \"Unknown\";\n }\n model.getObjectPool().renameObject(pointRef, pointName);\n Triple position = new Triple();\n attrVal = curPointElement.getAttributeValue(\"xPosition\");\n if (attrVal != null) {\n position.setX(Long.parseLong(attrVal));\n }\n attrVal = curPointElement.getAttributeValue(\"yPosition\");\n if (attrVal != null) {\n position.setY(Long.parseLong(attrVal));\n }\n attrVal = curPointElement.getAttributeValue(\"zPosition\");\n if (attrVal != null) {\n position.setZ(Long.parseLong(attrVal));\n }\n model.setPointPosition(pointRef, position);\n attrVal = curPointElement.getAttributeValue(\"vehicleOrientationAngle\");\n if (attrVal != null) {\n model.setPointVehicleOrientationAngle(pointRef,\n Double.parseDouble(attrVal));\n }\n Point.Type pType\n = Point.Type.valueOf(curPointElement.getAttributeValue(\"type\"));\n model.setPointType(pointRef, pType);\n List<Element> pointProps = curPointElement.getChildren(\"property\");\n for (int j = 0; j < pointProps.size(); j++) {\n Element curPointPropElement = pointProps.get(j);\n String propName = curPointPropElement.getAttributeValue(\"name\");\n if (propName == null || propName.isEmpty()) {\n propName = \"Property\" + j + \"Unknown\";\n }\n String propValue = curPointPropElement.getAttributeValue(\"value\");\n if (propValue == null || propValue.isEmpty()) {\n propValue = \"Value\" + j + \"Unknown\";\n }\n model.getObjectPool().setObjectProperty(pointRef, propName,\n propValue);\n }\n }\n }", "private void createVertices(int iX, int iY, int iXO, int iYO, int num, int increment) {\n int y = iY;\n if (num == 0 && increment == 0) {\n BracketNode last = new BracketNode(\"\", iX, y - 20, iXO, 20);\n nodes.add(last);\n getChildren().addAll(new Line(iX, iY, iX + iXO, iY), last);\n last.setName(currentBracket.getBracket().get(location));\n bracketMap.put(last, location);\n nodeMap.put(location, last);\n } else {\n ArrayList<BracketNode> aNodeList = new ArrayList<>();\n for (int i = 0; i < num; i++) {\n Point2D tl = new Point2D(iX, y);\n Point2D tr = new Point2D(iX + iXO, y);\n Point2D bl = new Point2D(iX, y + iYO);\n Point2D br = new Point2D(iX + iXO, y + iYO);\n BracketNode nTop = new BracketNode(\"\", iX, y - 20, iXO, 20);\n aNodeList.add(nTop);\n nodes.add(nTop);\n BracketNode nBottom = new BracketNode(\"\", iX, y + (iYO - 20), iXO, 20);\n aNodeList.add(nBottom);\n nodes.add(nBottom);\n Line top = new Line(tl.getX(), tl.getY(), tr.getX(), tr.getY());\n Line bottom = new Line(bl.getX(), bl.getY(), br.getX(), br.getY());\n Line right = new Line(tr.getX(), tr.getY(), br.getX(), br.getY());\n getChildren().addAll(top, bottom, right, nTop, nBottom);\n isTop = !isTop;\n y += increment;\n }\n ArrayList<Integer> tmpHelp = helper(location, num);\n for (int j = 0; j < aNodeList.size(); j++) {\n //System.out.println(currentBracket.getBracket().get(tmpHelp.get(j)));\n aNodeList.get(j).setName(currentBracket.getBracket().get(tmpHelp.get(j)));\n bracketMap.put(aNodeList.get(j), tmpHelp.get(j));\n nodeMap.put(tmpHelp.get(j), aNodeList.get(j));\n //System.out.println(bracketMap.get(aNodeList.get(j)));\n }\n }\n\n }", "private void createLocations( int numLocation, double offset, double sceneX, double sceneY, Random rand) {\n\n for (int k = 0; k < numLocation; k++) {\n int tmpOffSetX = (int) sceneX - ((int) offset * 2);\n int tmpOffsetY = (int) sceneY - ((int) offset * 2);\n double x = rand.nextInt(tmpOffSetX - 300);\n double y = rand.nextInt(tmpOffsetY);\n for (Location lo : locations)\n if (lo.intersects(new BoundingBox(x, y, offset * 2, offset * 2))) {\n x = rand.nextInt(tmpOffSetX - 300);\n y = rand.nextInt(tmpOffsetY);\n }\n if (x < offset) x += (offset + 10); // Attempts to buffer location from being placed off-screen.\n if (y < offset) y += (offset + 10);\n if (y > sceneY - offset) y -= (offset + 10);\n if (x > sceneX - offset) x -= (offset + 10);\n locations.add(new Location(x, y, offset, \"Location \" + k)); // adds new locations\n this.getChildren().add(locations.get(k));\n this.getChildren().add(new Text(\n locations.get(k).getCenterX() - offset,\n locations.get(k).getCenterY() + (offset * 2),\n locations.get(k).getName()));\n locations.get(k).setOnMouseClicked(locationEvent);\n }\n\n }", "public void generate() {\n\t\tMirror m = new Mirror();\n\t\tpoints.addAll(m.fish());\n\t\twhile (remainingPoints > 0) {\n\t\t\titerate();\n\t\t\tremainingPoints--;\n\t\t}\n\n\t}", "private void DrawDots(List<HashMap<String, String>> result,ArrayList point2) {\n map.clear();\n MarkerOptions options = new MarkerOptions();\n\n // this is the start location marker in green\n options.position(origin);\n options.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_GREEN));\n // the is the end location marker in red\n map.addMarker(options);\n options.position(dest);\n\n options.icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_RED));\n\n map.addMarker(options);\n ArrayList points = null;\n\n PolylineOptions lineOptions = null;\n\n MarkerOptions markerOptions = new MarkerOptions();\n points = new ArrayList();\n\n\n lineOptions = new PolylineOptions();\n List<HashMap<String, String>> path = result;\n\n for (int j = 1; j < path.size(); j++) {\n HashMap<String, String> point = path.get(j);\n\n double lat = Double.parseDouble(point.get(\"lat\"));\n double lng = Double.parseDouble(point.get(\"lng\"));\n LatLng position = new LatLng(lat, lng);\n points.add(position);\n\n }\n\n lineOptions.addAll(points);\n lineOptions.width(12);\n\n lineOptions.color(Color.RED);\n\n lineOptions.geodesic(true);\n map.addPolyline(lineOptions);\n\n for (Object k : points2) {\n map.addCircle(new CircleOptions()\n .center((LatLng) k)\n .radius(3)\n .strokeColor(Color.BLUE)\n .fillColor(Color.BLUE));\n }\n }", "private static List<Point> createConvergingDataset() {\r\n List<Point> data = new ArrayList<Point>();\r\n add(data, 1, 400);\r\n add(data, 5, 700);\r\n add(data, 10, 900);\r\n add(data, 15, 1000);\r\n add(data, 20, 1050);\r\n add(data, 25, 1060);\r\n add(data, 30, 1062);\r\n return data;\r\n }", "public ArrayList<LatLng> getCoordinates(int runID){\r\n ArrayList<LatLng> journey = new ArrayList<>();\r\n LatLng current;\r\n String[] id = {String.valueOf(runID)};\r\n String[] columns = {ContentContract.LATITUDE, ContentContract.LONGITUDE};\r\n String whereClause = ContentContract.RUN_ID + \"= ?\";\r\n\r\n // Query from ContentProvider for the run coordinates table\r\n Cursor c = getContentResolver().query(ContentContract.RUN_COORDINATES, columns, whereClause, id, null);\r\n Log.d(\"g53mdp\", DatabaseUtils.dumpCursorToString(c));\r\n if(c.moveToFirst()){\r\n do {\r\n // Builds the LatLng list\r\n double latitude = c.getDouble(3);\r\n double longitude = c.getDouble(4);\r\n current = new LatLng(latitude, longitude);\r\n journey.add(current);\r\n } while(c.moveToNext());\r\n }\r\n return journey;\r\n }", "private ArrayList<double[]> generatePoints(int divisions) {\n\t\tArrayList<double[]> result = new ArrayList<double[]>();\n\t\tdouble[] weight = new double[Run.NUMBER_OF_OBJECTIVES];\n\t\t\n\t\tif (divisions != 0) {\n\t\t\tgenerateRecursive(result, weight, Run.NUMBER_OF_OBJECTIVES, divisions, divisions, 0);\n\t\t}\n\t\t\n\t\treturn result;\n\t}", "public Polygon()\n {\n points = new ArrayList<PointF>();\n }", "private static Point[] generateKnownColinear(final int quantity) {\n\t\tint xStart = 0;\n\t\tint yStart = 0;\n\t\tPoint[] pointArray = new Point[quantity];\n\t\t\n\t\tSystem.out.println(\"Using \" + quantity + \" of known co-linear points.\");\n\t\t\n\t\tfor(int i = 0; i < quantity; i++) {\n\t\t\tpointArray[i] = new Point(xStart++, yStart++);\n\t\t}\n\t\t\n\t\treturn pointArray;\n\t}", "private ArrayList<Integer> cnvPoints2IndexList(ArrayList<Point> pts) {\n int width = layoutPanel.getLayoutSize().width;\n ArrayList<Integer> newNList = new ArrayList<Integer>();\n\n Iterator<Point> iter = pts.iterator();\n while (iter.hasNext()) {\n Point pt = iter.next();\n newNList.add(pt.y * width + pt.x);\n }\n Collections.sort(newNList);\n\n return newNList;\n }", "private void setShips(){\n\t\t\n\t\tint x,y;\n\t\tboolean orientacja;\n\t\tRandom generator = new Random();\n\t\t\n\t\tint ilosc = 1;\n\t\tint j = 0;\n\t\tfor(int i = 4; i > 0 ; i--){\n\t\t\twhile( j < ilosc ){\n\t\t\t\tx = generator.nextInt( 13 );\t\t\n\t\t\t\ty = generator.nextInt( 13 );\n\t\t\t\torientacja = generator.nextBoolean();\n\t\t\t\tif( isPossibleAddShip(x, y, i, orientacja) ) j++;\t\n\t\t\t}\n\t\tilosc++;\n\t\tj=0;\n\t\t}\n\t\t\n\t}", "public ArrayList<Vertex> initStart() {\r\n\t\tArrayList<Vertex> startPoint = new ArrayList<>();\r\n\t\tstartPoint.add(new Vertex(17, 2));\r\n\t\tstartPoint.add(new Vertex(16, 14));\r\n\t\tstartPoint.add(new Vertex(15, 14));\r\n\t\tstartPoint.add(new Vertex(11, 22));\r\n\t\tstartPoint.add(new Vertex(11, 21));\r\n\t\tstartPoint.add(new Vertex(22, 3));\r\n\t\tstartPoint.add(new Vertex(22, 2));\r\n\t\tstartPoint.add(new Vertex(20, 3));\r\n\t\tstartPoint.add(new Vertex(17, 21));\r\n\t\tstartPoint.add(new Vertex(17, 20));\r\n\t\tstartPoint.add(new Vertex(15, 21));\r\n\t\tstartPoint.add(new Vertex(12, 21));\r\n\t\treturn startPoint;\r\n\t}", "public void generatePositionGroups(){\n for (int i = 0; i < Input.length()+1; i++){\n PositionGroup pg = generatePositionGroupAt(i);\n PositionGroupList.add(pg);\n }\n }", "public void darCoordenadas() {\r\n\t\t\r\n\t\tfor(int x = 0; x<palabras.size(); x++) {\r\n\t\t\t\r\n\t\t\tif (palabras.get(x).get(0).getOrientacion().equals(\"V\")) {\r\n\t\t\t\tint coordenadaX = palabras.get(x).get(0).getX();\r\n\t\t\t\tint coordenadaY = palabras.get(x).get(0).getY();\r\n\t\t\t\t\r\n\t\t\t\tfor(int y = 1; y < palabras.get(x).size(); y++) \r\n\t\t\t\t{\r\n\t\t\t\t\tcoordenadaY++;\r\n\t\t\t\t\tpalabras.get(x).get(y).setX(coordenadaX);\r\n\t\t\t\t\tpalabras.get(x).get(y).setY(coordenadaY);\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (palabras.get(x).get(0).getOrientacion().equals(\"H\") ) {\r\n\t\t\t\t\r\n\t\t\t\tint coordenadaX = palabras.get(x).get(0).getX();\r\n\t\t\t\tint coordenadaY = palabras.get(x).get(0).getY();\r\n\t\t\t\t\r\n\t\t\t\tfor(int y = 1; y < palabras.get(x).size(); y++) \r\n\t\t\t\t{\r\n\t\t\t\t\tcoordenadaX++;\r\n\t\t\t\t\tpalabras.get(x).get(y).setX(coordenadaX);\r\n\t\t\t\t\tpalabras.get(x).get(y).setY(coordenadaY);\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public List<int[]> getCoords(Board lev){\n \tint[][] coords;\n \tColumn c = lev.getColumns().get(col);\n \tint[] p1 = c.getFrontPoint1();\n \tint[] p2 = c.getFrontPoint2();\n\n \tif (isPod && z < Board.BOARD_DEPTH) {\n \t\tint cx = p1[0] + (p2[0]-p1[0])/2;\n \t\tint cy = p1[1] + (p2[1]-p1[1])/2;\n\n \t\t// define outer and inner diamonds\n \t\tint[][] outer = new int[4][3];\n \t\tint[][] inner = new int[4][3];\n \t\touter[0][0] = cx;\n \t\touter[0][1] = cy - PODSIZE;\n \t\touter[0][2] = (int)z;\n \t\touter[1][0] = cx + PODSIZE;\n \t\touter[1][1] = cy;\n \t\touter[1][2] = (int) z;\n \t\touter[2][0] = cx;\n \t\touter[2][1] = cy + PODSIZE;\n \t\touter[2][2] = (int) z;\n \t\touter[3][0] = cx - PODSIZE;\n \t\touter[3][1] = cy;\n \t\touter[3][2] = (int) z;\n \t\tinner[0][0] = cx;\n \t\tinner[0][1] = cy - PODSIZE/3;\n \t\tinner[0][2] = (int) z;\n \t\tinner[1][0] = cx + PODSIZE/3;\n \t\tinner[1][1] = cy;\n \t\tinner[1][2] = (int) z;\n \t\tinner[2][0] = cx;\n \t\tinner[2][1] = cy + PODSIZE/3;\n \t\tinner[2][2] = (int) z;\n \t\tinner[3][0] = cx - PODSIZE/3;\n \t\tinner[3][1] = cy;\n \t\tinner[3][2] = (int) z;\n\n \t\t// define line path through those diamonds:\n \t\tcoords = new int[17][3];\n \t\tcoords[0] = outer[0];\n \t\tcoords[1] = outer[1];\n \t\tcoords[2] = inner[1];\n \t\tcoords[3] = inner [0];\n \t\tcoords[4] = outer[1];\n \t\tcoords[5] = outer[2];\n \t\tcoords[6] = inner[2];\n \t\tcoords[7] = inner[1];\n \t\tcoords[8] = outer[2];\n \t\tcoords[9] = outer[3];\n \t\tcoords[10]= inner[3];\n \t\tcoords[11]= inner[2];\n \t\tcoords[12]= outer[3];\n \t\tcoords[13]= outer[0];\n \t\tcoords[14]= inner[0];\n \t\tcoords[15]= inner[3];\n \t\tcoords[16]= outer[0];\n \t}\n \telse { \n \t\tcoords = new int[7][3];\n \t\tswitch (s) {\n \t\tcase STRAIGHT:\n \t\t\tcoords[0][0] = p1[0];\n \t\t\tcoords[0][1] = p1[1];\n \t\t\tcoords[0][2] = (int) (z-EXHEIGHT_H);\n \t\t\tcoords[1][0] = p2[0];\n \t\t\tcoords[1][1] = p2[1];\n \t\t\tcoords[1][2] = (int) (z+EXHEIGHT_H);\n \t\t\tcoords[2][0] = p2[0] - (p2[0]-p1[0])/3;\n \t\t\tcoords[2][1] = p2[1] - (p2[1]-p1[1])/3;\n \t\t\tcoords[2][2] = (int) z;\n \t\t\tcoords[3][0] = p2[0];\n \t\t\tcoords[3][1] = p2[1];\n \t\t\tcoords[3][2] = (int) (z-EXHEIGHT_H);\n \t\t\tcoords[4][0] = p1[0];\n \t\t\tcoords[4][1] = p1[1];\n \t\t\tcoords[4][2] = (int) (z+EXHEIGHT_H);\n \t\t\tcoords[5][0] = p1[0] + (p2[0]-p1[0])/3;\n \t\t\tcoords[5][1] = p1[1] + (p2[1]-p1[1])/3;\n \t\t\tcoords[5][2] = (int) z;\n \t\t\tcoords[6][0] = p1[0];\n \t\t\tcoords[6][1] = p1[1];\n \t\t\tcoords[6][2] = (int) (z-EXHEIGHT_H);\n \t\t\tbreak;\n\n \t\tcase JUMPRIGHT1:\n \t\tcase LANDRIGHT2:\n \t\t\tcoords[0][0] = p1[0] + (p2[0]-p1[0])/4;\n \t\t\tcoords[0][1] = p1[1] + (p2[1]-p1[1])/4;\n \t\t\tcoords[0][2] = (int) (z+EXHEIGHT_H*2);\n \t\t\tcoords[1][0] = p2[0] + (p2[0]-p1[0])/4;\n \t\t\tcoords[1][1] = p2[1] + (p2[1]-p1[1])/4;\n \t\t\tcoords[1][2] = (int) (z+EXHEIGHT_H*2);\n \t\t\tcoords[2][0] = p2[0] - (p2[0]-p1[0])/11;\n \t\t\tcoords[2][1] = p2[1] - (p2[1]-p1[1])/11;\n \t\t\tcoords[2][2] = (int) (z+EXHEIGHT_H*1.8);\n \t\t\tcoords[3][0] = p2[0];\n \t\t\tcoords[3][1] = p2[1];\n \t\t\tcoords[3][2] = (int) z;\n \t\t\tcoords[4][0] = (int) (p1[0] + (p2[0]-p1[0])/2);\n \t\t\tcoords[4][1] = (int) (p1[1] + (p2[1]-p1[1])/2);\n \t\t\tcoords[4][2] = (int) (z+ EXHEIGHT_H*5);\n \t\t\tcoords[5][0] = (int) (p2[0] - (p2[0]-p1[0])/2.5);\n \t\t\tcoords[5][1] = (int) (p2[1] - (p2[1]-p1[1])/2.5);\n \t\t\tcoords[5][2] = (int) (z+EXHEIGHT_H *2.6);\n \t\t\tcoords[6] = coords[0];\n \t\t\tbreak;\n\n \t\tcase JUMPLEFT1:\n \t\tcase LANDLEFT2:\n \t\t\tcoords[0][0] = p1[0];\n \t\t\tcoords[0][1] = p1[1];\n \t\t\tcoords[0][2] = (int) z;\n \t\t\tcoords[1][0] = (int) (p1[0] + (p2[0]-p1[0])/2);\n \t\t\tcoords[1][1] = (int) (p1[1] + (p2[1]-p1[1])/2);\n \t\t\tcoords[1][2] = (int) (z+ EXHEIGHT_H*5);\n \t\t\tcoords[2][0] = (int) (p1[0] + (p2[0]-p1[0])/2.5);\n \t\t\tcoords[2][1] = (int) (p1[1] + (p2[1]-p1[1])/2.5);\n \t\t\tcoords[2][2] = (int) (z+EXHEIGHT_H *2.6);\n \t\t\tcoords[3][0] = p2[0] - (p2[0]-p1[0])/4;\n \t\t\tcoords[3][1] = p2[1] - (p2[1]-p1[1])/4;\n \t\t\tcoords[3][2] = (int) (z+EXHEIGHT_H*2);\n \t\t\tcoords[4][0] = p1[0] - (p2[0]-p1[0])/4;\n \t\t\tcoords[4][1] = p1[1] - (p2[1]-p1[1])/4;\n \t\t\tcoords[4][2] = (int) (z+EXHEIGHT_H*2);\n \t\t\tcoords[5][0] = p1[0] + (p2[0]-p1[0])/11;\n \t\t\tcoords[5][1] = p1[1] + (p2[1]-p1[1])/11;\n \t\t\tcoords[5][2] = (int) (z+EXHEIGHT_H*1.8);\n \t\t\tcoords[6] = coords[0];\n \t\t\tbreak;\n\n \t\tcase JUMPLEFT2:\n \t\tcase LANDLEFT1:\n \t\t\tcoords[0][0] = p1[0];\n \t\t\tcoords[0][1] = p1[1];\n \t\t\tcoords[0][2] = (int) z;\n \t\t\tcoords[1][0] = (int) (p1[0] + (p2[0]-p1[0])/4.5);\n \t\t\tcoords[1][1] = (int) (p1[1] + (p2[1]-p1[1])/4.5);\n \t\t\tcoords[1][2] = (int) (z+ EXHEIGHT_H*8);\n \t\t\tcoords[2][0] = (int) (p1[0] + (p2[0]-p1[0])/4.5);\n \t\t\tcoords[2][1] = (int) (p1[1] + (p2[1]-p1[1])/4.5);\n \t\t\tcoords[2][2] = (int) (z+EXHEIGHT_H *4);\n \t\t\tcoords[3][0] = p2[0] - (p2[0]-p1[0])/2;\n \t\t\tcoords[3][1] = p2[1] - (p2[1]-p1[1])/2;\n \t\t\tcoords[3][2] = (int) (z+EXHEIGHT_H*4);\n \t\t\tcoords[4][0] = (int) (p1[0] - (p2[0]-p1[0])/3.5);\n \t\t\tcoords[4][1] = (int) (p1[1] - (p2[1]-p1[1])/3.5);\n \t\t\tcoords[4][2] = (int) (z+EXHEIGHT_H*1.8);\n \t\t\tcoords[5][0] = p1[0];// - (p2[0]-p1[0])/15;\n \t\t\tcoords[5][1] = p1[1];// - (p2[1]-p1[1])/15;\n \t\t\tcoords[5][2] = (int) (z+EXHEIGHT_H*1.8);\n \t\t\tcoords[6] = coords[0];\n \t\t\tbreak;\n\n \t\tcase JUMPRIGHT2:\n \t\tcase LANDRIGHT1:\n \t\t\tcoords[0][0] = p2[0] - (p2[0]-p1[0])/2;\n \t\t\tcoords[0][1] = p2[1] - (p2[1]-p1[1])/2;\n \t\t\tcoords[0][2] = (int) (z+EXHEIGHT_H*4);\n \t\t\tcoords[1][0] = (int) (p2[0] + (p2[0]-p1[0])/3.5);\n \t\t\tcoords[1][1] = (int) (p2[1] + (p2[1]-p1[1])/3.5);\n \t\t\tcoords[1][2] = (int) (z+EXHEIGHT_H*1.8);\n \t\t\tcoords[2][0] = p2[0];// - (p2[0]-p1[0])/15;\n \t\t\tcoords[2][1] = p2[1];// - (p2[1]-p1[1])/15;\n \t\t\tcoords[2][2] = (int) (z+EXHEIGHT_H*1.8);\n \t\t\tcoords[3][0] = p2[0];\n \t\t\tcoords[3][1] = p2[1];\n \t\t\tcoords[3][2] = (int) z;\n \t\t\tcoords[4][0] = (int) (p2[0] - (p2[0]-p1[0])/4.5);\n \t\t\tcoords[4][1] = (int) (p2[1] - (p2[1]-p1[1])/4.5);\n \t\t\tcoords[4][2] = (int) (z+ EXHEIGHT_H*8);\n \t\t\tcoords[5][0] = (int) (p2[0] - (p2[0]-p1[0])/4.5);\n \t\t\tcoords[5][1] = (int) (p2[1] - (p2[1]-p1[1])/4.5);\n \t\t\tcoords[5][2] = (int) (z+EXHEIGHT_H *4);\n \t\t\tcoords[6] = coords[0];\n \t\t\tbreak;\n \t\t}\n \t}\n\n \treturn Arrays.asList(coords);\n }", "@Override\n public CoordenadasDTO asignarCoordenadasNave(List<NaveDTO> naveDTOS){\n logger.debug(\"MensajeService::asignarCoordenadasNave()\");\n CoordenadasDTO posiciones = new CoordenadasDTO();\n double posicion [][] = new double [][] {{-500.00 , 200.00}, {100.00, -100.00}, {500.00, 100.00}};\n double distances[] = obtenerDistancias(naveDTOS);\n try {\n NonLinearLeastSquaresSolver trilateracion = new NonLinearLeastSquaresSolver(new TrilaterationFunction(posicion, distances), new LevenbergMarquardtOptimizer());\n LeastSquaresOptimizer.Optimum optimum = trilateracion.solve();\n double centroid[] = optimum.getPoint().toArray();\n posiciones.setY(centroid[1]);\n posiciones.setX(centroid[0]);\n\n } catch (Exception e){\n }\n return posiciones;\n }", "public ArrayList<Elemento> getPosicionesAdyacentes(){\n ArrayList <Elemento> result = new ArrayList<>();\n int[] coordenada_i = {0,1,1,1,0,-1,-1,-1};\n int[] coordenada_j = {1,1,0,-1,-1,-1,0,1};\n int nueva_posicion_fila = 0;\n int nueva_posicion_columna = 0;\n for(int k=0; k<8; k++){\n nueva_posicion_fila = fila + coordenada_i[k];\n nueva_posicion_columna = columna + coordenada_j[k];\n \n if((0 <= nueva_posicion_fila) && (nueva_posicion_fila < automata.getAutomata().length) && \n (0<= nueva_posicion_columna) && (nueva_posicion_columna < automata.getAutomata()[0].length)){\n result.add(automata.getElemento(nueva_posicion_fila,nueva_posicion_columna));\n \n }\n \n }\n return result;\n }", "@Test\n public void testGeneratePositionsFrom() {\n for (int line = 0; line < 11; line++) {\n for (int column = 0; column < 11; column++) {\n Position position = new Position(line, column);\n assertNotNull(this.board.generatePositionsFrom(position));\n }\n }\n }", "public ArrayList<Vertex> initEnd() {\r\n\t\tArrayList<Vertex> endPoints = new ArrayList<>();\r\n\t\tendPoints.add(new Vertex(11, 20));\r\n\t\tendPoints.add(new Vertex(8, 22));\r\n\t\tendPoints.add(new Vertex(8, 20));\r\n\t\tendPoints.add(new Vertex(15, 2));\r\n\t\tendPoints.add(new Vertex(19, 13));\r\n\t\tendPoints.add(new Vertex(15, 21));\r\n\t\tendPoints.add(new Vertex(12, 21));\r\n\t\tendPoints.add(new Vertex(11, 21));\r\n\t\tendPoints.add(new Vertex(20, 2));\r\n\t\tendPoints.add(new Vertex(17, 2));\r\n\t\tendPoints.add(new Vertex(16, 14));\r\n\t\tendPoints.add(new Vertex(15, 14));\r\n\t\treturn endPoints;\r\n\t}", "public XYSeries getXYSeries(String serie_name){ \n XYSeries serie = new XYSeries(serie_name); \n Point2D[] points_bezier = getPoint2DArray(); \n for(int j = 0 ; j < points_bezier.length; j++){ \n \n serie.add(points_bezier[j].getX(),points_bezier[j].getY()); \n } \n return serie; \n}", "private void plottingMarkers(){\r\n if (nameList.size()==0) {\r\n }\r\n else {\r\n for (int i = 0; i < nameList.size(); i++) {\r\n Loc2LatLng = new LatLng(Double.parseDouble(latList.get(i)), Double.parseDouble(lngList.get(i)));\r\n MarkerOptions markerSavedLocations = new MarkerOptions();\r\n markerSavedLocations.title(nameList.get(i));\r\n markerSavedLocations.position(Loc2LatLng);\r\n map.addMarker(markerSavedLocations);\r\n }\r\n }\r\n }", "long getCoordinates();", "long getCoordinates();", "List<GridCoordinate> getCoordinates(int cellWidth, int cellHeight);", "private void setPoints () {\n\t\tArrayList<Point> emptySpot = new ArrayList<Point>();\n\t\tfor (int i = 0; i < width; i++) {\n\t\t\tfor (int j = 0; j < height; j++) {\n\t\t\tif (maze[i][j] == 0) {\n\t\t\t\temptySpot.add(new Point (i, j));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tCollections.shuffle(emptySpot);\n\t\tthis.goal = emptySpot.get(0);\n\t\tdouble goalRange = this.goal.getX() + this.goal.getY();\n\t\tfor (int i = 1; i < emptySpot.size(); i++) {\n\t\t\tPoint playerStart = emptySpot.get(i);\n\t\t\tdouble playerRange = playerStart.getX() + playerStart.getY();\n\t\t\tif (Math.abs(playerRange - goalRange) > width/2)\n\t\t\tthis.playerStart = playerStart;\n\t\t}\n\t}", "public void setPoints(int points) {\n this.points = points;\n }", "private static void documentxyAndAddToListe(HashSet<Point> activatedScreen, List<List<Integer>> blockxyIDList,\n\t\t\tString k) {\n\t\tList<Integer> xyID = new ArrayList<>();\n\t\tScanner kScan = new Scanner(k);\n\n\t\tkScan.next(); //get past letter\n\t\tint xcoord = kScan.nextInt()/16;\n\t\txyID.add(xcoord);\n\t\tint ycoord = kScan.nextInt()/16;\n\t\txyID.add(ycoord);\n\t\t//System.out.println(k);\n\t\tif(!visited.contains(new Point(xcoord, ycoord))) {\n\t\t\tvisited.add(new Point(xcoord, ycoord));\n\t\n\t\t\tint e = kScan.nextInt();\n\t\t\t\n\t\t\tif(e==29||e==4||e==3||e==50||e==52||e==51||e==68) { //cannon/shooter\n\t\t\t\txyID.add(6);\n\t\t\t}else if (e==5||e==56) { //appearing/disappearing\n\t\t\t\txyID.add(1);\n\t\t\t}else if (e==45||e==27) { //breakable\n\t\t\t\txyID.add(4);\t\t\t\t\n\t\t\t}else if (e==31||e==40||e==36||e==67||e==10||e==47||e==11||e==17) { //moving plat\n\t\t\t\txyID.add(5);\n\t\t\t}else if ((e>=177&&e<=194)||(e>=621&&e<=626)||e==16) {\n\t\t\t\t//System.out.println(k);\n\t\t\t\txyID.add(10); //water //177-194 or 621-626\n\t\t\t}else if (e==9||e==33||e==34) {\n\t\t\t\txyID.add(0);\n\t\t\t}\n\t\t\t\t\n\t\t\telse {\n\t\t\t\txyID.add(0);\n\t\t\t}\n\t\t\tint howManySquaresX = xcoord/16;\n\t\t\tint howManySquaresY = ycoord/14;\n\t\t\tint screenX = howManySquaresX*16;\n\t\t\tint screenY = howManySquaresY*14;\n\t\t\tactivatedScreen.add(new Point(screenX, screenY));\n\t\t\tif(xcoord>maxX) {\n\t\t\t\tmaxX = xcoord+1;\n\t\t\t}\n\t\t\tif(ycoord>maxY) {\n\t\t\t\tmaxY = ycoord+1;\n\t\t\t}\n\t\t\t//System.out.println(k);\n\t\t\t//System.out.println(l);\n\t\t\tkScan.close();\n\t\t\tblockxyIDList.add(xyID);\n\t\t\n\t\t}\t\t\n\t}", "public List<SpawnPoint> getSpawnPoints(){\n return spawnPoints;\n }", "public AnimSVGPointList() {\n\t\t\titemList = new ArrayList<>(1);\n\t\t}", "private static void ajouterRoutes(List<Point> points) {\n long time = System.currentTimeMillis();\n Set<Point> ensPoints = new HashSet<>(points);\n for(Point p : points) {\n p.ajouterRoutes(ensPoints);\n // Supposons que l'on essaye d'ajouter plusieurs fois les memes destinations ...\n p.ajouterRoutes(ensPoints);\n p.ajouterRoutes(ensPoints);\n }\n long deltaTime = System.currentTimeMillis() - time;\n System.out.println(\"Les routes sont ajoutées en \"+deltaTime+\" ms\");\n }", "public void darCoordenadasIniciales() \r\n\t{\t\r\n\t\tint coordenadasX = 0;\r\n\t\tint coordenadasY = 1;\r\n\t\tint orientacion = 2;\r\n\t\t\r\n\t\tfor (int x = 0; x<palabras.size();x++) \r\n\t\t{\r\n\t\t\tpalabras.get(x).get(0).setX(Integer.parseInt(manejadorArchivos.getPalabras().get(coordenadasX)));\r\n\t\t\tpalabras.get(x).get(0).setY(Integer.parseInt(manejadorArchivos.getPalabras().get(coordenadasY)));\r\n\t\t\tpalabras.get(x).get(0).setOrientacion(manejadorArchivos.getPalabras().get(orientacion));\r\n\t\t\t\r\n\t\t\t coordenadasX = coordenadasX +4;\r\n\t\t\t coordenadasY = coordenadasY + 4;\r\n\t\t\t orientacion = orientacion + 4;\r\n\t\t}\r\n\t}", "@Test\n\tpublic void addPointsByListTest(){\n\t}", "public void iterate() {\n\n\t\tArrayList<int[]> pts = new ArrayList<int[]>();\n\t\tfor (int i = 0; i < POINTS_PER_ITER; i++) {\n\t\t\tint x = Window.mathRandom.nextInt(width);\n\t\t\tint y = Window.mathRandom.nextInt(width);\n\t\t\tpts.add(new int[] { x, y });\n\t\t}\n\n\t\tint[] bestPoint = new int[] {};\n\t\tdouble maxDist = 0;\n\t\tfor (int[] point : pts) {\n\t\t\tdouble dist = getDistFromOthers(point);\n\t\t\tif (dist > maxDist) {\n\t\t\t\tmaxDist = dist;\n\t\t\t\tbestPoint = point;\n\t\t\t}\n\t\t}\n\t\tif (check(bestPoint)) {\n\t\t\tpoints.add(bestPoint);\n\t\t} else {\n\t\t\tremainingPoints += 1;\n\t\t}\n\t}", "public LineStrip2D(List<Point2D> points) {\n this.points = new ArrayList<Point2D>(points);\n }", "private void initializeShippingPoints() {\n shipping_points = new ShippingPoint[num_shipping_points];\n \n int x_size = 8;\n int y_size = 8;\n int[][] grid = new int[x_size][y_size]; //keeps track of which locations are taken\n //so no two ShippingPoints have the same location\n \n int x = 0;\n int y = 0;\n \n for(int i = 0; i < num_shipping_points; i++)\n {\n x = (int)(Math.random() * x_size);\n y = (int)(Math.random() * y_size);\n while(grid[x][y] != 0) {\n x = (int)(Math.random() * x_size);\n y = (int)(Math.random() * y_size);\n }\n grid[x][y] = 1;\n if(i % 4 == 0) { //be careful -- probably won't work in the general case\n Supplier supplier = new Supplier(x, y, i);\n shipping_points[i] = supplier;\n }\n else {\n Customer customer = new Customer(x, y, i);\n shipping_points[i] = customer;\n }\n }\n \n if(eight_shipping_points) {\n //for 8 shipping points\n shipping_points[0].setPosition(4, 0);\n shipping_points[1].setPosition(8, 0);\n shipping_points[2].setPosition(8, 4);\n shipping_points[3].setPosition(8, 8);\n shipping_points[4].setPosition(4, 8);\n shipping_points[5].setPosition(0, 8);\n shipping_points[6].setPosition(0, 4);\n shipping_points[7].setPosition(0, 0);\n }\n \n else {\n //for 20 shipping points\n /**/shipping_points[0].setPosition(4,0);\n shipping_points[1].setPosition(8, 0);\n shipping_points[2].setPosition(12, 0);\n shipping_points[3].setPosition(16, 0);\n shipping_points[4].setPosition(20, 0);\n shipping_points[5].setPosition(20, 4);\n shipping_points[6].setPosition(20, 8);\n shipping_points[7].setPosition(20, 12);\n shipping_points[8].setPosition(20, 16);\n shipping_points[9].setPosition(20, 20);\n shipping_points[10].setPosition(16, 20);\n shipping_points[11].setPosition(12, 20);\n shipping_points[12].setPosition(8, 20);\n shipping_points[13].setPosition(4, 20);\n shipping_points[14].setPosition(0, 20);\n shipping_points[15].setPosition(0, 16);\n shipping_points[16].setPosition(0, 12);\n shipping_points[17].setPosition(0, 8);\n shipping_points[18].setPosition(0, 4);\n shipping_points[19].setPosition(0, 0);/**/\n }\n \n displayShippingPoints();\n }", "public VisuCoordinateTranslator() {\r\n limitedDirections = new HashMap<String, Integer>();\r\n limitedCoordinates = new HashMap<String, Shape>();\r\n limitedGroundCoordinates = new HashMap<String, Float[]>();\r\n Float c[] = {22f, 2f, 8.5f, -1.7f, 0f};\r\n limitedDirections.put(\"Status_GWP01\", 0);\r\n ArrayList a = new ArrayList<Float>();\r\n a.addAll(Arrays.asList(c));\r\n StraightShape ss = new StraightShape(a);\r\n limitedCoordinates.put(\"0.1.0\", ss);\r\n\r\n\r\n c = new Float[]{-0.97f, 0.88f, 0f, -0.1f, 1f};\r\n limitedDirections.put(\"Status_ETKa1\", 1);\r\n a = new ArrayList<Float>();\r\n a.addAll(Arrays.asList(c));\r\n ss = new StraightShape(a);\r\n limitedCoordinates.put(\"1.1.0\", ss);\r\n\r\n limitedDirections.put(\"Status_ETKa2\", 1);\r\n\r\n c = new Float[]{0.07f, -0.74f, 0f, 0f, 1f};\r\n limitedDirections.put(\"LAM_ETKa1\", 2);\r\n a = new ArrayList<Float>();\r\n a.addAll(Arrays.asList(c));\r\n ss = new StraightShape(a);\r\n limitedCoordinates.put(\"2.1.0\", ss);\r\n\r\n c = new Float[]{0.07f, -0.74f, 0f, 0f, 1f};\r\n limitedDirections.put(\"LAM_ETKa2\", 2);\r\n a = new ArrayList<Float>();\r\n a.addAll(Arrays.asList(c));\r\n ss = new StraightShape(a);\r\n\r\n\r\n limitedCoordinates.put(\"2.1.0\", ss);\r\n\r\n ArrayList<ArrayList<Float>> arrayOval = new ArrayList<ArrayList<Float>>();\r\n c = new Float[]{6.3f, -2f, 7.3f, -14.38f, 0f};//straight_1\r\n a = new ArrayList<Float>();\r\n a.addAll(Arrays.asList(c));\r\n arrayOval.add(a);\r\n\r\n c = new Float[]{-2f, -4.8f, 7.3f, -14.38f, 0f};//straight_2\r\n a = new ArrayList<Float>();\r\n a.addAll(Arrays.asList(c));\r\n arrayOval.add(a);\r\n\r\n c = new Float[]{3.072f, 0.0695f, 2.826f, -5.424f, -17.2f, 7.3f, 1f};//circular_3\r\n a = new ArrayList<Float>();\r\n a.addAll(Arrays.asList(c));\r\n arrayOval.add(a);\r\n\r\n c = new Float[]{-4.8f, -2f, 7.3f, -19.715f, 0f};//straight_4\r\n a = new ArrayList<Float>();\r\n a.addAll(Arrays.asList(c));\r\n arrayOval.add(a);\r\n\r\n c = new Float[]{-2f, 6.3f, 7.3f, -19.715f, 0f};//straight_5\r\n a = new ArrayList<Float>();\r\n a.addAll(Arrays.asList(c));\r\n arrayOval.add(a);\r\n\r\n c = new Float[]{3.038f, 0.1032f, 2.833f, 6.567f, -17.2f, 7.3f, 1f};//circular_6\r\n a = new ArrayList<Float>();\r\n a.addAll(Arrays.asList(c));\r\n arrayOval.add(a);\r\n\r\n c = new Float[]{3.1302f, 0.0114f, 2.8202f, -2.0298f, -17.2f, 7.3f, 1f};//circular_7\r\n a = new ArrayList<Float>();\r\n a.addAll(Arrays.asList(c));\r\n arrayOval.add(a);\r\n \r\n c = new Float[]{0.41f, 0.48f, 0.6f, 0.67f, 0.78f, 0.92f};//partitions\r\n a = new ArrayList<Float>();\r\n a.addAll(Arrays.asList(c));\r\n arrayOval.add(a);\r\n\r\n\r\n OvalShape os = new OvalShape(arrayOval);\r\n\r\n for (int i = 2; i < 11; i++) {\r\n for (int j = 0; j < 3; j++) {\r\n limitedCoordinates.put(\"1.\" + i + \".\" + j, os);\r\n limitedCoordinates.put(\"2.\" + i + \".\" + j, ss);\r\n }\r\n }\r\n\r\n \r\n \r\n c = new Float[]{2.0785f, -1.8972f};\r\n limitedGroundCoordinates.put(\"0.1.0\", c);\r\n c = new Float[]{-6.3859f,-0.4682f};\r\n limitedGroundCoordinates.put(\"1.1.0\", c);\r\n }", "protected abstract void getAllUniformLocations();", "public Point2D[] getGivenPoints(){ \n return this.points; \n }" ]
[ "0.70022607", "0.69950384", "0.6504586", "0.64958274", "0.64830446", "0.6469819", "0.6384429", "0.6367746", "0.63373554", "0.6225452", "0.6142129", "0.6108222", "0.60028994", "0.600129", "0.5973662", "0.59525365", "0.59383833", "0.592476", "0.5909428", "0.5896805", "0.5872921", "0.58592874", "0.58528084", "0.58241796", "0.5821054", "0.582017", "0.58039224", "0.58024246", "0.5795791", "0.5795025", "0.5789884", "0.577665", "0.57701737", "0.57489645", "0.57335323", "0.5733118", "0.5717754", "0.5709012", "0.5707009", "0.5703925", "0.5701851", "0.56940657", "0.56891483", "0.5686027", "0.56520766", "0.56476563", "0.56454515", "0.5644299", "0.5622126", "0.56112736", "0.560427", "0.5591189", "0.5583188", "0.5576553", "0.5572216", "0.5566938", "0.55660534", "0.5564678", "0.55586237", "0.5555159", "0.55525255", "0.5538477", "0.55367726", "0.55286956", "0.55015206", "0.5495979", "0.5494139", "0.5493178", "0.54909074", "0.5488608", "0.5487611", "0.5486016", "0.54814935", "0.54794455", "0.5471982", "0.54617155", "0.5459907", "0.5457649", "0.5433592", "0.54318005", "0.5428221", "0.5426903", "0.54258436", "0.5424102", "0.5424102", "0.5420914", "0.54131866", "0.54106236", "0.54076123", "0.54028094", "0.53975576", "0.5391653", "0.5390392", "0.5389695", "0.53894097", "0.5388887", "0.53847116", "0.5382778", "0.5371817", "0.5367892" ]
0.7162975
0
Handles the HTTP GET method.
@Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { metGet(request, response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void doGet( )\n {\n \n }", "@Override\n\tprotected void executeGet(GetRequest request, OperationResponse response) {\n\t}", "@Override\n\tprotected Method getMethod() {\n\t\treturn Method.GET;\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\t\n\t}", "@Override\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t}", "@Override\r\n\tprotected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoGet(req, resp);\r\n\t}", "void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException;", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException {\r\n\tlogTrace( req, \"GET log\" );\r\n\tString requestId = req.getQueryString();\r\n\tif (requestId == null) return;\r\n\tif (\"get-response\".equals( requestId )) {\r\n\t try {\r\n\t\tonMEVPollsForResponse( req, resp );\r\n\t } catch (Exception e) {\r\n\t\tlogError( req, resp, e, \"MEV polling error\" );\r\n\t\tsendError( resp, \"MEV polling error: \" + e.toString() );\r\n\t }\r\n\t}\r\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n \r\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t\t\n\t}", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n }", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\r\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\r\n\t}", "public void doGet() throws IOException {\n\n // search ressource\n byte[] contentByte = null;\n try {\n contentByte = ToolBox.readFileByte(RESOURCE_DIRECTORY, this.url);\n this.statusCode = OK;\n ContentType contentType = new ContentType(this.extension);\n sendHeader(statusCode, contentType.getContentType(), contentByte.length);\n } catch (IOException e) {\n System.out.println(\"Ressource non trouvé\");\n statusCode = NOT_FOUND;\n contentByte = ToolBox.readFileByte(RESPONSE_PAGE_DIRECTORY, \"pageNotFound.html\");\n sendHeader(statusCode, \"text/html\", contentByte.length);\n }\n\n this.sendBodyByte(contentByte);\n }", "public HttpResponseWrapper invokeGET(String path) {\n\t\treturn invokeHttpMethod(HttpMethodType.HTTP_GET, path, \"\");\n\t}", "@Override\n\tpublic void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }", "@Override\n\tprotected void doGet(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t}", "public Result get(Get get) throws IOException;", "@Override\n public void doGet(HttpServletRequest request, HttpServletResponse response) {\n System.out.println(\"[Servlet] GET request \" + request.getRequestURI());\n\n response.setContentType(FrontEndServiceDriver.APP_TYPE);\n response.setStatus(HttpURLConnection.HTTP_BAD_REQUEST);\n\n try {\n String url = FrontEndServiceDriver.primaryEventService +\n request.getRequestURI().replaceFirst(\"/events\", \"\");\n HttpURLConnection connection = doGetRequest(url);\n\n if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {\n PrintWriter pw = response.getWriter();\n JsonObject responseBody = (JsonObject) parseResponse(connection);\n\n response.setStatus(HttpURLConnection.HTTP_OK);\n pw.println(responseBody.toString());\n }\n }\n catch (Exception ignored) {}\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tSystem.out.println(\"get\");\n\t\tthis.doPost(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}", "public void doGet(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \tSystem.out.println(\"---here--get--\");\n processRequest(request, response);\n }", "@Override\n public final void doGet() {\n try {\n checkPermissions(getRequest());\n // GET one\n if (id != null) {\n output(api.runGet(id, getParameterAsList(PARAMETER_DEPLOY), getParameterAsList(PARAMETER_COUNTER)));\n } else if (countParameters() == 0) {\n throw new APIMissingIdException(getRequestURL());\n }\n // Search\n else {\n\n final ItemSearchResult<?> result = api.runSearch(Integer.parseInt(getParameter(PARAMETER_PAGE, \"0\")),\n Integer.parseInt(getParameter(PARAMETER_LIMIT, \"10\")), getParameter(PARAMETER_SEARCH),\n getParameter(PARAMETER_ORDER), parseFilters(getParameterAsList(PARAMETER_FILTER)),\n getParameterAsList(PARAMETER_DEPLOY), getParameterAsList(PARAMETER_COUNTER));\n\n head(\"Content-Range\", result.getPage() + \"-\" + result.getLength() + \"/\" + result.getTotal());\n\n output(result.getResults());\n }\n } catch (final APIException e) {\n e.setApi(apiName);\n e.setResource(resourceName);\n throw e;\n }\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n }", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tthis.service(req, resp);\r\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\n\t}", "@RequestMapping(value = \"/{id}\", method = RequestMethod.GET)\n public void get(@PathVariable(\"id\") String id, HttpServletRequest req){\n throw new NotImplementedException(\"To be implemented\");\n }", "@Override\npublic void get(String url) {\n\t\n}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\r\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tString action = req.getParameter(\"action\");\r\n\t\t\r\n\t\tif(action == null) {\r\n\t\t\taction = \"List\";\r\n\t\t}\r\n\t\t\r\n\t\tswitch(action) {\r\n\t\t\tcase \"List\":\r\n\t\t\t\tlistUser(req, resp);\r\n\t\t\t\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tlistUser(req, resp);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest request, \n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t\tSystem.out.println(\"Routed to doGet\");\n\t}", "@NonNull\n public String getAction() {\n return \"GET\";\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\n\t\tprocess(req,resp);\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "@Override\r\nprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t process(req,resp);\r\n\t }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tprocess(req, resp);\n\t}", "@Override\n\tpublic HttpResponse get(final String endpoint) {\n\t\treturn httpRequest(HTTP_GET, endpoint, null);\n\t}", "public void doGet(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\r\n\t}", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n System.out.println(\"teste doget\");\r\n }", "public void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/plain\");\n // Actual logic goes here.\n PrintWriter out = response.getWriter();\n out.println(\"Wolken,5534-0848-5100,0299-6830-9164\");\n\ttry \n\t{\n Get g = new Get(Bytes.toBytes(request.getParameter(\"userid\")));\n Result r = table.get(g);\n byte [] value = r.getValue(Bytes.toBytes(\"v\"),\n Bytes.toBytes(\"\"));\n\t\tString valueStr = Bytes.toString(value);\n\t\tout.println(valueStr);\n\t}\n\tcatch (Exception e)\n\t{\n\t\tout.println(e);\n\t}\n }", "@Override\r\n public void doGet(String path, HttpServletRequest request, HttpServletResponse response)\r\n throws Exception {\r\n // throw new UnsupportedOperationException();\r\n System.out.println(\"Inside the get\");\r\n response.setContentType(\"text/xml\");\r\n response.setCharacterEncoding(\"utf-8\");\r\n final Writer w = response.getWriter();\r\n w.write(\"inside the get\");\r\n w.close();\r\n }", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\r\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n System.out.println(\"Console: doGET visited\");\n String result = \"\";\n //get the user choice from the client\n String choice = (request.getPathInfo()).substring(1);\n response.setContentType(\"text/plain;charset=UTF-8\");\n PrintWriter out = response.getWriter();\n //methods call appropriate to user calls\n if (Integer.valueOf(choice) == 3) {\n result = theBlockChain.toString();\n if (result != null) {\n out.println(result);\n response.setStatus(200);\n //set status if result output is not generated\n } else {\n response.setStatus(401);\n return;\n }\n }\n //verify chain method\n if (Integer.valueOf(choice) == 2) {\n response.setStatus(200);\n boolean validity = theBlockChain.isChainValid();\n out.print(\"verifying:\\nchain verification: \");\n out.println(validity);\n }\n }", "@Override\n public DataObjectResponse<T> handleGET(DataObjectRequest<T> request)\n {\n if(getRequestValidator() != null) getRequestValidator().validateGET(request);\n\n DefaultDataObjectResponse<T> response = new DefaultDataObjectResponse<>();\n try\n {\n VisibilityFilter<T, DataObjectRequest<T>> visibilityFilter = visibilityFilterMap.get(VisibilityMethod.GET);\n List<Query> queryList = new LinkedList<>();\n if(request.getQueries() != null)\n queryList.addAll(request.getQueries());\n\n if(request.getId() != null)\n {\n // if the id is specified\n queryList.add(new ById(request.getId()));\n }\n\n DataObjectFeed<T> feed = objectPersister.retrieve(queryList);\n if(feed == null)\n feed = new DataObjectFeed<>();\n List<T> filteredObjects = visibilityFilter.filterByVisible(request, feed.getAll());\n response.setCount(feed.getCount());\n response.addAll(filteredObjects);\n }\n catch(PersistenceException e)\n {\n ObjectNotFoundException objectNotFoundException = new ObjectNotFoundException(String.format(OBJECT_NOT_FOUND_EXCEPTION, request.getId()), e);\n response.setErrorResponse(ErrorResponseFactory.objectNotFound(objectNotFoundException, request.getCID()));\n }\n return response;\n }", "public void handleGet( HttpExchange exchange ) throws IOException {\n switch( exchange.getRequestURI().toString().replace(\"%20\", \" \") ) {\n case \"/\":\n print(\"sending /MainPage.html\");\n sendResponse( exchange, FU.readFromFile( getReqDir( exchange )), 200);\n break;\n case \"/lif\":\n // send log in page ( main page )\n sendResponse ( exchange, FU.readFromFile(getReqDir(exchange)), 200);\n //\n break;\n case \"/home.html\":\n\n break;\n case \"/book.html\":\n\n break;\n default:\n //checks if user is logged in\n\n //if not send log in page\n //if user is logged in then\n print(\"Sending\");\n String directory = getReqDir( exchange ); // dont need to do the / replace as no space\n File page = new File( getReqDir( exchange) );\n\n // IMPLEMENT DIFFERENT RESPONSE CODE FOR HERE IF EXISTS IS FALSE OR CAN READ IS FALSE\n sendResponse(exchange, FU.readFromFile(directory), 200);\n break;\n }\n }", "public int handleGET(String requestURL) throws ClientProtocolException, IOException{\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\thttpGet = new HttpGet(requestURL);\t\t\r\n\t\t\t\t\t\t\r\n\t\tinputsource=null;\r\n\t\t\t\r\n\t\toutputString=\"\";\r\n\t\t\r\n\t\t//taking response by executing http GET object\r\n\t\tCloseableHttpResponse response = httpclient.execute(httpGet);\t\t\r\n\t\r\n\t\t/* \r\n\t\t * \tThe underlying HTTP connection is still held by the response object\r\n\t\t\tto allow the response content to be streamed directly from the network socket.\r\n\t\t\tIn order to ensure correct deallocation of system resources\r\n\t\t\tthe user MUST call CloseableHttpResponse.close() from a finally clause.\r\n\t\t\tPlease note that if response content is not fully consumed the underlying\r\n\t\t\tconnection cannot be safely re-used and will be shut down and discarded\r\n\t\t\tby the connection manager.\r\n\t\t */\r\n\t\t\r\n\t\t\tstatusLine= response.getStatusLine().toString();\t\t//status line\r\n\t\t\t\r\n\t\t\tHttpEntity entity1 = response.getEntity();\t\t\t\t//getting response entity from server response \t\r\n\t\t\t\t\t\r\n\t\t\tBufferedReader br=new BufferedReader(new InputStreamReader(entity1.getContent()));\r\n\r\n\t\t\tString line;\r\n\t\t\twhile((line=br.readLine())!=null)\r\n\t\t\t{\r\n\t\t\t\toutputString=outputString+line.toString();\r\n\t }\r\n\t\t\t\r\n\t\t\t//removing spaces around server response string.\r\n\t\t\toutputString.trim();\t\t\t\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\t//converting server response string into InputSource.\r\n\t\t\tinputsource = new InputSource(new StringReader(outputString));\t\r\n\t\t\t\r\n\t\t\t// and ensure it is fully consumed\r\n\t\t\tEntityUtils.consume(entity1);\t\t\t//consuming entity.\r\n\t\t\tresponse.close();\t\t\t\t\t\t//closing response.\r\n\t\t\tbr.close();\t\t\t\t\t\t\t\t//closing buffered reader\r\n\t\t\t\r\n\t\t\t//returning response code\r\n\t\t\treturn response.getStatusLine().getStatusCode();\r\n\t\r\n\t}", "@Override\n\tprotected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\t logger.error(\"BISHUNNN CALLED\");\n\t\tString category = request.getParameter(\"category\").trim();\n\t\tGetHttpCall getHttpCall = new GetHttpCall();\n\t\turl = APIConstants.baseURL+category.toLowerCase();\n\t\tresponseString = getHttpCall.execute(url);\n\t\tresponse.getWriter().write(responseString);\n\t}", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n //processRequest(request, response);\r\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tPrintWriter out = resp.getWriter();\n\t\tout.print(\"<h1>Hello from your doGet method!</h1>\");\n\t}", "public void doGet(HttpServletRequest request,\n HttpServletResponse response)\n throws IOException, ServletException {\n response.setContentType(TYPE_TEXT_HTML.label);\n response.setCharacterEncoding(UTF8.label);\n request.setCharacterEncoding(UTF8.label);\n String path = request.getRequestURI();\n logger.debug(RECEIVED_REQUEST + path);\n Command command = null;\n try {\n command = commands.get(path);\n command.execute(request, response);\n } catch (NullPointerException e) {\n logger.error(REQUEST_PATH_NOT_FOUND);\n request.setAttribute(JAVAX_SERVLET_ERROR_STATUS_CODE, 404);\n command = commands.get(EXCEPTION.label);\n command.execute(request, response);\n }\n }", "public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tString search = req.getParameter(\"searchBook\");\n\t\tString output=search;\n\n\t\t//redirect output to view search.jsp\n\t\treq.setAttribute(\"output\", output);\n\t\tresp.setContentType(\"text/json\");\n\t\tRequestDispatcher view = req.getRequestDispatcher(\"search.jsp\");\n\t\tview.forward(req, resp);\n\t\t\t\n\t}", "public void doGet( HttpServletRequest request, HttpServletResponse response )\n throws ServletException, IOException\n {\n handleRequest( request, response, false );\n }", "public void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\t}", "public void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\t}", "@GET\n @Produces(MediaType.APPLICATION_JSON)\n public Response handleGet() {\n Gson gson = GSONFactory.getInstance();\n List allEmployees = getAllEmployees();\n\n if (allEmployees == null) {\n allEmployees = new ArrayList();\n }\n\n Response response = Response.ok().entity(gson.toJson(allEmployees)).build();\n return response;\n }", "@Override\n\tprotected void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows IOException, ServletException {\n\t\tsuper.doGet(request, response);\t\t\t\n\t}", "private static String sendGET(String getURL) throws IOException {\n\t\tURL obj = new URL(getURL);\n\t\tHttpURLConnection con = (HttpURLConnection) obj.openConnection();\n\t\tcon.setRequestMethod(\"GET\");\n\t\tString finalResponse = \"\";\n\n\t\t//This way we know if the request was processed successfully or there was any HTTP error message thrown.\n\t\tint responseCode = con.getResponseCode();\n\t\tSystem.out.println(\"GET Response Code : \" + responseCode);\n\t\tif (responseCode == HttpURLConnection.HTTP_OK) { // success\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));\n\t\t\tString inputLine;\n\t\t\tStringBuffer buffer = new StringBuffer();\n\n\t\t\twhile ((inputLine = in.readLine()) != null) {\n\t\t\t\tbuffer.append(inputLine);\n\t\t\t}\n\t\t\tin.close();\n\n\t\t\t// print result\n\t\t\tfinalResponse = buffer.toString();\n\t\t} else {\n\t\t\tSystem.out.println(\"GET request not worked\");\n\t\t}\n\t\treturn finalResponse;\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n //processRequest(request, response);\n }", "@Override\n \tpublic void doGet(HttpServletRequest req, HttpServletResponse resp)\n \t\t\tthrows ServletException, IOException {\n \t\tdoPost(req, resp);\n \t}", "public BufferedReader reqGet(final String route) throws\n ServerStatusException, IOException {\n System.out.println(\"first reqGet\");\n return reqGet(route, USER_AGENT);\n }", "HttpGet getRequest(HttpServletRequest request, String address) throws IOException;", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override \r\nprotected void doGet(HttpServletRequest request, HttpServletResponse response) \r\nthrows ServletException, IOException { \r\nprocessRequest(request, response); \r\n}", "protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\n String action = request.getParameter(\"action\");\r\n\r\n try {\r\n switch (action)\r\n {\r\n case \"/getUser\":\r\n \tgetUser(request, response);\r\n break;\r\n \r\n }\r\n } catch (Exception ex) {\r\n throw new ServletException(ex);\r\n }\r\n }", "@Override\n protected void doGet\n (HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\n\t}", "@Test\r\n\tpublic void doGet() throws Exception {\n\t\tCloseableHttpClient httpClient = HttpClients.createDefault();\r\n\t\t// Create a GET object and pass a url to it\r\n\t\tHttpGet get = new HttpGet(\"http://www.google.com\");\r\n\t\t// make a request\r\n\t\tCloseableHttpResponse response = httpClient.execute(get);\r\n\t\t// get response as result\r\n\t\tSystem.out.println(response.getStatusLine().getStatusCode());\r\n\t\tHttpEntity entity = response.getEntity();\r\n\t\tSystem.out.println(EntityUtils.toString(entity));\r\n\t\t// close HttpClient\r\n\t\tresponse.close();\r\n\t\thttpClient.close();\r\n\t}", "private void requestGet(String endpoint, Map<String, String> params, RequestListener listener) throws Exception {\n String requestUri = Constant.API_BASE_URL + ((endpoint.indexOf(\"/\") == 0) ? endpoint : \"/\" + endpoint);\n get(requestUri, params, listener);\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tint i = request.getRequestURI().lastIndexOf(\"/\") + 1;\n\t\tString action = request.getRequestURI().substring(i);\n\t\tSystem.out.println(action);\n\t\t\n\t\tString view = \"Error\";\n\t\tObject model = \"service Non disponible\";\n\t\t\n\t\tif (action.equals(\"ProductsList\")) {\n\t\t\tview = productAction.productsList();\n\t\t\tmodel = productAction.getProducts();\n\t\t}\n\t\t\n\t\trequest.setAttribute(\"model\", model);\n\t\trequest.getRequestDispatcher(prefix + view + suffix).forward(request, response); \n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n\t throws ServletException, IOException {\n\tprocessRequest(request, response);\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tcommandAction(request,response);\r\n\t}" ]
[ "0.7589609", "0.71665615", "0.71148175", "0.705623", "0.7030174", "0.70291144", "0.6995984", "0.697576", "0.68883485", "0.6873811", "0.6853569", "0.6843572", "0.6843572", "0.6835363", "0.6835363", "0.6835363", "0.6817864", "0.6797789", "0.67810035", "0.6761234", "0.6754993", "0.6754993", "0.67394847", "0.6719924", "0.6716244", "0.67054695", "0.67054695", "0.67012346", "0.6684415", "0.6676695", "0.6675696", "0.6675696", "0.66747975", "0.66747975", "0.6669016", "0.66621476", "0.66621476", "0.66476154", "0.66365504", "0.6615004", "0.66130257", "0.6604073", "0.6570195", "0.6551141", "0.65378064", "0.6536579", "0.65357745", "0.64957607", "0.64672184", "0.6453189", "0.6450501", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.64067316", "0.6395873", "0.6379907", "0.63737476", "0.636021", "0.6356937", "0.63410467", "0.6309468", "0.630619", "0.630263", "0.63014317", "0.6283933", "0.62738425", "0.62680805", "0.62585783", "0.62553537", "0.6249043", "0.62457556", "0.6239428", "0.6239428", "0.62376446", "0.62359244", "0.6215947", "0.62125194", "0.6207376", "0.62067443", "0.6204527", "0.6200444", "0.6199078", "0.61876005", "0.6182614", "0.61762017", "0.61755335", "0.61716276", "0.6170575", "0.6170397", "0.616901" ]
0.68195957
16
Handles the HTTP POST method.
@Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { metPost(request, response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void doPost(Request request, Response response) {\n\n\t}", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) {\n }", "public void doPost( )\n {\n \n }", "@Override\n public String getMethod() {\n return \"POST\";\n }", "public String post();", "@Override\n\tpublic void doPost(HttpRequest request, AbstractHttpResponse response)\n\t\t\tthrows IOException {\n\t\t\n\t}", "@Override\n public String getMethod() {\n return \"POST\";\n }", "public ResponseTranslator post() {\n setMethod(\"POST\");\n return doRequest();\n }", "protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException {\n }", "public void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows IOException {\n\n\t}", "public void postData() {\n\n\t}", "@Override\n public void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException {\n logger.warn(\"doPost Called\");\n handle(req, res);\n }", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n }", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n }", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "@Override\n\tpublic void postHandle(WebRequest request, ModelMap model) throws Exception {\n\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n }", "public void doPost(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\r\n\r\n\t\t\r\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\t\n\t}", "@Override\n\tprotected HttpMethod requestMethod() {\n\t\treturn HttpMethod.POST;\n\t}", "@Override\n\tprotected void handlePostBody(HashMap<String, HashMap<String, String>> params, DataFormat format) throws Exception {\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n }", "@Override\n\tprotected void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }", "@Override\n\n\tpublic void handlePOST(CoapExchange exchange) {\n\t\tFIleStream read = new FIleStream();\n\t\tread.tempWrite(Temp_Path, exchange.getRequestText());\n\t\texchange.respond(ResponseCode.CREATED, \"POST successfully!\");\n\t\t_Logger.info(\"Receive post request:\" + exchange.getRequestText());\n\t}", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.getWriter().println(\"go to post method in manager\");\n }", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }", "public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\t\n\t}", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "public abstract boolean handlePost(FORM form, BindException errors) throws Exception;", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n super.doPost(req, resp);\n }", "public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\n\t\t\t\n\t\t \n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "public void processPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException\n {\n }", "@Override\n\tpublic void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n\t}", "@Override\n\tpublic void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n\t}", "public void doPost(HttpServletRequest request ,HttpServletResponse response){\n\n }", "public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\n\t}", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request,\r\n\t\t\tHttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "public void post(){\n\t\tHttpClient client = new HttpClient();\n\n\t\tPostMethod post = new PostMethod(\"http://211.138.245.85:8000/sso/POST\");\n//\t\tPostMethod post = new PostMethod(\"/eshopclient/product/show.do?id=111655\");\n//\t\tpost.addRequestHeader(\"Cookie\", cookieHead);\n\n\n\t\ttry {\n\t\t\tSystem.out.println(\"��������====\");\n\t\t\tint status = client.executeMethod(post);\n\t\t\tSystem.out.println(status);\n\t\t} catch (HttpException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n//\t\ttaskCount++;\n//\t\tcountDown--;\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException {\r\n\tlogTrace( req, \"POST log\" );\r\n\tString requestId = req.getQueryString();\r\n\tif (requestId == null) {\r\n\t try {\r\n\t\tServletUtil.bufferedRead( req.getInputStream() );\r\n\t } catch (IOException ex) {\r\n\t }\r\n\t logError( req, resp, new Exception(\"Unrecognized POST\"), \"\" );\r\n\t sendError(resp, \"Unrecognized POST\");\r\n\t} else\r\n\t if (\"post-request\".equals( requestId )) {\r\n\t\ttry {\r\n\t\t onMEVPostsRequest( req, resp );\r\n\t\t} catch (Exception e) {\r\n\t\t try {\r\n\t\t\tServletUtil.bufferedRead( req.getInputStream() );\r\n\t\t } catch (IOException ex) {\r\n\t\t }\r\n\t\t logError( req, resp, e, \"MEV POST error\" );\r\n\t\t sendError( resp, \"MEV POST error: \" + e.toString() );\r\n\t\t}\r\n\t } else if (\"post-response\".equals( requestId )) {\r\n\t\ttry {\r\n\t\t onPVMPostsResponse( req, resp );\r\n\t\t} catch (Exception e) {\r\n\t\t try {\r\n\t\t\tServletUtil.bufferedRead( req.getInputStream() );\r\n\t\t } catch (IOException ex) {\r\n\t\t }\r\n\t\t logError( req, resp, e, \"PVM POST error\" );\r\n\t\t sendError( resp, \"PVM POST error: \" + e.toString() );\r\n\t\t}\r\n\t }\r\n }", "@Override\n\tpublic void postHandle(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler,\n\t\t\tModelAndView modelAndView) throws Exception {\n\t\t\n\t}", "@Override\n\tpublic void postHandle(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler,\n\t\t\tModelAndView modelAndView) throws Exception {\n\t\t\n\t}", "@Override\n\tpublic void postHandle(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler,\n\t\t\tModelAndView modelAndView) throws Exception {\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest req, HttpServletResponse resp, Object handler, ModelAndView m)\r\n\t\t\tthrows Exception {\n\t\t\r\n\t}", "@Override\n public final void doPost() {\n try {\n checkPermissions(getRequest());\n final IItem jSonStreamAsItem = getJSonStreamAsItem();\n final IItem outputItem = api.runAdd(jSonStreamAsItem);\n\n output(JSonItemWriter.itemToJSON(outputItem));\n } catch (final APIException e) {\n e.setApi(apiName);\n e.setResource(resourceName);\n throw e;\n\n }\n }", "@Override\n\tvoid post() {\n\t\t\n\t}", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {\n\t\t\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\t\tSystem.out.println(\"=========interCpetor Post=========\");\r\n\t}", "public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\tString method = request.getParameter(\"method\");\n\t\tswitch(method){\n\t\tcase \"Crawl\":\n\t\t\tcrawl(request, response);\n\t\t\tbreak;\n\t\tcase \"Extract\":\n\t\t\textract(request, response);\n\t\t\tbreak;\n\t\tcase \"JDBC\":\n\t\t\tjdbc(request, response);\n\t\t\tbreak;\n\t\tcase \"Indexer\":\n\t\t\tindexer(request, response);\n\t\t\tbreak;\n\t\t}\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n System.out.println(\"teste dopost\");\r\n }", "protected void doPost(HttpServletRequest request,\r\n\t\t\tHttpServletResponse response)\r\n\t/* 43: */throws ServletException, IOException\r\n\t/* 44: */{\r\n\t\t/* 45:48 */doGet(request, response);\r\n\t\t/* 46: */}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tprocess(req, resp);\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\tprocess(req,resp);\r\n\t}", "public void handlePost(SessionSrvc session, IObjectContext context)\n throws Exception\n {\n }", "public void doPost(HttpServletRequest request, HttpServletResponse response) {\n\t\tdoGet(request, response);\n\t}", "public void doPost(HttpServletRequest request, HttpServletResponse response) {\n\t\tdoGet(request, response);\n\t}", "public void doPost(HttpServletRequest request, HttpServletResponse response) {\r\n\t\tdoGet(request, response);\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\t}", "@Override\n protected void doPost\n (HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n try {\r\n processRequest(request, response);\r\n } catch (JSONException ex) {\r\n Logger.getLogger(PDCBukUpload.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "@Override\r\n protected void doPost(HttpServletRequest request,\r\n HttpServletResponse response)\r\n throws ServletException,\r\n IOException {\r\n processRequest(request,\r\n response);\r\n\r\n }", "@Override\r\n\tpublic void doPost(CustomHttpRequest request, CustomHttpResponse response) throws Exception {\n\t\tdoGet(request, response);\r\n\t}", "@Override\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response,\n\t\t\tObject handler, ModelAndView modelAndView) throws Exception {\n\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tdoHandle(request, response);\n\t}", "private void postRequest() {\n\t\tSystem.out.println(\"post request, iam playing money\");\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }", "@Override\n public void postHandle(HttpServletRequest request,\n HttpServletResponse response, Object handler,\n ModelAndView modelAndView) throws Exception {\n\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (Exception ex) {\n Logger.getLogger(PedidoController.class.getName()).log(Level.SEVERE, null, ex);\n }\n }" ]
[ "0.7327792", "0.71364146", "0.71150917", "0.7103484", "0.7098967", "0.7022197", "0.7014374", "0.6963617", "0.6887727", "0.67830557", "0.6772561", "0.67459744", "0.65569043", "0.655617", "0.65236866", "0.6523533", "0.6523533", "0.6523533", "0.652217", "0.65187013", "0.65143514", "0.6510847", "0.651052", "0.64912283", "0.6479801", "0.6475664", "0.6470739", "0.6470278", "0.6468195", "0.645584", "0.6450473", "0.6450473", "0.6450473", "0.6447996", "0.6447996", "0.64368415", "0.64356387", "0.64334625", "0.6423143", "0.6421065", "0.64188904", "0.64188904", "0.64188904", "0.64063096", "0.6402555", "0.6402555", "0.639523", "0.6394996", "0.63531774", "0.6332038", "0.63235676", "0.6294927", "0.6287011", "0.6287011", "0.6287011", "0.6287011", "0.6287011", "0.6287011", "0.6287011", "0.6287011", "0.6287011", "0.6287011", "0.6287011", "0.62789494", "0.62713283", "0.62713283", "0.6270387", "0.6260497", "0.6253797", "0.62495375", "0.6225063", "0.6212975", "0.62123644", "0.62109727", "0.6206917", "0.62009853", "0.6176784", "0.6176784", "0.6176784", "0.6176784", "0.6176784", "0.6176784", "0.6176784", "0.61629224", "0.61590767", "0.6147172", "0.6145605", "0.6145605", "0.61443746", "0.6141046", "0.6135871", "0.61309165", "0.6129246", "0.6122686", "0.61175007", "0.61165035", "0.6105327", "0.6098414", "0.6097962", "0.609629" ]
0.6666483
12
Returns a short description of the servlet.
@Override public String getServletInfo() { return "Short description"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getServletInfo()\n {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\r\n return \"Short description\";\r\n }", "public String getServletInfo() {\r\n return \"Short description\";\r\n }", "public String getServletInfo() {\r\n return \"Short description\";\r\n }", "public String getServletInfo() {\r\n return \"Short description\";\r\n }", "public String getServletInfo() {\r\n return \"Short description\";\r\n }", "public String getServletInfo() {\r\n return \"Short description\";\r\n }", "@Override\r\n public String getServletInfo() {\r\n return \"Short description\";\r\n }", "@Override\r\n public String getServletInfo() {\r\n return \"Short description\";\r\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}", "@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}", "@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}", "@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}", "@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}", "@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}", "@Override\r\n public String getServletInfo()\r\n {\r\n return \"Short description\";\r\n }", "@Override\n public String getServletInfo()\n {\n return \"Short description\";\n }", "@Override\r\n\tpublic String getServletInfo() {\r\n\t\treturn \"Short description\";\r\n\t}", "@Override\r\n public String getServletInfo()\r\n {\r\n return \"Short description\";\r\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }" ]
[ "0.87634975", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8699131", "0.8699131", "0.8699131", "0.8699131", "0.8699131", "0.8699131", "0.8531295", "0.8531295", "0.85282224", "0.85282224", "0.85282224", "0.8527433", "0.8527433", "0.8527433", "0.8527433", "0.8527433", "0.8527433", "0.8516995", "0.8512296", "0.8511239", "0.8510324", "0.84964365" ]
0.0
-1
DAAP 3/julio/2015 Para reporte orden de compra.
public String toString2() { return calle.isEmpty() ? "" : (calle + " " + numeroExterior + " " + (numeroInterior.isEmpty() ? "" : " " + numeroInterior) + (referencia.isEmpty() ? "" : "" + referencia + " ") + (colonia.isEmpty() ? "" : colonia)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void crearReporte() {\n medirTiempoDeEnvio();\n SimpleDateFormat variableFecha = new SimpleDateFormat(\"dd-MM-yyyy\");\n Calendar cal = Calendar.getInstance();\n String dia = String.valueOf(cal.get(cal.DATE));\n String mes = String.valueOf(cal.get(cal.MONTH) + 1);\n String año = String.valueOf(cal.get(cal.YEAR));\n String fechainicio;\n String fechafin;\n Map parametro = new HashMap();\n cargando.setVisible(true);\n try {\n JasperViewer v;\n switch (listaTipoReporte.getSelectedIndex()) {\n case 0:\n if (rb_diario.isSelected() || this.reporte.getSelectedIndex() == 1) {\n if (this.reporte.getSelectedIndex() == 1) {\n fechafin = u.fechaCorrecta(variableFecha.format(this.fin.getDate()));\n fechainicio = u.fechaCorrecta(variableFecha.format(this.inicio.getDate()));\n parametro.put(\"fecha\",fechainicio+\" al \"+fechafin);\n } else {\n fechainicio = u.fechaCorrecta(variableFecha.format(this.dia.getDate()));\n fechafin = fechainicio;\n parametro.put(\"fecha\",\" dia \"+fechainicio);\n }\n \n String p = \"('\" + fechainicio + \"','\" + fechafin + \"')\";\n if (u.ejecutarSP(p, \"ordenes_procesadas_diarias\")) {\n v = u.runReporte(\"reporte_ordenes_procesadas_diario\", parametro);\n v.setTitle(\"Reporte de ordenes procesadas\");\n v.setVisible(true);\n } else {\n System.out.println(\"mal\");\n }\n } else {\n int mess = cb_mes.getSelectedIndex();\n mess = mess + 1;\n if (rb_mensual.isSelected()) {\n int dia2 = u.numero(mess);\n String fechanueva1 = año + \"-\" + mess + \"-\" + \"01\";\n String fechai1 = año + \"-\" + mess + \"-\" + \"15\";\n String fechai2 = año + \"-\" + mess + \"-\" + \"16\";\n String fechaf1 = año + \"-\" + mess + \"-\" + dia2;\n //----------------------------- ojo son 4 fechas finico-ffinal1 y fechafinal2 -a fechafinal2\n // String fechainicio = u.fechaCorrecta(variableFecha.format(jDateChooser1.getDate()));\n // String f = u.fechaCorrecta(variableFecha.format(jDateChooser2.getDate()));\n // String fechafin =fechainicio;\n String p = \"('\" + fechanueva1 + \"','\" + fechai1 + \"','\" + fechai2 + \"','\" + fechaf1 + \"')\";\n if (u.ejecutarSP(p, \"ordenes_procesadas_mensual\")) {\n v = u.runReporte(\"reporte_ordenes_procesadas_mensual\", parametro);\n v.setTitle(\"Reporte mensual de ordenes procesadas\");\n v.setVisible(true);\n } else {\n System.out.println(\"mal\");\n }\n } else {\n Reporte r = new Reporte();\n String nombreReporte = \"\";\n if (this.primera.isSelected()) {\n r.reporteQuincena(Integer.toString(mess), \"2014\", 1);\n parametro.put(\"periodo\", \"De la primera quincena del mes de \" + u.obtenerMes(mess));\n nombreReporte = \"procesadasQuincena\";\n } else {\n if (this.segunda.isSelected()) {\n r.reporteQuincena(Integer.toString(mess), \"2014\", 2);\n parametro.put(\"periodo\", \"De la segunda quincena del mes de \" + u.obtenerMes(mess));\n nombreReporte = \"procesadasQuincenaSegunda\";\n }\n }\n v = u.runReporte(nombreReporte, parametro);\n v.setTitle(\"Reporte quincenal de ordenes procesadas\");\n v.setVisible(true);\n u.ejecutarSQL(\"DROP TABLE IF EXISTS temporal1\");\n }\n }\n break;\n case 1:\n //RordeAuditada\n if (rb_mensual.isSelected()) {\n int mess = cb_mes.getSelectedIndex();\n mess = mess + 1;\n int dia2 = u.numero(mess);\n String fechanueva = año + \"-\" + mess + \"-\" + \"01\"; //calcular el anho\n String fechai = año + \"-\" + mess + \"-\" + \"15\";\n String fechaf = año + \"-\" + mess + \"-\" + dia2;\n String p1 = \"('\" + fechanueva + \"','\" + fechai + \"','\" + fechaf + \"')\";\n if (u.ejecutarSP(p1, \"Raudita_mensual\")) {\n parametro.put(\"fecha\", fechanueva);\n parametro.put(\"fecha_p\", fechai);\n parametro.put(\"fecha_s\", fechaf);\n parametro.put(\"año\", año);\n parametro.put(\"mes\", mes);\n v = u.runReporte(\"report7\", parametro);\n v.setTitle(\"Reporte mensual de ordenes auditadas\");\n v.setVisible(true);\n } else {\n System.out.println(\"mal\");\n }\n\n }\n if (rb_diario.isSelected() || this.reporte.getSelectedIndex() == 1) {\n if (this.reporte.getSelectedIndex() == 1) {\n fechafin = u.fechaCorrecta(variableFecha.format(this.fin.getDate()));\n fechainicio = u.fechaCorrecta(variableFecha.format(this.inicio.getDate()));\n } else {\n fechainicio = u.fechaCorrecta(variableFecha.format(this.dia.getDate()));\n fechafin = fechainicio;\n parametro.put(\"fecha1\", \"Del dia \" + fechainicio);\n }\n String p = \"('\" + fechainicio + \"','\" + fechafin + \"')\";\n if (u.ejecutarSP(p, \"reporteJoel\")) {\n v = u.runReporte(\"RordeAuditada\", parametro);\n v.setTitle(\"Reporte diario de ordenes auditadas\");\n v.setVisible(true);\n } else {\n System.out.println(\"mal\");\n }\n }\n if (rb_quincenal.isSelected()) {\n int mess = cb_mes.getSelectedIndex();\n mess = mess + 1;\n String ms = u.obtenerMes(mess);\n if (this.primera.isSelected()) {\n q = \"Primera\";\n String p = \"('\" + (año + \"-\" + mess + \"-\" + \"01\") + \"','\" + (año + \"-\" + mess + \"-\" + \"02\") + \"','\" + (año + \"-\" + mess + \"-\" + \"03\") + \"','\" + (año + \"-\" + mess + \"-\" + \"04\") + \"','\" + (año + \"-\" + mess + \"-\" + \"05\") + \"','\" + (año + \"-\" + mess + \"-\" + \"06\") + \"','\" + (año + \"-\" + mess + \"-\" + \"07\") + \"','\" + (año + \"-\" + mess + \"-\" + \"08\") + \"','\" + (año + \"-\" + mess + \"-\" + \"09\") + \"','\" + (año + \"-\" + mess + \"-\" + \"10\") + \"','\" + (año + \"-\" + mess + \"-\" + \"01\") + \"','\" + (año + \"-\" + mess + \"-\" + \"11\") + \"','\" + (año + \"-\" + mess + \"-\" + \"12\") + \"','\" + (año + \"-\" + mess + \"-\" + \"13\") + \"','\" + (año + \"-\" + mess + \"-\" + \"14\") + \"','\" + (año + \"-\" + mess + \"-\" + \"15\") + \"')\";\n if (u.ejecutarSP(p, \"Rauditada_quincenal\")) {\n parametro.put(\"d1\", ms);\n parametro.put(\"d2\", año);\n parametro.put(\"q\", q);\n v = u.runReporte(\"Raudita_quincenal\", parametro);\n v.setTitle(\"Reporte quincenal de ordenes auditadas\");\n v.setVisible(true);\n } else {\n System.out.println(\"mal\");\n }\n } else {\n if (this.segunda.isSelected()) {\n q = \"Segunda\";\n if (mess == 2) {\n String p = \"('\" + (año + \"-\" + mess + \"-\" + \"16\") + \"','\" + (año + \"-\" + mess + \"-\" + \"17\") + \"','\" + (año + \"-\" + mess + \"-\" + \"18\") + \"','\" + (año + \"-\" + mess + \"-\" + \"19\") + \"','\" + (año + \"-\" + mess + \"-\" + \"20\") + \"','\" + (año + \"-\" + mess + \"-\" + \"21\") + \"','\" + (año + \"-\" + mess + \"-\" + \"22\") + \"','\" + (año + \"-\" + mess + \"-\" + \"23\") + \"','\" + (año + \"-\" + mess + \"-\" + \"24\") + \"','\" + (año + \"-\" + mess + \"-\" + \"25\") + \"','\" + (año + \"-\" + mess + \"-\" + \"16\") + \"','\" + (año + \"-\" + mess + \"-\" + \"26\") + \"','\" + (año + \"-\" + mess + \"-\" + \"27\") + \"','\" + (año + \"-\" + mess + \"-\" + \"28\") + \"','\" + (año + \"-\" + mess + \"-\" + \"28\") + \"','\" + (año + \"-\" + mess + \"-\" + \"28\") + \"')\";\n if (u.ejecutarSP(p, \"Rauditada_quincenal\")) {\n\n parametro.put(\"d1\", ms);\n parametro.put(\"d2\", año);\n\n parametro.put(\"q\", q);\n v = u.runReporte(\"Raudita_quincenal\", parametro);\n v.setTitle(\"Reporte quincenal de ordenes auditadas\");\n v.setVisible(true);\n } else {\n System.out.println(\"mal\");\n }\n } else {\n String p = \"('\" + (año + \"-\" + mess + \"-\" + \"16\") + \"','\" + (año + \"-\" + mess + \"-\" + \"17\") + \"','\" + (año + \"-\" + mess + \"-\" + \"18\") + \"','\" + (año + \"-\" + mess + \"-\" + \"19\") + \"','\" + (año + \"-\" + mess + \"-\" + \"20\") + \"','\" + (año + \"-\" + mess + \"-\" + \"21\") + \"','\" + (año + \"-\" + mess + \"-\" + \"22\") + \"','\" + (año + \"-\" + mess + \"-\" + \"23\") + \"','\" + (año + \"-\" + mess + \"-\" + \"24\") + \"','\" + (año + \"-\" + mess + \"-\" + \"25\") + \"','\" + (año + \"-\" + mess + \"-\" + \"16\") + \"','\" + (año + \"-\" + mess + \"-\" + \"26\") + \"','\" + (año + \"-\" + mess + \"-\" + \"27\") + \"','\" + (año + \"-\" + mess + \"-\" + \"28\") + \"','\" + (año + \"-\" + mess + \"-\" + \"29\") + \"','\" + (año + \"-\" + mess + \"-\" + \"30\") + \"')\";\n if (u.ejecutarSP(p, \"Rauditada_quincenal\")) {\n parametro.put(\"d1\", ms);\n parametro.put(\"d2\", año);\n parametro.put(\"q\", q);\n v = u.runReporte(\"Raudita_quincenal\", parametro);\n v.setTitle(\"Reporte quincenal de ordenes auditadas\");\n v.setVisible(true);\n } else {\n System.out.println(\"mal\");\n }\n\n }\n }\n }\n }\n break;\n case 2:\n try {\n fechainicio = u.fechaCorrecta(variableFecha.format(this.inicio.getDate()));\n fechafin = u.fechaCorrecta(variableFecha.format(this.fin.getDate()));\n parametro.put(\"fechaInicio\", fechainicio);\n parametro.put(\"fechaFin\", fechafin);\n v = u.runReporte(\"reporte_errores_diarios\", parametro);\n v.setTitle(\"Reporte de Errores\");\n v.setVisible(true);\n } catch (Exception ex) {\n JOptionPane.showMessageDialog(null, \"No se pudo generar el reporte\", \"Reporte\", JOptionPane.ERROR_MESSAGE);\n ErroresSiapo.agregar(ex, \"codigo 39\");\n }\n break;\n case 3:\n \n if (this.reporte.getSelectedIndex() == 1) {\n fechafin = u.fechaCorrecta(variableFecha.format(this.fin.getDate()));\n fechainicio = u.fechaCorrecta(variableFecha.format(this.inicio.getDate()));\n parametro.put(\"PERIODO\", \"Del \" + u.fechaReves(fechainicio) + \" al \" + u.fechaReves(fechafin));\n } else {\n String m = Integer.toString(this.cb_mes.getSelectedIndex() + 1);\n fechafin = año + \"-\" + m + \"-\" + u.numero(this.cb_mes.getSelectedIndex() + 1);\n fechainicio = año + \"-\" + m + \"-01\";\n parametro.put(\"PERIODO\", \"Del mes de \" + u.obtenerMes(this.cb_mes.getSelectedIndex() + 1) + \" del año \" + año);\n }\n String p = \"('\" + fechainicio + \"','\" + fechafin + \"')\";\n if (u.ejecutarSP(p, \"ERRORES\")) {\n v = u.runReporte(\"analisisDeEficiencia\", parametro);\n v.setTitle(\"Reporte de Analisis de Eficiencia\");\n v.setVisible(true);\n } else {\n ErroresSiapo.agregar(null, \"codigo 39\");\n System.out.println(\"mal\");\n }\n break;\n case 4: \n try {\n fechainicio = u.fechaCorrecta(variableFecha.format(this.inicio.getDate()));\n fechafin = u.fechaCorrecta(variableFecha.format(this.fin.getDate()));\n parametro.put(\"fecha\", fechainicio);\n parametro.put(\"fechaFin\", fechafin);\n v = u.runReporte(\"reporteDiarioOrdenesRegreso\", parametro);\n v.setTitle(\"Reporte de Razones\");\n v.setVisible(true);\n } catch (Exception e) {\n ErroresSiapo.agregar(e, \"codigo 38\");\n JOptionPane.showMessageDialog(null, \"No se pudo generar el reporte\", \"Reporte\", JOptionPane.ERROR_MESSAGE);\n }\n break;\n }\n } catch (Exception e) {\n }\n\n }", "void exportarLog() {\n try {\n JasperPrint rU = null;\n HashMap map = new HashMap();\n\n String arquivoJasper = \"/Sistema/relatorios/relatorioAcessos.jasper\";\n try{\n rU = JasperFillManager.fillReport(arquivoJasper, map, parametrosNS.con);\n }catch(Exception e){ \n JOptionPane.showMessageDialog(null, \"visualizar relatorio \" + e);\n JOptionPane.showMessageDialog(null, e.getMessage());\n }\n JasperViewer.viewReport(rU, false); \n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"o erro foi ao gerar relatorio \" + e);\n }\n }", "public static JasperReportBuilder generateReport(ExportData metaData,HttpServletRequest request){\n session = request.getSession(false);\n report = report(); // Creer le rapport\n \n //Logo\n// logoImg = cmp.image(inImg).setStyle(DynamicReports.stl.style().setHorizontalAlignment(HorizontalAlignment.LEFT)); \n //logoImg.setDimension(80,80); \n \n //Definit le style des colonnes d'entàte\n report.setColumnTitleStyle(getHeaderStyle(metaData));\n \n \n \n LinkedHashMap <String,String> criteria = metaData.getCriteria(); \n //Ajout la date d'àdition au critere d'impression\n String valDateProperty = getDateTxt(metaData.getLang()) ;\n String keyDateProperty = \"\" ;\n if ( session.getAttribute(\"activedLocale\").equals(\"fr\") ) {\n keyDateProperty = \"Edité le \" ;\n }\n else {\n keyDateProperty = \"Printed on \" ;\n }\n criteria.put(keyDateProperty,valDateProperty);\n \n StyleBuilder titleStyle = stl.style(boldStyle).setFontSize(16).setForegroundColor(new Color(0, 0, 0)).setHorizontalAlignment(HorizontalAlignment.RIGHT).setRightIndent(20);\n ComponentBuilder<?, ?> logoComponent = cmp.horizontalList(\n //cmp.image(Templates.class.getResource(\"/logopalm.png\")).setFixedDimension(150, 50).setStyle(stl.style().setLeftIndent(20)),\n cmp.verticalList(\n cmp.text(metaData.getTitle()).setStyle(titleStyle)\n )\n ).newRow()\n .add(cmp.horizontalList().add(cmp.hListCell(createCriteriaComponent(criteria,metaData)).heightFixedOnTop()))\n .newRow(); \n \n report.noData(logoComponent, cmp.text(\"Aucun enregistrement trouvà\").setStyle(stl.style().setHorizontalAlignment(HorizontalAlignment.CENTER).setTopPadding(30)));\n\n \n \n lblStyle = stl.style(Templates.columnStyle).setForegroundColor(new Color(60, 91, 31)); // Couleur du text \n colStyle = stl.style(Templates.columnStyle).setHorizontalAlignment(HorizontalAlignment.CENTER);\n \n groupStyle = stl.style().setForegroundColor(new Color(60, 91, 31)) \n .setBold(Boolean.TRUE)\n .setPadding(5)\n .setFontSize(13)\n .setHorizontalAlignment(HorizontalAlignment.CENTER); \n \n\n \n if(metaData.getTitle().equals(ITitle.PARCEL)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PARCEL_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SECTOR)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SECTOR_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BLOCK)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BLOCK_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ATTACK_PHYTO)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TREATMENT)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TREATMENT_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVEST)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVEST_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SERVICING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.SERVICING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_PLANTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_PLANTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.FERTILIZATION)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.FERTILIZATION_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.CONTROL_PHYTO)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.CONTROL_PHYTO_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_FOLDING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.EVENT_FOLDING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.MORTALITY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.MORTALITY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVESTING)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HARVESTING_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.BUDGET)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.REPLACEMENT)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.REPLACEMENT_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.METEOROLOGY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.METEOROLOGY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_MATERIAL)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLANTING_MATERIAL_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLUVIOMETRY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.PLUVIOMETRY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ETP)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.ETP_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HYGROMETRY)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.HYGROMETRY_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TEMPERATURE)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.TEMPERATURE_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.INSULATION)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.INSULATION_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.WORK)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }else if(metaData.getTitle().equals(ITitle.WORK_en)){\n report.setPageFormat(PageType.A4, PageOrientation.LANDSCAPE);\n }\n \n \n drColumns = new HashMap<String, TextColumnBuilder>(); \n groups = new ArrayList<String>();\n subtotals = new ArrayList<String>();\n \n //Definit la liste des colonnes du rapport\n ExportGenerator.getColumns(metaData); \n //Definit la liste des sous-totaux du rapport\n ExportGenerator.getSubTotals(metaData);\n \n \n //Genration des sous totaux\n for (String group : groups) {\n ColumnGroupBuilder group2 = grp.group(drColumns.get(group));\n report.groupBy(group2);\n for (String subtotal : subtotals) {\n report.subtotalsAtGroupFooter(group2,sbt.sum(drColumns.get(subtotal)));\n }\n }\n\n for (String subtotal : subtotals) {\n report.subtotalsAtSummary(sbt.sum(drColumns.get(subtotal))); \n }\n \n /*if(ExportGenerator.getColumnByNameField(\"plantingName\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL \"), ExportGenerator.getColumnByNameField(\"plantingName\"), Calculation.NOTHING));\n }*//*else if(ExportGenerator.getColumnByNameField(\"invoiceCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"invoiceCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"planterCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL\"), ExportGenerator.getColumnByNameField(\"planterCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"transportTicket\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"transportTicket\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"deliveryDate\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"deliveryDate\"), Calculation.NOTHING));\n }\n else if(ExportGenerator.getColumnByNameField(\"arroundPlantingTicketNumber\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"arroundPlantingTicketNumber\"), Calculation.NOTHING));\n }\n else if(ExportGenerator.getColumnByNameField(\"planterNumber\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"planterNumber\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"startPaymentDate\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"startPaymentDate\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"sectorCode\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL GENERAL \"), ExportGenerator.getColumnByNameField(\"sectorCode\"), Calculation.NOTHING));\n }else if(ExportGenerator.getColumnByNameField(\"month\") != null){\n report.subtotalsAtSummary(sbt.aggregate(exp.text(\"TOTAL \"), ExportGenerator.getColumnByNameField(\"month\"), Calculation.NOTHING));\n }*/\n \n\n \n \n //Genere la source de donnàes du rapport\n report.setDataSource(metaData.getData());\n \n report.highlightDetailEvenRows(); \n \n \n // Definition de l'entete : valable uniquement pour la 1ere page\n HorizontalListBuilder hlb= null;\n \n hlb = cmp.horizontalList().add(\n cmp.hListCell(createCriteriaComponent(criteria,metaData)).heightFixedOnTop()\n );\n\n \n report.title(\n createCustomTitleComponent(metaData.getTitle()), // Titre\n hlb,// Liste Horizontal des Critàres \n cmp.verticalGap(12) // Marge de 12 px entre chaque critàre\n ); \n \n \n \n report.setPageMargin(DynamicReports.margin().setLeft(15).setTop(30).setRight(15).setBottom(30));\n report.setPageFormat(PageType.A3, PageOrientation.LANDSCAPE);\n report.pageFooter(DynamicReports.cmp.pageXslashY());\n return report;\n \n }", "public void generarReporteCostoGastoImpors(String sAccionBusqueda,List<CostoGastoImpor> costogastoimporsParaReportes) throws Exception {\n\t\tLong iIdUsuarioSesion=0L;\t\r\n\t\t\r\n\t\t\r\n\t\tif(usuarioActual==null) {\r\n\t\t\tthis.usuarioActual=new Usuario();\r\n\t\t}\r\n\t\t\r\n\t\tiIdUsuarioSesion=usuarioActual.getId();\r\n\t\t\r\n\t\tString sPathReportes=\"\";\r\n\t\t\r\n\t\tInputStream reportFile=null;\r\n\t\tInputStream imageFile=null;\r\n\t\t\t\r\n\t\timageFile=AuxiliarImagenes.class.getResourceAsStream(\"LogoReporte.jpg\");\t\t\t\r\n\t\t\t\t\r\n\t\t\r\n\t\tString sPathReporteFinal=\"\";\r\n\t\t\r\n\t\tif(!esReporteAccionProceso) {\r\n\t\t\tif(!this.sTipoReporte.equals(\"RELACIONES\")) {//!isEsReporteRelaciones\r\n\t\t\t\tif(!this.esReporteDinamico) {\r\n\t\t\t\t\tsPathReporteFinal=\"CostoGastoImpor\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\tsPathReporteFinal=this.sPathReporteDinamico;\r\n\t\t\t\t\treportFile = new FileInputStream(sPathReporteFinal);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tsPathReporteFinal=\"CostoGastoImporMasterRelaciones\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\r\n\t\t\t\t//sPathReportes=reportFile.getPath().replace(\"CostoGastoImporMasterRelacionesDesign.jasper\", \"\");\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t\tsPathReporteFinal=\"CostoGastoImpor\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\t\r\n\t\t}\r\n\t\t\r\n\t\tif(reportFile==null) {\r\n\t\t\tthrow new JRRuntimeException(sPathReporteFinal+\" no existe\");\r\n\t\t}\r\n\t\t\r\n\t\tString sUsuario=\"\";\r\n\t\t\r\n\t\tif(usuarioActual!=null) {\r\n\t\t\tsUsuario=usuarioActual.getuser_name();\r\n\t\t}\r\n\t\t\r\n\t\tMap<String, Object> parameters = new HashMap<String, Object>();\r\n\t\tparameters.put(\"usuario\", sUsuario);\r\n\t\t\r\n\t\tparameters.put(\"titulo\", Funciones.GetTituloSistemaReporte(this.parametroGeneralSg,this.moduloActual,this.usuarioActual));\r\n\t\tparameters.put(\"subtitulo\", \"Reporte De Costo Gasto Impores\");\t\t\r\n\t\tparameters.put(\"busquedapor\", CostoGastoImporConstantesFunciones.getNombreIndice(sAccionBusqueda)+sDetalleReporte);\r\n\t\t\r\n\t\t\r\n\t\tif(this.sTipoReporte.equals(\"RELACIONES\")) {//isEsReporteRelaciones\r\n\t\t\tparameters.put(\"SUBREPORT_DIR\", sPathReportes);\r\n\t\t}\r\n\t\t\r\n\t\tparameters.put(\"con_grafico\", this.conGraficoReporte);\r\n\t\t\r\n\t\tJasperReport jasperReport = (JasperReport)JRLoader.loadObject(reportFile);\r\n\t\t\t\t\r\n\t\tthis.cargarDatosCliente();\r\n\t\t\r\n\t\tArrayList<Classe> classes=new ArrayList<Classe>();\t\t\r\n\t\t\r\n\t\tif(this.sTipoReporte.equals(\"RELACIONES\")) {//isEsReporteRelaciones\r\n\t\t\t\r\n\t\t\tclasses.add(new Classe(DetalleLiquidacionImpor.class));\r\n\t\t\t\r\n\t\t\t//ARCHITECTURE\r\n\t\t\tif(Constantes.ISUSAEJBLOGICLAYER) {\t\t\r\n\t\t\t\ttry\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\tCostoGastoImporLogic costogastoimporLogicAuxiliar=new CostoGastoImporLogic();\r\n\t\t\t\t\tcostogastoimporLogicAuxiliar.setDatosCliente(costogastoimporLogic.getDatosCliente());\t\t\t\t\r\n\t\t\t\t\tcostogastoimporLogicAuxiliar.setCostoGastoImpors(costogastoimporsParaReportes);\r\n\t\t\t\t\t\r\n\t\t\t\t\tcostogastoimporLogicAuxiliar.cargarRelacionesLoteForeignKeyCostoGastoImporWithConnection(); //deepLoadsWithConnection(false, DeepLoadType.INCLUDE, classes, \"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tcostogastoimporsParaReportes=costogastoimporLogicAuxiliar.getCostoGastoImpors();\r\n\t\t\t\t\t\r\n\t\t\t\t\t//costogastoimporLogic.getNewConnexionToDeep();\r\n\t\t\t\t\t\r\n\t\t\t\t\t//for (CostoGastoImpor costogastoimpor:costogastoimporsParaReportes) {\r\n\t\t\t\t\t//\tcostogastoimporLogic.deepLoad(costogastoimpor, false, DeepLoadType.INCLUDE, classes);\r\n\t\t\t\t\t//}\t\t\t\t\t\t\r\n\t\t\t\t\t//costogastoimporLogic.commitNewConnexionToDeep();\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t} catch(Exception e) {\r\n\t\t\t\t\tthrow e;\r\n\t\t\t\t\t\r\n\t\t\t\t} finally {\r\n\t\t\t\t\t//costogastoimporLogic.closeNewConnexionToDeep();\r\n\t\t\t\t}\r\n\t\t\t} else if(Constantes.ISUSAEJBREMOTE) {\r\n\t\t\t} else if(Constantes.ISUSAEJBHOME) {\r\n\t\t\t}\r\n\t\t\t//ARCHITECTURE\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\r\n\t\t\tInputStream reportFileDetalleLiquidacionImpor = AuxiliarReportes.class.getResourceAsStream(\"DetalleLiquidacionImporDetalleRelacionesDesign.jasper\");\r\n\t\t\tparameters.put(\"subreport_detalleliquidacionimpor\", reportFileDetalleLiquidacionImpor);\r\n\t\t} else {\r\n\t\t\t//FK DEBERIA TRAERSE DE ANTEMANO\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\r\n\t\t//CLASSES PARA REPORTES OBJETOS RELACIONADOS\r\n\t\tif(!this.sTipoReporte.equals(\"RELACIONES\")) {//!isEsReporteRelaciones\r\n\t\t\tclasses=new ArrayList<Classe>();\r\n\t\t}\r\n\t\t\r\n\t\tJRBeanArrayDataSource jrbeanArrayDataSourceCostoGastoImpor=null;\r\n\t\t\r\n\t\tif(this.sTipoReporteExtra!=null && !this.sTipoReporteExtra.equals(\"\")) {\r\n\t\t\tCostoGastoImporConstantesFunciones.S_TIPOREPORTE_EXTRA=this.sTipoReporteExtra;\r\n\t\t} else {\r\n\t\t\tCostoGastoImporConstantesFunciones.S_TIPOREPORTE_EXTRA=\"\";\r\n\t\t}\r\n\t\t\r\n\t\tjrbeanArrayDataSourceCostoGastoImpor=new JRBeanArrayDataSource(CostoGastoImporJInternalFrame.TraerCostoGastoImporBeans(costogastoimporsParaReportes,classes).toArray());\r\n\t\t\r\n\t\tjasperPrint = JasperFillManager.fillReport(jasperReport,parameters,jrbeanArrayDataSourceCostoGastoImpor);\r\n\t\t\t\t\r\n\t\t\r\n\t\tString sPathDest=Constantes.SUNIDAD_ARCHIVOS+\":/\"+Constantes.SCONTEXTSERVER+\"/\"+CostoGastoImporConstantesFunciones.SCHEMA+\"/reportes\";\r\n\t\t\r\n\t\tFile filePathDest = new File(sPathDest);\r\n\t\t\r\n\t\tif(!filePathDest.exists()) {\r\n\t\t\tfilePathDest.mkdirs();\t\t\t\t\r\n\t\t}\r\n\t\t\t\t\r\n\t\tString sDestFileName=sPathDest+\"/\"+CostoGastoImporConstantesFunciones.CLASSNAME;\r\n\t\t\t\t\r\n\t\tif(this.sTipoArchivoReporte==\"VISUALIZAR\") {\r\n\t\t\tJasperViewer jasperViewer = new JasperViewer(jasperPrint,false) ;\r\n\t\t\tjasperViewer.setVisible(true) ; \r\n\r\n\t\t} else if(this.sTipoArchivoReporte==\"HTML\"||this.sTipoArchivoReporte==\"PDF\"||this.sTipoArchivoReporte==\"XML\") {\t\r\n\t\t\t//JasperFillManager.fillReportToFile(reportFile.getAbsolutePath(),parameters, new JRBeanArrayDataSource(CostoGastoImporBean.TraerCostoGastoImporBeans(costogastoimporsParaReportes).toArray()));\r\n\t\t\t\t\t\t\t\r\n\t\t\tif(this.sTipoArchivoReporte==\"HTML\") {\r\n\t\t\t\tsDestFileName+=\".html\";\r\n\t\t\t\tJasperExportManager.exportReportToHtmlFile(jasperPrint,sDestFileName);\r\n\t\t\t\t\t\r\n\t\t\t} else if(this.sTipoArchivoReporte==\"PDF\") {\r\n\t\t\t\tsDestFileName+=\".pdf\";\r\n\t\t\t\tJasperExportManager.exportReportToPdfFile(jasperPrint,sDestFileName);\r\n\t\t\t} else {\r\n\t\t\t\tsDestFileName+=\".xml\";\r\n\t\t\t\tJasperExportManager.exportReportToXmlFile(jasperPrint,sDestFileName, false);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t} else if(this.sTipoArchivoReporte==\"WORD\"||this.sTipoArchivoReporte==\"EXCEL\") {\r\n\t\t\t\t\r\n\t\t\tif(this.sTipoArchivoReporte==\"WORD\") {\r\n\t\t\t\tsDestFileName+=\".rtf\";\r\n\t\t\t\t\t\r\n\t\t\t\tJRRtfExporter exporter = new JRRtfExporter();\r\n\t\t\r\n\t\t\t\texporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);\r\n\t\t\t\texporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, sDestFileName);\r\n\t\t\r\n\t\t\t\texporter.exportReport();\r\n\t\t\t\t\r\n\t\t\t} else\t{\r\n\t\t\t\tsDestFileName+=\".xls\";\r\n\t\t\t\t\t\r\n\t\t\t\tJRXlsExporter exporterXls = new JRXlsExporter();\r\n\t\t\r\n\t\t\t\texporterXls.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);\r\n\t\t\t\texporterXls.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, sDestFileName);\r\n\t\t\t\texporterXls.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE);\r\n\t\t\r\n\t\t\t\texporterXls.exportReport();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} else if(this.sTipoArchivoReporte==\"EXCEL2\"||this.sTipoArchivoReporte==\"EXCEL2_2\") {\r\n\t\t\t//sDestFileName+=\".xlsx\";\r\n\t\t\t\r\n\t\t\tif(this.sTipoReporte.equals(\"NORMAL\")) {\r\n\t\t\t\tthis.generarExcelReporteCostoGastoImpors(sAccionBusqueda,sTipoArchivoReporte,costogastoimporsParaReportes);\r\n\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"FORMULARIO\")){\r\n\t\t\t\tthis.generarExcelReporteVerticalCostoGastoImpors(sAccionBusqueda,sTipoArchivoReporte,costogastoimporsParaReportes,false);\r\n\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"DINAMICO\")){\r\n\t\t\t\t\r\n\t\t\t\tif(this.sTipoReporteDinamico.equals(\"NORMAL\")) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.jButtonGenerarExcelReporteDinamicoCostoGastoImporActionPerformed(null);\r\n\t\t\t\t\t//this.generarExcelReporteCostoGastoImpors(sAccionBusqueda,sTipoArchivoReporte,costogastoimporsParaReportes);\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t} else if(this.sTipoReporteDinamico.equals(\"FORMULARIO\")){\r\n\t\t\t\t\tthis.generarExcelReporteVerticalCostoGastoImpors(sAccionBusqueda,sTipoArchivoReporte,costogastoimporsParaReportes,true);\r\n\t\t\t\t\r\n\t\t\t\t} else if(this.sTipoReporteDinamico.equals(\"RELACIONES\")){\r\n\t\t\t\t\tthis.generarExcelReporteRelacionesCostoGastoImpors(sAccionBusqueda,sTipoArchivoReporte,costogastoimporsParaReportes,true);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"RELACIONES\")){\r\n\t\t\t\tthis.generarExcelReporteRelacionesCostoGastoImpors(sAccionBusqueda,sTipoArchivoReporte,costogastoimporsParaReportes,false);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(this.sTipoArchivoReporte==\"HTML\"||this.sTipoArchivoReporte==\"PDF\"||this.sTipoArchivoReporte==\"XML\"||this.sTipoArchivoReporte==\"WORD\"||this.sTipoArchivoReporte==\"EXCEL\") {\t\t\t\t\r\n\t\t\tJOptionPane.showMessageDialog(this,\"REPORTE \"+sDestFileName+\" GENERADO SATISFACTORIAMENTE\",\"REPORTES \",JOptionPane.INFORMATION_MESSAGE);\r\n\t\t}\r\n\t}", "public void cargarReporte() throws Exception {\n ReporteLogica rpL = new ReporteLogica();\n int[][] entradas = rpL.reporteBasicoTransacciones(\"ENTRADA\");\n if (entradas.length > 0) {\n cincoMasEntradas(entradas);\n mayorMenorEntrada(entradas);\n totalEntradas(entradas);\n grafica(entradas);\n } else {\n JOptionPane.showMessageDialog(null, \"Datos insuficientes para generar reporte\");\n }\n }", "void reporte(){\n //Variable para abrir el listado automaticamente\n Desktop pc=Desktop.getDesktop();\n //Se crea el documento\n Document doc=new Document();\n try {\n //Se crea el documento PDF\n FileOutputStream pdf=new FileOutputStream(\"ListadoCursos.pdf\");\n //El documento almacena la infomación del pdf.\n PdfWriter.getInstance(doc, pdf);\n \n //Se abre el documento para que se pueda modificar\n doc.open();\n \n //Se crea el título del documento y se configura\n Paragraph titulo=new Paragraph(\"Listado de Cursos\\n\\n\",\n FontFactory.getFont(\"Serif\",22,Font.PLAIN));\n //Se agrega el titulo al documento\n doc.add(titulo);\n \n //Se crea la tabla con la información\n PdfPTable tabla=new PdfPTable(5);\n //Se agregan los titulos a la tabla\n tabla.addCell(\"Codigo\");\n tabla.addCell(\"Nombre\");\n tabla.addCell(\"Creditos\");\n tabla.addCell(\"Alumnos\");\n tabla.addCell(\"Profesor\");\n \n //Se agregan los datos del los profesores\n for (int i = 0; i < datos.cantCur; i++) {\n tabla.addCell(datos.codigoC[i]+\"\");\n tabla.addCell(datos.nombreC[i]);\n tabla.addCell(datos.creditosC[i]+\"\");\n tabla.addCell(datos.alumnosC[i]+\"\");\n //Se busca al profesor\n String profesor=\"\";\n int a=0;\n while(a<datos.cantPro){\n if (datos.codigoPC[i]==datos.codigoP[a]) {\n profesor=datos.nombreP[a]+\" \"+datos.apellidoP[a];\n break;\n }\n a++;\n }\n tabla.addCell(profesor);\n }\n \n //Se agrega la tabla\n doc.add(tabla);\n //Se cierra el documento\n doc.close();\n //El documento creado se pasa a una variable tipo FILE\n File f=new File(\"ListadoCursos.pdf\");\n //Se abre el documento PDF\n pc.open(f);\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null,\"Error al crear el pdf\");\n }\n }", "public void generarReporteGanancia(String destino,String fechainicial,String fechafinal)\n {\n \n if(destino.equals(\"Todos\"))\n {\n try\n {\n //File miDir = new File (Crear.class.getResource(\"/Reportes/ticket.jasper\").getFile());\n //File miDir=new File(\"/Reportes/ticket.jasper\");\n URL entrada=this.getClass().getResource(\"/Reportes/GananciaVentasGeneral.jasper\");\n JasperReport jasperReport;\n jasperReport=(JasperReport)JRLoader.loadObject(entrada);\n \n HashMap parametros = new HashMap<>();\n\n \n \n parametros.put(\"destino\", destino);\n parametros.put(\"fechainicial\", fechainicial);\n parametros.put(\"fechafinal\", fechafinal);\n \n \n \t\tJasperPrint jasperPrint =JasperFillManager.fillReport(jasperReport, parametros, Conexion.obtenerConexion());\n\t\t JasperViewer viewer = new JasperViewer(jasperPrint,false);\n viewer.setTitle(\"Movimientos de Ventas Credito/Contado\");\n viewer.setVisible(true);\n \n }\n catch(Exception er)\n {\n JOptionPane.showMessageDialog(null,\"Error al generar reporte\"+er.getCause()+\"\"+er.getLocalizedMessage());\n }\n }\n else\n { \n \n try\n {\n //File miDir = new File (Crear.class.getResource(\"/Reportes/ticket.jasper\").getFile());\n //File miDir=new File(\"/Reportes/ticket.jasper\");\n URL entrada=this.getClass().getResource(\"/Reportes/GananciaVentas.jasper\");\n JasperReport jasperReport;\n jasperReport=(JasperReport)JRLoader.loadObject(entrada);\n \n HashMap parametros = new HashMap<>();\n\n \n \n parametros.put(\"destino\", destino);\n parametros.put(\"fechainicial\", fechainicial);\n parametros.put(\"fechafinal\", fechafinal);\n \n \n \t\tJasperPrint jasperPrint =JasperFillManager.fillReport(jasperReport, parametros, Conexion.obtenerConexion());\n\t\t JasperViewer viewer = new JasperViewer(jasperPrint,false);\n viewer.setTitle(\"Movimientos de Insumos\");\n viewer.setVisible(true);\n \n }\n catch(Exception er)\n {\n JOptionPane.showMessageDialog(null,\"Error al generar reporte\"+er.getCause()+\"\"+er.getLocalizedMessage());\n }\n } \n }", "public void generarReporteCierreCajas(String sAccionBusqueda,List<CierreCaja> cierrecajasParaReportes) throws Exception {\n\t\tLong iIdUsuarioSesion=0L;\t\r\n\t\t\r\n\t\t\r\n\t\tif(usuarioActual==null) {\r\n\t\t\tthis.usuarioActual=new Usuario();\r\n\t\t}\r\n\t\t\r\n\t\tiIdUsuarioSesion=usuarioActual.getId();\r\n\t\t\r\n\t\tString sPathReportes=\"\";\r\n\t\t\r\n\t\tInputStream reportFile=null;\r\n\t\tInputStream imageFile=null;\r\n\t\t\t\r\n\t\timageFile=AuxiliarImagenes.class.getResourceAsStream(\"LogoReporte.jpg\");\t\t\t\r\n\t\t\t\t\r\n\t\t\r\n\t\tString sPathReporteFinal=\"\";\r\n\t\t\r\n\t\tif(!esReporteAccionProceso) {\r\n\t\t\tif(!this.sTipoReporte.equals(\"RELACIONES\")) {//!isEsReporteRelaciones\r\n\t\t\t\tif(!this.esReporteDinamico) {\r\n\t\t\t\t\tsPathReporteFinal=\"CierreCaja\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\tsPathReporteFinal=this.sPathReporteDinamico;\r\n\t\t\t\t\treportFile = new FileInputStream(sPathReporteFinal);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tsPathReporteFinal=\"CierreCajaMasterRelaciones\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\r\n\t\t\t\t//sPathReportes=reportFile.getPath().replace(\"CierreCajaMasterRelacionesDesign.jasper\", \"\");\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t\tsPathReporteFinal=\"CierreCaja\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\t\r\n\t\t}\r\n\t\t\r\n\t\tif(reportFile==null) {\r\n\t\t\tthrow new JRRuntimeException(sPathReporteFinal+\" no existe\");\r\n\t\t}\r\n\t\t\r\n\t\tString sUsuario=\"\";\r\n\t\t\r\n\t\tif(usuarioActual!=null) {\r\n\t\t\tsUsuario=usuarioActual.getuser_name();\r\n\t\t}\r\n\t\t\r\n\t\tMap<String, Object> parameters = new HashMap<String, Object>();\r\n\t\tparameters.put(\"usuario\", sUsuario);\r\n\t\t\r\n\t\tparameters.put(\"titulo\", Funciones.GetTituloSistemaReporte(this.parametroGeneralSg,this.moduloActual,this.usuarioActual));\r\n\t\tparameters.put(\"subtitulo\", \"Reporte De Cierre Cajas\");\t\t\r\n\t\tparameters.put(\"busquedapor\", CierreCajaConstantesFunciones.getNombreIndice(sAccionBusqueda)+sDetalleReporte);\r\n\t\t\r\n\t\t\r\n\t\tif(this.sTipoReporte.equals(\"RELACIONES\")) {//isEsReporteRelaciones\r\n\t\t\tparameters.put(\"SUBREPORT_DIR\", sPathReportes);\r\n\t\t}\r\n\t\t\r\n\t\tparameters.put(\"con_grafico\", this.conGraficoReporte);\r\n\t\t\r\n\t\tJasperReport jasperReport = (JasperReport)JRLoader.loadObject(reportFile);\r\n\t\t\t\t\r\n\t\tthis.cargarDatosCliente();\r\n\t\t\r\n\t\tArrayList<Classe> classes=new ArrayList<Classe>();\t\t\r\n\t\t\r\n\t\tif(this.sTipoReporte.equals(\"RELACIONES\")) {//isEsReporteRelaciones\r\n\t\t\t\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\t//FK DEBERIA TRAERSE DE ANTEMANO\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\r\n\t\t//CLASSES PARA REPORTES OBJETOS RELACIONADOS\r\n\t\tif(!this.sTipoReporte.equals(\"RELACIONES\")) {//!isEsReporteRelaciones\r\n\t\t\tclasses=new ArrayList<Classe>();\r\n\t\t}\r\n\t\t\r\n\t\tJRBeanArrayDataSource jrbeanArrayDataSourceCierreCaja=null;\r\n\t\t\r\n\t\tif(this.sTipoReporteExtra!=null && !this.sTipoReporteExtra.equals(\"\")) {\r\n\t\t\tCierreCajaConstantesFunciones.S_TIPOREPORTE_EXTRA=this.sTipoReporteExtra;\r\n\t\t} else {\r\n\t\t\tCierreCajaConstantesFunciones.S_TIPOREPORTE_EXTRA=\"\";\r\n\t\t}\r\n\t\t\r\n\t\tjrbeanArrayDataSourceCierreCaja=new JRBeanArrayDataSource(CierreCajaJInternalFrame.TraerCierreCajaBeans(cierrecajasParaReportes,classes).toArray());\r\n\t\t\r\n\t\tjasperPrint = JasperFillManager.fillReport(jasperReport,parameters,jrbeanArrayDataSourceCierreCaja);\r\n\t\t\t\t\r\n\t\t\r\n\t\tString sPathDest=Constantes.SUNIDAD_ARCHIVOS+\":/\"+Constantes.SCONTEXTSERVER+\"/\"+CierreCajaConstantesFunciones.SCHEMA+\"/reportes\";\r\n\t\t\r\n\t\tFile filePathDest = new File(sPathDest);\r\n\t\t\r\n\t\tif(!filePathDest.exists()) {\r\n\t\t\tfilePathDest.mkdirs();\t\t\t\t\r\n\t\t}\r\n\t\t\t\t\r\n\t\tString sDestFileName=sPathDest+\"/\"+CierreCajaConstantesFunciones.CLASSNAME;\r\n\t\t\t\t\r\n\t\tif(this.sTipoArchivoReporte==\"VISUALIZAR\") {\r\n\t\t\tJasperViewer jasperViewer = new JasperViewer(jasperPrint,false) ;\r\n\t\t\tjasperViewer.setVisible(true) ; \r\n\r\n\t\t} else if(this.sTipoArchivoReporte==\"HTML\"||this.sTipoArchivoReporte==\"PDF\"||this.sTipoArchivoReporte==\"XML\") {\t\r\n\t\t\t//JasperFillManager.fillReportToFile(reportFile.getAbsolutePath(),parameters, new JRBeanArrayDataSource(CierreCajaBean.TraerCierreCajaBeans(cierrecajasParaReportes).toArray()));\r\n\t\t\t\t\t\t\t\r\n\t\t\tif(this.sTipoArchivoReporte==\"HTML\") {\r\n\t\t\t\tsDestFileName+=\".html\";\r\n\t\t\t\tJasperExportManager.exportReportToHtmlFile(jasperPrint,sDestFileName);\r\n\t\t\t\t\t\r\n\t\t\t} else if(this.sTipoArchivoReporte==\"PDF\") {\r\n\t\t\t\tsDestFileName+=\".pdf\";\r\n\t\t\t\tJasperExportManager.exportReportToPdfFile(jasperPrint,sDestFileName);\r\n\t\t\t} else {\r\n\t\t\t\tsDestFileName+=\".xml\";\r\n\t\t\t\tJasperExportManager.exportReportToXmlFile(jasperPrint,sDestFileName, false);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t} else if(this.sTipoArchivoReporte==\"WORD\"||this.sTipoArchivoReporte==\"EXCEL\") {\r\n\t\t\t\t\r\n\t\t\tif(this.sTipoArchivoReporte==\"WORD\") {\r\n\t\t\t\tsDestFileName+=\".rtf\";\r\n\t\t\t\t\t\r\n\t\t\t\tJRRtfExporter exporter = new JRRtfExporter();\r\n\t\t\r\n\t\t\t\texporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);\r\n\t\t\t\texporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, sDestFileName);\r\n\t\t\r\n\t\t\t\texporter.exportReport();\r\n\t\t\t\t\r\n\t\t\t} else\t{\r\n\t\t\t\tsDestFileName+=\".xls\";\r\n\t\t\t\t\t\r\n\t\t\t\tJRXlsExporter exporterXls = new JRXlsExporter();\r\n\t\t\r\n\t\t\t\texporterXls.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);\r\n\t\t\t\texporterXls.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, sDestFileName);\r\n\t\t\t\texporterXls.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE);\r\n\t\t\r\n\t\t\t\texporterXls.exportReport();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} else if(this.sTipoArchivoReporte==\"EXCEL2\"||this.sTipoArchivoReporte==\"EXCEL2_2\") {\r\n\t\t\t//sDestFileName+=\".xlsx\";\r\n\t\t\t\r\n\t\t\tif(this.sTipoReporte.equals(\"NORMAL\")) {\r\n\t\t\t\tthis.generarExcelReporteCierreCajas(sAccionBusqueda,sTipoArchivoReporte,cierrecajasParaReportes);\r\n\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"FORMULARIO\")){\r\n\t\t\t\tthis.generarExcelReporteVerticalCierreCajas(sAccionBusqueda,sTipoArchivoReporte,cierrecajasParaReportes,false);\r\n\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"DINAMICO\")){\r\n\t\t\t\t\r\n\t\t\t\tif(this.sTipoReporteDinamico.equals(\"NORMAL\")) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.jButtonGenerarExcelReporteDinamicoCierreCajaActionPerformed(null);\r\n\t\t\t\t\t//this.generarExcelReporteCierreCajas(sAccionBusqueda,sTipoArchivoReporte,cierrecajasParaReportes);\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t} else if(this.sTipoReporteDinamico.equals(\"FORMULARIO\")){\r\n\t\t\t\t\tthis.generarExcelReporteVerticalCierreCajas(sAccionBusqueda,sTipoArchivoReporte,cierrecajasParaReportes,true);\r\n\t\t\t\t\r\n\t\t\t\t} else if(this.sTipoReporteDinamico.equals(\"RELACIONES\")){\r\n\t\t\t\t\tthis.generarExcelReporteRelacionesCierreCajas(sAccionBusqueda,sTipoArchivoReporte,cierrecajasParaReportes,true);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"RELACIONES\")){\r\n\t\t\t\tthis.generarExcelReporteRelacionesCierreCajas(sAccionBusqueda,sTipoArchivoReporte,cierrecajasParaReportes,false);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(this.sTipoArchivoReporte==\"HTML\"||this.sTipoArchivoReporte==\"PDF\"||this.sTipoArchivoReporte==\"XML\"||this.sTipoArchivoReporte==\"WORD\"||this.sTipoArchivoReporte==\"EXCEL\") {\t\t\t\t\r\n\t\t\tJOptionPane.showMessageDialog(this,\"REPORTE \"+sDestFileName+\" GENERADO SATISFACTORIAMENTE\",\"REPORTES \",JOptionPane.INFORMATION_MESSAGE);\r\n\t\t}\r\n\t}", "public static void reportes(){\n try {\n /**Variable necesaria para abrir el archivo creado*/\n Desktop pc=Desktop.getDesktop();\n /**Variables para escribir el documento*/\n File f=new File(\"Reporte_salvajes.html\");\n FileWriter w=new FileWriter(f);\n BufferedWriter bw=new BufferedWriter(w);\n PrintWriter pw=new PrintWriter(bw);\n \n /**Se inicia el documento HTML*/\n pw.write(\"<!DOCTYPE html>\\n\");\n pw.write(\"<html>\\n\");\n pw.write(\"<head>\\n\");\n pw.write(\"<title>Reporte de los Pokemons Salvajes</title>\\n\");\n pw.write(\"<style type=\\\"text/css\\\">\\n\" +\n \"body{\\n\" +\n \"background-color:rgba(117, 235, 148, 1);\\n\" +\n \"text-align: center;\\n\" +\n \"font-family:sans-serif;\\n\" +\n \"}\\n\"\n + \"table{\\n\" +\n\"\t\t\tborder: black 2px solid;\\n\" +\n\"\t\t\tborder-collapse: collapse;\\n\" +\n\" }\\n\"\n + \"#td1{\\n\" +\n\" border: black 2px solid;\\n\"\n + \" background-color: skyblue;\\n\" +\n\" }\\n\" +\n\" #td2{\\n\" +\n\" border: black 2px solid;\\n\"\n + \" background-color: white;\\n\" +\n\" }\\n\"\n +\"</style>\");\n pw.write(\"<meta charset=\\\"utf-8\\\">\");\n pw.write(\"</head>\\n\");\n /**Inicio del cuerpo*/\n pw.write(\"<body>\\n\");\n /**Título del reporte*/\n pw.write(\"<h1>Reporte de los Pokemons Salvajes</h1>\\n\");\n /**Fecha en que se genero el reporte*/\n pw.write(\"<h3>Documento Creado el \"+fecha.get(Calendar.DAY_OF_MONTH)+\n \"/\"+((int)fecha.get(Calendar.MONTH)+1)+\"/\"+fecha.get(Calendar.YEAR)+\" a las \"\n +fecha.get(Calendar.HOUR)+\":\"+fecha.get(Calendar.MINUTE)+\":\"+fecha.get(Calendar.SECOND)+\"</h3>\\n\");\n \n pw.write(\"<table align=\\\"center\\\">\\n\");\n //Se escriben los títulos de las columnas\n pw.write(\"<tr>\\n\");\n pw.write(\"<td id=\\\"td1\\\">\"+pokemon.Titulo[0]+\"</td>\\n\");\n pw.write(\"<td id=\\\"td1\\\">\"+pokemon.Titulo[1]+\"</td>\\n\");\n pw.write(\"<td id=\\\"td1\\\">\"+pokemon.Titulo[2]+\"</td>\\n\");\n pw.write(\"<td id=\\\"td1\\\">\"+pokemon.Titulo[3]+\"</td>\\n\");\n pw.write(\"<td id=\\\"td1\\\">\"+pokemon.Titulo[4]+\"</td>\\n\");\n pw.write(\"<td id=\\\"td1\\\">\"+pokemon.Titulo[5]+\"</td>\\n\");\n pw.write(\"<td id=\\\"td1\\\">\"+pokemon.Titulo[6]+\"</td>\\n\");\n pw.write(\"</tr>\\n\");\n for (int i = 0; i < pokemon.ingresados; i++) {\n //Se determina si el pokemon es salvaje\n if(pokemon.Capturado[i]==false){\n pw.write(\"<tr>\\n\");\n pw.write(\"<td id=\\\"td2\\\">\"+pokemon.Id[i]+\"</td>\\n\");\n pw.write(\"<td id=\\\"td2\\\">\"+pokemon.Tipo[i]+\"</td>\\n\");\n pw.write(\"<td id=\\\"td2\\\">\"+pokemon.Nombre[i]+\"</td>\\n\");\n pw.write(\"<td id=\\\"td2\\\">\"+pokemon.Vida[i]+\"</td>\\n\");\n pw.write(\"<td id=\\\"td2\\\">\"+pokemon.ptAt[i]+\"</td>\\n\");\n pw.write(\"<td id=\\\"td2\\\">Salvaje</td>\\n\");\n //Se determina si el pokemon esta vivo o muerto\n String estado;\n if (pokemon.Estado[i]==true) {\n estado=\"Vivo\";\n }else{estado=\"Muerto\";}\n pw.write(\"<td id=\\\"td2\\\">\"+estado+\"</td>\\n\");\n pw.write(\"</tr>\\n\");\n }\n }\n pw.write(\"</table><br>\\n\");\n \n pw.write(\"</body>\\n\");\n pw.write(\"</html>\\n\");\n /**Se finaliza el documento HTML*/\n \n /**Se cierra la capacidad de escribir en el documento*/ \n pw.close();\n /**Se cierra el documento en el programa*/\n bw.close();\n /**Se abre el documento recien creado y guardado*/\n pc.open(f);\n } catch (Exception e) {\n System.err.println(\"Asegurese de haber realizado las actividades previas \"\n + \"relacionadas\");\n }\n }", "public void verReporte(){\n //Guardamos en variables los valores de los parametros que pasaremos al reporte\n int cc = this.clienteTMP.getCodCliente();\n int cv = this.vendedor.getCodVendedor();\n int cf = this.facturaTMP.getCodFactura();\n \n System.out.println(\"Codigo cliente: \"+cc);\n System.out.println(\"Codigo vendedor: \"+cv);\n System.out.println(\"Codigo factura: \"+cf);\n \n //obtenemos la ruta en el sistema de archivos del archivo .jasper a\n //partir de la ruta relativa en el proyecto\n //Obtenemos el contexto de la aplicacion y lo depositamos en una variable\n //ServletContext\n ServletContext servletContext = \n (ServletContext)FacesContext.getCurrentInstance().getExternalContext().getContext();\n \n String rutaReporte = servletContext.getRealPath(\"/reportes/factura503.jasper\");\n System.out.println(\"Ruta del reporte: \"+rutaReporte);\n //Limpiamos la variables Temporales\n clienteTMP = new Cliente();\n facturaTMP = new Factura();\n \n //Creamos el reporte\n ReporteFactura.createReport(rutaReporte, cc, cv, cf);\n //exportamos el reporte a PDF\n ReporteFactura.exportReportToPdfWeb();\n \n //Cerramos el contexto\n FacesContext.getCurrentInstance().responseComplete();\n \n }", "@Override\r\n public void abrirListaReportes() {\n sec_rango_reporte.getCal_fecha1().setValue(null);\r\n sec_rango_reporte.getCal_fecha2().setValue(null);\r\n rep_reporte.dibujar();\r\n\r\n }", "public void generarReporteTablaAmortiDetalles(String sAccionBusqueda,List<TablaAmortiDetalle> tablaamortidetallesParaReportes) throws Exception {\n\t\tLong iIdUsuarioSesion=0L;\t\r\n\t\t\r\n\t\t\r\n\t\tif(usuarioActual==null) {\r\n\t\t\tthis.usuarioActual=new Usuario();\r\n\t\t}\r\n\t\t\r\n\t\tiIdUsuarioSesion=usuarioActual.getId();\r\n\t\t\r\n\t\tString sPathReportes=\"\";\r\n\t\t\r\n\t\tInputStream reportFile=null;\r\n\t\tInputStream imageFile=null;\r\n\t\t\t\r\n\t\timageFile=AuxiliarImagenes.class.getResourceAsStream(\"LogoReporte.jpg\");\t\t\t\r\n\t\t\t\t\r\n\t\t\r\n\t\tString sPathReporteFinal=\"\";\r\n\t\t\r\n\t\tif(!esReporteAccionProceso) {\r\n\t\t\tif(!this.sTipoReporte.equals(\"RELACIONES\")) {//!isEsReporteRelaciones\r\n\t\t\t\tif(!this.esReporteDinamico) {\r\n\t\t\t\t\tsPathReporteFinal=\"TablaAmortiDetalle\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\tsPathReporteFinal=this.sPathReporteDinamico;\r\n\t\t\t\t\treportFile = new FileInputStream(sPathReporteFinal);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tsPathReporteFinal=\"TablaAmortiDetalleMasterRelaciones\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\r\n\t\t\t\t//sPathReportes=reportFile.getPath().replace(\"TablaAmortiDetalleMasterRelacionesDesign.jasper\", \"\");\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t\tsPathReporteFinal=\"TablaAmortiDetalle\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\t\r\n\t\t}\r\n\t\t\r\n\t\tif(reportFile==null) {\r\n\t\t\tthrow new JRRuntimeException(sPathReporteFinal+\" no existe\");\r\n\t\t}\r\n\t\t\r\n\t\tString sUsuario=\"\";\r\n\t\t\r\n\t\tif(usuarioActual!=null) {\r\n\t\t\tsUsuario=usuarioActual.getuser_name();\r\n\t\t}\r\n\t\t\r\n\t\tMap<String, Object> parameters = new HashMap<String, Object>();\r\n\t\tparameters.put(\"usuario\", sUsuario);\r\n\t\t\r\n\t\tparameters.put(\"titulo\", Funciones.GetTituloSistemaReporte(this.parametroGeneralSg,this.moduloActual,this.usuarioActual));\r\n\t\tparameters.put(\"subtitulo\", \"Reporte De Tabla Amortizacion Detalles\");\t\t\r\n\t\tparameters.put(\"busquedapor\", TablaAmortiDetalleConstantesFunciones.getNombreIndice(sAccionBusqueda)+sDetalleReporte);\r\n\t\t\r\n\t\t\r\n\t\tif(this.sTipoReporte.equals(\"RELACIONES\")) {//isEsReporteRelaciones\r\n\t\t\tparameters.put(\"SUBREPORT_DIR\", sPathReportes);\r\n\t\t}\r\n\t\t\r\n\t\tparameters.put(\"con_grafico\", this.conGraficoReporte);\r\n\t\t\r\n\t\tJasperReport jasperReport = (JasperReport)JRLoader.loadObject(reportFile);\r\n\t\t\t\t\r\n\t\tthis.cargarDatosCliente();\r\n\t\t\r\n\t\tArrayList<Classe> classes=new ArrayList<Classe>();\t\t\r\n\t\t\r\n\t\tif(this.sTipoReporte.equals(\"RELACIONES\")) {//isEsReporteRelaciones\r\n\t\t\t\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\t//FK DEBERIA TRAERSE DE ANTEMANO\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\r\n\t\t//CLASSES PARA REPORTES OBJETOS RELACIONADOS\r\n\t\tif(!this.sTipoReporte.equals(\"RELACIONES\")) {//!isEsReporteRelaciones\r\n\t\t\tclasses=new ArrayList<Classe>();\r\n\t\t}\r\n\t\t\r\n\t\tJRBeanArrayDataSource jrbeanArrayDataSourceTablaAmortiDetalle=null;\r\n\t\t\r\n\t\tif(this.sTipoReporteExtra!=null && !this.sTipoReporteExtra.equals(\"\")) {\r\n\t\t\tTablaAmortiDetalleConstantesFunciones.S_TIPOREPORTE_EXTRA=this.sTipoReporteExtra;\r\n\t\t} else {\r\n\t\t\tTablaAmortiDetalleConstantesFunciones.S_TIPOREPORTE_EXTRA=\"\";\r\n\t\t}\r\n\t\t\r\n\t\tjrbeanArrayDataSourceTablaAmortiDetalle=new JRBeanArrayDataSource(TablaAmortiDetalleJInternalFrame.TraerTablaAmortiDetalleBeans(tablaamortidetallesParaReportes,classes).toArray());\r\n\t\t\r\n\t\tjasperPrint = JasperFillManager.fillReport(jasperReport,parameters,jrbeanArrayDataSourceTablaAmortiDetalle);\r\n\t\t\t\t\r\n\t\t\r\n\t\tString sPathDest=Constantes.SUNIDAD_ARCHIVOS+\":/\"+Constantes.SCONTEXTSERVER+\"/\"+TablaAmortiDetalleConstantesFunciones.SCHEMA+\"/reportes\";\r\n\t\t\r\n\t\tFile filePathDest = new File(sPathDest);\r\n\t\t\r\n\t\tif(!filePathDest.exists()) {\r\n\t\t\tfilePathDest.mkdirs();\t\t\t\t\r\n\t\t}\r\n\t\t\t\t\r\n\t\tString sDestFileName=sPathDest+\"/\"+TablaAmortiDetalleConstantesFunciones.CLASSNAME;\r\n\t\t\t\t\r\n\t\tif(this.sTipoArchivoReporte==\"VISUALIZAR\") {\r\n\t\t\tJasperViewer jasperViewer = new JasperViewer(jasperPrint,false) ;\r\n\t\t\tjasperViewer.setVisible(true) ; \r\n\r\n\t\t} else if(this.sTipoArchivoReporte==\"HTML\"||this.sTipoArchivoReporte==\"PDF\"||this.sTipoArchivoReporte==\"XML\") {\t\r\n\t\t\t//JasperFillManager.fillReportToFile(reportFile.getAbsolutePath(),parameters, new JRBeanArrayDataSource(TablaAmortiDetalleBean.TraerTablaAmortiDetalleBeans(tablaamortidetallesParaReportes).toArray()));\r\n\t\t\t\t\t\t\t\r\n\t\t\tif(this.sTipoArchivoReporte==\"HTML\") {\r\n\t\t\t\tsDestFileName+=\".html\";\r\n\t\t\t\tJasperExportManager.exportReportToHtmlFile(jasperPrint,sDestFileName);\r\n\t\t\t\t\t\r\n\t\t\t} else if(this.sTipoArchivoReporte==\"PDF\") {\r\n\t\t\t\tsDestFileName+=\".pdf\";\r\n\t\t\t\tJasperExportManager.exportReportToPdfFile(jasperPrint,sDestFileName);\r\n\t\t\t} else {\r\n\t\t\t\tsDestFileName+=\".xml\";\r\n\t\t\t\tJasperExportManager.exportReportToXmlFile(jasperPrint,sDestFileName, false);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t} else if(this.sTipoArchivoReporte==\"WORD\"||this.sTipoArchivoReporte==\"EXCEL\") {\r\n\t\t\t\t\r\n\t\t\tif(this.sTipoArchivoReporte==\"WORD\") {\r\n\t\t\t\tsDestFileName+=\".rtf\";\r\n\t\t\t\t\t\r\n\t\t\t\tJRRtfExporter exporter = new JRRtfExporter();\r\n\t\t\r\n\t\t\t\texporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);\r\n\t\t\t\texporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, sDestFileName);\r\n\t\t\r\n\t\t\t\texporter.exportReport();\r\n\t\t\t\t\r\n\t\t\t} else\t{\r\n\t\t\t\tsDestFileName+=\".xls\";\r\n\t\t\t\t\t\r\n\t\t\t\tJRXlsExporter exporterXls = new JRXlsExporter();\r\n\t\t\r\n\t\t\t\texporterXls.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);\r\n\t\t\t\texporterXls.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, sDestFileName);\r\n\t\t\t\texporterXls.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE);\r\n\t\t\r\n\t\t\t\texporterXls.exportReport();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} else if(this.sTipoArchivoReporte==\"EXCEL2\"||this.sTipoArchivoReporte==\"EXCEL2_2\") {\r\n\t\t\t//sDestFileName+=\".xlsx\";\r\n\t\t\t\r\n\t\t\tif(this.sTipoReporte.equals(\"NORMAL\")) {\r\n\t\t\t\tthis.generarExcelReporteTablaAmortiDetalles(sAccionBusqueda,sTipoArchivoReporte,tablaamortidetallesParaReportes);\r\n\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"FORMULARIO\")){\r\n\t\t\t\tthis.generarExcelReporteVerticalTablaAmortiDetalles(sAccionBusqueda,sTipoArchivoReporte,tablaamortidetallesParaReportes,false);\r\n\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"DINAMICO\")){\r\n\t\t\t\t\r\n\t\t\t\tif(this.sTipoReporteDinamico.equals(\"NORMAL\")) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.jButtonGenerarExcelReporteDinamicoTablaAmortiDetalleActionPerformed(null);\r\n\t\t\t\t\t//this.generarExcelReporteTablaAmortiDetalles(sAccionBusqueda,sTipoArchivoReporte,tablaamortidetallesParaReportes);\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t} else if(this.sTipoReporteDinamico.equals(\"FORMULARIO\")){\r\n\t\t\t\t\tthis.generarExcelReporteVerticalTablaAmortiDetalles(sAccionBusqueda,sTipoArchivoReporte,tablaamortidetallesParaReportes,true);\r\n\t\t\t\t\r\n\t\t\t\t} else if(this.sTipoReporteDinamico.equals(\"RELACIONES\")){\r\n\t\t\t\t\tthis.generarExcelReporteRelacionesTablaAmortiDetalles(sAccionBusqueda,sTipoArchivoReporte,tablaamortidetallesParaReportes,true);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"RELACIONES\")){\r\n\t\t\t\tthis.generarExcelReporteRelacionesTablaAmortiDetalles(sAccionBusqueda,sTipoArchivoReporte,tablaamortidetallesParaReportes,false);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(this.sTipoArchivoReporte==\"HTML\"||this.sTipoArchivoReporte==\"PDF\"||this.sTipoArchivoReporte==\"XML\"||this.sTipoArchivoReporte==\"WORD\"||this.sTipoArchivoReporte==\"EXCEL\") {\t\t\t\t\r\n\t\t\tJOptionPane.showMessageDialog(this,\"REPORTE \"+sDestFileName+\" GENERADO SATISFACTORIAMENTE\",\"REPORTES \",JOptionPane.INFORMATION_MESSAGE);\r\n\t\t}\r\n\t}", "public void generarReporteLibroContables(String sAccionBusqueda,List<LibroContable> librocontablesParaReportes) throws Exception {\n\t\tLong iIdUsuarioSesion=0L;\t\r\n\t\t\r\n\t\t\r\n\t\tif(usuarioActual==null) {\r\n\t\t\tthis.usuarioActual=new Usuario();\r\n\t\t}\r\n\t\t\r\n\t\tiIdUsuarioSesion=usuarioActual.getId();\r\n\t\t\r\n\t\tString sPathReportes=\"\";\r\n\t\t\r\n\t\tInputStream reportFile=null;\r\n\t\tInputStream imageFile=null;\r\n\t\t\t\r\n\t\timageFile=AuxiliarImagenes.class.getResourceAsStream(\"LogoReporte.jpg\");\t\t\t\r\n\t\t\t\t\r\n\t\t\r\n\t\tString sPathReporteFinal=\"\";\r\n\t\t\r\n\t\tif(!esReporteAccionProceso) {\r\n\t\t\tif(!this.sTipoReporte.equals(\"RELACIONES\")) {//!isEsReporteRelaciones\r\n\t\t\t\tif(!this.esReporteDinamico) {\r\n\t\t\t\t\tsPathReporteFinal=\"LibroContable\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\tsPathReporteFinal=this.sPathReporteDinamico;\r\n\t\t\t\t\treportFile = new FileInputStream(sPathReporteFinal);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tsPathReporteFinal=\"LibroContableMasterRelaciones\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\r\n\t\t\t\t//sPathReportes=reportFile.getPath().replace(\"LibroContableMasterRelacionesDesign.jasper\", \"\");\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t\tsPathReporteFinal=\"LibroContable\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\t\r\n\t\t}\r\n\t\t\r\n\t\tif(reportFile==null) {\r\n\t\t\tthrow new JRRuntimeException(sPathReporteFinal+\" no existe\");\r\n\t\t}\r\n\t\t\r\n\t\tString sUsuario=\"\";\r\n\t\t\r\n\t\tif(usuarioActual!=null) {\r\n\t\t\tsUsuario=usuarioActual.getuser_name();\r\n\t\t}\r\n\t\t\r\n\t\tMap<String, Object> parameters = new HashMap<String, Object>();\r\n\t\tparameters.put(\"usuario\", sUsuario);\r\n\t\t\r\n\t\tparameters.put(\"titulo\", Funciones.GetTituloSistemaReporte(this.parametroGeneralSg,this.moduloActual,this.usuarioActual));\r\n\t\tparameters.put(\"subtitulo\", \"Reporte De Libro Contables\");\t\t\r\n\t\tparameters.put(\"busquedapor\", LibroContableConstantesFunciones.getNombreIndice(sAccionBusqueda)+sDetalleReporte);\r\n\t\t\r\n\t\t\r\n\t\tif(this.sTipoReporte.equals(\"RELACIONES\")) {//isEsReporteRelaciones\r\n\t\t\tparameters.put(\"SUBREPORT_DIR\", sPathReportes);\r\n\t\t}\r\n\t\t\r\n\t\tparameters.put(\"con_grafico\", this.conGraficoReporte);\r\n\t\t\r\n\t\tJasperReport jasperReport = (JasperReport)JRLoader.loadObject(reportFile);\r\n\t\t\t\t\r\n\t\tthis.cargarDatosCliente();\r\n\t\t\r\n\t\tArrayList<Classe> classes=new ArrayList<Classe>();\t\t\r\n\t\t\r\n\t\tif(this.sTipoReporte.equals(\"RELACIONES\")) {//isEsReporteRelaciones\r\n\t\t\t\r\n\t\t\tclasses.add(new Classe(ParametroFactuPrincipal.class));\r\n\t\t\tclasses.add(new Classe(Definicion.class));\r\n\t\t\t\r\n\t\t\t//ARCHITECTURE\r\n\t\t\tif(Constantes.ISUSAEJBLOGICLAYER) {\t\t\r\n\t\t\t\ttry\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\tLibroContableLogic librocontableLogicAuxiliar=new LibroContableLogic();\r\n\t\t\t\t\tlibrocontableLogicAuxiliar.setDatosCliente(librocontableLogic.getDatosCliente());\t\t\t\t\r\n\t\t\t\t\tlibrocontableLogicAuxiliar.setLibroContables(librocontablesParaReportes);\r\n\t\t\t\t\t\r\n\t\t\t\t\tlibrocontableLogicAuxiliar.cargarRelacionesLoteForeignKeyLibroContableWithConnection(); //deepLoadsWithConnection(false, DeepLoadType.INCLUDE, classes, \"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tlibrocontablesParaReportes=librocontableLogicAuxiliar.getLibroContables();\r\n\t\t\t\t\t\r\n\t\t\t\t\t//librocontableLogic.getNewConnexionToDeep();\r\n\t\t\t\t\t\r\n\t\t\t\t\t//for (LibroContable librocontable:librocontablesParaReportes) {\r\n\t\t\t\t\t//\tlibrocontableLogic.deepLoad(librocontable, false, DeepLoadType.INCLUDE, classes);\r\n\t\t\t\t\t//}\t\t\t\t\t\t\r\n\t\t\t\t\t//librocontableLogic.commitNewConnexionToDeep();\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t} catch(Exception e) {\r\n\t\t\t\t\tthrow e;\r\n\t\t\t\t\t\r\n\t\t\t\t} finally {\r\n\t\t\t\t\t//librocontableLogic.closeNewConnexionToDeep();\r\n\t\t\t\t}\r\n\t\t\t} else if(Constantes.ISUSAEJBREMOTE) {\r\n\t\t\t} else if(Constantes.ISUSAEJBHOME) {\r\n\t\t\t}\r\n\t\t\t//ARCHITECTURE\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\r\n\t\t\tInputStream reportFileParametroFactuPrincipal = AuxiliarReportes.class.getResourceAsStream(\"ParametroFactuPrincipalDetalleRelacionesDesign.jasper\");\r\n\t\t\tparameters.put(\"subreport_parametrofactuprincipal\", reportFileParametroFactuPrincipal);\r\n\r\n\t\t\tInputStream reportFileDefinicion = AuxiliarReportes.class.getResourceAsStream(\"DefinicionDetalleRelacionesDesign.jasper\");\r\n\t\t\tparameters.put(\"subreport_definicion\", reportFileDefinicion);\r\n\t\t} else {\r\n\t\t\t//FK DEBERIA TRAERSE DE ANTEMANO\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\r\n\t\t//CLASSES PARA REPORTES OBJETOS RELACIONADOS\r\n\t\tif(!this.sTipoReporte.equals(\"RELACIONES\")) {//!isEsReporteRelaciones\r\n\t\t\tclasses=new ArrayList<Classe>();\r\n\t\t}\r\n\t\t\r\n\t\tJRBeanArrayDataSource jrbeanArrayDataSourceLibroContable=null;\r\n\t\t\r\n\t\tif(this.sTipoReporteExtra!=null && !this.sTipoReporteExtra.equals(\"\")) {\r\n\t\t\tLibroContableConstantesFunciones.S_TIPOREPORTE_EXTRA=this.sTipoReporteExtra;\r\n\t\t} else {\r\n\t\t\tLibroContableConstantesFunciones.S_TIPOREPORTE_EXTRA=\"\";\r\n\t\t}\r\n\t\t\r\n\t\tjrbeanArrayDataSourceLibroContable=new JRBeanArrayDataSource(LibroContableJInternalFrame.TraerLibroContableBeans(librocontablesParaReportes,classes).toArray());\r\n\t\t\r\n\t\tjasperPrint = JasperFillManager.fillReport(jasperReport,parameters,jrbeanArrayDataSourceLibroContable);\r\n\t\t\t\t\r\n\t\t\r\n\t\tString sPathDest=Constantes.SUNIDAD_ARCHIVOS+\":/\"+Constantes.SCONTEXTSERVER+\"/\"+LibroContableConstantesFunciones.SCHEMA+\"/reportes\";\r\n\t\t\r\n\t\tFile filePathDest = new File(sPathDest);\r\n\t\t\r\n\t\tif(!filePathDest.exists()) {\r\n\t\t\tfilePathDest.mkdirs();\t\t\t\t\r\n\t\t}\r\n\t\t\t\t\r\n\t\tString sDestFileName=sPathDest+\"/\"+LibroContableConstantesFunciones.CLASSNAME;\r\n\t\t\t\t\r\n\t\tif(this.sTipoArchivoReporte==\"VISUALIZAR\") {\r\n\t\t\tJasperViewer jasperViewer = new JasperViewer(jasperPrint,false) ;\r\n\t\t\tjasperViewer.setVisible(true) ; \r\n\r\n\t\t} else if(this.sTipoArchivoReporte==\"HTML\"||this.sTipoArchivoReporte==\"PDF\"||this.sTipoArchivoReporte==\"XML\") {\t\r\n\t\t\t//JasperFillManager.fillReportToFile(reportFile.getAbsolutePath(),parameters, new JRBeanArrayDataSource(LibroContableBean.TraerLibroContableBeans(librocontablesParaReportes).toArray()));\r\n\t\t\t\t\t\t\t\r\n\t\t\tif(this.sTipoArchivoReporte==\"HTML\") {\r\n\t\t\t\tsDestFileName+=\".html\";\r\n\t\t\t\tJasperExportManager.exportReportToHtmlFile(jasperPrint,sDestFileName);\r\n\t\t\t\t\t\r\n\t\t\t} else if(this.sTipoArchivoReporte==\"PDF\") {\r\n\t\t\t\tsDestFileName+=\".pdf\";\r\n\t\t\t\tJasperExportManager.exportReportToPdfFile(jasperPrint,sDestFileName);\r\n\t\t\t} else {\r\n\t\t\t\tsDestFileName+=\".xml\";\r\n\t\t\t\tJasperExportManager.exportReportToXmlFile(jasperPrint,sDestFileName, false);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t} else if(this.sTipoArchivoReporte==\"WORD\"||this.sTipoArchivoReporte==\"EXCEL\") {\r\n\t\t\t\t\r\n\t\t\tif(this.sTipoArchivoReporte==\"WORD\") {\r\n\t\t\t\tsDestFileName+=\".rtf\";\r\n\t\t\t\t\t\r\n\t\t\t\tJRRtfExporter exporter = new JRRtfExporter();\r\n\t\t\r\n\t\t\t\texporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);\r\n\t\t\t\texporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, sDestFileName);\r\n\t\t\r\n\t\t\t\texporter.exportReport();\r\n\t\t\t\t\r\n\t\t\t} else\t{\r\n\t\t\t\tsDestFileName+=\".xls\";\r\n\t\t\t\t\t\r\n\t\t\t\tJRXlsExporter exporterXls = new JRXlsExporter();\r\n\t\t\r\n\t\t\t\texporterXls.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);\r\n\t\t\t\texporterXls.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, sDestFileName);\r\n\t\t\t\texporterXls.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE);\r\n\t\t\r\n\t\t\t\texporterXls.exportReport();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} else if(this.sTipoArchivoReporte==\"EXCEL2\"||this.sTipoArchivoReporte==\"EXCEL2_2\") {\r\n\t\t\t//sDestFileName+=\".xlsx\";\r\n\t\t\t\r\n\t\t\tif(this.sTipoReporte.equals(\"NORMAL\")) {\r\n\t\t\t\tthis.generarExcelReporteLibroContables(sAccionBusqueda,sTipoArchivoReporte,librocontablesParaReportes);\r\n\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"FORMULARIO\")){\r\n\t\t\t\tthis.generarExcelReporteVerticalLibroContables(sAccionBusqueda,sTipoArchivoReporte,librocontablesParaReportes,false);\r\n\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"DINAMICO\")){\r\n\t\t\t\t\r\n\t\t\t\tif(this.sTipoReporteDinamico.equals(\"NORMAL\")) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.jButtonGenerarExcelReporteDinamicoLibroContableActionPerformed(null);\r\n\t\t\t\t\t//this.generarExcelReporteLibroContables(sAccionBusqueda,sTipoArchivoReporte,librocontablesParaReportes);\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t} else if(this.sTipoReporteDinamico.equals(\"FORMULARIO\")){\r\n\t\t\t\t\tthis.generarExcelReporteVerticalLibroContables(sAccionBusqueda,sTipoArchivoReporte,librocontablesParaReportes,true);\r\n\t\t\t\t\r\n\t\t\t\t} else if(this.sTipoReporteDinamico.equals(\"RELACIONES\")){\r\n\t\t\t\t\tthis.generarExcelReporteRelacionesLibroContables(sAccionBusqueda,sTipoArchivoReporte,librocontablesParaReportes,true);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"RELACIONES\")){\r\n\t\t\t\tthis.generarExcelReporteRelacionesLibroContables(sAccionBusqueda,sTipoArchivoReporte,librocontablesParaReportes,false);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(this.sTipoArchivoReporte==\"HTML\"||this.sTipoArchivoReporte==\"PDF\"||this.sTipoArchivoReporte==\"XML\"||this.sTipoArchivoReporte==\"WORD\"||this.sTipoArchivoReporte==\"EXCEL\") {\t\t\t\t\r\n\t\t\tJOptionPane.showMessageDialog(this,\"REPORTE \"+sDestFileName+\" GENERADO SATISFACTORIAMENTE\",\"REPORTES \",JOptionPane.INFORMATION_MESSAGE);\r\n\t\t}\r\n\t}", "public void generarReporteFacturaPuntoVentas(String sAccionBusqueda,List<FacturaPuntoVenta> facturapuntoventasParaReportes) throws Exception {\n\t\tLong iIdUsuarioSesion=0L;\t\r\n\t\t\r\n\t\t\r\n\t\tif(usuarioActual==null) {\r\n\t\t\tthis.usuarioActual=new Usuario();\r\n\t\t}\r\n\t\t\r\n\t\tiIdUsuarioSesion=usuarioActual.getId();\r\n\t\t\r\n\t\tString sPathReportes=\"\";\r\n\t\t\r\n\t\tInputStream reportFile=null;\r\n\t\tInputStream imageFile=null;\r\n\t\t\t\r\n\t\timageFile=AuxiliarImagenes.class.getResourceAsStream(\"LogoReporte.jpg\");\t\t\t\r\n\t\t\t\t\r\n\t\t\r\n\t\tString sPathReporteFinal=\"\";\r\n\t\t\r\n\t\tif(!esReporteAccionProceso) {\r\n\t\t\tif(!this.sTipoReporte.equals(\"RELACIONES\")) {//!isEsReporteRelaciones\r\n\t\t\t\tif(!this.esReporteDinamico) {\r\n\t\t\t\t\tsPathReporteFinal=\"FacturaPuntoVenta\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\tsPathReporteFinal=this.sPathReporteDinamico;\r\n\t\t\t\t\treportFile = new FileInputStream(sPathReporteFinal);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tsPathReporteFinal=\"FacturaPuntoVentaMasterRelaciones\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\r\n\t\t\t\t//sPathReportes=reportFile.getPath().replace(\"FacturaPuntoVentaMasterRelacionesDesign.jasper\", \"\");\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t\tsPathReporteFinal=\"FacturaPuntoVenta\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\t\r\n\t\t}\r\n\t\t\r\n\t\tif(reportFile==null) {\r\n\t\t\tthrow new JRRuntimeException(sPathReporteFinal+\" no existe\");\r\n\t\t}\r\n\t\t\r\n\t\tString sUsuario=\"\";\r\n\t\t\r\n\t\tif(usuarioActual!=null) {\r\n\t\t\tsUsuario=usuarioActual.getuser_name();\r\n\t\t}\r\n\t\t\r\n\t\tMap<String, Object> parameters = new HashMap<String, Object>();\r\n\t\tparameters.put(\"usuario\", sUsuario);\r\n\t\t\r\n\t\tparameters.put(\"titulo\", Funciones.GetTituloSistemaReporte(this.parametroGeneralSg,this.moduloActual,this.usuarioActual));\r\n\t\tparameters.put(\"subtitulo\", \"Reporte De Factura Punto Ventas\");\t\t\r\n\t\tparameters.put(\"busquedapor\", FacturaPuntoVentaConstantesFunciones.getNombreIndice(sAccionBusqueda)+sDetalleReporte);\r\n\t\t\r\n\t\t\r\n\t\tif(this.sTipoReporte.equals(\"RELACIONES\")) {//isEsReporteRelaciones\r\n\t\t\tparameters.put(\"SUBREPORT_DIR\", sPathReportes);\r\n\t\t}\r\n\t\t\r\n\t\tparameters.put(\"con_grafico\", this.conGraficoReporte);\r\n\t\t\r\n\t\tJasperReport jasperReport = (JasperReport)JRLoader.loadObject(reportFile);\r\n\t\t\t\t\r\n\t\tthis.cargarDatosCliente();\r\n\t\t\r\n\t\tArrayList<Classe> classes=new ArrayList<Classe>();\t\t\r\n\t\t\r\n\t\tif(this.sTipoReporte.equals(\"RELACIONES\")) {//isEsReporteRelaciones\r\n\t\t\t\r\n\t\t\tclasses.add(new Classe(FormaPagoPuntoVenta.class));\r\n\t\t\tclasses.add(new Classe(DetalleFacturaPuntoVenta.class));\r\n\t\t\t\r\n\t\t\t//ARCHITECTURE\r\n\t\t\tif(Constantes.ISUSAEJBLOGICLAYER) {\t\t\r\n\t\t\t\ttry\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\tFacturaPuntoVentaLogic facturapuntoventaLogicAuxiliar=new FacturaPuntoVentaLogic();\r\n\t\t\t\t\tfacturapuntoventaLogicAuxiliar.setDatosCliente(facturapuntoventaLogic.getDatosCliente());\t\t\t\t\r\n\t\t\t\t\tfacturapuntoventaLogicAuxiliar.setFacturaPuntoVentas(facturapuntoventasParaReportes);\r\n\t\t\t\t\t\r\n\t\t\t\t\tfacturapuntoventaLogicAuxiliar.cargarRelacionesLoteForeignKeyFacturaPuntoVentaWithConnection(); //deepLoadsWithConnection(false, DeepLoadType.INCLUDE, classes, \"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tfacturapuntoventasParaReportes=facturapuntoventaLogicAuxiliar.getFacturaPuntoVentas();\r\n\t\t\t\t\t\r\n\t\t\t\t\t//facturapuntoventaLogic.getNewConnexionToDeep();\r\n\t\t\t\t\t\r\n\t\t\t\t\t//for (FacturaPuntoVenta facturapuntoventa:facturapuntoventasParaReportes) {\r\n\t\t\t\t\t//\tfacturapuntoventaLogic.deepLoad(facturapuntoventa, false, DeepLoadType.INCLUDE, classes);\r\n\t\t\t\t\t//}\t\t\t\t\t\t\r\n\t\t\t\t\t//facturapuntoventaLogic.commitNewConnexionToDeep();\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t} catch(Exception e) {\r\n\t\t\t\t\tthrow e;\r\n\t\t\t\t\t\r\n\t\t\t\t} finally {\r\n\t\t\t\t\t//facturapuntoventaLogic.closeNewConnexionToDeep();\r\n\t\t\t\t}\r\n\t\t\t} else if(Constantes.ISUSAEJBREMOTE) {\r\n\t\t\t} else if(Constantes.ISUSAEJBHOME) {\r\n\t\t\t}\r\n\t\t\t//ARCHITECTURE\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\r\n\t\t\tInputStream reportFileFormaPagoPuntoVenta = AuxiliarReportes.class.getResourceAsStream(\"FormaPagoPuntoVentaDetalleRelacionesDesign.jasper\");\r\n\t\t\tparameters.put(\"subreport_formapagopuntoventa\", reportFileFormaPagoPuntoVenta);\r\n\r\n\t\t\tInputStream reportFileDetalleFacturaPuntoVenta = AuxiliarReportes.class.getResourceAsStream(\"DetalleFacturaPuntoVentaDetalleRelacionesDesign.jasper\");\r\n\t\t\tparameters.put(\"subreport_detallefacturapuntoventa\", reportFileDetalleFacturaPuntoVenta);\r\n\t\t} else {\r\n\t\t\t//FK DEBERIA TRAERSE DE ANTEMANO\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\r\n\t\t//CLASSES PARA REPORTES OBJETOS RELACIONADOS\r\n\t\tif(!this.sTipoReporte.equals(\"RELACIONES\")) {//!isEsReporteRelaciones\r\n\t\t\tclasses=new ArrayList<Classe>();\r\n\t\t}\r\n\t\t\r\n\t\tJRBeanArrayDataSource jrbeanArrayDataSourceFacturaPuntoVenta=null;\r\n\t\t\r\n\t\tif(this.sTipoReporteExtra!=null && !this.sTipoReporteExtra.equals(\"\")) {\r\n\t\t\tFacturaPuntoVentaConstantesFunciones.S_TIPOREPORTE_EXTRA=this.sTipoReporteExtra;\r\n\t\t} else {\r\n\t\t\tFacturaPuntoVentaConstantesFunciones.S_TIPOREPORTE_EXTRA=\"\";\r\n\t\t}\r\n\t\t\r\n\t\tjrbeanArrayDataSourceFacturaPuntoVenta=new JRBeanArrayDataSource(FacturaPuntoVentaJInternalFrame.TraerFacturaPuntoVentaBeans(facturapuntoventasParaReportes,classes).toArray());\r\n\t\t\r\n\t\tjasperPrint = JasperFillManager.fillReport(jasperReport,parameters,jrbeanArrayDataSourceFacturaPuntoVenta);\r\n\t\t\t\t\r\n\t\t\r\n\t\tString sPathDest=Constantes.SUNIDAD_ARCHIVOS+\":/\"+Constantes.SCONTEXTSERVER+\"/\"+FacturaPuntoVentaConstantesFunciones.SCHEMA+\"/reportes\";\r\n\t\t\r\n\t\tFile filePathDest = new File(sPathDest);\r\n\t\t\r\n\t\tif(!filePathDest.exists()) {\r\n\t\t\tfilePathDest.mkdirs();\t\t\t\t\r\n\t\t}\r\n\t\t\t\t\r\n\t\tString sDestFileName=sPathDest+\"/\"+FacturaPuntoVentaConstantesFunciones.CLASSNAME;\r\n\t\t\t\t\r\n\t\tif(this.sTipoArchivoReporte==\"VISUALIZAR\") {\r\n\t\t\tJasperViewer jasperViewer = new JasperViewer(jasperPrint,false) ;\r\n\t\t\tjasperViewer.setVisible(true) ; \r\n\r\n\t\t} else if(this.sTipoArchivoReporte==\"HTML\"||this.sTipoArchivoReporte==\"PDF\"||this.sTipoArchivoReporte==\"XML\") {\t\r\n\t\t\t//JasperFillManager.fillReportToFile(reportFile.getAbsolutePath(),parameters, new JRBeanArrayDataSource(FacturaPuntoVentaBean.TraerFacturaPuntoVentaBeans(facturapuntoventasParaReportes).toArray()));\r\n\t\t\t\t\t\t\t\r\n\t\t\tif(this.sTipoArchivoReporte==\"HTML\") {\r\n\t\t\t\tsDestFileName+=\".html\";\r\n\t\t\t\tJasperExportManager.exportReportToHtmlFile(jasperPrint,sDestFileName);\r\n\t\t\t\t\t\r\n\t\t\t} else if(this.sTipoArchivoReporte==\"PDF\") {\r\n\t\t\t\tsDestFileName+=\".pdf\";\r\n\t\t\t\tJasperExportManager.exportReportToPdfFile(jasperPrint,sDestFileName);\r\n\t\t\t} else {\r\n\t\t\t\tsDestFileName+=\".xml\";\r\n\t\t\t\tJasperExportManager.exportReportToXmlFile(jasperPrint,sDestFileName, false);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t} else if(this.sTipoArchivoReporte==\"WORD\"||this.sTipoArchivoReporte==\"EXCEL\") {\r\n\t\t\t\t\r\n\t\t\tif(this.sTipoArchivoReporte==\"WORD\") {\r\n\t\t\t\tsDestFileName+=\".rtf\";\r\n\t\t\t\t\t\r\n\t\t\t\tJRRtfExporter exporter = new JRRtfExporter();\r\n\t\t\r\n\t\t\t\texporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);\r\n\t\t\t\texporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, sDestFileName);\r\n\t\t\r\n\t\t\t\texporter.exportReport();\r\n\t\t\t\t\r\n\t\t\t} else\t{\r\n\t\t\t\tsDestFileName+=\".xls\";\r\n\t\t\t\t\t\r\n\t\t\t\tJRXlsExporter exporterXls = new JRXlsExporter();\r\n\t\t\r\n\t\t\t\texporterXls.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);\r\n\t\t\t\texporterXls.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, sDestFileName);\r\n\t\t\t\texporterXls.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE);\r\n\t\t\r\n\t\t\t\texporterXls.exportReport();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} else if(this.sTipoArchivoReporte==\"EXCEL2\"||this.sTipoArchivoReporte==\"EXCEL2_2\") {\r\n\t\t\t//sDestFileName+=\".xlsx\";\r\n\t\t\t\r\n\t\t\tif(this.sTipoReporte.equals(\"NORMAL\")) {\r\n\t\t\t\tthis.generarExcelReporteFacturaPuntoVentas(sAccionBusqueda,sTipoArchivoReporte,facturapuntoventasParaReportes);\r\n\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"FORMULARIO\")){\r\n\t\t\t\tthis.generarExcelReporteVerticalFacturaPuntoVentas(sAccionBusqueda,sTipoArchivoReporte,facturapuntoventasParaReportes,false);\r\n\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"DINAMICO\")){\r\n\t\t\t\t\r\n\t\t\t\tif(this.sTipoReporteDinamico.equals(\"NORMAL\")) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.jButtonGenerarExcelReporteDinamicoFacturaPuntoVentaActionPerformed(null);\r\n\t\t\t\t\t//this.generarExcelReporteFacturaPuntoVentas(sAccionBusqueda,sTipoArchivoReporte,facturapuntoventasParaReportes);\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t} else if(this.sTipoReporteDinamico.equals(\"FORMULARIO\")){\r\n\t\t\t\t\tthis.generarExcelReporteVerticalFacturaPuntoVentas(sAccionBusqueda,sTipoArchivoReporte,facturapuntoventasParaReportes,true);\r\n\t\t\t\t\r\n\t\t\t\t} else if(this.sTipoReporteDinamico.equals(\"RELACIONES\")){\r\n\t\t\t\t\tthis.generarExcelReporteRelacionesFacturaPuntoVentas(sAccionBusqueda,sTipoArchivoReporte,facturapuntoventasParaReportes,true);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"RELACIONES\")){\r\n\t\t\t\tthis.generarExcelReporteRelacionesFacturaPuntoVentas(sAccionBusqueda,sTipoArchivoReporte,facturapuntoventasParaReportes,false);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(this.sTipoArchivoReporte==\"HTML\"||this.sTipoArchivoReporte==\"PDF\"||this.sTipoArchivoReporte==\"XML\"||this.sTipoArchivoReporte==\"WORD\"||this.sTipoArchivoReporte==\"EXCEL\") {\t\t\t\t\r\n\t\t\tJOptionPane.showMessageDialog(this,\"REPORTE \"+sDestFileName+\" GENERADO SATISFACTORIAMENTE\",\"REPORTES \",JOptionPane.INFORMATION_MESSAGE);\r\n\t\t}\r\n\t}", "public void generarReportePagosAutorizadoss(String sAccionBusqueda,List<PagosAutorizados> pagosautorizadossParaReportes) throws Exception {\n\t\tLong iIdUsuarioSesion=0L;\t\r\n\t\t\r\n\t\t\r\n\t\tif(usuarioActual==null) {\r\n\t\t\tthis.usuarioActual=new Usuario();\r\n\t\t}\r\n\t\t\r\n\t\tiIdUsuarioSesion=usuarioActual.getId();\r\n\t\t\r\n\t\tString sPathReportes=\"\";\r\n\t\t\r\n\t\tInputStream reportFile=null;\r\n\t\tInputStream imageFile=null;\r\n\t\t\t\r\n\t\timageFile=AuxiliarImagenes.class.getResourceAsStream(\"LogoReporte.jpg\");\t\t\t\r\n\t\t\t\t\r\n\t\t\r\n\t\tString sPathReporteFinal=\"\";\r\n\t\t\r\n\t\tif(!esReporteAccionProceso) {\r\n\t\t\tif(!this.sTipoReporte.equals(\"RELACIONES\")) {//!isEsReporteRelaciones\r\n\t\t\t\tif(!this.esReporteDinamico) {\r\n\t\t\t\t\tsPathReporteFinal=\"PagosAutorizados\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\tsPathReporteFinal=this.sPathReporteDinamico;\r\n\t\t\t\t\treportFile = new FileInputStream(sPathReporteFinal);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tsPathReporteFinal=\"PagosAutorizadosMasterRelaciones\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\r\n\t\t\t\t//sPathReportes=reportFile.getPath().replace(\"PagosAutorizadosMasterRelacionesDesign.jasper\", \"\");\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t\tsPathReporteFinal=\"PagosAutorizados\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\t\r\n\t\t}\r\n\t\t\r\n\t\tif(reportFile==null) {\r\n\t\t\tthrow new JRRuntimeException(sPathReporteFinal+\" no existe\");\r\n\t\t}\r\n\t\t\r\n\t\tString sUsuario=\"\";\r\n\t\t\r\n\t\tif(usuarioActual!=null) {\r\n\t\t\tsUsuario=usuarioActual.getuser_name();\r\n\t\t}\r\n\t\t\r\n\t\tMap<String, Object> parameters = new HashMap<String, Object>();\r\n\t\tparameters.put(\"usuario\", sUsuario);\r\n\t\t\r\n\t\tparameters.put(\"titulo\", Funciones.GetTituloSistemaReporte(this.parametroGeneralSg,this.moduloActual,this.usuarioActual));\r\n\t\tparameters.put(\"subtitulo\", \"Reporte De Pagos Autorizadoses\");\t\t\r\n\t\tparameters.put(\"busquedapor\", PagosAutorizadosConstantesFunciones.getNombreIndice(sAccionBusqueda)+sDetalleReporte);\r\n\t\t\r\n\t\t\r\n\t\tif(this.sTipoReporte.equals(\"RELACIONES\")) {//isEsReporteRelaciones\r\n\t\t\tparameters.put(\"SUBREPORT_DIR\", sPathReportes);\r\n\t\t}\r\n\t\t\r\n\t\tparameters.put(\"con_grafico\", this.conGraficoReporte);\r\n\t\t\r\n\t\tJasperReport jasperReport = (JasperReport)JRLoader.loadObject(reportFile);\r\n\t\t\t\t\r\n\t\tthis.cargarDatosCliente();\r\n\t\t\r\n\t\tArrayList<Classe> classes=new ArrayList<Classe>();\t\t\r\n\t\t\r\n\t\tif(this.sTipoReporte.equals(\"RELACIONES\")) {//isEsReporteRelaciones\r\n\t\t\t\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\t//FK DEBERIA TRAERSE DE ANTEMANO\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\r\n\t\t//CLASSES PARA REPORTES OBJETOS RELACIONADOS\r\n\t\tif(!this.sTipoReporte.equals(\"RELACIONES\")) {//!isEsReporteRelaciones\r\n\t\t\tclasses=new ArrayList<Classe>();\r\n\t\t}\r\n\t\t\r\n\t\tJRBeanArrayDataSource jrbeanArrayDataSourcePagosAutorizados=null;\r\n\t\t\r\n\t\tif(this.sTipoReporteExtra!=null && !this.sTipoReporteExtra.equals(\"\")) {\r\n\t\t\tPagosAutorizadosConstantesFunciones.S_TIPOREPORTE_EXTRA=this.sTipoReporteExtra;\r\n\t\t} else {\r\n\t\t\tPagosAutorizadosConstantesFunciones.S_TIPOREPORTE_EXTRA=\"\";\r\n\t\t}\r\n\t\t\r\n\t\tjrbeanArrayDataSourcePagosAutorizados=new JRBeanArrayDataSource(PagosAutorizadosJInternalFrame.TraerPagosAutorizadosBeans(pagosautorizadossParaReportes,classes).toArray());\r\n\t\t\r\n\t\tjasperPrint = JasperFillManager.fillReport(jasperReport,parameters,jrbeanArrayDataSourcePagosAutorizados);\r\n\t\t\t\t\r\n\t\t\r\n\t\tString sPathDest=Constantes.SUNIDAD_ARCHIVOS+\":/\"+Constantes.SCONTEXTSERVER+\"/\"+PagosAutorizadosConstantesFunciones.SCHEMA+\"/reportes\";\r\n\t\t\r\n\t\tFile filePathDest = new File(sPathDest);\r\n\t\t\r\n\t\tif(!filePathDest.exists()) {\r\n\t\t\tfilePathDest.mkdirs();\t\t\t\t\r\n\t\t}\r\n\t\t\t\t\r\n\t\tString sDestFileName=sPathDest+\"/\"+PagosAutorizadosConstantesFunciones.CLASSNAME;\r\n\t\t\t\t\r\n\t\tif(this.sTipoArchivoReporte==\"VISUALIZAR\") {\r\n\t\t\tJasperViewer jasperViewer = new JasperViewer(jasperPrint,false) ;\r\n\t\t\tjasperViewer.setVisible(true) ; \r\n\r\n\t\t} else if(this.sTipoArchivoReporte==\"HTML\"||this.sTipoArchivoReporte==\"PDF\"||this.sTipoArchivoReporte==\"XML\") {\t\r\n\t\t\t//JasperFillManager.fillReportToFile(reportFile.getAbsolutePath(),parameters, new JRBeanArrayDataSource(PagosAutorizadosBean.TraerPagosAutorizadosBeans(pagosautorizadossParaReportes).toArray()));\r\n\t\t\t\t\t\t\t\r\n\t\t\tif(this.sTipoArchivoReporte==\"HTML\") {\r\n\t\t\t\tsDestFileName+=\".html\";\r\n\t\t\t\tJasperExportManager.exportReportToHtmlFile(jasperPrint,sDestFileName);\r\n\t\t\t\t\t\r\n\t\t\t} else if(this.sTipoArchivoReporte==\"PDF\") {\r\n\t\t\t\tsDestFileName+=\".pdf\";\r\n\t\t\t\tJasperExportManager.exportReportToPdfFile(jasperPrint,sDestFileName);\r\n\t\t\t} else {\r\n\t\t\t\tsDestFileName+=\".xml\";\r\n\t\t\t\tJasperExportManager.exportReportToXmlFile(jasperPrint,sDestFileName, false);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t} else if(this.sTipoArchivoReporte==\"WORD\"||this.sTipoArchivoReporte==\"EXCEL\") {\r\n\t\t\t\t\r\n\t\t\tif(this.sTipoArchivoReporte==\"WORD\") {\r\n\t\t\t\tsDestFileName+=\".rtf\";\r\n\t\t\t\t\t\r\n\t\t\t\tJRRtfExporter exporter = new JRRtfExporter();\r\n\t\t\r\n\t\t\t\texporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);\r\n\t\t\t\texporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, sDestFileName);\r\n\t\t\r\n\t\t\t\texporter.exportReport();\r\n\t\t\t\t\r\n\t\t\t} else\t{\r\n\t\t\t\tsDestFileName+=\".xls\";\r\n\t\t\t\t\t\r\n\t\t\t\tJRXlsExporter exporterXls = new JRXlsExporter();\r\n\t\t\r\n\t\t\t\texporterXls.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);\r\n\t\t\t\texporterXls.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, sDestFileName);\r\n\t\t\t\texporterXls.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE);\r\n\t\t\r\n\t\t\t\texporterXls.exportReport();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} else if(this.sTipoArchivoReporte==\"EXCEL2\"||this.sTipoArchivoReporte==\"EXCEL2_2\") {\r\n\t\t\t//sDestFileName+=\".xlsx\";\r\n\t\t\t\r\n\t\t\tif(this.sTipoReporte.equals(\"NORMAL\")) {\r\n\t\t\t\tthis.generarExcelReportePagosAutorizadoss(sAccionBusqueda,sTipoArchivoReporte,pagosautorizadossParaReportes);\r\n\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"FORMULARIO\")){\r\n\t\t\t\tthis.generarExcelReporteVerticalPagosAutorizadoss(sAccionBusqueda,sTipoArchivoReporte,pagosautorizadossParaReportes,false);\r\n\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"DINAMICO\")){\r\n\t\t\t\t\r\n\t\t\t\tif(this.sTipoReporteDinamico.equals(\"NORMAL\")) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.jButtonGenerarExcelReporteDinamicoPagosAutorizadosActionPerformed(null);\r\n\t\t\t\t\t//this.generarExcelReportePagosAutorizadoss(sAccionBusqueda,sTipoArchivoReporte,pagosautorizadossParaReportes);\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t} else if(this.sTipoReporteDinamico.equals(\"FORMULARIO\")){\r\n\t\t\t\t\tthis.generarExcelReporteVerticalPagosAutorizadoss(sAccionBusqueda,sTipoArchivoReporte,pagosautorizadossParaReportes,true);\r\n\t\t\t\t\r\n\t\t\t\t} else if(this.sTipoReporteDinamico.equals(\"RELACIONES\")){\r\n\t\t\t\t\tthis.generarExcelReporteRelacionesPagosAutorizadoss(sAccionBusqueda,sTipoArchivoReporte,pagosautorizadossParaReportes,true);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"RELACIONES\")){\r\n\t\t\t\tthis.generarExcelReporteRelacionesPagosAutorizadoss(sAccionBusqueda,sTipoArchivoReporte,pagosautorizadossParaReportes,false);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(this.sTipoArchivoReporte==\"HTML\"||this.sTipoArchivoReporte==\"PDF\"||this.sTipoArchivoReporte==\"XML\"||this.sTipoArchivoReporte==\"WORD\"||this.sTipoArchivoReporte==\"EXCEL\") {\t\t\t\t\r\n\t\t\tJOptionPane.showMessageDialog(this,\"REPORTE \"+sDestFileName+\" GENERADO SATISFACTORIAMENTE\",\"REPORTES \",JOptionPane.INFORMATION_MESSAGE);\r\n\t\t}\r\n\t}", "private void GetDetailAnalysisText() {\n\t\tMap<Integer, ArrayList<ReportPluDayComboModifier>> combMap = getCombItemMap(this.comb);\n\n\t\tComparatorPluDayItem comparatorPluDayItem = new ComparatorPluDayItem();\n\t\tCollections.sort(reportPluDayItems, comparatorPluDayItem);\n//\t\tList<ReportPluDayItem> cop = new ArrayList<ReportPluDayItem>();\n\t\tint allQty = 0;\n\t\tBigDecimal allAmount = BH.getBD(ParamConst.DOUBLE_ZERO);\n//\t\t\tboolean showMainCategory = true;\n//\t\t\tint mainCategoryId = 0;\n\t\tboolean lastLinePrinted = false;\n//\t\tBigDecimal categoryAmount = BH.getBD(ParamConst.DOUBLE_ZERO);\n//\t\tString name = \"\";\n//\t\tint id = 0;\n\t\tMap<Integer, ReportPluDayItem> map = new HashMap<Integer, ReportPluDayItem>();\n\t\tfor (int j = 0; j < reportPluDayItems.size(); j++) {\n\n\t\t\tReportPluDayItem reportPluDayItem = reportPluDayItems.get(j);\n\t\t\t//ObjectFactory.getInstance().getReportPluDayItem(reportPluDayItem);\n\t\t\tif(map.containsKey(reportPluDayItem.getItemMainCategoryId().intValue())){\n\t\t\t\tReportPluDayItem amountReportPluDayItem = map.get(reportPluDayItem.getItemMainCategoryId().intValue());\n\t\t\t\tBigDecimal amount = BH.add(BH.getBD(amountReportPluDayItem.getItemAmount()), BH.getBD(reportPluDayItem.getItemAmount()), false);\n\t\t\t\tamountReportPluDayItem.setItemAmount(amount.toString());\n\t\t\t}else{\n\t\t\t\tReportPluDayItem rr = new ReportPluDayItem();\n\t\t\t\trr.setItemMainCategoryId(reportPluDayItem.getItemMainCategoryId());\n\t\t\t\trr.setItemMainCategoryName(reportPluDayItem.getItemMainCategoryName());\n\t\t\t\trr.setItemAmount(BH.formatMoney(reportPluDayItem.getItemAmount()));\n\t\t\t\tmap.put(reportPluDayItem.getItemMainCategoryId().intValue(), rr);\n\t\t\t}\n//\t\t\t\tif(mainCategoryId == 0 || mainCategoryId == reportPluDayItem.getItemMainCategoryId().intValue()){\n//\t\t\t\t\tcategoryAmount = BH.add(categoryAmount,\n//\t\t\t\t\t\t\tBH.getBD(reportPluDayItem.getItemAmount()), true);\n//\t\t\t\t\tname = reportPluDayItem.getItemMainCategoryName();\n//\t\t\t\t\tid = reportPluDayItem.getItemMainCategoryId().intValue();\n//\n//\t\t\t\t\tif(mainCategoryId == 0)\n//\t\t\t\t\t\tmainCategoryId = id;\n//\n//\t\t\t\t\tif( j == reportPluDayItems.size() - 1){\n//\t\t\t\t\t\tReportPluDayItem rr = new ReportPluDayItem();\n//\t\t\t\t\t\trr.setItemMainCategoryId(id);\n//\t\t\t\t\t\trr.setItemMainCategoryName(name);\n//\t\t\t\t\t\trr.setItemAmount(categoryAmount.toString());\n//\t\t\t\t\t\tcop.add(rr);\n//\t\t\t\t\t}\n//\t\t\t\t}else{\n//\t\t\t\t\tReportPluDayItem rr = new ReportPluDayItem();\n//\t\t\t\t\trr.setItemMainCategoryId(id);\n//\t\t\t\t\trr.setItemMainCategoryName(name);\n//\t\t\t\t\trr.setItemAmount(categoryAmount.toString());\n//\t\t\t\t\tcop.add(rr);\n//\t\t\t\t\tname = reportPluDayItem.getItemMainCategoryName();\n//\t\t\t\t\tid = reportPluDayItem.getItemMainCategoryId().intValue();\n//\t\t\t\t\tmainCategoryId = id;\n//\t\t\t\t\tcategoryAmount = BH.getBD(ParamConst.DOUBLE_ZERO);\n//\t\t\t\t\tcategoryAmount = BH.add(categoryAmount,\n//\t\t\t\t\t\t\tBH.getBD(reportPluDayItem.getItemAmount()), true);\n//\n//\t\t\t\t}\n\t\t}\n\n\t\tIterator<Map.Entry<Integer, ReportPluDayItem>> entries = map.entrySet().iterator();\n\t\tboolean isFirst = true;\n\t\twhile (entries.hasNext()){\n\t\t\tMap.Entry<Integer, ReportPluDayItem> entry = entries.next();\n\t\t\tif(!isFirst){\n\t\t\t\tthis.addHortionalLine(this.charSize);\n\t\t\t}\n\t\t\tisFirst = false;\n\t\t\tReportPluDayItem amontReportPluDayItem = entry.getValue();\n\t\t\tthis.AddItem(amontReportPluDayItem.getItemMainCategoryName(), \"\", \"\", BH.formatMoney(amontReportPluDayItem.getItemAmount()).toString(), 1);\n\t\t\tthis.addHortionalLine(this.charSize);\n\t\t\tfor (int j = 0; j < reportPluDayItems.size(); j++) {\n\n\t\t\t\tReportPluDayItem reportPluDayItem = reportPluDayItems.get(j);\n\t\t\t\tif (amontReportPluDayItem.getItemMainCategoryId().intValue() == reportPluDayItem.getItemMainCategoryId().intValue()) {\n\t\t\t\t\t// Print comb modifier\n\t\t\t\t\tint itmId = reportPluDayItem.getItemDetailId().intValue();\n\t\t\t\t\tArrayList<ReportPluDayComboModifier> comItems = combMap.get(itmId);\n\t\t\t\t\tif (comItems != null && comItems.size() > 0) {\n\n\t\t\t\t\t\tint mm = 0;\n\t\t\t\t\t\tthis.AddItem(\" \"+reportPluDayItem.getItemName(), BH.formatMoney(reportPluDayItem.getItemPrice()),\n\t\t\t\t\t\t\t\treportPluDayItem.getItemCount().toString(),\n\t\t\t\t\t\t\t\tBH.formatThree(reportPluDayItem.getItemAmount()), 1);\n\t\t\t\t\t\tlastLinePrinted = false;\n\t\t\t\t\t\tthis.addHortionalLine(this.charSize);\n\t\t\t\t\t\tfor (mm = 0; mm < comItems.size(); mm++) {\n\t\t\t\t\t\t\tReportPluDayComboModifier pluModifier = comItems.get(mm);\n\t\t\t\t\t\t\tint count = pluModifier.getModifierCount().intValue() - pluModifier.getVoidModifierCount().intValue() - pluModifier.getBillVoidCount().intValue();\n\t\t\t\t\t\t\tif (count > 0) {\n\t\t\t\t\t\t\t\tBigDecimal modifierAmount = BH.mul(BH.getBD(1.00), BH.getBD(pluModifier.getModifierPrice()), true);\n\t\t\t\t\t\t\t\tBigDecimal modifierPrice = BH.mul(BH.getBD(1.00), BH.getBD(pluModifier.getModifierItemPrice()), true);\n\t\t\t\t\t\t\t\tthis.AddItem(\" (\" + pluModifier.getModifierName() + \")\",\n\t\t\t\t\t\t\t\t\t\t\"(\" + BH.formatThree(modifierPrice.toString()) + \")\", \"(\" + String.valueOf(count) + \")\", \"(\" + BH.formatThree(modifierAmount.toString())+ \")\", 1);\n\t\t\t\t\t\t\t\tlastLinePrinted = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (mm == comItems.size() && mm > 0) {\n\t\t\t\t\t\t\tif (!lastLinePrinted)\n\t\t\t\t\t\t\t\tthis.addHortionalLine(this.charSize);\n\t\t\t\t\t\t\tlastLinePrinted = true;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t} else {\n\n\t\t\t\t\t\tthis.AddItem(\" \"+reportPluDayItem.getItemName(), BH.formatMoney(reportPluDayItem.getItemPrice()),\n\t\t\t\t\t\t\t\treportPluDayItem.getItemCount().toString(), \"\" + BH.formatMoney(reportPluDayItem.getItemAmount()), 1);\n\t\t\t\t\t\tlastLinePrinted = false;\n\t\t\t\t\t}\n\t\t\t\t\t//END Comb modifier print\n\t\t\t\t\tallQty += reportPluDayItem.getItemCount();\n\t\t\t\t\tallAmount = BH.add(allAmount,\n\t\t\t\t\t\t\tBH.getBD(reportPluDayItem.getItemAmount()), true);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n//\t\tfor(ReportPluDayItem category : cop) {\n//\t\t\t\tif(cop.indexOf(category) != 0){\n//\t\t\t\t\tthis.addHortionalLine(this.charSize);\n//\t\t\t\t}\n//\t\t\t\tthis.AddItem(category.getItemMainCategoryName(), \"\", \"\", category.getItemAmount(), 1);\n//\t\t\t\tthis.addHortionalLine(this.charSize);\n//\t\t\t\tfor (int j = 0; j < reportPluDayItems.size(); j++) {\n//\n//\t\t\t\t\tReportPluDayItem reportPluDayItem = reportPluDayItems.get(j);\n////\t\t\t\t\tif (mainCategoryId != reportPluDayItem.getItemMainCategoryId().intValue()) {\n////\t\t\t\t\t\tif (mainCategoryId != 0) {\n////\t\t\t\t\t\t\tif (!lastLinePrinted)\n////\t\t\t\t\t\t\t\tthis.addHortionalLine(this.charSize);\n////\t\t\t\t\t\t\tlastLinePrinted = true;\n////\t\t\t\t\t\t}\n////\t\t\t\t\t\tmainCategoryId = reportPluDayItem.getItemMainCategoryId().intValue();\n////\t\t\t\t\t\tshowMainCategory = true;\n////\t\t\t\t\t}\n////\t\t\t\t\tif (showMainCategory) {\n////\t\t\t\t\t\tthis.AddItem(reportPluDayItem.getItemMainCategoryName(), \"\", \"\", \"\", 1);\n////\t\t\t\t\t\tthis.addHortionalLine(this.charSize);\n////\t\t\t\t\t\tshowMainCategory = false;\n////\t\t\t\t\t\tlastLinePrinted = true;\n////\t\t\t\t\t}\n//\t\t\t\t\tif (category.getItemMainCategoryId().intValue() == reportPluDayItem.getItemMainCategoryId().intValue()) {\n//\t\t\t\t\t\t//Bob: Print comb modifier\n//\t\t\t\t\t\tint itmId = reportPluDayItem.getItemDetailId().intValue();\n//\t\t\t\t\t\tArrayList<ReportPluDayComboModifier> comItems = combMap.get(itmId);\n//\t\t\t\t\t\tif (comItems != null && comItems.size() > 0) {\n//\n//\t\t\t\t\t\t\tint mm = 0;\n//\t\t\t\t\t\t\tthis.AddItem(\" \"+reportPluDayItem.getItemName(), reportPluDayItem.getItemPrice(),\n//\t\t\t\t\t\t\t\t\treportPluDayItem.getItemCount().toString(),\n//\t\t\t\t\t\t\t\t\treportPluDayItem.getItemAmount(), 1);\n//\t\t\t\t\t\t\tlastLinePrinted = false;\n//\t\t\t\t\t\t\tthis.addHortionalLine(this.charSize);\n//\t\t\t\t\t\t\tfor (mm = 0; mm < comItems.size(); mm++) {\n//\t\t\t\t\t\t\t\tReportPluDayComboModifier pluModifier = comItems.get(mm);\n//\t\t\t\t\t\t\t\tint count = pluModifier.getModifierCount().intValue() - pluModifier.getVoidModifierCount().intValue() - pluModifier.getBillVoidCount().intValue();\n//\t\t\t\t\t\t\t\tif (count > 0) {\n//\t\t\t\t\t\t\t\t\tBigDecimal modifierAmount = BH.mul(BH.getBD(1.00), BH.getBD(pluModifier.getModifierPrice()), true);\n//\t\t\t\t\t\t\t\t\tBigDecimal modifierPrice = BH.mul(BH.getBD(1.00), BH.getBD(pluModifier.getModifierItemPrice()), true);\n//\t\t\t\t\t\t\t\t\tthis.AddItem(\" (\" + pluModifier.getModifierName() + \")\",\n//\t\t\t\t\t\t\t\t\t\t\t\"(\" + modifierPrice.toString() + \")\", \"(\" + String.valueOf(count) + \")\", \"(\" + modifierAmount.toString() + \")\", 1);\n//\t\t\t\t\t\t\t\t\tlastLinePrinted = false;\n//\t\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\t}\n//\t\t\t\t\t\t\tif (mm == comItems.size() && mm > 0) {\n//\t\t\t\t\t\t\t\tif (!lastLinePrinted)\n//\t\t\t\t\t\t\t\t\tthis.addHortionalLine(this.charSize);\n//\t\t\t\t\t\t\t\tlastLinePrinted = true;\n//\t\t\t\t\t\t\t}\n//\n//\t\t\t\t\t\t} else {\n//\n//\t\t\t\t\t\t\tthis.AddItem(\" \"+reportPluDayItem.getItemName(), reportPluDayItem.getItemPrice(),\n//\t\t\t\t\t\t\t\t\treportPluDayItem.getItemCount().toString(), \"\" + reportPluDayItem.getItemAmount(), 1);\n//\t\t\t\t\t\t\tlastLinePrinted = false;\n//\t\t\t\t\t\t}\n//\t\t\t\t\t\t//END Comb modifier print\n//\t\t\t\t\t\tallQty += reportPluDayItem.getItemCount();\n//\t\t\t\t\t\tallAmount = BH.add(allAmount,\n//\t\t\t\t\t\t\t\tBH.getBD(reportPluDayItem.getItemAmount()), true);\n//\t\t\t\t\t}\n//\t\t\t\t}\n//\t\t\t}\n\t\tif (allQty != 0) {\n\t\t\tthis.addHortionalLine(this.charSize);\n\t\t\tthis.AddItem(PrintService.instance.getResources().getString(R.string.total), \"\", allQty + \"\", BH.formatMoney(allAmount.toString()), 1);\n\t\t}\n\n\n\t}", "public void generarReporteLiquidacionImpuestoImpors(String sAccionBusqueda,List<LiquidacionImpuestoImpor> liquidacionimpuestoimporsParaReportes) throws Exception {\n\t\tLong iIdUsuarioSesion=0L;\t\r\n\t\t\r\n\t\t\r\n\t\tif(usuarioActual==null) {\r\n\t\t\tthis.usuarioActual=new Usuario();\r\n\t\t}\r\n\t\t\r\n\t\tiIdUsuarioSesion=usuarioActual.getId();\r\n\t\t\r\n\t\tString sPathReportes=\"\";\r\n\t\t\r\n\t\tInputStream reportFile=null;\r\n\t\tInputStream imageFile=null;\r\n\t\t\t\r\n\t\timageFile=AuxiliarImagenes.class.getResourceAsStream(\"LogoReporte.jpg\");\t\t\t\r\n\t\t\t\t\r\n\t\t\r\n\t\tString sPathReporteFinal=\"\";\r\n\t\t\r\n\t\tif(!esReporteAccionProceso) {\r\n\t\t\tif(!this.sTipoReporte.equals(\"RELACIONES\")) {//!isEsReporteRelaciones\r\n\t\t\t\tif(!this.esReporteDinamico) {\r\n\t\t\t\t\tsPathReporteFinal=\"LiquidacionImpuestoImpor\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\tsPathReporteFinal=this.sPathReporteDinamico;\r\n\t\t\t\t\treportFile = new FileInputStream(sPathReporteFinal);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tsPathReporteFinal=\"LiquidacionImpuestoImporMasterRelaciones\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\r\n\t\t\t\t//sPathReportes=reportFile.getPath().replace(\"LiquidacionImpuestoImporMasterRelacionesDesign.jasper\", \"\");\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t\tsPathReporteFinal=\"LiquidacionImpuestoImpor\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\t\r\n\t\t}\r\n\t\t\r\n\t\tif(reportFile==null) {\r\n\t\t\tthrow new JRRuntimeException(sPathReporteFinal+\" no existe\");\r\n\t\t}\r\n\t\t\r\n\t\tString sUsuario=\"\";\r\n\t\t\r\n\t\tif(usuarioActual!=null) {\r\n\t\t\tsUsuario=usuarioActual.getuser_name();\r\n\t\t}\r\n\t\t\r\n\t\tMap<String, Object> parameters = new HashMap<String, Object>();\r\n\t\tparameters.put(\"usuario\", sUsuario);\r\n\t\t\r\n\t\tparameters.put(\"titulo\", Funciones.GetTituloSistemaReporte(this.parametroGeneralSg,this.moduloActual,this.usuarioActual));\r\n\t\tparameters.put(\"subtitulo\", \"Reporte De Liquidacion Impuesto Impores\");\t\t\r\n\t\tparameters.put(\"busquedapor\", LiquidacionImpuestoImporConstantesFunciones.getNombreIndice(sAccionBusqueda)+sDetalleReporte);\r\n\t\t\r\n\t\t\r\n\t\tif(this.sTipoReporte.equals(\"RELACIONES\")) {//isEsReporteRelaciones\r\n\t\t\tparameters.put(\"SUBREPORT_DIR\", sPathReportes);\r\n\t\t}\r\n\t\t\r\n\t\tparameters.put(\"con_grafico\", this.conGraficoReporte);\r\n\t\t\r\n\t\tJasperReport jasperReport = (JasperReport)JRLoader.loadObject(reportFile);\r\n\t\t\t\t\r\n\t\tthis.cargarDatosCliente();\r\n\t\t\r\n\t\tArrayList<Classe> classes=new ArrayList<Classe>();\t\t\r\n\t\t\r\n\t\tif(this.sTipoReporte.equals(\"RELACIONES\")) {//isEsReporteRelaciones\r\n\t\t\t\r\n\t\t\tclasses.add(new Classe(DetalleLiquidacionImpuestoImpor.class));\r\n\t\t\t\r\n\t\t\t//ARCHITECTURE\r\n\t\t\tif(Constantes.ISUSAEJBLOGICLAYER) {\t\t\r\n\t\t\t\ttry\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\tLiquidacionImpuestoImporLogic liquidacionimpuestoimporLogicAuxiliar=new LiquidacionImpuestoImporLogic();\r\n\t\t\t\t\tliquidacionimpuestoimporLogicAuxiliar.setDatosCliente(liquidacionimpuestoimporLogic.getDatosCliente());\t\t\t\t\r\n\t\t\t\t\tliquidacionimpuestoimporLogicAuxiliar.setLiquidacionImpuestoImpors(liquidacionimpuestoimporsParaReportes);\r\n\t\t\t\t\t\r\n\t\t\t\t\tliquidacionimpuestoimporLogicAuxiliar.cargarRelacionesLoteForeignKeyLiquidacionImpuestoImporWithConnection(); //deepLoadsWithConnection(false, DeepLoadType.INCLUDE, classes, \"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tliquidacionimpuestoimporsParaReportes=liquidacionimpuestoimporLogicAuxiliar.getLiquidacionImpuestoImpors();\r\n\t\t\t\t\t\r\n\t\t\t\t\t//liquidacionimpuestoimporLogic.getNewConnexionToDeep();\r\n\t\t\t\t\t\r\n\t\t\t\t\t//for (LiquidacionImpuestoImpor liquidacionimpuestoimpor:liquidacionimpuestoimporsParaReportes) {\r\n\t\t\t\t\t//\tliquidacionimpuestoimporLogic.deepLoad(liquidacionimpuestoimpor, false, DeepLoadType.INCLUDE, classes);\r\n\t\t\t\t\t//}\t\t\t\t\t\t\r\n\t\t\t\t\t//liquidacionimpuestoimporLogic.commitNewConnexionToDeep();\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t} catch(Exception e) {\r\n\t\t\t\t\tthrow e;\r\n\t\t\t\t\t\r\n\t\t\t\t} finally {\r\n\t\t\t\t\t//liquidacionimpuestoimporLogic.closeNewConnexionToDeep();\r\n\t\t\t\t}\r\n\t\t\t} else if(Constantes.ISUSAEJBREMOTE) {\r\n\t\t\t} else if(Constantes.ISUSAEJBHOME) {\r\n\t\t\t}\r\n\t\t\t//ARCHITECTURE\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\r\n\t\t\tInputStream reportFileDetalleLiquidacionImpuestoImpor = AuxiliarReportes.class.getResourceAsStream(\"DetalleLiquidacionImpuestoImporDetalleRelacionesDesign.jasper\");\r\n\t\t\tparameters.put(\"subreport_detalleliquidacionimpuestoimpor\", reportFileDetalleLiquidacionImpuestoImpor);\r\n\t\t} else {\r\n\t\t\t//FK DEBERIA TRAERSE DE ANTEMANO\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\r\n\t\t//CLASSES PARA REPORTES OBJETOS RELACIONADOS\r\n\t\tif(!this.sTipoReporte.equals(\"RELACIONES\")) {//!isEsReporteRelaciones\r\n\t\t\tclasses=new ArrayList<Classe>();\r\n\t\t}\r\n\t\t\r\n\t\tJRBeanArrayDataSource jrbeanArrayDataSourceLiquidacionImpuestoImpor=null;\r\n\t\t\r\n\t\tif(this.sTipoReporteExtra!=null && !this.sTipoReporteExtra.equals(\"\")) {\r\n\t\t\tLiquidacionImpuestoImporConstantesFunciones.S_TIPOREPORTE_EXTRA=this.sTipoReporteExtra;\r\n\t\t} else {\r\n\t\t\tLiquidacionImpuestoImporConstantesFunciones.S_TIPOREPORTE_EXTRA=\"\";\r\n\t\t}\r\n\t\t\r\n\t\tjrbeanArrayDataSourceLiquidacionImpuestoImpor=new JRBeanArrayDataSource(LiquidacionImpuestoImporJInternalFrame.TraerLiquidacionImpuestoImporBeans(liquidacionimpuestoimporsParaReportes,classes).toArray());\r\n\t\t\r\n\t\tjasperPrint = JasperFillManager.fillReport(jasperReport,parameters,jrbeanArrayDataSourceLiquidacionImpuestoImpor);\r\n\t\t\t\t\r\n\t\t\r\n\t\tString sPathDest=Constantes.SUNIDAD_ARCHIVOS+\":/\"+Constantes.SCONTEXTSERVER+\"/\"+LiquidacionImpuestoImporConstantesFunciones.SCHEMA+\"/reportes\";\r\n\t\t\r\n\t\tFile filePathDest = new File(sPathDest);\r\n\t\t\r\n\t\tif(!filePathDest.exists()) {\r\n\t\t\tfilePathDest.mkdirs();\t\t\t\t\r\n\t\t}\r\n\t\t\t\t\r\n\t\tString sDestFileName=sPathDest+\"/\"+LiquidacionImpuestoImporConstantesFunciones.CLASSNAME;\r\n\t\t\t\t\r\n\t\tif(this.sTipoArchivoReporte==\"VISUALIZAR\") {\r\n\t\t\tJasperViewer jasperViewer = new JasperViewer(jasperPrint,false) ;\r\n\t\t\tjasperViewer.setVisible(true) ; \r\n\r\n\t\t} else if(this.sTipoArchivoReporte==\"HTML\"||this.sTipoArchivoReporte==\"PDF\"||this.sTipoArchivoReporte==\"XML\") {\t\r\n\t\t\t//JasperFillManager.fillReportToFile(reportFile.getAbsolutePath(),parameters, new JRBeanArrayDataSource(LiquidacionImpuestoImporBean.TraerLiquidacionImpuestoImporBeans(liquidacionimpuestoimporsParaReportes).toArray()));\r\n\t\t\t\t\t\t\t\r\n\t\t\tif(this.sTipoArchivoReporte==\"HTML\") {\r\n\t\t\t\tsDestFileName+=\".html\";\r\n\t\t\t\tJasperExportManager.exportReportToHtmlFile(jasperPrint,sDestFileName);\r\n\t\t\t\t\t\r\n\t\t\t} else if(this.sTipoArchivoReporte==\"PDF\") {\r\n\t\t\t\tsDestFileName+=\".pdf\";\r\n\t\t\t\tJasperExportManager.exportReportToPdfFile(jasperPrint,sDestFileName);\r\n\t\t\t} else {\r\n\t\t\t\tsDestFileName+=\".xml\";\r\n\t\t\t\tJasperExportManager.exportReportToXmlFile(jasperPrint,sDestFileName, false);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t} else if(this.sTipoArchivoReporte==\"WORD\"||this.sTipoArchivoReporte==\"EXCEL\") {\r\n\t\t\t\t\r\n\t\t\tif(this.sTipoArchivoReporte==\"WORD\") {\r\n\t\t\t\tsDestFileName+=\".rtf\";\r\n\t\t\t\t\t\r\n\t\t\t\tJRRtfExporter exporter = new JRRtfExporter();\r\n\t\t\r\n\t\t\t\texporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);\r\n\t\t\t\texporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, sDestFileName);\r\n\t\t\r\n\t\t\t\texporter.exportReport();\r\n\t\t\t\t\r\n\t\t\t} else\t{\r\n\t\t\t\tsDestFileName+=\".xls\";\r\n\t\t\t\t\t\r\n\t\t\t\tJRXlsExporter exporterXls = new JRXlsExporter();\r\n\t\t\r\n\t\t\t\texporterXls.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);\r\n\t\t\t\texporterXls.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, sDestFileName);\r\n\t\t\t\texporterXls.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE);\r\n\t\t\r\n\t\t\t\texporterXls.exportReport();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} else if(this.sTipoArchivoReporte==\"EXCEL2\"||this.sTipoArchivoReporte==\"EXCEL2_2\") {\r\n\t\t\t//sDestFileName+=\".xlsx\";\r\n\t\t\t\r\n\t\t\tif(this.sTipoReporte.equals(\"NORMAL\")) {\r\n\t\t\t\tthis.generarExcelReporteLiquidacionImpuestoImpors(sAccionBusqueda,sTipoArchivoReporte,liquidacionimpuestoimporsParaReportes);\r\n\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"FORMULARIO\")){\r\n\t\t\t\tthis.generarExcelReporteVerticalLiquidacionImpuestoImpors(sAccionBusqueda,sTipoArchivoReporte,liquidacionimpuestoimporsParaReportes,false);\r\n\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"DINAMICO\")){\r\n\t\t\t\t\r\n\t\t\t\tif(this.sTipoReporteDinamico.equals(\"NORMAL\")) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.jButtonGenerarExcelReporteDinamicoLiquidacionImpuestoImporActionPerformed(null);\r\n\t\t\t\t\t//this.generarExcelReporteLiquidacionImpuestoImpors(sAccionBusqueda,sTipoArchivoReporte,liquidacionimpuestoimporsParaReportes);\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t} else if(this.sTipoReporteDinamico.equals(\"FORMULARIO\")){\r\n\t\t\t\t\tthis.generarExcelReporteVerticalLiquidacionImpuestoImpors(sAccionBusqueda,sTipoArchivoReporte,liquidacionimpuestoimporsParaReportes,true);\r\n\t\t\t\t\r\n\t\t\t\t} else if(this.sTipoReporteDinamico.equals(\"RELACIONES\")){\r\n\t\t\t\t\tthis.generarExcelReporteRelacionesLiquidacionImpuestoImpors(sAccionBusqueda,sTipoArchivoReporte,liquidacionimpuestoimporsParaReportes,true);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"RELACIONES\")){\r\n\t\t\t\tthis.generarExcelReporteRelacionesLiquidacionImpuestoImpors(sAccionBusqueda,sTipoArchivoReporte,liquidacionimpuestoimporsParaReportes,false);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(this.sTipoArchivoReporte==\"HTML\"||this.sTipoArchivoReporte==\"PDF\"||this.sTipoArchivoReporte==\"XML\"||this.sTipoArchivoReporte==\"WORD\"||this.sTipoArchivoReporte==\"EXCEL\") {\t\t\t\t\r\n\t\t\tJOptionPane.showMessageDialog(this,\"REPORTE \"+sDestFileName+\" GENERADO SATISFACTORIAMENTE\",\"REPORTES \",JOptionPane.INFORMATION_MESSAGE);\r\n\t\t}\r\n\t}", "public void generarReporteUtilidadTipoPrecios(String sAccionBusqueda,List<UtilidadTipoPrecio> utilidadtipopreciosParaReportes) throws Exception {\n\t\tLong iIdUsuarioSesion=0L;\t\r\n\t\t\r\n\t\t\r\n\t\tif(usuarioActual==null) {\r\n\t\t\tthis.usuarioActual=new Usuario();\r\n\t\t}\r\n\t\t\r\n\t\tiIdUsuarioSesion=usuarioActual.getId();\r\n\t\t\r\n\t\tString sPathReportes=\"\";\r\n\t\t\r\n\t\tInputStream reportFile=null;\r\n\t\tInputStream imageFile=null;\r\n\t\t\t\r\n\t\timageFile=AuxiliarImagenes.class.getResourceAsStream(\"LogoReporte.jpg\");\t\t\t\r\n\t\t\t\t\r\n\t\t\r\n\t\tString sPathReporteFinal=\"\";\r\n\t\t\r\n\t\tif(!esReporteAccionProceso) {\r\n\t\t\tif(!this.sTipoReporte.equals(\"RELACIONES\")) {//!isEsReporteRelaciones\r\n\t\t\t\tif(!this.esReporteDinamico) {\r\n\t\t\t\t\tsPathReporteFinal=\"UtilidadTipoPrecio\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\tsPathReporteFinal=this.sPathReporteDinamico;\r\n\t\t\t\t\treportFile = new FileInputStream(sPathReporteFinal);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tsPathReporteFinal=\"UtilidadTipoPrecioMasterRelaciones\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\r\n\t\t\t\t//sPathReportes=reportFile.getPath().replace(\"UtilidadTipoPrecioMasterRelacionesDesign.jasper\", \"\");\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t\tsPathReporteFinal=\"UtilidadTipoPrecio\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\t\r\n\t\t}\r\n\t\t\r\n\t\tif(reportFile==null) {\r\n\t\t\tthrow new JRRuntimeException(sPathReporteFinal+\" no existe\");\r\n\t\t}\r\n\t\t\r\n\t\tString sUsuario=\"\";\r\n\t\t\r\n\t\tif(usuarioActual!=null) {\r\n\t\t\tsUsuario=usuarioActual.getuser_name();\r\n\t\t}\r\n\t\t\r\n\t\tMap<String, Object> parameters = new HashMap<String, Object>();\r\n\t\tparameters.put(\"usuario\", sUsuario);\r\n\t\t\r\n\t\tparameters.put(\"titulo\", Funciones.GetTituloSistemaReporte(this.parametroGeneralSg,this.moduloActual,this.usuarioActual));\r\n\t\tparameters.put(\"subtitulo\", \"Reporte De Utilidad Tipo Precioes\");\t\t\r\n\t\tparameters.put(\"busquedapor\", UtilidadTipoPrecioConstantesFunciones.getNombreIndice(sAccionBusqueda)+sDetalleReporte);\r\n\t\t\r\n\t\t\r\n\t\tif(this.sTipoReporte.equals(\"RELACIONES\")) {//isEsReporteRelaciones\r\n\t\t\tparameters.put(\"SUBREPORT_DIR\", sPathReportes);\r\n\t\t}\r\n\t\t\r\n\t\tparameters.put(\"con_grafico\", this.conGraficoReporte);\r\n\t\t\r\n\t\tJasperReport jasperReport = (JasperReport)JRLoader.loadObject(reportFile);\r\n\t\t\t\t\r\n\t\tthis.cargarDatosCliente();\r\n\t\t\r\n\t\tArrayList<Classe> classes=new ArrayList<Classe>();\t\t\r\n\t\t\r\n\t\tif(this.sTipoReporte.equals(\"RELACIONES\")) {//isEsReporteRelaciones\r\n\t\t\t\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\t//FK DEBERIA TRAERSE DE ANTEMANO\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\r\n\t\t//CLASSES PARA REPORTES OBJETOS RELACIONADOS\r\n\t\tif(!this.sTipoReporte.equals(\"RELACIONES\")) {//!isEsReporteRelaciones\r\n\t\t\tclasses=new ArrayList<Classe>();\r\n\t\t}\r\n\t\t\r\n\t\tJRBeanArrayDataSource jrbeanArrayDataSourceUtilidadTipoPrecio=null;\r\n\t\t\r\n\t\tif(this.sTipoReporteExtra!=null && !this.sTipoReporteExtra.equals(\"\")) {\r\n\t\t\tUtilidadTipoPrecioConstantesFunciones.S_TIPOREPORTE_EXTRA=this.sTipoReporteExtra;\r\n\t\t} else {\r\n\t\t\tUtilidadTipoPrecioConstantesFunciones.S_TIPOREPORTE_EXTRA=\"\";\r\n\t\t}\r\n\t\t\r\n\t\tjrbeanArrayDataSourceUtilidadTipoPrecio=new JRBeanArrayDataSource(UtilidadTipoPrecioJInternalFrame.TraerUtilidadTipoPrecioBeans(utilidadtipopreciosParaReportes,classes).toArray());\r\n\t\t\r\n\t\tjasperPrint = JasperFillManager.fillReport(jasperReport,parameters,jrbeanArrayDataSourceUtilidadTipoPrecio);\r\n\t\t\t\t\r\n\t\t\r\n\t\tString sPathDest=Constantes.SUNIDAD_ARCHIVOS+\":/\"+Constantes.SCONTEXTSERVER+\"/\"+UtilidadTipoPrecioConstantesFunciones.SCHEMA+\"/reportes\";\r\n\t\t\r\n\t\tFile filePathDest = new File(sPathDest);\r\n\t\t\r\n\t\tif(!filePathDest.exists()) {\r\n\t\t\tfilePathDest.mkdirs();\t\t\t\t\r\n\t\t}\r\n\t\t\t\t\r\n\t\tString sDestFileName=sPathDest+\"/\"+UtilidadTipoPrecioConstantesFunciones.CLASSNAME;\r\n\t\t\t\t\r\n\t\tif(this.sTipoArchivoReporte==\"VISUALIZAR\") {\r\n\t\t\tJasperViewer jasperViewer = new JasperViewer(jasperPrint,false) ;\r\n\t\t\tjasperViewer.setVisible(true) ; \r\n\r\n\t\t} else if(this.sTipoArchivoReporte==\"HTML\"||this.sTipoArchivoReporte==\"PDF\"||this.sTipoArchivoReporte==\"XML\") {\t\r\n\t\t\t//JasperFillManager.fillReportToFile(reportFile.getAbsolutePath(),parameters, new JRBeanArrayDataSource(UtilidadTipoPrecioBean.TraerUtilidadTipoPrecioBeans(utilidadtipopreciosParaReportes).toArray()));\r\n\t\t\t\t\t\t\t\r\n\t\t\tif(this.sTipoArchivoReporte==\"HTML\") {\r\n\t\t\t\tsDestFileName+=\".html\";\r\n\t\t\t\tJasperExportManager.exportReportToHtmlFile(jasperPrint,sDestFileName);\r\n\t\t\t\t\t\r\n\t\t\t} else if(this.sTipoArchivoReporte==\"PDF\") {\r\n\t\t\t\tsDestFileName+=\".pdf\";\r\n\t\t\t\tJasperExportManager.exportReportToPdfFile(jasperPrint,sDestFileName);\r\n\t\t\t} else {\r\n\t\t\t\tsDestFileName+=\".xml\";\r\n\t\t\t\tJasperExportManager.exportReportToXmlFile(jasperPrint,sDestFileName, false);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t} else if(this.sTipoArchivoReporte==\"WORD\"||this.sTipoArchivoReporte==\"EXCEL\") {\r\n\t\t\t\t\r\n\t\t\tif(this.sTipoArchivoReporte==\"WORD\") {\r\n\t\t\t\tsDestFileName+=\".rtf\";\r\n\t\t\t\t\t\r\n\t\t\t\tJRRtfExporter exporter = new JRRtfExporter();\r\n\t\t\r\n\t\t\t\texporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);\r\n\t\t\t\texporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, sDestFileName);\r\n\t\t\r\n\t\t\t\texporter.exportReport();\r\n\t\t\t\t\r\n\t\t\t} else\t{\r\n\t\t\t\tsDestFileName+=\".xls\";\r\n\t\t\t\t\t\r\n\t\t\t\tJRXlsExporter exporterXls = new JRXlsExporter();\r\n\t\t\r\n\t\t\t\texporterXls.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);\r\n\t\t\t\texporterXls.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, sDestFileName);\r\n\t\t\t\texporterXls.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE);\r\n\t\t\r\n\t\t\t\texporterXls.exportReport();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} else if(this.sTipoArchivoReporte==\"EXCEL2\"||this.sTipoArchivoReporte==\"EXCEL2_2\") {\r\n\t\t\t//sDestFileName+=\".xlsx\";\r\n\t\t\t\r\n\t\t\tif(this.sTipoReporte.equals(\"NORMAL\")) {\r\n\t\t\t\tthis.generarExcelReporteUtilidadTipoPrecios(sAccionBusqueda,sTipoArchivoReporte,utilidadtipopreciosParaReportes);\r\n\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"FORMULARIO\")){\r\n\t\t\t\tthis.generarExcelReporteVerticalUtilidadTipoPrecios(sAccionBusqueda,sTipoArchivoReporte,utilidadtipopreciosParaReportes,false);\r\n\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"DINAMICO\")){\r\n\t\t\t\t\r\n\t\t\t\tif(this.sTipoReporteDinamico.equals(\"NORMAL\")) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.jButtonGenerarExcelReporteDinamicoUtilidadTipoPrecioActionPerformed(null);\r\n\t\t\t\t\t//this.generarExcelReporteUtilidadTipoPrecios(sAccionBusqueda,sTipoArchivoReporte,utilidadtipopreciosParaReportes);\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t} else if(this.sTipoReporteDinamico.equals(\"FORMULARIO\")){\r\n\t\t\t\t\tthis.generarExcelReporteVerticalUtilidadTipoPrecios(sAccionBusqueda,sTipoArchivoReporte,utilidadtipopreciosParaReportes,true);\r\n\t\t\t\t\r\n\t\t\t\t} else if(this.sTipoReporteDinamico.equals(\"RELACIONES\")){\r\n\t\t\t\t\tthis.generarExcelReporteRelacionesUtilidadTipoPrecios(sAccionBusqueda,sTipoArchivoReporte,utilidadtipopreciosParaReportes,true);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"RELACIONES\")){\r\n\t\t\t\tthis.generarExcelReporteRelacionesUtilidadTipoPrecios(sAccionBusqueda,sTipoArchivoReporte,utilidadtipopreciosParaReportes,false);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(this.sTipoArchivoReporte==\"HTML\"||this.sTipoArchivoReporte==\"PDF\"||this.sTipoArchivoReporte==\"XML\"||this.sTipoArchivoReporte==\"WORD\"||this.sTipoArchivoReporte==\"EXCEL\") {\t\t\t\t\r\n\t\t\tJOptionPane.showMessageDialog(this,\"REPORTE \"+sDestFileName+\" GENERADO SATISFACTORIAMENTE\",\"REPORTES \",JOptionPane.INFORMATION_MESSAGE);\r\n\t\t}\r\n\t}", "public void btnGenerarReporteDestruccionPDF() {\n try {\n byte[] bytesFile;\n bytesFile = null;\n Map parameters = new HashMap();\n\n parameters.put(\"rfc\", produccionCigarrosHelper.getTabacalera().getRfc());\n parameters.put(\"incidencia\", \"Desperdicios y destrucción\");\n parameters.put(\"fecha\", new Date());\n parameters.put(\"folio\", desperdiciosHelper.getIdAcuseRecibo());\n parameters.put(\"cadenaOriginal\", firmaFormHelper.getCadenaOriginal());\n parameters.put(\"selloDigital\", selloDigital.generaSelloDigital(firmaFormHelper.getCadenaOriginal()));\n parameters.put(\"codigo_qr\", QRCodeUtil.getQr(desperdiciosHelper.getIdAcuseRecibo(), produccionCigarrosHelper.getTabacalera().getRfc(), Constantes.CINCUENTA, Constantes.CINCUENTA, Constantes.ARCHIVO_PNG));\n\n if (reporterService != null) {\n bytesFile = reporterService.makeReport(ReportesTabacosEnum.REPORTE_ACUSE_DESPERDICIO_DESTRUCCION, ARCHIVO_PDF, parameters, null);\n if (bytesFile != null) {\n generaDocumento(bytesFile, MIMETypesEnum.PDF, \"AcuseDescargapDesperdiciosDestruccion_\" + desperdiciosHelper.getIdAcuseRecibo(), FileExtensionEnum.PDF);\n }\n }\n } catch (ReporterJasperException e) {\n super.addErrorMessage(ERROR, \"Error al generar el acuse\");\n LOGGER.error(\"Error al generar el Reporte en PDF\" + e.getMessage());\n } catch (QRCodeUtilException ex) {\n super.addErrorMessage(ERROR, \"Error al generar el acuse\");\n LOGGER.error(\"Error al generar el Reporte en PDF\" + ex.getMessage());\n } catch (SelloDigitalException ex) {\n super.addErrorMessage(ERROR, \"Error al generar el acuse\");\n LOGGER.error(\"Error al generar el Reporte en PDF\" + ex.getMessage());\n }\n\n }", "@Override\r\n public void aceptarReporte() {\n if (rep_reporte.getReporteSelecionado().equals(\"Libro Diario\")) {\r\n if (rep_reporte.isVisible()) {\r\n parametro = new HashMap();\r\n rep_reporte.cerrar();\r\n sec_rango_reporte.setMultiple(true);\r\n sec_rango_reporte.dibujar();\r\n utilitario.addUpdate(\"rep_reporte,sec_rango_reporte\");\r\n\r\n } else if (sec_rango_reporte.isVisible()) {\r\n String estado = \"\" + utilitario.getVariable(\"p_con_estado_comprobante_normal\") + \",\" + utilitario.getVariable(\"p_con_estado_comp_inicial\") + \",\" + utilitario.getVariable(\"p_con_estado_comp_final\");\r\n parametro.put(\"fecha_inicio\", sec_rango_reporte.getFecha1());\r\n parametro.put(\"fecha_fin\", sec_rango_reporte.getFecha2());\r\n\r\n parametro.put(\"ide_cneco\", estado);\r\n parametro.put(\"ide_cnlap_haber\", p_con_lugar_haber);\r\n parametro.put(\"ide_cnlap_debe\", p_con_lugar_debe);\r\n sec_rango_reporte.cerrar();\r\n sel_rep.setSeleccionFormatoReporte(parametro, rep_reporte.getPath());\r\n sel_rep.dibujar();\r\n utilitario.addUpdate(\"sel_rep,sec_rango_reporte\");\r\n }\r\n } else if (rep_reporte.getReporteSelecionado().equals(\"Balance General Consolidado\")) {\r\n if (rep_reporte.isVisible()) {\r\n parametro = new HashMap();\r\n rep_reporte.cerrar();\r\n sec_rango_reporte.setMultiple(true);\r\n sec_rango_reporte.dibujar();\r\n utilitario.addUpdate(\"rep_reporte,sec_rango_reporte\");\r\n } else if (sec_rango_reporte.isVisible()) {\r\n if (sec_rango_reporte.getFecha1String() != null && !sec_rango_reporte.getFecha1String().isEmpty()) {\r\n if (sec_rango_reporte.getFecha2String() != null && !sec_rango_reporte.getFecha2String().isEmpty()) {\r\n fecha_fin = sec_rango_reporte.getFecha2String();\r\n fecha_inicio = con.getFechaInicialPeriodo(fecha_fin);\r\n if (fecha_inicio != null && !fecha_inicio.isEmpty()) {\r\n sec_rango_reporte.cerrar();\r\n sel_tab_nivel.dibujar();\r\n utilitario.addUpdate(\"sec_rango_reporte,sel_tab_nivel\");\r\n } else {\r\n utilitario.agregarMensajeError(\"Atencion\", \"El rango de fechas seleccionado no se encuentra en ningun Periodo Contable\");\r\n }\r\n } else {\r\n utilitario.agregarMensajeError(\"Atencion\", \"No ha seleccionado la fecha final\");\r\n }\r\n } else {\r\n utilitario.agregarMensajeError(\"Atencion\", \"No ha seleccionado la fecha inicial\");\r\n }\r\n } else if (sel_tab_nivel.isVisible()) {\r\n if (sel_tab_nivel.getValorSeleccionado() != null) {\r\n System.out.println(\"fecha fin \" + fecha_fin);\r\n parametro.put(\"p_activo\", utilitario.getVariable(\"p_con_tipo_cuenta_activo\"));\r\n parametro.put(\"p_pasivo\", utilitario.getVariable(\"p_con_tipo_cuenta_pasivo\"));\r\n parametro.put(\"p_patrimonio\", utilitario.getVariable(\"p_con_tipo_cuenta_patrimonio\"));\r\n TablaGenerica tab_datos = utilitario.consultar(\"SELECT * FROM sis_empresa e, sis_sucursal s where s.ide_empr=e.ide_empr and s.ide_empr=\" + utilitario.getVariable(\"ide_empr\") + \" and s.ide_sucu=\" + utilitario.getVariable(\"ide_sucu\"));\r\n if (tab_datos.getTotalFilas() > 0) {\r\n parametro.put(\"logo\", tab_datos.getValor(0, \"logo_empr\"));\r\n parametro.put(\"empresa\", tab_datos.getValor(0, \"nom_empr\"));\r\n parametro.put(\"sucursal\", tab_datos.getValor(0, \"nom_sucu\"));\r\n parametro.put(\"direccion\", tab_datos.getValor(0, \"direccion_sucu\"));\r\n parametro.put(\"telefono\", tab_datos.getValor(0, \"telefonos_sucu\"));\r\n parametro.put(\"ruc\", tab_datos.getValor(0, \"identificacion_empr\"));\r\n\r\n }\r\n parametro.put(\"fecha_inicio\", getFormatoFecha(fecha_inicio));\r\n parametro.put(\"fecha_fin\", getFormatoFecha(fecha_fin));\r\n TablaGenerica tab_balance = con.generarBalanceGeneral(true, fecha_inicio, fecha_fin, Integer.parseInt(sel_tab_nivel.getValorSeleccionado()));\r\n parametro.put(\"titulo\", \"BALANCE GENERAL CONSOLIDADO\");\r\n if (tab_balance.getTotalFilas() > 0) {\r\n List lis_totales = con.obtenerTotalesBalanceGeneral(true, fecha_inicio, fecha_fin);\r\n double tot_activo = Double.parseDouble(lis_totales.get(0) + \"\");\r\n double tot_pasivo = Double.parseDouble(lis_totales.get(1) + \"\");\r\n double tot_patrimonio = Double.parseDouble(lis_totales.get(2) + \"\");\r\n double utilidad_perdida = tot_activo - tot_pasivo - tot_patrimonio;\r\n double total = tot_pasivo + tot_patrimonio + utilidad_perdida;\r\n parametro.put(\"p_tot_activo\", tot_activo);\r\n parametro.put(\"p_total\", total);\r\n parametro.put(\"p_utilidad_perdida\", utilidad_perdida);\r\n parametro.put(\"p_tot_pasivo\", tot_pasivo);\r\n parametro.put(\"p_tot_patrimonio\", (tot_patrimonio));\r\n }\r\n sel_tab_nivel.cerrar();\r\n ReporteDataSource data = new ReporteDataSource(tab_balance);\r\n sel_rep.setSeleccionFormatoReporte(parametro, rep_reporte.getPath(), data);\r\n sel_rep.dibujar();\r\n\r\n utilitario.addUpdate(\"sel_rep,sel_tab_nivel\");\r\n }\r\n }\r\n } else if (rep_reporte.getReporteSelecionado().equals(\"Balance General\")) {\r\n if (rep_reporte.isVisible()) {\r\n parametro = new HashMap();\r\n rep_reporte.cerrar();\r\n sec_rango_reporte.setMultiple(true);\r\n sec_rango_reporte.dibujar();\r\n utilitario.addUpdate(\"rep_reporte,sec_rango_reporte\");\r\n } else if (sec_rango_reporte.isVisible()) {\r\n if (sec_rango_reporte.getFecha1String() != null && !sec_rango_reporte.getFecha1String().isEmpty()) {\r\n if (sec_rango_reporte.getFecha2String() != null && !sec_rango_reporte.getFecha2String().isEmpty()) {\r\n fecha_fin = sec_rango_reporte.getFecha2String();\r\n fecha_inicio = con.getFechaInicialPeriodo(fecha_fin);\r\n if (fecha_inicio != null && !fecha_inicio.isEmpty()) {\r\n sec_rango_reporte.cerrar();\r\n sel_tab_nivel.dibujar();\r\n utilitario.addUpdate(\"sec_rango_reporte,sel_tab_nivel\");\r\n } else {\r\n utilitario.agregarMensajeError(\"Atencion\", \"El rango de fechas seleccionado no se encuentra en ningun Periodo Contable\");\r\n }\r\n\r\n } else {\r\n utilitario.agregarMensajeError(\"Atencion\", \"No ha seleccionado la fecha final\");\r\n }\r\n } else {\r\n utilitario.agregarMensajeError(\"Atencion\", \"No ha seleccionado la fecha inicial\");\r\n }\r\n } else if (sel_tab_nivel.isVisible()) {\r\n if (sel_tab_nivel.getValorSeleccionado() != null) {\r\n System.out.println(\"fecha fin \" + fecha_fin);\r\n parametro.put(\"p_activo\", utilitario.getVariable(\"p_con_tipo_cuenta_activo\"));\r\n parametro.put(\"p_pasivo\", utilitario.getVariable(\"p_con_tipo_cuenta_pasivo\"));\r\n parametro.put(\"p_patrimonio\", utilitario.getVariable(\"p_con_tipo_cuenta_patrimonio\"));\r\n TablaGenerica tab_datos = utilitario.consultar(\"SELECT * FROM sis_empresa e, sis_sucursal s where s.ide_empr=e.ide_empr and s.ide_empr=\" + utilitario.getVariable(\"ide_empr\") + \" and s.ide_sucu=\" + utilitario.getVariable(\"ide_sucu\"));\r\n if (tab_datos.getTotalFilas() > 0) {\r\n parametro.put(\"logo\", tab_datos.getValor(0, \"logo_empr\"));\r\n parametro.put(\"empresa\", tab_datos.getValor(0, \"nom_empr\"));\r\n parametro.put(\"sucursal\", tab_datos.getValor(0, \"nom_sucu\"));\r\n parametro.put(\"direccion\", tab_datos.getValor(0, \"direccion_sucu\"));\r\n parametro.put(\"telefono\", tab_datos.getValor(0, \"telefonos_sucu\"));\r\n parametro.put(\"ruc\", tab_datos.getValor(0, \"identificacion_empr\"));\r\n\r\n }\r\n parametro.put(\"fecha_inicio\", getFormatoFecha(fecha_inicio));\r\n parametro.put(\"fecha_fin\", getFormatoFecha(fecha_fin));\r\n TablaGenerica tab_balance = con.generarBalanceGeneral(false, fecha_inicio, fecha_fin, Integer.parseInt(sel_tab_nivel.getValorSeleccionado()));\r\n parametro.put(\"titulo\", \"BALANCE GENERAL\");\r\n if (tab_balance.getTotalFilas() > 0) {\r\n List lis_totales = con.obtenerTotalesBalanceGeneral(false, fecha_inicio, fecha_fin);\r\n double tot_activo = Double.parseDouble(lis_totales.get(0) + \"\");\r\n double tot_pasivo = Double.parseDouble(lis_totales.get(1) + \"\");\r\n double tot_patrimonio = Double.parseDouble(lis_totales.get(2) + \"\");\r\n double utilidad_perdida = tot_activo - tot_pasivo - tot_patrimonio;\r\n double total = tot_pasivo + tot_patrimonio + utilidad_perdida;\r\n parametro.put(\"p_tot_activo\", tot_activo);\r\n parametro.put(\"p_total\", total);\r\n parametro.put(\"p_utilidad_perdida\", utilidad_perdida);\r\n parametro.put(\"p_tot_pasivo\", tot_pasivo);\r\n parametro.put(\"p_tot_patrimonio\", (tot_patrimonio));\r\n }\r\n sel_tab_nivel.cerrar();\r\n ReporteDataSource data = new ReporteDataSource(tab_balance);\r\n sel_rep.setSeleccionFormatoReporte(parametro, rep_reporte.getPath(), data);\r\n sel_rep.dibujar();\r\n\r\n utilitario.addUpdate(\"sel_rep,sel_tab_nivel\");\r\n }\r\n }\r\n } else if (rep_reporte.getReporteSelecionado().equals(\"Estado de Resultados Consolidado\")) {\r\n if (rep_reporte.isVisible()) {\r\n parametro = new HashMap();\r\n rep_reporte.cerrar();\r\n sec_rango_reporte.setMultiple(true);\r\n sec_rango_reporte.dibujar();\r\n utilitario.addUpdate(\"rep_reporte,sec_rango_reporte\");\r\n } else if (sec_rango_reporte.isVisible()) {\r\n if (sec_rango_reporte.getFecha1String() != null && !sec_rango_reporte.getFecha1String().isEmpty()) {\r\n if (sec_rango_reporte.getFecha2String() != null && !sec_rango_reporte.getFecha2String().isEmpty()) {\r\n fecha_fin = sec_rango_reporte.getFecha2String();\r\n fecha_inicio = con.getFechaInicialPeriodo(fecha_fin);\r\n if (fecha_inicio != null && !fecha_inicio.isEmpty()) {\r\n sec_rango_reporte.cerrar();\r\n sel_tab_nivel.dibujar();\r\n utilitario.addUpdate(\"sec_rango_reporte,sel_tab_nivel\");\r\n }\r\n } else {\r\n utilitario.agregarMensajeError(\"Atencion\", \"No ha seleccionado la fecha fin\");\r\n }\r\n } else {\r\n utilitario.agregarMensajeError(\"Atencion\", \"No ha seleccionado la fecha inicio\");\r\n }\r\n } else if (sel_tab_nivel.isVisible()) {\r\n if (sel_tab_nivel.getValorSeleccionado() != null) {\r\n parametro.put(\"p_ingresos\", utilitario.getVariable(\"p_con_tipo_cuenta_ingresos\"));\r\n parametro.put(\"p_gastos\", utilitario.getVariable(\"p_con_tipo_cuenta_gastos\"));\r\n parametro.put(\"p_costos\", utilitario.getVariable(\"p_con_tipo_cuenta_costos\"));\r\n TablaGenerica tab_datos = utilitario.consultar(\"SELECT * FROM sis_empresa e, sis_sucursal s where s.ide_empr=e.ide_empr and s.ide_empr=\" + utilitario.getVariable(\"ide_empr\") + \" and s.ide_sucu=\" + utilitario.getVariable(\"ide_sucu\"));\r\n if (tab_datos.getTotalFilas() > 0) {\r\n parametro.put(\"logo\", tab_datos.getValor(0, \"logo_empr\"));\r\n parametro.put(\"empresa\", tab_datos.getValor(0, \"nom_empr\"));\r\n parametro.put(\"sucursal\", tab_datos.getValor(0, \"nom_sucu\"));\r\n parametro.put(\"direccion\", tab_datos.getValor(0, \"direccion_sucu\"));\r\n parametro.put(\"telefono\", tab_datos.getValor(0, \"telefonos_sucu\"));\r\n parametro.put(\"ruc\", tab_datos.getValor(0, \"identificacion_empr\"));\r\n }\r\n\r\n parametro.put(\"fecha_inicio\", getFormatoFecha(fecha_inicio));\r\n parametro.put(\"fecha_fin\", getFormatoFecha(fecha_fin));\r\n TablaGenerica tab_estado = con.generarEstadoResultados(true, fecha_inicio, fecha_fin, Integer.parseInt(sel_tab_nivel.getValorSeleccionado()));\r\n if (tab_estado.getTotalFilas() > 0) {\r\n List lis_totales = con.obtenerTotalesEstadoResultados(true, fecha_inicio, fecha_fin);\r\n double tot_ingresos = Double.parseDouble(lis_totales.get(0) + \"\");\r\n double tot_gastos = Double.parseDouble(lis_totales.get(1) + \"\");\r\n double tot_costos = Double.parseDouble(lis_totales.get(2) + \"\");\r\n double utilidad_perdida = tot_ingresos - (tot_gastos + tot_costos);\r\n parametro.put(\"p_tot_ingresos\", tot_ingresos);\r\n parametro.put(\"p_tot_gastos\", tot_gastos);\r\n parametro.put(\"p_tot_costos\", tot_costos);\r\n parametro.put(\"p_utilidad\", utilidad_perdida);\r\n }\r\n parametro.put(\"titulo\", \"ESTADO DE RESULTADOS CONSOLIDADO\");\r\n ReporteDataSource data = new ReporteDataSource(tab_estado);\r\n sel_tab_nivel.cerrar();\r\n sel_rep.setSeleccionFormatoReporte(parametro, rep_reporte.getPath(), data);\r\n sel_rep.dibujar();\r\n utilitario.addUpdate(\"sel_rep,sel_tab_nivel\");\r\n }\r\n }\r\n\r\n } else if (rep_reporte.getReporteSelecionado().equals(\"Estado de Resultados\")) {\r\n if (rep_reporte.isVisible()) {\r\n parametro = new HashMap();\r\n rep_reporte.cerrar();\r\n sec_rango_reporte.setMultiple(true);\r\n sec_rango_reporte.dibujar();\r\n utilitario.addUpdate(\"rep_reporte,sec_rango_reporte\");\r\n } else if (sec_rango_reporte.isVisible()) {\r\n if (sec_rango_reporte.getFecha1String() != null && !sec_rango_reporte.getFecha1String().isEmpty()) {\r\n if (sec_rango_reporte.getFecha2String() != null && !sec_rango_reporte.getFecha2String().isEmpty()) {\r\n fecha_fin = sec_rango_reporte.getFecha2String();\r\n fecha_inicio = con.getFechaInicialPeriodo(fecha_fin);\r\n if (fecha_inicio != null && !fecha_inicio.isEmpty()) {\r\n sec_rango_reporte.cerrar();\r\n sel_tab_nivel.dibujar();\r\n utilitario.addUpdate(\"sec_rango_reporte,sel_tab_nivel\");\r\n }\r\n } else {\r\n utilitario.agregarMensajeError(\"Atencion\", \"No ha seleccionado la fecha fin\");\r\n }\r\n } else {\r\n utilitario.agregarMensajeError(\"Atencion\", \"No ha seleccionado la fecha inicio\");\r\n }\r\n } else if (sel_tab_nivel.isVisible()) {\r\n if (sel_tab_nivel.getValorSeleccionado() != null) {\r\n parametro.put(\"p_ingresos\", utilitario.getVariable(\"p_con_tipo_cuenta_ingresos\"));\r\n parametro.put(\"p_gastos\", utilitario.getVariable(\"p_con_tipo_cuenta_gastos\"));\r\n parametro.put(\"p_costos\", utilitario.getVariable(\"p_con_tipo_cuenta_costos\"));\r\n TablaGenerica tab_datos = utilitario.consultar(\"SELECT * FROM sis_empresa e, sis_sucursal s where s.ide_empr=e.ide_empr and s.ide_empr=\" + utilitario.getVariable(\"ide_empr\") + \" and s.ide_sucu=\" + utilitario.getVariable(\"ide_sucu\"));\r\n if (tab_datos.getTotalFilas() > 0) {\r\n parametro.put(\"logo\", tab_datos.getValor(0, \"logo_empr\"));\r\n parametro.put(\"empresa\", tab_datos.getValor(0, \"nom_empr\"));\r\n parametro.put(\"sucursal\", tab_datos.getValor(0, \"nom_sucu\"));\r\n parametro.put(\"direccion\", tab_datos.getValor(0, \"direccion_sucu\"));\r\n parametro.put(\"telefono\", tab_datos.getValor(0, \"telefonos_sucu\"));\r\n parametro.put(\"ruc\", tab_datos.getValor(0, \"identificacion_empr\"));\r\n }\r\n\r\n parametro.put(\"fecha_inicio\", getFormatoFecha(fecha_inicio));\r\n parametro.put(\"fecha_fin\", getFormatoFecha(fecha_fin));\r\n TablaGenerica tab_estado = con.generarEstadoResultados(false, fecha_inicio, fecha_fin, Integer.parseInt(sel_tab_nivel.getValorSeleccionado()));\r\n if (tab_estado.getTotalFilas() > 0) {\r\n List lis_totales = con.obtenerTotalesEstadoResultados(false, fecha_inicio, fecha_fin);\r\n double tot_ingresos = Double.parseDouble(lis_totales.get(0) + \"\");\r\n double tot_gastos = Double.parseDouble(lis_totales.get(1) + \"\");\r\n double tot_costos = Double.parseDouble(lis_totales.get(2) + \"\");\r\n double utilidad_perdida = tot_ingresos - (tot_gastos + tot_costos);\r\n parametro.put(\"p_tot_ingresos\", tot_ingresos);\r\n parametro.put(\"p_tot_gastos\", tot_gastos);\r\n parametro.put(\"p_tot_costos\", tot_costos);\r\n parametro.put(\"p_utilidad\", utilidad_perdida);\r\n }\r\n ReporteDataSource data = new ReporteDataSource(tab_estado);\r\n parametro.put(\"titulo\", \"ESTADO DE RESULTADOS\");\r\n sel_tab_nivel.cerrar();\r\n sel_rep.setSeleccionFormatoReporte(parametro, rep_reporte.getPath(), data);\r\n sel_rep.dibujar();\r\n utilitario.addUpdate(\"sel_rep,sel_tab_nivel\");\r\n }\r\n }\r\n\r\n } else if (rep_reporte.getReporteSelecionado().equals(\"Libro Mayor\")) {\r\n if (rep_reporte.isVisible()) {\r\n parametro = new HashMap();\r\n rep_reporte.cerrar();\r\n lis_ide_cndpc_sel.clear();\r\n lis_ide_cndpc_deseleccionados.clear();\r\n int_count_deseleccion = 0;\r\n int_count_seleccion = 0;\r\n sel_tab.getTab_seleccion().setSeleccionados(null);\r\n// utilitario.ejecutarJavaScript(sel_tab.getTab_seleccion().getId() + \".clearFilters();\");\r\n sel_tab.dibujar();\r\n utilitario.addUpdate(\"rep_reporte,sel_tab\");\r\n } else {\r\n if (sel_tab.isVisible()) {\r\n\r\n if (sel_tab.getSeleccionados() != null && !sel_tab.getSeleccionados().isEmpty()) {\r\n System.out.println(\"nn \" + sel_tab.getSeleccionados());\r\n parametro.put(\"ide_cndpc\", sel_tab.getSeleccionados());//lista sel \r\n sel_tab.cerrar();\r\n String estado = \"\" + utilitario.getVariable(\"p_con_estado_comprobante_normal\") + \",\" + utilitario.getVariable(\"p_con_estado_comp_inicial\") + \",\" + utilitario.getVariable(\"p_con_estado_comp_final\");\r\n parametro.put(\"ide_cneco\", estado);\r\n sec_rango_reporte.setMultiple(true);\r\n sec_rango_reporte.dibujar();\r\n utilitario.addUpdate(\"sel_tab,sec_rango_reporte\");\r\n\r\n } else {\r\n utilitario.agregarMensajeInfo(\"Debe seleccionar al menos una cuenta contable\", \"\");\r\n }\r\n// if (lis_ide_cndpc_deseleccionados.size() == 0) {\r\n// System.out.println(\"sel tab lis \" + sel_tab.getSeleccionados());\r\n// parametro.put(\"ide_cndpc\", sel_tab.getSeleccionados());//lista sel \r\n// } else {\r\n// System.out.println(\"sel tab \" + utilitario.generarComillasLista(lis_ide_cndpc_deseleccionados));\r\n// parametro.put(\"ide_cndpc\", utilitario.generarComillasLista(lis_ide_cndpc_deseleccionados));//lista sel \r\n// }\r\n } else if (sec_rango_reporte.isVisible()) {\r\n if (sec_rango_reporte.isFechasValidas()) {\r\n parametro.put(\"fecha_inicio\", sec_rango_reporte.getFecha1());\r\n parametro.put(\"fecha_fin\", sec_rango_reporte.getFecha2());\r\n parametro.put(\"ide_cnlap_haber\", p_con_lugar_haber);\r\n parametro.put(\"ide_cnlap_debe\", p_con_lugar_debe);\r\n sec_rango_reporte.cerrar();\r\n sel_rep.setSeleccionFormatoReporte(parametro, rep_reporte.getPath());\r\n sel_rep.dibujar();\r\n utilitario.addUpdate(\"sel_rep,sec_rango_reporte\");\r\n } else {\r\n utilitario.agregarMensajeInfo(\"Las fechas seleccionadas no son correctas\", \"\");\r\n }\r\n }\r\n }\r\n } else if (rep_reporte.getReporteSelecionado().equals(\"Balance de Comprobacion\")) {\r\n if (rep_reporte.isVisible()) {\r\n parametro = new HashMap();\r\n rep_reporte.cerrar();\r\n sec_rango_reporte.setMultiple(true);\r\n sec_rango_reporte.dibujar();\r\n utilitario.addUpdate(\"rep_reporte,sec_rango_reporte\");\r\n\r\n } else {\r\n if (sec_rango_reporte.isVisible()) {\r\n if (sec_rango_reporte.getFecha1String() != null && !sec_rango_reporte.getFecha1String().isEmpty()) {\r\n if (sec_rango_reporte.getFecha2String() != null && !sec_rango_reporte.getFecha2String().isEmpty()) {\r\n String fecha_fin1 = sec_rango_reporte.getFecha2String();\r\n String fecha_inicio1 = sec_rango_reporte.getFecha1String();\r\n System.out.println(\"fecha fin \" + fecha_fin1);\r\n sec_rango_reporte.cerrar();\r\n\r\n TablaGenerica tab_datos = utilitario.consultar(\"SELECT * FROM sis_empresa e, sis_sucursal s where s.ide_empr=e.ide_empr and s.ide_empr=\" + utilitario.getVariable(\"ide_empr\") + \" and s.ide_sucu=\" + utilitario.getVariable(\"ide_sucu\"));\r\n if (tab_datos.getTotalFilas() > 0) {\r\n parametro.put(\"logo\", tab_datos.getValor(0, \"logo_empr\"));\r\n parametro.put(\"empresa\", tab_datos.getValor(0, \"nom_empr\"));\r\n parametro.put(\"sucursal\", tab_datos.getValor(0, \"nom_sucu\"));\r\n parametro.put(\"direccion\", tab_datos.getValor(0, \"direccion_sucu\"));\r\n parametro.put(\"telefono\", tab_datos.getValor(0, \"telefonos_sucu\"));\r\n parametro.put(\"ruc\", tab_datos.getValor(0, \"identificacion_empr\"));\r\n }\r\n String fechaPeriodoActivo = con.obtenerFechaInicialPeriodoActivo();\r\n// if (fechaPeriodoActivo != null && !fechaPeriodoActivo.isEmpty()) {\r\n parametro.put(\"fecha_inicio\", getFormatoFecha(fecha_inicio1));\r\n parametro.put(\"fecha_fin\", getFormatoFecha(fecha_fin1));\r\n TablaGenerica tab_bal = con.generarBalanceComprobacion(fechaPeriodoActivo, fecha_fin1);\r\n double suma_debe = 0;\r\n double suma_haber = 0;\r\n double suma_deudor = 0;\r\n double suma_acreedor = 0;\r\n for (int i = 0; i < tab_bal.getTotalFilas() - 1; i++) {\r\n suma_debe = Double.parseDouble(tab_bal.getValor(i, \"debe\")) + suma_debe;\r\n suma_haber = Double.parseDouble(tab_bal.getValor(i, \"haber\")) + suma_haber;\r\n suma_deudor = Double.parseDouble(tab_bal.getValor(i, \"deudor\")) + suma_deudor;\r\n suma_acreedor = Double.parseDouble(tab_bal.getValor(i, \"acreedor\")) + suma_acreedor;\r\n }\r\n parametro.put(\"tot_debe\", suma_debe);\r\n parametro.put(\"tot_haber\", suma_haber);\r\n parametro.put(\"tot_deudor\", suma_deudor);\r\n parametro.put(\"tot_acreedor\", suma_acreedor);\r\n ReporteDataSource data = new ReporteDataSource(tab_bal);\r\n sel_rep.setSeleccionFormatoReporte(parametro, rep_reporte.getPath(), data);\r\n sel_rep.dibujar();\r\n utilitario.addUpdate(\"sel_rep,sec_rango_reporte\");\r\n }\r\n// }\r\n } else {\r\n utilitario.agregarMensajeError(\"Atencion\", \"No ha seleccionado la fecha fin\");\r\n }\r\n } else {\r\n utilitario.agregarMensajeError(\"Atencion\", \"No ha seleccionado la fecha inicio\");\r\n }\r\n }\r\n\r\n } else if (rep_reporte.getReporteSelecionado().equals(\"Comprobante Contabilidad\")) {\r\n if (rep_reporte.isVisible()) {\r\n if (tab_tabla1.getValor(\"ide_cnccc\") != null) {\r\n parametro = new HashMap();\r\n rep_reporte.cerrar();\r\n parametro.put(\"ide_cnccc\", Long.parseLong(tab_tabla1.getValor(\"ide_cnccc\")));\r\n parametro.put(\"ide_cnlap_haber\", p_con_lugar_haber);\r\n parametro.put(\"ide_cnlap_debe\", p_con_lugar_debe);\r\n sel_rep.setSeleccionFormatoReporte(parametro, rep_reporte.getPath());\r\n sel_rep.dibujar();\r\n utilitario.addUpdate(\"rep_reporte,sel_rep\");\r\n } else {\r\n utilitario.agregarMensajeInfo(\"No se puede generar el reporte\", \"La fila seleccionada no tiene compraqbante de contabilidad\");\r\n }\r\n\r\n }\r\n }\r\n }", "public StringBuffer toStringCSV( Date fechaCierre ) {\n \tStringBuffer respuesta \t\t= new StringBuffer();\n \tfinal String COMA = \",\";\n \tSimpleDateFormat sdf = new SimpleDateFormat(\"dd/MM/yyyy\");\n\n \t//llenar el string buffer\n \trespuesta.append(this.numContrato\t \t\t!= null ? this.numContrato : \"\");\n \trespuesta.append(COMA);\n \trespuesta.append(this.producto \t\t\t\t!= null ? this.producto : \"\");\n \trespuesta.append(COMA);\n \trespuesta.append(fechaCierre \t\t\t\t!= null ? sdf.format(fechaCierre) : \"Fecha Invalida\"); //Dia Pago\n \trespuesta.append(COMA);\n \trespuesta.append(this.numGrupo\t\t\t\t!= null ? this.numGrupo : \"\");\n \trespuesta.append(COMA);\n \trespuesta.append(this.nombreGrupo\t\t\t!= null ? this.nombreGrupo : \"\");\n \trespuesta.append(COMA);\n \trespuesta.append(this.pagadoCapital\t\t\t!= null ? this.pagadoCapital.doubleValue() : 0.0d);\n \trespuesta.append(COMA);\n \trespuesta.append(this.pagadoInteres\t\t\t!= null ? this.pagadoInteres.doubleValue() : 0.0d );\n \trespuesta.append(COMA);\n \t\tthis.pagadoCapital = this.pagadoCapital != null ? this.pagadoCapital : 0.0d;\n \t\tthis.pagadoInteres = this.pagadoInteres != null ? this.pagadoInteres : 0.0d;\n \trespuesta.append(this.pagadoCapital.doubleValue() + this.pagadoInteres.doubleValue() ); //Pagado Total\n \trespuesta.append(COMA);\n \trespuesta.append(this.codigoSucursal\t\t!= null ? this.codigoSucursal \t : \"\");\n \trespuesta.append(COMA);\n \trespuesta.append(this.nombreSucursal\t\t!= null ? this.nombreSucursal : \"\");\n \trespuesta.append(COMA);\n \trespuesta.append(this.parcialidad\t\t\t!= null ? this.parcialidad : \"\" );\n \trespuesta.append( \"\\n\" );\n\n \treturn respuesta;\n }", "public void generarReporteAnalisisTransaClientes(String sAccionBusqueda,List<AnalisisTransaCliente> analisistransaclientesParaReportes) throws Exception {\n\t\tLong iIdUsuarioSesion=0L;\t\r\n\t\t\r\n\t\t\r\n\t\tif(usuarioActual==null) {\r\n\t\t\tthis.usuarioActual=new Usuario();\r\n\t\t}\r\n\t\t\r\n\t\tiIdUsuarioSesion=usuarioActual.getId();\r\n\t\t\r\n\t\tString sPathReportes=\"\";\r\n\t\t\r\n\t\tInputStream reportFile=null;\r\n\t\tInputStream imageFile=null;\r\n\t\t\t\r\n\t\timageFile=AuxiliarImagenes.class.getResourceAsStream(\"LogoReporte.jpg\");\t\t\t\r\n\t\t\t\t\r\n\t\t\r\n\t\tString sPathReporteFinal=\"\";\r\n\t\t\r\n\t\tif(!esReporteAccionProceso) {\r\n\t\t\tif(!this.sTipoReporte.equals(\"RELACIONES\")) {//!isEsReporteRelaciones\r\n\t\t\t\tif(!this.esReporteDinamico) {\r\n\t\t\t\t\tsPathReporteFinal=\"AnalisisTransaCliente\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\tsPathReporteFinal=this.sPathReporteDinamico;\r\n\t\t\t\t\treportFile = new FileInputStream(sPathReporteFinal);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tsPathReporteFinal=\"AnalisisTransaClienteMasterRelaciones\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\r\n\t\t\t\t//sPathReportes=reportFile.getPath().replace(\"AnalisisTransaClienteMasterRelacionesDesign.jasper\", \"\");\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t\tsPathReporteFinal=\"AnalisisTransaCliente\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\t\r\n\t\t}\r\n\t\t\r\n\t\tif(reportFile==null) {\r\n\t\t\tthrow new JRRuntimeException(sPathReporteFinal+\" no existe\");\r\n\t\t}\r\n\t\t\r\n\t\tString sUsuario=\"\";\r\n\t\t\r\n\t\tif(usuarioActual!=null) {\r\n\t\t\tsUsuario=usuarioActual.getuser_name();\r\n\t\t}\r\n\t\t\r\n\t\tMap<String, Object> parameters = new HashMap<String, Object>();\r\n\t\tparameters.put(\"usuario\", sUsuario);\r\n\t\t\r\n\t\tparameters.put(\"titulo\", Funciones.GetTituloSistemaReporte(this.parametroGeneralSg,this.moduloActual,this.usuarioActual));\r\n\t\tparameters.put(\"subtitulo\", \"Reporte De Analisis Transaccion Clientees\");\t\t\r\n\t\tparameters.put(\"busquedapor\", AnalisisTransaClienteConstantesFunciones.getNombreIndice(sAccionBusqueda)+sDetalleReporte);\r\n\t\t\r\n\t\t\r\n\t\tif(this.sTipoReporte.equals(\"RELACIONES\")) {//isEsReporteRelaciones\r\n\t\t\tparameters.put(\"SUBREPORT_DIR\", sPathReportes);\r\n\t\t}\r\n\t\t\r\n\t\tparameters.put(\"con_grafico\", this.conGraficoReporte);\r\n\t\t\r\n\t\tJasperReport jasperReport = (JasperReport)JRLoader.loadObject(reportFile);\r\n\t\t\t\t\r\n\t\tthis.cargarDatosCliente();\r\n\t\t\r\n\t\tArrayList<Classe> classes=new ArrayList<Classe>();\t\t\r\n\t\t\r\n\t\tif(this.sTipoReporte.equals(\"RELACIONES\")) {//isEsReporteRelaciones\r\n\t\t\t\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\t//FK DEBERIA TRAERSE DE ANTEMANO\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\r\n\t\t//CLASSES PARA REPORTES OBJETOS RELACIONADOS\r\n\t\tif(!this.sTipoReporte.equals(\"RELACIONES\")) {//!isEsReporteRelaciones\r\n\t\t\tclasses=new ArrayList<Classe>();\r\n\t\t}\r\n\t\t\r\n\t\tJRBeanArrayDataSource jrbeanArrayDataSourceAnalisisTransaCliente=null;\r\n\t\t\r\n\t\tif(this.sTipoReporteExtra!=null && !this.sTipoReporteExtra.equals(\"\")) {\r\n\t\t\tAnalisisTransaClienteConstantesFunciones.S_TIPOREPORTE_EXTRA=this.sTipoReporteExtra;\r\n\t\t} else {\r\n\t\t\tAnalisisTransaClienteConstantesFunciones.S_TIPOREPORTE_EXTRA=\"\";\r\n\t\t}\r\n\t\t\r\n\t\tjrbeanArrayDataSourceAnalisisTransaCliente=new JRBeanArrayDataSource(AnalisisTransaClienteJInternalFrame.TraerAnalisisTransaClienteBeans(analisistransaclientesParaReportes,classes).toArray());\r\n\t\t\r\n\t\tjasperPrint = JasperFillManager.fillReport(jasperReport,parameters,jrbeanArrayDataSourceAnalisisTransaCliente);\r\n\t\t\t\t\r\n\t\t\r\n\t\tString sPathDest=Constantes.SUNIDAD_ARCHIVOS+\":/\"+Constantes.SCONTEXTSERVER+\"/\"+AnalisisTransaClienteConstantesFunciones.SCHEMA+\"/reportes\";\r\n\t\t\r\n\t\tFile filePathDest = new File(sPathDest);\r\n\t\t\r\n\t\tif(!filePathDest.exists()) {\r\n\t\t\tfilePathDest.mkdirs();\t\t\t\t\r\n\t\t}\r\n\t\t\t\t\r\n\t\tString sDestFileName=sPathDest+\"/\"+AnalisisTransaClienteConstantesFunciones.CLASSNAME;\r\n\t\t\t\t\r\n\t\tif(this.sTipoArchivoReporte==\"VISUALIZAR\") {\r\n\t\t\tJasperViewer jasperViewer = new JasperViewer(jasperPrint,false) ;\r\n\t\t\tjasperViewer.setVisible(true) ; \r\n\r\n\t\t} else if(this.sTipoArchivoReporte==\"HTML\"||this.sTipoArchivoReporte==\"PDF\"||this.sTipoArchivoReporte==\"XML\") {\t\r\n\t\t\t//JasperFillManager.fillReportToFile(reportFile.getAbsolutePath(),parameters, new JRBeanArrayDataSource(AnalisisTransaClienteBean.TraerAnalisisTransaClienteBeans(analisistransaclientesParaReportes).toArray()));\r\n\t\t\t\t\t\t\t\r\n\t\t\tif(this.sTipoArchivoReporte==\"HTML\") {\r\n\t\t\t\tsDestFileName+=\".html\";\r\n\t\t\t\tJasperExportManager.exportReportToHtmlFile(jasperPrint,sDestFileName);\r\n\t\t\t\t\t\r\n\t\t\t} else if(this.sTipoArchivoReporte==\"PDF\") {\r\n\t\t\t\tsDestFileName+=\".pdf\";\r\n\t\t\t\tJasperExportManager.exportReportToPdfFile(jasperPrint,sDestFileName);\r\n\t\t\t} else {\r\n\t\t\t\tsDestFileName+=\".xml\";\r\n\t\t\t\tJasperExportManager.exportReportToXmlFile(jasperPrint,sDestFileName, false);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t} else if(this.sTipoArchivoReporte==\"WORD\"||this.sTipoArchivoReporte==\"EXCEL\") {\r\n\t\t\t\t\r\n\t\t\tif(this.sTipoArchivoReporte==\"WORD\") {\r\n\t\t\t\tsDestFileName+=\".rtf\";\r\n\t\t\t\t\t\r\n\t\t\t\tJRRtfExporter exporter = new JRRtfExporter();\r\n\t\t\r\n\t\t\t\texporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);\r\n\t\t\t\texporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, sDestFileName);\r\n\t\t\r\n\t\t\t\texporter.exportReport();\r\n\t\t\t\t\r\n\t\t\t} else\t{\r\n\t\t\t\tsDestFileName+=\".xls\";\r\n\t\t\t\t\t\r\n\t\t\t\tJRXlsExporter exporterXls = new JRXlsExporter();\r\n\t\t\r\n\t\t\t\texporterXls.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);\r\n\t\t\t\texporterXls.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, sDestFileName);\r\n\t\t\t\texporterXls.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE);\r\n\t\t\r\n\t\t\t\texporterXls.exportReport();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} else if(this.sTipoArchivoReporte==\"EXCEL2\"||this.sTipoArchivoReporte==\"EXCEL2_2\") {\r\n\t\t\t//sDestFileName+=\".xlsx\";\r\n\t\t\t\r\n\t\t\tif(this.sTipoReporte.equals(\"NORMAL\")) {\r\n\t\t\t\tthis.generarExcelReporteAnalisisTransaClientes(sAccionBusqueda,sTipoArchivoReporte,analisistransaclientesParaReportes);\r\n\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"FORMULARIO\")){\r\n\t\t\t\tthis.generarExcelReporteVerticalAnalisisTransaClientes(sAccionBusqueda,sTipoArchivoReporte,analisistransaclientesParaReportes,false);\r\n\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"DINAMICO\")){\r\n\t\t\t\t\r\n\t\t\t\tif(this.sTipoReporteDinamico.equals(\"NORMAL\")) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.jButtonGenerarExcelReporteDinamicoAnalisisTransaClienteActionPerformed(null);\r\n\t\t\t\t\t//this.generarExcelReporteAnalisisTransaClientes(sAccionBusqueda,sTipoArchivoReporte,analisistransaclientesParaReportes);\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t} else if(this.sTipoReporteDinamico.equals(\"FORMULARIO\")){\r\n\t\t\t\t\tthis.generarExcelReporteVerticalAnalisisTransaClientes(sAccionBusqueda,sTipoArchivoReporte,analisistransaclientesParaReportes,true);\r\n\t\t\t\t\r\n\t\t\t\t} else if(this.sTipoReporteDinamico.equals(\"RELACIONES\")){\r\n\t\t\t\t\tthis.generarExcelReporteRelacionesAnalisisTransaClientes(sAccionBusqueda,sTipoArchivoReporte,analisistransaclientesParaReportes,true);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"RELACIONES\")){\r\n\t\t\t\tthis.generarExcelReporteRelacionesAnalisisTransaClientes(sAccionBusqueda,sTipoArchivoReporte,analisistransaclientesParaReportes,false);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(this.sTipoArchivoReporte==\"HTML\"||this.sTipoArchivoReporte==\"PDF\"||this.sTipoArchivoReporte==\"XML\"||this.sTipoArchivoReporte==\"WORD\"||this.sTipoArchivoReporte==\"EXCEL\") {\t\t\t\t\r\n\t\t\tJOptionPane.showMessageDialog(this,\"REPORTE \"+sDestFileName+\" GENERADO SATISFACTORIAMENTE\",\"REPORTES \",JOptionPane.INFORMATION_MESSAGE);\r\n\t\t}\r\n\t}", "public void generarReportePlantillaFacturas(String sAccionBusqueda,List<PlantillaFactura> plantillafacturasParaReportes) throws Exception {\n\t\tLong iIdUsuarioSesion=0L;\t\r\n\t\t\r\n\t\t\r\n\t\tif(usuarioActual==null) {\r\n\t\t\tthis.usuarioActual=new Usuario();\r\n\t\t}\r\n\t\t\r\n\t\tiIdUsuarioSesion=usuarioActual.getId();\r\n\t\t\r\n\t\tString sPathReportes=\"\";\r\n\t\t\r\n\t\tInputStream reportFile=null;\r\n\t\tInputStream imageFile=null;\r\n\t\t\t\r\n\t\timageFile=AuxiliarImagenes.class.getResourceAsStream(\"LogoReporte.jpg\");\t\t\t\r\n\t\t\t\t\r\n\t\t\r\n\t\tString sPathReporteFinal=\"\";\r\n\t\t\r\n\t\tif(!esReporteAccionProceso) {\r\n\t\t\tif(!this.sTipoReporte.equals(\"RELACIONES\")) {//!isEsReporteRelaciones\r\n\t\t\t\tif(!this.esReporteDinamico) {\r\n\t\t\t\t\tsPathReporteFinal=\"PlantillaFactura\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\tsPathReporteFinal=this.sPathReporteDinamico;\r\n\t\t\t\t\treportFile = new FileInputStream(sPathReporteFinal);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tsPathReporteFinal=\"PlantillaFacturaMasterRelaciones\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\r\n\t\t\t\t//sPathReportes=reportFile.getPath().replace(\"PlantillaFacturaMasterRelacionesDesign.jasper\", \"\");\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t\tsPathReporteFinal=\"PlantillaFactura\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\t\r\n\t\t}\r\n\t\t\r\n\t\tif(reportFile==null) {\r\n\t\t\tthrow new JRRuntimeException(sPathReporteFinal+\" no existe\");\r\n\t\t}\r\n\t\t\r\n\t\tString sUsuario=\"\";\r\n\t\t\r\n\t\tif(usuarioActual!=null) {\r\n\t\t\tsUsuario=usuarioActual.getuser_name();\r\n\t\t}\r\n\t\t\r\n\t\tMap<String, Object> parameters = new HashMap<String, Object>();\r\n\t\tparameters.put(\"usuario\", sUsuario);\r\n\t\t\r\n\t\tparameters.put(\"titulo\", Funciones.GetTituloSistemaReporte(this.parametroGeneralSg,this.moduloActual,this.usuarioActual));\r\n\t\tparameters.put(\"subtitulo\", \"Reporte De Plantilla Facturas\");\t\t\r\n\t\tparameters.put(\"busquedapor\", PlantillaFacturaConstantesFunciones.getNombreIndice(sAccionBusqueda)+sDetalleReporte);\r\n\t\t\r\n\t\t\r\n\t\tif(this.sTipoReporte.equals(\"RELACIONES\")) {//isEsReporteRelaciones\r\n\t\t\tparameters.put(\"SUBREPORT_DIR\", sPathReportes);\r\n\t\t}\r\n\t\t\r\n\t\tparameters.put(\"con_grafico\", this.conGraficoReporte);\r\n\t\t\r\n\t\tJasperReport jasperReport = (JasperReport)JRLoader.loadObject(reportFile);\r\n\t\t\t\t\r\n\t\tthis.cargarDatosCliente();\r\n\t\t\r\n\t\tArrayList<Classe> classes=new ArrayList<Classe>();\t\t\r\n\t\t\r\n\t\tif(this.sTipoReporte.equals(\"RELACIONES\")) {//isEsReporteRelaciones\r\n\t\t\t\r\n\t\t\t\r\n\t\t} else {\r\n\t\t\t//FK DEBERIA TRAERSE DE ANTEMANO\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\r\n\t\t//CLASSES PARA REPORTES OBJETOS RELACIONADOS\r\n\t\tif(!this.sTipoReporte.equals(\"RELACIONES\")) {//!isEsReporteRelaciones\r\n\t\t\tclasses=new ArrayList<Classe>();\r\n\t\t}\r\n\t\t\r\n\t\tJRBeanArrayDataSource jrbeanArrayDataSourcePlantillaFactura=null;\r\n\t\t\r\n\t\tif(this.sTipoReporteExtra!=null && !this.sTipoReporteExtra.equals(\"\")) {\r\n\t\t\tPlantillaFacturaConstantesFunciones.S_TIPOREPORTE_EXTRA=this.sTipoReporteExtra;\r\n\t\t} else {\r\n\t\t\tPlantillaFacturaConstantesFunciones.S_TIPOREPORTE_EXTRA=\"\";\r\n\t\t}\r\n\t\t\r\n\t\tjrbeanArrayDataSourcePlantillaFactura=new JRBeanArrayDataSource(PlantillaFacturaJInternalFrame.TraerPlantillaFacturaBeans(plantillafacturasParaReportes,classes).toArray());\r\n\t\t\r\n\t\tjasperPrint = JasperFillManager.fillReport(jasperReport,parameters,jrbeanArrayDataSourcePlantillaFactura);\r\n\t\t\t\t\r\n\t\t\r\n\t\tString sPathDest=Constantes.SUNIDAD_ARCHIVOS+\":/\"+Constantes.SCONTEXTSERVER+\"/\"+PlantillaFacturaConstantesFunciones.SCHEMA+\"/reportes\";\r\n\t\t\r\n\t\tFile filePathDest = new File(sPathDest);\r\n\t\t\r\n\t\tif(!filePathDest.exists()) {\r\n\t\t\tfilePathDest.mkdirs();\t\t\t\t\r\n\t\t}\r\n\t\t\t\t\r\n\t\tString sDestFileName=sPathDest+\"/\"+PlantillaFacturaConstantesFunciones.CLASSNAME;\r\n\t\t\t\t\r\n\t\tif(this.sTipoArchivoReporte==\"VISUALIZAR\") {\r\n\t\t\tJasperViewer jasperViewer = new JasperViewer(jasperPrint,false) ;\r\n\t\t\tjasperViewer.setVisible(true) ; \r\n\r\n\t\t} else if(this.sTipoArchivoReporte==\"HTML\"||this.sTipoArchivoReporte==\"PDF\"||this.sTipoArchivoReporte==\"XML\") {\t\r\n\t\t\t//JasperFillManager.fillReportToFile(reportFile.getAbsolutePath(),parameters, new JRBeanArrayDataSource(PlantillaFacturaBean.TraerPlantillaFacturaBeans(plantillafacturasParaReportes).toArray()));\r\n\t\t\t\t\t\t\t\r\n\t\t\tif(this.sTipoArchivoReporte==\"HTML\") {\r\n\t\t\t\tsDestFileName+=\".html\";\r\n\t\t\t\tJasperExportManager.exportReportToHtmlFile(jasperPrint,sDestFileName);\r\n\t\t\t\t\t\r\n\t\t\t} else if(this.sTipoArchivoReporte==\"PDF\") {\r\n\t\t\t\tsDestFileName+=\".pdf\";\r\n\t\t\t\tJasperExportManager.exportReportToPdfFile(jasperPrint,sDestFileName);\r\n\t\t\t} else {\r\n\t\t\t\tsDestFileName+=\".xml\";\r\n\t\t\t\tJasperExportManager.exportReportToXmlFile(jasperPrint,sDestFileName, false);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t} else if(this.sTipoArchivoReporte==\"WORD\"||this.sTipoArchivoReporte==\"EXCEL\") {\r\n\t\t\t\t\r\n\t\t\tif(this.sTipoArchivoReporte==\"WORD\") {\r\n\t\t\t\tsDestFileName+=\".rtf\";\r\n\t\t\t\t\t\r\n\t\t\t\tJRRtfExporter exporter = new JRRtfExporter();\r\n\t\t\r\n\t\t\t\texporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);\r\n\t\t\t\texporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, sDestFileName);\r\n\t\t\r\n\t\t\t\texporter.exportReport();\r\n\t\t\t\t\r\n\t\t\t} else\t{\r\n\t\t\t\tsDestFileName+=\".xls\";\r\n\t\t\t\t\t\r\n\t\t\t\tJRXlsExporter exporterXls = new JRXlsExporter();\r\n\t\t\r\n\t\t\t\texporterXls.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);\r\n\t\t\t\texporterXls.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, sDestFileName);\r\n\t\t\t\texporterXls.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE);\r\n\t\t\r\n\t\t\t\texporterXls.exportReport();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} else if(this.sTipoArchivoReporte==\"EXCEL2\"||this.sTipoArchivoReporte==\"EXCEL2_2\") {\r\n\t\t\t//sDestFileName+=\".xlsx\";\r\n\t\t\t\r\n\t\t\tif(this.sTipoReporte.equals(\"NORMAL\")) {\r\n\t\t\t\tthis.generarExcelReportePlantillaFacturas(sAccionBusqueda,sTipoArchivoReporte,plantillafacturasParaReportes);\r\n\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"FORMULARIO\")){\r\n\t\t\t\tthis.generarExcelReporteVerticalPlantillaFacturas(sAccionBusqueda,sTipoArchivoReporte,plantillafacturasParaReportes,false);\r\n\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"DINAMICO\")){\r\n\t\t\t\t\r\n\t\t\t\tif(this.sTipoReporteDinamico.equals(\"NORMAL\")) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.jButtonGenerarExcelReporteDinamicoPlantillaFacturaActionPerformed(null);\r\n\t\t\t\t\t//this.generarExcelReportePlantillaFacturas(sAccionBusqueda,sTipoArchivoReporte,plantillafacturasParaReportes);\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t} else if(this.sTipoReporteDinamico.equals(\"FORMULARIO\")){\r\n\t\t\t\t\tthis.generarExcelReporteVerticalPlantillaFacturas(sAccionBusqueda,sTipoArchivoReporte,plantillafacturasParaReportes,true);\r\n\t\t\t\t\r\n\t\t\t\t} else if(this.sTipoReporteDinamico.equals(\"RELACIONES\")){\r\n\t\t\t\t\tthis.generarExcelReporteRelacionesPlantillaFacturas(sAccionBusqueda,sTipoArchivoReporte,plantillafacturasParaReportes,true);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"RELACIONES\")){\r\n\t\t\t\tthis.generarExcelReporteRelacionesPlantillaFacturas(sAccionBusqueda,sTipoArchivoReporte,plantillafacturasParaReportes,false);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(this.sTipoArchivoReporte==\"HTML\"||this.sTipoArchivoReporte==\"PDF\"||this.sTipoArchivoReporte==\"XML\"||this.sTipoArchivoReporte==\"WORD\"||this.sTipoArchivoReporte==\"EXCEL\") {\t\t\t\t\r\n\t\t\tJOptionPane.showMessageDialog(this,\"REPORTE \"+sDestFileName+\" GENERADO SATISFACTORIAMENTE\",\"REPORTES \",JOptionPane.INFORMATION_MESSAGE);\r\n\t\t}\r\n\t}", "public void generateReportPluviometer() {\r\n\t\tReportsController reportsController = ControladorContexto\r\n\t\t\t\t.getContextBean(ReportsController.class);\r\n\t\ttry {\r\n\t\t\tconsultPluviometer();\r\n\t\t\treportsController.generateReportPluviometer(pluviometerPojoList,\r\n\t\t\t\t\tyear);\r\n\t\t\tsetStartDateReport(null);\r\n\t\t\tsetEndDateReport(null);\r\n\t\t} catch (Exception e) {\r\n\t\t\tControladorContexto.mensajeError(e);\r\n\t\t}\r\n\t}", "public String reporteIncumplimientoPuntoXConductorWeb(HttpServletRequest request,\n HttpServletResponse response) throws IOException {\n \n String idRuta = request.getParameter(\"idRuta\");\n String idPunto = request.getParameter(\"idPunto\");\n String nombreRuta = request.getParameter(\"nombreRuta\");\n String nombrePunto = request.getParameter(\"nombrePunto\");\n String idVehiculo = request.getParameter(\"idVehiculo\");\n String placa = request.getParameter(\"placa\");\n String numeroInterno = request.getParameter(\"numeroInterno\");\n String fecha = request.getParameter(\"fecha\");\n String nombreReporte = \"reporte_IncumplimientoPuntoXConductor\";\n int tipoReporte = 29;\n \n ParametrosReporte pr = new ParametrosReporte();\n \n if (pr != null) { \n pr.setTipoReporte(tipoReporte);\n pr.setIdRuta(Restriction.getNumber(idRuta));\n pr.setIdPunto(Restriction.getNumber(idPunto));\n pr.setNombreRuta(nombreRuta);\n pr.setNombrePunto(nombrePunto);\n pr.setFechaInicioStr(fecha);\n pr.setIdVehiculo(Restriction.getNumber(idVehiculo));\n pr.setPlaca(placa);\n pr.setNumeroInterno(numeroInterno);\n pr.setNombreReporte(nombreReporte);\n ReporteWeb rptw = new ReporteWeb(pr, request, response);\n return rptw.generarReporteWeb(tipoReporte);\n }\n \n return \"/app/reportes/reporte_IncumplimientoPuntoXRuta.jsp\";\n }", "@Override\n public String report() {\n String license = \"License Plate No.: \" + getLicensePlate();\n String destination = \"Destination: \" + getZipDest();\n String weight = \"Weight Load: \" + getCurrentWeight() + \"/\" + getMaxWeight();\n String profit = String.format(\"Net Profit: ($%.2f)\", getProfit());\n String labels = \"=====Shipping Labels=====\\n\";\n for (int i = 0; i < getPackages().size(); i++) {\n labels += getPackages().get(i).shippingLabel();\n }\n labels = labels.concat(\"==============================\");\n String report = \"======== Cargo Plane Report =======\\n\"\n + license + \"\\n\" + destination + \"\\n\" + weight + \"\\n\" + profit + \"\\n\" + labels;\n return report;\n\n }", "public void generarReporteTipoDetalleMovimientoInventarios(String sAccionBusqueda,List<TipoDetalleMovimientoInventario> tipodetallemovimientoinventariosParaReportes) throws Exception {\n\t\tLong iIdUsuarioSesion=0L;\t\r\n\t\t\r\n\t\t\r\n\t\tif(usuarioActual==null) {\r\n\t\t\tthis.usuarioActual=new Usuario();\r\n\t\t}\r\n\t\t\r\n\t\tiIdUsuarioSesion=usuarioActual.getId();\r\n\t\t\r\n\t\tString sPathReportes=\"\";\r\n\t\t\r\n\t\tInputStream reportFile=null;\r\n\t\tInputStream imageFile=null;\r\n\t\t\t\r\n\t\timageFile=AuxiliarImagenes.class.getResourceAsStream(\"LogoReporte.jpg\");\t\t\t\r\n\t\t\t\t\r\n\t\t\r\n\t\tString sPathReporteFinal=\"\";\r\n\t\t\r\n\t\tif(!esReporteAccionProceso) {\r\n\t\t\tif(!this.sTipoReporte.equals(\"RELACIONES\")) {//!isEsReporteRelaciones\r\n\t\t\t\tif(!this.esReporteDinamico) {\r\n\t\t\t\t\tsPathReporteFinal=\"TipoDetalleMovimientoInventario\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\tsPathReporteFinal=this.sPathReporteDinamico;\r\n\t\t\t\t\treportFile = new FileInputStream(sPathReporteFinal);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tsPathReporteFinal=\"TipoDetalleMovimientoInventarioMasterRelaciones\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\r\n\t\t\t\t//sPathReportes=reportFile.getPath().replace(\"TipoDetalleMovimientoInventarioMasterRelacionesDesign.jasper\", \"\");\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t\tsPathReporteFinal=\"TipoDetalleMovimientoInventario\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\t\r\n\t\t}\r\n\t\t\r\n\t\tif(reportFile==null) {\r\n\t\t\tthrow new JRRuntimeException(sPathReporteFinal+\" no existe\");\r\n\t\t}\r\n\t\t\r\n\t\tString sUsuario=\"\";\r\n\t\t\r\n\t\tif(usuarioActual!=null) {\r\n\t\t\tsUsuario=usuarioActual.getuser_name();\r\n\t\t}\r\n\t\t\r\n\t\tMap<String, Object> parameters = new HashMap<String, Object>();\r\n\t\tparameters.put(\"usuario\", sUsuario);\r\n\t\t\r\n\t\tparameters.put(\"titulo\", Funciones.GetTituloSistemaReporte(this.parametroGeneralSg,this.moduloActual,this.usuarioActual));\r\n\t\tparameters.put(\"subtitulo\", \"Reporte De Tipo Costos\");\t\t\r\n\t\tparameters.put(\"busquedapor\", TipoDetalleMovimientoInventarioConstantesFunciones.getNombreIndice(sAccionBusqueda)+sDetalleReporte);\r\n\t\t\r\n\t\t\r\n\t\tif(this.sTipoReporte.equals(\"RELACIONES\")) {//isEsReporteRelaciones\r\n\t\t\tparameters.put(\"SUBREPORT_DIR\", sPathReportes);\r\n\t\t}\r\n\t\t\r\n\t\tparameters.put(\"con_grafico\", this.conGraficoReporte);\r\n\t\t\r\n\t\tJasperReport jasperReport = (JasperReport)JRLoader.loadObject(reportFile);\r\n\t\t\t\t\r\n\t\tthis.cargarDatosCliente();\r\n\t\t\r\n\t\tArrayList<Classe> classes=new ArrayList<Classe>();\t\t\r\n\t\t\r\n\t\tif(this.sTipoReporte.equals(\"RELACIONES\")) {//isEsReporteRelaciones\r\n\t\t\t\r\n\t\t\tclasses.add(new Classe(DetalleMovimientoInventario.class));\r\n\t\t\t\r\n\t\t\t//ARCHITECTURE\r\n\t\t\tif(Constantes.ISUSAEJBLOGICLAYER) {\t\t\r\n\t\t\t\ttry\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\tTipoDetalleMovimientoInventarioLogic tipodetallemovimientoinventarioLogicAuxiliar=new TipoDetalleMovimientoInventarioLogic();\r\n\t\t\t\t\ttipodetallemovimientoinventarioLogicAuxiliar.setDatosCliente(tipodetallemovimientoinventarioLogic.getDatosCliente());\t\t\t\t\r\n\t\t\t\t\ttipodetallemovimientoinventarioLogicAuxiliar.setTipoDetalleMovimientoInventarios(tipodetallemovimientoinventariosParaReportes);\r\n\t\t\t\t\t\r\n\t\t\t\t\ttipodetallemovimientoinventarioLogicAuxiliar.cargarRelacionesLoteForeignKeyTipoDetalleMovimientoInventarioWithConnection(); //deepLoadsWithConnection(false, DeepLoadType.INCLUDE, classes, \"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\ttipodetallemovimientoinventariosParaReportes=tipodetallemovimientoinventarioLogicAuxiliar.getTipoDetalleMovimientoInventarios();\r\n\t\t\t\t\t\r\n\t\t\t\t\t//tipodetallemovimientoinventarioLogic.getNewConnexionToDeep();\r\n\t\t\t\t\t\r\n\t\t\t\t\t//for (TipoDetalleMovimientoInventario tipodetallemovimientoinventario:tipodetallemovimientoinventariosParaReportes) {\r\n\t\t\t\t\t//\ttipodetallemovimientoinventarioLogic.deepLoad(tipodetallemovimientoinventario, false, DeepLoadType.INCLUDE, classes);\r\n\t\t\t\t\t//}\t\t\t\t\t\t\r\n\t\t\t\t\t//tipodetallemovimientoinventarioLogic.commitNewConnexionToDeep();\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t} catch(Exception e) {\r\n\t\t\t\t\tthrow e;\r\n\t\t\t\t\t\r\n\t\t\t\t} finally {\r\n\t\t\t\t\t//tipodetallemovimientoinventarioLogic.closeNewConnexionToDeep();\r\n\t\t\t\t}\r\n\t\t\t} else if(Constantes.ISUSAEJBREMOTE) {\r\n\t\t\t} else if(Constantes.ISUSAEJBHOME) {\r\n\t\t\t}\r\n\t\t\t//ARCHITECTURE\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\r\n\t\t\tInputStream reportFileDetalleMovimientoInventario = AuxiliarReportes.class.getResourceAsStream(\"DetalleMovimientoInventarioDetalleRelacionesDesign.jasper\");\r\n\t\t\tparameters.put(\"subreport_detallemovimientoinventario\", reportFileDetalleMovimientoInventario);\r\n\t\t} else {\r\n\t\t\t//FK DEBERIA TRAERSE DE ANTEMANO\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\r\n\t\t//CLASSES PARA REPORTES OBJETOS RELACIONADOS\r\n\t\tif(!this.sTipoReporte.equals(\"RELACIONES\")) {//!isEsReporteRelaciones\r\n\t\t\tclasses=new ArrayList<Classe>();\r\n\t\t}\r\n\t\t\r\n\t\tJRBeanArrayDataSource jrbeanArrayDataSourceTipoDetalleMovimientoInventario=null;\r\n\t\t\r\n\t\tif(this.sTipoReporteExtra!=null && !this.sTipoReporteExtra.equals(\"\")) {\r\n\t\t\tTipoDetalleMovimientoInventarioConstantesFunciones.S_TIPOREPORTE_EXTRA=this.sTipoReporteExtra;\r\n\t\t} else {\r\n\t\t\tTipoDetalleMovimientoInventarioConstantesFunciones.S_TIPOREPORTE_EXTRA=\"\";\r\n\t\t}\r\n\t\t\r\n\t\tjrbeanArrayDataSourceTipoDetalleMovimientoInventario=new JRBeanArrayDataSource(TipoDetalleMovimientoInventarioJInternalFrame.TraerTipoDetalleMovimientoInventarioBeans(tipodetallemovimientoinventariosParaReportes,classes).toArray());\r\n\t\t\r\n\t\tjasperPrint = JasperFillManager.fillReport(jasperReport,parameters,jrbeanArrayDataSourceTipoDetalleMovimientoInventario);\r\n\t\t\t\t\r\n\t\t\r\n\t\tString sPathDest=Constantes.SUNIDAD_ARCHIVOS+\":/\"+Constantes.SCONTEXTSERVER+\"/\"+TipoDetalleMovimientoInventarioConstantesFunciones.SCHEMA+\"/reportes\";\r\n\t\t\r\n\t\tFile filePathDest = new File(sPathDest);\r\n\t\t\r\n\t\tif(!filePathDest.exists()) {\r\n\t\t\tfilePathDest.mkdirs();\t\t\t\t\r\n\t\t}\r\n\t\t\t\t\r\n\t\tString sDestFileName=sPathDest+\"/\"+TipoDetalleMovimientoInventarioConstantesFunciones.CLASSNAME;\r\n\t\t\t\t\r\n\t\tif(this.sTipoArchivoReporte==\"VISUALIZAR\") {\r\n\t\t\tJasperViewer jasperViewer = new JasperViewer(jasperPrint,false) ;\r\n\t\t\tjasperViewer.setVisible(true) ; \r\n\r\n\t\t} else if(this.sTipoArchivoReporte==\"HTML\"||this.sTipoArchivoReporte==\"PDF\"||this.sTipoArchivoReporte==\"XML\") {\t\r\n\t\t\t//JasperFillManager.fillReportToFile(reportFile.getAbsolutePath(),parameters, new JRBeanArrayDataSource(TipoDetalleMovimientoInventarioBean.TraerTipoDetalleMovimientoInventarioBeans(tipodetallemovimientoinventariosParaReportes).toArray()));\r\n\t\t\t\t\t\t\t\r\n\t\t\tif(this.sTipoArchivoReporte==\"HTML\") {\r\n\t\t\t\tsDestFileName+=\".html\";\r\n\t\t\t\tJasperExportManager.exportReportToHtmlFile(jasperPrint,sDestFileName);\r\n\t\t\t\t\t\r\n\t\t\t} else if(this.sTipoArchivoReporte==\"PDF\") {\r\n\t\t\t\tsDestFileName+=\".pdf\";\r\n\t\t\t\tJasperExportManager.exportReportToPdfFile(jasperPrint,sDestFileName);\r\n\t\t\t} else {\r\n\t\t\t\tsDestFileName+=\".xml\";\r\n\t\t\t\tJasperExportManager.exportReportToXmlFile(jasperPrint,sDestFileName, false);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t} else if(this.sTipoArchivoReporte==\"WORD\"||this.sTipoArchivoReporte==\"EXCEL\") {\r\n\t\t\t\t\r\n\t\t\tif(this.sTipoArchivoReporte==\"WORD\") {\r\n\t\t\t\tsDestFileName+=\".rtf\";\r\n\t\t\t\t\t\r\n\t\t\t\tJRRtfExporter exporter = new JRRtfExporter();\r\n\t\t\r\n\t\t\t\texporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);\r\n\t\t\t\texporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, sDestFileName);\r\n\t\t\r\n\t\t\t\texporter.exportReport();\r\n\t\t\t\t\r\n\t\t\t} else\t{\r\n\t\t\t\tsDestFileName+=\".xls\";\r\n\t\t\t\t\t\r\n\t\t\t\tJRXlsExporter exporterXls = new JRXlsExporter();\r\n\t\t\r\n\t\t\t\texporterXls.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);\r\n\t\t\t\texporterXls.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, sDestFileName);\r\n\t\t\t\texporterXls.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE);\r\n\t\t\r\n\t\t\t\texporterXls.exportReport();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} else if(this.sTipoArchivoReporte==\"EXCEL2\"||this.sTipoArchivoReporte==\"EXCEL2_2\") {\r\n\t\t\t//sDestFileName+=\".xlsx\";\r\n\t\t\t\r\n\t\t\tif(this.sTipoReporte.equals(\"NORMAL\")) {\r\n\t\t\t\tthis.generarExcelReporteTipoDetalleMovimientoInventarios(sAccionBusqueda,sTipoArchivoReporte,tipodetallemovimientoinventariosParaReportes);\r\n\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"FORMULARIO\")){\r\n\t\t\t\tthis.generarExcelReporteVerticalTipoDetalleMovimientoInventarios(sAccionBusqueda,sTipoArchivoReporte,tipodetallemovimientoinventariosParaReportes,false);\r\n\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"DINAMICO\")){\r\n\t\t\t\t\r\n\t\t\t\tif(this.sTipoReporteDinamico.equals(\"NORMAL\")) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.jButtonGenerarExcelReporteDinamicoTipoDetalleMovimientoInventarioActionPerformed(null);\r\n\t\t\t\t\t//this.generarExcelReporteTipoDetalleMovimientoInventarios(sAccionBusqueda,sTipoArchivoReporte,tipodetallemovimientoinventariosParaReportes);\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t} else if(this.sTipoReporteDinamico.equals(\"FORMULARIO\")){\r\n\t\t\t\t\tthis.generarExcelReporteVerticalTipoDetalleMovimientoInventarios(sAccionBusqueda,sTipoArchivoReporte,tipodetallemovimientoinventariosParaReportes,true);\r\n\t\t\t\t\r\n\t\t\t\t} else if(this.sTipoReporteDinamico.equals(\"RELACIONES\")){\r\n\t\t\t\t\tthis.generarExcelReporteRelacionesTipoDetalleMovimientoInventarios(sAccionBusqueda,sTipoArchivoReporte,tipodetallemovimientoinventariosParaReportes,true);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"RELACIONES\")){\r\n\t\t\t\tthis.generarExcelReporteRelacionesTipoDetalleMovimientoInventarios(sAccionBusqueda,sTipoArchivoReporte,tipodetallemovimientoinventariosParaReportes,false);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(this.sTipoArchivoReporte==\"HTML\"||this.sTipoArchivoReporte==\"PDF\"||this.sTipoArchivoReporte==\"XML\"||this.sTipoArchivoReporte==\"WORD\"||this.sTipoArchivoReporte==\"EXCEL\") {\t\t\t\t\r\n\t\t\tJOptionPane.showMessageDialog(this,\"REPORTE \"+sDestFileName+\" GENERADO SATISFACTORIAMENTE\",\"REPORTES \",JOptionPane.INFORMATION_MESSAGE);\r\n\t\t}\r\n\t}", "public void realtorioCli() throws ClassNotFoundException, FileNotFoundException, DocumentException, SQLException {\r\n ContCli cocli = new ContCli();\r\n \r\n\r\n //Instancia um novo documento\r\n Document doc = new Document();\r\n \r\n //Define o local do documento\r\n PdfWriter objpdf = PdfWriter.getInstance(doc, new FileOutputStream(\"relatorioClientes.pdf\"));\r\n doc.open();\r\n PdfPTable tb = new PdfPTable(1);\r\n tb.setWidthPercentage(50);\r\n tb.setHorizontalAlignment(Element.ALIGN_CENTER);\r\n tb.setSpacingAfter(10f);\r\n tb.setSpacingBefore(10f);\r\n \r\n PdfPCell cel = new PdfPCell(new Paragraph(\"Relatório Clientes.\"));\r\n cel.setBorderColor(BaseColor.BLACK);\r\n cel.setPaddingLeft(10);\r\n cel.setHorizontalAlignment(Element.ALIGN_CENTER);\r\n cel.setVerticalAlignment(Element.ALIGN_MIDDLE);\r\n\r\n tb.addCell(cel);\r\n\r\n doc.add(tb);\r\n\r\n try {\r\n PdfPTable tabela = new PdfPTable(4); // 4 colunas.\r\n tabela.setWidthPercentage(100); //largura 100%\r\n tabela.setSpacingBefore(10f); //espaços antes da tabela\r\n tabela.setSpacingAfter(10f); //espaços antes da tabela\r\n\r\n float[] larguraColuna = {1f, 1f, 1f, 1f};\r\n tabela.setWidths(larguraColuna);\r\n\r\n PdfPCell celula01 = new PdfPCell(new Paragraph(\"Código\"));\r\n celula01.setBorderColor(BaseColor.BLACK);\r\n celula01.setPaddingLeft(10);\r\n celula01.setHorizontalAlignment(Element.ALIGN_CENTER);\r\n celula01.setVerticalAlignment(Element.ALIGN_MIDDLE);\r\n\r\n PdfPCell celula02 = new PdfPCell(new Paragraph(\"Nome\"));\r\n celula02.setBorderColor(BaseColor.BLACK);\r\n celula02.setPaddingLeft(10);\r\n celula02.setHorizontalAlignment(Element.ALIGN_CENTER);\r\n celula02.setVerticalAlignment(Element.ALIGN_MIDDLE);\r\n\r\n PdfPCell celula03 = new PdfPCell(new Paragraph(\"CPF\"));\r\n celula03.setBorderColor(BaseColor.BLACK);\r\n celula03.setPaddingLeft(10);\r\n celula03.setHorizontalAlignment(Element.ALIGN_CENTER);\r\n celula03.setVerticalAlignment(Element.ALIGN_MIDDLE);\r\n\r\n PdfPCell celula04 = new PdfPCell(new Paragraph(\"Divida\"));\r\n celula04.setBorderColor(BaseColor.BLACK);\r\n celula04.setPaddingLeft(10);\r\n celula04.setHorizontalAlignment(Element.ALIGN_CENTER);\r\n celula04.setVerticalAlignment(Element.ALIGN_MIDDLE);\r\n tabela.addCell(celula01);\r\n tabela.addCell(celula02);\r\n tabela.addCell(celula03);\r\n tabela.addCell(celula04);\r\n for (Cliente cli : cocli.selecCli()) {\r\n\r\n //Set Column widths\r\n //Para evitar que a borda da célula e o conteúdo se sobreponham, \r\n //se você tiver tendo bordas de células grossas\r\n //celula01.setUserBorderPadding(true);\r\n //celula02.setUserBorderPadding(true);\r\n //celula03.setUserBorderPadding(true);\r\n doc.add(new Paragraph());\r\n\r\n celula01 = new PdfPCell(new Paragraph(\"\" + cli.getCod()));\r\n celula01.setBorderColor(BaseColor.BLACK);\r\n celula01.setPaddingLeft(10);\r\n celula01.setHorizontalAlignment(Element.ALIGN_CENTER);\r\n celula01.setVerticalAlignment(Element.ALIGN_MIDDLE);\r\n\r\n celula02 = new PdfPCell(new Paragraph(cli.getNome()));\r\n celula02.setBorderColor(BaseColor.BLACK);\r\n celula02.setPaddingLeft(10);\r\n celula02.setHorizontalAlignment(Element.ALIGN_CENTER);\r\n celula02.setVerticalAlignment(Element.ALIGN_MIDDLE);\r\n\r\n celula03 = new PdfPCell(new Paragraph(cli.getCpf()));\r\n celula03.setBorderColor(BaseColor.BLACK);\r\n celula03.setPaddingLeft(10);\r\n celula03.setHorizontalAlignment(Element.ALIGN_CENTER);\r\n celula03.setVerticalAlignment(Element.ALIGN_MIDDLE);\r\n\r\n celula04 = new PdfPCell(new Paragraph(\"R$\" + cli.getDiv()));\r\n celula04.setBorderColor(BaseColor.BLACK);\r\n celula04.setPaddingLeft(10);\r\n celula04.setHorizontalAlignment(Element.ALIGN_CENTER);\r\n celula04.setVerticalAlignment(Element.ALIGN_MIDDLE);\r\n tabela.addCell(celula01);\r\n tabela.addCell(celula02);\r\n tabela.addCell(celula03);\r\n tabela.addCell(celula04);\r\n\r\n// String linha = \"\";\r\n// linha += (\"Codigo: \" + contatos.getCodigoContato());\r\n// linha += (\" Nome: \" + contatos.getNomeContato());\r\n// linha += (\" Celular: \" + contatos.getNumCelular());\r\n// linha += (\" Fixo: \" + contatos.getNumFixo());\r\n// documento.add(new Paragraph(linha));\r\n }\r\n doc.add(tabela);\r\n\r\n doc.close();\r\n objpdf.close();\r\n doc.close();\r\n objpdf.close();\r\n } catch (DocumentException e) {\r\n e.printStackTrace();\r\n }\r\n PDF pd = new PDF();\r\n pd.abreArquivoPdf(\"relatorioClientes.pdf\");\r\n }", "public void nuevoReporteVentasCiudad(ArrayList<Producto> Datos) throws IOException {\n Document documento = null;\r\n try {\r\n //Direccion root\r\n FileOutputStream ficheroPdf = new FileOutputStream(\"C:\\\\Users\\\\panle\\\\Documents\\\\ReporteVentasCiudad.pdf\");\r\n //FileOutputStream ficheroPdf = new FileOutputStream(\"user.dir/tmp\", \"ReporteProductos.pdf\");\r\n //File tempfile = new File(\"user.dir/tmp\", \"tempfile.txt\"); \r\n documento = new Document();\r\n // Se asocia el documento al OutputStream y se indica que el espaciado entre\r\n // lineas sera de 20. Esta llamada debe hacerse antes de abrir el documento\r\n PdfWriter.getInstance(documento, ficheroPdf).setInitialLeading(20);\r\n\r\n // Se abre el documento\r\n documento.open();\r\n documento.add(new Paragraph(\"REPORTE VENTAS POR CIUDAD\",\r\n FontFactory.getFont(\"ARIAL\", // fuente\r\n 16, // tamaño\r\n Font.ITALIC, // estilo\r\n BaseColor.BLACK))); // color\r\n\r\n PdfPTable tabla = new PdfPTable(3);//#campos(columnas) para la tabla\r\n Font font = new Font(FontFamily.COURIER, 6, Font.BOLD, BaseColor.BLACK);\r\n PdfPCell cell = new PdfPCell(new Phrase(\"Celdas\", font));\r\n\r\n documento.add(new Paragraph(\"\\n\"));\r\n\r\n Image img = Image.getInstance(\"C:\\\\Users\\\\logo.png\");\r\n documento.add(img);\r\n documento.add(new Paragraph(\"\\n\"));\r\n\r\n int conta = 0;\r\n\r\n cell.setBorder(Rectangle.TITLE);\r\n tabla.addCell(\"DESCRIPCION\");\r\n tabla.addCell(\"REFERENCIA\");\r\n tabla.addCell(\"TIPO\");\r\n\r\n while (conta < Datos.size()) {\r\n cell.setBorder(Rectangle.NO_BORDER);\r\n tabla.addCell(Datos.get(conta).getDESCRIPCION());\r\n tabla.addCell(Datos.get(conta).getREFERENCIA());\r\n tabla.addCell(Datos.get(conta).getTIPO());\r\n conta++;\r\n }\r\n\r\n documento.add(tabla);\r\n documento.close();\r\n\r\n } catch (FileNotFoundException | DocumentException e) {\r\n System.out.println(\"Error al generar Reporte Productos, por:\");\r\n e.printStackTrace();\r\n }\r\n }", "public void nuevoReporteVentasFecha(ArrayList<Producto> Datos) throws IOException {\n Document documento = null;\r\n try {\r\n //Direccion root\r\n FileOutputStream ficheroPdf = new FileOutputStream(\"C:\\\\Users\\\\panle\\\\Documents\\\\ReporteVentasFecha.pdf\");\r\n //FileOutputStream ficheroPdf = new FileOutputStream(\"user.dir/tmp\", \"ReporteProductos.pdf\");\r\n //File tempfile = new File(\"user.dir/tmp\", \"tempfile.txt\"); \r\n documento = new Document();\r\n // Se asocia el documento al OutputStream y se indica que el espaciado entre\r\n // lineas sera de 20. Esta llamada debe hacerse antes de abrir el documento\r\n PdfWriter.getInstance(documento, ficheroPdf).setInitialLeading(20);\r\n\r\n // Se abre el documento\r\n documento.open();\r\n documento.add(new Paragraph(\"REPORTE VENTAS POR FECHA\",\r\n FontFactory.getFont(\"ARIAL\", // fuente\r\n 16, // tamaño\r\n Font.ITALIC, // estilo\r\n BaseColor.BLACK))); // color\r\n\r\n PdfPTable tabla = new PdfPTable(3);//#campos(columnas) para la tabla\r\n Font font = new Font(FontFamily.COURIER, 6, Font.BOLD, BaseColor.BLACK);\r\n PdfPCell cell = new PdfPCell(new Phrase(\"Celdas\", font));\r\n\r\n documento.add(new Paragraph(\"\\n\"));\r\n\r\n Image img = Image.getInstance(\"C:\\\\Users\\\\logo.png\");\r\n documento.add(img);\r\n documento.add(new Paragraph(\"\\n\"));\r\n\r\n int conta = 0;\r\n\r\n cell.setBorder(Rectangle.TITLE);\r\n tabla.addCell(\"DESCRIPCION\");\r\n tabla.addCell(\"REFERENCIA\");\r\n tabla.addCell(\"TIPO\");\r\n\r\n while (conta < Datos.size()) {\r\n cell.setBorder(Rectangle.NO_BORDER);\r\n tabla.addCell(Datos.get(conta).getDESCRIPCION());\r\n tabla.addCell(Datos.get(conta).getREFERENCIA());\r\n tabla.addCell(Datos.get(conta).getTIPO());\r\n conta++;\r\n }\r\n\r\n documento.add(tabla);\r\n documento.close();\r\n\r\n } catch (FileNotFoundException | DocumentException e) {\r\n System.out.println(\"Error al generar Reporte Productos, por:\");\r\n e.printStackTrace();\r\n }\r\n }", "private void affichageDateFin() {\r\n\t\tif (dateFinComptage!=null){\r\n\t\t\tSystem.out.println(\"Le comptage est clos depuis le \"+ DateUtils.format(dateFinComptage));\r\n\t\t\tif (nbElements==0){\r\n\t\t\t\tSystem.out.println(\"Le comptage est clos mais n'a pas d'éléments. Le comptage est en anomalie.\");\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tSystem.out.println(\"Le comptage est clos et est OK.\");\r\n\t\t\t}\r\n\t\t}\r\n\t\telse {\r\n\t\t\tSystem.out.println(\"Le compte est actif.\");\r\n\t\t}\r\n\t}", "private void todayReport() {\n\t\tListSeries dollarEarning = new ListSeries();\n\t\tString[] dates = new String[1];\n\t\t/* Create a DateField with the default style. */\n Calendar calendar=Calendar.getInstance();\n\t\t\n\t\tvReportDisplayLayout.removeAllComponents();\n\t\tdates[0] = String.valueOf(calendar.get(Calendar.MONTH)+1) + \"/\" + \n\t\t\t\tString.valueOf(calendar.get(Calendar.DATE)) + \"/\" + \n\t\t\t\tString.valueOf(calendar.get(Calendar.YEAR));\n\t\tdollarEarning = getTodayData();\n\t\t\n\t\tdisplayChart chart = new displayChart();\n\t\t\n\t\tdReportPanel.setContent(chart.getDisplayChart(dates, dollarEarning));\n\t\tvReportDisplayLayout.addComponent(dReportPanel);\n\t}", "public void ver() {\n Clases.Conexion cc = new Clases.Conexion();\n\n try {\n Reportes.Reportes r = new Reportes.Reportes(new JFrame(), true);\n File fichero = new File(\"test.txt\");\n System.out.println(\"La ruta del fichero es: \" + fichero.getAbsolutePath());\n String archivo = \"C:\\\\Users\\\\Jonathan\\\\Documents\\\\NetBeansProjects\\\\Ramy\\\\src\\\\Reportes\\\\Transportes.jasper\";\n// String archivo = \"Reportes/Transportes.jasper\";\n JasperReport jasperReport = (JasperReport) JRLoader.loadObject(new File(archivo));\n Map parametro = new HashMap();\n JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parametro, cc.conexion());\n\n JRViewer jrv = new JRViewer(jasperPrint);\n jrv.setZoomRatio((float) 0.95);\n r.contenedor.removeAll();\n\n r.contenedor.setLayout(new BorderLayout());\n r.contenedor.add(jrv, BorderLayout.CENTER);\n\n r.contenedor.repaint();\n r.contenedor.revalidate();\n jrv.setVisible(true);\n r.setVisible(true);\n } catch (JRException ex) {\n System.err.println(\"Error iReport: \" + ex.getMessage());\n }\n }", "public String reporteIncumplimientoPuntoXVehiculoWeb (HttpServletRequest request,\n HttpServletResponse response) throws IOException {\n \n String idRuta = request.getParameter(\"idRuta\");\n String idPunto = request.getParameter(\"idPunto\");\n String nombreRuta = request.getParameter(\"nombreRuta\");\n String nombrePunto = request.getParameter(\"nombrePunto\");\n String fecha = request.getParameter(\"fecha\");\n String nombreReporte = \"reporte_IncumplimientoPuntoXVehiculo\";\n int tipoReporte = 28;\n \n ParametrosReporte pr = new ParametrosReporte();\n \n if (pr != null) { \n pr.setTipoReporte(tipoReporte);\n pr.setIdRuta(Restriction.getNumber(idRuta));\n pr.setIdPunto(Restriction.getNumber(idPunto));\n pr.setNombreRuta(nombreRuta); \n pr.setNombrePunto(nombrePunto);\n pr.setNombreReporte(nombreReporte);\n pr.setFechaInicioStr(fecha);\n ReporteWeb rptw = new ReporteWeb(pr, request, response);\n return rptw.generarReporteWeb(tipoReporte);\n }\n \n return \"/app/reportes/reporte_IncumplimientoPuntoXRuta.jsp\";\n }", "private void prnHEADER()\n\t{ \n\t try\n\t {\n\t\t\tcl_dat.M_PAGENO +=1;\n\t\t\tcl_dat.M_intLINNO_pbst=0;\n\t\t\t\n\t\t\tif(cl_dat.M_cmbOPTN_pbst.getSelectedItem().toString().equals(cl_dat.M_OPPRN_pbst) && (M_rdbTEXT.isSelected()))\n\t\t\t\tprnFMTCHR(dosREPORT,M_strBOLD);\n\t\t\tif(M_rdbHTML.isSelected())\n\t\t\t\tdosREPORT.writeBytes(\"<B>\");\n\t\t\tdosREPORT.writeBytes(\"\\n\");\n\t\t\tdosREPORT.writeBytes(padSTRING('L',\" \",100));\n\t\t\tdosREPORT.writeBytes(\"------------------------------\\n\");\n\t\t\tdosREPORT.writeBytes(padSTRING('L',\" \",100));\n\t\t\tdosREPORT.writeBytes(strISODC1+\"\\n\");\n\t\t\tdosREPORT.writeBytes(padSTRING('L',\" \",100));\n\t\t\tdosREPORT.writeBytes(strISODC2+\"\\n\");\n\t\t\tdosREPORT.writeBytes(padSTRING('L',\" \",100));\n\t\t\tdosREPORT.writeBytes(strISODC3+\"\\n\");\n\t\t\tdosREPORT.writeBytes(padSTRING('L',\" \",100));\n\t\t\tdosREPORT.writeBytes(\"------------------------------\\n\");\n\t\t\t\n\t\t\tdosREPORT.writeBytes(padSTRING('R',cl_dat.M_strCMPNM_pbst ,100));\n\t\t\tdosREPORT.writeBytes(\"Report Date:\"+ cl_dat.M_strLOGDT_pbst + \"\\n\");\t\n\t\t\t\n\t\t\tdosREPORT.writeBytes(padSTRING('R',\"Stock Statement as on \"+(rdbDYOPN.isSelected() ? strREFDT+\" at 07:00 Hrs\" : cl_dat.M_txtCLKDT_pbst.getText()+\" \"+cl_dat.M_txtCLKTM_pbst.getText()+\" Hrs\"),100));\t\t\t\n\t\t\tdosREPORT.writeBytes(\"Page No. :\" + String.valueOf(cl_dat.M_PAGENO) + \"\\n\");\t\t\t\t\t\t\n\t\t\tdosREPORT.writeBytes(\"---------------------------------------------------------------------------------------------------------------------------------------\\n\");\n\t\t\t\n\t\t\tdosREPORT.writeBytes(padSTRING('R',\" \",12));\n\t\t\tdosREPORT.writeBytes(padSTRING('R',\"Product & Size\",28));\n\t\t\t//System.out.println(\"LM_COUNT = \"+LM_COUNT);\n\t\t\tfor(i=0;i<LM_COUNT;i++)\n\t\t\t\tdosREPORT.writeBytes(padSTRING('L',staMNLDS[i],12));\n\t\t\tdosREPORT.writeBytes(padSTRING('L',\"Tot.Sq.Mts\",12));\n\t\t\tdosREPORT.writeBytes(padSTRING('L',\"S/Rtn\",12));\n\t\t\tdosREPORT.writeBytes(padSTRING('L',\"Res.Qty\",10));\n\t\t\tdosREPORT.writeBytes(padSTRING('L',\"Q/Hold\",10));\n\t\t\tdosREPORT.writeBytes(padSTRING('L',\"Cub.Mtrs\",10));\n\t\t\tdosREPORT.writeBytes(padSTRING('L',\"M.Tons\",10));\n\t\t\tdosREPORT.writeBytes(padSTRING('L',\"Pcs\",10));\n\t\t\tdosREPORT.writeBytes(\"\\n\");\n\t\t\t//crtLINE(136);\n\t\t\t//dosREPORT.writeBytes(\"\\n\");\n\t\t\tdosREPORT.writeBytes(\"---------------------------------------------------------------------------------------------------------------------------------------\\n\");\t\t\n\t\t\t\n\t\t\tif(cl_dat.M_cmbOPTN_pbst.getSelectedItem().toString().equals(cl_dat.M_OPPRN_pbst) && (M_rdbTEXT.isSelected()))\n\t\t\t\tprnFMTCHR(dosREPORT,M_strNOBOLD);\n\t\t\tif(M_rdbHTML.isSelected())\n\t\t\t\tdosREPORT.writeBytes(\"</B>\");\n\t\t\tcl_dat.M_intLINNO_pbst += 11;\n\t }\n\t catch(Exception L_EX)\n\t {\n\t\t\tsetMSG(L_EX + \" prnHEADER\",'E');\n\t\t}\n\t}", "public Excel_Reporte_Borrador() {\r\n }", "public void affiche () {\r\n\t\tSystem.out.println(\"Nom du porteur du compte: \" + this.porteur);\r\n\t\tSystem.out.println(\"numéro du compte: \" + this.IBAN);\r\n\t\tSystem.out.println(\"Solde du compte: \" + this.solde);\r\n\t}", "public void generarReporteTipoDireccions(String sAccionBusqueda,List<TipoDireccion> tipodireccionsParaReportes) throws Exception {\n\t\tLong iIdUsuarioSesion=0L;\t\r\n\t\t\r\n\t\t\r\n\t\tif(usuarioActual==null) {\r\n\t\t\tthis.usuarioActual=new Usuario();\r\n\t\t}\r\n\t\t\r\n\t\tiIdUsuarioSesion=usuarioActual.getId();\r\n\t\t\r\n\t\tString sPathReportes=\"\";\r\n\t\t\r\n\t\tInputStream reportFile=null;\r\n\t\tInputStream imageFile=null;\r\n\t\t\t\r\n\t\timageFile=AuxiliarImagenes.class.getResourceAsStream(\"LogoReporte.jpg\");\t\t\t\r\n\t\t\t\t\r\n\t\t\r\n\t\tString sPathReporteFinal=\"\";\r\n\t\t\r\n\t\tif(!esReporteAccionProceso) {\r\n\t\t\tif(!this.sTipoReporte.equals(\"RELACIONES\")) {//!isEsReporteRelaciones\r\n\t\t\t\tif(!this.esReporteDinamico) {\r\n\t\t\t\t\tsPathReporteFinal=\"TipoDireccion\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\tsPathReporteFinal=this.sPathReporteDinamico;\r\n\t\t\t\t\treportFile = new FileInputStream(sPathReporteFinal);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tsPathReporteFinal=\"TipoDireccionMasterRelaciones\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\r\n\t\t\t\t//sPathReportes=reportFile.getPath().replace(\"TipoDireccionMasterRelacionesDesign.jasper\", \"\");\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t\tsPathReporteFinal=\"TipoDireccion\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\t\r\n\t\t}\r\n\t\t\r\n\t\tif(reportFile==null) {\r\n\t\t\tthrow new JRRuntimeException(sPathReporteFinal+\" no existe\");\r\n\t\t}\r\n\t\t\r\n\t\tString sUsuario=\"\";\r\n\t\t\r\n\t\tif(usuarioActual!=null) {\r\n\t\t\tsUsuario=usuarioActual.getuser_name();\r\n\t\t}\r\n\t\t\r\n\t\tMap<String, Object> parameters = new HashMap<String, Object>();\r\n\t\tparameters.put(\"usuario\", sUsuario);\r\n\t\t\r\n\t\tparameters.put(\"titulo\", Funciones.GetTituloSistemaReporte(this.parametroGeneralSg,this.moduloActual,this.usuarioActual));\r\n\t\tparameters.put(\"subtitulo\", \"Reporte De Tipo Direcciones\");\t\t\r\n\t\tparameters.put(\"busquedapor\", TipoDireccionConstantesFunciones.getNombreIndice(sAccionBusqueda)+sDetalleReporte);\r\n\t\t\r\n\t\t\r\n\t\tif(this.sTipoReporte.equals(\"RELACIONES\")) {//isEsReporteRelaciones\r\n\t\t\tparameters.put(\"SUBREPORT_DIR\", sPathReportes);\r\n\t\t}\r\n\t\t\r\n\t\tparameters.put(\"con_grafico\", this.conGraficoReporte);\r\n\t\t\r\n\t\tJasperReport jasperReport = (JasperReport)JRLoader.loadObject(reportFile);\r\n\t\t\t\t\r\n\t\tthis.cargarDatosCliente();\r\n\t\t\r\n\t\tArrayList<Classe> classes=new ArrayList<Classe>();\t\t\r\n\t\t\r\n\t\tif(this.sTipoReporte.equals(\"RELACIONES\")) {//isEsReporteRelaciones\r\n\t\t\t\r\n\t\t\tclasses.add(new Classe(Direccion.class));\r\n\t\t\t\r\n\t\t\t//ARCHITECTURE\r\n\t\t\tif(Constantes.ISUSAEJBLOGICLAYER) {\t\t\r\n\t\t\t\ttry\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\tTipoDireccionLogic tipodireccionLogicAuxiliar=new TipoDireccionLogic();\r\n\t\t\t\t\ttipodireccionLogicAuxiliar.setDatosCliente(tipodireccionLogic.getDatosCliente());\t\t\t\t\r\n\t\t\t\t\ttipodireccionLogicAuxiliar.setTipoDireccions(tipodireccionsParaReportes);\r\n\t\t\t\t\t\r\n\t\t\t\t\ttipodireccionLogicAuxiliar.cargarRelacionesLoteForeignKeyTipoDireccionWithConnection(); //deepLoadsWithConnection(false, DeepLoadType.INCLUDE, classes, \"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\ttipodireccionsParaReportes=tipodireccionLogicAuxiliar.getTipoDireccions();\r\n\t\t\t\t\t\r\n\t\t\t\t\t//tipodireccionLogic.getNewConnexionToDeep();\r\n\t\t\t\t\t\r\n\t\t\t\t\t//for (TipoDireccion tipodireccion:tipodireccionsParaReportes) {\r\n\t\t\t\t\t//\ttipodireccionLogic.deepLoad(tipodireccion, false, DeepLoadType.INCLUDE, classes);\r\n\t\t\t\t\t//}\t\t\t\t\t\t\r\n\t\t\t\t\t//tipodireccionLogic.commitNewConnexionToDeep();\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t} catch(Exception e) {\r\n\t\t\t\t\tthrow e;\r\n\t\t\t\t\t\r\n\t\t\t\t} finally {\r\n\t\t\t\t\t//tipodireccionLogic.closeNewConnexionToDeep();\r\n\t\t\t\t}\r\n\t\t\t} else if(Constantes.ISUSAEJBREMOTE) {\r\n\t\t\t} else if(Constantes.ISUSAEJBHOME) {\r\n\t\t\t}\r\n\t\t\t//ARCHITECTURE\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\r\n\t\t\tInputStream reportFileDireccion = AuxiliarReportes.class.getResourceAsStream(\"DireccionDetalleRelacionesDesign.jasper\");\r\n\t\t\tparameters.put(\"subreport_direccion\", reportFileDireccion);\r\n\t\t} else {\r\n\t\t\t//FK DEBERIA TRAERSE DE ANTEMANO\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\r\n\t\t//CLASSES PARA REPORTES OBJETOS RELACIONADOS\r\n\t\tif(!this.sTipoReporte.equals(\"RELACIONES\")) {//!isEsReporteRelaciones\r\n\t\t\tclasses=new ArrayList<Classe>();\r\n\t\t}\r\n\t\t\r\n\t\tJRBeanArrayDataSource jrbeanArrayDataSourceTipoDireccion=null;\r\n\t\t\r\n\t\tif(this.sTipoReporteExtra!=null && !this.sTipoReporteExtra.equals(\"\")) {\r\n\t\t\tTipoDireccionConstantesFunciones.S_TIPOREPORTE_EXTRA=this.sTipoReporteExtra;\r\n\t\t} else {\r\n\t\t\tTipoDireccionConstantesFunciones.S_TIPOREPORTE_EXTRA=\"\";\r\n\t\t}\r\n\t\t\r\n\t\tjrbeanArrayDataSourceTipoDireccion=new JRBeanArrayDataSource(TipoDireccionJInternalFrame.TraerTipoDireccionBeans(tipodireccionsParaReportes,classes).toArray());\r\n\t\t\r\n\t\tjasperPrint = JasperFillManager.fillReport(jasperReport,parameters,jrbeanArrayDataSourceTipoDireccion);\r\n\t\t\t\t\r\n\t\t\r\n\t\tString sPathDest=Constantes.SUNIDAD_ARCHIVOS+\":/\"+Constantes.SCONTEXTSERVER+\"/\"+TipoDireccionConstantesFunciones.SCHEMA+\"/reportes\";\r\n\t\t\r\n\t\tFile filePathDest = new File(sPathDest);\r\n\t\t\r\n\t\tif(!filePathDest.exists()) {\r\n\t\t\tfilePathDest.mkdirs();\t\t\t\t\r\n\t\t}\r\n\t\t\t\t\r\n\t\tString sDestFileName=sPathDest+\"/\"+TipoDireccionConstantesFunciones.CLASSNAME;\r\n\t\t\t\t\r\n\t\tif(this.sTipoArchivoReporte==\"VISUALIZAR\") {\r\n\t\t\tJasperViewer jasperViewer = new JasperViewer(jasperPrint,false) ;\r\n\t\t\tjasperViewer.setVisible(true) ; \r\n\r\n\t\t} else if(this.sTipoArchivoReporte==\"HTML\"||this.sTipoArchivoReporte==\"PDF\"||this.sTipoArchivoReporte==\"XML\") {\t\r\n\t\t\t//JasperFillManager.fillReportToFile(reportFile.getAbsolutePath(),parameters, new JRBeanArrayDataSource(TipoDireccionBean.TraerTipoDireccionBeans(tipodireccionsParaReportes).toArray()));\r\n\t\t\t\t\t\t\t\r\n\t\t\tif(this.sTipoArchivoReporte==\"HTML\") {\r\n\t\t\t\tsDestFileName+=\".html\";\r\n\t\t\t\tJasperExportManager.exportReportToHtmlFile(jasperPrint,sDestFileName);\r\n\t\t\t\t\t\r\n\t\t\t} else if(this.sTipoArchivoReporte==\"PDF\") {\r\n\t\t\t\tsDestFileName+=\".pdf\";\r\n\t\t\t\tJasperExportManager.exportReportToPdfFile(jasperPrint,sDestFileName);\r\n\t\t\t} else {\r\n\t\t\t\tsDestFileName+=\".xml\";\r\n\t\t\t\tJasperExportManager.exportReportToXmlFile(jasperPrint,sDestFileName, false);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t} else if(this.sTipoArchivoReporte==\"WORD\"||this.sTipoArchivoReporte==\"EXCEL\") {\r\n\t\t\t\t\r\n\t\t\tif(this.sTipoArchivoReporte==\"WORD\") {\r\n\t\t\t\tsDestFileName+=\".rtf\";\r\n\t\t\t\t\t\r\n\t\t\t\tJRRtfExporter exporter = new JRRtfExporter();\r\n\t\t\r\n\t\t\t\texporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);\r\n\t\t\t\texporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, sDestFileName);\r\n\t\t\r\n\t\t\t\texporter.exportReport();\r\n\t\t\t\t\r\n\t\t\t} else\t{\r\n\t\t\t\tsDestFileName+=\".xls\";\r\n\t\t\t\t\t\r\n\t\t\t\tJRXlsExporter exporterXls = new JRXlsExporter();\r\n\t\t\r\n\t\t\t\texporterXls.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);\r\n\t\t\t\texporterXls.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, sDestFileName);\r\n\t\t\t\texporterXls.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE);\r\n\t\t\r\n\t\t\t\texporterXls.exportReport();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} else if(this.sTipoArchivoReporte==\"EXCEL2\"||this.sTipoArchivoReporte==\"EXCEL2_2\") {\r\n\t\t\t//sDestFileName+=\".xlsx\";\r\n\t\t\t\r\n\t\t\tif(this.sTipoReporte.equals(\"NORMAL\")) {\r\n\t\t\t\tthis.generarExcelReporteTipoDireccions(sAccionBusqueda,sTipoArchivoReporte,tipodireccionsParaReportes);\r\n\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"FORMULARIO\")){\r\n\t\t\t\tthis.generarExcelReporteVerticalTipoDireccions(sAccionBusqueda,sTipoArchivoReporte,tipodireccionsParaReportes,false);\r\n\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"DINAMICO\")){\r\n\t\t\t\t\r\n\t\t\t\tif(this.sTipoReporteDinamico.equals(\"NORMAL\")) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.jButtonGenerarExcelReporteDinamicoTipoDireccionActionPerformed(null);\r\n\t\t\t\t\t//this.generarExcelReporteTipoDireccions(sAccionBusqueda,sTipoArchivoReporte,tipodireccionsParaReportes);\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t} else if(this.sTipoReporteDinamico.equals(\"FORMULARIO\")){\r\n\t\t\t\t\tthis.generarExcelReporteVerticalTipoDireccions(sAccionBusqueda,sTipoArchivoReporte,tipodireccionsParaReportes,true);\r\n\t\t\t\t\r\n\t\t\t\t} else if(this.sTipoReporteDinamico.equals(\"RELACIONES\")){\r\n\t\t\t\t\tthis.generarExcelReporteRelacionesTipoDireccions(sAccionBusqueda,sTipoArchivoReporte,tipodireccionsParaReportes,true);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"RELACIONES\")){\r\n\t\t\t\tthis.generarExcelReporteRelacionesTipoDireccions(sAccionBusqueda,sTipoArchivoReporte,tipodireccionsParaReportes,false);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(this.sTipoArchivoReporte==\"HTML\"||this.sTipoArchivoReporte==\"PDF\"||this.sTipoArchivoReporte==\"XML\"||this.sTipoArchivoReporte==\"WORD\"||this.sTipoArchivoReporte==\"EXCEL\") {\t\t\t\t\r\n\t\t\tJOptionPane.showMessageDialog(this,\"REPORTE \"+sDestFileName+\" GENERADO SATISFACTORIAMENTE\",\"REPORTES \",JOptionPane.INFORMATION_MESSAGE);\r\n\t\t}\r\n\t}", "public String getCodReportador() {\n return codReportador;\n }", "@Override\n\tpublic String parler() {\n\t\treturn \"Je suis un Orc\";\n\t}", "public static void main(String args[]) throws Exception{\n \trmk.gui.HtmlReportDialog rpt = new rmk.gui.HtmlReportDialog();\r\n \trpt.exitOnCancel=true;\r\n \t\r\n\tjava.util.GregorianCalendar date = new java.util.GregorianCalendar(2003, 11, 1);\r\n \trmk.reports.TaxShipped tst = new rmk.reports.TaxShipped(date);\r\n\ttst.setFormat(ReportDataInvoicesList.FORMAT_TAX_SHIPPED); // FORMAT_TAX_SHIPPED FORMAT_MINIS\r\n\r\n \trpt.setReport(tst);\r\n// \tErrorLogger.getInstance().logMessage(tst.getInvoice());\r\n// \trpt.setInvoice(60001); // 42496, 42683, 50000, 42684\r\n \trpt.setVisible(true);\r\n }", "public void abrirRelatorioParcelasConvenio(Object convenio, Object periodo) {\n InputStream inputStream = getClass().getResourceAsStream(\"RelatorioParcelasConvenio.jasper\");\r\n\r\n Map<String, Object> parametros = new HashMap<String, Object>();\r\n\r\n parametros.put(\"CONVENIO\", convenio);\r\n parametros.put(\"PERIODO\", periodo);\r\n\r\n try {\r\n // abre o relatório\r\n ReportUtils.openReport(\"Relatório de Parcelas por Convênio\", inputStream, parametros, ConnectionFactory.getConnection());\r\n } catch (JRException exc) {\r\n exc.printStackTrace();\r\n }\r\n\r\n }", "@SneakyThrows\n private void pdfReport() {\n NotificationUtil.warningAlert(\"Warning\", \"Nothing to export\", NotificationUtil.SHORT);\n ServiceFactory.getPdfService().projectReport(table.getItems());\n }", "public void publicarPropuestas() {\n try {\n //SISTEMA VERIFICA QUE LOS COMPROMISOS PARA EL PERIODO HAYAN SIDO INGRESADO\n if (this.listaCompromiso == null || this.listaCompromiso.isEmpty()) {\n //MUESTRA MENSAJE: 'DEBE INGRESAR LOS COMPROMISOS PARA PODER PUBLICAR ', NO ES POSIBLE PUBLICAR LOS RESULTADOS \n addErrorMessage(keyPropertiesFactory.value(\"cu_ne_6_lbl_mensaje_add_comprimiso_faltantes\"));\n return;\n }\n String mensajeValidacion = validarCompromisosPeriodoByPropuestaNacesidad(this.propuestaSeleccionada);\n if (mensajeValidacion != null) {\n addErrorMessage(keyPropertiesFactory.value(mensajeValidacion));\n return;\n }\n if (IConstantes.CONSTANTES_ESTADO_PROPUESTA_NECESIDAD_PRE_APROBADA.compareTo(this.propuestaSeleccionada.getConstantes().getIdConstantes()) != 0) {\n addErrorMessage(\"La propuesta debe estar en estado Pre-Aprobado\");\n return;\n }\n /*byte[] bitesPdf;\n //GENERAMOS EL REPORTE - CREADOR DE REPORTES\n try {\n HashMap mapa = new HashMap();\n mapa.put(\"p_id_periodo\", periodoSeleccionado.getIdPeriodo().intValue());\n bitesPdf = GeneradorReportesServicio.getInstancia().generarReporte(mapa, \"reporte15.jasper\");\n } catch (Exception e) {\n adicionaMensajeError(\"ERROR, Se presentaron errores al general el reporte JASPER\");\n Logger.getLogger(this.getClass().getName()).log(Level.SEVERE, \"CU-NE-06(publicarPropuestas)\", e);\n return;\n }*/\n String iniciaCodigoVic = keyPropertiesFactory.value(\"cu_ne_6_codigo_proyecto_inicia_generacion\");\n if (iniciaCodigoVic.contains(\"-----NOT FOUND-----\")) {\n addErrorMessage(keyPropertiesFactory.value(\"cu_ne_6_error_no_existe_codigo_proyecto_inicia_generacion\"));\n return;\n }\n //EL SISTEMA CAMBIA EL ESTADO DE TODAS LAS PROPUESTAS DEL LISTADO DE ''PRE-APROBADA ' A 'APROBADA' \n //Y LOS DE ESTADO 'REVISADA' A 'NO APROBADA' \n List<SieduPropuestaAsignada> lstPropuestaasignada = this.servicePropuestaAsignada.findByVigencia(this.propuestaSeleccionada);\n List<Long> lstLong = new ArrayList<>();\n for (SieduPropuestaAsignada s : lstPropuestaasignada) {\n lstLong.add(s.getPropuestaNecesidad().getIdPropuestaNecesidad());\n }\n Proyecto proyecto = new Proyecto();\n int contarProyecto = iProyectoLocal.contarProyectoByVigencia(lstLong);\n Constantes constantes = iConstantesLocal.getConstantesPorIdConstante(IConstantes.DURACION_PROYECTOS_INSTITUCIONALES);\n int numeroMesesEstimacionProyecto = Integer.parseInt(constantes.getValor());\n UsuarioRol usuarioRol = new UsuarioRol(loginFaces.getPerfilUsuarioDTO().getRolUsuarioPorIdRolDTO(IConstantesRole.EVALUADOR_DE_PROPUESTAS_DE_NECESIDADES_EN_LA_VICIN).getIdUsuarioRol());\n if (this.propuestaSeleccionada.getConstantes().getIdConstantes().equals(IConstantes.CONSTANTES_ESTADO_PROPUESTA_NECESIDAD_PRE_APROBADA)) {\n EjecutorNecesidad ejecutorNecesidadResponsable = iEjecutorNecesidadLocal.getEjecutorNecesidadPorPropuestaNecesidadYRolResponsable(this.propuestaSeleccionada.getIdPropuestaNecesidad());\n if (ejecutorNecesidadResponsable == null || ejecutorNecesidadResponsable.getUnidadPolicial() == null || ejecutorNecesidadResponsable.getUnidadPolicial().getSiglaFisica() == null) {\n addErrorMessage(\"Error, Verifique la sigla física de la Unidad Policial asociada a la propuesta: \" + this.propuestaSeleccionada.getTema());\n return;\n }\n\n this.propuestaSeleccionada.setConstantes(new Constantes(IConstantes.CONSTANTES_ESTADO_PROPUESTA_NECESIDAD_APROBADA));\n //POR CADA PROPROPUESTA APROBADA SE CREA UN PROYECTO\n //CREA UN PROYECTO DE INVESTIGACIÓN POR CADA PROPUESTA CON EL ESTADO 'APROBADA', \n //ASIGNÁNDOLE EL CÓDIGO DE INVESTIGACIÓN DE ACUERDO AL MÉTODO ESTABLECIDO(VER REQUERIMIENTOS ESPECIALES), \n //ASIGNÁNDOLE EL ÁREA Y LA LÍNEA DE INVESTIGACIÓN Y EL TEMA PROPUESTO COMO TITULO PROPUESTO\n //VIC - [Consecutivo de proyectos en el periodo][Año]- [Código interno de la Unidad Policial o Escuela]\n String codigoInternoUnidad = ejecutorNecesidadResponsable.getUnidadPolicial().getSiglaFisica();\n String codigoProyecto = iniciaCodigoVic.concat(\"-\");//VIC \n contarProyecto += 1;\n codigoProyecto = codigoProyecto.concat(String.valueOf(contarProyecto));//[Consecutivo de proyectos en el periodo]\n codigoProyecto = codigoProyecto.concat(String.valueOf(lstPropuestaasignada.get(0).getSieduPropuestaAsignadaPK().getVigencia()));//[Año]\n codigoProyecto = codigoProyecto.concat(\"-\");\n codigoProyecto = codigoProyecto.concat(codigoInternoUnidad);//[Código interno de la Unidad Policial o Escuela]\n Date fechaHoy = new Date();\n proyecto.setCodigoProyecto(codigoProyecto);\n proyecto.setLinea(this.propuestaSeleccionada.getLinea());\n proyecto.setTituloPropuesto(this.propuestaSeleccionada.getTema());\n proyecto.setTema(this.propuestaSeleccionada.getTema());\n proyecto.setPeriodo(this.propuestaSeleccionada.getPeriodo());\n proyecto.setUsuarioRol(usuarioRol);\n proyecto.setEstado(new Constantes(IConstantes.TIPO_ESTADO_PROYECTO_EN_EJECUCION));\n proyecto.setUnidadPolicial(ejecutorNecesidadResponsable.getUnidadPolicial());\n proyecto.setPropuestaNecesidad(this.propuestaSeleccionada);\n proyecto.setFechaEstimadaInicio(fechaHoy);\n Calendar fechaFinalEstimadaProyecto = Calendar.getInstance();\n fechaFinalEstimadaProyecto.setTime(fechaHoy);\n fechaFinalEstimadaProyecto.add(Calendar.MONTH, numeroMesesEstimacionProyecto);\n proyecto.setFechaEstimadaFinalizacion(fechaFinalEstimadaProyecto.getTime());\n proyecto.setFechaActualizacion(fechaHoy);\n //CREAMOS LOS COMPROMISOS PROYECTOS\n List<CompromisoProyecto> listaCompromisosProyecto = new ArrayList<CompromisoProyecto>();\n //CONSULTAMOS LOS COMPROMISOS DE ESTE PERIODO\n List<CompromisoPeriodo> listaComprimiso = iCompromisoPeriodoLocal.buscarCompromisoPeriodoByIdPropuestaNecesidad(this.propuestaSeleccionada);\n for (CompromisoPeriodo unCompromisoPeriodo : listaComprimiso) {\n CompromisoProyecto compromisoProyecto = new CompromisoProyecto();\n compromisoProyecto.setCompromisoPeriodo(unCompromisoPeriodo);\n compromisoProyecto.setProyecto(proyecto);\n compromisoProyecto.setEstado(new Constantes(IConstantes.ESTADO_COMPROMISO_PROYECTO_PENDIENTE));\n compromisoProyecto.setFechaCreacion(new Date());\n compromisoProyecto.setMaquina(loginFaces.getPerfilUsuarioDTO().getMaquinaDTO().getIpLoginRemotoUsuario());\n compromisoProyecto.setUsuarioRegistro(loginFaces.getPerfilUsuarioDTO().getIdentificacion());\n compromisoProyecto.setUsuarioRolRegistra(usuarioRol);\n listaCompromisosProyecto.add(compromisoProyecto);\n }\n //CREAMOS LAS UNIDADES EJECUTORAS PARA EL PROYECTO\n List<EjecutorNecesidadDTO> listadoEjecutorNecesidadDTOPropuesta = iEjecutorNecesidadLocal.getEjecutorNecesidadDTOPorPropuestaNecesidad(this.propuestaSeleccionada.getIdPropuestaNecesidad());\n List<EjecutorNecesidad> listaEjecutorNecesidadProyecto = new ArrayList<EjecutorNecesidad>();\n for (EjecutorNecesidadDTO unaEjecutorNecesidadDTO : listadoEjecutorNecesidadDTOPropuesta) {\n EjecutorNecesidad ejecutorNecesidadLocal = new EjecutorNecesidad();\n ejecutorNecesidadLocal.setPropuestaNecesidad(new PropuestaNecesidad(this.propuestaSeleccionada.getIdPropuestaNecesidad()));\n ejecutorNecesidadLocal.setProyecto(proyecto);\n ejecutorNecesidadLocal.setRol(new Constantes(unaEjecutorNecesidadDTO.getIdRol()));\n ejecutorNecesidadLocal.setUnidadPolicial(this.iUnidadPolicialLocal.obtenerUnidadPolicialPorId(unaEjecutorNecesidadDTO.getIdUnidadPolicial()));\n listaEjecutorNecesidadProyecto.add(ejecutorNecesidadLocal);\n }\n proyecto.setEjecutorNecesidadList(listaEjecutorNecesidadProyecto);\n proyecto.setCompromisoProyectoList(listaCompromisosProyecto);\n\n } else if (this.propuestaSeleccionada.getConstantes().getIdConstantes().equals(\n IConstantes.CONSTANTES_ESTADO_PROPUESTA_NECESIDAD_REVISADA)) {\n this.propuestaSeleccionada.setConstantes(new Constantes(IConstantes.CONSTANTES_ESTADO_PROPUESTA_NECESIDAD_NO_APROBADA));\n }\n\n //ACTUALIZAMOS EL CAMPO ROL_ACTUAL\n //CON EL OBJETIVO SE SABER EN DONDE SE ENCUENTRA LA PROPUESTA\n //ESTO SE REALIZA PARA CORREGIR \n //LA INCIDENCIA #0002754: Mientras no se publiquen los resultados de las necesidades, el estado debe ser 'Enviada a VICIN'.\n this.propuestaSeleccionada.setRolActual(IConstantes.PROPUESTA_NECESIDAD_PUBLICADA_JEFE_UNIDAD);\n /* \n\n //GENERAMOS EL NOMBRE DEL ARCHIVO DEL REPORTE\n String nombreReporteUnico = \"PROP_NECES_PERIODO\".concat(\"_\").concat(String.valueOf(System.currentTimeMillis())).concat(\".pdf\");\n String nombreReporte = \"PROP_NECES_PERIODO_\" + (periodoSeleccionado.getAnio() == null ? periodoSeleccionado.getIdPeriodo().toString() : periodoSeleccionado.getAnio().toString()) + \".pdf\";\n */\n //SE ACTUALIZAN LAS PROPUESTAS DE NECESIDAD\n servicePropuestaNecesidad.guardarPropuestaYgenerarProyecto(\n this.propuestaSeleccionada,\n proyecto);\n\n addInfoMessage(keyPropertiesFactory.value(\"cu_ne_6_lbl_mensaje_propuestas_actualizadas_ok_publicar\"));\n\n navigationFaces.redirectFacesCuNe01();\n\n } catch (Exception e) {\n\n addErrorMessage(keyPropertiesFactory.value(\"general_mensaje_error_exception\"));\n Logger.getLogger(this.getClass().getName()).log(Level.SEVERE,\n \"CU-NE-06 Evaluar propuestas de necesidades de investigación - (publicarPropuestas)\", e);\n\n }\n\n }", "public void ReportarUnDiario(){\n f.registrarReporteDiario(new ReporteDiario(descripcionReporteDiario,prob));\n }", "public void nuevoReporteVentasMueble(ArrayList<Producto> Datos) throws IOException {\n Document documento = null;\r\n try {\r\n //Direccion root\r\n FileOutputStream ficheroPdf = new FileOutputStream(\"C:\\\\Users\\\\panle\\\\Documents\\\\ReporteVentasMueble.pdf\");\r\n //FileOutputStream ficheroPdf = new FileOutputStream(\"user.dir/tmp\", \"ReporteProductos.pdf\");\r\n //File tempfile = new File(\"user.dir/tmp\", \"tempfile.txt\"); \r\n documento = new Document();\r\n // Se asocia el documento al OutputStream y se indica que el espaciado entre\r\n // lineas sera de 20. Esta llamada debe hacerse antes de abrir el documento\r\n PdfWriter.getInstance(documento, ficheroPdf).setInitialLeading(20);\r\n\r\n // Se abre el documento\r\n documento.open();\r\n documento.add(new Paragraph(\"REPORTE VENTAS POR MUEBLE\",\r\n FontFactory.getFont(\"ARIAL\", // fuente\r\n 16, // tamaño\r\n Font.ITALIC, // estilo\r\n BaseColor.BLACK))); // color\r\n\r\n PdfPTable tabla = new PdfPTable(3);//#campos(columnas) para la tabla\r\n Font font = new Font(FontFamily.COURIER, 6, Font.BOLD, BaseColor.BLACK);\r\n PdfPCell cell = new PdfPCell(new Phrase(\"Celdas\", font));\r\n\r\n documento.add(new Paragraph(\"\\n\"));\r\n\r\n Image img = Image.getInstance(\"C:\\\\Users\\\\logo.png\");\r\n documento.add(img);\r\n documento.add(new Paragraph(\"\\n\"));\r\n\r\n int conta = 0;\r\n\r\n cell.setBorder(Rectangle.TITLE);\r\n tabla.addCell(\"DESCRIPCION\");\r\n tabla.addCell(\"REFERENCIA\");\r\n tabla.addCell(\"TIPO\");\r\n\r\n while (conta < Datos.size()) {\r\n cell.setBorder(Rectangle.NO_BORDER);\r\n tabla.addCell(Datos.get(conta).getDESCRIPCION());\r\n tabla.addCell(Datos.get(conta).getREFERENCIA());\r\n tabla.addCell(Datos.get(conta).getTIPO());\r\n conta++;\r\n }\r\n\r\n documento.add(tabla);\r\n documento.close();\r\n\r\n } catch (FileNotFoundException | DocumentException e) {\r\n System.out.println(\"Error al generar Reporte Productos, por:\");\r\n e.printStackTrace();\r\n }\r\n }", "private static void statACricri() {\n \tSession session = new Session();\n \tNSTimestamp dateRef = session.debutAnnee();\n \tNSArray listAffAnn = EOAffectationAnnuelle.findAffectationsAnnuelleInContext(session.ec(), null, null, dateRef);\n \tLRLog.log(\">> listAffAnn=\"+listAffAnn.count() + \" au \" + DateCtrlConges.dateToString(dateRef));\n \tlistAffAnn = LRSort.sortedArray(listAffAnn, \n \t\t\tEOAffectationAnnuelle.INDIVIDU_KEY + \".\" + EOIndividu.NOM_KEY);\n \t\n \tEOEditingContext ec = new EOEditingContext();\n \tCngUserInfo ui = new CngUserInfo(new CngDroitBus(ec), new CngPreferenceBus(ec), ec, new Integer(3065));\n \tStringBuffer sb = new StringBuffer();\n \tsb.append(\"service\").append(ConstsPrint.CSV_COLUMN_SEPARATOR);\n \tsb.append(\"agent\").append(ConstsPrint.CSV_COLUMN_SEPARATOR);\n \tsb.append(\"contractuel\").append(ConstsPrint.CSV_COLUMN_SEPARATOR);\n \tsb.append(\"travaillees\").append(ConstsPrint.CSV_COLUMN_SEPARATOR);\n \tsb.append(\"conges\").append(ConstsPrint.CSV_COLUMN_SEPARATOR);\n \tsb.append(\"dues\").append(ConstsPrint.CSV_COLUMN_SEPARATOR);\n \tsb.append(\"restant\");\n \tsb.append(ConstsPrint.CSV_NEW_LINE);\n \t\n \n \tfor (int i = 0; i < listAffAnn.count(); i++) {\n \t\tEOAffectationAnnuelle itemAffAnn = (EOAffectationAnnuelle) listAffAnn.objectAtIndex(i);\n \t\t//\n \t\tEOEditingContext edc = new EOEditingContext();\n \t\t//\n \t\tNSArray array = EOAffectationAnnuelle.findSortedAffectationsAnnuellesForOidsInContext(\n \t\t\t\tedc, new NSArray(itemAffAnn.oid()));\n \t\t// charger le planning pour forcer le calcul\n \t\tPlanning p = Planning.newPlanning((EOAffectationAnnuelle) array.objectAtIndex(0), ui, dateRef);\n \t\t// quel les contractuels\n \t\t//if (p.affectationAnnuelle().individu().isContractuel(p.affectationAnnuelle())) {\n \t\ttry {p.setType(\"R\");\n \t\tEOCalculAffectationAnnuelle calcul = p.affectationAnnuelle().calculAffAnn(\"R\");\n \t\tint minutesTravaillees3112 = calcul.minutesTravaillees3112().intValue();\n \t\tint minutesConges3112 = calcul.minutesConges3112().intValue();\n \t\t\n \t\t// calcul des minutes dues\n \t\tint minutesDues3112 = /*0*/ 514*60;\n \t\t/*\tNSArray periodes = p.affectationAnnuelle().periodes();\n \t\tfor (int j=0; j<periodes.count(); j++) {\n \t\t\tEOPeriodeAffectationAnnuelle periode = (EOPeriodeAffectationAnnuelle) periodes.objectAtIndex(j);\n \t\tminutesDues3112 += periode.valeurPonderee(p.affectationAnnuelle().minutesDues(), septembre01, decembre31);\n \t\t}*/\n \t\tsb.append(p.affectationAnnuelle().structure().libelleCourt()).append(ConstsPrint.CSV_COLUMN_SEPARATOR);\n \t\tsb.append(p.affectationAnnuelle().individu().nomComplet()).append(ConstsPrint.CSV_COLUMN_SEPARATOR);\n \t\tsb.append(p.affectationAnnuelle().individu().isContractuel(p.affectationAnnuelle())?\"O\":\"N\").append(ConstsPrint.CSV_COLUMN_SEPARATOR);\n \t\tsb.append(TimeCtrl.stringForMinutes(minutesTravaillees3112)).append(ConstsPrint.CSV_COLUMN_SEPARATOR);\n \t\tsb.append(TimeCtrl.stringForMinutes(minutesConges3112)).append(ConstsPrint.CSV_COLUMN_SEPARATOR);\n \t\tsb.append(TimeCtrl.stringForMinutes(minutesDues3112)).append(ConstsPrint.CSV_COLUMN_SEPARATOR);\n \t\tsb.append(TimeCtrl.stringForMinutes(minutesTravaillees3112 - minutesConges3112 - minutesDues3112)).append(ConstsPrint.CSV_NEW_LINE);\n \t\tLRLog.log((i+1)+\"/\"+listAffAnn.count() + \" (\" + p.affectationAnnuelle().individu().nomComplet() + \")\");\n \t\t} catch (Throwable e) {\n \t\t\te.printStackTrace();\n \t\t}\n \t\tedc.dispose();\n \t\t//}\n \t}\n \t\n\t\tString fileName = \"/tmp/stat_000_\"+listAffAnn.count()+\".csv\";\n \ttry {\n\t\t\tBufferedWriter fichier = new BufferedWriter(new FileWriter(fileName));\n\t\t\tfichier.write(sb.toString());\n\t\t\tfichier.close();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tLRLog.log(\"writing \" + fileName);\n\t\t}\n }", "public Reporte4() {\n initComponents();\n modelo = new DefaultTableModel();\n modelo.addColumn(\"id_partidos\");\n modelo.addColumn(\"equipo_local\");\n modelo.addColumn(\"equipo_visitante\");\n modelo.addColumn(\"estadio\");\n modelo.addColumn(\"fecha\");\n modelo.addColumn(\"marcador_local\");\n modelo.addColumn(\"marcador_visitante\");\n // jPanel2.setVisible(false);\n // jPanel3.setVisible(false);\n //jPanel4.setVisible(false);\n //modelo.addColumn(\"Año escolar\");\n this.jTable1.setModel(modelo);\n CargarBD();\n }", "public void generarReporteEvaluacionProveedors(String sAccionBusqueda,List<EvaluacionProveedor> evaluacionproveedorsParaReportes) throws Exception {\n\t\tLong iIdUsuarioSesion=0L;\t\r\n\t\t\r\n\t\t\r\n\t\tif(usuarioActual==null) {\r\n\t\t\tthis.usuarioActual=new Usuario();\r\n\t\t}\r\n\t\t\r\n\t\tiIdUsuarioSesion=usuarioActual.getId();\r\n\t\t\r\n\t\tString sPathReportes=\"\";\r\n\t\t\r\n\t\tInputStream reportFile=null;\r\n\t\tInputStream imageFile=null;\r\n\t\t\t\r\n\t\timageFile=AuxiliarImagenes.class.getResourceAsStream(\"LogoReporte.jpg\");\t\t\t\r\n\t\t\t\t\r\n\t\t\r\n\t\tString sPathReporteFinal=\"\";\r\n\t\t\r\n\t\tif(!esReporteAccionProceso) {\r\n\t\t\tif(!this.sTipoReporte.equals(\"RELACIONES\")) {//!isEsReporteRelaciones\r\n\t\t\t\tif(!this.esReporteDinamico) {\r\n\t\t\t\t\tsPathReporteFinal=\"EvaluacionProveedor\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\t\r\n\t\t\t\t} else {\r\n\t\t\t\t\tsPathReporteFinal=this.sPathReporteDinamico;\r\n\t\t\t\t\treportFile = new FileInputStream(sPathReporteFinal);\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tsPathReporteFinal=\"EvaluacionProveedorMasterRelaciones\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\r\n\t\t\t\t//sPathReportes=reportFile.getPath().replace(\"EvaluacionProveedorMasterRelacionesDesign.jasper\", \"\");\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t\tsPathReporteFinal=\"EvaluacionProveedor\"+this.sTipoReporteExtra+\"Design.jasper\";\r\n\t\t\t\treportFile = AuxiliarReportes.class.getResourceAsStream(sPathReporteFinal);\t\r\n\t\t}\r\n\t\t\r\n\t\tif(reportFile==null) {\r\n\t\t\tthrow new JRRuntimeException(sPathReporteFinal+\" no existe\");\r\n\t\t}\r\n\t\t\r\n\t\tString sUsuario=\"\";\r\n\t\t\r\n\t\tif(usuarioActual!=null) {\r\n\t\t\tsUsuario=usuarioActual.getuser_name();\r\n\t\t}\r\n\t\t\r\n\t\tMap<String, Object> parameters = new HashMap<String, Object>();\r\n\t\tparameters.put(\"usuario\", sUsuario);\r\n\t\t\r\n\t\tparameters.put(\"titulo\", Funciones.GetTituloSistemaReporte(this.parametroGeneralSg,this.moduloActual,this.usuarioActual));\r\n\t\tparameters.put(\"subtitulo\", \"Reporte De Evaluacion Proveedores\");\t\t\r\n\t\tparameters.put(\"busquedapor\", EvaluacionProveedorConstantesFunciones.getNombreIndice(sAccionBusqueda)+sDetalleReporte);\r\n\t\t\r\n\t\t\r\n\t\tif(this.sTipoReporte.equals(\"RELACIONES\")) {//isEsReporteRelaciones\r\n\t\t\tparameters.put(\"SUBREPORT_DIR\", sPathReportes);\r\n\t\t}\r\n\t\t\r\n\t\tparameters.put(\"con_grafico\", this.conGraficoReporte);\r\n\t\t\r\n\t\tJasperReport jasperReport = (JasperReport)JRLoader.loadObject(reportFile);\r\n\t\t\t\t\r\n\t\tthis.cargarDatosCliente();\r\n\t\t\r\n\t\tArrayList<Classe> classes=new ArrayList<Classe>();\t\t\r\n\t\t\r\n\t\tif(this.sTipoReporte.equals(\"RELACIONES\")) {//isEsReporteRelaciones\r\n\t\t\t\r\n\t\t\tclasses.add(new Classe(DetalleEvaluacionProveedor.class));\r\n\t\t\t\r\n\t\t\t//ARCHITECTURE\r\n\t\t\tif(Constantes.ISUSAEJBLOGICLAYER) {\t\t\r\n\t\t\t\ttry\t{\r\n\t\t\t\t\t\r\n\t\t\t\t\tEvaluacionProveedorLogic evaluacionproveedorLogicAuxiliar=new EvaluacionProveedorLogic();\r\n\t\t\t\t\tevaluacionproveedorLogicAuxiliar.setDatosCliente(evaluacionproveedorLogic.getDatosCliente());\t\t\t\t\r\n\t\t\t\t\tevaluacionproveedorLogicAuxiliar.setEvaluacionProveedors(evaluacionproveedorsParaReportes);\r\n\t\t\t\t\t\r\n\t\t\t\t\tevaluacionproveedorLogicAuxiliar.cargarRelacionesLoteForeignKeyEvaluacionProveedorWithConnection(); //deepLoadsWithConnection(false, DeepLoadType.INCLUDE, classes, \"\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tevaluacionproveedorsParaReportes=evaluacionproveedorLogicAuxiliar.getEvaluacionProveedors();\r\n\t\t\t\t\t\r\n\t\t\t\t\t//evaluacionproveedorLogic.getNewConnexionToDeep();\r\n\t\t\t\t\t\r\n\t\t\t\t\t//for (EvaluacionProveedor evaluacionproveedor:evaluacionproveedorsParaReportes) {\r\n\t\t\t\t\t//\tevaluacionproveedorLogic.deepLoad(evaluacionproveedor, false, DeepLoadType.INCLUDE, classes);\r\n\t\t\t\t\t//}\t\t\t\t\t\t\r\n\t\t\t\t\t//evaluacionproveedorLogic.commitNewConnexionToDeep();\r\n\t\t\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\t\t} catch(Exception e) {\r\n\t\t\t\t\tthrow e;\r\n\t\t\t\t\t\r\n\t\t\t\t} finally {\r\n\t\t\t\t\t//evaluacionproveedorLogic.closeNewConnexionToDeep();\r\n\t\t\t\t}\r\n\t\t\t} else if(Constantes.ISUSAEJBREMOTE) {\r\n\t\t\t} else if(Constantes.ISUSAEJBHOME) {\r\n\t\t\t}\r\n\t\t\t//ARCHITECTURE\t\t\r\n\t\t\t\r\n\t\t\r\n\t\t\t\r\n\t\t\t\r\n\r\n\t\t\tInputStream reportFileDetalleEvaluacionProveedor = AuxiliarReportes.class.getResourceAsStream(\"DetalleEvaluacionProveedorDetalleRelacionesDesign.jasper\");\r\n\t\t\tparameters.put(\"subreport_detalleevaluacionproveedor\", reportFileDetalleEvaluacionProveedor);\r\n\t\t} else {\r\n\t\t\t//FK DEBERIA TRAERSE DE ANTEMANO\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\t\t\t\t\t\r\n\t\t\r\n\t\t//CLASSES PARA REPORTES OBJETOS RELACIONADOS\r\n\t\tif(!this.sTipoReporte.equals(\"RELACIONES\")) {//!isEsReporteRelaciones\r\n\t\t\tclasses=new ArrayList<Classe>();\r\n\t\t}\r\n\t\t\r\n\t\tJRBeanArrayDataSource jrbeanArrayDataSourceEvaluacionProveedor=null;\r\n\t\t\r\n\t\tif(this.sTipoReporteExtra!=null && !this.sTipoReporteExtra.equals(\"\")) {\r\n\t\t\tEvaluacionProveedorConstantesFunciones.S_TIPOREPORTE_EXTRA=this.sTipoReporteExtra;\r\n\t\t} else {\r\n\t\t\tEvaluacionProveedorConstantesFunciones.S_TIPOREPORTE_EXTRA=\"\";\r\n\t\t}\r\n\t\t\r\n\t\tjrbeanArrayDataSourceEvaluacionProveedor=new JRBeanArrayDataSource(EvaluacionProveedorJInternalFrame.TraerEvaluacionProveedorBeans(evaluacionproveedorsParaReportes,classes).toArray());\r\n\t\t\r\n\t\tjasperPrint = JasperFillManager.fillReport(jasperReport,parameters,jrbeanArrayDataSourceEvaluacionProveedor);\r\n\t\t\t\t\r\n\t\t\r\n\t\tString sPathDest=Constantes.SUNIDAD_ARCHIVOS+\":/\"+Constantes.SCONTEXTSERVER+\"/\"+EvaluacionProveedorConstantesFunciones.SCHEMA+\"/reportes\";\r\n\t\t\r\n\t\tFile filePathDest = new File(sPathDest);\r\n\t\t\r\n\t\tif(!filePathDest.exists()) {\r\n\t\t\tfilePathDest.mkdirs();\t\t\t\t\r\n\t\t}\r\n\t\t\t\t\r\n\t\tString sDestFileName=sPathDest+\"/\"+EvaluacionProveedorConstantesFunciones.CLASSNAME;\r\n\t\t\t\t\r\n\t\tif(this.sTipoArchivoReporte==\"VISUALIZAR\") {\r\n\t\t\tJasperViewer jasperViewer = new JasperViewer(jasperPrint,false) ;\r\n\t\t\tjasperViewer.setVisible(true) ; \r\n\r\n\t\t} else if(this.sTipoArchivoReporte==\"HTML\"||this.sTipoArchivoReporte==\"PDF\"||this.sTipoArchivoReporte==\"XML\") {\t\r\n\t\t\t//JasperFillManager.fillReportToFile(reportFile.getAbsolutePath(),parameters, new JRBeanArrayDataSource(EvaluacionProveedorBean.TraerEvaluacionProveedorBeans(evaluacionproveedorsParaReportes).toArray()));\r\n\t\t\t\t\t\t\t\r\n\t\t\tif(this.sTipoArchivoReporte==\"HTML\") {\r\n\t\t\t\tsDestFileName+=\".html\";\r\n\t\t\t\tJasperExportManager.exportReportToHtmlFile(jasperPrint,sDestFileName);\r\n\t\t\t\t\t\r\n\t\t\t} else if(this.sTipoArchivoReporte==\"PDF\") {\r\n\t\t\t\tsDestFileName+=\".pdf\";\r\n\t\t\t\tJasperExportManager.exportReportToPdfFile(jasperPrint,sDestFileName);\r\n\t\t\t} else {\r\n\t\t\t\tsDestFileName+=\".xml\";\r\n\t\t\t\tJasperExportManager.exportReportToXmlFile(jasperPrint,sDestFileName, false);\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t} else if(this.sTipoArchivoReporte==\"WORD\"||this.sTipoArchivoReporte==\"EXCEL\") {\r\n\t\t\t\t\r\n\t\t\tif(this.sTipoArchivoReporte==\"WORD\") {\r\n\t\t\t\tsDestFileName+=\".rtf\";\r\n\t\t\t\t\t\r\n\t\t\t\tJRRtfExporter exporter = new JRRtfExporter();\r\n\t\t\r\n\t\t\t\texporter.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);\r\n\t\t\t\texporter.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, sDestFileName);\r\n\t\t\r\n\t\t\t\texporter.exportReport();\r\n\t\t\t\t\r\n\t\t\t} else\t{\r\n\t\t\t\tsDestFileName+=\".xls\";\r\n\t\t\t\t\t\r\n\t\t\t\tJRXlsExporter exporterXls = new JRXlsExporter();\r\n\t\t\r\n\t\t\t\texporterXls.setParameter(JRExporterParameter.JASPER_PRINT, jasperPrint);\r\n\t\t\t\texporterXls.setParameter(JRExporterParameter.OUTPUT_FILE_NAME, sDestFileName);\r\n\t\t\t\texporterXls.setParameter(JRXlsExporterParameter.IS_ONE_PAGE_PER_SHEET, Boolean.TRUE);\r\n\t\t\r\n\t\t\t\texporterXls.exportReport();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} else if(this.sTipoArchivoReporte==\"EXCEL2\"||this.sTipoArchivoReporte==\"EXCEL2_2\") {\r\n\t\t\t//sDestFileName+=\".xlsx\";\r\n\t\t\t\r\n\t\t\tif(this.sTipoReporte.equals(\"NORMAL\")) {\r\n\t\t\t\tthis.generarExcelReporteEvaluacionProveedors(sAccionBusqueda,sTipoArchivoReporte,evaluacionproveedorsParaReportes);\r\n\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"FORMULARIO\")){\r\n\t\t\t\tthis.generarExcelReporteVerticalEvaluacionProveedors(sAccionBusqueda,sTipoArchivoReporte,evaluacionproveedorsParaReportes,false);\r\n\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"DINAMICO\")){\r\n\t\t\t\t\r\n\t\t\t\tif(this.sTipoReporteDinamico.equals(\"NORMAL\")) {\r\n\t\t\t\t\t\r\n\t\t\t\t\tthis.jButtonGenerarExcelReporteDinamicoEvaluacionProveedorActionPerformed(null);\r\n\t\t\t\t\t//this.generarExcelReporteEvaluacionProveedors(sAccionBusqueda,sTipoArchivoReporte,evaluacionproveedorsParaReportes);\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t} else if(this.sTipoReporteDinamico.equals(\"FORMULARIO\")){\r\n\t\t\t\t\tthis.generarExcelReporteVerticalEvaluacionProveedors(sAccionBusqueda,sTipoArchivoReporte,evaluacionproveedorsParaReportes,true);\r\n\t\t\t\t\r\n\t\t\t\t} else if(this.sTipoReporteDinamico.equals(\"RELACIONES\")){\r\n\t\t\t\t\tthis.generarExcelReporteRelacionesEvaluacionProveedors(sAccionBusqueda,sTipoArchivoReporte,evaluacionproveedorsParaReportes,true);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t} else if(this.sTipoReporte.equals(\"RELACIONES\")){\r\n\t\t\t\tthis.generarExcelReporteRelacionesEvaluacionProveedors(sAccionBusqueda,sTipoArchivoReporte,evaluacionproveedorsParaReportes,false);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(this.sTipoArchivoReporte==\"HTML\"||this.sTipoArchivoReporte==\"PDF\"||this.sTipoArchivoReporte==\"XML\"||this.sTipoArchivoReporte==\"WORD\"||this.sTipoArchivoReporte==\"EXCEL\") {\t\t\t\t\r\n\t\t\tJOptionPane.showMessageDialog(this,\"REPORTE \"+sDestFileName+\" GENERADO SATISFACTORIAMENTE\",\"REPORTES \",JOptionPane.INFORMATION_MESSAGE);\r\n\t\t}\r\n\t}", "@Override\n public void imprimirMatricula() \n {\n HashMap parameters = new HashMap();\n parameters.put(\"especialidad\", new String(\"123\"));\n Print print = new Print();\n byte[] bytes = print.cargar_reporte(\"/WEB-INF/reportes/hola.jasper\", parameters).toByteArray();\n InputStream in = new ByteArrayInputStream(bytes);\n print.imprimir(in);\n }", "public String reporteCumplimientoRutaWeb (HttpServletRequest request,\n HttpServletResponse response) throws IOException {\n \n String idRuta = request.getParameter(\"idRuta\");\n String nombreRuta = request.getParameter(\"nombreRuta\");\n String fechaInicio = request.getParameter(\"fechaInicio\");\n String fechaFinal = request.getParameter(\"fechaFinal\");\n String meta = request.getParameter(\"meta\");\n String metaReal = request.getParameter(\"metaReal\");\n String tituloReporte = \"CUMPLIMIENTO DE RUTA POR VEHÍCULO\";\n String nombreReporte = \"reporte_CumplimientoRuta\";\n int tipoReporte = 24; /* Se usa consulta de reporte cumplimiento ruta x vehiculo */\n \n ParametrosReporte pr = new ParametrosReporte();\n \n if (pr != null) {\n pr.setTituloReporte(tituloReporte);\n pr.setTipoReporte(tipoReporte);\n pr.setNombreReporte(nombreReporte);\n pr.setFechaInicioStr(fechaInicio);\n pr.setFechaFinalStr(fechaFinal);\n pr.setIdRuta(Restriction.getNumber(idRuta));\n pr.setNombreRuta(nombreRuta);\n pr.setMeta(Restriction.getNumber(meta));\n pr.setMeta_real(Restriction.getRealNumber(metaReal));\n ReporteWeb rptw = new ReporteWeb(pr, request, response);\n return rptw.generarReporteWeb(tipoReporte);\n } else { \n }\n \n return \"/app/reportes/reporte_ConsolidadoRutas.jsp\";\n }", "void printReport();", "public void nuevoReporteClientes(ArrayList<Cliente> Datos) throws IOException {\n Document documento = null;\r\n try {\r\n FileOutputStream ficheroPdf = new FileOutputStream(\"C:\\\\Users\\\\panle\\\\Documents\\\\ReporteClientes.pdf\");\r\n documento = new Document(); // Se asocia el documento al OutputStream y se indica que el espaciado entre\r\n // lineas sera de 20. Esta llamada debe hacerse antes de abrir el documento\r\n PdfWriter.getInstance(documento, ficheroPdf).setInitialLeading(20);\r\n\r\n // Se abre el documento.\r\n documento.open();\r\n documento.add(new Paragraph(\"REPORTE CLIENTES\",\r\n FontFactory.getFont(\"ARIAL\", // fuente\r\n 16, // tamaño\r\n Font.ITALIC, // estilo\r\n BaseColor.BLACK))); // color\r\n\r\n PdfPTable tabla = new PdfPTable(9);\r\n Font font = new Font(FontFamily.COURIER, 6, Font.BOLD, BaseColor.BLACK);\r\n PdfPCell cell = new PdfPCell(new Phrase(\"algo\", font));\r\n documento.add(new Paragraph(\"\\n\"));\r\n\r\n Image img = Image.getInstance(\"C:\\\\Users\\\\panle\\\\Documents\\\\logo.png\");\r\n documento.add(img);\r\n documento.add(new Paragraph(\"\\n\"));\r\n int conta = 0;\r\n\r\n cell.setBorder(Rectangle.TITLE);\r\n tabla.addCell(\"NOMBRE COMLETO\");\r\n tabla.addCell(\"USUARIO\");\r\n tabla.addCell(\"NIT\");\r\n tabla.addCell(\"NO DOCUMENTO\");\r\n tabla.addCell(\"PROFESION\");\r\n tabla.addCell(\"TELÉFONO CELULAR\");\r\n tabla.addCell(\"TELÉFONO RESIDENCIA\");\r\n tabla.addCell(\"DIRECCIÓN\");\r\n tabla.addCell(\"CIUDAD\");\r\n\r\n while (conta < Datos.size()) {\r\n cell.setBorder(Rectangle.NO_BORDER);\r\n tabla.addCell(Datos.get(conta).getNOMBRE() + \" \" + Datos.get(conta).getAPELLIDO());\r\n tabla.addCell(Datos.get(conta).getUSUARIO());\r\n tabla.addCell(Datos.get(conta).getNIT());\r\n tabla.addCell(Datos.get(conta).getNUMERO_DOC());\r\n tabla.addCell(Datos.get(conta).getPROFESION());\r\n tabla.addCell(Datos.get(conta).getTEL_CEL());\r\n tabla.addCell(Datos.get(conta).getTEL_RESIDENCIA());\r\n tabla.addCell(Datos.get(conta).getDIRECCION());\r\n tabla.addCell(Datos.get(conta).getCIUDAD());\r\n conta++;\r\n }\r\n\r\n documento.add(tabla);\r\n documento.close();\r\n\r\n } catch (FileNotFoundException | DocumentException e) {\r\n System.out.println(\"Error al generar Reporte Clientes, por:\");\r\n e.printStackTrace();\r\n }\r\n }", "@Override\n protected String elaboraFooterCorrelate() {\n String text = CostBio.VUOTO;\n\n if (usaFooterCorrelate) {\n text += \"==Voci correlate==\";\n text += A_CAPO;\n text += LibWiki.setRigaQuadre(LibText.levaCoda(PATH_ANTRO, \"/\"));\n text += LibWiki.setRigaQuadre(PATH_ANTRO + \"Cognomi\");\n text += LibWiki.setRigaQuadre(PATH_ANTRO + \"Didascalie\");\n }// end of if cycle\n\n return text;\n }", "public void TesteCompleto() {\n\n\n TectoySunmiPrint.getInstance().initPrinter();\n TectoySunmiPrint.getInstance().setSize(24);\n\n // Alinhamento do texto\n\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_CENTER);\n TectoySunmiPrint.getInstance().printText(\"Alinhamento\\n\");\n TectoySunmiPrint.getInstance().printText(\"--------------------------------\\n\");\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_LEFT);\n TectoySunmiPrint.getInstance().printText(\"TecToy Automação\\n\");\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_CENTER);\n TectoySunmiPrint.getInstance().printText(\"TecToy Automação\\n\");\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_RIGTH);\n TectoySunmiPrint.getInstance().printText(\"TecToy Automação\\n\");\n\n // Formas de impressão\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_CENTER);\n TectoySunmiPrint.getInstance().printText(\"Formas de Impressão\\n\");\n TectoySunmiPrint.getInstance().printText(\"--------------------------------\\n\");\n TectoySunmiPrint.getInstance().setSize(28);\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_LEFT);\n TectoySunmiPrint.getInstance().printStyleBold(true);\n TectoySunmiPrint.getInstance().printText(\"TecToy Automação\\n\");\n TectoySunmiPrint.getInstance().printStyleReset();\n TectoySunmiPrint.getInstance().printStyleAntiWhite(true);\n TectoySunmiPrint.getInstance().printText(\"TecToy Automação\\n\");\n TectoySunmiPrint.getInstance().printStyleReset();\n TectoySunmiPrint.getInstance().printStyleDoubleHeight(true);\n TectoySunmiPrint.getInstance().printText(\"TecToy Automação\\n\");\n TectoySunmiPrint.getInstance().printStyleReset();\n TectoySunmiPrint.getInstance().printStyleDoubleWidth(true);\n TectoySunmiPrint.getInstance().printText(\"TecToy Automação\\n\");\n TectoySunmiPrint.getInstance().printStyleReset();\n TectoySunmiPrint.getInstance().printStyleInvert(true);\n TectoySunmiPrint.getInstance().printText(\"TecToy Automação\\n\");\n TectoySunmiPrint.getInstance().printStyleReset();\n TectoySunmiPrint.getInstance().printStyleItalic(true);\n TectoySunmiPrint.getInstance().printText(\"TecToy Automação\\n\");\n TectoySunmiPrint.getInstance().printStyleReset();\n TectoySunmiPrint.getInstance().printStyleStrikethRough(true);\n TectoySunmiPrint.getInstance().printText(\"TecToy Automação\\n\");\n TectoySunmiPrint.getInstance().printStyleReset();\n TectoySunmiPrint.getInstance().printStyleUnderLine(true);\n TectoySunmiPrint.getInstance().printText(\"TecToy Automação\\n\");\n TectoySunmiPrint.getInstance().printStyleReset();\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_LEFT);\n TectoySunmiPrint.getInstance().printTextWithSize(\"TecToy Automação\\n\", 35);\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_CENTER);\n TectoySunmiPrint.getInstance().printTextWithSize(\"TecToy Automação\\n\", 28);\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_RIGTH);\n TectoySunmiPrint.getInstance().printTextWithSize(\"TecToy Automação\\n\",50);\n // TectoySunmiPrint.getInstance().feedPaper();\n TectoySunmiPrint.getInstance().setSize(24);\n\n\n // Impressão de BarCode\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_CENTER);\n TectoySunmiPrint.getInstance().printText(\"Imprime BarCode\\n\");\n TectoySunmiPrint.getInstance().printText(\"--------------------------------\\n\");\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_LEFT);\n TectoySunmiPrint.getInstance().printBarCode(\"7894900700046\", TectoySunmiPrint.BarCodeModels_EAN13, 162, 2,\n TectoySunmiPrint.BarCodeTextPosition_INFORME_UM_TEXTO);\n TectoySunmiPrint.getInstance().printAdvanceLines(2);\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_CENTER);\n TectoySunmiPrint.getInstance().printBarCode(\"7894900700046\", TectoySunmiPrint.BarCodeModels_EAN13, 162, 2,\n TectoySunmiPrint.BarCodeTextPosition_ABAIXO_DO_CODIGO_DE_BARRAS);\n TectoySunmiPrint.getInstance().printAdvanceLines(2);\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_RIGTH);\n TectoySunmiPrint.getInstance().printBarCode(\"7894900700046\", TectoySunmiPrint.BarCodeModels_EAN13, 162, 2,\n TectoySunmiPrint.BarCodeTextPosition_ACIMA_DO_CODIGO_DE_BARRAS_BARCODE);\n TectoySunmiPrint.getInstance().printAdvanceLines(2);\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_CENTER);\n TectoySunmiPrint.getInstance().printBarCode(\"7894900700046\", TectoySunmiPrint.BarCodeModels_EAN13, 162, 2,\n TectoySunmiPrint.BarCodeTextPosition_ACIMA_E_ABAIXO_DO_CODIGO_DE_BARRAS);\n //TectoySunmiPrint.getInstance().feedPaper();\n TectoySunmiPrint.getInstance().print3Line();\n // Impressão de BarCode\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_CENTER);\n TectoySunmiPrint.getInstance().printText(\"Imprime QrCode\\n\");\n TectoySunmiPrint.getInstance().printText(\"--------------------------------\\n\");\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_LEFT);\n TectoySunmiPrint.getInstance().printQr(\"www.tectoysunmi.com.br\", 8, 1);\n //TectoySunmiPrint.getInstance().feedPaper();\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_CENTER);\n TectoySunmiPrint.getInstance().printQr(\"www.tectoysunmi.com.br\", 8, 1);\n //TectoySunmiPrint.getInstance().feedPaper();\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_RIGTH);\n TectoySunmiPrint.getInstance().printQr(\"www.tectoysunmi.com.br\", 8, 1);\n //TectoySunmiPrint.getInstance().feedPaper();\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_LEFT);\n TectoySunmiPrint.getInstance().printDoubleQRCode(\"www.tectoysunmi.com.br\",\"tectoysunmi\", 7, 1);\n //TectoySunmiPrint.getInstance().feedPaper();\n\n\n // Impresão Imagem\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_CENTER);\n TectoySunmiPrint.getInstance().printText(\"Imprime Imagem\\n\");\n TectoySunmiPrint.getInstance().printText(\"-------------------------------\\n\");\n BitmapFactory.Options options = new BitmapFactory.Options();\n options.inTargetDensity = 160;\n options.inDensity = 160;\n Bitmap bitmap1 = null;\n Bitmap bitmap = null;\n if (bitmap == null) {\n bitmap = BitmapFactory.decodeResource(getResources(), test, options);\n }\n if (bitmap1 == null) {\n bitmap1 = BitmapFactory.decodeResource(getResources(), test1, options);\n bitmap1 = scaleImage(bitmap1);\n }\n TectoySunmiPrint.getInstance().printBitmap(bitmap1);\n //TectoySunmiPrint.getInstance().feedPaper();\n TectoySunmiPrint.getInstance().print3Line();\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_LEFT);\n TectoySunmiPrint.getInstance().printBitmap(bitmap1);\n //TectoySunmiPrint.getInstance().feedPaper();\n TectoySunmiPrint.getInstance().print3Line();\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_RIGTH);\n TectoySunmiPrint.getInstance().printBitmap(bitmap1);\n //TectoySunmiPrint.getInstance().feedPaper();\n TectoySunmiPrint.getInstance().print3Line();\n\n TectoySunmiPrint.getInstance().setAlign(TectoySunmiPrint.Alignment_CENTER);\n TectoySunmiPrint.getInstance().printText(\"Imprime Tabela\\n\");\n TectoySunmiPrint.getInstance().printText(\"--------------------------------\\n\");\n\n String[] prod = new String[3];\n int[] width = new int[3];\n int[] align = new int[3];\n\n width[0] = 100;\n width[1] = 50;\n width[2] = 50;\n\n align[0] = TectoySunmiPrint.Alignment_LEFT;\n align[1] = TectoySunmiPrint.Alignment_CENTER;\n align[2] = TectoySunmiPrint.Alignment_RIGTH;\n\n prod[0] = \"Produto 001\";\n prod[1] = \"10 und\";\n prod[2] = \"3,98\";\n TectoySunmiPrint.getInstance().printTable(prod, width, align);\n\n prod[0] = \"Produto 002\";\n prod[1] = \"10 und\";\n prod[2] = \"3,98\";\n TectoySunmiPrint.getInstance().printTable(prod, width, align);\n\n prod[0] = \"Produto 003\";\n prod[1] = \"10 und\";\n prod[2] = \"3,98\";\n TectoySunmiPrint.getInstance().printTable(prod, width, align);\n\n prod[0] = \"Produto 004\";\n prod[1] = \"10 und\";\n prod[2] = \"3,98\";\n TectoySunmiPrint.getInstance().printTable(prod, width, align);\n\n prod[0] = \"Produto 005\";\n prod[1] = \"10 und\";\n prod[2] = \"3,98\";\n TectoySunmiPrint.getInstance().printTable(prod, width, align);\n\n prod[0] = \"Produto 006\";\n prod[1] = \"10 und\";\n prod[2] = \"3,98\";\n TectoySunmiPrint.getInstance().printTable(prod, width, align);\n\n TectoySunmiPrint.getInstance().print3Line();\n TectoySunmiPrint.getInstance().openCashBox();\n TectoySunmiPrint.getInstance().cutpaper();\n\n }", "@Override\n\tpublic void preparar() {\n\t\tSystem.out.println(\"massa, presunto, queijo, calabreza e cebola\");\n\t\t\n\t}", "public void verComprobante() {\r\n if (tab_tabla1.getValorSeleccionado() != null) {\r\n if (!tab_tabla1.isFilaInsertada()) {\r\n Map parametros = new HashMap();\r\n parametros.put(\"ide_cnccc\", Long.parseLong(tab_tabla1.getValorSeleccionado()));\r\n parametros.put(\"ide_cnlap_debe\", p_con_lugar_debe);\r\n parametros.put(\"ide_cnlap_haber\", p_con_lugar_haber);\r\n vpdf_ver.setVisualizarPDF(\"rep_contabilidad/rep_comprobante_contabilidad.jasper\", parametros);\r\n vpdf_ver.dibujar();\r\n } else {\r\n utilitario.agregarMensajeInfo(\"Debe guardar el comprobante\", \"\");\r\n }\r\n\r\n } else {\r\n utilitario.agregarMensajeInfo(\"No hay ningun comprobante seleccionado\", \"\");\r\n }\r\n }", "@Override\r\n\t\t\tpublic void reporte() {\n\r\n\t\t\t}", "private static void benvenuto() {\n\t\tUtilityIO.header(MSG_BENVENUTO, SIMBOLO_MESSAGGIO_BENV_USCITA);\n\t\tSystem.out.println();\n\t\t\n\t}", "private void exportarDatos() {\r\n // Cabecera\r\n System.out.println(\"Exportación de Datos\");\r\n System.out.println(\"====================\");\r\n\r\n // Acceso al Fichero\r\n try (PrintWriter pr = new PrintWriter(DEF_NOMBRE_FICHERO)) {\r\n // Bucle de Escritura\r\n for (Item item : CARRITO) {\r\n // Generar Linea de Texto\r\n String linea = String.format(Locale.ENGLISH, \"%d%s%s%s%.2f%s%s\",\r\n item.getId(), REG_CSV_ESCR,\r\n item.getNombre(), REG_CSV_ESCR,\r\n item.getPrecio(), REG_CSV_ESCR,\r\n UtilesGraficos.obtenerNombreColor(item.getColor()));\r\n\r\n // Item > Fichero\r\n pr.println(linea);\r\n }\r\n\r\n // Mensaje Informativo\r\n UtilesEntrada.hacerPausa(\"Datos exportados correctamente\");\r\n } catch (NumberFormatException | NullPointerException e) {\r\n // Mensaje Informativo\r\n UtilesEntrada.hacerPausa(\"ERROR: Formato de datos incorrecto\");\r\n\r\n // Vaciado Carrito\r\n CARRITO.clear();\r\n } catch (IOException e) {\r\n // Mensaje Informativo\r\n UtilesEntrada.hacerPausa(\"ERROR: Acceso al fichero\");\r\n }\r\n }", "public static void CreateReport() {\n\t\tString fileName = new SimpleDateFormat(\"'Rest_Country_Report_'YYYYMMddHHmm'.html'\").format(new Date());\n\t\tString path = \"Report/\" + fileName;\n\t\treport = new ExtentReports(path);\n\t}", "@Override\n\tprotected void createCompHeader() {\n\t\tString headerTxt = \"Cohorts Report\";\n\t\tiDartImage icoImage = iDartImage.PAVAS;\n\t\tbuildCompdHeader(headerTxt, icoImage);\n\t}", "public String generarReporte (HttpServletRequest request,\n HttpServletResponse response) throws IOException {\n Empresa empresaSesion = (Empresa)request.getSession().getAttribute(\"emp\");\n String simbolo_moneda;\n \n if (empresaSesion != null && empresaSesion.getSimboloMoneda() != null && \n !empresaSesion.getSimboloMoneda().isEmpty()) {\n simbolo_moneda = empresaSesion.getSimboloMoneda();\n } else {\n simbolo_moneda = \"$\";\n }\n \n // Se restauran variables iniciadas\n ReporteUtil.restaurarValores();\n \n String tipoReporte = request.getParameter(\"tipoReporte\");\n String fechaInicio = request.getParameter(\"fechaInicio\");\n String fechaFinal = request.getParameter(\"fechaFinal\");\n String placa = request.getParameter(\"splaca\"); // id,placa,numInterno\n String mplaca = request.getParameter(\"smplaca_v\");\n String esteDia = request.getParameter(\"esteDia\");\n String tipoArchivo = request.getParameter(\"tipoArchivo\");\n String ruta = request.getParameter(\"sruta\");\n String mruta = request.getParameter(\"smruta_v\");\n String malarma = request.getParameter(\"smalarma_v\");\n String base = request.getParameter(\"sbase\");\n String idLiquidador = request.getParameter(\"sliquidador\");\n String meta = request.getParameter(\"smeta\");\n String mconductor = request.getParameter(\"smconductor_v\"); \n \n boolean dia_actual = verificarDiaActual(fechaInicio, fechaFinal);\n \n// Etiquetas etiquetas = null;\n// etiquetas = LiquidacionBD.searchTags();\n ConfiguracionLiquidacion etiquetas = obtenerEtiquetasLiquidacionPerfil(request);\n \n if (etiquetas != null) {\n ReporteUtil.establecerEtiquetas(etiquetas);\n } \n \n //String reportesPath = \"D:\\\\rdw\\\\\"; \n \n // En caso de estar sobre un SO_WIN, se quita ultimo delimitador\n String reportesPath = getServletContext().getRealPath(\"\");\n if (reportesPath.endsWith(\"\\\\\")) {\n reportesPath = reportesPath.substring(0, reportesPath.length()-1); \n }\n \n Map<String,String> h = new HashMap<String,String>();\n \n h.put(\"tipoReporte\", tipoReporte);\n h.put(\"fechaInicio\", fechaInicio);\n h.put(\"fechaFinal\", fechaFinal); \n h.put(\"tipoArchivo\", tipoArchivo);\n h.put(\"path\", reportesPath); \n \n \n // Informacion de usuario en sesion\n HttpSession session = request.getSession(); \n Usuario u = (Usuario) session.getAttribute(\"login\");\n \n h.put(\"idUsuario\", \"\" + u.getId());\n h.put(\"nombreUsuario\", u.getNombre() +\" \"+ u.getApellido());\n h.put(\"usuarioPropietario\", (u.esPropietario()) ? \"1\" : \"0\");\n \n // Nombre y titulo del reporte\n String nt[] = nombreReporte(tipoReporte, dia_actual).split(\":\");\n \n // Verifica si se considera una o todas las rutas\n // para reportes nivel_ocupacion, despachador, descripcion ruta,\n // cumplimiento ruta por conductor\n int ntp = Integer.parseInt(tipoReporte);\n if (ntp == 5 || ntp == 14 || ntp == 16) {\n if (!ruta.equals(\"0\")) { // Se elige una ruta\n nt[0] += \"_X1Ruta\";\n h.put(\"unaRuta\", \"t\");\n } else {\n h.put(\"unaRuta\", \"f\");\n }\n } \n if (ntp == 25) {\n String una_ruta = (!ruta.equals(\"0\")) ? \"t\" : \"f\";\n h.put(\"unaRuta\", una_ruta);\n }\n \n h.put(\"nombreReporte\", nt[0]);\n h.put(\"tituloReporte\", nt[1]);\n \n // Verifica si es reporte gerencia, gerencia x vehiculo para incluir\n // todos los vehiculos o todas las rutas\n ReporteUtil.incluirTotalidadRutas = false;\n ReporteUtil.incluirTotalidadVehiculos = false;\n ReporteUtil.incluirVehiculosPropietario = false;\n \n if (ntp == 15) {\n ReporteUtil.incluirTotalidadVehiculos = true; \n } else if (ntp == 18) {\n ReporteUtil.incluirTotalidadRutas = true;\n } else if (ntp == 11) {\n if (u.esPropietario()) { \n ReporteUtil.incluirVehiculosPropietario = true;\n } else {\n ReporteUtil.incluirTotalidadVehiculos = true; \n }\n }\n \n // Verifica si es reporte ruta x vehiculo para generar\n // reporte desde codigo\n if (ntp == 3) { \n ReporteUtil.desdeCodigo = true;\n } else {\n ReporteUtil.desdeCodigo = false;\n }\n \n // Verifica si es reporte ruta x vehiculo, vehiculo x ruta, despachador\n // para establecer un dia en parametro fecha y no un rango\n if (ntp == 3 || ntp == 11 || ntp == 16) {\n h.put(\"fechaFinal\", fechaInicio);\n } \n \n // No se necesitan fechas para reporte estadistico y descripcion ruta\n if (ntp == 13 || ntp == 14) {\n h.put(\"fechaInicio\", \"\");\n h.put(\"fechaFinal\", \"\");\n }\n \n // Eleccion de reportes gerencia segun empresa\n if (ntp == 15 || ntp == 18) {\n String empresa = u.getNombreEmpresa();\n String nombre_reporte = h.get(\"nombreReporte\");\n if (ReporteUtil.esEmpresa(empresa, ReporteUtil.EMPRESA_FUSACATAN)) {\n nombre_reporte += \"Fusa\";\n h.put(\"nombreReporte\", nombre_reporte);\n } \n }\n \n // Reportes de liquidacion\n if (ntp == 19 || ntp == 20 || ntp == 21 || ntp == 22) { \n h.put(\"fechaInicio\", fechaInicio + \" 00:00:00\");\n h.put(\"fechaFinal\", fechaFinal + \" 23:59:59\");\n \n //System.out.println(\"---> \"+EtiquetasLiquidacion.getEtq_total1() );\n /*SI EL REPORTE ES LIQUIDACION POR LIQUIDADOR SE MODIFICA EL NOMBRE SI LA EMPRESA ES DIFERENTE DE NEIVA*/\n if (ntp == 21) {\n if ((u.getNombreEmpresa().equalsIgnoreCase(\"FUSACATAN\")) || \n (u.getNombreEmpresa().equalsIgnoreCase(\"TIERRA GRATA\")) || \n (u.getNombreEmpresa().equalsIgnoreCase(\"Tierragrata\"))) {\n h.put(\"nombreReporte\", \"Reporte_LiquidacionXLiquidador_new_dcto\"); \n }\n }\n \n if (tipoArchivo.equals(\"w\")) {\n Usuario liquidador = UsuarioBD.getById(Restriction.getNumber(idLiquidador));\n if (liquidador != null) { \n String nom = liquidador.getNombre();\n String ape = liquidador.getApellido(); \n h.put(\"idUsuarioLiquidador\", idLiquidador);\n h.put(\"nombresUsuarioLiquidador\", ape + \" \" + nom);\n }\n } else {\n h.put(\"idUsuario\", idLiquidador);\n }\n } \n \n if (ntp == 23 || ntp == 24 || ntp == 25) {\n h.put(\"meta\", \"\" + meta);\n if (tipoArchivo.equals(\"r\")) {\n ReporteUtil.reporteWeb = true;\n }\n }\n \n if (ntp == 26 || ntp == 27) {\n h.put(\"fechaInicio\", fechaInicio);\n h.put(\"fechaFinal\", fechaFinal);\n ReporteUtil.reporteWeb = true;\n } \n \n // ======================= Verificacion de campos ======================\n \n // Id, placa, numeroInterno vehiculo\n if (placa.indexOf(\",\") >= 0) {\n h.put(\"idVehiculo\", placa.split(\",\")[0]);\n h.put(\"placa\", placa.split(\",\")[1]);\n h.put(\"numInterno\", placa.split(\",\")[2]);\n h.put(\"capacidad\", placa.split(\",\")[3]);\n ReporteUtil.incluirVehiculo = true;\n } else\n ReporteUtil.incluirVehiculo = false;\n \n // Id de multiples vehiculos\n if (mplaca != \"\" || mplaca.indexOf(\",\") >= 0) {\n h.put(\"strVehiculos\", mplaca);\n h.put(\"strVehiculosPlaca\", id2placa(mplaca));\n ReporteUtil.incluirVehiculos = true;\n } else\n ReporteUtil.incluirVehiculos = false;\n \n // Id ruta y nombre ruta\n if (ruta.indexOf(\",\") >= 0) {\n String arrayRuta[] = ruta.split(\",\");\n h.put(\"idRuta\", arrayRuta[0]);\n h.put(\"nombreRuta\", arrayRuta[1]);\n ReporteUtil.incluirRuta = true;\n } else \n ReporteUtil.incluirRuta = false;\n \n // Id ruta \n if (mruta != \"\" || mruta.indexOf(\",\") >= 0) {\n h.put(\"strRutas\", mruta);\n ReporteUtil.incluirRutas = true;\n } else\n ReporteUtil.incluirRutas = false;\n \n // Id alarma\n if (malarma != \"\" || malarma.indexOf(\",\") >= 0) {\n h.put(\"strAlarmas\", malarma);\n ReporteUtil.incluirAlarma = true;\n } else \n ReporteUtil.incluirAlarma = false; \n \n // Id base, nombre\n if (base.indexOf(\",\") >= 0) {\n String arrayBase[] = base.split(\",\");\n h.put(\"idBase\", arrayBase[0]);\n h.put(\"nombreBase\", arrayBase[1]);\n ReporteUtil.incluirBase = true;\n } else \n ReporteUtil.incluirBase = false; \n \n // Se verifica y establece parametros de empresa\n Empresa emp = EmpresaBD.getById(u.getIdempresa()); \n if (emp != null) {\n h.put(\"nombreEmpresa\", emp.getNombre());\n h.put(\"nitEmpresa\", emp.getNit());\n h.put(\"idEmpresa\", \"\" + emp.getId());\n } else {\n request.setAttribute(\"msg\", \"* Usuario no tiene relaci&oacute;n y/o permisos adecuados con la empresa.\");\n request.setAttribute(\"msgType\", \"alert alert-warning\");\n return \"/app/reportes/generaReporte.jsp\";\n }\n \n int id_ruta = Restriction.getNumber(h.get(\"idRuta\")); \n String pplaca = \"'\" + h.get(\"placa\") + \"'\";\n \n // Se verifica si existe despacho para cruzar sus datos,\n // en caso contrario se extrae los datos unicamente desde tabla info. registradora\n if (ntp == 3) {\n if (!DespachoBD.existe_planilla_en(fechaInicio, pplaca)) {\n ReporteUtil.desdeCodigo = true; \n h.put(\"nombreReporte\", \"reporte_RutaXVehiculo2\");\n h.put(\"cruzarDespacho\", \"0\"); \n } else {\n ReporteUtil.desdeCodigo = false; // Reporte con cruce despacho es dinamico\n h.put(\"cruzarDespacho\", \"1\"); \n }\n }\n if (ntp == 11) {\n if (!DespachoBD.existe_planilla_en(fechaInicio, id_ruta)) {\n h.put(\"nombreReporte\", \"reporte_VehiculosXRuta\");\n h.put(\"cruzarDespacho\", \"0\"); \n } else {\n h.put(\"cruzarDespacho\", \"1\");\n }\n }\n \n if (ntp == 30) {\n h.put(\"fechaInicio\", fechaInicio);\n h.put(\"fechaFinal\", fechaFinal);\n h.put(\"strConductores\", mconductor);\n ReporteUtil.reporteWeb = true;\n \n // Se verifica que exista una configuracion de desempeno activa\n ConfCalificacionConductor ccc = CalificacionConductorBD.confCalificacionConductor();\n if (ccc == null) {\n request.setAttribute(\"msg\", \"* No existe ninguna configuraci&oacute;n de desempe&ntilde;o registrada. Por favor registre una.\");\n request.setAttribute(\"msgType\", \"alert alert-warning\");\n request.setAttribute(\"result_error\", \"1\");\n return \"/app/reportes/generaReporte.jsp\";\n }\n }\n \n // Creacion de reporte\n JasperPrint print = null;\n if (tipoArchivo.equals(\"r\")) {\n \n // Reporte de solo lectura << PDF / Web >>\n ReporteUtil rpt;\n \n if (ReporteUtil.reporteWeb) { \n ReporteWeb rptw = new ReporteWeb(h, request, response);\n return rptw.generarReporteWeb(ntp); \n \n } else if (ReporteUtil.desdeCodigo) {\n rpt = new ReporteUtil(h);\n print = rpt.generarReporteDesdeCodigo(Integer.parseInt(h.get(\"tipoReporte\")), simbolo_moneda);\n \n } else {\n rpt = new ReporteUtil(h);\n print = rpt.generarReporte(simbolo_moneda);\n }\n \n } else {\n \n // Reporte editable << XLS >>\n ReporteUtilExcel rue = new ReporteUtilExcel();\n MakeExcel rpte = rue.crearReporte(ntp, dia_actual, h, u, etiquetas);\n \n // Restablece placa de reportes que no necesitan\n restablecerParametro(\"placa\", ntp, h);\n String splaca = h.get(\"placa\");\n splaca = (splaca == null || splaca == \"\") ? \"\" : \"_\" + splaca;\n String nombreArchivo = h.get(\"nombreReporte\") + splaca + \".xls\";\n \n //response.setContentType(\"application/vnd.ms-excel\");\n response.setContentType(\"application/ms-excel\"); \n response.setHeader(\"Content-Disposition\", \"attachment; filename=\"+nombreArchivo);\n \n HSSFWorkbook file = rpte.getExcelFile();\n file.write(response.getOutputStream()); \n response.flushBuffer();\n response.getOutputStream().close();\n \n return \"/app/reportes/generaReporte.jsp\";\n }\n \n // Impresion de reporte de solo lectura PDF\n if (print != null) {\n \n try { \n // Se comprueba existencia de datos en el reporte obtenido\n boolean hayDatos = true;\n List<JRPrintPage> pp = print.getPages(); \n if (pp.size() > 0) {\n JRPrintPage ppp = pp.get(0);\n if (ppp.getElements().size() <= 0) \n hayDatos = false; \n } else \n hayDatos = false;\n \n if (!hayDatos) {\n request.setAttribute(\"msg\", \"* Ning&uacute;n dato obtenido en el reporte.\");\n request.setAttribute(\"msgType\", \"alert alert-warning\");\n request.setAttribute(\"data_reporte\", \"1\");\n return \"/app/reportes/generaReporte.jsp\";\n }\n \n byte[] bytes = JasperExportManager.exportReportToPdf(print);\n \n // Inicia descarga del reporte\n response.setContentType(\"application/pdf\");\n response.setContentLength(bytes.length);\n ServletOutputStream outStream = response.getOutputStream();\n outStream.write(bytes, 0, bytes.length);\n outStream.flush();\n outStream.close();\n \n } catch (JRException e) {\n System.err.println(e);\n } catch (IOException e) {\n System.err.println(e);\n } \n }\n return \"/app/reportes/generaReporte.jsp\";\n }", "@Override\n\tpublic void apagar() {\n\t\tSystem.out.println(\"Apagando Computadora\");\n\t}", "protected String elaboraFooter() {\n String testo = A_CAPO;\n boolean nascosta = pref.isBool(FlowCost.USA_DEBUG);\n String cat;\n\n if (usaNote) {\n testo += usaNote();\n }// end of if cycle\n\n if (usaVociCorrelate) {\n testo += usaVociCorrelate();\n }// end of if cycle\n\n testo += LibWiki.setPortale(tagHeadTemplateProgetto);\n cat = tagCategoria;\n cat = nascosta ? LibWiki.setNowiki(cat) : cat;\n testo += cat;\n\n return testo;\n }", "public void dataPadrao() {\n Calendar c = Calendar.getInstance();\n SimpleDateFormat s = new SimpleDateFormat(\"dd/MM/yyyy\");\n String dataAtual = s.format(c.getTime());\n c.add(c.MONTH, 1);\n String dataAtualMaisUm = s.format(c.getTime());\n dataInicial.setText(dataAtual);\n dataFinal.setText(dataAtualMaisUm);\n }", "private static void saluti() {\n\t\tUtilityIO.header(MSG_CHIUSURA, SIMBOLO_MESSAGGIO_BENV_USCITA);\n\t\tSystem.out.println();\n\t}", "public static void createReportICD10(String title, String date) {\n try {\n Document document = new Document(PageSize.A5.rotate());\n PdfWriter.getInstance(document, new FileOutputStream(title));\n document.open();\n addMetaDataICD10(document);\n addTitleICD10(document, date);\n addDataICD10(document, date);\n addFooterICD10(document);\n document.close();\n\n PrintTest2.print3(title);\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public mbvConsolidadoPeriodoAnteriores() {\r\n }", "protected JRDataSource getJRDataSource()\r\n/* 82: */ {\r\n/* 83:106 */ JRDataSource ds = null;\r\n/* 84:107 */ List<Object[]> listaDatosReporte = new ArrayList();\r\n/* 85:108 */ listaDatosReporte = this.servicioReportePresupuesto.getReportePresupuesto(getEjercicio(), getMesSeleccionado(), this.cantDigitos, this.dimensionContable, \r\n/* 86:109 */ getListaDimensionContable(), this.tipoReporte.ordinal(), AppUtil.getUsuarioEnSesion().getIdUsuario(), AppUtil.getOrganizacion()\r\n/* 87:110 */ .getIdOrganizacion());\r\n/* 88: */ String[] fields;\r\n/* 89: */ String[] fields;\r\n/* 90:112 */ if ((this.tipoReporte.ordinal() == 1) && (this.mesSeleccionado != null)) {\r\n/* 91:113 */ fields = new String[] { \"f_ejercicioNombre\", \"f_dimensionCodigo\", \"f_dimensionNombre\", \"f_cuentaContableCodigo\", \"f_cuentaContableNombre\", \"f_valorMes\", \"f_transferenciasIngreso\", \"f_transferenciasEgreso\", \"f_incrementos\", \"f_decrementos\" };\r\n/* 92: */ } else {\r\n/* 93:117 */ fields = new String[] { \"f_ejercicioNombre\", \"f_dimensionCodigo\", \"f_dimensionNombre\", \"f_cuentaContableCodigo\", \"f_cuentaContableNombre\", \"f_valorEnero\", \"f_valorFebrero\", \"f_valorMarzo\", \"f_valorAbril\", \"f_valorMayo\", \"f_valorJunio\", \"f_valorJulio\", \"f_valorAgosto\", \"f_valorSeptiembre\", \"f_valorOctubre\", \"f_valorNoviembre\", \"f_valorDiciembre\", \"f_transfereciasIngresosEnero\", \"f_transfereciasEgresosEnero\", \"f_incrementosEnero\", \"f_decrementosEnero\", \"f_transfereciasIngresosFebrero\", \"f_transfereciasEgresosFebrero\", \"f_incrementosFebrero\", \"f_decrementosFebrero\", \"f_transfereciasIngresosMarzo\", \"f_transfereciasEgresosMarzo\", \"f_incrementosMarzo\", \"f_decrementosMarzo\", \"f_transfereciasIngresosAbril\", \"f_transfereciasEgresosAbril\", \"f_incrementosAbril\", \"f_decrementosAbril\", \"f_transfereciasIngresosMayo\", \"f_transfereciasEgresosMayo\", \"f_incrementosMayo\", \"f_decrementosMayo\", \"f_transfereciasIngresosJunio\", \"f_transfereciasEgresosJunio\", \"f_incrementosJunio\", \"f_decrementosJunio\", \"f_transfereciasIngresosJulio\", \"f_transfereciasEgresosJulio\", \"f_incrementosJulio\", \"f_decrementosJulio\", \"f_transfereciasIngresosAgosto\", \"f_transfereciasEgresosAgosto\", \"f_incrementosAgosto\", \"f_decrementosAgosto\", \"f_transfereciasIngresosSeptiembre\", \"f_transfereciasEgresosSeptiembre\", \"f_incrementosSeptiembre\", \"f_decrementosSeptiembre\", \"f_transfereciasIngresosOctubre\", \"f_transfereciasEgresosOctubre\", \"f_incrementosOctubre\", \"f_decrementosOctubre\", \"f_transfereciasIngresosNoviembre\", \"f_transfereciasEgresosNoviembre\", \"f_incrementosNoviembre\", \"f_decrementosNoviembre\", \"f_transfereciasIngresosDiciembre\", \"f_transfereciasEgresosDiciembre\", \"f_incrementosDiciembre\", \"f_decrementosDiciembre\" };\r\n/* 94: */ }\r\n/* 95:133 */ ds = new QueryResultDataSource(listaDatosReporte, fields);\r\n/* 96: */ \r\n/* 97:135 */ return ds;\r\n/* 98: */ }", "public void reporteIngresosCliente(Date fechaInicial, Date fechaFinal,TablaModelo modeloConsumos, TablaModelo modeloAlojamientos,String dpiCliente){\n introducirConsumosClienteFechas(fechaInicial, fechaFinal, modeloConsumos, dpiCliente);\n introducirPagosALojamientoClienteFechas(fechaInicial, fechaFinal, modeloAlojamientos, dpiCliente);\n }", "public void gerarRelatorioPaciente() {\n Document documento = new Document(PageSize.A4.rotate());\n \n //Defina as margens\n documento.setMargins(40f, 40f, 150f, 40f);\n \n try {\n CabecalhoRodapeEvento inserircabecalho = new CabecalhoRodapeEvento();\n \n //Cria um arquivo relatorio.pdf com o documento\n PdfWriter.getInstance(documento, new FileOutputStream(\"relatorioPaciente.pdf\")).setPageEvent(inserircabecalho);\n \n documento.open();\n \n Paragraph tituloDoRelatorio = new Paragraph(new Phrase(20F, \"RELATÓRIO DOS PACIENTES CADASTRADOS\",\n FontFactory.getFont(FontFactory.HELVETICA_BOLD, 15F)));\n tituloDoRelatorio.setAlignment(Element.ALIGN_CENTER);\n\n documento.add(tituloDoRelatorio);\n \n Table tabelaPacientes = new Table(7);\n tabelaPacientes.setBorder(10);\n tabelaPacientes.setBorderWidth(2);\n tabelaPacientes.setBorderColor(Color.black);\n tabelaPacientes.setPadding(2);\n //tabelaPacientes.setSpacing(0);\n tabelaPacientes.setWidth(100f);\n tabelaPacientes.setWidths(new float[]{5f, 10f, 25f, 7f, 13f, 28f, 12f});\n \n Paragraph paragrafoId = new Paragraph(new Phrase(12F, \"ID\",\n FontFactory.getFont(FontFactory.HELVETICA_BOLD, 10F)));\n paragrafoId.setAlignment(Element.ALIGN_CENTER);\n \n Paragraph paragrafoCpf = new Paragraph(new Phrase(12F, \"CPF\",\n FontFactory.getFont(FontFactory.HELVETICA_BOLD, 10F)));\n paragrafoCpf.setAlignment(Element.ALIGN_CENTER);\n \n Paragraph paragrafoNome = new Paragraph(new Phrase(12F, \"NOME\",\n FontFactory.getFont(FontFactory.HELVETICA_BOLD, 10F)));\n paragrafoNome.setAlignment(Element.ALIGN_CENTER);\n \n Paragraph paragrafoSexo = new Paragraph(new Phrase(12F, \"SEXO\",\n FontFactory.getFont(FontFactory.HELVETICA_BOLD, 10F)));\n paragrafoSexo.setAlignment(Element.ALIGN_CENTER);\n \n Paragraph paragrafoTelefone = new Paragraph(new Phrase(12F, \"TELEFONE\",\n FontFactory.getFont(FontFactory.HELVETICA_BOLD, 10F)));\n paragrafoTelefone.setAlignment(Element.ALIGN_CENTER);\n \n Paragraph paragrafoEndereco = new Paragraph(new Phrase(12F, \"ENDEREÇO\",\n FontFactory.getFont(FontFactory.HELVETICA_BOLD, 10F)));\n paragrafoEndereco.setAlignment(Element.ALIGN_CENTER);\n \n Paragraph paragrafoDataNascimento = new Paragraph(new Phrase(12F, \"DATA NASCIMENTO\",\n FontFactory.getFont(FontFactory.HELVETICA_BOLD, 10F)));\n paragrafoDataNascimento.setAlignment(Element.ALIGN_CENTER);\n \n Cell celulaPacienteId = new Cell(paragrafoId);\n Cell celulaPacienteCpf = new Cell(paragrafoCpf);\n Cell celulaPacienteNome = new Cell(paragrafoNome);\n Cell celulaPacienteSexo = new Cell(paragrafoSexo);\n Cell celulaPacienteTelefone = new Cell(paragrafoTelefone);\n Cell celulaPacienteEndereco = new Cell(paragrafoEndereco);\n Cell celulaPacienteDataNascimento = new Cell(paragrafoDataNascimento);\n \n celulaPacienteId.setHeader(true);\n tabelaPacientes.addCell(celulaPacienteId);\n tabelaPacientes.addCell(celulaPacienteCpf);\n tabelaPacientes.addCell(celulaPacienteNome);\n tabelaPacientes.addCell(celulaPacienteSexo);\n tabelaPacientes.addCell(celulaPacienteTelefone);\n tabelaPacientes.addCell(celulaPacienteEndereco);\n tabelaPacientes.addCell(celulaPacienteDataNascimento);\n \n //definindo alinhamento, cores do cabeçalho da tabela\n for (int i = 0; i < tabelaPacientes.getColumns(); i++) {\n\n Cell celula = (Cell) tabelaPacientes.getElement(0, i);\n celula.setHorizontalAlignment(Element.ALIGN_CENTER);\n celula.setBackgroundColor(Color.yellow);\n celula.setBorderColor(Color.black);\n\n }\n \n for(Paciente paciente : listarTodosPacientes()) {\n paragrafoId = new Paragraph(new Phrase(15F, \"\"+ paciente.getId(),\n FontFactory.getFont(FontFactory.HELVETICA, 9F)));\n paragrafoId.setAlignment(Element.ALIGN_CENTER);\n celulaPacienteId = new Cell(paragrafoId);\n celulaPacienteId.setBorderColor(Color.black);\n celulaPacienteId.setHorizontalAlignment(Element.ALIGN_CENTER);\n tabelaPacientes.addCell(celulaPacienteId);\n \n paragrafoCpf = new Paragraph(new Phrase(15F, \"\"+ paciente.getCpf(),\n FontFactory.getFont(FontFactory.HELVETICA, 9F)));\n paragrafoCpf.setAlignment(Element.ALIGN_CENTER);\n celulaPacienteCpf = new Cell(paragrafoCpf);\n celulaPacienteCpf.setBorderColor(Color.black);\n celulaPacienteCpf.setHorizontalAlignment(Element.ALIGN_CENTER);\n tabelaPacientes.addCell(celulaPacienteCpf);\n \n paragrafoNome = new Paragraph(new Phrase(15F, \"\"+ paciente.getNome(),\n FontFactory.getFont(FontFactory.HELVETICA, 9F)));\n paragrafoNome.setAlignment(Element.ALIGN_CENTER);\n celulaPacienteNome = new Cell(paragrafoNome);\n celulaPacienteNome.setBorderColor(Color.black);\n celulaPacienteNome.setHorizontalAlignment(Element.ALIGN_LEFT);\n tabelaPacientes.addCell(celulaPacienteNome);\n \n paragrafoSexo = new Paragraph(new Phrase(15F, \"\"+ paciente.getSexo(),\n FontFactory.getFont(FontFactory.HELVETICA, 9F)));\n paragrafoSexo.setAlignment(Element.ALIGN_CENTER);\n celulaPacienteSexo = new Cell(paragrafoSexo);\n celulaPacienteSexo.setBorderColor(Color.black);\n celulaPacienteSexo.setHorizontalAlignment(Element.ALIGN_CENTER);\n tabelaPacientes.addCell(celulaPacienteSexo);\n \n paragrafoTelefone = new Paragraph(new Phrase(15F, paciente.getTelefone(),\n FontFactory.getFont(FontFactory.HELVETICA, 9F)));\n paragrafoTelefone.setAlignment(Element.ALIGN_CENTER);\n celulaPacienteTelefone = new Cell(paragrafoTelefone);\n celulaPacienteTelefone.setBorderColor(Color.black);\n celulaPacienteTelefone.setHorizontalAlignment(Element.ALIGN_CENTER);\n tabelaPacientes.addCell(celulaPacienteTelefone);\n \n paragrafoEndereco = new Paragraph(new Phrase(15F, paciente.getEndereco(),\n FontFactory.getFont(FontFactory.HELVETICA, 9F)));\n paragrafoEndereco.setAlignment(Element.ALIGN_CENTER);\n celulaPacienteEndereco = new Cell(paragrafoEndereco);\n celulaPacienteEndereco.setBorderColor(Color.black);\n celulaPacienteEndereco.setHorizontalAlignment(Element.ALIGN_CENTER);\n tabelaPacientes.addCell(celulaPacienteEndereco);\n \n paragrafoDataNascimento = new Paragraph(new Phrase(15F, \"\"+ sdf.format(paciente.getDataDeNascimento()),\n FontFactory.getFont(FontFactory.HELVETICA, 9F)));\n paragrafoDataNascimento.setAlignment(Element.ALIGN_CENTER);\n celulaPacienteDataNascimento = new Cell(paragrafoDataNascimento);\n celulaPacienteDataNascimento.setBorderColor(Color.black);\n celulaPacienteDataNascimento.setHorizontalAlignment(Element.ALIGN_CENTER);\n tabelaPacientes.addCell(celulaPacienteDataNascimento);\n \n } \n \n documento.add(tabelaPacientes);\n \n Runtime.getRuntime().exec(new String[]{\"cmd.exe\", \"/c\", \"start\", \"relatorioPaciente.pdf\"});\n \n documento.close();\n \n } catch (DocumentException ex) {\n System.out.println(ex);\n } catch (FileNotFoundException ex) {\n System.out.println(ex);\n } catch (IOException ex) {\n System.out.println(ex);\n } catch (SQLException ex) {\n System.out.println(ex);\n }\n }", "@Override\n public List<OmOrderHeaders> printPDF(IRequest requestCtx, @StdWho List<OmOrderHeaders> States) {\n PDFReport pdfPrint = new PDFReport();\n\n OmOrderHeaders notice=null;\n //List<OmOrderHeaders> trade=new ArrayList<OmOrderHeaders>();\n\n for (OmOrderHeaders state : States) {\n if (state.getHeaderId() != null) {\n notice=state;\n }\n }\n\n File file = new File(\"C:\\\\Users\\\\PB\\\\Desktop\\\\\"+notice.getOrderNumber()+\".pdf\");\n List<OmOrderLines> omOrderLines = omOrderLinesMapper.selectSumPrice(notice);\n\n\n try {\n\n BaseFont bfChinese=PDFReport.bfChinese;\n Font headfont =PDFReport.headfont;\n Font keyfont=PDFReport.keyfont;\n Font textfont=PDFReport.textfont;\n\n file.createNewFile();\n Document document = new Document();\n\n document.setPageSize(PageSize.A4);\n PdfWriter.getInstance(document, new FileOutputStream(file));\n document.open();\n PdfPTable table= pdfPrint.createTable(6);\n\n table.addCell(pdfPrint.createCell(\".订单打印:\", headfont, Element.ALIGN_LEFT,6,false));\n table.addCell(pdfPrint.createCell(\" \", keyfont, Element.ALIGN_LEFT,6,false));\n table.addCell(pdfPrint.createCell(\" \", keyfont, Element.ALIGN_LEFT,6,false));\n\n\n table.addCell(pdfPrint.createCell(\"订单编号:\", keyfont, Element.ALIGN_RIGHT,0,false));\n //table.addCell(pdfPrint.createCell(notice.getOrderNumber(), textfont, Element.ALIGN_CENTER));\n table.addCell(pdfPrint.createCell(notice.getOrderNumber(), textfont,Element.ALIGN_LEFT));\n table.addCell(pdfPrint.createCell(\"公司名称:\", keyfont, Element.ALIGN_RIGHT,0,false));\n OrgCompanys orgCompanys = orgCompanysMapper.selectByPrimaryKey(notice.getCompanyId());\n table.addCell(pdfPrint.createCell(orgCompanys.getCompanyName(), textfont, Element.ALIGN_LEFT));\n ArCustomers arCustomers = arCustomersMapper.selectByPrimaryKey(notice.getCustomerId());\n table.addCell(pdfPrint.createCell(\"客户名称:\", keyfont, Element.ALIGN_RIGHT,0,false));\n table.addCell(pdfPrint.createCell(arCustomers.getCustomerName(), textfont, Element.ALIGN_LEFT));\n table.addCell(pdfPrint.createCell(\" \", keyfont, Element.ALIGN_LEFT,6,false));\n\n\n table.addCell(pdfPrint.createCell(\"订单日期:\", keyfont, Element.ALIGN_RIGHT,0,false));\n table.addCell(pdfPrint.createCell(new SimpleDateFormat(\"yyyy/MM/dd\").format(notice.getOrderDate()), textfont, Element.ALIGN_LEFT));\n long sum = 0;\n for(int i=0;i<omOrderLines.size();i++) {\n OmOrderLines ot = new OmOrderLines();\n ot = omOrderLines.get(i);\n sum = sum + ot.getOrderdQuantity()*ot.getUnitSellingPrice();\n\n }\n\n\n table.addCell(pdfPrint.createCell(\"订单总金额:\", keyfont, Element.ALIGN_RIGHT,0,false));\n table.addCell(pdfPrint.createCell(String.valueOf(sum), textfont, Element.ALIGN_LEFT));\n table.addCell(pdfPrint.createCell(\"订单状态:\", keyfont, Element.ALIGN_RIGHT,0,false));\n String s=\"\";\n if(notice.getOrderStatus().equals(\"NEW\")){\n s=\"新建\";\n }else if(notice.getOrderStatus().equals(\"SUBMITED\")){\n s=\"已提交\";\n }else if(notice.getOrderStatus().equals(\"APPROVED\")){\n s=\"已审批\";\n }else if(notice.getOrderStatus().equals(\"REJECTED\")){\n s=\"已拒绝\";\n }\n table.addCell(pdfPrint.createCell(s, textfont, Element.ALIGN_LEFT));\n table.addCell(pdfPrint.createCell(\" \", keyfont, Element.ALIGN_LEFT,6,false));\n table.addCell(pdfPrint.createCell(\" \", keyfont, Element.ALIGN_LEFT,6,false));\n\n table.addCell(pdfPrint.createCell(\"主要:\", headfont, Element.ALIGN_LEFT,6,false));\n\t\ttable.addCell(pdfPrint.createCell(\"物料编码\", textfont, Element.ALIGN_CENTER));\n\t\ttable.addCell(pdfPrint.createCell(\"物料描述\", textfont, Element.ALIGN_CENTER));\n\t\ttable.addCell(pdfPrint.createCell(\"产品单位\", textfont, Element.ALIGN_CENTER));\n\t\ttable.addCell(pdfPrint.createCell(\"数量\", textfont, Element.ALIGN_CENTER));\n table.addCell(pdfPrint.createCell(\"销售单价\", textfont, Element.ALIGN_CENTER));\n table.addCell(pdfPrint.createCell(\"金额\", textfont, Element.ALIGN_CENTER));\n\n\t\tfor(int i=0;i<omOrderLines.size();i++){\n OmOrderLines ot = new OmOrderLines ();\n ot = omOrderLines.get(i);\n InvInventoryItems invInventoryItems = invInventoryItemsMapper.selectByPrimaryKey(ot.getInventoryItemId());\n\t\t\ttable.addCell(pdfPrint.createCell(invInventoryItems.getItemCode(), textfont));\n\t\t\ttable.addCell(pdfPrint.createCell(invInventoryItems.getItemDescription(), textfont));\n\t\t\ttable.addCell(pdfPrint.createCell(ot.getOrderQuantityUom(), textfont));\n\t\t\ttable.addCell(pdfPrint.createCell(String.valueOf(ot.getOrderdQuantity()), textfont));\n table.addCell(pdfPrint.createCell(String.valueOf(ot.getUnitSellingPrice()), textfont));\n table.addCell(pdfPrint.createCell(String.valueOf(ot.getOrderdQuantity()*ot.getUnitSellingPrice()), textfont));\n\t\t}\n\t\ttry {\n\t\t\tdocument.add(table);\n\n\t\t}catch(Exception e){e.printStackTrace(); }\n\n\t\tdocument.close();\n }catch(Exception e){e.printStackTrace();}\n\n\n return States;\n }", "public void limpiarReporte(){\n\n\t\tmodelo.setRowCount(0);\n\n\t}", "void genReport() {\n\n current_part.save_state(); \n\n JTextArea ta = text;\n\n ta.setText(\"\");\n\n if (!t_foil_name.equals(\"Test\"))\n ta.append(\"Hydrofoil: \" + t_foil_name);\n\n java.util.Date date = new java.util.Date();\n ta.append(\"\\n Date: \" + date);\n \n wing.print( \"Main Wing\", ta);\n stab.print( \"Stabilizer Wing\", ta);\n strut.print(\"Mast (a.k.a. Strut)\", ta);\n fuse.print( \"Fuselage\", ta);\n\n ta.append( \"\\n\\n\");\n // tail volume is LAElev * AreaElev / (MACWing * AreaWing)\n // LAElev : The elevator's Lever Arm measured at the wing's and elevator's quarter chord point\n double LAElev = stab.xpos + stab.chord_xoffs + 0.25*stab.chord - (wing.xpos + wing.chord_xoffs + 0.25*wing.chord);\n // MAC : The main wing's Mean Aerodynamic Chord\n // AreaWing : The main wing's area\n // AreaElev : The elevator's area\n \n ta.append( \"\\nTail Voulume: \" + LAElev*stab.span*stab.chord/(wing.chord*wing.chord*wing.span));\n \n\n ta.append( \"\\n\\n\");\n switch (planet) {\n case 0: { \n ta.append( \"\\n Standard Earth Atmosphere\" );\n break;\n }\n case 1: { \n ta.append( \"\\n Martian Atmosphere\" );\n break;\n }\n case 2: { \n ta.append( \"\\n Water\" );\n break;\n }\n case 3: { \n ta.append( \"\\n Specified Conditions\" );\n break;\n }\n case 4: { \n ta.append( \"\\n Specified Conditions\" );\n break;\n }\n }\n\n // ta.append( \"\\n Altitude = \" + filter0(alt_val) );\n // if (lunits == IMPERIAL) ta.append( \" ft ,\" );\n // else /*METRIC*/ ta.append( \" m ,\" );\n \n switch (lunits) {\n case 0: { /* English */\n ta.append( \"\\n Density = \" + filter5(rho_EN) );\n ta.append( \"slug/cu ft\" );\n ta.append( \"\\n Pressure = \" + filter3(ps0/144.) );\n ta.append( \"lb/sq in,\" );\n ta.append( \" Temperature = \" + filter0(ts0 - 460.) );\n ta.append( \"F,\" );\n break;\n }\n case 1: { /* Metric */\n ta.append( \" Density = \" + filter3(rho_EN*515.4) );\n ta.append( \"kg/cu m\" );\n ta.append( \"\\n Pressure = \" + filter3(101.3/14.7*ps0/144.) );\n ta.append( \"kPa,\" );\n ta.append( \" Temperature = \" + filter0(ts0*5.0/9.0 - 273.1) );\n ta.append( \"C,\" );\n break;\n }\n }\n\n ta.append( \"\\n Speed = \" + filter1(velocity * (lunits==IMPERIAL? 0.868976 : 0.539957 )) + \"Kts, or\" );\n ta.append( \" \" + filter1(velocity) );\n if (lunits == IMPERIAL) ta.append( \" mph ,\" );\n else /*METRIC*/ ta.append( \" km/hr ,\" );\n\n // if (out_aux_idx == 1)\n // ta.append( \"\\n Lift Coefficient = \" + filter3(current_part.cl) );\n // if (out_aux_idx == 0) {\n // if (Math.abs(lift) <= 10.0) ta.append( \"\\n Lift = \" + filter3(lift) );\n // if (Math.abs(lift) > 10.0) ta.append( \"\\n Lift = \" + filter0(lift) );\n // if (lunits == IMPERIAL) ta.append( \" lbs \" );\n // else /*METRIC*/ ta.append( \" Newtons \" );\n // }\n // if ( polarOut == 1)\n // ta.append( \"\\n Drag Coefficient = \" + filter3(current_part.cd) );\n // if (out_aux_idx == 0) {\n // ta.append( \"\\n Drag = \" + filter0(drag) );\n // if (lunits == IMPERIAL) ta.append( \" lbs \" );\n // else /*METRIC*/ ta.append( \" Newtons \" );\n // }\n\n ta.append( \"\\n Lift = \" + dash.outTotalLift.getText());\n ta.append( \"\\n Drag = \" + dash.outTotalDrag.getText());\n\n if (min_takeoff_speed_info != null) \n ta.append( \"\\n\\n\" + min_takeoff_speed_info);\n\n if (cruising_info != null) \n ta.append( \"\\n\\n\" + cruising_info);\n\n if (max_speed_info != null) \n ta.append( \"\\n\\n\" + max_speed_info);\n\n // ensure end ta.setCaretPosition(ta.getText().length());\n // ensure start\n ta.setCaretPosition(0);\n }", "public String reporteFinMesPre()\n\t{\n\t\tString m = new String();\n\t\tif(!this.clientes.isEmpty())\n\t\t{\n\t\t\tGregorianCalendar ff = new GregorianCalendar();\n\t\t\tCliente c = new Cliente();\n\t\t\tlong dur, durc, durt, totalcliente, totalcuenta, totalt;\n\t\t\tLLamada ll;\n\t\t\tCuenta p;\n\t\t\n\t\t\tListIterator<LLamada> itl;\n\t\t\tRecarga r;\n\t\t\tListIterator<Recarga> itr;\n\t\t\t\n\t\t\tSet<String> llaves = clientes.keySet();\n\t\t\tList<String> li = new ArrayList<String>(llaves);\n\t\t\tListIterator<String> it = li.listIterator();\n\t\t\tListIterator<Cuenta> cu;\n\t\t\tList<Cuenta> lista = new ArrayList<Cuenta>();\n\t\t\tList<Cliente> cli = new ArrayList<Cliente>();\n\t\t\tString s = new String();\n\t\t\t\n\t\t\twhile(it.hasNext())\n\t\t\t{\n\t\t\t\ts = it.next();\n\t\t\t\tif(clientes.get(s).tienePre())\n\t\t\t\t\tcli.add(clientes.get(s));\n\t\t\t}\n\t\t\t\n\t\t\tCollections.sort(cli, new CompararCedulasClientes());\n\n\t\t\t\n\t\t\tListIterator<Cliente> itc = cli.listIterator();\n\t\t\t\n\t\t\tList<LLamada> lisll = new ArrayList<LLamada>();\n\t\t\tList<Recarga> lisr = new ArrayList<Recarga>();\n\t\t\t\n\t\t\ttotalt = 0;\n\t\t\tdurt = 0;\n\t\t\twhile(itc.hasNext())\n\t\t\t{\n\t\t\t\ttotalcliente = 0;\n\t\t\t\tdurc = 0;\n\t\t\t\tc = itc.next();\n\t\t\t\tm += Utils.espacios(\"--CLIENTE: \", 12) + Utils.espacios(c.getNombre(), 15) + Utils.espacios(\", CC \",5) + Utils.espacios(String.valueOf(c.getCedula()), 10) + Utils.espacios(\", \", 3) + Utils.espacios(c.getDireccion(), 20) + \"\\n\";\n\t\t\t\t\n\t\t\t\tcu = c.getCuentas().listIterator(0);\n\t\t\t\tlista.clear();\n\t\t\t\twhile(cu.hasNext())\n\t\t\t\t{\n\t\t\t\t\tp = cu.next();\n\t\t\t\t\tif(p instanceof CuentaPrepago)\n\t\t\t\t\t\tlista.add(p);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tcu = lista.listIterator(0);\n\t\t\t\t\n\t\t\t\twhile(cu.hasNext())\n\t\t\t\t{\n\t\t\t\t\tp = cu.next();\n\t\t\t\t\tm += Utils.espacios(\" \", 4)+ Utils.espacios(\"Cuenta Postpago #\", 17) + Utils.espacios(String.valueOf(p.getId()), 5) + Utils.espacios(\": Num \", 6) + Utils.espacios(String.valueOf(p.getNumero()), 10) + Utils.espacios(\", Plan \", 7) + Utils.espacios(p.getPlan().getNombre(), 15) + \"\\n\\n\";\n\t\t\t\t\t//recargas\n\t\t\t\t\tm += Utils.espacios(\" \", 8) + Utils.espacios(\"Recargas: \", 11) + Utils.espacios(\"Fecha\", 15) + \"Valor\\n\";\n\t\t\t\t\ttotalcuenta = 0;\n\n\t\t\t\t\tlisr = ((CuentaPrepago)p).getRecargas();\n\t\t\t\t\tCollections.sort(lisll, new CompararRecargaFecha());\n\t\t\t\t\titr = lisr.listIterator(0);\n\t\t\t\t\t\n\t\t\t\t\twhile(itr.hasNext())\n\t\t\t\t\t{\n\t\t\t\t\t\tr = itr.next();\n\t\t\t\t\t\tif(r.getFechaRecarga().get(Calendar.MONTH) == ff.get(Calendar.MONTH) && r.getFechaRecarga().get(Calendar.YEAR) == ff.get(Calendar.YEAR))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tm += Utils.espacios(\" \", 19) + Utils.espacios(Utils.convertirFechaCadena(r.getFechaRecarga()), 15) + r.getValorRecarga() + \"\\n\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tm += Utils.espacios(\" \", 19) + Utils.espacios(\"TotalRecargas: ----------------------------\", 55) + Utils.espacios(String.valueOf(p.obtenerPagoCuenta(ff)),10) + \"\\n\";\n\n\t\t\t\t\t\n\n\t\t\t\t\ttotalcuenta += p.obtenerPagoCuenta(ff);\n\t\t\t\t\ttotalcliente += totalcuenta;\n\n\n\t\t\t\t\tm += Utils.espacios(\" \", 8) + Utils.espacios(\"Llamadas: \", 11)+ Utils.espacios(\"Fecha\", 15) + Utils.espacios(\"TelefonoDestinatario\", 21) + Utils.espacios(\"Duracion\",10 ) + Utils.espacios(\"Valor\", 8) +\"\\n\\n\";\n\t\t\t\t\tlisll = p.getLlamadas();\n\t\t\t\t\tCollections.sort(lisll, new CompararLLamadasFecha());\n\t\t\t\t\titl = lisll.listIterator(0);\n\t\t\t\t\t\n\t\t\t\t\ttotalcuenta = 0;\n\t\t\t\t\tdur =0;\n\t\t\t\t\twhile(itl.hasNext())\n\t\t\t\t\t{\n\t\t\t\t\t\tll = itl.next();\n\t\t\t\t\t\tif (ll.getFecha().get(Calendar.MONTH) == ff.get(Calendar.MONTH) && ll.getFecha().get(Calendar.YEAR) == ff.get(Calendar.YEAR))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\ttotalcuenta += ll.getValor();\n\t\t\t\t\t\t\tdur += ll.getDuracion();\n\t\t\t\t\t\t\tm += Utils.espacios(\" \",19) + Utils.espacios(Utils.convertirFechaCadena(ll.getFecha()), 16) + Utils.espacios(String.valueOf(ll.getTelefonoDestinatario()), 20) + Utils.espacios(String.valueOf(ll.getDuracion()), 10) + Utils.espacios(String.valueOf(ll.getValor()), 8) + \"\\n\";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdurc += dur;\n\t\t\t\t\tm += Utils.espacios(\" \", 19) + Utils.espacios(\"TotalLLamadas: ----------------------------\", 55) + Utils.espacios(String.valueOf(dur),10) + totalcuenta + \"\\n\";\n\n\n\n\n\t\t\t\t}\n\t\t\t\ttotalt += totalcliente;\n\t\t\t\tdurt += durc;\n\t\t\t\tm += Utils.espacios(\" \",8) + Utils.espacios(\"Total Cliente: ----------------------------\", 66) + Utils.espacios(String.valueOf(durc),10) + totalcliente + \"\\n\\n\\n\";\n\t\t\t}\n\n\t\t\tm += Utils.espacios(\"TOTAL TODOS LOS CLIENTES: -----------------------\", 64) + Utils.espacios(\"Duracion: \" + String.valueOf(durt),20) + \"Valor: \"+totalt + \"\\n\" + \"\\n\";\n\t\t}\n\t\treturn m;\n\t}", "public void crearPDF()\r\n\t{\r\n\t\tif (!new File(ruta).exists())\r\n\t\t\t(new File(ruta)).mkdirs();\r\n\r\n\t\tFile[] files = (new File(ruta)).listFiles();\r\n\t\tString ruta = \"\";\r\n\t\tif (files.length == 0) {\r\n\t\t\truta = this.ruta + huesped + \"0\" + \".pdf\";\r\n\t\t} else {\r\n\t\t\tString path = files[files.length - 1].getAbsolutePath();\r\n\t\t\tString num = path.substring(path.length() - 5, path.length() - 4);\r\n\r\n\t\t\truta = this.ruta + huesped + (Integer.parseInt(num) + 1) + \".pdf\";\r\n\t\t}\r\n\r\n\t\tSimpleDateFormat formato = new SimpleDateFormat(\"dd/MM/YYYY\");\r\n\t\t\r\n\t\tcabecera = \"\\n\"+\"Resonance Home\" + \"\\n\"+ \r\n \"Armenia, Quindio\" + \"\\n\" + \r\n \"Colombia\" + \"\\n\\n\" + \r\n\t\t\t\t\"Fecha \" + reserva.getFecha().toString() + \"\\n\\n\\n\";\r\n\t\tcontenido = \"Reserva de hospedaje: \"+ reserva.getHospedaje().getId() + \"\\n\" + \r\n \t\"Titulo del Hospedaje: \" + reserva.getHospedaje().getTitulo() + \" \" + \"\\n\" +\r\n \t\"Dirección: \" + reserva.getHospedaje().getDireccion().getDireccion() + \", \" + reserva.getHospedaje().getDireccion().toString() + \"\\n\" +\r\n\t\t\t\t\"Anfitrion: \" + nombreAnfitrion + \"\\n\" + \"Correo: \" + emailAnfitrion + \"\\n\\n\\n\" + \"Huesped: \"\r\n\t\t\t\t+ nombreHuesped + \"\\n\" +\r\n \t\"Metodo de pago: \" + reserva.getTarjeta().getNumeroT() + \" Tarjeta de credito\" + \"\\n\\n\" +\r\n \tformato.format(reserva.getFechaInicial()) + \" hasta \"+ formato.format(reserva.getFechaFinal()) +\"\\n\\n\" +\r\n \t\"Descripcion\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tvalor\" + \"\\n\\n\" + \r\n\t\t\t\t\"Huespedes\" + \"\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t \"\r\n\t\t\t\t+ reserva.getNumeroHuespedes() + \"\\n\" +\r\n\t\t\t\t\"Alojamiento\" + \"\t\t\t\t\t\t\t\t\t\t\t\t\t \" + precioCompleto + \"\\n\"\r\n\t\t\t\t+ \"Tarifa de limpieza\" + \"\t\t\t\t \t \" + precioLimpieza + \"\\n\" + \"Comision por servicio\"\r\n\t\t\t\t+ \"\t\t\t\t\t\" + precioComision + \"\\n\\n\";\r\n\t\tpiePagina = \"TOTAL \" + \" \" + \"$ \" + reserva.getValor() + \"\\n\" ;\r\n\t\t\r\n\t\ttry {\r\n\t\t\tFileOutputStream archivo = new FileOutputStream(ruta);\r\n\t\t\tDocument doc = new Document(PageSize.A5, 10, 10, 10, 10);\r\n\t\t\tPdfWriter.getInstance(doc, archivo);\r\n\t\t\tdoc.open();\r\n\t\t\tdoc.add(obtenerCabecera(cabecera));\r\n\t\t\tdoc.add(obtenerContenido(contenido));\r\n\t\t\tdoc.add(obtenerPiePagina(piePagina));\r\n\t\t\tdoc.close();\r\n\t\t\tthis.ruta = ruta;\r\n\t\t}\r\n\t\tcatch (Exception e) {\r\n\t\t\tSystem.out.println(\"\" + e);\r\n\t\t}\r\n\r\n\t}", "@Override\n void createReport(final Format reportFormat,\n final long start, final long end) {\n makeBriefReport(reportFormat, \"Informe breu\", start, end);\n writeToFile();\n getFormat().finishPrinting();\n }", "public List<ReporteComprasVentasRetenciones> getReporteExportaciones(int mes, int anio, int idOrganizacion)\r\n/* 260: */ {\r\n/* 261:344 */ StringBuffer sql = new StringBuffer();\r\n/* 262:345 */ sql.append(\"SELECT new ReporteComprasVentasRetenciones(tc.codigo, tc.nombre, COUNT(tc.codigo), \");\r\n/* 263:346 */ sql.append(\" (CASE WHEN tc.codigo = '04' and COALESCE(dpadre.indicadorDocumentoExterior, false) = true THEN -SUM(fcs.baseImponibleTarifaCero) ELSE SUM(fcs.valorFobRefrendo) END), \");\r\n/* 264:347 */ sql.append(\" 'Exportaciones')\");\r\n/* 265:348 */ sql.append(\" FROM FacturaClienteSRI fcs \");\r\n/* 266:349 */ sql.append(\" LEFT OUTER JOIN fcs.tipoComprobanteSRI tc \");\r\n/* 267:350 */ sql.append(\" LEFT OUTER JOIN fcs.facturaCliente fc \");\r\n/* 268:351 */ sql.append(\" LEFT OUTER JOIN fc.documento d \");\r\n/* 269:352 */ sql.append(\" LEFT OUTER JOIN fc.facturaClientePadre fcpadre \");\r\n/* 270:353 */ sql.append(\" LEFT OUTER JOIN fcpadre.documento dpadre \");\r\n/* 271:354 */ sql.append(\" WHERE MONTH(fcs.fechaEmision) =:mes \");\r\n/* 272:355 */ sql.append(\" AND YEAR(fcs.fechaEmision) =:anio \");\r\n/* 273:356 */ sql.append(\" AND fc.estado!=:estadoAnulado \");\r\n/* 274:357 */ sql.append(\" AND fc.indicadorSaldoInicial!=true \");\r\n/* 275:358 */ sql.append(\" AND COALESCE(dpadre.indicadorDocumentoExterior, d.indicadorDocumentoExterior) = true \");\r\n/* 276:359 */ sql.append(\" AND fc.idOrganizacion = :idOrganizacion\");\r\n/* 277:360 */ sql.append(\" GROUP BY tc.codigo, tc.nombre, dpadre.indicadorDocumentoExterior \");\r\n/* 278:361 */ sql.append(\" ORDER BY tc.codigo, tc.nombre \");\r\n/* 279: */ \r\n/* 280:363 */ Query query = this.em.createQuery(sql.toString());\r\n/* 281:364 */ query.setParameter(\"mes\", Integer.valueOf(mes));\r\n/* 282:365 */ query.setParameter(\"anio\", Integer.valueOf(anio));\r\n/* 283:366 */ query.setParameter(\"estadoAnulado\", Estado.ANULADO);\r\n/* 284:367 */ query.setParameter(\"idOrganizacion\", Integer.valueOf(idOrganizacion));\r\n/* 285:368 */ return query.getResultList();\r\n/* 286: */ }", "private void btnReporteActionPerformed(java.awt.event.ActionEvent evt) {\n HashMap parametros = new HashMap();\n parametros.put(\"Logo\", \".//src//Imagenes//BuscarComputadora.png\");\n parametros.put(\"Titulo\", \"Resultado de Análisis\");\n parametros.put(\"Subtitulo\", \"Documentos\");\n JasperPrint jprint = EvaluacionBL.generaReporte(\"rptReporteAnalisis\", parametros, null);\n\n try {\n JRViewer jrv = new JRViewer(jprint);\n JFrame frmReporteAnalisis = new JFrame();\n frmReporteAnalisis.getContentPane().add(jrv,BorderLayout.CENTER);\n frmReporteAnalisis.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);\n frmReporteAnalisis.setSize(706, 478);\n\n frmReporteAnalisis.setTitle(\"Pre - View de Resultado de Análisis\");\n frmReporteAnalisis.setVisible(true);\n\n }catch(Exception e){\n System.out.println(e.getMessage());\n }\n\n }", "public void makeReport()\n\t{\n\t\tif (currentStage[currentSlice-1] > 1)\n\t\t{\n\t\t\tResultsTable rt = new ResultsTable();\n\t\t\tfor (int j=0;j<popSequence.N;j++)\n\t\t\t{\n\t\t\t\tpop = popSequence.PopList[j];\n\t\t\t\tint N = pop.N;\n\t\t\t\tfor (int i=0;i<N;i++)\n\t\t\t\t{\n\t\t\t\t\trt.incrementCounter();\n\t\t\t\t\tBalloon bal;\n\t\t\t\t\tbal = (Balloon)(pop.BallList.get(i));\n\t\t\t\t\tbal.mass_geometry();\n\t\t\t\t\trt.addValue(\"X\",bal.x0);\n\t\t\t\t\trt.addValue(\"Y\",bal.y0);\n\t\t\t\t\trt.addValue(\"Z\",j);\n\t\t\t\t\trt.addValue(\"ID\",bal.id);\n\t\t\t\t\trt.addValue(\"AREA\",bal.area);\n\t\t\t\t\trt.addValue(\"Ixx\",bal.Ixx);\n\t\t\t\t\trt.addValue(\"Iyy\",bal.Iyy);\n\t\t\t\t\trt.addValue(\"Ixy\",bal.Ixy);\n\t\t\t\t\trt.addValue(\"Lx\",bal.lx);\n\t\t\t\t\trt.addValue(\"Ly\",bal.ly);\n\t\t\t\t}\n\t\t\t}\n\t\t\trt.show(\"Report\");\n\t\t\tcurrentSlice = i1.getCurrentSlice();\n\t\t\tipWallSegment = (i1.getStack()).getProcessor(i1.getCurrentSlice());\n\t\t\tpop = popSequence.PopList[currentSlice-1];\n\t\t}\n\t}", "public void gerarCupom(String cliente, String vendedor,List<Produto> produtos, float totalVenda ) throws IOException {\r\n \r\n File arquivo = new File(\"cupomFiscal.txt\");\r\n String produto =\" \"; \r\n if(arquivo.exists()){\r\n System.out.println(\"Arquivo localizado com sucessso\");\r\n }else{\r\n System.out.println(\"Arquivo não localizado, será criado outro\");\r\n arquivo.createNewFile();\r\n } \r\n \r\n for(Produto p: produtos){\r\n produto += \" \"+p.getQtd()+\" \"+ p.getNome()+\" \"+p.getMarca()+\" \"+ p.getPreco()+\"\\n \";\r\n }\r\n \r\n \r\n \r\n FileWriter fw = new FileWriter(arquivo, true);\r\n BufferedWriter bw = new BufferedWriter(fw);\r\n \r\n \r\n bw.write(\" \"+LOJA);\r\n bw.newLine();\r\n bw.write(\"---------------------------------------\");\r\n bw.newLine();\r\n bw.write(\"CLIENTE CPF\");\r\n bw.newLine();\r\n bw.write(cliente);\r\n bw.newLine();\r\n bw.write(\"---------------------------------------\");\r\n bw.newLine();\r\n bw.write(DateCustom.dataHora());\r\n bw.newLine();\r\n bw.write(\" CUPOM FISCAL \");\r\n bw.newLine();\r\n bw.write(\"QTD DESCRIÇÃO PREÇO\");\r\n bw.newLine();\r\n bw.write(produto);\r\n bw.newLine(); \r\n bw.write(\"---------------------------------------\");\r\n bw.newLine();\r\n bw.write(\"TOTAL R$ \" + totalVenda);\r\n bw.newLine();\r\n bw.write(\"---------------------------------------\");\r\n bw.newLine();\r\n bw.write(\"Vendedor \" + vendedor);\r\n bw.newLine();\r\n bw.newLine();\r\n bw.close();\r\n fw.close();\r\n }", "void generateMgiCrisprAlleleReport();", "public DetallesCompra(java.awt.Frame parent, boolean modal,int compra,float total1,String fecha1) {\n super(parent, modal);\n initComponents();\n this.setLocationRelativeTo(null);\n efectosTabla();\n llenarTabla(compra);\n ID.setText(\"\"+compra);\n total.setText(\"$\"+total1);\n fecha.setText(\"\"+fecha1);\n }", "public PRODUCT_REPORT() {\n initComponents();\n date();\n time();\n table();\n \n pnn2.setEditable(false);\n pc1.setEditable(false);\n pba.setEditable(false);\n pds.setEditable(false);\n }", "public String print() throws JRException, IOException {\n\n// Connection con = null;\n//\n// try {\n//\n// Class.forName(\"com.mysql.jdbc.Driver\");\n// con = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/hgrpweb_bd1\",\n// \"root\", \"root\");\n// } catch (Exception ex) {\n// ex.printStackTrace();\n// }\n String[] columns = new String[]{\n \"SeancesRealisesees\",\n \"NbGestantesZS\", \"NbGestantesHZ\", \"NbGestantesCPN2Plus\",\n \"DontRefereParCsZS\", \"DontRefereParCsHZ\", \"DontRefereParCsCPN2Plus\",\n \"FeAvec3CPNAu8emEt9emMoisZS\", \"FeAvec3CPNAu8emEt9emMoisHZ\",\n \"FeAyantConcultePour2emCpnZS\", \"FeAyantConcultePour2emCpnHZ\",\n \"FeAyantConcultePour3emCpnZS\", \"FeAyantConcultePour3emCpnHZ\",\n \"FeAyantConcultePour4emCpnOuPlusZS\", \"FeAyantConcultePour4emCpnOuPlusHZ\",\n \"FeARisqueDetecteesZS\", \"FeARisqueDetecteesHZ\",\n \"FeARisqueRefereesZS\", \"FeARisqueRefereesHZ\",\n \"FerAcideFolique1ereDoseZS\", \"FerAcideFolique1ereDoseHZ\",\n \"FerAcideFolique2ereDoseZS\", \"FerAcideFolique2ereDoseHZ\",\n \"FerAcideFolique3ereDoseZS\", \"FerAcideFolique3ereDoseHZ\",\n \"SulfadoxPyrimet1ereDoseZS\", \"SulfadoxPyrimet1ereDoseHZ\",\n \"SulfadoxPyrimet2ereDoseZS\", \"SulfadoxPyrimet2ereDoseHZ\",\n \"SulfadoxPyrimet3ereDoseVIHPlusZS\", \"SulfadoxPyrimet3ereDoseVIHPlusHZ\",\n \"FeAyantRecuVAT2emeA5emeDoseZS\", \"FeAyantRecuVAT2emeA5emeDoseHZ\",\n \"FeAyantCompletementVaccineesAvantGrossesseZS\", \"FeAyantCompletementVaccineesAvantGrossesseHZ\",\n \"FeEnceintesAyantAcquisUneMilZS\", \"FeEnceintesAyantAcquisUneMilHZ\",\n \"FeEnceintesAyantRecuMebendazole2emeTrimZS\", \"FeEnceintesAyantRecuMebendazole2emeTrimHZ\",\n \"VAT1ZS\", \"VAT1HZ\",\n \"VAT2ZS\", \"VAT2HZ\",\n \"VAT3ZS\", \"VAT3HZ\",\n \"VAT4ZS\", \"VAT4HZ\",\n \"VAT5ZS\", \"VAT5HZ\",\n \"QuiOntEteConseilleePourTestZS\", \"QuiOntEteConseilleePourTestHZ\",\n \"QuiOntEteTesteePourVIHZS\", \"QuiOntEteTesteePourVIHHZ\",\n \"QuiOnteuTestPositifZS\", \"QuiOnteuTestPositifHZ\",\n \"QuiOnEteInformeeDuResultatZS\", \"QuiOnEteInformeeDuResultatHZ\",\n \"QuiOnEuTestPositifEtInformeeDuResultatZS\", \"QuiOnEuTestPositifEtInformeeDuResultatHZ\",\n \"QuiOntEuGrossesseALIssuDunViolZS\", \"QuiOntEuGrossesseALIssuDunViolHZ\",\n \"NBAccouchementVIHPlus\", \"dontAyantRecuTritherapie\",\n \"NBEnfantsNesDeMereVIHPlus\", \"dontAyantPrislaTritherapie\",\n \"NbConsultationsZS\", \"NbConsultationsHZ\",\n \"NbConsultationsCPoN2Plus42eJr\", \"NbAccouchementAyantRecuVitamineZS\",\n \"NbAccouchementAyantRecuVitamineHZ\", \"NbAccouchementAyantRecuFerAcideFoliqueZS\",\n \"NbAccouchementAyantRecuFerAcideFoliqueHZ\", \"NbFemmeAyantPresenteeComplicationApresAccouchement\"};\n String[][] data = new String[][]{{\n \"1024\",\n NbGestantesZS(), NbGestantesHZ(), NbGestantesCPN2Plus(), DontRefereParCsZS(), DontRefereParCsHZ(), DontRefereParCsCPN2Plus(),\n FeAvec3CPNAu8emEt9emMoisZS(), FeAvec3CPNAu8emEt9emMoisHZ(), FeAyantConcultePour2emCpnZS(), FeAyantConcultePour2emCpnHZ(), FeAyantConcultePour3emCpnZS(), FeAyantConcultePour3emCpnHZ(),\n FeAyantConcultePour4emCpnOuPlusZS(), FeAyantConcultePour4emCpnOuPlusHZ(), FeARisqueDetecteesZS(), FeARisqueDetecteesHZ(), FeARisqueRefereesZS(), FeARisqueRefereesHZ(),\n FerAcideFolique1ereDoseZS(), FerAcideFolique1ereDoseHZ(), FerAcideFolique2ereDoseZS(), FerAcideFolique2ereDoseHZ(), FerAcideFolique3ereDoseZS(), FerAcideFolique3ereDoseHZ(),\n SulfadoxPyrimet1ereDoseZS(), SulfadoxPyrimet1ereDoseHZ(), SulfadoxPyrimet2ereDoseZS(), SulfadoxPyrimet2ereDoseHZ(), SulfadoxPyrimet3ereDoseVIHPlusZS(), SulfadoxPyrimet3ereDoseVIHPlusHZ(),\n FeAyantRecuVAT2emeA5emeDoseZS(), FeAyantRecuVAT2emeA5emeDoseHZ(), FeAyantCompletementVaccineesAvantGrossesseZS(), FeAyantCompletementVaccineesAvantGrossesseHZ(), FeEnceintesAyantAcquisUneMilZS(), FeEnceintesAyantAcquisUneMilHZ(),\n FeEnceintesAyantRecuMebendazole2emeTrimZS(), FeEnceintesAyantRecuMebendazole2emeTrimHZ(), VAT1ZS(), VAT1HZ(), VAT2ZS(), VAT2HZ(),\n VAT3ZS(), VAT3HZ(), VAT4ZS(), VAT4HZ(), VAT5ZS(), VAT5HZ(),\n QuiOntEteConseilleePourTestZS(), QuiOntEteConseilleePourTestHZ(), QuiOntEteTesteePourVIHZS(), QuiOntEteTesteePourVIHHZ(), QuiOnteuTestPositifZS(), QuiOnteuTestPositifHZ(),\n QuiOnEteInformeeDuResultatZS(), QuiOnEteInformeeDuResultatHZ(), QuiOnEuTestPositifEtInformeeDuResultatZS(), QuiOnEuTestPositifEtInformeeDuResultatHZ(), QuiOntEuGrossesseALIssuDunViolZS(), QuiOntEuGrossesseALIssuDunViolHZ(),\n NBAccouchementVIHPlus(), dontAyantRecuTritherapie(), NBEnfantsNesDeMereVIHPlus(), dontAyantPrislaTritherapie(), NbConsultationsZS(), NbConsultationsHZ(),\n NbConsultationsCPoN2Plus42eJr(), NbAccouchementAyantRecuVitamineZS(), NbAccouchementAyantRecuVitamineHZ(), NbAccouchementAyantRecuFerAcideFoliqueZS(), NbAccouchementAyantRecuFerAcideFoliqueHZ(), NbFemmeAyantPresenteeComplicationApresAccouchement()}};\n\n String reportPath = FacesContext.getCurrentInstance().getExternalContext().getRealPath(\"/rapports/cpn.jasper\");\n JasperPrint jasperPrint = JasperFillManager.fillReport(reportPath, null, new JRTableModelDataSource(new JTable(data, columns).getModel()));\n HttpServletResponse httpServletResponse = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse();\n httpServletResponse.setContentType(\"application/pdf\");\n httpServletResponse.addHeader(\"Content-disposition\", \"inline; filename=Rapport mensuel.pdf\");\n ServletOutputStream servletOutputStream = httpServletResponse.getOutputStream();\n servletOutputStream.write(JasperExportManager.exportReportToPdf(jasperPrint));\n servletOutputStream.flush();\n servletOutputStream.close();\n FacesContext.getCurrentInstance().renderResponse();\n FacesContext.getCurrentInstance().responseComplete();\n return null;\n }", "@Override\r\n\tpublic String toString() {\r\n\t\t\r\n\t\tStringBuilder sb = new StringBuilder();\r\n\t\t\r\n String dataInicioFormatada = this.dataInicio;\r\n\t\t\t\r\n\t\tsb.append(this.designacaoTorneio + \" | \");\r\n\t\tsb.append(dataInicioFormatada + \" | \");\r\n\t\tsb.append(this.jogadorAdversario.getNome() + \"\\t| \");\r\n\t\tsb.append(this.qtdEncontros + \" | \");\r\n\t\t\t\r\n\t\t\t\r\n\t\tdouble diferenca = jogadorCorrente.getPontos() - this.jogadorAdversario.getPontos();\r\n\t\t\t\r\n\t\tif (diferenca < 0.0)\r\n\t\t\tsb.append((Math.round(diferenca * 100) / 100.0) + \"\\n\");\r\n\t\t\t\r\n\t\telse\r\n\t\t\tsb.append(\"+\" + (Math.round(diferenca * 100) / 100.0));\r\n\r\n\t\tif (sb.length() == 0)\r\n\t\t\tsb.append(VisualizarEncontroDTO.NAO_EXISTEM_CONFRONTOS);\r\n\t\t\r\n\t\treturn sb.toString();\r\n\t}", "@Override\n\tpublic void exportarData() {\n\t\tDate date=new Date();\n\t\tString nameFile=\"recaudado-\"+date.getTime()+\".xls\";\n\t\tTableToExcel.save(grid,nameFile);\n\t}", "public void nuevoReporteProductos(ArrayList<Producto> Datos) throws IOException {\n Document documento = null;\r\n try {\r\n //Direccion root\r\n FileOutputStream ficheroPdf = new FileOutputStream(\"C:\\\\Users\\\\panle\\\\Documents\\\\ReporteProductos.pdf\");\r\n //FileOutputStream ficheroPdf = new FileOutputStream(\"user.dir/tmp\", \"ReporteProductos.pdf\");\r\n //File tempfile = new File(\"user.dir/tmp\", \"tempfile.txt\"); \r\n documento = new Document();\r\n // Se asocia el documento al OutputStream y se indica que el espaciado entre\r\n // lineas sera de 20. Esta llamada debe hacerse antes de abrir el documento\r\n PdfWriter.getInstance(documento, ficheroPdf).setInitialLeading(20);\r\n\r\n // Se abre el documento\r\n documento.open();\r\n documento.add(new Paragraph(\"REPORTE PRODUCTOS\",\r\n FontFactory.getFont(\"ARIAL\", // fuente\r\n 16, // tamaño\r\n Font.ITALIC, // estilo\r\n BaseColor.BLACK))); // color\r\n\r\n PdfPTable tabla = new PdfPTable(3);//#campos(columnas) para la tabla\r\n Font font = new Font(FontFamily.COURIER, 6, Font.BOLD, BaseColor.BLACK);\r\n PdfPCell cell = new PdfPCell(new Phrase(\"Celdas\", font));\r\n\r\n documento.add(new Paragraph(\"\\n\"));\r\n\r\n Image img = Image.getInstance(\"C:\\\\Users\\\\logo.png\");\r\n documento.add(img);\r\n documento.add(new Paragraph(\"\\n\"));\r\n\r\n int conta = 0;\r\n\r\n cell.setBorder(Rectangle.TITLE);\r\n tabla.addCell(\"DESCRIPCION\");\r\n tabla.addCell(\"REFERENCIA\");\r\n tabla.addCell(\"TIPO\");\r\n\r\n while (conta < Datos.size()) {\r\n cell.setBorder(Rectangle.NO_BORDER);\r\n tabla.addCell(Datos.get(conta).getDESCRIPCION());\r\n tabla.addCell(Datos.get(conta).getREFERENCIA());\r\n tabla.addCell(Datos.get(conta).getTIPO());\r\n conta++;\r\n }\r\n\r\n documento.add(tabla);\r\n documento.close();\r\n\r\n } catch (FileNotFoundException | DocumentException e) {\r\n System.out.println(\"Error al generar Reporte Productos, por:\");\r\n e.printStackTrace();\r\n }\r\n }", "public static void main(String[] args) {\n\n\n System.out.println(\"Bienvenido a Export Digital\");\n\n Ingrediente ingrediente1=new Ingrediente(\"Sal\",2,2,\"Sal tipo marina\",0,\"-\",\"SalYs\");\n Ingrediente ingrediente2=new Ingrediente(\"Pimienta\",1,1,\"Origen colombia\",0,\"-\",\"Green&Light\");\n Ingrediente ingrediente3=new Ingrediente(\"Ajo\",2,3,\"Origen Buenos aires , Tigre\",0,\"-\",\"Green&Ligh\");\n Ingrediente ingrediente4=new Ingrediente(\"Oregano\",1,4,\"Condimentos SA , Tandil\",0,\"-\",\"Condimentos Sa\");\n Ingrediente ingrediente5=new Ingrediente(\"Aji picante\",1,1,\"Origen mexico\",0,\"-\",\"Pica SA\");\n List<Ingrediente> miIngredientes=new ArrayList<>();\n miIngredientes.add(ingrediente1);\n miIngredientes.add(ingrediente2);\n List<Ingrediente> miIngredientes2=new ArrayList<>();\n miIngredientes2.add(ingrediente3);\n miIngredientes2.add(ingrediente4);\n miIngredientes2.add(ingrediente1);\n List<Ingrediente> miIngredientes3=new ArrayList<>();\n miIngredientes3.add(ingrediente1);\n miIngredientes3.add(ingrediente5);\n miIngredientes3.add(ingrediente3);\n\n Receta recetaPollo=new Receta(\"Receta Pollo\",60f,miIngredientes);\n Receta recetaPescado=new Receta(\"Receta Pescado\",30f,miIngredientes2);\n Receta recetaMariscos=new Receta(\"Medallon PO\",20f,miIngredientes3);\n\n MedallonPO medallonPO=new MedallonPO(\"Medallon Pollo clasico\",4.35f,recetaPollo,100,52.3f,13,-22,180,35,25,5,100f,\"D6\",1,32,3,125f,220f,20,36);\n MedallonesPE medallonPE=new MedallonesPE(\"Medallon Pescado clasico\",4.35f,recetaPescado,100,44.3f,24f,-25,180,25,20,3,100f,\"D6\",1,33,3,\"Merluza\",240f,36);\n Anillas rabas=new Anillas(\"Anillas rebozadas\",5.35f,recetaMariscos,100,120f,15,-20,180,20,35,2,15f,\"V2\",140f,8,15,\"V2\");\n\n List<Producto> misProductos=new ArrayList<>();\n misProductos.add(medallonPO);\n misProductos.add(medallonPE);\n misProductos.add(rabas);\n List<Ventas> lista=new ArrayList<>();\n List<Ingrediente> listaingredientes = new ArrayList<>();\n List <Produccion> listaProduccion= new ArrayList<>();\n HistorialVentas historial = new HistorialVentas(lista);\n Inventario inventario=new Inventario(listaProduccion,listaingredientes);\n Fabrica miFabrica=new Fabrica(\"Mardi Sa\",\"Ortiz de zarate 3544\",historial,inventario,misProductos);\n\n miFabrica.IniciarProg();\n\n\n\n\n\n\n\n\n\n\n\n /*\n\n\n\n\n\n // Test ventas, produtos y historial\n\n Ingrediente ingrediente=new Ingrediente(\"Sal\",2,2,\"Sal marina\",0,\"12112\",\"Elmasita\");\n List<Ingrediente> miIngredientes=new ArrayList<>();\n miIngredientes.add(ingrediente);\n Receta recetaPollo=new Receta(\"Medallon PO\",60f,miIngredientes);\n MedallonPO medallonPO=new MedallonPO(\"Medallon Pollo clasico\",4.35f,recetaPollo,100,52.3f,13,-22,180,35,25,5,100f,\"D6\",1,32,3,125f,220f,20,36);\n Ventas venta=new Ventas(medallonPO,100,\"14023123\");\n Ventas vent1=new Ventas(medallonPO,1000,\"14/02/1997\");\n Ventas venta2=new Ventas(medallonPO,100,\"14/02/1994\");\n Produccion produccion=new Produccion(medallonPO,\"10/02/1994\",1000);\n List<Producto> misProductos=new ArrayList<>();\n List<Ventas> lista=new ArrayList<>();\n List<Ingrediente> listaingredientes = new ArrayList<>();\n listaingredientes.add(ingrediente);\n List <Produccion> listaProduccion= new ArrayList<>();\n HistorialVentas historial = new HistorialVentas(lista);\n Inventario inventario=new Inventario(listaProduccion,listaingredientes);\n System.out.println(medallonPO.getReceta().getIngredientes().get(0));\n inventario.mostrar(inventario.getListaIngredientes());\n Fabrica miFabrica=new Fabrica(\"Mardi Sa\",\"Ortiz de zarate 3544\",historial,inventario,misProductos);\n miFabrica.inicializarIngredientes();\n miFabrica.mostrar(miFabrica.getMiStock().getListaIngredientes());\n // miFabrica.getMiStock().inicializarIngredientes();//Seteo en 0 las cantidades de mis bolsas\n /* System.out.println(\"\\n\");\n System.out.println(\"\\n\");\n System.out.println(\"\\n\");\n miFabrica.mostrar(miFabrica.getMiStock().getListaIngredientes());\n miFabrica.comprarIngredientes(200);\n System.out.println(\"\\n\");\n System.out.println(\"\\n\");\n System.out.println(\"\\n\");\n /*\n\n /*miFabrica.mostrar(miFabrica.getMiStock().getListaIngredientes());*/\n /*\n miFabrica.agregar(medallonPO, miFabrica.getMisProductos());\n miFabrica.mostrar(miFabrica.getMisProductos().get(0).getReceta().getIngredientes());\n miFabrica.comprarIngredientes(200);\n miFabrica.mostrar(miFabrica.getMisProductos().get(0).getReceta().getIngredientes());\n miFabrica.mostrar(miFabrica.getMiStock().getListaIngredientes());\n // okSystem.out.println(produccion.toString());\n // ok System.out.println(medallonPO.toString());\n // System.out.println(miFabrica.getMisProductos().get(0).getReceta().toString());\n //ok miFabrica.mostrar(miFabrica.getMisProductos().get(0).getReceta().getIngredientes());\n\n\n // miFabrica.agregar(produccion,inventario.getListaProduccion());\n //inventario.mostrar(inventario.getListaProduccion());\n // miFabrica.agregar(venta,historial.getVentas());//EL AGREGADO , LAS MUESTRAS Y EL ELIMINADO FUNCIONAN , ASI COMO EL BUSQUEDA GENERAL\n // miFabrica.agregar(vent1,historial.getVentas());\n // miFabrica.agregar(venta2,historial.getVentas());\n // historial.mostrar(historial.getVentas());\n // historial.eliminar(venta,historial.getVentas());\n // historial.mostrar(historial.getVentas());\n miFabrica.producir(0);\n // miFabrica.producir(miFabrica.getMiStock(),miFabrica.getMisProductos(),0);\n System.out.println(\"\\n\");\n System.out.println(\"\\n\");\n System.out.println(\"\\n\");\n miFabrica.getMiStock().calcularTotalStockProductos(misProductos, miFabrica.getMiStock());\n // miFabrica.mostrar(miFabrica.getMiStock().getListaProduccion());\n //miFabrica.mostrar(historial.getVentas());\n System.out.println(\"\\n\");\n System.out.println(\"\\n\");\n System.out.println(\"\\n\");\n */\n //ok List<Produccion>miListaDis=miFabrica.getMiStock().bajarDisponibles(miFabrica.getMiStock().getListaProduccion());\n //ok Inventario inventario1=new Inventario(miListaDis,listaingredientes);\n //ok inventario1.mostrar(inventario1.getListaProduccion());\n /* miFabrica.mostrar(miFabrica.getMiStock().getListaProduccion());\n System.out.println(\"\\n\");\n System.out.println(\"\\n\");\n System.out.println(\"\\n\");\n miFabrica.vender(miFabrica.getMisProduccionesVendidas(),miFabrica.getMiStock(),miFabrica.getMiHistorial(),misProductos,0);\n miFabrica.mostrar(miFabrica.getMisProduccionesVendidas());\n System.out.println(\"\\n\");\n System.out.println(\"\\n\");\n System.out.println(\"\\n\");\n miFabrica.mostrar(miFabrica.getMiStock().getListaProduccion());\n miFabrica.getMiStock().calcularTotalStockProductos(misProductos,miFabrica.getMiStock());\n // miFabrica.mostrar(misProductos);\n //NOTA FALTAN LAS BUSQUEDAS TANTO EN INVENTARIO COMO EN HISTORIAL Y TESTEAR\n*/\n }", "public GenerateReport() {\n initComponents();\n displayLogs();\n }", "public static void main(String args[]) throws IOException {\n File file = new File(\"Savoy House_2019_Price List_precios.pdf\");\n PDDocument document = PDDocument.load(file);\n\n //Instantiate PDFTextStripper class\n PDFTextStripper striper = new PDFTextStripper();\n\n //Retrieving text from PDF document\n striper.setStartPage(1);\n\n String documentText = striper.getText(document);\n //System.out.println(documentText);\n\n String[] tablica = documentText.split(\"\\n\");\n String header = \"Referencia,colección,Catalogo,Distributor Price EXW-Valencia,Distributor Price EXW-Valencia,\" +\n \"uds por caja,Peso bruto,imap price\\n\" +\n \"sku #,Family,Catalogue,CE 2019 [€] (Ready pickup 50~65 days),CE 2019 [€] (Ready pickup 20~30 days),\" +\n \"Pkg size,Packed weight [kg],online (Valid until June 30th 2019)\\n\";\n\n StringBuilder sb = new StringBuilder(header);\n\n for (int i = 0; i < tablica.length; i++) {\n if (tablica[i].trim().endsWith(\"€\")) {\n int lineLength = tablica[i].trim().replaceAll(\"\\\\s€|\\\\skg|,\", \"\").split(\" \").length;\n\n // check if 'Pkg size' is 1 (is not empty)\n if (tablica[i].trim().replaceAll(\"\\\\s€|\\\\skg|,\", \"\").split(\" \")[lineLength - 3].equals(\"1\")) {\n\n // join collection name into one record in the row\n if (lineLength == 8) {\n sb.append(tablica[i].trim().replaceAll(\"\\\\s€|\\\\skg|,\", \"\").replaceAll(\" \", \",\") + \"\\n\");\n } else if (lineLength > 8) {\n sb.append(tablica[i].trim().replaceAll(\"\\\\s€|\\\\skg|,\", \"\").split(\" \")[0] + \",\");\n for (int j = 1; j < lineLength - 6; j++) {\n if (j < lineLength - 7) {\n sb.append(tablica[i].trim().replaceAll(\"\\\\s€|\\\\skg|,\", \"\").split(\" \")[j] + \" \");\n } else {\n sb.append(tablica[i].trim().replaceAll(\"\\\\s€|\\\\skg|,\", \"\").split(\" \")[j]);\n }\n }\n sb.append(\",\");\n\n // append other records into the row\n for (int j = lineLength - 6; j < lineLength; j++) {\n if (j < lineLength - 1) {\n sb.append(tablica[i].trim().replaceAll(\"\\\\s€|\\\\skg|,\", \"\").split(\" \")[j] + \",\");\n } else {\n sb.append(tablica[i].trim().replaceAll(\"\\\\s€|\\\\skg|,\", \"\").split(\" \")[j]);\n }\n }\n sb.append(\"\\n\");\n }\n } else {\n sb.append(\"Data missing\\n\");\n }\n }\n }\n System.out.println(sb);\n\n // write sb string as csv file\n try {\n FileWriter writer = new FileWriter(\"savoy2019.csv\", true);\n writer.write(sb.toString());\n writer.close();\n System.out.println(\"'savoy2019.csv' file created successfully\");\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n //Closing the document\n document.close();\n }", "public static JasperPrint gestorReporte(String strNombreReporte,Map parametros, Collection list) {\n JRBeanCollectionDataSource dataSource;\n\n ConexionJDBC objConexion = new ConexionJDBC();\n \n\n JasperReport jasperReport;\n JasperPrint jasperPrint;\n\n try{\n Connection conn = DriverManager.getConnection(URL_BASEDATOS, \"postgres\", \"cuadrado\");\n //1- Se llena el datasource con la informacion de la \"busqueda\"\n dataSource = new JRBeanCollectionDataSource(list);\n //2-Se compila el archivo XML y se carga en la memoria\n jasperReport = JasperCompileManager.compileReport(strNombreReporte+\".jrxml\");\n //3-Se llena el reporte con la información de la coleccion y parámetros necesarios para la consulta\n jasperPrint = JasperFillManager.fillReport(jasperReport, parametros, conn);\n //4-Se exporta el reporte a pdf y se guarda en disco\n //JasperExportManager.exportReportToPdfFile(jasperPrint, strNombreReporte+\".pdf\");\n System.out.println(\"Reporte\");\n return jasperPrint;\n }catch (Exception e){\n e.printStackTrace();\n System.out.println(\"No hay reporte\" + e);\n }\n return null;\n\n }", "public String report() {\n if (getCurrentWeight() != 0) {\n String output = \"\\n==========Cargo Plane Report==========\\n\";\n output += String.format(\"License Plate No.: %s\\n\" +\n \"Destination: %d\\n\" +\n \"Weight Load: %.2f/%.2f\\n\", getLicensePlate(), getZipDest(),\n getCurrentWeight(), getMaxWeight());\n if (getProfit() < 0) {\n output += String.format(\"Net Profit: ($%.2f)\\n\", -1 * getProfit());\n } else {\n output += String.format(\"Net Profit: $%.2f\\n\", getProfit());\n }\n for (Package packa : getPackages()) {\n output += \"=====Shipping Labels=====\\n\";\n output += packa.shippingLabel();\n }\n output += \"\\n==============================\\n\";\n return output;\n\n } else {\n return \"\";\n }\n }", "protected String decrisToi(){\r\n return \"\\t\"+this.nomVille+\" est une ville de \"+this.nomPays+ \", elle comporte : \"+this.nbreHabitants+\" habitant(s) => elle est donc de catégorie : \"+this.categorie;\r\n }", "Report createReport();", "@Override\n protected String elaboraFooterCategorie() {\n String text = CostBio.VUOTO;\n\n text += A_CAPO;\n text += LibWiki.setRigaCat(\"Liste di persone per cognome| \");\n text += LibWiki.setRigaCat(\"Progetto Antroponimi|Cognomi\");\n\n return text;\n }", "public void reporteIngresosHotel(Date fechaInicial, Date fechaFinal,TablaModelo modeloConsumos, TablaModelo modeloAlojamientos){\n introducirConsumosHotelFechas(fechaInicial, fechaFinal, modeloConsumos);\n introducirPagosALojamientoHotelFechas(fechaInicial, fechaFinal, modeloAlojamientos);\n \n }", "public void BotonExportarPDF(String nomRep) {\n //ABRIR CUADRO DE DIALOGO PARA GUARDAR EL ARCHIVO \n JFileChooser fileChooser = new JFileChooser();\n fileChooser.addChoosableFileFilter(new FileNameExtensionFilter(\"todos los archivos *.PDF\", \"pdf\", \"PDF\"));//filtro para ver solo archivos .pdf\n int seleccion = fileChooser.showSaveDialog(null);\n try {\n if (seleccion == JFileChooser.APPROVE_OPTION) {//comprueba si ha presionado el boton de aceptar\n File JFC = fileChooser.getSelectedFile();\n String PATH = JFC.getAbsolutePath();//obtenemos la direccion del archivo + el nombre a guardar\n try (PrintWriter printwriter = new PrintWriter(JFC)) {\n printwriter.print(\"src\\\\Reportes\\\\\" + nomRep + \".jasper\");\n }\n this.ReportePDF(\"src\\\\Reportes\\\\\" + nomRep + \".jasper\", PATH);//mandamos como parametros la ruta del archivo a compilar y el nombre y ruta donde se guardaran \n //comprobamos si a la hora de guardar obtuvo la extension y si no se la asignamos\n if (!(PATH.endsWith(\".pdf\"))) {\n File temp = new File(PATH + \".pdf\");\n JFC.renameTo(temp);//renombramos el archivo\n }\n JOptionPane.showMessageDialog(null, \"Esto puede tardar unos segundos, espere porfavor\", \"Estamos Generando el Reporte\", JOptionPane.WARNING_MESSAGE);\n JOptionPane.showMessageDialog(null, \"Documento Exportado Exitosamente!\", \"Guardado exitoso!\", JOptionPane.INFORMATION_MESSAGE);\n }\n } catch (FileNotFoundException | HeadlessException e) {//por alguna excepcion salta un mensaje de error\n JOptionPane.showMessageDialog(null, \"Error al Exportar el archivo!\", \"Oops! Error\", JOptionPane.ERROR_MESSAGE);\n }\n }", "public static void main(String[] args) throws DateTimeParseException {\t\t\r\n\t\t//Get the current date for which the report is to be generated\r\n\t\tLocalDate date = LocalDate.now(); \r\n\t\t//date = LocalDate.parse( \"09 Jan 2017\", DateTimeFormatter.ofPattern( \"dd MMM yyyy\", Locale.ENGLISH ) );\r\n\t\t\r\n\t\t( new ReportGenerator( trades, date ) ).displayReport();\r\n\t}", "private void reportType() {\n\t\tVerticalLayout vReportLayout = new VerticalLayout();\n\t\tvReportLayout.addStyleName(Reindeer.PANEL_LIGHT);\n\t\tvReportLayout.setWidth(\"150px\");\n\t\tVerticalLayout bSpace = new VerticalLayout();\n\t\tbSpace.setHeight(\"25px\");\n\t\troot.addComponent(bSpace);\n\t\t\n\t\tButton todayButton = new Button(\"TODAY\");\n\t\ttodayButton.setWidth(\"100%\");\n\t\ttodayButton.addClickListener(new Button.ClickListener() {\n\t\t /**\n\t\t\t * \n\t\t\t */\n\t\t\tprivate static final long serialVersionUID = 1L;\n\n\t\t\tpublic void buttonClick(ClickEvent event) {\n\t\t //Notification.show(event.getButton().getCaption());\n\t\t \tif (event.getButton().getCaption() != null) {\n\t\t\t\t\tupdateReportLayout(event.getButton().getCaption());\n\t\t\t\t}\n\t\t \n\t\t }\n\t\t \n\t\t});\n\t\tvReportLayout.addComponent(todayButton);\n\t\t\n\t\tButton last30DaysButton = new Button(\"LAST 30 DAYS\");\n\t\tlast30DaysButton.setWidth(\"100%\");\n\t\tlast30DaysButton.addClickListener(new Button.ClickListener() {\n\t\t /**\n\t\t\t * \n\t\t\t */\n\t\t\tprivate static final long serialVersionUID = 1L;\n\n\t\t\tpublic void buttonClick(ClickEvent event) {\n\t\t \tif (event.getButton().getCaption() != null) {\n\t\t\t\t\tupdateReportLayout(event.getButton().getCaption());\n\t\t\t\t}\n\t\t \n\t\t }\n\t\t \n\t\t});\n\t\tvReportLayout.addComponent(last30DaysButton);\n\t\t\n\t\ttReportPanel.setContent(vReportLayout);\n\t\ttReportPanel.addStyleName(Reindeer.PANEL_LIGHT);\n\t\thorLayout.addComponent(tReportPanel);\n\t\troot.addComponent(horLayout);\n\t}" ]
[ "0.68394077", "0.6728751", "0.65475637", "0.65373737", "0.65326035", "0.6495582", "0.6469892", "0.64481646", "0.63730335", "0.63693154", "0.63594484", "0.6297568", "0.6290384", "0.62874556", "0.6283648", "0.62746304", "0.6265272", "0.62611413", "0.62550646", "0.6232968", "0.6215526", "0.6203042", "0.6199522", "0.61797416", "0.61788887", "0.61610156", "0.61597264", "0.6138997", "0.6136343", "0.61072654", "0.6103898", "0.60745376", "0.6067018", "0.60598284", "0.60194594", "0.60155356", "0.60145605", "0.6006923", "0.5974805", "0.59617853", "0.5958303", "0.5946065", "0.593517", "0.59342945", "0.59200907", "0.5919065", "0.5912044", "0.59095246", "0.59071726", "0.5893688", "0.58932877", "0.5888302", "0.588658", "0.5883781", "0.5882348", "0.58727807", "0.5869795", "0.58667076", "0.5862433", "0.58572376", "0.58566207", "0.5854617", "0.5854429", "0.5846655", "0.5845429", "0.5821515", "0.58068013", "0.5797279", "0.57958215", "0.5793411", "0.5793396", "0.57896984", "0.5774753", "0.57680196", "0.5758463", "0.57533675", "0.57511336", "0.5740334", "0.57329005", "0.5719729", "0.57098544", "0.57085794", "0.57020825", "0.569939", "0.5698815", "0.5695515", "0.5684695", "0.5684553", "0.56713295", "0.5667251", "0.56499755", "0.56479365", "0.56455904", "0.5639118", "0.5638165", "0.5635179", "0.5630011", "0.562986", "0.5624802", "0.56187344", "0.5615175" ]
0.0
-1
Created by intel i3 on 3/14/2017.
public interface IRegisterPresenter { public void requestRegister(RegisterBody registerBody); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final void mo51373a() {\n }", "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "@Override\n public void func_104112_b() {\n \n }", "public void mo6081a() {\n }", "public void mo38117a() {\n }", "public void mo4359a() {\n }", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "protected void mo6255a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "private void m50366E() {\n }", "private static void cajas() {\n\t\t\n\t}", "public void mo12628c() {\n }", "protected MetadataUGWD() {/* intentionally empty block */}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\n\tprotected void interr() {\n\t}", "private void init() {\n\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "private void kk12() {\n\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "private void poetries() {\n\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "public final void mo91715d() {\n }", "private MetallicityUtils() {\n\t\t\n\t}", "public void mo55254a() {\n }", "@Override\n public int describeContents() { return 0; }", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "public void mo21877s() {\n }", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "public void mo12930a() {\n }", "public void mo21779D() {\n }", "@Override\n public void init() {\n\n }", "@Override\n protected void getExras() {\n }", "public void mo21785J() {\n }", "public abstract void mo56925d();", "public void mo3376r() {\n }", "public Pitonyak_09_02() {\r\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "public abstract void mo70713b();", "public void mo21783H() {\n }", "public void mo9848a() {\n }", "private void m50367F() {\n }", "private Rekenhulp()\n\t{\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "public void mo115190b() {\n }", "@Override\n public void init() {\n }", "public void mo21782G() {\n }", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "public void mo21793R() {\n }", "public final void mo8775b() {\n }", "@Override\n protected void initialize() \n {\n \n }", "@Override\n protected void init() {\n }", "@Override\n protected void initialize() {\n\n \n }", "@Override\r\n\tpublic void init() {}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "@Override\n void init() {\n }", "private void init() {\n\n\n\n }", "public void mo1531a() {\n }", "@SuppressWarnings(\"unused\")\n private void generateInfo()\n {\n }", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "public void mo21878t() {\n }", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n public void init() {}", "zzang mo29839S() throws RemoteException;", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "public void mo21794S() {\n }", "@Override\n\tprotected void initialize() {\n\n\t}", "static void feladat4() {\n\t}", "protected boolean func_70814_o() { return true; }", "public void mo21825b() {\n }", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "public abstract void mo6549b();", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}" ]
[ "0.60055053", "0.5823534", "0.57855767", "0.5754048", "0.5748715", "0.57441056", "0.5714471", "0.569432", "0.56753546", "0.56753546", "0.5634899", "0.56200284", "0.56200284", "0.56200284", "0.56200284", "0.56200284", "0.56200284", "0.56200284", "0.5619613", "0.56108767", "0.5610432", "0.5597485", "0.5570308", "0.55401284", "0.5505924", "0.5501652", "0.54864854", "0.546108", "0.5458281", "0.5451831", "0.54457957", "0.5443429", "0.54432493", "0.543845", "0.5432889", "0.54324013", "0.5429715", "0.5427742", "0.5427742", "0.5427742", "0.5427742", "0.5427742", "0.54087514", "0.54014313", "0.5397538", "0.5394123", "0.5386567", "0.53856593", "0.53856146", "0.5379518", "0.5377246", "0.53756183", "0.53728765", "0.5369236", "0.5369236", "0.5366403", "0.53658646", "0.5361883", "0.53604287", "0.5355112", "0.5354069", "0.5352369", "0.5352369", "0.5352369", "0.5352369", "0.5352369", "0.5352369", "0.53444326", "0.53401273", "0.53299624", "0.5328747", "0.532436", "0.53232324", "0.5322132", "0.5321063", "0.5320739", "0.5318676", "0.531852", "0.53162634", "0.5316007", "0.53104955", "0.5309192", "0.5306371", "0.5301814", "0.5301814", "0.5301814", "0.5299358", "0.52985275", "0.52985275", "0.52985275", "0.5294349", "0.52912456", "0.52903163", "0.5288927", "0.52852887", "0.52828145", "0.5280083", "0.52796197", "0.527546", "0.52718437", "0.5264835" ]
0.0
-1
Created by yy111026 on 2017/2/7.
public interface ICodeWriter { boolean write(String code); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n public void func_104112_b() {\n \n }", "private stendhal() {\n\t}", "private static void cajas() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "public final void mo51373a() {\n }", "private void poetries() {\n\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "public void mo38117a() {\n }", "private void kk12() {\n\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "private void m50366E() {\n }", "@Override\n public void init() {\n\n }", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "private void init() {\n\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "protected boolean func_70814_o() { return true; }", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n public void init() {\n }", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n public int describeContents() { return 0; }", "@Override\n void init() {\n }", "@Override\n protected void getExras() {\n }", "public void mo4359a() {\n }", "public void gored() {\n\t\t\n\t}", "private void strin() {\n\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n public void init() {}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\r\n\tpublic void init() {}", "@Override\n protected void init() {\n }", "public void mo6081a() {\n }", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n protected void initialize() {\n\n \n }", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "private Rekenhulp()\n\t{\n\t}", "public abstract void mo70713b();", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void init() {\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\tpublic void einkaufen() {\n\t}", "public void mo21877s() {\n }", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tpublic void init()\n\t{\n\n\t}", "private void init() {\n\n\n\n }", "@Override\n protected void initialize() \n {\n \n }", "private final zzgy zzgb() {\n }", "@Override\r\n\tprotected void func03() {\n\t\t\r\n\t}", "public void mo12628c() {\n }", "public void mo12930a() {\n }", "static void feladat9() {\n\t}", "static void feladat4() {\n\t}", "public void method_4270() {}", "@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}", "public void m23075a() {\n }", "@Override\n\tprotected void initialize() {\n\n\t}" ]
[ "0.58538514", "0.57800186", "0.57428384", "0.5693515", "0.5633346", "0.5631937", "0.5631937", "0.5579036", "0.5578189", "0.5571889", "0.55356514", "0.5487927", "0.5481954", "0.5481395", "0.5462429", "0.5462193", "0.54466045", "0.5445839", "0.544211", "0.54402137", "0.5437942", "0.54124856", "0.54093146", "0.53947973", "0.53914356", "0.53914356", "0.53914356", "0.53914356", "0.53914356", "0.5387856", "0.53783786", "0.5374706", "0.5371673", "0.5366967", "0.53669226", "0.5358624", "0.5355932", "0.5340791", "0.5340427", "0.53316844", "0.5325484", "0.5302848", "0.5299814", "0.5285017", "0.52776766", "0.52744085", "0.52744085", "0.52744085", "0.52733964", "0.5259632", "0.52556545", "0.52546763", "0.52526575", "0.52431816", "0.52431816", "0.52406245", "0.52406245", "0.52406245", "0.5238909", "0.5238909", "0.5238909", "0.5226128", "0.5219464", "0.52158904", "0.52158904", "0.52158904", "0.52158904", "0.52158904", "0.52158904", "0.5210105", "0.5210105", "0.5210105", "0.5210105", "0.5210105", "0.5210105", "0.5210105", "0.52081996", "0.52020556", "0.52020556", "0.520096", "0.520096", "0.51953715", "0.51858175", "0.518365", "0.51770777", "0.5175506", "0.5170546", "0.51697236", "0.5169237", "0.5163581", "0.5153141", "0.51530844", "0.51480854", "0.5138917", "0.5134338", "0.51310736", "0.512934", "0.512181", "0.51209575", "0.51183724", "0.51167595" ]
0.0
-1
Create the location request to start receiving updates
private void getLocation() { LocationRequest mLocationRequestHighAccuracy = new LocationRequest(); mLocationRequestHighAccuracy.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); mLocationRequestHighAccuracy.setInterval(UPDATE_INTERVAL); mLocationRequestHighAccuracy.setFastestInterval(FASTEST_INTERVAL); if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED || ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) { stopSelf(); return; } else mFusedLocationClient.requestLocationUpdates(mLocationRequestHighAccuracy, new LocationCallback() { @Override public void onLocationResult(LocationResult locationResult) { Log.d(TAG, "onLocationResult: got location result."); Location location = locationResult.getLastLocation(); if (location != null) { db.getReference("Users").child(FirebaseAuth.getInstance().getCurrentUser().getUid()).addValueEventListener(new ValueEventListener() { @Override public void onDataChange(@NonNull DataSnapshot snapshot) { user=snapshot.getValue(User.class); } @Override public void onCancelled(@NonNull DatabaseError error) { } }); LocationModel geoPoint = new LocationModel(location.getLatitude(), location.getLongitude()); UserLocation userLocation = new UserLocation(geoPoint, user); saveUserLocation(userLocation); } /*if (location != null) { DocumentReference u = db.collection("Users").document(FirebaseAuth.getInstance().getCurrentUser().getUid()); u.get().addOnCompleteListener(new OnCompleteListener<DocumentSnapshot>() { @Override public void onComplete(@NonNull Task<DocumentSnapshot> task) { if (task.isSuccessful()) { user = task.getResult().toObject(User.class); } } }); GeoPoint geoPoint = new GeoPoint(location.getLatitude(), location.getLongitude()); UserLocation userLocation = new UserLocation(geoPoint, null, user); saveUserLocation(userLocation); }*/ } }, Looper.myLooper()); // Looper.myLooper tells this to repeat forever until thread is destroyed }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void createLocationRequest() {\n System.out.println(\"In CREATE LOCATION REQUEST\");\n mLocationRequest = new LocationRequest();\n mLocationRequest.setInterval(60 * 1000);\n mLocationRequest.setFastestInterval(5 * 1000);\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n //mLocationRequest.setSmallestDisplacement(Utils.DISPLACEMENT);\n }", "public void createLocationRequest(){\n locationRequest = new LocationRequest();\n locationRequest.setInterval(1000);\n locationRequest.setFastestInterval(500);\n locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n }", "protected void createLocationRequest() {\n\t\tmLocationRequest = new LocationRequest();\n\t\tmLocationRequest.setInterval(UPDATE_INTERVAL);\n\t\tmLocationRequest.setFastestInterval(FATEST_INTERVAL);\n\t\tmLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n\t\tmLocationRequest.setSmallestDisplacement(DISPLACEMENT);\n\t}", "protected void createLocationRequest() {\n mLocationRequest = new LocationRequest();\n //Sets the preferred interval for GPS location updates\n mLocationRequest.setInterval(UPDATE_INTERVAL_IN_MS);\n //Sets the fastest interval for GPS location updates\n mLocationRequest.setFastestInterval(FASTEST_UPDATE_INTERVAL_IN_MS);\n //Sets priority of the GPS location to accuracy\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n }", "protected void createLocationRequest() {\n mLocationRequest = new LocationRequest();\n\n // Sets the desired interval for active location updates. This interval is\n // inexact.\n mLocationRequest.setInterval(UPDATE_INTERVAL_IN_MILLISECONDS);\n\n // Sets the fastest rate for active location updates. This interval is exact, and your\n // application will never receive updates faster than this value.\n mLocationRequest.setFastestInterval(FASTEST_UPDATE_INTERVAL_IN_MILLISECONDS);\n\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n Log.d(Constants.LOCATION_REQUEST, Constants.LOCATION_REQUEST);\n }", "protected void createLocationRequest() {\n mLocationRequest = new LocationRequest();\n int UPDATE_INTERVAL = 1000 * 60 * 5;\n mLocationRequest.setInterval(UPDATE_INTERVAL);\n int FASTEST_INTERVAL = 5000;\n mLocationRequest.setFastestInterval(FASTEST_INTERVAL);\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n int DISPLACEMENT = 20;\n mLocationRequest.setSmallestDisplacement(DISPLACEMENT); // 20 meters\n }", "private void createLocationRequest() {\n mLocationRequest = new LocationRequest();\n mLocationRequest = LocationRequest.create();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n }", "protected void SetupLocationRequest()\n {\n mLocationRequest = LocationRequest.create()\n .setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY)\n .setInterval(30 * 1000) // 30 seconds, in milliseconds\n .setFastestInterval(1 * 1000); // 1 second, in milliseconds\n }", "@SuppressLint(\"MissingPermission\")\n private void requestNewLocationData() {\n LocationRequest mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequest.setInterval(5);\n mLocationRequest.setFastestInterval(0);\n mLocationRequest.setNumUpdates(1);\n\n // setting LocationRequest\n // on FusedLocationClient\n mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this);\n mFusedLocationClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper());\n }", "@SuppressLint(\"MissingPermission\")\n private void requestNewLocationData() {\n LocationRequest mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequest.setInterval(5);\n mLocationRequest.setFastestInterval(0);\n mLocationRequest.setNumUpdates(1);\n\n // setting LocationRequest\n // on FusedLocationClient\n mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this);\n mFusedLocationClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper());\n }", "@SuppressLint(\"MissingPermission\")\n private void requestNewLocationData() {\n LocationRequest mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequest.setInterval(5);\n mLocationRequest.setFastestInterval(0);\n mLocationRequest.setNumUpdates(1);\n\n // setting LocationRequest\n // on FusedLocationClient\n FusedLocationProviderClient mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this);\n mFusedLocationClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper());\n }", "private LocationRequest createLocationRequest() {\r\n LocationRequest mLocationRequest = new LocationRequest();\r\n mLocationRequest.setInterval(2000);\r\n mLocationRequest.setFastestInterval(1000);\r\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\r\n return mLocationRequest;\r\n }", "protected void startLocationUpdates() {\n mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequest.setInterval(UPDATE_INTERVAL);\n //mLocationRequest.setFastestInterval(FASTEST_INTERVAL);\n\n // Create LocationSettingsRequest object using location request\n LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder();\n builder.addLocationRequest(mLocationRequest);\n LocationSettingsRequest locationSettingsRequest = builder.build();\n\n // Check whether location settings are satisfied\n // https://developers.google.com/android/reference/com/google/android/gms/location/SettingsClient\n SettingsClient settingsClient = LocationServices.getSettingsClient(this);\n settingsClient.checkLocationSettings(locationSettingsRequest);\n\n // new Google API SDK v11 uses getFusedLocationProviderClient(this)\n try{\n getFusedLocationProviderClient(this).requestLocationUpdates(mLocationRequest, new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n onLocationChanged(locationResult.getLastLocation(),false);\n }\n },\n Looper.myLooper());\n }\n catch(SecurityException e){\n e.printStackTrace();\n }\n\n }", "private void startLocationUpdates() {\n Log.d(LOG_TAG, \"startLocationUpdates() called\");\n fusedLocationClient.requestLocationUpdates(locationRequest, locationCallback, Looper.getMainLooper());\n }", "void requestLocClick() {\n isRequest = true;\n mHasLocationData = false;\n if (mLocationClient != null && mLocationClient.isStarted()) {\n mLocationClient.requestLocation();\n Toast.makeText(getActivity(), \"Locating...\", Toast.LENGTH_SHORT).show();\n } else {\n Log.d(TAG, \"Location Client is not started...\");\n }\n }", "@SuppressLint(\"MissingPermission\")\n private void requestLocationUpdate() {\n }", "private void setLocationRequest() {\n locationRequest = new LocationRequest();\n locationRequest.setInterval(10000); // how often we ask provider for location\n locationRequest.setFastestInterval(5000); // 'steal' location from other app\n locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY); // can pick balanced power accuracy\n }", "protected void startLocationUpdates() {\n mLocationRequest = LocationRequest.create()\n .setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY)\n .setInterval(1000000)\n .setFastestInterval(1000000);\n // Request location updates\n if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, new LocationListener() {\n @Override\n public void onLocationChanged(Location location) {\n mLastLocation = location;\n }\n });\n }\n\n }", "private void StartLocationUpdates() {\n mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY);\n mLocationRequest.setInterval(UPDATE_INTERVAL);\n mLocationRequest.setFastestInterval(FASTEST_INTERVAL);\n\n // Create LocationSettings object using location request\n LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder();\n builder.addLocationRequest(mLocationRequest);\n LocationSettingsRequest locationSettingsRequest = builder.build();\n\n // Checks if location settings are OK\n SettingsClient settingsClient = LocationServices.getSettingsClient(context);\n settingsClient.checkLocationSettings(locationSettingsRequest);\n\n if (ActivityCompat.checkSelfPermission(context, Manifest.permission.ACCESS_FINE_LOCATION)\n != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission\n (context, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n\n return;\n }else {\n getFusedLocationProviderClient(context).requestLocationUpdates(mLocationRequest, new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n onLocationChanged(locationResult.getLastLocation());\n// getLastLocation();\n }\n },\n Looper.myLooper());\n }\n\n }", "private LocationRequest getLocationRequest() {\r\n Log.i(TAG, \"getting location request\");\r\n LocationRequest locationRequest = new LocationRequest();\r\n locationRequest.setInterval(10000);\r\n locationRequest.setFastestInterval(5000);\r\n locationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY);\r\n return locationRequest;\r\n }", "private LocationRequest getLocationRequest() {\n LocationRequest locationRequest = new LocationRequest();\n locationRequest.setInterval(10000);\n locationRequest.setFastestInterval(5000);\n locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n return locationRequest;\n }", "protected void startLocationUpdates()\n {\n try\n {\n if (googleApiClient.isConnected())\n {\n LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, locationRequest, this);\n isRequestingLocationUpdates = true;\n }\n }\n catch (SecurityException e)\n {\n Toast.makeText(getContext(), \"Unable to get your current location!\" +\n \" Please enable the location permission in Settings > Apps \" +\n \"> Bengaluru Buses.\", Toast.LENGTH_LONG).show();\n }\n }", "private void startPeriodicUpdates() {\n\n\t\tmLocationClient.requestLocationUpdates(mLocationRequest, this);\n\t\tmConnectionState.setText(R.string.location_requested);\n\t}", "@SuppressLint(\"RestrictedApi\")\n protected void startLocationUpdates() {\n mLocationRequest = new LocationRequest();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequest.setInterval(UPDATE_INTERVAL);\n mLocationRequest.setFastestInterval(FASTEST_INTERVAL);\n\n LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder();\n builder.addLocationRequest(mLocationRequest);\n LocationSettingsRequest locationSettingsRequest = builder.build();\n\n SettingsClient settingsClient = LocationServices.getSettingsClient(this);\n settingsClient.checkLocationSettings(locationSettingsRequest);\n\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n return;\n }\n getFusedLocationProviderClient(this).requestLocationUpdates(mLocationRequest, new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n onLocationChanged(locationResult.getLastLocation());\n }\n },\n Looper.myLooper());\n }", "private void locationRequests(){\n mFusedClient = LocationServices.getFusedLocationProviderClient(this);\n mLocationCallback = new LocationCallback(){\n @Override\n public void onLocationResult(LocationResult locationResult){\n List<Location> locationList = locationResult.getLocations();\n if(locationList.size() > 0){\n Location location = locationList.get(locationList.size() - 1);\n Log.i(TAG, \"Location: \" + location.getLatitude() + \" \" + location.getLongitude());\n mLatitude = String.valueOf(location.getLatitude());\n mLongitude = String.valueOf(location.getLongitude());\n }\n }\n };\n mLocationRequest = new LocationRequest();\n mLocationRequest.setInterval(UPDATE_INTERVAL_IN_MILLISECONDS);\n mLocationRequest.setFastestInterval(FASTEST_UPDATE_INTERVAL_IN_MILLISECONDS);\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.M){\n if(ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mFusedClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper());\n } else {\n getLocation();\n }\n } else {\n mFusedClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper());\n }\n }", "public void startReceivingLocationUpdates() {\n Dexter.withActivity(this)\n .withPermission(Manifest.permission.ACCESS_FINE_LOCATION)\n .withListener(new PermissionListener() {\n @Override\n public void onPermissionGranted(PermissionGrantedResponse response) {\n mRequestingLocationUpdates = true;\n startLocationUpdates();\n }\n\n @Override\n public void onPermissionDenied(PermissionDeniedResponse response) {\n if (response.isPermanentlyDenied()) {\n // open device settings when the permission is\n // denied permanently\n openSettings();\n }\n }\n\n @Override\n public void onPermissionRationaleShouldBeShown(com.karumi.dexter.listener.PermissionRequest permission, PermissionToken token) {\n token.continuePermissionRequest();\n }\n\n }).check();\n }", "private void requestLocationUpdates(){\n if(googleApiClient.isConnected()){\n try{\n setLocationRequest();\n LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, locationRequest, this);\n } catch (SecurityException ex) {\n Log.e(TAG, \"requestLocationUpdates: no permissions\", ex);\n }\n }\n }", "public void getLocationInfo() {\n startLocationService();\n }", "private void startLocationUpdates() {\r\n try {\r\n TimeUnit.SECONDS.sleep(3);\r\n } catch (InterruptedException e) {\r\n e.printStackTrace();\r\n }\r\n mFusedLocationClient.requestLocationUpdates(getLocationRequest(), mLocationCallback, Looper.getMainLooper());\r\n mMap.setMyLocationEnabled(true);\r\n }", "public void requestLocationUpdates(View view) {\n Log.d(TAG, \"requestLocationUpdates\");\n try {\n Log.i(TAG, \"Starting location updates\");\n LocationRequestHelper.setRequesting(this, true);\n LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, getPendingIntent());\n } catch (SecurityException e) {\n LocationRequestHelper.setRequesting(this, false);\n e.printStackTrace();\n }\n }", "public void startLocationUpdate() {\n if (locationCallback != null) {\n try {\n locationCallback = new LocationCallback() {//khoi tao dinh nghia (extent)\n\n @Override\n public void onLocationResult(LocationResult locationResult) {\n super.onLocationResult(locationResult);\n Log.d(TAG, \"onLocationResult: \");\n if (locationResult != null) {\n Log.d(TAG, \"onLocationResult: loaction!==null\");\n myLocation = locationResult.getLastLocation();\n showMarker();//de show hinh len\n }\n }\n };\n fusedLocationProviderClient.requestLocationUpdates(locationRequest, locationCallback, null);//dang ky voi he thong app lang nghe su thay doi cua location\n\n } catch (SecurityException e) {\n e.getMessage();\n\n }\n }\n }", "protected void startLocationUpdates() {\n\t\tcontected();\n\t\tLocationServices.FusedLocationApi.requestLocationUpdates(\n\t\t\t\tmGoogleApiClient, mLocationRequest, (LocationListener)context);\n\t}", "public void requestLocation() {\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED\n && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) !=\n PackageManager.PERMISSION_GRANTED) {\n if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {\n requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION,\n Manifest.permission.INTERNET}, 12);\n }\n return;\n }\n //this line updates location\n mMap.setMyLocationEnabled(true);\n providerClient.requestLocationUpdates(locationRequest, locationCallback, getMainLooper());\n }", "private void createLocationCallback() {\n mLocationCallback = new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n super.onLocationResult(locationResult);\n\n mLastLocation = locationResult.getLastLocation();\n mRequestingLocationUpdate = false;\n\n startAddressLookupService();\n }\n };\n }", "private void sendRequest() {\n double origLat = currLatLng.latitude;\n double origLong = currLatLng.longitude;\n double destLat = destLatLng.latitude;\n double destLong = destLatLng.longitude;\n String origin = origLat + \",\" + origLong;\n String destination = destLat + \",\" + destLong;\n Log.d(TAG, \"sendRequest: origin LatLong- \" + \" destination LaatLng- \" + destLatLng);\n try {\n new DirectionFinder(this, origin, destination).execute();\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n }\n\n }", "@Override\n public void requestLocationUpdates() {\n handler = new Handler();\n handler.postDelayed(new LocationUpdateRunnable(), UPDATE_INTERVAL_MS);\n }", "public void settingRequest() {\n mLocationRequest = new LocationRequest();\n mLocationRequest.setInterval(10000); // 10 seconds, in milliseconds\n mLocationRequest.setFastestInterval(1000); // 1 second, in milliseconds\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n\n LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder()\n .addLocationRequest(mLocationRequest);\n\n PendingResult<LocationSettingsResult> result =\n LocationServices.SettingsApi.checkLocationSettings(mGoogleApiClient,\n builder.build());\n\n result.setResultCallback(new ResultCallback<LocationSettingsResult>() {\n\n @Override\n public void onResult(@NonNull LocationSettingsResult result) {\n status = result.getStatus();\n final LocationSettingsStates state = result.getLocationSettingsStates();\n switch (status.getStatusCode()) {\n case LocationSettingsStatusCodes.SUCCESS:\n // All location settings are satisfied. The client can\n // initialize location requests here.\n getLocation();\n break;\n case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:\n // Location settings are not satisfied, but this can be fixed\n // by showing the user a dialog.\n try {\n // Show the dialog by calling startResolutionForResult(),\n // and check the result in onActivityResult().\n status.startResolutionForResult(UserCurrentLocation.this, 1000);\n } catch (IntentSender.SendIntentException e) {\n // Ignore the error.\n }\n break;\n case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:\n // Location settings are not satisfied. However, we have no way\n // to fix the settings so we won't show the dialog.\n break;\n }\n }\n\n });\n }", "public void startLocationUpdates() {\n if(checkCoarseLocationPermission()) {\n LocationServices.FusedLocationApi.requestLocationUpdates(\n mGoogleApiClient, mLocationRequest, this);\n }\n }", "protected void createLocationRequest()\n {\n errorLinearLayout.setVisibility(View.GONE);\n swipeRefreshLayout.setRefreshing(true);\n final int REQUEST_CHECK_SETTINGS = 0x1;\n locationRequest = new LocationRequest();\n locationRequest.setInterval(5000);\n locationRequest.setFastestInterval(3000);\n locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder().addLocationRequest(locationRequest);\n PendingResult<LocationSettingsResult> result = LocationServices.SettingsApi.checkLocationSettings(googleApiClient, builder.build());\n\n result.setResultCallback(new ResultCallback<LocationSettingsResult>()\n {\n @Override\n public void onResult(@NonNull LocationSettingsResult result)\n {\n final Status status = result.getStatus();\n switch (status.getStatusCode())\n {\n case LocationSettingsStatusCodes.SUCCESS:\n if (!isRequestingLocationUpdates)\n {\n int permissionCheck = ContextCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_FINE_LOCATION);\n if (permissionCheck == PackageManager.PERMISSION_GRANTED)\n {\n startLocationUpdates();\n }\n else\n {\n requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, LOCATION_PERMISSION_REQUEST_CODE);\n }\n }\n break;\n case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:\n\n int permissionCheck = ContextCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_FINE_LOCATION);\n if (permissionCheck == PackageManager.PERMISSION_GRANTED)\n {\n if (locationManager.isProviderEnabled(LocationManager.GPS_PROVIDER))\n {\n if (!isRequestingLocationUpdates)\n {\n startLocationUpdates();\n }\n }\n else\n {\n try\n {\n status.startResolutionForResult(getActivity(), REQUEST_CHECK_SETTINGS);\n }\n catch (IntentSender.SendIntentException e)\n {\n Toast.makeText(getActivity(), \"Failed to enable location services! Please try again later...\", Toast.LENGTH_SHORT).show();\n }\n }\n }\n else\n {\n requestPermissions(new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, LOCATION_PERMISSION_REQUEST_CODE);\n }\n break;\n case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:\n Toast.makeText(getActivity(), \"Device doesn't have a GPS! Can't locate bus stops nearby...\", Toast.LENGTH_LONG).show();\n break;\n }\n }\n });\n }", "@Override\n public void onConnected(Bundle connectionHint)\n {\n if (locationHasToBeUpdated)\n {\n createLocationRequest();\n locationHasToBeUpdated = false;\n }\n }", "public void startLocationUpdates(){\n // High accuracy should use GPS to get the location\n locationRequest = new LocationRequest();\n locationRequest.setInterval(2000);\n locationRequest.setFastestInterval(1000);\n locationRequest.setSmallestDisplacement(1);\n locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n\n if(ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED &&\n ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED){\n // The user has not given us access to get their location\n // May want to request those premissions here\n try {\n int gpsOff = Settings.Secure.getInt(getContentResolver(), Settings.Secure.LOCATION_MODE);\n // If this returns zero then GPS is off\n if(gpsOff == 0){\n Intent turnOnGPS = new Intent(Settings.ACTION_LOCATION_SOURCE_SETTINGS);\n startActivity(turnOnGPS);\n }\n }catch (Settings.SettingNotFoundException e){\n e.printStackTrace();\n }\n\n return;\n }\n\n LocationServices.FusedLocationApi.requestLocationUpdates(googleApiClient, locationRequest, this);\n }", "public void startLocationUpdates() {\n startLocationUpdatesFromInside();\n showForegroundNotification();\n }", "@Override\n\tprotected void onCreate(Bundle savedInstanceState){\n\t\tsuper.onCreate(savedInstanceState);\n\t\tsetContentView(R.layout.activity_request);\n\n\t\t//Identity user's identity, used to communicate with the server\n\t\tLocationUtils.credential = GoogleAccountCredential.usingAudience(this,\n\t\t\t\t\"server:client_id:\" + LocationUtils.WEB_CLIENT_ID);\n\t\tstartActivityForResult(LocationUtils.credential.newChooseAccountIntent(), LocationUtils.REQUEST_ACCOUNT_PICKER);\n\t\t\n\t\t// Get handles to the UI view objects\n\t\tmLatLng = (TextView) findViewById(R.id.lat_lng);\n\t\tmAddress = (TextView) findViewById(R.id.address);\n\t\tmActivityIndicator = (ProgressBar) findViewById(R.id.address_progress);\n\t\tmConnectionState = (TextView) findViewById(R.id.text_connection_state);\n\t\tmConnectionStatus = (TextView) findViewById(R.id.text_connection_status);\n\n\t\tLocationUtils.mMap = ((MapFragment) getFragmentManager().findFragmentById(R.id.map)).getMap();\n\t\tLocationUtils.mMap.setMyLocationEnabled(true);\n\n\t\t// Create a new global location parameters object\n\t\tmLocationRequest = LocationRequest.create();\n\n\t\t/*\n\t\t * Set the update interval\n\t\t */\n\t\tmLocationRequest.setInterval(LocationUtils.UPDATE_INTERVAL_IN_MILLISECONDS);\n\n\t\t// Use high accuracy\n\t\tmLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n\n\t\t// Set the interval ceiling to one minute\n\t\tmLocationRequest.setFastestInterval(LocationUtils.FAST_INTERVAL_CEILING_IN_MILLISECONDS);\n\n\t\t// Note that location updates are off until the user turns them on\n\t\tmUpdatesRequested = true;\n\n\t\t// Open Shared Preferences\n\t\tmPrefs = getSharedPreferences(LocationUtils.SHARED_PREFERENCES, Context.MODE_PRIVATE);\n\n\t\t// Get an editor\n\t\tmEditor = mPrefs.edit();\n\n\t\t/*\n\t\t * Create a new location client, using the enclosing class to\n\t\t * handle callbacks.\n\t\t */\n\t\tmLocationClient = new LocationClient(this, this, this);\n\t}", "private void startLocationUpdates() {\n mSettingsClient.checkLocationSettings(mLocationSettingsRequest).\n addOnSuccessListener(this, new OnSuccessListener<LocationSettingsResponse>() {\n @Override\n public void onSuccess(LocationSettingsResponse locationSettingsResponse) {\n Log.e(TAG, \"All location settings are satisfied.\");\n\n //noinspection MissingPermission\n mFusedLocationClient.requestLocationUpdates(mLocationBalancedRequest,\n mLocationCallback, Looper.myLooper());\n\n updateLocationUI();\n }\n })\n .addOnFailureListener(this, new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n int statusCode = ((ApiException) e).getStatusCode();\n switch (statusCode) {\n case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:\n Log.e(TAG, \"Location settings are not satisfied. Attempting to upgrade \" +\n \"location settings \");\n try {\n // Show the dialog by calling startResolutionForResult(), and check the\n // result in onActivityResult().\n ResolvableApiException rae = (ResolvableApiException) e;\n rae.startResolutionForResult(MainActivity.this, REQUEST_CHECK_SETTINGS);\n } catch (IntentSender.SendIntentException sie) {\n Log.e(TAG, \"PendingIntent unable to execute request.\");\n }\n break;\n case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:\n String errorMessage = \"Location settings are inadequate, and cannot be \" +\n \"fixed here. Fix in Settings.\";\n Log.e(TAG, errorMessage);\n Toast.makeText(MainActivity.this, errorMessage, Toast.LENGTH_LONG).show();\n mRequestingLocationUpdates = false;\n }\n updateLocationUI();\n }\n });\n\n }", "@Override\n public void onConnected(Bundle bundle) {\n Log.d(TAG, \"onConnected\");\n\n mLocationRequest = LocationRequest.create();\n mLocationRequest.setInterval(5000); // milliseconds\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n\n LocationServices.FusedLocationApi.requestLocationUpdates(mLocationClient, mLocationRequest, this);\n\n // connect to socket for upload\n mSocket.connect();\n }", "@Override\n public void onConnected(Bundle bundle) {\n if (Utility.isLocationPermissionRequired(getApplicationContext())) {\n setIsTracking(false);\n stopSelf();\n return;\n }\n\n LocationRequest request = Utility.createNewLocationRequest();\n\n Intent intent = new Intent(this, TrackerReceiver.class);\n mTrackerIntent = PendingIntent.getBroadcast(\n getApplicationContext(), REQUEST_CODE, intent, PendingIntent.FLAG_UPDATE_CURRENT\n );\n ActivityRecognition.ActivityRecognitionApi.requestActivityUpdates(\n mGoogleApiClient, 60000, mTrackerIntent\n );\n LocationServices.FusedLocationApi.requestLocationUpdates(\n mGoogleApiClient, request, mTrackerIntent\n );\n }", "protected void startLocationUpdates() {\n // The final argument to {@code requestLocationUpdates()} is a LocationListener\n // (http://developer.android.com/reference/com/google/android/gms/location/LocationListener.html).\n LocationServices.FusedLocationApi.requestLocationUpdates(\n mGoogleApiClient, mLocationRequest, this);\n }", "protected void startLocationUpdates() {\n // The final argument to {@code requestLocationUpdates()} is a LocationListener\n // (http://developer.android.com/reference/com/google/android/gms/location/LocationListener.html).\n LocationServices.FusedLocationApi.requestLocationUpdates(\n mGoogleApiClient, mLocationRequest, this);\n }", "protected void startLocationUpdates() {\n // The final argument to {@code requestLocationUpdates()} is a LocationListener\n // (http://developer.android.com/reference/com/google/android/gms/location/LocationListener.html).\n LocationServices.FusedLocationApi.requestLocationUpdates(\n mGoogleApiClient, mLocationRequest, this);\n }", "protected void buildLocationSettingsRequest() {\n LocationSettingsRequest.Builder builder = new LocationSettingsRequest.Builder();\n builder.addLocationRequest(mLocationRequest);\n mLocationSettingsRequest = builder.build();\n\n }", "public void addRequest(LocationRequest request) {\n if (request != null) {\n this.request.addRequest(request);\n enable();\n }\n }", "public static WeatherRequest generateWeatherRequestForCurrentLocation() {\n WeatherRequest req = new WeatherRequest();\n req.setTypeCurrentLocation();\n return req;\n }", "private void startLocationUpdates() {\n settingsClient\n .checkLocationSettings(locationSettingsRequest)\n .addOnSuccessListener(this, new OnSuccessListener<LocationSettingsResponse>() {\n @SuppressLint(\"MissingPermission\")\n @Override\n public void onSuccess(LocationSettingsResponse locationSettingsResponse) {\n Log.i(TAG, \"All location settings are satisfied.\");\n\n //noinspection MissingPermission\n fusedLocationClient.requestLocationUpdates(locationRequest, locationCallback, Looper.myLooper());\n\n onLocationChange();\n }\n })\n .addOnFailureListener(this, new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n int statusCode = ((ApiException) e).getStatusCode();\n switch (statusCode) {\n case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:\n Log.i(TAG, \"Location settings are not satisfied. Attempting to upgrade \" +\n \"location settings \");\n try {\n // Show the dialog by calling startResolutionForResult(), and check the\n // result in onActivityResult().\n ResolvableApiException rae = (ResolvableApiException) e;\n rae.startResolutionForResult(UserLocation.this, REQUEST_CODE);\n } catch (IntentSender.SendIntentException sie) {\n Log.i(TAG, \"PendingIntent unable to execute request.\");\n }\n break;\n case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:\n String errorMessage = \"Location settings are inadequate, and cannot be \" +\n \"fixed here. Fix in Settings.\";\n Log.e(TAG, errorMessage);\n\n Toast.makeText(UserLocation.this, errorMessage, Toast.LENGTH_LONG).show();\n }\n\n onLocationChange();\n }\n });\n }", "void onNewLocationRecieved(LocationWrapper locationWrapper, LocationType type);", "private void initLocationData() {\n\n // init google client and request for fused location provider\n fusedLocationProviderClient = LocationServices.getFusedLocationProviderClient(context);\n\n locationRequest = new LocationRequest()\n //.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY) // GPS quality location points\n .setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY) // optimized for battery\n .setInterval(20000) // at least once every 20 seconds\n .setFastestInterval(10000); // at most once every 10 seconds\n\n locationCallback = new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n\n Point userPoint;\n if (locationResult != null) {\n // update user location\n Location lastLocation = locationResult.getLastLocation();\n userPoint = new Point(lastLocation.getLatitude(), lastLocation.getLongitude());\n // cache location\n PreferencesCache.setLastLatitude(lastLocation.getLatitude());\n PreferencesCache.setLastLongitude(lastLocation.getLongitude());\n } else {\n // get cached data\n userPoint = new Point(PreferencesCache.getLastLatitude(), PreferencesCache.getLastLongitude());\n }\n\n navigator.updateUserLocation(userPoint);\n }\n };\n }", "public void createNewLocationRequest(int priority,Long interval,long fastestInterval){\n\t mLocationRequest = LocationRequest.create();\n\t // Use high accuracy\n\t mLocationRequest.setPriority(priority);\n\t // Set the update interval to 5 seconds\n\t mLocationRequest.setInterval(interval);\n\t // Set the fastest update interval to 1 second\n\t mLocationRequest.setFastestInterval(fastestInterval);\n\t \n\t }", "public void startUpdatesButtonHandler() {\n if (!mRequestingLocationUpdates) {\n mRequestingLocationUpdates = true;\n // startLocationUpdates();\n }\n }", "public void startTracking()\n\t{\n\t\tthisRoute.timeStart = System.currentTimeMillis();\n\t\t\n\t\tlocationManager.requestLocationUpdates(provider, gpsTimeFreq, 0, locListener);\n\t}", "@Override\n public void onConnected(@Nullable Bundle bundle) {\n mLocationRequest = new LocationRequest();\n mLocationRequest.setInterval(1000);\n mLocationRequest.setFastestInterval(1000);\n mLocationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY);\n if (ContextCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this);\n }\n }", "private void startLocationUpdates() {\n mSettingsClient.checkLocationSettings(mLocationSettingsRequest)\n .addOnSuccessListener(getActivity(), locationSettingsResponse -> {\n mFusedLocationClient.requestLocationUpdates(mLocationRequest,\n mLocationCallback, Looper.myLooper());\n\n updateUI();\n })\n .addOnFailureListener(getActivity(), e -> {\n int statusCode = ((ApiException) e).getStatusCode();\n switch (statusCode) {\n case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:\n try {\n // Show the dialog and check the result in onActivityResult().\n ResolvableApiException resolvable = (ResolvableApiException) e;\n MapFragment.this.startIntentSenderForResult(resolvable.getResolution().getIntentSender(),\n REQUEST_CHECK_SETTINGS, null, 0,\n 0, 0, null);\n } catch (IntentSender.SendIntentException sie) {\n //...\n }\n break;\n case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:\n String errorMessage = \"Location settings are inadequate, and cannot be \" +\n \"fixed here. Fix in Settings.\";\n Toast.makeText(MapFragment.this.getActivity(), errorMessage, Toast.LENGTH_LONG).show();\n mRequestingLocationUpdates = false;\n }\n\n MapFragment.this.updateUI();\n });\n }", "private void enableRequestLocationUpdate() {\n mLocationManager = (LocationManager) getSystemService(LOCATION_SERVICE);\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n return;\n }\n mLocationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER,\n 1000 * 10, 10, mLocationListener);\n mLocationManager.requestLocationUpdates(\n LocationManager.NETWORK_PROVIDER, 1000 * 10, 10,\n mLocationListener);\n }", "protected void startLocationUpdates() {\n try {\n if (ContextCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {\n LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this);\n }\n } catch (Exception ex) {\n ex.printStackTrace();\n }\n }", "public void startUpdatesButtonHandler() {\n if (!mRequestingLocationUpdates) {\n mRequestingLocationUpdates = true;\n startLocationUpdates();\n }\n }", "public void callUpdateLocation( AppCompatActivity activity, final Context context, String collName, int recordId, LatLng newLocation ){\r\n\r\n ServiceRequest serviceRequest = new ServiceRequest( ServiceRequest.CORE_SEVICE_NAME, \"updateLocation\", context );\r\n serviceRequest.putParameterValue( \"database_name\", \"update_location\" );\r\n serviceRequest.putParameterValue( \"dataset_name\", \"gis\" );\r\n serviceRequest.putParameterValue( \"collection_name\", collName );\r\n serviceRequest.putParameterValue( \"record_id\", String.valueOf( recordId ) );\r\n serviceRequest.putParameterValue( \"location_x\", String.valueOf( newLocation.longitude ) );\r\n serviceRequest.putParameterValue( \"location_y\", String.valueOf( newLocation.latitude ) );\r\n serviceRequest.putParameterValue( \"username\", LoginAuthentificationHandlerContext.getInstance().getUsername( ) );\r\n serviceRequest.putParameterValue( \"password\", LoginAuthentificationHandlerContext.getInstance( ).getPassword( ) );\r\n L.m( serviceRequest.getServiceRequest( ) );\r\n\r\n SmallWorldServiceTask task = new SmallWorldServiceTask(\r\n serviceRequest.getServiceRequest( ),\r\n activity,\r\n \"Updating new location...\",\r\n new SetOnTaskCompleteListener< List< HashMap< String, String > > >( ){\r\n @Override\r\n public void onTaskComplete( List< HashMap< String, String > > result ) {\r\n HashMap< String, String > response = result.get( 0 );\r\n if( response.containsKey( \"login_response\" )){\r\n L.t( context, response.get( \"login_response\" ) );\r\n }else if( response.containsKey( \"result_update\" ) ){\r\n String updated = response.get( \"result_update\" );\r\n if( updated != null ){\r\n if( updated.equals( \"true\" )){\r\n MapEngine.refreshMap( MobileGatewayMapActivity.masterActivity.getMap( ), MobileGatewayMapActivity.masterActivity.getMap( ).getCameraPosition( ), context );\r\n L.t( context, \"Updated location complete\" );\r\n }else{\r\n L.t( context, \"Updated location failed!!!! \" + updated );\r\n }\r\n }\r\n }\r\n\r\n }\r\n } );\r\n task.execute( );\r\n }", "private void startLocationUpdates() {\r\n // Begin by checking if the device has the necessary location settings.\r\n mSettingsClient.checkLocationSettings(mLocationSettingsRequest)\r\n .addOnSuccessListener(this, new OnSuccessListener<LocationSettingsResponse>() {\r\n @Override\r\n public void onSuccess(LocationSettingsResponse locationSettingsResponse) {\r\n Log.i(TAG, \"All location settings are satisfied.\");\r\n\r\n if(checkPermissions()){\r\n // Launch background service - Monitor location\r\n Log.i(TAG, \"trying to start location service..\");\r\n startService(new Intent(MainActivity.this, LocationService.class));\r\n\r\n // Launch background service - Geofence\r\n if(localUser.isGeofenceEnabled()){\r\n Log.i(TAG, \"trying to start geofence service..\");\r\n startService(new Intent(MainActivity.this, GeofenceService.class));\r\n }\r\n } else{\r\n requestPermissions();\r\n }\r\n\r\n\r\n\r\n }\r\n })\r\n .addOnFailureListener(this, new OnFailureListener() {\r\n @Override\r\n public void onFailure(@NonNull Exception e) {\r\n int statusCode = ((ApiException) e).getStatusCode();\r\n switch (statusCode) {\r\n case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:\r\n Log.i(TAG, \"Location settings are not satisfied. Attempting to upgrade \" +\r\n \"location settings \");\r\n try {\r\n // Show the dialog by calling startResolutionForResult(), and check the\r\n // result in onActivityResult().\r\n ResolvableApiException rae = (ResolvableApiException) e;\r\n rae.startResolutionForResult(MainActivity.this, REQUEST_CHECK_SETTINGS);\r\n } catch (IntentSender.SendIntentException sie) {\r\n Log.i(TAG, \"PendingIntent unable to execute request.\");\r\n }\r\n break;\r\n case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:\r\n String errorMessage = \"Location settings are inadequate, and cannot be \" +\r\n \"fixed here. Fix in Settings.\";\r\n Log.e(TAG, errorMessage);\r\n Toast.makeText(MainActivity.this, errorMessage, Toast.LENGTH_LONG).show();\r\n mRequestingLocationUpdates = false;\r\n }\r\n\r\n }\r\n });\r\n }", "private void startLocationUpdate()\r\n {\r\n try \r\n {\r\n _locationProvider = LocationProvider.getInstance(null);\r\n \r\n if ( _locationProvider == null ) \r\n {\r\n // We would like to display a dialog box indicating that GPS isn't supported, but because\r\n // the event-dispatcher thread hasn't been started yet, modal screens cannot be pushed onto\r\n // the display stack. So delay this operation until the event-dispatcher thread is running\r\n // by asking it to invoke the following Runnable object as soon as it can.\r\n Runnable showGpsUnsupportedDialog = new Runnable() \r\n {\r\n public void run() \r\n {\r\n Dialog.alert(\"GPS is not supported on this platform, exiting...\");\r\n System.exit( 1 );\r\n }\r\n };\r\n invokeLater( showGpsUnsupportedDialog ); // ask event-dispatcher thread to display dialog ASAP\r\n } \r\n else \r\n {\r\n // only a single listener can be associated with a provider, and unsetting it involves the same\r\n // call but with null, therefore, no need to cache the listener instance\r\n _locationProvider.setLocationListener(new LocationListenerImpl(), _interval, 1, 1);\r\n }\r\n } catch (LocationException le) {\r\n System.err.println(\"Failed to instantiate the LocationProvider object, exiting...\");\r\n System.err.println(le); \r\n System.exit(0);\r\n } \r\n }", "private void startLocationUpdates() {\n mSettingsClient.checkLocationSettings(mLocationSettingsRequest)\n .addOnSuccessListener(this, new OnSuccessListener<LocationSettingsResponse>() {\n @Override\n public void onSuccess(LocationSettingsResponse locationSettingsResponse) {\n Log.i(TAG, \"All location settings are satisfied.\");\n\n //noinspection MissingPermission\n if (ActivityCompat.checkSelfPermission(ChooseParty.this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(ChooseParty.this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n ActivityCompat.requestPermissions(ChooseParty.this,\n new String[]{Manifest.permission.ACCESS_FINE_LOCATION},\n REQUEST_PERMISSIONS_REQUEST_CODE);\n }\n mFusedLocationClient.requestLocationUpdates(mLocationRequest,\n mLocationCallback, Looper.myLooper());\n\n }\n })\n .addOnFailureListener(this, new OnFailureListener() {\n @Override\n public void onFailure(@NonNull Exception e) {\n int statusCode = ((ApiException) e).getStatusCode();\n switch (statusCode) {\n case LocationSettingsStatusCodes.RESOLUTION_REQUIRED:\n Log.i(TAG, \"Location settings are not satisfied. Attempting to upgrade \" +\n \"location settings \");\n try {\n // Show the dialog by calling startResolutionForResult(), and check the\n // result in onActivityResult().\n ResolvableApiException rae = (ResolvableApiException) e;\n rae.startResolutionForResult(ChooseParty.this, REQUEST_CHECK_SETTINGS);\n } catch (IntentSender.SendIntentException sie) {\n Log.i(TAG, \"PendingIntent unable to execute request.\");\n }\n break;\n case LocationSettingsStatusCodes.SETTINGS_CHANGE_UNAVAILABLE:\n String errorMessage = \"Location settings are inadequate, and cannot be \" +\n \"fixed here. Fix in Settings.\";\n Log.e(TAG, errorMessage);\n Toast.makeText(ChooseParty.this, errorMessage, Toast.LENGTH_LONG).show();\n mRequestingLocationUpdates = false;\n }\n }\n });\n }", "@Override\n public void onConnected(Bundle connectionHint) {\n mLocationRequest = LocationRequest.create();\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequest.setInterval(4000); // Update location every 4 second\n //Retrieve current location\n LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this);\n }", "private void sendRequest() {\n String origin = latitudewisata+\",\"+longitudewisata;\n Log.e(\"orininya\",origin);\n String destination = latitudewisata+\",\"+longitudewisata;\n Log.e(\"Dest\",destination);\n if (origin.isEmpty()) {\n Toast.makeText(this, \"Please enter origin address!\", Toast.LENGTH_SHORT).show();\n return;\n }\n if (destination.isEmpty()) {\n Toast.makeText(this, \"Please enter destination address!\", Toast.LENGTH_SHORT).show();\n return;\n }\n\n try {\n new DirectionFinder(this, origin, destination).execute();\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n }\n }", "protected void startLocationUpdates() {\n\n if (ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(getActivity(), Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n /*if (shouldShowRequestPermissionRationale(\n Manifest.permission.ACCESS_FINE_LOCATION)) {\n showExplanationDialog(new DialogInterface.OnClickListener() {\n @Override\n public void onClick(DialogInterface dialog, int which) {\n requestPermissions(\n new String[]{ Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }\n });\n } else {\n requestPermissions(\n new String[]{ Manifest.permission.ACCESS_FINE_LOCATION, Manifest.permission.ACCESS_COARSE_LOCATION},\n PERMISSIONS_REQUEST_ACCESS_FINE_LOCATION);\n }*/\n } else {\n if (mGoogleApiClient.isConnected()) {\n LocationServices.FusedLocationApi.requestLocationUpdates(\n mGoogleApiClient, mLocationRequest, this);\n mRequestingLocationUpdates = true;\n Fog.d(TAG, \"requestedLocationUpdates\");\n }\n }\n }", "public void startDrawing() {\n try {\n LocationRequest locationRequest = LocationRequest.create()\n .setInterval(10 * 1000)\n .setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, locationRequest, this);\n isDrawing = true;\n } catch (SecurityException e) {\n Log.e(TAG, \"Failed to start location updates \" + e.getLocalizedMessage());\n }\n }", "public void getLocation() {\n\t\tThread locationThread = new Thread(new Runnable(){\n\t\t\tpublic void run(){\n\t\t\t\ttry{\n\t\t\t\t\tURL url = new URL(\"http://ip-api.com/json\");\n\t\t\t\t\tURLConnection connection = url.openConnection();\n\t\t\t\t\n\t\t\t\t\tString line;\n\t\t\t\t\tStringBuilder builder = new StringBuilder();\n\t\t\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));\n\t\t\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\t\t\tbuilder.append(line);\n\t\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\tJSONObject json = new JSONObject(builder.toString());\n\t\t\t\t\tString status = json.getString(\"status\");\n\t\t\t\t\tSystem.out.println(\"Location retrieval was: \" + status);\n\t\t\t\t\tif(status.equals(\"success\")){\n\t\t\t\t\t\tcity = json.getString(\"city\");\n\t\t\t\t\t\tzipCode = json.getString(\"zip\");\n\t\t\t\t\t\tcountryCode = json.getString(\"countryCode\");\n\t\t\t\t\t}else{\n\t\t\t\t\t\tSystem.out.println(\"Failed to retreive location\");\n\t\t\t\t\t}\n\t\t\t\t}catch(IOException e){\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t\t\n\t\tif(!locationThread.isAlive()){\n\t\t\tlocationThread.start();\n\t\t}else{\n\t\t\ttry {\n\t\t\t\tlocationThread.join();\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tlocationThread.start();\n\t\t}\n\t}", "private void addPendingLocationRequest(LocationRequest locationRequest, LocationActivityResultListener listener) {\n mPendingLocationRequests.add(listener);\n\n // If it's the first pending request, let's ask the user to turn on high accuracy location.\n if (mPendingLocationRequests.size() == 1) {\n resolveUserSettingsForRequest(locationRequest);\n }\n }", "@SuppressLint({\"MissingPermission\", \"DefaultLocale\"})\n private void requestCurrentLocation() {\n mFusedLocationClient\n .getCurrentLocation(PRIORITY_HIGH_ACCURACY, cancellationTokenSource.getToken())\n .addOnCompleteListener(this, task -> {\n if (task.isSuccessful() && task.getResult() != null) {\n Location result = task.getResult();\n Log.d(TAG, String.format(\"getCurrentLocation() result: %s\", result.toString()));\n logOutputToScreen(String.format(\n \"Location (success): %f, %f\",\n result.getLatitude(), result.getLongitude()\n ));\n } else {\n Log.e(TAG, String.format(\"Location (failure): %s\", task.getException()));\n }\n });\n }", "public void locate()\n\t{\n\t\tlocationClient = new LocationClient(Main.activity.getApplicationContext()); // 实例化LocationClient类\n\t\t\t\t\n\t\tlocationClient.registerLocationListener(myListener); // 注册监听函数\n\t\tthis.setLocationOption();\t//设置定位参数\n\t\tlocationClient.start(); // 开始定位\n\t\tlocationClient.requestLocation();\n\t}", "private void startLocationService() {\n\t\tmLocationMngr = (LocationManager) this\r\n\t\t\t\t.getSystemService(Context.LOCATION_SERVICE);\r\n\r\n\t\tmGpsListener = new GPSListener();\r\n\t\tlong minTime = 10000;\r\n\t\tfloat minDistance = 0;\r\n\r\n\t\tmLocationMngr.requestLocationUpdates(LocationManager.GPS_PROVIDER,\r\n\t\t\t\tminTime, minDistance, mGpsListener);\r\n\t\tmLocationMngr.requestLocationUpdates(LocationManager.NETWORK_PROVIDER,\r\n\t\t\t\tminTime, minDistance, mGpsListener);\r\n\r\n\t\ttry {\r\n\t\t\tLocation lastLocation = mLocationMngr\r\n\t\t\t\t\t.getLastKnownLocation(LocationManager.GPS_PROVIDER);\r\n\t\t\tif (lastLocation != null) {\r\n\t\t\t\tDouble latitude = lastLocation.getLatitude();\r\n\t\t\t\tDouble longitude = lastLocation.getLongitude();\r\n\t\t\t\tString msg = \"Your Current Location \\nLatitude: \" + latitude\r\n\t\t\t\t\t\t+ \", Longitude: \" + longitude;\r\n\t\t\t\tLog.i(TAG, msg);\r\n\t\t\t\t// this.showToastMsg(msg);\r\n\t\t\t\tshowCurrentLocation(latitude, longitude);\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tString msg = \"Failed to get current location. Please try later.\";\r\n\t\t\tLog.e(TAG, msg);\r\n\t\t\tshowToastMsg(msg);\r\n\t\t}\r\n\r\n\t}", "@Override\n public void onConnected(@Nullable Bundle bundle) {\n Log.d(TAG, \"onConnected!\");\n mLocationRequest = new LocationRequest();\n mLocationRequest.setInterval(1000);\n mLocationRequest.setFastestInterval(1000);\n mLocationRequest.setPriority(LocationRequest.PRIORITY_BALANCED_POWER_ACCURACY);\n if (ContextCompat.checkSelfPermission(getActivity(),\n Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this);\n }\n\n }", "private void getLocation() {\n LocationRequest mLocationRequestHighAccuracy = new LocationRequest();\n mLocationRequestHighAccuracy.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n mLocationRequestHighAccuracy.setInterval(UPDATE_INTERVAL);\n mLocationRequestHighAccuracy.setFastestInterval(FASTEST_INTERVAL);\n\n\n // new Google API SDK v11 uses getFusedLocationProviderClient(this)\n if (ActivityCompat.checkSelfPermission(this,\n Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n Log.d(TAG, \"getLocation: stopping the location service.\");\n stopSelf();\n return;\n }\n Log.d(TAG, \"getLocation: getting location information.\");\n mFusedLocationClient.requestLocationUpdates(mLocationRequestHighAccuracy, new LocationCallback() {\n @Override\n public void onLocationResult(LocationResult locationResult) {\n Log.d(TAG, \"onLocationResult: got location result.\");\n Location location = locationResult.getLastLocation();\n if (location != null) {\n GeoPoint geoPoint = new GeoPoint(location.getLatitude(), location.getLongitude());\n userInfoDoc.get().addOnCompleteListener(task -> {\n Boolean av = (Boolean) task.getResult().get(\"Availability\");\n saveUserLocation(geoPoint , av);\n });\n saveDistance(geoPoint);\n\n }\n }\n },\n Looper.myLooper()); // Looper.myLooper tells this to repeat forever until thread is destroyed\n }", "public static native void sendListenerLocationUpdateRequested(\n long timestamp,\n long eventId,\n String provider,\n long interval,\n long minInterval,\n float minDistance,\n int accuracy,\n int powerReq,\n int priority,\n String stack);", "protected void startLocationUpdates() {\n try {\n// LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, this);\n\n /* mLocationRequest = new LocationRequest();\n mLocationRequest.setInterval(6000); // two minute interval\n mLocationRequest.setFastestInterval(6000);//120000\n mLocationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);*/\n /*if (ContextCompat.checkSelfPermission(this,\n android.Manifest.permission.ACCESS_FINE_LOCATION)\n == PackageManager.PERMISSION_GRANTED) {\n mFusedLocationClient.requestLocationUpdates(mLocationRequest, mLocationCallback, Looper.myLooper());\n }*/\n if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n// LocationServices.FusedLocationApi.requestLocationUpdates(mGoogleApiClient, mLocationRequest, (LocationListener) this);\n LocationServices.getFusedLocationProviderClient(this).requestLocationUpdates(mLocationRequest, null);\n// requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener);\n// requestLocationUpdates(LocationManager.NETWORK_PROVIDER, 0, 0, locationListener);\n\n } catch (Exception e) {\n // TODO: handle exception\n e.printStackTrace();\n }\n }", "private void initLocation() {\n BaiduLocationHolder.OPTION.setLocationMode(LocationClientOption.LocationMode.Hight_Accuracy);\n //可选,默认高精度,设置定位模式,高精度,低功耗,仅设备\n\n BaiduLocationHolder.OPTION.setCoorType(\"bd09ll\");\n //可选,默认gcj02,设置返回的定位结果坐标系\n\n int span = 1000;\n BaiduLocationHolder.OPTION.setScanSpan(span);\n //可选,默认0,即仅定位一次,设置发起定位请求的间隔需要大于等于1000ms才是有效的\n\n BaiduLocationHolder.OPTION.setIsNeedAddress(true);\n //可选,设置是否需要地址信息,默认不需要\n\n BaiduLocationHolder.OPTION.setOpenGps(true);\n //可选,默认false,设置是否使用gps\n\n BaiduLocationHolder.OPTION.setLocationNotify(true);\n //可选,默认false,设置是否当GPS有效时按照1S/1次频率输出GPS结果\n\n BaiduLocationHolder.OPTION.setIsNeedLocationDescribe(true);\n //可选,默认false,设置是否需要位置语义化结果,可以在BDLocation.getLocationDescribe里得到,结果类似于“在北京天安门附近”\n\n BaiduLocationHolder.OPTION.setIsNeedLocationPoiList(true);\n //可选,默认false,设置是否需要POI结果,可以在BDLocation.getPoiList里得到\n\n BaiduLocationHolder.OPTION.setIgnoreKillProcess(false);\n //可选,默认true,定位SDK内部是一个SERVICE,并放到了独立进程,设置是否在stop的时候杀死这个进程,默认不杀死\n\n BaiduLocationHolder.OPTION.SetIgnoreCacheException(false);\n //可选,默认false,设置是否收集CRASH信息,默认收集\n\n BaiduLocationHolder.OPTION.setEnableSimulateGps(false);\n //可选,默认false,设置是否需要过滤GPS仿真结果,默认需要\n\n// BaiduLocationHolder.OPTION.setWifiValidTime(5*60*1000);\n //可选,7.2版本新增能力,如果您设置了这个接口,首次启动定位时,会先判断当前WiFi是否超出有效期,超出有效期的话,会先重新扫描WiFi,然后再定位\n\n BaiduLocationHolder.CLIENT.setLocOption(BaiduLocationHolder.OPTION);\n }", "private void startTrackingRoute(){\n if(ContextCompat.checkSelfPermission(this, ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED){\n //Starts up alert dialog for getting permission\n ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.ACCESS_FINE_LOCATION}, REQUEST_LOC_PERMISSION);\n }\n else{\n //Start the location updater listener\n locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, MIN_DISTANCE, this);\n }\n }", "private void updateWithNewLocation(Location location)\n {\n\n float fLatitude = (float)0.0;\n float fLongitude = (float)0.0;\n float fHepe=(float)10000.0;\n byte ucNapUsed = 0;\n byte ucWiperErrorCode = 0;\n\n if (Config.LOGD) Log.d(TAG,\"Network Location callback\");\n\n if( location != null)\n {\n //read params from location structure return by WPS\n fLatitude = (float)(location.getLatitude());\n fLongitude = (float)(location.getLongitude());\n fHepe = location.getAccuracy();\n\n if(bScanCompleted == true)\n {\n ucNapUsed= (byte)aResults.size();\n }\n else\n {\n ucNapUsed = 50;\n }\n\n }\n else\n {\n ucWiperErrorCode = 99;\n }\n startWiperReport();\n native_notify_wiper_position(fLatitude,fLongitude,fHepe,ucNapUsed,ucWiperErrorCode);\n endWiperReport();\n\n }", "@Override\n public void requestLocationSuccess(Location requestLocation, boolean locationChanged) {\n if (request != null) {\n weatherHelper.requestWeather(this, requestLocation, this);\n }\n }", "@Override\n\tpublic void onConnected(Bundle arg0) {\n\t\t Toast.makeText(context, \"Connected\", Toast.LENGTH_SHORT).show();\n\t\t mLocationClient.requestLocationUpdates(mLocationRequest,this);\n\t}", "void requestLocationUpdates(final LocationRequest locationRequest, Integer requestId, final LocationRequestCallbacks callbacks) {\n final FusedLocationProviderClient locationProvider = getLocationProvider();\n\n LocationCallback locationCallback = new LocationCallback() {\n boolean isLocationAvailable = false;\n @Override\n public void onLocationResult(LocationResult locationResult) {\n Location location = locationResult != null ? locationResult.getLastLocation() : null;\n\n if (location != null) {\n callbacks.onLocationChanged(location);\n } else if (!isLocationAvailable) {\n callbacks.onLocationError(new LocationUnavailableException());\n }\n }\n\n @Override\n public void onLocationAvailability(LocationAvailability locationAvailability) {\n isLocationAvailable = locationAvailability.isLocationAvailable();\n }\n };\n\n if (requestId != null) {\n // Save location callback and request so we will be able to pause/resume receiving updates.\n mLocationCallbacks.put(requestId, locationCallback);\n mLocationRequests.put(requestId, locationRequest);\n }\n\n try {\n locationProvider.requestLocationUpdates(locationRequest, locationCallback, Looper.myLooper());\n callbacks.onRequestSuccess();\n } catch (SecurityException e) {\n callbacks.onRequestFailed(new LocationRequestRejectedException(e));\n }\n }", "@Override\n public ExtensionResult doSendLocation(ExtensionRequest extensionRequest) {\n Map<String, String> output = new HashMap<>();\n QuickReplyBuilder quickReplyBuilder = new QuickReplyBuilder.Builder(\"\")\n .add(\"location\", \"location\").build();\n output.put(OUTPUT, quickReplyBuilder.string());\n ExtensionResult extensionResult = new ExtensionResult();\n extensionResult.setAgent(false);\n extensionResult.setRepeat(false);\n extensionResult.setSuccess(true);\n extensionResult.setNext(true);\n extensionResult.setValue(output);\n return extensionResult;\n }", "private PendingIntent createRequestPendingIntent() {\n\n // If the PendingIntent already exists\n if (null != geofenceRequestIntent) {\n\n // Return the existing intent\n return geofenceRequestIntent;\n\n // If no PendingIntent exists\n } else {\n\n // Create an Intent pointing to the IntentService\n // TODO correct service?\n Intent intent = new Intent(activity, ReceiveTransitionsIntentService.class);\n /*\n * Return a PendingIntent to start the IntentService.\n * Always create a PendingIntent sent to Location Services\n * with FLAG_UPDATE_CURRENT, so that sending the PendingIntent\n * again updates the original. Otherwise, Location Services\n * can't match the PendingIntent to requests made with it.\n */\n return PendingIntent.getService(\n activity,\n 0,\n intent,\n PendingIntent.FLAG_UPDATE_CURRENT);\n }\n }", "private void startService() {\r\n\r\n\t\t// ---use the LocationManager class to obtain GPS locations---\r\n\t\tlm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);\r\n\t\tlocationListener = new MyLocationListener();\r\n\r\n\t\tlm.requestLocationUpdates(LocationManager.GPS_PROVIDER, minTimeMillis,\r\n\t\t\t\tminDistanceMeters, locationListener);\r\n\t\tlocationListener.onLocationChanged(lm.getLastKnownLocation(LocationManager.GPS_PROVIDER));\r\n\t}", "@Override\n public void onConnected(Bundle bundle) {\n Log.d(TAG, \"onConnected\");\n\n locationRequest = LocationRequest.create();\n locationRequest.setInterval(10000); // milliseconds\n locationRequest.setFastestInterval(10000); // the fastest rate in milliseconds at which your app can handle location updates\n locationRequest.setPriority(LocationRequest.PRIORITY_HIGH_ACCURACY);\n\n if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_COARSE_LOCATION) != PackageManager.PERMISSION_GRANTED) {\n // TODO: Consider calling\n // ActivityCompat#requestPermissions\n // here to request the missing permissions, and then overriding\n // public void onRequestPermissionsResult(int requestCode, String[] permissions,\n // int[] grantResults)\n // to handle the case where the user grants the permission. See the documentation\n // for ActivityCompat#requestPermissions for more details.\n return;\n }\n LocationServices.FusedLocationApi.requestLocationUpdates(\n googleApiClient, locationRequest, this);\n }", "public void startLocationService(Context context){\n createLocationRequest();\n mGoogleApiClient = new GoogleApiClient.Builder(context)\n .addApi(LocationServices.API)\n .addConnectionCallbacks(this)\n .addOnConnectionFailedListener(this)\n .build();\n mGoogleApiClient.connect();\n }", "@Override\n public LocationResult getLocation(final LocationRequest request) throws LocationException {\n if (request == null) {\n LOGGER.severe(\"Null request.\");\n throw new LocationException(\"Null request\");\n }\n LocUtil.startLocationTimer();\n\n // always print request as json to log for debugging\n LOGGER.fine(\"JSON Request: \\n\" + Utility.toJSONString(request.toJSON()));\n\n // create locInput from LocationRequest\n LocInput in = new LocInput(request);\n\n LocationResult result = (LocationResult) getLocation(in);\n\n LOGGER.info(\n \"Event: \"\n + request.ID\n + \", Result: \"\n + result.LocatorExitCode\n + \", \"\n + LocUtil.endLocationTimer()\n + \", numData: \"\n + request.InputData.size());\n\n // always print result as json to log for debugging, if it is valid\n if (result != null) {\n LOGGER.fine(\"JSON Result: \\n\" + Utility.toJSONString(result.toJSON()));\n } else {\n LOGGER.severe(\"Null result.\");\n throw new LocationException(\"Null Result\");\n }\n\n return result;\n }", "public void updateLocation();", "void update(Location location);", "public void activate() {\n if (null == mLocationClient) {\n mLocationClient = new AMapLocationClient(mContext.getApplicationContext());\n }\n // 设置定位回调监听\n mLocationClient.setLocationListener(this);\n // 初始化定位参数\n mLocationOption = new AMapLocationClientOption();\n // 设置定位模式为高精度模式,Battery_Saving为低功耗模式,Device_Sensors是仅设备模式\n mLocationOption.setLocationMode(AMapLocationMode.Hight_Accuracy);\n // 设置是否返回地址信息(默认返回地址信息)\n mLocationOption.setNeedAddress(true);\n // 设置是否只定位一次,默认为false\n mLocationOption.setOnceLocation(true);// 只定位一次\n if(mLocationOption.isOnceLocationLatest()){\n mLocationOption.setOnceLocationLatest(true);\n //设置setOnceLocationLatest(boolean b)接口为true,启动定位时SDK会返回最近3s内精度最高的一次定位结果。\n //如果设置其为true,setOnceLocation(boolean b)接口也会被设置为true,反之不会。\n }\n // 设置是否强制刷新WIFI,默认为强制刷新\n mLocationOption.setWifiActiveScan(true);\n // 设置是否允许模拟位置,默认为false,不允许模拟位置\n mLocationOption.setMockEnable(false);\n // 给定位客户端对象设置定位参数\n mLocationClient.setLocationOption(mLocationOption);\n // 启动定位\n mLocationClient.startLocation();\n }", "private void updateLocationToServer() {\n\n if (Utility.isConnectingToInternet(getActivity())) {\n\n if (mGpsTracker.canGetLocation()) {\n\n if (Utility.ischeckvalidLocation(mGpsTracker)) {\n\n Animation fade1 = AnimationUtils.loadAnimation(getActivity(), R.anim.flip);\n btnRefreshLocation.startAnimation(fade1);\n Map<String, String> params = new HashMap<String, String>();\n if (!AppConstants.isGestLogin(getActivity())) {\n params.put(\"iduser\", SharedPref.getInstance().getStringVlue(getActivity(), userId));\n } else {\n params.put(\"iduser\", \"0\");\n }\n\n params.put(\"latitude\", \"\" + mGpsTracker.getLatitude());\n params.put(\"longitude\", \"\" + mGpsTracker.getLongitude());\n RequestHandler.getInstance().stringRequestVolley(getActivity(), AppConstants.getBaseUrl(SharedPref.getInstance().getBooleanValue(getActivity(), isStaging)) + updatelocation, params, this, 5);\n fade1.cancel();\n } else {\n mGpsTracker.showInvalidLocationAlert();\n }\n } else {\n showSettingsAlert(5);\n }\n } else {\n Utility.showInternetError(getActivity());\n }\n\n }", "private GeofencingRequest getGeofencingRequest(LBAction lbAction) {\n GeofencingRequest.Builder builder = new GeofencingRequest.Builder();\n builder.setInitialTrigger(GeofencingRequest.INITIAL_TRIGGER_ENTER);// change upon params\n builder.addGeofence(createGeofenceForAction(lbAction));\n return builder.build();\n }", "private void onDataSendBegin() {\n Observable<Location> observable = ObservableFactory.from(SmartLocation.with(this).location().oneFix());\n observable.timeout(8, TimeUnit.SECONDS)\n .subscribeOn(Schedulers.newThread())\n .observeOn(AndroidSchedulers.mainThread())\n .subscribe(new Observer<Location>() {\n @Override\n public void onSubscribe(Disposable d) {\n currentLocation = null;\n }\n\n @Override\n public void onNext(Location loc) {\n currentLocation = loc;\n }\n\n @Override\n public void onError(Throwable e) {\n Log.e(\"onDataSendBegin\", \"onError: yes\", e);\n Toast.makeText(PanelActivity.this, \"Unable to fetch precise location, try in another way.\", Toast.LENGTH_SHORT).show();\n currentLocation = locationUtils.getLocation();\n if (currentLocation == null) {\n Log.e(\"TAG\", \"无法获取设备定位信息(包括最近一次成功定位)!\");\n }\n sendLocation();\n }\n\n @Override\n public void onComplete() {\n sendLocation();\n }\n });\n }", "private void SendBroadcastLocation() {\n Intent locationBroadcast = new Intent();\n locationBroadcast.putExtra(Constants.INTENT_LOCATION, mCurrentLocation);\n locationBroadcast.putExtra(Constants.INTENT_LAST_UPDATED_TIME, mLastUpdateTime);\n Log.d(Constants.SENDING_BROADCAST, Constants.SENDING_BROADCAST);\n locationBroadcast.setAction(CUSTOM_INTENT);\n sendBroadcast(locationBroadcast);\n }", "@Override\n public void onConnected(@Nullable Bundle bundle) {\n Log.i(TAG, \"Location Services Connected\");\n requestLocationUpdates();\n }", "@Override\n public void requestWeatherLocationSuccess(String query, List<Location> locationList) {\n if (request != null) {\n if (locationList != null && locationList.size() > 0) {\n weatherHelper.requestWeather(this, locationList.get(0), this);\n } else {\n requestWeatherLocationFailed(query);\n }\n }\n }" ]
[ "0.7807477", "0.7758711", "0.7650004", "0.75696146", "0.751144", "0.73866934", "0.7262146", "0.722402", "0.72024965", "0.72024965", "0.7199066", "0.7041655", "0.6972455", "0.6858887", "0.68506616", "0.6836776", "0.68347365", "0.6737932", "0.6736338", "0.6722951", "0.67022216", "0.6623411", "0.66170084", "0.64707005", "0.64604604", "0.6404886", "0.64014006", "0.63791746", "0.6377859", "0.6362492", "0.6331467", "0.6296634", "0.6281171", "0.6277085", "0.6246048", "0.6214367", "0.620383", "0.6121797", "0.6108206", "0.6073678", "0.60677135", "0.6066524", "0.60623026", "0.6051742", "0.6050826", "0.60254073", "0.6022469", "0.6022469", "0.6022469", "0.6005663", "0.6000059", "0.5997982", "0.5995221", "0.59900165", "0.59855676", "0.5975636", "0.596076", "0.5933103", "0.5916951", "0.5899368", "0.58984405", "0.5895207", "0.5887039", "0.58673584", "0.5867065", "0.58519304", "0.5833403", "0.5824072", "0.58110785", "0.5804726", "0.5783171", "0.57779753", "0.57740635", "0.57731056", "0.57687855", "0.5746174", "0.5740035", "0.57310605", "0.5730489", "0.5727973", "0.5723544", "0.57087487", "0.5703869", "0.5694314", "0.568726", "0.5671687", "0.566704", "0.56536853", "0.56495076", "0.56487894", "0.5642664", "0.56319803", "0.5621233", "0.56122714", "0.5609552", "0.5609438", "0.5602398", "0.55809224", "0.55715865", "0.5563749", "0.555901" ]
0.0
-1
The interface used to communicate with the parent activity
public interface Callbacks { // Through this method is the activity notified of a selected list item void onAnimalSelected(Animal animal); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface SupportParentable {\n Intent getSupportParentActivityIntent();\n }", "public interface C0869a {\n Intent getSupportParentActivityIntent();\n }", "public interface OnNewIntent {\n void onNewIntent(ZHIntent zHIntent);\n}", "public interface ActivityInterface {\n public void initView();\n public void setUICallbacks();\n public int getLayout();\n public void updateUI();\n}", "public interface MainView extends MvpView{\n void startAnekdotActivity(int type);\n}", "@Override\n\tprotected void onHandleIntent(Intent arg0) {\n\t\t\n\t}", "public ChildActivity(){\r\n mBackPressed = new Event();\r\n }", "interface LoginChamaPresenter {\n\n /**when activity is resumed*/\n void onResume();\n\n /** performs actions on user click, passes the position to implementer*/\n void onChamaItemClicked(int position);\n\n void onDestroy();\n}", "public interface IViewListActivity {\n\n Context getBaseContext();\n\n View findViewById(final int id);\n\n void onResultList(final List<Filme> filmes);\n\n void setSupportActionBar(Toolbar toolbar);\n\n void startSearch();\n\n void onErrorSearch(final String errorMsg);\n\n void onSuccess(final Filme filme);\n\n}", "public interface ActivityClientInterfaceTCP {\r\n void clientCallBackTCP(String commandID, String text);\r\n}", "public interface IBaseView {\n\n void showToastMessage(String message);\n\n void setProgressBar(boolean show);\n\n void showNetworkFailureMessage(boolean show);\n\n Context getPermission();\n\n void startNewActivity();\n\n}", "public String getParentActivity() {\n return parentActivity;\n }", "public interface Presenter {\n void onCreate();\n\n void onStart();\n\n void onStop();\n\n void pause();\n\n void attachView(View view);\n\n\n void attatchIncomingIntent(Intent intent);\n}", "public interface IActivity {\n void bindData();\n\n void bindListener();\n}", "public interface MeetingsActivityView {\n void startMainActivity();\n\n void startMeetingDetailsActivity();\n\n void startMeetingAddActivity();\n\n void errorInfo(String msg);\n\n void errorMeetingCompletedInfo(String msg);\n void successMeetingCompletedInfo(String msg);\n\n\n void startGetMeetings();\n}", "public interface ActivityLauncher {\r\n\r\n\tpublic void launchActivity();\r\n\r\n\tpublic void finishCurrentActivity();\r\n\r\n}", "public interface NotificationSenderActivity {\n\n public void update();\n\n}", "@Override\n\tprotected void onHandleIntent(Intent intent) {\n\n\t}", "public interface MainGameActivityCallBacks {\n public void onMsgFromFragmentToMainGame(String sender, String strValue);\n}", "public interface IController {\n public void onActivityPause();\n\n public void onActivityResume(Activity activity);\n}", "public interface ActivityView extends AceView {\n void finish();\n}", "public interface LocationHandler {\n public void onAddLocationButtonClicked(Activity activity);\n\n public void onLocationMessageViewClicked(Activity activity, AVIMLocationMessage locationMessage);\n}", "interface Presenter {\n\n /*get data through intent*/\n void getBundleData(Intent intent);\n\n void callHistoryDetail(Bundle extra);\n int getStoreType();\n }", "public interface MainActivityUI\n{\n\t//Respond to MainActivityLogicInterface.init().\n\tvoid initCompleted();\n\t//Will be called, if bluetooth or beacons are not supported. \\p errorcode contains a human-readable description of the problem.\n\tvoid notSupported(String errorcode);\n\t//Will be called, if bluetooth is deactivated, but should be activated to detect beacons.\n\tvoid bluetoothDeactivated();\n\t//Will be called, if permissions for COARSE_LOCATION is not given, but should be to detect beacons.\n\tvoid askForPermissions();\n\n\t//Will be called, when no beacon and no local map was found.\n\tvoid switchToMapSelectActivity();\n\n\t//Respond to MainActivityLogicInterface.getMap(). \\p map is the data contained in the active map.\n\tvoid updateMap(MapData map);\n\n\t//Will be called, if a new 'nearest' beacon was found. \\p beaconID is the id of the new beacon in MapData.\n\tvoid updateBeaconPosition(int beaconID);\n\n\t//Respond to NavigationDrawerLogic.findSpecialBeacon() or NavigationDrawerLogik.findAllSpecialBeacons() to mark the results. \\p beaconIDs is a list of the beacons which should be marked.\n\tvoid markBeacons(List<Integer> beaconIDs);\n}", "public interface ISEActivityAttatcher {\n void onCreate(Bundle savedInstanceState);\n void onStart();\n void onRestart();\n void onResume();\n void onPause();\n void onStop();\n void onDestroy();\n void onActivityResult(int requestCode, int resultCode, Intent data);\n boolean isRecyled();\n}", "@Override\n protected void onHandleIntent(Intent workIntent) {\n }", "@Override\n protected void onHandleIntent(Intent intent) {\n\n }", "@Override\n public void onNewIntent(Activity activity, Intent data) {\n }", "@Override // com.android.server.wm.WindowContainer, com.android.server.wm.ConfigurationContainer\n public void onParentChanged() {\n }", "public interface MeetingAddActivityView {\n\n void startMeetingsActivity();\n void successInfo(String msg);\n void errorInfo(String msg);\n void startGetCustomers();\n}", "public interface IMainActivity {\n\n void createNewNote(String title, String content);\n\n void updateNote(Note note);\n\n void onNoteSelected(Note note);\n\n void deleteNote(Note note);\n}", "public interface IMainActivity {\n\n void createNewNote(String title, String content);\n\n void updateNote(Note note);\n\n void onNoteSelected(Note note);\n\n void deleteNote(Note note);\n}", "public interface Communicator {\n public void doAlert(View view);\n}", "public interface Parent {\n\n /**\n * Create a new preference for a default app.\n *\n * @param context the {@code Context} to use when creating the preference.\n *\n * @return a new preference for a default app\n */\n @NonNull\n TwoTargetPreference createPreference(@NonNull Context context);\n\n /**\n * Callback when changes have been made to the {@link PreferenceScreen} of the parent\n * {@link PreferenceFragmentCompat}.\n */\n void onPreferenceScreenChanged();\n }", "ViewActivity getDefaultParentActivity();", "public interface IMainView extends BaseView {\n\n void inflateBottomViewParent();\n\n void moveToHomeWorkActivity();\n\n void moveToAttendanceActivity();\n\n void moveToMoreFragment();\n\n void logout();\n\n\n}", "public Activity getParentActivity() {\r\n \treturn parentActivity;\r\n }", "public interface MyBaseActivityImp {\n\n /**\n * 跳转Activity;\n *\n * @param paramClass Activity参数\n */\n void gotoActivity(Class<?> paramClass);\n\n /**\n * 跳转Activity,带有Bundle参数;\n *\n * @param paramClass Activity参数\n * @param bundle Bundle参数\n */\n void gotoActivity(Class<?> paramClass, Bundle bundle);\n\n /**\n * 跳转Activity,带有Bundle参数,并且该Activity不会压入栈中,返回后自动关闭;\n *\n * @param paramClass Activity参数\n * @param bundle Bundle参数\n */\n void gotoActivityNoHistory(Class<?> paramClass, Bundle bundle);\n\n /**\n * @param paramClass\n * @param bundle\n * @param paramInt\n */\n void gotoActivityForResult(Class<?> paramClass, Bundle bundle, int paramInt);\n\n /**\n * init View\n */\n void initView();\n\n /**\n *\n */\n void onEvent(Object o);\n}", "public interface ProcessDocUploadDialogNavigator extends BaseView {\n public void dismissSuccessResult();\n public Context getAttachedcontext();\n public void galleryIntent();\n public void cameraIntent();\n public void openDatePicker();\n}", "public interface Iplatform {\r\n\r\n\t/**\r\n\t * @param mActivity \r\n\t * @param gameInitListener\r\n\t */\r\n\tpublic void init(Activity mActivity, InitService.GameInitListener gameInitListener);\r\n\r\n\t/**\r\n\t * @param activity\r\n\t * @param gameLoginListener\r\n\t */\r\n\tpublic void login(Activity activity,String uid,\r\n\t\t\tLoginService.GameLoginListener gameLoginListener);\r\n\t\r\n\t\r\n\r\n\r\n\t/**\r\n\t * @param activity\r\n\t * @param gameLogoutListener\r\n\t */\r\n\tpublic void logOut(Activity activity,\r\n\t\t\tLogOutService.GameLogoutListener gameLogoutListener);\r\n\t\r\n\r\n\t/**\r\n\t * @param activity\r\n\t * @param money\r\n\t * @param order\r\n\t * @param listener\r\n\t */\r\n\tpublic void pay(Activity activity, int money,String propName, String order,\r\n\t\t\t String extInfo, ICallback listener);\r\n\r\n\r\n\tpublic void setLocation(LocationInfo info) ;\r\n\r\n\tpublic void onPause();\r\n\r\n\tpublic void onDestory();\r\n\r\n\tpublic void onResume() ;\r\n\t\r\n\r\n\r\n}", "public interface IStartView {\n\n void showStartInfo(String url);\n void goMainActivity();\n}", "@Override\n protected void onNewIntent(Intent intent) {\n }", "public interface OnChildClickListener {\n\n void onChildClick();\n\n}", "public interface Presenter {\n\n void onStart();\n\n void onStop();\n\n void onPause();\n\n void attachView(View v);\n\n void attachIncomingArg(Bundle intent);\n\n void onCreate();\n\n void onDestroy();\n}", "public interface ActivityInterface {\n\n int getLayout();\n\n void initView();\n}", "public interface DialogInterface {\n void setTitleContent();\n\n void setContainer();\n\n void OnClickListenEvent(View v);\n}", "public interface OnTaskClickedListener {\n\n void taskOpened(int taskId);\n}", "@Override\r\n\tprotected void onNewIntent(Intent intent) {\n\t\tsuper.onNewIntent(intent);\r\n\t\tString message = intent.getStringExtra(PARAM_NAME_CALLER_MESSAGE);\r\n\t\t\r\n\t\tmessageView.setText(\"onNewIntent : caller message - \" + message + \"\\n\"\r\n\t\t\t\t+ \"activity \" + this.toString());\r\n\t}", "public interface PluginInterface {\n\n public void attach(Activity proxyActivity);\n\n public void onCreate(Bundle saveInstanceState);\n\n public void onStart();\n\n public void onResume();\n\n public void onPause();\n\n public void onStop();\n\n public void onDestroy();\n\n public void onSaveInstanceState(Bundle outSate);\n\n public boolean onTouchEvent(MotionEvent event);\n\n public void onBackPressed();\n\n\n}", "@Override\n\tprotected void getIntentData(Bundle savedInstanceState) {\n\n\t}", "public abstract void onOpen();", "public interface IActivityBase {\n\n void showToast(String msg);\n void showAlert(String msg);\n\n}", "public interface VatomMetaPresenter {\n\n /**\n * Load vatom details on activity create and update VatomMetaScreen\n * @param intent\n */\n void onCreate(Intent intent);\n\n void onDestroy();\n\n void onOptionsItemSelected(MenuItem menuItem);\n\n}", "public interface BroadCastManagerCallerInterface {\n /**\n * **\n * This method is called when an intent Has Been ReceivedT hrough The BroadCast\n * @param intent This is the intent that was received\n */\n void intentHasBeenReceivedThroughTheBroadCast(Intent intent);\n}", "public interface MainPresenterInterface {\n\n void onCallOnResume();\n\n void onListReachBotton();\n\n void onCallRetry();\n}", "public interface MainActivityView {\n\n}", "public interface PaymentActControl {\n void paymentCallback(int code, String message);\n Activity getActivity();\n}", "public interface AboutUsNavigator {\n\n void onUpdateApp(String msg, String downloadUrl);\n}", "public interface IRegisterActivityView extends IActivityView{\n void onRegisteredSuccessfully();\n void onError(String message);\n}", "@Override\n public void onNewIntent(Intent intent) {\n }", "public interface IMainView {\n void registeButtonClicked();\n void destroyButtonClicked();\n void updateClientStatus(boolean registered, String registrationId);\n void showProgress();\n void hideProgress();\n void showToast(String msg);\n}", "public interface OmnomActivity {\n\tpublic static final int REQUEST_CODE_ENABLE_BLUETOOTH = 100;\n\tpublic static final int REQUEST_CODE_SCAN_QR = 101;\n\n\tvoid start(Intent intent, int animIn, int animOut, boolean finish);\n\n\tvoid startForResult(Intent intent, int animIn, int animOut, int code);\n\n\tvoid start(Class<?> cls);\n\n\tvoid start(Class<?> cls, boolean finish);\n\n\tvoid start(Intent intent, boolean finish);\n\n\tActivity getActivity();\n\n\tint getLayoutResource();\n\n\tvoid initUi();\n\n\tPreferenceProvider getPreferences();\n\n\tSubscription subscribe(final Observable observable, final Action1<? extends Object> onNext, final Action1<Throwable> onError);\n\n\tvoid unsubscribe(final Subscription subscription);\n\n}", "public interface LoginView {\n\n void session(Context context);\n\n void loadHalaman(Intent intent);\n\n void notifMe(String message);\n\n}", "public interface OnChatListener {\n void onSendMessage(Bundle b);\n }", "public interface ListPersonaActivity {\n String TAG = \"listPersonaAct\";\n void showPersonas();\n}", "protected abstract Intent getIntent();", "public interface Client {\n /**\n * Called when a link is clicked by the user.\n * @param itemId The ContentId of the item currently being shown in the InfoBar.\n */\n void onLinkClicked(@Nullable ContentId itemId);\n\n /**\n * Called when the InfoBar is closed either implicitly or explicitly by the user.\n * @param explicitly Whether the InfoBar was closed explicitly by the user from close\n * button.\n */\n void onInfoBarClosed(boolean explicitly);\n }", "public interface OnBaseUIListener {\n}", "public interface MasterConfirmModel {\n\n interface OnInitUIListener {\n\n void onUIInitSuccess(String extraMaster);\n\n void onUIInitError(String msg);\n\n }\n\n void initUI(Intent intent, Bundle saveInstanceState, OnInitUIListener onInitUIListener);\n\n interface OnSubmitClickCallback {\n\n void onSubmitError(String msg);\n\n void onSubmitSuccess();\n\n }\n\n void onSubmitClick(String extraMaster, String editMaster, OnSubmitClickCallback onSubmitClickCallback);\n\n}", "public interface GameActivityInterface extends Serializable {\n\n /**\n * Called in ingamefragment when throwthread is done\n * @param dices send all the dices generate on a roll\n * */\n void onThrowPostPossibleScores(SparseArray<Dice> dices);\n /**\n * Set the player view\n *\n * @param v view of the application\n * */\n void setPlayerView(View v);\n /**\n * Set the score view\n *\n * @param v view of the application\n * */\n void setScoreView(View v);\n\n /**\n * Set the throws\n *\n * @param v view of the application\n * */\n void getThrows(View v);\n\n /**\n * Set rounds end\n *\n * @param player the current player\n * @param activity the game activity\n * */\n void roundsEnd(Player player,Activity activity);\n\n /**\n * Update view\n *\n * @param v view of the application\n * */\n void updateView(View v);\n\n /**\n * Update highscore\n *\n * @param v view of the application\n * */\n void updateHighScore(View v);\n\n}", "public interface IMainView extends MvpView {\n void setMyLocation();\n void setRefresh();\n void scanLock();\n void getNearSeller();\n void feedback();\n void sellerDetail(Long uid);\n void buyBoxFun();\n}", "public interface IChat {\n\n void onUserClicked(Object obj);\n\n void onActionClicked(View view, Object obj);\n}", "public interface NotifierToParent1 {\n public void notifytoparent(Object data);\n}", "@Override\n public void onActivityCreated(Activity activity, Bundle bundle) {}", "public interface MainActivityContract {\n interface View extends BaseView{\n\n\n void getLocationNow(android.view.View view);\n void onRequestPermissionsResult(int requestCode, String permissions[], int[] grantResults);\n void locationObtained(boolean isObtained);\n void locationEnabled(boolean isEnabled);\n void showerror(String s);\n\n\n }\n interface Presenter extends BasePresenter<View>{\n\n void attachView(MainActivityContract.View view);\n void checkLocationActive(Activity activity);\n void init(Activity activity);\n void getContext(Context context);\n void getLocation(String lattitude, String longitude);\n void getLocationByAddress(String a, String b, String c, String d, String e);\n void getLocationByGeo(String a, String b, String c, String d, String e);\n void DettachedView();\n }\n\n}", "public interface IEditTripActivityPresenter {\n public void setData(Intent intent);\n public void editTrip();\n public void startSerivice();\n public void stopService();\n}", "public interface BridgeEventHandler {\n\n void onMounted();\n\n void onPress(ReadableMap parameters);\n\n void shareTitle(ReadableMap parameters);\n\n void shareUrl(ReadableMap parameters);\n\n void onScrub(ReadableMap percentage);\n\n void onDiscoveryRow(ReadableMap parameters);\n\n void onLanguageSelected(ReadableMap parameters);\n\n void handleTouchStart(ReadableMap parameters);\n\n void handleTouchMove(ReadableMap parameters);\n\n void handleTouchEnd(ReadableMap parameters);\n\n void onAudioTrackSelected(ReadableMap parameters);\n}", "public interface IActivityDelegate {\n\n void onCreateBefore(Bundle savedInstanceState);\n\n void onCreate(Bundle savedInstanceState);\n\n void onSaveInstanceState(Bundle outState);\n\n void onResume();\n\n void onPause();\n\n void onDestroy();\n\n void onBackPressed();\n\n void finish();\n\n void overridePendingTransition(int enterAnim, int exitAnim);\n\n void onActivityResult(int requestCode, int resultCode, Intent data);\n}", "public interface MainHandler {\n\n void onClickPushLocation(View view);\n void onClickAddFriend(View view);\n void onClickGoMap(View view);\n void onAutoPushLocation(View view, boolean checked);\n\n}", "public interface VuActivityMain extends Vu.ActivityVu {\n void showBtn(String st);\n\n void showBtn2(String st);\n}", "public interface WorkersMvpView extends MvpView {\n void updateDataList();\n\n void showDataError(boolean show);\n\n void showProgress(boolean show);\n\n void showToast(String text);\n\n void navigateToWorkerInfoActivity(Worker worker);\n}", "public interface IBaseActivityListEvent {\n\n /**\n * Creates a new fragment with the listentries of the given ShoppingList item.\n *\n * @param _ShoppingList of the list that the content should be shown.\n */\n void selectList(ShoppingList _ShoppingList);\n}", "@Override\n protected void onNewIntent(Intent intent){\n handleIntent(intent);\n }", "interface onItemClicked {\n void sendDataToActivity(String data);\n }", "@Override\n\tpublic IBinder onBind(Intent arg0) {\n\t\t\n\t\t\t\n\t\treturn null;\n\t}", "@Override\n public IBinder onBind(Intent arg0) {\n return null;\n }", "public interface LoginMvpView extends OjaView {\n\n void openMainActivity();\n}", "@Override\n\tpublic void onParentSet() {\n\t\t\n\t}", "public abstract EnvioMensajesCallBackInterface getInterfaceCallback();", "void onEnterToChatDetails();", "public interface CallListener {\r\n void onCallTapListener(int position);\r\n}", "public interface IFirstActivityView {\n void setData(HotData hotData);\n void setFailMessage(String error);\n}", "public interface IMainView extends MvpView{\n void onLoginSuccess();\n\n void onCommitJpushIDSuccess();\n\n void onCommitJpushIdFailed();\n\n void onError(Exception e);\n}", "public interface MainActivityPresenter extends IPresenter {\n void init();\n\n void onDestory();\n\n void loginClick(String name, String pwd);\n\n}", "public interface MainActivityView {\n\n void showLoading();\n void hideLoading();\n void toMainActivity(String data);\n}", "public interface ModalViewInterface extends ActivityInterface {\n /**\n * Check whether current activity show as a modal view in the tablet.\n */\n public boolean isStartAsModal();\n }", "public interface Activity<T extends Pane> extends Component, Haltable, Hookable {\n\n\tT getParent();\n\tActivityState getState();\n\n}", "public interface BaseNotificationClickListener {\n void onClick(Context context, String content);\n}", "abstract void onOpen();", "public interface OnParallaxTopEventListener {\n public void onBackPressed();\n public void onShare();\n public void onRefresh();\n}" ]
[ "0.69960654", "0.6754166", "0.6560104", "0.63722235", "0.63602775", "0.63410056", "0.6304983", "0.6277444", "0.6255922", "0.62456197", "0.62399226", "0.6187052", "0.61849195", "0.6182348", "0.617242", "0.6168373", "0.61649024", "0.612474", "0.6099223", "0.6094941", "0.6082917", "0.6082786", "0.6071508", "0.6048214", "0.604038", "0.6040261", "0.6033251", "0.6027938", "0.60025746", "0.60000443", "0.59994304", "0.59994304", "0.59960085", "0.59732455", "0.59660065", "0.59602815", "0.5951306", "0.5948973", "0.59383404", "0.59291565", "0.59260195", "0.5919147", "0.5909089", "0.5905081", "0.5904349", "0.5895781", "0.5884384", "0.5883673", "0.5879881", "0.58793133", "0.5878697", "0.5875052", "0.58720887", "0.5871823", "0.58691967", "0.5858271", "0.58525383", "0.5852216", "0.5847716", "0.58451986", "0.58449674", "0.5842601", "0.58369887", "0.58312714", "0.58013314", "0.5789942", "0.5787664", "0.57803875", "0.5777551", "0.5766158", "0.5764377", "0.57639754", "0.576308", "0.57609934", "0.5747127", "0.57467735", "0.57466185", "0.5742925", "0.5734523", "0.5724485", "0.57192045", "0.57162166", "0.5708818", "0.57057303", "0.57008076", "0.5695585", "0.56876004", "0.5682786", "0.567657", "0.56708395", "0.56670475", "0.56670415", "0.5666331", "0.5664115", "0.5658666", "0.5655307", "0.564739", "0.56464696", "0.564637", "0.56458277" ]
0.5774885
69
Through this method is the activity notified of a selected list item
void onAnimalSelected(Animal animal);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void onSelectedItem(int position) {\n\t\t\t\t\n\t\t\t\tviewInfo.intentUri = customDialog.mAppList.get(position).intentUri;\n\t\t\t\t\n\t\t\t\tviewInfo.icon = customDialog.mAppList.get(position).icon;\n\t\t\t\tviewInfo.label = customDialog.mAppList.get(position).label;\n\t\t\t\t\n\t\t\t\tmUiManager.addItemToPanel(null\n\t\t\t\t,viewInfo\n\t\t\t\t,mDatabaseUtil);\n\t\t\t}", "private void itemSelected(int position) {\n\t\tmessageToPasteFromTheListView=arrayAdapter.getItem(position).getMessage();\n\t\tgetActivity().showDialog(((MainActivity)getActivity()).dialogID);\n\t}", "@Override\n public void onListItemClicked(int position) {\n\n }", "public void onComidaSelected(int comidaId);", "@Override\n\t\t\tpublic void menuSelected(MenuItem selectedItem)\n\t\t\t{\n\n\t\t\t}", "@Override\n\t\t\tpublic void menuSelected(MenuItem selectedItem)\n\t\t\t{\n\n\t\t\t}", "@Override\n public void setOnListViewItemPressed(int listPositionIndex, String selectedItemText)\n {\n\n if (ListenerSimple != null)\n {\n keepLastItemIndexPressed = listPositionIndex;\n // Now let's fire listener here\n ListenerSimple.setOnListViewItemPressed(listPositionIndex, selectedItemText);\n }\n finish();\n }", "@Override\n public void onListItemClick(ListView l, View v, int position, long id) {\n super.onListItemClick(l, v, position, id);\n //l.getSelectedItem()\n String geslecteerdJaar = GEBOORTEJAREN.get(position);\n\n //stap 4 om listener in te stellen\n if(mListener != null)\n mListener.geboortejaarGeselecteerd(geslecteerdJaar);\n\n }", "void onListFragmentInteraction(String item);", "void onItemSelected(int index, T item) throws RemoteException;", "@Override\n public void onSelected(\n @NonNull List<Uri> uriList, @NonNull List<String> pathList) {\n Log.e(\"onSelected\", \"onSelected: pathList=\" + pathList);\n }", "@Override\n public void onListItemClick(ListView l, View v, int position, long id) {\n \tsuper.onListItemClick(l, v, position, id);\n \tLog.i(TAG, \"Position: \" + position);\n \t/*String item = (String) getListAdapter().getItem(position);\n \tnew AlertDialog.Builder(this)\n \t .setTitle(\"Test\")\n \t .setMessage(item)\n \t .setPositiveButton(\"OK\",\n \t new DialogInterface.OnClickListener() {\n \t public void onClick(DialogInterface dialog, int which) {}}\n \t )\n \t .show();\n \t\n Toast.makeText(this, item + \" selected\", Toast.LENGTH_LONG).show();*/\n }", "void onItemSelected(Bundle args);", "@Override\n\t public void onListItemClick(ListView l, View v, int position, long id) {\n\t mCallback.onDealSelected(mAdapter.getItem(position));\n\t \n\t // Set the item as checked to be highlighted when in two-pane layout\n\t getListView().setItemChecked(position, true);\n\t}", "@Override\n public void onListFragmentInteraction(Model.Item item) {\n }", "@Override\r\n\t public void onListItemClick(ListView l, View v, int position, long id) {\n\t\t Cursor cursor = (Cursor) getListAdapter().getItem(position);\r\n\t\t String serviceUri = cursor.getString(cursor.getColumnIndex(NotificationData.SERVICE_ID));\r\n\t\t Log.d(TAG, \"selected service \" + serviceUri);\r\n\t\t MainActivity m = (MainActivity) getActivity();\r\n\t\t m.showServiceSpecificNotifications(serviceUri,\"\");// TODO: fetch and send the service name!!, now is sending an empty string\r\n\t }", "public void onListItemClick(ListView l, View v, int position, long id) {\n // Notify the parent activity of selected item\n super.onListItemClick(l, v, position, id);\n mListener.OnRecipeSelected();\n\n }", "void onItemSelected();", "void onItemSelected();", "public interface ListListener {\n\t/*\n\t * Called by soundfun.ui when a different element\n\t * has been selected. This also is called if no\n\t * element was previously selected and is now selected.\n\t */\n\tpublic void selected(String action);\n}", "public void onItemStateChanged(String id, boolean selected);", "@Override\n protected void onListItemClick(ListView l, View v, int position, long id)\n {\n String selection = l.getItemAtPosition(position).toString();\n Toast.makeText(this, selection, Toast.LENGTH_LONG).show();\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View v, int position, long id)\n {\n }", "@Override\n\t\tpublic void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n\t\t\tListView listView = (ListView) parent;\n\t\t\tString item = (String) listView.getSelectedItem();\n//\t\t\tToast.makeText(SearchGroupActivity.this, \"onItemSelected = \" + item, Toast.LENGTH_LONG).show();\n\t\t}", "@Override\n public void onSelected(@NonNull List<Uri> uriList, @NonNull List<String> pathList) {\n Log.e(\"onSelected\", \"onSelected: pathList=\" + pathList);\n\n }", "@Override\n public void onClick(View v) {\n if (fragment instanceof ItemListFragment)\n ((ItemListFragment) fragment).onItemSelected(position, AppConstants.AMMUNATION_SELECTED);\n }", "@Override\r\n public void onListItemClick(ListView l, View v, int position, long id) {\n }", "@Override\n public void onSelected(@NonNull List<Uri> uriList, @NonNull List<String> pathList) {\n Log.e(\"onSelected\", \"onSelected: pathList=\" + pathList);\n\n }", "@Override protected void onListItemClick (ListView l, View v, int position, long id)\n\t{\n\t\tLog.i(\"IDManagement\", \"Listitemclick set id\" + String.format(\"%d\", id));\n\t\tselectedItem = id;\n\n\t}", "@Override\r\n\tpublic void itemSelectedAtIndexPath(IndexPath path) {\n\r\n\t}", "public void onSelectedItems(Map<String,Integer> selectedMapPo) {\n\t\t\t\t\n\t\t\t}", "public void onItemSelected(int position);", "private void contactListItemHandler(){\n contactList.setOnItemClickListener(new AdapterView.OnItemClickListener() {\n @Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n startChat(customArrayAdapter.getChatId(position));\n }\n });\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n\tprotected void onListItemClick(ListView l, View v, int position, long id) {\n\t\tString selection = l.getItemAtPosition(position).toString();\n\t\tToast.makeText(this, selection, Toast.LENGTH_LONG).show();\n\t}", "@Override\r\n\tpublic void onMenuItemSelected(MenuItem item) {\n\r\n\t}", "@Override\n\t\tpublic void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n\n\t\t}", "@Override\n public void onItemSelected(AdapterView<?> parent, View view,\n int position, long id) {\n }", "public void onListItemSelect(int position) {\n storageGridViewAdapter.toggleSelection(position);//Toggle the selection\n\n boolean hasCheckedItems = storageGridViewAdapter.getSelectedCount() > 0;//Check if any items are already selected or not\n\n if (hasCheckedItems && mActionMode == null)\n // there are some selected items, start the actionMode\n mActionMode = startSupportActionMode(new ToolbarActionModeCallback(PictureActivity.this, storageGridViewAdapter, allImages));\n else if (!hasCheckedItems && mActionMode != null)\n // there no selected items, finish the actionMode\n mActionMode.finish();\n\n if (mActionMode != null)\n //set action mode title on item selection\n mActionMode.setTitle(String.valueOf(storageGridViewAdapter.getSelectedCount()) + \" selected\");\n }", "@Override\n public void onItemSelected(AdapterView<?> adapterView, View view, int position, long id)\n {\n }", "public void onItemSelecting(AdapterView<?> parent, View view, int oldPosition, int newPosition);", "@Override\n public void onContactSelected(Contact selected, int rowId)\n {\n contactIndex = rowId;\n selectedContact = selected;\n\n // Visa detaljvyn när en rad i listan klickas\n showDetails();\n }", "@Override\n public void onListFragmentInteraction(SongsListContent.SongsListItem item) {\n Log.d(\"DBP\", \"Method to select song not implemented\");\n }", "public void onItemSelected(int id);", "@Override\n\t\t\tpublic void onItemSelected(AdapterView<?> parent, View view,\n\t\t\t\t\tint position, long id) {\n\t\t\t}", "@Override\n public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {\n }", "@Override\n public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {\n }", "@Override\n public void onItemSelected(AdapterView<?> adapterView, View view, int i, long l) {\n }", "@Override\n\tpublic void onListItemClick(ListView l, View v, int position, long id) {\n\t \n\t }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n }", "void notifyListItemInserted(int position);", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n if ( mMesasListListener != null ){\n //aviso al listener\n //obtengo la mesa pulsada\n Mesa mesaSelected = mesas.getMesa(position);\n mMesasListListener.onMesaSelected(mesaSelected,position);\n\n\n }\n }", "public interface OnSelectedItemChangeListener {\n void OnSelectedItemChange(PieMenuView source, int currentItem);\n }", "public void onItemSelected(String id);", "public void onItemSelected(String id);", "public void onItemSelected(String id);", "public void onItemSelected(String id);", "public void onItemSelected(String id);", "public void onItemSelected(Long id);", "@Override\n public void onListItemClick(ListView l, View v, int position, long id) {\n String activity = getListAdapter().getItem(position).toString();\n Toast.makeText(getActivity().getApplicationContext(), \"Task Chosen: \" + activity, Toast.LENGTH_SHORT).show();\n Intent i = new Intent(getActivity(), SensorLogActivity.class);\n i.putExtra(ACTIVITY_NAME, ((TaskSelectionActivity)getActivity()).getUsername());\n i.putExtra(ACTIVITY_NAME, activity);\n startActivity(i);\n }", "void onListFragmentInteraction(DummyItem item);", "void onListFragmentInteraction(DummyItem item);", "@Override\r\n\t\t\tpublic void onItemSelected(AdapterView<?> arg0, View arg1,\r\n\t\t\t\t\tint arg2, long arg3) {\n\t\t\t\treceive();\r\n\t\t\t}", "private void notifyListSelectionListener()\r\n {\r\n \tif (listSelectionListeners != null && listSelectionListeners.size() > 0) \r\n \t{\r\n ListSelectionEvent event = new ListSelectionEvent(this, avatarIndex, avatarIndex, false);\r\n\r\n for (ListSelectionListener listener : listSelectionListeners)\r\n {\r\n listener.valueChanged(event);\r\n }\r\n \t}\r\n }", "@Override\n\t\tpublic void onItemSelected(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\tlong arg3) {\n\t\t\t\n\t\t}", "@Override\n public void onItemClick(AdapterView<?> a, View v, int position, long id) {\n Toast.makeText(getApplicationContext(), \"Selected :\" + \" \" + listData.get(position), Toast.LENGTH_LONG).show();\n }", "public void onSelectionChanged();", "public void onShowMushroomSelectionDialogSelected(Context context);", "void onListClick();", "public interface OnItemSelecetedListener {\n void onItemSelected(String link);\n }", "public interface Callbacks {\n // Through this method is the activity notified of a selected list item\n void onAnimalSelected(Animal animal);\n }", "@Override\r\n\tpublic void onListItemClick(ListView l, View v, int position, long id) {\n\t\tCrime crime = ((CrimeAdapter)getListAdapter()).getItem(position);\r\n\t\tLog.d(TAG, crime.getTitle() + \"was click!\");\r\n\t\t\r\n\t\t// Start CrimeActivity\r\n\t\t// Intent intent = new Intent(getActivity(), CrimeActivity.class);\r\n\t\t\r\n\t\t// Start CrimePagerActivity with this crime\r\n\t\t/*Intent intent = new Intent(getActivity(), CrimePagerActivity.class);\r\n\t\tintent.putExtra(CrimeFragment.EXTRA_CRIME_ID, crime.getId());\r\n\t\tstartActivity(intent);*/\r\n\t\t\r\n\t\t// 以适配手机和平板的方式展示CrimeFragment\r\n\t\tmCallbacks.onCrimeSelected(crime);\r\n\t}", "void onListFragmentInteraction(Class item);", "@Override\r\n\t\t\tpublic void onItemSelected(AdapterView<?> arg0, View arg1,\r\n\t\t\t\t\tint arg2, long arg3) {\n\t\t\t\tchecklistIndex = arg2;\r\n\t\t\t\t\r\n\t\t\t}", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position,\n long id) {\n\n }", "@Override\n public void onListItemClick(ListView l, View v, int position, long id) {\n Log.i(\"LoaderCustom\", \"Item clicked: \" + id);\n }", "@Override\n public void onItemClick(View view, ListItem obj, int position) {\n }", "@Override\n\tpublic void onSelectionChanged(ListSelectionEvent e, List<ShoppingListObject> values) {\n\n\t}", "protected void onSelectedItemChanged() {\n if (selectedItem == null) {\n anchorLabel();\n getInputWidget().setText(\"\");\n } else {\n String playerName = ((Player)selectedItem).getName();\n getInputWidget().setText(playerName);\n floatLabel();\n }\n\n if (itemChooserListener != null) itemChooserListener.onSelectionChanged(this, selectedItem);\n }", "@Override\n\t\t\tpublic void onItemSelected(AdapterView<?> arg0, View paramView, int arg2, long arg3) {\n\t\t\t\tmItemListCurPosition = arg2;\n\t\t\t\tif (isFirstInit) {\n\t\t\t\t\tfocusView.initFocusView(paramView, false, 0);\n\t\t\t\t}\n\t\t\t\tfocusView.moveTo(paramView);\n\t\t\t\tif (mTextView != null) {\n\t\t\t\t\tmTextView.setTextColor(mContext.getResources().getColor(R.color.grey5_color));\n\t\t\t\t}\n\t\t\t\tif (mTextViewSetting != null) {\n\t\t\t\t\tmTextViewSetting.setTextColor(mContext.getResources().getColor(\n\t\t\t\t\t\t\tR.color.grey5_color));\n\t\t\t\t}\n\t\t\t\tmTextView = (TextView) paramView.findViewById(R.id.item_name);\n\t\t\t\tmTextViewSetting = (TextView) paramView.findViewById(R.id.item_setting);\n\t\t\t\tif (isFirstInit) {\n\t\t\t\t\tisFirstInit = false;\n\t\t\t\t\tmTextColorChangeFlag = true;\n\t\t\t\t\tlistTextColorSet();\n\t\t\t\t}\n\t\t\t}", "public void onEventSelected(int position);", "@Override\n public void onItemSelected(View view, int position) {\n }", "public interface OnEventSelectedListener {\n /** Called by FragmentEvents when a list item is selected */\n public void onEventSelected(int position);\n }", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n //NOTE: Position 0 is reserved for the manually added Prompt\n if (position > 0) {\n //Retrieving the Category Name of the selection\n mCategoryLastSelected = parent.getItemAtPosition(position).toString();\n //Calling the Presenter method to take appropriate action\n //(For showing/hiding the EditText field of Category OTHER)\n mPresenter.onCategorySelected(mCategoryLastSelected);\n } else {\n //On other cases, reset the Category Name saved\n mCategoryLastSelected = \"\";\n }\n }", "@Override\n protected void onListItemClick(ListView l, View v, int position, long id) {\n \t\n \t\n }", "@Override\n\tpublic void onItemSelected(AdapterView<?> parent, View view, int pos,\n\t\t\tlong id) {\n\t\t\n\t\t\n\t}", "void onListFragmentInteraction(Task item);", "@Override\n public void onItemSelected(AdapterView<?> parent, View view, int position, long id) {\n\n }", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t\t\t\tBaseData.item = (String[]) adapter.getItem(arg2);\n\t\t\t\tListIntentActivity.goActivity(ListActivity.this);\n\t\t\t}", "protected void onSelect() {\n\n }", "@Override\r\n\t public void onPause() {\n\t \tsuper.onPause();\r\n\t \t StaticStore.LogPrinter('e',\"onPause() ListSelection\");\r\n\t \t StaticStore.midlet.onPauseCalled();\r\n\t }", "@Override\n public void onItemClick(View view, int position) {\n if (MyUtil.notEmpty(dynamicResultList)) {\n\n if (itemSelectListener != null)\n itemSelectListener.itemSelected(dynamicResultList.get(position));\n }\n }", "public interface OnItemListClickListener {\n void onItemListSelected(Medicine item);\n }", "@Override\n public void onItemClick(View view, int position) {\n presenter.onSelectedCarreer(position);\n }", "public void onPageSelected(int pageSelected) {\n\t\t\t}", "@Override\r\n\t public void onResume() {\n\t \tsuper.onResume();\r\n\t \tStaticStore.LogPrinter('e',\"onResume() ListSelection\");\r\n\t \tStaticStore.midlet.onResumeCalled();\r\n\t }", "@Override\n public void onItemSelected(AdapterView<?> arg0, View arg1,\n int arg2, long arg3) {\n\n\n }", "public void onListItemClick( ListView l, View v, int position, long id )\n {\n }" ]
[ "0.7466268", "0.7101397", "0.7098625", "0.70372033", "0.7032316", "0.7032316", "0.7021653", "0.6976917", "0.6944782", "0.6935799", "0.6924011", "0.6915264", "0.69148546", "0.69135386", "0.69091874", "0.6894523", "0.6886321", "0.6872687", "0.6872687", "0.68624246", "0.685497", "0.68454903", "0.6842842", "0.68112254", "0.68110573", "0.6810251", "0.6797522", "0.67923427", "0.67891604", "0.67849064", "0.6779647", "0.67785215", "0.6778051", "0.67759556", "0.67759556", "0.67740506", "0.67704463", "0.6768949", "0.6757655", "0.675193", "0.67472494", "0.673793", "0.67371285", "0.6735196", "0.6733485", "0.67330337", "0.67276585", "0.67276585", "0.67276585", "0.67241603", "0.6717333", "0.6717333", "0.6695284", "0.6693513", "0.66911465", "0.6684714", "0.6682786", "0.6682786", "0.6682786", "0.6682786", "0.6682786", "0.6679511", "0.6678698", "0.6673555", "0.6673555", "0.66711515", "0.667093", "0.6668523", "0.6660564", "0.66583973", "0.66579473", "0.6655219", "0.6654082", "0.66468036", "0.66338843", "0.66281134", "0.6624064", "0.6622224", "0.6616313", "0.6611059", "0.6607473", "0.66069174", "0.6597097", "0.659529", "0.6591195", "0.65789014", "0.65747476", "0.6574108", "0.65651876", "0.65647054", "0.65554816", "0.65554464", "0.6551571", "0.6546308", "0.6536638", "0.6536638", "0.6533188", "0.6531031", "0.65188277", "0.6518435", "0.6516077" ]
0.0
-1
Filter the animals according to the supplied key, shared by the lexicon menu activity
public void updateUI() { List<Animal> animals; String searchQuery = LexiconPreferences.getSearchQuery(getActivity()); // Check if there's a search query present if (searchQuery != null) { ArrayList<String> whereArgs = new ArrayList<>(); whereArgs.add(LexiconPreferences.getFilterValue(getActivity())); animals = mAnimalManager.searchAnimals( mAnimalManager.createWhereClauseFromFilter(LexiconPreferences.getFilterKey(getActivity())), whereArgs, searchQuery ); } else { animals = mAnimalManager.getAnimals( mAnimalManager.createWhereClauseFromFilter(LexiconPreferences.getFilterKey(getActivity())), new String[]{LexiconPreferences.getFilterValue(getActivity())} ); } if (animals.size() > 0) { // If the fragment is already running, update the data in case something changed (some animal) if (mAnimalAdapter == null) { mAnimalAdapter = new AnimalAdapter(animals); mAnimalRecyclerView.setAdapter(mAnimalAdapter); } else { mAnimalAdapter.setAnimals(animals); mAnimalAdapter.notifyDataSetChanged(); } } else { RelativeLayout emptyList = (RelativeLayout) mView.findViewById(R.id.list_empty); emptyList.setVisibility(View.VISIBLE); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void filterItems()\n {\n System.out.println(\"filtered items (name containing 's'):\");\n Set<ClothingItem> items = ctrl.filterItemsByName(\"s\");\n items.stream().forEach(System.out::println);\n }", "public boolean isMatchFilterKey(String key) {\n boolean match = false;\n\n // Validate the title contains the key\n if (title.contains(key)) {\n System.out.println(String.format(\"Title for Talent %s contains the search key %s \", name, key));\n match = true;\n }else System.out.println(String.format(\"Title for Talent %s dose not contains the search key %s \", name, key));\n\n // Validate the Name contains the key\n if (name.contains(key)) {\n System.out.println(String.format(\"Name for Talent %s contains the search key %s \", name, key));\n match = true;\n }else System.out.println(String.format(\"Name for Talent %s dose not contains the search key %s \", name, key));\n\n // Validate the overview contains the key\n if (overview.contains(key)) {\n System.out.println(String.format(\"Overview for Talent %s contains the search key %s \", name, key));\n match = true;\n }else System.out.println(String.format(\"Overview for Talent %s dose not contains the search key %s \", name, key));\n\n // Validate the skills contains the key\n if (skills.contains(key)) {\n System.out.println(String.format(\"Skills for Talent %s contains the search key %s \", name, key));\n match = true;\n }else System.out.println(String.format(\"Skills for Talent %s dose not contains the search key %s \", name, key));\n\n return match;\n }", "public TypeFilterHonSearch(String key) {\r\n\t\temptyKey = StringUtils.isEmpty(key);\r\n\t\tif (emptyKey == false) {\r\n\t\t\tkey = key.trim().toLowerCase();\r\n\t\t\tif (key.length() > 0) {\r\n\t\t\t\tif (key.charAt(key.length() - 1) != '*') {\r\n\t\t\t\t\tkey += '*';\r\n\t\t\t\t}\r\n\t\t\t\tpattern = Pattern.compile(StringUtils.replace(key, \"*\", \".*\"));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n protected FilterResults performFiltering(CharSequence arg0) {\n String[] tmp = API.it().getKeywords(arg0.toString());\n FilterResults results = new FilterResults();\n results.values = tmp;\n results.count = tmp.length;\n return results;\n }", "public Artikel [] filter(Predicate<Artikel> predicate) {\n Artikel[] filteredList = new Artikel[key];\n Artikel [] liste = new Artikel[key];\n int i = 0;\n for (Map.Entry<Integer, Artikel> integerArtikelEntry : lager.entrySet()) {\n liste[i] = integerArtikelEntry.getValue();\n i++;\n }\n int p = 0;\n for (i = 0; i < key; i++) {\n if (predicate.test(liste[i])) {\n filteredList[p] = liste [i];\n p++;\n }\n }\n liste = filteredList;\n return liste;\n }", "@FXML\n public void filterCupboardIngredients(){\n String searchText = searchIngredientCupboard.getText();\n List<Ingredient> filteredList = ingredientsFromDatabase.stream().filter(new Predicate<Ingredient>() {\n @Override\n public boolean test(Ingredient ingredient) {\n //inclusive of the upper cases makes it case insensitive\n if (ingredient.getName().toUpperCase().contains(searchText.toUpperCase())){\n return true;\n } else {\n return false;\n }\n }\n }).collect(Collectors.toList());\n filterObservableList = FXCollections.observableList(filteredList);\n allIngredientsCupboardPane.setItems(filterObservableList);\n }", "private static void searchAnimalByName() {\n\t\tshowMessage(\"type in the animal's name: \\n\");\n\t\t\n\t\tString name = getUserTextTyped();\n\t\tToScreen.listAnimal(AnimalSearch.byName(name), true);\n\t\t\n\t\t//condition to do another search by name or go back to the main menu\n\t\t//if the user decide for doing another search the method is called again, otherwise it will go back to the main menu\n\t\tint tryAgain = askForGoMainMenu(\"Would you like to search for another name or go back to main menu?\\n Type 1 to search someone else \\n Type 0 to go to menu. \\n Choice: \");\n\t\tif(tryAgain == 1){\n\t\t\tsearchAnimalByName();\n\t\t} else {\n\t\t\tmain();\n\t\t}\n\t\t\n\t}", "@FXML\n public void filterIngredients(){\n String searchText = searchIngredient.getText();\n List<Ingredient> filteredList = ingredientsFromDatabase.stream().filter(new Predicate<Ingredient>() {\n @Override\n public boolean test(Ingredient ingredient) {\n //inclusive of the upper cases makes it case insensitive\n if (ingredient.getName().toUpperCase().contains(searchText.toUpperCase())){\n return true;\n } else {\n return false;\n }\n }\n }).collect(Collectors.toList());\n filterObservableList = FXCollections.observableList(filteredList);\n ingredientsList.setItems(filterObservableList);\n }", "public void retain(\n\t\tPredicate<String>\tkeyFilter)\n\t{\n\t\tfor (String key : new ArrayList<>(pairs.keySet()))\n\t\t{\n\t\t\tif (!keyFilter.test(key))\n\t\t\t\tpairs.remove(key);\n\t\t}\n\t}", "private void txtSearchingBrandKeyReleased(java.awt.event.KeyEvent evt) {\n String query=txtSearchingBrand.getText().toUpperCase();\n filterData(query);\n }", "public void filter(UserCommand cmd)\n\t{\n\t\t\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R. menu.filter_menu, menu);\n MenuItem searchItem = menu.findItem(R. id.action_search);\n SearchView searchView = (SearchView)\n searchItem.getActionView();\n searchView.setIconifiedByDefault(true);\n searchView.setImeOptions(EditorInfo.IME_ACTION_DONE);\n // SearchView searchView = (SearchView) menu.findItem(R.id.action_search).getActionView();\n searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {\n @Override\n public boolean onQueryTextSubmit(String query) {\n\n adapteer.getFilter().filter(query);\n return false;\n }\n\n @Override\n public boolean onQueryTextChange(String newText) {\n // adapter.getFilter().filter(newText);\n // filter recycler view when query submitted\n adapteer.getFilter().filter(newText);\n return false;\n }\n\n\n });\n return true;\n }", "void useKeywordsCheckBoxMenuItem_actionPerformed(ActionEvent e) {\n filterType = FilterAgent.USE_KEYWORDS;\n filterArticles();\n this.setTitle(titleBarText + \" - using Keywords\");\n }", "public abstract void filter();", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.log_in, menu);\n getMenuInflater().inflate(R.menu.searchfile, menu);\n final MenuItem myActionMenuItem = menu.findItem(id.search);\n searchView = (SearchView) myActionMenuItem.getActionView();\n changeSearchViewTextColor(searchView);\n ((EditText) searchView.findViewById(android.support.v7.appcompat.R.id.search_src_text)).setHintTextColor(getColor(color.white));\n searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {\n @Override\n public boolean onQueryTextSubmit(String query) {\n if(!searchView.isIconified()){\n searchView.setIconified(true);\n }\n myActionMenuItem.collapseActionView();\n return false;\n }\n\n @Override\n public boolean onQueryTextChange(String newText) {\n final List<ClinicItem> filtermodelist = filter(clinicList, newText);\n adapter.setfilter(filtermodelist);\n return true;\n }\n });\n return true;\n }", "public void remove(\n\t\tPredicate<String>\tkeyFilter)\n\t{\n\t\tfor (String key : new ArrayList<>(pairs.keySet()))\n\t\t{\n\t\t\tif (keyFilter.test(key))\n\t\t\t\tpairs.remove(key);\n\t\t}\n\t}", "@Override\r\n\tpublic List<Product> search(String key) {\n\tProductExample example = new ProductExample();\r\n\texample.createCriteria().andNameLike(\"%\"+key+\"%\");\r\n\texample.setOrderByClause(\"id desc\");\r\n\tList<Product> list = productMapper.selectByExample(example);\r\n\tsetAll(list);\r\n\treturn list;\r\n\t\t}", "default Collection<ItemStack> getContentsMatching(Predicate<ItemStack> predicate) {\n\t\treturn this.getContents().values().stream().filter(predicate).collect(Collectors.toList());\n\t}", "public void filterByMyReason(String enteredReason){\n // for each mood event in the list\n for (int i = 0; i < moodListBeforeFilterMy.getCount(); i++ ){\n // get the mood event's trigger text\n keyOfReason = moodListBeforeFilterMy.getMoodEvent(i).getTriggerText();\n // if it contains the entered key of reason, then add it to the new list\n if (keyOfReason != null && keyOfReason.toLowerCase().contains(enteredReason.toLowerCase())) {\n moodListAfterFilter.add(moodListBeforeFilterMy.getMoodEvent(i));\n }\n }\n }", "public static interface KeyValueFilter {\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu_categaries, menu);\n final MenuItem cartItem = menu.findItem(R.id.action_cart);\n View actionView = cartItem.getActionView();\n textCartItemCount =actionView.findViewById(R.id.cart_badge);\n actionView.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n onOptionsItemSelected(cartItem);\n }\n });\n\n// this code is for the searching the item in the layout\n MenuItem searchItem = menu.findItem(R.id.search);\n SearchView searchView = (SearchView) searchItem.getActionView();\n\n searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {\n @Override\n public boolean onQueryTextSubmit(String query) {\n return false;\n }\n\n @Override\n public boolean onQueryTextChange(String newText) {\n cat_Adapter.getFilter().filter(newText);\n return false;\n }\n });\n\n return true;\n }", "private void showMenuItem(final String key) {\n\t\titems.get(key).setEnabled(true);\n\t}", "public void filterByMyDisplayAll(){\n // add them into the new list\n for (int i = 0; i < moodListBeforeFilterMy.getCount(); i++ ){\n moodListAfterFilter.add(moodListBeforeFilterMy.getMoodEvent(i));\n }\n }", "public static ArrayList<String> getPossibilities(String key) {\n ArrayList<String> hints = new ArrayList<>();\n\n for (String a : keywords) {\n if (a.toLowerCase().startsWith(key.toLowerCase())) {\n hints.add(a);\n }\n }\n return hints;\n }", "public static void filter() {\n\t\t\n\t\tResult.filter(toggleGroup.getSelectedToggle().getUserData(), ((ComboBox)hbox3.getChildren().get(0)).getValue());\n\t\t\n\t}", "@Override\n\tpublic ArrayList<SearchItem> search(String key) {\n\t\treturn null;\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == R.id.filterImages) {\n setfilterImages();\n }\n \n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main2, menu);\n\n SearchManager searchManager =\n (SearchManager) getSystemService(Context.SEARCH_SERVICE);\n final SearchView searchView =\n (SearchView) menu.findItem(R.id.app_bar_search).getActionView();\n searchView.setSearchableInfo(\n searchManager.getSearchableInfo(getComponentName()));\n searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {\n @Override\n public boolean onQueryTextSubmit(String query) {\n //Toast.makeText(Main2Activity.this,query,Toast.LENGTH_LONG).show();\n //adapter.filter(query);\n return false;\n }\n\n @Override\n public boolean onQueryTextChange(String newText) {\n adapter.filter(newText);\n return false;\n }\n\n });\n\n\n\n return true;\n }", "private void hideMenuItem(final String key) {\n\t\titems.get(key).setEnabled(false);\n\t}", "public ArrayList<Animal> filterAnimals(String field, String value) {\n ArrayList<Animal> filteredAnimals = new ArrayList<>();\n if (getAnimals().size() > 0) {\n if (field.equals(\"breed\"))\n filteredAnimals = (ArrayList<Animal>) getAnimals().stream()\n .filter(animal -> animal.getBreedOrType().equals(value))\n .collect(Collectors.toList());\n else if (field.equals(\"name\"))\n filteredAnimals = (ArrayList<Animal>) getAnimals().stream()\n .filter(animal -> animal.getName().equals(value))\n .collect(Collectors.toList());\n }\n return filteredAnimals;\n }", "public HashMap<String, Shelter> getByRestriction(CharSequence gender, CharSequence age,\n CharSequence name){\n HashMap<String, Shelter> searchedList = shelters;\n if (!(gender == null)) {\n Set entries = searchedList.entrySet();\n for(Iterator<Map.Entry<String, Shelter>> it = entries.iterator();\n it.hasNext(); ) {\n Map.Entry<String, Shelter> entry = it.next();\n Shelter shelter = entry.getValue();\n String genderVal = shelter.getGender();\n if (!genderVal.contains(gender) && (genderVal.contains(\"Men\")\n || genderVal.contains(\"Women\"))){\n it.remove();\n }\n }\n }\n if (!(age == null)) {\n Set entries = searchedList.entrySet();\n for(Iterator<Map.Entry<String, Shelter>> it = entries.iterator();\n it.hasNext(); ) {\n Map.Entry<String, Shelter> entry = it.next();\n Shelter shelter = entry.getValue();\n String genderVal = shelter.getGender();\n if (!genderVal.contains(age) && (genderVal.contains(\"Children\")\n || genderVal.contains(\"Families w/ newborns\")\n || genderVal.contains(\"Young adults\"))){\n it.remove();\n }\n }\n }\n if (!(name == null)) {\n Set entries = searchedList.entrySet();\n for(Iterator<Map.Entry<String, Shelter>> it = entries.iterator();\n it.hasNext(); ) {\n Map.Entry<String, Shelter> entry = it.next();\n Shelter shelter = entry.getValue();\n String nameVal = shelter.getName();\n if (!nameVal.contains(name)){\n it.remove();\n }\n }\n }\n return searchedList;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.bin, menu);\n SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);\n MenuItem searchItem = menu.findItem(R.id.action_search);\n final SearchView searchView = (SearchView) MenuItemCompat.getActionView(searchItem);\n if (null != searchView) {\n searchView.setSearchableInfo(searchManager\n .getSearchableInfo(getComponentName()));\n searchView.setIconifiedByDefault(false);\n }\n SearchView.OnQueryTextListener queryTextListener = new SearchView.OnQueryTextListener() {\n public boolean onQueryTextChange(String newText) {\n // this is your adapter that will be filtered\n return true;\n }\n\n public boolean onQueryTextSubmit(String query) {\n //Here u can get the value \"query\" which is entered in the search box.\n Intent next = new Intent(BinActivity.this, SearchActivity.class);\n next.setFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);\n next.putExtra(\"title\",query);\n startActivity(next);\n return true;\n }\n };\n searchView.setOnQueryTextListener(queryTextListener);\n return true;\n }", "@Override\n public String filterWidgetAttribute(@Nonnull String attributeKey, Object attributeValue) {\n return attributeKey;\n }", "@FXML\n private void handleFilter(ActionEvent event) {\n if(!inSearch){\n btnFind.setImage(imageC);\n //query here\n String querry = txtInput.getText();\n if(querry !=null){\n obsSongs = FXCollections.observableArrayList(bllfacade.querrySongs(querry));\n lstSongs.setItems(obsSongs);\n }\n inSearch = true;\n }else{\n btnFind.setImage(imageF); \n txtInput.setText(\"\");\n init();\n inSearch = false;\n }\n }", "@Override\n public List<FoodItem> filterByName(String substring) {\n //turn foodItemList into a stream to filter the list and check if any food item matched \n return foodItemList.stream().filter(x -> x.getName().toLowerCase() \n .contains(substring.toLowerCase())).collect(Collectors.toList());\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n\n if (id == R.id.action_add_new_group) {\n //Toast.makeText(this,\"editprofile\",Toast.LENGTH_LONG).show();\n\n Intent intent = new Intent(GroupManagerActivity.this,AddGroupActivity.class);\n startActivity(intent);\n\n return true;\n }\n\n\n\n if (id == R.id.action_search_group_manager) {\n //Toast.makeText(this,\"editprofile\",Toast.LENGTH_LONG).show();\n\n /* newText = newText.toLowerCase();\n final List<AuditTrail> filteredList = new ArrayList<>();\n\n for (int i = 0; i < auditTrailList.size(); i++) {\n\n final String text = auditTrailList.get(i).getUsername().toLowerCase();\n if (text.contains(newText)) {\n\n filteredList.add(auditTrailList.get(i));\n }\n\n rvAudit.setLayoutManager(new LinearLayoutManager(AuditTrailStorageActivity.this));\n auditListAdapter = new AuditListAdapter(AuditTrailStorageActivity.this, filteredList);\n rvAudit.setAdapter(auditListAdapter);\n auditListAdapter.notifyDataSetChanged();\n }\n return false;\n*/\n\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "public void filterByFoReason(String enteredReason){\n // for each mood event in the list\n for (int i = 0; i < moodListBeforeFilterFo.getCount(); i++ ){\n // get the mood event's trigger text\n keyOfReason = moodListBeforeFilterFo.getMoodEvent(i).getTriggerText();\n // if it contains the entered key of reason, then add it to the new list\n if (keyOfReason != null && keyOfReason.toLowerCase().contains(enteredReason.toLowerCase())) {\n moodListAfterFilter.add(moodListBeforeFilterFo.getMoodEvent(i));\n }\n }\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {\n super.onCreateOptionsMenu(menu, menuInflater);\n menu.clear();\n menuInflater.inflate(R.menu.search_menu, menu);\n MenuItem searchItem = menu.findItem(R.id.actionSearch);\n SearchView searchView = (SearchView) searchItem.getActionView();\n // below line is to call set on query text listener method.\n searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {\n @Override\n public boolean onQueryTextSubmit(String query) {\n return false;\n }\n\n @Override\n public boolean onQueryTextChange(String newText) {\n // inside on query text change method we are\n // calling a method to filter our recycler view.\n filter(newText);\n return true;\n }\n });\n }", "public abstract boolean shouldObserve(String key);", "@Override\n public void onClick(View view) {\n Utils.saveInSharedPreference(activity, \"filter-state\", \"isStarFilterOn\", isStarFilterOn );\n Utils.saveInSharedPreference(activity, \"filter-state\", \"isFavFilterOn\", isFavFilterOn );\n\n if(!isFavFilterOn && !isStarFilterOn) {\n recyclerViewAdapter.getFilter().filter(\"A\"); //display entire list\n }\n else {\n recyclerViewAdapter.getFilter().filter(Utils.getFilterSting(isStarFilterOn, isFavFilterOn));\n }\n drawerLayout.closeDrawers();\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.home_screen, menu);\n final MenuItem myActionMenuItem = menu.findItem(R.id.action_search);\n final SearchView searchView = (SearchView) myActionMenuItem.getActionView();\n searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {\n @Override\n public boolean onQueryTextSubmit(String query) {\n if (!searchView.isIconified()) {\n searchView.setIconified(true);\n }\n myActionMenuItem.collapseActionView();\n searchBeerByName(query);\n return false;\n }\n\n @Override\n public boolean onQueryTextChange(String newText) {\n searchString = newText;\n searchHandler.removeCallbacks(searchRunnable);\n searchHandler.postDelayed(searchRunnable, 500);\n return true;\n }\n });\n myActionMenuItem.setOnActionExpandListener(new MenuItem.OnActionExpandListener() {\n @Override\n public boolean onMenuItemActionExpand(MenuItem item) {\n return true;\n }\n\n @Override\n public boolean onMenuItemActionCollapse(MenuItem item) {\n // Clearing the existing beer list\n loadNewBeerData(new ArrayList<BeerDetails>());\n // loading new data\n presenter.getBeers(1);\n searchString = null;\n return true;\n }\n });\n return true;\n }", "@Override\n protected FilterResults performFiltering(CharSequence constraint) {\n FilterResults results = new FilterResults();\n if (constraint != null && constraint.length() > 0) {\n //CONSTARINT TO UPPER\n constraint = constraint.toString().toUpperCase();\n List<Product> filters = new ArrayList<Product>();\n //get specific items\n for (int i = 0; i < filterList.size(); i++) {\n if (filterList.get(i).getAdi().toUpperCase().contains(constraint)) {\n Product p = new Product(filterList.get(i).getIncKey(),filterList.get(i).getCicekPasta(),filterList.get(i).getUrunKodu(),\n filterList.get(i).getSatisFiyat(),filterList.get(i).getKdv(),filterList.get(i).getResimKucuk(),\n filterList.get(i).getSiparisSayi(),filterList.get(i).getDefaultKategori(),filterList.get(i).getCicekFiloFiyat(),\n filterList.get(i).getAdi(), filterList.get(i).getResimBuyuk(), filterList.get(i).getIcerik());\n filters.add(p);\n }\n }\n results.count = filters.size();\n results.values = filters;\n if(filters.size()==0){ // if not found result\n TextView tv= (TextView) mainActivity.findViewById(R.id.sonucyok);\n tv.setText(\"Üzgünüz, aradığınız sonucu bulamadık..\");\n Log.e(\"bbı\",\"oıfnot\");\n }\n else\n mainActivity.findViewById(R.id.sonucyok).setVisibility(View.INVISIBLE);\n\n } else {\n results.count = filterList.size();\n results.values = filterList;\n }\n return results;\n }", "public static Predicate<BiomeSelectionContext> includeByKey(Collection<RegistryKey<Biome>> keys) {\n\t\treturn context -> keys.contains(context.getBiomeKey());\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.miFilters) {\n Toast.makeText(this, \"Clicked!\", Toast.LENGTH_SHORT).show();\n // Launch a second activity (age form)\n\n Intent i = new Intent(this, SearchFiltersActivity.class);\n i.putExtra(\"filter\", imageFilter);\n startActivityForResult(i, FILTERS_INTENT_CODE);\n }\n\n return super.onOptionsItemSelected(item);\n }", "private static void hideFilters(List<HealthDataFilter> allFilters) {\n Set<String> userHideFilterChoices = PreferenceUtility.getUserHideFilterChoices();\n if (userHideFilterChoices==null){\n if (AppConstant.DEBUG) Log.i(\"AppUtility:\"+\">\",\"Was no saved hidden filter\");\n return;\n }\n Iterator<HealthDataFilter> iterator = allFilters.iterator();\n while (iterator.hasNext()) {\n HealthDataFilter next = iterator.next();\n // if (next.getFilterName().equals(\"QUEENS\")){\n if (userHideFilterChoices.contains(next.getFilterName())){\n iterator.remove();\n }\n }\n }", "void filterOptions(FsItem f, Map<String, Object> map);", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu_main, menu);\n\n SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);\n searchView = (SearchView) menu.findItem(R.id.action_search).getActionView();\n searchMenuItem = menu.findItem(R.id.action_search);\n searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));\n searchView.setIconifiedByDefault(false);\n\n SearchView.OnQueryTextListener textChangeListener = new SearchView.OnQueryTextListener() {\n @Override\n public boolean onQueryTextChange(String newText) {\n // this is your adapter that will be filtered\n //dataAdapter.getFilter().filter(newText);\n Log.i(TAG, \"on text chnge text: \" + newText);\n\n\n rvAdapter.getFilter().filter(newText);\n rv.scrollToPosition(0);\n\n return true;\n }\n\n @Override\n public boolean onQueryTextSubmit(String query) {\n // this is your adapter that will be filtered\n //dataAdapter.getFilter().filter(query);\n Log.i(TAG, \"on query submit: \" + query);\n return true;\n }\n };\n searchView.setOnQueryTextListener(textChangeListener);\n\n\n return true;\n }", "ObservableList<MenuItem> getFilteredMenuItemList();", "@FXML\r\n void filterTableResult(KeyEvent event) {\r\n \tfilteredData.clear();\r\n\r\n for (twinsTable p : playerInfo) {\r\n if (matchesFilter(p)) {\r\n filteredData.add(p);\r\n }\r\n }\r\n\r\n // Must re-sort table after items changed\r\n reapplyTableSortOrder();\r\n }", "public Artikel[] filterAll (Predicate<Artikel> ... predicates){\n Artikel [] temp = new Artikel[key];\n for (Predicate<Artikel> predicate : predicates) {\n temp = filter(predicate);\n }\n return temp;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_weather, menu);\n\n // Here we get the action view we defined\n myActionMenuItem = menu.findItem(R.id.Itm_SearchAction_Menu);\n View actionView = myActionMenuItem.getActionView();\n\n // We then get the edit text view that is part of the action view\n if(actionView != null) {\n myActionEditText = (EditText) actionView.findViewById(R.id.myActionEditText);\n if(myActionEditText != null) {\n myActionEditText.addTextChangedListener(new TextWatcher() {\n\n @Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n String strWord = myActionEditText.getText().toString();\n if (TextUtils.isEmpty(strWord)) {\n mStrFilterWord = \"\";\n updatePrefs();\n } else {\n mStrFilterWord = strWord.toUpperCase(Locale.ENGLISH);\n }\n updateWeatherBasedOnCriteria();\n }\n\n @Override\n public void beforeTextChanged(CharSequence s, int start, int count, int after) {\n\n }\n\n @Override\n public void afterTextChanged(Editable s) {\n\n }\n });\n }\n }\n\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n protected FilterResults performFiltering(CharSequence charSequence) {\n FilterResults results = new FilterResults();\n\n if (charSequence != null && charSequence.length() > 0) {\n charSequence = charSequence.toString().toUpperCase();\n ArrayList<Icon> filterIcon = new ArrayList<>();\n\n for (int i = 0; i < mFilterList.size(); i++) {\n if (mFilterList.get(i).getName().toUpperCase().contains(charSequence)) {\n filterIcon.add(mFilterList.get(i));\n }\n }\n\n results.count = filterIcon.size();\n results.values = filterIcon;\n } else {\n results.count = mFilterList.size();\n results.values = mFilterList;\n }\n\n return results;\n }", "@Override // android.media.MediaFormat.FilteredMappedKeySet\n public String mapKeyToItem(String key) {\n return key;\n }", "public void filterName(String nameProduct){\n market.filterName(nameProduct);\n car = market.filters;\n }", "public void filterByFoDisplayAll(){\n // add them into the new list\n for (int i = 0; i < moodListBeforeFilterFo.getCount(); i++ ){\n moodListAfterFilter.add(moodListBeforeFilterFo.getMoodEvent(i));\n }\n }", "@Override\n\tpublic void filterClick() {\n\t\t\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n //handle presses on the action bar items\n switch (item.getItemId()) {\n // if the item in tool bar is selected\n case R.id.activity_filter:\n // check which option is selected\n checkWhichIsChosen();\n // if there are more than one options are selected, then braek\n if(flag > 1){\n Toast.makeText(this,\"Warning: More than one option is chosen\" ,Toast.LENGTH_LONG).show();\n setErrorMessages();\n break;\n }\n // if there is only one option is selected, then save the mood event list in the file\n if(flag == 1){\n SaveFile saveFile = new SaveFile();\n saveFile.saveArrayList(getApplicationContext(), moodListAfterFilter, FILENAME);\n // save the options which the user chosen\n saveOption();\n }\n // if no option is selected, then delete the file.\n if (flag == 0){\n // save the option\n saveOption();\n deleteFile(\"filter.sav\");\n }\n // jump to main activity\n setResult(RESULT_OK);\n finish();\n return true;\n\n }\n return super.onOptionsItemSelected(item);\n }", "public void filterBy(Map<String, List<String>> queryMap) {\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n MenuItem item = menu.findItem(R.id.menuSearch);\n SearchView searchView = (SearchView) item.getActionView();\n\n searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {\n @Override\n public boolean onQueryTextSubmit (String query) { return false; }\n\n @Override\n public boolean onQueryTextChange(String newText) {\n updateList(posts);\n postAdapter.getFilter().performFiltering(newText);\n return false;\n }\n });\n\n\n return super.onCreateOptionsMenu(menu);\n }", "public ReturnCode filterKeyValue(KeyValue kv) {\r\n\t\tif ( ACL_BYTE == kv.getQualifier()[0]) { // Match ACL\r\n\t\t\tif ( -1 == this.amfc.allowAccess(kv.getValue(),0)) {\r\n\t\t\t\treturn ReturnCode.NEXT_ROW;\r\n\t\t\t}\r\n\t\t} else if (META_BYTE == kv.getQualifier()[0]) {\r\n\t\t\tif ( -1 == this.amfc.allowMeta(kv.getValue(),0)) {\r\n\t\t\t\treturn ReturnCode.NEXT_ROW;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn ReturnCode.INCLUDE;\r\n\t}", "private void displayFilter() throws JSONException, InterruptedException {\r\n logger.log(Level.INFO, \"\\nPlease enter the type of club you would \" +\r\n \"like to filter by or 'back' to return to initial prompt:\");\r\n \r\n // club name that user searches for\r\n String filter = in.nextLine();\r\n \r\n // exit if user chooses to do so, otherwise search database\r\n if (\"back\".equalsIgnoreCase(filter))\r\n displayOpen();\r\n else\r\n filterClub(filter);\r\n }", "public Inventory searchForItem (TheGroceryStore g, Inventory i, String key);", "@Override\r\n public boolean onCreateOptionsMenu(Menu icon){\n\r\n MenuInflater expand = getMenuInflater();\r\n\r\n expand.inflate(R.menu.top_menu, icon); //Referencing to the specific menu\r\n\r\n MenuItem search = icon.findItem(R.id.search_bar);\r\n\r\n SearchView searchView = (SearchView) search.getActionView(); //Displays the search view button\r\n\r\n searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {\r\n\r\n\r\n @Override\r\n public boolean onQueryTextSubmit(String s) {//Begins filtering here\r\n\r\n adapterDevices.getFilter().filter(s);\r\n\r\n return false;\r\n }\r\n //Sends typed string in search bar to trigger search\r\n\r\n\r\n //Method is triggered if there is text change\r\n @Override\r\n public boolean onQueryTextChange(String s) {\r\n\r\n if(s.equals(\"\")){ //When search bar is empty again the page is reloaded\r\n\r\n Intent refresh = new Intent(getApplicationContext(), MyDevicesActivity.class);\r\n\r\n startActivity(refresh);\r\n\r\n finish();\r\n\r\n }\r\n return false;\r\n }\r\n });\r\n\r\n\r\n return true;\r\n\r\n\r\n }", "private void filter(String text) {\n ArrayList<ChildItem> filterdNames = new ArrayList<>();\n\n //looping through existing elements\n for (ChildItem s : dataParent ) {\n\n //if the existing elements contains the search input\n if (s.getKode_barang().toLowerCase().contains(text.toLowerCase())) {\n //adding the element to filtered list\n filterdNames.add(s);\n }\n }\n\n //calling a method of the adapter class and passing the filtered list\n adapter.filterList(filterdNames);\n }", "public void checkWhichIsChosen(){\n // reset all initial set up\n moodListAfterFilter.clear();\n deleteFile(\"filter.sav\");\n flag = 0;\n // key of reason and moos state which is entered by user\n enteredMyReason = myReasonEditText.getText().toString();\n enteredFoReason = foReasonEditText.getText().toString();\n selectedMyMoodState = myEmotionalStateSpinner.getSelectedItem().toString();\n selectedFoMoodState = foEmotionalStateSpinner.getSelectedItem().toString();\n // if Myself Mood state is selected, then jump to its filter function\n if(selectedMyMoodState != null && !selectedMyMoodState.isEmpty()){\n filterByMyMoodState(selectedMyMoodState);\n flag ++;\n }\n // if Following Mood state is selected, then jump to its filter function\n if(selectedFoMoodState != null && !selectedFoMoodState.isEmpty()){\n filterByFoMoodState(selectedFoMoodState);\n flag ++;\n }\n // if Myself most recent week is selected, then jump to its filter function\n if (myMostRecentWeekCheckbox.isChecked()){\n filterByMyMostRece();\n flag ++;\n }\n // if Following most recent week is selected, then jump to its filter function\n if (foMostRecentWeekCheckbox.isChecked()){\n filterByFoMostRece();\n flag ++;\n }\n // if Myself display all is selected, then jump to its filter function\n if (myDisplayAllCheckbox.isChecked()){\n filterByMyDisplayAll();\n flag ++;\n }\n // if Following display all is selected, then jump to its filter function\n if (foDisplayAllCheckbox.isChecked()){\n filterByFoDisplayAll();\n flag ++;\n }\n // if Myself key of reason is entered, then jump to its filter function\n if(enteredMyReason != null && !enteredMyReason.isEmpty()){\n filterByMyReason(enteredMyReason);\n flag ++;\n }\n // if Following key of reason is entered, then jump to its filter function\n if(enteredFoReason != null && !enteredFoReason.isEmpty()){\n filterByFoReason(enteredFoReason);\n flag ++;\n }\n }", "public abstract boolean isItemFiltered(pt.keep.oaiextended.AgentItem item);", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.learningcard_menu, menu);\n\n MenuItem searchItem = menu.findItem(R.id.action_search);\n SearchView searchView = (SearchView) searchItem.getActionView();\n // after searchView has been clicked set Listener on text change in box\n searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {\n @Override\n public boolean onQueryTextSubmit(String query) {\n return false;\n }\n // send new Text on textchange to adapter\n @Override\n public boolean onQueryTextChange(String newText) {\n adapter.getFilter().filter(newText);\n return false;\n }\n });\n return true;\n }", "private void loadSuggest() {\n foodList.orderByChild(\"MenuId\").equalTo(categoryId).\n addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n for (DataSnapshot postSnapshot: dataSnapshot.getChildren()){\n Log.e(\"Tag\",postSnapshot.getKey());\n Food item = postSnapshot.getValue(Food.class);\n suggestList.add(item.getName());\n }\n }\n\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n\n }\n });\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);\n\n MenuItem searchItem = menu.findItem(R.id.action_search);\n searchView = (SearchView) searchItem.getActionView();\n searchView.setQueryHint(getString(R.string.search_film));\n searchView.setOnQueryTextListener(this);\n\n return true;\n }", "public void getAllAttributeTypesKeys(Set<String> all, ItemFilter<IAttributeType<?>> filter);", "@Override\n public List<FoodItem> filterByName(String substring) {\n if (foodItemList == null || foodItemList.size() == 0)\n return foodItemList;\n List<FoodItem> foodCandidate = new ArrayList<>();\n \tfor (FoodItem food : foodItemList) {\n if (food.getName().equals(substring)) {\n foodCandidate.add(food);\n }\n \t}\n return foodCandidate;\n \n }", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);\r\n SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);\r\n SearchView searchView = (SearchView) menu.findItem(R.id.action_search).getActionView();\r\n\r\n searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));\r\n searchView.setIconifiedByDefault(false);\r\n searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {\r\n @Override\r\n public boolean onQueryTextSubmit(String query) {\r\n return false;\r\n }\r\n\r\n @Override\r\n public boolean onQueryTextChange(String newText) {\r\n setSearchFragement();\r\n\r\n List<String> searchedList = search(newText);\r\n adapter = new ArrayAdapter<String>(getApplicationContext(), android.R.layout.simple_list_item_1, searchedList);\r\n final ListView listview = (ListView) findViewById(R.id.listView1);\r\n adapter.getFilter().filter(newText);\r\n listview.setAdapter(adapter);\r\n return false;\r\n }\r\n });\r\n return true;\r\n }", "public static Predicate<BiomeSelectionContext> excludeByKey(Collection<RegistryKey<Biome>> keys) {\n\t\treturn context -> !keys.contains(context.getBiomeKey());\n\t}", "@Inject @Optional\n\tprivate void filterVariations(@UIEventTopic(TermSuiteEvents.NEW_VARIATION_FILTER) Map<Class<?>, Object> params) {\n\t\tif(Objects.equals(\n\t\t\t\tBrokerUtil.get(params, ETerminology.class),\n\t\t\t\tcontext.get(ETerminology.class))) {\n\t\t\tviewer.setFilters(null, BrokerUtil.get(params, VariationFilter.class));\n\t\t\tviewer.expandToLevel(2);\n\t\t}\n\t}", "public void setMenuFilter(ObjectMenuFilter filter);", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu_main, menu);\n MenuItem menuItem = menu.findItem(R.id.action_search);\n\n searchView = (SearchView) MenuItemCompat.getActionView(menuItem);\n //since we start highlighted at item 0\n searchView.setQueryHint(\"Search Devices...\");\n searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {\n @Override\n public boolean onQueryTextSubmit(String query) {\n return false;\n }\n\n @Override\n public boolean onQueryTextChange(String newText) {\n //search every fragment for the text entered\n // TODO: find a more efficient way to search.\n // maybe search only active tabs, and make sure to filter text upon switching tabs.\n // maybe just use multiple threads\n\n devicesFragment.getDevicesAdapter().getFilter().filter(newText);\n actionsFragment.getActionsAdapter().getFilter().filter(newText);\n return true;\n }\n });\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.home, menu);\n\n searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);\n searchView = (SearchView) menu.findItem(R.id.menu_search_id).getActionView();\n searchView.setIconifiedByDefault(false);//Do not expand the View\n searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));\n /*All logic about searching for a story*/\n Searcher searcher = new Searcher(this, searchView);\n searcher.setAll_adapter(AllStories.itemAdapter);\n searcher.setAll_no_stories(AllStories.no_stories_found);\n searcher.setPopular_adapter(PopularStories.itemAdapter);\n searcher.setPopular_no_stories(PopularStories.no_stories_text_view);\n searcher.search();\n\n\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n // Inflate the menu; this adds items to the action bar if it is present.\n getMenuInflater().inflate(R.menu.menu_main, menu);//Menu Resource, Menu\n\n SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);\n searchMenuItem = menu.findItem(R.id.action_search);\n searchView = (SearchView) searchMenuItem.getActionView();\n\n searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));\n searchView.setSubmitButtonEnabled(false);\n searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {\n @Override\n public boolean onQueryTextSubmit(String query) {\n return false;\n }\n\n @Override\n public boolean onQueryTextChange(String newText) {\n storageGridViewAdapter.getFilter().filter(newText);\n return true;\n }\n });\n\n return true;\n }", "private List<moneda> filter(List<moneda> p1, String query)\n {\n query = query.toLowerCase();\n final List<moneda> filteredModeList = new ArrayList<>();\n for (moneda model:p1)\n {\n final String text = model.getNombre().toLowerCase();\n if(text.startsWith(query))\n {\n filteredModeList.add(model);\n }\n }\n return filteredModeList;\n }", "public List<Dictionary> getDictionaryEntrysByCategory(String filter, String categoryFilter)\n throws LIMSRuntimeException {\n try {\n String sql = \"\";\n\n if (filter != null) {\n // bugzilla 1847: use dictEntryDisplayValue\n // bugzilla 2440 sql is incorrect - duplicate entries displaying\n // in dropdown\n if (!StringUtil.isNullorNill(categoryFilter)) {\n sql = \"from Dictionary d \"\n + \"where (d.localAbbreviation is not null and upper(d.localAbbreviation) || \"\n + enquote(IActionConstants.LOCAL_CODE_DICT_ENTRY_SEPARATOR_STRING)\n + \" || upper(d.dictEntry) like upper(:param1) and d.isActive= \"\n + enquote(YES)\n + \" and d.dictionaryCategory.categoryName = :param2)\"\n + \" OR (d.localAbbreviation is null and upper(d.dictEntry) like upper(:param1) and d.isActive= \"\n + enquote(YES) + \" and d.dictionaryCategory.categoryName = :param2)\";\n } else {\n sql = \"from Dictionary d \"\n + \"where (d.localAbbreviation is not null and upper(d.localAbbreviation) || \"\n + enquote(IActionConstants.LOCAL_CODE_DICT_ENTRY_SEPARATOR_STRING)\n + \" || upper(d.dictEntry) like upper(:param1) and d.isActive= \"\n + enquote(YES)\n + \")\"\n + \" OR (d.localAbbreviation is null and upper(d.dictEntry) like upper(:param1) and d.isActive= \"\n + enquote(YES) + \")\";\n }\n } else {\n if (!StringUtil.isNullorNill(categoryFilter)) {\n sql = \"from Dictionary d where d.dictEntry like :param1 and d.isActive= \" + enquote(YES)\n + \" and d.dictionaryCategory.categoryName = :param2\";\n } else {\n sql = \"from Dictionary d where d.dictEntry like :param1 and d.isActive= \" + enquote(YES);\n }\n }\n\n sql += \" order by d.dictEntry asc\";\n Query query = HibernateUtil.getSession().createQuery(sql);\n query.setParameter(\"param1\", filter + \"%\");\n if (!StringUtil.isNullorNill(categoryFilter)) {\n query.setParameter(\"param2\", categoryFilter);\n }\n\n @SuppressWarnings(\"unchecked\")\n List<Dictionary> list = query.list();\n HibernateUtil.getSession().flush();\n HibernateUtil.getSession().clear();\n\n return list;\n\n } catch (Exception e) {\n // bugzilla 2154\n LogEvent.logError(\"DictionaryDAOImpl\", \"getDictionaryEntrys()\", e.toString());\n throw new LIMSRuntimeException(\n \"Error in Dictionary getDictionaryEntrys(String filter, String categoryFilter)\", e);\n }\n }", "public interface FilterAction {\n /**\n * Takes search entities that has been returned from {@link cz.muni.fi.pb162.find.filesystem.FSWalkResult}\n * Applies all the filters that have been enabled and returns filtered entries.\n *\n * To check which filters are active use {@link cz.muni.fi.pb162.find.ApplicationOptions}\n *\n * @param entries - Not filtered search entities\n * @return filtered search entities\n */\n List<SearchEntry> filter(List<SearchEntry> entries);\n}", "default Set<StackKey> findAll(Predicate<ItemStack> filter) {\n Set<StackKey> items = new HashSet<>();\n for (IInventoryAdapter inventoryObject : this) {\n for (IInvSlot slot : InventoryIterator.get(inventoryObject)) {\n ItemStack stack = slot.getStack();\n if (!InvTools.isEmpty(stack) && filter.test(stack)) {\n stack = stack.copy();\n InvTools.setSize(stack, 1);\n items.add(StackKey.make(stack));\n }\n }\n }\n return items;\n }", "public void feedCat(){\n this.isHungry = false;\n this.isHappy = false;\n }", "void displayFilteredAlbums();", "FeatureHolder filter(FeatureFilter filter);", "public void filterByMyMoodState(String selectedMoodState){\n // for each mood event in the list\n for (int i = 0; i < moodListBeforeFilterMy.getCount(); i++ ){\n // get the mood event's mood state\n stateOfMood = moodListBeforeFilterMy.getMoodEvent(i).getMoodState();\n // if it equals the selected mood state, then add it to the new list\n if (stateOfMood.equals(selectedMoodState)) {\n moodListAfterFilter.add(moodListBeforeFilterMy.getMoodEvent(i));\n }\n }\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_search, menu);\n MenuItem searchItem = menu.findItem(R.id.action_search);\n final SearchView searchView = (SearchView) MenuItemCompat.getActionView(searchItem);\n searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {\n // When a search is made, calls fetchArticles to make new request\n @Override\n public boolean onQueryTextSubmit(String query) {\n topStories = false;\n filter.setQuery(query);\n gvResults.clearOnScrollListeners();\n setUpRecycler();\n findViewById(R.id.relativeLayout).setVisibility(View.GONE);\n findViewById(R.id.tvHeading).setVisibility(View.GONE);\n fetchArticles(0,true);\n searchView.clearFocus();\n return true;\n }\n\n @Override\n public boolean onQueryTextChange(String newText) {\n return false;\n }\n });\n\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu_item, menu);\n MenuItem searchItem = menu.findItem(R.id.action_search);\n SearchView searchView = (SearchView) searchItem.getActionView();\n searchView.setImeOptions(EditorInfo.IME_ACTION_DONE);\n try{ searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {\n @Override\n public boolean onQueryTextSubmit(String query) {\n return false;\n }\n\n @Override\n public boolean onQueryTextChange(String newText) {\n DeliveryReturnBySupervisorAdapter.getFilter().filter(newText);\n return false;\n }\n });\n }\n catch (Exception e)\n {\n e.printStackTrace();\n Intent intent_stay = new Intent(DeliveryReturnBySupervisor.this, DeliveryWithoutStatus.class);\n Toast.makeText(this, \"Page Loading...\", Toast.LENGTH_SHORT).show();\n startActivity(intent_stay);\n }\n return true;\n }", "public abstract void removeDisplayedItem(String key);", "default Collection<ItemStack> getContentsMatchingSimulated(Predicate<ItemStack> predicate) {\n\t\treturn this.getContentsSimulated().stream().map(ItemStack::copy).filter(predicate).collect(Collectors.toList());\n\t}", "public void metodoTakeWhile() {\n\n // takeWhile it stops once it has found an element that fails to match\n List<Dish> slicedMenu1\n = specialMenu.stream()\n .takeWhile(dish -> dish.getCalories() < 320)\n .collect(toList());\n }", "Map<String, String> getFilters();", "protected void performFiltering(CharSequence text, int keyCode) {\n/* 528 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "public void filter(CharSequence constraint) {\n mItemFilter.filter(constraint);\n }", "public void searchBarClick() {\n String searchText = searchView.getText().toString();\n if(searchText.equals(\"Age\")) {\n age.setVisibility(View.VISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"Sex\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.VISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"Chest Pain\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.VISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"Resting Blood Pressure\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.VISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"Serum Cholesterol\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.VISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"Fasting Blood Sugar Larger\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.VISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"Resting Electroc. Result\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.VISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"Maximum Heart Rate Achieved\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.VISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"Exercise Induced Angina\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.VISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"ST Depression Induc. ex.\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.VISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"Slope of Peak Exercise ST\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.VISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"Number of Major Vessel\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.VISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"Thalassemia\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.VISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"Pregnancies\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.VISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"Glucose\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.VISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"Blood Pressure\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.VISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"Skin Thickness\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.VISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"Insulin\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.VISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"BMI\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.VISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n } else if(searchText.equals(\"Diabetes Pedigree Function\")) {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.VISIBLE);\n } else {\n age.setVisibility(View.INVISIBLE);\n sex.setVisibility(View.INVISIBLE);\n cp.setVisibility(View.INVISIBLE);\n trestbps.setVisibility(View.INVISIBLE);\n chol.setVisibility(View.INVISIBLE);\n fbs.setVisibility(View.INVISIBLE);\n restecg.setVisibility(View.INVISIBLE);\n thalach.setVisibility(View.INVISIBLE);\n exang.setVisibility(View.INVISIBLE);\n oldpeak.setVisibility(View.INVISIBLE);\n slope.setVisibility(View.INVISIBLE);\n ca.setVisibility(View.INVISIBLE);\n thal.setVisibility(View.INVISIBLE);\n imageSection.setVisibility(View.INVISIBLE);\n\n pregnancies.setVisibility(View.INVISIBLE);\n glucose.setVisibility(View.INVISIBLE);\n bloodPressure.setVisibility(View.INVISIBLE);\n skinThick.setVisibility(View.INVISIBLE);\n bmi.setVisibility(View.INVISIBLE);\n insulin.setVisibility(View.INVISIBLE);\n diabetes.setVisibility(View.INVISIBLE);\n }\n }", "@Override\n protected FilterResults performFiltering(CharSequence constraint) {\n\n String searchText = constraint.toString().toLowerCase();\n\n List<MapDataModel> filteredList = new ArrayList<>();\n\n if(searchText.isEmpty() || searchText.length() == 0){\n filteredList.addAll(doctorslist);\n }else{\n for (MapDataModel doctorlist: doctorslist){\n\n if (doctorlist.getDoctorname().toLowerCase().contains(searchText)){\n filteredList.add(doctorlist);\n }\n }\n }\n\n FilterResults filterResults = new FilterResults();\n filterResults.values = filteredList;\n\n return filterResults;\n }", "boolean useItem(Command command) {\n HashMap newInventory = inventory.getInventory();\n Iterator iterator = newInventory.entrySet().iterator();\n String seeItem;\n String nameOfItem = \"\";\n String useItem = \"debug\";\n\n while (iterator.hasNext()) {\n HashMap.Entry liste = (HashMap.Entry) iterator.next();\n String itemName = (String) liste.getKey();\n if (itemName.equalsIgnoreCase(command.getSecondWord())) {\n useItem = itemName;\n nameOfItem = itemName;\n break;\n }\n }\n if (!nameOfItem.equals(\"\") && inventory.getUseable(nameOfItem)) {\n\n System.out.println(\"You have dropped: \" + nameOfItem);\n inventory.removeItemInventory(nameOfItem);\n player.setEnergy(player.getEnergy() + 20);\n player.setHealth(player.getHealth() + 5);\n\n return true;\n }\n return false;\n }", "protected static void searchByKeysHashID(String keys, String myId) {\n String[] splitWords = new String[keys.split(\"[ ]+\").length];\n splitWords = keys.split(\"[ ]+\");\n System.out.println(splitWords[0]);\n for (String keyWord : splitWords) {\n keyWord = keyWord.toLowerCase();\n if (map.get(keyWord) != null) {\n ArrayList<Integer> allInstancesofWord = (ArrayList<Integer>) map.get(keyWord);\n {\n for (int i = 0; i < allInstancesofWord.size(); i++) {\n\n Product e = productList.get(allInstancesofWord.get(i));\n if (e.productIdMatch(myId)) // if an element has the desired id and it has the correct key terms. it is printed.\n {\n System.out.println(\"I hope this Worksid\");\n System.out.println(productList.get(allInstancesofWord.get(i)));\n ProductGUI.Display(e.toString() + \"\\n\");\n }\n }\n }\n }\n if (map.get(keyWord) == null) {\n System.out.println(\"The products you are searching for were not found\");\n }\n }\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.meme_view, menu);\n MenuItem search = menu.findItem(R.id.search_menu);\n search.setVisible(false);\n MenuItem addMeme = menu.findItem(R.id.open_image);\n addMeme.setVisible(false);\n }", "private void filterResults(String medium) {\r\n\t\tnew HomePageAdverteerder(driver).openExchangePage()\r\n\t\t\t.selectFilterOptions(Filter.MEDIUM, new String[] {medium})\r\n\t\t\t.selectFilterOptions(Filter.FORMAAT_CODE, new String[] {FULL_PAGE})\r\n\t\t\t.applyFilters();\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);\n MenuItem menuItemSearch = menu.findItem(R.id.search);\n MenuItem menuItemCart = menu.findItem(R.id.cart);\n\n if (CURRENT_TAG.equals(TAG_SEARCH)) {\n hideMenuItem(menuItemSearch);\n showMenuItem(menuItemCart);\n return true;\n }\n\n if (CURRENT_TAG.equals(TAG_MY_CART)) {\n hideMenuItem(menuItemCart);\n showMenuItem(menuItemSearch);\n return true;\n }\n\n showMenuItem(menuItemCart);\n showMenuItem(menuItemSearch);\n\n return true;\n }" ]
[ "0.5693252", "0.5643201", "0.56060153", "0.5439196", "0.53535974", "0.5290784", "0.52361387", "0.52336246", "0.51788455", "0.51716673", "0.51428276", "0.51242876", "0.51148367", "0.5107099", "0.51038843", "0.5084255", "0.50840145", "0.5081014", "0.50787413", "0.50534254", "0.5020218", "0.50012124", "0.49903333", "0.4986465", "0.4971365", "0.49665284", "0.49536994", "0.4949224", "0.49485448", "0.49417314", "0.4925573", "0.4912464", "0.49064624", "0.4904798", "0.49035648", "0.48947793", "0.48903075", "0.48804802", "0.48632473", "0.48627433", "0.4843629", "0.4827061", "0.4821826", "0.48101428", "0.48047405", "0.4783304", "0.47757092", "0.47732618", "0.4765657", "0.4762163", "0.47593376", "0.4741625", "0.4736777", "0.4736509", "0.4729905", "0.47034287", "0.46902853", "0.46862015", "0.46823984", "0.46810707", "0.46744543", "0.46706793", "0.46688417", "0.46636614", "0.4649636", "0.46453065", "0.46424976", "0.4629512", "0.46221948", "0.46126536", "0.4610357", "0.46067178", "0.46003276", "0.46003112", "0.45978284", "0.45906627", "0.45789924", "0.4577567", "0.45719647", "0.4569296", "0.45682114", "0.45667407", "0.45662814", "0.4566276", "0.45627812", "0.45623964", "0.45622608", "0.45451605", "0.45416594", "0.4539269", "0.45352772", "0.45351768", "0.45343387", "0.45336476", "0.4532041", "0.45269617", "0.45225745", "0.45199975", "0.45178953", "0.4517553", "0.45152307" ]
0.0
-1
Wait for the view being rendered so that its dimensions are known and Picasso can use them to resize the image
@Override public void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom) { ImageLoader.getInstance(getActivity()).loadImage( mAnimal.getImage(), mImageImageView ); // Remove the listener mImageImageView.removeOnLayoutChangeListener(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void handleSizeChange(Object observable) {\n imageView.fitToSize(getWidth(), getHeight());\n placeHolder.setGlyphSize(Math.min(getWidth(), getHeight()) * 0.6);\n }", "@Override\n public void onBitmapLoaded(Bitmap bitmap, Picasso.LoadedFrom from) {\n if(bitmap.getHeight()>bitmap.getWidth()){\n\n progressBar.setVisibility(View.INVISIBLE);\n //load to imageview and set scale type to center crop\n imageView.setScaleType(ImageView.ScaleType.CENTER_CROP);\n imageView.setImageBitmap(bitmap);\n\n }else {\n\n progressBar.setVisibility(View.INVISIBLE);\n //load to imageview and set scale type to fitxy\n imageView.setScaleType(ImageView.ScaleType.FIT_XY);\n imageView.setImageBitmap(bitmap);\n\n }\n\n }", "@Override\n public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {\n float a = (float) viewHolder.img2.getWidth() / (float) loadedImage.getWidth();\n viewHolder.img2.setImageBitmap(resize(loadedImage, a));\n }", "@Override\n public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {\n float a = (float) viewHolder.img2.getWidth() / (float) loadedImage.getWidth();\n viewHolder.img2.setImageBitmap(resize(loadedImage, a));\n }", "@Override \n public void run() {\n Drawable drawable = null; \n int newImgWidth = 0; \n int newImgHeight = 0; \n try { \n drawable = Drawable.createFromStream(new URL(mUrl).openStream(), \"image\"); \n //对图片进行缩放 \n //newImgWidth = drawable.getIntrinsicWidth(); \n //newImgHeight = drawable.getIntrinsicHeight(); \n \n //取得屏幕分辨率\n DisplayMetrics dm = new DisplayMetrics();\n MainPage.instance.getWindowManager().getDefaultDisplay().getMetrics(dm);\n newImgWidth = dm.widthPixels;\n newImgHeight = (newImgWidth / drawable.getIntrinsicWidth()) * drawable.getIntrinsicHeight(); \n } catch (Exception e) { \n // TODO: handle exception \n e.printStackTrace(); \n } \n //让线程休眠1秒 \n SystemClock.sleep(1000); \n \n //使用Handler更新UI \n Message msg = handler.obtainMessage(); \n HashMap<String, Object> hashMap = new HashMap<String, Object>(); \n hashMap.put(\"imageView\", imageView); \n hashMap.put(\"drawable\", drawable); \n msg.obj = hashMap; \n msg.arg1 = newImgWidth; \n msg.arg2 = newImgHeight; \n handler.sendMessage(msg); \n }", "@Test public void inJustDecodeBoundsIfResizing() {\n final Request requiresResize = new Request.Builder(TestUtils.URI_1).resize(20, 15).build();\n final BitmapFactory.Options resizeOptions = createBitmapOptions(requiresResize);\n assertThat(resizeOptions).isNotNull();\n assertThat(resizeOptions.inJustDecodeBounds).isTrue();\n }", "@Override\n public void onResourceReady(BitmapFactory.Options resource, GlideAnimation<? super BitmapFactory.Options> glideAnimation) {\n scaleImageView.setScale((float)resource.outWidth / (float)resource.outHeight);\n }", "@SuppressLint(\"ClickableViewAccessibility\")\n private void setupPostImageView() {\n // Show the ProgressBar while waiting for image to load\n progressBar.setVisibility(View.VISIBLE);\n\n /*\n * prismPostImageView will have a width of 90% of the screen\n * prismPostImageView will have a max height of 60% of the screen\n * This causes any images that are stronger in height to not span the entire screen\n */\n// prismPostImageView.getLayoutParams().width = (int) (Default.screenWidth * 0.9);\n prismPostImageView.setMaxHeight((int) (Default.screenHeight * 0.675));\n\n /*\n * Using the Glide library to populate the prismPostImageView\n * asBitmap: converts to Bitmap\n * thumbnail: previews a 5% loaded image while the rest of the image is being loaded\n * load: loads the prismPost URI\n * listener: confirms if the image was uploaded properly or not\n * into: the loaded image will be placed inside the prismPostImageView\n */\n Glide.with(context)\n .asBitmap()\n .load(prismPost.getImage())\n .apply(new RequestOptions().fitCenter().override((int) (Default.screenWidth * 0.9), (int) (Default.screenHeight * 0.675)))\n .listener(new RequestListener<Bitmap>() {\n @Override\n public boolean onLoadFailed(@Nullable GlideException e, Object model, Target<Bitmap> target, boolean isFirstResource) {\n // TODO: @Mike we should hide progressBar here as well and display a toast or something\n progressBar.setVisibility(View.GONE);\n return false;\n }\n\n @Override\n public boolean onResourceReady(Bitmap resource, Object model, Target<Bitmap> target, DataSource dataSource, boolean isFirstResource) {\n // TODO: @Mike we should hide progressBar here as well and display a toast or something\n new Thread(new Runnable() {\n @Override\n public void run() {\n ((Activity) context).runOnUiThread(new Runnable() {\n @Override\n public void run() {\n prismPostRelativeLayout.setBackground(new BitmapDrawable(\n context.getResources(), BitmapHelper.blur(resource, 0.2f, 100)));\n prismPostImageCardView.animate()\n .alpha(1f)\n .setDuration(250)\n .start();\n prismPostImageView.animate()\n .alpha(1f)\n .setDuration(250)\n .start();\n progressBar.animate()\n .alpha(0f)\n .setDuration(0)\n .withEndAction(new Runnable() {\n @Override\n public void run() {\n progressBar.setVisibility(View.GONE);\n }\n }).start();\n }\n });\n }\n }).start();\n return false;\n }\n }).into(prismPostImageView);\n\n /*\n * GestureDetector used to replace the prismPostImageView TouchListener\n * This allows detection of Single, Long, and Double tap gestures\n */\n final GestureDetector gestureDetector = new GestureDetector(context, new GestureDetector.SimpleOnGestureListener() {\n @Override\n public boolean onSingleTapConfirmed(MotionEvent e) {\n IntentHelper.intentToPrismPostDetailActivity(context, prismPost);\n return false;\n }\n\n @Override\n public void onLongPress(MotionEvent e) {\n super.onLongPress(e);\n }\n\n @Override\n public boolean onDoubleTap(MotionEvent e) {\n handleLikeButtonClick();\n return super.onDoubleTap(e);\n }\n });\n\n /*\n * Sets the TouchListener to be handled by the GestureDetector class\n * This allows detection of Single, Long, and Double tap gestures\n */\n prismPostImageView.setOnTouchListener(new View.OnTouchListener() {\n @Override\n public boolean onTouch(View view, MotionEvent motionEvent) {\n gestureDetector.onTouchEvent(motionEvent);\n return true;\n }\n });\n }", "@Override\n public void onBindViewHolder(RecyclerView.ViewHolder vh, final int position) {\n\n if(vh instanceof ViewHolder_item) {\n\n final ViewHolder_item viewHolder = (ViewHolder_item) vh;\n\n /* Transformation transformation = new Transformation() {\n\n\n @Override\n public Bitmap transform(Bitmap source) {\n int targetWidth =viewHolder.m_Image.getWidth();\n\n double aspectRatio = (double) source.getHeight() / (double) source.getWidth();\n int targetHeight = (int) (targetWidth * aspectRatio);\n Bitmap result = Bitmap.createScaledBitmap(source, targetWidth, targetHeight, false);\n if (result != source) {\n // Same bitmap is returned if sizes are the same\n source.recycle();\n }\n return result;\n }\n\n @Override\n public String key() {\n return \"transformation\" + \" desiredWidth\";\n }\n };\n*/\n\n Picasso.with(viewHolder.m_Image.getContext()).\n\n load(Utils.BASE_IMAGE_URL+\n viewHolder.m_Image.getContext().getResources().getString(R.string.phone_size)+\n mList.get(position).getPoster_path())\n //.transform(transformation)\n .into(viewHolder.m_Image);\n }else {\n ((ProgressViewHolder)vh).progressBar.setIndeterminate(true);\n }\n }", "@Override\n protected void onImageLaidOut() {\n super.onImageLaidOut();\n final Drawable drawable = getDrawable();\n if (drawable == null) {\n return;\n }\n\n float drawableWidth = drawable.getIntrinsicWidth();\n float drawableHeight = drawable.getIntrinsicHeight();\n\n if (mTargetAspectRatio == SOURCE_IMAGE_ASPECT_RATIO) {\n mTargetAspectRatio = drawableWidth / drawableHeight;\n }\n\n int height = (int) (mThisWidth / mTargetAspectRatio);\n if (height > mThisHeight) {\n int width = (int) (mThisHeight * mTargetAspectRatio);\n int halfDiff = (mThisWidth - width) / 2;\n mCropRect.set(halfDiff, 0, width + halfDiff, mThisHeight);\n } else {\n int halfDiff = (mThisHeight - height) / 2;\n mCropRect.set(0, halfDiff, mThisWidth, height + halfDiff);\n }\n\n calculateImageScaleBounds(drawableWidth, drawableHeight);\n setupInitialImagePosition(drawableWidth, drawableHeight);\n\n if (mCropBoundsChangeListener != null) {\n mCropBoundsChangeListener.onCropAspectRatioChanged(mTargetAspectRatio);\n }\n if (mTransformImageListener != null) {\n// mTransformImageListener.onScale(getCurrentScale());\n// mTransformImageListener.onRotate(getCurrentAngle());\n mTransformImageListener.onBrightness(getCurrentBrightness());\n// mTransformImageListener.onContrast(getCurrentContrast());\n }\n }", "@Override\n\tprotected void onSizeChanged(int w, int h, int oldw, int oldh) {\n\t\tsuper.onSizeChanged(w, h, oldw, oldh);\n\n\t\t// save device height width, we use it a lot of places\n\t\tmViewHeight = h;\n\t\tmViewWidth = w;\n\n\t\t// fix up the image\n\t\tsetInitialImageBounds();\n\t}", "void onResized(int width, int height);", "private void updateSizeInfo() {\n RelativeLayout drawRegion = (RelativeLayout)findViewById(R.id.drawWindow);\r\n drawW = drawRegion.getWidth();\r\n drawH = drawRegion.getHeight();\r\n getImageFromStorage();\r\n LinearLayout parentWindow = (LinearLayout)findViewById(R.id.parentWindow);\r\n parentWindow.setPadding((drawW - bgImage.getWidth())/2, (drawH - bgImage.getHeight())/2, (drawW - bgImage.getWidth())/2, (drawH - bgImage.getHeight())/2);\r\n parentWindow.invalidate();\r\n }", "@Override\n public void setupInnerViewElements(ViewGroup parent, View viewImage) {\n if (viewImage != null) {\n if (parent != null && parent.getResources() != null) {\n DisplayMetrics metrics = parent.getResources().getDisplayMetrics();\n\n int base = 64;\n\n if (metrics != null) {\n viewImage.getLayoutParams().width = (int) (base * metrics.density);\n viewImage.getLayoutParams().height = (int) (base * metrics.density);\n } else {\n viewImage.getLayoutParams().width = 196;\n viewImage.getLayoutParams().height = 196;\n }\n }\n }\n\n }", "private void refreshDimensions() {\n //tamano del canvas\n targetWidth = canvasWidth;\n targetHeight = canvasHeight;\n//de las imagenes\n sourceWidth = bitmap.getWidth();\n sourceHeight = bitmap.getHeight();\n\n double targetRatio = (double) targetWidth / (double) targetHeight;\n double sourceRatio = (double) sourceWidth / (double) sourceHeight;\n\n targetOffsetX = 0;\n targetOffsetY = 0;\n\n if(sourceRatio > targetRatio)\n {\n int newTargetHeight = (int) (targetWidth / sourceRatio);\n int delta = targetHeight - newTargetHeight;\n targetOffsetY = delta / 2;\n targetHeight = newTargetHeight;\n }\n else if(sourceRatio < targetRatio)\n {\n int newTargetWidth = (int) (targetHeight * sourceRatio);\n int delta = targetWidth - newTargetWidth;\n targetOffsetX = delta / 2;\n targetWidth = newTargetWidth;\n }\n\n puzzleWidth = slidePuzzle.getWidth();\n puzzleHeight = slidePuzzle.getHeight();\n\n targetColumnWidth = targetWidth / puzzleWidth;\n targetRowHeight = targetHeight / puzzleHeight;\n sourceColumnWidth = sourceWidth / puzzleWidth;\n sourceRowHeight = sourceHeight / puzzleHeight;\n }", "@Override\n public void bindView(View view, Context context, Cursor cursor) {\n int poster_path_index = cursor.getColumnIndex(MovieContract.MovieDetailsEntry.COLUMN_POSTER_PATH);\n String poster_path = cursor.getString(poster_path_index);\n String baseURL = \"http://image.tmdb.org/t/p/w185\" + poster_path;\n ImageView imageView = (ImageView) view.findViewById(R.id.imageView);\n\n\n if (baseURL.contains(\"null\")) {\n Picasso.with(context).load(R.drawable.poster_not_available)\n .resize(185, 200)\n .into(imageView);\n\n } else {\n\n if(isNetworkAvailable()) {\n Picasso.with(context).load(baseURL).into(imageView);\n// Picasso.with(context).load(\"http://i.imgur.com/DvpvklR.png\").into(imageView\n }else{\n Picasso.with(context)\n .load(baseURL)\n .networkPolicy(NetworkPolicy.OFFLINE)\n .placeholder(R.drawable.error_loading)\n .into(imageView);\n\n }\n }\n }", "public void onResized(Integer width,Integer height);", "@Override\r\n public void getSize(final SizeReadyCallback cb) {\n super.getSize(new SizeReadyCallback() {\r\n @Override\r\n public void onSizeReady(int width, int height) {\r\n cb.onSizeReady(displayWidth / 2, displayHeight / 2);\r\n }\r\n });\r\n }", "private void asyncInitSurface() {\n\n ViewTreeObserver vto = _gameLayout.getViewTreeObserver();\n vto.addOnGlobalLayoutListener (new ViewTreeObserver.OnGlobalLayoutListener() {\n\n @Override\n public void onGlobalLayout() {\n _gameLayout.getViewTreeObserver().removeOnGlobalLayoutListener(this);\n\n //Log.d(TAG, \"SET SIZES W = \" + width + \" H = \" + height);\n _app.setWindowSize(_gameLayout.getMeasuredWidth(), _gameLayout.getMeasuredHeight());\n\n initSurface();\n }\n });\n }", "protected abstract void onResize(int width, int height);", "public void ImageTransform(){\n imageView.clearAnimation();\n Picasso.get()\n .load(url)\n .resize(150, 150)\n .centerCrop()\n .into(imageView);\n }", "@Override\n public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {\n Log.d(TAG, \"#onLoadingComplete imageUri = \"+imageUri + \" loadedImage = \"+loadedImage + \" width = \"+loadedImage.getWidth() + \" height = \"+loadedImage.getHeight());\n if (mPhotoView != null)\n mPhotoView.setImageBitmap(loadedImage);\n }", "private void getImgSize(){\n imgSizeX = 1080; //mAttacher.getDisplayRect().right - mAttacher.getDisplayRect().left;\n imgSizeY = 888.783f; //mAttacher.getDisplayRect().bottom - mAttacher.getDisplayRect().top;\n }", "void previewSized();", "@Override\n public void onSuccess(Uri uri) {\n Picasso.get().load(uri).fit().centerCrop().into(someimage);\n }", "public void preparePaint()\n {\n if(! size.equals(getSize())) { // if the size has changed...\n size = getSize();\n fieldImage = fieldView.createImage(size.width, size.height);\n g = fieldImage.getGraphics();\n\n xScale = size.width / gridWidth;\n if(xScale < 1) {\n xScale = GRID_VIEW_SCALING_FACTOR;\n }\n yScale = size.height / gridHeight;\n if(yScale < 1) {\n yScale = GRID_VIEW_SCALING_FACTOR;\n }\n }\n }", "@Override\n public void run() {\n Log.i(TAG, \"run: width\" + mWidth);\n Log.i(TAG, \"run: height----------\" + mHeight);\n }", "@Override\n public void run() {\n final Bitmap imageBm = decodeBitmapFromUri(ChooseActivity.this, myUri);\n inputWidth = imageBm.getWidth();\n inputHeight = imageBm.getHeight();\n new Thread() {\n @Override\n public void run() {\n float perfectSize = 2000f;\n float minScale = Math.min(perfectSize / imageBm.getWidth(), perfectSize / imageBm.getHeight());\n minScale = Math.min(minScale, 1f);\n Bitmap scaledBitmap = Bitmap.createScaledBitmap(imageBm, (int) (minScale * imageBm.getWidth()), (int) (minScale * imageBm.getHeight()), true);\n FaceUtil.InitFaceUtil(ChooseActivity.this);\n Map<String, Object> faces = FaceUtil.DetectFace(scaledBitmap);\n FaceUtil.Release();\n if (scaledBitmap != imageBm) {\n scaledBitmap.recycle();\n }\n\n synchronized (imageBm) {\n imageBm.notify();\n }\n\n faceStates = faces;\n localStateMap.putAll(faceStates);\n\n renderView.updateStates(localStateMap);\n }\n }.start();\n synchronized (imageBm) {\n try {\n imageBm.wait();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n renderView.importImage(imageBm);\n renderView.setAlpha(1);\n\n updateRenderLayout(imageBm.getWidth(), imageBm.getHeight());\n progressDialog.dismiss();\n\n }", "@Override\n\t\t\t\t\t\tpublic void onLoadingComplete(String arg0, View arg1, Bitmap arg2) {\n\t\t \t\t\t\tDrawable drawable = iv_details_poster.getDrawable();\n\t\t \t\t\t\tBitmap bitmap = ImageUtil.drawableToBitmap(drawable);\n\t\t \t\t\t\tBitmap bit = Reflect3DImage.skewImage(bitmap, 60);\n\t\t \t\t\t\tiv_details_poster.setImageBitmap(bit);\n\t\t\t\t\t\t}", "private void setPic() {\n int targetW = imageView.getMaxWidth();\n int targetH = imageView.getMaxHeight();\n\n // Get the dimensions of the bitmap\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;\n\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n\n // Determine how much to scale down the image\n int scaleFactor = Math.min(photoW/targetW, photoH/targetH);\n\n // Decode the image file into a Bitmap sized to fill the View\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inSampleSize = scaleFactor;\n bmOptions.inPurgeable = true;\n\n Bitmap bitmap = BitmapFactory.decodeFile(currentPhotoPath, bmOptions);\n bitmap = Bitmap.createScaledBitmap(bitmap, 1280, 960,false);\n Log.d(\"demo\", \"setPic: \"+ bitmap.getWidth()+\" \"+bitmap.getHeight());\n Log.d(\"demo\", \"setPic: \"+ bitmap.getByteCount()/1000);\n imageView.setImageBitmap(bitmap);\n }", "@Override\n public void onError() {\n Picasso.with(getActivity())\n .load(profileModel.getDriverPhoto())\n .error(R.drawable.profile)\n .resize(0, 200)\n .into(driverImg, new Callback() {\n @Override\n public void onSuccess() {\n\n }\n\n @Override\n public void onError() {\n Log.v(\"Picasso\",\"Could not fetch image\");\n }\n });\n }", "private void loadViewElementPropertiesWithActivityObject() {\n \n JRMediaObject mo = null;\n if (mActivityObject.getMedia().size() > 0) mo = mActivityObject.getMedia().get(0);\n \n final ImageView mci = (ImageView) findViewById(R.id.media_content_image);\n final TextView mcd = (TextView) findViewById(R.id.media_content_description);\n final TextView mct = (TextView) findViewById(R.id.media_content_title);\n \n // Set the media_content_view = a thumbnail of the media\n if (mo != null) if (mo.hasThumbnail()) {\n Log.d(TAG, \"media image url: \" + mo.getThumbnail());\n //there was a bug here, openstream is IO blocking, so moved that call into an asynctask\n new AsyncTask<JRMediaObject, Void, Bitmap>(){\n protected Bitmap doInBackground(JRMediaObject... mo_) {\n try {\n //todo experiment with this code, see if we can get it to cache the image\n URL url = new URL(mo_[0].getThumbnail());\n URLConnection urlc = url.openConnection();\n urlc.setUseCaches(true);\n urlc.setDefaultUseCaches(true);\n InputStream is = urlc.getInputStream();\n return BitmapFactory.decodeStream(is);\n } catch (MalformedURLException e) {\n return null;\n } catch (IOException e) {\n return null;\n }\n }\n \n protected void onPostExecute(Bitmap bitmap) {\n if (bitmap == null) mci.setVisibility(View.INVISIBLE);\n else mci.setVisibility(View.VISIBLE);\n mci.setImageBitmap(bitmap);\n }\n }.execute(mo);\n }\n \n // Set the media content description\n mcd.setText(mActivityObject.getDescription());\n \n // Set the media content title\n mct.setText(mActivityObject.getTitle());\n }", "public void ImageCreate(){\n Picasso.get().load(url).into(imageView);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n final View contentView = inflater.inflate(R.layout.fragment_restaurant_details_full_image, container, false);\n\n Log.d(\"mife\",\"stid = \" + stId);\n Button backBtn = (Button) contentView.findViewById(R.id.back_button);\n backBtn.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n if(listener != null)\n listener.onBack();\n }\n });\n imageView = (ImageView) contentView.findViewById(R.id.full_image);\n progressBar = (ProgressBar) contentView.findViewById(R.id.full_image_progressBar);\n st = Model.instace.getRestaurant(stId);\n Log.d(\"TAG\",\"got restaurant name: \" + st.name);\n\n\n if (st.imageUrl != null && !st.imageUrl.isEmpty() && !st.imageUrl.equals(\"\")){\n progressBar.setVisibility(View.VISIBLE);\n Model.instace.getImage(st.imageUrl, new Model.GetImageListener() {\n @Override\n public void onSuccess(Bitmap image) {\n imageView.setImageBitmap(image);\n progressBar.setVisibility(View.GONE);\n }\n\n @Override\n public void onFail() {\n progressBar.setVisibility(View.GONE);\n }\n });\n }\n\n\n return contentView;\n }", "@Override\n protected Bitmap doInBackground(Droid... params) {\n droid = params[0];\n // Scale the bitmap.\n return getScaledBitmap(\n makeBitmap(getResources(), droid.getAvatarId(), (int) mDroidImageWidth),\n mDroidImageWidth\n );\n }", "@Override\n protected void onSizeChanged(int w, int h, int oldW, int oldH) {\n super.onSizeChanged(w, h, oldW, oldH);\n\n canvasWidth = w;\n canvasHeight = h;\n updatePolygonSize();\n\n if (Math.min(canvasWidth, canvasHeight) != Math.min(oldW, oldH)) {\n refreshImage();\n }\n }", "private void initializeView() {\n mBinding = DataBindingUtil.setContentView(this, R.layout.activity_product_details);\n DisplayMetrics displayMetrics = new DisplayMetrics();\n getWindowManager().getDefaultDisplay().getMetrics(displayMetrics);\n mBinding.vPPdpProductImages.getLayoutParams().height = displayMetrics.widthPixels;\n mBinding.vPPdpProductImages.requestFocus();\n }", "@Override\n protected Bitmap doInBackground(String... id) {\n final String placeId = id[0];\n PlacePhotoMetadataResult result = Places.GeoDataApi\n .getPlacePhotos(this.googleApiClient, placeId).await();\n\n if (result.getStatus().isSuccess()) {\n PlacePhotoMetadataBuffer photoMetadataBuffer = result.getPhotoMetadata();\n int numberOfPhotos = photoMetadataBuffer.getCount();\n\n if (numberOfPhotos > 0 && !isCancelled()) {\n for (int i = 0; i < numberOfPhotos; i++) {\n publishProgress((i + 1) * 100 / numberOfPhotos);\n\n // Load the thumbnail from buffer to determine the aspect ratio\n PlacePhotoMetadata photoMetadata = photoMetadataBuffer.get(i);\n Bitmap thumbnail = photoMetadata.getScaledPhoto(\n this.googleApiClient, 160, 90).await().getBitmap();\n\n // Return the photo if the aspect ratio is unspecified,\n // i.e. aspect ratio is -1\n if (Math.abs(this.aspectRatio - -1d) < 0.0001) {\n Bitmap bitmap = photoMetadata.getScaledPhoto(\n this.googleApiClient, 1920, 1080).await().getBitmap();\n publishProgress(PROGRESS_FINISH);\n photoMetadataBuffer.release();\n return bitmap;\n }\n\n // Calculate the aspect ratio of the photo\n double aspectRatio = (double) thumbnail.getWidth() / (double) thumbnail.getHeight();\n\n // Return the photo if the aspect ratio matches the requirement\n if (Math.abs(this.aspectRatio - aspectRatio) < 0.01) {\n Bitmap bitmap = photoMetadata.getScaledPhoto(\n this.googleApiClient, 1920, 1080).await().getBitmap();\n photoMetadataBuffer.release();\n publishProgress(PROGRESS_FINISH);\n return bitmap;\n }\n }\n }\n photoMetadataBuffer.release();\n }\n publishProgress(PROGRESS_FINISH);\n return null;\n }", "void setInitialImageBoundsFitImage() {\n\t\tif (mImage != null) {\n\t\t\tif (mViewWidth > 0) {\t\t\t\n\t\t\t\tmMinHeight = mViewHeight;\n\t\t\t\tmMinWidth = mViewWidth; \n\t\t\t\tmMaxWidth = (int)(mMinWidth * mMaxSize);\n\t\t\t\tmMaxHeight = (int)(mMinHeight * mMaxSize);\t\t\t\t\n\t\t\t\t\t\n\t\t\t\tmScrollTop = 0;\n\t\t\t\tmScrollLeft = 0;\n\t\t\t\tscaleBitmap(mMinWidth, mMinHeight);\n\t\t }\n\t\t}\n\t}", "public void onCoverSelected() {\n final Optional<Uri> coverImageUriWrapper = entityToBind.getCoverImageUri();\n if (coverImageUriWrapper.isPresent()) {\n final int coverMaxWidth = assetsComputationHelper.getCoverMaxWidth();\n final int coverMaxHeight = assetsComputationHelper.getCoverMaxHeight();\n Glide.with(getContext())\n .load(coverImageUriWrapper.get())\n .override(coverMaxWidth, coverMaxHeight)\n .centerCrop()\n .into(coverImageView);\n }\n }", "private void prepareProductImagesLayout(View view) {\n productImagesRecycler = (RecyclerView) view.findViewById(R.id.product_images_recycler_view);\n LinearLayoutManager linearLayoutManager = new LinearLayoutManager(getActivity(), LinearLayoutManager.HORIZONTAL, false);\n productImagesRecycler.setLayoutManager(linearLayoutManager);\n productImagesAdapter = new ProductImagesRecyclerAdapter(getActivity(), new ProductImagesRecyclerInterface() {\n @Override\n public void onImageSelected(View v, int position) {\n ProductImagesDialogFragment imagesDialog = ProductImagesDialogFragment.newInstance(productImagesUrls, position);\n if (imagesDialog != null)\n imagesDialog.show(getFragmentManager(), ProductImagesDialogFragment.class.getSimpleName());\n else {\n Timber.e(\"%s Called with empty image list\", ProductImagesDialogFragment.class.getSimpleName());\n }\n }\n });\n productImagesRecycler.setAdapter(productImagesAdapter);\n\n ViewGroup.LayoutParams params = productImagesRecycler.getLayoutParams();\n DisplayMetrics dm = getActivity().getResources().getDisplayMetrics();\n int densityDpi = dm.densityDpi;\n\n // For small screen even smaller images.\n if (densityDpi <= DisplayMetrics.DENSITY_MEDIUM) {\n params.height = (int) (dm.heightPixels * 0.4);\n } else {\n params.height = (int) (dm.heightPixels * 0.48);\n }\n\n // Prepare related products\n RecyclerView relatedProductsRecycler = (RecyclerView) view.findViewById(R.id.product_recommended_images_recycler);\n relatedProductsRecycler.setLayoutManager(new LinearLayoutManager(getActivity(), LinearLayoutManager.HORIZONTAL, false));\n relatedProductsRecycler.addItemDecoration(new RecyclerMarginDecorator(getContext(), RecyclerMarginDecorator.ORIENTATION.HORIZONTAL));\n relatedProductsAdapter = new RelatedProductsRecyclerAdapter(getActivity(), new RelatedProductsRecyclerInterface() {\n @Override\n public void onRelatedProductSelected(View v, int position, Product product) {\n if (product != null && getActivity() instanceof MainActivity) {\n ((MainActivity) getActivity()).onProductSelected(product.getProduct_id());\n }\n }\n\n });\n relatedProductsRecycler.setAdapter(relatedProductsAdapter);\n }", "@Override\r\n\tpublic void setupView() {\n\t\tbitmapUtils.configDefaultBitmapConfig(Config.RGB_565);//设置图片压缩类型\r\n\t\tbitmapUtils.configDefaultLoadingImage(R.drawable.test_default_wait_img);// 默认背景图片\r\n\t\tbitmapUtils.configDefaultLoadFailedImage(R.drawable.test_default_wait_img);// 加载失败图片\r\n\t\t\r\n\t\t// 获取数据\r\n\t\tintent = getIntent();\r\n\t\tBlogsInfoEntity entity = (BlogsInfoEntity) intent.getSerializableExtra(\"entity\");\r\n\t\tlist_images = entity.getImg_attachment();\r\n\t\tint position = intent.getIntExtra(\"position\", 0);\r\n\t\tleft_btn = (ImageView) findViewById(R.id.left_btn);\r\n\t\tleft_btn.setOnClickListener(l);\r\n\t\tcenter_content = (TextView) findViewById(R.id.center_content);\r\n\t\tcenter_content.setText(String.valueOf(position + 1) + \"/\"+ String.valueOf(list_images.size()));\r\n\t\tmViewPager = (CustomViewPager) findViewById(R.id.pager);\r\n\t\tmViewPager.setScanScroll(true);\r\n\t\tSamplePagerAdapter adapter = new SamplePagerAdapter();// 声明适配器\r\n\t\tmViewPager.setAdapter(adapter);// 绑定\r\n\t\tmViewPager.setCurrentItem(position);\r\n\t\tmViewPager.setOnPageChangeListener(new OnPageChangeListener() {\r\n\t\t\t// 页面更变\r\n\t\t\t@Override\r\n\t\t\tpublic void onPageSelected(int position) {\r\n\t\t\t\tcenter_content.setText(String.valueOf(position + 1) + \"/\"+ String.valueOf(list_images.size()));\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onPageScrollStateChanged(int state) {\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t\t@Override\r\n\t\t\tpublic void onPageScrolled(int position, float positionOffset,\r\n\t\t\t\t\tint positionOffsetPixels) {\r\n\t\t\t}\r\n\t\t});\r\n\t}", "@Override\n public void configViews() {\n\n ImageView view = findViewById(R.id.iv);\n GlideUrl cookie = new GlideUrl(\"http://images.dmzj.com/tuijian/320_170/170623yinglingtj2.jpg\", new LazyHeaders.Builder()\n .addHeader(\"Referer\", Constant.IMG_BASE_URL)\n .addHeader(\"Accept-Encoding\",\"gzip\").build());\n// Glide.with(this).load(cookie)\n// .placeholder(R.mipmap.ic_launcher)\n// .error(R.drawable.a)\n// .transform(new GlideRoundTransform(this,6))\n// .into(view);\n\n// MultiTransformation multi = new MultiTransformation(\n// new RoundedCornersTransformation(20, 0));\n float density = getResources().getDisplayMetrics().density;\n Log.e(\"density\",\"density\"+density);\n RoundedCornersTransformation roundedCornersTransformation =\n new RoundedCornersTransformation((int) (density*20), 0);\n// Glide.with(this).loadOptions.bitmapTransform(roundedCornersTransformation))\n// .into(view);(cookie)\n// .apply(Request\n//\n DeviceUtils.printDisplayInfo(this);\n\n Glide.with(this).load(cookie)\n .apply((RequestOptions.bitmapTransform(roundedCornersTransformation)))\n .into(image01);\n Glide.with(this).load(cookie)\n .into(image02);\n }", "@Override\r\n\t\tpublic void surfaceCreated(SurfaceHolder holder) {\n\t\t\tif(isUseSelf)\r\n\t\t\t\tthread.start();\r\n\t\t\tViewGroup.LayoutParams lp = getLayoutParams();\r\n\t\t\tlp.width = width;\r\n\t\t\tlp.height = height;\r\n\t\t\tsetLayoutParams(lp);\r\n\t\t}", "public void displayImage(ImageView imageView, Drawable loadingImage, int width,\n int height, ImageGenerator<?> imageGenerator, Runnable callback) {\n if (imageView == null) {\n if (callback != null) \n callback.run();\n return;\n }\n \n if (loadingImage != null) {\n// if (imageView.getBackground() == null) {\n// imageView.setBackgroundDrawable(loadingImage);\n// }\n// imageView.setImageDrawable(null);\n \timageView.setImageDrawable(loadingImage);\n }\n \n if (imageGenerator == null || imageGenerator.getTag() == null) {\n if (callback != null) \n callback.run();\n return;\n }\n\n String tag = imageGenerator.getTag();\n imageView.setTag(tag);\n String key = (width != 0 && height != 0) ? tag + width + height : tag;\n Bitmap bitmap = null;\n synchronized (mMemoryCache) {\n bitmap = mMemoryCache.get(key);\n }\n if (bitmap != null) {\n setImageBitmap(imageView, bitmap, false);\n if (callback != null) \n callback.run();\n return;\n }\n \n synchronized (mTaskStack) {\n for (AsyncImageLoadTask asyncImageTask : mTaskStack) {\n if (asyncImageTask != null \n && asyncImageTask.mImageRef != null\n && tag.equals(asyncImageTask.mImageRef.tag)) {\n if (callback != null) \n callback.run();\n return;\n }\n }\n }\n\n ImageRef imageRef = new ImageRef(imageView, tag, width, height,\n imageGenerator, callback);\n AsyncImageLoadTask asyncImageTask = new AsyncImageLoadTask();\n mTaskStack.push(asyncImageTask); \n asyncImageTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, imageRef);\n \n }", "@Override\n public void onSnapshotReady(Bitmap arg0) {\n mIsMapStatic = true;\n\n // Creating an imageview with the snapshot\n ImageView imageView = new ImageView(getActivity());\n imageView.setLayoutParams(new RelativeLayout.LayoutParams(LayoutParams.WRAP_CONTENT,\n LayoutParams.WRAP_CONTENT));\n imageView.setImageBitmap(arg0);\n\n // Removing all the views (dynamic map) and adding the imageview\n assert getView() != null;\n ((ViewGroup) getView()).removeAllViews();\n ((ViewGroup) getView()).addView(imageView);\n\n mMapDataLoader.onMapCameraChange();\n }", "private void resultImgInit() {\n resultImgAndLoadingLayout.setX(cornerPositions.getLeftTop().x);\n resultImgAndLoadingLayout.setY(cornerPositions.getLeftTop().y);\n int wight = cornerPositions.getRightBottom().x - cornerPositions.getLeftTop().x + cornerImgSize;\n int height = cornerPositions.getRightBottom().y - cornerPositions.getLeftTop().y + cornerImgSize;\n resultImgAndLoadingLayout.setLayoutParams(new LayoutParams(wight, height));\n }", "public void drawImage() {\n ImageView imageView = (ImageView) findViewById(R.id.photo);\n imageView.setVisibility(View.VISIBLE);\n Glide.with(MainActivity.this).load(iURI).fitCenter().into(imageView);\n }", "void rootViewSizeChange()\n {\n int rootW = (int) Math.ceil(_rootView.getWidth());\n int rootH = (int) Math.ceil(_rootView.getHeight());\n _canvas.setWidth(rootW*_scale); _canvas.setHeight(rootH*_scale);\n }", "private void determineCanvasSize() {\n boolean changed = transformManager.determineCanvasSize();\n if ( changed ) {\n changeListenerProxy.canvasSizeChanged( new ApparatusPanel2.ChangeEvent( ApparatusPanel2.this ) );\n paint();\n }\n }", "@Override\n public void UpdateUI(Context context, int position, Advert data) {\n\n Glide\n .with(context)\n .load(data.img_path)\n .centerCrop()\n .placeholder(R.mipmap.jiazai)\n .error(R.mipmap.jiazai)\n// .override(screenWidth,banner_height)\n .dontAnimate()\n .into(imageView);\n }", "private void m91741a(View view) {\n ViewGroup.LayoutParams layoutParams = view.getLayoutParams();\n if (layoutParams != null && layoutParams.width > 0 && layoutParams.height > 0) {\n this.f73957q = layoutParams.width;\n this.f73958r = layoutParams.height;\n } else if (view.getMeasuredWidth() <= 0 || view.getMeasuredHeight() <= 0) {\n view.post(new C28183k(this));\n } else {\n this.f73957q = view.getMeasuredWidth();\n this.f73958r = view.getMeasuredHeight();\n }\n }", "public void bindViews(){\n txtBio = (TextView) findViewById(R.id.txtBio);\n txtSpeakerName = (TextView) findViewById(R.id.txtSpeakerName);\n imgSpeaker = (ImageView) findViewById(R.id.imgSpeaker);\n speaker = getSpeaker();\n\n\n String image_name = speaker.getImage().toUpperCase().replace(\" \", \"_\");\n String url = IMAGE_URL + image_name;\n ImageLoader imgLoader = AppController.getInstance().getImageLoader();\n imgLoader.get(url, new ImageLoader.ImageListener() {\n @Override\n public void onResponse(ImageLoader.ImageContainer response, boolean isImmediate) {\n if (response.getBitmap() != null) {\n imgSpeaker.setAdjustViewBounds(true);\n imgSpeaker.setImageBitmap(response.getBitmap());\n\n }\n }\n\n @Override\n public void onErrorResponse(VolleyError error) {\n\n }\n });\n if(speaker!=null) {\n txtBio.setText(speaker.getBio());\n txtSpeakerName.setText(speaker.getName());\n }\n }", "private void processAndSetImage() {\n\n // Resample the saved image to fit the ImageView\n mResultsBitmap = resamplePic(this, mTempPhotoPath);\n\n// tv.setText(base64conversion(photoFile));\n//\n// Intent intent = new Intent(Intent.ACTION_SEND);\n// intent.setType(\"text/plain\");\n// intent.putExtra(Intent.EXTRA_TEXT, base64conversion(photoFile));\n// startActivity(intent);\n\n /**\n * UPLOAD IMAGE USING RETROFIT\n */\n\n retroFitHelper(base64conversion(photoFile));\n\n // Set the new bitmap to the ImageView\n imageView.setImageBitmap(mResultsBitmap);\n }", "public void updateParametersPictureSize() {\n if (this.mCameraDevice == null) {\n Log.w(TAG, \"attempting to set picture size without camera device\");\n return;\n }\n String pictureSizeKey;\n this.mCameraSettings.setSizesLocked(false);\n SettingsManager settingsManager = this.mActivity.getSettingsManager();\n if (isCameraFrontFacing()) {\n pictureSizeKey = Keys.KEY_PICTURE_SIZE_FRONT;\n } else {\n pictureSizeKey = Keys.KEY_PICTURE_SIZE_BACK;\n }\n String pictureSize = settingsManager.getString(SettingsManager.SCOPE_GLOBAL, pictureSizeKey, SettingsUtil.getDefaultPictureSize(isCameraFrontFacing()));\n Size size = new Size(960, MotionPictureHelper.FRAME_HEIGHT_9);\n if (isDepthEnabled()) {\n size = SettingsUtil.getBokehPhotoSize(this.mActivity, pictureSize);\n } else {\n size = SettingsUtil.sizeFromString(pictureSize);\n }\n this.mCameraSettings.setPhotoSize(size);\n if (ApiHelper.IS_NEXUS_5) {\n if (ResolutionUtil.NEXUS_5_LARGE_16_BY_9.equals(pictureSize)) {\n this.mShouldResizeTo16x9 = true;\n } else {\n this.mShouldResizeTo16x9 = false;\n }\n }\n if (size != null) {\n Size optimalSize;\n Tag tag;\n Size optimalSize2 = CameraUtil.getOptimalPreviewSize(this.mActivity, this.mCameraCapabilities.getSupportedPreviewSizes(), ((double) size.width()) / ((double) size.height()));\n Size original = this.mCameraSettings.getCurrentPreviewSize();\n StringBuilder stringBuilder = new StringBuilder();\n stringBuilder.append(\"Photo module Set preview size \");\n stringBuilder.append(size);\n stringBuilder.append(\" calculate size \");\n stringBuilder.append(optimalSize2);\n stringBuilder.append(\" original size \");\n stringBuilder.append(original);\n android.util.Log.e(\"===++++++=====\", stringBuilder.toString());\n if (isDepthEnabled()) {\n optimalSize = SettingsUtil.getBokehPreviewSize(pictureSize, false);\n } else {\n if ((size.width() == 4160 && size.height() == 1970) || (size.width() == 3264 && size.height() == 1546)) {\n optimalSize2 = new Size(1440, MotionPictureHelper.FRAME_HEIGHT_9);\n }\n optimalSize = optimalSize2;\n this.mActivity.getCameraAppUI().setSurfaceHeight(optimalSize.height());\n this.mActivity.getCameraAppUI().setSurfaceWidth(optimalSize.width());\n }\n this.mUI.setCaptureSize(optimalSize);\n Log.w(TAG, String.format(\"KPI original size is %s, optimal size is %s\", new Object[]{original.toString(), optimalSize.toString()}));\n if (!optimalSize.equals(original)) {\n tag = TAG;\n StringBuilder stringBuilder2 = new StringBuilder();\n stringBuilder2.append(\"setting preview size. optimal: \");\n stringBuilder2.append(optimalSize);\n stringBuilder2.append(\"original: \");\n stringBuilder2.append(original);\n Log.v(tag, stringBuilder2.toString());\n this.mCameraSettings.setPreviewSize(optimalSize);\n this.mCameraDevice.applySettings(this.mCameraSettings);\n this.mCameraSettings = this.mCameraDevice.getSettings();\n if (this.mCameraSettings == null) {\n Log.e(TAG, \"camera setting is null ?\");\n }\n }\n if (!(optimalSize.width() == 0 || optimalSize.height() == 0)) {\n Log.v(TAG, \"updating aspect ratio\");\n this.mUI.updatePreviewAspectRatio(((float) optimalSize.width()) / ((float) optimalSize.height()));\n }\n this.mCameraSettings.setSizesLocked(true);\n tag = TAG;\n StringBuilder stringBuilder3 = new StringBuilder();\n stringBuilder3.append(\"Preview size is \");\n stringBuilder3.append(optimalSize);\n Log.d(tag, stringBuilder3.toString());\n }\n }", "@Override\r\n public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {\n \tLog.v(\"catch\",view+\"\");\r\n \ttry{\r\n if (loadedImage != null && view!=null) { \r\n ImageView imageView = (ImageView) view; \r\n // imageView.setImageBitmap(loadedImage);\r\n // 是否第一次显示 \r\n boolean firstDisplay = !displayedImages.contains(imageUri); \r\n if (firstDisplay) { \r\n // 图片淡入效果 \r\n FadeInBitmapDisplayer.animate(imageView, 800); \r\n displayedImages.add(imageUri); \r\n \r\n/* \t ViewGroup.LayoutParams params = imageView.getLayoutParams(); \r\n \t params.height =loadedImage.getHeight(); \r\n \t ((MarginLayoutParams)params).setMargins(10, 10, 10, 10);\r\n \t imageView.setLayoutParams(params);*/ \r\n } \r\n } \r\n \t}catch(Exception e){\r\n \t\tLog.v(\"catch1\",e.getMessage());\r\n \t}\r\n }", "public void onFinishInflate() {\n super.onFinishInflate();\n this.titleIconContainer = findViewById(C1167R.C1170id.watch_next_info_icon_title_container);\n this.message = findViewById(C1167R.C1170id.watch_next_info_message);\n Resources res = getContext().getResources();\n this.selectedMessageWidth = res.getDimensionPixelSize(C1167R.dimen.watch_next_info_card_selected_message_width);\n this.selectedCardHeight = res.getDimensionPixelSize(C1167R.dimen.program_default_height);\n }", "private void setUpImageLoader() {\n\t\tfinal DisplayMetrics displayMetrics = new DisplayMetrics();\n\t\tgetWindowManager().getDefaultDisplay().getMetrics(displayMetrics);\n\t\tfinal int height = displayMetrics.heightPixels;\n\t\tfinal int width = displayMetrics.widthPixels;\n\n\t\t// For this sample we'll use half of the longest width to resize our images. As the\n\t\t// image scaling ensures the image is larger than this, we should be left with a\n\t\t// resolution that is appropriate for both portrait and landscape. For best image quality\n\t\t// we shouldn't divide by 2, but this will use more memory and require a larger memory\n\t\t// cache.\n\t\tfinal int longest = (height > width ? height : width) / 4;\n\n\t\tImageCache.ImageCacheParams cacheParams =\n\t\t\t\tnew ImageCache.ImageCacheParams(this, IMAGE_CACHE_DIR);\n\t\tcacheParams.setMemCacheSizePercent(0.25f); // Set memory cache to 25% of app memory\n\n\t\timageResizer = new ImageResizer(this, longest);\n\t\timageResizer.addImageCache(getSupportFragmentManager(), cacheParams);\n\t\timageResizer.setImageFadeIn(true);\n\t}", "private void populateView(){\n\n //Display image without blocking, and cache it\n ImageView imageView = (ImageView) findViewById(R.id.activity_location_image);\n Picasso.with(this)\n .load(location.getImageURL()).fit().centerCrop().into(imageView);\n\n //Display description\n TextView description = (TextView) findViewById(R.id.activity_location_description);\n description.setText(location.getDescription());\n\n //Display hours\n TextView hours = (TextView) findViewById(R.id.activity_location_hours);\n hours.setText(location.getStringOpenHours());\n\n //Display google maps, map IF address can be found\n SupportMapFragment mapFragment = (SupportMapFragment) getSupportFragmentManager()\n .findFragmentById(R.id.activity_location_map);\n if (canFindLocationAddress()){\n\n //Set width and height of map\n mapFragment.getView().getLayoutParams().height = getMapHeight();\n mapFragment.getView().offsetLeftAndRight(50);\n mapFragment.getMapAsync(this);\n }\n\n //Hide the map otherwise\n else{\n mapFragment.getView().setVisibility(View.INVISIBLE);\n }\n }", "public void preparePaint()\n {\n if(! size.equals(getSize())) { // if the size has changed...\n size = getSize();\n fieldImage = this.createImage(size.width, size.height);\n g = fieldImage.getGraphics();\n\n xScale = size.width / gridWidth;\n if(xScale < 1) {\n xScale = GRID_VIEW_SCALING_FACTOR;\n }\n yScale = size.height / gridHeight;\n if(yScale < 1) {\n yScale = GRID_VIEW_SCALING_FACTOR;\n }\n }\n }", "@Override\n protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n int minw = mLightRadius*2 + getPaddingLeft() + getPaddingRight();\n int w = resolveSizeAndState(minw, widthMeasureSpec, 0);\n\n // Ask for a height that would let the view get as big as it can\n int minh = mLightRadius*2 + getPaddingBottom() + getPaddingTop();\n\n int h = resolveSizeAndState(minh, heightMeasureSpec, 0);\n\n // Calling this method determines the measured width and height\n // Retrieve with getMeasuredWidth or getMeasuredHeight methods later\n setMeasuredDimension(w, h);\n\n }", "@Override\n protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n textView.measure(widthMeasureSpec, heightMeasureSpec);\n\n // Now limit the max size for the icon and then compute its measure\n int height = textView.getMeasuredHeight();\n // We allow 120% of the text size\n height = (12 * height) / 10;\n imageView.setMaxWidth(height);\n imageView.setMaxHeight(height);\n imageView.measure(widthMeasureSpec, heightMeasureSpec);\n\n // Now compute this item measure\n super.onMeasure(widthMeasureSpec, heightMeasureSpec);\n }", "public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage);", "private void refreshImage() {\n Bitmap image = drawableToBitmap(getDrawable());\n int canvasSize = Math.min(canvasWidth, canvasHeight);\n if (canvasSize > 0 && image != null) {\n //Preserve image ratio if it is not square\n BitmapShader shader = new BitmapShader(ThumbnailUtils.extractThumbnail(image, canvasSize, canvasSize),\n Shader.TileMode.CLAMP, Shader.TileMode.CLAMP);\n mPaint.setShader(shader);\n }\n }", "@Override\n protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n mWidth = getMeasuredDimension(widthMeasureSpec);\n mHeight = getMeasuredDimension(heightMeasureSpec);\n mCanvasSize = Math.min(mWidth, mHeight);\n\n /*Without this your layout will not be inflated\n Here the the width and height parameters are the same that you\n have given in your XML layout\n */\n setMeasuredDimension(mWidth, mHeight);\n }", "@Override\n protected void onPreExecute() {\n imgPlaceDetail.setImageBitmap(getBitmapFromAssets(\"no_image_backdrop.png\"));\n //imgPlaceDetail.setImageResource(R.drawable.no_image_backdrop);\n //imgPlaceDetail.invalidate();\n\n }", "@FXML\n /**\n * use initialize method to get the metadata of the image file and set the metadata properties on the UI display\n */\n public void initialize() {\n messaging.onMessage(MessageObject.SubjectEnum.ImageIdToShow, (file) -> {\n\n if (this.imageViewContainer == null) {\n return;\n }\n\n //get image and restrict the maximum width to 400\n Image image = ImageUtil.getImageFromFile((File) file);\n //get imageView and set its width and height\n ImageView imageView = ImageUtil.getImageViewByImage(image, \"\", 400, 400);\n //clear the HBox imageViewContainer\n this.imageViewContainer.getChildren().clear();\n //add imageView to the HBox imageViewContainer\n this.imageViewContainer.getChildren().add(\n imageView\n );\n //set an hgrow constraint on the imageView\n this.imageViewContainer.setHgrow(imageView, Priority.NEVER);\n //get metadata from the image file\n Metadata metadata = null;\n try {\n metadata = ImageMetadataReader.readMetadata((File) file);\n } catch (ImageProcessingException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n //get the width and height of the image\n int width = (int)image.getWidth();\n int height = (int)image.getHeight();\n //set text of Label width and height on the UI display\n this.width.setText(\"\" + width);\n this.height.setText(\"\" + height);\n //get ExifIFD0Directory from metadata\n ExifIFD0Directory exifIFD0Directory = metadata.getFirstDirectoryOfType(ExifIFD0Directory.class);\n //initialize make and model of camera\n String NA = MsIsConstant.NAPlaceholder;\n String make = NA;\n String model = NA;\n if (exifIFD0Directory != null) {\n //get the value of make and model properties\n make = exifIFD0Directory.getString(ExifIFD0Directory.TAG_MAKE);\n model = exifIFD0Directory.getString(ExifIFD0Directory.TAG_MODEL);\n if (make == null || model == null) {\n make = NA;\n model = NA;\n }\n }\n //set text of Label make and model of camera on the UI display\n this.cameraMakeAndModel.setText(String.format(\"%s, %s\", make, model));\n\n GpsDirectory gpsDirectory = metadata.getFirstDirectoryOfType(GpsDirectory.class);\n showGeo(gpsDirectory);\n\n });\n }", "@Before\n public void setDimension() {\n this.view.setDimension(new Dimension(WITDH, HEIGHT));\n }", "@Override // com.android.server.wm.WindowContainer\n public void prepareSurfaces() {\n this.mDimmer.resetDimStates();\n super.prepareSurfaces();\n getBounds(this.mTmpDimBoundsRect);\n if (this.mDimmer.updateDims(getPendingTransaction(), this.mTmpDimBoundsRect)) {\n scheduleAnimation();\n }\n }", "@Override\n public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {\n }", "@Override\n protected void onPreExecute() {\n super.onPreExecute();\n gD.callload(context, nScreenHeight);\n\n\n\n }", "public synchronized void setPictureFromCache(final int width, final int height) {\n Runnable run = new Runnable() {\n @Override\n public void run() {\n File file = new File(context.getExternalFilesDir(null), pictureName);\n if (file != null) {\n Bitmap myBitmap = BitmapFactory.decodeFile(file.getAbsolutePath());\n if (imageView != null) {\n //imageView.setImageDrawable(new BitmapDrawable(null, myBitmap));\n new ResizeImage(imageView, file.getAbsolutePath()).setImageView(width, height);\n }\n }\n }\n };\n new Handler(context.getMainLooper()).post(run);\n }", "@Override\n\tpublic void onResize(int width, int height) {\n\t}", "private static Bitmap getImageResized(Context context, Uri imageUri) {\r\n if (context == null || imageUri == null) {\r\n return null;\r\n }\r\n\r\n Bitmap bitmap;\r\n int[] sampleSizes = new int[]{5, 3, 2, 1};\r\n int i = 0;\r\n do {\r\n bitmap = decodeBitmap(context, imageUri, sampleSizes[i]);\r\n Log.d(\"Resizer\", \"new bitmap width = \" + bitmap.getWidth());\r\n i++;\r\n } while (bitmap.getWidth() < DEFAULT_MIN_WIDTH_QUALITY && i < sampleSizes.length);\r\n\r\n return bitmap;\r\n }", "private CommonPopWindow measureWidthAndHeight(View mContentView) {\n/* 125 */ int widthMeasureSpec = View.MeasureSpec.makeMeasureSpec(1073741823, -2147483648);\n/* 126 */ int heightMeasureSpec = View.MeasureSpec.makeMeasureSpec(1073741823, -2147483648);\n/* 127 */ mContentView.measure(widthMeasureSpec, heightMeasureSpec);\n/* 128 */ return this;\n/* */ }", "private void loadProductImage(String imagePath, ImageView imageView) {\n Bitmap bitmap = BitmapUtil.fromFileScaled(imagePath, imageView.getWidth(), imageView.getHeight(),\n true);\n if (bitmap == null) {\n Log.d(getClass().getSimpleName(), \"Failed to load product image: image view dimensions not yet \" +\n \"\" + \"determined\");\n } else {\n Activity activity = getActivity();\n if (activity != null) {\n imageView.setImageDrawable(BitmapUtil.getRoundedBitmapDrawable(activity, bitmap));\n }\n }\n }", "@Override\n public void run() {\n if (imageViewReused(loadDataHolder))\n return;\n // Download image from web url\n Bitmap bitmap = getBitmap(loadDataHolder.getUrl());\n\n // Save to cache\n if (bitmap != null) {\n memoryCache.put(loadDataHolder.getUrl(), bitmap);\n }\n\n if (imageViewReused(loadDataHolder))\n return;\n\n // Get bitmap to display\n BitmapDisplayRunnable displayRunnable =\n new BitmapDisplayRunnable(bitmap, loadDataHolder);\n\n // Post message to handler associated with UI thread\n handler.post(displayRunnable);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_mentor_info, container, false);\n ImageView mentorpic = (ImageView) view.findViewById(R.id.mentor_pic);\n Glide\n .with(getActivity())\n .load(R.drawable.mentor)\n .apply(new RequestOptions()\n .override(mentorpic.getWidth(),((mentorpic.getHeight())/2)))\n .into(mentorpic);\n\n return view;\n }", "@Override\n public void onResourceReady(@NonNull Bitmap resource, @Nullable Transition<? super Bitmap> transition) {\n Bitmap scaledBitmap = Bitmap.createScaledBitmap(resource,\n AlchenomiconConstants.ICON_UPSCALED_SIZE,\n AlchenomiconConstants.ICON_UPSCALED_SIZE, false);\n view.setImageBitmap(scaledBitmap);\n }", "public synchronized void setPictureFromCache() {\n Runnable run = new Runnable() {\n @Override\n public void run() {\n File file = new File(context.getExternalFilesDir(null), pictureName);\n if (file != null) {\n Bitmap myBitmap = BitmapFactory.decodeFile(file.getAbsolutePath());\n if (imageView != null) {\n //imageView.setImageDrawable(new BitmapDrawable(null, myBitmap));\n new ResizeImage(imageView, file.getAbsolutePath()).setImageView();\n }\n }\n }\n };\n new Handler(context.getMainLooper()).post(run);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_good_image, container, false);\n ButterKnife.bind(this, view);\n Glide.with(getActivity())\n .load(imagePath)\n .error(Glide.with(getActivity()).load(R.drawable.goods_default))\n .into(goodImg);\n return view;\n }", "@Override\r\n\tprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n\t\tint minw = getPaddingLeft() + getPaddingRight() + getSuggestedMinimumWidth();\r\n\t\tint measuredWidth = resolveSize(minw, widthMeasureSpec);\r\n\r\n\t\tint minh = getPaddingTop() + getPaddingBottom() + getSuggestedMinimumHeight();\r\n\t\tint measuredHeight = resolveSize(minh, heightMeasureSpec);\r\n\t\tsetMeasuredDimension(measuredWidth, measuredHeight);\r\n\t\t// super.onMeasure(widthMeasureSpec, heightMeasureSpec);\r\n\r\n\t}", "private SimpleTarget<Bitmap> getGlideTarget() {\n SimpleTarget<Bitmap> target = new SimpleTarget<Bitmap>() {\n @Override\n public void onResourceReady(@NonNull Bitmap bitmap, @Nullable Transition<? super Bitmap> transition) {\n ivUserProfile.setImageBitmap(bitmap);\n Log.d(\"Result\", \"height\" + bitmap.getHeight());\n Log.d(\"Result\", \"width\" + bitmap.getWidth());\n scanData.setUserPicture(getBytes(bitmap));\n }\n\n @Override\n public void onLoadFailed(@Nullable Drawable errorDrawable) {\n super.onLoadFailed(errorDrawable);\n }\n };\n\n return target;\n }", "public ResizeBundle doInBackground(ResizeBundle... resizeBundles) {\n return PhotoModule.this.cropJpegDataToAspectRatio(resizeBundles[0]);\n }", "@Override\n\tprotected void onLayout(boolean changed, int l, int t, int r, int b)\n\t{\n\n\t\tDisplayMetrics displayMetrics = getResources().getDisplayMetrics();\n\t\tint screenWidth = displayMetrics.widthPixels;\n\t\t//int screenHeight = displayMetrics.heightPixels;\n\t\tint childTop = 30;\n\t\tint childLeft = 20;\n\t\tint cameraPicWidth = screenWidth / 5;\n\t\tint cameraPicHeight = 2 * cameraPicWidth;\n\t\tint space = 20;\n\t\tint column = 0;\n\n\t\tfinal int count = getChildCount();\n\t\tfor (int i = 0; i < count; i++)\n\t\t{\n\t\t\tfinal View child = getChildAt(i);\n\t\t\tif (child.getVisibility() != View.GONE)\n\t\t\t{\n\t\t\t\tchild.setVisibility(View.VISIBLE);\n\t\t\t\t//child.measure(r - l, b - t);\n\t\t\t\tchild.layout(childLeft + space, childTop, childLeft + cameraPicWidth + space, childTop + cameraPicHeight + space);\n\t\t\t\tcolumn++;\n\t\t\t\tif (childLeft < screenWidth - 2 * (space + cameraPicWidth))\n\t\t\t\t{\n\t\t\t\t\tchildLeft += cameraPicWidth + space;\n\t\t\t\t} else\n\t\t\t\t{\n\t\t\t\t\tcolumn = 0;\n\t\t\t\t\tchildLeft = 20;\n\t\t\t\t\tchildTop += cameraPicHeight;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "void setInitialImageBoundsFillScreen() {\n\t\tif (mImage != null) {\n\t\t\tif (mViewWidth > 0) {\n\t\t\t\tboolean resize=false;\n\t\t\t\t\n\t\t\t\tint newWidth=mImageWidth;\n\t\t\t\tint newHeight=mImageHeight;\n\t\t\t\n\t\t\t\t// The setting of these max sizes is very arbitrary\n\t\t\t\t// Need to find a better way to determine max size\n\t\t\t\t// to avoid attempts too big a bitmap and throw OOM\n\t\t\t\tif (mMinWidth==-1) { \n\t\t\t\t\t// set minimums so that the largest\n\t\t\t\t\t// direction we always filled (no empty view space)\n\t\t\t\t\t// this maintains initial aspect ratio\n\t\t\t\t\tif (mViewWidth > mViewHeight) {\n\t\t\t\t\t\tmMinWidth = mViewWidth;\n\t\t\t\t\t\tmMinHeight = (int)(mMinWidth/mAspect);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmMinHeight = mViewHeight;\n\t\t\t\t\t\tmMinWidth = (int)(mAspect*mViewHeight);\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\tmMaxWidth = (int)(mMinWidth * 1.5f);\n\t\t\t\t\tmMaxHeight = (int)(mMinHeight * 1.5f);\n\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\tif (newWidth < mMinWidth) {\n\t\t\t\t\tnewWidth = mMinWidth;\n\t\t\t\t\tnewHeight = (int) (((float) mMinWidth / mImageWidth) * mImageHeight);\n\t\t\t\t\tresize = true;\n\t\t\t\t}\n\t\t\t\tif (newHeight < mMinHeight) {\n\t\t\t\t\tnewHeight = mMinHeight;\n\t\t\t\t\tnewWidth = (int) (((float) mMinHeight / mImageHeight) * mImageWidth);\n\t\t\t\t\tresize = true;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tmScrollTop = 0;\n\t\t\t\tmScrollLeft = 0;\n\t\t\t\t\n\t\t\t\t// scale the bitmap\n\t\t\t\tif (resize) {\n\t\t\t\t\tscaleBitmap(newWidth, newHeight);\n\t\t\t\t} else {\n\t\t\t\t\tmExpandWidth=newWidth;\n\t\t\t\t\tmExpandHeight=newHeight;\t\t\t\t\t\n\t\t\t\t\tmResizeFactorX = ((float) newWidth / mImageWidth);\n\t\t\t\t\tmResizeFactorY = ((float) newHeight / mImageHeight);\n\t\t\t\t\tmRightBound = 0 - (mExpandWidth - mViewWidth);\n\t\t\t\t\tmBottomBound = 0 - (mExpandHeight - mViewHeight);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void setPic() {\n int targetW = imageView.getWidth();\n int targetH = imageView.getHeight();\n\n // Get the dimensions of the bitmap\n BitmapFactory.Options bmOptions = new BitmapFactory.Options();\n bmOptions.inJustDecodeBounds = true;\n BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n int photoW = bmOptions.outWidth;\n int photoH = bmOptions.outHeight;\n\n // Determine how much to scale down the image\n int scaleFactor = Math.min(photoW/targetW, photoH/targetH);\n\n // Decode the image file into a Bitmap sized to fill the View\n bmOptions.inJustDecodeBounds = false;\n bmOptions.inSampleSize = scaleFactor;\n bmOptions.inPurgeable = true;\n\n Bitmap bitmap = BitmapFactory.decodeFile(mCurrentPhotoPath, bmOptions);\n imageView.setImageBitmap(bitmap);\n imageView.invalidate();\n }", "@Override\n\t\tprotected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n\t\t\tLog.e(\"FYF\", getId() + \" ImageView onMeasure\");\n\t\t\tsuper.onMeasure(widthMeasureSpec, heightMeasureSpec);\n\t\t}", "private void getWidthAndHeight() {\n DisplayMetrics displaymetrics = new DisplayMetrics();\n getActivity().getWindowManager().getDefaultDisplay().getMetrics(displaymetrics);\n screenHeight = displaymetrics.heightPixels;\n screenWidth = displaymetrics.widthPixels;\n }", "@Override\n public boolean onPreDraw() {\n if (!hasMeasured) {\n\n screenHeight = content.getMeasuredHeight();//获取ViewTree的高度\n hasMeasured = true;//设置为true,使其不再被测量。\n\n }\n return true;//如果返回false,界面将为空。\n\n }", "public void displayImage(final ImageView imageView, final String url, int reqWidth, int reqHeight) {\n if (mImageViews.get(imageView) != null && mImageViews.get(imageView).equals(url))\r\n return;\r\n\r\n mImageViews.put(imageView, url);\r\n\r\n Bitmap bitmap = mMemoryCache.get(url);\r\n\r\n if (bitmap != null) {\r\n imageView.setImageBitmap(bitmap);\r\n } else {\r\n // if the image have already put to the queue\r\n if (mSubscribers.get(url) != null) {\r\n mSubscribers.get(url).addImageView(imageView);\r\n } else {\r\n imageView.setImageResource(DEFAULT_IMAGE_ID);\r\n BitmapUseCase bitmapUseCase = mBitmapUseCaseFactory.create(url, reqWidth, reqHeight);\r\n\r\n BitmapSubscriber subscriber = new BitmapSubscriber(imageView, url, bitmapUseCase);\r\n\r\n bitmapUseCase.execute(subscriber);\r\n mSubscribers.put(url, subscriber);\r\n mUseCases.add(bitmapUseCase);\r\n }\r\n\r\n }\r\n\r\n\r\n }", "@Override\n public void surfaceCreated(SurfaceHolder arg0) {\n screen_width = this.getWidth();\n screen_height = this.getHeight();\n initBitmap(); // 初始化图片资源\n threadFlag = true;\n thread.start();\n }", "public void onBoundsResolved()\n {\n updateTransform();\n }", "private void updateSizeSafely(final View parentView) {\n if(parentView == null)\n {\n return;\n }\n\n parentView.post(new Runnable() {\n @Override\n public void run() {\n updateSize(parentView);\n }\n });\n }", "private void setDimension() {\n float videoProportion = getVideoProportion();\n int screenWidth = getResources().getDisplayMetrics().widthPixels;\n int screenHeight = getResources().getDisplayMetrics().heightPixels;\n float screenProportion = (float) screenHeight / (float) screenWidth;\n ViewGroup.LayoutParams lp = mVideoPlayer.getLayoutParams();\n\n if (videoProportion < screenProportion) {\n lp.height = screenHeight;\n lp.width = (int) ((float) screenHeight / videoProportion);\n } else {\n lp.width = screenWidth;\n lp.height = (int) ((float) screenWidth * videoProportion);\n }\n mVideoPlayer.setLayoutParams(lp);\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n mView = inflater.inflate(R.layout.camera_page, container, false);\n\n if(null != savedInstanceState) {\n mSnapshot = savedInstanceState.getParcelable(CameraPage.ARG_IMAGE);\n }\n Button doCameraSnapshotBtn = (Button) mView.findViewById(R.id.get_camera_snapshot_btn);\n doCameraSnapshotBtn.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n MQTT_Client mqttClient = (MQTT_Client) MainActivity.Args.get(Arg.MQTT_CLIENT);\n mqttClient.askSnapshot(new MQTT_Client.OnResultListener() {\n @Override\n public void onSuccess(@Nullable Object result) {\n byte[] imageData = (byte[]) result;\n mSnapshot = BitmapFactory.decodeByteArray(imageData, 0, imageData.length);\n mUpdateGUICallback.onUpdate();\n }\n @Override\n public void onFailure(@Nullable Object result) {\n Toast message = Toast.makeText(getActivity(), (String) result, Toast.LENGTH_LONG);\n message.show();\n }\n });\n }\n });\n return mView;\n }", "public void requestLargeLayout() {\n Dialog dialog = getDialog();\n if (dialog == null) {\n Log.w(getClass().getSimpleName(), \"requestLargeLayout dialog has not init yet!\");\n return;\n }\n Window window = dialog.getWindow();\n if (window == null) {\n Log.w(getClass().getSimpleName(), \"requestLargeLayout window has not init yet!\");\n return;\n }\n FragmentActivity activity = getActivity();\n if (activity != null) {\n float displayWidthInDip = UIUtil.getDisplayWidthInDip(activity);\n float displayHeightInDip = UIUtil.getDisplayHeightInDip(activity);\n int dimensionPixelSize = getResources().getDimensionPixelSize(C4558R.dimen.annotate_dialog_min_width);\n if (displayWidthInDip < displayHeightInDip) {\n displayHeightInDip = displayWidthInDip;\n }\n if (displayHeightInDip < ((float) dimensionPixelSize)) {\n window.setLayout(dimensionPixelSize, -1);\n }\n }\n }", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n Intent intent = getIntent();\n if (intent == null || intent.getExtras() == null) {\n// HcAppState.getInstance().removeActivity(this);\n finish();\n return;\n }\n mIconUri = intent.getStringExtra(\"uri\");\n if (TextUtils.isEmpty(mIconUri)) {\n// HcAppState.getInstance().removeActivity(this);\n finish();\n return;\n }\n mWidth = (int) (360 * Util.getScreenDensity());\n mHeight = (int) (640 * Util.getScreenDensity());\n\n mWidth = intent.getIntExtra(\"width\", mWidth);\n mHeight = intent.getIntExtra(\"height\", mHeight);\n\n setContentView(R.layout.activity_big_image);\n mPhotoView = (PhotoView) findViewById(R.id.image_photo);\n mOptions = new DisplayImageOptions.Builder()\n .imageScaleType(ImageScaleType.EXACTLY)\n .cacheInMemory(false).cacheOnDisk(false)\n .considerExifParams(true)\n .bitmapConfig(Bitmap.Config.ARGB_8888).build();\n ImageLoader.getInstance().loadImage(mIconUri, new ImageSize(mWidth, mHeight), mOptions, new ImageLoadingListener() {\n\n @Override\n public void onLoadingStarted(String imageUri, View view) {\n // TODO Auto-generated method stub\n Log.d(TAG, \"#onLoadingStarted imageUri = \"+imageUri);\n\n }\n\n @Override\n public void onLoadingFailed(String imageUri, View view,\n FailReason failReason) {\n // TODO Auto-generated method stub\n Log.d(TAG, \"#onLoadingFailed imageUri = \" + imageUri + \" failReason = \" + failReason);\n// HcAppState.getInstance().removeActivity(BigImageActivity.this);\n finish();\n overridePendingTransition(0, 0);\n }\n\n @Override\n public void onLoadingComplete(String imageUri, View view, Bitmap loadedImage) {\n // TODO Auto-generated method stub\n Log.d(TAG, \"#onLoadingComplete imageUri = \"+imageUri + \" loadedImage = \"+loadedImage + \" width = \"+loadedImage.getWidth() + \" height = \"+loadedImage.getHeight());\n if (mPhotoView != null)\n mPhotoView.setImageBitmap(loadedImage);\n }\n\n @Override\n public void onLoadingCancelled(String imageUri, View view) {\n // TODO Auto-generated method stub\n Log.d(TAG, \"#onLoadingCancelled imageUri = \"+imageUri);\n// HcAppState.getInstance().removeActivity(BigImageActivity.this);\n finish();\n overridePendingTransition(0, 0);\n }\n });\n\n mPhotoView.setOnPhotoTapListener(new PhotoViewAttacher.OnPhotoTapListener() {\n\n @Override\n public void onPhotoTap(View view, float x, float y) {\n // TODO Auto-generated method stub\n// HcAppState.getInstance().removeActivity(BigImageActivity.this);\n finish();\n overridePendingTransition(0, 0);\n }\n });\n }", "@Override\n protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {\n int measuredWidth = measure(widthMeasureSpec);\n int measuredHeight = measure(heightMeasureSpec);\n\n int d = Math.min(measuredWidth, measuredHeight);\n setMeasuredDimension(d, d);\n }", "private void calcContentSize() {\n }", "protected void onPostExecute(Bitmap result) {\n // Hide the progress dialog\n //mProgressDialog.dismiss();\n\n if (result != null) {\n Display display = getWindowManager().getDefaultDisplay();\n Point size = new Point();\n display.getSize(size);\n int newWidth = size.x;\n\n//Get actual width and height of image\n int width = result.getWidth();\n int height = result.getHeight();\n\n\n float cal = (float) newWidth / width;\n after_cal = Math.round(cal * height);\n\n// Calculate the ratio between height and width of Original Image\n float ratio = (float) height / (float) width;\n float scale = getApplicationContext().getResources().getDisplayMetrics().density;\n int newHeight = Math.round((width * ratio) / scale);\n TableRow.LayoutParams layoutParams = new TableRow.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, after_cal);\n if (isFrom.equalsIgnoreCase(\"que\")) {\n img_ques.setLayoutParams(layoutParams);\n\n Glide.with(getApplicationContext()).load(question).asBitmap().into(new BitmapImageViewTarget(img_ques) {\n @Override\n protected void setResource(Bitmap resource) {\n super.setResource(resource);\n }\n });\n\n /* Glide.with(PracticeTestQAActivity.this)\n .load(question).asBitmap().dontAnimate()\n .diskCacheStrategy(DiskCacheStrategy.ALL)\n .placeholder(R.drawable.placeholder)\n .error(R.drawable.placeholder)\n .into(img_ques);*/\n } else if (isFrom.equalsIgnoreCase(\"opt_1\")) {\n img_opt1.setLayoutParams(layoutParams);\n Glide.with(getApplicationContext()).load(opt_1).asBitmap().into(new BitmapImageViewTarget(img_opt1) {\n @Override\n protected void setResource(Bitmap resource) {\n super.setResource(resource);\n }\n });\n\n /* Glide.with(PracticeTestQAActivity.this)\n .load(opt_1).asBitmap().dontAnimate()\n .diskCacheStrategy(DiskCacheStrategy.ALL)\n .placeholder(R.drawable.placeholder)\n .error(R.drawable.placeholder)\n .into(img_opt1);*/\n } else if (isFrom.equalsIgnoreCase(\"opt_2\")) {\n img_opt2.setLayoutParams(layoutParams);\n Glide.with(getApplicationContext()).load(opt_2).asBitmap().into(new BitmapImageViewTarget(img_opt2) {\n @Override\n protected void setResource(Bitmap resource) {\n super.setResource(resource);\n }\n });\n\n /*Glide.with(PracticeTestQAActivity.this)\n .load(opt_2).asBitmap().dontAnimate()\n .diskCacheStrategy(DiskCacheStrategy.ALL)\n .placeholder(R.drawable.placeholder)\n .error(R.drawable.placeholder)\n .into(img_opt2);*/\n } else if (isFrom.equalsIgnoreCase(\"opt_3\")) {\n img_opt3.setLayoutParams(layoutParams);\n Glide.with(getApplicationContext()).load(opt_3).asBitmap().into(new BitmapImageViewTarget(img_opt3) {\n @Override\n protected void setResource(Bitmap resource) {\n super.setResource(resource);\n }\n });\n /* Glide.with(PracticeTestQAActivity.this)\n .load(opt_3).asBitmap().dontAnimate()\n .diskCacheStrategy(DiskCacheStrategy.ALL)\n .placeholder(R.drawable.placeholder)\n .error(R.drawable.placeholder)\n .into(img_opt3);*/\n } else if (isFrom.equalsIgnoreCase(\"opt_4\")) {\n img_opt4.setLayoutParams(layoutParams);\n Glide.with(getApplicationContext()).load(opt_4).asBitmap().into(new BitmapImageViewTarget(img_opt4) {\n @Override\n protected void setResource(Bitmap resource) {\n super.setResource(resource);\n }\n });\n /* Glide.with(PracticeTestQAActivity.this)\n .load(opt_4).asBitmap().dontAnimate()\n .diskCacheStrategy(DiskCacheStrategy.ALL)\n .placeholder(R.drawable.placeholder)\n .error(R.drawable.placeholder)\n .into(img_opt4);*/\n } else if (isFrom.equalsIgnoreCase(\"correctAns\")) {\n img_CorrectAns.setLayoutParams(layoutParams);\n Glide.with(getApplicationContext()).load(correctImg).asBitmap().into(new BitmapImageViewTarget(img_CorrectAns) {\n @Override\n protected void setResource(Bitmap resource) {\n super.setResource(resource);\n }\n });\n /*Glide.with(PracticeTestQAActivity.this)\n .load(correctImg).asBitmap().dontAnimate()\n .diskCacheStrategy(DiskCacheStrategy.ALL)\n .placeholder(R.drawable.placeholder)\n .error(R.drawable.placeholder)\n .into(img_CorrectAns);*/\n }\n } else {\n // Notify user that an error occurred while downloading image\n\n }\n\n }" ]
[ "0.65739214", "0.64689654", "0.64437383", "0.6399398", "0.63004464", "0.6062135", "0.6022678", "0.6009603", "0.60051167", "0.59875023", "0.58600324", "0.5841984", "0.5832919", "0.57927155", "0.5784294", "0.5759561", "0.5747895", "0.57163113", "0.56912845", "0.56584936", "0.56562364", "0.5652612", "0.5643145", "0.5627656", "0.56109756", "0.55873734", "0.5583445", "0.556724", "0.5560343", "0.5538278", "0.5508717", "0.55071694", "0.5502775", "0.54971987", "0.5480955", "0.54754037", "0.5462998", "0.5454446", "0.5448225", "0.5445626", "0.5444619", "0.54441774", "0.5443711", "0.54427177", "0.5430899", "0.5422264", "0.54167527", "0.5390873", "0.53866786", "0.53810257", "0.53746974", "0.5372362", "0.53623325", "0.53605616", "0.53589195", "0.53577214", "0.5340479", "0.53384113", "0.53197545", "0.5313403", "0.53040665", "0.5296994", "0.5296674", "0.52965146", "0.52941084", "0.52917904", "0.52909917", "0.5289053", "0.5288363", "0.52816194", "0.5275487", "0.5268555", "0.5258798", "0.52575403", "0.5254786", "0.52540576", "0.5246358", "0.52458006", "0.5244241", "0.5244122", "0.5242207", "0.52407527", "0.5237156", "0.5230968", "0.5228161", "0.52261496", "0.5222956", "0.5220154", "0.5219755", "0.52164984", "0.5214158", "0.52099454", "0.5193906", "0.5193394", "0.5190678", "0.5186599", "0.51865536", "0.5186086", "0.51856214", "0.5184007", "0.5181764" ]
0.0
-1
Set data to application context
public void setupContext(ServletContext context) { Map<String, Object> map = new HashMap<String, Object>(); map.put("CURRENT_THEME", Constants.CURRENT_THEME); map.put("LOGGED_USER", Constants.LOGGED_USER); map.put("YES", Constants.YES); map.put("NO", Constants.NO); map.put("ACTION", Constants.ACTION); map.put("ACTION_ADD", Constants.ACTION_ADD); map.put("SECURE_FIELD", Constants.SECURE_FIELD); map.put("DEBUG_MODE", Constants.isDebugMode()); map.put("SHOW_FLAT_COMMISSIONS", "false"); context.setAttribute("Constants", map); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void setContext(Map<String, Object> context);", "void setAppCtx(ApplicationContext appCtx);", "public void setUserContext(UserContext userContext);", "private void setUserData(){\n }", "public void setContext(Context context) {\n this.contextMain = context;\n }", "@Override\n\tpublic void setApplicationContext(ApplicationContext applicationContext) {\n\t\tthis.applicationContext = applicationContext;\n\t}", "public void setUserData(Object data);", "public void setApplicationContext(final ApplicationContext inApplicationContext)\n {\n ctx = inApplicationContext;\n }", "public void setContext(Context _context) {\n context = _context;\n }", "public synchronized static void setContext(Context con){\n\t\tcontext = con;\n\t}", "protected void setContext(RestContext context) throws ServletException {\n\t\tthis.context.set(context);\n\t}", "@Override\r\n\tpublic void setApplicationContext(ApplicationContext applicationContext)\r\n\t\t\tthrows BeansException {\n\t\tSystem.out.println(\"进入方法。。。\"+applicationContext);\r\n\t\tApplicationContextHolder.app=applicationContext;\r\n\t}", "@Override\n public void setApplicationContext(ApplicationContext applicationContext) {\n super.setApplicationContext(applicationContext);\n this.applicationContext = applicationContext;\n }", "public void setContext(Context context) {\n this.context = context;\n }", "public static void setApplicationContext( ApplicationContext context ){\n\t\t\tctx = context;\n//\t\telse{\n//\t\t\tSystem.out.println(\"Error, ApplicationContext already has been set\");\n//\t\t}\n\t}", "@Override\r\n\tpublic void setContext(Context context) {\r\n\t\tthis.context = context;\r\n\t}", "@Override\n\tpublic void setApplicationContext(ApplicationContext applicationContext) throws BeansException {\n\t\tcontext=applicationContext;\n\t}", "private void setAttributes() {\n mAuth = ServerData.getInstance().getMAuth();\n user = ServerData.getInstance().getUser();\n sharedpreferences = getSharedPreferences(GOOGLE_CALENDAR_SHARED_PREFERENCES, Context.MODE_PRIVATE);\n walkingSharedPreferences = getSharedPreferences(ACTUAL_WALK, Context.MODE_PRIVATE);\n\n notificationId = 0;\n requestCode = 0;\n fragmentManager = getSupportFragmentManager();\n\n context = this;\n }", "public void setContextObject(Object co) {\n context = co;\n }", "@Override\n\tpublic void onApplicationEvent(ContextRefreshedEvent arg0) {\n\t\tinitData();\n\t}", "@Override\n\tpublic void onApplicationEvent(ContextRefreshedEvent arg0) {\n\t\tinitData();\n\t}", "abstract public void setUserData(Object data);", "@Autowired\n\tpublic void setContext(ApplicationContext context) {\n\t\tthis.context = context;\n\t\t((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope(\"session\", new SessionScope());\n\t\t((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope(\"request\", new RequestScope());\n\t}", "public FetchingAllDataModel() {\n\n context = AppController.getInstance().getApplicationContext();\n }", "@Autowired\r\n\tpublic void setContext(ApplicationContext context) {\r\n\t\tthis.context = context;\r\n\t\t((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope(\"session\", new SessionScope());\r\n\t\t((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope(\"request\", new RequestScope());\r\n\t}", "@Autowired\r\n\tpublic void setContext(ApplicationContext context) {\r\n\t\tthis.context = context;\r\n\t\t((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope(\"session\", new SessionScope());\r\n\t\t((DefaultListableBeanFactory) context.getAutowireCapableBeanFactory()).registerScope(\"request\", new RequestScope());\r\n\t}", "void setContext(Context context) {\n\t\tthis.context = context;\n\t}", "public void addContextData( String key,\n String value );", "public void setData(T data){\n this.data = data;\n }", "public MyServiceDataSingleton(Context context) {\r\n myContext = context;\r\n }", "public void initData(Controller controller) {\r\n //Initialise controller.\r\n this.controller = controller;\r\n }", "void setUserData(Object userData);", "public void setUser(UserData data) {\n user = data;\n }", "private void loadUserData() {\n\t\tuserData = new UserData();\n }", "public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {\n\t\tthis.context=context;\r\n\t}", "void setData(T data) {\n\t\tthis.data = data;\n\t}", "public void setContext(PageContext context) {\n this.context = context;\n }", "@Override\r\n\tpublic void setApplicationContext(ApplicationContext applicationContext) throws BeansException {\n\t\tthis.applicationContext = applicationContext;\r\n\t}", "public static void userData(Context context)\r\n\t{\r\n\t\ttry {\r\n\t\t\tcontext.json(((Account)context.sessionAttribute(\"currentUser\")));\r\n\t\t}\r\n\t\tcatch(Exception e)\r\n\t\t{\r\n\t\t\tLogging.error(e);\r\n\t\t\tcontext.redirect(\"/index.html\");\r\n\t\t}\r\n\t}", "public Context() {\n this.usersList = JsonParser.getUsersFromJsonArray();\n this.editedUsersList = new ArrayList<>();\n }", "public static void populateData() {\n\n }", "@Override\n\tpublic void setApplicationContext(ApplicationContext context) throws BeansException {\n\t\tSystem.out.println(\"setting newly\");\n\t\tthis.context=context;\n\t\tsetContext();\n\t}", "public void setRequestData(T requestData) {\n this.requestData = requestData;\n }", "public void initializeContext(Context context) {\n this.context = context;\n }", "@Override\r\n\tpublic void setApplicationContext(ApplicationContext applicationContext)\r\n\t\t\tthrows BeansException {\n\t\tcontext = (WebApplicationContext) applicationContext;\r\n\t}", "static void setActiveContext(ApplicationContext context) {\n SchemaCompilerApplicationContext.context = context;\n }", "public void setUserData(Object userData) {\n this.userData = userData;\n }", "private void setUser(Map<String, Object> data) {\n this.setUser(ID(), data);\n }", "private void InitData() {\n\t}", "@Autowired\r\n\tpublic void setDataStore(TrPortfolioContestDAO dataStore) {\r\n\t\tthis.dataStore = dataStore;\r\n\t}", "private void initialData() {\n\n// if (MorphiaObject.datastore.createQuery(SecurityRole.class).countAll() == 0) {\n// for (final String roleName : Arrays\n// .asList(controllers.Application.USER_ROLE)) {\n// final SecurityRole role = new SecurityRole();\n// role.roleName = roleName;\n// MorphiaObject.datastore.save(role);\n// }\n// }\n }", "public MyApp() {\n sContext = this;\n }", "public void setContext(Context conti) {\n\t\tthis.cont = conti;\n\t}", "@Override\r\n\tpublic void setContext(Context context) {\n\t\thost = context.getString(MongoWriteConstants.MONGO_HOST);\r\n\t\tport = context.getInteger(MongoWriteConstants.MONGO_PORT, MongoWriteConstants.DEFAULT_MONGO_PORT);\r\n\t\tuser = context.getString(MongoWriteConstants.MONGO_USER);\r\n\t\tpassword = context.getString(MongoWriteConstants.MONGO_PASSWORD);\r\n\t\tdatabase = context.getString(MongoWriteConstants.MONGO_DATABASE);\r\n\t\tcollection = context.getString(MongoWriteConstants.MONGO_COLLECTION);\r\n\t}", "public void setContext(UsersResourceContext context) {\n this._context = context;\n }", "public void setContext(final Class<?> context) {\n\t\tthis.context = context;\n\t}", "public void setUserData (Object userData) {\n\t\tthis.userData = userData;\n\t}", "@Override\n\tprotected void initData() {\n\t\trequestUserInfo();\n\t}", "public void setData(Object data) {\r\n this.data = data;\r\n }", "public void setContext(ContextRequest context) {\n\t\tthis.context = context;\n\t}", "@Override\n public void sync(Context context) {\n context.setCandidateSet(Database.getCandidateSet());\n context.setVoterSet(Database.getVoterSet());\n context.setLogins(Database.getLogins());\n context.setCommissionerSet(Database.getCommissionerSet());\n }", "public void setUserData(Object argUserData) {\n userData = argUserData;\n }", "@Override\r\n\tpublic void initData() {\n\t\tThreadUtils.getSinglePool().execute(new Runnable() {\r\n\t\t\t\r\n\t\t\t@Override\r\n\t\t\tpublic void run() {\r\n\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\ttry {\r\n\t\t\t\t\tThread.sleep(2000);\r\n\t\t\t\t\tIntent intent =null;\r\n\t\t\t\t\tChainApplication application = (ChainApplication) getApplicationContext();\r\n\t\t\t\t\tUser user = application.getUserInfo();\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(StringUtils.isEmpty(user.getUser_Name()) && StringUtils.isEmpty(HttpManager.getInstance().getToken(HttpManager.KEY_TOKEN))){\r\n\t\t\t\t\t\tintent = new Intent(getActivity(),LoginActivity.class);\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tintent = new Intent(getActivity(), MainActivity.class);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tstartActivity(intent);\r\n\t\t\t\t\tfinish();\r\n\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t});\r\n\t}", "private DatabaseContext() {\r\n datastore = createDatastore();\r\n init();\r\n }", "public void setApplicationContext(ApplicationContext context) throws BeansException {\r\n CONTEXT = context;\r\n }", "private void initData(){\n\n }", "public void setEntityContext(EntityContext aContext) {\n context = aContext;\n }", "public void setEntityContext(EntityContext aContext) {\n context = aContext;\n }", "public void setEntityContext(EntityContext aContext) {\n context = aContext;\n }", "public void setEntityContext(EntityContext aContext) {\n context = aContext;\n }", "public void InitData() {\n }", "public abstract void setValue(ELContext context, Object value);", "public void setApplicationContext(ApplicationContext context) throws BeansException {\n appContext = context;\n }", "private void initData() {\n\n }", "public static void setContext(Context c) {\n c = Utils.getContextImpl(c);\n // Then get the application context, as the provided context could be from\n // a provider, receiver, service, or activity.\n Context app = c.getApplicationContext();\n // getApplicationContext() could return null if the context is provided\n // during the Application's attach or some other non-standard situation.\n if (app != null)\n c = app;\n // Finally, get the raw ContextImpl of the app.\n context = Utils.getContextImpl(c);\n }", "private void initialData() {\n\n }", "public void setApplicationContext(ApplicationContext applicationContext)\r\n\t\t\tthrows BeansException {\n\t\tZWUtil.applicationContext = applicationContext;\r\n\t}", "@Override\n protected void configure() {\n bind(ApplicationContext.class).toInstance(ctxt);\n }", "public DatasetAdmin(Context context) {\n // this.data = MainActivity.data;\n this.context = context;\n }", "public abstract void set(T v, String context);", "public void setData(Object data) {\n this.data = data;\n }", "@Override\r\n\tpublic void setApplicationContext(ApplicationContext applicationContext) throws BeansException {\n\t\t\r\n\t}", "private void initData() {\n requestServerToGetInformation();\n }", "public void setContext(ComponentContext ctx)\n\t{\n\t\tthis.context = ctx;\n\t}", "public STDataController(Context context) {\n personNames = new ArrayList<String>();\n personIds = new ArrayList<String>();\n personPhotos = new ArrayList<Bitmap>();\n personSelections = new ArrayList<HashSet<Integer>>();\n \n menuItemNames = new ArrayList<String>();\n menuItemPrices = new ArrayList<Double>();\n \n this.context = context;\n }", "private AppRepo(Context context) {\n mDb = AppDB.getInstance(context);\n mFoods = getAllFoods();\n mPortions = getAllPortions();\n mMeals = getAllMeals();\n mConsumed = getAllConsumed();\n }", "private VelocityContext getHomePageData(User currentUser) {\r\n VelocityContext context = new VelocityContext();\r\n\r\n List<Post> newPosts = postService.getNewPosts();\r\n context.put(\"posts\", newPosts);\r\n\r\n context.put(\"user\", currentUser);\r\n \r\n return context;\r\n }", "private void initData() {\n }", "public void initData(UserManager userManager) {\n this.userManager = userManager;\n }", "@Override\n\tpublic void setApplicationContext(ApplicationContext context) throws BeansException {\n\t\t\n\t\tthis.context = context;\n\t\t\n\t}", "protected void bind(EvaluationContext context) {\n this.context = context;\n }", "public void setApplicationContext(ApplicationContext applicationContext)\n/* */ throws BeansException\n/* */ {\n/* 106 */ applicationContext = applicationContext;\n/* */ }", "@Override\n public void setCallContext(CallContext context) {\n this.context = context;\n //repository map depends on the context\n this.eloCmisRepositoryMap = EloCmisRepository.createEloCmisRepositoryMap(this, (ExtensionsData) null);\n }", "public static void setData() \n\t{\n\t\tsetCustomerData();\n\t\ttry\n\t\t{\n\t\t\tsetSensorData();\n\t\t}\n\t\tcatch (SensorNotFoundException e)\n\t\t{\n\t\t\tstatusBar.setText(e.getMessage());\n\t\t}\n\n\t}", "@Override\n\tpublic void setApplicationContext(ApplicationContext ctx) throws BeansException {\n\t\tthis.ctx=ctx;\n\t}", "public void setContext(Context ctx) {\n\t\tprefs = PreferenceManager.getDefaultSharedPreferences(ctx);\n\t\tupdateNextIdx();\n\t}", "public void setData(Data data) {\n this.data = data;\n }", "public static void setupContext(ServletContext context) {\n \t//I don't need this dropdown list. bguo.\n// ApplicationContext ctx = WebApplicationContextUtils.getRequiredWebApplicationContext(context);\n// LookupManager mgr = (LookupManager) ctx.getBean(\"lookupManager\");\n//\n// // get list of possible roles\n// context.setAttribute(RoleConstants.AVAILABLE_ROLES, mgr.getAllRoles());\n// log.debug(\"Drop-down initialization complete [OK]\");\n }", "public void setData(Map<E, String> data) {\n\t\tthis.data = data;\n\t}", "protected void setup(Context context) {}", "public void setContext( UpgradeContext context ) {\r\n\t\tthis.context = context;\r\n\t\tupgradeContext = context;\r\n\t}" ]
[ "0.675036", "0.6457679", "0.6425149", "0.6288981", "0.6246408", "0.6245115", "0.62099725", "0.6178935", "0.61604255", "0.613073", "0.61275", "0.61271", "0.61029387", "0.6063543", "0.6038909", "0.6030269", "0.60225147", "0.6002457", "0.5995526", "0.5986865", "0.5986865", "0.5985339", "0.5970089", "0.59507763", "0.5928579", "0.5928579", "0.5925083", "0.5881649", "0.5834068", "0.5824755", "0.58058786", "0.5790219", "0.576774", "0.5751209", "0.5745428", "0.57377315", "0.57320696", "0.57303053", "0.5726921", "0.57262784", "0.57254344", "0.5721122", "0.5711139", "0.5705362", "0.5703237", "0.56945425", "0.5688243", "0.567293", "0.5651995", "0.564598", "0.563709", "0.5613259", "0.5608026", "0.5602893", "0.5579275", "0.5574306", "0.55701417", "0.55664027", "0.55610996", "0.55548453", "0.55466676", "0.55329794", "0.5522399", "0.5521932", "0.5518766", "0.55180377", "0.55156845", "0.55156845", "0.55156845", "0.55156845", "0.55102646", "0.5502008", "0.5501516", "0.54994726", "0.5497686", "0.54972434", "0.54891276", "0.5487704", "0.5483225", "0.5481665", "0.54774016", "0.5477093", "0.5464888", "0.54635495", "0.5459252", "0.5458497", "0.5456579", "0.5456158", "0.5455578", "0.54526085", "0.5449493", "0.54461014", "0.5442834", "0.54406637", "0.5438772", "0.5438376", "0.5435951", "0.5425744", "0.54251564", "0.5424524", "0.5410207" ]
0.0
-1
Inflate the menu; this adds items to the action bar if it is present.
@Override public boolean onCreateOptionsMenu(Menu menu) { getMenuInflater().inflate(R.menu.menu_chat2, menu); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tMenuInflater inflater = getMenuInflater();\n \tinflater.inflate(R.menu.main_activity_actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.actions, menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n \tgetMenuInflater().inflate(R.menu.actions, menu);\n \treturn super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.actions_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main_actions, menu);\n\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n\t\tinflater.inflate(R.menu.action_bar_menu, menu);\r\n\t\tmMenu = menu;\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.act_bar_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_actions, menu);\r\n\t\treturn true;\r\n //return super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\r\n\t inflater.inflate(R.menu.action_bar_all, menu);\r\n\t return super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\t super.onCreateOptionsMenu(menu);\n\t\tMenuInflater muu= getMenuInflater();\n\t\tmuu.inflate(R.menu.cool_menu, menu);\n\t\treturn true;\n\t\t\n\t\t\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.adventure_archive, menu);\r\n\t\treturn true;\r\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.archive_menu, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n \tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n \t\tinflater.inflate(R.menu.main, menu);\n \t\tsuper.onCreateOptionsMenu(menu, inflater);\n \t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.action_menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater bow=getMenuInflater();\n\t\tbow.inflate(R.menu.menu, menu);\n\t\treturn true;\n\t\t}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.action_menu, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\t\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\t\t\n\t\t/* Inflate the menu; this adds items to the action bar if it is present */\n\t\tgetMenuInflater().inflate(R.menu.act_main, menu);\t\t\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflate = getMenuInflater();\n inflate.inflate(R.menu.menu, ApplicationData.amvMenu.getMenu());\n return true;\n }", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.menu, menu);\n\t\t\treturn true; \n\t\t\t\t\t\n\t\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.main, menu);\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) \n {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_bar, menu);\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_item, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tinflater.inflate(R.menu.menu, menu);\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t MenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t return super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t inflater.inflate(R.menu.menu, menu);\n\t \n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\t//menu.clear();\n\t\tinflater.inflate(R.menu.soon_to_be, menu);\n\t\t//getActivity().getActionBar().show();\n\t\t//getActivity().getActionBar().setBackgroundDrawable(\n\t\t\t\t//new ColorDrawable(Color.rgb(223, 160, 23)));\n\t\t//return true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n this.getMenuInflater().inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.main, menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu( Menu menu, MenuInflater inflater )\n\t{\n\t\tsuper.onCreateOptionsMenu( menu, inflater );\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\r\n\t\treturn super.onCreateOptionsMenu(menu);\r\n\t}", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\r\n \t// We must call through to the base implementation.\r\n \tsuper.onCreateOptionsMenu(menu);\r\n \t\r\n MenuInflater inflater = getMenuInflater();\r\n inflater.inflate(R.menu.main_menu, menu);\r\n\r\n return true;\r\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main, menu);//Menu Resource, Menu\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n inflater.inflate(R.menu.inter_main, menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.action, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu (Menu menu){\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.menu_main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.custom_action_bar, menu);\n\t\treturn true;\n\t}", "public void initMenubar() {\n\t\tremoveAll();\n\n\t\t// \"File\"\n\t\tfileMenu = new FileMenuD(app);\n\t\tadd(fileMenu);\n\n\t\t// \"Edit\"\n\t\teditMenu = new EditMenuD(app);\n\t\tadd(editMenu);\n\n\t\t// \"View\"\n\t\t// #3711 viewMenu = app.isApplet()? new ViewMenu(app, layout) : new\n\t\t// ViewMenuApplicationD(app, layout);\n\t\tviewMenu = new ViewMenuApplicationD(app, layout);\n\t\tadd(viewMenu);\n\n\t\t// \"Perspectives\"\n\t\t// if(!app.isApplet()) {\n\t\t// perspectivesMenu = new PerspectivesMenu(app, layout);\n\t\t// add(perspectivesMenu);\n\t\t// }\n\n\t\t// \"Options\"\n\t\toptionsMenu = new OptionsMenuD(app);\n\t\tadd(optionsMenu);\n\n\t\t// \"Tools\"\n\t\ttoolsMenu = new ToolsMenuD(app);\n\t\tadd(toolsMenu);\n\n\t\t// \"Window\"\n\t\twindowMenu = new WindowMenuD(app);\n\n\t\tadd(windowMenu);\n\n\t\t// \"Help\"\n\t\thelpMenu = new HelpMenuD(app);\n\t\tadd(helpMenu);\n\n\t\t// support for right-to-left languages\n\t\tapp.setComponentOrientation(this);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp=getMenuInflater();\n\t\tblowUp.inflate(R.menu.welcome_menu, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.listing, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.item, menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.resource, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater= getMenuInflater();\n inflater.inflate(R.menu.menu,menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.home_action_bar, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.template, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n Log.d(\"onCreateOptionsMenu\", \"create menu\");\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.socket_activity_actions, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_menu, menu);//Menu Resource, Menu\n\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actionbar, menu);\n return true;\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(toolbar_res, menu);\n updateMenuItemsVisibility(menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t// \n\t\tMenuInflater mi = getMenuInflater();\n\t\tmi.inflate(R.menu.thumb_actv_menu, menu);\n\t\t\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t}", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.swag_list_activity_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n super.onCreateOptionsMenu(menu, inflater);\n\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n MenuInflater inflater = getMenuInflater();\n inflater.inflate(R.menu.main_menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(android.view.Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\n\t\treturn true;\n\t}", "@Override\n\t\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\t\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\t\treturn true;\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.jarvi, menu);\n\t\treturn super.onCreateOptionsMenu(menu);\n\t}", "public void onCreateOptionsMenu(Menu menu, MenuInflater inflater){\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) {\n menuInflater.inflate(R.menu.main, menu);\n\n }", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.add__listing, menu);\r\n\t\treturn true;\r\n\t}", "@Override\r\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.actmain, menu);\r\n return true;\r\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.buat_menu, menu);\n\t\treturn true;\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.layout.menu, menu);\n\t\treturn true;\n\t}", "@Override\npublic boolean onCreateOptionsMenu(Menu menu) {\n\n\t\n\t\n\tgetMenuInflater().inflate(R.menu.main, menu);\n\t\n\treturn super.onCreateOptionsMenu(menu);\n}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ichat, menu);\n\t\treturn true;\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu, menu);\n return super.onCreateOptionsMenu(menu);\n }", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater)\n\t{\n\t\tsuper.onCreateOptionsMenu(menu, inflater);\n\t\tinflater.inflate(R.menu.expenses_menu, menu);\n\t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n \tpublic boolean onCreateOptionsMenu(Menu menu) {\n \t\tgetMenuInflater().inflate(R.menu.main, menu);\n \t\treturn true;\n \t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.action_bar, menu);\n return true;\n }", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tsuper.onCreateOptionsMenu(menu);\n\t\tMenuInflater blowUp = getMenuInflater();\n\t\tblowUp.inflate(R.menu.status, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.menu, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n\tpublic void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n\t}", "@Override\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tMenuInflater inflater = getMenuInflater();\n\t\tinflater.inflate(R.menu.main, menu);\n\t\treturn true;\n\t}", "@Override\r\n\tpublic boolean onCreateOptionsMenu(Menu menu) {\n\t\tgetMenuInflater().inflate(R.menu.ui_main, menu);\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_activity_actions, menu);\n return true;\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {\n inflater.inflate(R.menu.menu_main, menu);\n super.onCreateOptionsMenu(menu, inflater);\n }" ]
[ "0.7246102", "0.7201358", "0.7194834", "0.7176498", "0.71066517", "0.7039537", "0.7037961", "0.70112145", "0.70094734", "0.69807225", "0.6944953", "0.69389373", "0.6933199", "0.6916928", "0.6916928", "0.6891486", "0.68831646", "0.68754137", "0.68745375", "0.68621665", "0.68621665", "0.68621665", "0.68621665", "0.68515885", "0.68467957", "0.68194443", "0.6817494", "0.6813087", "0.6813087", "0.6812847", "0.6805774", "0.6801204", "0.6797914", "0.6791314", "0.6789091", "0.67883503", "0.6783642", "0.6759701", "0.6757412", "0.67478645", "0.6744127", "0.6744127", "0.67411774", "0.6740183", "0.6726017", "0.6723245", "0.67226785", "0.67226785", "0.67208904", "0.67113477", "0.67079866", "0.6704564", "0.6699229", "0.66989094", "0.6696622", "0.66952467", "0.66865396", "0.6683476", "0.6683476", "0.6682188", "0.6681209", "0.6678941", "0.66772443", "0.6667702", "0.66673946", "0.666246", "0.6657578", "0.6657578", "0.6657578", "0.6656586", "0.66544783", "0.66544783", "0.66544783", "0.66524047", "0.6651954", "0.6650132", "0.66487855", "0.6647077", "0.66467404", "0.6646615", "0.66464466", "0.66449624", "0.6644209", "0.6643461", "0.6643005", "0.66421187", "0.6638628", "0.6634786", "0.6633529", "0.6632049", "0.6632049", "0.6632049", "0.66315657", "0.6628954", "0.66281766", "0.6627182", "0.6626297", "0.6624309", "0.6619582", "0.6618876", "0.6618876" ]
0.0
-1
Override the Fragment.onAttach() method to instantiate the NoticeDialogListener
@Override public void onAttach(final Activity activity) { super.onAttach(activity); // Verify that the host activity implements the callback interface try { // Instantiate the NoticeDialogListener so we can send events to the // host mListener = (NoticeDialogListener) activity; } catch (final ClassCastException e) { // The activity doesn't implement the interface, throw exception throw new ClassCastException(activity.toString() + " must implement NoticeDialogListener"); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onAttach(Context context){\n super.onAttach(context);\n Activity activity = (Activity) context;\n if (context instanceof Activity){\n activity = (Activity) context;\n }\n\n try{\n listener = (StationFragmentListener) activity;\n }\n catch(ClassCastException e){\n throw new ClassCastException(activity.toString()\n + \" must implement NoticeDialogListener\");\n }\n\n\n }", "@Override\n public void onAttach(Activity activity) {\n super.onAttach(activity);\n // Verify that the host activity implements the callback interface\n try {\n // Instantiate the NoticeDialogListener so we can send events to the host\n mListener = (NoticeDialogListener) activity;\n } catch (ClassCastException e) {\n // The activity doesn't implement the interface, throw exception\n throw new ClassCastException(activity.toString()\n + \" must implement NoticeDialogListener\");\n }\n }", "@Override\n public void onAttach(Activity activity) {\n super.onAttach(activity);\n // Verify that the host activity implements the callback interface\n try {\n // Instantiate the NoticeDialogListener so we can send events to the host\n mListener = (DialogListener) activity;\n } catch (ClassCastException e) {\n // The activity doesn't implement the interface, throw exception\n throw new ClassCastException(activity.toString()\n + \" must implement NoticeDialogListener\");\n }\n }", "@Override\n public void onAttach(Activity activity) {\n \tthis.activity = activity;\n \t\n \tsuper.onAttach(activity);\n \n // Verify that the host activity implements the callback interface\n try {\n // Instantiate the NoticeDialogListener so we can send events to the host\n mListener = (NoticeDialogListener) activity;\n } catch (ClassCastException e) {\n // The activity doesn't implement the interface, throw exception\n throw new ClassCastException(activity.toString()\n + \" must implement NoticeDialogListener\");\n }\n }", "@Override\n public void onAttach(Activity activity) {\n super.onAttach(activity);\n // Verify that the host activity implements the callback interface\n try {\n // Instantiate the NoticeDialogListener so we can send events to the host\n mListener = (Listener) activity;\n } catch (ClassCastException e) {\n // The activity doesn't implement the interface, throw exception\n throw new ClassCastException(activity.toString()\n + \" must implement NoticeDialogListener\");\n }\n }", "@Override\n public void onAttach(Activity activity) {\n super.onAttach(activity);\n // Verify that the host activity implements the callback interface\n try {\n // Instantiate the NoticeDialogListener so we can send events to the host\n mListener = (NewProjectDialogListener) activity;\n } catch (ClassCastException e) {\n // The activity doesn't implement the interface, throw exception\n throw new ClassCastException(activity.toString()\n + \" must implement NoticeDialogListener\");\n }\n }", "public void showNoticeDialog() {\n DialogFragment dialog = new MyDialog();\n dialog.show(getSupportFragmentManager(), \"NoticeDialogFragment\");\n }", "@Override\n public void onAttach(Activity activity) {\n super.onAttach(activity);\n // Verify that the host activity implements the callback interface\n try {\n // Instantiate the NoticeDialogListener so we can send events to the host\n dialogListener = (AddContractDialogListener) activity;\n } catch (ClassCastException e) {\n // The activity doesn't implement the interface, throw exception\n throw new ClassCastException(activity.toString() + \" must implement AddContractDialogListener\");\n }\n }", "@Override\n public void onAttach(Activity activity) {\n super.onAttach(activity);\n // Verify that the host activity implements the callback interface\n try {\n // Instantiate the NoticeDialogListener so we can send events to the host\n mListener = (VoidReasonDialogListener) activity;\n } catch (ClassCastException e) {\n // The activity doesn't implement the interface, throw exception\n throw new ClassCastException(activity.toString()\n + \" must implement VoidReasonDialogListener\");\n }\n }", "@Override \n\tpublic void onAttach(Activity activity) { \n\t\tsuper.onAttach(activity); \n\t\t// Verify that the host activity implements the callback interface \n\t\ttry { \n\t\t\t// Instantiate the NoticeDialogListener so we can send events to the host \n\t\t\tmListener = (SettingsDialogListener) activity; \n\t\t} \n\t\tcatch (ClassCastException e) { \n\t\t\t// The activity doesn't implement the interface, throw exception \n\t\t\tthrow new ClassCastException(activity.toString() + \" must implement SettingsDialogListener\"); \n\t\t} \n\t}", "@Override\n public void onAttach(Context context) {\n super.onAttach(context);\n mMesasListListener = (MesasListListener) getActivity();\n }", "public interface NoticeDialogListener{\n public void onDialogAlbumPhotoClick();\n public void onDialogTakePhotoClick();\n }", "@Override\n public void onAttach(Activity activity) {\n super.onAttach(activity);\n // Verify that the host activity implements the callback interface\n try {\n // Instantiate the NoticeDialogListener so we can send events to the host\n mListener = (LeaveChanDialogListener) activity;\n } catch (ClassCastException e) {\n // The activity doesn't implement the interface, throw exception\n throw new ClassCastException(activity.toString()\n + \" must implement LeaveChanDialogListener\");\n }\n }", "public void showNoticeDialog() {\n DialogFragment dialog = new OptionDialog();\n dialog.show(getSupportFragmentManager(), \"NoticeDialogFragment\");\n }", "public void onAttach() {\n super.onAttach(getActivity());\n Log.i(sFragmentName, \"onAttach()\");\n }", "@Override\n public void onAttach(Context context) {\n super.onAttach(context);\n if (context instanceof OnFragmentInteractionListener) {\n mListener = (OnFragmentInteractionListener) context;\n } else {\n throw new RuntimeException(context.toString()\n + \" must implement OnFragmentInteractionListener\");\n }\n }", "@Override\r\n public void onAttach(Context context) {\r\n super.onAttach(context);\r\n if (context instanceof OnFragmentInteractionListener) {\r\n mListener = (OnFragmentInteractionListener) context;\r\n } else {\r\n throw new RuntimeException(context.toString()\r\n + \" must implement OnFragmentInteractionListener\");\r\n }\r\n }", "@Override\n public void onAttach(Context context) {\n super.onAttach(context);\n // mHost=(NetworkDialogListener)context;\n }", "@Override\n public void onAttach(Context context) {\n super.onAttach(context);\n if (context instanceof ProgrammingLangC_BookmarkFragmentProgram.OnFragmentInteractionListener) {\n mListener = (ProgrammingLangC_BookmarkFragmentProgram.OnFragmentInteractionListener) context;\n } else {\n throw new RuntimeException(context.toString()\n + \" must implement OnFragmentInteractionListener\");\n }\n }", "@Override\n public void onAttach(Context context) {\n super.onAttach(context);\n // Verify that the host activity implements the callback interface\n try {\n // Instantiate the SelectPetDialogListener so we can send events to the host\n listener = (SelectPetDialogListener) context;\n } catch (ClassCastException e) {\n // The activity doesn't implement the interface, throw exception\n throw new ClassCastException(\"Activity must implement AddPetDialogListener\");\n }\n }", "@Override\n public void onFragmentAttached() {\n }", "private void myOnAttach(Context context) {\n\n if (context instanceof LoginFragmentInteractionListener) {\n mListener = (LoginFragmentInteractionListener) context;\n } else {\n throw new RuntimeException(context.toString()\n + \" must implement LoginFragmentInteractionListener\");\n }\n }", "@Override\n public void onAttach(@NonNull Context context) {\n super.onAttach(context);\n\n try {\n dListener = (dialogListener) context; // dialog interface is equal to activity instance\n } catch (ClassCastException e) {\n // in case dialogListener didnt implemented\n throw new ClassCastException(context.toString() + \"must Implement dialogListener interface to MainActivity First\");\n }\n }", "@Override\n public void onAttach(Context context) {\n super.onAttach(context);\n // get a reference to the hosting activity in listener, works bc host activity must implement interface\n listener = (OnFragmentInteractionListener) context;\n }", "@Override\n public void onAttach(Context context) {\n super.onAttach(context);\n if(context instanceof onSelectGeboortejaarFragmentListener){\n mListener = (onSelectGeboortejaarFragmentListener) context;\n }else{\n throw new RuntimeException(context.toString()\n + \" must implement onSelectGeboortejaarFragment\");\n }\n }", "@Override\n public void onAttach(Context context) {\n super.onAttach(context);\n\n Log.d(TAG, \"onAttach\");\n\n if(context instanceof SurveyVoteListener){\n mVoteListener = (SurveyVoteListener) context;\n Log.d(TAG, \"On attach survey vote listener set \" + mVoteListener);\n } else {\n throw new RuntimeException(context.toString() + \" must implement SurveyVoteListener\");\n }\n }", "@Override\n public void onAttach(Context context) {\n super.onAttach(context);\n if (context instanceof FragmentTwo.fragmentTwoInterface) {\n listener = (FragmentTwo.fragmentTwoInterface) context;\n }\n else {\n throw new RuntimeException();\n }\n }", "@Override\n public void onAttach(Context context) {\n super.onAttach(context);\n if (context instanceof ParadasFragment.FragmentFromFragment) {\n fragmentFromFragmentListener = (ParadasFragment.FragmentFromFragment) context;\n } else {\n throw new ClassCastException(context.toString() + \" must implements MainScreenFragment.OnNewSurveyClicked\");\n }\n }", "@Override\r\n public void onAttach(Context context) {\r\n super.onAttach(context);\r\n }", "@Override\n public void onAttach(Context context) {\n super.onAttach(context);\n try {\n listener = (ScoreDialogPickerListener) context;\n } catch (ClassCastException e) {\n throw new ClassCastException(context.toString() +\n \"must implement example dialog listener\");\n }\n }", "@Override\n public void onAttach(Context context) {\n super.onAttach(context);\n\n }", "@Override\n public void onAttach(Context context) {\n super.onAttach(context);\n //this registers this fragment to recieve any EventBus\n EventBus.getDefault().register(this);\n }", "@Override\n public void onAttach(Context context) {\n super.onAttach(context);\n }", "@Override\r\n\t\tpublic void onAttach(Activity activity) {\n\t\t\tsuper.onAttach(activity);\r\n\t\t\tmCallback=(Fragment_Listener)activity;\r\n\t\t\t\r\n\t\t}", "@Override\n public void onAttach(Context context) {\n super.onAttach(context);\n listener = (LoginFragment.LoginFragmentListener) context;\n }", "public static void setCustomDialogFragment(ZeTargetInAppNotification customDialogFrag){\n customDialogFragment = customDialogFrag;\n }", "@Override\n protected void onCreateInternal() {\n ConfirmationDialogFragment dialog =\n (ConfirmationDialogFragment) getFragmentController().findDialogByTag(\n ConfirmationDialogFragment.TAG);\n\n ConfirmationDialogFragment.resetListeners(dialog, mConfirmListener, /* rejectListener= */\n null);\n }", "@Override\n public void onAttach(Context context) {\n super.onAttach(context);\n if (context instanceof RequestFragmentInterface) {\n mInterface = (RequestFragmentInterface) context;\n } else {\n throw new RuntimeException(context.toString()\n + \" must implement OnFragmentInteractionListener\");\n }\n }", "@Override\n\n public void onAttach(Activity activity) {\n super.onAttach(activity);\n // Verify that the host activity implements the callback interface\n try {\n // Instantiate the listener so we can send events to the host\n mListener = (TrackPlayerDialogListener) activity;\n } catch (ClassCastException e) {\n // The activity doesn't implement the interface, throw exception\n throw new ClassCastException(activity.toString()\n + \" must implement TrackPlayerDialogListener\");\n }\n }", "public abstract void onAttach();", "@Override\n\tpublic void onAttach(Activity activity) {\n\t\tsuper.onAttach(activity);\n\t\tLog.d(\"Fragment02\",\"onAttach\");\n\t}", "@Override\n public void onAttach(Context context){\n super.onAttach(context);\n if(context instanceof OnFragmentInteractionListener) {\n mListener = (OnFragmentInteractionListener) context;\n } else {\n throw new ClassCastException(context.toString()\n + getResources().getString(R.string.exception_message));\n }\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n return inflater.inflate(R.layout.fragment_notice, container, false);\n }", "@Override\n public void onAttach(Activity activity){\n super.onAttach(activity);\n\n //refer the listener variable declared above to the host activity when the fragment is attached\n listener = (AddEditCardListener) activity;\n }", "@NonNull\n @Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n builder.setTitle(getArguments().getString(\"title\"))\n .setMessage(getArguments().getString(\"message\"))\n .setCancelable(false)\n .setPositiveButton(R.string.OK, new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n // FIRE ZE MISSILES!\n // call callback method\n // mListener.onInfoDialogOKClick(InfoDialog.this);\n }\n });\n // Create the AlertDialog object and return it\n return builder.create();\n }", "@Override\n public void onAttach(Context context) {\n super.onAttach(context);\n if (context instanceof OnSubmittedListFragmentInteractionListener) {\n mListener = (OnSubmittedListFragmentInteractionListener) context;\n } else {\n throw new RuntimeException(context.toString()\n + \" must implement OnRejectedListFragmentInteractionListener\");\n }\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_notice, container, false);\n textView = view.findViewById(R.id.noticeBF);\n textView.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n Intent intent = new Intent(getContext(), MainActivity.class);\n startActivity(intent);\n }\n });\n return view;\n }", "@Override\n public void onAttach(Context context) {\n super.onAttach(context);\n mContext = context;\n mPresenter = createPresenter();\n if (mPresenter != null) {\n mPresenter.attachView((V) this);\n }\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_notification, container, false);\n\n tabLayout = view.findViewById(R.id.tabLayout_noti);\n ViewPager viewPager = view.findViewById(R.id.vpgNoti);\n setUpViewPager(viewPager);\n tabLayout.setupWithViewPager(viewPager);\n\n tabLayout.setOnTabSelectedListener(new TabLayout.OnTabSelectedListener() {\n @Override\n public void onTabSelected(TabLayout.Tab tab) {\n viewPager.setCurrentItem(tab.getPosition());\n }\n\n @Override\n public void onTabUnselected(TabLayout.Tab tab) {\n\n }\n\n @Override\n public void onTabReselected(TabLayout.Tab tab) {\n\n }\n });\n\n return view;\n }", "@Override\r\n\tpublic void onAttach(Activity activity) {\n\t\tsuper.onAttach(activity);\r\n\t\ttry {\r\n\t\t\tmListener = (AddItemDialogListener) activity;\r\n\t\t} catch (Exception e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public interface OnListFragmentInteractionListener {\n void onListFragmentInteraction(Note note);\n}", "public interface OnNoteFragmentInteractionListener {\n // TODO: Update argument type and name\n void openNote(Note note, int position);\n void onFragmentInteraction(Uri uri);\n }", "@Override\n public void onAttach(Activity activity)\n {\n super.onAttach(activity);\n // Verify that the host activity implements the callback interface\n try\n {\n // Instantiate the RestartGameDialogListener so we can send events\n // to the host\n mListener = (RestartGameDialogListener)activity;\n }\n catch (ClassCastException e)\n {\n throw new ClassCastException(activity.toString()\n + \" must implement RestartGameDialogListener\");\n }\n }", "@Override\n public Dialog onCreateDialog(Bundle savedInstanceState) {\n AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());\n String mess = \"They decliened your invitation\";\n if(getArguments().getBoolean(\"hostDeclined\"))\n {\n mess = \"They canceled their invitation\";\n }\n builder.setMessage(mess)\n .setPositiveButton(\"Ok\", new DialogInterface.OnClickListener() {\n public void onClick(DialogInterface dialog, int id) {\n // FIRE ZE MISSILES!\n }\n });\n // Create the AlertDialog object and return it\n return builder.create();\n }", "public interface OnViewFragmentListener {\r\n public void onViewCreated();\r\n}", "public interface StationFragmentListener{\n public void onDialogPositiveClick(DialogFragment dialog);\n public void onDialogNegativeClick(DialogFragment dialog);\n }", "@Override\n\tpublic void onAttach(Activity activity) {\n\t\tsuper.onAttach(activity);\n\t\tlistenr = (CheckStateListener) getActivity();\n\t}", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n Achievements getPostDetails();\n }", "@Override\n public void onAttach(Context context) {\n super.onAttach(context);\n if (context instanceof ComposeTweetListener) {\n mTweetListener = (ComposeTweetListener) context;\n } else {\n throw new ClassCastException(context.toString()\n + \" must implement ComposeTweetFragment.ComposeTweetListener\");\n }\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n public void onCallBellPressed(MessageReason reason);\n }", "public interface OnFragmentInteractionListener {\n\n public void openDialog(MotionEvent event);\n\n public void closeDialog();\n\n}", "@Override\n public void onAttach(Activity activity) {\n super.onAttach(activity);\n try{\n// mCallback = (FragmentIterationListener) activity;\n// }catch(CastClassException ex){\n }catch(Exception ex){\n Log.e(MovimientoListFragment.TAG, \"El Activity debe implementar la interfaz FragmentIterationListener\");\n }\n }", "public MessageListFragment() {\n setConversationListItemClickListener(new EaseConversationListItemClickListener() {\n @Override\n public void onListItemClicked(EMConversation conversation) {\n startActivity(new Intent(getActivity(), ChatActivity.class).putExtra(EaseConstant.EXTRA_USER_ID, conversation.conversationId()));\n }\n });\n // Required empty public constructor\n }", "public interface OnListNotesFragmentListener {\n void onListFragmentInteraction(NoteRef item);\n }", "public interface OnFragmentInteractionListener {\n void onFragmentMessage(String TAG, Object data);\n}", "void onFragmentInteraction(View v);", "void showDialog() {\n\t\tDialogFragment newFragment = MyAlertDialogFragment\n\t\t\t\t.newInstance(R.string.not_enoughth_information);\n\t\tnewFragment.show(getFragmentManager(), \"dialog\");\n\t}", "@TargetApi(23)\n @Override\n public void onAttach(Context context) {\n super.onAttach(context);\n onAttachToContext(context);\n }", "public DialogoPersonalizadoFragment() {\n\n }", "@Override\n public void attachFragment(Fragment fragment) {\n\n this.playerFragment = fragment; // Attaches the playerFragment to this class.\n\n // If the service has disconnected, the SSMusicService is restarted.\n if (!serviceBound) {\n setUpAudioService(); // Sets up the SSMusicService.\n }\n\n // Attaches the SSPlayerFragment.\n else {\n musicService.attachPlayerFragment(fragment);\n }\n }", "@Override\n public void onAttachFragment(Fragment fragment){\n // check if the current fragment is the recyclerview fragment and replace it with a word fragment\n if (fragment instanceof WordListFragment) {\n WordListFragment wordListFragment = (WordListFragment) fragment;\n wordListFragment.setOnViewClickListener(this);\n }\n }", "void onFragmentInteraction();", "void onFragmentInteraction();", "void onFragmentInteraction();", "public void onDialogPositiveClick(DialogFragment dialog);", "@Override\r\n\tpublic void onFragmentCreate(Bundle savedInstanceState) {\n\t}", "public void onShow(DialogInterface dialog) {\n if (listener == null) {\n return;\n }\n listener.onShow(context);\n }", "@Override\n public void onAttach(Activity activity) {\n super.onAttach(activity);\n\n // Verify that the host activity implements the callback interface\n try {\n // Instantiate the SetPasswordDialogListener so we can send events to the host\n deleteUserPromptListener = (DeleteUserPrompt.DeleteUserPromptListener) activity;\n } catch (ClassCastException e) {\n // The activity doesn't implement the interface, throw exception\n throw new ClassCastException(activity.toString()\n + \" must implement DeleteUserPromptListener\");\n }\n }", "@Override\n\tpublic void onActivityCreated(Bundle savedInstanceState) {\n\t\t\n\t\tactivity = (MainActivity)getActivity(); \n\t\t\n\t\tactivity.setContListener(this);\n\t\t\n\t\tif(MODE == Const.MODE_DEFAULT){\n\t\t\tinitializeInfoForm();\n\t\t}else{\n\t\t\tinitializeAddEditForm();\t\t\t\n\t\t}\n\t\t\n\t\tsuper.onActivityCreated(savedInstanceState);\n\t}", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n void onSocialLoginInteraction();\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n fragmentView = inflater.inflate(R.layout.fragment_event_friend_list, container, false);\n\n linlaHeaderProgress = (LinearLayout) fragmentView.findViewById(R.id.linlaHeaderProgress);\n\n eventFriendListRelativeLayout = (RelativeLayout) fragmentView.findViewById(R.id.eventFriendListRelativeLayout);\n eventFriendListRelativeLayout.setVisibility(View.GONE);\n\n try {\n checkAndHandleNotification();\n } catch (FaroObjectNotFoundException e) {\n // Event has been deleted.\n Toast.makeText(getActivity(), \"Event has been deleted\", LENGTH_LONG).show();\n Log.e(TAG, MessageFormat.format(\"Event {0} has been deleted\", eventId));\n getActivity().finish();\n }\n\n return fragmentView;\n }", "public interface DialogFragmentClickListener {\n public void onClick(DialogFragment dialogFragment);\n}", "public interface OnNotificationsFragmentInteractionListener {\r\n void onNotificationsFragmentInteraction(Uri uri);\r\n }", "@Override\n public void onAttach(Activity activity) {\n super.onAttach(activity);\n // Verify that the host activity implements the callback interface.\n try {\n // Instantiate the ImageChooserDialogListener so we can send events to the host.\n mListener = (ImageChooserDialogListener) activity;\n } catch (ClassCastException e) {\n // The activity doesn't implement the interface, throw exception.\n throw new ClassCastException(activity.toString()\n + \" must implement ImageChooserDialogListener.\");\n }\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n\n View vi = inflater.inflate(R.layout.fragment_fees, container, false);\n\n\n infobtn = (ImageView)vi.findViewById(R.id.infobtn);\n\n infobtn.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n new MaterialDialog.Builder(getActivity())\n .title(\"Consultation fees\")\n .content(\"This fees is indicative and might vary. \\n NOTE:Fees is payable at clinic. There are NO charges for booking an appointment.\")\n .positiveText(\"DISMISS\")\n .negativeText(\"\")\n .show();\n }\n });\n\n\n return vi;\n }", "public interface OpenFragmentListener {\n // TODO: Update argument type and name\n void OpenFragmentInteraction();\n }", "@SuppressWarnings(\"deprecation\")\n @Override\n public void onAttach(Activity activity) {\n super.onAttach(activity);\n callEvents = (MesiboVideoCallFragment.OnCallEvents) activity;\n }", "@Override\n public void onAttach(Context context) {\n super.onAttach(context);\n try {\n callback = (QuestionDisplay.Display) context;\n } catch (ClassCastException e) {\n throw new ClassCastException(context.toString()\n + \" must implement OnHeadlineSelectedListener\");\n }\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_dialog, container, false);\n\n youTubePlayerView = view.findViewById(R.id.youtube_player_view);\n getLifecycle().addObserver(youTubePlayerView);\n initPictureInPicture(youTubePlayerView);\n\n youTubePlayerView.addYouTubePlayerListener(new AbstractYouTubePlayerListener() {\n @Override\n public void onReady(@NonNull YouTubePlayer youTubePlayer) {\n String videoId = \"SQNtGoM3FVU\";\n youTubePlayer.loadVideo(videoId, 0);\n }\n });\n return view;\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n void onFragmentInteractionForm3(CrtPollForm3Data crtPollForm3Data);\n }", "public interface OnFragmentInteractionListener {\n // TODO: Update argument type and name\n\n\n void onFragmentInteraction(String mId, String mProductName, String mItemRate, int minteger, int update);\n }", "@Override\n public void onAttach(@NonNull Context context) {\n super.onAttach(context);\n mIMainActivity = (IMainActivity) getActivity();\n }", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n nfview= inflater.inflate(R.layout.fragment_news, container, false);\n newslistview=nfview.findViewById(R.id.news_listview);\n getNewsList();\n handler=new Handler(){\n @Override\n public void handleMessage(Message msg) {\n if(msg.what==Flag.NEWSFRAGMENT_MSG){\n newsBeanArrayList =(ArrayList<NewsBean>) msg.obj;\n newsAdapter=new NewsAdapter();\n newslistview.setAdapter(newsAdapter);\n }\n super.handleMessage(msg);\n }\n };\n\n newslistview.setOnItemClickListener(this);\n return nfview;\n\n }", "@Override\n public void onAttach(Context context) {\n super.onAttach(context);\n listener = (DeleteFishListener) context;\n }", "@Override\n\tpublic void onAttach(Context context) {\n\t\tsuper.onAttach(context);\n\t\tmContext = getActivity();\n\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup parent, Bundle savedInstanceState) {\n Bundle params = getArguments();\n view = inflater.inflate(R.layout.fragment_info,\n parent, false);\n\n\n numero = view.findViewById(R.id.num_id);\n prenom = view.findViewById(R.id.prenom_id);\n nom = view.findViewById(R.id.nom_id);\n formation = view.findViewById(R.id.formation_id);\n\n numero.setText(params.getString(\"i\"));\n prenom.setText(params.getString(\"prenom\"));\n nom.setText(params.getString(\"nom\"));\n formation.setText(params.getString(\"formation\"));\n\n InfoFragmentEventListener infoFragmentEventListener = (InfoFragmentEventListener)getActivity();\n\n\n //return inflater.inflate(R.layout.fragment_info, parent, false);\n Button btnprec = view.findViewById(R.id.prec_btn);\n Button btnsuiv = view.findViewById(R.id.suiv_btn);\n\n btnprec.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n infoFragmentEventListener.precedantClicked();\n }\n });\n btnsuiv.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View view) {\n infoFragmentEventListener.suivantClicked();\n }\n });\n\n\n\n return view;\n }", "@Override\n public void onAttach(Activity activity) {\n super.onAttach(activity);\n // Verify that the host activity implements the callback interface\n try {\n // Instantiate the SettingsManualInputDialogListener so we can send events to the host\n mListener = (SettingsManualInputDialogListener) activity;\n } catch (ClassCastException e) {\n // The activity doesn't implement the interface, throw exception\n throw new ClassCastException(activity.toString()\n + \" must implement SettingsManualInputDialogListener\");\n }\n }", "void onFragmentInteraction(Object ref);", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n mLocalBroadcastManager = LocalBroadcastManager.getInstance(getContext());\n return super.onCreateView(inflater, container, savedInstanceState);\n }", "public interface UserInfoListener {\n /**\n * Notifies other fragments with user information\n * @param userInfo user information, for now just a string\n */\n public void notifyUserInfo(String userInfo);\n}" ]
[ "0.78009003", "0.7167224", "0.71536154", "0.7130251", "0.70350647", "0.70094967", "0.68853986", "0.6862401", "0.68517256", "0.6624119", "0.6545264", "0.65181243", "0.64765465", "0.6421755", "0.64032584", "0.6286565", "0.62842494", "0.62456185", "0.6241208", "0.62272", "0.6225288", "0.621851", "0.62133145", "0.61570805", "0.6132056", "0.6087401", "0.60585165", "0.60577947", "0.60391784", "0.6038498", "0.60316086", "0.6011751", "0.60023725", "0.59983486", "0.59795284", "0.58756846", "0.58756524", "0.5869284", "0.58516103", "0.5841907", "0.58403754", "0.5839477", "0.58330184", "0.582282", "0.5813987", "0.5791786", "0.5760162", "0.5681076", "0.5649985", "0.56422186", "0.5618025", "0.55943984", "0.5586968", "0.55828005", "0.55808824", "0.5579906", "0.55769104", "0.55732125", "0.557058", "0.55670965", "0.55615884", "0.5552931", "0.55292326", "0.5500876", "0.5498385", "0.54917973", "0.54894614", "0.54664385", "0.5462892", "0.5445765", "0.54423094", "0.5442145", "0.5442145", "0.5442145", "0.5440142", "0.54385275", "0.54341006", "0.5430275", "0.5429711", "0.54008645", "0.53896666", "0.5389456", "0.5388501", "0.53879976", "0.537773", "0.53755563", "0.5374578", "0.5360837", "0.5345806", "0.53454703", "0.53358245", "0.53315556", "0.53313106", "0.5328748", "0.5321602", "0.5315657", "0.531328", "0.5307707", "0.5293694", "0.529344" ]
0.6996569
6
As Tab implicitly destroys this, and the embedder is allowed to destroy this, allow destroy() to be called multiple times.
@Override public void destroy() { if (mNativeFaviconCallbackProxy == 0) { return; } mTab.removeFaviconCallbackProxy(this); try { mClient.onDestroyed(); } catch (RemoteException e) { throw new AndroidRuntimeException(e); } FaviconCallbackProxyJni.get().deleteFaviconCallbackProxy(mNativeFaviconCallbackProxy); mNativeFaviconCallbackProxy = 0; mClient = null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void destroy() {\n }", "@Override\r\n\t\tpublic void destroy() {\n\t\t\t\r\n\t\t}", "@Override\n public void destroy() {\n }", "@Override\n public void destroy() {\n }", "@Override\n public void destroy() {\n }", "@Override\n public void destroy() {\n }", "@Override\n public void destroy() {\n }", "@Override\n public void destroy() {\n }", "@Override\r\n public void destroy() {\n }", "@Override\r\n public void destroy() {\n }", "@Override\r\n\tpublic void destroy()\r\n\t{\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\t\r\n\t}", "@Override\n\tpublic void destroy() {\n\t}", "@Override\n\tpublic void destroy() {\n\t}", "@Override\n\tpublic void destroy() {\n\t}", "@Override\n\tpublic void destroy() {\n\t}", "@Override\n\tpublic void destroy() {\n\t}", "@Override\n\tpublic void destroy() {\n\t}", "@Override\n\tpublic void destroy() {\n\t}", "@Override\n\tpublic void destroy() {\n\t}", "@Override\n\tpublic void destroy() {\n\t}", "@Override\r\n\tpublic void destroy() {\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\n\t}", "@Override\n\tpublic void destroy() {\n\t\t\n\t}", "@Override\n\tpublic void destroy() {\n\t\t\n\t}", "@Override\n\tpublic void destroy() {\n\t\t\n\t}", "@Override\n\tpublic void destroy() {\n\t\t\n\t}", "@Override\n\tpublic void destroy() {\n\t\t\n\t}", "@Override\n\tpublic void destroy() {\n\t\t\n\t}", "@Override\n\tpublic void destroy() {\n\t\t\n\t}", "@Override\n\tpublic void destroy() {\n\t\t\n\t}", "@Override\n\tpublic void destroy() {\n\t\t\n\t}", "@Override\n\tpublic void destroy() {\n\t\t\n\t}", "@Override\n\tpublic void destroy() {\n\t\t\n\t}", "@Override\n\tpublic void destroy() {\n\t\t\n\t}", "@Override\n\tpublic void destroy() {\n\t\t\n\t}", "@Override\n\tpublic void destroy() {\n\t\t\n\t}", "@Override\n\tpublic void destroy() {\n\t\t\n\t}", "@Override\n\tpublic void destroy() {\n\t\t\n\t}", "@Override\n\tpublic void destroy() {\n\t\t\n\t}", "@Override\n\tpublic void destroy() {\n\t\t\n\t}", "@Override\n\tpublic void destroy() {\n\t\t\n\t}", "@Override\n\tpublic void destroy() {\n\t\t\n\t}", "@Override\n\tpublic void destroy() {\n\t\t\n\t}", "@Override\n\tpublic void destroy() {\n\t\t\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\tsuper.destroy();\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\tsuper.destroy();\r\n\t}", "@Override\r\n\tpublic void destroy() {\n\t\tsuper.destroy();\r\n\t}", "@Override\n\tpublic void destroy() {\n\t\tsuper.destroy();\n\t\tSystem.out.println(\"destroy\");\n\t}", "@Override\n public void destroy() {\n }", "@Override\n\tpublic void destroy(){\n\t\t\n\t}", "@Override\n public void Destroy() {\n }", "@Override\t\n\tpublic void destroy() {\n\t\t\n\t}", "@Override\n public void destroy() {\n\n }", "@Override\n public void destroy() {\n\n }", "@Override\n public void destroy() {\n\n }", "@Override\n public void destroy() {\n }" ]
[ "0.6888513", "0.67959994", "0.678001", "0.6769299", "0.6769299", "0.6769299", "0.6769299", "0.6769299", "0.6755097", "0.6755097", "0.6753193", "0.6735109", "0.6735109", "0.6735109", "0.6735109", "0.6735109", "0.6735109", "0.6735109", "0.6735109", "0.6735109", "0.6735109", "0.6735109", "0.6735109", "0.6735109", "0.6735109", "0.67317706", "0.67317706", "0.67317706", "0.67317706", "0.67317706", "0.67317706", "0.67317706", "0.67317706", "0.67317706", "0.6710577", "0.6709576", "0.6709576", "0.6709576", "0.6709576", "0.6709576", "0.6709576", "0.6709576", "0.6709576", "0.6709576", "0.6709576", "0.6709576", "0.6709576", "0.6709576", "0.6709576", "0.6709576", "0.6709576", "0.6709576", "0.6709576", "0.6709576", "0.6709576", "0.6709576", "0.6709576", "0.6709576", "0.6709576", "0.6709576", "0.6709576", "0.6709576", "0.6709576", "0.6709576", "0.6709576", "0.6709576", "0.6709576", "0.67036724", "0.67036724", "0.67036724", "0.67036724", "0.67036724", "0.67036724", "0.67036724", "0.67036724", "0.67036724", "0.67036724", "0.67036724", "0.67036724", "0.67036724", "0.67036724", "0.67036724", "0.67036724", "0.67036724", "0.67036724", "0.67036724", "0.67036724", "0.67036724", "0.67036724", "0.6703563", "0.6703563", "0.6703563", "0.66831917", "0.6681429", "0.6680074", "0.6673637", "0.66729873", "0.6667715", "0.6667715", "0.6667715", "0.66613716" ]
0.0
-1
Sorts a list using Bubble Sort. What Bubble Sort does is that for every pair of elements in the list, if the first is greater than the second, it swaps them. Since in every iteration the greatest element of the list ends up in the last position the outer loop shrinks the range of indexes that need to be checked by one each iteration.
public static <T extends Comparable<? super T>> void bubbleSort(List<T> list){ int size = list.size(); if(size > 1){ for(int i = size - 1; i >= 0; i--){ for(int j = 0; j < i; j++){ if(list.get(j).compareTo(list.get(j + 1)) > 0){ swap(list, j, j + 1); } } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void bubbleSort() {\n\t\tint n = data.size();\n\t\tfor (int i = 0; i < data.size(); i++) {\n\t\t\tfor (int j = 1; j < n - i; j++) {\n\t\t\t\tif (data.get(j - 1) > data.get(j)) {\n\t\t\t\t\tswap(j, j - 1);\n\t\t\t\t}\n\t\t\t}\n\n\t\t}\n\n\t}", "public void bubbleSort(ArrayList <Comparable> list){\r\n\t\tsteps += 2; //init, check condition\r\n\t\tfor (int i = list.size() - 1; i >= 0; i --){\r\n\t\t\tsteps += 2; //init, check condition\r\n\t\t\tfor (int j = 0; j < i ; j ++){\r\n\t\t\t\tsteps += 5;\r\n\t\t\t\tif (list.get(j).compareTo(list.get(j + 1)) < 0){\r\n\t\t\t\t\tsteps += 2;\r\n\t\t\t\t\tswap(list, j, j + 1);\r\n\t\t\t\t\tsteps += 5;\r\n\t\t\t\t}\r\n\t\t\t\tsteps += 2;\r\n\t\t\t}\r\n\t\t\tsteps += 2;\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"Bubble Sort\");\r\n\t\tSystem.out.println();\r\n\t}", "public void bubbleSort(ArrayList <Integer> list){\n System.out.println();\n System.out.println(\"Bubble Sort\");\n System.out.println();\n\n steps = 0;\n for (int outer = 0; outer < list.size() - 1; outer++){\n for (int inner = 0; inner < list.size()-outer-1; inner++){\n steps += 3;//count one compare and 2 gets\n if (list.get(inner)>(list.get(inner + 1))){\n steps += 4;//count 2 gets and 2 sets\n int temp = list.get(inner);\n list.set(inner,list.get(inner + 1));\n list.set(inner + 1,temp);\n }\n }\n }\n }", "public void bubbleSort(){\n for(int i = arraySize -1; i > 1; i--){\n for(int j = 0; j < i; j++){\n // Use < to change it to Descending order\n if(theArray[j] > theArray[j+1]){\n swapValues(j, j+1);\n printHorizontalArray(i, j);\n }\n printHorizontalArray(i, j);\n }\n }\n }", "public static void BubbleSort(int[] input) {\r\n for (int i = input.length - 1; i > 0; i--) {\r\n for (int j = 0; j < i; i++) {\r\n if (input[j] > input[j + 1]) {\r\n swap(input, j, j + 1);\r\n }\r\n }\r\n }\r\n }", "public static void bubbleSort(String [] list1)\r\n\t{\r\n\t\t\r\n\t String temp;\r\n\t int swap=1000;\r\n\t while(swap>0) \r\n\t {\r\n\t \tswap=0;\r\n\t \tfor(int outside=0; outside<list1.length-1; outside++)\r\n\t \t{\r\n\t \t\tif(list1[outside+1].compareTo(list1[outside])<0)\r\n\t \t\t{\r\n\t \t\t\tswap++;\r\n\t \t\t\ttemp=list1[outside];\r\n\t \t\t\tlist1[outside]=list1[outside+1];\r\n\t \t\t\tlist1[outside+1]=temp;\r\n\t \t\t}\r\n\t \t}\r\n\t }\r\n\t \r\n\t}", "public static void bubbleSortNumberList(long[] list) {\n /*make N passes through the list (N is length of the list) */\n for(int i=0;i<list.length-1;i++) {\n /* for index from 0 to N-1, compare item[index] to next item, swap if needed */\n for(int j=0; j<list.length-1-i;j++) {\n if(list[j]>list[j+1]){\n long tmp = list[j];\n list[j] = list[j+1];\n list[j+1] = tmp;\n }\n }\n }\n }", "public static void BubbleSort(int[] a) {\n\t int n = a.length;\n\t int temp = 0;\n\n\t for(int i = 0; i < n; i++) {\n\t for(int j=1; j < (n-i); j++) {\n\t if(a[j-1] > a[j]) {\n\t temp = a[j-1];\n\t a[j-1] = a[j];\n\t a[j] = temp;\n\t }\n\t }\n\t }\n\t}", "public static void bubbleSort(Array a) {\n int temp;\n for (int i = 0; i < a.length - 1; i++) { // for passes\n int flag = 0;\n for (int j = 0; j < a.length - 1 - i; j++) { // for iteration\n if (a.get(j) > a.get(j + 1)) {\n temp = a.get(j);\n a.set(j, a.get(j + 1));\n a.set(j + 1, temp);\n flag = 1;\n }\n }\n if (flag == 0) break; // if the list is already sorted\n }\n }", "public List<Integer> bubbleSort(List<Integer> list) {\n List<Integer> listCopy = new ArrayList<>(list);\n\n for (int i = 0; i < listCopy.size() - 1; i++) {\n boolean isSorted = true;\n for (int j = 0; j < listCopy.size() - 1 - i; j++) {\n if (listCopy.get(j) > listCopy.get(j + 1)) {\n Collections.swap(listCopy, j, j + 1);\n isSorted = false;\n }\n }\n\n if (isSorted) {\n break;\n }\n }\n\n return listCopy;\n }", "static void BubbleSort(int[] arr){\n for(int i = 0; i< arr.length-1;i++){\n int numberOfSwaps = 0;\n for(int j = 0; j<arr.length-i-1;j++){\n if(arr[j]>arr[j+1]){\n Swap(arr, j, j+1);\n numberOfSwaps++;\n }\n }\n if(numberOfSwaps == 0){\n break;\n }\n }\n }", "public void bubbleSort() {\n boolean unordered = false;\n do {\n unordered = false;\n for (int i = 0; i < array.length - 1; i++) {\n if (((Comparable) array[i]).compareTo(array[i + 1]) > 0) {\n T temp = array[i + 1];\n array[i + 1] = array[i];\n array[i] = temp;\n unordered = true;\n }\n }\n } while (unordered);\n }", "private void bubbleSort(T[] arr) {\n boolean swaps;\n for (int i = 0; i < n - 1; i++) { // since we always compare two elements, we will need to iterate up to (n - 1) times\n swaps = false;\n for (int j = 1; j < n - i; j++) // we reduce the inspected area by one element at each loop, because the largest element will already be pushed to the right\n if (arr[j].compareTo(arr[j - 1]) < 0) {\n swap(arr, j, j - 1); // the swap method is implemented further\n swaps = true;\n }\n if (!swaps) break; // we stop if there were no swaps during the last iteration\n }\n }", "public static void bubbleSortAlgo(int[] arr) {\n for(int i = 1; i<arr.length-1; i++){\n // inner loop to compare each element with it's next one in every iteration in one complete outer loop\n for(int j = 0; j<arr.length -1; j++){\n if(isSmaller(arr, j+1, j)){ // compares the jth element from it's next element\n swap(arr, j+1, j); // if ismaller condition is true swaps both the elements\n }\n }\n }\n \n }", "public void bubbleSort(long [] a){\n\t\tint upperBound=a.length-1;\n\t\tint lowerBound =0;\n\t\tint swaps=0;\n\t\tint iterations=0;\n\t\twhile(upperBound>=lowerBound){\n\t\t\tfor(int i=0,j=1;i<=upperBound && j<=upperBound; j++,i++){\n\t\t\t\tlong lowerOrderElement = a[i];\n\t\t\t\tlong upperOrderElement = a[j];\n\t\t\t\titerations++;\n\t\t\t\tif(lowerOrderElement>upperOrderElement){ //swap positions\n\t\t\t\t\ta[i] = a[j];\n\t\t\t\t\ta[j]= lowerOrderElement;\n\t\t\t\t\tswaps=swaps+1;\n\t\t\t\t}\n\t\t\t\telse{ // sorted.\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tupperBound--;\n//\t\tSystem.out.println(\"upperBound:- \" +upperBound);\n//\t\tSystem.out.println(\"lowerBound:- \" +lowerBound);\n\t\t}displayArr(a);\n\t\t\n\t\tSystem.out.println(\"Total Swaps:- \" + swaps);\n\t\tSystem.out.println(\"Total Iterations:- \" + iterations);\n\t}", "public ListUtilities bubbleSort(){\n\t\tboolean swaps = true;\t\t\n\t\t\n\t\twhile(swaps == true){\n\t\t\t//no swaps to begin with\n\t\t\tswaps = false;\n\n\t\t\t//if not end of list\n\t\t\tif (this.nextNum != null){\n\t\t\t\tListUtilities temp = new ListUtilities();\n\t\t\t\t//make temp point to 2\n\t\t\t\ttemp = this.nextNum;\n\t\t\t\t//if 1 is greater than 2\n\t\t\t\tif(this.num > this.nextNum.num){\n\t\t\t\t\t//it swapped\n\t\t\t\t\tswaps = true;\n\t\t\t\t\tswapF(temp);\n\t\t\t\t}\n\n\t\t\t//keep going until you hit end of list\n\t\t\ttemp.bubbleSort();\n\t\t\t} \n\n\t\t\t//if at end of list and swaps were made, return to beginning and try again\n\t\t\tif (this.nextNum == null && swaps == true){\n\n\t\t\t\tthis.returnToStart().bubbleSort();\n\t\t\t}\n\t\t}\n\t//return beginning of list\n\treturn this.returnToStart();\n\t}", "void bubblesort(int arr[],int n)\n {\n for(int i=0;i<n;i++)\n {\n for(int j=0;j<n-1;j++) //after its 1st iteration we have our maximum value sorted\n {\n if(arr[j]>arr[j+1]) // if value at present index is > the next index value then its swap the value \n {\n int temp=arr[j];\n arr[j]=arr[j+1];\n arr[j+1]=temp;\n }\n }\n }\n }", "public void setBubbleSort() \n\t{\n\t\tint last = recordCount + NOT_FOUND; //array.length() - 1\n\n\t\twhile(last > RESET_VALUE) //last > 0\n\t\t{\n\t\t\tint localIndex = RESET_VALUE; \n\t\t\tboolean swap = false;\n\n\t\t\twhile(localIndex < last) \n\t\t\t{\n\t\t\t\tif(itemIDs[localIndex] > itemIDs[localIndex + 1]) \n\t\t\t\t{\n\t\t\t\t\tsetSwapArrayElements(localIndex);\n\t\t\t\t\tswap = true;\n\t\t\t\t}\n\t\t\t\tlocalIndex++;\n\t\t\t}\n\n\t\t\tif(swap == false) \n\t\t\t{\n\t\t\t\tlast = RESET_VALUE;\n\t\t\t}\n\t\t\telse \n\t\t\t{\n\t\t\t\tlast = last + NOT_FOUND;\n\t\t\t}\n\n\t\t}//END while(last > RESET_VALUE)\n\t\treturn;\n\t}", "public void sort() {\n ListNode start = head;\n ListNode position1;\n ListNode position2;\n\n // Going through each element of the array from the second element to the end\n while (start.next != null) {\n start = start.next;\n position1 = start;\n position2 = position1.previous;\n // Checks if previous is null and keeps swapping elements backwards till there\n // is an element that is bigger than the original element\n while (position2 != null && (position1.data < position2.data)) {\n swap(position1, position2);\n numberComparisons++;\n position1 = position2;\n position2 = position1.previous;\n }\n }\n }", "static int[] Bubble_sort(int[] input) {\n\t\t//int n=input.length;\t\t\t\t\t//length of the array\n\t\tfor(int i=0;i<input.length;i++)\n\t\t{\t\t\t\t\t\t\t\t\n\t\t\tint pos=0;\t\t\t//setting the first element as the Max element\n\t\t\tint max=input[pos];\n\t\t\tfor(int j=0;j<input.length-i;j++)\n\t\t\t{\t\t\t\t\t//traversing the array to find the max element\n\t\t\t\tif(input[j]>max)\n\t\t\t\t{\n\t\t\t\t\tpos=j;\n\t\t\t\t\tmax=input[pos];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\t\t//swapping the Max element with input.length-i-1 position\n\t\t\tinput[pos]=input[input.length-i-1];\n\t\t\tinput[input.length-i-1]=max;\n\t\t}\n\t\treturn input;\n\t}", "public void bubbleSort(int start, int stop) {\n\t\tfor (int n = stop; n > start + 1; n--) {\n\t\t\tfor (int i = start; i < n; i++) {\n\t\t\t\taddComparison();\n\t\t\t\tif (sequence[i] > sequence[i + 1]) {\n\t\t\t\t\tswapAt(i, i + 1);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void myBubbleSort(int array[]) {\n for (int i = 0; i < array.length - 1; i++) {\n //Iterate through the array to the index to the left of i\n for (int j = 0; j < array.length - i - 1; j++) {\n //Check if the value of the index on the left is less than the index on the right\n if (array[j] > array[j + 1]) {\n //If so, swap them.\n int temp = array[j];\n array[j] = array[j + 1];\n array[j + 1] = temp;\n\n }\n }\n }\n }", "public static void bubbleSort(IntList l) {\n\t\tif (l.getFirst() == null)\n\t\t\treturn;\n\t\tl1: while (true) {\n\t\t\tfor (\tIntListEntry e = l.getFirst().getNext();\n\t\t\t\t\te != null;\n\t\t\t\t\te = e.getNext()) {\n\t\t\t\tIntListEntry d = e.getPrevious();\n\t\t\t\tif (d.getItem() > e.getItem()) {\n\t\t\t\t\tl.delete(e);\n\t\t\t\t\tl.insertBefore(e, d);\n\t\t\t\t\tcontinue l1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}", "public static void bubbleSort(int[] arr)\n\t{\n\t\tint len=arr.length;\n\t\tboolean swapped=true;\n\t\twhile(swapped){\n\t\t\tswapped=false;\n\t\t\tfor(int j=1;j<len;j++){\n\t\t\t\tif(arr[j-1]>arr[j]){\n\t\t\t\t\tint temp=arr[j-1];\n\t\t\t\t\tarr[j-1]=arr[j];\n\t\t\t\t\tarr[j]=temp;\n\t\t\t\t\tswapped=true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static void sortBubble(int[] tab) {\n boolean alreadySorted=false;\n int temp;\n int n=tab.length;\n int i=0;\n if(tab.length!=0){\n while (i<n-1 && !alreadySorted){\n alreadySorted=true;\n for (int j=0; j<n-1-i;j++){\n if (tab[j]>tab[j+1]){\n alreadySorted=false;\n temp=tab[j];\n tab[j]=tab[j+1];\n tab[j+1]=temp;\n }\n }\n i=i+1;\n }\n }\n}", "public static void bubbleSort(int[] arr){\n\n\t\tboolean swaps = true; //setting boolean swaps to true \n\t\tint l = arr.length; //varibale to hold the length of the array \n\n\t\twhile (swaps == true) { //goes through while swaps is true \n\n\t\t\tswaps = false; //setting swaps to false \n\n\t\t\tfor(int i = 0; i < l-1; i++) { //iterates through the length of the array \n\t\t\t\t\n\t\t\t\tif (arr[i + 1] < arr[i]) { //if the element on the right is less than the one on the left (54321)\n\n\n\t\t\t\t\tint temp = arr[i]; //holds the value of element at that index position \n\t\t\t\t\tarr[i] = arr[i+1]; //swaps the elments over \n\t\t\t\t\tarr[i+1] = temp; //moves onto the next element \n\n\t\t\t\t\tswaps = true; //as n-1, moves back and repeats to do the last element \n\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t}", "void sort (int [] items) {\r\n\tint length = items.length;\r\n\tfor (int gap=length/2; gap>0; gap/=2) {\r\n\t\tfor (int i=gap; i<length; i++) {\r\n\t\t\tfor (int j=i-gap; j>=0; j-=gap) {\r\n\t\t \t\tif (items [j] <= items [j + gap]) {\r\n\t\t\t\t\tint swap = items [j];\r\n\t\t\t\t\titems [j] = items [j + gap];\r\n\t\t\t\t\titems [j + gap] = swap;\r\n\t\t \t\t}\r\n\t \t}\r\n\t }\r\n\t}\r\n}", "void bubbleSort(int arr[]) {\r\n\r\n int n = arr.length;\r\n boolean swapped;\r\n for(int i = 0; i < n-1; i++) { //denotes pass #\r\n for(int j = 0; j < n-i-1; j++) { //denotes element in the pass\r\n if(arr[j] > arr[j+1]) {\r\n //swapping of the element\r\n arr[j] += arr[j+1];\r\n arr[j+1] = arr[j] - arr[j+1];\r\n arr[j] -= arr[j+1];\r\n swapped = true;\r\n\r\n } //end of if block\r\n }//end of element checking loop\r\n //if no 2 elements were swapped by inner loop, then break\r\n if (swapped == false)\r\n break;\r\n }//end of pass loop\r\n }", "static void bubbleSort(int[] arr) {\n\t\tboolean swapped; //using swapped for optimization, inner loop will continue only if swapping is possible\n\t\tfor(int i=0;i<arr.length-1;i++) {\n\t\t\tswapped =false;\n\t\t\tfor(int j =0;j<arr.length-i-1;j++) {\n\t\t\t\tif(arr[j]>arr[j+1]) {\n\t\t\t\t\tint temp = arr[j+1]; \n\t\t arr[j+1] = arr[j]; \n\t\t arr[j] = temp;\n\t\t swapped = true;\n\t\t\t\t}\n\t\t\t\t// IF no two elements were \n\t // swapped by inner loop, then break \n\t\t\t\t if (swapped == false) \n\t\t break;\n\t\t\t}\n\t\t}\n\t\tfor(int a:arr) \n\t\t{ \n\t\t\tSystem.out.print(a+ \" \");\n\t\t}\n\t\tSystem.out.println();\n\t\t\n\t}", "public static void sort(ArrayList<Integer> list) {\n\t\tint temp;\n\t\tfor (int i=0; i < list.size() ; i++) {\n\t\t\tfor (int j=i+1;j<list.size()-1;j++){\n\t\t\t\tif(list.get(i)>list.get(j)){\n\t\t\t\t\ttemp = list.get(i);\n\t\t\t\t\tlist.set(i,list.get(j));\n\t\t\t\t\tlist.set(j, temp);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void bubbleSort() {\r\n\r\n int n = leaderboardScores.size();\r\n int intChange;\r\n String stringChange;\r\n\r\n for (int i = 0 ; i < n - 1 ; i ++ ) {\r\n for (int j = 0 ; j < n - i - 1 ; j ++ ) {\r\n\r\n if (leaderboardScores.get(j) > leaderboardScores.get(j + 1)) {\r\n // swap arr[j+1] and arr[i]\r\n intChange = leaderboardScores.get(j);\r\n leaderboardScores.set(j, leaderboardScores.get(j + 1));\r\n leaderboardScores.set(j + 1, intChange);\r\n\r\n stringChange = leaderboardUsers.get(j);\r\n leaderboardUsers.set(j, leaderboardUsers.get(j + 1));\r\n leaderboardUsers.set(j + 1, stringChange);\r\n }\r\n\r\n }\r\n }\r\n }", "public static void bubbleSort() {\r\n\t\tfor(int i = nodeArrList.size() -1; i > 0; i--) {\r\n\t\t\tfor(int j = 0; j < i; j++) {\r\n\t\t\t\tif(nodeArrList.get(j).frequency > nodeArrList.get(j +1).frequency) {\r\n\t\t\t\t\tHuffmanNode temp = nodeArrList.get(j);\r\n\t\t\t\t\tnodeArrList.set(j, nodeArrList.get(j + 1));\r\n\t\t\t\t\tnodeArrList.set(j + 1, temp);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "static int[] bubbleSort(int[] a) {\n int n = a.length;\n while(n > 0) {\n int newLastN = 0; // if no swap occurred in last step we won't need to run next iteration\n for (int i = 1; i < n; i++) {\n comparisonCount++;\n if (a[i - 1] > a[i]) {\n swapCount++;\n swap(a, i - 1, i);\n newLastN = i;\n }\n }\n n = newLastN;\n }\n return a;\n }", "void BubbleSortforLinkedList() {\n\t\tif (isEmpty() || head.next == null) return;\n\t\tNode curr = head;\n\t\tBoolean change = true;\n\t\twhile (change) {\n\t\t\tchange = false;\n\t\t\twhile (curr != null) {\n\t\t\t\tif (curr.next.data < curr.data) {\n\t\t\t\t\tint temp = curr.data;\n\t\t\t\t\tcurr.data = curr.next.data;\n\t\t\t\t\tcurr.next.data = temp;\n\t\t\t\t\tchange = true;\n\t\t\t\t}\n\t\t\tcurr = curr.next;\n\t\t\t} \n\t\t}\n\t}", "public void bubbleSort() {\n \tfor (int i = 0; i < contarElementos()-1; i++) {\n\t\t\tboolean intercambiado= false;\n\t\t\tfor (int j = 0; j < contarElementos()-1; j++) {\n\t\t\t\tif (encontrarNodoEnElndice(j).getElemento().compareTo(encontrarNodoEnElndice(j+1).getElemento())>0) {\n\t\t\t\t\tintercambiar(j, j+1);\n\t\t\t\t\tintercambiado=true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!intercambiado) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n }", "public static List<Integer> bubbleSort(List<Integer> lista) {\r\n int aux = 0;\r\n for (Integer lista1 : lista) {\r\n for (int j = 0; j < lista.size() - 1; j++) {\r\n if (lista.get(j) > lista.get(j + 1)) {\r\n aux = lista.get(j);\r\n lista.set(j, lista.get(j + 1));\r\n lista.set(j + 1, aux);\r\n }\r\n }\r\n }\r\n return lista;\r\n }", "private static void BubbleIter(int[] arr) {\n\t\t\n\t\tint size = arr.length;\n\t for (int i=1; i<size; ++i) {\n\t for (int j=0; j<size-i; ++j) {\n\t \t// Sorts the array arr[first] through arr[last] iteratively.\n\t \t// Last index changes by i pass\n\t if (arr[j]>arr[j+1]) swap(arr, j);\n\t }\n\t }\n\t}", "private Integer[] bubbleSortList() {\n\t\tInteger[] localList = new Integer[intList.size()];\n\t\tlocalList = intList.toArray(localList);\n\n\t\tint temp;\n\t\tfor (int i = 5; i >= 0; i--) {\n\t\t\tfor (int j = 0; j < 4; j++) {\n\t\t\t\tif (localList[j] > localList[j + 1]) {\n\t\t\t\t\ttemp = localList[j];\n\t\t\t\t\tlocalList[j] = localList[j + 1];\n\t\t\t\t\tlocalList[j + 1] = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn localList;\n\t}", "public void bubbleSort(int[] array){\n int last = array.length;\r\n // boolean to flag a swap\r\n boolean swap = true;\r\n // continue if a swap has been made\r\n while(swap){\r\n // assume no swaps will be done\r\n swap = false;\r\n // look for swaps\r\n for(int i = 0; i < last - 1; i++){\r\n // find a bigger value?\r\n if(array[i] > array[i+1]){\r\n // swap\r\n swap(array, i, i+1);\r\n // set flag to true\r\n swap = true;\r\n }\r\n }\r\n // move the last position tracker\r\n last--;\r\n }\r\n }", "public static void bubbleSort(int [] arr){\n int temp = 0; //temporary variable\n boolean flag = false; //mark if any reversion has happened\n for (int i = 0; i < arr.length - 1;i++){\n\n for (int j = 0; j < arr.length - 1-i; j++) {\n //if the previous number is bigger than the latter, reverse\n if (arr[j] > arr[j + 1]) {\n flag = true;\n temp = arr[j];\n arr[j] = arr[j + 1];\n arr[j + 1] = temp;\n }\n }\n\n //System.out.printf(\"After the %d round of sorting\",i+1);\n //System.out.println(Arrays.toString(arr));\n\n if(!flag){\n break;\n } else {\n flag = false;\n //reset flag to true to do the next check\n }\n }\n }", "public static void main(String[] args) {\n int list[] = {8,7,6,5,1};\n \t//System.out.println(\"the list number is \" + list[0]);\n int temp;\n for(int j = list.length; j>= 0; j --){\n \tfor (int i = 0; i < j - 1; i ++){\n \t\tif( list[i] > list[i + 1]){\n \t\t\ttemp = list[i + 1];\n \t\t\tlist[i + 1] = list [i];\n \t\t\tlist [i] = temp;\n\n \t}\n\n\n \t//\n }\n\n \t}\t\n \t \t\tfor(int x = 0; x < list.length; x ++){\n\t\t\tSystem.out.println(list[x]);\n\t\t}\n }", "public static void main(String[] args) {\n\t\t\n\t\tint[] myArray = {6,3,9,4,7,5,8,2,1,10};\n\t\t\n\t\t// change the outer loop LCV so that we are making one fewer pass\n\t\tfor(int i = myArray.length - 2; i > 0; i--) {\n\t\t\t\n\t\t\tboolean swapOccurred = false;\n\t\t\t\n\t\t\tfor(int j = 0; j < i; j++) {\n\t\t\t\t// Compare current element to next highest\n\t\t\t\n\t\t\t\t// if the second element is greater than the first\n\t\t\t\tif(myArray[j] > myArray[j + 1]) {\n\t\t\t\t\n\t\t\t\t\t// swap\n\t\t\t\t\tswapOccurred = true;\n\t\t\t\t\t\n\t\t\t\t\t// (hold onto the element so we don't lose it!)\n\t\t\t\t\tint temp = myArray[j + 1];\n\t\t\t\t\t// assign lower element:\n\t\t\t\t\tmyArray[j + 1] = myArray[j];\t// at this point, both array elements hold the same value\n\t\t\t\t\t// assign higher element:\n\t\t\t\t\tmyArray[j] = temp;\n\t\t\t\t}\t\n\t\t\t\t\n\t\t\t}// inner loop ends\t\t\n\t\t\t\n\t\t\t// if swap occurred, break:\n\t\t\tif(!swapOccurred) {\t// or \n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tprintArray(myArray);\n\t\t\t\n\t\t}// outer loop ends\t\n\t\t\n\t}", "public static void bubbleSort(int[] arr){\r\n \tfor(int i = 0; i< arr.length - 1;i++)\r\n \t{\r\n \t\tfor(int j = 0; j< arr.length - 1; j++)\r\n \t\t{\r\n \t\t\tif(arr[j] > arr[j + 1])\r\n \t\t\t{\r\n \t\t\t\tint temp = arr[j];\r\n \t\t\t\tarr[j] = arr[j + 1];\r\n \t\t\t\tarr[j + 1] = temp;\r\n \t\t\t}\r\n \t\t}\r\n \t}\r\n }", "public void sortIncreasing()\n {\n int min;\n \n for (int i = 0; i < list.length - 1; i++)\n {\n min = i; \n for(int j = i+1; j < list.length; j++)\n {\n if(list[j] < list[min])\n min = j; \n }\n if(i != min && list[min] < list.length)\n {\n int temp = list[min];\n list[min] = list[i];\n list[i] = temp; \n }\n }\n }", "public static int[] bubbleSort(int[] values) {\n int temp;\n boolean nextPass = true;\n \n for (int i = 1; i < values.length && nextPass; i++) { // terminate loop if at end of array or a new pass is not needed\n nextPass = false;\n for (int j = 0; j < values.length - i; j++) {\n if (values[j] > values[j + 1]) { // current value greater than the next? swap values\n temp = values[j];\n values[j] = values[j + 1];\n values[j + 1] = temp;\n nextPass = true; \n }\n }\n }\n \n return values;\n }", "public void bubbleSort(int [] array) {\n\t\t\n\t\tfor(int i=0; i<array.length - 1; i++) {\n\t\t\t\n\t\t\tfor(int j=0; j<array.length-i-1; j++) {\n\t\t\t\t\n\t\t\t\tif(array[j]>array[j+1]) {\n\t\t\t\t\t\n\t\t\t\t\tint temp = array[j];\n\t\t\t\t\tarray[j] = array[j+1];\n\t\t\t\t\tarray[j+1] = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(Arrays.toString(array));\n\t\t}\n\t}", "private static void BubbleIterMod(int[] arr) {\n\t\t\n\t\tboolean pass = true;\n\t while (pass) {\n\t pass = false; //assume this is last pass over array\n\t for (int j=0; j<arr.length-1; ++j) {\n\t if (arr[j] > arr[j+1]) { \n\t \tswap(arr, j);\n\t \tpass = true; //after an exchange, must look again\n\t }\n\t }\n\t }\n\t}", "public static void bubbleSort(int[] array) {\n boolean swapped = true;\n for (int i = 0; i < array.length && swapped != false; i++) {\n swapped = false;\n for (int j = 1; j < (array.length - i); j++) {\n if (array[j - 1] > array[j]) {\n swap(array, j, j - 1);\n swapped = true;\n }\n }\n }\n }", "private static Integer[] optimisedBubbleSort(Integer[] n) {\n int len = n.length - 1;\n boolean swapped = false;\n for (int i = 0; i < len; i++) {\n for (int j = 0; j < len - i; j++) {\n if (n[j] > n[j + 1]) {\n int temp = n[j];\n n[j] = n[j + 1];\n n[j + 1] = temp;\n swapped = true;\n }\n }\n if(swapped == false) {\n break;\n }\n }\n return n;\n }", "public static void bubbleSort(int[] a) {\n\t\tboolean loop;\n\t\tdo {\n\t\t\tloop = false;\n\t\t\tfor (int i = 0; i < a.length - 1; i ++) {\n\t\t\t\tif (a[i] > a[i + 1]) {\n\t\t\t\t\tint temp = a[i];\n\t\t\t\t\ta[i] = a[i + 1];\n\t\t\t\t\ta[i + 1] = temp;\n\t\t\t\t\tloop = true;\n\t\t\t\t}\n\t\t\t}\n\t\t} while (loop);\n\t}", "public static void bubbleSort(int[] arr) {\r\n for (int i = 0; i < arr.length; i++) {\r\n boolean swapped = false;\r\n for (int j = 1; j < arr.length - i; j++) {\r\n if (arr[j] < arr[j - 1]) {\r\n swap(arr, j, j - 1);\r\n swapped = true;\r\n }\r\n }\r\n if (!swapped) {\r\n break;\r\n }\r\n }\r\n }", "public static void bubbleSort(int[] a) {\r\n boolean swapped; // keeps track of when array values are swapped \r\n int i; // a loop counter\r\n int temp; // catalyst variable for String swapping\r\n\r\n // Each iteration of the outer do loop is is one pass through the loop. \r\n // If anything was swapped, it makes another pass\r\n do {\r\n // set swapped to false before each pass\r\n swapped = false;\r\n\r\n // the for loop is a pass through the array to the second to last element\r\n for (i = 0; (i < a.length - 1); i++) {\r\n // if the two items are out of order see page 16 for String compareTo() \r\n if (a[i + 1] < (a[i])) {\r\n // swap the two items and set swapped to true \r\n temp = a[i];//catalyst variable assignment to item\r\n a[i] = a[i + 1];//copy second item to first item slot\r\n a[i + 1] = temp;//copy catalyst variable to second slot\r\n\r\n swapped = true; //something was swapped!\r\n\r\n } // end if\r\n } // end for\r\n\r\n // the outer loop will repeat if a swap was made – another passs\r\n } while (swapped);\r\n\r\n }", "public void sort(List<Integer> listToSort){\n\t\t\n\t\t//loop through all list value\n\t\tfor (int i = 0; i < listToSort.size() - 1; i++) {\n\t\t\tint index = i;//store value position to be swapped if required\n\t\t\t\n\t\t\t//loop through all list values looking for one that is lower than that of position index\n\t\t\tfor (int j = i + 1; j < listToSort.size(); j++) {\n\t\t\t\tif (listToSort.get(j) < listToSort.get(index)) {\n\t\t\t\t\tindex = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//swap values at position index and i if required\n\t\t\tif (index != i) {\n\t\t\t\tint temp = listToSort.get(index); \n\t\t\t\tlistToSort.set(index, listToSort.get(i));\n\t\t\t\tlistToSort.set(i, temp);\t\t\t\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\n int numbers[] = new int[]{32,43,53,54,32,65,63,98,43,23};\n for(int i=0; i< numbers.length-1; i++)\n {\n for (int j=0;j<numbers.length-1-i;j++)\n if(numbers[j] > numbers[j+1])\n {\n int temp=numbers[j];\n numbers[j]=numbers[j+1];\n numbers[j+1]=temp;\n }\n }\n for (int i=0;i<numbers.length-1;i++)\n {\n System.out.print(numbers[i]+\" \");\n }\n System.out.println(numbers[numbers.length-1]);\n }", "public static int[] bubble(int[] arr)\n {\n int l=arr.length;\n\n for (int i = 0; i <l-1; i++)\n {\n for (int j=0; j<l-1-i; j++)\n {\n if (arr[j] > arr[j + 1])\n {\n swap(j, j+ 1, arr);\n }\n }\n }\n return arr;\n }", "public static int[] BubbleSort(int[] array){\n int j;\n int temp;\n boolean flag=false;\n while ( flag )\n {\n flag= false;\n for( j=0;j<array.length-1;j++ )\n {\n if ( array[j] < array[j+1] )\n {\n temp = array[j];\n array[j] = array[j+1];\n array[j+1] = temp;\n flag = true;\n }\n }\n }\n return array;\n }", "public void recursiveBubbleSort(int[] numbers) {\n boolean sorted = false;\n int posA;\n int posB;\n\n for(int i = 0; i < numbers.length - 1; i++) {\n if(numbers[i] > numbers[i + 1] && numbers[i] != numbers.length) {\n posA = numbers[i];\n posB = numbers[i + 1];\n numbers[i] = posB;\n numbers[i + 1] = posA;\n sorted = true;\n }\n }\n if (sorted) {\n recursiveBubbleSort(numbers);\n }\n }", "public void wiggleSort(int[] nums) {\n\n // At position 0 we need a[0] < a[1] and in position 1 we need a[1] > a[2]\n for(int i=0; i < nums.length-1; i++) {\n boolean isEven = i%2==0;\n if(isEven) {\n if(nums[i] > nums[i+1]) { // a[0] should less than a[1]\n ArrayUtils.swap(nums,i,i+1);\n }\n } else {\n if(nums[i] < nums[i+1]) { // a[1] should greater than a[2]\n ArrayUtils.swap(nums,i,i+1);\n }\n }\n }\n }", "public static void getBubbleSort(int range) {\n\n Integer[] number = GetRandomArray.getIntegerArray(range);\n\n //main cursor to run across array\n int pivot_main = 0;\n\n //secondary cursor to run of each index of array\n int pivot_check = 0;\n\n //variable to hold current check number\n int check_num = 0;\n\n //run loop for array length time\n for (int i = number.length; i > 0; i--) {\n\n //set cursor to first number\n pivot_main = number[0];\n\n //loop size decreases with main loop (i - 1234 | j - 4321)\n for (int j = 0; j < i - 1; j++) {\n\n //set cursor to next number in loop\n pivot_check = j + 1;\n\n //get number at above cursor\n check_num = number[j + 1];\n\n //check if number at current cursor is less than number at main cursor\n if (check_num < pivot_main) {\n //swap there position\n number[pivot_check] = pivot_main;\n number[j] = check_num;\n }\n\n //check if number at current cursor is greater than number at main cursor\n if (check_num > pivot_main) {\n //transfer current number to main cursor\n pivot_main = check_num;\n }\n }\n System.out.println(Arrays.toString(number));\n }\n }", "private static <E extends Comparable<? super E>> List<E > bubbleSort(List<E > comparable) {\n\t boolean changed = false;\n\t do {\n\t changed = false;\n\t for (int a = 0; a < comparable.size() - 1; a++) {\n\t if (comparable.get(a).compareTo(comparable.get(a + 1)) > 0) {\n\t E tmp = comparable.get(a);\n\t comparable.set(a, comparable.get(a + 1));\n\t comparable.set(a + 1, tmp);\n\t changed = true;\n\t }\n\t }\n\t } while (changed);\n\t \n\t\treturn comparable;\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tint [] arr= {3,43,2,320,143,4};\n\t\t\n\t\tint temp=0;\n\t\tint lenth=arr.length;\n\t\t\n\t\tfor(int i=0;i<lenth;i++) {\n\t\t\t\n\t\t\tfor(int j=1;j<(lenth-i);j++)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif(arr[j-1]>arr[j]) {\n\t\t\t\t\ttemp=arr[j-1];\n\t\t\t\t\tarr[j-1]=arr[j];\n\t\t\t\t\t\t\tarr[j]=temp;\n\t\t\t\t\tSystem.out.println(arr[j]);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t\t\t\n\t\t\n\n\t}", "@Test\n public void testBubbleSort() {\n BubbleSort<Integer> testing = new BubbleSort<>();\n\n testing.sort(array, new Comparator<Integer>() {\n @Override\n public int compare(Integer i1, Integer i2) {\n return i1.compareTo(i2);\n }\n });\n\n checkArray(\"Bubble sort doesn't work!\", array);\n }", "private static void sort(long[] list) {\n\t\tint start = 0, limit = list.length;\n\t\t\n\t\tlong temp;\n\t\tint current;\n\t\tint lowestindex;\n\n\t\twhile (start < limit) {\n\t\t\tlowestindex = start;\n\t\t\tfor (current = start; current < limit; current++)\n\t\t\t\tif (list[current] < list[lowestindex])\n\t\t\t\t\tlowestindex = current;\n\t\t\t//swap\n\t\t\ttemp = list[start];\n\t\t\tlist[start] = list[lowestindex];\n\t\t\tlist[lowestindex] = temp;\n\t\t\tstart++;\n\t\t}\n\t}", "static void bubbleSort(int arr[], int n)\n {\n int i, j, temp;\n boolean swapped;\n for (i = 0; i < n - 1; i++)\n {\n swapped = false;\n for (j = 0; j < n - i - 1; j++)\n {\n if (arr[j] > arr[j + 1])\n {\n System.out.println(\"\\nSwapped \" + arr[j] + \" with \" + arr[j + 1]);\n // swap arr[j] and arr[j+1]\n temp = arr[j];\n arr[j] = arr[j + 1];\n arr[j + 1] = temp;\n swapped = true;\n printArray(arr, arr.length);\n }\n }\n\n // IF no two elements were\n // swapped by inner loop, then break\n if (swapped == false)\n break;\n }\n }", "private void bInsertionSort(int lowerIndex, int higherIndex) {\n \t\tArrayList tmpsorted = new ArrayList();\n \t\tint tmp, lowerbound, upperbound;\n \t\t\n \t\tfor(int i = lowerIndex; i <= higherIndex; i++) {\n \t\t\ttmp = (int) unsorted.get(i);\n \t\t\tif(tmpsorted.isEmpty()) {\n \t\t\t\ttmpsorted.add(tmp);\n \t\t\t} else {\n \t\t\t\t\n \t\t\t\t//Every new number we want to insert needs\n \t\t\t\t//to reset the bounds according to the sorted list.\n \t\t\t\tupperbound = tmpsorted.size() - 1;\n \t\t\t\tlowerbound = 0;\n \t\t\t\t\n \t\t\t\twhile (unsorted.size() != 0){\n \t\t\t\t//Note that each \"break;\" throws us out of the while loop.\n \t\t\t\t//Causing our boundaries to be reset for the new number\n \t\t\t\t\t\n \t\t\t\t\tint j = (upperbound + lowerbound) / 2;\t//j points to the middle of the boundaries\n \t\t\t\t\tif (tmp <= (int)tmpsorted.get(j)){\t//is tmp less or equal to the number in j?\n \t\t\t\t\t\t\t\t\t\t\t\t\n \t\t\t\t\t\tif (j == 0){\t\t\t\t\t\t//Are we at the bottom of the list?\n \t\t\t\t\t\t\ttmpsorted.add(0, tmp);\t\t//Add it to the bottom of the list.\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t}\n \t\t\t\t\t\t\n \t\t\t\t\t\telse if ((int)tmpsorted.get(j-1) > tmp){ \n \t\t\t\t\t\t//Else if the number behind j is bigger than tmp...\n \t\t\t\t\t\t//...we can move the upper bound behind j and repeat the split.\n \t\t\t\t\t\t//NOTE: We do NOT \"break;\" to get thrown out of the while loop.\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t\tupperbound = j - 1;\n \t\t\t\t\t\t}\n \t\t\t\t\t\t\n \t\t\t\t\t\telse{ //Else we just add the number to j\n \t\t\t\t\t\t\ttmpsorted.add(j, tmp);\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\telse{ //If tmp is HIGHER than j\n \t\t\t\t\t\tif (j == tmpsorted.size() - 1){\n \t\t\t\t\t\t//Are we at the end of the list?\n \t\t\t\t\t\t//Just add tmp at the end of the list.\t\n \t\t\t\t\t\t\ttmpsorted.add(j+1, tmp);\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t}\n \t\t\t\t\t\t\n \t\t\t\t\t\telse if((int)tmpsorted.get(j+1) < tmp){\n \t\t\t\t\t\t//if the next number to j is still less than tmp...\n \t\t\t\t\t\t//we raise the lowerbound past j and repeat the split\n \t\t\t\t\t\t//NOTE: We do NOT \"break;\" to get thrown out of the while loop.\n \t\t\t\t\t\t\tlowerbound = j + 1;\n \t\t\t\t\t\t}\n \t\t\t\t\t\t\n \t\t\t\t\t\telse{ \n \t\t\t\t\t\t//Else we can just add tmp after j since it's higher than j\n \t\t\t\t\t\t\ttmpsorted.add(j+1, tmp);\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t}\n \t\t\t\t\n \t\t\t}\n \t\t}\n \t\t// Replace the unsorted values with tmpsorted.\n \t\tint j = 0;\n \t\tfor(int i = lowerIndex; i <= higherIndex; i++) {\n \t\t\tunsorted.set(i, tmpsorted.get(j));\n \t\t\tj++;\n \t\t}\n\n \t}", "public static void main(String[] args) {\r\n\t\tint arr[] = {1,0,5,6,3,2,3,7,9,8,4};\r\n\t\tint temp;\r\n\t\t\r\n\t\tfor(int i = 0; i < 10; i ++) {\r\n\t\t\tfor(int j = 0; j < 10 - i; j ++) {\r\n\t\t\t\tif(arr[j] > arr[j+1]){\r\n\t\t\t\t\ttemp = arr[j+1];\r\n\t\t\t\t\tarr[j+1] = arr[j];\r\n\t\t\t\t\tarr[j] = temp;\r\n\t\t\t\t}\t\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int i = 0; i < 11; i ++) {\r\n\t\t\tSystem.out.println(arr[i]);\r\n\t\t}\r\n\t}", "public void sortScores(){\r\n // TODO: Use a single round of bubble sort to bubble the last entry\r\n // TODO: in the high scores up to the correct location.\r\n \tcount=0;\r\n \tfor(int i=Settings.numScores-1; i>0;i--){\r\n \t\tif(scores[i]>scores[i-1]){\r\n \t\t\tint tempS;\r\n \t\t\ttempS=scores[i];\r\n \t\t\tscores[i]=scores[i-1];\r\n \t\t\tscores[i-1]=tempS;\r\n \t\t\t\r\n \t\t\tString tempN;\r\n \t\t\ttempN=names[i];\r\n \t\t\tnames[i]=names[i-1];\r\n \t\t\tnames[i-1]=tempN;\r\n \t\t\tcount++;\r\n \t\t}\r\n \t}\r\n }", "public static void main(String[] args) {\n\r\n int temp;\r\n\r\n int[] someNums = {8, 1, 9, 5, 4, 6, 2};\r\n for (int a = 0; a < (someNums.length - 1); a++) {\r\n for (int b = 0; b < (someNums.length - 1); b++) {\r\n if (someNums[b] > someNums[b + 1]) {\r\n temp = someNums[b];\r\n someNums[b] = someNums[b + 1];\r\n someNums[b + 1] = temp;\r\n }\r\n }\r\n }\r\n for (int i = 0; i < (someNums.length - 1); i++) {\r\n System.out.println(someNums[i]);\r\n }\r\n }", "public void shellSort(){\n int increment = list.size() / 2;\n while (increment > 0) {\n for (int i = increment; i < list.size(); i++) {\n int j = i;\n int temp = list.get(i);\n while (j >= increment && list.get(j - increment) > temp) {\n list.set(j, list.get(j - increment));\n j = j - increment;\n }\n list.set(j, temp);\n }\n if (increment == 2) {\n increment = 1;\n } else {\n increment *= (5.0 / 11);\n }\n }\n }", "public void oldSort()\n\t{\n\t\tfor (int index = 0; index < arraySize; index++) {\n\t\t\tfor (int secondIndex = index + 1; secondIndex < arraySize; secondIndex++) {\n\t\t\t\tint temp = 0;\n\t\t\t\tif (array[index] > array[secondIndex]) {\n\t\t\t\t\ttemp = array[index];\n\t\t\t\t\tarray[index] = array[secondIndex];\n\t\t\t\t\tarray[secondIndex] = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public static void main(String[] args) {\n int[] intArray = {20, 35, -15, 7, 55, 1, -22};\n\n for (int lastUnsortedIndex = intArray.length - 1; lastUnsortedIndex > 0; lastUnsortedIndex--) {\n for (int i = 0; i < lastUnsortedIndex; i++) {\n if (intArray[i] > intArray[i + 1]) {\n swap(intArray, i, i + 1);\n }\n }\n }\n\n for (int i = 0; i < intArray.length; i ++) {\n System.out.println(intArray[i]);\n }\n }", "public static void main(String[] args) {\n \n int swap = 0;\n \n Scanner scan = new Scanner(System.in);\n System.out.print(\"Kaç elemanlı = \");\n int max = scan.nextInt();\n\n int[] toSortArray = new int[max];\n\n toSortArray[0] = 0;\n\n for (int i = 1; i < max; i++) {\n\n toSortArray[i] = (int) (Math.random() * 100);\n toSortArray[0]++; //holds the number of values in the array;\n\n int index = i;\n\n while (toSortArray[index / 2] < toSortArray[index] && (index / 2) != 0) {\n\n int temp = toSortArray[index / 2];\n toSortArray[index / 2] = toSortArray[index];\n toSortArray[index] = temp;\n index = index / 2;\n\n }\n\n\t\t\t//Hence the heap is created!\n }\n\n System.out.println(\"The array to be sorted is:\");\n\n for (int i = 0; i < max; i++) {\n\n System.out.print(\" | \" + toSortArray[i]);\n\n }\n\n System.out.println(\" | \");\n\n\t\t//Start\n\t\t//Let's Sort it out now!\n while (toSortArray[0] > 0) {\n\n int temp = toSortArray[1];\n toSortArray[1] = toSortArray[toSortArray[0]];\n toSortArray[toSortArray[0]] = temp;\n\n for (int i = 1; i < toSortArray[0]; i++) {\n\n int index = i;\n\n while (toSortArray[index / 2] < toSortArray[index] && (index / 2) != 0) {\n\n int temp1 = toSortArray[index / 2];\n toSortArray[index / 2] = toSortArray[index];\n toSortArray[index] = temp1;\n index = index / 2;\n swap = swap+1;\n\n }\n\n }\n\n toSortArray[0]--;\n\n }\n\n\t\t//End\n System.out.println(\"The sorted array is: \");\n\n for (int i = 0; i < max; i++) {\n\n System.out.print(\" | \" + toSortArray[i]);\n }\n\n System.out.println(\" | \");\n System.out.println(max + \" eleman için \"+ swap + \" adet eleman yerdeğiştirildi. \" );\n\n }", "public void nextPermutation2(int[] nums) {\n int i = nums.length - 2, j = nums.length - 1;\n\n // 1.Find first number (i) which breaks descending order\n for (; i >= 0 && nums[i] >= nums[i + 1]; i--);\n\n // 2.Exchange this number with the least number that's greater than this number.\n if (i >= 0) {\n while (nums[i] >= nums[j]) j--;\n swap(nums, i, j);\n }\n\n // 3.Reverse sort the numbers after the exchanged number\n i++;\n for (int k = nums.length - 1; i < k; i++, k--)\n swap(nums, i, k);\n }", "public static void sort(int[] mergeList) {\n for(int i = 0; i < mergeList.length - 1; i++) { //iterate through mergeList \n int min = mergeList[i];\n int minIndex = i;\n \n\n for(int j = i + 1; j < mergeList.length; j++) { //swap current list item with smaller value \n if(mergeList[j] < min) { \n min = mergeList[j]; \n minIndex = j; \n \n }\t\t\t\t\t\n }\n \n \n if(minIndex != i) { //swap original list with sorted list\n mergeList[minIndex] = mergeList[i];\n mergeList[i] = min;\n \n }\n }\n }", "@Test\n public void testReverseOrderSort() {\n BubbleSort<Integer> testing = new BubbleSort<>();\n\n testing.sort(array, new Comparator<Integer>() {\n @Override\n public int compare(Integer i1, Integer i2) {\n return i2.compareTo(i1);\n }\n });\n\n checkReverseOrder(\"Bubble sort doesn't work with other comparator!\", array);\n }", "private static void sortList(ArrayList<ArrayList<Integer>> list){\n for (int i = 0; i < list.size(); i++) {\n for (int j = list.size() - 1; j > i; j--) {\n if ( (getCustomerArrivalTime(list.get(i)) == getCustomerArrivalTime(list.get(j)) && getCustomerIndex(list.get(i)) > getCustomerIndex(list.get(j)))\n || getCustomerArrivalTime(list.get(i)) > getCustomerArrivalTime(list.get(j))) {\n\n ArrayList<Integer> tmp = list.get(i);\n list.set(i,list.get(j)) ;\n list.set(j,tmp);\n }\n }\n }\n }", "public void bubbleSort(ArrayList<Pokemon> p);", "public static <T extends Comparable<T>> void bubbleSort(T[] arrayToSort) {\n for(int i = 0; i < arrayToSort.length - 1; i++)\n for(int j = arrayToSort.length - 1; j > i + 1; j--)\n if(arrayToSort[j].compareTo(arrayToSort[j - 1]) < 0) {\n T value = arrayToSort[j];\n arrayToSort[j] = arrayToSort[j - 1];\n arrayToSort[j - 1] = value;\n }\n }", "public static void main(String[] args) {\n\n Random generator = new Random ();\n int[] List = new int[10];\n int swap ;\n\n //fill up Array\n for (int i = 0 ; i < 10 ; i++) {\n List[i]= generator.nextInt(1000) ;\n System.out.print(List[i] + \" \");\n }\n System.out.println();\n\n //Compare each number with remaining numbers\n int pointer = 0 ;\n while(pointer < 9) {\n for (pointer = 0 ; pointer < 9 ; pointer ++) {\n if ((List[pointer]) > (List[(pointer+1)])) {\n swap = List[pointer];\n List[pointer] = List[pointer + 1];\n List[pointer + 1] = swap;\n for (int i = 0 ; i < 10 ; i++) {\n System.out.print(List[i] + \" \");\n }\n System.out.println();\n break;\n }\n }\n }\n }", "void sort() {\n\t\tint n = array.length;\n\t\tint temp = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 1; j < (n - i); j++) {\n\t\t\t\tif (array[j - 1] > array[j]) { // if the first term is larger\n\t\t\t\t\t\t\t\t\t\t\t\t// than the last term, then the\n\t\t\t\t\t\t\t\t\t\t\t\t// temp holds the previous term\n\t\t\t\t\ttemp = array[j - 1];\n\t\t\t\t\tarray[j - 1] = array[j];// swaps places within the array\n\t\t\t\t\tarray[j] = temp;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\n // auxIntArr is found in AuxPkg.AuxFuncs\n int[] arr = auxIntArr.clone();\n\n System.out.println(\"BubbleSort:\");\n System.out.print(\"Before: \");\n printIntArr(arr);\n\n // Main loop where the index will grow smaller as the array gets sorted\n for( int lastUnsortedIdx = arr.length -1;\n lastUnsortedIdx > 0;\n lastUnsortedIdx--)\n {\n // Nested loop for bubbling highest values to the next sorted slot\n // in the main loop\n for(int idx = 0; idx < lastUnsortedIdx; idx++)\n {\n if(arr[idx] > arr[idx+1])\n {\n swap(arr, idx, idx+1);\n }\n }\n }\n\n System.out.print(\"After: \");\n printIntArr(arr);\n System.out.println();\n }", "private Boolean sortList()\n\t{\n\t\tBoolean listSorted = true;\n\n\t\t// Perform a bubble sort on the unsorted list\n\t\tfor(int i = 0; i < (listSize-1); i++) \n\t\t{\n\t\t\tif(sortedList[i] > sortedList[i+1]) {\n\t\t\t\tlistSorted = false;\n\t\t\t\tint swap = sortedList[i+1];\n\t\t\t\tsortedList[i+1] = sortedList[i];\n\t\t\t\tsortedList[i] = swap;\n\t\t\t}\n\t\t}\n\n\t\t// Return the state of our sort so the recursion can continue or cease\n\t\treturn listSorted;\n\t}", "public static int[] bubbleSort(int array[]) {\n \t\t// TODO S1 implements bubble sort\n\t\tfor (int i = 0; i < array.length; i++) {\n\t\t\tfor (int j = 0; j < array.length - i - 1; j++) {\n\t\t\t\tif (array[j] > array[j + 1]) {\n\t\t\t\t\tint smaller = array[j + 1];\n\t\t\t\t\tint larger = array[j];\n\t\t\t\t\tarray[j] = smaller;\n\t\t\t\t\tarray[j + 1] = larger;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n \t return array;\n \t}", "public static int[] bubleSort(int[] elements) {\n\t\tif (elements.length == 0 || elements.length == 1)\n\t\t\treturn elements;\n\t\t\n\t\tboolean swapped = true;\n\t\t\n\t\twhile (swapped) {\n\t\t\tswapped = false;\n\t\t\tfor (int i=0;i < elements.length-1;i++) {\n\t\t\t\tif (elements[i] > elements[i+1]) {\n\t\t\t\t\tint temp = elements[i];\n\t\t\t\t\telements[i] = elements[i+1];\n\t\t\t\t\telements[i+1] = temp;\n\t\t\t\t\tswapped = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn elements;\n\t}", "public void sort() {\n\n // Fill in the blank here.\n\tfor(int i = 0; i < size; i++){\n\t\tint currentLowest, cLIndex, temp;\n\t\tcurrentLowest = elements[i];\n\t\tcLIndex = i; \n\t\tfor(int c = i+1; c < size; c++){\n\t\t\tif(currentLowest > elements[c]){\n\t\t\t\tcurrentLowest = elements[c];\n\t\t\t\tcLIndex = c;\n\t\t\t} \n\t\t}\n\t\ttemp = elements[i];\n\t\telements[i] = elements[cLIndex];\n\t\telements[cLIndex] = temp;\n\t\t\n\t}\n System.out.println(\"Sorting...\");\n }", "static List<Integer> longestBouncyList(List<Integer> arr) {\n List<Integer> results = new ArrayList<>();\r\n results.add(arr.get(0));\r\n \r\n // If the 1 element is the lowest 2, add the first 2 elements \r\n List<Integer> test = new ArrayList<>();\r\n if (arr.get(0) < arr.get(1)) {\r\n test.add(arr.get(0));\r\n test.add(arr.get(1));\r\n }\r\n\r\n // Traverse the arr\r\n for (int i = 1; i < arr.size() - 1; i++) {\r\n\r\n if (((arr.get(i) > arr.get(i - 1)) && (arr.get(i) > arr.get(i + 1)))\r\n || ((arr.get(i) < arr.get(i - 1)) && (arr.get(i) < arr.get(i + 1)))) {\r\n\r\n if (test.isEmpty()) {\r\n test.add(arr.get(i - 1));\r\n test.add(arr.get(i));\r\n }\r\n\r\n test.add(arr.get(i + 1));\r\n\r\n if (i == arr.size() - 2) {\r\n results = compareList(test, results);\r\n }\r\n\r\n } else {\r\n\r\n results = compareList(test, results);\r\n \r\n test = new ArrayList<>();\r\n }\r\n\r\n }\r\n return results;\r\n }", "public void wiggleSort(int[] nums) {\n for (int i = 0; i < nums.length - 1; i++) {\n if ((i % 2 == 0 && nums[i] > nums[i + 1]) || (i % 2 == 1 && nums[i] < nums[i + 1])) swap(nums, i, i + 1);\n }\n }", "public static void bubbleSort(int[] src) {\n if (src == null || src.length <= 1) return;\n\n for (int i = 0; i < src.length; ++i) {\n boolean flag = false;\n for (int j = 0; j < src.length - i - 1; ++j) {\n if (src[j] > src[j + 1]) {\n Utils.swap(src, j, j + 1);\n flag = true;\n }\n }\n\n if (!flag) return;\n }\n }", "public static void bubbleSort(int arr[], int n)\n {\n for (int i = 0; i < n - 1; i++) { \n\t\t\tfor (int j = 0; j < n - i - 1; j++) { \n\t\t\t\tif (arr[j] > arr[j + 1]) { \n\t\t\t\t\tint temp = arr[j]; \n\t\t\t\t\tarr[j] = arr[j + 1]; \n\t\t\t\t\tarr[j + 1] = temp; \n\t\t\t\t} \n\t\t\t} \n\t\t} \n }", "public static void bubbleSort(String[] words) {\n \n for(int i=0; i< words.length-1; i++) {\n for(int j=i+1; j<words.length; j++) {\n if(words[j].compareTo(words[i]) < 0) {\n String s = words[j];\n words[j] = words[i];\n words[i] = s;\n }\n } \n }\n }", "public static <T extends Comparable<T>> void myBubbleSort(T[] arrayToSort) {\n boolean isNotSorted = true;\n while(isNotSorted) {\n isNotSorted = false;\n for(int i = 0; i < arrayToSort.length - 1; i++)\n if(arrayToSort[i].compareTo(arrayToSort[i + 1]) > 0) {\n T value = arrayToSort[i];\n arrayToSort[i] = arrayToSort[i + 1];\n arrayToSort[i + 1] = value;\n isNotSorted = true;\n }\n }\n }", "public void selectionSort(ArrayList <Comparable> list){\r\n\t\tsteps += 2;\r\n\t\tfor (int i = list.size() - 1; i >= 0; i--){\r\n\t\t\tsteps ++;\r\n\t\t\tint biggest = 0; \r\n\t\t\tsteps += 2;\r\n\t\t\tfor (int j = 0; j < i; j++){\r\n\t\t\t\tsteps += 4;\r\n\t\t\t\tif (list.get(j).compareTo(list.get(biggest)) > 0){\r\n\t\t\t\t\tsteps ++;\r\n\t\t\t\t\tbiggest = j;\r\n\t\t\t\t}\r\n\t\t\t\tsteps += 2;\r\n\t\t\t}\r\n\t\t\tsteps += 5;\r\n\t\t\tswap(list, i, biggest);\r\n\t\t\tsteps += 2;\r\n\t\t}\r\n\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"Selection Sort\");\r\n\t\tSystem.out.println();\r\n\t}", "static void sort(int[] a)\n {\n for ( int j = 1; j<a.length; j++)\n {\n int i = j - 1;\n while(i>=0 && a[i]>a[i+1])\n {\n int temp = a[i];\n a[i] = a[i+1];\n a[i+1] = temp;\n i--;\n }\n }\n }", "private void createArrays(){\n array1 = new BubbleSort(CreateIntArray.fillArray(15)).bubbleSort();\n array2 = new BubbleSort(CreateIntArray.fillArray(15)).bubbleSort();\n BubbleSort.listArrayElements(array1);\n BubbleSort.listArrayElements(array2);\n\n int[] array = new int[array1.length + array2.length];\n\n int i = 0, j = 0;\n for (int k = 0; k < array.length; k++){\n if(i > array1.length - 1){\n array[k] = array2[j];\n j++;\n } else if(j > array2.length - 1){\n array[k] = array1[i];\n i++;\n } else if (array1[i] < array2[j]){\n array[k] = array1[i];\n i++;\n } else {\n array[k] = array2[j];\n j++;\n }\n\n }\n BubbleSort.listArrayElements(array);\n\n\n }", "@Override\r\n\tpublic void sort() {\r\n\t\tint minpos;\r\n\t\tfor (int i = 0; i < elements.length-1; i++) {\r\n\t\t\tminpos=AuxMethods.minPos(elements, i);\r\n\t\t\telements=AuxMethods.swapElements(elements, i, minpos);\r\n\t\t\t\r\n\t\t}\r\n\t}", "private static ArrayList<Integer> sort(ArrayList<Integer> v) {\n\t\tint key, i, j; \n\t\tfor (j = 1; j != v.size(); j++) {\n\t\t\tkey = v.get(j); \n\t\t\ti = j - 1; \n\t\t\twhile ((i >= 0) && (v.get(i) > key)) {\n\t\t\t\tv.set(i+1, v.get(i));\n\t\t\t\ti -= 1; \n\t\t\t}\n\t\t\tv.set(i+1, key); \n\t\t}\n\t\treturn v; \n\t}", "public void sort(){\n ListNode t, x, b = new ListNode(null, null);\n while (firstNode != null){\n t = firstNode; firstNode = firstNode.nextNode;\n for (x = b; x.nextNode != null; x = x.nextNode) //b is the first node of the new sorted list\n if (cmp.compare(x.nextNode.data, t.data) > 0) break;\n t.nextNode = x.nextNode; x.nextNode = t;\n if (t.nextNode==null) lastNode = t;\n }\n firstNode = b.nextNode;\n }", "public static int[] bubbleSort(int[] inputArray) {\n boolean done = false;\n\n for (int i = 0; i < inputArray.length && !done; i++) {\n done = true;\n for (int j = 0; j < inputArray.length - i - 1; j++) {\n if (inputArray[j] > inputArray[j + 1]) {\n int temp = inputArray[j];\n inputArray[j] = inputArray[j + 1];\n inputArray[j + 1] = temp;\n done = false;\n }\n }\n }\n return inputArray;\n\n }", "private void sortBubble(ArrayList<String[]> jtData, int col)\n {\n String first, second;\n for(int i=0; i < jtData.size();i++)\n {\n for(int j=1; j < (jtData.size()-i); j++)\n {\n first = jtData.get(j-1)[col];\n second = jtData.get(j)[col];\n if(col == 2)\n {\n // Price is integer\n int x = Integer.valueOf(first);\n int y = Integer.valueOf(second);\n if(x < y)\n { \n Collections.swap(jtData, j, j-1);\n }\n }\n else if (first.compareToIgnoreCase(second) > 0) \n {\n // For Strings\n Collections.swap(jtData, j, j-1);\n }\n }\n }\n }", "public static void main(String[] args) {\n ArrayList<Comparable> BestBubble = new ArrayList<Comparable>();\r\n ArrayList<Comparable> WorstBubble = new ArrayList<Comparable>();\r\n ArrayList<Comparable> BestSelection = new ArrayList<Comparable>();\r\n ArrayList<Comparable> WorstSelection = new ArrayList<Comparable>();\r\n ArrayList<Comparable> BestInsertion = new ArrayList<Comparable>();\r\n ArrayList<Comparable> WorstInsertion = new ArrayList<Comparable>();\r\n\r\n // Best and worst case bubbleSortV testing...\r\n for (int i = 0; i < 10; i++) {\r\n BestBubble.add(i * 2);\r\n } System.out.println(\"BestBubble in pre-sorted ascending order...\\n\" + BestBubble + \"\\n\");\r\n\r\n for (int x = 10; x > 0; x--) {\r\n WorstBubble.add(x);\r\n }\r\n System.out.println(\"WorstBubble in descending order...\\n\" + WorstBubble + \"\\n\");\r\n\r\n // Best and worst case selectionSortV testing...\r\n for (int i = 0; i < 10; i++) {\r\n BestSelection.add(i * 2);\r\n } System.out.println(\"BestSelection in pre-sorted ascending order...\\n\" + BestSelection + \"\\n\");\r\n\r\n for (int x = 10; x > 0; x--) {\r\n WorstSelection.add(x);\r\n }\r\n System.out.println(\"WorstSelection in descending order...\\n\" + WorstSelection + \"\\n\");\r\n\r\n // Best and worst case insertionSortV testing...\r\n for (int i = 0; i < 10; i++) {\r\n BestInsertion.add(i * 2);\r\n } System.out.println(\"BestInsertion in pre-sorted ascending order...\\n\" + BestInsertion + \"\\n\");\r\n\r\n for (int x = 10; x > 0; x--) {\r\n WorstInsertion.add(x);\r\n }\r\n System.out.println(\"WorstInsertion in descending order...\\n\" + WorstInsertion + \"\\n\");\r\n\r\n // Sort every single instantiation of ArrayList\r\n MySorts.bubbleSortV(BestBubble);\r\n MySorts.bubbleSortV(WorstBubble);\r\n\r\n MySorts.selectionSortV(BestSelection);\r\n MySorts.selectionSortV(WorstSelection);\r\n\r\n MySorts.insertionSortV(BestInsertion);\r\n MySorts.insertionSortV(WorstInsertion);\r\n\r\n // Prints all the instantiations of ArrayList\r\n System.out.println(\"Sorted BestBubble...\\n\" + BestBubble + \"\\n\");\r\n System.out.println(\"Sorted WorstBubble...\\n\" + WorstBubble + \"\\n\");\r\n\r\n System.out.println(\"Sorted BestSelection...\\n\" + BestSelection + \"\\n\");\r\n System.out.println(\"Sorted WorstSelection...\\n\" + WorstSelection + \"\\n\");\r\n\r\n System.out.println(\"Sorted BestInsertion...\\n\" + BestInsertion + \"\\n\");\r\n System.out.println(\"Sorted WorstInsertion...\\n\" + WorstInsertion + \"\\n\");\r\n }" ]
[ "0.806171", "0.79305696", "0.7777937", "0.75938386", "0.75158423", "0.7346814", "0.7328804", "0.7313081", "0.7254229", "0.7249269", "0.72053415", "0.719981", "0.71247286", "0.7111351", "0.7108883", "0.7105088", "0.7084769", "0.70533586", "0.7047797", "0.7047245", "0.70456547", "0.7035566", "0.6987015", "0.698527", "0.6969851", "0.6957699", "0.69495785", "0.6933629", "0.6933323", "0.6931459", "0.691992", "0.6898079", "0.6897644", "0.68946993", "0.68836397", "0.6862304", "0.68596244", "0.6810748", "0.6770808", "0.6725684", "0.67231244", "0.6637275", "0.6632718", "0.659911", "0.6586111", "0.65781957", "0.65725416", "0.6570334", "0.6558449", "0.65388685", "0.65384686", "0.65196717", "0.6506639", "0.6495142", "0.64921695", "0.6452104", "0.6449682", "0.6447248", "0.64440143", "0.6433003", "0.6425003", "0.6421776", "0.64123523", "0.64123166", "0.63979506", "0.63749516", "0.6329501", "0.6329135", "0.6324314", "0.6317457", "0.63126665", "0.6298144", "0.6278178", "0.62717885", "0.6257061", "0.62488705", "0.6237211", "0.6235409", "0.622181", "0.6220833", "0.621148", "0.6208883", "0.6207394", "0.6193275", "0.61894923", "0.61888385", "0.618448", "0.6180403", "0.6164438", "0.6157323", "0.61456597", "0.6144646", "0.6138906", "0.6133498", "0.6113412", "0.61123323", "0.6101102", "0.6089853", "0.6088055", "0.60875237" ]
0.75396204
4
Sorts a list using Insertion Sort. What insertion sort does is that it separates the list in two parts, the sorted part and the unsorted part. In every iteration it augments the sorted part by one, the new item in the sorted part is then swapped backwards until there are no more greater elements than it, assuring that the sorted part remains sorted. That is done until the sorted part size is the same as the list's size.
public static <T extends Comparable<? super T>> void insertionSort(List<T> list){ int size = list.size(); if(size > 1){ for(int i = 0; i < size; i++){ int sortedSideIndex = i; while(sortedSideIndex > 0 && list.get(sortedSideIndex - 1).compareTo(list.get(sortedSideIndex)) > 0){ swap(list, sortedSideIndex, sortedSideIndex - 1); sortedSideIndex--; } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void insertionSort(ArrayList <Integer> list){\n System.out.println();\n System.out.println(\"Insertion Sort\");\n System.out.println();\n\n int current = 0;\n int len = list.size();\n for (int n = 1; n < len; n++) {\n current = list.get(n);\n int j = n - 1;\n while (j >= 0 && list.get(j) > current) {\n list.set(j + 1, list.get(j));\n j = j - 1;\n }\n list.set(j + 1, current);\n }\n }", "public void insertionSort(ArrayList <Comparable> list){\r\n\t\tsteps += 2; //init, check condition\r\n\t\tfor (int i = 1 ; i < list.size(); i++){\r\n\t\t\tsteps ++; //=\r\n\t\t\tint j = i;\r\n\t\t\tsteps += 7; //-, >, get(), compareTo(), get(), -, <\r\n\t\t\twhile ((j - 1 > 0) && (list.get(j).compareTo(list.get(j - 1)) > 0)){\r\n\t\t\t\tsteps += 3; // swap(), -, --\r\n\t\t\t\tswap(list, j, j - 1);\r\n\t\t\t\tsteps += 5;\r\n\t\t\t\tj--;\r\n\t\t\t\tsteps += 7; //-, >, get(), compareTo(), get(), -, <\r\n\t\t\t}\r\n\t\t\tsteps += 2; //increment, check condition\r\n\t\t}\r\n\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"Insertion Sort\");\r\n\t\tSystem.out.println();\r\n\t}", "public static void insertionSort(int[] a) {\r\n\r\n int i; //pointer to item in unsorted list\r\n int j; //pointer to an item in sorted list\r\n int value; //the next value to be inserted into sorted list\r\n\r\n for (i = 1; i < a.length; i++) { // iterate for each item in unsorted list\r\n\r\n value = a[i]; //assigns value of element in list to be sorted\r\n j = i - 1; //assign j to be the last element in sorted list\r\n\r\n while (j >= 0 && (a[j] >= value)) {\r\n //if there are still elements in unsorted list \r\n //and if the value to be inserted is less than the the value at index\r\n a[j + 1] = a[j]; //copy element to the right\r\n j--; //increment to check value to the left\r\n }//end while --the array continues moving each element right\r\n a[j + 1] = value; //assign value to it's place \r\n }//end for loop\r\n }", "public void insertionSort() {\n\t\tfor (int i = 1; i < numberOfElements; i++) {\n\t\t\tint temp = arr[i];\n\t\t\tint j = i;\n\t\t\t\n\t\t\twhile (j > 0) {\n\t\t\t\tif (arr[j - 1] <= temp) {\n\t\t\t\t\tnumberOfComparisons++;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tnumberOfComparisons++;\n\t\t\t\tarr[j] = arr[j - 1];\n\t\t\t\tnumberOfCopies++;\n\t\t\t\tj--;\n\t\t\t}\n\t\t\tarr[j] = temp;\n\t\t}\n\t}", "public static void insertionSort(int[] list1)\r\n\t{\r\n\t\tint temp=0;\r\n\t\tfor(int outside=1; outside<list1.length; outside++)\r\n\t\t{\r\n\t\t\tfor(int inside=outside; inside>0; inside--)\r\n\t\t\t{\r\n\t\t\t\tif(list1[inside]<list1[inside-1])\r\n\t\t\t\t{\r\n\t\t\t\t\ttemp=list1[inside-1];\r\n\t\t\t\t\tlist1[inside-1]=list1[inside];\r\n\t\t\t\t\tlist1[inside]=temp;\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void insertionSort(int[] sortList) {\r\n\t\tint n = sortList.length;\r\n\t\tfor (int j = 1; j < n && sortList[j] != -1; j++) {\r\n\t\t\tint key = sortList[j];\r\n\t\t\tint i = j - 1;\r\n\t\t\twhile ((i > -1) && (sortList[i] > key)) {\r\n\t\t\t\tsortList[i + 1] = sortList[i];\r\n\t\t\t\ti--;\r\n\t\t\t}\r\n\t\t\tsortList[i + 1] = key;\r\n\t\t}\r\n\t}", "public void insertionSortAsc(){\r\n for(int x=1 ; x<numItems ; x++){ //get the starting point\r\n int temp = mArray[x]; //take the item out\r\n int pos = x -1;\r\n while(pos >= 0 && mArray[pos]>temp){\r\n mArray[pos+1] = mArray[pos]; //shift item up\r\n pos--; //move position left\r\n }\r\n mArray[pos+1] = temp; //insert item in the empty spot\r\n }\r\n }", "public static void insertionSort2(IntList l) {\n\t\tIntListEntry input = l.getFirst();\n\t\tl1:\twhile (input != null) {\n\t\t\tfor (IntListEntry e = l.getFirst(); e != input; e = e.getNext())\n\t\t\t\tif (e.getItem() > input.getItem()) {\n\t\t\t\t\tIntListEntry next = input.getNext();\n\t\t\t\t\tl.delete(input);\n\t\t\t\t\tl.insertBefore(input, e);\n\t\t\t\t\tinput = next;\n\t\t\t\t\tcontinue l1;\n\t\t\t\t}\n\t\t\tinput = input.getNext();\n\t\t}\n\t}", "public static String[] insertionSort(String[] list){\n for (int i=1; i<list.length; i++){\r\n //use a variable a to temporarily store the index of the current item\r\n int a = i;\r\n //loop through comparisons with items before it until it reaches an item that is smaller than it\r\n while(list[a].compareTo(list[a-1])<0){\r\n //when item before it is larger, use a temporary string variable to store the current item's value\r\n String temp = list[a];\r\n list[a]=list[a-1];//give list[a] the value of the list[a-1]\r\n list[a-1]=temp;//give list[a-1] the value that is stored in the temporary\r\n a-=1;\r\n if(a==0)\r\n break;\r\n }\r\n }\r\n return list;\r\n }", "static <T extends Comparable<T>> List<T> sort(List<T> list) {\n\t\tif (list == null || list.size() < 2) {\n\t\t\treturn list;\n\t\t}\n\t\tfor (int i = 1; i < list.size(); i++) {\n\t\t\t// the current is begin from index of 1\n\t\t\tT current = list.get(i);\n\t\t\tint j = i - 1;\n\t\t\tint origin = j;\n\t\t\twhile (j >= 0 && list.get(j).compareTo(current) > 0) {\n\t\t\t\t// insert into the head of the sorted list\n\t\t\t\t// or as the first element into an empty sorted list\n\t\t\t\t// last element of the sorted list\n\t\t\t\t// middle of the list\n\t\t\t\t// insert into middle of the sorted list or as the last element\n\t\t\t\tlist.set(j + 1, list.get(j));\n\t\t\t\tj--;\n\t\t\t}\n\t\t\tlist.set(j + 1, current);\n\t\t\tprintInsertionSortAnimation(list, current, j, origin);\n\t\t\tSystem.out.println();\n\t\t}\n\n\t\treturn list;\n\t}", "public static <T extends Comparable<? super T>> void insertionSort(List<T> a){\n insertionSort(a, 0, a.size()-1);\n }", "public static ArrayList<Integer> insertionSort(ArrayList<Integer> list) {\n ArrayList<Integer> outList = new ArrayList<>();\n for (int toInsert : list) {\n for (int j = 0; j < outList.size(); j++) {\n if (outList.get(j) >= toInsert) {\n outList.add(j, toInsert);\n break;\n } else if (j == outList.size() - 1) {\n outList.add(toInsert);\n break;\n }\n }\n if (outList.size() == 0) {\n outList.add(toInsert);\n }\n }\n return outList;\n }", "protected static <T extends Comparable<? super T>> void insertionSort(List<T> a, int low, int high){\n // Example of insertion sort\n // 4 1 3 2 5\n // 1 4 3 2 5\n // 1 3 4 2 5\n // 1 2 3 4 5\n\n // index low is already sorted\n // move from left to right inserting in correct position \n // list is always sorted from low to i\n for (int i = low + 1; i <= high; i++){\n // store object at index i\n T tmp = a.get(i);\n\n // start at i if j - 1 is greater then tmp move index j - 1 to j\n int j;\n for(j = i; j > 0; j--){\n // tmp < j - 1 -> compareTo < 0\n // tmp > j - 1 -> compareTo > 0\n if(tmp.compareTo(a.get(j - 1)) < 0){\n a.set(j, a.get(j-1));\n } else {\n // break if tmp is bigger than j - 1\n \n break;\n }\n }\n \n // tmp should be inserted into position j\n a.set(j, tmp);\n }\n }", "public void insertionSort(int[] nums) {\n for (int i = 1; i < nums.length; i++) {\n // Hold the current element which is processed\n int current = nums[i];\n int j = i;\n\n // Trace backwards and find a place to insert current by shifting elements\n // towards the right\n while (j - 1 >= 0 && nums[j - 1] > current) {\n nums[j] = nums[j - 1];\n j--;\n }\n\n // j is the right place to insert current\n nums[j] = current;\n }\n\n }", "static void insertionSort(int[] A) {\n\t // Sort the array A into increasing order.\n\t \n\t int itemsSorted; // Number of items that have been sorted so far.\n\n\t for (itemsSorted = 1; itemsSorted < A.length; itemsSorted++) {\n\t // Assume that items A[0], A[1], ... A[itemsSorted-1] \n\t // have already been sorted. Insert A[itemsSorted]\n\t // into the sorted part of the list.\n\t \n\t int temp = A[itemsSorted]; // The item to be inserted.\n\t int loc = itemsSorted - 1; // Start at end of list.\n\t \n\t while (loc >= 0 && A[loc] > temp) {\n\t A[loc + 1] = A[loc]; // Bump item from A[loc] up to loc+1.\n\t loc = loc - 1; // Go on to next location.\n\t }\n\t \n\t A[loc + 1] = temp; // Put temp in last vacated space.\n\t }\n\t}", "public void insertionSort() {\n Comparable p = (Comparable) array[0];\n Comparable[] sorted = new Comparable[array.length];\n sorted[0] = p;\n for (int i = 0; i < array.length - 1; i++) {\n if (p.compareTo(array[i + 1]) < 0) {\n p = (Comparable) array[i + 1];\n sorted[i + 1] = p;\n } else {\n Comparable temp = (Comparable) array[i + 1];\n int j = i;\n while (j >= 0 && sorted[j].compareTo(array[i + 1]) > 0) {\n j--;\n }\n for (int q = i; q > j; q--) {\n sorted[q + 1] = sorted[q];\n }\n sorted[j + 1] = temp;\n }\n }\n this.array = (T[]) sorted;\n }", "public void insertionNumberSort()\n {\n\t for(int j=1; j<AL.size(); j++)\n\t {\n\t\t Generics temp = AL.get(j);\n\t\t int possibleIndex = j;\n\t\t \n\t\t while(possibleIndex>0 && Integer.parseInt(AL.get(possibleIndex - 1).toString()) < Integer.parseInt(temp.toString()))\n\t\t {\n\t\t\t AL.set(possibleIndex, AL.get(possibleIndex -1));\n\t\t\t possibleIndex--;\n\t\t\t \n\t\t }\n\t\t \n\t\t AL.set(possibleIndex, temp);\n\t }\n \n }", "static void InsertionSort(int[] arr){\n int inner, temp;\n for(int outer = 1; outer<arr.length;outer++){\n temp = arr[outer];\n inner = outer;\n while (inner>0 && arr[inner-1]>temp){\n arr[inner] = arr[inner-1];\n inner--;\n }\n arr[inner]=temp;\n }\n }", "private static void InsertionSort(RandomVector v) {\n\t\tfor(int i = 1; i < v.size(); i++) {\n\t\t\t\n\t\t\t\n\t\t\tint j = 0, //start looking through sorted section from beginning\n\t\t\t\t\ttemp = v.get(i); //stash our current unsorted element\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tfor(j=0; j < i && v.get(j) <= v.get(i); j++){}\n\t\t\t\n\t\t\t//walk from one element to the left of i through to j to the left\n\t\t\tfor(int k = i-1; k >= j; k--){\n\t\t\t\t//move element at k one step to the right\n\t\t\t\tv.set(k+1, v.get(k));\n\t\t\t}\n\t\t//copy temp into element j\t\n\t\t\tv.set(j, temp);\n\t\t\tSystem.out.println(v);\n\t\t}\n\t\t\n\t}", "public ListNode insertionSortList(ListNode head) {\n ListNode dummy = new ListNode(0);\n ListNode prev = dummy;\n ListNode node = head;\n\n while (node != null) {\n ListNode temp = node.next;\n\n /* Before insert, the prev is at the last node of the sorted list.\n Only the last node's value is larger than the current inserting node\n should we move the temp back to the head*/\n if (prev.val >= node.val)\n prev = dummy;\n\n while (prev.next != null && prev.next.val < node.val) {\n prev = prev.next;\n }\n\n // insert between prev and prev.next\n node.next = prev.next;\n prev.next = node;\n\n // prev = dummy; // Don't set prev to the head of the list after insert\n node = temp;\n }\n return dummy.next;\n }", "public static IntList insertionSort1(IntList input) {\n\t\tIntList output = new SimpleIntList();\n\t\tl1: while (!input.isEmpty()) {\n\t\t\tIntListEntry first = input.getFirst();\n\t\t\tinput.delete(first);\n\t\t\tfor (IntListEntry e = output.getFirst(); e != null; e = e.getNext())\n\t\t\t\tif (e.getItem() > first.getItem()) {\n\t\t\t\t\toutput.insertBefore(first, e);\n\t\t\t\t\tcontinue l1;\t\t\t\t\t\n\t\t\t\t}\n\t\t\toutput.append(first);\n\t\t}\n\t\treturn output;\n\t}", "public ListNode insertionSortList(ListNode head) {\n if ( head == null || head.next == null) {\n return head;\n }\n ListNode dummy = new ListNode(0);\n\n ListNode cur = head;\n\n while ( cur != null ) {\n ListNode next = cur.next;\n ListNode newCur = dummy;\n while ( newCur.next != null && newCur.next.val <= cur.val ) {\n newCur = newCur.next;\n }\n cur.next = newCur.next;\n newCur.next = cur;\n\n cur = next;\n }\n\n return dummy.next;\n }", "Vector<NewsArticle> insertionSort(Vector<NewsArticle> articles) {\n int i, j;\n int size = articles.size();\n NewsArticle sortedList[] = new NewsArticle[articles.size()];\n\n articles.copyInto(sortedList);\n NewsArticle temp;\n\n for (i = 1; i < size; i++) {\n temp = sortedList[i];\n\n j = i;\n while ((j > 0) && (sortedList[j - 1].getScore(filterType) < temp.getScore(filterType))) {\n sortedList[j] = sortedList[j - 1];\n j = j - 1;\n }\n sortedList[j] = temp;\n }\n Vector<NewsArticle> outList = new Vector<NewsArticle>();\n\n for (i = 0; i < size; i++) {\n temp = sortedList[i];\n outList.addElement(temp);\n }\n return outList;\n }", "private void bInsertionSort(int lowerIndex, int higherIndex) {\n \t\tArrayList tmpsorted = new ArrayList();\n \t\tint tmp, lowerbound, upperbound;\n \t\t\n \t\tfor(int i = lowerIndex; i <= higherIndex; i++) {\n \t\t\ttmp = (int) unsorted.get(i);\n \t\t\tif(tmpsorted.isEmpty()) {\n \t\t\t\ttmpsorted.add(tmp);\n \t\t\t} else {\n \t\t\t\t\n \t\t\t\t//Every new number we want to insert needs\n \t\t\t\t//to reset the bounds according to the sorted list.\n \t\t\t\tupperbound = tmpsorted.size() - 1;\n \t\t\t\tlowerbound = 0;\n \t\t\t\t\n \t\t\t\twhile (unsorted.size() != 0){\n \t\t\t\t//Note that each \"break;\" throws us out of the while loop.\n \t\t\t\t//Causing our boundaries to be reset for the new number\n \t\t\t\t\t\n \t\t\t\t\tint j = (upperbound + lowerbound) / 2;\t//j points to the middle of the boundaries\n \t\t\t\t\tif (tmp <= (int)tmpsorted.get(j)){\t//is tmp less or equal to the number in j?\n \t\t\t\t\t\t\t\t\t\t\t\t\n \t\t\t\t\t\tif (j == 0){\t\t\t\t\t\t//Are we at the bottom of the list?\n \t\t\t\t\t\t\ttmpsorted.add(0, tmp);\t\t//Add it to the bottom of the list.\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t}\n \t\t\t\t\t\t\n \t\t\t\t\t\telse if ((int)tmpsorted.get(j-1) > tmp){ \n \t\t\t\t\t\t//Else if the number behind j is bigger than tmp...\n \t\t\t\t\t\t//...we can move the upper bound behind j and repeat the split.\n \t\t\t\t\t\t//NOTE: We do NOT \"break;\" to get thrown out of the while loop.\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t\tupperbound = j - 1;\n \t\t\t\t\t\t}\n \t\t\t\t\t\t\n \t\t\t\t\t\telse{ //Else we just add the number to j\n \t\t\t\t\t\t\ttmpsorted.add(j, tmp);\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\telse{ //If tmp is HIGHER than j\n \t\t\t\t\t\tif (j == tmpsorted.size() - 1){\n \t\t\t\t\t\t//Are we at the end of the list?\n \t\t\t\t\t\t//Just add tmp at the end of the list.\t\n \t\t\t\t\t\t\ttmpsorted.add(j+1, tmp);\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t}\n \t\t\t\t\t\t\n \t\t\t\t\t\telse if((int)tmpsorted.get(j+1) < tmp){\n \t\t\t\t\t\t//if the next number to j is still less than tmp...\n \t\t\t\t\t\t//we raise the lowerbound past j and repeat the split\n \t\t\t\t\t\t//NOTE: We do NOT \"break;\" to get thrown out of the while loop.\n \t\t\t\t\t\t\tlowerbound = j + 1;\n \t\t\t\t\t\t}\n \t\t\t\t\t\t\n \t\t\t\t\t\telse{ \n \t\t\t\t\t\t//Else we can just add tmp after j since it's higher than j\n \t\t\t\t\t\t\ttmpsorted.add(j+1, tmp);\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t}\n \t\t\t\t\n \t\t\t}\n \t\t}\n \t\t// Replace the unsorted values with tmpsorted.\n \t\tint j = 0;\n \t\tfor(int i = lowerIndex; i <= higherIndex; i++) {\n \t\t\tunsorted.set(i, tmpsorted.get(j));\n \t\t\tj++;\n \t\t}\n\n \t}", "public static void insertionSort(int[] data) {\n for(int i = 1; i < data.length; i++) {\n int j = i;\n while(j > 0 && data[j] < data[j - 1]) { //can get all the way to the front if need be\n int temp = data[j - 1];\n data[j - 1] = data[j];\n data[j] = temp;\n j--;\n }\n }\n }", "public static void insertionSort(int[] arr)\n\t{\n\t\tint len=arr.length;\n\t\tfor(int i=1;i<len;i++){\n\t\t\tfor(int j=i;j>0&&arr[j]<arr[j-1];j--)\n\t\t\t{\n\t\t\t\tint temp=arr[j-1];\n\t\t\t\tarr[j-1]=arr[j];\n\t\t\t\tarr[j]=temp;\n\t\t\t}\n\t\t}\n\t}", "public void insertionSort(int[] nums) {\n\t\tif(nums.length<=1) return ;\n\t\tfor(int i=1;i<nums.length;i++) {\n\t\t\tint j=i;\n\t\t\twhile( j>=1 && less(nums[j],nums[j-1])) {\n\t\t\t\tswap(nums,j,j-1);\n\t\t\t\tj--;\n\t\t\t}\n\t\t}\n\t}", "public static void insertionSort(int[] array) {\n for (int i = 1; i < array.length; i++) {\n int temp = array[i];\n int j = i;\n /**\n * Compare the variable temp with each element on the right until a larger element than it is found.\n */\n while (j > 0 && temp > array[j - 1]) {\n array[j] = array[j - 1];\n j--;\n }\n /**\n * Places temp before the element smaller than it\n */\n array[j] = temp;\n }\n }", "void InsertionSort(int a[])\n {\n int i,j;\n\n for( j=1;j<a.length;j++)\n {\n int key =a[j];\n i=j-1;\n\n\n while(i>=0 && a[i]>key)\n {\n a[i+1]=a[i];\n i=i-1;\n }\n a[i+1]=key;\n\n }\n\n }", "public static void Insertionsort(int a[]) \n\t { \n\t int n = a.length; \n\t for (int i=1; i<n; ++i) \n\t { \n\t int key = a[i]; \n\t int j = i-1;\n\t while (j>=0 && a[j] > key) \n\t { \n\t a[j+1] = a[j]; \n\t j = j-1; \n\t } \n\t a[j+1] = key; \n\t } \n\t }", "public static void insertionSort(Comparable[] a) {\n\n for (int i = 1; i < a.length; i++) {\n for (int j = i; j > 0; j--) {\n if (less(a[j], a[j-1])) exch(a, j, j-1);\n else break;\n }\n }\n }", "private void insertionSort(T[] arr) {\n for (int i = 1; i < n; i++)\n for (int j = i; j > 0 && arr[j].compareTo(arr[j - 1]) < 0; j--) // we create the variable j to shift the element\n swap(arr, j, j - 1);\n }", "public void InsertionSort(T[] arr)\n {\n for(int i = 1; i < arr.length; i++)\n {\n int j = i -1;\n T value = arr[i];\n\n while(j >= 0 && arr[j].compareTo(value) > 0)\n {\n arr[j + 1] = arr[j];\n j--;\n }\n arr[j+1] = value;\n }\n }", "@Test(timeout = SHORT_TIMEOUT)\n public void testAdaptiveInsertionSort() {\n //Test adaptiveness of completely ordered sort\n\n //Generate sorted array\n toSort = randArrDuplicates(MAX_ARR_SIZE, new Random(2110));\n Arrays.parallelSort(toSort, comp);\n sortedInts = cloneArr(toSort);\n\n comp.resetCount();\n Sorting.insertionSort(sortedInts, comp);\n int numComparisons = comp.getCount();\n\n assertSorted(sortedInts, comp);\n\n //Should require only 1 pass through array, for n-1 comparisons\n assertTrue(\"Too many comparisons: \" + numComparisons,\n numComparisons <= MAX_ARR_SIZE - 1);\n\n //Check adaptiveness with 1 item out-of-order\n\n //Set up list\n toSort = new IntPlus[6];\n for (int i = 0; i < toSort.length; i++) {\n toSort[i] = new IntPlus(2 * i);\n }\n toSort[3] = new IntPlus(-1);\n\n sortedInts = cloneArr(toSort);\n\n /*\n Initial Array: [0, 2, 4, -1, 8, 10]\n Should require 7 comparisons to sort\n */\n comp.resetCount();\n Sorting.insertionSort(sortedInts, comp);\n numComparisons = comp.getCount();\n\n assertSorted(sortedInts, comp);\n\n assertTrue(\"Too many comparisons: \" + numComparisons,\n numComparisons <= 7);\n }", "public static void insertionSort(int[] arr) {\r\n\t\tfor (int scan = 1; scan < arr.length; scan++) {\r\n\t\t\tint temp = arr[scan];\r\n\t\t\t\r\n\t\t\tint pos = scan;\r\n\t\t\twhile (pos > 0 && arr[pos - 1] > temp) {\r\n\t\t\t\tarr[pos] = arr[pos - 1];\r\n\t\t\t\tpos--;\r\n\t\t\t}\r\n\t\t\tarr[pos] = temp;\r\n\t\t}\r\n\t}", "public void insertionSort (Integer [] inNums)\n\t{\n\t\tnums = inNums.clone();\n\t\tfor (int i=0; i<nums.length; i++)\n\t\t{\n\t\t\tfor (int j=i; j>0; j--)\n\t\t\t{\n\t\t\t\t//System.out.println (\"i=\"+i+\"; j=\"+j);\n\t\t\t\tprint ();\n\t\t\t\t//if (nums[j] < nums[j-1])\n\t\t\t\tif (nums[j].compareTo (nums[j-1]) < 0)\n\t\t\t\t{\n\t\t\t\t\ttemp = nums[j-1];\n\t\t\t\t\tnums [j-1] = nums[j];\n\t\t\t\t\tnums[j]=temp;\n\t\t\t\t}\n\t\t\t\telse break;\n\t\t\t}\n\t\t}\n\t}", "public static int[] doInsertionSort(int[] input){\n int temp;\n for (int i = 1; i < input.length; i++) {\n for(int j = i ; j > 0 ; j--){\n if(input[j] < input[j-1]){\n temp = input[j];\n input[j] = input[j-1];\n input[j-1] = temp;\n }\n }\n }\n return input;\n }", "public static void InsertionSort(int[] array) {\n for (int i=0; i<array.length; i++) {\n int cur_element = array[i];\n int j = i - 1;\n while (j >= 0 && array[j] > cur_element) {\n array[j+1] = array[j];\n j--;\n }\n array[j+1] = cur_element;\n }\n }", "public static void insertionSortPart2(int[] ar)\n {\n for(int i = 1; i < ar.length; i++){\n for(int j = 0; j < i; j++){\n if(ar[i] <= ar[j]){\n int tmp = ar[i];\n ar[i] = ar[j];\n ar[j] = tmp;\n }\n }\n printArray(ar);\n }\n }", "public void sortIncreasing()\n {\n int min;\n \n for (int i = 0; i < list.length - 1; i++)\n {\n min = i; \n for(int j = i+1; j < list.length; j++)\n {\n if(list[j] < list[min])\n min = j; \n }\n if(i != min && list[min] < list.length)\n {\n int temp = list[min];\n list[min] = list[i];\n list[i] = temp; \n }\n }\n }", "public ListNode insertionSortList(ListNode head) {\n\n ListNode helper = new ListNode(0);\n ListNode pre = helper;\n ListNode cur = head;\n while(cur!=null) {\n\n while(pre.next.val < cur.val){ //keep looking until find right place\n ;\n }\n }\n return null;\n }", "private static void insertionSortArray2(int[] arr) {\n\n int key,j;\n\n for(int index=1;index<arr.length;index++){\n\n key=arr[index];\n\n j=index-1;\n\n while(j>=0 && arr[j]>key){\n arr[j+1]=arr[j];\n j--;\n }\n arr[j+1]=key;\n }\n\n\n }", "public static void insertionSort(int[] arr) {\n //write your code here\n for(int i=1;i<arr.length;i++) {\n for(int j=i-1;j>=0;j--) {\n if(isGreater(arr, j, j+1))\n swap(arr, j, j+1);\n else\n break;\n }\n }\n}", "private static int[] insertionSort(int[] inputArr) {\n\t\tint temp;\n\t\tfor(int i=1;i<inputArr.length;i++)\n\t\t{\n\t\t\tfor(int j=i;j>0;j--)\n\t\t\t{\n\t\t\t\tif(inputArr[j-1]>inputArr[j])\n\t\t\t\t{\n\t\t\t\t\ttemp=inputArr[j-1];\n\t\t\t\t\tinputArr[j-1]=inputArr[j];\n\t\t\t\t\tinputArr[j]=temp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn inputArr;\n\t}", "public static void insertSort (int array[])\n {\n for (int i = 1; i < array.length; ++i)\n {\n int key = array[i];\n int j = i -1;\n\n while(j >= 0 && array[j] > key)\n {\n array[j + 1] = array[j];\n j = j - 1;\n }\n array[j+1] = key;\n }\n }", "public void insertionSort(ArrayList<T> arr, int p, int r) {\n\t}", "public void insertionSort(Long[] keys) {\n int n = keys.length;\n for(int i = 1; i< n; ++i) {\n long current = keys[i];\n int j = i-1;\n\n while(j >= 0 && current < keys[j]) {\n keys[j+1] = keys[j];\n j--;\n\n }\n keys[j+1] = current;\n }\n }", "public static int[] insertionSort(int[] array)\r\n {\n for (int i = 1; i < array.length; i++)\r\n {\r\n // during each iteration as we travel to the right of the array, we\r\n // first need to set our iterator that will move back to the left\r\n // as we find the correct place to put the item we are inserting\r\n // into the left side of the array. Since we know that at this point\r\n // everything to the left of index i is already sorted, we want our\r\n // new item to be inserted to be the first element to the right of \r\n // the sorted section, which is at array[i].\r\n int j = i;\r\n \r\n // now we start moving our backwards iterator, j, to the left one\r\n // array slot at a time. During each iteration we'll check to see\r\n // if the item at array[j] is less than array[j-1], or the item to\r\n // the left. If it is then we swap them and compare again with the\r\n // next item to the left. We repeat this process until we either\r\n // find that array[j] is greater than or equal to the item to the\r\n // left, or that we reach the far left side of the array.\r\n while (j > 0 && array[j] < array[j-1])\r\n {\r\n // create a temp variable to allow us to swap array[j] with\r\n // array[j-1] and then swap the two.\r\n int temp = array[j];\r\n array[j] = array[j-1];\r\n array[j-1] = temp;\r\n \r\n j--;\r\n }\r\n }\r\n \r\n return array;\r\n }", "public static void insertionSort(int[] arr, int left, int right) {\n\t\t int i, j, newValue;\n\t\t for (i = left; i <= right; i++) {\n\t\t\t\tnewValue = arr[i];\n\t\t\t\tj = i;\n\t\t\t\twhile (j > 0 && arr[j - 1] > newValue) {\n\t\t\t\t\t arr[j] = arr[j - 1];\n\t\t\t\t\t j--;\n\t\t\t\t}\n\t\t\t\tarr[j] = newValue;\n\t\t }\n\t}", "public static void insertionSort(List<Integer> values) {\r\n for (int i = 1; i < values.size(); i++) {\r\n insert(values, i);\r\n } // for\r\n }", "public static void sort(ArrayList<Integer> list) {\n\t\tint temp;\n\t\tfor (int i=0; i < list.size() ; i++) {\n\t\t\tfor (int j=i+1;j<list.size()-1;j++){\n\t\t\t\tif(list.get(i)>list.get(j)){\n\t\t\t\t\ttemp = list.get(i);\n\t\t\t\t\tlist.set(i,list.get(j));\n\t\t\t\t\tlist.set(j, temp);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static void insertionSort(double a[], int low, int high)\n {\n double value;\n int i, j;\n int size = high - low;\n\n for(i = low + 1; i < size; i++) {\n value = a[i];\n j = i;\n\n while(j > 0 && a[j-1] < value) {\n a[j] = a[j-1];\n j = j - 1;\n }\n a[j] = value;\n }\n }", "public static void insertionSort(int[] arr, int left, int right) {\n for (int i = left + 1; i <= right; i++){\n int temp = arr[i];\n int j = i - 1;\n while (j >= left && arr[j] > temp) {\n arr[j + 1] = arr[j];\n j--;\n }\n arr[j + 1] = temp;\n }\n }", "public static ArrayList<Integer> mergeSort(ArrayList <Integer> list){\n System.out.println();\n System.out.println(\"Insertion Sort\");\n System.out.println();\n if (3 > 2){\n int mid= list.size()/2;\n ArrayList<Integer> left= new ArrayList<Integer>(mid);\n ArrayList<Integer> right=new ArrayList<Integer>(list.size()-mid);\n for (int i = 0; i < mid; i++) {\n left.add(list.get(i));\n } \n\n for (int i = 0; i < list.size()-mid; i++) {\n right.add(list.get(i));\n } \n\n left = mergeSort(left); \n right = mergeSort(right);\n merge(left,right,list);\n }\n return list;\n }", "public int[] insertionSort(int[] in) {\n\t\t\n\t\tint[] out = new int[in.length]; \t\t\t// make a copy of the array so it can be reused for all methods\n\t\tSystem.arraycopy(in, 0, out, 0, in.length);\n\t\t\n\t\tfor(int i = 1; i < out.length; i += 1) {\n\t\t\tint temp = out[i];\n\t\t\tint j = i;\n\t\t\t\n\t\t\t// Swap the integers as long the left is bigger then right, as long there is a left from scratch\n\t\t\twhile(j > 0 && out[j - 1] > temp) {\n\t\t\t\tout[j] = out[j - 1];\n\t\t\t\tj = j - 1;\n\t\t\t}\n\t\t\tout[j] = temp;\n\t\t}\n\t\treturn out;\n\t}", "public static void insertionSort(int[] array) {\n\n int saveElement;\n int i;\n\n for (int iNextEl = 1; iNextEl < array.length; iNextEl++) {\n saveElement = array[iNextEl]; // 1 - SAVE NEXT ELEMENT\n\n i = iNextEl;\n while ((i > 0) && (array[i - 1] > saveElement)) { // 2 - SHIFT LOOP\n array[i] = array[i - 1];\n i--;\n }\n array[i] = saveElement; // 3 - PUT SAVED ELEMENT BACK\n }\n }", "public void shellSort(){\n int increment = list.size() / 2;\n while (increment > 0) {\n for (int i = increment; i < list.size(); i++) {\n int j = i;\n int temp = list.get(i);\n while (j >= increment && list.get(j - increment) > temp) {\n list.set(j, list.get(j - increment));\n j = j - increment;\n }\n list.set(j, temp);\n }\n if (increment == 2) {\n increment = 1;\n } else {\n increment *= (5.0 / 11);\n }\n }\n }", "private static void insertionSortArray(int[] arr) {\n\n int key,index;\n for( index=1;index<arr.length;index++){\n key=arr[index];\n for(int j=index-1; j>=0;j--){\n if(key<arr[j]){\n arr[index]=arr[j]; //swap\n arr[j]=key;\n index--; //since a[i] & a[j] are swapped, index of key(i) has to changed\n }else {\n break;\n }\n }\n }\n\n }", "public static <T> List<T> SortedInsert(List<T> items, Comparator<T> c) \n {\n\n \n List<T> l = new ArrayList<T>();\n \n for (int i = 0; i < items.size(); i ++)\n {\n \n for (int j = 0; j < l.size(); j ++)\n {\n if (c.compare(l.get(i), l.get(j)) > 0)\n {\n \t l.add(j, l.get(j));\n }\n }\n \n // l.add(items.get(i));\n \n \n }\n\treturn l;\n \n}", "public void sort() {\n ListNode start = head;\n ListNode position1;\n ListNode position2;\n\n // Going through each element of the array from the second element to the end\n while (start.next != null) {\n start = start.next;\n position1 = start;\n position2 = position1.previous;\n // Checks if previous is null and keeps swapping elements backwards till there\n // is an element that is bigger than the original element\n while (position2 != null && (position1.data < position2.data)) {\n swap(position1, position2);\n numberComparisons++;\n position1 = position2;\n position2 = position1.previous;\n }\n }\n }", "static void insertionSort(int array[]) {\n int n = array.length;\n //for key selection\n for (int i = 1; i < n; ++i) {\n int key = array[i];\n int j = i - 1;\n\n //Compare the key and elements of array, move greater elements to one position further \n while (j >= 0 && array[j] > key) {\n array[j + 1] = array[j];\n j = j - 1;\n\n }\n array[j + 1] = key;\n }\n\n }", "public ArrayList<URL> insertionSort(ArrayList<URL> bucket) {\n\t\tfor(int j=1;j<bucket.size();j++) {\n\t\t\tURL key = bucket.get(j);\n\t\t\tint i = j-1;\n\t\t\twhile(i>=0 && bucket.get(i).getUrl().compareTo(key.getUrl())>0) {\n\t\t\t\tbucket.set(i+1, bucket.get(i));\n\t\t\t\ti --;\n\t\t\t}\n\t\t\tbucket.set(i+1, key);\n\t\t}\n\t\treturn bucket;\n\t}", "@Test\r\n public void testSort() {\r\n System.out.println(\"sort\");\r\n int[] array = {6, 3, 7, 9, 4, 1, 3, 7, 0};\r\n int[] expResult = {0, 1, 3, 3, 4, 6, 7, 7, 9};\r\n\r\n int[] result = new InsertionSort().sort(array);\r\n\r\n assertArrayEquals(expResult, result);\r\n \r\n array = new int[10000];\r\n for (int i = 0; i < array.length; i++) {\r\n array[i] = new Random().nextInt(Integer.MAX_VALUE);\r\n }\r\n expResult = Arrays.copyOf(array, array.length);\r\n Arrays.sort(expResult);\r\n \r\n result = new InsertionSort().sort(array);\r\n\r\n assertArrayEquals(expResult, result);\r\n }", "public static <T extends Comparable<T>> void insertionSort(T[] arrayToSort) {\n for(int i = 1; i < arrayToSort.length; i++) {\n T currentValue = arrayToSort[i];\n int sortedIterator = i - 1;\n // iterate through sorted portion of array\n while((sortedIterator >= 0) && (currentValue.compareTo(arrayToSort[sortedIterator]) < 0))\n arrayToSort[sortedIterator + 1] = arrayToSort[sortedIterator--];\n arrayToSort[sortedIterator + 1] = currentValue;\n }\n }", "@Override\r\n\tpublic void sort() {\r\n\t\tint minpos;\r\n\t\tfor (int i = 0; i < elements.length-1; i++) {\r\n\t\t\tminpos=AuxMethods.minPos(elements, i);\r\n\t\t\telements=AuxMethods.swapElements(elements, i, minpos);\r\n\t\t\t\r\n\t\t}\r\n\t}", "private static void sortUsingInsertionSort(int[] array, int k) {\n \n for(int i = 1; i < array.length; ++i) {\n int j = 0;\n while (array[j] < array[i]) {\n j++;\n }\n \n int temp = array[j];\n array[j] = array[i];\n array[i] = temp;\n }\n \n PrintUtil.printArray(array, \"Sorted Array\");\n }", "public void insertionStringSort()\n {\n\t for(int j=1; j<AL.size(); j++)\n\t {\n\t\t Generics temp = AL.get(j);\n\t\t int possibleIndex = j;\n\t\t \n\t\t while(possibleIndex>0 && AL.get(possibleIndex - 1).toString().compareTo(temp.toString())>0)\n\t\t {\n\t\t\t AL.set(possibleIndex, AL.get(possibleIndex -1));\n\t\t\t possibleIndex--;\n\t\t\t \n\t\t }\n\t\t \n\t\t AL.set(possibleIndex, temp);\n\t }\n \n }", "private static void insertionSort(int[] array, int n) {\n \t\n \tfor (int index = 1; index < n; index++) {\n \t\tint temp = array[index];\n \t\tint j = index;\n\n\t\t\tint finalPosition = binarySearch(array, temp, 0, j - 1);\n\n \t\twhile (j > finalPosition) {\n \t\t\tarray[j] = array[j - 1];\n \t\t\tj -= 1;\n \t\t}\n \t\tarray[j] = temp;\n \t}\n }", "public static void insertSorted(List list, Object obj, Comparator c)\n {\n insertSorted(list, obj, c, true);\n }", "@Test\n\tpublic void givenAnUnsortedList_ThenListIsSorted() {\n\t\tList<Integer> unsorted = new ArrayList<>();\n\t\tunsorted.add(2);\n\t\tunsorted.add(1);\n\t\tunsorted.add(3);\n\t\tunsorted.add(5);\n\t\tunsorted.add(4);\n\t\t\n\t\t// Execute the code\n\t\tList<Integer> sorted = QuickSort.getInstance().sort(unsorted);\n\t\t\n\t\t// Verify the test result(s)\n\t\tassertThat(sorted.get(0), is(1));\n\t\tassertThat(sorted.get(1), is(2));\n\t\tassertThat(sorted.get(2), is(3));\n\t\tassertThat(sorted.get(3), is(4));\n\t\tassertThat(sorted.get(4), is(5));\n\t}", "public static int[] insertionSort(int[] elements) {\n\t\tif (elements.length == 0 || elements.length == 1)\n\t\t\treturn elements;\n\t\t\n\t\tfor (int i=1;i < elements.length;i++) {\n\t\t\tint temp = elements[i];\n\t\t\tfor (int j=i-1;j >= 0;j--) {\n\t\t\t\tif (temp < elements[j]) {\n\t\t\t\t\telements[j+1] = elements[j];\n\t\t\t\t\telements[j] = temp;\n\t\t\t\t} else\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn elements;\n\t}", "public int[] insertionSortInt(int[] input){\r\n\t for(int i=1;i<input.length;i++){\r\n\t\t for(int j=i;j>0;j--){\r\n\t\t\t if(input[j-1]>input[j]){\r\n\t\t\t\t\tinput[j-1]=input[j-1]+input[j];\r\n\t\t\t\t\tinput[j]=input[j-1]-input[j];\r\n\t\t\t\t\tinput[j-1]=input[j-1]-input[j];\r\n\t\t\t\t}\r\n\t\t }\r\n\t }return input;\r\n }", "public static void insertionSort1(int n, List<Integer> arr) {\n List<String> steps = insertionSortSteps(arr);\n for (String step : steps) {\n System.out.println(step);\n }\n }", "public static void insertionSort(int[] array) {\n for (int i = 1; i < array.length; i++) {\n for (int j = i; j > 0 && array[j] < array[j - 1]; j--) {\n swap(array, j, j - 1);\n }\n }\n }", "public static void insertionSort(int data[], int order) {\n for (int i = 1; i < data.length; i++) {\n int j = i;\n int k = i - 1;\n while (k >= 0) {\n if (data[j] < data[k]) {\n int temp = data[j];\n data[j] = data[k];\n data[k] = temp;\n j = k;\n k--;\n }\n else\n break;\n }\n }\n }", "private static int[] insertionSort(int[] arr) {\n\t\tif(null == arr || arr.length == 0 || arr.length == 1) {\n\t\t\treturn arr;\n\t\t}\n\t\tint i, j;\n\t\tint key = 0;\n\t\tfor(i =1; i<arr.length; i++) {\n\t\t\tkey = arr[i];\n\t\t\tj = i-1;\n\t\t\twhile(j>=0 && arr[j]>key) {\n\t\t\t\tarr[j+1] = arr[j];\n\t\t\t\tj = j-1;\n\t\t\t\t\n\t\t\t}\n\t\t\tarr[j+1] = key;\n\t\t}\n\t\treturn arr;\n\t}", "public void insertionSort(int[] arr) \n {\n int i, j, newValue;\n try\n { \n //looping over the array to sort the elements\n for (i = 1; i < arr.length; i++) \n {\n thread.sleep(100);\n newValue = arr[i];\n j = i;\n if(!orderPanel) //condition for Descending order\n {\n while (j > 0 && arr[j - 1] > newValue) \n {\n arr[j] = arr[j - 1]; // swapping the elements \n repaint(); // painting the GUI\n this.setThreadState();\n j--;\n }\n }\n else // condition for Ascending order\n {\n while (j > 0 && arr[j - 1] < newValue) \n {\n arr[j] = arr[j - 1];\n repaint(); // painting the GUI\n this.setThreadState();\n j--;\n }\n }\n arr[j] = newValue;\n \n }\n }\n catch(Exception e)\n {\n System.out.println(\"Exception occured\" + e); \n }\n \n \n }", "private void testInsertionSort() {\n System.out.println(\"------ TESTING : insertionSort() ------\");\n try{\n iTestFileList.insertionSort(); // calling insertion sort function\n }catch(Exception e){\n System.out.println(e.getMessage());\n }\n }", "private static <E extends Comparable<? super E>> void insertionSort(\r\n\t\t\tComparable<E>[] data, int left, int right,\r\n\t\t\tComparator<Comparable<E>> comp) {\r\n\t\tint j;\r\n\t\tfor (int p = left + 1; p < right + 1; p++) {\r\n\t\t\tComparable<E> tmp = (Comparable<E>) data[p];\r\n\t\t\tfor (j = p; j > left && comp.compare(tmp, data[j - 1]) < 0; j--) {\r\n\t\t\t\tdata[j] = data[j - 1];\r\n\t\t\t}\r\n\t\t\tdata[j] = tmp;\r\n\t\t}\r\n\t}", "public static void sort(Comparable[] a){\n for(int i=1;i<a.length;i++){\n // Insert a[i] among a[i-1],a[i-2],a[i-3]...\n for (int j=i;j>0&&less(a[j],a[j-1]);j--){\n exch(a,j,j-1);\n }\n }\n }", "void sort (int [] items) {\r\n\tint length = items.length;\r\n\tfor (int gap=length/2; gap>0; gap/=2) {\r\n\t\tfor (int i=gap; i<length; i++) {\r\n\t\t\tfor (int j=i-gap; j>=0; j-=gap) {\r\n\t\t \t\tif (items [j] <= items [j + gap]) {\r\n\t\t\t\t\tint swap = items [j];\r\n\t\t\t\t\titems [j] = items [j + gap];\r\n\t\t\t\t\titems [j + gap] = swap;\r\n\t\t \t\t}\r\n\t \t}\r\n\t }\r\n\t}\r\n}", "public void sort() {\n\n // Fill in the blank here.\n\tfor(int i = 0; i < size; i++){\n\t\tint currentLowest, cLIndex, temp;\n\t\tcurrentLowest = elements[i];\n\t\tcLIndex = i; \n\t\tfor(int c = i+1; c < size; c++){\n\t\t\tif(currentLowest > elements[c]){\n\t\t\t\tcurrentLowest = elements[c];\n\t\t\t\tcLIndex = c;\n\t\t\t} \n\t\t}\n\t\ttemp = elements[i];\n\t\telements[i] = elements[cLIndex];\n\t\telements[cLIndex] = temp;\n\t\t\n\t}\n System.out.println(\"Sorting...\");\n }", "public int[] InsertionSort(int[] A) {\n int n = A.length;\n for(int k = 0; k < n; k++) {\n if(k == minimum) {\n int temp = A[k];\n A[k] = A[0];\n A[0] = temp;\n }\n }\n for(int i = 1; i < n; ++i) {\n int key = A[i];\n int j = i - 1;\n while(j >= minimum && A[j] > key) {\n A[j + 1] = A[j];\n j = j - 1;\n } \n A[j + 1] = key; \n }\n return A;\n }", "public static void insertSort(int[] a, int n){\n // 插入排序,把数组分为已排序区和未排序区,依次把未排序中的元素插入的已排序中\n\n for (int i = 1; i < n ; ++i){\n // 遍历已排序区,找到已排序中符合要求的位置\n // value 待插入的数据\n int value = a[i];\n // j = 已排序的区间索引前一位\n int j = i-1;\n for (;j>=0;--j){\n\n // System.out.printf(\"\\n[%s : %s]\", Arrays.stream(a).boxed().collect(Collectors.toList()).subList(0,i).toString(),Arrays.stream(a).boxed().collect(Collectors.toList()).subList(i,n).toString());\n if (a[j] > value){\n // 大于待插入的数据的都自觉往后移动一位\n a[j+1] = a[j];\n move++;\n }else {\n // 中止 当前j为目标位置\n break;\n }\n }\n a[j+1] = value;\n }\n }", "public static void InsertationSort(int[] data)\n {\n int key;\n // loop for select values from the array\n for(int i = 1; i <data.length;i++)\n {\n // key= select the value of index [i]\n key = data[i];\n // select the value that is Previous of the key to compare with.\n int j = i -1 ;\n // loop for comparing and sort, change the order of the values.\n while(j >= 0 && key < data[j])\n {\n data[j+1]=data[j];\n j--;\n }\n data[j+1]=key;\n }\n }", "@Test(timeout = SHORT_TIMEOUT)\n public void testTinyInsertionSort() {\n //size-0 arr\n toSort = new IntPlus[0];\n sortedInts = cloneArr(toSort);\n Sorting.insertionSort(sortedInts, comp);\n\n assertArrayEquals(toSort, sortedInts); //Sort can't rearrange anything\n\n //size-1 arr\n toSort = new IntPlus[1];\n toSort[0] = new IntPlus(42);\n sortedInts = cloneArr(toSort);\n Sorting.insertionSort(sortedInts, comp);\n\n assertArrayEquals(toSort, sortedInts); //Sort can't rearrange anything\n }", "public static void sort(int[] mergeList) {\n for(int i = 0; i < mergeList.length - 1; i++) { //iterate through mergeList \n int min = mergeList[i];\n int minIndex = i;\n \n\n for(int j = i + 1; j < mergeList.length; j++) { //swap current list item with smaller value \n if(mergeList[j] < min) { \n min = mergeList[j]; \n minIndex = j; \n \n }\t\t\t\t\t\n }\n \n \n if(minIndex != i) { //swap original list with sorted list\n mergeList[minIndex] = mergeList[i];\n mergeList[i] = min;\n \n }\n }\n }", "static double [] insertionSort (double a[]){\r\n //todo: implement the sort\r\n \tif(a==null){ //could be length\r\n \t\tSystem.out.print(\"Array empty\");\r\n \t\treturn null;\r\n \t}\r\n \tfor(int i = 1; i <a.length; i++) {\r\n \t\tdouble current = a[i];\r\n \t\tint j = i;\r\n \t\twhile(j>0 && a[j-1]> current) {\r\n \t\t\ta[j] =a[j-1];\r\n \t\t\tj--;\r\n \t\t} \r\n \t\ta[j]=current;\r\n \t}\r\n \treturn a;\r\n }", "@Override\r\n\tpublic List<T> sort(List<T> list) {\n\t\tassert list != null : \"list cannot be null\";\r\n\t\tfor(int i = 0; i < list.size() - 1; i ++){\r\n\t\t\tint min = i;\r\n\t\t\tfor(int j = i + 1; j < list.size(); j ++){\r\n\t\t\t\tint current = j;\r\n\t\t\t\tif(this.comparator.compare(list.get(min), list.get(current)) > 0){\r\n\t\t\t\t\tmin = current;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tswap(list, i, min);\r\n\t\t}\r\n\t\treturn list;\r\n\t}", "private void insertionSort(ArrayList<ArrayList<Piece>> combinations2) {\n for (int index = 1; index < combinations2.size(); index++) {\n ArrayList<Piece> compareWord = combinations2.get(index);\n\n int lowerIndex = index-1;\n\n while (lowerIndex >=0 && compareWord.size()<combinations2.get(lowerIndex).size()){\n combinations2.set(lowerIndex+1, combinations2.get(lowerIndex));\n lowerIndex--;\n }\n\n combinations2.set(lowerIndex+1,compareWord);\n }\n }", "public void insertionNumberSortDouble()\n {\n\t for(int j=1; j<AL.size(); j++)\n\t {\n\t\t Generics temp = AL.get(j);\n\t\t int possibleIndex = j;\n\t\t \n\t\t while(possibleIndex>0 && Double.parseDouble(AL.get(possibleIndex - 1).toString()) < Double.parseDouble(temp.toString()))\n\t\t {\n\t\t\t AL.set(possibleIndex, AL.get(possibleIndex -1));\n\t\t\t possibleIndex--;\n\t\t\t \n\t\t }\n\t\t \n\t\t AL.set(possibleIndex, temp);\n\t }\n \n }", "static\nNode sortedInsert(Node head, Node newNode) \n\n{ \n\nNode current; \n\n\n// if list is empty \n\nif\n(head == \nnull\n) \n\nhead = newNode; \n\n\n// if the node is to be inserted at the beginning \n\n// of the doubly linked list \n\nelse\nif\n(head.data >= newNode.data) \n\n{ \n\nnewNode.next = head; \n\nnewNode.next.prev = newNode; \n\nhead = newNode; \n\n} \n\n\nelse\n\n{ \n\ncurrent = head; \n\n\n// locate the node after which the new node \n\n// is to be inserted \n\nwhile\n(current.next != \nnull\n&& \n\ncurrent.next.data < newNode.data) \n\ncurrent = current.next; \n\n\n/* Make the appropriate links */\n\nnewNode.next = current.next; \n\n\n// if the new node is not inserted \n\n// at the end of the list \n\nif\n(current.next != \nnull\n) \n\nnewNode.next.prev = newNode; \n\n\ncurrent.next = newNode; \n\nnewNode.prev = current; \n\n\n} \n\nreturn\nhead; \n\n}", "private static void sort(long[] list) {\n\t\tint start = 0, limit = list.length;\n\t\t\n\t\tlong temp;\n\t\tint current;\n\t\tint lowestindex;\n\n\t\twhile (start < limit) {\n\t\t\tlowestindex = start;\n\t\t\tfor (current = start; current < limit; current++)\n\t\t\t\tif (list[current] < list[lowestindex])\n\t\t\t\t\tlowestindex = current;\n\t\t\t//swap\n\t\t\ttemp = list[start];\n\t\t\tlist[start] = list[lowestindex];\n\t\t\tlist[lowestindex] = temp;\n\t\t\tstart++;\n\t\t}\n\t}", "public void selectionSort(ArrayList <Comparable> list){\r\n\t\tsteps += 2;\r\n\t\tfor (int i = list.size() - 1; i >= 0; i--){\r\n\t\t\tsteps ++;\r\n\t\t\tint biggest = 0; \r\n\t\t\tsteps += 2;\r\n\t\t\tfor (int j = 0; j < i; j++){\r\n\t\t\t\tsteps += 4;\r\n\t\t\t\tif (list.get(j).compareTo(list.get(biggest)) > 0){\r\n\t\t\t\t\tsteps ++;\r\n\t\t\t\t\tbiggest = j;\r\n\t\t\t\t}\r\n\t\t\t\tsteps += 2;\r\n\t\t\t}\r\n\t\t\tsteps += 5;\r\n\t\t\tswap(list, i, biggest);\r\n\t\t\tsteps += 2;\r\n\t\t}\r\n\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"Selection Sort\");\r\n\t\tSystem.out.println();\r\n\t}", "static void insertIntoSorted(int ar[]) {\n\n\t\tint valueToInsert, holePosition;\n\n\t\tfor (int i = ar.length - 1; i > 0; i--) {\n\n\t\t\tvalueToInsert = ar[i];\n\t\t\tholePosition = i;\n\n\t\t\twhile (holePosition < ar.length\n\t\t\t\t\t&& ar[holePosition - 1] > valueToInsert) {\n\t\t\t\tar[holePosition] = ar[holePosition - 1];\n\t\t\t\tholePosition -= 1;\n\n\t\t\t\tdisplaySteps(ar);\n\t\t\t\tSystem.out.println();\n\t\t\t\tif (holePosition == 0) {\n\t\t\t\t\tif (ar[holePosition] > valueToInsert) {\n\t\t\t\t\t\tar[holePosition] = valueToInsert;\n\t\t\t\t\t\tdisplaySteps(ar);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tar[holePosition] = valueToInsert;\n\t\t\tif (i == 1 && holePosition != 0) {\n\t\t\t\tdisplaySteps(ar);\n\t\t\t}\n\n\t\t}\n\t}", "public int insertionSort()\n {\n // initialize the number of sort checks to 0\n int numSortChecks = 0;\n\n /** FOR INSERTION SORT, EPUT YOUR CODE HERE **/\n\n // Loop through the array of cards ... put each one in the heap\n // add to the heap ... increase the number of sort checks based\n // on the number returned from myCardHeap.add( )\n\n // Loop over all the card in the heap, keep a counter as to which card \n // number we are on\n // use extractMin() to remove a card from the heap\n // place this card into the array at the appropriate position.\n // iuncrement the numChecks variable\n\n return numSortChecks;\n }", "private boolean insetrionSort(E[] aList, int left, int right) {\n\t\t\n\t\tfor(int i=(right-1); i >= left; i--) {\n\t\t\tE insertedElement = aList[i];\n\t\t\tint j = i + 1;\n\t\t\twhile(this.compare(aList[j], insertedElement) < 0) {\n\t\t\t\taList[j-1] = aList[j];\n\t\t\t\tj++;\n\t\t\t}\n\t\t\taList[j-1] = insertedElement;\n\t\t}\n\t\treturn true;\n\t}", "@Test\n public void testSort(){\n InsertionSort sort = new InsertionSort();\n int arr[] = sort.shellInsertionSort(initArr());\n scan(arr);\n }", "public static int[] insertionSort(int[] arr, int n){\n for(int i=1; i<n; i++){\n int value = arr[i];\n int hole = i;\n while(hole > 0 && arr[hole -1] > value){\n arr[hole] = arr[hole-1];\n hole = hole - 1;\n }\n arr[hole] = value;\n }\n return arr;\n }", "public void sort(){\n ListNode t, x, b = new ListNode(null, null);\n while (firstNode != null){\n t = firstNode; firstNode = firstNode.nextNode;\n for (x = b; x.nextNode != null; x = x.nextNode) //b is the first node of the new sorted list\n if (cmp.compare(x.nextNode.data, t.data) > 0) break;\n t.nextNode = x.nextNode; x.nextNode = t;\n if (t.nextNode==null) lastNode = t;\n }\n firstNode = b.nextNode;\n }" ]
[ "0.7810198", "0.7736323", "0.759363", "0.7489948", "0.74524397", "0.745081", "0.7372652", "0.7296179", "0.72716326", "0.72670645", "0.7229206", "0.71393", "0.7137543", "0.71320546", "0.7117249", "0.7107512", "0.7100454", "0.701271", "0.6997408", "0.6981523", "0.6967522", "0.6929696", "0.6892417", "0.6833117", "0.68018955", "0.6782912", "0.67626417", "0.6760676", "0.67165697", "0.6691616", "0.6668694", "0.6655875", "0.664468", "0.6634408", "0.66119635", "0.65959024", "0.65825623", "0.6582401", "0.6571793", "0.6556785", "0.6547853", "0.6542103", "0.6528655", "0.65067405", "0.65035915", "0.6498978", "0.64840895", "0.64786685", "0.6441389", "0.6411292", "0.63841444", "0.63710725", "0.63693947", "0.63637346", "0.636302", "0.6357722", "0.63396007", "0.63394177", "0.6333594", "0.6313387", "0.6309775", "0.6308006", "0.6274169", "0.6271088", "0.62665594", "0.62660027", "0.6258129", "0.6252855", "0.6248589", "0.62463486", "0.6227144", "0.621675", "0.61960125", "0.61897063", "0.6168258", "0.61639875", "0.61629236", "0.61533785", "0.61308837", "0.6115794", "0.6102163", "0.61011887", "0.6097611", "0.60967106", "0.60881704", "0.6084611", "0.607363", "0.6073218", "0.6072935", "0.6047452", "0.6045556", "0.60252374", "0.6011047", "0.6000558", "0.59848934", "0.59679973", "0.59583765", "0.5948078", "0.59440506", "0.5943191" ]
0.77399415
1
Sorts a list using Selection Sort. Selection Sort has two cycles. The outer one iterates over the whole list. Inside it, the current index is stored as the lowest one, then it iterates over the elements after that one, if a lower element is found, its index is then stored as the lowest one. After it gets the index of the lowest item, it then gets swapped with the one in the current index of the outer loop. When the two loops are finished, the list is sorted.
public static <T extends Comparable<? super T>> void selectionSort(List<T> list){ int size = list.size(); if(size > 1){ for(int i = 0; i < size; i++){ int lowestIndex = i; for(int j = i; j < size; j++){ if(list.get(lowestIndex).compareTo(list.get(j)) > 0){ lowestIndex = j; } } if(lowestIndex != i){ swap(list, i, lowestIndex); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void selectionSort() {\n int nextMin;\n\n for (int i = 0; i < IntList.length - 1; i++) {\n nextMin = i;\n for (int j = i + 1; j < IntList.length; j++) {\n if (IntList[j] < IntList[nextMin])\n nextMin = j;\n }\n if (nextMin != i)\n swapSelection(IntList, i, nextMin);\n }\n }", "public void selectionSort(ArrayList <Comparable> list){\r\n\t\tsteps += 2;\r\n\t\tfor (int i = list.size() - 1; i >= 0; i--){\r\n\t\t\tsteps ++;\r\n\t\t\tint biggest = 0; \r\n\t\t\tsteps += 2;\r\n\t\t\tfor (int j = 0; j < i; j++){\r\n\t\t\t\tsteps += 4;\r\n\t\t\t\tif (list.get(j).compareTo(list.get(biggest)) > 0){\r\n\t\t\t\t\tsteps ++;\r\n\t\t\t\t\tbiggest = j;\r\n\t\t\t\t}\r\n\t\t\t\tsteps += 2;\r\n\t\t\t}\r\n\t\t\tsteps += 5;\r\n\t\t\tswap(list, i, biggest);\r\n\t\t\tsteps += 2;\r\n\t\t}\r\n\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"Selection Sort\");\r\n\t\tSystem.out.println();\r\n\t}", "public static void selectionSort(int[] list) {\n for (int i = 0; i < list.length - 1; i++) {\n int currentMin = list[i];\n int currentMinIndex = i;\n \n for (int j = i + 1; j < list.length; j++) {\n if (currentMin < list[j]) {\n currentMin = list[j];\n currentMinIndex = j;\n }\n }\n \n // swap list[i] with list[currentMinIndex] if necessary\n if (currentMinIndex != i) {\n list[currentMinIndex] = list[i];\n list[i] = currentMin;\n }\n }\n }", "public void selectionSort()\r\n {\r\n for(int x = 0; x < numItems; x++)\r\n {\r\n int smallestLoc = x;\r\n for(int y = x+1; y<numItems; y++)\r\n {\r\n if(mArray[y]< mArray[smallestLoc])\r\n {\r\n smallestLoc = y;\r\n }\r\n }\r\n int temp = mArray[x];\r\n mArray[x] = mArray[smallestLoc];\r\n mArray[smallestLoc] = temp;\r\n }\r\n }", "public static void selectionSort(double[] list) {\r\n for (int i = 0; i < list.length - 1; i++) {\r\n // Find the minimum in the list[i..list.length-1]\r\n \t\tint min_index = i;\r\n \t\tfor(int k = i+1; k < list.length; k++) {\r\n \t\t if(list[k] < list[min_index]) {\r\n \t\t min_index = k;\r\n }\r\n }\r\n\r\n // Swap list[i] with list[currentMinIndex] if necessary;\r\n \t\tdouble temp = list[i];\r\n \t\tlist[i] = list[min_index];\r\n \t\tlist[min_index] = temp;\r\n }\r\n }", "public static void selectionSort(int[] list) {\n for (int i=0; i<list.length-1; i++) {\n //find the minimum in the list [i... list.length-1]\n int currentMin= list[i];\n int currentMinIndex=i;\n \n for (int j=i+1; j<list.length; j++) {\n if (currentMin>list[j]) {\n currentMin=list[j];\n currentMinIndex=j;\n }\n }\n \n //swap list[i] with list[currentMinIndex] if necessary\n if (currentMinIndex != i) {\n list[currentMinIndex]=list[i];\n list[i]= currentMin;\n }\n }\n for (int j=0;j<list.length;j++) { //loop that print out all the values inputed\n System.out.print(list[j]+\" \");\n }\n }", "@Override\r\n\tpublic List<T> sort(List<T> list) {\n\t\tassert list != null : \"list cannot be null\";\r\n\t\tfor(int i = 0; i < list.size() - 1; i ++){\r\n\t\t\tint min = i;\r\n\t\t\tfor(int j = i + 1; j < list.size(); j ++){\r\n\t\t\t\tint current = j;\r\n\t\t\t\tif(this.comparator.compare(list.get(min), list.get(current)) > 0){\r\n\t\t\t\t\tmin = current;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tswap(list, i, min);\r\n\t\t}\r\n\t\treturn list;\r\n\t}", "public static void selectionSort2(IntList l) {\n\t\tIntListEntry input = l.getFirst();\n\t\tIntListEntry output = null;\n\t\twhile (input != null) {\n\t\t\tIntListEntry min = input;\n\t\t\tfor (IntListEntry e = input; e != null; e = e.getNext())\n\t\t\t\tif (e.getItem()<min.getItem())\n\t\t\t\t\tmin = e;\n\t\t\tif (min != input) {\n\t\t\t\tl.delete(min);\n\t\t\t\tif (output == null)\n\t\t\t\t\tl.prepend(min);\n\t\t\t\telse\n\t\t\t\t\tl.insertAfter(min,output);\n\t\t\t}\n\t\t\toutput = min;\n\t\t\tinput = min.getNext();\n\t\t}\n\t}", "public void sort(List<Integer> listToSort){\n\t\t\n\t\t//loop through all list value\n\t\tfor (int i = 0; i < listToSort.size() - 1; i++) {\n\t\t\tint index = i;//store value position to be swapped if required\n\t\t\t\n\t\t\t//loop through all list values looking for one that is lower than that of position index\n\t\t\tfor (int j = i + 1; j < listToSort.size(); j++) {\n\t\t\t\tif (listToSort.get(j) < listToSort.get(index)) {\n\t\t\t\t\tindex = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//swap values at position index and i if required\n\t\t\tif (index != i) {\n\t\t\t\tint temp = listToSort.get(index); \n\t\t\t\tlistToSort.set(index, listToSort.get(i));\n\t\t\t\tlistToSort.set(i, temp);\t\t\t\n\t\t\t}\n\t\t}\n\t}", "private static void sort(long[] list) {\n\t\tint start = 0, limit = list.length;\n\t\t\n\t\tlong temp;\n\t\tint current;\n\t\tint lowestindex;\n\n\t\twhile (start < limit) {\n\t\t\tlowestindex = start;\n\t\t\tfor (current = start; current < limit; current++)\n\t\t\t\tif (list[current] < list[lowestindex])\n\t\t\t\t\tlowestindex = current;\n\t\t\t//swap\n\t\t\ttemp = list[start];\n\t\t\tlist[start] = list[lowestindex];\n\t\t\tlist[lowestindex] = temp;\n\t\t\tstart++;\n\t\t}\n\t}", "static void SelectionSort(int[] arr){\n int minIndex;\n for(int i = 0; i<arr.length-1; i++){\n minIndex = i;\n for(int j = i+1; j<arr.length;j++){\n if(arr[minIndex]>arr[j]){\n minIndex = j;\n }\n }\n if(minIndex>i){\n Swap(arr,i,minIndex);\n }\n }\n }", "public void sortIncreasing()\n {\n int min;\n \n for (int i = 0; i < list.length - 1; i++)\n {\n min = i; \n for(int j = i+1; j < list.length; j++)\n {\n if(list[j] < list[min])\n min = j; \n }\n if(i != min && list[min] < list.length)\n {\n int temp = list[min];\n list[min] = list[i];\n list[i] = temp; \n }\n }\n }", "public static void sort(int[] mergeList) {\n for(int i = 0; i < mergeList.length - 1; i++) { //iterate through mergeList \n int min = mergeList[i];\n int minIndex = i;\n \n\n for(int j = i + 1; j < mergeList.length; j++) { //swap current list item with smaller value \n if(mergeList[j] < min) { \n min = mergeList[j]; \n minIndex = j; \n \n }\t\t\t\t\t\n }\n \n \n if(minIndex != i) { //swap original list with sorted list\n mergeList[minIndex] = mergeList[i];\n mergeList[i] = min;\n \n }\n }\n }", "public void sort() {\n ListNode start = head;\n ListNode position1;\n ListNode position2;\n\n // Going through each element of the array from the second element to the end\n while (start.next != null) {\n start = start.next;\n position1 = start;\n position2 = position1.previous;\n // Checks if previous is null and keeps swapping elements backwards till there\n // is an element that is bigger than the original element\n while (position2 != null && (position1.data < position2.data)) {\n swap(position1, position2);\n numberComparisons++;\n position1 = position2;\n position2 = position1.previous;\n }\n }\n }", "public static void sort(ArrayList<Integer> list) {\n\t\tint temp;\n\t\tfor (int i=0; i < list.size() ; i++) {\n\t\t\tfor (int j=i+1;j<list.size()-1;j++){\n\t\t\t\tif(list.get(i)>list.get(j)){\n\t\t\t\t\ttemp = list.get(i);\n\t\t\t\t\tlist.set(i,list.get(j));\n\t\t\t\t\tlist.set(j, temp);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static void Selectionsort(int a[]) { \n\t int n = a.length; \n\t for (int i = 0; i < n-1; i++) \n\t { \n\t int min_idx = i; \n\t for (int j = i+1; j < n; j++) \n\t if (a[j] < a[min_idx]) \n\t min_idx = j; \n\t \n\t int temp = a[min_idx]; \n\t a[min_idx] = a[i]; \n\t a[i] = temp; \n\t } \n\t }", "@Override\r\n\tpublic void sort() {\r\n\t\tint minpos;\r\n\t\tfor (int i = 0; i < elements.length-1; i++) {\r\n\t\t\tminpos=AuxMethods.minPos(elements, i);\r\n\t\t\telements=AuxMethods.swapElements(elements, i, minpos);\r\n\t\t\t\r\n\t\t}\r\n\t}", "public void stringSelectionSort() {\n int nextMin;\n\n for (int i = 0; i < StringList.length - 1; i++) {\n nextMin = i;\n for (int j = i + 1; j < StringList.length; j++) {\n if (StringList[j].compareTo(StringList[nextMin]) < 0)\n nextMin = j;\n }\n if (nextMin != i)\n swapSelectionStrings(StringList, i, nextMin);\n }\n }", "public void sort() {\n\n // Fill in the blank here.\n\tfor(int i = 0; i < size; i++){\n\t\tint currentLowest, cLIndex, temp;\n\t\tcurrentLowest = elements[i];\n\t\tcLIndex = i; \n\t\tfor(int c = i+1; c < size; c++){\n\t\t\tif(currentLowest > elements[c]){\n\t\t\t\tcurrentLowest = elements[c];\n\t\t\t\tcLIndex = c;\n\t\t\t} \n\t\t}\n\t\ttemp = elements[i];\n\t\telements[i] = elements[cLIndex];\n\t\telements[cLIndex] = temp;\n\t\t\n\t}\n System.out.println(\"Sorting...\");\n }", "public static void selectionSort(int input[]) {\n\t\tfor(int i = 0;i<input.length-1;i++) {\n\t\t\tint min = input[i];\n\t\t\tint minindex = i;\n\t\t\tfor(int j = i+1 ;j<input.length;j++) {\n\t\t\t\tif(min > input[j] ) {\n\t\t\t\t\tmin = input[j];\n\t\t\t\t\tminindex = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(minindex!=i) {\n\t\t\tinput[minindex] = input[i];\n\t\t\t input[i]= min;\n\t\t\t}\n\t\t}\n\t}", "public void selectionSort(int [] nums) {\n\t\tfor(int i=0;i<nums.length;i++) {\n\t\t\tint min=i;\n\t\t\tfor(int j=i+1;j<nums.length;j++) {\n\t\t\t\tif(less(nums[j],nums[i])) \n\t\t\t\t\tmin=j;\n\t\t\t}\n\t\t\tswap(nums,i,min);\n\t\t}\n\t}", "public void selectionSort(int [] nums) {\n\t\tfor(int i=0;i<nums.length;i++) {\n\t\t\tint min=i;\n\t\t\tfor(int j=i+1;j<nums.length;j++) {\n\t\t\t\tif(less(nums[j],nums[i])) \n\t\t\t\t\tmin=j;\n\t\t\t}\n\t\t\tswap(nums,i,min);\n\t\t}\n\t}", "public void selectionSort(int[] x)\n {\n for (int i = 0; i < x.length-1; i++) {\n int minIndex = i;\n for (int j = i+1; j < x.length; j++) {\n if (x[minIndex] > x[j]) {\n minIndex = j;\n }\n }\n int temp = x[i];\n x[i] = x[minIndex];\n x[minIndex] = temp;\n }\n \n public void replaceFirst(int oldVal, int newVal)\n {\n \n }\n}", "public void selectionSort(){\n for(int x=0; x < arraySize; x++){\n int minimum = x;\n for(int y = x; y < arraySize; y++){\n // Change to < for descending sort\n if(theArray[minimum] > theArray[y]){\n minimum = y;\n }\n }\n swapValues(x, minimum);\n printHorizontalArray(x, -1);\n }\n }", "public static void selectionSort(double [] list1)\r\n\t{\r\n\t\tdouble temp= 0.0;\r\n\t\tint smallest=0;\r\n\t\r\n\t\tfor(int outside=0; outside<list1.length; outside++)\r\n\t\t{\r\n\t\t\t//System.out.println(\"Outside: \" + outside);\r\n\t\t\tsmallest=outside;\r\n\t\t\tfor(int inside=1+outside; inside<list1.length; inside++)\r\n\t\t\t{\r\n\t\t\t\tif(list1[inside]<list1[smallest])\r\n\t\t\t\t{\r\n\t\t\t\t\tsmallest = inside;\t\t\r\n\t\t\t\t\t//System.out.println(smallest);\r\n\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\ttemp=list1[smallest];\r\n\t\t\tlist1[smallest]=list1[outside];\r\n\t\t\tlist1[outside]=temp;\r\n\t\t}\r\n\t}", "public void sort(){\n startTime = System.nanoTime();\n int smallest = array[0]; \n int smallestIndex = 0;\n\n for (int i = 0; i < array.length - 1; i++){\n smallest = array[i];\n smallestIndex = i;\n //find smallest number \n for (int j = i; j < array.length; j++){\n if (array[j] < smallest) {\n smallest = array[j];\n smallestIndex = j;\n }\n }\n //swap smallest to the front\n swap(array, i, smallestIndex);\n }\n endTime = System.nanoTime();\n }", "static <T extends Comparable<T>> List<T> sort(List<T> list) {\n\t\tif (list == null || list.size() < 2) {\n\t\t\treturn list;\n\t\t}\n\t\tfor (int i = 1; i < list.size(); i++) {\n\t\t\t// the current is begin from index of 1\n\t\t\tT current = list.get(i);\n\t\t\tint j = i - 1;\n\t\t\tint origin = j;\n\t\t\twhile (j >= 0 && list.get(j).compareTo(current) > 0) {\n\t\t\t\t// insert into the head of the sorted list\n\t\t\t\t// or as the first element into an empty sorted list\n\t\t\t\t// last element of the sorted list\n\t\t\t\t// middle of the list\n\t\t\t\t// insert into middle of the sorted list or as the last element\n\t\t\t\tlist.set(j + 1, list.get(j));\n\t\t\t\tj--;\n\t\t\t}\n\t\t\tlist.set(j + 1, current);\n\t\t\tprintInsertionSortAnimation(list, current, j, origin);\n\t\t\tSystem.out.println();\n\t\t}\n\n\t\treturn list;\n\t}", "public static IntList selectionSort1(IntList input) {\n\t\tIntList output = new SimpleIntList();\n\t\twhile (!input.isEmpty()) {\n\t\t\tIntListEntry min = input.getFirst();\n\t\t\tfor (IntListEntry e = input.getFirst(); e != null; e = e.getNext())\n\t\t\t\tif (e.getItem()<min.getItem())\n\t\t\t\t\tmin = e;\n\t\t\tinput.delete(min);\n\t\t\toutput.append(min);\n\t\t}\n\t\treturn output;\n\t}", "static void selectionSort(int a[])\n {\n int n = a.length;\n for(int i = 0; i < n-1; i++)\n {\n for(int j = i + 1; j < n; j++)\n {\n if(a[i] > a[j])\n swap(a,i,j);\n }\n }\n }", "public static void selectionSort(List<Integer> values) {\r\n for (int i = 0; i < values.size(); i++) {\r\n int j = findPosMin(values, i);\r\n swap(values, i, j);\r\n } // for\r\n }", "public static void selectionSorter(int[] arr) {\n //run n-1 times where n is array length\n for(int i = 0; i < arr.length - 1; i++) {\n //find the minimum element in unsorted list\n //swap it with arr[i]\n int min = i;\n for(int j = i + 1; j < arr.length; j++) {\n if(arr[j] < arr[min]) {\n min = j;\n }\n }\n swap(arr,min,i);\n }\n }", "public static void selectionSort (int[] elts) {\r\n\t\tint minPosition;\r\n\t\tint length = elts.length;\r\n\t\tfor (int i = 0; i < length-1; i++) {\r\n\t\t\tminPosition = findMinPositionSegment (elts, i, length-i);\r\n\t\t\tif (minPosition != i)\r\n\t\t\t\tswap (elts, i, minPosition);\r\n\t\t}\r\n\t}", "public static void selectionSort (int[] elts) {\r\n\t\tint minPosition;\r\n\t\tint length = elts.length;\r\n\t\tfor (int i = 0; i < length-1; i++) {\r\n\t\t\tminPosition = findMinPositionSegment (elts, i, length-i);\r\n\t\t\tif (minPosition != i)\r\n\t\t\t\tswap (elts, i, minPosition);\r\n\t\t}\r\n\t}", "static void selectionSort(int[] arr) {\n\t\t\t\n\t\tfor(int i = 0; i<arr.length-1;i++) {\n\t\t\tint index =i;\n\t\t\tfor(int j =i+1; j<arr.length;j++) {\n\t\t\t\tif(arr[j]<arr[index]) {\n\t\t\t\t\tindex = j; //finding the smallest index\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\t//Swap the found minimum element with the first element\n\t\t\tint temp = arr[index]; \n arr[index] = arr[i]; \n arr[i] = temp;\n\t\t\t\t\t\t}\t\n\t\tfor(int a:arr) \n\t\t{\t\n\t\t\tSystem.out.print(a+ \" \");\n\t\t}\n\t\tSystem.out.println();\n\t\t\n\t}", "public static void selectionSort(int[] data){\n\n\tfor(int i = 0; i < data.length; i++){\n\t int min = data[i];\n\t int indexToReplace = i;\n\n\t for(int k = i; k < data.length; k++){\n\t\tif(data[k] < min){\n\t\t indexToReplace = k;\n\t\t min = data[k];\n\t\t}\n\t }\n\n\t int old = data[i];\n\t data[i] = min;\n\t data[indexToReplace] = old;\n\t}\n }", "public void sort(){\n ListNode t, x, b = new ListNode(null, null);\n while (firstNode != null){\n t = firstNode; firstNode = firstNode.nextNode;\n for (x = b; x.nextNode != null; x = x.nextNode) //b is the first node of the new sorted list\n if (cmp.compare(x.nextNode.data, t.data) > 0) break;\n t.nextNode = x.nextNode; x.nextNode = t;\n if (t.nextNode==null) lastNode = t;\n }\n firstNode = b.nextNode;\n }", "public static void selectionSort(int[] a) \n {\n for (int i = 0; i < a.length; i++) \n {\n int minPos = minimumPosition(a, i);\n swap(a, minPos, i);\n }\n }", "public static void selectionSort (int array[])\n {\n for (int i = 0; i < (array.length -1); i++)\n {\n for (int j = i + 1; j < (array.length); j++)\n {\n if(array[i] > array[j])\n //the new found smallest element is swapped\n swap(array, j, i);\n }\n }\n }", "public static void selectionSort(int[] array) {\n int iOfTempMin;\n\n for (int i = 0; i < array.length - 1; i++) {\n iOfTempMin = i; // 1 - FIND INDEX OF MIN\n \n for (int index = i + 1; index < array.length; index++) {\n \n if (array[index] < array[iOfTempMin])\n iOfTempMin = index; \n }\n swap(array, i, iOfTempMin); // 2 - SWAP\n }\n }", "public static void selectionSort(int[] a) {\r\n int temp; // catalyst variable for Integer swapping\r\n int spot; //location in array where minimum will be inserted\r\n int minimum; //location of minimum value in remainder\r\n\r\n for (spot = 0; spot < a.length - 1; spot++) {\r\n minimum = spot; //\r\n for (int i = spot + 1; i < a.length; i++) {\r\n if (a[i] < a[minimum]) {\r\n minimum = i; //if i is less than minimum, i is new minimum\r\n }\r\n }//end for i\r\n\r\n //swap a[spot] and a[minimum]\r\n temp = a[minimum];\r\n a[minimum] = a[spot];\r\n a[spot] = temp;\r\n }//end for spot\r\n }", "public int[] selectionSort(int[] lista) {\r\n\t for (int i = 0; i < lista.length; i++) {\r\n\t int inicial = lista[i];\r\n\t int minId = i;\r\n\t for (int j = i+1; j < lista.length; j++) {\r\n\t if (lista[j] < inicial) {\r\n\t inicial = lista[j];\r\n\t minId = j;\r\n\t }\r\n\t }\r\n\t // swapping\r\n\t int cambiar = lista[i];\r\n\t lista[i] = inicial;\r\n\t lista[minId] = cambiar;\r\n\t }\r\n\t return lista;\r\n\t}", "public static void selectionSort (int[] arr)\n {\n for (int x = 0; x < arr.length; x++)\n {\n //A variable is used to keep track of the index of the current minumum value\n int minimum = x; \n //The second loop is used to find the smallest element in the unsorted section of the array\n for (int y = x + 1; y < arr.length; y++)\n {\n if (arr[y] < arr[minimum])\n minimum = y;\n }\n //A temporary variable allows the minimum element and the element after the sorted sectino to be swapped\n int temp = arr [minimum];\n arr [minimum] = arr [x];\n arr [x] = temp;\n }\n }", "public void simpleSelectionSort(int start, int end, int[] array) {\n\t\tfor (int i = start; i <= end - 1; i++) {\n\t\t\tint minIndex = i;\n\t\t\tfor (int k = i + 1; k <= end; k++) {\n\t\t\t\tif (array[k] < array[minIndex]) {\n\t\t\t\t\tminIndex = k;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Yes, find smaller element\n\t\t\tif (minIndex != i) {\n\t\t\t\tCommUtil.swap(i, minIndex, array);\n\t\t\t}\n\t\t}\n\t}", "public void sortList() {\n Node3 current = front, index = null;\n student temp;\n\n if(front == null) {\n return;\n }\n else {\n while(current != null) {\n //Node index will point to node next to current\n index = current.getNext();\n\n while(index != null) {\n //If current node's data is greater than index's node data, swap the data between them\n if(current.getData().getRoll()> index.getData().getRoll()) {\n temp = current.getData();\n current.setData(index.getData());\n index.setData(temp);\n }\n index = index.getNext();\n }\n current = current.getNext();\n }\n }\n }", "public static void selectionSort(int[] arr) {\n for (int firstUnordered = 0; firstUnordered < arr.length; firstUnordered++) {\n int smallestIndex = firstUnordered;\n for (int j = firstUnordered; j < arr.length; j++) {\n if (arr[j] < arr[smallestIndex]) {\n smallestIndex = j;\n }\n }\n int aux = arr[firstUnordered];\n arr[firstUnordered] = arr[smallestIndex];\n arr[smallestIndex] = aux;\n }\n }", "public static int[] selectionSort(int[] array)\r\n {\n for (int i = 0; i < array.length-1; i++)\r\n {\r\n // This variable will keep track of the index of the smallest\r\n // element found during this pass of the unsorted portion of the\r\n // array. Since we start at i, that will be the smallest as we\r\n // start each iteration of the outer loop.\r\n int minIndex = i;\r\n \r\n // this inner for loop starts at i+1 and searches through the entire\r\n // remaining unsorted array to see if it can find an item that is\r\n // less than what is currently at array[minIndex]\r\n for (int j = i+1; j < array.length; j++)\r\n {\r\n // during each iteration of this inner loop, check to see if the\r\n // item we are currently looking at is less than the item at\r\n // array[minIndex]. If it is less, we need to change our\r\n // minIndex to be set to the current index we are looking at, in\r\n // this case j.\r\n if (array[j] < array[minIndex])\r\n {\r\n minIndex = j;\r\n }\r\n }\r\n \r\n // once we have found the smallest element in the unsorted portion\r\n // of the array, we need to swap it with the item at index i. But we\r\n // don't want to do this if they are the same index, so if minIndex\r\n // equals i, then do nothing, otherwise we need to perform the swap.\r\n if (minIndex != i)\r\n {\r\n int temp = array[i];\r\n array[i] = array[minIndex];\r\n array[minIndex] = temp;\r\n }\r\n }\r\n \r\n return array;\r\n }", "static void selectionSort(int arr[]) {\n\t\tfor (int i = 0; i < arr.length - 1; i++) {\r\n\t\t\tfor (int j = i + 1; j < arr.length; j++) {\r\n\t\t\t\tif (arr[i] > arr[j]) {\r\n\t\t\t\t\tswap(arr, i, j);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void SelectionSort(int[] array) {\n for (int i=0; i<array.length; i++){\n int min_element = array[i];\n int min_ind = i;\n for (int j=i; j<array.length; j++) {\n if (array[j] < min_element) {\n min_element = array[j];\n min_ind = j;\n }\n }\n swap(array, i, min_ind);\n }\n }", "public void selectionSort(int[] array){\n for(int position = 0; position < array.length; position++){\r\n // go through the rest looking for a smaller number\r\n for(int i = position+1; i < array.length; i++){\r\n // have we found smaller?\r\n if(array[i] < array[position]){\r\n // swap numbers\r\n swap(array, i, position);\r\n }\r\n }\r\n }\r\n }", "public static void sort(ArrayList<Number> list) {\r\n\t\t\t\t\tfor (int i = 0; i < list.size(); i++) {\r\n\t\t\t\t\t\tfor (int j = 0; j < list.size(); j++) {\r\n\t\t\t\t\t\t\t// Ako je vrijadnost elementa na idneksu i manja od vrijednosti\r\n\t\t\t\t\t\t\t// elementa na idneksu j, zamijeni im pozicije.\r\n\t\t\t\t\t\t\tif (list.get(i).doubleValue() < list.get(j).doubleValue()) {\r\n\t\t\t\t\t\t\t\t// Cuvamo elemenat sa drugog indeksa u temp varijabli.\r\n\t\t\t\t\t\t\t\tNumber temp = list.get(j);\r\n\t\t\t\t\t\t\t\t// Kopiramo elemenat sa prvog indeksa preko drugog elementa.\r\n\t\t\t\t\t\t\t\tlist.set(j, list.get(i));\r\n\t\t\t\t\t\t\t\t// Kopiramo temp (drugi elemenat) preko prvog elementa.\r\n\t\t\t\t\t\t\t\tlist.set(i, temp);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t}", "public static void sequentialSort(List<Integer> list, int start, int end) {\n if (start >= end)\n return;\n // recursive case\n\n // now sort into two sections so stuff in lower section is less than\n // pivot, and remainder is in upper section.\n int pivot = list.get((start + end) / 2);\n int lower = start;\n int upper = end - 1;\n\n while (lower < upper) {\n int lowerItem = list.get(lower);\n int upperItem = list.get(upper);\n if (lowerItem < pivot)\n // this item is not out of place\n lower++;\n else if (upperItem > pivot)\n // this item is not out of place\n upper--;\n else {\n // both items are out of place --- so swap them.\n list.set(lower, upperItem);\n list.set(upper, lowerItem);\n if (upperItem != pivot)\n lower++;\n if (lowerItem != pivot)\n upper--;\n }\n }\n\n list.set(lower, pivot);\n\n ParSort.pause(list, 100); // to make animation in display mode better\n\n // A this point, lower == upper.\n ParSort.sequentialSort(list, start, lower);\n ParSort.sequentialSort(list, lower + 1, end);\n }", "private static void sort2(int[] a) {\n for(int i=0; i<a.length; i++){\n //find smallest from i to end \n int minIndex=i;\n for(int j=i ; j<a.length; j++)\n if(a[j]<a[minIndex])\n minIndex=j;\n //swap\n int t = a[i];\n a[i] = a[minIndex];\n a[minIndex] = t;\n }\n }", "public static void selection(double[] list){\n \n double currentMin = 0;\n int currentMinIndex = 0;\n \n // searches overall array\n for(int i = 0; i < list.length - 1; i++){\n currentMin = list[i];\n currentMinIndex = i;\n \n // This is where the array will be sorted\n for(int j = i + 1; j < list.length; j++){\n // will comapre current numbers to next\n if(currentMin < list[j]){\n currentMin = list[j];\n currentMinIndex = j;\n }\n }\n \n // This is where the values are swaped\n if(currentMinIndex != i){\n list[currentMinIndex] = list[i];\n list[i] = currentMin;\n }\n } \n }", "public static void selectionSort(int[] data){\n\n int sfIndex, lowestSF, store;\n sfIndex = 0;\n for (int i = 0; i < data.length; i++){\n lowestSF = data[i];\n for (int j = i; j < data.length; j++){\n if (data[j] < lowestSF){\n lowestSF = data[j];\n sfIndex = j;\n }\n }\n store = data[i];\n data[i] = lowestSF;\n data[sfIndex] = store;\n }\n }", "private List<Integer> sort(List<Integer> list) {\n List<Integer> sorted = new ArrayList<Integer>();\n if (list.size() == 0) {\n return list;\n } else {\n List<Integer> l = new ArrayList<Integer>();\n Integer m = list.get(0);\n List<Integer> h = new ArrayList<Integer>();\n \n for(int i : list.subList(1, list.size())) {\n if (i > m)\n h.add(i);\n else\n l.add(i);\n }\n \n sorted.addAll(sort(l));\n sorted.add(m);\n sorted.addAll(sort(h));\n }\n return sorted;\n }", "void sort (int [] items) {\r\n\tint length = items.length;\r\n\tfor (int gap=length/2; gap>0; gap/=2) {\r\n\t\tfor (int i=gap; i<length; i++) {\r\n\t\t\tfor (int j=i-gap; j>=0; j-=gap) {\r\n\t\t \t\tif (items [j] <= items [j + gap]) {\r\n\t\t\t\t\tint swap = items [j];\r\n\t\t\t\t\titems [j] = items [j + gap];\r\n\t\t\t\t\titems [j + gap] = swap;\r\n\t\t \t\t}\r\n\t \t}\r\n\t }\r\n\t}\r\n}", "private void selectionSort(T[] arr) {\n for (int i = 0; i < n; i++) {\n int min = i; // the index of the minimal element is set to i by default\n for (int j = i + 1; j < n; j++) {\n if (arr[j].compareTo(arr[min]) < 0)\n min = j;\n }\n swap(arr, i, min);\n }\n }", "public void sort() {\r\n int k = start;\r\n for (int i = 0; i < size - 1; i++) {\r\n int p = (k + 1) % cir.length;\r\n for (int j = i + 1; j < size; j++) {\r\n if ((int) cir[p] < (int) cir[k % cir.length]) {\r\n Object temp = cir[k];\r\n cir[k] = cir[p];\r\n cir[p] = temp;\r\n }\r\n p = (p + 1) % cir.length;\r\n }\r\n k = (k + 1) % cir.length;\r\n }\r\n }", "@Test\n public void testSelectionSort(){\n SimpleList<Integer> simpleList = new SimpleList<Integer>();\n simpleList.append(1);\n simpleList.append(2);\n simpleList.append(3);\n simpleList.append(4);\n simpleList.append(5);\n simpleList.append(6);\n simpleList.append(7);\n simpleList.append(8);\n simpleList.append(9);\n simpleList.append(10);\n Sorter.selectionSort(simpleList);\n List<Integer> list = simpleList.getList();\n Integer[] expected = new Integer[]{10,9,8,7,6,5,4,3,2,1};\n Integer[] real = new Integer[simpleList.size()];\n list.toArray(real);\n assertArrayEquals(expected, real);\n }", "public void shellSort(){\n int increment = list.size() / 2;\n while (increment > 0) {\n for (int i = increment; i < list.size(); i++) {\n int j = i;\n int temp = list.get(i);\n while (j >= increment && list.get(j - increment) > temp) {\n list.set(j, list.get(j - increment));\n j = j - increment;\n }\n list.set(j, temp);\n }\n if (increment == 2) {\n increment = 1;\n } else {\n increment *= (5.0 / 11);\n }\n }\n }", "public static void selectionSort(Comparable[] a) {\n int n = a.length;\n int im;\n for (int i = 0; i < n; i++) {\n im = i;\n for (int j = im; j < n; j++) {\n // Find the min\n if (less(a[j], a[im])) im = j;\n if (i != im) exch(a, i, im);\n }\n }\n }", "public static <E> void selectionSort(E[] list,\n\t\t\tComparator<? super E> comparator) {\n\t\tfor (int i = 0; i < list.length - 1; i++) {\n\t\t\t// Find the minimum in the list[i..list.length-1]\n\t\t\tE currentMin = list[i];\n\t\t\tint currentMinIndex = i;\n\n\t\t\tfor (int j = i + 1; j < list.length; j++) {\n\t\t\t\tif (comparator.compare(currentMin, list[j]) > 0) {\n\t\t\t\tcurrentMin = list[j];\n\t\t\t\tcurrentMinIndex = j;\n\t\t\t}\n\t\t}\n\n\t\t// Swap list[i] with list[currentMinIndex] if necessary\n\t\tif (currentMinIndex != i) {\n\t\t\t\tlist[currentMinIndex] = list[i];\n\t\t\t\tlist[i] = currentMin;\n\t\t\t}\n\t\t}\n\t}", "private void sort()\n {\n // This implements Shell sort.\n // Unfortunately we cannot use the sorting functions from the library\n // (e.g. java.util.Arrays.sort), since the ones that work on int\n // arrays do not accept a comparison function, but only allow\n // sorting into natural order.\n int jump = length;\n boolean done;\n \n while( jump>1 ){\n jump /= 2;\n \n do {\n done = true;\n \n for( int j = 0; j<(length-jump); j++ ){\n int i = j + jump;\n \n if( !areCorrectlyOrdered( indices[j], indices[i] ) ){\n // Things are in the wrong order, swap them and step back.\n int tmp = indices[i];\n indices[i] = indices[j];\n indices[j] = tmp;\n done = false;\n }\n }\n } while( !done );\n }\n \n // TODO: integrate this with the stuff above.\n for( int i=1; i<length; i++ ){\n commonality[i] = commonLength( indices[i-1], indices[i] );\n }\n commonality[0] = -1;\n }", "public void selectionSort(int [] array) {\n\t\t\n\t\t//10,3,6,13,2,1\n\t\t//1,3,6,13,2,10 \n\t\t//1,2,6,13,3,10\n\t\t//1,2,3,13,6,10\n\t\t//1,2,3,6,13,10\n\t\t//1,2,3,6,10,13\n\t\t\n\t\tint minValue = 0;\n\t\tint minIndex = 0; \n\t\t\n\t\tfor(int i=0; i<array.length-1; i++) {\n\t\t\t\n\t\t\tminValue = array[i];\n\t\t\t\n\t\t\tfor(int j=i; j<array.length; j++) {\n\t\t\t\t\n\t\t\t\tif(array[j]<minValue) {\n\t\t\t\t\t\n\t\t\t\t\tminValue = array[j];\n\t\t\t\t\tminIndex = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\tint temp = array[i];\n\t\t\tarray[i] = array[minIndex];\n\t\t\tarray[minIndex] = temp;\n\t\t\tSystem.out.println(Arrays.toString(array));\n\t\t}\n\t}", "public static void selectionSort(int[] arr) {\r\n\t\tfor (int pos = 0; pos < arr.length - 1; pos++) {\r\n\t\t\tint minIdx = pos;\r\n\t\t\tfor (int scan = pos + 1; scan < arr.length; scan++)\r\n\t\t\t\tif (arr[scan] < arr[minIdx])\r\n\t\t\t\t\tminIdx = scan;\r\n\r\n\t\t\tif (pos != minIdx) {\r\n\t\t\t\tint temp = arr[pos];\r\n\t\t\t\tarr[pos] = arr[minIdx];\r\n\t\t\t\tarr[minIdx] = temp;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public SortingAlgorithmResult<E> sort(List<E> l);", "private void sortArray(int[] myArray) {\n\t\t// Selection sort\n\t\tint n = myArray.length;\n\t\tint temp = 0;\n\t\t\n\t\tfor(int i=0; i<n-1; i++) {\n\t\t\t\n\t\t\tint min = i;\n\t\t\t\n\t\t\tfor(int j=n-1; j>i; j--) {\n\t\t\t\tif( myArray[j] < myArray[min] ) {\n\t\t\t\t\tmin = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif( min != i ) {\n\t\t\t\ttemp = myArray[i];\n\t\t\t\tmyArray[i] = myArray[min];\n\t\t\t\tmyArray[min] = temp;\n\t\t\t}\n\t\t}\n\t}", "public static int[] selectionSort(int[] array) {\n\n if(array.length== 0) {\n return new int[] {};\n }\n\n int[] arraySorted = new int[array.length];\n int[] arrayWaitToSorted = new int[array.length];\n\n\n\n int startIndex = 0;\n while ( startIndex < array.length ) {\n int swapMinIndex = startIndex;\n\n\n\n\n\n for (int j = startIndex+1; j < array.length ; j++) {\n\n\n if (array[j] < array[swapMinIndex] ) {\n swapMinIndex = j;\n }\n\n }\n\n int temp = array[swapMinIndex];\n array[swapMinIndex] = array[startIndex];\n array[startIndex] = temp;\n\n startIndex++;\n\n\n\n// int temp = array[swapMinIndex];\n// arraySorted[i] = array[swapMinIndex];\n// array[swapMinIndex]= array[i];\n }\n\n\n\n\n// return arraySorted;\n return array;\n }", "private static ArrayList<Integer> sort(ArrayList<Integer> v) {\n\t\tint key, i, j; \n\t\tfor (j = 1; j != v.size(); j++) {\n\t\t\tkey = v.get(j); \n\t\t\ti = j - 1; \n\t\t\twhile ((i >= 0) && (v.get(i) > key)) {\n\t\t\t\tv.set(i+1, v.get(i));\n\t\t\t\ti -= 1; \n\t\t\t}\n\t\t\tv.set(i+1, key); \n\t\t}\n\t\treturn v; \n\t}", "public static void selectionSort(int[] arr) {\n\t\tfor (int i = 0; i < arr.length; i++) {\n\t\t\tint min_index = i;\n\t\t\tfor (int j = i; j < arr.length; j++) {\n\t\t\t\tif (arr[min_index] > arr[j])\n\t\t\t\t\tmin_index = j;\n\t\t\t}\n\t\t\tif (min_index != i) \n\t\t\t\tUtilities.swap(arr, i, min_index);\n//\t\t\tSystem.out.println(Arrays.toString(arr));\n\t\t}\n\t}", "public static void sort(Object[] object) {\n // Set the variables for the current min, minIndex, and compare value\n Object currentMin;\n int currentMinIndex;\n int compareInt;\n\n // Begin loop to work through the list.\n for (int i = 0; i < object.length; i++) {\n // Find the minimum in the list.\n currentMin = object[i];\n currentMinIndex = i;\n for (int k = i + 1; k < object.length; k++) {\n compareInt = ((Comparable) currentMin).compareTo(object[k]);\n if(compareInt > 0) {\n currentMin = object[k];\n currentMinIndex = k;\n }\n }\n\n // Swap list[i] with list[currentMaxIndex] if needed.\n if (currentMinIndex != i) {\n object[currentMinIndex] = object[i];\n object[i] = currentMin;\n }\n }\n }", "private static LinkedList<Integer> sortIntList(LinkedList<Integer> list)\n\t{\n\t\t// Sort LinkedList\n\t\tCollections.sort(list, new Comparator<Integer>()\n\t\t{\n\t\t\t @Override\n\t\t\t public int compare(Integer int1, Integer int2)\n\t\t\t {\n\t\t\t if(int1 < int2){\n\t\t\t return -1; \n\t\t\t }\n\t\t\t if(int1 > int2){\n\t\t\t return 1; \n\t\t\t }\n\t\t\t return 0;\n\t\t\t }\n\t\t});\n\t\treturn list;\n\t}", "public static void sort(Comparable[] a) {\n for (int i = 0 ; i < a.length ; i++) { // each position scan\n int min = i;\n for (int j = i+1; j < a.length; j++) { // each time we have to scan through remaining entry\n if (HelperFunctions.less(a[j], a[min])) {\n min = j ;\n }\n HelperFunctions.exch(a, i, min);\n }\n }\n }", "static void selectionSort(int[] A) {\n\t // Sort A into increasing order, using selection sort\n\t \n\t for (int lastPlace = A.length-1; lastPlace > 0; lastPlace--) {\n\t // Find the largest item among A[0], A[1], ...,\n\t // A[lastPlace], and move it into position lastPlace \n\t // by swapping it with the number that is currently \n\t // in position lastPlace.\n\t \n\t int maxLoc = 0; // Location of largest item seen so far.\n\t \n\t for (int j = 1; j <= lastPlace; j++) {\n\t if (A[j] > A[maxLoc]) {\n\t // Since A[j] is bigger than the maximum we've seen\n\t // so far, j is the new location of the maximum value\n\t // we've seen so far.\n\t maxLoc = j; \n\t }\n\t }\n\t \n\t int temp = A[maxLoc]; // Swap largest item with A[lastPlace].\n\t A[maxLoc] = A[lastPlace];\n\t A[lastPlace] = temp;\n\t \n\t } // end of for loop\n\t \n\t}", "private static void sortList(ArrayList<ArrayList<Integer>> list){\n for (int i = 0; i < list.size(); i++) {\n for (int j = list.size() - 1; j > i; j--) {\n if ( (getCustomerArrivalTime(list.get(i)) == getCustomerArrivalTime(list.get(j)) && getCustomerIndex(list.get(i)) > getCustomerIndex(list.get(j)))\n || getCustomerArrivalTime(list.get(i)) > getCustomerArrivalTime(list.get(j))) {\n\n ArrayList<Integer> tmp = list.get(i);\n list.set(i,list.get(j)) ;\n list.set(j,tmp);\n }\n }\n }\n }", "public static void main(String[] args) {\n ArrayList<Integer> mainList = new ArrayList<Integer>();\n mainList.add(5);\n mainList.add(2);\n mainList.add(10);\n mainList.add(14);\n mainList.add(3);\n mainList.add(6);\n mainList.add(9);\n boolean asc = false;\n System.out.println(listSort(mainList, asc));\n }", "void ascendingSelectionSort(int[] arr,int n){\n for(int i=0;i<n-1;i++){\n int min_index = i;\n for(int j=i+1;j<n;j++){\n if(arr[j]<arr[min_index]){\n min_index = j;\n }\n }\n if(i != min_index){\n int temp = arr[i];\n arr[i] = arr[min_index];\n arr[min_index]= temp;\n }\n }\n }", "@Test\n\tvoid SelectionSortTest() \n\t{\t\n\t\tint[] twoNumbers = new int[] {2, 1};\n\t\tint[] expTwoNumbers = new int[] {1, 2};\n\t\tint[] everyOther = new int[] {1, 3, 5, 6, 4, 2};\n\t\tint[] expEveryOther = new int[] {1, 2, 3, 4, 5, 6};\n\t\tint[] smallestFirst = new int[] {1, 2, 5, 6, 3, 4};\n\t\tint[] expSmallestFirst = new int[] {1, 2, 3, 4, 5, 6};\n\t\tint[] smallestMiddle = new int[] {3, 4, 1, 2, 5, 6};\n\t\tint[] expSmallestMiddle = new int[] {1, 2, 3, 4, 5, 6};\n\t\t\n\t\tassertArrayEquals(expTwoNumbers, utilities.SelectionSort(twoNumbers));\n\t\tassertArrayEquals(expEveryOther, utilities.SelectionSort(everyOther));\n\t\tassertArrayEquals(expSmallestFirst, utilities.SelectionSort(smallestFirst));\n\t\tassertArrayEquals(expSmallestMiddle, utilities.SelectionSort(smallestMiddle));\n\t}", "public static void selectionSort(int[] data){ \n for (int i = 0; i < data.length; i++) {\n\t int placeholder = 0;\n\t for( int j = i; j < data.length; j++) {\n\t if (data[j] < data[i]) {\n\t\t placeholder = data[i];\n\t\t data [i] = data[j];\n\t\t data[j] = placeholder;\n\t }\n\t }\n }\n }", "public static List<Integer> sortNumbers(List<Integer> unsortedList) {\n\n // naive sort\n if (unsortedList == null || unsortedList.size() <= 1) {\n return unsortedList;\n }\n\n int pivot = unsortedList.get(0);\n List<Integer> lessThanPivot = new ArrayList<>();\n List<Integer> greaterThanPivot = new ArrayList<>();\n\n unsortedList.subList(1, unsortedList.size()).forEach(number -> {\n if (number <= pivot) {\n lessThanPivot.add(number);\n } else {\n greaterThanPivot.add(number);\n }\n });\n\n System.out.printf(\"%15s %1s %-15s%n\", lessThanPivot, pivot, greaterThanPivot);\n\n List<Integer> sortedNumbers = new ArrayList<>(sortNumbers(lessThanPivot));\n sortedNumbers.add(pivot);\n sortedNumbers.addAll(sortNumbers(greaterThanPivot));\n return sortedNumbers;\n }", "public static void selectionSort(int[] data, int i, int j){\n\t\tfor(int k = i; k <= j && k < data.length; k++){\n\t\t\tint minIndex = k;\n\t\t\tfor(int s = k + 1; s <= j && s < data.length; s++){\n\t\t\t\tif(data[minIndex] > data[s])\n\t\t\t\t\tminIndex = s;\n\t\t\t}\n\t\t\tif(minIndex != k){\n\t\t\t\tint tmp = data[k];\n\t\t\t\tdata[k] = data[minIndex];\n\t\t\t\tdata[minIndex] = tmp;\n\t\t\t}\n\t\t}\n\t}", "public static void selectionSort(int[] arr) {\r\n int min = 0;\r\n int max = arr.length - 1;\r\n while (max > min) {\r\n for (int i = min; i < max; i++) {\r\n if (arr[i] < arr[min]) {\r\n swap(arr, i, min);\r\n }\r\n if (arr[i] > arr[max]) {\r\n swap(arr, i, max);\r\n }\r\n }\r\n min = min + 1;\r\n max = max - 1;\r\n }\r\n }", "public static void selectionsort(Integer[] arr){\n\t\tfor(int i=0;i<arr.length;i++){\n\t\t\tint minIndex=i;\n\t\t\tfor(int j=i+1;j<arr.length;j++){\n\t\t\t\tif(arr[minIndex] > arr[j]){\n\t\t\t\t\tminIndex=j;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tint temp=arr[i];\n\t\t\tarr[i]=arr[minIndex];\n\t\t\tarr[minIndex]=temp;\n\t\t}\n\t\t\n\t\tfor(int i:arr){\n\t\t\tSystem.out.println(i);\n\t\t}\n\t}", "public static void sort(java.util.List arg0)\n { return; }", "public static void selectionSort(int[] arr)\n\t{\n\t\tint len=arr.length;\n\t\tint mIndex;\n\t\tfor(int i=0;i<len;i++){\n\t\t\tmIndex=i;\n\t\t\tfor(int j=i+1;j<len;j++)\n\t\t\t{\n\t\t\t\tif(arr[mIndex]>arr[j])\n\t\t\t\t\tmIndex=j;\n\t\t\t}\n\t\t\tif(mIndex!=i)\n\t\t\t{\n\t\t\t\tint temp=arr[mIndex];\n\t\t\t\tarr[mIndex]=arr[i];\n\t\t\t\tarr[i]=temp;\n\t\t\t}\n\t\t}\n\t}", "public static void bubbleSort(IntList l) {\n\t\tif (l.getFirst() == null)\n\t\t\treturn;\n\t\tl1: while (true) {\n\t\t\tfor (\tIntListEntry e = l.getFirst().getNext();\n\t\t\t\t\te != null;\n\t\t\t\t\te = e.getNext()) {\n\t\t\t\tIntListEntry d = e.getPrevious();\n\t\t\t\tif (d.getItem() > e.getItem()) {\n\t\t\t\t\tl.delete(e);\n\t\t\t\t\tl.insertBefore(e, d);\n\t\t\t\t\tcontinue l1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t}", "static void doubleSelectionSort (int [] array) {\n\t for (int i = 0, j = array.length - 1; (i < array.length && j >= 0); i++, j--)\n {\n int minIndex = i;\n int maxIndex = j;\n\n for (int a = i + 1; a < array.length; a++)\n if (array[a] < array[minIndex])\n minIndex = a;\n\n for (int b = j - 1; b >= 0; b--)\n if (array[b] > array[maxIndex])\n maxIndex = b;\n\n if (isSorted(array)) return;\n\n swap(array, minIndex, i);\n System.out.println(Arrays.toString(array));\n swap(array, maxIndex, j);\n System.out.println(Arrays.toString(array));\n }\n\t}", "private static void selectionSort(ArrayList<Box> BoxArray) { \n\n\t\tfor ( int i = 0; i < BoxArray.size(); i++ ) { \n\t\t\tint lowPos = i; \n\t\t\tfor ( int j = i + 1; j < BoxArray.size(); j++ ) \n\t\t\t\tif ( BoxArray.get(j).volume() < BoxArray.get(lowPos).volume() ) \n\t\t\t\t\tlowPos = j;\n\t\t\tif ( BoxArray.get(lowPos) != BoxArray.get(i) ) { \n\t\t\t\tBox temp = BoxArray.get(lowPos);\n\t\t\t\tBoxArray.set(lowPos, BoxArray.get(i));\n\t\t\t\tBoxArray.set(i, temp);\n\t\t\t}\n\t\t}\n\t}", "public static List<Integer> sort(List<Integer> input) {\n\t\tif (input.size() < 2)\n\t\t\treturn input;\n\n\t\tint pivot = input.get((input.size() - 1) / 2);\n\t\tList<Integer> less = input.stream().filter(x -> x < pivot).collect(Collectors.toList());\n\t\tList<Integer> greater = input.stream().filter(x -> x > pivot).collect(Collectors.toList());\n\t\tList<Integer> all = new ArrayList<>(sort(less));\n\t\tall.add(pivot);\n\t\tall.addAll(sort(greater));\n\t\treturn all;\n\t}", "static void selectionSort(int[] arr){\r\n\t\t\r\n\t\tfor(int i=0;i<arr.length-1;i++) {\r\n\t\t\t\r\n\t\t\tfor(int j=(i+1);j<arr.length;j++) {\r\n\t\t\t\t\r\n\t\t\t\tif(arr[j] < arr[i]) MyUtil.swap(arr,i,j);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tMyUtil.displayArray(arr);\r\n\t\t\r\n\t}", "public static Comparable[] selectionSort(Comparable[] array) {\n int indexSorted = 0;\r\n //loops once for every array member, although value itself is unused\r\n for (Comparable member : array) {\r\n //remembers the index of the next ,owest member, by default the next index\r\n int low = indexSorted;\r\n \r\n //loops over every array member and comares with current lowest value\r\n for(int j = indexSorted; j < array.length; j++) {\r\n //if a lower value than low is found, set low to index of lower value\r\n if (array[j].compareTo(array[low]) < 0) {\r\n low = j;\r\n }\r\n }\r\n \r\n //if an index other than the next one is the lowest, swap the values of the two indexs\r\n if (low != indexSorted) {\r\n Comparable toShift = array[indexSorted];\r\n array[indexSorted] = array[low];\r\n array[low] = toShift;\r\n }\r\n \r\n //adds one index to the amount of sorted index\r\n indexSorted++;\r\n }\r\n \r\n return array;\r\n }", "public static int[] SelectionSort(int array[]){\n int j;\n for(int i = 0;i<array.length-1;i++) {\n int minPos = i;\n for (j = i + 1; j < array.length-1; j++) {\n if (array[j] < array[minPos]) {\n minPos = j;\n }\n }\n int temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }\n return array;\n }", "@Override\n public <T extends Comparable<? super T>> List<T> sort(List<T> list){\n return pool.invoke(new ForkJoinSorter<T>(list));\n }", "public void sort()throws InterruptedException{\n\t\tfor (int i = 0; i < a.length - 1; i++) {\n\t\t\tint minPos = minPosition(i);\n\t\t\tsortStateLock.lock();\n\t\t\ttry{\n\t\t\t\tswap(minPos, i);\n\t\t\t\t// For animation\n\t\t\t\talreadySorted = i;\n\t\t\t}\n\t\t\tfinally{\n\t\t\t\tsortStateLock.unlock();\n\t\t \t\t}\n\t\t\tpause(2);\n\t }\n }", "void sort();", "void sort();", "public static void mySort(ArrayList<Integer> myList)\n {\n\n }", "static void sort(int[] a)\n {\n for ( int j = 1; j<a.length; j++)\n {\n int i = j - 1;\n while(i>=0 && a[i]>a[i+1])\n {\n int temp = a[i];\n a[i] = a[i+1];\n a[i+1] = temp;\n i--;\n }\n }\n }", "public static <T extends Comparable<? super T>> \n\t\t\tvoid selectionSort (T [] array)\n {\t\n\t int startScan, index, minIndex;\n T minValue; \t// Note that T is now a type that can be used in\n \t\t\t\t// this method\n\n for (startScan = 0; startScan < (array.length-1); startScan++)\n {\n minIndex = startScan;\n minValue = array[startScan];\n for(index = startScan + 1; index < array.length; index++)\n {\n if (array[index].compareTo(minValue) < 0)\n {\n minValue = array[index];\n minIndex = index;\n }\n }\n array[minIndex] = array[startScan];\n array[startScan] = minValue;\n }\n \n }", "public static int[] selectionSort(int[] numbers) {\n\n\t\t// double for loop to iterate over next position in array to be sorted (i)\n\t\t// and to iterate over remaining numbers in the array (j)\n\n\t\tfor (int i = 0; i < numbers.length; i++) {\n\t\t\tint index = i;\n\t\t\tfor (int j = i + 1; j < numbers.length; j++) {\n\t\t\t\tif (numbers[j] < numbers[index]) {\n\t\t\t\t\tindex = j;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// swap numbers if a smaller number is found\n\t\t\tint smallestNumber = numbers[index];\n\t\t\tnumbers[index] = numbers[i];\n\t\t\tnumbers[i] = smallestNumber;\n\n\t\t}\n\n\t\treturn numbers;\n\n\t}" ]
[ "0.7975867", "0.7555647", "0.75013226", "0.7328977", "0.7224258", "0.7172128", "0.7084391", "0.7060816", "0.70022374", "0.69581306", "0.69371444", "0.6911653", "0.6907416", "0.6861859", "0.68606734", "0.6855765", "0.68410677", "0.68237066", "0.67939556", "0.67855763", "0.67747724", "0.67747724", "0.6754632", "0.67397916", "0.6733733", "0.6688959", "0.6682289", "0.66678375", "0.6649109", "0.6645036", "0.6623922", "0.65900284", "0.65900284", "0.6542511", "0.65394044", "0.6530057", "0.6518122", "0.65107566", "0.6496008", "0.64870983", "0.647626", "0.6444865", "0.6443995", "0.64396816", "0.6438151", "0.64251816", "0.6424845", "0.6393653", "0.6368664", "0.63665915", "0.6362269", "0.63520366", "0.6349193", "0.6316224", "0.6293242", "0.62762225", "0.6270078", "0.62653726", "0.6264049", "0.6242687", "0.62379366", "0.6229616", "0.6222261", "0.6218297", "0.61717886", "0.6168847", "0.61656046", "0.6158089", "0.6146569", "0.61275876", "0.61220926", "0.6116013", "0.61138475", "0.6110955", "0.6096534", "0.60931027", "0.60719645", "0.60684615", "0.60660493", "0.6064769", "0.60643315", "0.60630095", "0.6046449", "0.60399604", "0.6025318", "0.6021842", "0.6018984", "0.6015551", "0.60015875", "0.599644", "0.599248", "0.5979414", "0.59786874", "0.5955105", "0.59473425", "0.59473425", "0.59419376", "0.5937159", "0.5935711", "0.592385" ]
0.7511797
2
Calls the recursive Quicksort with the default parameters needed
public static <T extends Comparable<? super T>> void quickSort(List<T> list){ if(list.size() > 1) quickSort(list, 0, list.size() - 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void quickSortHelper(int start, int end){\n if(start < end){\n //partition index calls partition that returns idx\n //and also puts toSort[partitionidx] in the right place\n int partitionidx = partition(start, end);\n\n //sorts elements before and after the partitions\n //recursive - nice\n //System.out.println(\"test\");\n quickSortHelper(start, partitionidx - 1); //befre\n quickSortHelper(partitionidx + 1, end); //after\n }\n }", "void quickSort(int arr[], int low, int high) \n { \n if (low < high) \n { \n /* pi is partitioning index, arr[pi] is \n now at right place */\n int pi = partition(arr, low, high); \n \n // Recursively sort elements before \n // partition and after partition \n quickSort(arr, low, pi-1); \n quickSort(arr, pi+1, high); \n } \n }", "public static void quickSort(ArrayList<Integer> S){\n\t\t\n\t\tif (S.isEmpty()) { //if empty just return itself \n\t\t\treturn; \n\t\t}\n\t\t\n\t\tint pivot = S.get(S.size()-1); //creating a pivot point for the sort \n\t\t\n\t\tArrayList<Integer> L = new ArrayList<Integer>(); //Creating array list for Less than\n\t\tArrayList<Integer> E = new ArrayList<Integer>(); //Creating array list for Equal than\n\t\tArrayList<Integer> G = new ArrayList<Integer>(); //Creating array list for Greater than \n\t\t\n\t\twhile (!S.isEmpty()) { //run while the array list isn't empty \n\t\t\t\n\t\t\tif (S.get(0)< pivot) { //if its less than the pivot, add less than \n\t\t\t\t\n\t\t\t\tL.add(S.get(0)); //adds the less than \n\t\t\t\tS.remove(0); //removes the elements at that index position \n\t\t\t}\n\t\t\telse if(S.get(0) == pivot) { //if its equal to the pivot, add equal to \n\t\t\t\t\n\t\t\t\tE.add(S.get(0));\n\t\t\t\tS.remove(0);\n\t\t\t}\n\t\t\t\n\t\t\telse if (S.get(0) > pivot) { //if its greater than the pivot point, add greater than \n\t\t\t\t\n\t\t\t\tG.add(S.get(0));\n\t\t\t\tS.remove(0);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tif (!L.isEmpty()) { //if Less than isn't empty, call quick sort on less than \n\t\t\t\n\t\t\tquickSort(L); //calls the quick sort for less than \n\t\t}\n\t\t\n\t\tif (!G.isEmpty()) { //if Greater than isn't empty, call quick sort on greater than \n\t\t\t\n\t\t\tquickSort(G); //calls quick sort for greater than \n\t\t}\n\t\t\n\t\tS.addAll(L); //Shifting all of the elements to the right \n\t\tS.addAll(E); //Shifting all of the elements to the right \n\t\tS.addAll(G); //Shifting all of the elements to the right \n\t}", "private void quickSort(Comparable[] items, int left, int right) {\n if (left < right) {\n /**\n * Split the list at the pivot through partitioning it,\n * and return the pivot to separate out the less than\n * and greater than sides.\n */\n int pivot = partition(items, left, right);\n if (pivot - 1 > left) {\n quickSort(items, left, pivot - 1);\n }\n if (pivot + 1 < right) {\n quickSort(items, pivot + 1, right);\n }\n }\n }", "private void quickSort(List<T> array, int startIndex, int endIndex, FuncInterface<T> ICompare)\n {\n if (startIndex < endIndex)\n {\n // calculate the pivotIndex\n int pivotIndex = partition(array, startIndex, endIndex, ICompare);\n // quickSort the left sub-array\n quickSort(array, startIndex, pivotIndex, ICompare);\n // quickSort the right sub-array\n quickSort(array, pivotIndex + 1, endIndex, ICompare); \n }\n }", "public void quickSort() {\n\t\tquickSort(0, data.size() - 1);\n\t}", "private void quickSort(int low, int high) {\n\t\tint i = low;\n\t\tint k = high;\n\t\tint pivot = array[low + (high - low) / 2];\n\n\t\twhile (i <= k) {\n\t\t\t// Stops when element on left side is greater than the pivot\n\t\t\twhile (array[i] < pivot) {\n\t\t\t\ti++;\n\t\t\t}\n\t\t\t// Stops when the element on the right side is less than the pivot\n\t\t\twhile (array[k] > pivot) {\n\t\t\t\tk--;\n\t\t\t}\n\t\t\t// Swap the left and right elements, since the one on the left is\n\t\t\t// greater than the one on the right (proved via pivot)\n\t\t\tif (i <= k) {\n\t\t\t\texchangeNums(i, k);\n\t\t\t\t// Move on to the next elements\n\t\t\t\ti++;\n\t\t\t\tk--;\n\t\t\t}\n\t\t}\n\t\t// Recursive calls\n\t\tif (low < k) {\n\t\t\tquickSort(low, k);\n\t\t}\n\t\tif (i < high) {\n\t\t\tquickSort(i, high);\n\t\t}\n\t}", "public void quickSort() {\n if (actualArray == null || actualArray.length == 0) {\n return;\n }\n quickSort(0, actualArray.length - 1);\n }", "public void quicksort()\n { quicksort(this.heap, 0, heap.size()-1);\n }", "private void quickSort(int start, int end) {\n\t\tint pivot, i, j;\n\t\tif (start < end) {\n\t\t\t// Select first element as Pivot\n\t\t\tpivot = start;\n\t\t\ti = start;\n\t\t\tj = end;\n\n\t\t\t// Base condition\n\t\t\twhile (i < j) {\n\t\t\t\t// increment i till found greater element than pivot\n\t\t\t\tfor (i = start; i <= end; i++) {\n\t\t\t\t\tif (data.get(i) > data.get(pivot)) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// decrement j till found lesser element than pivot\n\t\t\t\tfor (j = end; j >= start; j--) {\n\t\t\t\t\tif (data.get(j) <= data.get(pivot)) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// if i<j than swap\n\t\t\t\tif (i < j) {\n\t\t\t\t\tswap(i, j);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// set pivot to jth element & move pivot to proper position\n\t\t\tswap(j, pivot);\n\n\t\t\t// Repeat for sub arrays\n\t\t\tquickSort(start, j - 1);\n\t\t\tquickSort(j + 1, end);\n\t\t}\n\t}", "private QuickSort3Way() {}", "@Test\n public void testQuickSort() {\n System.out.println(\"QuickSort listo\");\n Comparable[] list = {3,2,5,4,1};\n QuickSort instance = new QuickSort();\n Comparable[] expResult = {1,2,3,4,5};\n Comparable[] result = instance.QuickSort(list, 0, list.length-1);\n assertArrayEquals(expResult, result);\n }", "static void quickSort(int[] arr, int left, int right){\n int position = partition(arr, left, right);\n if(left<position){\n quickSort(arr,left,position);\n }\n if(position+1<right){\n quickSort(arr,position+1,right);\n }\n }", "private void quicksort(int low, int high) {\r\n\t\tint i = low, j = high;\r\n\t\t// Get the pivot element from the middle of the list\r\n\t\tint pivot = mutualNum[low + (high-low)/2];\r\n\t\t// Divide into two lists\r\n\t\twhile (i <= j) {\r\n\t\t\twhile (mutualNum[i] > pivot) {\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t\twhile (mutualNum[j] < pivot) {\r\n\t\t\t\tj--;\r\n\t\t\t}\r\n\t\t\tif (i <= j) {\r\n\t\t\t\texchange(i, j);\r\n\t\t\t\ti++;\r\n\t\t\t\tj--;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Recursion\r\n\t\tif (low < j)\r\n\t\t\tquicksort(low, j);\r\n\t\tif (i < high)\r\n\t\t\tquicksort(i, high);\r\n\t}", "public void quickSort(Node node)\n {\n // Find last node\n Node head1 = lastNode(node);\n \n // Call the recursive QuickSort\n _quickSort(node,head1);\n }", "public ListUtilities quicksort(){\n\t\t\n\t\tListUtilities lo = this.returnToStart();\n\t\tListUtilities hi = this.goToEnd();\n\t\tListUtilities sorted = this.partition(lo, hi);\n\t\t\n\t\treturn sorted.returnToStart();\t\t\n\t}", "public static void quickSort(LinkedQueue q) {\n // Your solution here.\n if (q.isEmpty())\n {\n return;\n }\n int pivotInt = (int) (1 + Math.random() * q.size());\n Object pivot = q.nth(pivotInt);\n LinkedQueue qSmall = new LinkedQueue();\n LinkedQueue qEquals = new LinkedQueue();\n LinkedQueue qLarge = new LinkedQueue();\n \n ListSorts.partition(q, (Comparable) pivot, qSmall, qEquals, qLarge);\n \n ListSorts.quickSort(qSmall);\n ListSorts.quickSort(qLarge);\n \n q.append(qSmall);\n q.append(qEquals);\n q.append(qLarge);\n \n\n }", "private static <T extends Comparable<T>> void quicksort(T v[], int left, int right) {\n if(left<right){\n int indexP = partition(v,left,right);\n quicksort(v, left, indexP - 1);\n quicksort(v, indexP + 1, right );\n\n }\n\n }", "private static <AnyType extends Comparable<? super AnyType>> void quicksort(AnyType[] a, int left, int right)\n {\n if(left + CUTOFF <= right)\n {\n AnyType pivot = median3(a, left, right);\n\n // Begin partitioning\n int i = left, j = right - 1;\n for( ; ; )\n {\n while(a[++i].compareTo(pivot) < 0);\n while(a[--j].compareTo(pivot) > 0);\n if(i < j)\n CommonFunc.swapReference(a, i, j);\n else\n break;\n }\n\n CommonFunc.swapReference(a, i, right - 1);\n\n quicksort(a, left, i - 1);\n quicksort(a, i + 1, right);\n }\n else // Do an insertion sort on the subarray\n Insertionsort.insertionsort(a, left, right);\n }", "public void sort() {\n Stack<Pair> stack = new Stack();\n //fill the stack\n Pair temp = new Pair(0, a.length);\n stack.push(temp);\n quickSort(stack,stack.peek().first, stack.peek().n);\n }", "public static void main(String[] args){\n int [] a= {18,10,23,46,9};\n quickSort(a,0,a.length-1);\n }", "public void sort() {\n\t\tSystem.out.println(\"Quick Sort Algorithm invoked\");\n\n\t}", "private static void quicksort( Comparable [ ] a, int low, int high ) {\n if( low + CUTOFF > high )\n insertionSort( a, low, high );\n else {\n// Sort low, middle, high\n int middle = ( low + high ) / 2;\n if( a[ middle ].lessThan( a[ low ] ) )\n swapReferences( a, low, middle );\n if( a[ high ].lessThan( a[ low ] ) )\n swapReferences( a, low, high );\n if( a[ high ].lessThan( a[ middle ] ) )\n swapReferences( a, middle, high );\n// Place pivot at position high - 1\n swapReferences( a, middle, high - 1 );\n Comparable pivot = a[ high - 1 ];\n// Begin partitioning\n int i, j;\n for( i = low, j = high - 1; ; ) {\n while( a[ ++i ].lessThan( pivot ) );\n while( pivot.lessThan( a[ --j ] ) );\n if( i < j )\n swapReferences( a, i, j );\n else\n break;\n }\n// Restore pivot\n swapReferences( a, i, high - 1 );\n quicksort( a, low, i - 1 ); // Sort small elements\n quicksort( a, i + 1, high ); // Sort large elements\n }\n }", "protected abstract void partialQuickSort(Integer[] map, int left, int right, int minIdx, int maxIdx);", "private void quickSort(Node<T> low, Node<T> high) {\n if (!Objects.isNull(high) &&\n low != high && low != high.getNext()) {\n\n Node<T> pivot = partition(low, high);\n quickSort(low, pivot.getPrev());\n quickSort(pivot.getNext(), high);\n }\n }", "public static void quickSort (int[] nums, int start, int end) {\n\t\t// check if it's a valid array\n\t\tif (nums == null || nums.length == 0) {\n\t\t\treturn;\n\t\t}\n\n // exit condition\n\t\tif (start >= end) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tint left = start, right = end;\n\t\tint pivot = nums[start + (end - start) / 2];\n\t\t\n\t\twhile (left <= right) {\n\t\t\twhile (left <= right && nums[left] < pivot) {\n\t\t\t\tleft++;\n\t\t\t}\n\t\t\twhile (left <= right && nums[right] > pivot) {\n\t\t\t\tright--;\n\t\t\t}\n\t\t\tif (left <= right) {\n\t\t\t\tswap(nums, left, right);\n\t\t\t\tleft++;\n\t\t\t\tright--;\n\t\t\t}\n\t\t}\n\n // call quickSort recursively\n\t\tquickSort(nums, start, right);\n\t\tquickSort(nums, left, end);\n\t}", "public static void qSort(int left, int right){\n\t\tint i = left, j = right;\n\t\tint ref = left + (right-left)/2;\n\t\tHeapNode pivot = edges[ref];\n\t\tHeapNode temp2 ;\n\t\twhile (i <= j) {\n\t\t\twhile (compare(pivot, edges[i]))\n\t\t\t\ti++;\n\t\t\twhile (compare(edges[j], pivot))\n\t\t\t\tj--;\n\t\t\tif (i <= j) {\n\t\t\t\ttemp2=edges[i];\n\t\t\t\tedges[i]=edges[j];\n\t\t\t\tedges[j]=temp2;\n\n\t\t\t\ti++;\n\t\t\t\tj--;\n\t\t\t}\n\t\t};\n\t\t// recursion\n\t\tif (left < j)\n\t\t\tqSort(left, j);\n\t\tif (i < right) {\n\t\t\tqSort(i, right);\n\t\t}\n\n\t}", "public static void quickSort(int[] a, int left, int right)\r\n {\r\n int pivot = partition(a, left, right);\r\n if(left < pivot - 1)\r\n quickSort(a, left, pivot - 1);\r\n if(pivot < right)\r\n quickSort(a, pivot, right);\r\n }", "private static <E extends Comparable<? super E>> void quickSortHelper(\r\n\t\t\tComparable<E>[] data, int left, int right) {\r\n\t\tif (left + CUTOFF <= right) {\r\n\t\t\tE pivot = median3(data, left, right);\r\n\t\t\tint partition = partition(data, left, right, pivot);\r\n\t\t\tquickSortHelper(data, left, partition - 1);\r\n\t\t\tquickSortHelper(data, partition + 1, right);\r\n\t\t} else {\r\n\t\t\tinsertionSort(data, left, right);\r\n\t\t}\r\n\t}", "public void quickSortIter(){\n int pivot = 0;\n int partition;\n boolean unordered = false;\n do {\n unordered = false;\n partition = pivot;\n for (int i = pivot + 1; i < array.length; i++) {\n if (((Comparable) array[pivot]).compareTo(array[i]) >= 0) {\n if (i - partition > 1) {\n T temp = array[i];\n array[i] = array[partition];\n array[partition] = temp;\n partition++;\n unordered = true;\n } else {\n partition++;\n unordered = true;\n }\n }\n }\n T temp = array[partition];\n array[partition] = array[pivot];\n array[pivot] = temp;\n if (partition < array.length) {\n pivot = partition + 1;\n for (int i = 0; i < partition; i++) {\n if (((Comparable) array[i]).compareTo(array[i + 1]) > 0) {\n pivot = i;\n break;\n }\n }\n }\n } while (unordered);\n\n }", "private static void quickSort(int[] array, int startIndex, int rightIndex) {\n if (startIndex < rightIndex) {\n int pivot = partition(array, startIndex, rightIndex);\n quickSort(array, startIndex, pivot - 1);\n quickSort(array, pivot + 1, rightIndex);\n }\n }", "public static void quickSort(int[] a, int startIndex, int endIndex) {\r\n int pivotIndex; // the index of pivot returned by the quicksort partition\r\n // if the set has more than one element, then partition\r\n if (startIndex < endIndex) {\r\n // partition and return the pivotIndex\r\n pivotIndex = partition(a, startIndex, endIndex);\r\n // recursive call to quicksort on low half\r\n quickSort(a, startIndex, pivotIndex - 1);\r\n // recursive call to quicksort on high half \r\n quickSort(a, pivotIndex + 1, endIndex);\r\n } // end if\r\n }", "private static void quickSort(double arr[],Integer[] pageIDS, int low, int high)\n {\n if (low < high)\n {\n /* pi is partitioning index, arr[pi] is\n now at right place */\n int pi = partition(arr,pageIDS, low, high);\n\n // Recursively sort elements before\n // partition and after partition\n quickSort(arr, pageIDS, low, pi-1);\n quickSort(arr, pageIDS,pi+1, high);\n }\n }", "public static void quickSortTest(){\n\t\tTransformer soundwave = new Transformer(\"Soundwave\", 'D', new int[] {8,9,2,6,7,5,6,10});\n\t\tTransformer bluestreak = new Transformer(\"Bluestreak\", 'A', new int[] {6,6,7,9,5,2,9,7});\n\t\tTransformer hubcap = new Transformer(\"Hubcap\", 'A', new int[] {4,4,4,4,4,4,4,4});\n\t\tTransformer abominus = new Transformer(\"Abominus\", 'D', new int[] {10,1,3,10,5,10,8,4});\n\t\t\n\t\tgame.addTransformer(soundwave);\n\t\tgame.addTransformer(bluestreak);\n\t\tgame.addTransformer(hubcap);\n\t\tgame.addTransformer(abominus);\n\t\t\n\t\tgame.sortCompetitorsByRank();\n\t\tgame.printSortedRoster();\n\t}", "public interface QuickSort<A> {\r\n\t\r\n\tpublic void sort(A list, PivotPositions pivot) throws UnsupportedPivotException;\r\n\t\r\n\t/**\r\n\t * These values represents all possible pivots.\r\n\t * @author Robin\r\n\t *\r\n\t */\r\n\tpublic static enum PivotPositions {\r\n\t\tFIRST, RANDOM, MIDDLE;\r\n\r\n\t\t@Override\r\n\t\tpublic String toString() {\r\n\t\t\tString s = \"\";\r\n\t\t\tswitch (this) {\r\n\t\t\tcase FIRST:\r\n\t\t\t\ts = \"first\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase RANDOM:\r\n\t\t\t\ts = \"random\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase MIDDLE:\r\n\t\t\t\ts = \"middle\";\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\treturn s;\r\n\t\t}\r\n\t}\r\n\t\r\n\t/**\r\n\t * Class for generating unsupported pivot exceptions. This\r\n\t * exception is thrown if the input cannot be interpreted as a pivot.\r\n\t * \r\n\t * @author Robin\r\n\t *\r\n\t */\r\n\tpublic static class UnsupportedPivotException extends Exception {\r\n\t\t/**\r\n\t\t * \r\n\t\t */\r\n\t\tprivate static final long serialVersionUID = 853436763252048434L;\r\n\t\tprivate final PivotPositions pivot;\r\n\r\n\t\tpublic UnsupportedPivotException(PivotPositions pivot) {\r\n\t\t\tthis.pivot = pivot;\r\n\t\t}\r\n\r\n\t\t@Override\r\n\t\tpublic void printStackTrace() {\r\n\t\t\tSystem.out.println(pivot);\r\n\t\t}\r\n\t}\r\n}", "private static <T extends Comparable<? super T>> void quickSort(List<T> list, int beginIndex, int finishIndex){\n if(beginIndex + 1 <= finishIndex){\n int i = beginIndex;\n int j = finishIndex;\n while(i <= j){\n while(list.get(i).compareTo(list.get(finishIndex)) < 0 && i < finishIndex){\n i++;\n }\n while(list.get(j).compareTo(list.get(finishIndex)) >= 0 && j > beginIndex){\n j--;\n }\n if(i <= j) {\n if(i != j)\n swap(list, i, j);\n if(i != beginIndex)\n i++;\n if(j != finishIndex)\n j--;\n }\n }\n if(i < finishIndex)\n swap(list, i, finishIndex);\n\n quickSort(list, beginIndex, i - 1);\n quickSort(list, i + 1, finishIndex);\n }\n }", "private void doQuickSort(int lowerIndex, int higherIndex){\n\t\tint lowItter = lowerIndex;\n\t\tint highItter = higherIndex;\n \n\t\t// use the middle as a pivot numberr\n int middleIndex = lowerIndex + (higherIndex - lowerIndex)/2;\n\t\tint pivot = sortArray[middleIndex];\n \n\t\twhile (lowItter <= highItter) {\n\t\t\twhile (sortArray[lowItter] < pivot)\n lowItter++;\n \n\t\t\twhile (sortArray[highItter] > pivot)\n highItter--;\n \n compCount++;\n\t\t\tif (lowItter <= highItter) {\n\t\t\t\tswap(lowItter, highItter);\n swapCount++;\n \n\t\t\t\tlowItter++;\n\t\t\t\thighItter--;\n\t\t }\n\t\t}\n \n compCount++;\n\t\tif (lowerIndex < higherIndex)\n\t\t\tdoQuickSort(lowerIndex, highItter);\n \n compCount++;\n\t\tif (lowItter < higherIndex)\n\t\t\tdoQuickSort(lowItter, higherIndex);\n \n\t}", "private void quickSort(int[] array, int left, int right) {\n if (left>=right){\n return;\n }\n\n //2. Pick a pivot element -> we will choose the centre element:\n // Note: Better would be to choose left + (right-left)/2 (as this would avoid overflow error for large arrays i.e. 2GB))\n\n int pivot = array[(left+right)/2];\n\n //3. Partition the array around this pivot and return the index of the partition.\n int index = partition(array,left,right,pivot);\n\n //4. Sort on the left and right side recursively.\n quickSort(array,left,index-1); //Left side\n quickSort(array,index,right); //Right side\n }", "public void quicksort() {\r\n quicksort(mArray, 0, mArray.length -1);\r\n }", "public static void quickSort(int[] arr, int lo, int hi) {\n //write your code here\n if(lo>hi){\n return;\n }\n int pivot = partition(arr, arr[hi], lo, hi);\n quickSort(arr, lo, pivot-1);\n quickSort(arr, pivot+1, hi);\n }", "static void quickSortFirst(int[] array, int left, int right) {\n if (left < right) {\n //Selecting first element as pivot\n int pivot = array[left];\n //For partition\n int i = left;\n int j = right;\n while (i < j) {\n //Shift one place to past pivot element\n i += 1;\n //Search right part to find elements greater than pivot\n while (i <= right && array[i] < pivot) {\n i += 1;\n\n }\n //Search left part to find elements smaller than pivot\n while (j >= left && array[j] > pivot) {\n j -= 1;\n\n }\n if (i <= right && i < j) {\n //Swap\n swap(array, i, j);\n\n }\n }\n //Place pivot in correct place\n swap(array, left, j);\n //Sorting again for partition parts\n quickSortFirst(array, left, j - 1);\n quickSortFirst(array, j + 1, right);\n }\n }", "public void quicksort(int[] a, int start, int end){\n\t\tif(end <= start) return;\r\n\t\t//2 number\r\n//\t\tif(end - start == 1 && a[start] > a[end]){\r\n//\t\t\tswap(a, start, end);\r\n//\t\t\treturn;\r\n//\t\t}\r\n\t\tif((end - start )< 20){\r\n\t\t\tinsertSort(a, start,end);\r\n\t\t\treturn;\r\n\t\t}\r\n\t int pivot = getPivot(a, start, end);\r\n\t int i = start, j = end - 1;\r\n\t while(i < j){\r\n\t while(i < j && a[++i] < pivot);\r\n\t while(i < j && a[--j] > pivot);\r\n\t if(i < j)\r\n\t swap(a, i, j);\r\n\t }\r\n\t swap(a, i, end -1);\r\n\t quicksort(a, start, i - 1);\r\n\t quicksort(a, i + 1, end);\r\n\t}", "void quick_sort(int intArray[], int low, int high)\n {\n if (low < high)\n {\n // partition the array around pi=>partitioning index and return pi\n int pi = partition(intArray, low, high);\n // sort each partition recursively\n quick_sort(intArray, low, pi - 1);\n quick_sort(intArray, pi + 1, high);\n }\n }", "public static void quickSort(int[] src) {\n if (src == null || src.length <= 1) return;\n\n rPartition(src, 0, src.length - 1);\n }", "public void quicksort(ArrayList<Node> array, int low, int high)\n {\n Node pivot = new Node(array.get(low).element);\n //Start value for pivot index\n int pivotIndex = low;\n //Define index in list where values start being higher than the pivot \n int higherThan = -1;\n //Begin the for loop after the first element\n for (int i = low + 1; i <= high; i++)\n \n { int gap = Math.abs(pivotIndex - i);\n if (array.get(i).element.compareTo(pivot.element) <= 0 && gap == 1)\n { switchPosition(i,pivotIndex);\n pivotIndex = i;\n }\n else if (array.get(i).element.compareTo(pivot.element) <= 0 && gap > 1)\n { //higherThan = i;\n switchPosition(i, pivotIndex);\n int temp = i;\n i = pivotIndex;\n pivotIndex = temp;\n switchPosition(i+1, pivotIndex); \n pivotIndex = i+1;\n //i++;\n //pivotIndex = higherThan;\n //higherThan++;\n }\n else // (array.get(i).element.compareTo(pivot.element) > 0 )\n { //Do nothing, element should stay in its position greater than the pivot\n }\n \n }\n System.out.println(\"Pivot index: \" + pivotIndex + \"\\n\");\n for (int i = 0; i < array.size(); i++)\n {\n System.out.println(\" \" + array.get(i).element.toString());\n }\n if ((pivotIndex - 1) >= 1)\n { quicksort(array, 0, pivotIndex - 1);\n System.out.println(\"\\n low index call, pivot element \" + array.get(pivotIndex).element.toString());\n }\n if ((high - pivotIndex) >= 1)\n {\n quicksort(array, pivotIndex + 1, high-1); \n }\n }", "public static void main(String[] args) {\n\t\t\n\t\tint[] x = {9,2,4,5,6,7,8,2,44,55,90,1456,300,345654,1,76};\n\t\t\n\t\tSystem.out.println(Arrays.toString(x));\n\t\t\n\t\tint since = 0;\n\t\tint until = x.length - 1;\n\t\tquicksort(x,since,until);\n\t\tSystem.out.println(Arrays.toString(x));\n\t\t\n\t\t}", "public static void intQSort(int v[], int l, int r) {\n\n int tmp; //tmp variable for swapping\n\n if (INSERTIONENABLED) {\n\n //Use insertion sort for arrays smaller than CUTOFF\n if (r < CUTOFF) {\n\n for(int i = l; i < r; i++) {\n for(int j = i; j > 0 && v[j - 1] > v[j]; j--) {\n // swap(j, j -1) {\n tmp=v[j - 1];\n v[j - 1]=v[j];\n v[j]=tmp;\n // }\n }\n }\n\n return;\n }\n }\n\n int pivot;\n int m = l + (int) (Math.random() * ((r - l) + 1)); // random number between first and last, Peto's remark\n\n //median(v[l], v[m], v[r]) {\n if (v[l] <= v[m]) {\n if (v[m] <= v[r])\n pivot = v[m];\n else {\n if (v[l] <= v[r])\n pivot = v[r];\n else\n pivot = v[l];\n }\n } else {\n if (v[m] <= v[r]) {\n if (v[l] <= v[r])\n pivot = v[l];\n else\n pivot = v[r];\n } \n else\n pivot = v[m];\n }\n // }\n\n int i=l,j=r;\n\n //Partioning\n while(i<=j) {\n\n while(v[i]<pivot) i++;\n while(v[j]>pivot) j--;\n\n if(i<=j) {\n //swap(i, j) {\n tmp=v[i];\n v[i]=v[j];\n v[j]=tmp;\n // }\n\n i++;\n j--;\n }\n }\n\n if(l<j) \n intQSort(v,l,j);\n\n if(i<r) \n intQSort(v,i,r);\n }", "public void quickSort(int[] list, int p, int r){\r\n\t\tif(p<r){\r\n\t\t\tint q = partition(list, p, r);\r\n\t\t\tquickSort(list, p, q-1);\r\n\t\t\tquickSort(list, q+1, r); \r\n\t\t}\r\n\t}", "private void quickSort(Node state, ArrayList<Move> A, int p, int r, boolean isAscending) {\n\t\tif (p < r) {\n\t\t\tint q = this.partition(state, A, p, r, isAscending);\n\t\t\tthis.quickSort(state, A, p, q - 1, isAscending);\n\t\t\tthis.quickSort(state, A, q + 1, r, isAscending);\n\t\t}\n\t}", "public static void QuickSort(int a[]) {\n\t Sort(a, 0, a.length-1); \n\t }", "public static void main(String[] args) {\n Scanner s = new Scanner(System.in);\n \n //prompting input\n \tSystem.out.println(\"How many elements do you need sorted?\");\n \n //storing input\n int n = s.nextInt();\n \t\n \tint arr[] = new int[n];\n \n System.out.println(\"Enter the elements of your array, please.\");\n \n //populating array\n for (int i = 0; i < n; i++) {\n \tarr[i] = s.nextInt();\n }\n \n //instanciating object of Quick_Sort class\n Quick_Sort sorter = new Quick_Sort();\n //calling a method on object with array argument\n \tsorter.sort(arr);\n \n System.out.println(\"Your elements after recursive Quick Sort\");\n\n for (int i = 0; i < n; i++)\n System.out.println(arr[i]);\n \n s.close(); \n \n }", "private void quicksort(int inLow, int inHigh) {\n\t\tint i = inLow; int j = inHigh;\n\t\t//____| Get Pivot from middle.\n\t\tfloat pivot = gameObjectsList.get(inLow + (inHigh - inLow)/2).getX();\n\t\t//____| Divide List\n\t\twhile (i <= j){\n\t\t\twhile(gameObjectsList.get(i).getX() < pivot){\n\t\t\t\ti++;\n\t\t\t}\n\t\t\twhile(gameObjectsList.get(j).getX() > pivot){\n\t\t\t\tj--;\n\t\t\t}\n\t\t\tif (i<=j){\n\t\t\t\tCollections.swap(gameObjectsList, i, j);\n\t\t\t\ti++;\n\t\t\t\tj--;\n\t\t\t}\n\t\t}\n\t\tif (inLow < j)\n\t\t\tquicksort(inLow, j);\n\t\tif (i < inHigh)\n\t\t\tquicksort(i, inHigh);\n\t}", "public void quickSort(Comparable[] arr, int low, int high) {\n\t\tint pivot;\n\t\tif (low < high) {\n\t\t\tpivot = partition(arr, low, high);\n\t\t\tquickSort(arr, low, pivot - 1);\n\t\t\tquickSort(arr, pivot + 1, high);\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tQuickHelper help = new QuickHelper();\n\t\t\n\t\tSystem.out.println(\"Now starting A\");\n\t\tint A[] = {5,2,12,7,9,6};\n\t\thelp.print(A);\n\t\tint n= A.length;\n\t\thelp.sort(A, 0, n-1);\n\t\thelp.print(A);\n\t\t\n\t\tSystem.out.println(\"\\nNow starting B\");\n\t\tint B[] = {1,2,3,4};\n\t\thelp.print(B);\n\t\tn = B.length;\n\t\thelp.tailrecursivesort(B, 0, n-1);\n\t\thelp.print(B);\n\t\t\n\t\tSystem.out.println(\"\\nNow starting C\");\n\t\tint C[] = {1,2,3,4};\n\t\thelp.print(C);\n\t\tn = C.length;\n\t\thelp.improvedtailrecursivesort(C, 0, n-1);\n\t\thelp.print(C);\n\t}", "private static void quicksort(Object a[], int lo0, int hi0) {\n int lo = lo0;\n int hi = hi0;\n int mid;\n\n if (hi0 > lo0) {\n swapReferences(a, lo0, (lo0 + hi0)/2);\n Object[] midObject = (Object[]) a[(lo0 + hi0) / 2];\n mid = (int)midObject[2];\n while (lo <= hi) {\n Object[] loObject = (Object[])a[lo];\n int loWeight = (int)loObject[2];\n while((lo < hi0) && (loWeight < mid)) {\n loObject = (Object[])a[lo];\n loWeight = (int)loObject[2];\n if (loWeight < mid) {\n lo++;\n }\n }\n\n Object[] hiObject = (Object[])a[hi];\n int hiWeight = (int)hiObject[2];\n while((hi > lo0) && (hiWeight > mid)) {\n hiObject = (Object[])a[hi];\n hiWeight = (int)hiObject[2];\n if (hiWeight > mid) {\n hi--;\n }\n }\n\n if (lo <= hi) {\n swapReferences(a, lo, hi);\n lo++;\n hi--;\n }\n }\n\n if (lo0 < hi) {\n quicksort(a, lo0, hi);\n }\n\n if (lo < hi0) {\n quicksort(a, lo, hi0);\n }\n }\n }", "public static void quickSortInPlace(List<Comparable> data, int from, int to) {\n\t\tif (data==null || data.size()<2 || (to-from)<1)\n\t\t\treturn;\n\t\tif (from<0 || to <0 || from>data.size() || to>data.size()) {\n\t\t\tthrow new IndexOutOfBoundsException(data+\" from \"+from+\" to \"+to);\n\t\t}\n\t\t\n\t\tComparable pivot = data.get(to);\n\t\tint pos=from;\n\t\tfor (int i=from; i<to; ++i ) {\n\t\t\tif (data.get(i).compareTo(pivot)<0) {\n\t\t\t\tif (i!=pos) {\n\t\t\t\t\tComparable tmp = data.get(i);\n\t\t\t\t\tdata.set(i,data.get(pos));\n\t\t\t\t\tdata.set(pos, tmp);\n\t\t\t\t\t//System.out.println(data.get(i)+\"<=>\"+tmp);\n\t\t\t\t}\n\t\t\t\tpos++;\n\t\t\t}\n\t\t\t//System.out.println(Arrays.asList(data));\n\t\t}\n\t\t\n\t\tif (pos!=to) {\n\t\t\tComparable tmp = data.get(to);\n\t\t\tdata.set(to, data.get(pos));\n\t\t\tdata.set(pos, tmp);\n\t\t}\n\t\t\n\t\t//System.out.println(Arrays.asList(data)+\" [\"+pos+\"]\"+pivot+\" (\"+from+\",\"+to+\")\");\n\t\tquickSortInPlace(data,from, pos-1);\n\t\tquickSortInPlace(data,pos+1,to);\n\t}", "public void sort(int[] seq, int begin, int end) {\n if (seq == null || end - begin <= 1) {// only seq with length larger than 1 is needed to sort\n return;\n }\n // divide and conquer\n int p = partition(seq, begin, end);// the pivot is now in the final place\n sort(seq, begin, p); // sort the left part\n sort(seq, p + 1, end); // sort the right part, p+1 excludes p because p is the final place of pivot\n }", "public static void main(String[] args){\n\tint[] o = {3,1,2,2,4};\n\tint[] p = {3,7,1,4,32,95,47,12,50,41};\n\tSystem.out.println(toString(o));\n\tSystem.out.println(toString(quicksort(o,0,o.length)));\n }", "private void quickSortM(int[] arr, int start, int end) {\n\t\tif(start>=end)\r\n\t\t\treturn ;\r\n\t\tint bounary = partition(arr,start,end);\r\n\t\tquickSortM(arr,start,bounary-1);\r\n\t\tquickSortM(arr, bounary+1, end);\r\n\t}", "public static void QuickSort( Comparable[ ] datos, int inicio, int fin)\n\t{\n\t\t// TODO \n\t\t//se escoge como pivote el primer termino\n\t\tComparable pivote = datos[inicio];\n\t\tint primermayor = inicio;\n\t\tif(inicio<fin&&inicio<datos.length)\n\t\t{\n\t\t\tfor(int i=inicio +1; i<fin; i++) //ordena los elementos empezando por el segundo de la lista\n\t\t\t{\n\t\t\t\tif(less(datos[i],pivote)) \n\t\t\t\t{\n\t\t\t\t\t//si el elemento en la posicion i es menor al pivote se intercambio con el indice del primer elemento mayor al pivote\n\t\t\t\t\texchange(datos, i, primermayor);\n\t\t\t\t\tprimermayor++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//se repite recursivamente el metodo\n\t\t\tQuickSort(datos,inicio, primermayor);\n\t\t\tQuickSort(datos,primermayor+1,fin);\n\t\t}\n\t}", "private static void quickSortArray(int[] a, int startIndex, int endIndex) {\n\t\t\n\t\t\n\t\tif (startIndex<endIndex){\n\t\t\t\n\t\t\t// calculate the partitioned index\n\t\t\t\n\t\t\tint partitionIndex= partion(a, startIndex,endIndex);\n\t\t\t\n\t\t\tquickSortArray(a,startIndex,partitionIndex-1);\n\t\t\tquickSortArray(a,partitionIndex+1,endIndex);\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "@Test\n public void sortArrayQuickSortTest() {\n int[] array1 = new int[]{5, 2, 3, 1};\n int[] expectedArray1 = new int[]{1, 2, 3, 5};\n int[] actualArray1 = sortArrayQuickSort(array1);\n assertArrayEquals(expectedArray1, actualArray1);\n /**\n * Example 2:\n * Input: nums = [5,1,1,2,0,0]\n * Output: [0,0,1,1,2,5]\n */\n int[] array2 = new int[]{5, 1, 1, 2, 0, 0};\n int[] expectedArray2 = new int[]{0, 0, 1, 1, 2, 5};\n int[] actualArray2 = sortArrayQuickSort(array2);\n assertArrayEquals(expectedArray2, actualArray2);\n }", "static void quickSort (int a[], int lo, int hi){\n\t int i=lo, j=hi, h;\r\n\t int pivot=a[lo];\r\n\r\n\t // pembagian\r\n\t do{\r\n\t while (a[i]<pivot) i++;\r\n\t while (a[j]>pivot) j--;\r\n\t if (i<=j)\r\n\t {\r\n\t h=a[i]; a[i]=a[j]; a[j]=h;//tukar\r\n\t i++; j--;\r\n System.out.println(\"i = \"+i + \" j = \" + j);\r\n\t }\r\n\t } while (i<=j);\r\n\r\n\t // pengurutan\r\n\t if (lo<j) quickSort(a, lo, j);\r\n\t if (i<hi) quickSort(a, i, hi);\r\n\t }", "private static <T> void quickSort(@Nonnull List<T> x, @Nonnull Comparator<? super T> comparator, int off, int len) {\n if (len < 7) {\n for (int i = off; i < len + off; i++) {\n for (int j = i; j > off && comparator.compare(x.get(j), x.get(j - 1)) < 0; j--) {\n swapElements(x, j, j - 1);\n }\n }\n return;\n }\n\n // Choose a partition element, v\n int m = off + (len >> 1); // Small arrays, middle element\n if (len > 7) {\n int l = off;\n int n = off + len - 1;\n if (len > 40) { // Big arrays, pseudomedian of 9\n int s = len / 8;\n l = med3(x, comparator, l, l + s, l + 2 * s);\n m = med3(x, comparator, m - s, m, m + s);\n n = med3(x, comparator, n - 2 * s, n - s, n);\n }\n m = med3(x, comparator, l, m, n); // Mid-size, med of 3\n }\n T v = x.get(m);\n\n // Establish Invariant: v* (<v)* (>v)* v*\n int a = off;\n int b = a;\n int c = off + len - 1;\n int d = c;\n while (true) {\n while (b <= c && comparator.compare(x.get(b), v) <= 0) {\n if (comparator.compare(x.get(b), v) == 0) {\n swapElements(x, a++, b);\n }\n b++;\n }\n while (c >= b && comparator.compare(v, x.get(c)) <= 0) {\n if (comparator.compare(x.get(c), v) == 0) {\n swapElements(x, c, d--);\n }\n c--;\n }\n if (b > c) break;\n swapElements(x, b++, c--);\n }\n\n // Swap partition elements back to middle\n int n = off + len;\n int s = Math.min(a - off, b - a);\n vecswap(x, off, b - s, s);\n s = Math.min(d - c, n - d - 1);\n vecswap(x, b, n - s, s);\n\n // Recursively sort non-partition-elements\n if ((s = b - a) > 1) quickSort(x, comparator, off, s);\n if ((s = d - c) > 1) quickSort(x, comparator, n - s, s);\n }", "public static void ordenarQuickSort( Comparable[ ] datos )\n\t{\n\t\t// TODO \n\t\t// Ejecuto Quick Sort y ordeno recursivamente las secciones restantes\n\t\tint inicio = 0;//indice que indica el inicio del ordenamiento por pivote\n\t\tint fin = datos.length; //indice que indica el final del ordenamiento por pivote\n\t\tComparable pivote = datos[inicio]; //escogo el pivote como el primer termino del arreglo\n\t\tint primermayor = inicio;\n\t\tif( inicio != fin)\n\t\t{\n\t\t\t//primer ordenamiento\n\t\t\tfor(int i=inicio +1; i<fin; i++) //ordena los elementos con respecto al pivote empezando por el segundo de la lista\n\t\t\t{\n\t\t\t\tif(less(datos[i], pivote)) \n\t\t\t\t{\n\t\t\t\t\t//si el elemento en la posicion i es menor al pivote se intercambio con el indice del primer elemento mayor al pivote\n\t\t\t\t\texchange(datos, i, primermayor);\n\t\t\t\t\tprimermayor++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//ordenamientos sucesivos\n\t\t\tQuickSort (datos, inicio, primermayor);\n\t\t\tQuickSort (datos, primermayor+1, fin);\n\t\t}\n\t}", "public static void main(String[] args) {\n\r\n\t\tint [] array1 = {3,2,5,0,1};\r\n\t\tint [] array2 = {8,10,7,6,4};\r\n\t\tint [] array3= new int[array1.length+array2.length];\r\n\t\t\r\n\t\tint i=0,j=0;\r\n\t\t\r\n\t\twhile(i<array1.length){\r\n\t\t\tarray3[i]=array1[i];\r\n\t\t\ti++;\r\n\t\t}\r\n\t\t\r\n\t\twhile(j<array2.length){\r\n\t\t\tarray3[i]=array2[j];\r\n\t\t\ti++;\r\n\t\t\tj++;\r\n\t\t}\r\n\t\tQuickSort(array3,0,array3.length-1,false,false);\r\n\t\t\r\n\t}", "protected void quickSort(Vector v, int lo0, int hi0) {\r\n\tint lo = lo0;\r\n\tint hi = hi0;\r\n\tTypedFile mid;\r\n\r\n\tif ( hi0 > lo0)\r\n\t{\r\n\r\n\t /* Arbitrarily establishing partition element as the midpoint of\r\n\t * the array.\r\n\t */\r\n\t mid = (TypedFile) v.elementAt(( lo0 + hi0 ) / 2);\r\n\r\n\t // loop through the array until indices cross\r\n\t while( lo <= hi )\r\n\t {\r\n\t\t/* find the first element that is greater than or equal to \r\n\t\t * the partition element starting from the left Index.\r\n\t\t */\r\n\t\t// Nasty to have to cast here. Would it be quicker\r\n\t\t// to copy the vectors into arrays and sort the arrays?\r\n\t\twhile( ( lo < hi0 ) && lt( (TypedFile)v.elementAt(lo), mid ) )\r\n\t\t ++lo;\r\n\r\n\t\t /* find an element that is smaller than or equal to \r\n\t\t * the partition element starting from the right Index.\r\n\t\t */\r\n\t\twhile( ( hi > lo0 ) && lt( mid, (TypedFile)v.elementAt(hi) ) )\r\n\t\t --hi;\r\n\r\n\t\t // if the indexes have not crossed, swap\r\n\t\tif( lo <= hi ) \r\n\t\t{\r\n\t\t swap(v, lo, hi);\r\n\t\t ++lo;\r\n\t\t --hi;\r\n\t\t}\r\n\t }\r\n\r\n\t /* If the right index has not reached the left side of array\r\n\t\t * must now sort the left partition.\r\n\t\t */\r\n\t if( lo0 < hi )\r\n\t\tquickSort( v, lo0, hi );\r\n\r\n\t\t/* If the left index has not reached the right side of array\r\n\t\t * must now sort the right partition.\r\n\t\t */\r\n\t if( lo < hi0 )\r\n\t\tquickSort( v, lo, hi0 );\r\n\r\n\t}\r\n }", "private int partition(Comparable[] items, int first, int last) {\n /**\n * Get a random pivot for the current section.\n * <p/>\n * It should be noted that I made a decision to choose a randomized pivot\n * over selecting a hard-coded pivot (i.e. the middle), or a median. This\n * is to avoid situations where we might get the 'worst case' scenario for\n * QuickSort, leading to O(n^2) time complexity. By using a random pivot,\n * it becomes highly unlikely for the algorithm to run into this situation.\n * <p/>\n * I felt this was the safest and most reliable way of implementing the\n * pivot selection.\n */\n int pivot = (int) Math.floor(UtilityMethods.getPivot(first, last));\n\n /**\n * Swap the pivot item with the first element to move it out\n * of the way during sorting. Assign a variable to hold this\n * for quick comparison.\n */\n UtilityMethods.swapElements(items, pivot, first);\n Comparable pivotElement = items[first];\n\n /**\n * The index to begin the swapping of the elements is the next\n * index after the pivot, currently at first.\n */\n int swapPosition = first + 1;\n\n /**\n * For each element within the current section, we iterate through\n * the section, starting from one after the pivot (the swap position)\n */\n for (int currentElement = swapPosition; currentElement <= last; currentElement++) {\n\n /**\n * If the currently being checked element is smaller than the pivot,\n * we swap the current element with the 'swap position'. This results\n * in gathering all of the numbers less than the pivot element to\n * one side of the array.\n *\n * The index that is then to be swapped is incremented. This means\n * that any elements before the swap position will be sorted as 'less'\n * than the pivot. We don't need to move any elements greater than\n * the pivot.\n */\n if (items[currentElement].compareTo(pivotElement) < 0) {\n UtilityMethods.swapElements(items, swapPosition, currentElement);\n swapPosition++;\n }\n\n }\n\n /**\n * After all elements have been swapped around, we switch the first element\n * (the pivot element), with the last sorted 'less than' element in swap\n * position -1. The works, as it doesn't matter what element is in what\n * position, as long as there are greater and less than sections. By\n * doing this swap, we keep the elements less than the pivot to the left\n * of the pivot, and put the pivot in the 'correct' sorted place in the list.\n */\n UtilityMethods.swapElements(items, first, swapPosition - 1);\n\n /**\n * We return the swapPosition -1, which is the final index of the pivot element.\n */\n return swapPosition - 1;\n }", "public static void main(String[] args) {\n\t\t\n\t\tint[] a = new int[] {3,1,2,1,5,9};\n\t\tquickSort(a);\n\t}", "public static void QuickSort(int arr[], int low, int high) {\n\n if (low < high) {\n int pivot = partition(arr, low, high);\n\n //Sort elements before and after partition\n QuickSort(arr, low, pivot - 1);\n QuickSort(arr, pivot + 1, high);\n }\n }", "public void quickSortRecur() {\n this.array = quickSortRecur(array, size);\n }", "public static void main(String arg []) {\r\n\t\tint n = 8; //problem size\r\n\t\t\r\n\t\ttestSortingAlgorithm(new Insertion(n));\r\n\t\t\r\n\t\ttestSortingAlgorithm(new Selection(n));\r\n\t\t\r\n\t\ttestSortingAlgorithm(new Bubble(n));\r\n\t\t\r\n\t\ttestSortingAlgorithm(new QuicksortFateful(n));\r\n\t\t\r\n\t\ttestSortingAlgorithm(new QuicksortCentralElement(n));\r\n\t\t\r\n\t\ttestSortingAlgorithm(new QuicksortMedianOfThree(n));\r\n\t}", "public static void quickSort(int[] array, int left, int right) {\n\n\t\tif (left < right) {\n\t\t\tint pivotNewIndex = partition(array, left, right);\n\t\t\tquickSort(array, left, pivotNewIndex - 1);\n\t\t\tquickSort(array, pivotNewIndex + 1, right);\n\t\t}\n\n\t}", "public void go(int boundary) {\n\t\tthis.b = boundary;\n\t\tSystem.out.println(\"Start QuickSort ...\");\n\t\tthis.startTime = new Date().getTime();\n\t\tsort(0, sequence.length - 1);\n\t\tthis.endTime = new Date().getTime();\n\t}", "public static void quickSort(Integer[] arr) {\n int len = arr.length;\n// qsort3way(arr, 0, len - 1);\n qsort(arr, 0, len - 1);\n }", "private static <T> void quicksort(Comparable<T>[] array, int fromIndex,\r\n\t\t\tint toIndex) {\r\n\t\tComparable<T> pivot = array[toIndex];\r\n\t\tint j = toIndex;\r\n\r\n\t\t// searching for a bigger value than pivot starting at fromIndex\r\n\t\tfor (int i = fromIndex; i <= toIndex; i++) {\r\n\t\t\tif (compareTo(array[i], pivot) >= 0) {\r\n\r\n\t\t\t\t// searching for a smaller value than pivot starting at toIndex\r\n\t\t\t\twhile (j > i) {\r\n\t\t\t\t\tj--;\r\n\t\t\t\t\tif (compareTo(array[j], pivot) <= 0) {\r\n\r\n\t\t\t\t\t\t// swap values at i and j\r\n\t\t\t\t\t\tswap(array, j, i);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t * if right position for pivot has been found swap pivot and\r\n\t\t\t\t * element at reached position\r\n\t\t\t\t */\r\n\t\t\t\tif (i == j) {\r\n\t\t\t\t\tswap(array, i, toIndex);\r\n\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Checks if there are more elements to sort on the left\r\n\t\t\t\t\t * side of the right of pivot\r\n\t\t\t\t\t */\r\n\t\t\t\t\tif (i - 1 > fromIndex) {\r\n\t\t\t\t\t\tquicksort(array, fromIndex, i - 1);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * calls quicksort if there are more elements to sort on the\r\n\t\t\t\t\t * right side of the of pivot\r\n\t\t\t\t\t */\r\n\t\t\t\t\tif (i + 1 < toIndex) {\r\n\t\t\t\t\t\tquicksort(array, i + 1, toIndex);\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// i shouldn't be bigger than j\r\n\t\t\tif (i > j) {\r\n\t\t\t\tthrow new IllegalStateException(\"i > j\");\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void sort() {\n\t\tif (data.size() < 10) {\n\t\t\tbubbleSort();\n\t\t\tSystem.out.println(\"Bubble Sort\");\n\t\t} else {\n\t\t\tquickSort();\n\t\t\tSystem.out.println(\"Quick Sort\");\n\t\t}\n\t}", "static void quicksort( Vector<ECG> L, Vector<Paciente> m,int ini, int fin){\n\t\tif(ini<fin){\n\t\t\tint x=pivotear(L,m,ini,fin);\n\t\t\tquicksort(L,m,ini,x-1);\n\t\t\tquicksort(L,m,x+1,fin);\n\t\t}\n\t}", "private static void quickSort(int[] array, int begin, int end, boolean useMedian) {\n int i = begin;\n int j = end;\n if (array.length==0 || array == null) {\n return;\n }\n int pivot = array[begin];\n if (useMedian) { \n pivot = array[begin + (end - begin) / 2];\n }\n\n while (i <= j) { \n while (array[i] < pivot) { \n i++;\n }\n while (array[j] > pivot) { \n j--; r\n }\n if (i <= j) { \n swap(array, i, j); \n i++;\n j--;\n }\n }\n\n if (begin < j) { \n quickSort(array, begin, j, useMedian);\n }\n if (i < end) { \n quickSort(array, i, end, useMedian);\n }\n }", "private void sort(T[] arr, int lo, int hi) {\n if (lo >= hi) return; // we return if the size of the part equals 1\n int pivot = partition(arr, lo, hi); // receiving the index of the pivot element\n sort(arr, lo, pivot - 1); // sorting the left part\n sort(arr, pivot + 1, hi); // sorting the right part\n }", "static void quickSort (double a[], int lo, int hi){\n int i=lo, j=hi;\r\n\t\tdouble h;\r\n double pivot=a[lo];\r\n\r\n // pembagian\r\n do{\r\n while (a[i]<pivot) i++;\r\n while (a[j]>pivot) j--;\r\n if (i<=j)\r\n {\r\n h=a[i]; a[i]=a[j]; a[j]=h;//tukar\r\n i++; j--;\r\n }\r\n } while (i<=j);\r\n\r\n // pengurutan\r\n if (lo<j) quickSort(a, lo, j);\r\n if (i<hi) quickSort(a, i, hi);\r\n }", "public static ArrayList<Integer> quickSortSubset(ArrayList<Integer> input, int level){\n if(input.size() < 2){\n return input;\n }\n\n //pivot is the last number in the input array\n //currentPos is the current index being compared to pivot\n int pivot = input.get(input.size()-1);\n int currentPos = 0;\n ArrayList<Integer> auxList = new ArrayList<>();\n\n /* the loop runs until currentPos reaches the pivot\n * each time the loop runs, input[currentPos] is either kept if less than\n * the pivot, or moved to the auxList if greater than or equal */\n while(currentPos < input.size()-1) {\n\n if(debug) {\n tabPrint(\"input: \" + input.toString(), level);\n tabPrint(\"auxList: \" + auxList.toString(), level);\n tabPrint(\"Pivot: \" + pivot, level);\n }\n\n\n if (input.get(currentPos) >= pivot) { //move number to auxList if it's greater or equal to pivot\n if(debug) tabPrint(\"Move \"+input.get(currentPos)+\" to auxList\",level);\n auxList.add(input.remove(currentPos));\n } else { //keep number if it's less than pivot\n if(debug) tabPrint(\"Keep \"+input.get(currentPos),level);\n currentPos++;\n }\n }\n\n //remove pivot from subset to be sorted since it is already in it's correct position\n input.remove(input.size()-1);\n\n //recursively sorts both sets of numbers\n input = quickSortSubset(input, level+1);\n auxList = quickSortSubset(auxList,level+1);\n\n //recombines all elements into one array\n input.add(pivot);\n input.addAll(auxList);\n\n return input;\n\n }", "public static void main(String[] args) {\n\r\n\t\t int[] arr = generateRandomArrayWithRandomNum();\r\n\t int checksSelectionSort = 0;\r\n\t int checksBubbleSort = 0;\r\n\t int checksMergeSort = 0;\r\n\t int checksQuickSort = 0;\r\n\t int[] copyArr = new int[1000];\r\n\t for (int x = 0; x < 20; x++) {\r\n\t System.arraycopy(arr, 0, copyArr, 0, 1000);\r\n\t checksSelectionSort += doSelectionSort(arr);\r\n\r\n\t \r\n\t System.arraycopy(copyArr, 0, arr, 0, 1000);\r\n\t checksBubbleSort += bubbleSort(copyArr);\r\n\t System.arraycopy(arr, 0, copyArr, 0, 1000);\r\n\t checksMergeSort += new mergeSort().sort(arr);\r\n\t System.arraycopy(copyArr, 0, arr, 0, 1000);\r\n\t checksQuickSort += new quickSort().sort(copyArr);\r\n\t }\r\n\t System.out.println(\"Analysis Of Sorting algorithms \");\r\n\t System.out.println(\"Selection Sort : \"+checksSelectionSort/20);\r\n\t System.out.println(\"Bubble Sort : \"+checksBubbleSort/20);\r\n\t System.out.println(\"Merge Sort : \"+checksMergeSort/20);\r\n\t System.out.println(\"Quick Sort : \"+checksQuickSort/20);\r\n\r\n\t \r\n\t }", "public static void quickSort (int[] elts) {\r\n\t\tquickSortSegment (elts, 0, elts.length);\r\n\t}", "public static void quickSort (int[] elts) {\r\n\t\tquickSortSegment (elts, 0, elts.length);\r\n\t}", "public static void quickSort(int[] input) {\r\n\t\tint len = input.length;\r\n\t\tquickSortDemo(input, 0, len - 1);\r\n\r\n\t}", "public static void main(String[] args) {\n\r\n\t\tint[] a;\r\n\r\n\t\ta= new int[] {2,8,3,6,2,7,1,9,6,8};\r\n\r\n\t\tSort.bubble(a);\r\n\r\n\t\tSystem.out.println(\"BubbleSort: \\n\");\r\n\t\tfor (int i = 0; i < a.length; i++) {\r\n\t\t\tSystem.out.print(a[i] + \" \");\r\n\t\t}\r\n\t\t\r\n\t\ta= new int[] {2,8,3,6,2,7,1,9,6,8};\r\n\r\n\t\tSort.selection(a);\r\n\t\t\r\n\t\tSystem.out.println(\"\\n\\nSelection: \\n\");\r\n\t\tfor (int i = 0; i < a.length; i++) {\r\n\t\t\tSystem.out.print(a[i] + \" \");\r\n\t\t}\r\n\t\t\r\n\t\ta= new int[] {2,8,3,6,2,7,1,9,6,8};\r\n\r\n\t\tSort.insertion(a);\r\n\t\t\r\n\t\tSystem.out.println(\"\\n\\nInsertion: \\n\");\r\n\t\tfor (int i = 0; i < a.length; i++) {\r\n\t\t\tSystem.out.print(a[i] + \" \");\r\n\t\t}\r\n\r\n\t\ta= new int[] {2,8,3,6,2,7,1,9,6,8};\r\n\r\n\t\tSort.mergeSort(a, 0, a.length-1);\r\n\t\t\r\n\t\tSystem.out.println(\"\\n\\nMerge: \\n\");\r\n\t\tfor (int i = 0; i < a.length; i++) {\r\n\t\t\tSystem.out.print(a[i] + \" \");\r\n\t\t}\r\n\t\t\r\n\t\ta= new int[] {2,8,3,6,2,7,1,9,6,8};\r\n\r\n\t\tSort.quickSort(a, 0, a.length-1);\r\n\t\t\r\n\t\tSystem.out.println(\"\\n\\nQuick: \\n\");\r\n\t\tfor (int i = 0; i < a.length; i++) {\r\n\t\t\tSystem.out.print(a[i] + \" \");\r\n\t\t}\r\n\t\t\r\n\t\ta= new int[] {2,8,3,6,2,7,1,9,6,8};\r\n\r\n\t\tSort.qs(a, 0, a.length-1);\r\n\t\t\r\n\t\tSystem.out.println(\"\\n\\nQuick1: \\n\");\r\n\t\tfor (int i = 0; i < a.length; i++) {\r\n\t\t\tSystem.out.print(a[i] + \" \");\r\n\t\t}\r\n\t\t\r\n\t}", "public static void quickSortIn(int[] array, int left, int right, int n) {\n\n\t\tif (right - left < n) {\n\t\t\tinsertionSort(array, left, right);\n\t\t}\n\t\telse{\n\t\t\tif (left < right) {\n\t\t\t\tint pivotNewIndex = partition(array, left, right);\n\t\t\t\tquickSortIn(array, left, pivotNewIndex - 1, n);\n\t\t\t\tquickSortIn(array, pivotNewIndex + 1, right, n);\n\t\t\t}\n\t\t}\n\n\t}", "@Override\n protected void partialQuickSort(Integer[] map, int left, int right, int minIdx, int maxIdx) {\n do {\n int i = left;\n int j = right;\n int x = map[i + ((j - i) >> 1)];\n do {\n while (i < map.length && this.compareKeys(x, map[i]) > 0)\n i++;\n\n while (j >= 0 && this.compareKeys(x, map[j]) < 0)\n j--;\n\n if (i > j)\n break;\n\n if (i < j) {\n int temp = map[i];\n map[i] = map[j];\n map[j] = temp;\n }\n\n i++;\n j--;\n } while (i <= j);\n\n if (minIdx >= i)\n left = i + 1;\n else if (maxIdx <= j)\n right = j - 1;\n\n if (j - left <= right - i) {\n if (left < j)\n this.partialQuickSort(map, left, j, minIdx, maxIdx);\n\n left = i;\n } else {\n if (i < right)\n this.partialQuickSort(map, i, right, minIdx, maxIdx);\n\n right = j;\n }\n } while (left < right);\n }", "public abstract void sort(int[] sortMe);", "void sort( int low, int high)\n {\n if (low > high)\n {\n /* pi is partitioning index, arr[pi] is\n now at right place */\n int pi = partition(low, high);\n\n // Recursively sort elements before\n // partition and after partition\n sort( low, pi-1);\n sort( pi+1, high);\n }\n }", "private void quicksortSeq(Comparable[] array, int low, int up){\r\n\t\tif(low < up){\r\n\t\t\trekursionsSchritte += 2;\r\n\t\t\tint p = findPiv(array, low, up);\r\n\t\t\tquicksortSeq(array, low, p);\r\n\t\t\tquicksortSeq(array, p + 1, up);\r\n\t\t}\r\n\t}", "public T[] sortAux(T array[], int low, int high, int switchSize) {\n\t\t \n\t if (low < high) {\n\t \t \n\t \t \tif (array.length < switchSize) {\n\t \t \t\tarray = insertionSort.sort(array);\n\t \t \t} else {\n\t \t \t\t//Find the correct index for the pivot\n\t \t int pivotCorrected = helpers.partition(array, low, high);\n\n\t \t //Recursively sort elements to the left and right of pivot\n\t \t array = sortAux(array, low, pivotCorrected - 1, switchSize);\n\t \t array = sortAux(array, pivotCorrected + 1, high, switchSize);\n\t \t \t}\n\t }\n\t return array;\n\t }", "private static <E extends Comparable<? super E>> void quickSortHelper(\r\n\t\t\tComparable<E>[] data, int left, int right,\r\n\t\t\tComparator<Comparable<E>> comparator) {\r\n\r\n\t\t// Pick a pivot, partition around that pivot, then recursively sort the\r\n\t\t// left and right sides\r\n\t\tif (left + CUTOFF <= right) {\r\n\t\t\tE pivot = median3(data, left, right, comparator);\r\n\t\t\tint partition = partition(data, left, right, pivot, comparator);\r\n\t\t\tquickSortHelper(data, left, partition - 1, comparator);\r\n\t\t\tquickSortHelper(data, partition + 1, right, comparator);\r\n\t\t} else {\r\n\t\t\tinsertionSort(data, left, right, comparator);\r\n\t\t}\r\n\t}", "private static void recursiveQuicksort(int[] ints, int si, int ei) {\n\n\t\tif (si == ei || ei < si)\n\t\t\treturn;\n\n\t\tint start = si;\n\t\tint ri = si + (int)(Math.random() * (ei - si + 1));\n\t\tint numDuplicates = 0;\n\n\t\tint temp = ints[ei];\n\t\tints[ei] = ints[ri];\n\t\tints[ri] = temp;\n\t\tri = ei;\n\t\tei--;\n\n\t\twhile (si + numDuplicates <= ei) {\n\t\t\tif (ints[si + numDuplicates] == ints[ri])\n\t\t\t\tnumDuplicates++;\n\t\t\telse if (ints[si + numDuplicates] < ints[ri]) {\n\t\t\t\tif (numDuplicates > 0) {\n\t\t\t\t\ttemp = ints[si + numDuplicates];\n\t\t\t\t\tints[si + numDuplicates] = ints[ri];\n\t\t\t\t\tints[si] = temp;\n\t\t\t\t}\n\t\t\t\tsi++;\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttemp = ints[ei];\n\t\t\t\tints[ei] = ints[si + numDuplicates];\n\t\t\t\tints[si + numDuplicates] = temp;\n\t\t\t\tei--;\n\t\t\t}\n\t\t}\n\n\t\ttemp = ints[si + numDuplicates];\n\t\tints[si + numDuplicates] = ints[ri];\n\t\tints[ri] = temp;\n\n\t\trecursiveQuicksort(ints, start, si - 1);\n\t\trecursiveQuicksort(ints, ei + 1, ri);\n\n\t}", "public static void main(String[] args) {\n\t\tStopwatch timer = new Stopwatch();\n \tString[] s1 = {\"LS3A3PS\",\"130N740\",\"53KD8Y60\",\"D48P1L3D\",\"Y7M\"};\n\t\tString[] s2 = {\"U45\",\"J6Y\",\"VRW\",\"L60\",\"ZVN\"};\n\t\tString[] s3 = {\"NCDJMN\",\"0BTWJ\",\"TK5FLT\",\"JNYJO\",\"C1LA9H\"};\n\t\tString[] s4 = {\"K32Z\",\"KJH6\",\"5G9O\",\"9JOL\",\"VJNY\"};\n\t\tString[] s5 = {\"3J4\",\"TFHX\",\"A5QOR4\",\"L7\",\"L9T7K8ZG\"};\n\t\t\n int n = s1.length;\n sort(s1);\n StdOut.println(\"Asad Zaheer\\n\\nThree-way Quicksort Test 1\\n\");\n for (int x = 0; x < n; x++) {\n \tStdOut.println(s1[x]);\n }\n StdOut.println();\n double time = timer.elapsedTime();\n \t\t//display the execution time second test\n \t\tStdOut.println(\"Execution time \" + time + \" seconds.\\n\");\n \n //start stop watch for second test\n Stopwatch timer2 = new Stopwatch();\n int n1 = s2.length;\n StdOut.println(\"Asad Zaheer\\n\\nThree-way Quicksort Test 2\\n\");\n sort(s2);\n for (int x = 0; x < n1; x++) {\n \tStdOut.println(s2[x]);\n }\n StdOut.println();\n double time2 = timer2.elapsedTime();\n \t\t//display the execution time second test\n \t\tStdOut.println(\"Execution time \" + time2 + \" seconds.\\n\");\n \n //start stop watch for third test\n Stopwatch timer3 = new Stopwatch();\n int n2 = s3.length;\n StdOut.println(\"Asad Zaheer\\n\\nThree-way Quicksort Test 3\\n\");\n sort(s3);\n for (int x = 0; x < n2; x++) {\n \tStdOut.println(s3[x]);\n }\n StdOut.println();\n double time3 = timer3.elapsedTime();\n \t\t//display the execution time third test\n \t\tStdOut.println(\"Execution time \" + time3 + \" seconds.\\n\");\n \n //start stop watch for fourth test\n Stopwatch timer4 = new Stopwatch();\n int n3 = s4.length;\n StdOut.println(\"Asad Zaheer\\n\\nThree-way Quicksort Test 4\\n\");\n sort(s4);\n for (int x = 0; x < n3; x++) {\n \tStdOut.println(s4[x]);\n }\n StdOut.println();\n double time4 = timer4.elapsedTime();\n \t\t//display the execution time fourth test\n \t\tStdOut.println(\"Execution time \" + time4 + \" seconds.\\n\");\n \n //start stop watch for fifth test\n Stopwatch timer5 = new Stopwatch();\n int n4 = s5.length;\n StdOut.println(\"Asad Zaheer\\n\\nThree-way Quicksort Test 5\\n\");\n sort(s5);\n for (int x = 0; x < n4; x++) {\n \tStdOut.println(s5[x]);\n }\n StdOut.println();\n double time5 = timer5.elapsedTime();\n \t\t//display the execution time fifth test\n \t\tStdOut.println(\"Execution time \" + time5 + \" seconds.\\n\");\n }", "public static void main(String[] args) {\n QuickSort obj = new QuickSort();\n int numbers[] = new int[]{};\n try {\n numbers = obj.driverFunction(numbers);\n System.out.println(Arrays.toString(numbers));\n }catch(Exception e) {\n \t System.out.println(\"Invalid Argument\");\n }\n }", "public static void quickSort(int arr[]) {\n\t\tquickSort(arr, 0, arr.length - 1);\n\t}", "interface Subsort {\n void sort(int[] arr, int left, int right);\n }", "public static void main(String[] args) {\n\t\t\t\r\n\t\tQuickSort q = new QuickSort(); \r\n\t\tif(q.input == null || q.length==0){\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tq.quickSort(0, q.length-1);\r\n\t\tfor(int i=0; i<q.length;i++)\r\n\t\t\tSystem.out.println(q.input[i]);\r\n\t}", "private static void quicksort(int[] array, int fromIndex, int toIndex) {\r\n\t\tint pivot = array[toIndex];\r\n\t\tint j = toIndex;\r\n\r\n\t\t// searching for a bigger value than pivot starting at fromIndex\r\n\t\tfor (int i = fromIndex; i <= toIndex; i++) {\r\n\t\t\tif (array[i] >= pivot) {\r\n\r\n\t\t\t\t// searching for a smaller value than pivot starting at toIndex\r\n\t\t\t\twhile (j > i) {\r\n\t\t\t\t\tj--;\r\n\r\n\t\t\t\t\t// swap values at i and j\r\n\t\t\t\t\tif (array[j] <= pivot) {\r\n\t\t\t\t\t\tswap(array, j, i);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t * if right position for pivot has been found swap pivot and\r\n\t\t\t\t * element at reached position\r\n\t\t\t\t */\r\n\t\t\t\tif (i == j) {\r\n\t\t\t\t\tswap(array, i, toIndex);\r\n\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Checks if there are more elements to sort on the left\r\n\t\t\t\t\t * side of the right of pivot\r\n\t\t\t\t\t */\r\n\t\t\t\t\tif (i - 1 > fromIndex) {\r\n\t\t\t\t\t\tquicksort(array, fromIndex, i - 1);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * calls quicksort if there are more elements to sort on the\r\n\t\t\t\t\t * right side of the of pivot\r\n\t\t\t\t\t */\r\n\t\t\t\t\tif (i + 1 < toIndex) {\r\n\t\t\t\t\t\tquicksort(array, i + 1, toIndex);\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// i shouldn't be bigger than j\r\n\t\t\tif (i > j) {\r\n\t\t\t\tthrow new IllegalStateException(\"i > j\");\r\n\t\t\t}\r\n\t\t}\r\n\t}" ]
[ "0.6995139", "0.6880269", "0.6776992", "0.6743407", "0.67421347", "0.6726314", "0.66673005", "0.6665514", "0.6663525", "0.6631636", "0.65927076", "0.65833086", "0.65783674", "0.65737987", "0.65480644", "0.654393", "0.6524867", "0.65197724", "0.64984787", "0.6471656", "0.6467011", "0.64634985", "0.6458926", "0.6457125", "0.6454557", "0.6449251", "0.6443645", "0.64270437", "0.64015734", "0.63916427", "0.6389283", "0.63545936", "0.6353152", "0.63436234", "0.6321321", "0.63191825", "0.6301166", "0.6298", "0.6293669", "0.62732553", "0.6271385", "0.62662816", "0.6259008", "0.62382907", "0.62182945", "0.6206372", "0.6205436", "0.6204061", "0.61829895", "0.6178821", "0.6160654", "0.61528623", "0.61486906", "0.61386514", "0.61376876", "0.6136961", "0.61338764", "0.6124524", "0.61143273", "0.61093444", "0.61079365", "0.60974205", "0.60945463", "0.6089761", "0.60892624", "0.6086151", "0.6066061", "0.60648185", "0.60632974", "0.60372114", "0.6026824", "0.6024403", "0.60157764", "0.6011233", "0.60046947", "0.5995155", "0.59950507", "0.5988549", "0.5980055", "0.59680384", "0.5960326", "0.59602416", "0.5956155", "0.5955414", "0.5955414", "0.5954501", "0.5952731", "0.5937801", "0.5932988", "0.5923548", "0.59218293", "0.5920774", "0.59138703", "0.5905277", "0.5903679", "0.5902238", "0.5897339", "0.58934957", "0.5873225", "0.5868913", "0.5868299" ]
0.0
-1
Sorts a list using Quicksort. What Quicksort does is, first to check if the sublist has more than one element, if it has only one, that part is considered sorted. The chosen pivot is the last element in the list. If it has more than one element, it sets two ints, i and j to be equal to the first index of the sublist and the last one respectively. Then it goes into a loop that iterates while i is less or equal to j. In the loop, first it augments i by one until it reaches the index of an element that is greater than the pivot, then it decrements j until it reaches an element lesser than the pivot, after that it checks if i is not equal to j, if the condition is true, the elements in i and j are swapped and i is augmented if its different to the beginIndex variable (because without that check, i never reaches the value of the element in beginIndex if it needs to be swapped), j is decremented if its different to the finishIndex variable. Finally, when i is greater than j, if i is lesser than the last element index, it swaps the element in the finishIndex with the element in i and calls itself recursively with changed values.
private static <T extends Comparable<? super T>> void quickSort(List<T> list, int beginIndex, int finishIndex){ if(beginIndex + 1 <= finishIndex){ int i = beginIndex; int j = finishIndex; while(i <= j){ while(list.get(i).compareTo(list.get(finishIndex)) < 0 && i < finishIndex){ i++; } while(list.get(j).compareTo(list.get(finishIndex)) >= 0 && j > beginIndex){ j--; } if(i <= j) { if(i != j) swap(list, i, j); if(i != beginIndex) i++; if(j != finishIndex) j--; } } if(i < finishIndex) swap(list, i, finishIndex); quickSort(list, beginIndex, i - 1); quickSort(list, i + 1, finishIndex); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void quickSort(int start, int end) {\n\t\tint pivot, i, j;\n\t\tif (start < end) {\n\t\t\t// Select first element as Pivot\n\t\t\tpivot = start;\n\t\t\ti = start;\n\t\t\tj = end;\n\n\t\t\t// Base condition\n\t\t\twhile (i < j) {\n\t\t\t\t// increment i till found greater element than pivot\n\t\t\t\tfor (i = start; i <= end; i++) {\n\t\t\t\t\tif (data.get(i) > data.get(pivot)) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// decrement j till found lesser element than pivot\n\t\t\t\tfor (j = end; j >= start; j--) {\n\t\t\t\t\tif (data.get(j) <= data.get(pivot)) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// if i<j than swap\n\t\t\t\tif (i < j) {\n\t\t\t\t\tswap(i, j);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// set pivot to jth element & move pivot to proper position\n\t\t\tswap(j, pivot);\n\n\t\t\t// Repeat for sub arrays\n\t\t\tquickSort(start, j - 1);\n\t\t\tquickSort(j + 1, end);\n\t\t}\n\t}", "private void quickSort(List<T> array, int startIndex, int endIndex, FuncInterface<T> ICompare)\n {\n if (startIndex < endIndex)\n {\n // calculate the pivotIndex\n int pivotIndex = partition(array, startIndex, endIndex, ICompare);\n // quickSort the left sub-array\n quickSort(array, startIndex, pivotIndex, ICompare);\n // quickSort the right sub-array\n quickSort(array, pivotIndex + 1, endIndex, ICompare); \n }\n }", "public static void quickSort(ArrayList<Integer> S){\n\t\t\n\t\tif (S.isEmpty()) { //if empty just return itself \n\t\t\treturn; \n\t\t}\n\t\t\n\t\tint pivot = S.get(S.size()-1); //creating a pivot point for the sort \n\t\t\n\t\tArrayList<Integer> L = new ArrayList<Integer>(); //Creating array list for Less than\n\t\tArrayList<Integer> E = new ArrayList<Integer>(); //Creating array list for Equal than\n\t\tArrayList<Integer> G = new ArrayList<Integer>(); //Creating array list for Greater than \n\t\t\n\t\twhile (!S.isEmpty()) { //run while the array list isn't empty \n\t\t\t\n\t\t\tif (S.get(0)< pivot) { //if its less than the pivot, add less than \n\t\t\t\t\n\t\t\t\tL.add(S.get(0)); //adds the less than \n\t\t\t\tS.remove(0); //removes the elements at that index position \n\t\t\t}\n\t\t\telse if(S.get(0) == pivot) { //if its equal to the pivot, add equal to \n\t\t\t\t\n\t\t\t\tE.add(S.get(0));\n\t\t\t\tS.remove(0);\n\t\t\t}\n\t\t\t\n\t\t\telse if (S.get(0) > pivot) { //if its greater than the pivot point, add greater than \n\t\t\t\t\n\t\t\t\tG.add(S.get(0));\n\t\t\t\tS.remove(0);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tif (!L.isEmpty()) { //if Less than isn't empty, call quick sort on less than \n\t\t\t\n\t\t\tquickSort(L); //calls the quick sort for less than \n\t\t}\n\t\t\n\t\tif (!G.isEmpty()) { //if Greater than isn't empty, call quick sort on greater than \n\t\t\t\n\t\t\tquickSort(G); //calls quick sort for greater than \n\t\t}\n\t\t\n\t\tS.addAll(L); //Shifting all of the elements to the right \n\t\tS.addAll(E); //Shifting all of the elements to the right \n\t\tS.addAll(G); //Shifting all of the elements to the right \n\t}", "public void quicksort(ArrayList<Node> array, int low, int high)\n {\n Node pivot = new Node(array.get(low).element);\n //Start value for pivot index\n int pivotIndex = low;\n //Define index in list where values start being higher than the pivot \n int higherThan = -1;\n //Begin the for loop after the first element\n for (int i = low + 1; i <= high; i++)\n \n { int gap = Math.abs(pivotIndex - i);\n if (array.get(i).element.compareTo(pivot.element) <= 0 && gap == 1)\n { switchPosition(i,pivotIndex);\n pivotIndex = i;\n }\n else if (array.get(i).element.compareTo(pivot.element) <= 0 && gap > 1)\n { //higherThan = i;\n switchPosition(i, pivotIndex);\n int temp = i;\n i = pivotIndex;\n pivotIndex = temp;\n switchPosition(i+1, pivotIndex); \n pivotIndex = i+1;\n //i++;\n //pivotIndex = higherThan;\n //higherThan++;\n }\n else // (array.get(i).element.compareTo(pivot.element) > 0 )\n { //Do nothing, element should stay in its position greater than the pivot\n }\n \n }\n System.out.println(\"Pivot index: \" + pivotIndex + \"\\n\");\n for (int i = 0; i < array.size(); i++)\n {\n System.out.println(\" \" + array.get(i).element.toString());\n }\n if ((pivotIndex - 1) >= 1)\n { quicksort(array, 0, pivotIndex - 1);\n System.out.println(\"\\n low index call, pivot element \" + array.get(pivotIndex).element.toString());\n }\n if ((high - pivotIndex) >= 1)\n {\n quicksort(array, pivotIndex + 1, high-1); \n }\n }", "private static <T> void quickSort(@Nonnull List<T> x, @Nonnull Comparator<? super T> comparator, int off, int len) {\n if (len < 7) {\n for (int i = off; i < len + off; i++) {\n for (int j = i; j > off && comparator.compare(x.get(j), x.get(j - 1)) < 0; j--) {\n swapElements(x, j, j - 1);\n }\n }\n return;\n }\n\n // Choose a partition element, v\n int m = off + (len >> 1); // Small arrays, middle element\n if (len > 7) {\n int l = off;\n int n = off + len - 1;\n if (len > 40) { // Big arrays, pseudomedian of 9\n int s = len / 8;\n l = med3(x, comparator, l, l + s, l + 2 * s);\n m = med3(x, comparator, m - s, m, m + s);\n n = med3(x, comparator, n - 2 * s, n - s, n);\n }\n m = med3(x, comparator, l, m, n); // Mid-size, med of 3\n }\n T v = x.get(m);\n\n // Establish Invariant: v* (<v)* (>v)* v*\n int a = off;\n int b = a;\n int c = off + len - 1;\n int d = c;\n while (true) {\n while (b <= c && comparator.compare(x.get(b), v) <= 0) {\n if (comparator.compare(x.get(b), v) == 0) {\n swapElements(x, a++, b);\n }\n b++;\n }\n while (c >= b && comparator.compare(v, x.get(c)) <= 0) {\n if (comparator.compare(x.get(c), v) == 0) {\n swapElements(x, c, d--);\n }\n c--;\n }\n if (b > c) break;\n swapElements(x, b++, c--);\n }\n\n // Swap partition elements back to middle\n int n = off + len;\n int s = Math.min(a - off, b - a);\n vecswap(x, off, b - s, s);\n s = Math.min(d - c, n - d - 1);\n vecswap(x, b, n - s, s);\n\n // Recursively sort non-partition-elements\n if ((s = b - a) > 1) quickSort(x, comparator, off, s);\n if ((s = d - c) > 1) quickSort(x, comparator, n - s, s);\n }", "private static <T> void quicksort(Comparable<T>[] array, int fromIndex,\r\n\t\t\tint toIndex) {\r\n\t\tComparable<T> pivot = array[toIndex];\r\n\t\tint j = toIndex;\r\n\r\n\t\t// searching for a bigger value than pivot starting at fromIndex\r\n\t\tfor (int i = fromIndex; i <= toIndex; i++) {\r\n\t\t\tif (compareTo(array[i], pivot) >= 0) {\r\n\r\n\t\t\t\t// searching for a smaller value than pivot starting at toIndex\r\n\t\t\t\twhile (j > i) {\r\n\t\t\t\t\tj--;\r\n\t\t\t\t\tif (compareTo(array[j], pivot) <= 0) {\r\n\r\n\t\t\t\t\t\t// swap values at i and j\r\n\t\t\t\t\t\tswap(array, j, i);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t * if right position for pivot has been found swap pivot and\r\n\t\t\t\t * element at reached position\r\n\t\t\t\t */\r\n\t\t\t\tif (i == j) {\r\n\t\t\t\t\tswap(array, i, toIndex);\r\n\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Checks if there are more elements to sort on the left\r\n\t\t\t\t\t * side of the right of pivot\r\n\t\t\t\t\t */\r\n\t\t\t\t\tif (i - 1 > fromIndex) {\r\n\t\t\t\t\t\tquicksort(array, fromIndex, i - 1);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * calls quicksort if there are more elements to sort on the\r\n\t\t\t\t\t * right side of the of pivot\r\n\t\t\t\t\t */\r\n\t\t\t\t\tif (i + 1 < toIndex) {\r\n\t\t\t\t\t\tquicksort(array, i + 1, toIndex);\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t// i shouldn't be bigger than j\r\n\t\t\tif (i > j) {\r\n\t\t\t\tthrow new IllegalStateException(\"i > j\");\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void quickSort(int[] a, int startIndex, int endIndex) {\r\n int pivotIndex; // the index of pivot returned by the quicksort partition\r\n // if the set has more than one element, then partition\r\n if (startIndex < endIndex) {\r\n // partition and return the pivotIndex\r\n pivotIndex = partition(a, startIndex, endIndex);\r\n // recursive call to quicksort on low half\r\n quickSort(a, startIndex, pivotIndex - 1);\r\n // recursive call to quicksort on high half \r\n quickSort(a, pivotIndex + 1, endIndex);\r\n } // end if\r\n }", "private static void quicksort(int[] array, int fromIndex, int toIndex) {\r\n\t\tint pivot = array[toIndex];\r\n\t\tint j = toIndex;\r\n\r\n\t\t// searching for a bigger value than pivot starting at fromIndex\r\n\t\tfor (int i = fromIndex; i <= toIndex; i++) {\r\n\t\t\tif (array[i] >= pivot) {\r\n\r\n\t\t\t\t// searching for a smaller value than pivot starting at toIndex\r\n\t\t\t\twhile (j > i) {\r\n\t\t\t\t\tj--;\r\n\r\n\t\t\t\t\t// swap values at i and j\r\n\t\t\t\t\tif (array[j] <= pivot) {\r\n\t\t\t\t\t\tswap(array, j, i);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t * if right position for pivot has been found swap pivot and\r\n\t\t\t\t * element at reached position\r\n\t\t\t\t */\r\n\t\t\t\tif (i == j) {\r\n\t\t\t\t\tswap(array, i, toIndex);\r\n\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Checks if there are more elements to sort on the left\r\n\t\t\t\t\t * side of the right of pivot\r\n\t\t\t\t\t */\r\n\t\t\t\t\tif (i - 1 > fromIndex) {\r\n\t\t\t\t\t\tquicksort(array, fromIndex, i - 1);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * calls quicksort if there are more elements to sort on the\r\n\t\t\t\t\t * right side of the of pivot\r\n\t\t\t\t\t */\r\n\t\t\t\t\tif (i + 1 < toIndex) {\r\n\t\t\t\t\t\tquicksort(array, i + 1, toIndex);\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// i shouldn't be bigger than j\r\n\t\t\tif (i > j) {\r\n\t\t\t\tthrow new IllegalStateException(\"i > j\");\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public <T extends Comparable<T>> int partition(T[] list, int first, int last) {\n\t/**\n\t * System.out.println(\"hey\" + Arrays.toString(list));\n\n\tint pivotIndex = 0;\n\tif(list.length < 3) {\n\t\tpivotIndex = 0;\n\t} else {\n\t\tT[] temp = Arrays.copyOfRange(list, 0, 3);\n\t\tArrays.sort(temp);\n\t\tT a = temp[1];\n\t\tfor(int i=0; i<3; i++) {\n\t\t\tif(a.equals(list[i])) {\n\t\t\t\tpivotIndex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Move pivot to first Index...\n\t\tT tempo = list[first];\n\t\tlist[first] = list[pivotIndex];\n\t\tlist[pivotIndex] = tempo;\n\t}\n\t\n\t\t */\n\t\n\t\n\tT pivot = list[first]; \n\tdisplay(list, pivot);\n\t// Choose the first element as the pivot 17 \n\tint low = first + 1; // Index for forward search\n\tint high = last; \n\t// Index for backward search\n\n\twhile (high > low) {\n\t\t// Search forward from left\n\t\twhile (low <= high && list[low].compareTo(pivot) <= 0)\n\t\t\tlow++;\n\n\t\t// Search backward from right\n\t\twhile (low <= high && list[high].compareTo(pivot) > 0)\n\t\t\thigh--;\n\n\t\t// Swap two elements in the list\n\t\tif (high > low) {\n\t\t\tT temp = list[high]; \n\t\t\tlist[high] = list[low]; \n\t\t\tlist[low] = temp;\n\t\t} \n\t} \n\n\n\twhile (high > first && list[high].compareTo(pivot) >= 0) high--;\n\tif (list[high].compareTo(pivot) <= 0){ \n\t\tlist[first] = list[high]; \n\t\tlist[high] = pivot;\n\t\treturn high;\n\t}else {\n\t\treturn first; \n\t}\n}", "public void quickSortHelper(int start, int end){\n if(start < end){\n //partition index calls partition that returns idx\n //and also puts toSort[partitionidx] in the right place\n int partitionidx = partition(start, end);\n\n //sorts elements before and after the partitions\n //recursive - nice\n //System.out.println(\"test\");\n quickSortHelper(start, partitionidx - 1); //befre\n quickSortHelper(partitionidx + 1, end); //after\n }\n }", "private void quicksort(int low, int high) {\r\n\t\tint i = low, j = high;\r\n\t\t// Get the pivot element from the middle of the list\r\n\t\tint pivot = mutualNum[low + (high-low)/2];\r\n\t\t// Divide into two lists\r\n\t\twhile (i <= j) {\r\n\t\t\twhile (mutualNum[i] > pivot) {\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t\twhile (mutualNum[j] < pivot) {\r\n\t\t\t\tj--;\r\n\t\t\t}\r\n\t\t\tif (i <= j) {\r\n\t\t\t\texchange(i, j);\r\n\t\t\t\ti++;\r\n\t\t\t\tj--;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// Recursion\r\n\t\tif (low < j)\r\n\t\t\tquicksort(low, j);\r\n\t\tif (i < high)\r\n\t\t\tquicksort(i, high);\r\n\t}", "private static void quicksort( Comparable [ ] a, int low, int high ) {\n if( low + CUTOFF > high )\n insertionSort( a, low, high );\n else {\n// Sort low, middle, high\n int middle = ( low + high ) / 2;\n if( a[ middle ].lessThan( a[ low ] ) )\n swapReferences( a, low, middle );\n if( a[ high ].lessThan( a[ low ] ) )\n swapReferences( a, low, high );\n if( a[ high ].lessThan( a[ middle ] ) )\n swapReferences( a, middle, high );\n// Place pivot at position high - 1\n swapReferences( a, middle, high - 1 );\n Comparable pivot = a[ high - 1 ];\n// Begin partitioning\n int i, j;\n for( i = low, j = high - 1; ; ) {\n while( a[ ++i ].lessThan( pivot ) );\n while( pivot.lessThan( a[ --j ] ) );\n if( i < j )\n swapReferences( a, i, j );\n else\n break;\n }\n// Restore pivot\n swapReferences( a, i, high - 1 );\n quicksort( a, low, i - 1 ); // Sort small elements\n quicksort( a, i + 1, high ); // Sort large elements\n }\n }", "public static void sequentialSort(List<Integer> list, int start, int end) {\n if (start >= end)\n return;\n // recursive case\n\n // now sort into two sections so stuff in lower section is less than\n // pivot, and remainder is in upper section.\n int pivot = list.get((start + end) / 2);\n int lower = start;\n int upper = end - 1;\n\n while (lower < upper) {\n int lowerItem = list.get(lower);\n int upperItem = list.get(upper);\n if (lowerItem < pivot)\n // this item is not out of place\n lower++;\n else if (upperItem > pivot)\n // this item is not out of place\n upper--;\n else {\n // both items are out of place --- so swap them.\n list.set(lower, upperItem);\n list.set(upper, lowerItem);\n if (upperItem != pivot)\n lower++;\n if (lowerItem != pivot)\n upper--;\n }\n }\n\n list.set(lower, pivot);\n\n ParSort.pause(list, 100); // to make animation in display mode better\n\n // A this point, lower == upper.\n ParSort.sequentialSort(list, start, lower);\n ParSort.sequentialSort(list, lower + 1, end);\n }", "void quickSort(int arr[], int low, int high) \n { \n if (low < high) \n { \n /* pi is partitioning index, arr[pi] is \n now at right place */\n int pi = partition(arr, low, high); \n \n // Recursively sort elements before \n // partition and after partition \n quickSort(arr, low, pi-1); \n quickSort(arr, pi+1, high); \n } \n }", "public void quicksort(int[] a, int start, int end){\n\t\tif(end <= start) return;\r\n\t\t//2 number\r\n//\t\tif(end - start == 1 && a[start] > a[end]){\r\n//\t\t\tswap(a, start, end);\r\n//\t\t\treturn;\r\n//\t\t}\r\n\t\tif((end - start )< 20){\r\n\t\t\tinsertSort(a, start,end);\r\n\t\t\treturn;\r\n\t\t}\r\n\t int pivot = getPivot(a, start, end);\r\n\t int i = start, j = end - 1;\r\n\t while(i < j){\r\n\t while(i < j && a[++i] < pivot);\r\n\t while(i < j && a[--j] > pivot);\r\n\t if(i < j)\r\n\t swap(a, i, j);\r\n\t }\r\n\t swap(a, i, end -1);\r\n\t quicksort(a, start, i - 1);\r\n\t quicksort(a, i + 1, end);\r\n\t}", "private int partition(Comparable[] items, int first, int last) {\n /**\n * Get a random pivot for the current section.\n * <p/>\n * It should be noted that I made a decision to choose a randomized pivot\n * over selecting a hard-coded pivot (i.e. the middle), or a median. This\n * is to avoid situations where we might get the 'worst case' scenario for\n * QuickSort, leading to O(n^2) time complexity. By using a random pivot,\n * it becomes highly unlikely for the algorithm to run into this situation.\n * <p/>\n * I felt this was the safest and most reliable way of implementing the\n * pivot selection.\n */\n int pivot = (int) Math.floor(UtilityMethods.getPivot(first, last));\n\n /**\n * Swap the pivot item with the first element to move it out\n * of the way during sorting. Assign a variable to hold this\n * for quick comparison.\n */\n UtilityMethods.swapElements(items, pivot, first);\n Comparable pivotElement = items[first];\n\n /**\n * The index to begin the swapping of the elements is the next\n * index after the pivot, currently at first.\n */\n int swapPosition = first + 1;\n\n /**\n * For each element within the current section, we iterate through\n * the section, starting from one after the pivot (the swap position)\n */\n for (int currentElement = swapPosition; currentElement <= last; currentElement++) {\n\n /**\n * If the currently being checked element is smaller than the pivot,\n * we swap the current element with the 'swap position'. This results\n * in gathering all of the numbers less than the pivot element to\n * one side of the array.\n *\n * The index that is then to be swapped is incremented. This means\n * that any elements before the swap position will be sorted as 'less'\n * than the pivot. We don't need to move any elements greater than\n * the pivot.\n */\n if (items[currentElement].compareTo(pivotElement) < 0) {\n UtilityMethods.swapElements(items, swapPosition, currentElement);\n swapPosition++;\n }\n\n }\n\n /**\n * After all elements have been swapped around, we switch the first element\n * (the pivot element), with the last sorted 'less than' element in swap\n * position -1. The works, as it doesn't matter what element is in what\n * position, as long as there are greater and less than sections. By\n * doing this swap, we keep the elements less than the pivot to the left\n * of the pivot, and put the pivot in the 'correct' sorted place in the list.\n */\n UtilityMethods.swapElements(items, first, swapPosition - 1);\n\n /**\n * We return the swapPosition -1, which is the final index of the pivot element.\n */\n return swapPosition - 1;\n }", "public static ArrayList<Integer> quickSortSubset(ArrayList<Integer> input, int level){\n if(input.size() < 2){\n return input;\n }\n\n //pivot is the last number in the input array\n //currentPos is the current index being compared to pivot\n int pivot = input.get(input.size()-1);\n int currentPos = 0;\n ArrayList<Integer> auxList = new ArrayList<>();\n\n /* the loop runs until currentPos reaches the pivot\n * each time the loop runs, input[currentPos] is either kept if less than\n * the pivot, or moved to the auxList if greater than or equal */\n while(currentPos < input.size()-1) {\n\n if(debug) {\n tabPrint(\"input: \" + input.toString(), level);\n tabPrint(\"auxList: \" + auxList.toString(), level);\n tabPrint(\"Pivot: \" + pivot, level);\n }\n\n\n if (input.get(currentPos) >= pivot) { //move number to auxList if it's greater or equal to pivot\n if(debug) tabPrint(\"Move \"+input.get(currentPos)+\" to auxList\",level);\n auxList.add(input.remove(currentPos));\n } else { //keep number if it's less than pivot\n if(debug) tabPrint(\"Keep \"+input.get(currentPos),level);\n currentPos++;\n }\n }\n\n //remove pivot from subset to be sorted since it is already in it's correct position\n input.remove(input.size()-1);\n\n //recursively sorts both sets of numbers\n input = quickSortSubset(input, level+1);\n auxList = quickSortSubset(auxList,level+1);\n\n //recombines all elements into one array\n input.add(pivot);\n input.addAll(auxList);\n\n return input;\n\n }", "public ListUtilities quicksort(){\n\t\t\n\t\tListUtilities lo = this.returnToStart();\n\t\tListUtilities hi = this.goToEnd();\n\t\tListUtilities sorted = this.partition(lo, hi);\n\t\t\n\t\treturn sorted.returnToStart();\t\t\n\t}", "private void quicksort(int inLow, int inHigh) {\n\t\tint i = inLow; int j = inHigh;\n\t\t//____| Get Pivot from middle.\n\t\tfloat pivot = gameObjectsList.get(inLow + (inHigh - inLow)/2).getX();\n\t\t//____| Divide List\n\t\twhile (i <= j){\n\t\t\twhile(gameObjectsList.get(i).getX() < pivot){\n\t\t\t\ti++;\n\t\t\t}\n\t\t\twhile(gameObjectsList.get(j).getX() > pivot){\n\t\t\t\tj--;\n\t\t\t}\n\t\t\tif (i<=j){\n\t\t\t\tCollections.swap(gameObjectsList, i, j);\n\t\t\t\ti++;\n\t\t\t\tj--;\n\t\t\t}\n\t\t}\n\t\tif (inLow < j)\n\t\t\tquicksort(inLow, j);\n\t\tif (i < inHigh)\n\t\t\tquicksort(i, inHigh);\n\t}", "private void quickSort(int low, int high) {\n\t\tint i = low;\n\t\tint k = high;\n\t\tint pivot = array[low + (high - low) / 2];\n\n\t\twhile (i <= k) {\n\t\t\t// Stops when element on left side is greater than the pivot\n\t\t\twhile (array[i] < pivot) {\n\t\t\t\ti++;\n\t\t\t}\n\t\t\t// Stops when the element on the right side is less than the pivot\n\t\t\twhile (array[k] > pivot) {\n\t\t\t\tk--;\n\t\t\t}\n\t\t\t// Swap the left and right elements, since the one on the left is\n\t\t\t// greater than the one on the right (proved via pivot)\n\t\t\tif (i <= k) {\n\t\t\t\texchangeNums(i, k);\n\t\t\t\t// Move on to the next elements\n\t\t\t\ti++;\n\t\t\t\tk--;\n\t\t\t}\n\t\t}\n\t\t// Recursive calls\n\t\tif (low < k) {\n\t\t\tquickSort(low, k);\n\t\t}\n\t\tif (i < high) {\n\t\t\tquickSort(i, high);\n\t\t}\n\t}", "private static void sort(ArrayList<Comparable> list, int startIndex, int endIndex)\n {\n if (startIndex < endIndex)\n {\n int lowerIndex = startIndex;\n int medianIndex = (startIndex + endIndex) / 2;\n int upperIndex = endIndex;\n Comparable medianValue = list.get(medianIndex);\n\n while (lowerIndex < upperIndex)\n {\n while (list.get(lowerIndex).compareTo(medianValue) < 0)\n {\n ++lowerIndex;\n }\n\n while (list.get(upperIndex).compareTo(medianValue) > 0)\n {\n --upperIndex;\n }\n\n if (lowerIndex < upperIndex)\n {\n Comparable valueAtLowerIndex = list.get(lowerIndex);\n\n list.set(lowerIndex++, list.get(upperIndex));\n list.set(upperIndex--, valueAtLowerIndex);\n }\n else if (lowerIndex == upperIndex)\n {\n ++lowerIndex;\n --upperIndex;\n }\n }\n\n sort(list, startIndex, upperIndex);\n sort(list, lowerIndex, endIndex);\n }\n }", "private void doQuickSort(int lowerIndex, int higherIndex){\n\t\tint lowItter = lowerIndex;\n\t\tint highItter = higherIndex;\n \n\t\t// use the middle as a pivot numberr\n int middleIndex = lowerIndex + (higherIndex - lowerIndex)/2;\n\t\tint pivot = sortArray[middleIndex];\n \n\t\twhile (lowItter <= highItter) {\n\t\t\twhile (sortArray[lowItter] < pivot)\n lowItter++;\n \n\t\t\twhile (sortArray[highItter] > pivot)\n highItter--;\n \n compCount++;\n\t\t\tif (lowItter <= highItter) {\n\t\t\t\tswap(lowItter, highItter);\n swapCount++;\n \n\t\t\t\tlowItter++;\n\t\t\t\thighItter--;\n\t\t }\n\t\t}\n \n compCount++;\n\t\tif (lowerIndex < higherIndex)\n\t\t\tdoQuickSort(lowerIndex, highItter);\n \n compCount++;\n\t\tif (lowItter < higherIndex)\n\t\t\tdoQuickSort(lowItter, higherIndex);\n \n\t}", "private void quickSort(Comparable[] items, int left, int right) {\n if (left < right) {\n /**\n * Split the list at the pivot through partitioning it,\n * and return the pivot to separate out the less than\n * and greater than sides.\n */\n int pivot = partition(items, left, right);\n if (pivot - 1 > left) {\n quickSort(items, left, pivot - 1);\n }\n if (pivot + 1 < right) {\n quickSort(items, pivot + 1, right);\n }\n }\n }", "public static <T extends Comparable<? super T>> void quickSort(List<T> list){\n if(list.size() > 1)\n quickSort(list, 0, list.size() - 1);\n }", "protected static <T extends Comparable<? super T>> void quickSort(List<T> a,\n int low, int high){\n // Example\n // low = 0, high = 5, center = 2\n // a - 1 3 4 2 5 6 \n // a[low] = 1, a[center] = 4, a[high] = 6\n // sort if necessary\n // 4 is median, place median in position high - 1\n // pivot = 4\n // a - 1 3 5 2 4 6\n // Let i = low + 1, and j = high - 2\n // a[i] = 3, a[j] = 2\n // increment i until a[i] > pivot\n // i = 2\n // decrement j until a[j] < pivot\n // j = 3\n // swap a[i] and a[j]\n // a - 1 3 2 5 4 6\n // continue\n // i = 3\n // j = 2\n // when i and j cross\n // replace median at position i\n // a - 1 3 2 4 5 6\n // sort low to i - 1\n // sort i + 1 to high\n // a - 1 2 3 4 5 6\n\n // If length of array is short enough use insertion sort\n if(high - low < CUTOFF){\n insertionSort(a, low, high);\n return;\n } \n\n // Median of three\n int center = (high + low)/2;\n // sort low, center, high\n // 3 2 1\n // if low is greater than center\n if(a.get(low).compareTo(a.get(center)) > 0){\n swapReferences(a, low, center);\n // low is less than center\n // 2 3 1\n }\n // if center is greater than high\n if(a.get(center).compareTo(a.get(high)) > 0){\n swapReferences(a, center, high);\n // high is largest\n // 2 1 3\n }\n // if low is greater than center\n if(a.get(low).compareTo(a.get(center)) > 0){\n swapReferences(a, low, center);\n // low is less than center\n // 1 2 3\n }\n\n // center is median and will be used as pivot\n // place pivot at position high - 1\n swapReferences(a, center, high - 1);\n // store pivot value for easy accesss\n T pivot = a.get(high - 1);\n\n // partition array into elements smaller than and greater than pivot\n // low is already less than pivot\n // high is already greater than pivot\n int i = low + 1;\n int j = high - 2;\n while(true){\n // scan i to the right until object greater than pivot is found\n // when loop stops i will be pointing at element greater than pivot\n while(a.get(i).compareTo(pivot) < 0){\n i++;\n }\n\n // scan j to the left until object less than pivot is found\n // when loop stops j will be pointing to an element less than pivot\n while(a.get(j).compareTo(pivot) > 0){\n j--;\n }\n\n // if i and j cross than partitioning is complete\n if(i >= j){\n break;\n }\n\n swapReferences(a, i, j);\n\n // after swapping move to next position to check\n i++;\n j--;\n }\n\n // Put pivot in between elements less than and greater than itself\n // i is greater than so should belong above pivot\n swapReferences(a, high - 1, i);\n \n // Recursively sort element smaller than pivot and greater than pivot\n quickSort(a, low, i - 1);\n quickSort(a, i+1, high);\n }", "public void quickSort(int[] list, int p, int r){\r\n\t\tif(p<r){\r\n\t\t\tint q = partition(list, p, r);\r\n\t\t\tquickSort(list, p, q-1);\r\n\t\t\tquickSort(list, q+1, r); \r\n\t\t}\r\n\t}", "public static void quickSort (int[] nums, int start, int end) {\n\t\t// check if it's a valid array\n\t\tif (nums == null || nums.length == 0) {\n\t\t\treturn;\n\t\t}\n\n // exit condition\n\t\tif (start >= end) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tint left = start, right = end;\n\t\tint pivot = nums[start + (end - start) / 2];\n\t\t\n\t\twhile (left <= right) {\n\t\t\twhile (left <= right && nums[left] < pivot) {\n\t\t\t\tleft++;\n\t\t\t}\n\t\t\twhile (left <= right && nums[right] > pivot) {\n\t\t\t\tright--;\n\t\t\t}\n\t\t\tif (left <= right) {\n\t\t\t\tswap(nums, left, right);\n\t\t\t\tleft++;\n\t\t\t\tright--;\n\t\t\t}\n\t\t}\n\n // call quickSort recursively\n\t\tquickSort(nums, start, right);\n\t\tquickSort(nums, left, end);\n\t}", "@Test\n\tpublic void givenAnUnsortedList_ThenListIsSorted() {\n\t\tList<Integer> unsorted = new ArrayList<>();\n\t\tunsorted.add(2);\n\t\tunsorted.add(1);\n\t\tunsorted.add(3);\n\t\tunsorted.add(5);\n\t\tunsorted.add(4);\n\t\t\n\t\t// Execute the code\n\t\tList<Integer> sorted = QuickSort.getInstance().sort(unsorted);\n\t\t\n\t\t// Verify the test result(s)\n\t\tassertThat(sorted.get(0), is(1));\n\t\tassertThat(sorted.get(1), is(2));\n\t\tassertThat(sorted.get(2), is(3));\n\t\tassertThat(sorted.get(3), is(4));\n\t\tassertThat(sorted.get(4), is(5));\n\t}", "@Test\n public void testQuickSort() {\n System.out.println(\"QuickSort listo\");\n Comparable[] list = {3,2,5,4,1};\n QuickSort instance = new QuickSort();\n Comparable[] expResult = {1,2,3,4,5};\n Comparable[] result = instance.QuickSort(list, 0, list.length-1);\n assertArrayEquals(expResult, result);\n }", "public void quickSortIter(){\n int pivot = 0;\n int partition;\n boolean unordered = false;\n do {\n unordered = false;\n partition = pivot;\n for (int i = pivot + 1; i < array.length; i++) {\n if (((Comparable) array[pivot]).compareTo(array[i]) >= 0) {\n if (i - partition > 1) {\n T temp = array[i];\n array[i] = array[partition];\n array[partition] = temp;\n partition++;\n unordered = true;\n } else {\n partition++;\n unordered = true;\n }\n }\n }\n T temp = array[partition];\n array[partition] = array[pivot];\n array[pivot] = temp;\n if (partition < array.length) {\n pivot = partition + 1;\n for (int i = 0; i < partition; i++) {\n if (((Comparable) array[i]).compareTo(array[i + 1]) > 0) {\n pivot = i;\n break;\n }\n }\n }\n } while (unordered);\n\n }", "private static <AnyType extends Comparable<? super AnyType>> void quicksort(AnyType[] a, int left, int right)\n {\n if(left + CUTOFF <= right)\n {\n AnyType pivot = median3(a, left, right);\n\n // Begin partitioning\n int i = left, j = right - 1;\n for( ; ; )\n {\n while(a[++i].compareTo(pivot) < 0);\n while(a[--j].compareTo(pivot) > 0);\n if(i < j)\n CommonFunc.swapReference(a, i, j);\n else\n break;\n }\n\n CommonFunc.swapReference(a, i, right - 1);\n\n quicksort(a, left, i - 1);\n quicksort(a, i + 1, right);\n }\n else // Do an insertion sort on the subarray\n Insertionsort.insertionsort(a, left, right);\n }", "void quick_sort(int intArray[], int low, int high)\n {\n if (low < high)\n {\n // partition the array around pi=>partitioning index and return pi\n int pi = partition(intArray, low, high);\n // sort each partition recursively\n quick_sort(intArray, low, pi - 1);\n quick_sort(intArray, pi + 1, high);\n }\n }", "private void sort(T[] arr, int lo, int hi) {\n if (lo >= hi) return; // we return if the size of the part equals 1\n int pivot = partition(arr, lo, hi); // receiving the index of the pivot element\n sort(arr, lo, pivot - 1); // sorting the left part\n sort(arr, pivot + 1, hi); // sorting the right part\n }", "private static void sort(long[] list) {\n\t\tint start = 0, limit = list.length;\n\t\t\n\t\tlong temp;\n\t\tint current;\n\t\tint lowestindex;\n\n\t\twhile (start < limit) {\n\t\t\tlowestindex = start;\n\t\t\tfor (current = start; current < limit; current++)\n\t\t\t\tif (list[current] < list[lowestindex])\n\t\t\t\t\tlowestindex = current;\n\t\t\t//swap\n\t\t\ttemp = list[start];\n\t\t\tlist[start] = list[lowestindex];\n\t\t\tlist[lowestindex] = temp;\n\t\t\tstart++;\n\t\t}\n\t}", "public static List<Integer> sort(List<Integer> input) {\n\t\tif (input.size() < 2)\n\t\t\treturn input;\n\n\t\tint pivot = input.get((input.size() - 1) / 2);\n\t\tList<Integer> less = input.stream().filter(x -> x < pivot).collect(Collectors.toList());\n\t\tList<Integer> greater = input.stream().filter(x -> x > pivot).collect(Collectors.toList());\n\t\tList<Integer> all = new ArrayList<>(sort(less));\n\t\tall.add(pivot);\n\t\tall.addAll(sort(greater));\n\t\treturn all;\n\t}", "public static void intQSort(int v[], int l, int r) {\n\n int tmp; //tmp variable for swapping\n\n if (INSERTIONENABLED) {\n\n //Use insertion sort for arrays smaller than CUTOFF\n if (r < CUTOFF) {\n\n for(int i = l; i < r; i++) {\n for(int j = i; j > 0 && v[j - 1] > v[j]; j--) {\n // swap(j, j -1) {\n tmp=v[j - 1];\n v[j - 1]=v[j];\n v[j]=tmp;\n // }\n }\n }\n\n return;\n }\n }\n\n int pivot;\n int m = l + (int) (Math.random() * ((r - l) + 1)); // random number between first and last, Peto's remark\n\n //median(v[l], v[m], v[r]) {\n if (v[l] <= v[m]) {\n if (v[m] <= v[r])\n pivot = v[m];\n else {\n if (v[l] <= v[r])\n pivot = v[r];\n else\n pivot = v[l];\n }\n } else {\n if (v[m] <= v[r]) {\n if (v[l] <= v[r])\n pivot = v[l];\n else\n pivot = v[r];\n } \n else\n pivot = v[m];\n }\n // }\n\n int i=l,j=r;\n\n //Partioning\n while(i<=j) {\n\n while(v[i]<pivot) i++;\n while(v[j]>pivot) j--;\n\n if(i<=j) {\n //swap(i, j) {\n tmp=v[i];\n v[i]=v[j];\n v[j]=tmp;\n // }\n\n i++;\n j--;\n }\n }\n\n if(l<j) \n intQSort(v,l,j);\n\n if(i<r) \n intQSort(v,i,r);\n }", "private static void quickSort(int[] array, int startIndex, int rightIndex) {\n if (startIndex < rightIndex) {\n int pivot = partition(array, startIndex, rightIndex);\n quickSort(array, startIndex, pivot - 1);\n quickSort(array, pivot + 1, rightIndex);\n }\n }", "public interface QuickSort<A> {\r\n\t\r\n\tpublic void sort(A list, PivotPositions pivot) throws UnsupportedPivotException;\r\n\t\r\n\t/**\r\n\t * These values represents all possible pivots.\r\n\t * @author Robin\r\n\t *\r\n\t */\r\n\tpublic static enum PivotPositions {\r\n\t\tFIRST, RANDOM, MIDDLE;\r\n\r\n\t\t@Override\r\n\t\tpublic String toString() {\r\n\t\t\tString s = \"\";\r\n\t\t\tswitch (this) {\r\n\t\t\tcase FIRST:\r\n\t\t\t\ts = \"first\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase RANDOM:\r\n\t\t\t\ts = \"random\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase MIDDLE:\r\n\t\t\t\ts = \"middle\";\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\treturn s;\r\n\t\t}\r\n\t}\r\n\t\r\n\t/**\r\n\t * Class for generating unsupported pivot exceptions. This\r\n\t * exception is thrown if the input cannot be interpreted as a pivot.\r\n\t * \r\n\t * @author Robin\r\n\t *\r\n\t */\r\n\tpublic static class UnsupportedPivotException extends Exception {\r\n\t\t/**\r\n\t\t * \r\n\t\t */\r\n\t\tprivate static final long serialVersionUID = 853436763252048434L;\r\n\t\tprivate final PivotPositions pivot;\r\n\r\n\t\tpublic UnsupportedPivotException(PivotPositions pivot) {\r\n\t\t\tthis.pivot = pivot;\r\n\t\t}\r\n\r\n\t\t@Override\r\n\t\tpublic void printStackTrace() {\r\n\t\t\tSystem.out.println(pivot);\r\n\t\t}\r\n\t}\r\n}", "static void quickSortFirst(int[] array, int left, int right) {\n if (left < right) {\n //Selecting first element as pivot\n int pivot = array[left];\n //For partition\n int i = left;\n int j = right;\n while (i < j) {\n //Shift one place to past pivot element\n i += 1;\n //Search right part to find elements greater than pivot\n while (i <= right && array[i] < pivot) {\n i += 1;\n\n }\n //Search left part to find elements smaller than pivot\n while (j >= left && array[j] > pivot) {\n j -= 1;\n\n }\n if (i <= right && i < j) {\n //Swap\n swap(array, i, j);\n\n }\n }\n //Place pivot in correct place\n swap(array, left, j);\n //Sorting again for partition parts\n quickSortFirst(array, left, j - 1);\n quickSortFirst(array, j + 1, right);\n }\n }", "private void sort(int start, int end) {\n int firstHalf = start;\n int lastHalf = end;\n int pivotIndex = start + (int) (Math.random() * (end - start));\n T pivot = sortedArray[pivotIndex];\n while (firstHalf <= lastHalf) {\n while (sortedArray[firstHalf].compareTo(pivot) > 0) {\n firstHalf++;\n }\n while (sortedArray[lastHalf].compareTo(pivot) < 0) {\n lastHalf--;\n }\n if (firstHalf <= lastHalf) {\n T temp = sortedArray[firstHalf];\n sortedArray[firstHalf] = sortedArray[lastHalf];\n sortedArray[lastHalf] = temp;\n firstHalf++;\n lastHalf--;\n }\n }\n if (start < lastHalf) {\n sort(start, firstHalf);\n }\n if (firstHalf < end) {\n sort(firstHalf, end);\n }\n }", "private static void quickSortArray(int[] a, int startIndex, int endIndex) {\n\t\t\n\t\t\n\t\tif (startIndex<endIndex){\n\t\t\t\n\t\t\t// calculate the partitioned index\n\t\t\t\n\t\t\tint partitionIndex= partion(a, startIndex,endIndex);\n\t\t\t\n\t\t\tquickSortArray(a,startIndex,partitionIndex-1);\n\t\t\tquickSortArray(a,partitionIndex+1,endIndex);\n\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "private static void quicksort(Object a[], int lo0, int hi0) {\n int lo = lo0;\n int hi = hi0;\n int mid;\n\n if (hi0 > lo0) {\n swapReferences(a, lo0, (lo0 + hi0)/2);\n Object[] midObject = (Object[]) a[(lo0 + hi0) / 2];\n mid = (int)midObject[2];\n while (lo <= hi) {\n Object[] loObject = (Object[])a[lo];\n int loWeight = (int)loObject[2];\n while((lo < hi0) && (loWeight < mid)) {\n loObject = (Object[])a[lo];\n loWeight = (int)loObject[2];\n if (loWeight < mid) {\n lo++;\n }\n }\n\n Object[] hiObject = (Object[])a[hi];\n int hiWeight = (int)hiObject[2];\n while((hi > lo0) && (hiWeight > mid)) {\n hiObject = (Object[])a[hi];\n hiWeight = (int)hiObject[2];\n if (hiWeight > mid) {\n hi--;\n }\n }\n\n if (lo <= hi) {\n swapReferences(a, lo, hi);\n lo++;\n hi--;\n }\n }\n\n if (lo0 < hi) {\n quicksort(a, lo0, hi);\n }\n\n if (lo < hi0) {\n quicksort(a, lo, hi0);\n }\n }\n }", "static void quickSort (int a[], int lo, int hi){\n\t int i=lo, j=hi, h;\r\n\t int pivot=a[lo];\r\n\r\n\t // pembagian\r\n\t do{\r\n\t while (a[i]<pivot) i++;\r\n\t while (a[j]>pivot) j--;\r\n\t if (i<=j)\r\n\t {\r\n\t h=a[i]; a[i]=a[j]; a[j]=h;//tukar\r\n\t i++; j--;\r\n System.out.println(\"i = \"+i + \" j = \" + j);\r\n\t }\r\n\t } while (i<=j);\r\n\r\n\t // pengurutan\r\n\t if (lo<j) quickSort(a, lo, j);\r\n\t if (i<hi) quickSort(a, i, hi);\r\n\t }", "private static <T extends Comparable<T>> void quicksort(T v[], int left, int right) {\n if(left<right){\n int indexP = partition(v,left,right);\n quicksort(v, left, indexP - 1);\n quicksort(v, indexP + 1, right );\n\n }\n\n }", "public void sort() {\n Stack<Pair> stack = new Stack();\n //fill the stack\n Pair temp = new Pair(0, a.length);\n stack.push(temp);\n quickSort(stack,stack.peek().first, stack.peek().n);\n }", "public static void quickSort(int[] a, int left, int right)\r\n {\r\n int pivot = partition(a, left, right);\r\n if(left < pivot - 1)\r\n quickSort(a, left, pivot - 1);\r\n if(pivot < right)\r\n quickSort(a, pivot, right);\r\n }", "private void quickSort(int[] array, int left, int right) {\n if (left>=right){\n return;\n }\n\n //2. Pick a pivot element -> we will choose the centre element:\n // Note: Better would be to choose left + (right-left)/2 (as this would avoid overflow error for large arrays i.e. 2GB))\n\n int pivot = array[(left+right)/2];\n\n //3. Partition the array around this pivot and return the index of the partition.\n int index = partition(array,left,right,pivot);\n\n //4. Sort on the left and right side recursively.\n quickSort(array,left,index-1); //Left side\n quickSort(array,index,right); //Right side\n }", "public void sort(int[] seq, int begin, int end) {\n if (seq == null || end - begin <= 1) {// only seq with length larger than 1 is needed to sort\n return;\n }\n // divide and conquer\n int p = partition(seq, begin, end);// the pivot is now in the final place\n sort(seq, begin, p); // sort the left part\n sort(seq, p + 1, end); // sort the right part, p+1 excludes p because p is the final place of pivot\n }", "public static <T extends Comparable<? super T>> void quickSort(List<T> a){\n quickSort(a, 0, a.size() - 1);\n }", "static <T extends Comparable<T>> List<T> sort(List<T> list) {\n\t\tif (list == null || list.size() < 2) {\n\t\t\treturn list;\n\t\t}\n\t\tfor (int i = 1; i < list.size(); i++) {\n\t\t\t// the current is begin from index of 1\n\t\t\tT current = list.get(i);\n\t\t\tint j = i - 1;\n\t\t\tint origin = j;\n\t\t\twhile (j >= 0 && list.get(j).compareTo(current) > 0) {\n\t\t\t\t// insert into the head of the sorted list\n\t\t\t\t// or as the first element into an empty sorted list\n\t\t\t\t// last element of the sorted list\n\t\t\t\t// middle of the list\n\t\t\t\t// insert into middle of the sorted list or as the last element\n\t\t\t\tlist.set(j + 1, list.get(j));\n\t\t\t\tj--;\n\t\t\t}\n\t\t\tlist.set(j + 1, current);\n\t\t\tprintInsertionSortAnimation(list, current, j, origin);\n\t\t\tSystem.out.println();\n\t\t}\n\n\t\treturn list;\n\t}", "public static void quickSort(int[] arr, int lo, int hi) {\n //write your code here\n if(lo>hi){\n return;\n }\n int pivot = partition(arr, arr[hi], lo, hi);\n quickSort(arr, lo, pivot-1);\n quickSort(arr, pivot+1, hi);\n }", "public static void quickSort(LinkedQueue q) {\n // Your solution here.\n if (q.isEmpty())\n {\n return;\n }\n int pivotInt = (int) (1 + Math.random() * q.size());\n Object pivot = q.nth(pivotInt);\n LinkedQueue qSmall = new LinkedQueue();\n LinkedQueue qEquals = new LinkedQueue();\n LinkedQueue qLarge = new LinkedQueue();\n \n ListSorts.partition(q, (Comparable) pivot, qSmall, qEquals, qLarge);\n \n ListSorts.quickSort(qSmall);\n ListSorts.quickSort(qLarge);\n \n q.append(qSmall);\n q.append(qEquals);\n q.append(qLarge);\n \n\n }", "private static void quickSort(int[] array, int begin, int end, boolean useMedian) {\n int i = begin;\n int j = end;\n if (array.length==0 || array == null) {\n return;\n }\n int pivot = array[begin];\n if (useMedian) { \n pivot = array[begin + (end - begin) / 2];\n }\n\n while (i <= j) { \n while (array[i] < pivot) { \n i++;\n }\n while (array[j] > pivot) { \n j--; r\n }\n if (i <= j) { \n swap(array, i, j); \n i++;\n j--;\n }\n }\n\n if (begin < j) { \n quickSort(array, begin, j, useMedian);\n }\n if (i < end) { \n quickSort(array, i, end, useMedian);\n }\n }", "static void quickSort (double a[], int lo, int hi){\n int i=lo, j=hi;\r\n\t\tdouble h;\r\n double pivot=a[lo];\r\n\r\n // pembagian\r\n do{\r\n while (a[i]<pivot) i++;\r\n while (a[j]>pivot) j--;\r\n if (i<=j)\r\n {\r\n h=a[i]; a[i]=a[j]; a[j]=h;//tukar\r\n i++; j--;\r\n }\r\n } while (i<=j);\r\n\r\n // pengurutan\r\n if (lo<j) quickSort(a, lo, j);\r\n if (i<hi) quickSort(a, i, hi);\r\n }", "private static void quickSort(Array A, int iStart, int iEnd)\n\t{\n\t\tif (iStart == iEnd)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tint pivot = Rand.randInt(iStart, iEnd);\n\t\tpivot = partition(A, iStart, iEnd, pivot);\n\t\tif (pivot > iStart)\n\t\t{\n\t\t\tquickSort(A, iStart, pivot - 1);\n\t\t}\n\t\tif (pivot < iEnd)\n\t\t{\n\t\t\tquickSort(A, pivot + 1, iEnd);\n\t\t}\n\t}", "static void quickSort(int[] arr, int left, int right){\n int position = partition(arr, left, right);\n if(left<position){\n quickSort(arr,left,position);\n }\n if(position+1<right){\n quickSort(arr,position+1,right);\n }\n }", "private static void quickSort(double arr[],Integer[] pageIDS, int low, int high)\n {\n if (low < high)\n {\n /* pi is partitioning index, arr[pi] is\n now at right place */\n int pi = partition(arr,pageIDS, low, high);\n\n // Recursively sort elements before\n // partition and after partition\n quickSort(arr, pageIDS, low, pi-1);\n quickSort(arr, pageIDS,pi+1, high);\n }\n }", "public void sort() {\n ListNode start = head;\n ListNode position1;\n ListNode position2;\n\n // Going through each element of the array from the second element to the end\n while (start.next != null) {\n start = start.next;\n position1 = start;\n position2 = position1.previous;\n // Checks if previous is null and keeps swapping elements backwards till there\n // is an element that is bigger than the original element\n while (position2 != null && (position1.data < position2.data)) {\n swap(position1, position2);\n numberComparisons++;\n position1 = position2;\n position2 = position1.previous;\n }\n }\n }", "public static void quickSortInPlace(List<Comparable> data, int from, int to) {\n\t\tif (data==null || data.size()<2 || (to-from)<1)\n\t\t\treturn;\n\t\tif (from<0 || to <0 || from>data.size() || to>data.size()) {\n\t\t\tthrow new IndexOutOfBoundsException(data+\" from \"+from+\" to \"+to);\n\t\t}\n\t\t\n\t\tComparable pivot = data.get(to);\n\t\tint pos=from;\n\t\tfor (int i=from; i<to; ++i ) {\n\t\t\tif (data.get(i).compareTo(pivot)<0) {\n\t\t\t\tif (i!=pos) {\n\t\t\t\t\tComparable tmp = data.get(i);\n\t\t\t\t\tdata.set(i,data.get(pos));\n\t\t\t\t\tdata.set(pos, tmp);\n\t\t\t\t\t//System.out.println(data.get(i)+\"<=>\"+tmp);\n\t\t\t\t}\n\t\t\t\tpos++;\n\t\t\t}\n\t\t\t//System.out.println(Arrays.asList(data));\n\t\t}\n\t\t\n\t\tif (pos!=to) {\n\t\t\tComparable tmp = data.get(to);\n\t\t\tdata.set(to, data.get(pos));\n\t\t\tdata.set(pos, tmp);\n\t\t}\n\t\t\n\t\t//System.out.println(Arrays.asList(data)+\" [\"+pos+\"]\"+pivot+\" (\"+from+\",\"+to+\")\");\n\t\tquickSortInPlace(data,from, pos-1);\n\t\tquickSortInPlace(data,pos+1,to);\n\t}", "public void quicksort()\n { quicksort(this.heap, 0, heap.size()-1);\n }", "private void quickSort(Node<T> low, Node<T> high) {\n if (!Objects.isNull(high) &&\n low != high && low != high.getNext()) {\n\n Node<T> pivot = partition(low, high);\n quickSort(low, pivot.getPrev());\n quickSort(pivot.getNext(), high);\n }\n }", "void sort( int low, int high)\n {\n if (low > high)\n {\n /* pi is partitioning index, arr[pi] is\n now at right place */\n int pi = partition(low, high);\n\n // Recursively sort elements before\n // partition and after partition\n sort( low, pi-1);\n sort( pi+1, high);\n }\n }", "public void quickSort() {\n\t\tquickSort(0, data.size() - 1);\n\t}", "public static void sort012(int a[], int n)\r\n{\r\n int start=0, mid=0, end=n-1, pivot=1;\r\n \r\n while(mid <= end)\r\n {\r\n if(a[mid] < pivot) // current element is 0\r\n {\r\n swap(a, mid, start);\r\n start++;\r\n mid++;\r\n }\r\n else if(a[mid] > pivot) // current element is 2\r\n {\r\n swap(a, mid, end);\r\n end--;\r\n }\r\n else //a[mid]==pivot --- current element is 1\r\n mid++;\r\n }\r\n}", "public static Move QuickSort(Move list) {\n if (list == null || list.next == null)\n return list;\n Move smaller = null;\n Move p = list;\n list = list.next;\n p.next = null;\n Move bigger = p;\n while (list != null) {\n if (p.value < list.value) {\n Move temp = list;\n list = list.next;\n temp.next = bigger;\n bigger = temp;\n } else {\n Move temp = list;\n list = list.next;\n temp.next = smaller;\n smaller = temp;\n }\n }\n smaller = QuickSort(smaller);\n bigger = QuickSort(bigger);\n p.next = smaller;\n return bigger;\n }", "public static void quicksort(int l, int r, List<CustomCharacter> list)\n throws InterruptedException {\n\n // handle edge cases\n if(l >= r){\n return;\n }\n if(l >= list.size()){\n return;\n }\n if(r >= list.size()){\n r = list.size() - 1;\n }\n\n\n\n // partition smaller elements on left // and larger on right // with respect to the originalPosition of the rth element (pivot)\n int smallElementEnd = l-1;\n System.out.println(\"Deciding for : \" + list.get(r).key);\n\n CustomCharacter rth = list.get(r);\n for (int i = l; i < r; i++) {\n CustomCharacter curr = list.get(i);\n if(curr.originalPosition < rth.originalPosition){\n swap(list, ++smallElementEnd, i);\n }\n }\n\n // place rth element at correct position\n swap(list, ++smallElementEnd, r);\n\n Thread.sleep(1500);\n printList(list);\n\n // sort the remaining two halves\n quicksort(l, smallElementEnd-1, list);\n quicksort(smallElementEnd + 1, r, list);\n }", "public ListUtilities partition(ListUtilities start, ListUtilities pivot){\n\t\tboolean swap = false;\n\t\tListUtilities lo = start;\n\t\tListUtilities hi = pivot;\n\t\twhile( lo != pivot){\n\t\t\t//System.out.println(\"lo \" + lo.num + \" hi \" + hi.num + \" pivot \" + pivot.num + \" start \" + start.num);\n\t\t\tif(lo.num > pivot.num){\n\t\t\t\tListUtilities next = lo.nextNum;\n\t\t\t\tif(lo == start){\n\t\t\t\t\tstart = next;\n\t\t\t\t}\n\t\t\t\t//if lo is not first\n\t\t\t\tif(lo.prevNum != null){\n\t\t\t\t\t//remove current lo\n\t\t\t\t\tlo.prevNum.nextNum = lo.nextNum;\n\t\t\t\t\tnext.prevNum = lo.prevNum;\n\t\t\t\t}else{\n\t\t\t\t\tnext.prevNum = null;\n\t\t\t\t}\n\t\t\t\t//if hi is not last\n\t\t\t\tif(hi.nextNum != null){\n\t\t\t\t\t//connect with element after current hi\n\t\t\t\t\tlo.nextNum = hi.nextNum;\n\t\t\t\t\thi.nextNum.prevNum = lo;\n\t\t\t\t}else{\n\t\t\t\t\t//connect with element after current hi\n\t\t\t\t\tlo.nextNum = null;\n\t\t\t\t}\n\t\t\t\t//connect with pivot\n\t\t\t\tlo.prevNum = hi;\n\t\t\t\thi.nextNum = lo;\n\n\t\t\t\thi = lo;\n\t\t\t\tlo = next;\n\t\t\t}else{\n\t\t\t\tlo = lo.nextNum;\n\t\t\t}\n\t\t}\n\t\tif(start != pivot.prevNum && start != pivot){\n\t\t\tstart = partition(start, pivot.prevNum);\n\t\t}\n\t\tif(pivot != hi){\n\t\t\tpartition(pivot.nextNum, hi);\n\t\t}\n\t\treturn start;\n\t}", "public static List<ArcWeighted> quickSort(final List<ArcWeighted> data) {\n List<ArcWeighted> a = new LinkedList<>();\n List<ArcWeighted> b = new LinkedList<>();\n final int Pivot = data.size() / 2;\n\n if (data.size() <= 1) {\n return data;\n }\n\n final ArcWeighted PivotArc = data.get(Pivot);\n final int PivotValue = data.get(Pivot).weight;\n\n while (!data.isEmpty()) {\n final ArcWeighted temp = data.remove(0);\n\n if (temp != PivotArc) {\n\n if (PivotValue <= temp.weight) {\n a.add(temp);\n } else {\n b.add(temp);\n }\n\n }\n\n }\n\n // A binary tree like this is formed.\n // ========================//\n // pivotValue //\n // //\n // a b //\n // ========================//\n // a and b are sub-trees\n // (they may have no children and be laeves)\n\n // The data is placed into a tree and then exported in order.\n\n a = sortingAlgorithms.quickSort(a); // Call itself\n b = sortingAlgorithms.quickSort(b); // Call itself\n\n // merge\n a.add(PivotArc);\n a.addAll(b);\n\n return a;\n // All of the data is returned and merged (see code above) forming a sorted list\n }", "protected void quickSort(Vector v, int lo0, int hi0) {\r\n\tint lo = lo0;\r\n\tint hi = hi0;\r\n\tTypedFile mid;\r\n\r\n\tif ( hi0 > lo0)\r\n\t{\r\n\r\n\t /* Arbitrarily establishing partition element as the midpoint of\r\n\t * the array.\r\n\t */\r\n\t mid = (TypedFile) v.elementAt(( lo0 + hi0 ) / 2);\r\n\r\n\t // loop through the array until indices cross\r\n\t while( lo <= hi )\r\n\t {\r\n\t\t/* find the first element that is greater than or equal to \r\n\t\t * the partition element starting from the left Index.\r\n\t\t */\r\n\t\t// Nasty to have to cast here. Would it be quicker\r\n\t\t// to copy the vectors into arrays and sort the arrays?\r\n\t\twhile( ( lo < hi0 ) && lt( (TypedFile)v.elementAt(lo), mid ) )\r\n\t\t ++lo;\r\n\r\n\t\t /* find an element that is smaller than or equal to \r\n\t\t * the partition element starting from the right Index.\r\n\t\t */\r\n\t\twhile( ( hi > lo0 ) && lt( mid, (TypedFile)v.elementAt(hi) ) )\r\n\t\t --hi;\r\n\r\n\t\t // if the indexes have not crossed, swap\r\n\t\tif( lo <= hi ) \r\n\t\t{\r\n\t\t swap(v, lo, hi);\r\n\t\t ++lo;\r\n\t\t --hi;\r\n\t\t}\r\n\t }\r\n\r\n\t /* If the right index has not reached the left side of array\r\n\t\t * must now sort the left partition.\r\n\t\t */\r\n\t if( lo0 < hi )\r\n\t\tquickSort( v, lo0, hi );\r\n\r\n\t\t/* If the left index has not reached the right side of array\r\n\t\t * must now sort the right partition.\r\n\t\t */\r\n\t if( lo < hi0 )\r\n\t\tquickSort( v, lo, hi0 );\r\n\r\n\t}\r\n }", "public static List<Integer> sortNumbers(List<Integer> unsortedList) {\n\n // naive sort\n if (unsortedList == null || unsortedList.size() <= 1) {\n return unsortedList;\n }\n\n int pivot = unsortedList.get(0);\n List<Integer> lessThanPivot = new ArrayList<>();\n List<Integer> greaterThanPivot = new ArrayList<>();\n\n unsortedList.subList(1, unsortedList.size()).forEach(number -> {\n if (number <= pivot) {\n lessThanPivot.add(number);\n } else {\n greaterThanPivot.add(number);\n }\n });\n\n System.out.printf(\"%15s %1s %-15s%n\", lessThanPivot, pivot, greaterThanPivot);\n\n List<Integer> sortedNumbers = new ArrayList<>(sortNumbers(lessThanPivot));\n sortedNumbers.add(pivot);\n sortedNumbers.addAll(sortNumbers(greaterThanPivot));\n return sortedNumbers;\n }", "public void selectionSort(ArrayList <Comparable> list){\r\n\t\tsteps += 2;\r\n\t\tfor (int i = list.size() - 1; i >= 0; i--){\r\n\t\t\tsteps ++;\r\n\t\t\tint biggest = 0; \r\n\t\t\tsteps += 2;\r\n\t\t\tfor (int j = 0; j < i; j++){\r\n\t\t\t\tsteps += 4;\r\n\t\t\t\tif (list.get(j).compareTo(list.get(biggest)) > 0){\r\n\t\t\t\t\tsteps ++;\r\n\t\t\t\t\tbiggest = j;\r\n\t\t\t\t}\r\n\t\t\t\tsteps += 2;\r\n\t\t\t}\r\n\t\t\tsteps += 5;\r\n\t\t\tswap(list, i, biggest);\r\n\t\t\tsteps += 2;\r\n\t\t}\r\n\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"Selection Sort\");\r\n\t\tSystem.out.println();\r\n\t}", "private static <T extends Comparable<T>> void sort(T[] list, int lo, int hi) {\n\t\tif (hi - lo <= 0) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tint splitPoint = splitList(list, lo, hi);\r\n\t\tSystem.out.println(\"splitPoint: \" + splitPoint);\r\n\t\tsort(list, lo, splitPoint - 1);\r\n\t\tsort(list, splitPoint + 1, hi);\r\n\t}", "interface Subsort {\n void sort(int[] arr, int left, int right);\n }", "private static int partitionAssumingPivotIsLastElement(int arr[], int startIndex, int endIndex) {\n if (startIndex < 0 || endIndex > arr.length - 1) {\n return -1;\n }\n int pivotIndex = endIndex;\n int i = -1; //i holds the index whose left is smaller and right side is bigger than arr[i]\n int pivotVal = arr[pivotIndex];\n for ( int j = startIndex ; j <= endIndex; j++) {\n if (arr[j] > pivotVal && i == -1) {\n i = j;\n continue;\n }\n\n if(arr[j] < pivotVal && j != endIndex && i != -1) {\n swap(arr, i, j);\n i++;\n }\n }\n// shiftRightByOnePosition(arr, i);\n// if (i != -1) {\n// arr[i] = pivotVal;\n// }\n swap(arr, i, pivotIndex);\n return i;\n }", "public static void quickSortSegment (int[] elts, int first, int size) {\r\n\t\tif (size == 2) {\r\n\t\t\tif (elts[first] > elts[first+1])\r\n\t\t\t\tswap (elts, first, first+1);\r\n\t\t}\r\n\t\telse if (size > 2) {\r\n\t\t\tint pivotPosition = partitionSegment(elts, first, size);\r\n\t\t\tquickSortSegment (elts, first, pivotPosition-first);\r\n\t\t\tquickSortSegment (elts, pivotPosition+1, first+size-1-pivotPosition);\r\n\t\t}\r\n\t}", "public static int quickSortInAscendingOrder(int[] array, int start, int end) {\n\n int pivot = array[start];\n int index1 = start;\n int index2 = end;\n\n while (index1 < index2) {\n while (index1 < index2 && array[--index2] >= pivot);\n if (index1 < index2) {\n array[index1] = array[index2];\n }\n\n while (index1 < index2 && array[++index1] <= pivot);\n\n if (index1 < index2) {\n array[index2] = array[index1];\n }\n }\n\n array[index2] = pivot;\n return index2;\n }", "private void quickSort(Node state, ArrayList<Move> A, int p, int r, boolean isAscending) {\n\t\tif (p < r) {\n\t\t\tint q = this.partition(state, A, p, r, isAscending);\n\t\t\tthis.quickSort(state, A, p, q - 1, isAscending);\n\t\t\tthis.quickSort(state, A, q + 1, r, isAscending);\n\t\t}\n\t}", "void sort(int arr[], int low, int high) {\n\t\tif (low < high) {\n\t\t\t/*\n\t\t\t * pi is partitioning index, arr[pi] is now at right place\n\t\t\t */\n\t\t\tint pi = partition(arr, low, high);\n\n\t\t\t// Recursively sort elements before\n\t\t\t// partition and after partition\n\t\t\tsort(arr, low, pi - 1);\n\t\t\tsort(arr, pi + 1, high);\n\t\t}\n\t}", "private void quickSortM(int[] arr, int start, int end) {\n\t\tif(start>=end)\r\n\t\t\treturn ;\r\n\t\tint bounary = partition(arr,start,end);\r\n\t\tquickSortM(arr,start,bounary-1);\r\n\t\tquickSortM(arr, bounary+1, end);\r\n\t}", "public static void quickSortSegment (int[] elts, int first, int size) {\r\n\t\tif (size == 2) {\r\n\t\t\tif (elts[first] > elts[first+1])\r\n\t\t\t\tswap (elts, first, first+1);\r\n\t\t}\r\n\t\telse if (size > 2) {\r\n\t\t\tint pivotPosition = partitionSegment(elts, first, size);\r\n\t\t\tquickSortSegment (elts, first, pivotPosition-first);\r\n\t\t\tquickSortSegment (elts, pivotPosition+1, size-(pivotPosition+1-first));\r\n\t\t}\r\n\t}", "public static void quickSort(String[] entrants, int start, int end) {\n if (end-start <= 0) {\r\n return;\r\n }\r\n // Set pivot as mid-point\r\n int pivot = (int) Math.ceil((end+start)/2.0), pivot_val = getVal(entrants[pivot]);\r\n // Move pivot to end\r\n swap(entrants, pivot, end);\r\n int left = end, right = end+1;\r\n while (right > left) {\r\n // Move left bound to first value greater than or equal to pivot\r\n for (int i = start; i <= end-1; i++) {\r\n if (getVal(entrants[i]) >= pivot_val) {\r\n left = i;\r\n break;\r\n }\r\n }\r\n // Move right bound to left until crosses left bound or finds value less than pivot\r\n for (int i = end-1; i >= left-1; i--) {\r\n if (getVal(entrants[i]) < pivot_val || i == left-1 || i == 0) {\r\n right = i;\r\n break;\r\n }\r\n }\r\n // Check if bounds crossed\r\n if (right <= left) {\r\n // Move pivot to final spot\r\n swap(entrants, left, end);\r\n }\r\n else {\r\n // Swap these values\r\n swap(entrants, left, right);\r\n }\r\n }\r\n // Do left and right partitions (left is location of pivot)\r\n quickSort(entrants, start, left-1);\r\n quickSort(entrants, left+1, end);\r\n return;\r\n }", "public static int[] quicksort(int[] array, int start, int end) {\n\t\tif (start < end) {\r\n\t\t\t// returns correct index for pivot\r\n\t\t\tint pivotIndex = partition(array, start, end);\r\n\t\t\t// recursively sort from start until pivot\r\n\t\t\tquicksort(array, start, pivotIndex - 1);\r\n\t\t\t// recursively sort from after pivot to end\r\n\t\t\tquicksort(array, pivotIndex + 1, end);\r\n\t\t}\r\n\r\n\t\treturn array;\r\n\t}", "public static void QuickSort(int a[]) {\n\t Sort(a, 0, a.length-1); \n\t }", "private static int partition(int left, int right, int pivot, List<Integer> A) {\n int pivotValue = A.get(pivot);\n int largerIndex = left;\n\n Collections.swap(A, pivot, right);\n for (int i = left; i < right; ++i) {\n if (A.get(i) > pivotValue) {\n Collections.swap(A, i, largerIndex++);\n }\n }\n Collections.swap(A, right, largerIndex);\n return largerIndex;\n }", "private static <T extends Comparable<T>> int splitList(T[] list, int lo, int hi) {\n\t\tT pivot = list[lo];\r\n\t\tint left = lo + 1;\r\n\t\tint right = hi;\r\n\t\tSystem.out.println(\"splitList(list=\" + Arrays.toString(list) + \", lo=\" + lo + \", hi=\" + hi + \")\" + \" pivot=\"\r\n\t\t\t\t+ pivot + \", left=\" + left + \", right=\" + right);\r\n\r\n\t\twhile (true) {\r\n\t\t\twhile (left <= right) {\r\n\t\t\t\tif (list[left].compareTo(pivot) <= 0) {\r\n\t\t\t\t\tleft++;\r\n\t\t\t\t\tSystem.out.println(printArray(list, left, right, lo));\r\n\t\t\t\t} else\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\twhile (right > left) {\r\n\t\t\t\tif (list[right].compareTo(pivot) <= 0)\r\n\t\t\t\t\tbreak;\r\n\t\t\t\telse {\r\n\t\t\t\t\tright--;\r\n\t\t\t\t\tSystem.out.println(printArray(list, left, right, lo));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (left >= right) {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\tswap(list, left, right);\r\n\t\t\tSystem.out.println(printArray(list, left, right, lo));\r\n\t\t}\r\n\t\tswap(list, lo, left - 1);\r\n\t\tSystem.out.println(printArray(list, left, right, lo));\r\n\r\n\t\treturn left - 1;\r\n\t}", "public static void qSort(int left, int right){\n\t\tint i = left, j = right;\n\t\tint ref = left + (right-left)/2;\n\t\tHeapNode pivot = edges[ref];\n\t\tHeapNode temp2 ;\n\t\twhile (i <= j) {\n\t\t\twhile (compare(pivot, edges[i]))\n\t\t\t\ti++;\n\t\t\twhile (compare(edges[j], pivot))\n\t\t\t\tj--;\n\t\t\tif (i <= j) {\n\t\t\t\ttemp2=edges[i];\n\t\t\t\tedges[i]=edges[j];\n\t\t\t\tedges[j]=temp2;\n\n\t\t\t\ti++;\n\t\t\t\tj--;\n\t\t\t}\n\t\t};\n\t\t// recursion\n\t\tif (left < j)\n\t\t\tqSort(left, j);\n\t\tif (i < right) {\n\t\t\tqSort(i, right);\n\t\t}\n\n\t}", "public void quicksort() {\r\n quicksort(mArray, 0, mArray.length -1);\r\n }", "@Override\r\n\tpublic List<T> sort(List<T> list) {\n\t\tassert list != null : \"list cannot be null\";\r\n\t\tfor(int i = 0; i < list.size() - 1; i ++){\r\n\t\t\tint min = i;\r\n\t\t\tfor(int j = i + 1; j < list.size(); j ++){\r\n\t\t\t\tint current = j;\r\n\t\t\t\tif(this.comparator.compare(list.get(min), list.get(current)) > 0){\r\n\t\t\t\t\tmin = current;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tswap(list, i, min);\r\n\t\t}\r\n\t\treturn list;\r\n\t}", "public static void QuickSort(int arr[], int low, int high) {\n\n if (low < high) {\n int pivot = partition(arr, low, high);\n\n //Sort elements before and after partition\n QuickSort(arr, low, pivot - 1);\n QuickSort(arr, pivot + 1, high);\n }\n }", "public static double testQuickSort(Integer[] list){\n\t\tdouble totalTime = 0;\n\t\tfor (int i = 0; i < TEST_RUNS; i++){\n\t\t\tInteger[] tmp = Arrays.copyOf(list, list.length);\t// make copy of list\n\t\t\tt.start();\t\t\t\t\t\t\t\t\t\t\t// start clock\n\t\t\tQuickSort.sort(tmp);\t\t\t\t\t\t\t\t// sort copy\n\t\t\ttotalTime += t.getTime();\t\t\t\t\t\t\t// end clock and increment total\n\t\t}\n\t\treturn totalTime / TEST_RUNS; \n\t}", "public void quickSort(Comparable[] arr, int low, int high) {\n\t\tint pivot;\n\t\tif (low < high) {\n\t\t\tpivot = partition(arr, low, high);\n\t\t\tquickSort(arr, low, pivot - 1);\n\t\t\tquickSort(arr, pivot + 1, high);\n\t\t}\n\t}", "private static void recursiveQuicksort(int[] ints, int si, int ei) {\n\n\t\tif (si == ei || ei < si)\n\t\t\treturn;\n\n\t\tint start = si;\n\t\tint ri = si + (int)(Math.random() * (ei - si + 1));\n\t\tint numDuplicates = 0;\n\n\t\tint temp = ints[ei];\n\t\tints[ei] = ints[ri];\n\t\tints[ri] = temp;\n\t\tri = ei;\n\t\tei--;\n\n\t\twhile (si + numDuplicates <= ei) {\n\t\t\tif (ints[si + numDuplicates] == ints[ri])\n\t\t\t\tnumDuplicates++;\n\t\t\telse if (ints[si + numDuplicates] < ints[ri]) {\n\t\t\t\tif (numDuplicates > 0) {\n\t\t\t\t\ttemp = ints[si + numDuplicates];\n\t\t\t\t\tints[si + numDuplicates] = ints[ri];\n\t\t\t\t\tints[si] = temp;\n\t\t\t\t}\n\t\t\t\tsi++;\n\t\t\t}\n\t\t\telse {\n\t\t\t\ttemp = ints[ei];\n\t\t\t\tints[ei] = ints[si + numDuplicates];\n\t\t\t\tints[si + numDuplicates] = temp;\n\t\t\t\tei--;\n\t\t\t}\n\t\t}\n\n\t\ttemp = ints[si + numDuplicates];\n\t\tints[si + numDuplicates] = ints[ri];\n\t\tints[ri] = temp;\n\n\t\trecursiveQuicksort(ints, start, si - 1);\n\t\trecursiveQuicksort(ints, ei + 1, ri);\n\n\t}", "public void quickSort(Node node)\n {\n // Find last node\n Node head1 = lastNode(node);\n \n // Call the recursive QuickSort\n _quickSort(node,head1);\n }", "public static void dbQSort(double[] v, int l, int r) {\n\n double pivot;\n int m = l + (int) (Math.random() * ((r - l) + 1)); // random number between first and last, Peto's remark\n \n //median(v[l], v[m], v[r]) {\n if (v[l] <= v[m]) {\n if (v[m] <= v[r])\n pivot = v[m];\n else {\n if (v[l] <= v[r])\n pivot = v[r];\n else\n pivot = v[l];\n }\n } else {\n if (v[m] <= v[r]) {\n if (v[l] <= v[r])\n pivot = v[l];\n else\n pivot = v[r];\n } \n else\n pivot = v[m];\n }\n // }\n\n int i=l,j=r;\n double tmp; //tmp variable for swapping\n\n //Partioning\n while(i<=j) {\n\n while(v[i]<pivot) i++;\n while(v[j]>pivot) j--;\n\n if(i<=j) {\n //swap(i, j) {\n tmp=v[i];\n v[i]=v[j];\n v[j]=tmp;\n // }\n\n i++;\n j--;\n }\n }\n\n if(l<j) \n dbQSort(v,l,j);\n\n if(i<r) \n dbQSort(v,i,r);\n\n }", "public void shellSort(){\n int increment = list.size() / 2;\n while (increment > 0) {\n for (int i = increment; i < list.size(); i++) {\n int j = i;\n int temp = list.get(i);\n while (j >= increment && list.get(j - increment) > temp) {\n list.set(j, list.get(j - increment));\n j = j - increment;\n }\n list.set(j, temp);\n }\n if (increment == 2) {\n increment = 1;\n } else {\n increment *= (5.0 / 11);\n }\n }\n }", "protected abstract void partialQuickSort(Integer[] map, int left, int right, int minIdx, int maxIdx);", "public static void quickSortTest(){\n\t\tTransformer soundwave = new Transformer(\"Soundwave\", 'D', new int[] {8,9,2,6,7,5,6,10});\n\t\tTransformer bluestreak = new Transformer(\"Bluestreak\", 'A', new int[] {6,6,7,9,5,2,9,7});\n\t\tTransformer hubcap = new Transformer(\"Hubcap\", 'A', new int[] {4,4,4,4,4,4,4,4});\n\t\tTransformer abominus = new Transformer(\"Abominus\", 'D', new int[] {10,1,3,10,5,10,8,4});\n\t\t\n\t\tgame.addTransformer(soundwave);\n\t\tgame.addTransformer(bluestreak);\n\t\tgame.addTransformer(hubcap);\n\t\tgame.addTransformer(abominus);\n\t\t\n\t\tgame.sortCompetitorsByRank();\n\t\tgame.printSortedRoster();\n\t}", "void binarysort(int lo, int hi, int start) {\n //debug(\"binarysort: lo:\" + lo + \" hi:\" + hi + \" start:\" + start);\n int p;\n \n //assert_(lo <= start && start <= hi);\n /* assert [lo, start) is sorted */\n if (lo == start)\n ++start;\n for (; start < hi; ++start) {\n /* set l to where *start belongs */\n int l = lo;\n int r = start;\n PyObject pivot = this.data[r];\n // Invariants:\n // pivot >= all in [lo, l).\n // pivot < all in [r, start).\n // The second is vacuously true at the start.\n //assert_(l < r);\n do {\n p = l + ((r - l) >> 1);\n if (iflt(pivot, this.data[p]))\n r = p;\n else\n l = p+1;\n } while (l < r);\n //assert_(l == r);\n // The invariants still hold, so pivot >= all in [lo, l) and\n // pivot < all in [l, start), so pivot belongs at l. Note\n // that if there are elements equal to pivot, l points to the\n // first slot after them -- that's why this sort is stable.\n // Slide over to make room.\n for (p = start; p > l; --p)\n this.data[p] = this.data[p - 1];\n this.data[l] = pivot;\n }\n //dump_data(\"binsort\", lo, hi - lo);\n }", "public static int partition(int[] list, int first, int last) {\n // Choose the middle element as the pivot among\n // first, medium, last\n int pivot = getPivot(list, first, last);\n int low = first + 1; // Index for forward search\n int high = last; // Index for backward search\n\n while (high > low) {\n // Search forward for left\n while (low <= high && list[low] <= pivot) {\n low++;\n }\n\n // Search backward for right\n while (low <= high && list[high] > pivot) {\n high--;\n }\n\n // Swap two elements in the list\n if (high > low) {\n int temp = list[high];\n list[high] = list[low];\n list[low] = temp;\n }\n }\n\n while (high > first && list[high] >= pivot)\n high--;\n\n // Swap pivot with list[high]\n if (pivot > list[high]) {\n list[first] = list[high];\n list[high] = pivot;\n return high;\n }\n else {\n return first;\n }\n }", "public static void ordenarQuickSort( Comparable[ ] datos )\n\t{\n\t\t// TODO \n\t\t// Ejecuto Quick Sort y ordeno recursivamente las secciones restantes\n\t\tint inicio = 0;//indice que indica el inicio del ordenamiento por pivote\n\t\tint fin = datos.length; //indice que indica el final del ordenamiento por pivote\n\t\tComparable pivote = datos[inicio]; //escogo el pivote como el primer termino del arreglo\n\t\tint primermayor = inicio;\n\t\tif( inicio != fin)\n\t\t{\n\t\t\t//primer ordenamiento\n\t\t\tfor(int i=inicio +1; i<fin; i++) //ordena los elementos con respecto al pivote empezando por el segundo de la lista\n\t\t\t{\n\t\t\t\tif(less(datos[i], pivote)) \n\t\t\t\t{\n\t\t\t\t\t//si el elemento en la posicion i es menor al pivote se intercambio con el indice del primer elemento mayor al pivote\n\t\t\t\t\texchange(datos, i, primermayor);\n\t\t\t\t\tprimermayor++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//ordenamientos sucesivos\n\t\t\tQuickSort (datos, inicio, primermayor);\n\t\t\tQuickSort (datos, primermayor+1, fin);\n\t\t}\n\t}" ]
[ "0.7283001", "0.70876795", "0.7071906", "0.705921", "0.6897115", "0.68930733", "0.68885237", "0.686257", "0.68429804", "0.6835734", "0.6825981", "0.68020505", "0.6792441", "0.67855954", "0.6782032", "0.67726976", "0.6726483", "0.6721188", "0.66978675", "0.66392666", "0.66341275", "0.65836835", "0.65771055", "0.6542562", "0.65363646", "0.6526178", "0.65092635", "0.6461509", "0.64585793", "0.64470863", "0.64401895", "0.6438968", "0.64322615", "0.6410959", "0.63993114", "0.6397453", "0.63788295", "0.6349119", "0.63486636", "0.6331191", "0.6319422", "0.6289135", "0.6286419", "0.62810624", "0.62642777", "0.6237284", "0.62305516", "0.6228095", "0.6227069", "0.62127995", "0.62015396", "0.6169816", "0.61481947", "0.6144338", "0.61426127", "0.61325526", "0.6124523", "0.61204535", "0.61108947", "0.6105192", "0.60923755", "0.6090322", "0.6087131", "0.60830873", "0.6080306", "0.6079431", "0.6065992", "0.6055085", "0.60532045", "0.6049501", "0.60379606", "0.60346127", "0.60246384", "0.6020491", "0.6020474", "0.60137975", "0.60071677", "0.6002246", "0.5997413", "0.5996693", "0.59805197", "0.5975861", "0.59707737", "0.59689265", "0.59644955", "0.59558326", "0.59526044", "0.5950916", "0.5939438", "0.59144735", "0.5902281", "0.5896619", "0.58923674", "0.58910316", "0.58891743", "0.5862017", "0.5856286", "0.5851733", "0.5834515", "0.58309025" ]
0.7619916
0
Calls the private mergeSort method with the default parameters needed.
public static <T extends Comparable<? super T>> void mergeSort(List<T> list){ if(list.size() > 1){ mergeSort(list, 0, (list.size()/2), list.size() - 1, (T[])new Comparable[list.size()]); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private PerfectMergeSort() {}", "public MergeSort(){\r\n \r\n }", "private Mergesort() {\r\n }", "public void mergeSort() {\n this.array = mergeSort(array);\n }", "public void mergeSort(){\r\n mergeSort(mArray, new int[mArray.length], 0 , mArray.length - 1);\r\n }", "@Test(timeout = SHORT_TIMEOUT)\n public void testTinyMergeSort() {\n //size-0 arr\n toSort = new IntPlus[0];\n sortedInts = cloneArr(toSort);\n Sorting.mergeSort(sortedInts, comp);\n\n assertArrayEquals(toSort, sortedInts); //Sort can't rearrange anything\n\n //size-1 arr\n toSort = new IntPlus[1];\n toSort[0] = new IntPlus(42);\n sortedInts = cloneArr(toSort);\n Sorting.mergeSort(sortedInts, comp);\n\n assertArrayEquals(toSort, sortedInts); //Sort can't rearrange anything\n }", "public void mergeSort() throws Exception{\n\t\tif(this.qtd<=1)\n\t\t\tthrow new Exception(\"Nada para ordenar\");\n\t\tthis.sort(0,this.qtd-1);\n\t}", "private void merge_sort( ArrayList<Type> array, ArrayList<Type> auxillary, int low, int high )\r\n\t{\r\n\t\t// base case\r\n\t\tif ((high - low) <= switchValue)\r\n\t\t{\r\n\t\t\tSort_Utils.insertion_sort(array, low, high);\r\n\t\t}\r\n\t\t\r\n\t\tif (low < high)\r\n\t\t{\r\n\t\t\tint middle = low + (high - low)/2;\r\n\t\t\t\r\n\t\t\t// recursively sort the two halves of the array\r\n\t\t\tmerge_sort(array, auxillary, low, middle);\r\n\t\t\tmerge_sort(array, auxillary, middle + 1, high);\r\n\t\t\tcombine(array, auxillary, low, middle, high);\r\n\t\t}\r\n}", "public void mergesort()\n { sort(this.heap, 0, heap.size()-1);\n }", "private static void mergeSort(int[] data, int left, int right) {\n\n\t\tint mid;\n\n\t\tif (left < right) {\n\n\t\t\tmid = (left + right) / 2;\n\n\t\t\tmergeSort(data, left, mid);\n\t\t\tmergeSort(data, mid + 1, right);\n\t\t\tmerge(data, left, mid, right);\n\t\t}\n\n\t}", "public static int[] mergeSortHelper(int num[]) {\n\t\tmergeSort(num, 0, num.length - 1);\n\t\treturn num;\n\t}", "private void mergeSort(int low, int high) {\n\t\tif (low < high) {\n\t\t\tint middle = low + (high - low) / 2;\n\t\t\tmergeSort(low, middle);\n\t\t\tmergeSort(middle + 1, high);\n\t\t\tmergeParts(low, middle, high);\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tMergeSortedArrays obj = new MergeSortedArrays();\r\n\t\tint[] nums1 = {1,2,3,0,0,0};\r\n\t\tint m = 3;\r\n\t\tint[] nums2 = {2,5,6};\r\n\t\tint n=3;\r\n\t\tobj.merge(nums1, m, nums2, n);\r\n\r\n\t}", "public static void mergeSort(ArrayList<Integer> inputList) {\n recursiveCallCounter++;\n System.out.println(\"Current recursive call count: \" + recursiveCallCounter);\n\n if (inputList.size() < 2) {\n System.out.println(\"\\nCurrent list length < 2\");\n System.out.println(\"Current recursive call count: \" + recursiveCallCounter + \"\\n\");\n\n return;\n }\n\n ArrayList<Integer> leftList = arrayListCopy(inputList, 0, inputList.size() / 2);\n ArrayList<Integer> rightList = arrayListCopy(inputList, inputList.size() / 2, inputList.size());\n\n System.out.println(\"\\nMerging left\");\n System.out.println(\"Pre-Sort left: \" + printCurrentList(leftList));\n mergeSort(leftList);\n System.out.println(\"Post-Sort left: \" + printCurrentList(leftList));\n\n\n\n System.out.println(\"\\nMerging right\");\n System.out.println(\"Pre-Sort right: \" + printCurrentList(rightList));\n mergeSort(rightList);\n System.out.println(\"Post-Sort right: \" + printCurrentList(rightList));\n\n merge(leftList, rightList, inputList);\n }", "@Test\n public void testSort() {\n System.out.println(\"sort\");\n ParallelMergeSort instance = null;\n instance.sort();\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "public static void mergeSort(int a[]) {\n\t sort(a, 0, a.length-1); \n\t }", "private static void mergeSort(int[] attr, int low, int hight) {\n\t\t\n\t}", "public static void mergesort(int[]data){\n if (data.length <= 1)\n return;\n mergesortH(data, 0, data.length - 1);\n \n }", "private void merge_sort( ArrayList<Type> array, ArrayList<Type> auxillary, int low, int high ){\n\t\tif((high-low)>switchOff){\n\t\t\tint middle=low+((high-low)/2);\n\t\t\tmerge_sort(array,auxillary,low,middle);\n\t\t\tmerge_sort(array,auxillary,middle+1,high);\n\t\t\tcombine(array,auxillary,low,middle,high);\n\t\t}else{\n\t\t\tSort_Utils.insertion_sort(array, low, high);\n\t\t}\n\t}", "private static <T extends Comparable<T>> void mergeSort(T[] arrayToSort, int startIndex, int endIndex) {\n if(startIndex + 1 < endIndex) {\n int centerIndex = (endIndex + startIndex)/2;\n mergeSort(arrayToSort, startIndex, centerIndex); // sort left half\n mergeSort(arrayToSort, centerIndex, endIndex); // sort right half\n merge(arrayToSort, startIndex, centerIndex, endIndex); // merge two, sorted halves\n }\n }", "public static void mergeSort(int[] elts) {\r\n\t\tint size = elts.length;\r\n\t\tif (size == 2) {\r\n\t\t\tif (elts[0] > elts[1])\r\n\t\t\t\tIntArraySortUtils.swap(elts, 0, 1);\r\n\t\t}\r\n\t\telse if (size > 2) {\r\n\t\t\tPair<int[], int[]> split = splitArray(elts);\r\n\t\t\tint[] left = split.first;\r\n\t\t\tint[] right = split.second;\r\n\t\t\tmergeSort(left);\r\n\t\t\tmergeSort(right);\r\n\t\t\tIntArraySortUtils.merge(elts, left, right);\r\n\t\t}\r\n\r\n\t}", "private void mergesort(int[] array) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tint[] inputarray= {46,45,87,32,84};\r\n\t\tMergeSort MS = new MergeSort();\r\n\t\tMS.sort(inputarray);\r\n\t}", "@Test(timeout = TIMEOUT, expected = IllegalArgumentException.class)\n public void testMergeNull() {\n Integer[] arr = {4, 2, 1, 3};\n Sorting.mergeSort(null, comparator);\n Sorting.mergeSort(arr, null);\n }", "public static <T extends Comparable<? super T>> void mergeSort(List<T> a){\n // create tmp array \n List<T> tmpArray = new ArrayList<>();\n for(int i = 0; i < a.size(); i++){\n tmpArray.add(null);\n }\n\n // call mergeSort method\n mergeSort(a, tmpArray, 0, a.size()-1);\n }", "public Merge() {\r\n this.listsOfSorted = new LinkedList<>();\r\n\r\n }", "private static <T extends Comparable<? super T>> void mergeSort(List<T> list, int begin, int mid, int finish, T[] auxiliaryArray){\n if(begin + 1 == finish)\n merge(list, begin, mid, mid + 1, finish, auxiliaryArray);\n else{\n if(begin < finish){\n mergeSort(list, begin, (mid + begin)/2, mid, auxiliaryArray);\n mergeSort(list, mid + 1, (finish + mid)/2, finish, auxiliaryArray);\n merge(list, begin, mid, mid + 1, finish, auxiliaryArray);\n }\n }\n }", "@Test(timeout = SHORT_TIMEOUT, expected = IllegalArgumentException.class)\n public void testNullArrMergeSort() {\n Sorting.mergeSort(null, comp);\n }", "public void mergeSort(Comparable[] input) {\n\t\t\n\t\t// check if input array is null\n\t\tif (input == null)\n\t\t\tthrow new IllegalArgumentException(\"Input array cannot be null!\");\n\t\t\n\t\t// if input array is empty or contains only 1 element - there's no need to sort\n\t\tif (input.length < 2)\n\t\t\treturn;\n\t\t\n\t\t// set up environment\n\t\tsetUp(input);\n\t\t\n\t\t// variable to store final result list\n\t\tint list;\n\t\twhile (true) {\n\t\t\t\n\t\t\t// poll two lists from queue\n\t\t\tint list1 = poll();\n\t\t\tint list2 = poll();\n\t\t\t\n\t\t\t// merge them and save result into created variable\n\t\t\tlist = merge(list1, list2);\n\t\t\t\n\t\t\t// if queue is empty - there's nothing else to merge - break loop\n\t\t\tif (isEmpty())\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t// if queue is not empty - add merged list to it\n\t\t\tadd(list);\n\t\t}\n\t\t\n\t\t// write result\n\t\twriteBack(input, list);\n\t}", "private void mergeSortHelper(Object arr[], int l, int r) \n\t{ \n\t\tif (l < r) \n\t\t{ \n\t\t\t// Find the middle point \n\t\t\tint m = (l+r)/2; \n\n\t\t\t// Sort first and second halves \n\t\t\tmergeSortHelper(arr, l, m); \n\t\t\tmergeSortHelper(arr , m+1, r); \n\n\t\t\t// Merge the sorted halves \n\t\t\tmerge(arr, l, m, r); \n\t\t} \n\t}", "private void mergeSort(int[] array, int start, int end) {\n\t\tif (start < end) {\n\t\t\tint mid = (start + end) / 2;\n\t\t\tmergeSort(array, start, mid);\n\t\t\tmergeSort(array, mid + 1, end);\n\t\t\tmerge(array, start, mid, end);\n\t\t}\n\t}", "public FindInversionsAndMergeSort() {\n\t\tthis.intArr = null;\n\t}", "public void sort() {\n if(c==null) {\n int middle;\n\n Comparable[] left, right;\n\n\n if (unsorted.length <= 1) {\n\n sorted = unsorted;\n\n } else {\n\n middle = unsorted.length / 2;\n\n\n left = new Comparable[middle];\n\n right = new Comparable[unsorted.length - middle];\n\n\n System.arraycopy(unsorted, 0, left, 0, middle);\n\n System.arraycopy(unsorted, middle, right, 0, unsorted.length - middle);\n\n\n // Внимание! Опа, рекурсия :)\n\n SimpleMerger leftSort = new SimpleMerger(left, c);\n\n SimpleMerger rightSort = new SimpleMerger(right,c);\n\n\n leftSort.sort();\n\n rightSort.sort();\n\n\n sorted = merge(leftSort.getSorted(), rightSort.getSorted());\n\n }\n }else{\n\n int middle;\n\n Object[] left, right;\n\n\n if (unsorted2.length <= 1) {\n\n sorted2 = unsorted2;\n\n } else {\n\n middle = unsorted2.length / 2;\n\n\n left = new Object[middle];\n\n right = new Object[unsorted2.length - middle];\n System.arraycopy(unsorted2, 0, left, 0, middle);\n\n System.arraycopy(unsorted2, middle, right, 0, unsorted2.length - middle);\n\n\n\n\n SimpleMerger leftSort = new SimpleMerger(left,c);\n\n SimpleMerger rightSort = new SimpleMerger(right,c);\n\n\n leftSort.sort();\n\n rightSort.sort();\n\n\n\n sorted2 = merge2(leftSort.getSorted2(), rightSort.getSorted2());\n\n }\n\n }\n }", "@Test\n public void sortArrayMergeSortTest() {\n int[] array1 = new int[]{5, 2, 3, 1};\n int[] expectedArray1 = new int[]{1, 2, 3, 5};\n int[] actualArray1 = sortArrayMergeSort(array1);\n assertArrayEquals(expectedArray1, actualArray1);\n /**\n * Example 2:\n * Input: nums = [5,1,1,2,0,0]\n * Output: [0,0,1,1,2,5]\n */\n int[] array2 = new int[]{5, 1, 1, 2, 0, 0};\n int[] expectedArray2 = new int[]{0, 0, 1, 1, 2, 5};\n int[] actualArray2 = sortArrayMergeSort(array2);\n assertArrayEquals(expectedArray2, actualArray2);\n }", "static void MergeSort(int[] arr){\n int[] helper = new int[arr.length];\n MergeSort(arr, helper, 0, arr.length-1);\n }", "public void mergeSort(ArrayList <Comparable> a, int first, int last){\r\n\t\t\r\n\t\tif (last - first == 0) {\r\n\t\t\tsteps ++;\r\n\t\t}else if (last - first == 1) {\r\n\t\t\tsteps += 4; \r\n\t\t\tif (a.get(first).compareTo(a.get(last)) > 0) {\r\n\t\t\t\tsteps += 5;\r\n\t\t\t\tswap(a, first, last);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\tsteps += 3;\r\n\t\t\tint mid = (last + first)/2;\r\n\t\t\tsteps += 4;\r\n\t\t\tmergeSort(a, first, mid);\r\n\t\t\tmergeSort(a, mid + 1, last);\r\n\t\t\tmerge(a, first, mid, last);\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"Merge Sort\");\r\n\t\tSystem.out.println();\r\n\t}", "public static void ordenarMergeSort( Comparable[ ] datos ) {\n\n\t\t// TODO implementar el algoritmo MergeSort\n\t\tlong startTime = System.currentTimeMillis();\n\t\tmergeSort(datos, 0, datos.length-1);\n\t\tlong endTime = System.currentTimeMillis() - startTime;\n\t\tSystem.out.println(endTime+\"\");\n\n\t}", "public static void main(String[] args) {\n\t\tList<Integer> inputArray = new ArrayList<Integer>();\n\t\tinputArray.add(99);\n\t\tinputArray.add(44);\n\t\tinputArray.add(6);\n\t\tinputArray.add(2);\n\t\tinputArray.add(1);\n\t\tinputArray.add(5); \n\t\tinputArray.add(63);\n\t\tinputArray.add(87);\n\t\tinputArray.add(283);\n\t\tinputArray.add(4);\n\t\tinputArray.add(0);\n\t\t \n\t\tSystem.out.println(\"Merge Sort Input\");\n\t\tinputArray = mergeSort(inputArray);\n\t\tSystem.out.println(\"Sorted Array: \"+inputArray);\n\t}", "public static void main(String[] args) {\n\t\tint[] arr = { 42, 96, 12, 18, -1, 53 };\n\t\tint[] sorted = mergesorting(arr,0,arr.length-1);\n\t\tdisplay(sorted);\n\t}", "public MergeSortTest(String testName) {\n super(testName);\n }", "void mergeSort(int[] arr, int l, int r) {\r\n if (l<r)\r\n {\r\n int m = (l+r)/2;\r\n\r\n mergeSort(arr,l,m);\r\n mergeSort(arr, m+1, r);\r\n merge(arr, l, m, r);\r\n }\r\n }", "public static void mergeSort(int[] arr) {\r\n if (arr.length - 1 > 0) {\r\n int[] arrLeft = new int[arr.length / 2];\r\n System.arraycopy(arr, 0, arrLeft, 0, arr.length / 2);\r\n int[] arrRight = new int[arr.length - arrLeft.length];\r\n System.arraycopy(arr, arr.length / 2, arrRight, 0, arrRight.length);\r\n mergeSort(arrLeft);\r\n mergeSort(arrRight);\r\n merge(arr, arrLeft, arrRight);\r\n }\r\n }", "public static void main(String[] args) {\n\t\tint[] A = {8,9,5,4,7,6,2,3,1};\n\t\tint[] tempA = new int[9];\n\t\tMergeSort object = new MergeSort();\n\t\tobject.mergeSort(A,tempA,0,8);\n\t\tSystem.out.println(\"hello\");\n\t}", "private static <T extends Comparable,S> void mergeSort(T[] src, S[] src2,\n\t\t\tT[] dest,\n\t\t\tS[] dest2,\n\t\t\tint low,\n\t\t\tint high,\n\t\t\tint off) {\n\t\tint length = high - low;\n\n\t\t// Insertion sort on smallest arrays\n\t\tif (length < INSERTIONSORT_THRESHOLD) {\n\t\t\tfor (int i=low; i<high; i++)\n\t\t\t\tfor (int j=i; j>low &&\n\t\t\t\t\t\tdest[j-1].compareTo(dest[j])>0; j--)\n\t\t\t\t\tswap(dest,dest2, j, j-1);\n\t\t\treturn;\n\t\t}\n\n\t\t// Recursively sort halves of dest into src\n\t\tint destLow = low;\n\t\tint destHigh = high;\n\t\tlow += off;\n\t\thigh += off;\n\t\tint mid = (low + high) >>> 1;\n\t\tmergeSort(dest, dest2, src, src2,low, mid, -off);\n\t\tmergeSort(dest, dest2, src, src2, mid, high, -off);\n\n\t\t// If list is already sorted, just copy from src to dest. This is an\n\t\t// optimization that results in faster sorts for nearly ordered lists.\n\t\tif (src[mid-1].compareTo(src[mid]) <= 0) {\n\t\t\tSystem.arraycopy(src, low, dest, destLow, length);\n\t\t\tSystem.arraycopy(src2, low, dest2, destLow, length);\n\t\t\treturn;\n\t\t}\n\n\t\t// Merge sorted halves (now in src) into dest\n\t\tfor(int i = destLow, p = low, q = mid; i < destHigh; i++) {\n\t\t\tif (q >= high || p < mid && src[p].compareTo(src[q])<=0) {\n\t\t\t\tdest2[i] = src2[p];\n\t\t\t\tdest[i] = src[p++];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdest2[i] = src2[q];\n\t\t\t\tdest[i] = src[q++];\n\t\t\t}\n\t\t}\n\t}", "static void mergeSort(int[] arr, int l, int r) {\n\t\tif (l<r) {\n\t\t\tint m = (l+r)/2;\n\n\t\t\tmergeSort(arr, l, m);\n\t\t\tmergeSort(arr, m+1, r);\n\t\t\tmerge(arr, l, r, m);\n\t\t}\n\t}", "private void runMergeSort(double[] heights, int numberOfThreads, List<List<List<double[]>>> animations) {\n // Merge sort splits the input into separate sections to sorted separately and then merged, so this list keeps\n // track of the starting index of each section of the input\n List<List<Integer>> starts = new ArrayList<List<Integer>>();\n starts.add(new ArrayList<Integer>());\n\n // The number of rectangles separating the start of each section created by the first stage of merge sort\n int interval;\n if(numberOfThreads > arrSize) {\n interval = 1;\n } else {\n interval = (int) Math.ceil((double) arrSize / (double) numberOfThreads);\n }\n\n /*\n The first stage of concurrent merge sort is to sort each separate section of the input with an individual\n thread. Then each subsequent stage consists of merging the separate sections such that the number of\n separately sorted sections is halved until the input is fully sorted. For the purposes of visualization,\n each stage in the process is represented as a time level in the animations list in the form of a list.\n Each separate section of the input at a given time level is represented as a list which is nested inside of\n the list corresponding to the time level at which the section (location) exists. Each list of locations\n holds arrays of doubles with each array representing some step in the process of merge sort (such as the\n comparison of two values, or the changing of some value in the input).\n */\n List<List<double[]>> firstTimeLevel = new ArrayList<List<double[]>>();\n animations.add(firstTimeLevel);\n\n // main.Sorting the separate sections of the input as defined by the number of threads being used\n for(int i = 0; i < arrSize - interval; i += interval) {\n List<double[]> location = new ArrayList<double[]>();\n firstTimeLevel.add(location);\n int start = i;\n int end = (i + interval - 1) > (arrSize - 1) ? arrSize - 1: i + interval - 1;\n starts.get(0).add(start);\n MergeSort.mergeSort(heights, start, end, location);\n }\n\n List<double[]> location = new ArrayList<double[]>();\n firstTimeLevel.add(location);\n int start = (arrSize - interval) >= 0 ? arrSize - interval : 0;\n int end = arrSize - 1;\n starts.get(0).add(start);\n MergeSort.mergeSort(heights, start, end, location);\n\n runMerge(heights, numberOfThreads / 2, starts, animations);\n }", "private void mergesort(ToCompare[] a, int l, int r) throws BrokenBarrierException, InterruptedException {\n if (l >= r) {\r\n return;\r\n }\r\n\r\n //recursion step: a[l..r] is not empty \r\n //divide into sublists and merge \r\n int m = (l + r) / 2;\r\n mergesort(a, l, m);\r\n mergesort(a, m + 1, r);\r\n merge(a, l, m, r);\r\n }", "public static void mergeSort(int start, int end, int[] numbers) {\n int mid = (start + end) / 2;\n\n if (start < end) {\n // sort left half\n mergeSort(start, mid, numbers);\n\n // sort right half\n mergeSort(mid + 1, end, numbers);\n\n // merge\n merge(start, mid, end, numbers);\n }\n }", "private static void mergeSort(int[] array, int startIndex, int endIndex) {\n if (startIndex < endIndex) {\n int halfIndex = (int) Math.floor((startIndex + endIndex) / 2);\n mergeSort(array, startIndex, halfIndex);\n mergeSort(array, halfIndex + 1, endIndex);\n mergeLogic(array, startIndex, halfIndex, endIndex);\n }\n }", "private static int[] mergeSort(int numbers[]) {\n\n\t\tif (numbers.length <= 1) {\n\t\t\treturn numbers;\n\t\t}\n\n\t\tint mid = numbers.length / 2;\n\t\tint subArray1[] = new int[mid];\n\t\tint subArray2[] = new int[numbers.length - mid];\n\n\t\tint count = 0;\n\t\tfor (int i = 0; i < subArray1.length; i++) {\n\t\t\tsubArray1[i] = numbers[count++];\n\t\t}\n\t\tfor (int i = 0; i < subArray2.length; i++) {\n\t\t\tsubArray2[i] = numbers[count++];\n\t\t}\n\n\t\tsubArray1 = mergeSort(subArray1);\n\t\tsubArray2 = mergeSort(subArray2);\n\t\tnumbers = merge(subArray1, subArray2);\n\n\t\treturn numbers;\n\t}", "public void mergesort_iterative(){\n\t\tint step = 1;\n\t\tint length = arr.length;\n\t\twhile(step < length){\n\t\t\tint i = 0;\n\t\t\twhile(i<length){\n\t\t\t\tmerge_iterative(i, step);\n\t\t\t\ti += step*2;\n\t\t\t}\n\t\t\tstep <<= 1;\n\t\t}\n\t}", "@Test\npublic void testMerge() throws Exception { \n//TODO: Test goes here... \n/* \ntry { \n Method method = MergeSort.getClass().getMethod(\"merge\", int[].class, int[].class); \n method.setAccessible(true); \n method.invoke(<Object>, <Parameters>); \n} catch(NoSuchMethodException e) { \n} catch(IllegalAccessException e) { \n} catch(InvocationTargetException e) { \n} \n*/ \n}", "private static int mergeOrdered(char[] paramArrayOfChar1, int paramInt1, int paramInt2, char[] paramArrayOfChar2, int paramInt3, int paramInt4)\n/* */ {\n/* 801 */ return mergeOrdered(paramArrayOfChar1, paramInt1, paramInt2, paramArrayOfChar2, paramInt3, paramInt4, true);\n/* */ }", "public static void enhancedMergeSort(int[] array, int size)\n {\n //base case\n if (size < 2)\n return;\n\n //sub arrays are sorted using insertion sort as\n //Mergesort has too much overhead for tiny subarrays.\n\n if ((size-1) < CUTOFF)\n {\n insertSort(array);\n return;\n }\n\n //dividing the array from the middle\n int mid = size / 2;\n int[] leftArray = new int[mid];\n int[] rightArray = new int[size - mid];\n for (int i = 0; i < mid; i++)\n {\n leftArray[i] = array[i];\n }\n for (int i = mid; i < size; i++)\n {\n rightArray[i - mid] = array[i];\n }\n //recursion\n mergeSort(leftArray, mid);\n mergeSort(rightArray, size - mid);\n\n // if the last element of left half is lesser or equal than first element of second half of the array\n // merge() call is skipped as it is not required.\n if ((array[mid] <= array[mid+1]))\n return;\n\n //merging the sorted halves\n merge(array, leftArray, rightArray, mid, size - mid);\n }", "public static void main(String[] args) {\r\n\t\tint[] A = { 1, 2, 3, 4, 4, 5, 6, 6, 7 };\r\n\t\tint[] B = { 4, 5, 5, 5, 6, 7, 8, 9 };\r\n\r\n\t\tSystem.out.println(\"Test 1: \");\r\n\t\tmerge(A, B);\r\n\r\n\t\tint[] C = { 9, 15, 16, 28 };\r\n\t\tint[] D = { 1, 8, 14, 15, 26, 31 };\r\n\t\tSystem.out.println(\"Test 2: \");\r\n\t\tmerge(C, D);\r\n\r\n\t\tint[] E = { -3, -1, 0, 29358, 29359, 300000 };\r\n\t\tint[] F = { -29, -2, 0, 100, 29360 };\r\n\t\tSystem.out.println(\"Test 3: \");\r\n\t\tmerge(E, F);\r\n\r\n\t}", "private static <T,S>void mergeSort(T[] src,S[] src2,\n\t\t\tT[] dest,\n\t\t\tS[] dest2,\n\t\t\tint low, int high, int off,\n\t\t\tComparator c) {\n\t\tint length = high - low;\n\n\t\t// Insertion sort on smallest arrays\n\t\tif (length < INSERTIONSORT_THRESHOLD) {\n\t\t\tfor (int i=low; i<high; i++)\n\t\t\t\tfor (int j=i; j>low && c.compare(dest[j-1], dest[j])>0; j--) \n\t\t\t\t\tswap(dest,dest2,j, j-1);\n\t\t\treturn;\n\t\t}\n\n\t\t// Recursively sort halves of dest into src\n\t\tint destLow = low;\n\t\tint destHigh = high;\n\t\tlow += off;\n\t\thigh += off;\n\t\tint mid = (low + high) >>> 1;\n\t\t\tmergeSort(dest,dest2, src, src2,low, mid, -off, c);\n\t\t\tmergeSort(dest,dest2, src, src2, mid, high, -off, c);\n\n\t\t\t// If list is already sorted, just copy from src to dest. This is an\n\t\t\t// optimization that results in faster sorts for nearly ordered lists.\n\t\t\tif (c.compare(src[mid-1], src[mid]) <= 0) {\n\t\t\t\tSystem.arraycopy(src, low, dest, destLow, length);\n\t\t\t\tSystem.arraycopy(src2, low, dest2, destLow, length);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Merge sorted halves (now in src) into dest\n\t\t\tfor(int i = destLow, p = low, q = mid; i < destHigh; i++) {\n\t\t\t\tif (q >= high || p < mid && c.compare(src[p], src[q]) <= 0) {\n\t\t\t\t\tdest2[i] = src2[p];\n\t\t\t\t\tdest[i] = src[p++];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tdest2[i] = src2[q];\n\t\t\t\t\tdest[i] = src[q++];\n\t\t\t\t}\n\t\t\t}\n\t}", "private static <K> void mergeSortHelper(K[] S, Comparator<K> comp, long timeGiven, long startTime) throws TimedOutException {\n if (System.currentTimeMillis() - startTime > timeGiven) {\n throw new TimedOutException(\"TimeOut\");\n }\n int n = S.length;\n if (n < 2) return; // array is trivially sorted\n // divide\n int mid = n / 2;\n K[] S1 = Arrays.copyOfRange(S, 0, mid); // copy of first half\n K[] S2 = Arrays.copyOfRange(S, mid, n); // copy of second half\n // conquer (with recursion)\n mergeSortHelper(S1, comp, timeGiven, startTime); // sort copy of first half\n mergeSortHelper(S2, comp, timeGiven, startTime); // sort copy of second half\n // merge results\n merge(S1, S2, S, comp, timeGiven, startTime); // merge sorted halves back into original\n \n }", "public static void sort(int[] mergeList) {\n for(int i = 0; i < mergeList.length - 1; i++) { //iterate through mergeList \n int min = mergeList[i];\n int minIndex = i;\n \n\n for(int j = i + 1; j < mergeList.length; j++) { //swap current list item with smaller value \n if(mergeList[j] < min) { \n min = mergeList[j]; \n minIndex = j; \n \n }\t\t\t\t\t\n }\n \n \n if(minIndex != i) { //swap original list with sorted list\n mergeList[minIndex] = mergeList[i];\n mergeList[i] = min;\n \n }\n }\n }", "private static void mergeSort(int[] num, int low, int high) {\n\t\tif ((high - low) >= 1) {\n\n\t\t\t// find the middle index\n\t\t\tint middle = (low + high) / 2;\n\n\t\t\t// make recursive calls to the 'left' and 'right' sides of the sublist\n\t\t\tmergeSort(num, low, middle);\n\t\t\tmergeSort(num, middle + 1, high);\n\n\t\t\t// merge the sublists back together\n\t\t\tmerge(num, low, middle, middle + 1, high);\n\n\t\t}\n\t}", "public static void Mergesort(int[]data,int[]storageA,int[]storageB){\n int length=data.length;\n while (length>8){\n for(int i=0;i<data.length/2;i++){\n storageA[i]=data[i];\n }\n int index=0;\n for(int i=data.length/2;i<data.length;i++){\n storageB[index]=data[i];\n index++;\n }\n int[]temp1=new int[storageA.length/2];\n int[]temp2=new int[storageA.length-temp1.length];\n int[]temp3=new int[storageB.length/2];\n int[]temp4=new int[storageB.length-temp3.length];\n Mergesort(storageA,temp1,temp2);\n Mergesort(storageB,temp3,temp4);\n\n merge(data,storageA,storageB);\n // System.out.println(Arrays.toString(data));\n length=8;\n }\n insertion(data);\n\n // System.out.println(Arrays.toString(storageA));\n //System.out.println(Arrays.toString(storageB));\n //data=merge(storageA,storageB,0,1);\n }", "public void setSort_merge_passes(Long sort_merge_passes) {\n this.sort_merge_passes = sort_merge_passes;\n }", "@Override\n\tpublic Object sort(Object o) {\n\t\tSystem.out.println(\"\\nI am Merge Sort!!!\");\n\t\t if (o instanceof MyArray) {\n\t\t \tMyArray new_name = (MyArray) o;\n\t\t \tint[] array = new_name.array;\n\t\t \t\n\t\t \tmergesort(array);\n\t\t \tfor (int i = 0; i < array.length; i++) {\n\t\t \t\tSystem.out.print(array[i] + \" \");\n\t\t \t\t\n\t\t \t}\n\t\t }\n\t\treturn null;\n\t}", "private static void evaluateMergesortVogellaThreaded() {\n\n // LOGGER.info(\"evaluating parallel mergesort with Java Threads based on the Vogella version\");\n\n // The time before start to sort.\n long startTime;\n\n // The time after sort.\n long endTime;\n\n // generate sorted array\n numbers = generateSortedArray(ARRAY_SIZE);\n\n // get array to evaluate\n generateWorstUnsortArray(numbers);\n\n // get systemtime before sorting\n startTime = System.currentTimeMillis();\n\n // sort\n msVogellaJThreads.sort(numbers);\n\n // get systemtime after sorting\n endTime = System.currentTimeMillis();\n\n // show the result of the sorting process\n System.out.println(\"\\n- Sortierergebnis: Java Threads (Vogella) -\");\n System.out.println(\"Die sortierte Folge lautet: \" + arrayToString(numbers));\n System.out.printf(\"Für die Sortierung wurden %d ms benötigt\", endTime - startTime);\n System.out.println(\"\\n------------------------------------------------\\n\");\n }", "public void sort() {\n }", "public static void main(String[] args) {\n\t\tint[] data = { 6, 3, 3, 7, 1, 21, 3, 7, 2, 25 };\n\n\t\tSystem.out.print(\"origin :\");\n\t\tprint(data);\n\t\tmergeSort(data, 0, data.length - 1);\n\n\t\tSystem.out.print(\"result :\");\n\t\tprint(data);\n\t}", "public static <T> void mergeSort( T[] array, int left, int right, Comparator<? super T> comp )\n\t{\n\t\tif ( left < right ) {\n\t\t\tint mid = ( left + right ) / 2;\n\t\t\tmergeSort(array, left, mid, comp);\n\t\t\tmergeSort(array, mid + 1, right, comp);\n\t\t\tmerge(array, left, mid, right, comp);\n\t\t}\n\t}", "@Override\r\n\tpublic void addSort() {\n\t\t\r\n\t}", "public void mergeSort(int[] array) {\n\t\t// Edge cases.\n\t\tif (array == null) return;\n\t\tif (array.length <= 1) return;\n\t\t\n\t\t// Invoke recursive mergeSort.\n\t\tmergeSort(array, 0, array.length - 1);\n\t}", "public int[] mergeSort(int[] nums) {\n\t\tif(nums.length<=1) return nums;\n\t\t\n\t\tint mid=nums.length/2;\n\t\tint[] numsA=Arrays.copyOfRange(nums,0,mid);\n\t\tint[] numsB=Arrays.copyOfRange(nums,mid,nums.length);\n\t\t\n\t\treturn merge(mergeSort(numsA),mergeSort(numsB));\n\t\t\n\t}", "public String doSort();", "private int[] mergeSort(int[] nums, int start, int end) {\n if (start == end) {\n return new int[]{nums[start]};\n }\n\n // keep dividing the entire array into sub-arrays\n int mid = (end - start) / 2 + start;\n int[] left = mergeSort(nums, start, mid);\n int[] right = mergeSort(nums, mid + 1, end);\n // return merged array\n return mergeTwoSortedArrays(left, right);\n }", "void mergeSort(int arr[], int l, int r) \n { \n if (l < r) \n { \n // Find the middle point \n int m = (l+r)/2; \n \n // Sort first and second halves \n mergeSort(arr, l, m); \n mergeSort(arr , m+1, r); \n \n // Merge the sorted halves \n sort(arr, l, m, r); \n } \n\t}", "public void sortGivenArray_date(){\n movieList = mergeSort(movieList);\n }", "private void mergesort(ArrayList<Integer> list, int l, int h) {\n\t\tif (l < h) {\n\t\t\tint m = (l + h) / 2;\n\t\t\tmergesort(list, l, m);\n\t\t\tmergesort(list, m + 1, h);\n\t\t\tSystem.out.println(list);\n\t\t\tmerge(list, l, m, h);\n\t\t}\n\t}", "static void mergeSort(int array[], int start, int end) {\n if (start < end) {\n // Find the middle point\n int middle = start + (end - start)/2;\n\n // Sort first and second parts\n mergeSort(array, start, middle);\n mergeSort(array, middle + 1, end);\n\n // Merge the sorted parts\n merge(array, start, middle, end);\n\n }\n\n }", "private void recMergeSort(final long[] workSpace, final int lowerBound,\n final int upperBound) {\n if (lowerBound == upperBound) // if range is 1,\n return; // no use sorting\n else { // find midpoint\n final int mid = (lowerBound + upperBound) / 2;\n // sort low half\n recMergeSort(workSpace, lowerBound, mid);\n // sort high half\n recMergeSort(workSpace, mid + 1, upperBound);\n // merge them\n merge(workSpace, lowerBound, mid + 1, upperBound);\n } // end else\n }", "private void mergeSort(ArrayList<File> listToSort, Comparator<File> fileComparator) {\r\n int size = listToSort.size();\r\n if (size < 2) {\r\n return;\r\n }\r\n int half = size / 2;\r\n ArrayList<File> firstList = new ArrayList<File>(listToSort.subList(0, half));\r\n ArrayList<File> secondList = new ArrayList<File>(listToSort.subList(half, size));\r\n\r\n mergeSort(firstList, fileComparator);\r\n mergeSort(secondList, fileComparator);\r\n\r\n merge(firstList, secondList, listToSort, fileComparator);\r\n }", "private static void mergeSortInternally(int[] a, int low, int high) {\n\n if (low >= high) {\n return;\n }\n int mid = low + (high - low) / 2;\n mergeSortInternally(a, low, mid);\n mergeSortInternally(a, mid + 1, high);\n System.out.println(\"low:\" + low + \", mid:\" + mid + \", high:\" + high);\n merge(a, low, mid, high);\n }", "private void somethingIsWrongWithMergeSort() {\n try {\n Sorting.mergesort(\n null, (new Zombie(null, 0, 0).getNameComparator()));\n fail(\"You didn't even throw the exception for the array.\");\n } catch (IllegalArgumentException e) {\n assertNotNull(\n \"Good job throwing the exception...but you need a message!\",\n e.getMessage());\n }\n try {\n Sorting.mergesort(horde, null);\n fail(\"You didn't even throw the exception for the comparator.\");\n } catch (IllegalArgumentException e) {\n assertNotNull(\n \"Good job throwing the exception...but you need a message!\",\n e.getMessage());\n }\n }", "public static void sort(java.util.List arg0)\n { return; }", "private static void merge(int[] nums, int[] work, int start, int mid, int end){\n\t\tboolean loop = true;\n\t\tint counter1 = start;\n\t\tint counter2 = mid+1;\n\t\tint workCounter = start;\n\t\t\n\t\twhile(loop){\n\t\t\tif(counter1 > mid){\n\t\t\t\t// Copy all elements from 2nd end to work\n\t\t\t\tfor(int i=counter2; i<=end; i++)\n\t\t\t\t\twork[workCounter++] = nums[i];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tif(counter2 > end){\n\t\t\t\t// Copy all elements from start-mid to work\n\t\t\t\tfor(int i=counter1; i<=mid; i++)\n\t\t\t\t\twork[workCounter++] = nums[i];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t// Swap the number if the numbers in are not is sorted order\n\t\t\tif(nums[counter1] < nums[counter2]){\n\t\t\t\twork[workCounter] = nums[counter1]; \n\t\t\t\tcounter1++;\n\t\t\t}else{\n\t\t\t\twork[workCounter] = nums[counter2]; \n\t\t\t\tcounter2++;\n\t\t\t}\n\t\t\t\n\t\t\tworkCounter++;\n\t\t}\n\t\t\n\t\t// Copy the sorted work array into main array\n\t\tfor(int i=start; i <= end; i++)\n\t\t\tnums[i] = work[i];\n\t}", "JDKSort() {\n }", "public static void main(String[] args) {\n\t\t\tint arr[]= {2,9,8,3,6,4,10,7};\r\n\t\t\tint[] so=mergesort(arr,0,arr.length-1);\r\n\t\t\tSystem.out.println(Arrays.toString(so));\r\n//\t\t\tfor(int i=0;i<arr.length;i++)\r\n//\t\t\t\tSystem.out.print(so[i]+\" \");\r\n\t\t}", "static void MergeSort(int[] A, int p, int r) {\n\t\tif (p < r) {\n\t\t\tint q = (p + r) / 2;\n\t\t\tMergeSort(A, p, q);\n\t\t\tMergeSort(A, q + 1, r);\n\t\t\tMerge(A, p, q, r);\n\t\t}\n\t}", "public static void mergesort(ArrayList<Score> items, int start, int end) {\r\n if (start < end) {\r\n int mid = (start + end) / 2;\r\n mergesort(items, start, mid);\r\n mergesort(items, mid + 1, end);\r\n merge(items, start, mid, end);\r\n }\r\n }", "private Sort() { }", "void merge();", "@Override\n\tprotected void merge(Object in1, Object in2, Object out) {\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tfinal int arr[] = new int[] { 6, 4, 3, 2, 1, 55, 6, 4, 22, 33, 4, -12, 0, 0, 0 };\n\t\tSystem.out.println(Arrays.toString(mergeSort(arr, 0, arr.length - 1)));\n\t}", "public FileMergeSort() {\r\n }", "public static void sortInputExternalMerge() {\r\n\t\tExternalMultiwayMerge merge = new ExternalMultiwayMerge();\r\n\t\tmerge.sort(inputFile, M, d);\r\n\t}", "public void sort(){\r\n\t\t\t// we pass this doubly linked list's head to merge sort it\r\n\t\t\tthis.head = mergeSort(this.head);\r\n\t\t}", "private void mergeSortRec(WordList list, Comparator<String> comp, int start, int end)\r\n {\r\n // TODO\r\n\t int middle = start + (end - start)/2; \r\n\t \r\n\t if(start < end) {\r\n\t\t mergeSortRec(list, comp, start, middle);\r\n\t\t mergeSortRec(list, comp, middle+1, end);\r\n\t\t mergeHelp(list, comp, start, middle, end);\r\n\t }\r\n\t \r\n }", "public static void mergeSort(List<Integer> values) {\r\n for (int stepSize = 2; stepSize < values.size(); stepSize *= 2) {\r\n for (int i = 0; i < values.size(); i += stepSize) {\r\n int prefixStart = i;\r\n int suffixStart = i + stepSize / 2;\r\n int suffixEnd = Math.min(values.size(), i + stepSize);\r\n merge(values, prefixStart, suffixStart, suffixEnd);\r\n } // for\r\n if (stepSize > values.size() / 2) {\r\n int prefixStart = 0;\r\n int suffixStart = stepSize;\r\n int suffixEnd = values.size();\r\n merge(values, prefixStart, suffixStart, suffixEnd);\r\n } // if\r\n //printList(values);\r\n } // for\r\n }", "public static void main(String[] args) {\n\t\t\n\t\tint [] arr = {1,4,5,6,8,10,3,2,9,7};\n\t\t\n\t\tMergeSort ms = new MergeSort();\n\t\tms.mergeSort(arr);\n\t\t\n\t\tarr = ms.getArray();\n\t\tfor(Integer i : arr) {\n\t\t\tSystem.out.print(i + \" \");\n\t\t}\n\t\t\n\t\t\n\n\t}", "public void merge(paintIntegers[] arr, int lidx, int midx, int ridx){\n int leftn = midx - lidx + 1;\n int rightn = ridx - midx;\n\n //instantiating the left and right arrays\n int Left[] = new int [leftn];\n int Right[] = new int [rightn];\n\n //copies the data from original to the left and right\n for (int i=0; i < leftn; ++i) {\n Left[i] = arr[lidx + i].val;\n }\n for (int j=0; j < rightn; ++j) {\n Right[j] = arr[midx + 1 + j].val;\n }\n\n //merges the two arrays and updates the original array\n //initializes leftIndex and rightIndex to iterate over the left and right arrays\n //if it is added to the original array, then where it came from, it would increment\n int leftIndex = 0;\n int rightIndex = 0;\n int k = lidx; //to properly align where the elements to go, left\n //System.out.println(k);\n //while it hasnt gone through all the elements in the left and right array\n //between the two arrays check which one is lowest, and then updates original array\n while (leftIndex < leftn && rightIndex < rightn)\n {\n if (Left[leftIndex] <= Right[rightIndex])\n {\n arr[k].val = Left[leftIndex];\n sorting.add(paintIntegers.deepCopy(arr));//adds current array to list\n leftIndex++;\n }\n else\n {\n arr[k].val = Right[rightIndex];\n sorting.add(paintIntegers.deepCopy(arr));//adds current array to list\n rightIndex++;\n }\n k++;\n }\n //if there are some left on the left array then just adds to original array\n //possible because all the elements in right array have been added\n //all thats left is the sorted elements from the left array\n while (leftIndex < leftn)\n {\n arr[k].val = Left[leftIndex];\n sorting.add(paintIntegers.deepCopy(arr));//adds current array to list\n leftIndex++;\n k++;\n }\n //same explanation as above but with the right array\n while (rightIndex < rightn)\n {\n arr[k].val = Right[rightIndex];\n sorting.add(paintIntegers.deepCopy(arr));//adds current array to list\n rightIndex++;\n k++;\n }\n }", "public DefaultSortParameters() {\n\t\tthis(null, null, null, null, null);\n\t}", "@Override\n public abstract void merge(Mergeable merge);", "public void mergesort(int[] a, int startI, int endI) {\n\t\t\n\t\t//int si= a.length-1;\n\t\tint [] val = new int[1];\n\t\tint midPoint;\n\t\tlong heapSize = Runtime.getRuntime().totalMemory();\n\t\tlong heapFreeSize = Runtime.getRuntime().freeMemory(); \n\t\t//System.out.println(\"current heap size \"+heapsize);\n\t\tmidPoint = (endI+startI)/2; //midpoint for array\n\t\t\n\t\tif(heapFreeSize<1212015976)\n\t\tSystem.out.println(\"Start: \"+startI+\" End: \"+endI+\" Mid: \"+midPoint+\" current heap size \"+heapSize+\" current free heap \"+heapFreeSize);\n\t\tif (endI-startI < 1) {\n\t\t\tval[0]=a[startI];\n\t\t\t//System.out.println(\"returning \"+val[0]);\n\t\t\treturn ;\n\t\t}\n\t\t/*try\n\t\t{\n\t\t Thread.sleep(3000);\n\t\t}\n\t\tcatch(InterruptedException ex)\n\t\t{\n\t\t Thread.currentThread().interrupt();\n\t\t}*/\n\t\n\t\tmergesort(a, startI, midPoint); //split left\n\t\t\n\t\t\n\t\t//System.out.println(\"Start 2: \"+startI+\" End: \"+endI+\" Mid: \"+midPoint);\n\t\tmergesort(a, midPoint+1, endI);\t\t//split right\n\t\ttemp=mergeSortedArrays(a, startI, midPoint, midPoint+1, endI); //by defining positions in array, we are taking out array slices\n\t\t/*for (int i=0;i<temp.length;i++) {\n\t\t\ta[i]=temp[i];\n\t\t}*/\n\t\t/*System.out.println(\"Printing Temp=>\");\n\t\t\n\t\tfor (int i=0;i<temp.length;i++) {\n\t\t\tSystem.out.print(temp[i]+\", \");\n\t\t}\n\t\tSystem.out.println(\"\\n Printing A=>\");\n\t\t\n\t\tfor (int i=startI;i<endI;i++) {\n\t\t\tSystem.out.print(a[i]+\", \");\n\t\t}\n\t\tSystem.out.println(\"==>\");\n\t\treturn a;*/\n\t\t\n\t\t//System.out.println(\"==>\");\n\t\tint fill = startI;\n\t\tfor (int i=0;i<temp.length;i++) {\n\t\t\ta[fill]=temp[i];\n\t\t\tfill++;\n\t\t}\n\t\treturn ;\n\t}", "public int[] mergeSort(int in[]) {\n\t\t\n\t\t// Base case\n\t\t\t\tif(in.length == 1) {\n\t\t\t\t\treturn in;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tint[] left, right;\n\t\t\t\t\n\t\t\t\tleft = new int[in.length / 2];\n\t\t\t\tSystem.arraycopy(in, 0, left, 0, in.length / 2);\n\t\t\t\t\n\t\t\t\t// Even number of elements\n\t\t\t\tif(in.length % 2 == 0) {\n\t\t\t\t\tright = new int[(in.length / 2)];\n\t\t\t\t\tSystem.arraycopy(in, in.length / 2, right, 0, in.length / 2);\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// Odd number of elements\n\t\t\t\telse {\n\t\t\t\t\tright = new int[(in.length / 2) + 1];\n\t\t\t\t\tSystem.arraycopy(in, in.length / 2, right, 0, in.length / 2 + 1);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tleft = mergeSort(left);\n\t\t\t\tright = mergeSort(right);\n\t\t\t\t\n\t\t\t\treturn merge(left, right);\n\t\t\t\t\n\t}" ]
[ "0.7228038", "0.6719791", "0.6644334", "0.6613423", "0.6597394", "0.6586384", "0.6522727", "0.64714915", "0.6469497", "0.6417973", "0.64107084", "0.6400262", "0.63879675", "0.6352518", "0.62890685", "0.62865174", "0.6268996", "0.62451345", "0.62441677", "0.6214703", "0.6206241", "0.6192303", "0.6176492", "0.6155745", "0.61438656", "0.6143299", "0.61390555", "0.61148643", "0.6104966", "0.61028093", "0.6074402", "0.6061814", "0.6059367", "0.60427153", "0.60371447", "0.6032487", "0.6010975", "0.600021", "0.5988324", "0.5979522", "0.5976093", "0.5964193", "0.5962656", "0.5958815", "0.59276277", "0.59241", "0.5909385", "0.59093004", "0.5907684", "0.5902901", "0.5884085", "0.5872881", "0.58695465", "0.5856693", "0.5855743", "0.58509475", "0.58472294", "0.58437634", "0.5836821", "0.58335125", "0.5825847", "0.5809118", "0.5806488", "0.5791539", "0.5765505", "0.57646036", "0.5762531", "0.57613283", "0.5757313", "0.5754432", "0.574922", "0.5742532", "0.57416695", "0.5728335", "0.57213485", "0.57043827", "0.5702726", "0.5702211", "0.5701895", "0.56886494", "0.56859696", "0.5685832", "0.5679623", "0.5672936", "0.5667188", "0.5633537", "0.5627606", "0.56193364", "0.5617124", "0.55871326", "0.558515", "0.55837363", "0.5579578", "0.55739564", "0.5571722", "0.55664045", "0.5565978", "0.5561974", "0.55544615", "0.55401987" ]
0.5776177
64
Makes the recursive Merge Sort calls and the Merge method call. First it check if the sublists that need to be ordered are of size 1. If they are, they are then merged, if they are not, it calls itself recursively. After the recursion, when its sublists are ordered, it merges them if the beginning index is lesser then the finish one, since sublists don't need to be ordered if they are of size 0.
private static <T extends Comparable<? super T>> void mergeSort(List<T> list, int begin, int mid, int finish, T[] auxiliaryArray){ if(begin + 1 == finish) merge(list, begin, mid, mid + 1, finish, auxiliaryArray); else{ if(begin < finish){ mergeSort(list, begin, (mid + begin)/2, mid, auxiliaryArray); mergeSort(list, mid + 1, (finish + mid)/2, finish, auxiliaryArray); merge(list, begin, mid, mid + 1, finish, auxiliaryArray); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void mergeSort(ArrayList<Integer> inputList) {\n recursiveCallCounter++;\n System.out.println(\"Current recursive call count: \" + recursiveCallCounter);\n\n if (inputList.size() < 2) {\n System.out.println(\"\\nCurrent list length < 2\");\n System.out.println(\"Current recursive call count: \" + recursiveCallCounter + \"\\n\");\n\n return;\n }\n\n ArrayList<Integer> leftList = arrayListCopy(inputList, 0, inputList.size() / 2);\n ArrayList<Integer> rightList = arrayListCopy(inputList, inputList.size() / 2, inputList.size());\n\n System.out.println(\"\\nMerging left\");\n System.out.println(\"Pre-Sort left: \" + printCurrentList(leftList));\n mergeSort(leftList);\n System.out.println(\"Post-Sort left: \" + printCurrentList(leftList));\n\n\n\n System.out.println(\"\\nMerging right\");\n System.out.println(\"Pre-Sort right: \" + printCurrentList(rightList));\n mergeSort(rightList);\n System.out.println(\"Post-Sort right: \" + printCurrentList(rightList));\n\n merge(leftList, rightList, inputList);\n }", "public void mergeSort(ArrayList <Comparable> a, int first, int last){\r\n\t\t\r\n\t\tif (last - first == 0) {\r\n\t\t\tsteps ++;\r\n\t\t}else if (last - first == 1) {\r\n\t\t\tsteps += 4; \r\n\t\t\tif (a.get(first).compareTo(a.get(last)) > 0) {\r\n\t\t\t\tsteps += 5;\r\n\t\t\t\tswap(a, first, last);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\tsteps += 3;\r\n\t\t\tint mid = (last + first)/2;\r\n\t\t\tsteps += 4;\r\n\t\t\tmergeSort(a, first, mid);\r\n\t\t\tmergeSort(a, mid + 1, last);\r\n\t\t\tmerge(a, first, mid, last);\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"Merge Sort\");\r\n\t\tSystem.out.println();\r\n\t}", "private static void mergeSort(int[] num, int low, int high) {\n\t\tif ((high - low) >= 1) {\n\n\t\t\t// find the middle index\n\t\t\tint middle = (low + high) / 2;\n\n\t\t\t// make recursive calls to the 'left' and 'right' sides of the sublist\n\t\t\tmergeSort(num, low, middle);\n\t\t\tmergeSort(num, middle + 1, high);\n\n\t\t\t// merge the sublists back together\n\t\t\tmerge(num, low, middle, middle + 1, high);\n\n\t\t}\n\t}", "public static void mergeSortNonRecursive(int[] input){\n int[] arr;\n Stack<int[]> unsortedStack = new Stack();\n Stack<int[]> sortedStack = new Stack();\n unsortedStack.push(input);\n //while !unsortedStack.isempty, needs to pop int[] from stack , assign to arr, pop status\n //if(arr.length>1), split arr to arr.left and arr.right,push left and right into stack, push false to stack twice\n //else if(arr.length<=1), push arr to sortedStack (while (!unsorted.isempty && peek().length==arr,merge and pushback to stack again)\n //\n\n while(!unsortedStack.empty()) {\n arr = unsortedStack.pop();\n if (arr.length > 1) {\n int begin = 0,end=arr.length,mid=arr.length/2;\n int[] left = Arrays.copyOfRange(arr, begin, mid);\n int[] right = Arrays.copyOfRange(arr, mid, end);\n unsortedStack.push(left);\n unsortedStack.push(right);\n } else {\n while(!sortedStack.isEmpty() && sortedStack.peek().length<=arr.length){\n arr = merge(arr, sortedStack.pop());\n }\n sortedStack.push(arr);\n }\n }\n while(sortedStack.size()>1){\n arr = merge(sortedStack.pop(), sortedStack.pop());\n sortedStack.push(arr);\n }\n int[] tmp = sortedStack.pop();\n for(int i=0;i<input.length;i++){\n input[i]=tmp[i];\n }\n\n }", "public List<Integer> chunkMergesort(List<Integer> S) {\n\t\tif (S.size() < 2) {\n \t\t\treturn S;\n \t\t}\n \t\tint c = chunks(S);\n \t\tif (c == 1){\n \t\t\treturn S;\n \t\t}\n \t\tChunks p = chunkDivide(S, c);\n \t\tList<Integer> S1 = p.left;\n \t\tList<Integer> S2 = p.right;\n\t\tS1 = chunkMergesort(S1);\n\t\tS2 = chunkMergesort(S2);\n\t\tS = merge(S1, S2);\n\t\treturn S;\n\t}", "private void mergesort(ToCompare[] a, int l, int r) throws BrokenBarrierException, InterruptedException {\n if (l >= r) {\r\n return;\r\n }\r\n\r\n //recursion step: a[l..r] is not empty \r\n //divide into sublists and merge \r\n int m = (l + r) / 2;\r\n mergesort(a, l, m);\r\n mergesort(a, m + 1, r);\r\n merge(a, l, m, r);\r\n }", "public static void enhancedMergeSort(int[] array, int size)\n {\n //base case\n if (size < 2)\n return;\n\n //sub arrays are sorted using insertion sort as\n //Mergesort has too much overhead for tiny subarrays.\n\n if ((size-1) < CUTOFF)\n {\n insertSort(array);\n return;\n }\n\n //dividing the array from the middle\n int mid = size / 2;\n int[] leftArray = new int[mid];\n int[] rightArray = new int[size - mid];\n for (int i = 0; i < mid; i++)\n {\n leftArray[i] = array[i];\n }\n for (int i = mid; i < size; i++)\n {\n rightArray[i - mid] = array[i];\n }\n //recursion\n mergeSort(leftArray, mid);\n mergeSort(rightArray, size - mid);\n\n // if the last element of left half is lesser or equal than first element of second half of the array\n // merge() call is skipped as it is not required.\n if ((array[mid] <= array[mid+1]))\n return;\n\n //merging the sorted halves\n merge(array, leftArray, rightArray, mid, size - mid);\n }", "private void mergeSort(int low, int high) {\n\t\tif (low < high) {\n\t\t\tint middle = low + (high - low) / 2;\n\t\t\tmergeSort(low, middle);\n\t\t\tmergeSort(middle + 1, high);\n\t\t\tmergeParts(low, middle, high);\n\t\t}\n\t}", "public void mergesort_iterative(){\n\t\tint step = 1;\n\t\tint length = arr.length;\n\t\twhile(step < length){\n\t\t\tint i = 0;\n\t\t\twhile(i<length){\n\t\t\t\tmerge_iterative(i, step);\n\t\t\t\ti += step*2;\n\t\t\t}\n\t\t\tstep <<= 1;\n\t\t}\n\t}", "public static void mergeSort(List<Integer> values) {\r\n for (int stepSize = 2; stepSize < values.size(); stepSize *= 2) {\r\n for (int i = 0; i < values.size(); i += stepSize) {\r\n int prefixStart = i;\r\n int suffixStart = i + stepSize / 2;\r\n int suffixEnd = Math.min(values.size(), i + stepSize);\r\n merge(values, prefixStart, suffixStart, suffixEnd);\r\n } // for\r\n if (stepSize > values.size() / 2) {\r\n int prefixStart = 0;\r\n int suffixStart = stepSize;\r\n int suffixEnd = values.size();\r\n merge(values, prefixStart, suffixStart, suffixEnd);\r\n } // if\r\n //printList(values);\r\n } // for\r\n }", "public static ArrayList<Integer> mergeSort(ArrayList <Integer> list){\n System.out.println();\n System.out.println(\"Insertion Sort\");\n System.out.println();\n if (3 > 2){\n int mid= list.size()/2;\n ArrayList<Integer> left= new ArrayList<Integer>(mid);\n ArrayList<Integer> right=new ArrayList<Integer>(list.size()-mid);\n for (int i = 0; i < mid; i++) {\n left.add(list.get(i));\n } \n\n for (int i = 0; i < list.size()-mid; i++) {\n right.add(list.get(i));\n } \n\n left = mergeSort(left); \n right = mergeSort(right);\n merge(left,right,list);\n }\n return list;\n }", "public void mergeSort(int[] array){\n if(array.length <= 1){\r\n return;\r\n }\r\n // divide into 2 arrays\r\n int split = array.length/2;\r\n // create 2 arrays\r\n int[] front = Arrays.copyOfRange(array, 0, split);\r\n int[] back = Arrays.copyOfRange(array, split, array.length);\r\n \r\n // recursively sort\r\n mergeSort(front);\r\n mergeSort(back);\r\n \r\n // put numbers in correct spot\r\n // keeping track of where we are\r\n int fSpot = 0;\r\n int bSpot = 0;\r\n for(int i = 0; i < array.length; i++){\r\n // no more items in front array\r\n if(fSpot == front.length){\r\n // put item from back array in\r\n array[i] = back[bSpot];\r\n bSpot++;\r\n }else if(bSpot == back.length){\r\n // put item from front array in\r\n array[i] = front[fSpot];\r\n fSpot++;\r\n }else if(front[fSpot] < back[bSpot]){\r\n // put front item in\r\n array[i] = front[fSpot];\r\n fSpot++;\r\n }else{\r\n // put back item in\r\n array[i] = back[bSpot];\r\n bSpot++;\r\n }\r\n }\r\n }", "public static void mergeSort(int[] array, int size)\n {\n //base case\n if (size < 2)\n return;\n\n //dividing the array from the middle\n int mid = size / 2;\n int[] leftArray = new int[mid];\n int[] rightArray = new int[size - mid];\n for (int i = 0; i < mid; i++)\n {\n leftArray[i] = array[i];\n }\n for (int i = mid; i < size; i++)\n {\n rightArray[i - mid] = array[i];\n }\n //recursion\n mergeSort(leftArray, mid);\n mergeSort(rightArray, size - mid);\n //merging the sorted halves\n merge(array, leftArray, rightArray, mid, size - mid);\n }", "private void merge(ArrayList <Comparable> a, int first, int mid, int last){\r\n\t\tsteps += 5;\r\n\t\tArrayList<Comparable> temp = new ArrayList<Comparable>();\r\n\t\tint firstInd = first;\r\n\t\tint middle = mid + 1;\r\n\t\tsteps += 2;\r\n\t\twhile (firstInd <= mid && (middle) <= last) {\r\n\t\t\tif (a.get(firstInd).compareTo(a.get(middle)) < 0) {\r\n\t\t\t\ttemp.add(a.get(firstInd));\r\n\t\t\t\tfirstInd ++;\r\n\t\t\t\tsteps += 7;\r\n\t\t\t}else if (a.get(middle).compareTo(a.get(firstInd)) < 0){\r\n\t\t\t\ttemp.add(a.get(middle));\r\n\t\t\t\tmiddle++;\r\n\t\t\t\tsteps += 7;\r\n\t\t }else {\r\n\t\t\t\ttemp.add(a.get(middle));\r\n\t\t\t\tmiddle++;\r\n\t\t\t\tsteps += 3;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (firstInd >= mid + 1) {\r\n\t\t\tsteps += 4;\r\n\t\t\tfor (int i = middle; i <= last; i++) {\r\n\t\t\t\ttemp.add(a.get(i));\r\n\t\t\t}\r\n\t\t\tsteps += 3;\r\n\t\t}else {\r\n\t\t\tsteps += 2;\r\n\t\t\tfor (int i = firstInd; i <= mid; i++) {\r\n\t\t\t\ttemp.add(a.get(i));\r\n\t\t\t}\r\n\t\t\tsteps += 3;\r\n\t\t}\r\n\t\tsteps += 3;\r\n\t\tint j = 0;\r\n\t\tfor (int i = first; i <= last; i++) {\r\n\t\t\ta.set(i, temp.get(j));\r\n\t\t\tj++;\r\n\t\t\tsteps += 4;\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"Merge\");\r\n\t\tSystem.out.println();\r\n\r\n\t}", "private static void norecursion_mergesort(String[] arr) {\r\n\t\tint n = arr.length, k = 2;\r\n\t\twhile (k <= n) {\r\n\t\t\tfor (int i = 0;i < n;i++) {\r\n\t\t\t\tif ((i+1) % k == 0) {\r\n\t\t\t\t\tmerge(arr, i+1-k, i+1-k/2, i+1);\r\n\t\t\t\t\tif (n-(i+1) < k) {\r\n\t\t\t\t\t\tmerge(arr, (i+1)-k, i+1, n);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t\tk *= 2;\r\n\t\t}\r\n\t}", "public static void mergeSort(LinkedQueue q) {\n // Your solution here.\n LinkedQueue temp = ListSorts.makeQueueOfQueues(q);\n if (temp.isEmpty())\n {\n return;\n }\n while (temp.size() != 1)\n {\n try\n {\n Object queueOne = temp.dequeue();\n Object queueTwo = temp.dequeue();\n LinkedQueue temp2 = ListSorts.mergeSortedQueues((LinkedQueue) \n queueOne, (LinkedQueue) queueTwo);\n temp.enqueue(temp2);\n }\n catch (QueueEmptyException e)\n {\n e.printStackTrace(); \n }\n }\n \n try \n {\n q.append((LinkedQueue) temp.dequeue());\n } \n catch (QueueEmptyException e) \n {\n // TODO Auto-generated catch block\n e.printStackTrace();\n } \n }", "public static ArrayList<String> mergeSort(ArrayList<String> aList) {\n ArrayList<String> left = new ArrayList<String>();\n ArrayList<String> right = new ArrayList<String>();\n int minIndex;\n \n if (aList.size() == 1) { \n return aList;\n } else {\n minIndex = aList.size()/2;\n \n for (int i= 0; i< minIndex; i++) {\n left.add(aList.get(i));\n }\n\n for (int i= minIndex; i< aList.size(); i++) {\n right.add(aList.get(i));\n }\n \n left = mergeSort(left);\n right = mergeSort(right);\n \n merge(aList, right, left);\n }\n return aList;\n }", "void mergeSort(int arr[], int l, int r) \n { \n if (l < r) \n { \n // Find the middle point \n int m = (l+r)/2; \n \n // Sort first and second halves \n mergeSort(arr, l, m); \n mergeSort(arr , m+1, r); \n \n // Merge the sorted halves \n sort(arr, l, m, r); \n } \n\t}", "private static int[] mergeSort(int numbers[]) {\n\n\t\tif (numbers.length <= 1) {\n\t\t\treturn numbers;\n\t\t}\n\n\t\tint mid = numbers.length / 2;\n\t\tint subArray1[] = new int[mid];\n\t\tint subArray2[] = new int[numbers.length - mid];\n\n\t\tint count = 0;\n\t\tfor (int i = 0; i < subArray1.length; i++) {\n\t\t\tsubArray1[i] = numbers[count++];\n\t\t}\n\t\tfor (int i = 0; i < subArray2.length; i++) {\n\t\t\tsubArray2[i] = numbers[count++];\n\t\t}\n\n\t\tsubArray1 = mergeSort(subArray1);\n\t\tsubArray2 = mergeSort(subArray2);\n\t\tnumbers = merge(subArray1, subArray2);\n\n\t\treturn numbers;\n\t}", "static double[] mergeSortIterative (double a[]) {\r\n \tif(a==null){\r\n \t\tSystem.out.print(\"Array: empty\");\r\n \t\treturn null;\r\n \t}\r\n \tint length = (a.length-1);\r\n \tint currentSize; //varies from 1 to n/2\r\n\t\tint leftStart; // pick starting index of left subarray to be merged\r\n\t\tfor(currentSize=1; currentSize <= length; currentSize = (2*currentSize)) { //Merge subarrays in bottom up manner\r\n\t\t\t for(leftStart =0; leftStart < length ; leftStart += (2*currentSize)) { //Pick starting point of differnet subarrays of current size\r\n\t\t\t\t int mid = leftStart + currentSize -1;\r\n\t\t\t\t int rightEnd = Math.min(leftStart+2*currentSize-1, length);\r\n\t\t\t\t merge(a,leftStart,mid,rightEnd);\r\n\t\t\t }\r\n\t\t }\r\n\t\t return a;\r\n }", "public static void sort(int[] mergeList) {\n for(int i = 0; i < mergeList.length - 1; i++) { //iterate through mergeList \n int min = mergeList[i];\n int minIndex = i;\n \n\n for(int j = i + 1; j < mergeList.length; j++) { //swap current list item with smaller value \n if(mergeList[j] < min) { \n min = mergeList[j]; \n minIndex = j; \n \n }\t\t\t\t\t\n }\n \n \n if(minIndex != i) { //swap original list with sorted list\n mergeList[minIndex] = mergeList[i];\n mergeList[i] = min;\n \n }\n }\n }", "public static void mergeSort(int[] arr) {\r\n if (arr.length - 1 > 0) {\r\n int[] arrLeft = new int[arr.length / 2];\r\n System.arraycopy(arr, 0, arrLeft, 0, arr.length / 2);\r\n int[] arrRight = new int[arr.length - arrLeft.length];\r\n System.arraycopy(arr, arr.length / 2, arrRight, 0, arrRight.length);\r\n mergeSort(arrLeft);\r\n mergeSort(arrRight);\r\n merge(arr, arrLeft, arrRight);\r\n }\r\n }", "public Node mergeSort(Node head){\r\n\t\t\tif(head == null || head.next == null)\r\n\t\t\t\treturn head;\r\n\t\t\t// divide the list in 2 parts\r\n\t\t\tNode rightLow = split(head);\r\n\t\t\t\r\n\t\t\tNode leftPart = mergeSort(head);\r\n\t\t\tNode rightPart = mergeSort(rightLow);\r\n\r\n\t\t\t// call the merge sorted lists method to merge both the divided parts in sorted way\r\n\t\t\treturn mergeSortedLists(leftPart, rightPart);\r\n\t\t}", "public static void Mergesort(int[]data,int[]storageA,int[]storageB){\n int length=data.length;\n while (length>8){\n for(int i=0;i<data.length/2;i++){\n storageA[i]=data[i];\n }\n int index=0;\n for(int i=data.length/2;i<data.length;i++){\n storageB[index]=data[i];\n index++;\n }\n int[]temp1=new int[storageA.length/2];\n int[]temp2=new int[storageA.length-temp1.length];\n int[]temp3=new int[storageB.length/2];\n int[]temp4=new int[storageB.length-temp3.length];\n Mergesort(storageA,temp1,temp2);\n Mergesort(storageB,temp3,temp4);\n\n merge(data,storageA,storageB);\n // System.out.println(Arrays.toString(data));\n length=8;\n }\n insertion(data);\n\n // System.out.println(Arrays.toString(storageA));\n //System.out.println(Arrays.toString(storageB));\n //data=merge(storageA,storageB,0,1);\n }", "private void merge_sort( ArrayList<Type> array, ArrayList<Type> auxillary, int low, int high )\r\n\t{\r\n\t\t// base case\r\n\t\tif ((high - low) <= switchValue)\r\n\t\t{\r\n\t\t\tSort_Utils.insertion_sort(array, low, high);\r\n\t\t}\r\n\t\t\r\n\t\tif (low < high)\r\n\t\t{\r\n\t\t\tint middle = low + (high - low)/2;\r\n\t\t\t\r\n\t\t\t// recursively sort the two halves of the array\r\n\t\t\tmerge_sort(array, auxillary, low, middle);\r\n\t\t\tmerge_sort(array, auxillary, middle + 1, high);\r\n\t\t\tcombine(array, auxillary, low, middle, high);\r\n\t\t}\r\n}", "private static void mergeSort(int[] array, int startIndex, int endIndex) {\n if (startIndex < endIndex) {\n int halfIndex = (int) Math.floor((startIndex + endIndex) / 2);\n mergeSort(array, startIndex, halfIndex);\n mergeSort(array, halfIndex + 1, endIndex);\n mergeLogic(array, startIndex, halfIndex, endIndex);\n }\n }", "void mergeSort(int[] arr, int l, int r) {\r\n if (l<r)\r\n {\r\n int m = (l+r)/2;\r\n\r\n mergeSort(arr,l,m);\r\n mergeSort(arr, m+1, r);\r\n merge(arr, l, m, r);\r\n }\r\n }", "private void runMergeSort(double[] heights, int numberOfThreads, List<List<List<double[]>>> animations) {\n // Merge sort splits the input into separate sections to sorted separately and then merged, so this list keeps\n // track of the starting index of each section of the input\n List<List<Integer>> starts = new ArrayList<List<Integer>>();\n starts.add(new ArrayList<Integer>());\n\n // The number of rectangles separating the start of each section created by the first stage of merge sort\n int interval;\n if(numberOfThreads > arrSize) {\n interval = 1;\n } else {\n interval = (int) Math.ceil((double) arrSize / (double) numberOfThreads);\n }\n\n /*\n The first stage of concurrent merge sort is to sort each separate section of the input with an individual\n thread. Then each subsequent stage consists of merging the separate sections such that the number of\n separately sorted sections is halved until the input is fully sorted. For the purposes of visualization,\n each stage in the process is represented as a time level in the animations list in the form of a list.\n Each separate section of the input at a given time level is represented as a list which is nested inside of\n the list corresponding to the time level at which the section (location) exists. Each list of locations\n holds arrays of doubles with each array representing some step in the process of merge sort (such as the\n comparison of two values, or the changing of some value in the input).\n */\n List<List<double[]>> firstTimeLevel = new ArrayList<List<double[]>>();\n animations.add(firstTimeLevel);\n\n // main.Sorting the separate sections of the input as defined by the number of threads being used\n for(int i = 0; i < arrSize - interval; i += interval) {\n List<double[]> location = new ArrayList<double[]>();\n firstTimeLevel.add(location);\n int start = i;\n int end = (i + interval - 1) > (arrSize - 1) ? arrSize - 1: i + interval - 1;\n starts.get(0).add(start);\n MergeSort.mergeSort(heights, start, end, location);\n }\n\n List<double[]> location = new ArrayList<double[]>();\n firstTimeLevel.add(location);\n int start = (arrSize - interval) >= 0 ? arrSize - interval : 0;\n int end = arrSize - 1;\n starts.get(0).add(start);\n MergeSort.mergeSort(heights, start, end, location);\n\n runMerge(heights, numberOfThreads / 2, starts, animations);\n }", "static void mergeSort(int array[], int start, int end) {\n if (start < end) {\n // Find the middle point\n int middle = start + (end - start)/2;\n\n // Sort first and second parts\n mergeSort(array, start, middle);\n mergeSort(array, middle + 1, end);\n\n // Merge the sorted parts\n merge(array, start, middle, end);\n\n }\n\n }", "public Node mergeSort(Node head) {\n if (head == null || head.next == null) {\n return head;\n }\n\n // split head into 'a' and 'b' sublists\n Node a = head, b;\n\n Node slow = split(head);\n b = slow.next;\n slow.next = null;\n\n // recursively sort the sub-lists\n a = mergeSort(a);\n b = mergeSort(b);\n\n // merge the two sorted lists together\n head = merge(a, b);\n return head;\n }", "private static <T extends Comparable<T>> void mergeSort(T[] arrayToSort, int startIndex, int endIndex) {\n if(startIndex + 1 < endIndex) {\n int centerIndex = (endIndex + startIndex)/2;\n mergeSort(arrayToSort, startIndex, centerIndex); // sort left half\n mergeSort(arrayToSort, centerIndex, endIndex); // sort right half\n merge(arrayToSort, startIndex, centerIndex, endIndex); // merge two, sorted halves\n }\n }", "private void mergeSort(int[] array, int start, int end) {\n\t\tif (start < end) {\n\t\t\tint mid = (start + end) / 2;\n\t\t\tmergeSort(array, start, mid);\n\t\t\tmergeSort(array, mid + 1, end);\n\t\t\tmerge(array, start, mid, end);\n\t\t}\n\t}", "private static void mergeSort(int[] data, int left, int right) {\n\n\t\tint mid;\n\n\t\tif (left < right) {\n\n\t\t\tmid = (left + right) / 2;\n\n\t\t\tmergeSort(data, left, mid);\n\t\t\tmergeSort(data, mid + 1, right);\n\t\t\tmerge(data, left, mid, right);\n\t\t}\n\n\t}", "protected ArrayList<Aircraft> mergeSort(ArrayList<Aircraft> list, boolean ascending)\r\n {\r\n\t\t// Use the merge sort algorithm to sort 'aircrafts' and then \r\n\t\t// return it. Initially this method just returns an empty\r\n \t// list - you need to fix this.\r\n \t\r\n \tArrayList<Aircraft> sorted = new ArrayList<Aircraft>();\r\n\r\n \t// TODO\r\n \tif(list.size()<=1) \r\n \t{\r\n \t\treturn list;\r\n \t}\r\n \t \r\n \t int middleIndex = list.size()/2; //find the middle index\r\n \t \r\n \t ArrayList<Aircraft> sortedL = new ArrayList<Aircraft>(middleIndex); //create new Empty array at left\r\n \t ArrayList<Aircraft> sortedR; // initialized new Array at Right \r\n \t \r\n \t \r\n \t if(list.size()%2 == 0) //create new Right Empty array has the same of Left empty array\r\n \t {\r\n \t sortedR = new ArrayList<Aircraft>(middleIndex); \r\n \t }else\r\n \t {\r\n \t sortedR = new ArrayList<Aircraft>(middleIndex+1);\r\n \t }\r\n \t \r\n \t for(int i = 0;i<middleIndex;i++)\r\n \t {\r\n \t sortedL.add(list.get(i)); //get index list with lest than middle index\r\n \t }\r\n \t \r\n \t for(int j = middleIndex ;j < list.size();j++)\r\n \t {\r\n \t sortedR.add(list.get(j)); //get index list with more than middle index\r\n \t }\r\n \t \r\n \t\r\n \t \r\n \t if(ascending == true) {\r\n \t sortedL = mergeSort(sortedL,true); // split elements in the left side;\r\n \t sortedR = mergeSort(sortedR,true); // split element in the right side;\r\n \t \r\n \t sorted= Merge(sortedL,sortedR,true);\r\n \t \r\n \t \r\n \t }else // for descending\r\n \t { \r\n \t \r\n \t sortedL = mergeSort(sortedL,false); // split elements in the left side;\r\n \t sortedR = mergeSort(sortedR,false); // split element in the right side;\r\n \t \r\n \t sorted= Merge(sortedL,sortedR,false);\r\n \t \r\n \t }\r\n \treturn sorted;\r\n\t\t\r\n \t\r\n\t\t\r\n \t\r\n }", "private void mergeSortHelper(Object arr[], int l, int r) \n\t{ \n\t\tif (l < r) \n\t\t{ \n\t\t\t// Find the middle point \n\t\t\tint m = (l+r)/2; \n\n\t\t\t// Sort first and second halves \n\t\t\tmergeSortHelper(arr, l, m); \n\t\t\tmergeSortHelper(arr , m+1, r); \n\n\t\t\t// Merge the sorted halves \n\t\t\tmerge(arr, l, m, r); \n\t\t} \n\t}", "private void mergeSort(ArrayList<File> listToSort, Comparator<File> fileComparator) {\r\n int size = listToSort.size();\r\n if (size < 2) {\r\n return;\r\n }\r\n int half = size / 2;\r\n ArrayList<File> firstList = new ArrayList<File>(listToSort.subList(0, half));\r\n ArrayList<File> secondList = new ArrayList<File>(listToSort.subList(half, size));\r\n\r\n mergeSort(firstList, fileComparator);\r\n mergeSort(secondList, fileComparator);\r\n\r\n merge(firstList, secondList, listToSort, fileComparator);\r\n }", "private void mergesort(ArrayList<Integer> list, int l, int h) {\n\t\tif (l < h) {\n\t\t\tint m = (l + h) / 2;\n\t\t\tmergesort(list, l, m);\n\t\t\tmergesort(list, m + 1, h);\n\t\t\tSystem.out.println(list);\n\t\t\tmerge(list, l, m, h);\n\t\t}\n\t}", "static double[] mergeSortRecursive (double a[]) {\r\n \tif(a==null){\r\n \t\tSystem.out.print(\"Array empty\");\r\n \t\treturn null;\r\n \t}\r\n \tif(a.length>1) {\r\n \t\tint mid=a.length/2;\r\n \t\t//spilt left part\r\n \t\tdouble[] left =new double[mid];\r\n \t\tfor(int i =0 ; i <mid;i++) {\r\n \t\t\tleft[i]=a[i];\r\n \t\t}\r\n \t\t//spilt right part\r\n \t\tdouble[] right =new double[a.length-mid];\r\n \t\tfor(int i=mid; i< a.length;i++) {\r\n \t\t\tright[i-mid]=a[i];\r\n \t\t}\r\n \t\tmergeSortIterative(left);\r\n \t\tmergeSortIterative(right);\r\n \t\tint i=0;\r\n \t\tint j=0;\r\n \t\tint k=0;\r\n \t\t//Merge left and right arrays\r\n \t\twhile(i<left.length && j<right.length) {\r\n \t\t\tif(left[i]<right[j]) {\r\n \t\t\t\ta[k]=left[i];\r\n \t\t\t\ti++;\r\n \t\t\t}else {\r\n \t\t\t\ta[k]=right[j];\r\n \t\t\t\tj++;\r\n \t\t\t}\r\n \t\t\tk++;\r\n \t\t}\r\n \t\t//Collect remaining elements\r\n \t\twhile(i<left.length) {\r\n \t\t\ta[k]=left[i];\r\n \t\t\ti++;\r\n \t\t\tk++;\r\n \t\t}\r\n \t\twhile(j<right.length) {\r\n \t\t\ta[k]=right[j];\r\n \t\t\tj++;\r\n \t\t\tk++;\r\n \t\t}\r\n \t}\r\n\r\n \treturn a;\r\n }", "public static IntList mergeSort(IntList input) {\n\t\tif (input.length() <= 1)\n\t\t\treturn input;\n\t\tIntList part1 = new SimpleIntList();\n\t\tIntList part2 = new SimpleIntList();\n\t\tdivide(input,part1,part2);\n\t\tpart1 = mergeSort(part1);\n\t\tpart2 = mergeSort(part2);\n\t\treturn merge(part1,part2);\n\t}", "public void mergeSort() throws Exception{\n\t\tif(this.qtd<=1)\n\t\t\tthrow new Exception(\"Nada para ordenar\");\n\t\tthis.sort(0,this.qtd-1);\n\t}", "public static void mergeSort(int[] elts) {\r\n\t\tint size = elts.length;\r\n\t\tif (size == 2) {\r\n\t\t\tif (elts[0] > elts[1])\r\n\t\t\t\tIntArraySortUtils.swap(elts, 0, 1);\r\n\t\t}\r\n\t\telse if (size > 2) {\r\n\t\t\tPair<int[], int[]> split = splitArray(elts);\r\n\t\t\tint[] left = split.first;\r\n\t\t\tint[] right = split.second;\r\n\t\t\tmergeSort(left);\r\n\t\t\tmergeSort(right);\r\n\t\t\tIntArraySortUtils.merge(elts, left, right);\r\n\t\t}\r\n\r\n\t}", "public void sortRecursively() {\n\t\tif (!this.isEmpty()) {\n\t\t\tT x = this.peek();\n\t\t\tthis.pop();\n\t\t\tsortRecursively();\n\t\t\tinsertInOrder(x);\n\t\t} else\n\t\t\treturn;\n\t}", "private void recMergeSort(final long[] workSpace, final int lowerBound,\n final int upperBound) {\n if (lowerBound == upperBound) // if range is 1,\n return; // no use sorting\n else { // find midpoint\n final int mid = (lowerBound + upperBound) / 2;\n // sort low half\n recMergeSort(workSpace, lowerBound, mid);\n // sort high half\n recMergeSort(workSpace, mid + 1, upperBound);\n // merge them\n merge(workSpace, lowerBound, mid + 1, upperBound);\n } // end else\n }", "static void mergeSort(int[] arr, int l, int r) {\n\t\tif (l<r) {\n\t\t\tint m = (l+r)/2;\n\n\t\t\tmergeSort(arr, l, m);\n\t\t\tmergeSort(arr, m+1, r);\n\t\t\tmerge(arr, l, r, m);\n\t\t}\n\t}", "public void merge(paintIntegers[] arr, int lidx, int midx, int ridx){\n int leftn = midx - lidx + 1;\n int rightn = ridx - midx;\n\n //instantiating the left and right arrays\n int Left[] = new int [leftn];\n int Right[] = new int [rightn];\n\n //copies the data from original to the left and right\n for (int i=0; i < leftn; ++i) {\n Left[i] = arr[lidx + i].val;\n }\n for (int j=0; j < rightn; ++j) {\n Right[j] = arr[midx + 1 + j].val;\n }\n\n //merges the two arrays and updates the original array\n //initializes leftIndex and rightIndex to iterate over the left and right arrays\n //if it is added to the original array, then where it came from, it would increment\n int leftIndex = 0;\n int rightIndex = 0;\n int k = lidx; //to properly align where the elements to go, left\n //System.out.println(k);\n //while it hasnt gone through all the elements in the left and right array\n //between the two arrays check which one is lowest, and then updates original array\n while (leftIndex < leftn && rightIndex < rightn)\n {\n if (Left[leftIndex] <= Right[rightIndex])\n {\n arr[k].val = Left[leftIndex];\n sorting.add(paintIntegers.deepCopy(arr));//adds current array to list\n leftIndex++;\n }\n else\n {\n arr[k].val = Right[rightIndex];\n sorting.add(paintIntegers.deepCopy(arr));//adds current array to list\n rightIndex++;\n }\n k++;\n }\n //if there are some left on the left array then just adds to original array\n //possible because all the elements in right array have been added\n //all thats left is the sorted elements from the left array\n while (leftIndex < leftn)\n {\n arr[k].val = Left[leftIndex];\n sorting.add(paintIntegers.deepCopy(arr));//adds current array to list\n leftIndex++;\n k++;\n }\n //same explanation as above but with the right array\n while (rightIndex < rightn)\n {\n arr[k].val = Right[rightIndex];\n sorting.add(paintIntegers.deepCopy(arr));//adds current array to list\n rightIndex++;\n k++;\n }\n }", "public static void mergesort(int[]data){\n if (data.length <= 1)\n return;\n mergesortH(data, 0, data.length - 1);\n \n }", "@Test(timeout = SHORT_TIMEOUT)\n public void testTinyMergeSort() {\n //size-0 arr\n toSort = new IntPlus[0];\n sortedInts = cloneArr(toSort);\n Sorting.mergeSort(sortedInts, comp);\n\n assertArrayEquals(toSort, sortedInts); //Sort can't rearrange anything\n\n //size-1 arr\n toSort = new IntPlus[1];\n toSort[0] = new IntPlus(42);\n sortedInts = cloneArr(toSort);\n Sorting.mergeSort(sortedInts, comp);\n\n assertArrayEquals(toSort, sortedInts); //Sort can't rearrange anything\n }", "public void mergesort(int[] a, int startI, int endI) {\n\t\t\n\t\t//int si= a.length-1;\n\t\tint [] val = new int[1];\n\t\tint midPoint;\n\t\tlong heapSize = Runtime.getRuntime().totalMemory();\n\t\tlong heapFreeSize = Runtime.getRuntime().freeMemory(); \n\t\t//System.out.println(\"current heap size \"+heapsize);\n\t\tmidPoint = (endI+startI)/2; //midpoint for array\n\t\t\n\t\tif(heapFreeSize<1212015976)\n\t\tSystem.out.println(\"Start: \"+startI+\" End: \"+endI+\" Mid: \"+midPoint+\" current heap size \"+heapSize+\" current free heap \"+heapFreeSize);\n\t\tif (endI-startI < 1) {\n\t\t\tval[0]=a[startI];\n\t\t\t//System.out.println(\"returning \"+val[0]);\n\t\t\treturn ;\n\t\t}\n\t\t/*try\n\t\t{\n\t\t Thread.sleep(3000);\n\t\t}\n\t\tcatch(InterruptedException ex)\n\t\t{\n\t\t Thread.currentThread().interrupt();\n\t\t}*/\n\t\n\t\tmergesort(a, startI, midPoint); //split left\n\t\t\n\t\t\n\t\t//System.out.println(\"Start 2: \"+startI+\" End: \"+endI+\" Mid: \"+midPoint);\n\t\tmergesort(a, midPoint+1, endI);\t\t//split right\n\t\ttemp=mergeSortedArrays(a, startI, midPoint, midPoint+1, endI); //by defining positions in array, we are taking out array slices\n\t\t/*for (int i=0;i<temp.length;i++) {\n\t\t\ta[i]=temp[i];\n\t\t}*/\n\t\t/*System.out.println(\"Printing Temp=>\");\n\t\t\n\t\tfor (int i=0;i<temp.length;i++) {\n\t\t\tSystem.out.print(temp[i]+\", \");\n\t\t}\n\t\tSystem.out.println(\"\\n Printing A=>\");\n\t\t\n\t\tfor (int i=startI;i<endI;i++) {\n\t\t\tSystem.out.print(a[i]+\", \");\n\t\t}\n\t\tSystem.out.println(\"==>\");\n\t\treturn a;*/\n\t\t\n\t\t//System.out.println(\"==>\");\n\t\tint fill = startI;\n\t\tfor (int i=0;i<temp.length;i++) {\n\t\t\ta[fill]=temp[i];\n\t\t\tfill++;\n\t\t}\n\t\treturn ;\n\t}", "@SuppressWarnings(\"squid:S2259\")\n private void mergeInto(RootListNode<K> head, RootListNode<K> tail) {\n // if root list empty, just copy\n if (rootList.head == null) {\n rootList.head = head;\n rootList.tail = tail;\n return;\n }\n\n // initialize\n RootListNode<K> resultHead;\n RootListNode<K> resultTail;\n RootListNode<K> resultTailPrev = null;\n RootListNode<K> cur1 = rootList.head;\n RootListNode<K> cur2 = head;\n\n // add first node\n if (cur1.root.rank <= cur2.root.rank) {\n resultHead = cur1;\n resultTail = cur1;\n RootListNode<K> cur1next = cur1.next;\n cur1.next = null;\n cur1 = cur1next;\n if (cur1next != null) {\n cur1next.prev = null;\n }\n } else {\n resultHead = cur2;\n resultTail = cur2;\n RootListNode<K> cur2next = cur2.next;\n cur2.next = null;\n cur2 = cur2next;\n if (cur2next != null) {\n cur2next.prev = null;\n }\n }\n\n // merge\n int rank1; \n int rank2;\n while (true) {\n int resultRank = resultTail.root.rank;\n\n // read rank1\n if (cur1 != null) {\n rank1 = cur1.root.rank;\n } else {\n if (cur2 != null && cur2.root.rank <= resultRank) {\n rank1 = Integer.MAX_VALUE;\n } else {\n break;\n }\n }\n\n // read rank2\n if (cur2 != null) {\n rank2 = cur2.root.rank;\n } else {\n if (cur1 != null && cur1.root.rank <= resultRank) {\n rank2 = Integer.MAX_VALUE;\n } else {\n break;\n }\n }\n\n if (rank1 <= rank2) {\n switch (Integer.compare(rank1, resultRank)) {\n case 0:\n // combine into result\n resultTail.root = combine(cur1.root, resultTail.root);\n // remove cur1\n RootListNode<K> cur1next = cur1.next;\n cur1.next = null;\n if (cur1next != null) {\n cur1next.prev = null;\n }\n cur1 = cur1next;\n break;\n case -1:\n // can happen if three same ranks\n cur1next = cur1.next;\n // add before tail into result\n cur1.next = resultTail;\n resultTail.prev = cur1;\n cur1.prev = resultTailPrev;\n if (resultTailPrev != null) {\n resultTailPrev.next = cur1;\n } else {\n resultHead = cur1;\n }\n resultTailPrev = cur1;\n // advance cur1\n if (cur1next != null) {\n cur1next.prev = null;\n }\n cur1 = cur1next;\n break;\n case 1:\n // append into result\n resultTail.next = cur1;\n cur1.prev = resultTail;\n resultTailPrev = resultTail;\n resultTail = cur1;\n // remove cur1\n cur1 = cur1.next;\n resultTail.next = null;\n if (cur1 != null) {\n cur1.prev = null;\n }\n break;\n default:\n break;\n }\n } else {\n // symmetric case rank2 < rank1\n switch (Integer.compare(rank2, resultRank)) {\n case 0:\n // combine into result\n resultTail.root = combine(cur2.root, resultTail.root);\n // remove cur2\n RootListNode<K> cur2next = cur2.next;\n cur2.next = null;\n if (cur2next != null) {\n cur2next.prev = null;\n }\n cur2 = cur2next;\n break;\n case -1:\n // can happen if three same ranks\n cur2next = cur2.next;\n // add before tail into result\n cur2.next = resultTail;\n resultTail.prev = cur2;\n cur2.prev = resultTailPrev;\n if (resultTailPrev != null) {\n resultTailPrev.next = cur2;\n } else {\n resultHead = cur2;\n }\n resultTailPrev = cur2;\n // advance cur2\n if (cur2next != null) {\n cur2next.prev = null;\n }\n cur2 = cur2next;\n break;\n case 1:\n // append into result\n resultTail.next = cur2;\n cur2.prev = resultTail;\n resultTailPrev = resultTail;\n resultTail = cur2;\n // remove cur2\n cur2 = cur2.next;\n resultTail.next = null;\n if (cur2 != null) {\n cur2.prev = null;\n }\n break;\n default: \n break;\n }\n\n }\n }\n\n // record up to which point a suffix minimum update is needed\n RootListNode<K> updateSuffixFix = resultTail;\n\n // here rank of cur1 is more than result rank\n if (cur1 != null) {\n cur1.prev = resultTail;\n resultTail.next = cur1;\n resultTail = rootList.tail;\n }\n\n // here rank of cur2 is more than result rank\n if (cur2 != null) {\n cur2.prev = resultTail;\n resultTail.next = cur2;\n resultTail = tail;\n }\n\n // update suffix minimum\n updateSuffixMin(updateSuffixFix);\n\n // store final list\n rootList.head = resultHead;\n rootList.tail = resultTail;\n }", "public static void mergeSort(int start, int end, int[] numbers) {\n int mid = (start + end) / 2;\n\n if (start < end) {\n // sort left half\n mergeSort(start, mid, numbers);\n\n // sort right half\n mergeSort(mid + 1, end, numbers);\n\n // merge\n merge(start, mid, end, numbers);\n }\n }", "public void mergeSort() {\n this.array = mergeSort(array);\n }", "private int[] mergeSort(int[] nums, int start, int end) {\n if (start == end) {\n return new int[]{nums[start]};\n }\n\n // keep dividing the entire array into sub-arrays\n int mid = (end - start) / 2 + start;\n int[] left = mergeSort(nums, start, mid);\n int[] right = mergeSort(nums, mid + 1, end);\n // return merged array\n return mergeTwoSortedArrays(left, right);\n }", "private static <T extends Comparable,S> void mergeSort(T[] src, S[] src2,\n\t\t\tT[] dest,\n\t\t\tS[] dest2,\n\t\t\tint low,\n\t\t\tint high,\n\t\t\tint off) {\n\t\tint length = high - low;\n\n\t\t// Insertion sort on smallest arrays\n\t\tif (length < INSERTIONSORT_THRESHOLD) {\n\t\t\tfor (int i=low; i<high; i++)\n\t\t\t\tfor (int j=i; j>low &&\n\t\t\t\t\t\tdest[j-1].compareTo(dest[j])>0; j--)\n\t\t\t\t\tswap(dest,dest2, j, j-1);\n\t\t\treturn;\n\t\t}\n\n\t\t// Recursively sort halves of dest into src\n\t\tint destLow = low;\n\t\tint destHigh = high;\n\t\tlow += off;\n\t\thigh += off;\n\t\tint mid = (low + high) >>> 1;\n\t\tmergeSort(dest, dest2, src, src2,low, mid, -off);\n\t\tmergeSort(dest, dest2, src, src2, mid, high, -off);\n\n\t\t// If list is already sorted, just copy from src to dest. This is an\n\t\t// optimization that results in faster sorts for nearly ordered lists.\n\t\tif (src[mid-1].compareTo(src[mid]) <= 0) {\n\t\t\tSystem.arraycopy(src, low, dest, destLow, length);\n\t\t\tSystem.arraycopy(src2, low, dest2, destLow, length);\n\t\t\treturn;\n\t\t}\n\n\t\t// Merge sorted halves (now in src) into dest\n\t\tfor(int i = destLow, p = low, q = mid; i < destHigh; i++) {\n\t\t\tif (q >= high || p < mid && src[p].compareTo(src[q])<=0) {\n\t\t\t\tdest2[i] = src2[p];\n\t\t\t\tdest[i] = src[p++];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdest2[i] = src2[q];\n\t\t\t\tdest[i] = src[q++];\n\t\t\t}\n\t\t}\n\t}", "public void mergeSort(){\r\n mergeSort(mArray, new int[mArray.length], 0 , mArray.length - 1);\r\n }", "private PerfectMergeSort() {}", "public static void mergeSort(int[] array, int start, int end) {\n // start = 0\n // end = array.length\n // mid = (start + end) / 2\n\n // Base case: break recursion if there are less than 2 elements in the array - 1 or 0 elements\n if (end - start < 2) {\n return;\n }\n\n // Logical partition of the array\n int mid = (start + end) / 2;\n\n // Recursive calls\n mergeSort(array, start, mid); // mergeSort left partition\n mergeSort(array, mid, end); // mergeSort right partition\n\n // Finally merge the sorted arrays. \n // By the time this method is called, left and right partitions are already handled.\n merge(array, start, mid, end);\n }", "private void runMerge(double[] heights, int numberOfThreads, List<List<Integer>> starts, List<List<List<double[]>>> animations) {\n // A counter to keep track of the time level\n int inc = 0;\n\n while(numberOfThreads >= 1) {\n // Each round of merging occurs at separate separate time levels\n List<List<double[]>> timeLevel = new ArrayList<List<double[]>>();\n animations.add(timeLevel);\n\n // Each time level has a different set of sorted sections\n List<Integer> startLevel = new ArrayList<Integer>();\n startLevel.add(0);\n starts.add(startLevel);\n\n List<Integer> currentStartLevel = starts.get(inc);\n\n // Executing merge for the current time level and generating the corresponding animations\n for(int iteration = 0; iteration < currentStartLevel.size() - 1; iteration += 2) {\n List<double[]> location = new ArrayList<double[]>();\n timeLevel.add(location);\n\n int startIndex = currentStartLevel.get(iteration);\n int middleIndex = currentStartLevel.get(iteration + 1) - 1;\n int endIndex;\n\n if(iteration == currentStartLevel.size() - 2) {\n endIndex = arrSize - 1;\n } else {\n endIndex = currentStartLevel.get(iteration + 2) - 1;\n startLevel.add(endIndex + 1);\n }\n\n MergeSort.merge(heights, startIndex, middleIndex, endIndex, location);\n }\n\n inc++;\n\n // The number of separately sorted sections is halved after ever stage of sorting\n numberOfThreads /= 2;\n }\n }", "private static void merge(int[] nums, int[] work, int start, int mid, int end){\n\t\tboolean loop = true;\n\t\tint counter1 = start;\n\t\tint counter2 = mid+1;\n\t\tint workCounter = start;\n\t\t\n\t\twhile(loop){\n\t\t\tif(counter1 > mid){\n\t\t\t\t// Copy all elements from 2nd end to work\n\t\t\t\tfor(int i=counter2; i<=end; i++)\n\t\t\t\t\twork[workCounter++] = nums[i];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tif(counter2 > end){\n\t\t\t\t// Copy all elements from start-mid to work\n\t\t\t\tfor(int i=counter1; i<=mid; i++)\n\t\t\t\t\twork[workCounter++] = nums[i];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t// Swap the number if the numbers in are not is sorted order\n\t\t\tif(nums[counter1] < nums[counter2]){\n\t\t\t\twork[workCounter] = nums[counter1]; \n\t\t\t\tcounter1++;\n\t\t\t}else{\n\t\t\t\twork[workCounter] = nums[counter2]; \n\t\t\t\tcounter2++;\n\t\t\t}\n\t\t\t\n\t\t\tworkCounter++;\n\t\t}\n\t\t\n\t\t// Copy the sorted work array into main array\n\t\tfor(int i=start; i <= end; i++)\n\t\t\tnums[i] = work[i];\n\t}", "public void mergeSort(Comparable[] input) {\n\t\t\n\t\t// check if input array is null\n\t\tif (input == null)\n\t\t\tthrow new IllegalArgumentException(\"Input array cannot be null!\");\n\t\t\n\t\t// if input array is empty or contains only 1 element - there's no need to sort\n\t\tif (input.length < 2)\n\t\t\treturn;\n\t\t\n\t\t// set up environment\n\t\tsetUp(input);\n\t\t\n\t\t// variable to store final result list\n\t\tint list;\n\t\twhile (true) {\n\t\t\t\n\t\t\t// poll two lists from queue\n\t\t\tint list1 = poll();\n\t\t\tint list2 = poll();\n\t\t\t\n\t\t\t// merge them and save result into created variable\n\t\t\tlist = merge(list1, list2);\n\t\t\t\n\t\t\t// if queue is empty - there's nothing else to merge - break loop\n\t\t\tif (isEmpty())\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t// if queue is not empty - add merged list to it\n\t\t\tadd(list);\n\t\t}\n\t\t\n\t\t// write result\n\t\twriteBack(input, list);\n\t}", "public static int mergeSort(Integer[] arr, Integer[] aux, int low, int high)\n {\n // Base case\n if (high == low) { // if run size == 1\n return 0;\n }\n\n // find mid point\n int mid = (low + ((high - low) >> 1));\n int inversionCount = 0;\n\n // recursively split runs into two halves until run size == 1,\n // then merge them and return back up the call chain\n\n // split / merge left half\n inversionCount += mergeSort(arr, aux, low, mid);\n\n // split / merge right half\n inversionCount += mergeSort(arr, aux, mid + 1, high);\n\n // merge the two half runs\n inversionCount += merge(arr, aux, low, mid, high);\n\n return inversionCount;\n }", "private void merge_sort( ArrayList<Type> array, ArrayList<Type> auxillary, int low, int high ){\n\t\tif((high-low)>switchOff){\n\t\t\tint middle=low+((high-low)/2);\n\t\t\tmerge_sort(array,auxillary,low,middle);\n\t\t\tmerge_sort(array,auxillary,middle+1,high);\n\t\t\tcombine(array,auxillary,low,middle,high);\n\t\t}else{\n\t\t\tSort_Utils.insertion_sort(array, low, high);\n\t\t}\n\t}", "static void merge(int arr[], int l, int m, int r) \n { \n // Sizes of the two subarrays\n int size1 = m - l + 1; \n int size2 = r - m; \n \n // Temporary arrays\n int left[] = new int [size1]; \n int right[] = new int [size2]; \n \n // Copy over to temps\n for (int i=0; i<size1; ++i) \n left[i] = arr[l + i]; \n for (int j=0; j<size2; ++j) \n right[j] = arr[m + 1+ j]; \n \n \n // Initial indexes of first and second subarrays \n int i = 0, j = 0; \n \n // Initial index of merged subarry array \n int k = l; \n while (i < size1 && j < size2) \n { \n if (left[i] <= right[j]) \n { \n arr[k] = left[i]; \n i++; \n } \n else\n { \n arr[k] = right[j]; \n j++; \n } \n k++; \n } \n \n // Copy rest of arrays\n while (i < size1) \n { \n arr[k] = left[i]; \n i++; \n k++; \n } \n \n // For the other array\n while (j < size2) \n { \n arr[k] = right[j]; \n j++; \n k++; \n } \n }", "@Test\n public void sortArrayMergeSortTest() {\n int[] array1 = new int[]{5, 2, 3, 1};\n int[] expectedArray1 = new int[]{1, 2, 3, 5};\n int[] actualArray1 = sortArrayMergeSort(array1);\n assertArrayEquals(expectedArray1, actualArray1);\n /**\n * Example 2:\n * Input: nums = [5,1,1,2,0,0]\n * Output: [0,0,1,1,2,5]\n */\n int[] array2 = new int[]{5, 1, 1, 2, 0, 0};\n int[] expectedArray2 = new int[]{0, 0, 1, 1, 2, 5};\n int[] actualArray2 = sortArrayMergeSort(array2);\n assertArrayEquals(expectedArray2, actualArray2);\n }", "public static int[] bottomUpMergeSort(int[] num) {\n\n\t\tint[] temp = new int[num.length];\n\n\t\t// repeat merging process while width is smaller than length\n\t\tfor (int width = 2; width <= num.length; width *= 2) {\n\n\t\t\t// System.out.println(\"width = \" + width );\n\n\t\t\t// merge sublists\n\t\t\tfor (int i = 0; i < num.length; i += width)\n\t\t\t\tmergeLists(num, i, width, temp);\n\n\t\t\t// copy temp array back to original array\n\t\t\tfor (int i = 0; i < num.length; i++) {\n\t\t\t\tnum[i] = temp[i];\n\t\t\t\t// System.out.print(num[i] + \" \");\n\t\t\t}\n\n\t\t\t// System.out.println();\n\t\t\t// System.out.println();\n\t\t}\n\n\t\treturn num;\n\n\t}", "public static int[] mergeSort(int[] arr, int lo, int hi) {\n //write your code here\n if(lo < hi) {\n int mid = (lo+hi)/2;\n int[] lft = mergeSort(arr, lo, mid);\n int[] rgt = mergeSort(arr, mid+1, hi);\n int[] res = mergeTwoSortedArrays(lft, rgt);\n return res;\n }\n return new int[]{arr[lo]}; // if(lo==hi)\n}", "public static <T extends Comparable<? super T>> void mergeSort(List<T> list){\n if(list.size() > 1){\n mergeSort(list, 0, (list.size()/2), list.size() - 1, (T[])new Comparable[list.size()]);\n }\n }", "public static double[] mergeSortRecursive (double a[]) {\n if(a.length <= 1) return a;\n double temp [] = new double[a.length];\n mergeSortBottomUp(a, temp, 0, a.length-1);\n return a;\n }", "void merge_collapse() {\n while (this.n > 1) {\n int localN = this.n - 2;\n if (localN > 0 && this.len[localN-1] <= this.len[localN] + this.len[localN+1]) {\n if (this.len[localN-1] < this.len[localN+1])\n --localN;\n merge_at(localN);\n } else if (this.len[localN] <= this.len[localN+1]) {\n merge_at(localN);\n } else {\n break;\n }\n }\n }", "public ListNode mergeSortList(ListNode head) {\n \tif(head == null || head.next == null) return head;\n \t//递归的出口 空list或者 只有一个值的时候 直接返回 \n \tListNode mid=findMid(head); //找到中间值 \n \tListNode pointer=mid.next; //记录右边的开始\n \tmid.next=null; // 把list拆成两半 \n \tListNode part1=mergeSortList(head); //对前半部分mergeSort 并记录返回指针\n \tListNode part2=mergeSortList(pointer); //对后半部分mergeSort 并记录返回指针\n \treturn merge(part1, part2); //两部分再合并\n }", "public static void sort(int[] arr) {\n // Base Case\n if (arr.length == 1) return;\n\n // Splitting the array\n int midpoint = arr.length / 2;\n int[] left_arr = Arrays.copyOfRange(arr, 0, midpoint);\n int[] right_arr = Arrays.copyOfRange(arr, midpoint, arr.length);\n\n // Sorting the subarrays \n sort(left_arr);\n sort(right_arr);\n\n // Combining the subarrays\n int left_pointer = 0;\n int right_pointer = 0;\n /** \n * Check which array has smaller value then \n * assign it to sorted array\n */ \n while (left_pointer + right_pointer < arr.length) {\n // Left array has been traversed\n if (left_pointer >= left_arr.length) {\n arr[left_pointer + right_pointer] \n = right_arr[right_pointer];\n right_pointer++;\n }\n // Right array has been traversed\n else if (right_pointer >= right_arr.length) {\n arr[left_pointer + right_pointer]\n = left_arr[left_pointer];\n left_pointer++;\n }\n // Both arrays still have values.\n else {\n // Left array has smaller or equal value\n if (left_arr[left_pointer] <= right_arr[right_pointer]) { \n arr[left_pointer + right_pointer]\n = left_arr[left_pointer];\n left_pointer++;\n }\n // Right array has smaller value\n else {\n arr[left_pointer + right_pointer]\n = right_arr[right_pointer];\n right_pointer++;\n }\n }\n }\n // Array is sorted. Replace given array.\n }", "public void mergeSort(List<Integer> a, int n) {\n if (n < 2) {\n return;\n }\n int mid = n / 2;\n List<Integer> l = new LinkedList<Integer>();\n List<Integer> r = new LinkedList<Integer>();\n \n for (int i = 0; i < mid; i++) {\n l.add(a.get(i));\n }\n for (int i = mid; i < n; i++) {\n r.add(a.get(i));\n }\n mergeSort(l, mid);\n mergeSort(r, n - mid);\n \n merge(a, l, r, mid, n - mid);\n }", "void merge(int arr[], int l, int m , int r)\n {\n int n1 = m-l+1;\n int n2 = r-m;\n\n //create temp arrays\n int L[] = new int[n1];\n int R[] = new int[n2];\n\n //copy the elements to the array\n for(int i=0; i < n1 ;i++)\n L[i] = arr[l+i];\n for(int j=0; j < n2 ;j++)\n R[j] = arr[m+1+j];\n\n // Initial indexes of first and second subarrays\n int i = 0, j = 0;\n\n // Initial index of merged subarry array\n int k = l;\n\n while(i<n1 && j< n2)\n {\n if(L[i] <= R[j])\n {\n arr[k++] = L[i++];\n }\n else\n {\n arr[k++] = R[j++];\n }\n }\n\n while(i<n1)\n {\n arr[k++]=L[i++];\n }\n\n while(j<n2)\n {\n arr[k++]=R[j++];\n }\n\n }", "private static void mergeAsc(int arr[], int start, int mid, int end) {\n\r\n\t\tint subArrLen1 = mid - start + 1;\r\n\t\tint subArrLen2 = end - mid;\r\n\r\n\t\t// create the sub Arrays as temporary storage\r\n\t\tint subArray1[] = new int[subArrLen1];\r\n\t\tint subArray2[] = new int[subArrLen2];\r\n\r\n\t\t// copy data in temporary arrays\r\n\r\n\t\tfor (int i = 0; i < subArrLen1; i++) {\r\n\t\t\tsubArray1[i] = arr[start + i];\r\n\t\t}\r\n\r\n\t\tfor (int i = 0; i < subArrLen2; i++) {\r\n\t\t\tsubArray2[i] = arr[mid + i + 1];\r\n\t\t}\r\n\r\n\t\t// merging the temporary arrays\r\n\r\n\t\tint i = 0, j = 0;\r\n\t\tint k = start;\r\n\r\n\t\twhile (i < subArrLen1 && j < subArrLen2) {\r\n\t\t\tif (subArray1[i] <= subArray2[j]) {\r\n\t\t\t\tarr[k] = subArray1[i];\r\n\t\t\t\ti++;\r\n\t\t\t} else {\r\n\t\t\t\tarr[k] = subArray2[j];\r\n\t\t\t\tj++;\r\n\t\t\t}\r\n\t\t\tk++;\r\n\r\n\t\t}\r\n\r\n\t\t// copy left over elements of subArray2[]\r\n\t\twhile (i < subArrLen1) {\r\n\t\t\tarr[k] = subArray1[i];\r\n\t\t\ti++;\r\n\t\t\tk++;\r\n\t\t}\r\n\r\n\t\t// copy left over elements of subArray2[]\r\n\t\twhile (j < subArrLen2) {\r\n\t\t\tarr[k] = subArray2[j];\r\n\t\t\tj++;\r\n\t\t\tk++;\r\n\t\t}\r\n\r\n\t}", "public static <T extends Comparable<? super T>> void mergeSort(List<T> a){\n // create tmp array \n List<T> tmpArray = new ArrayList<>();\n for(int i = 0; i < a.size(); i++){\n tmpArray.add(null);\n }\n\n // call mergeSort method\n mergeSort(a, tmpArray, 0, a.size()-1);\n }", "private static void recursiveMergesort(\n\t\tint[] ints,\n\t\tint[] copyOfInts,\n\t\tint min,\n\t\tint max\n\t\t) {\n\n\t\tif (min < max - 1) {\n\t\t\tint middleOfArray = (max + min) / 2;\n\t\t\trecursiveMergesort(\n\t\t\t\tints,\n\t\t\t\tcopyOfInts,\n\t\t\t\tmin,\n\t\t\t\tmiddleOfArray\n\t\t\t\t);\n\t\t\trecursiveMergesort(\n\t\t\t\tints,\n\t\t\t\tcopyOfInts,\n\t\t\t\tmiddleOfArray,\n\t\t\t\tmax);\n\t\t\tmergeHalves(\n\t\t\t\tints,\n\t\t\t\tcopyOfInts,\n\t\t\t\tmin,\n\t\t\t\tmiddleOfArray,\n\t\t\t\tmax);\n\t\t}\n\t\t// if min == max - 1, then this range\n\t\t// of ints only contains one int\n\n\t}", "public static <T extends Comparable<? super T>> void mergeSort(List<T> a,\n List<T> tmpArray, int low, int high){\n // base case if high - low < 1 then already sorted\n if(high - low < 1){\n return;\n }\n\n // else split array and sort each half and then merge the halves back together\n int center = (low + high)/2;\n mergeSort(a, tmpArray, low, center);\n mergeSort(a, tmpArray, center + 1, high);\n merge(a, tmpArray, low, high);\n }", "public static void mergesort_helper(Value[] arr, int low, int high) {\r\n // Base case: the sub-array has length 0 or 1.\r\n // (void methods can return, they just don't return anything)\r\n if (high - low <= 1) {\r\n StdDraw.clear();\r\n arr[0].draw(0.5, 0);\r\n StdAudio.play(arr[0].getSound());\r\n } else {\r\n // Prepare for the recursive calls\r\n // Find the mid-point to \"split\" the sub-array in two \"halves\"\r\n int mid = low + (high - low) / 2;\r\n // Recursive calls / \"Divide\" phase\r\n // Sort the two \"halves\" recursively\r\n mergesort_helper(arr, low, mid);\r\n mergesort_helper(arr, mid, high);\r\n // \"Conquer\" phase: merge the sorted sub-arrays.\r\n merge(arr, low, high);\r\n }\r\n double x = 0.5;\r\n StdDraw.clear();\r\n StdDraw.setPenColor(StdDraw.BLUE);\r\n StdDraw.filledSquare(arr.length / 2, arr.length / 2, arr.length / 2);\r\n for (int i = 0; i < arr.length; i++) {\r\n if (i < high && i > low) {\r\n StdDraw.setPenColor(StdDraw.YELLOW);\r\n } else {\r\n StdDraw.setPenColor(StdDraw.GREEN);\r\n }\r\n arr[i].draw(x, 0);\r\n StdAudio.play(arr[i].getSound());\r\n x += 1;\r\n }\r\n }", "public void sort(){\n\t\t\n\t\tif(Q.size() != 1){\n\t\t\tArrayQueue<E> tempQueue1 = Q.dequeue();\n\t\t\tArrayQueue<E> tempQueue2 = Q.dequeue();\n\t\t\tArrayQueue<E> tempQueue3 = merge(tempQueue1, tempQueue2);\n\t\t\tQ.enqueue(tempQueue3);\n\t\t\tsort();\n\t\t}\n\t\t\n\t}", "public static void mergesort(ArrayList<Score> items, int start, int end) {\r\n if (start < end) {\r\n int mid = (start + end) / 2;\r\n mergesort(items, start, mid);\r\n mergesort(items, mid + 1, end);\r\n merge(items, start, mid, end);\r\n }\r\n }", "static void MergeSort(int[] arr){\n int[] helper = new int[arr.length];\n MergeSort(arr, helper, 0, arr.length-1);\n }", "static void sort(int arr[], int l, int r) \n { \n if (l < r) \n { \n // Find middle \n int m = (l+r)/2; \n \n // Sort both halves\n sort(arr, l, m); \n sort(arr , m+1, r); \n \n // Merge both halves after they have been sorted \n merge(arr, l, m, r); \n } \n }", "public List<Integer> mergeSort(List<Integer> list) {\n if (list.size() < 2) {\n return list;\n }\n\n int middle = list.size() / 2;\n\n SortingsZlatopolsky algorithms = new SortingsZlatopolsky();\n\n return merge(algorithms.mergeSort(list.subList(0, middle)),\n algorithms.mergeSort(list.subList(middle, list.size())));\n }", "private void mergeSubArr(int lowerIndex, int middle, int higherIndex) {\n \t\n \tArrayList tempMergArr = new ArrayList();\n \t\n \t\n \tfor (int i = 0; i < lowerIndex; i++){\n \t\ttempMergArr.add(i, 0);\n \t} \t\n \t\n for (int i = lowerIndex; i <= higherIndex; i++) {\n tempMergArr.add(i, (int)unsorted.get(i));\n }\n \n int i = lowerIndex;\n int j = middle + 1;\n int l = lowerIndex;\n while (i <= middle && j <= higherIndex) {\n if ((int)tempMergArr.get(i) <= (int)tempMergArr.get(j)) {\n unsorted.set(l, tempMergArr.get(i));\n i++;\n } else {\n unsorted.set(l, tempMergArr.get(j));\n j++;\n }\n l++;\n }\n while (i <= middle) {\n unsorted.set(l, tempMergArr.get(i));\n l++;\n i++;\n }\n while (j <= middle) {\n \tunsorted.set(l, tempMergArr.get(j));\n \tl++;\n \ti++;\n }\n\n \n }", "private static <K> void mergeSortHelper(K[] S, Comparator<K> comp, long timeGiven, long startTime) throws TimedOutException {\n if (System.currentTimeMillis() - startTime > timeGiven) {\n throw new TimedOutException(\"TimeOut\");\n }\n int n = S.length;\n if (n < 2) return; // array is trivially sorted\n // divide\n int mid = n / 2;\n K[] S1 = Arrays.copyOfRange(S, 0, mid); // copy of first half\n K[] S2 = Arrays.copyOfRange(S, mid, n); // copy of second half\n // conquer (with recursion)\n mergeSortHelper(S1, comp, timeGiven, startTime); // sort copy of first half\n mergeSortHelper(S2, comp, timeGiven, startTime); // sort copy of second half\n // merge results\n merge(S1, S2, S, comp, timeGiven, startTime); // merge sorted halves back into original\n \n }", "public void mergesort()\n { sort(this.heap, 0, heap.size()-1);\n }", "private static <T,S>void mergeSort(T[] src,S[] src2,\n\t\t\tT[] dest,\n\t\t\tS[] dest2,\n\t\t\tint low, int high, int off,\n\t\t\tComparator c) {\n\t\tint length = high - low;\n\n\t\t// Insertion sort on smallest arrays\n\t\tif (length < INSERTIONSORT_THRESHOLD) {\n\t\t\tfor (int i=low; i<high; i++)\n\t\t\t\tfor (int j=i; j>low && c.compare(dest[j-1], dest[j])>0; j--) \n\t\t\t\t\tswap(dest,dest2,j, j-1);\n\t\t\treturn;\n\t\t}\n\n\t\t// Recursively sort halves of dest into src\n\t\tint destLow = low;\n\t\tint destHigh = high;\n\t\tlow += off;\n\t\thigh += off;\n\t\tint mid = (low + high) >>> 1;\n\t\t\tmergeSort(dest,dest2, src, src2,low, mid, -off, c);\n\t\t\tmergeSort(dest,dest2, src, src2, mid, high, -off, c);\n\n\t\t\t// If list is already sorted, just copy from src to dest. This is an\n\t\t\t// optimization that results in faster sorts for nearly ordered lists.\n\t\t\tif (c.compare(src[mid-1], src[mid]) <= 0) {\n\t\t\t\tSystem.arraycopy(src, low, dest, destLow, length);\n\t\t\t\tSystem.arraycopy(src2, low, dest2, destLow, length);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Merge sorted halves (now in src) into dest\n\t\t\tfor(int i = destLow, p = low, q = mid; i < destHigh; i++) {\n\t\t\t\tif (q >= high || p < mid && c.compare(src[p], src[q]) <= 0) {\n\t\t\t\t\tdest2[i] = src2[p];\n\t\t\t\t\tdest[i] = src[p++];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tdest2[i] = src2[q];\n\t\t\t\t\tdest[i] = src[q++];\n\t\t\t\t}\n\t\t\t}\n\t}", "public static int[] mergeklists(int[] l1, int[] l2, int[] l3, int size){\r\n\t\t//what i can do\r\n\t\t//put everything into one array using a for loop\r\n\t\t//then bubble sort it\r\n\t\t//BUBBLES\r\n\t\tint[] arry = new int[size];\r\n\t\tint temp = 0;\r\n\t\tint i = 0;\r\n\t\twhile (temp < size){\r\n\t\t\tif (i < l1.length-1){\r\n\t\t\t\tarry[temp] = l1[i];\r\n\t\t\t\ttemp++;\r\n\t\t\t}\r\n\t\t\tif (i < l2.length-1){\r\n\t\t\t\tarry[temp] = l2[i];\r\n\t\t\t\ttemp++;\r\n\t\t\t}\r\n\t\t\tif (i < l3.length-1){\r\n\t\t\t\tarry[temp] = l3[i];\r\n\t\t\t\ttemp++;\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t\t//BUBBLES\r\n\t\tboolean bubble = true;\r\n\t\tint bub = 0;\r\n\t\twhile (bubble){\r\n\t\t\tbubble = false;\r\n\t\t\tfor (int j = 0; j < size - 1; j++){\r\n\t\t\t\tif (arry[j] > arry[j+1]){\r\n\t\t\t\t\tbub = arry[j];\r\n\t\t\t\t\tarry[j] = arry[j+1];\r\n\t\t\t\t\tarry[j+1] = bub;\r\n\t\t\t\t\tbubble = true;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn arry;\r\n\t}", "private static void mergesort(String[] arr, int s, int e) {\n\t\tint len = e - s;\r\n\t\tif (len > 1) {\r\n\t\t\tint mid = (s + e) / 2;\r\n\t\t\tmergesort(arr, s, mid);\r\n\t\t\tmergesort(arr, mid, e);\r\n\t\t\tmerge(arr, s, mid, e);\r\n\t\t}\r\n\t}", "public int[] mergeSort(int[] nums) {\n\t\tif(nums.length<=1) return nums;\n\t\t\n\t\tint mid=nums.length/2;\n\t\tint[] numsA=Arrays.copyOfRange(nums,0,mid);\n\t\tint[] numsB=Arrays.copyOfRange(nums,mid,nums.length);\n\t\t\n\t\treturn merge(mergeSort(numsA),mergeSort(numsB));\n\t\t\n\t}", "static void MergeSort(int[] A, int p, int r) {\n\t\tif (p < r) {\n\t\t\tint q = (p + r) / 2;\n\t\t\tMergeSort(A, p, q);\n\t\t\tMergeSort(A, q + 1, r);\n\t\t\tMerge(A, p, q, r);\n\t\t}\n\t}", "private static void merge(ArrayList<Integer> leftList, ArrayList<Integer> rightList, ArrayList<Integer> outList) {\n\n int leftIndex = 0;\n int rightIndex = 0;\n int outIndex = 0;\n\n while (leftIndex < leftList.size() && rightIndex < rightList.size()) {\n\n if (leftList.get(leftIndex).compareTo(rightList.get(rightIndex)) <= 0) {\n outList.set(outIndex, leftList.get(leftIndex));\n leftIndex++;\n } else {\n outList.set(outIndex, rightList.get(rightIndex));\n rightIndex++;\n }\n\n outIndex++;\n\n }\n\n if (leftIndex < leftList.size()) {\n copyRemainder(leftList, leftIndex, outList, outIndex);\n } else {\n copyRemainder(rightList, rightIndex, outList, outIndex);\n }\n\n }", "public static int[] mergeSort2(int[] input) {\n\t\tint[] result = input.clone();\n\t\tif (result.length < 2) return result;\n\t\t\n\t\t/* \n\t\t * By iterating over the length of sub-arrays (from 1 to total length), \n\t\t * and then iterating through the sub-arrays at each stage, two nested\n\t\t * loops can be used to replicate the effect of a recursive call without\n\t\t * explicitly recursing\n\t\t */\n\t\tfor (int subArrayLength = 1; subArrayLength < result.length; subArrayLength *= 2) {\n\t\t\t\n\t\t\tfor (int startIndex = 0; startIndex < result.length + subArrayLength; startIndex += 2 * subArrayLength) {\n\t\t\t\tif (startIndex + subArrayLength < result.length) {\n\t\t\t\t\tint rightArrayLength = Math.min(subArrayLength, result.length - (startIndex + subArrayLength)); \n\t\t\t\t\tint[] left = new int[subArrayLength];\n\t\t\t\t\tint[] right = new int[rightArrayLength];\n\t\t\t\t\tSystem.arraycopy(result, startIndex, left, 0, subArrayLength);\n\t\t\t\t\tSystem.arraycopy(result, startIndex + subArrayLength, right, 0, rightArrayLength);\n\t\t\t\t\tint[] mergeResult = merge1(left, right);\n\t\t\t\t\tSystem.arraycopy(mergeResult, 0, result, startIndex, subArrayLength + rightArrayLength);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "public void sort() {\n if(c==null) {\n int middle;\n\n Comparable[] left, right;\n\n\n if (unsorted.length <= 1) {\n\n sorted = unsorted;\n\n } else {\n\n middle = unsorted.length / 2;\n\n\n left = new Comparable[middle];\n\n right = new Comparable[unsorted.length - middle];\n\n\n System.arraycopy(unsorted, 0, left, 0, middle);\n\n System.arraycopy(unsorted, middle, right, 0, unsorted.length - middle);\n\n\n // Внимание! Опа, рекурсия :)\n\n SimpleMerger leftSort = new SimpleMerger(left, c);\n\n SimpleMerger rightSort = new SimpleMerger(right,c);\n\n\n leftSort.sort();\n\n rightSort.sort();\n\n\n sorted = merge(leftSort.getSorted(), rightSort.getSorted());\n\n }\n }else{\n\n int middle;\n\n Object[] left, right;\n\n\n if (unsorted2.length <= 1) {\n\n sorted2 = unsorted2;\n\n } else {\n\n middle = unsorted2.length / 2;\n\n\n left = new Object[middle];\n\n right = new Object[unsorted2.length - middle];\n System.arraycopy(unsorted2, 0, left, 0, middle);\n\n System.arraycopy(unsorted2, middle, right, 0, unsorted2.length - middle);\n\n\n\n\n SimpleMerger leftSort = new SimpleMerger(left,c);\n\n SimpleMerger rightSort = new SimpleMerger(right,c);\n\n\n leftSort.sort();\n\n rightSort.sort();\n\n\n\n sorted2 = merge2(leftSort.getSorted2(), rightSort.getSorted2());\n\n }\n\n }\n }", "private static void mergeDesc(int arr[], int start,int mid, int end) {\n\r\n\t\t\t\tint subArrLen1 = mid - start + 1;\r\n\t\t\t\tint subArrLen2 = end - mid;\r\n\r\n\t\t\t\t// create the sub Arrays as temporary storage\r\n\t\t\t\tint subArray1[] = new int[subArrLen1];\r\n\t\t\t\tint subArray2[] = new int[subArrLen2];\r\n\r\n\t\t\t\t// copy data in temporary arrays\r\n\r\n\t\t\t\tfor (int i = 0; i < subArrLen1; i++) {\r\n\t\t\t\t\tsubArray1[i] = arr[start + i];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfor (int i = 0; i < subArrLen2; i++) {\r\n\t\t\t\t\tsubArray2[i] = arr[mid + i + 1];\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// merging the temporary arrays\r\n\r\n\t\t\t\tint i = 0, j = 0;\r\n\t\t\t\tint k = start;\r\n\r\n\t\t\t\twhile (i < subArrLen1 && j < subArrLen2) {\r\n\t\t\t\t\tif (subArray1[i] > subArray2[j]) {\r\n\t\t\t\t\t\tarr[k] = subArray1[i];\r\n\t\t\t\t\t\ti++;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tarr[k] = subArray2[j];\r\n\t\t\t\t\t\tj++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tk++;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// copy left over elements of subArray2[]\r\n\t\t\t\twhile (i < subArrLen1) {\r\n\t\t\t\t\tarr[k] = subArray1[i];\r\n\t\t\t\t\ti++;\r\n\t\t\t\t\tk++;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// copy left over elements of subArray2[]\r\n\t\t\t\twhile (j < subArrLen2) {\r\n\t\t\t\t\tarr[k] = subArray2[j];\r\n\t\t\t\t\tj++;\r\n\t\t\t\t\tk++;\r\n\t\t\t\t}\r\n\r\n\t}", "private void mergeSortRec(WordList list, Comparator<String> comp, int start, int end)\r\n {\r\n // TODO\r\n\t int middle = start + (end - start)/2; \r\n\t \r\n\t if(start < end) {\r\n\t\t mergeSortRec(list, comp, start, middle);\r\n\t\t mergeSortRec(list, comp, middle+1, end);\r\n\t\t mergeHelp(list, comp, start, middle, end);\r\n\t }\r\n\t \r\n }", "public static void mergeSortReverse(int[] nums, int start, int end) {\n // check for the base condition\n if (end - start < 2) {\n return;\n }\n // otherwise break the array [10, 2, 6, -12, 5,12,16] into parts\n int mid = (start + end) / 2;\n // now got the mid and array is divided\n // Left array - [10, 2, 6] & Right array - [-12, 5, 12, 16]\n mergeSortReverse(nums, start, mid); //calling mergeSort for left array\n mergeSortReverse(nums, mid, end); //calling mergeSort for right array\n // merge the sorted array\n mergeReverse(nums, start, mid, end);\n }", "public static ListNode mergeKLists(ListNode[] lists) {\n ListNode result = new ListNode(-1);\n ListNode curr = result;\n boolean []isEnd = new boolean[lists.length];\n int isEndSum = 0;\n for (int i = 0; i < lists.length; i++) {\n if(list[i]==null)\n {\n isEnd[i] = true;\n isEndSum++;\n }\n }\n while(isEndSum<lists.length){\n int min_index=-1;\n int min=Integer.MAX_VALUE;\n for (int i = 0; i < lists.length; i++) {\n if(isEndSum==lists.length-1)\n {\n break;\n }\n if(lists[i]==null&&!isEnd[i])\n {\n isEnd[i]=true;\n isEndSum++;\n }\n if(!isEnd[i] && (min>lists[i].val))\n {\n min_index = i;\n min = lists[i].val;\n }\n }\n if(min_index!=-1)\n {\n curr.next = new ListNode(min);\n lists[min_index] = lists[min_index].next;\n curr = curr.next;\n }\n if(isEndSum==lists.length-1)\n {\n for (int i = 0; i < lists.length; i++) {\n if(!isEnd[i])\n {\n ListNode tmp = lists[i];\n while(tmp!=null)\n {\n curr.next = tmp;\n tmp = tmp.next;\n curr = curr.next;\n\n }\n isEndSum++;\n break;\n }\n \n }\n }\n\n }\n return result.next;\n }", "public static void mergeSort(int a[]) {\n\t sort(a, 0, a.length-1); \n\t }", "private static void merge(int[] arr, int start, int mid, int end) {\n\t\tint length1 = mid - start + 1;\n\t\tint length2 = end - mid;\n\t\tint left[] = new int[length1];\n\t\tint right[] = new int[length2];\n\t\tfor (int index =0; index < length1; index++) {\n\t\t\tleft[index] = arr[start+index];\n\t\t}\n\t\tfor (int index =0; index < length2; index++) {\n\t\t\tright[index] = arr[mid+index+1];\n\t\t}\n\t\tint leftIndex = 0;\n\t\tint rightIndex = 0;\n\t\tint index = start;\n\t\twhile (leftIndex < length1 && rightIndex < length2) {\n\t\t\tif (left [leftIndex] < right[rightIndex]) {\n\t\t\t\tarr[index] = left[leftIndex];\n\t\t\t\tleftIndex ++;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tarr[index] = right[rightIndex];\n\t\t\t\trightIndex++;\n\t\t\t\tnumberOfInversions += (mid - leftIndex)+1;\n\t\t\t}\n\t\t\tindex++;\n\t\t}\n\t\twhile (leftIndex < length1) {\n\t\t\tarr[index] = left[leftIndex];\n\t\t\tleftIndex++;\n\t\t\tindex++;\n\t\t}\n\t\twhile (rightIndex < length2) {\n\t\t\tarr[index] = right[rightIndex];\n\t\t\trightIndex++;\n\t\t\tindex++;\n\t\t}\n\t\t\t\n\t\t\n\t}", "private static int mergeOrdered(char[] paramArrayOfChar1, int paramInt1, int paramInt2, char[] paramArrayOfChar2, int paramInt3, int paramInt4)\n/* */ {\n/* 801 */ return mergeOrdered(paramArrayOfChar1, paramInt1, paramInt2, paramArrayOfChar2, paramInt3, paramInt4, true);\n/* */ }" ]
[ "0.7206505", "0.66950655", "0.65173924", "0.6474508", "0.6449039", "0.6432452", "0.6361544", "0.6347528", "0.63315487", "0.6300061", "0.6287681", "0.62818867", "0.6207635", "0.6206394", "0.6172332", "0.6159802", "0.61416197", "0.6121641", "0.6102874", "0.6091779", "0.60324866", "0.60062134", "0.60000473", "0.59944123", "0.59834325", "0.5979014", "0.5977918", "0.5974778", "0.597372", "0.59706914", "0.59514743", "0.5935435", "0.5925423", "0.59035325", "0.58996856", "0.58962554", "0.58747095", "0.58695436", "0.58676225", "0.5866445", "0.5863675", "0.58598286", "0.58502597", "0.5820146", "0.5818821", "0.5808462", "0.5782988", "0.57779086", "0.57130885", "0.57010543", "0.5695604", "0.5693125", "0.56882393", "0.5684877", "0.5675425", "0.5670367", "0.5666586", "0.5666026", "0.5651788", "0.56479937", "0.5647605", "0.56471467", "0.5644355", "0.56391793", "0.56289697", "0.5617358", "0.56161904", "0.5613856", "0.55956286", "0.55820686", "0.55777335", "0.5576817", "0.5570289", "0.55669105", "0.55618984", "0.5561596", "0.5552435", "0.55370325", "0.55301553", "0.55291176", "0.5529005", "0.55244744", "0.5511914", "0.5505062", "0.54962504", "0.54889214", "0.54755306", "0.54732555", "0.5468887", "0.54631656", "0.5458002", "0.54510224", "0.5443787", "0.54353005", "0.54318696", "0.5425964", "0.5412349", "0.5409624", "0.53994966", "0.5395937" ]
0.63904464
6
Private method used to merge two parts of a given list. For it to work, both sublists must be sorted. First it creates indexes to navigate through the sublists and one to navigate through the auxiliary array of Comparable objects. Then, it goes into a loop that iterates until one of the sublists is completely inside the auxiliary array. The loop check which of the current elements in the sublists is lesser and adds it to the auxiliary array so the elements inside it are in order. After that it adds any element that was left outside the array. Finally, it changes the values of the elements in the list so that it matches the order of the ones in the auxiliary array.
private static <T extends Comparable<? super T>> void merge(List<T> list, int firstBegin, int firstFinish, int secondBegin, int secondFinish, T[] auxiliaryArray){ int firstIndex = firstBegin; int secondIndex = secondBegin; int auxiliaryIndex = 0; while(firstIndex <= firstFinish && secondIndex <= secondFinish){ if(list.get(firstIndex).compareTo(list.get(secondIndex)) <= 0){ auxiliaryArray[auxiliaryIndex] = list.get(firstIndex); firstIndex++; }else{ auxiliaryArray[auxiliaryIndex] = list.get(secondIndex); secondIndex++; } auxiliaryIndex++; } while(firstIndex <= firstFinish){ auxiliaryArray[auxiliaryIndex] = list.get(firstIndex); firstIndex++; auxiliaryIndex++; } while(secondIndex <= secondFinish){ auxiliaryArray[auxiliaryIndex] = list.get(secondIndex); secondIndex++; auxiliaryIndex++; } auxiliaryIndex = 0; for(int i = firstBegin; i <= secondFinish; i++){ list.set(i, auxiliaryArray[auxiliaryIndex]); auxiliaryIndex++; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static <T extends Comparable<? super T>> void mergeSort(List<T> list, int begin, int mid, int finish, T[] auxiliaryArray){\n if(begin + 1 == finish)\n merge(list, begin, mid, mid + 1, finish, auxiliaryArray);\n else{\n if(begin < finish){\n mergeSort(list, begin, (mid + begin)/2, mid, auxiliaryArray);\n mergeSort(list, mid + 1, (finish + mid)/2, finish, auxiliaryArray);\n merge(list, begin, mid, mid + 1, finish, auxiliaryArray);\n }\n }\n }", "private void merge(ArrayList <Comparable> a, int first, int mid, int last){\r\n\t\tsteps += 5;\r\n\t\tArrayList<Comparable> temp = new ArrayList<Comparable>();\r\n\t\tint firstInd = first;\r\n\t\tint middle = mid + 1;\r\n\t\tsteps += 2;\r\n\t\twhile (firstInd <= mid && (middle) <= last) {\r\n\t\t\tif (a.get(firstInd).compareTo(a.get(middle)) < 0) {\r\n\t\t\t\ttemp.add(a.get(firstInd));\r\n\t\t\t\tfirstInd ++;\r\n\t\t\t\tsteps += 7;\r\n\t\t\t}else if (a.get(middle).compareTo(a.get(firstInd)) < 0){\r\n\t\t\t\ttemp.add(a.get(middle));\r\n\t\t\t\tmiddle++;\r\n\t\t\t\tsteps += 7;\r\n\t\t }else {\r\n\t\t\t\ttemp.add(a.get(middle));\r\n\t\t\t\tmiddle++;\r\n\t\t\t\tsteps += 3;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif (firstInd >= mid + 1) {\r\n\t\t\tsteps += 4;\r\n\t\t\tfor (int i = middle; i <= last; i++) {\r\n\t\t\t\ttemp.add(a.get(i));\r\n\t\t\t}\r\n\t\t\tsteps += 3;\r\n\t\t}else {\r\n\t\t\tsteps += 2;\r\n\t\t\tfor (int i = firstInd; i <= mid; i++) {\r\n\t\t\t\ttemp.add(a.get(i));\r\n\t\t\t}\r\n\t\t\tsteps += 3;\r\n\t\t}\r\n\t\tsteps += 3;\r\n\t\tint j = 0;\r\n\t\tfor (int i = first; i <= last; i++) {\r\n\t\t\ta.set(i, temp.get(j));\r\n\t\t\tj++;\r\n\t\t\tsteps += 4;\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"Merge\");\r\n\t\tSystem.out.println();\r\n\r\n\t}", "private static void merge(Comparable[] as, Comparable[] aux, int lo, int mid, int hi) {\n assert isSorted(as, lo, mid); // precondition that first sub array is ordered\n assert isSorted(as, mid + 1, hi); // precondition that second sub array is ordered\n\n for (int k = lo; k <= hi; k++) {\n aux[k] = as[k];\n }\n\n int i = lo;\n int j = mid + 1;\n for (int k = lo; k <= hi; k++) {\n // done with first sub array\n if (i > mid) as[k] = aux[j++];\n // done with second sub array\n else if (j > hi) as[k] = aux[i++];\n // second less than first\n else if (less(aux[j], aux[i])) as[k] = aux[j++];\n // first less than first\n else as[k] = aux[i++];\n }\n\n assert isSorted(as, lo, hi); // postcondition that whole as array is sorted\n }", "public static void merge(int[] list1, int[] list2, int[] temp){\n //Current index in three lists\n int current1 = 0;\n int current2 = 0;\n int current3 = 0;\n\n while(current1 < list1.length && current2 < list2.length){\n if(list1[current1] < list2[current2])\n temp[current3++] = list1[current1++];\n else\n temp[current3++] = list2[current2++];\n }\n //Rest of the list1 to temp\n while(current1 < list1.length)\n temp[current3++] = list1[current1++];\n //Rest of the list2 to temp\n while(current2 < list2.length)\n temp[current3++] = list2[current2++];\n }", "private static void merge(ArrayList<Integer> leftList, ArrayList<Integer> rightList, ArrayList<Integer> outList) {\n\n int leftIndex = 0;\n int rightIndex = 0;\n int outIndex = 0;\n\n while (leftIndex < leftList.size() && rightIndex < rightList.size()) {\n\n if (leftList.get(leftIndex).compareTo(rightList.get(rightIndex)) <= 0) {\n outList.set(outIndex, leftList.get(leftIndex));\n leftIndex++;\n } else {\n outList.set(outIndex, rightList.get(rightIndex));\n rightIndex++;\n }\n\n outIndex++;\n\n }\n\n if (leftIndex < leftList.size()) {\n copyRemainder(leftList, leftIndex, outList, outIndex);\n } else {\n copyRemainder(rightList, rightIndex, outList, outIndex);\n }\n\n }", "private static <File> void merge(ArrayList<File> firstList, ArrayList<File> secondList,\r\n ArrayList<File> wholeList, Comparator<File> usedComparison) {\r\n int i = 0;\r\n int j = 0;\r\n int k = 0;\r\n while (i < firstList.size() && j < secondList.size()) {\r\n if (usedComparison.compare(firstList.get(i), secondList.get(j)) < 0) {\r\n wholeList.set(k++, firstList.get(i++));\r\n } else {\r\n wholeList.set(k++, secondList.get(j++));\r\n }\r\n }\r\n while (i < firstList.size()) {\r\n wholeList.set(k++, firstList.get(i++));\r\n }\r\n while (j < secondList.size()) {\r\n wholeList.set(k++, secondList.get(j++));\r\n }\r\n }", "private void mergeSubArr(int lowerIndex, int middle, int higherIndex) {\n \t\n \tArrayList tempMergArr = new ArrayList();\n \t\n \t\n \tfor (int i = 0; i < lowerIndex; i++){\n \t\ttempMergArr.add(i, 0);\n \t} \t\n \t\n for (int i = lowerIndex; i <= higherIndex; i++) {\n tempMergArr.add(i, (int)unsorted.get(i));\n }\n \n int i = lowerIndex;\n int j = middle + 1;\n int l = lowerIndex;\n while (i <= middle && j <= higherIndex) {\n if ((int)tempMergArr.get(i) <= (int)tempMergArr.get(j)) {\n unsorted.set(l, tempMergArr.get(i));\n i++;\n } else {\n unsorted.set(l, tempMergArr.get(j));\n j++;\n }\n l++;\n }\n while (i <= middle) {\n unsorted.set(l, tempMergArr.get(i));\n l++;\n i++;\n }\n while (j <= middle) {\n \tunsorted.set(l, tempMergArr.get(j));\n \tl++;\n \ti++;\n }\n\n \n }", "private static void merge(ArrayList<Integer> a, int left, int mid, int right) {\n\t\tint chunk1 = mid - left + 1;\r\n\t\tint chunk2 = right - mid;\r\n\t\tArrayList<Integer> tempArrLeft = new ArrayList<>();\r\n\t\tArrayList<Integer> tempArrRight = new ArrayList<>();\r\n\t\t//pipe data into temps\r\n\t\tfor (int i=0; i < chunk1; ++i) {\r\n\t\t\ttempArrLeft.add(a.get(left + i));\r\n\t\t}\r\n\t\tfor (int j=0; j < chunk2; ++j) {\r\n\t\t\ttempArrRight.add(a.get(mid + 1 + j));\r\n\t\t}\r\n\r\n\t\t//merge temp arrays\r\n\t\tint i = 0, j = 0;\r\n\t\tint k = left;\r\n\t\twhile (i < chunk1 && j < chunk2) {\r\n\t\t\tif (tempArrLeft.get(i) <= tempArrRight.get(j)) {\r\n\t\t\t\ta.set(k, tempArrLeft.get(i));\r\n\t\t\t\ti++;\r\n\t\t\t} else {\r\n\t\t\t\ta.set(k, tempArrRight.get(j));\r\n\t\t\t\tj++;\r\n\t\t\t}\r\n\t\t\tk++;\r\n\t\t}\r\n\t\twhile (i < chunk1) {\r\n\t\t\ta.set(k, tempArrLeft.get(i));\r\n\t\t\ti++;\r\n\t\t\tk++;\r\n\t\t}\r\n\t\twhile (j < chunk2) {\r\n\t\t\ta.set(k, tempArrRight.get(j));\r\n\t\t\tj++;\r\n\t\t\tk++;\r\n\t\t}\r\n\t}", "private static void mergeAsc(int arr[], int start, int mid, int end) {\n\r\n\t\tint subArrLen1 = mid - start + 1;\r\n\t\tint subArrLen2 = end - mid;\r\n\r\n\t\t// create the sub Arrays as temporary storage\r\n\t\tint subArray1[] = new int[subArrLen1];\r\n\t\tint subArray2[] = new int[subArrLen2];\r\n\r\n\t\t// copy data in temporary arrays\r\n\r\n\t\tfor (int i = 0; i < subArrLen1; i++) {\r\n\t\t\tsubArray1[i] = arr[start + i];\r\n\t\t}\r\n\r\n\t\tfor (int i = 0; i < subArrLen2; i++) {\r\n\t\t\tsubArray2[i] = arr[mid + i + 1];\r\n\t\t}\r\n\r\n\t\t// merging the temporary arrays\r\n\r\n\t\tint i = 0, j = 0;\r\n\t\tint k = start;\r\n\r\n\t\twhile (i < subArrLen1 && j < subArrLen2) {\r\n\t\t\tif (subArray1[i] <= subArray2[j]) {\r\n\t\t\t\tarr[k] = subArray1[i];\r\n\t\t\t\ti++;\r\n\t\t\t} else {\r\n\t\t\t\tarr[k] = subArray2[j];\r\n\t\t\t\tj++;\r\n\t\t\t}\r\n\t\t\tk++;\r\n\r\n\t\t}\r\n\r\n\t\t// copy left over elements of subArray2[]\r\n\t\twhile (i < subArrLen1) {\r\n\t\t\tarr[k] = subArray1[i];\r\n\t\t\ti++;\r\n\t\t\tk++;\r\n\t\t}\r\n\r\n\t\t// copy left over elements of subArray2[]\r\n\t\twhile (j < subArrLen2) {\r\n\t\t\tarr[k] = subArray2[j];\r\n\t\t\tj++;\r\n\t\t\tk++;\r\n\t\t}\r\n\r\n\t}", "private void merge(Comparable[] array, Comparable[] aux, int low, int high) {\n if (low >= high) return;\n\n int mid = (low + high) / 2;\n // Copy to aux\n for (int i = low; i <= high; i++) {\n aux[i] = array[i];\n }\n\n int i = low;\n int j = mid + 1;\n\n for (int k = low; k <= high; k++) {\n if (i > mid) array[k] = aux[j++];\n else if (j > high) array[k] = aux[i++];\n else if (aux[i].compareTo(aux[j]) <= 0) array[k] = aux[i++]; // <= makes it stable!!\n else array[k] = aux[j++];\n }\n }", "protected static <T extends Comparable<? super T>> void merge(List<T> a,\n List<T> tmpArray, int low, int high){\n int leftEnd = (low + high)/2;\n int leftPos = low;\n int rightPos = leftEnd + 1;\n int rightEnd = high;\n\n // merge into beginning of tmpArray\n int tmpPos = 0;\n int numElements = high - low + 1;\n\n while(leftPos <= leftEnd && rightPos <= rightEnd){\n // if value at leftPos is less than rightPos\n // copy leftPos into tmpArray and increment leftPos\n if(a.get(leftPos).compareTo(a.get(rightPos)) <= 0){\n tmpArray.set(tmpPos, a.get(leftPos));\n leftPos++;\n \n } else { // else rightPos is less and should be copied\n tmpArray.set(tmpPos, a.get(rightPos));\n rightPos++;\n }\n\n // in either case increment tmpPos\n tmpPos++;\n }\n\n // copy rest of left array if right array finished first\n while(leftPos <= leftEnd){\n tmpArray.set(tmpPos, a.get(leftPos));\n // increment left and tmp position\n leftPos++;\n tmpPos++;\n }\n\n // copy rest of right array if left array finished first\n while(rightPos <= rightEnd){\n tmpArray.set(tmpPos, a.get(rightPos));\n // increment right and tmp position\n rightPos++;\n tmpPos++;\n }\n\n // copy tmpArray back into array a\n for(int i = 0; i < numElements; i++){\n a.set(low+i, tmpArray.get(i));\n }\n }", "private static void merge(Comparable[] a, int[] index, int[] aux, int lo, int mid, int hi){\n for(int k=lo;k<=hi;k++){\n aux[k]=index[k];\n }\n int i=lo,j=mid+1;\n for(int k=lo;k<=hi;k++){\n if(i>mid) index[k]=aux[j++];\n else if(j>hi) index[k]=aux[i++];\n else if(less(a[aux[j]],a[aux[i]])) index[k]=aux[j++];\n else index[k]=aux[i++];\n }\n }", "private void combine( ArrayList<Type> array, ArrayList<Type> auxillary, int low, int mid, int high ){\n\t\tfor(int iterator=low;iterator<high;iterator++){\n\t\t\tauxillary.set(iterator, array.get(iterator));\n\t\t}\n\t\tint arrayPosition=low;\n\t\tint lowPosition=low;\n\t\tint midPosition=mid+1;\n\t\twhile(lowPosition<mid && midPosition<high){\n\t\t\tif(auxillary.get(lowPosition).compareTo(auxillary.get(midPosition))){\n\t\t\t\tarray.set(arrayPosition, auxillary.get(lowPosition));\n\t\t\t\tlowPosition++;\n\t\t\t}else{\n\t\t\t\tarray[arrayPosition]=auxillary[midPosition];\n\t\t\t\tmidPosition++;\n\t\t\t}\n\t\t\tarrayPosition++;\n\t\t}\n\t\tif(lowPosition==mid){\n\t\t\twhile(midPosition<high){\n\t\t\t\tarray[arrayPosition]=auxillary[midPosition];\n\t\t\t\tmidPosition++;\n\t\t\t\tarrayPosition++;\n\t\t\t}\n\t\t}else if(midPosition==high){\n\t\t\twhile(lowPosition<mid){\n\t\t\t\tarray[arrayPosition]=auxillary[lowPosition];\n\t\t\t\tlowPosition++;\n\t\t\t\tarrayPosition++;\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public static <T extends Comparable<? super T>> \n void union(SLL<T> list1, SLL<T> list2,\n SLL<T> result) {\n \n SLLNode<T> iterlist1 = list1.head;\n SLLNode<T> iterlist2 = list2.head;\n \n T itemlist1=null, itemlist2=null;\n \n // get first item in each list\n if ( iterlist1 != null )\n itemlist1 = iterlist1.info;\n if( iterlist2 != null )\n itemlist2 = iterlist2.info;\n \n while ( itemlist1 != null || itemlist2 != null ) {\n\n int compareResult;\n if( itemlist1 == null ) {\n compareResult = 1;\n } else if ( itemlist2 == null ) {\n compareResult = -1;\n } else {\n compareResult = itemlist1.compareTo(itemlist2);\n }\n \n if ( compareResult == 0 ) {\n result.addToTail(itemlist1); //appending to result list \n if( iterlist1.next != null ) {\n iterlist1 = iterlist1.next;\n itemlist1 = iterlist1.info;\n } else {\n itemlist1 = null;\n }\n \n if( iterlist2.next != null ) {\n iterlist2 = iterlist2.next;\n itemlist2 = iterlist2.info;\n } else {\n itemlist2 = null;\n } \n }\n else if ( compareResult < 0 ) { \n result.addToTail(itemlist1); //appending to result list\n if( iterlist1.next != null ) {\n iterlist1 = iterlist1.next;\n itemlist1 = iterlist1.info;\n } else {\n itemlist1 = null;\n }\n }\n else {\n result.addToTail(itemlist2);\n if( iterlist2.next != null ) {\n iterlist2 = iterlist2.next;\n itemlist2 = iterlist2.info;\n } else {\n itemlist2 = null;\n }\n }\n } \n }", "public void merge(paintIntegers[] arr, int lidx, int midx, int ridx){\n int leftn = midx - lidx + 1;\n int rightn = ridx - midx;\n\n //instantiating the left and right arrays\n int Left[] = new int [leftn];\n int Right[] = new int [rightn];\n\n //copies the data from original to the left and right\n for (int i=0; i < leftn; ++i) {\n Left[i] = arr[lidx + i].val;\n }\n for (int j=0; j < rightn; ++j) {\n Right[j] = arr[midx + 1 + j].val;\n }\n\n //merges the two arrays and updates the original array\n //initializes leftIndex and rightIndex to iterate over the left and right arrays\n //if it is added to the original array, then where it came from, it would increment\n int leftIndex = 0;\n int rightIndex = 0;\n int k = lidx; //to properly align where the elements to go, left\n //System.out.println(k);\n //while it hasnt gone through all the elements in the left and right array\n //between the two arrays check which one is lowest, and then updates original array\n while (leftIndex < leftn && rightIndex < rightn)\n {\n if (Left[leftIndex] <= Right[rightIndex])\n {\n arr[k].val = Left[leftIndex];\n sorting.add(paintIntegers.deepCopy(arr));//adds current array to list\n leftIndex++;\n }\n else\n {\n arr[k].val = Right[rightIndex];\n sorting.add(paintIntegers.deepCopy(arr));//adds current array to list\n rightIndex++;\n }\n k++;\n }\n //if there are some left on the left array then just adds to original array\n //possible because all the elements in right array have been added\n //all thats left is the sorted elements from the left array\n while (leftIndex < leftn)\n {\n arr[k].val = Left[leftIndex];\n sorting.add(paintIntegers.deepCopy(arr));//adds current array to list\n leftIndex++;\n k++;\n }\n //same explanation as above but with the right array\n while (rightIndex < rightn)\n {\n arr[k].val = Right[rightIndex];\n sorting.add(paintIntegers.deepCopy(arr));//adds current array to list\n rightIndex++;\n k++;\n }\n }", "private void merge_sort( ArrayList<Type> array, ArrayList<Type> auxillary, int low, int high )\r\n\t{\r\n\t\t// base case\r\n\t\tif ((high - low) <= switchValue)\r\n\t\t{\r\n\t\t\tSort_Utils.insertion_sort(array, low, high);\r\n\t\t}\r\n\t\t\r\n\t\tif (low < high)\r\n\t\t{\r\n\t\t\tint middle = low + (high - low)/2;\r\n\t\t\t\r\n\t\t\t// recursively sort the two halves of the array\r\n\t\t\tmerge_sort(array, auxillary, low, middle);\r\n\t\t\tmerge_sort(array, auxillary, middle + 1, high);\r\n\t\t\tcombine(array, auxillary, low, middle, high);\r\n\t\t}\r\n}", "protected ArrayList<Aircraft> mergeSort(ArrayList<Aircraft> list, boolean ascending)\r\n {\r\n\t\t// Use the merge sort algorithm to sort 'aircrafts' and then \r\n\t\t// return it. Initially this method just returns an empty\r\n \t// list - you need to fix this.\r\n \t\r\n \tArrayList<Aircraft> sorted = new ArrayList<Aircraft>();\r\n\r\n \t// TODO\r\n \tif(list.size()<=1) \r\n \t{\r\n \t\treturn list;\r\n \t}\r\n \t \r\n \t int middleIndex = list.size()/2; //find the middle index\r\n \t \r\n \t ArrayList<Aircraft> sortedL = new ArrayList<Aircraft>(middleIndex); //create new Empty array at left\r\n \t ArrayList<Aircraft> sortedR; // initialized new Array at Right \r\n \t \r\n \t \r\n \t if(list.size()%2 == 0) //create new Right Empty array has the same of Left empty array\r\n \t {\r\n \t sortedR = new ArrayList<Aircraft>(middleIndex); \r\n \t }else\r\n \t {\r\n \t sortedR = new ArrayList<Aircraft>(middleIndex+1);\r\n \t }\r\n \t \r\n \t for(int i = 0;i<middleIndex;i++)\r\n \t {\r\n \t sortedL.add(list.get(i)); //get index list with lest than middle index\r\n \t }\r\n \t \r\n \t for(int j = middleIndex ;j < list.size();j++)\r\n \t {\r\n \t sortedR.add(list.get(j)); //get index list with more than middle index\r\n \t }\r\n \t \r\n \t\r\n \t \r\n \t if(ascending == true) {\r\n \t sortedL = mergeSort(sortedL,true); // split elements in the left side;\r\n \t sortedR = mergeSort(sortedR,true); // split element in the right side;\r\n \t \r\n \t sorted= Merge(sortedL,sortedR,true);\r\n \t \r\n \t \r\n \t }else // for descending\r\n \t { \r\n \t \r\n \t sortedL = mergeSort(sortedL,false); // split elements in the left side;\r\n \t sortedR = mergeSort(sortedR,false); // split element in the right side;\r\n \t \r\n \t sorted= Merge(sortedL,sortedR,false);\r\n \t \r\n \t }\r\n \treturn sorted;\r\n\t\t\r\n \t\r\n\t\t\r\n \t\r\n }", "private List<Integer> merge(List<Integer> firstList, List<Integer> secondList) {\n List<Integer> resultList = new ArrayList<>();\n\n if (firstList.size() == 1 && secondList.size() == 1) {\n resultList.add(Math.min(firstList.get(0), secondList.get(0)));\n resultList.add(Math.max(firstList.get(0), secondList.get(0)));\n return resultList;\n }\n\n int firstIndex = 0;\n int secondIndex = 0;\n\n while (firstIndex < firstList.size() && secondIndex < secondList.size()) {\n if (firstList.get(firstIndex) < secondList.get(secondIndex)) {\n resultList.add(firstList.get(firstIndex));\n firstIndex++;\n } else {\n resultList.add(secondList.get(secondIndex));\n secondIndex++;\n }\n }\n\n if (firstIndex < firstList.size()) {\n for (int i = firstIndex; i < firstList.size(); i++) {\n resultList.add(firstList.get(i));\n }\n }\n\n if (secondIndex < secondList.size()) {\n for (int i = secondIndex; i < secondList.size(); i++) {\n resultList.add(secondList.get(i));\n }\n }\n\n return resultList;\n }", "private void merge_sort( ArrayList<Type> array, ArrayList<Type> auxillary, int low, int high ){\n\t\tif((high-low)>switchOff){\n\t\t\tint middle=low+((high-low)/2);\n\t\t\tmerge_sort(array,auxillary,low,middle);\n\t\t\tmerge_sort(array,auxillary,middle+1,high);\n\t\t\tcombine(array,auxillary,low,middle,high);\n\t\t}else{\n\t\t\tSort_Utils.insertion_sort(array, low, high);\n\t\t}\n\t}", "private void merge(ArrayList<Integer> arrayList, int p, int q, int r){\n ArrayList<Integer> lowHalf = new ArrayList<>();\r\n ArrayList<Integer> topHalf = new ArrayList<>();\r\n\r\n int k = p;\r\n int i;\r\n int j;\r\n\r\n //Values from original array entered into the new arrays\r\n for (i = 0; k <= q; i++, k++) {\r\n lowHalf.add(i, arrayList.get(k));\r\n }\r\n for (j = 0; k <= r; j++, k++) {\r\n topHalf.add(j, arrayList.get(k));\r\n }\r\n\r\n\r\n k = p;\r\n i = 0;\r\n j = 0;\r\n\r\n\r\n while (i < lowHalf.size() && j < topHalf.size()) {\r\n if (lowHalf.get(i) < topHalf.get(j)) {\r\n arrayList.set(k, lowHalf.get(i));\r\n i++;\r\n } else {\r\n arrayList.set(k, topHalf.get(j));\r\n j++;\r\n }\r\n k++;\r\n }\r\n\r\n while (i < lowHalf.size()) {\r\n arrayList.set(k, lowHalf.get(i));\r\n k++;\r\n i++;\r\n }\r\n while (j < topHalf.size()) {\r\n arrayList.set(k, topHalf.get(j));\r\n k++;\r\n j++;\r\n }\r\n }", "public static Comparable[] merge( Comparable[] leftPart, Comparable[] rightPart ) {\n\n int cursorLeft = 0, cursorRight = 0, counter = 0;\n\n Comparable[] merged = new Comparable[leftPart.length + rightPart.length];\n\n\n\n while ( cursorLeft < leftPart.length && cursorRight < rightPart.length ) {\n\n\n if ( leftPart[cursorLeft].compareTo(rightPart[cursorRight])<0) {\n\n merged[counter] = leftPart[cursorLeft];\n\n cursorLeft++;\n\n } else {\n\n merged[counter] = rightPart[cursorRight];\n\n cursorRight++;\n\n }\n\n\n\n counter++;\n\n }\n\n\n\n if ( cursorLeft < leftPart.length ) {\n\n System.arraycopy( leftPart, cursorLeft, merged, counter, merged.length - counter );\n\n }\n\n if ( cursorRight < rightPart.length ) {\n\n System.arraycopy( rightPart, cursorRight, merged, counter, merged.length - counter );\n\n }\n\n\n\n return merged;\n\n }", "@Test\n public void testUnionOfLists() {\n System.out.println(\"UnionOfLists\");\n ArrayList<Integer> arr1 = new ArrayList<>();\n arr1.add(12);\n arr1.add(10);\n arr1.add(23);\n ArrayList<Integer> arr2 = new ArrayList<>();\n arr2.add(23);\n arr2.add(10);\n Collections.sort(arr1);\n ArrayListRecursive instance = new ArrayListRecursive(arr1, arr2);\n List result = instance.UnionOfLists();\n Collections.sort(result);\n assertEquals(arr1, result);\n }", "private static void mergeSorted(int[] a, int alength, int[] b) {\n int ai = alength - 1;\n int bi = b.length - 1;\n int ri = a.length - 1;\n while (ai >= 0 && bi >= 0) {\n if (a[ai] > b[bi]) {\n a[ri--] = a[ai--];\n } else {\n a[ri--] = b[bi--];\n }\n }\n\n while (bi >= 0) a[ri--] = b[bi--];\n //Note that you don't need to copy the contents of A after running out of elements in B. They are already in place.\n// while (ai >= 0) a[ri--] = a[ai--];\n }", "private static void mergeDesc(int arr[], int start,int mid, int end) {\n\r\n\t\t\t\tint subArrLen1 = mid - start + 1;\r\n\t\t\t\tint subArrLen2 = end - mid;\r\n\r\n\t\t\t\t// create the sub Arrays as temporary storage\r\n\t\t\t\tint subArray1[] = new int[subArrLen1];\r\n\t\t\t\tint subArray2[] = new int[subArrLen2];\r\n\r\n\t\t\t\t// copy data in temporary arrays\r\n\r\n\t\t\t\tfor (int i = 0; i < subArrLen1; i++) {\r\n\t\t\t\t\tsubArray1[i] = arr[start + i];\r\n\t\t\t\t}\r\n\r\n\t\t\t\tfor (int i = 0; i < subArrLen2; i++) {\r\n\t\t\t\t\tsubArray2[i] = arr[mid + i + 1];\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// merging the temporary arrays\r\n\r\n\t\t\t\tint i = 0, j = 0;\r\n\t\t\t\tint k = start;\r\n\r\n\t\t\t\twhile (i < subArrLen1 && j < subArrLen2) {\r\n\t\t\t\t\tif (subArray1[i] > subArray2[j]) {\r\n\t\t\t\t\t\tarr[k] = subArray1[i];\r\n\t\t\t\t\t\ti++;\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tarr[k] = subArray2[j];\r\n\t\t\t\t\t\tj++;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tk++;\r\n\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// copy left over elements of subArray2[]\r\n\t\t\t\twhile (i < subArrLen1) {\r\n\t\t\t\t\tarr[k] = subArray1[i];\r\n\t\t\t\t\ti++;\r\n\t\t\t\t\tk++;\r\n\t\t\t\t}\r\n\r\n\t\t\t\t// copy left over elements of subArray2[]\r\n\t\t\t\twhile (j < subArrLen2) {\r\n\t\t\t\t\tarr[k] = subArray2[j];\r\n\t\t\t\t\tj++;\r\n\t\t\t\t\tk++;\r\n\t\t\t\t}\r\n\r\n\t}", "private static void merge(Comparable[] a, int[] index, int[] aux, int low, int mid, int high) {\n for(int k=low; k<=high; k++)\n aux[k] = index[k];\n \n // merge back to a[]\n int i=low, j=mid+1;\n for(int k=low; k<=high; k++) {\n if(i>mid) index[k] = aux[j++];\n else if(j>high) index[k] = aux[i++];\n else if(SortUtil.less(a[aux[j]], a[aux[i]])) index[k] = aux[j++];\n else index[k] = aux[i++];\n }\n }", "private void combine( ArrayList<Type> array, ArrayList<Type> auxillary, int low, int mid, int high )\r\n\t{\r\n\t\t//copy the array into auxillary array for scratchwork\r\n\t\tfor (int index = low; index <= high; index++ )\r\n\t\t{\r\n\t\t\tauxillary.set(index, array.get(index));\r\n\t\t}\r\n\t\t\r\n\t\tint lowIndex = low;\r\n\t\tint midIndex= mid + 1;\r\n\t\tfor (int count= low; count <= high; count++)\r\n\t\t{\r\n\t\t\tif (lowIndex > mid)\r\n\t\t\t{\r\n\t\t\t\tarray.set(count, auxillary.get(midIndex));\r\n\t\t\t\tmidIndex++;\r\n\t\t\t}\r\n\t\t\telse if (midIndex > high)\r\n\t\t\t{\r\n\t\t\t\tarray.set(count, auxillary.get(lowIndex));\r\n\t\t\t\tlowIndex++;\r\n\t\t\t}\r\n\t\t\t// if the element at midIndex is smaller than the element at the lowIndex, place it into the\r\n\t\t\t// real array before the element at lowIndex\r\n\t\t\telse if((auxillary.get(midIndex).compareTo(auxillary.get(lowIndex)) == -1))\r\n\t\t\t{\r\n\t\t\t\tarray.set(count, auxillary.get(midIndex));\r\n\t\t\t\tmidIndex++;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tarray.set(count, auxillary.get(lowIndex));\r\n\t\t\t\tlowIndex++;\r\n\t\t\t}\r\n\t\t}\r\n\t\r\n\t}", "public static ArrayList<String> mergeSort(ArrayList<String> aList) {\n ArrayList<String> left = new ArrayList<String>();\n ArrayList<String> right = new ArrayList<String>();\n int minIndex;\n \n if (aList.size() == 1) { \n return aList;\n } else {\n minIndex = aList.size()/2;\n \n for (int i= 0; i< minIndex; i++) {\n left.add(aList.get(i));\n }\n\n for (int i= minIndex; i< aList.size(); i++) {\n right.add(aList.get(i));\n }\n \n left = mergeSort(left);\n right = mergeSort(right);\n \n merge(aList, right, left);\n }\n return aList;\n }", "public static IntList mergeSort(IntList input) {\n\t\tif (input.length() <= 1)\n\t\t\treturn input;\n\t\tIntList part1 = new SimpleIntList();\n\t\tIntList part2 = new SimpleIntList();\n\t\tdivide(input,part1,part2);\n\t\tpart1 = mergeSort(part1);\n\t\tpart2 = mergeSort(part2);\n\t\treturn merge(part1,part2);\n\t}", "private static void sort(Comparable[] as, Comparable[] aux, int lo, int hi) {\n if (hi <= lo + CUTOFF - 1) {\n Insertion.sort(as, lo, hi);\n return;\n }\n int mid = lo + (hi - lo) / 2;\n sort (as, aux, lo, mid);\n sort (as, aux, mid + 1, hi);\n // Last element of first array is less than the first of the second --> Stop!\n if (!less(as[mid + 1], as[mid])) return;\n merge (as, aux, lo, mid, hi);\n }", "public void merge(List<Integer> a, List<Integer> l, List<Integer> r, int left, int right) \n {\n \n int i = 0, j = 0, k = 0;\n while (i < left && j < right) \n {\n if (l.get(i) < r.get(j)) \n {\n a.add(k++, l.get(i++));\n a.remove(k);\n }\n else \n {\n a.add(k++, r.get(j++));\n a.remove(k);\n }\n }\n \n while (i < left) \n {\n a.add(k++, l.get(i++));\n a.remove(k);\n }\n while (j < right) \n {\n a.add(k++, r.get(j++));\n a.remove(k);\n }\n }", "private static void mergeSort(int[] num, int low, int high) {\n\t\tif ((high - low) >= 1) {\n\n\t\t\t// find the middle index\n\t\t\tint middle = (low + high) / 2;\n\n\t\t\t// make recursive calls to the 'left' and 'right' sides of the sublist\n\t\t\tmergeSort(num, low, middle);\n\t\t\tmergeSort(num, middle + 1, high);\n\n\t\t\t// merge the sublists back together\n\t\t\tmerge(num, low, middle, middle + 1, high);\n\n\t\t}\n\t}", "int merge(int list1, int list2) {\n\t\t\n\t\t// Get values of the lists\n\t\t\n\t\tComparable c1 = array[list1];\n\t\tComparable c2 = array[list2];\n\n\t\t// compare values\n\t\t\n\t\tint small = list1, big = list2;\n\t\tif (c1 != c2 && c1 != null && c1.compareTo(c2) > 0) {\n\n\t\t\tsmall = list2;\n\t\t\tbig = list1;\n\t\t}\n\n\t\t/*\n\t\t * If small list has no tail - set big list to be small list tail\n\t\t * If small list has tail - merge it with the big list and set result to be small list tail\n\t\t */\n\t\t\n\t\tif (next[small] == NIL)\n\t\t\tnext[small] = big;\n\t\telse\n\t\t\tnext[small] = merge(next[small], big);\n\t\t\n\t\t// return small list with new tail\n\t\t\n\t\treturn small;\n\t}", "private static <T,P> void sort1(List<T> x, List<P> a2, Comparator<T> comp, int off, int len) {\n\t\t// Insertion sort on smallest arrays\n\t\tif (len < 7) {\n\t\t\tfor (int i=off; i<len+off; i++)\n\t\t\t\tfor (int j=i; j>off && comp.compare(x.get(j-1),x.get(j))>0; j--)\n\t\t\t\t\tswap(x, a2, j, j-1);\n\t\t\treturn;\n\t\t}\n\n\t\t// Choose a partition element, v\n\t\tint m = off + (len >> 1); // Small arrays, middle element\n\t\tif (len > 7) {\n\t\t\tint l = off;\n\t\t\tint n = off + len - 1;\n\t\t\tif (len > 40) { // Big arrays, pseudomedian of 9\n\t\t\t\tint s = len/8;\n\t\t\t\tl = med3(x,comp, l, l+s, l+2*s);\n\t\t\t\tm = med3(x,comp, m-s, m, m+s);\n\t\t\t\tn = med3(x,comp, n-2*s, n-s, n);\n\t\t\t}\n\t\t\tm = med3(x,comp, l, m, n); // Mid-size, med of 3\n\t\t}\n\t\tT v = x.get(m);\n\n\t\t// Establish Invariant: v* (<v)* (>v)* v*\n\t\tint a = off, b = a, c = off + len - 1, d = c;\n\t\twhile(true) {\n\t\t\twhile (b <= c && comp.compare(x.get(b),v)<=0) {\n\t\t\t\tif (x.get(b) == v)\n\t\t\t\t\tswap(x,a2, a++, b);\n\t\t\t\tb++;\n\t\t\t}\n\t\t\twhile (c >= b && comp.compare(x.get(c),v)>=0) {\n\t\t\t\tif (x.get(c) == v)\n\t\t\t\t\tswap(x,a2, c, d--);\n\t\t\t\tc--;\n\t\t\t}\n\t\t\tif (b > c)\n\t\t\t\tbreak;\n\t\t\tswap(x,a2, b++, c--);\n\t\t}\n\n\t\t// Swap partition elements back to middle\n\t\tint s, n = off + len;\n\t\ts = Math.min(a-off, b-a ); vecswap(x,a2, off, b-s, s);\n\t\ts = Math.min(d-c, n-d-1); vecswap(x,a2, b, n-s, s);\n\n\t\t// Recursively sort non-partition-elements\n\t\tif ((s = b-a) > 1)\n\t\t\tsort1(x,a2,comp, off, s);\n\t\tif ((s = d-c) > 1)\n\t\t\tsort1(x,a2,comp, n-s, s);\n\t}", "private void merge(int lb, int mid, int ub, int[] ar){\n\t\tint i = lb ,j = lb + mid, k = 0;\n\t\tint[] out = new int[ub - lb + 1];\n\t\twhile( (i <= lb + mid - 1) && (j <= ub)){\n\t\t if(ar[i] <= ar[j]) out[k++] = ar[i++];\n\t\t else out[k++] = ar[j++];\n\t\t}\n\t\twhile(i <= lb + mid - 1) out[k++] = ar[i++];\n\t\twhile(j <= ub) \t out[k++] = ar[j++];\n\t\tfor(int l = 0; l < k; l++) ar[lb + l] = out[l];\n\t}", "private List<DataPoint> mergeSortedListsOfAttempts(List<List<QuizAttempt>> listsToMerge) {\n List<DataPoint> listFromMerging = new ArrayList<>();\n int numberOfLists = listsToMerge.size();\n int[] lengths = new int[numberOfLists];\n int[] positions = new int[numberOfLists];\n for (int i = 0; i < numberOfLists; ++i) {\n lengths[i] = listsToMerge.get(i).size();\n }\n\n Queue<QuizAttempt> pq = new PriorityQueue<>(Comparator.comparing(QuizAttempt::getTakenAt));\n\n for (int i = 0; i < numberOfLists; ++i) {\n if (positions[i] < lengths[i]) {\n pq.offer(listsToMerge.get(i).get(0));\n positions[i]++;\n }\n }\n\n int idx = 0;\n while (!pq.isEmpty()) {\n QuizAttempt attempt = pq.poll();\n LocalDateTime takenAt = attempt.getTakenAt();\n double scoreInPercentage = attempt.getScore().getScoreInPercentage();\n listFromMerging.add(new DataPoint(takenAt, scoreInPercentage));\n\n if (positions[idx] < lengths[idx]) {\n // process the idx-th list\n pq.offer(listsToMerge.get(idx).get(positions[idx]));\n positions[idx]++;\n }\n\n idx++;\n }\n\n return listFromMerging;\n }", "static void merge(int arr[], int l, int m, int r) \n { \n // Sizes of the two subarrays\n int size1 = m - l + 1; \n int size2 = r - m; \n \n // Temporary arrays\n int left[] = new int [size1]; \n int right[] = new int [size2]; \n \n // Copy over to temps\n for (int i=0; i<size1; ++i) \n left[i] = arr[l + i]; \n for (int j=0; j<size2; ++j) \n right[j] = arr[m + 1+ j]; \n \n \n // Initial indexes of first and second subarrays \n int i = 0, j = 0; \n \n // Initial index of merged subarry array \n int k = l; \n while (i < size1 && j < size2) \n { \n if (left[i] <= right[j]) \n { \n arr[k] = left[i]; \n i++; \n } \n else\n { \n arr[k] = right[j]; \n j++; \n } \n k++; \n } \n \n // Copy rest of arrays\n while (i < size1) \n { \n arr[k] = left[i]; \n i++; \n k++; \n } \n \n // For the other array\n while (j < size2) \n { \n arr[k] = right[j]; \n j++; \n k++; \n } \n }", "private void mergeAB() {\r\n //merge only for the indexes of this global_count\r\n boolean a_end = false;\r\n boolean b_end = false;\r\n boolean start = false;\r\n int a_count = splitA[global_count - 1];\r\n if(a_count == A.length - 1){\r\n a_count = splitA[global_count - 2] + 1;\r\n }\r\n int b_count = splitB[global_count - 1];\r\n if(b_count == B.length - 1){\r\n if(global_count != splitB.length){\r\n start = true;\r\n b_count = 0;\r\n }\r\n else{\r\n b_count = splitB[global_count - 2] + 1;\r\n }\r\n }\r\n if(b_count == -1){\r\n b_end = true;\r\n b_count = 0;\r\n if(splitB[0] == B.length - 1){\r\n b_count = B.length;\r\n }\r\n }\r\n int c_count = a_count + b_count;\r\n while(!a_end || !b_end){\r\n if(a_end){\r\n C[c_count] = B[b_count];\r\n b_count++;\r\n }\r\n else if(b_end){\r\n C[c_count] = A[a_count];\r\n a_count++;\r\n }\r\n //if a > b\r\n else if(A[a_count] > B[b_count]){\r\n C[c_count] = B[b_count];\r\n b_count++;\r\n c_count++;\r\n }\r\n //if a <= b\r\n else{\r\n C[c_count] = A[a_count];\r\n a_count++;\r\n c_count++;\r\n }\r\n if(!start){\r\n if(a_count == splitA[global_count - 1] + 1){\r\n a_end = true;\r\n }\r\n if(b_count == splitB[global_count - 1] + 1){\r\n b_end = true;\r\n }\r\n }\r\n else{\r\n if(a_count == splitA[global_count - 1] + 1){\r\n a_end = true;\r\n }\r\n if(b_count == splitB.length){\r\n b_end = true;\r\n }\r\n }\r\n }\r\n }", "private void merge(Comparable[] a, int min, int mid, int max){\n for(int t = min; t <= max;t++){\n aux[t] = a[t];\n }\n \n int i = min; // start index for left side\n int j = mid + 1; // start index for right side\n \n for(int k = min; k <= max; k++){\n if(i > mid){\n a[k] = aux[j++];\n }\n else if(j > max){\n a[k] = aux[i++];\n }\n else if(aux[i].compareTo(aux[j]) < 0 ){\n a[k] = aux[i++];\n }\n else {\n a[k] = aux[j++];\n }\n }\n }", "void merge(int arr[], int left, int mid, int right) {\n\t\tint n1 = mid - left + 1;\n\t\tint n2 = right - mid;\n\n\t\t/* Create temporary arrays */\n\t\tint leftArray[] = new int[n1];\n\t\tint rightArray[] = new int[n2];\n\n\t\t/* Copy data to temporary arrays */\n\t\tfor (int i = 0; i < n1; ++i)\n\t\t\tleftArray[i] = arr[left + i];\n\t\tfor (int j = 0; j < n2; ++j)\n\t\t\trightArray[j] = arr[mid + 1 + j];\n\n\t\t/* Merge the temporary arrays */\n\n\t\t// Initial indexes of first and second sub-arrays\n\t\tint i = 0, j = 0;\n\n\t\t// Initial index of merged sub-array array\n\t\tint k = left;\n\t\twhile (i < n1 && j < n2) {\n\t\t\tif (leftArray[i] >= rightArray[j]) {\n\t\t\t\tarr[k] = leftArray[i];\n\t\t\t\ti++;\n\t\t\t} else {\n\t\t\t\tarr[k] = rightArray[j];\n\t\t\t\tj++;\n\t\t\t}\n\t\t\tk++;\n\t\t}\n\n\t\t/* Copy remaining elements of L[] if any */\n\t\twhile (i < n1) {\n\t\t\tarr[k] = leftArray[i];\n\t\t\ti++;\n\t\t\tk++;\n\t\t}\n\n\t\t/* Copy remaining elements of R[] if any */\n\t\twhile (j < n2) {\n\t\t\tarr[k] = rightArray[j];\n\t\t\tj++;\n\t\t\tk++;\n\t\t}\n\t\t\n\t}", "public static ArrayList<Integer> mergeSort(ArrayList <Integer> list){\n System.out.println();\n System.out.println(\"Insertion Sort\");\n System.out.println();\n if (3 > 2){\n int mid= list.size()/2;\n ArrayList<Integer> left= new ArrayList<Integer>(mid);\n ArrayList<Integer> right=new ArrayList<Integer>(list.size()-mid);\n for (int i = 0; i < mid; i++) {\n left.add(list.get(i));\n } \n\n for (int i = 0; i < list.size()-mid; i++) {\n right.add(list.get(i));\n } \n\n left = mergeSort(left); \n right = mergeSort(right);\n merge(left,right,list);\n }\n return list;\n }", "public static void mergeSort(ArrayList<Integer> inputList) {\n recursiveCallCounter++;\n System.out.println(\"Current recursive call count: \" + recursiveCallCounter);\n\n if (inputList.size() < 2) {\n System.out.println(\"\\nCurrent list length < 2\");\n System.out.println(\"Current recursive call count: \" + recursiveCallCounter + \"\\n\");\n\n return;\n }\n\n ArrayList<Integer> leftList = arrayListCopy(inputList, 0, inputList.size() / 2);\n ArrayList<Integer> rightList = arrayListCopy(inputList, inputList.size() / 2, inputList.size());\n\n System.out.println(\"\\nMerging left\");\n System.out.println(\"Pre-Sort left: \" + printCurrentList(leftList));\n mergeSort(leftList);\n System.out.println(\"Post-Sort left: \" + printCurrentList(leftList));\n\n\n\n System.out.println(\"\\nMerging right\");\n System.out.println(\"Pre-Sort right: \" + printCurrentList(rightList));\n mergeSort(rightList);\n System.out.println(\"Post-Sort right: \" + printCurrentList(rightList));\n\n merge(leftList, rightList, inputList);\n }", "private static int[] mergeSortedArray(int[] a, int[] b){\n int i = a.length -1;\n for(int j = 3, k = 3, x=0; ( (j >= 0) && (k >= 0)) ; x++){\n\n if(a[j] > b[k]){\n a[i] = a[j];\n a[j] = 0;\n --j;\n --i;\n\n } else{\n a[i] = b[k];\n --k;\n --i;\n }\n\n if(j == -1 ) // this condition worked\n j = 0;\n }\n\n return a;\n\n }", "private int merge(Comparable[] a, Comparable[] aux, int lo, int mid, int hi) {\n for (int k = lo; k <= hi; k++) {\n aux[k] = a[k];\n }\n\n int k = lo;\n int i = lo;\n int j = mid + 1;\n int count = 0;\n\n while (k < hi) {\n if (i > mid) a[k++] = aux[j++];\n else if (j > hi) a[k++] = aux[i++];\n else if (less(aux[j], aux[i])) {\n count += mid + 1 - i;\n a[k++] = aux[j++];\n }\n else a[k++] = aux[i++];\n }\n return count;\n }", "private void mergesort(ToCompare[] a, int l, int r) throws BrokenBarrierException, InterruptedException {\n if (l >= r) {\r\n return;\r\n }\r\n\r\n //recursion step: a[l..r] is not empty \r\n //divide into sublists and merge \r\n int m = (l + r) / 2;\r\n mergesort(a, l, m);\r\n mergesort(a, m + 1, r);\r\n merge(a, l, m, r);\r\n }", "void merge(int arr[], int l, int m , int r)\n {\n int n1 = m-l+1;\n int n2 = r-m;\n\n //create temp arrays\n int L[] = new int[n1];\n int R[] = new int[n2];\n\n //copy the elements to the array\n for(int i=0; i < n1 ;i++)\n L[i] = arr[l+i];\n for(int j=0; j < n2 ;j++)\n R[j] = arr[m+1+j];\n\n // Initial indexes of first and second subarrays\n int i = 0, j = 0;\n\n // Initial index of merged subarry array\n int k = l;\n\n while(i<n1 && j< n2)\n {\n if(L[i] <= R[j])\n {\n arr[k++] = L[i++];\n }\n else\n {\n arr[k++] = R[j++];\n }\n }\n\n while(i<n1)\n {\n arr[k++]=L[i++];\n }\n\n while(j<n2)\n {\n arr[k++]=R[j++];\n }\n\n }", "private void merge() {\n for (int i = low; i<high; i++){\n temparray[i]=nums[i];\n }\n\n int i = low;\n int j = middle;\n //index of the original array for which we are making compare\n int index = low;\n //copy the smallest from the left and right partition to temp\n while ((i<middle)&&(j<high)){\n if(temparray[i]<=temparray[j]){\n nums[index]=temparray[i];\n i++;\n }\n else {\n nums[index]=temparray[j];\n j++;\n }\n index++;\n }\n // copy the rest of the the left side\n while (i<middle){\n nums[index]= temparray[i];\n i++;\n index++;\n }\n //and the right\n while (j<high){\n nums[index]=temparray[j];\n j++;\n index++;\n }\n\n }", "public static void merge(Comparable[] a, Comparable[] aux, int lo,int mid,int hi){\n for(int k=lo;k<=hi;k++){\n aux[k]=a[k];\n }\n int i=lo,j=mid+1;\n for(int k=lo;k<=hi;k++){\n if(i>mid) a[k]=aux[j++];\n else if(j>hi) a[k]=aux[i++];\n else if(less(aux[j],aux[i])) a[k]=aux[j++];\n else a[k]=aux[i++];\n }\n }", "private static MyList Merge(MyList L1, MyList L2)\n\t{\n\t\t//however, one assumption is that the length of L1>L2, because of our mid algorithm\n\t\tMyList merged = new MyList(0);//its next is the resulting merged list\n\t\tMyList current = merged;//current points where we are at the time of merging\n\t\tint turn = 1;//we define a turn to know which list element to be merged per loop cycle\n\t\twhile(L1!=null && L2!=null)\n\t\t{\n\t\t\tif(turn==1)//pick from L1\n\t\t\t{\n\t\t\t\tcurrent.next = L1;\n\t\t\t\tL1 = L1.next;//update L1's index to right\n\t\t\t\tturn = 2;//next loop we pick from L2\n\t\t\t}\n\t\t\telse//pick from L2\n\t\t\t{\n\t\t\t\tcurrent.next = L2;\n\t\t\t\tL2 = L2.next;//update L1's index to right\n\t\t\t\tturn = 1;//back to L1 next cycle\n\t\t\t}\n\t\t\tcurrent = current.next;//update the current pointer\n\t\t}\n\t\t//as we said L1's length may be longer than L2 considering size of array\n\t\tif(L1!=null)//we merge the remaining L1 to our current.next\n\t\t\tcurrent.next = L1;\n\n\t\treturn merged.next;\n\t}", "static void merge(int array[], int l, int x, int r) {\n int arrSize1 = x - l + 1;\n int arrSize2 = r - x;\n\n //Create temp arrays \n int tempArray1[] = new int[arrSize1];\n int tempArray2[] = new int[arrSize2];\n\n // Copy elements to temp arrays\n for (int i = 0; i < arrSize1; ++i)\n \ttempArray1[i] = array[l + i];\n for (int j = 0; j < arrSize2; ++j)\n \ttempArray2[j] = array[x + 1 + j];\n\n // Merge the temp arrays\n\n // Initial the indexes of two arrays\n int i = 0, j = 0;\n\n int k = l;\n while (i < arrSize1 && j < arrSize2) {\n\n if (tempArray1[i] <= tempArray2[j]) {\n array[k] = tempArray1[i];\n i++;\n }\n else {\n array[k] = tempArray2[j];\n j++;\n }\n k++;\n }\n\n // If there are any elements left, copy those elements of tempArray1\n while (i < arrSize1) {\n array[k] = tempArray1[i];\n i++;\n k++;\n }\n\n // If there are any elements left, copy those elements of tempArray2\n while (j < arrSize2) {\n array[k] = tempArray2[j];\n j++;\n k++;\n }\n\n }", "static void merge(Comparable[] a, int lo, int mid, int hi) {\n int i = lo, j = mid + 1;\n\n //copy a[lo..hi] to aux[lo..hi]\n for (int k = lo; k <= hi; k++) {\n aux[k] = a[k];\n }\n\n for (int k = lo; k <= hi; k++) {\n if (i > mid) {\n a[k] = aux[j++];\n\n } else if (j > hi) {\n a[k] = aux[i++];\n\n } else if (less(aux[j], aux[i])) {\n a[k] = aux[j++];\n\n } else {\n a[k] = aux[i++];\n\n }\n }\n }", "private void bInsertionSort(int lowerIndex, int higherIndex) {\n \t\tArrayList tmpsorted = new ArrayList();\n \t\tint tmp, lowerbound, upperbound;\n \t\t\n \t\tfor(int i = lowerIndex; i <= higherIndex; i++) {\n \t\t\ttmp = (int) unsorted.get(i);\n \t\t\tif(tmpsorted.isEmpty()) {\n \t\t\t\ttmpsorted.add(tmp);\n \t\t\t} else {\n \t\t\t\t\n \t\t\t\t//Every new number we want to insert needs\n \t\t\t\t//to reset the bounds according to the sorted list.\n \t\t\t\tupperbound = tmpsorted.size() - 1;\n \t\t\t\tlowerbound = 0;\n \t\t\t\t\n \t\t\t\twhile (unsorted.size() != 0){\n \t\t\t\t//Note that each \"break;\" throws us out of the while loop.\n \t\t\t\t//Causing our boundaries to be reset for the new number\n \t\t\t\t\t\n \t\t\t\t\tint j = (upperbound + lowerbound) / 2;\t//j points to the middle of the boundaries\n \t\t\t\t\tif (tmp <= (int)tmpsorted.get(j)){\t//is tmp less or equal to the number in j?\n \t\t\t\t\t\t\t\t\t\t\t\t\n \t\t\t\t\t\tif (j == 0){\t\t\t\t\t\t//Are we at the bottom of the list?\n \t\t\t\t\t\t\ttmpsorted.add(0, tmp);\t\t//Add it to the bottom of the list.\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t}\n \t\t\t\t\t\t\n \t\t\t\t\t\telse if ((int)tmpsorted.get(j-1) > tmp){ \n \t\t\t\t\t\t//Else if the number behind j is bigger than tmp...\n \t\t\t\t\t\t//...we can move the upper bound behind j and repeat the split.\n \t\t\t\t\t\t//NOTE: We do NOT \"break;\" to get thrown out of the while loop.\n \t\t\t\t\t\t\t\n \t\t\t\t\t\t\tupperbound = j - 1;\n \t\t\t\t\t\t}\n \t\t\t\t\t\t\n \t\t\t\t\t\telse{ //Else we just add the number to j\n \t\t\t\t\t\t\ttmpsorted.add(j, tmp);\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t\telse{ //If tmp is HIGHER than j\n \t\t\t\t\t\tif (j == tmpsorted.size() - 1){\n \t\t\t\t\t\t//Are we at the end of the list?\n \t\t\t\t\t\t//Just add tmp at the end of the list.\t\n \t\t\t\t\t\t\ttmpsorted.add(j+1, tmp);\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t}\n \t\t\t\t\t\t\n \t\t\t\t\t\telse if((int)tmpsorted.get(j+1) < tmp){\n \t\t\t\t\t\t//if the next number to j is still less than tmp...\n \t\t\t\t\t\t//we raise the lowerbound past j and repeat the split\n \t\t\t\t\t\t//NOTE: We do NOT \"break;\" to get thrown out of the while loop.\n \t\t\t\t\t\t\tlowerbound = j + 1;\n \t\t\t\t\t\t}\n \t\t\t\t\t\t\n \t\t\t\t\t\telse{ \n \t\t\t\t\t\t//Else we can just add tmp after j since it's higher than j\n \t\t\t\t\t\t\ttmpsorted.add(j+1, tmp);\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t}\n \t\t\t\t\n \t\t\t}\n \t\t}\n \t\t// Replace the unsorted values with tmpsorted.\n \t\tint j = 0;\n \t\tfor(int i = lowerIndex; i <= higherIndex; i++) {\n \t\t\tunsorted.set(i, tmpsorted.get(j));\n \t\t\tj++;\n \t\t}\n\n \t}", "public static void merge(int[] array, int start, int mid, int end) {\n if (array[mid - 1] <= array[mid]) {\n return;\n }\n\n // Index variables\n int i = start;\n int j = mid;\n int tempIndex = 0;\n\n // Create a temp array large enough to hold all elements in the left and right partitions\n int[] temp = new int[end - start];\n\n // While there are elements left in any of the left and right partitions...\n while (i < mid && j < end) {\n /* \n temp[tempIndex++] = array[i] <= array[j] ? array[i++] : array[j++];\n */\n // If the left element is smaller than or equal to the right...\n if (array[i] <= array[j]) {\n // Assign the left element to the temp array, and increment tempIndex and i\n temp[tempIndex++] = array[i++];\n } else {\n // Else assign the right element to the temp array, and increment tempIndex and j\n temp[tempIndex++] = array[j++];\n }\n }\n\n // At this point, either left or right partition will now be empty. \n // Then we simply merge the rest from another partition into temp array \n // as elements left are all larger than the largest elements in the temp array.\n /*\n System.arraycopy(src, srcPos, dest, destPos, length)\n src => source array\n srcPos => source index\n dest => destination array\n destPos => destination index\n */\n\n // Start at unhandled index of the left partition and copy over the rest of the elements\n // to the end of the array from index we've copied over to temp array so far.\n // If there are left over elements in the right partitions, they're already in the end of the array.\n // In the next step, we will be copying over the sorted and merged array from temp array \n // back to the original array, so the the beginning of the array is now sorted in the original array.\n System.arraycopy(array, i, array, start + tempIndex, mid - i);\n\n // Copy the elements in the temp array back into the original array\n System.arraycopy(temp, 0, array, start, tempIndex);\n }", "public static <T extends Comparable<? super T>> void mergeSort(List<T> a,\n List<T> tmpArray, int low, int high){\n // base case if high - low < 1 then already sorted\n if(high - low < 1){\n return;\n }\n\n // else split array and sort each half and then merge the halves back together\n int center = (low + high)/2;\n mergeSort(a, tmpArray, low, center);\n mergeSort(a, tmpArray, center + 1, high);\n merge(a, tmpArray, low, high);\n }", "private static void merge(int[] nums, int[] work, int start, int mid, int end){\n\t\tboolean loop = true;\n\t\tint counter1 = start;\n\t\tint counter2 = mid+1;\n\t\tint workCounter = start;\n\t\t\n\t\twhile(loop){\n\t\t\tif(counter1 > mid){\n\t\t\t\t// Copy all elements from 2nd end to work\n\t\t\t\tfor(int i=counter2; i<=end; i++)\n\t\t\t\t\twork[workCounter++] = nums[i];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\tif(counter2 > end){\n\t\t\t\t// Copy all elements from start-mid to work\n\t\t\t\tfor(int i=counter1; i<=mid; i++)\n\t\t\t\t\twork[workCounter++] = nums[i];\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t// Swap the number if the numbers in are not is sorted order\n\t\t\tif(nums[counter1] < nums[counter2]){\n\t\t\t\twork[workCounter] = nums[counter1]; \n\t\t\t\tcounter1++;\n\t\t\t}else{\n\t\t\t\twork[workCounter] = nums[counter2]; \n\t\t\t\tcounter2++;\n\t\t\t}\n\t\t\t\n\t\t\tworkCounter++;\n\t\t}\n\t\t\n\t\t// Copy the sorted work array into main array\n\t\tfor(int i=start; i <= end; i++)\n\t\t\tnums[i] = work[i];\n\t}", "private static void merge(ArrayList<Score> items, int start, int mid, int end) {\r\n Object[] temp = new Object[items.size()];\r\n int pos1 = start;\r\n int pos2 = mid + 1;\r\n int spot = start;\r\n\r\n while (!(pos1 > mid && pos2 > end)) {\r\n if ((pos1 > mid) || ((pos2 <= end) && (items.get(pos2).compareTo(items.get(pos1)) < 0))) {\r\n temp[spot] = items.get(pos2);\r\n pos2 += 1;\r\n } else {\r\n temp[spot] = items.get(pos1);\r\n pos1 += 1;\r\n }\r\n spot += 1;\r\n }\r\n for (int i = start; i <= end; i++) {\r\n items.set(i, (Score) temp[i]);\r\n }\r\n }", "public void merge(int[] inputArray, int start, int mid, int end) {\n int s1 = mid - start + 1;\n int s2 = end - mid;\n\n //Create a left and right array\n int L[] = new int [s1];\n int R[] = new int [s2];\n\n //Copy elements into two separate arrays\n for (int i=0; i<s1; ++i)\n L[i] = inputArray[start + i];\n for (int j=0; j<s2; ++j)\n R[j] = inputArray[mid + 1+ j];\n\n\n int i = 0, j = 0;\n int k = start;\n\n //Start your comparision\n while (i < s1 && j < s2)\n {\n if (L[i] <= R[j])\n {\n inputArray[k] = L[i];\n i++;\n }\n else\n {\n inputArray[k] = R[j];\n j++;\n }\n k++;\n }\n\n //Copy the remaining elements\n while (i < s1)\n {\n inputArray[k] = L[i];\n i++;\n k++;\n }\n while (j < s2)\n {\n inputArray[k] = R[j];\n j++;\n k++;\n }\n }", "private static void sort(Comparable[] a, int[] index, int[] aux, int lo, int hi){\n if(hi<=lo) return;\n int mid=lo+(hi-lo)/2;\n sort(a,index,aux,lo,mid);\n sort(a,index,aux,mid+1,hi);\n merge(a,index,aux,lo,mid,hi);\n }", "public static void merge(int[] a, int[] temp, int low, int mid, int high) {\r\n // low is the low index of the part of the array to be sorted\r\n // high is the high index of the part of the array to be sorted\r\n // mid is the middle of the array – last item in low half\r\n\r\n // copy the two sets from a[] to the same locations in the temporary array\r\n for (int i = low; i <= high; i++) {\r\n temp[i] = a[i];\r\n }\r\n //set up necessary pointers\r\n int lowP = low; // pointer to current item in low half\r\n int highP = mid + 1; // pointer to current item in high half\r\n int aP = low; // pointer to where each item will be put back in a[]\r\n // while the pointers have not yet reached the end of either half\r\n while ((lowP <= mid) && (highP <= high)) {\r\n // if current item in low half <= current item in high half\r\n if (temp[lowP] <= temp[highP]) {\r\n // move item at lowP back to array a and increment low pointer\r\n a[aP] = temp[lowP];\r\n lowP++;\r\n } else {\r\n // move item at highP back to array a and increment high pointer\r\n a[aP] = temp[highP];\r\n highP++;\r\n } // end if..else\r\n\r\n // increment pointer for location in original array\r\n aP++;\r\n } // end while\r\n // if lowP is at end of low half, then low half is done, move rest of high half.\r\n if (lowP > mid) {\r\n for (int i = highP; i <= high; i++) {\r\n a[aP] = temp[i]; //\r\n aP++;\r\n } // end for\r\n } else // high half is done, move rest of low half\r\n {\r\n for (int i = lowP; i <= mid; i++) {\r\n a[aP] = temp[i];\r\n aP++;\r\n }// end for\r\n }\r\n//\r\n }", "private void merge(ArrayList<Integer> list, int low, int middle, int high) {\n\t\tArrayList<Integer> temp = new ArrayList<Integer>();\n\t\tList<Integer> s1;\n\t\tList<Integer> s2;\n\t\t\n\t\ts1 = new ArrayList<>(list.subList(low, middle + 1));\n\t\ts2 = new ArrayList<>(list.subList(middle + 1, high + 1));\n\t\t\n\t\tint i1 = 0;\n\t\tint i2 = 0;\n\t\t\n\t\twhile (i1 < s1.size() && i2 < s2.size()) {\n\t\t\tif(s1.get(i1).compareTo(s2.get(i2)) <= 0) {\n\t\t\t\ttemp.add(s1.get(i1));\n\t\t\t\ti1++;\n\t\t\t} else {\n\t\t\t\ttemp.add(s2.get(i2));\n\t\t\t\ti2++;\n\t\t\t}\n\t\t}\n\t\t\n\t\twhile (i1 < s1.size()) {\n\t\t\ttemp.add(s1.get(i1));\n\t\t\ti1++;\n\t\t}\n\t\t\n\t\tfor(int i = 0; i < temp.size();i++) {\n\t\t\tlist.set(i + low, temp.get(i));\n\t\t}\n\t}", "private static void merge(int[] array, int lowIndex, int middleIndex, int highIndex) {\n int n1 = middleIndex - lowIndex + 1;\n int n2 = highIndex - middleIndex;\n\n /*Create temp arrays*/\n int L[] = new int[n1];\n int R[] = new int[n2];\n\n /*Copy data to temp arrays*/\n for (int i = 0; i < L.length; i++) {\n L[i] = array[lowIndex + i];\n }\n for (int i = 0; i < R.length; i++) {\n R[i] = array[middleIndex + 1 + i];\n }\n\n /* Merge the temp arrays */\n\n // Initial indexes of first and second subarrays\n int i = 0, j = 0;\n\n // Initial index of merged subarray\n int k = lowIndex;\n\n while (i < n1 && j < n2) {\n if (L[i] <= R[j]) {\n array[k] = L[i];\n i++;\n } else {\n array[k] = R[j];\n j++;\n }\n k++;\n }\n\n /*Copy remaining elements of L[] if any */\n while (i < n1) {\n array[k] = L[i];\n i++;\n k++;\n }\n\n /*Copy remaining elements of R[] if any */\n while (j < n2) {\n array[k] = R[j];\n j++;\n k++;\n }\n }", "private static <T extends Comparable,S> void mergeSort(T[] src, S[] src2,\n\t\t\tT[] dest,\n\t\t\tS[] dest2,\n\t\t\tint low,\n\t\t\tint high,\n\t\t\tint off) {\n\t\tint length = high - low;\n\n\t\t// Insertion sort on smallest arrays\n\t\tif (length < INSERTIONSORT_THRESHOLD) {\n\t\t\tfor (int i=low; i<high; i++)\n\t\t\t\tfor (int j=i; j>low &&\n\t\t\t\t\t\tdest[j-1].compareTo(dest[j])>0; j--)\n\t\t\t\t\tswap(dest,dest2, j, j-1);\n\t\t\treturn;\n\t\t}\n\n\t\t// Recursively sort halves of dest into src\n\t\tint destLow = low;\n\t\tint destHigh = high;\n\t\tlow += off;\n\t\thigh += off;\n\t\tint mid = (low + high) >>> 1;\n\t\tmergeSort(dest, dest2, src, src2,low, mid, -off);\n\t\tmergeSort(dest, dest2, src, src2, mid, high, -off);\n\n\t\t// If list is already sorted, just copy from src to dest. This is an\n\t\t// optimization that results in faster sorts for nearly ordered lists.\n\t\tif (src[mid-1].compareTo(src[mid]) <= 0) {\n\t\t\tSystem.arraycopy(src, low, dest, destLow, length);\n\t\t\tSystem.arraycopy(src2, low, dest2, destLow, length);\n\t\t\treturn;\n\t\t}\n\n\t\t// Merge sorted halves (now in src) into dest\n\t\tfor(int i = destLow, p = low, q = mid; i < destHigh; i++) {\n\t\t\tif (q >= high || p < mid && src[p].compareTo(src[q])<=0) {\n\t\t\t\tdest2[i] = src2[p];\n\t\t\t\tdest[i] = src[p++];\n\t\t\t}\n\t\t\telse {\n\t\t\t\tdest2[i] = src2[q];\n\t\t\t\tdest[i] = src[q++];\n\t\t\t}\n\t\t}\n\t}", "static void merge(double a[],int start,int mid, int end) {\r\n \tint i,j,k;\r\n \tint size1 = mid - start +1;\r\n \tint size2 = end - mid;\r\n \tif (size2 > 0 && size1 > 0) {\r\n \t\tdouble leftA[] = new double[size1]; // temp arrays\r\n \tdouble rightA[] = new double[size2];\r\n \tfor(i=0;i < size1;i++) leftA[i] = a[start+i]; //Copy data into temp arrays \r\n \tfor(j=0;j<size2;j++) rightA[j] = a[mid+1+j];\r\n \ti=0; // Merge temp arrays back into a[]\r\n \tj=0;\r\n \tk=start;\r\n \twhile (i<size1 && j < size2) {\r\n \t\tif(leftA[i]<=rightA[j]) {\r\n \t\t\ta[k]=leftA[i];\r\n \t\t\ti++;\r\n \t\t}else {\r\n \t\t\ta[k]=rightA[j];\r\n \t\t\tj++;\r\n \t\t}\r\n \t\tk++;\r\n \t}\r\n \twhile(i<size1) { //if remaining in leftA[] copy in\r\n \t\ta[k]=leftA[i];\r\n \t\ti++;\r\n \t\tk++;\r\n \t}\r\n \twhile(j<size2) { //if remaining in rightA[] copy in\r\n \t\ta[k]=rightA[j];\r\n \t\tj++;\r\n \t\tk++;\r\n \t}\r\n \t}\t\r\n }", "private static void sort(Comparable[] a, Comparable[] aux, int lo, int hi) {\n if (hi <= lo) return;\n int mid = lo + (hi - lo) / 2;\n sort(a, aux, lo, mid);\n sort(a, aux, mid + 1, hi);\n merge(a, aux, lo, mid, hi);\n }", "public void mergeSort(ArrayList <Comparable> a, int first, int last){\r\n\t\t\r\n\t\tif (last - first == 0) {\r\n\t\t\tsteps ++;\r\n\t\t}else if (last - first == 1) {\r\n\t\t\tsteps += 4; \r\n\t\t\tif (a.get(first).compareTo(a.get(last)) > 0) {\r\n\t\t\t\tsteps += 5;\r\n\t\t\t\tswap(a, first, last);\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}else {\r\n\t\t\tsteps += 3;\r\n\t\t\tint mid = (last + first)/2;\r\n\t\t\tsteps += 4;\r\n\t\t\tmergeSort(a, first, mid);\r\n\t\t\tmergeSort(a, mid + 1, last);\r\n\t\t\tmerge(a, first, mid, last);\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"Merge Sort\");\r\n\t\tSystem.out.println();\r\n\t}", "public void merge(int l, int m, int r){\n int n1 = m-l+1;\n int n2 = r-m;\n\n // temp arrays \n int[] L = new int[n1];\n int[] R = new int[n2];\n\n // copy data of the 2 subarrays int he temp ones\n // TODO : can be reduced to one loop and another loop of length |n1-n2|\n for(int i=0; i<n1; i++) L[i] = arr[l+i];\n for(int i=0; i<n2; i++) R[i] = arr[m+1+i];\n\n\n // init indexes\n int i=0, j=0, k=l;\n while (i<n1 && j<n2){ // ordering in asc order\n if(L[i] <= R[j]){\n arr[k] = L[i];\n i++;\n } else{\n arr[k] = R[j];\n j++;\n }\n k++;\n }\n\n // insert the remaining items\n while(i<n1){\n arr[k] = L[i];\n i++;\n k++;\n }\n\n while(j<n2){\n arr[k] = R[j];\n j++;\n k++;\n }\n \n\n }", "@Test\n public void testIntersectionOfLists() {\n System.out.println(\"IntersectionOfLists\");\n ArrayList<Integer> arr1 = new ArrayList<>();\n arr1.add(12);\n arr1.add(10);\n arr1.add(23);\n ArrayList<Integer> arr2 = new ArrayList<>();\n arr2.add(23);\n arr2.add(10);\n Collections.sort(arr2);\n ArrayListRecursive instance = new ArrayListRecursive(arr1, arr2);\n List result = instance.IntersectionOfLists();\n Collections.sort(result);\n assertEquals(arr2, result);\n }", "private static int[] merge( int[] a, int[] b )\n {\n int[] ans = new int[(a.length + b.length)]; //create new array with the combined lengths\n int a1 = 0; //counter for a's position\n int b1 = 0; //counter for b's position\n while (a1 < a.length || b1 < b.length) { //iterates while either counter is not at the end of each array\n\t if (a1 == a.length) { //if you finished with all of a add the remaining b elements\n\t ans[a1 + b1] = b[b1]; \n\t b1 += 1;\n\t }\n\t else if (b1 == b.length) { //if you finished with all of b add the remaining a elements\n\t ans[a1 + b1] = a[a1];\n\t a1 += 1;\n\t }\n\t else if (a[a1] > b[b1]) { //if the current element at position a1 is larger than the one at b1, add the lower b1 to the new array and move to next b position\n\t ans[a1 + b1] = b[b1];\n\t b1 += 1;\n\t }\n\t else {\n\t ans[a1 + b1] = a[a1]; //otherwise add the element at a1 and move to next a position \n\t a1 += 1;\n\t }\n }\n return ans; //return the sorted merged array\t \t \n }", "private static void merge(int[] inputArray, int start, int mid, int end) {\n int tempArray [] = new int[end - start + 1]; //length of array\n\n // index counter for left side of Array\n int leftSlot = start;\n\n // index counter for right side of Array\n int rightSlot = mid + 1;\n\n // index for temp array\n int k = 0;\n\n while(leftSlot <= mid && rightSlot <= end){ //loop will run till left slot is less than mid value, and right slot is less than end index\n if(inputArray[leftSlot] < inputArray[rightSlot]){\n tempArray[k] = inputArray[leftSlot];\n leftSlot = leftSlot + 1; // incrementing the left slot\n }else {\n tempArray[k] = inputArray[rightSlot];\n rightSlot = rightSlot + 1; // incrementing the right slot\n }\n\n k = k+1; //need to increment the index of temp array so that value gets copied to correct place\n }\n\n /**\n * when it gets to here that means the above loop is completed and\n * both the left and right side of array are sorted\n */\n\n //there can be scenario that right array is sorted and left index is always less than right\n\n if(leftSlot <= mid){\n while(leftSlot <= mid){\n tempArray[k] = inputArray[leftSlot];\n leftSlot = leftSlot + 1;\n k = k + 1;\n }\n }else if(rightSlot <= end){\n while(rightSlot <= end){\n tempArray[k] = inputArray[rightSlot];\n rightSlot = rightSlot + 1;\n k = k + 1;\n }\n }\n for(int i=0;i< tempArray.length;i++){\n inputArray[start + i] = tempArray[i]; // copying back to original array\n }\n }", "private void mergesort(ArrayList<Integer> list, int l, int h) {\n\t\tif (l < h) {\n\t\t\tint m = (l + h) / 2;\n\t\t\tmergesort(list, l, m);\n\t\t\tmergesort(list, m + 1, h);\n\t\t\tSystem.out.println(list);\n\t\t\tmerge(list, l, m, h);\n\t\t}\n\t}", "public static Node mergeSortedLists(Node list1Itr, Node list2Itr){\r\n\t\t\tDoublyLinkedList sortedList = new DoublyLinkedList();\r\n\t\t\t// add the smaller element to the new list and traverse that list\r\n\t\t\twhile(list1Itr!=null && list2Itr!=null){\r\n\t\t\t\tif(list1Itr.val == list2Itr.val){\r\n\t\t\t\t\tsortedList.add(list1Itr.val);\r\n\t\t\t\t\tsortedList.add(list1Itr.val);\r\n\t\t\t\t\tlist1Itr = list1Itr.next;\r\n\t\t\t\t\tlist2Itr = list2Itr.next;\r\n\t\t\t\t}\r\n\t\t\t\telse if(list1Itr.val < list2Itr.val){\r\n\t\t\t\t\tsortedList.add(list1Itr.val);\r\n\t\t\t\t\tlist1Itr = list1Itr.next;\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tsortedList.add(list2Itr.val);\r\n\t\t\t\t\tlist2Itr = list2Itr.next;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// add the remaining elements of the left out list\r\n\t\t\tif(list1Itr!=null){\r\n\t\t\t\tsortedList.addNode(list1Itr);\r\n\t\t\t}\r\n\t\t\tif(list2Itr!=null){\r\n\t\t\t\tsortedList.addNode(list2Itr);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn sortedList.head;\r\n\t\t}", "public static void main(String[] args) {\n\t\t\n\t\t// 10 Tests: \n\t\tList<Integer> a1 = new List<>();\n\t\tList<Integer> b1 = new List<>(1, new List<>(2, new List<>(3, new List<>())));\n\t\t\n\t\tList<Integer> a2 = new List<>(1, new List<>(2, new List<>(3, new List<>())));\n\t\tList<Integer> b2 = new List<>();\n\t\t\n\t\tList<Integer> a3 = new List<>();\n\t\tList<Integer> b3 = new List<>();\n\t\t\n\t\tList<Integer> a4 = new List<>(1, new List<>(2, new List<>(3, new List<>())));\n\t\tList<Integer> b4 = new List<>(4, new List<>(5, new List<>(6, new List<>())));\n\t\t\n\t\tList<Integer> a5 = new List<>(4, new List<>(5, new List<>(6, new List<>())));\n\t\tList<Integer> b5 = new List<>(1, new List<>(2, new List<>(3, new List<>())));\n\t\t\n\t\tList<Integer> a6 = new List<>(1, new List<>(4, new List<>(6, new List<>()))); \n\t\tList<Integer> b6 = new List<>(5, new List<>(6, new List<>(9, new List<>())));\n\t\t\n\t\tList<Integer> a7 = new List<>(-6, new List<>(-5, new List<>(-4, new List<>())));\n\t\tList<Integer> b7 = new List<>(-3, new List<>(-2, new List<>(-1, new List<>())));\n\t\t\n\t\tList<Integer> a8 = new List<>(-2, new List<>(-1, new List<>(0, new List<>())));\n\t\tList<Integer> b8 = new List<>(-1, new List<>(0, new List<>(1, new List<>(2, new List<>()))));\n\t\t\n\t\tList<Integer> a9 = new List<>(-1, new List<>(0, new List<>(1, new List<>())));\n\t\tList<Integer> b9 = new List<>(3, new List<>(4, new List<>(5, new List<>())));\n\t\t\n\t\tList<Integer> a10 = new List<>(-1, new List<>(0, new List<>(1, new List<>())));\n\t\tList<Integer> b10 = new List<>(-1, new List<>(0, new List<>(1, new List<>())));\n\t\t\n\t\tSystem.out.println(unique(a1, b1));\n\t\tSystem.out.println(unique(a2, b2));\n\t\tSystem.out.println(unique(a3, b3));\n\t\tSystem.out.println(unique(a4, b4));\n\t\tSystem.out.println(unique(a5, b5));\n\t\tSystem.out.println(unique(a6, b6));\n\t\tSystem.out.println(unique(a7, b7));\n\t\tSystem.out.println(unique(a8, b8));\n\t\tSystem.out.println(unique(a9, b9));\n\t\tSystem.out.println(unique(a10, b10));\n\t\t\n\t}", "@Test\n public void testItem_Ordering() {\n OasisList<Integer> baseList = new SegmentedOasisList<>(2, 2);\n\n List<Integer> expResult = Arrays.asList(1, 2, 6, 8);\n baseList.addAll(expResult);\n\n for (int i = 0; i < expResult.size(); i++) {\n assertEquals(expResult.get(i), baseList.get(i));\n }\n }", "public void merge(SortedList<T> list2){\n while(!list2.isEmpty()){\n this.internalInsert(list2.removeFromFront());\n }\n\n this.sort();\n }", "private static int[] merge( int[] a, int[] b )\n {\n int[] retList = new int[a.length + b.length];\n\t int aPos = 0, bPos = 0;\n\t for(int x = 0; x < retList.length; x ++) {\n\t\t if(aPos < a.length && bPos < b.length) {\n\t\t\t if(a[aPos] < b[bPos]) {\n\t\t\t\t retList[x] = a[aPos];\n\t\t\t\t aPos ++;\n\t\t\t }\n\t\t\t else {\n\t\t\t\t retList[x] = b[bPos];\n\t\t\t\t bPos ++;\n\t\t\t }\n\t\t }\n\t\t else if(aPos < a.length) {\n\t\t\t retList[x] = a[aPos];\n\t\t\t aPos ++;\n\t\t }\n\t\t else {\n\t\t\t retList[x] = b[bPos];\n\t\t\t bPos ++;\n\t\t }\n\t }\n return retList;\n }", "public static void prefixMerge(Client [] list1, Client [] list2, Client[] result){\n int resultCount = 0;\n for (int i = 0; resultCount < result.length; i++) //goes through list1 up until the end of result\n {\n for (int j = 0; j < list2.length && resultCount < result.length; j++) //goes through list2 up until the end of list2\n {\n for (int k = 0; k < resultCount; k++) { //check if current element of list2 is already in result\n if (list2[j].compareClient(result[k]) == 0) { j++; } //without this there is an issue where the previous element of list1 is\n } //repeated in list2 but the current element of list1 is larger\n\n if (list2[j].compareClient(list1[i]) < 0) { //copies current element of list2 to result if it is smaller\n result[resultCount] = list2[j]; //than current element of list1\n resultCount++;\n }\n }\n if (resultCount < result.length) { //copies current element of list1 to result if there is room in result\n result[resultCount] = list1[i]; // needed if statement because of outOfBounds exception where all elements\n resultCount++; //in result were already filled by list2\n }\n }\n\n }", "private void recMergeSort(final long[] workSpace, final int lowerBound,\n final int upperBound) {\n if (lowerBound == upperBound) // if range is 1,\n return; // no use sorting\n else { // find midpoint\n final int mid = (lowerBound + upperBound) / 2;\n // sort low half\n recMergeSort(workSpace, lowerBound, mid);\n // sort high half\n recMergeSort(workSpace, mid + 1, upperBound);\n // merge them\n merge(workSpace, lowerBound, mid + 1, upperBound);\n } // end else\n }", "public void mergeSort(Comparable[] input) {\n\t\t\n\t\t// check if input array is null\n\t\tif (input == null)\n\t\t\tthrow new IllegalArgumentException(\"Input array cannot be null!\");\n\t\t\n\t\t// if input array is empty or contains only 1 element - there's no need to sort\n\t\tif (input.length < 2)\n\t\t\treturn;\n\t\t\n\t\t// set up environment\n\t\tsetUp(input);\n\t\t\n\t\t// variable to store final result list\n\t\tint list;\n\t\twhile (true) {\n\t\t\t\n\t\t\t// poll two lists from queue\n\t\t\tint list1 = poll();\n\t\t\tint list2 = poll();\n\t\t\t\n\t\t\t// merge them and save result into created variable\n\t\t\tlist = merge(list1, list2);\n\t\t\t\n\t\t\t// if queue is empty - there's nothing else to merge - break loop\n\t\t\tif (isEmpty())\n\t\t\t\tbreak;\n\t\t\t\n\t\t\t// if queue is not empty - add merged list to it\n\t\t\tadd(list);\n\t\t}\n\t\t\n\t\t// write result\n\t\twriteBack(input, list);\n\t}", "static void mergeSort(int array[], int start, int end) {\n if (start < end) {\n // Find the middle point\n int middle = start + (end - start)/2;\n\n // Sort first and second parts\n mergeSort(array, start, middle);\n mergeSort(array, middle + 1, end);\n\n // Merge the sorted parts\n merge(array, start, middle, end);\n\n }\n\n }", "public static void sort(int[] mergeList) {\n for(int i = 0; i < mergeList.length - 1; i++) { //iterate through mergeList \n int min = mergeList[i];\n int minIndex = i;\n \n\n for(int j = i + 1; j < mergeList.length; j++) { //swap current list item with smaller value \n if(mergeList[j] < min) { \n min = mergeList[j]; \n minIndex = j; \n \n }\t\t\t\t\t\n }\n \n \n if(minIndex != i) { //swap original list with sorted list\n mergeList[minIndex] = mergeList[i];\n mergeList[i] = min;\n \n }\n }\n }", "private void merge(ArrayList<T> arr, int p, int q, int r) {\n\t\t// we assume that in array arr, p to q are sorted and q+1 to r are sorted.\n\t\tint n1 = q-p+1;\n\t\tint n2 = r-q;\n\t\t\n\t\t// lets get two temp arraylists to hold the value while we merge\n\t\tArrayList<T> Larr = new ArrayList<T>();\n\t\tArrayList<T> Rarr = new ArrayList<T>();\n\t\tfor(int i = 1; i <= n1; i++) {\n\t\t\tLarr.add(arr.get(p+i-1));\n\t\t}\n\t\tfor(int i = 1; i <= n2; i++) {\n\t\t\tRarr.add(arr.get(q+i));\n\t\t}\n\t\t\n\t\tint i = 0;\n\t\tint j = 0;\n\t\tint k = p;\n\t\twhile( i<n1 && j<n2) {\n\t\t\tif(Larr.get(i).compareTo(Rarr.get(j)) <= 0) {\n\t\t\t\tarr.set(k, Larr.get(i));\n\t\t\t\ti++;\n\t\t\t}\n\t\t\telse {\n\t\t\t\tarr.set(k, Rarr.get(j));\n\t\t\t\tj++;\n\t\t\t}\n\t\t\tk++;\n\t\t}\n\t\t\n\t\t//copy remaining elements of L and R if any\n\t\twhile( i < n1) {\n\t\t\tarr.set(k, Larr.get(i));\n\t\t\ti++;\n\t\t\tk++;\n\t\t}\n\t\t\n\t\twhile( j < n2) {\n\t\t\tarr.set(k, Rarr.get(j));\n\t\t\tj++;\n\t\t\tk++;\n\t\t}\n\t}", "private static <T extends Comparable<T>> void merge(T[] arrayToSort, int startIndex, int centerIndex, int endIndex) {\n List<T> left = new ArrayList<>(centerIndex - startIndex);\n List<T> right = new ArrayList<>(endIndex - centerIndex);\n for(int i = startIndex; i < centerIndex; i++)\n left.add(arrayToSort[i]);\n for(int i = centerIndex; i < endIndex; i++)\n right.add(arrayToSort[i]);\n int leftItr = 0;\n int rightItr = 0;\n for(int i = startIndex; i < endIndex; i++) {\n if(leftItr < left.size())\n if(rightItr < right.size())\n if(left.get(leftItr).compareTo(right.get(rightItr)) < 0)\n arrayToSort[i] = left.get(leftItr++);\n else\n arrayToSort[i] = right.get(rightItr++);\n else\n arrayToSort[i] = left.get(leftItr++);\n else\n arrayToSort[i] = right.get(rightItr++);\n }\n }", "private static void recursiveMergesort(\n\t\tint[] ints,\n\t\tint[] copyOfInts,\n\t\tint min,\n\t\tint max\n\t\t) {\n\n\t\tif (min < max - 1) {\n\t\t\tint middleOfArray = (max + min) / 2;\n\t\t\trecursiveMergesort(\n\t\t\t\tints,\n\t\t\t\tcopyOfInts,\n\t\t\t\tmin,\n\t\t\t\tmiddleOfArray\n\t\t\t\t);\n\t\t\trecursiveMergesort(\n\t\t\t\tints,\n\t\t\t\tcopyOfInts,\n\t\t\t\tmiddleOfArray,\n\t\t\t\tmax);\n\t\t\tmergeHalves(\n\t\t\t\tints,\n\t\t\t\tcopyOfInts,\n\t\t\t\tmin,\n\t\t\t\tmiddleOfArray,\n\t\t\t\tmax);\n\t\t}\n\t\t// if min == max - 1, then this range\n\t\t// of ints only contains one int\n\n\t}", "private void sort(T[] arr, T[] temp, int lo, int hi) {\n if (lo >= hi) return; // we return if the size of the part equals 1\n int mid = lo + (hi - lo) / 2;\n sort(arr, temp, lo, mid); // sorting the left part\n sort(arr, temp, mid + 1, hi); // sorting the right part\n merge(arr, temp, lo, hi, mid); // merging two parts\n }", "public static void mergeSort(List<Integer> values) {\r\n for (int stepSize = 2; stepSize < values.size(); stepSize *= 2) {\r\n for (int i = 0; i < values.size(); i += stepSize) {\r\n int prefixStart = i;\r\n int suffixStart = i + stepSize / 2;\r\n int suffixEnd = Math.min(values.size(), i + stepSize);\r\n merge(values, prefixStart, suffixStart, suffixEnd);\r\n } // for\r\n if (stepSize > values.size() / 2) {\r\n int prefixStart = 0;\r\n int suffixStart = stepSize;\r\n int suffixEnd = values.size();\r\n merge(values, prefixStart, suffixStart, suffixEnd);\r\n } // if\r\n //printList(values);\r\n } // for\r\n }", "public void sort() {\n if(c==null) {\n int middle;\n\n Comparable[] left, right;\n\n\n if (unsorted.length <= 1) {\n\n sorted = unsorted;\n\n } else {\n\n middle = unsorted.length / 2;\n\n\n left = new Comparable[middle];\n\n right = new Comparable[unsorted.length - middle];\n\n\n System.arraycopy(unsorted, 0, left, 0, middle);\n\n System.arraycopy(unsorted, middle, right, 0, unsorted.length - middle);\n\n\n // Внимание! Опа, рекурсия :)\n\n SimpleMerger leftSort = new SimpleMerger(left, c);\n\n SimpleMerger rightSort = new SimpleMerger(right,c);\n\n\n leftSort.sort();\n\n rightSort.sort();\n\n\n sorted = merge(leftSort.getSorted(), rightSort.getSorted());\n\n }\n }else{\n\n int middle;\n\n Object[] left, right;\n\n\n if (unsorted2.length <= 1) {\n\n sorted2 = unsorted2;\n\n } else {\n\n middle = unsorted2.length / 2;\n\n\n left = new Object[middle];\n\n right = new Object[unsorted2.length - middle];\n System.arraycopy(unsorted2, 0, left, 0, middle);\n\n System.arraycopy(unsorted2, middle, right, 0, unsorted2.length - middle);\n\n\n\n\n SimpleMerger leftSort = new SimpleMerger(left,c);\n\n SimpleMerger rightSort = new SimpleMerger(right,c);\n\n\n leftSort.sort();\n\n rightSort.sort();\n\n\n\n sorted2 = merge2(leftSort.getSorted2(), rightSort.getSorted2());\n\n }\n\n }\n }", "public static void sort(Comparable[] a)\n {\n // Do lg N passes of pairwise merges.\n int N = a.length;\n aux = new Comparable[N];\n for (int sz = 1; sz < N; sz = sz+sz) // sz: subarray size\n for (int lo = 0; lo < N - sz; lo += sz + sz) // lo: subarray index\n merge(a, lo, lo + sz - 1, Math.min(lo + sz + sz - 1, N - 1));\n }", "@Override\r\n public void run() {\r\n \r\n while (listsOfSorted.size() > 1) {\r\n \r\n int[] list1 = listsOfSorted.poll();\r\n int[] list2 = listsOfSorted.poll();\r\n int[] newSortedList = new int[list1.length + list2.length];\r\n\r\n int current1 = 0;\r\n int current2 = 0;\r\n int current3 = 0;\r\n\r\n while (current1 < list1.length && current2 < list2.length) {\r\n if (list1[current1] < list2[current2]) {\r\n newSortedList[current3++] = list1[current1++];\r\n } else {\r\n newSortedList[current3++] = list2[current2++];\r\n }\r\n }\r\n\r\n while (current1 < list1.length) {\r\n newSortedList[current3++] = list1[current1++];\r\n }\r\n\r\n while (current2 < list2.length) {\r\n newSortedList[current3++] = list2[current2++];\r\n \r\n }\r\n \r\n listsOfSorted.offer(newSortedList);\r\n \r\n }\r\n System.out.println(Arrays.toString(listsOfSorted.peek()));\r\n \r\n }", "public static <T extends Comparable<? super T>>\n void intersection(SLL<T> list1, SLL<T> list2, SLL<T> result) {\n\n SLLNode<T> iterlist1 = list1.head;\n SLLNode<T> iterlist2 = list2.head;\n\n T itemlist1=null, itemlist2=null;\n\n // get first item in each list\n if ( iterlist1 != null && iterlist2 != null ) {\n itemlist1 = iterlist1.info;\n itemlist2 = iterlist2.info;\n }\n\n while ( itemlist1 != null && itemlist2 != null ) {\n int compareResult = itemlist1.compareTo(itemlist2);\n \n if ( compareResult == 0 ) {\n result.addToTail(itemlist1); //append to result list\n if( iterlist1.next != null ) {\n iterlist1 = iterlist1.next;\n itemlist1 = iterlist1.info;\n } else {\n itemlist1 = null;\n }\n \n if( iterlist2.next != null ) {\n iterlist2 = iterlist2.next;\n itemlist2 = iterlist2.info;\n } else {\n itemlist2 = null;\n } \n }\n else if ( compareResult < 0 ) { \n if( iterlist1.next != null ) {\n iterlist1 = iterlist1.next;\n itemlist1 = iterlist1.info;\n } else {\n itemlist1 = null;\n }\n }\n else {\n if( iterlist2.next != null ) {\n iterlist2 = iterlist2.next;\n itemlist2 = iterlist2.info;\n } else {\n itemlist2 = null;\n }\n }\n }\n }", "@SuppressWarnings(\"squid:S2259\")\n private void mergeInto(RootListNode<K> head, RootListNode<K> tail) {\n // if root list empty, just copy\n if (rootList.head == null) {\n rootList.head = head;\n rootList.tail = tail;\n return;\n }\n\n // initialize\n RootListNode<K> resultHead;\n RootListNode<K> resultTail;\n RootListNode<K> resultTailPrev = null;\n RootListNode<K> cur1 = rootList.head;\n RootListNode<K> cur2 = head;\n\n // add first node\n if (cur1.root.rank <= cur2.root.rank) {\n resultHead = cur1;\n resultTail = cur1;\n RootListNode<K> cur1next = cur1.next;\n cur1.next = null;\n cur1 = cur1next;\n if (cur1next != null) {\n cur1next.prev = null;\n }\n } else {\n resultHead = cur2;\n resultTail = cur2;\n RootListNode<K> cur2next = cur2.next;\n cur2.next = null;\n cur2 = cur2next;\n if (cur2next != null) {\n cur2next.prev = null;\n }\n }\n\n // merge\n int rank1; \n int rank2;\n while (true) {\n int resultRank = resultTail.root.rank;\n\n // read rank1\n if (cur1 != null) {\n rank1 = cur1.root.rank;\n } else {\n if (cur2 != null && cur2.root.rank <= resultRank) {\n rank1 = Integer.MAX_VALUE;\n } else {\n break;\n }\n }\n\n // read rank2\n if (cur2 != null) {\n rank2 = cur2.root.rank;\n } else {\n if (cur1 != null && cur1.root.rank <= resultRank) {\n rank2 = Integer.MAX_VALUE;\n } else {\n break;\n }\n }\n\n if (rank1 <= rank2) {\n switch (Integer.compare(rank1, resultRank)) {\n case 0:\n // combine into result\n resultTail.root = combine(cur1.root, resultTail.root);\n // remove cur1\n RootListNode<K> cur1next = cur1.next;\n cur1.next = null;\n if (cur1next != null) {\n cur1next.prev = null;\n }\n cur1 = cur1next;\n break;\n case -1:\n // can happen if three same ranks\n cur1next = cur1.next;\n // add before tail into result\n cur1.next = resultTail;\n resultTail.prev = cur1;\n cur1.prev = resultTailPrev;\n if (resultTailPrev != null) {\n resultTailPrev.next = cur1;\n } else {\n resultHead = cur1;\n }\n resultTailPrev = cur1;\n // advance cur1\n if (cur1next != null) {\n cur1next.prev = null;\n }\n cur1 = cur1next;\n break;\n case 1:\n // append into result\n resultTail.next = cur1;\n cur1.prev = resultTail;\n resultTailPrev = resultTail;\n resultTail = cur1;\n // remove cur1\n cur1 = cur1.next;\n resultTail.next = null;\n if (cur1 != null) {\n cur1.prev = null;\n }\n break;\n default:\n break;\n }\n } else {\n // symmetric case rank2 < rank1\n switch (Integer.compare(rank2, resultRank)) {\n case 0:\n // combine into result\n resultTail.root = combine(cur2.root, resultTail.root);\n // remove cur2\n RootListNode<K> cur2next = cur2.next;\n cur2.next = null;\n if (cur2next != null) {\n cur2next.prev = null;\n }\n cur2 = cur2next;\n break;\n case -1:\n // can happen if three same ranks\n cur2next = cur2.next;\n // add before tail into result\n cur2.next = resultTail;\n resultTail.prev = cur2;\n cur2.prev = resultTailPrev;\n if (resultTailPrev != null) {\n resultTailPrev.next = cur2;\n } else {\n resultHead = cur2;\n }\n resultTailPrev = cur2;\n // advance cur2\n if (cur2next != null) {\n cur2next.prev = null;\n }\n cur2 = cur2next;\n break;\n case 1:\n // append into result\n resultTail.next = cur2;\n cur2.prev = resultTail;\n resultTailPrev = resultTail;\n resultTail = cur2;\n // remove cur2\n cur2 = cur2.next;\n resultTail.next = null;\n if (cur2 != null) {\n cur2.prev = null;\n }\n break;\n default: \n break;\n }\n\n }\n }\n\n // record up to which point a suffix minimum update is needed\n RootListNode<K> updateSuffixFix = resultTail;\n\n // here rank of cur1 is more than result rank\n if (cur1 != null) {\n cur1.prev = resultTail;\n resultTail.next = cur1;\n resultTail = rootList.tail;\n }\n\n // here rank of cur2 is more than result rank\n if (cur2 != null) {\n cur2.prev = resultTail;\n resultTail.next = cur2;\n resultTail = tail;\n }\n\n // update suffix minimum\n updateSuffixMin(updateSuffixFix);\n\n // store final list\n rootList.head = resultHead;\n rootList.tail = resultTail;\n }", "private static <T,S>void mergeSort(T[] src,S[] src2,\n\t\t\tT[] dest,\n\t\t\tS[] dest2,\n\t\t\tint low, int high, int off,\n\t\t\tComparator c) {\n\t\tint length = high - low;\n\n\t\t// Insertion sort on smallest arrays\n\t\tif (length < INSERTIONSORT_THRESHOLD) {\n\t\t\tfor (int i=low; i<high; i++)\n\t\t\t\tfor (int j=i; j>low && c.compare(dest[j-1], dest[j])>0; j--) \n\t\t\t\t\tswap(dest,dest2,j, j-1);\n\t\t\treturn;\n\t\t}\n\n\t\t// Recursively sort halves of dest into src\n\t\tint destLow = low;\n\t\tint destHigh = high;\n\t\tlow += off;\n\t\thigh += off;\n\t\tint mid = (low + high) >>> 1;\n\t\t\tmergeSort(dest,dest2, src, src2,low, mid, -off, c);\n\t\t\tmergeSort(dest,dest2, src, src2, mid, high, -off, c);\n\n\t\t\t// If list is already sorted, just copy from src to dest. This is an\n\t\t\t// optimization that results in faster sorts for nearly ordered lists.\n\t\t\tif (c.compare(src[mid-1], src[mid]) <= 0) {\n\t\t\t\tSystem.arraycopy(src, low, dest, destLow, length);\n\t\t\t\tSystem.arraycopy(src2, low, dest2, destLow, length);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Merge sorted halves (now in src) into dest\n\t\t\tfor(int i = destLow, p = low, q = mid; i < destHigh; i++) {\n\t\t\t\tif (q >= high || p < mid && c.compare(src[p], src[q]) <= 0) {\n\t\t\t\t\tdest2[i] = src2[p];\n\t\t\t\t\tdest[i] = src[p++];\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tdest2[i] = src2[q];\n\t\t\t\t\tdest[i] = src[q++];\n\t\t\t\t}\n\t\t\t}\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\tprivate static <E extends Comparable<? super E>> void merge(\r\n\t\t\tComparable<E>[] data, int first, int second, int len,\r\n\t\t\tComparable<E>[] target) {\r\n\t\t// indices from first\r\n\t\tint i = 0;\r\n\t\t// indices from second\r\n\t\tint j = 0;\r\n\t\t// index in target to copy to\r\n\t\tint t = first;\r\n\r\n\t\t// main copy smaller element into target loop\r\n\t\t// stop if the right pointer runs off the array\r\n\t\twhile (i < len && j < len && second + j < data.length) {\r\n\t\t\tint cmp = data[first + i].compareTo((E) data[second + j]);\r\n\t\t\tif (cmp > 0) {\r\n\t\t\t\ttarget[t] = data[second + j];\r\n\t\t\t\tj++;\r\n\t\t\t} else {\r\n\t\t\t\ttarget[t] = data[first + i];\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t\tt++;\r\n\t\t}\r\n\r\n\t\t// finish copying from the array that hasn't finished, making sure you\r\n\t\t// don't run off the end of the array\r\n\t\tif (i < len) {\r\n\t\t\t// finish copying first array\r\n\t\t\tfor (int k = i; k < len && first + k < data.length; k++) {\r\n\t\t\t\ttarget[t] = data[first + k];\r\n\t\t\t\tt++;\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\t// finish copying second array\r\n\t\t\tfor (int k = j; k < len && second + k < data.length; k++) {\r\n\t\t\t\ttarget[t] = data[second + k];\r\n\t\t\t\tt++;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void mergeSort(LinkedQueue q) {\n // Your solution here.\n LinkedQueue temp = ListSorts.makeQueueOfQueues(q);\n if (temp.isEmpty())\n {\n return;\n }\n while (temp.size() != 1)\n {\n try\n {\n Object queueOne = temp.dequeue();\n Object queueTwo = temp.dequeue();\n LinkedQueue temp2 = ListSorts.mergeSortedQueues((LinkedQueue) \n queueOne, (LinkedQueue) queueTwo);\n temp.enqueue(temp2);\n }\n catch (QueueEmptyException e)\n {\n e.printStackTrace(); \n }\n }\n \n try \n {\n q.append((LinkedQueue) temp.dequeue());\n } \n catch (QueueEmptyException e) \n {\n // TODO Auto-generated catch block\n e.printStackTrace();\n } \n }", "public static <T extends Comparable<? super T>> void mergeSort(List<T> a){\n // create tmp array \n List<T> tmpArray = new ArrayList<>();\n for(int i = 0; i < a.size(); i++){\n tmpArray.add(null);\n }\n\n // call mergeSort method\n mergeSort(a, tmpArray, 0, a.size()-1);\n }", "private void merge(Object [] arr, int l, int m, int r) \n\t{\n\t\tint n1 = m - l + 1; \n\t\tint n2 = r - m; \n\n\t\t/* Create temp arrays */\n\t\tObject L[] = new Object [n1]; \n\t\tObject R[] = new Object [n2]; \n\n\t\t/*Copy data to temp arrays*/\n\t\tfor (int i=0; i<n1; ++i) \n\t\t\tL[i] = arr[l + i]; \n\t\tfor (int j=0; j<n2; ++j) \n\t\t\tR[j] = arr[m + 1+ j]; \n\n\n\t\t/* Merge the temp arrays */\n\n\t\t// Initial indexes of first and second subarrays \n\t\tint i = 0, j = 0; \n\n\t\t// Initial index of merged subarry array \n\t\tint k = l; \n\t\twhile (i < n1 && j < n2) \n\t\t{ \n\t\t\tint comparison = ((T)L[i]).compareTo((T)R[j]);\n\t\t\tif (comparison <= 0) \n\t\t\t{ \n\t\t\t\tarr[k] = L[i]; \n\t\t\t\ti++; \n\t\t\t} \n\t\t\telse\n\t\t\t{ \n\t\t\t\tarr[k] = R[j]; \n\t\t\t\tj++; \n\t\t\t} \n\t\t\tk++; \n\t\t} \n\n\t\t/* Copy remaining elements of L[] if any */\n\t\twhile (i < n1) \n\t\t{ \n\t\t\tarr[k] = L[i]; \n\t\t\ti++; \n\t\t\tk++; \n\t\t} \n\n\t\t/* Copy remaining elements of R[] if any */\n\t\twhile (j < n2) \n\t\t{ \n\t\t\tarr[k] = R[j]; \n\t\t\tj++; \n\t\t\tk++; \n\t\t} \n\t}", "public void sort(int arr[], int l, int m, int r) \n {\n int n1 = m - l + 1; \n int n2 = r - m; \n /* Create temp arrays */\n int L[] = new int [n1]; \n int R[] = new int [n2]; \n /*Copy data to temp arrays*/\n for (int i=0; i<n1; ++i) \n L[i] = arr[l + i]; \n for (int j=0; j<n2; ++j) \n R[j] = arr[m + 1+ j]; \n /* Merge the temp arrays */\n // Initial indexes of first and second subarrays \n int i = 0, j = 0; \n // Initial index of merged subarry array \n int k = l; \n while (i < n1 && j < n2) \n { \n if (L[i] <= R[j]) \n { \n arr[k] = L[i]; \n i++; \n } \n else\n { \n arr[k] = R[j]; \n j++; \n } \n k++; \n } \n /* Copy remaining elements of L[] if any */\n while (i < n1) \n { \n arr[k] = L[i]; \n i++; \n k++; \n } \n /* Copy remaining elements of R[] if any */\n while (j < n2) \n { \n arr[k] = R[j]; \n j++; \n k++; \n } \n }", "public static <T extends Comparable<? super T>> void mergeSort(List<T> list){\n if(list.size() > 1){\n mergeSort(list, 0, (list.size()/2), list.size() - 1, (T[])new Comparable[list.size()]);\n }\n }", "public static ListNode mergeKLists(ListNode[] lists) {\n ListNode result = new ListNode(-1);\n ListNode curr = result;\n boolean []isEnd = new boolean[lists.length];\n int isEndSum = 0;\n for (int i = 0; i < lists.length; i++) {\n if(list[i]==null)\n {\n isEnd[i] = true;\n isEndSum++;\n }\n }\n while(isEndSum<lists.length){\n int min_index=-1;\n int min=Integer.MAX_VALUE;\n for (int i = 0; i < lists.length; i++) {\n if(isEndSum==lists.length-1)\n {\n break;\n }\n if(lists[i]==null&&!isEnd[i])\n {\n isEnd[i]=true;\n isEndSum++;\n }\n if(!isEnd[i] && (min>lists[i].val))\n {\n min_index = i;\n min = lists[i].val;\n }\n }\n if(min_index!=-1)\n {\n curr.next = new ListNode(min);\n lists[min_index] = lists[min_index].next;\n curr = curr.next;\n }\n if(isEndSum==lists.length-1)\n {\n for (int i = 0; i < lists.length; i++) {\n if(!isEnd[i])\n {\n ListNode tmp = lists[i];\n while(tmp!=null)\n {\n curr.next = tmp;\n tmp = tmp.next;\n curr = curr.next;\n\n }\n isEndSum++;\n break;\n }\n \n }\n }\n\n }\n return result.next;\n }", "public static void mergeSorted(ArrayList<Integer> A, ArrayList<Integer> B) {\n\t\tArrayList<Integer> ans = new ArrayList<Integer>();\n\n\t\tfor (int i : A) {\n\t\t\tans.add(i);\n\t\t}\n\n\t\tfor (int i : B) {\n\t\t\tans.add(i);\n\t\t}\n\n\t\tCollections.sort(ans);\n\t\tSystem.out.println(ans);\n\n\t}", "private static int[] mergeSortedArrays(int[] arr1, int[] arr2) {\n if (arr1 == null\n || arr2 == null\n || arr1.length == 0\n || arr2.length == 0) {\n return new int[]{-1};\n }\n\n int[] mergedArr = new int[arr1.length + arr2.length];\n int lengthOfArrOne = arr1.length;\n int lengthOfArrTwo = arr2.length;\n int indexForFirstArr = 0;\n int indexForSecondArr = 0;\n int indexForMergedArr = 0;\n while (indexForFirstArr < lengthOfArrOne\n && indexForSecondArr < lengthOfArrTwo) {\n if (arr1[indexForFirstArr] < arr2[indexForSecondArr]) {\n mergedArr[indexForMergedArr++] = arr1[indexForFirstArr++];\n } else {\n mergedArr[indexForMergedArr++] = arr2[indexForSecondArr++];\n }\n\n //increase index counter\n //indexForFirstArr++;\n //indexForSecondArr++;\n }\n\n //append the remaining array\n if(indexForFirstArr == lengthOfArrOne\n && indexForSecondArr < lengthOfArrTwo){\n for(int index = indexForSecondArr; indexForSecondArr<lengthOfArrTwo; indexForSecondArr++){\n mergedArr[indexForMergedArr++] = arr2[index];\n }\n }else if(indexForFirstArr < lengthOfArrOne\n && indexForSecondArr == lengthOfArrTwo){\n for(int index = indexForFirstArr; indexForFirstArr<lengthOfArrOne; indexForFirstArr++){\n mergedArr[indexForMergedArr++] = arr1[index];\n }\n }\n\n //decrease the extra space in the last index\n --indexForMergedArr;\n\n return mergedArr;\n }", "private void mergeSort(int low, int high) {\n\t\tif (low < high) {\n\t\t\tint middle = low + (high - low) / 2;\n\t\t\tmergeSort(low, middle);\n\t\t\tmergeSort(middle + 1, high);\n\t\t\tmergeParts(low, middle, high);\n\t\t}\n\t}" ]
[ "0.68264425", "0.6767184", "0.6742535", "0.66359454", "0.66306657", "0.6548423", "0.64574635", "0.6377535", "0.6352814", "0.63273096", "0.62961495", "0.62897664", "0.62764484", "0.6268267", "0.6261277", "0.62481475", "0.6244175", "0.6242339", "0.6242143", "0.62305975", "0.62156874", "0.62060535", "0.6185477", "0.6154646", "0.61463994", "0.6123116", "0.61150306", "0.6103403", "0.6102408", "0.60818785", "0.60809296", "0.6072348", "0.6044228", "0.6036075", "0.6025294", "0.60160863", "0.5992551", "0.59889966", "0.5983738", "0.59705144", "0.59675455", "0.59584516", "0.595667", "0.5948731", "0.5945416", "0.5931898", "0.5915972", "0.5891785", "0.5884964", "0.58827865", "0.5882057", "0.58727413", "0.58685684", "0.5867062", "0.586001", "0.58550835", "0.58509034", "0.58312917", "0.5821201", "0.5815532", "0.5800996", "0.579918", "0.579238", "0.5777015", "0.5762627", "0.5755594", "0.57526284", "0.57454276", "0.57389146", "0.5736415", "0.5736202", "0.5714642", "0.57029945", "0.5697538", "0.56931615", "0.568919", "0.56891084", "0.5687426", "0.5683662", "0.56657434", "0.5659125", "0.56590945", "0.56556046", "0.5650735", "0.56406856", "0.5639056", "0.56359917", "0.56309533", "0.56279486", "0.56166726", "0.56094986", "0.56090724", "0.5606483", "0.56033576", "0.5602716", "0.56010044", "0.55995595", "0.5599148", "0.5592708", "0.5590551" ]
0.7306727
0
Swaps the elements in the x and y indexes in the list passed as a parameter
private static <T> void swap(List<T> list, int x, int y){ T temp = list.get(x); list.set(x, list.get(y)); list.set(y, temp); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void swap(List<Integer> list, int i, int j){\n int temp = list.get(i);\n list.set(i,list.get(j));\n list.set(j, temp);\n }", "public void swapAdjacentElements(int[] values)\n {\n // your work here\n\n\n\n\n }", "private static void swap(Integer[] a, int x, int y) {\n\t\tInteger temp = a[x];\n\t\ta[x] = a[y];\n\t\ta[y] = temp;\n\t}", "private static void swap(int[] a, int x, int y) {\n\t\tint temp = a[x];\n\t\ta[x] = a[y];\n\t\ta[y] = temp;\n\t}", "private static <T,P> void vecswap(List<T> x, List<P> a2,int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x,a2, a, b);\n\t}", "private static <T> void vecswap(List<T> x, int a, int b, int n) {\n for (int i = 0; i < n; i++, a++, b++) {\n swapElements(x, a, b);\n }\n }", "private static <T,S> void swap(List<T> x, List<S> a2, int a, int b) {\n\t\tT t = x.get(a);\n\t\tx.set(a, x.get(b));\n\t\tx.set(b,t);\n\t\tS t2 = a2.get(a);\n\t\ta2.set(a,a2.get(b));\n\t\ta2.set(b,t2);\n\t}", "static void swap(List<CustomCharacter> list, int a, int b){\n CustomCharacter temp = getClone(list, a);\n list.set(a, list.get(b));\n list.set(b, temp);\n }", "private static void swap(Object[] x, int a, int b)\n {\n Object t = x[a];\n x[a] = x[b];\n x[b] = t;\n }", "private static <T,P> void vecswap(T x[], int[] a2,int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x,a2, a, b);\n\t}", "public static void swap(int[] a, int x, int y) {\n int tmp = a[x];\n a[x] = a[y];\n a[y] = tmp;\n }", "public static void swap(List<Integer> values, int i, int j) {\r\n int temp = values.get(i);\r\n values.set(i, values.get(j));\r\n values.set(j, temp);\r\n }", "private static <E> void swap(ArrayList<E> a, int i, int j) {\n\t\tE t = a.get(i);\n\t\ta.set(i, a.get(j));\n\t\ta.set(j, t);\n\t}", "private static <E> void swap(ArrayList<E> a, int i, int j) {\n\t\tE t = a.get(i);\n\t\ta.set(i, a.get(j));\n\t\ta.set(j, t);\n\t}", "private static <T> void vecswap(int x[], double[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x, a2, a, b);\n\t}", "private static void vecswap(int x[], int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x, a, b);\n\t}", "private static <T,P> void vecswap(T x[], P[] a2,int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x,a2, a, b);\n\t}", "private static void vecswap(double x[], int[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x,a2, a, b);\n\t}", "protected static void swapReferences(List<?> array, int a, int b){\n Collections.swap(array, a, b);\n }", "private static <T> void vecswap(int x[], T[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x, a2, a, b);\n\t}", "private void swapElement ( int p1, int p2 )\n\t{\n\t}", "private static <T> void vecswap(float x[],T[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x, a2, a, b);\n\t}", "private static void vecswap(int x[], int[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x, a2, a, b);\n\t}", "public synchronized void elementSwapped(Object newParam, int index1,\n\t\t\tint index2) {\n\n\t\tif (index1 < index2) {\n\t\t\tswapElements(newParam, index1, index2);\n\t\t} else {\n\t\t\tswapElements(newParam, index2, index1);\n\t\t}\n\n\t}", "private static void swap(int x[], int[] a2, int a, int b) {\n\t\tint t = x[a];\n\t\tx[a] = x[b];\n\t\tx[b] = t;\n\t\tint t2 = a2[a];\n\t\ta2[a] = a2[b];\n\t\ta2[b] = t2;\n\t}", "private static void vecswap(double x[], double[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x,a2, a, b);\n\t}", "@Override\n protected void swap(int i, int j)\n {\n E temp = this.elements[i];\n this.elements[i] = this.elements[j];\n \tthis.elementsToArrayIndex.put(elements[i], i);\n this.elements[j] = temp;\n \tthis.elementsToArrayIndex.put(elements[j], j);\n }", "public static void swap2DArr(int a[][], int i, int j, int x, int y) {\n\t\tint temp = a[i][j];\n\t\ta[i][j] = a[x][y];\n\t\ta[x][y] = temp;\n\n\t}", "private static <T> void vecswap(double x[], T[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x,a2, a, b);\n\t}", "private void swap(int firstIdx, int secondIdx) {\r\n // TODO\r\n }", "public static void swap(java.util.List arg0, int arg1, int arg2)\n { return; }", "static void swap(List l, int i1, int i2) {\n\t\tObject tmp=l.get(i1);\n\t\tl.set(i1, l.get(i2));\n\t\tl.set(i2, tmp);\n\t}", "private static <T> void swap(int x[], T[] a2, int a, int b) {\n\t\tint t = x[a];\n\t\tx[a] = x[b];\n\t\tx[b] = t;\n\t\tT t2 = a2[a];\n\t\ta2[a] = a2[b];\n\t\ta2[b] = t2;\n\t}", "private static <T> void swap(int x[], double[] a2, int a, int b) {\n\t\tint t = x[a];\n\t\tx[a] = x[b];\n\t\tx[b] = t;\n\t\tdouble t2 = a2[a];\n\t\ta2[a] = a2[b];\n\t\ta2[b] = t2;\n\t}", "private static <T extends Comparable<T>> void swap(T[] list, int left, int right) {\n\t\tif (left != right) {\r\n\t\t\tT temp = list[left];\r\n\t\t\tlist[left] = list[right];\r\n\t\t\tlist[right] = temp;\r\n\t\t}\r\n\t}", "private static void vecswap(char x[], char[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x, a2, a, b);\n\t}", "public void swap(ArrayList <Comparable> list, int a, int b){\r\n\t\tComparable temp = list.get(a);\r\n\t\tlist.set(a, list.get(b));\r\n\t\tlist.set(b, temp);\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"Swap\");\r\n\t\tSystem.out.println();\r\n\t}", "private static <T> void vecswap(char x[], T[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x, a2, a, b);\n\t}", "private static <T,S> void swap(T x[], int[] a2, int a, int b) {\n\t\tT t = x[a];\n\t\tx[a] = x[b];\n\t\tx[b] = t;\n\t\tint t2 = a2[a];\n\t\ta2[a] = a2[b];\n\t\ta2[b] = t2;\n\t}", "public synchronized void elementSwapped(Object source, int index1,\n\t\t\tObject other, int index2) {\n\n\t}", "private static <T> void vecswap(byte x[], T[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x, a2, a, b);\n\t}", "private static <T> void vecswap(long x[], T[] a2,int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x,a2, a, b);\n\t}", "private void swap(int[] nums, int i, int j) {\n\t\tint tmp=nums[i];\n\t\tnums[i]=nums[j];\n\t\tnums[j]=tmp;\n\t}", "private static void swap(double x[], int[] a2, int a, int b) {\n\t\tdouble t = x[a];\n\t\tx[a] = x[b];\n\t\tx[b] = t;\n\t\tint t2 = a2[a];\n\t\ta2[a] = a2[b];\n\t\ta2[b] = t2;\n\t}", "private void swap(int[] nums, int i, int j) {\n int temp = nums[i];\n nums[i] = nums[j];\n nums[j] = temp;\n }", "private static void swap(double x[], double[] a2, int a, int b) {\n\t\tdouble t = x[a];\n\t\tx[a] = x[b];\n\t\tx[b] = t;\n\t\tdouble t2 = a2[a];\n\t\ta2[a] = a2[b];\n\t\ta2[b] = t2;\n\t}", "private void vecswap(double x[], int a, int b, int n) {\r\n for (int i = 0; i < n; i++, a++, b++) {\r\n swap(x, a, b);\r\n }\r\n }", "public void flipIndexes() {\n int temp = index1;\n index1 = index2;\n index2 = temp;\n }", "public void swap(int index1, int index2) {\n \n }", "private void swap(int x, int y) {\n\t\tint temp = boardConfig[x];\n\t\tboardConfig[x] = boardConfig[y];\n\t\tboardConfig[y] = temp;\n\t}", "void swap(int index_1,int index_2){\n int temp=arr[index_1];\n arr[index_1]=arr[index_2];\n arr[index_2]=temp;\n }", "@Override\n public INDArray swap(INDArray x, INDArray y) {\n //NativeBlas.dswap(x.length(), x.data(), 0, 1, y.data(), 0, 1);\n JavaBlas.rswap(x.length(), x.data(), x.offset(), 1, y.data(), y.offset(), 1);\n return y;\n }", "public static void swap (int[] elts, int i, int j) {\r\n\t\tint temp = elts[i];\r\n\t\telts[i] = elts[j];\r\n\t\telts[j] = temp;\r\n\t}", "public static void swap (int[] elts, int i, int j) {\r\n\t\tint temp = elts[i];\r\n\t\telts[i] = elts[j];\r\n\t\telts[j] = temp;\r\n\t}", "private static void swap(int[] nums, int i, int j) {\n nums[i] += nums[j];\n nums[j] = nums[i] - nums[j];\n nums[i] = nums[i] - nums[j];\n }", "private static <T,S> void swap(T x[], S[] a2, int a, int b) {\n\t\tT t = x[a];\n\t\tx[a] = x[b];\n\t\tx[b] = t;\n\t\tS t2 = a2[a];\n\t\ta2[a] = a2[b];\n\t\ta2[b] = t2;\n\t}", "private void swapAt(int i, int j) {\n\t\tfloat tmp = sequence[i];\n\t\tsequence[i] = sequence[j];\n\t\tsequence[j] = tmp;\n\t}", "@Override\n\tpublic void swap(int pos1, int pos2) {\n\t}", "private static void swap(int[] A, int i, int j) {\n int temp = A[i];\n A[i] = A[j];\n A[j] = temp;\n }", "public void swapPieceValues(int x, int y, int row, int col) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.row = row;\n\t\tthis.col = col;\n\t}", "private static <T> void swap(byte x[],T[] a2, int a, int b) {\n\t\tbyte t = x[a];\n\t\tx[a] = x[b];\n\t\tx[b] = t;\n\t\tT t2 = a2[a];\n\t\ta2[a] = a2[b];\n\t\ta2[b] = t2;\n\t}", "private void swap(int []a, int i, int j){\n\t\tint temp = a[i];\n\t\ta[i] = a[j];\n\t\ta[j] = temp;\n\t}", "private static void swap(int[] arry , int a,int b) {\n int temp = arry[a];\n arry[a]=arry[b];\n arry[b]=temp;\n }", "private static <T> void swap(float x[], T[] a2,int a, int b) {\n\t\tfloat t = x[a];\n\t\tx[a] = x[b];\n\t\tx[b] = t;\n\t\tT t2 = a2[a];\n\t\ta2[a] = a2[b];\n\t\ta2[b] = t2;\n\t}", "private void swap(double x[], int a, int b) {\r\n double t = x[a];\r\n x[a] = x[b];\r\n x[b] = t;\r\n }", "private static <T> void vecswap(short x[], T[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x, a2, a, b);\n\t}", "public static void swap (int x, int y) {\r\n\t\tint t = x;\r\n\t\tx = y;\r\n\t\ty = t;\r\n\t}", "public void putListInPointOrder() {\n for (int i = 0; i < players.size(); i++) {\n Player s = players.get(i);\n if (i < players.size() - 1) {\n for (int j = i; j < players.size(); j++) {\n while (s.getPoint() < players.get(j).getPoint()) {\n Collections.swap(players, i, j);\n }\n\n }\n }\n }\n }", "private void swap(int i, int j) {\n\t\tint tmp = data.get(i);\n\t\tdata.set(i, data.get(j));\n\t\tdata.set(j, tmp);\n\t}", "private void swap(int from, int to) {\n E tmp = array[from];\n array[from] = array[to];\n array[to] = tmp;\n }", "private static <T> void swap(long x[], T[] a2, int a, int b) {\n\t\tlong t = x[a];\n\t\tx[a] = x[b];\n\t\tx[b] = t;\n\t\tT t2 = a2[a];\n\t\ta2[a] = a2[b];\n\t\ta2[b] = t2;\n\t}", "private void switchElements(int a, int b) {\r\n\t\tE temp = c[a];\r\n\t\tc[a] = c[b];\r\n\t\tc[b] = temp;\r\n\t}", "private void swap(int i, int j){\n \t\tint temp = a[i];\n \t\ta[i] = a[j];\n \t\ta[j] = temp;\n }", "static void swapPositions(Piece src, Piece dst) {\n\t\t/* Swap the current positions of the pieces */\n\t\tint tempPosition = src.getPosition();\n \tsrc.setPosition(dst.getPosition());\n \tdst.setPosition(tempPosition);\n \t\n \t/* Swap the pieces in jigsawPieces to ensure that it is sorted by currentPosition */\n\t\tPlay.jigsawPieces.set(src.getPosition(), src);\n\t\tPlay.jigsawPieces.set(dst.getPosition(), dst);\n\t}", "private static void exch(Object[] a, int i, int j) {\n Object swap = a[i];\n a[i] = a[j];\n a[j] = swap;\n }", "private static void exch(Object[] a, int i, int j) {\n Object swap = a[i];\n a[i] = a[j];\n a[j] = swap;\n }", "private static void exch(Object[] a, int i, int j) {\n Object swap = a[i];\n a[i] = a[j];\n a[j] = swap;\n }", "private void swap(int[] a, int i, int j) {\n int tmp = a[i];\n a[i] = a[j];\n a[j] = tmp;\n }", "private static <T> void swap(double x[], T[] a2, int a, int b) {\n\t\tdouble t = x[a];\n\t\tx[a] = x[b];\n\t\tx[b] = t;\n\t\tT t2 = a2[a];\n\t\ta2[a] = a2[b];\n\t\ta2[b] = t2;\n\t}", "private static void swap(int[] a, int i, int j) {\n int swap = a[i];\n a[i] = a[j];\n a[j] = swap;\n }", "static void swap(int[] numbers, int index1, int index2) {\n\t\tint var = numbers[index1];\r\n\t\tnumbers[index1] = numbers[index2];\r\n\t\tnumbers[index2] = var;\r\n\t}", "private static void swap(int[] A, int a, int b){\n\t\tint temp = A[a];\n\t\tA[a] = A[b];\n\t\tA[b] = temp;\n\t}", "private void swap(int[] a, int index1, int index2) {\n int temp = a[index1];\n a[index1] = a[index2];\n a[index2] = temp;\n }", "private static void exch(Object[] a, int i, int j) {\r\n Object swap = a[i];\r\n a[i] = a[j];\r\n a[j] = swap;\r\n }", "private void swap(int index1, int index2) {\n E element1 = getElement(index1);\n E element2 = getElement(index2);\n setElement(index2, element1);\n setElement(index1, element2);\n }", "private void exchange(int i, int j) {\n int temp = numbers[i];\n numbers[i] = numbers[j];\n numbers[j] = temp;\n \n }", "public void swap(int[] nums, int i, int j) {\n int temp = nums[i];\n nums[i] = nums[j];\n nums[j] = temp;\n }", "public static void swap(int[] input, int i, int j){\n\t\tint temp = input[i];\n\t\tinput[i] = input[j];\n\t\tinput[j] = temp;\n\t}", "@Override\n \tpublic void swap(int i, int j) {\n \t\tint t=data[i];\n \t\tdata[i]=data[j];\n \t\tdata[j]=t;\n \t}", "private void swap(int pos1, int pos2) {\n\t\tE temp = apq.get(pos1);\n\t\tapq.set(pos1, apq.get(pos2));\n\t\tapq.set(pos2, temp);\n\n\t\tlocator.set(apq.get(pos1), pos1);\n\t\tlocator.set(apq.get(pos2), pos2);\n\t}", "private static void swap(int x, int y) {\n\t\tint temp = x;\n\t\tx = y;\n\t\ty = temp;\n\t\tSystem.out.println(\"in swap : x = \" + x + \"; y = \" + y);\n\t\t\n\t}", "public static void swapCity2(ArrayList<City> routine, int index1, int index2, int num) {\n int i = 0;\n while(i < num){\n City temp = routine.get(index1 + i);\n routine.set(index1 + i, routine.get(index2 + i));\n routine.set(index2 + i, temp);\n i++;\n }\n \n }", "public void swap(int i, int j) {\n int temp = a[i];\n a[i] = a[j];\n a[j] = temp;\n }", "private int[] swap(int[] a, int i, int j) {\n int tmp;\n tmp = a[i];\n a[i] = a[j];\n a[j] = tmp;\n return a;\n }", "private static void swap(int[] array, int ind1, int ind2) {\n int temp = array[ind1];\n array[ind1] = array[ind2];\n array[ind2] = temp;\n }", "private static void swap(int[] array, int index1, int index2) {\n int x = array[index1];\n array[index1] = array[index2];\n array[index2] = x;\n }", "private void swap(int[] values, int p1, int p2) {\n int temp = values[p1];\n values[p1] = values[p2];\n values[p2] = temp;\n moves++;\n }", "private void swap(int i, int j) {\n\t\tlong temp = a[i];\n\t\ta[i] = a[j];\n\t\ta[j] = temp;\n\t}", "public static ArrayList<String>\n swap(ArrayList<String> list,int pos1,int pos2)\n { Collections.swap(list,pos1,pos2);\n return list;\n }", "private static void swap(int[] arr, int a, int b) {\n int temp = arr[a];\n arr[a] = arr[b];\n arr[b] = temp;\n }" ]
[ "0.6982257", "0.68490106", "0.6783818", "0.67692024", "0.67533284", "0.6723598", "0.6686065", "0.6681535", "0.6513651", "0.6412165", "0.6399929", "0.6389672", "0.63894945", "0.63894945", "0.63833207", "0.63717014", "0.6364414", "0.636061", "0.6352174", "0.6336906", "0.6334852", "0.6324157", "0.6318516", "0.63084537", "0.6305", "0.6272378", "0.62712246", "0.6236461", "0.622694", "0.62241364", "0.6215651", "0.6205701", "0.62047106", "0.6188362", "0.61606777", "0.6150664", "0.61505383", "0.61498106", "0.6146494", "0.61462885", "0.61407256", "0.6140566", "0.61333036", "0.61299324", "0.61119014", "0.6101772", "0.6095278", "0.6076597", "0.6072151", "0.6069798", "0.60692126", "0.6063199", "0.6052113", "0.6052113", "0.6044547", "0.6033586", "0.6005012", "0.60020965", "0.6001488", "0.5986819", "0.5982002", "0.59775877", "0.59656173", "0.59647787", "0.5962204", "0.59609175", "0.5960186", "0.5950949", "0.59470844", "0.5941694", "0.59381664", "0.59314805", "0.5914304", "0.59056854", "0.58948016", "0.58948016", "0.58948016", "0.58916456", "0.58798444", "0.5875887", "0.58679825", "0.58677036", "0.58597827", "0.5855711", "0.5855133", "0.584835", "0.58481634", "0.584388", "0.58384573", "0.58350366", "0.5833905", "0.58325964", "0.5820135", "0.58190054", "0.5817006", "0.5812498", "0.58033574", "0.5795937", "0.5780673", "0.5778308" ]
0.75193214
0
An ARD broker connection in the Instance state.
public interface ARDInstance extends Closeable { public InstanceMap getMap(); /** * Provide a subscriber interface that gets notified when the broker receives marker changes. * * @param subscriber */ public void setSubscriber(ARDInstanceSubscriber subscriber); /** * Notify the instance on ARDd that the device has moved. * * @param geoCoord The new location * @throws ARDInstanceException */ public void move(GeoCoordFine geoCoord) throws ARDInstanceException; public void close() throws IOException; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void connectionEstablished() {}", "public void connect() {}", "@Override\n public boolean isConnectable() {\n return true;\n }", "@Override public String brokerAddress() { return brokerAddress; }", "private void connectToABBOE() throws IOException, IllegalArgumentsException {\n Socket socket = Biomine3000Utils.connectToServer(args);\n this.connection = new ABBOEConnection(CLIENT_PARAMS, socket, log);\n this.connection.init(new ObjectHandler());\n \n }", "@Override\n public abstract void connect();", "ST setArrivalConnection(ST connection);", "public void connecting() {\n\n }", "@Override\n\tpublic void connect() {\n\t\t\n\t}", "@Override\n\tpublic void connect() {\n\t\t\n\t}", "@Override\r\n\tpublic ServerBean connect() throws RemoteException {\n\t\tSystem.out.println(\"coming from DealServerImp\");\r\n\t\treturn null;\r\n\t}", "public void connect();", "public void connect();", "public void connect();", "public BamStream getBrokerStream()\n {\n return this;\n }", "public IPConnection() {\n\t\tbrickd = new BrickDaemon(\"2\", this);\n\t}", "interface Connect extends RconConnectionEvent, Cancellable {}", "protected abstract void onConnect();", "public WarpConnection getConnection() {\r\n return(this.connection);\r\n }", "public ConnectionConfig createConnection()\n {\n return _connectionConfig;\n }", "public abstract Connection getConnection();", "private Connection() {\n\t\tSystem.out.println(\"--Connection Created--\");\n\t}", "public Connection getConnection();", "public Connection getConnection();", "public Connection getConnection();", "public Connection ObtenirConnexion(){return cn;}", "protected IXConnection getConnection() {\n return eloCmisConnectionManager.getConnection(this.getCallContext());\n }", "public abstract void onConnect();", "public String getConnection()\n {\n return this.connection;\n }", "public void onConnection();", "abstract void onConnect();", "public\n Connection getConnection();", "Connection createConnection();", "protected void onConnect() {}", "public Broker() {\n\t\tbrokerSocket = null;\n\t\tclientSocket = null;\n\t\tresWriter = null;\n\t\tmqttReader = null;\n\t\tportNumber = 1883;\n\t}", "public Connection getConnection() {\n \t\treturn this.connect;\n \t}", "abstract public void openConnection();", "public boolean isConnectionActive(){\n return this.connectionActive;\n }", "public Connection getConn() {return conn;}", "public void connect()\n {\n \tLog.d(TAG, \"connect\");\n \t\n \tif(!this.isConnected ) {\n mContext.bindService(new Intent(\"com.google.tungsten.LedService\"), mServiceConnection, \n \t\tContext.BIND_AUTO_CREATE);\n \t}\n }", "public Connection getConnection() {\r\n return connection;\r\n }", "public Connection getConnection() {\r\n return connection;\r\n }", "@Override\n public void establishConnectionWithYourTower() {\n }", "private Connection getConn(){\n \n return new util.ConnectionPar().getConn();\n }", "public String getBrokerId() {\n return brokerId;\n }", "public String getBrokerId() {\n return brokerId;\n }", "protected void connect() {\n\t\treadProperties();\n\t\tif (validateProperties())\n\t\t\tjuraMqttClient = createClient();\n\t}", "public Connection getConnection(){\r\n\t\treturn connection;\r\n\t}", "InstrumentedConnection getConnection();", "@Override\n public void connectionLost(Throwable t) {\n System.out.println(\"Connection lost!\");\n // code to reconnect to the broker would go here if desired\n }", "public Connection getConnection() {\n return conn;\n }", "public Connection getConnection() {\n return conn;\n }", "NodeConnection createNodeConnection();", "protected Connection getConnection() {\r\n\t\treturn getProcessor().getConnection();\r\n\t}", "public void startConnection(){\n startBTConnection(mBTDevice,MY_UUID_INSECURE);\n }", "public void connect() {\n try {\n socket = connectToBackEnd();\n } catch (IOException ioe) {\n ioe.printStackTrace();\n }\n }", "protected Connection getConnection () {\n \t\treturn connection;\n \t}", "public Connection getConnection() {\n return connection;\n }", "private void openConnection(){}", "public IConnection getConnection () { \n\t\treturn connection;\n\t}", "ClientConnection connection();", "void connectionActivity(ConnectionEvent ce);", "public void setConnectionActive(boolean connectionActive){\n this.connectionActive = connectionActive;\n }", "public void connect() {\n if (isShutdown)\n return;\n\n setNewConnection(reconnectInternal());\n }", "public Status connect()\n {\n return connect(5.0);\n }", "public synchronized void startConnection ()\r\n\t{\r\n \t\tsynchronized (this)\r\n \t\t{\r\n \t\t\tif (_roboCOM!=null) return;\r\n\t\t\t\r\n\t\t\tuitoken++;\r\n\t\t\t_roboCOM = new TCPClient (MsgQueue,cm,uitoken);\r\n\r\n\t\t\t// debug parameters\r\n\t\t\t_roboCOM.msgHello=\"Start Connection ACCE\";\r\n\t\t\t\t\t\t\t\r\n\t \t \tnew Thread (_roboCOM).start();\r\n \t\t}\r\n\t}", "public void open(String address, int port, Handler<AsyncResult<AmqpBridge>> openHandler) {\n\n this.client = ProtonClient.create(this.vertx);\n\n // TODO: check correlation between MQTT and AMQP keep alive\n ProtonClientOptions clientOptions = new ProtonClientOptions();\n clientOptions.setHeartbeat(this.mqttEndpoint.keepAliveTimeSeconds() * 1000);\n\n String userName = (this.mqttEndpoint.auth() != null) ? this.mqttEndpoint.auth().getUsername() : null;\n String password = (this.mqttEndpoint.auth() != null) ? this.mqttEndpoint.auth().getPassword() : null;\n // NOTE : if username/password are null then Vert.x Proton just provides SASL ANONYMOUS as supported mechanism\n // otherwise it provides PLAIN with username/password provided here\n this.client.connect(clientOptions, address, port, userName, password, done -> {\n\n String clientIdentifier = this.mqttEndpoint.clientIdentifier();\n if (done.succeeded()) {\n\n this.connection = done.result();\n this.connection\n .closeHandler(remoteClose -> handleRemoteConnectionClose(this.connection, remoteClose))\n .disconnectHandler(this::handleRemoteDisconnect)\n .open();\n\n // setup MQTT endpoint handlers and AMQP endpoints\n this.setupMqttEndpoint();\n this.setupAmqpEndpoits();\n\n // setup a Future for completed connection steps with all services\n // with AMQP_WILL and AMQP_LIST/AMQP_SUBSCRIPTIONS or AMQP_CLOSE handled\n Future<AmqpSubscriptionsMessage> connectionFuture = Future.future();\n connectionFuture.setHandler(ar -> {\n\n try {\n if (ar.succeeded()) {\n\n this.rcvEndpoint.publishHandler(this::publishHandler);\n this.rcvEndpoint.pubrelHandler(this::pubrelHandler);\n\n AmqpSubscriptionsMessage amqpSubscriptionsMessage = ar.result();\n\n if (amqpSubscriptionsMessage != null) {\n this.mqttEndpoint.accept(!amqpSubscriptionsMessage.topicSubscriptions().isEmpty());\n // added topic subscriptions of a previous session in the local collection\n this.grantedQoSLevels = amqpSubscriptionsMessage.topicSubscriptions()\n .stream()\n .collect(Collectors.toMap(amqpTopicSubscription -> amqpTopicSubscription.topic(),\n amqpTopicSubscription -> amqpTopicSubscription.qos()));\n\n } else {\n this.mqttEndpoint.accept(false);\n this.grantedQoSLevels = new HashMap<>();\n }\n LOG.info(\"CONNACK [{}] to MQTT client {} at {}\", CONNECTION_ACCEPTED.ordinal(),\n clientIdentifier, this.remoteAddress);\n\n // open unique client publish address receiver\n this.rcvEndpoint.openPublish();\n\n openHandler.handle(Future.succeededFuture(AmqpBridge.this));\n\n } else {\n\n this.mqttEndpoint.reject(CONNECTION_REFUSED_SERVER_UNAVAILABLE);\n LOG.error(\"CONNACK [{}] to MQTT client {} at {}\", CONNECTION_REFUSED_SERVER_UNAVAILABLE.ordinal(),\n clientIdentifier, this.remoteAddress);\n\n openHandler.handle(Future.failedFuture(ar.cause()));\n }\n }\n finally\n {\n openedFuture.complete();\n }\n });\n\n // step 1 : send AMQP_WILL to Last Will and Testament Service\n Future<ProtonDelivery> willFuture = Future.future();\n // if remote MQTT has specified the will\n if (this.mqttEndpoint.will().isWillFlag()) {\n\n // sending AMQP_WILL\n MqttWill will = this.mqttEndpoint.will();\n\n AmqpWillMessage amqpWillMessage =\n new AmqpWillMessage(will.isWillRetain(),\n will.getWillTopic(),\n MqttQoS.valueOf(will.getWillQos()),\n Buffer.buffer(will.getWillMessageBytes()));\n\n // specified link name for the Last Will and Testament Service as MQTT clientid\n ProtonLinkOptions linkOptions = new ProtonLinkOptions();\n linkOptions.setLinkName(clientIdentifier);\n\n // setup and open AMQP endpoints to Last Will and Testament Service\n ProtonSender wsSender = this.connection.createSender(AmqpLwtServiceEndpoint.LWT_SERVICE_ENDPOINT, linkOptions);\n this.lwtEndpoint = new AmqpLwtServiceEndpoint(wsSender);\n\n this.lwtEndpoint.open();\n this.lwtEndpoint.sendWill(amqpWillMessage, willFuture);\n\n } else {\n\n // otherwise just complete the Future\n willFuture.complete();\n }\n\n willFuture.compose(v -> {\n\n // handling AMQP_SUBSCRIPTIONS reply from Subscription Service\n this.rcvEndpoint.subscriptionsHandler(amqpSubscriptionsMessage -> {\n\n LOG.info(\"Session present: {}\", !amqpSubscriptionsMessage.topicSubscriptions().isEmpty());\n LOG.info(amqpSubscriptionsMessage.toString());\n\n connectionFuture.complete(amqpSubscriptionsMessage);\n });\n\n // step 2 : send AMQP_CLOSE or AMQP_LIST (based on \"clean session\" flag) to Subscription Service\n Future<ProtonDelivery> sessionFuture = Future.future();\n\n if (this.mqttEndpoint.isCleanSession()) {\n\n // sending AMQP_CLOSE\n AmqpCloseMessage amqpCloseMessage =\n new AmqpCloseMessage(clientIdentifier);\n\n this.ssEndpoint.sendClose(amqpCloseMessage, closeAsyncResult -> {\n\n // in case of AMQP_CLOSE, the connection completes on its disposition\n // no other AMQP message will be delivered by Subscription Service (i.e. AMQP_SUBSCRIPTIONS)\n if (closeAsyncResult.succeeded()) {\n connectionFuture.complete();\n } else {\n connectionFuture.fail(closeAsyncResult.cause());\n }\n });\n\n } else {\n\n // sending AMQP_LIST\n AmqpListMessage amqpListMessage =\n new AmqpListMessage(clientIdentifier);\n\n this.ssEndpoint.sendList(amqpListMessage, sessionFuture);\n }\n\n return sessionFuture;\n\n }).compose(v -> {\n // nothing here !??\n }, connectionFuture);\n\n // timeout for the overall connection process\n vertx.setTimer(AMQP_SERVICES_CONNECTION_TIMEOUT, timer -> {\n if (!connectionFuture.isComplete()) {\n connectionFuture.fail(\"Timeout on connecting to AMQP services\");\n }\n });\n\n } else {\n\n LOG.error(\"Error connecting to AMQP services ...\", done.cause());\n final MqttConnectReturnCode code;\n if (done.cause() instanceof SecurityException) {\n // error on the SASL mechanism side\n code = CONNECTION_REFUSED_NOT_AUTHORIZED;\n } else {\n code = CONNECTION_REFUSED_SERVER_UNAVAILABLE;\n\n }\n this.mqttEndpoint.reject(code);\n\n openHandler.handle(Future.failedFuture(done.cause()));\n\n LOG.info(\"CONNACK [{}] to MQTT client {} at {}\", code.ordinal(),\n clientIdentifier, this.remoteAddress);\n }\n\n });\n\n }", "Connection getConnection() {\n\t\treturn connection;\n\t}", "public Connection getConnection()\n\t{\n\t\treturn connection;\n\t}", "void createConnection();", "void connectionCreated();", "public String getBrokerId() {\n return brokerId;\n }", "public String getBrokerId() {\n return brokerId;\n }", "@Override\r\n public DBusConnection getDbusConnection() {\r\n return dbusConnection;\r\n }", "private void establishConnection() {\n\n try {\n\n for(Clone clone:this.clones){\n ClearConnection connection = new ClearConnection();\n connection.connect(clone.getIp(), clone.getOffloadingPort(), 5 * 1000);\n this.connections.add(connection);\n }\n\n this.protocol = new ERAMProtocol();\n this.ode = new ERAMode();\n\n } catch (Exception e) {\n Log.e(TAG,\"Connection setup with the Remote Server failed - \" + e);\n }\n }", "@NonNull\n protected final Connection getConnection() {\n return mConnection;\n }", "public Connection getConnection() {\n this.connect();\n return this.connection;\n }", "public Connection getConnection() {\n\t\treturn this.connection;\n\t}", "public static void openConnection() {\n\t\tarcade.startConnection();\n\t}", "private void openConnection () {\n String[] labels = {\"Host :\", \"Port :\"};\n String[] initialValues = {\"localhost\", \"1111\"};\n StandardDialogClient openHandler = new StandardDialogClient () {\n\t@Override\n\tpublic void dialogDismissed (StandardDialog d, int code) {\n\t try {\n\t InputDialog inputD = (InputDialog)d;\n\t if (inputD.wasCancelled ()) return;\n\t String[] results = inputD.getResults ();\n\t String host = results[0];\n\t String port = results[1];\n\t TwGateway connection =\n\t (TwGateway)TwGateway.openConnection (host, port);\n\t // The following call will fail if the G2 is secure.\n\t connection.login();\n\t setConnection (connection);\n\t } catch (Exception e) {\n\t new WarningDialog (null, \"Error During Connect\", true, e.toString (), null).setVisible (true);\n\t }\n\t}\n };\t \n\n new ConnectionInputDialog (getCurrentFrame (), \"Open Connection\",\n\t\t\t\t true, labels, initialValues,\n\t\t\t\t (StandardDialogClient) openHandler).setVisible (true);\n }", "public Connection getConnection()\n\t{\n\t\treturn wConn;\n\t}", "public interface RobotConnectionManager {\n RobotConnection getConnection();\n}", "protected abstract boolean isConnected();", "public Connection getMyConnection(){\n return myConnection;\n }", "public Connection getConn() {\r\n return conn;\r\n }", "protected Connection getConnection() {\n return con;\n }", "@Override\r\n\t\tpublic void onConnect(Connection connection) {\n\r\n\t\t}", "public Connection getConn()\r\n\t{\r\n\t\treturn this.conn;\r\n\t}", "public static Connection getConnection() {\n return singleInstance.createConnection();\n }", "public void setConn(Connection conn) {this.conn = conn;}", "void notifyConnectionStateChanged(State state);", "public boolean connectionAlive() throws RemoteException;", "@Bean\n BrokerService broker() throws Exception {\n BrokerService broker = new BrokerService();\n // configure the broker\n broker.addConnector(BROKER_URL);\n broker.start();\n return broker;\n }", "abstract public boolean createConnection();", "io.netifi.proteus.admin.om.Connection getConnection(int index);", "@Pure\n\tST getArrivalConnection();", "protected abstract boolean sharedConnectionEnabled();", "public Connections getConnections();", "public Connection(ActionListener al) {\r\n this.al = al;\r\n init();\r\n \r\n }", "public Connection getConn()\n\t{\n\t\treturn this.conn;\n\t}" ]
[ "0.60451156", "0.5995148", "0.58643895", "0.5861701", "0.5846698", "0.5827355", "0.58213174", "0.5760253", "0.57388073", "0.57388073", "0.57180035", "0.56915045", "0.56915045", "0.56915045", "0.5658507", "0.56575453", "0.5652639", "0.5645539", "0.56217146", "0.560984", "0.56066585", "0.5605409", "0.56035674", "0.56035674", "0.56035674", "0.5602019", "0.5580797", "0.5573194", "0.557265", "0.5567497", "0.5566574", "0.55571455", "0.5555367", "0.5551076", "0.553826", "0.5503194", "0.5498428", "0.54894215", "0.5484668", "0.547379", "0.5471481", "0.5471481", "0.54705346", "0.5462072", "0.54594487", "0.54594487", "0.54571295", "0.54502285", "0.5446411", "0.5438536", "0.54339314", "0.54339314", "0.5432176", "0.54305804", "0.54155326", "0.54153967", "0.5411184", "0.54098284", "0.5409671", "0.539988", "0.5394041", "0.5392941", "0.5391935", "0.5387622", "0.5385007", "0.5383536", "0.53779876", "0.5365426", "0.53639257", "0.53619635", "0.53581625", "0.53574604", "0.53574604", "0.53572667", "0.53566384", "0.53540164", "0.5353844", "0.53401595", "0.5331636", "0.53091836", "0.53036755", "0.5303347", "0.530066", "0.52943516", "0.52905107", "0.5283263", "0.5267899", "0.5262638", "0.52573144", "0.5253866", "0.52502483", "0.52493155", "0.52423924", "0.5239173", "0.5238862", "0.52363247", "0.52309036", "0.5224588", "0.52198917", "0.5219709" ]
0.5398236
60
Provide a subscriber interface that gets notified when the broker receives marker changes.
public void setSubscriber(ARDInstanceSubscriber subscriber);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface StationMarkerListener {\n void onNewMarkers(List<StationMarker> markers);\n}", "public interface Listener{\n\t\tpublic void notify(Map<String,Serializable> datas);\n\t}", "public interface ReceiverObserver {\n\n void update(DataNotification notification);\n}", "public interface OnMyMarkerListener {\n\n void onLongPress(MyMarker marker);\n }", "void subscribeReceiveListener(IDataReceiveListener listener);", "public void subscribe( Observer< S, Info > obs );", "public interface ISubscriber {\r\n\r\n\tpublic void setName(String name);\r\n\tpublic String getName();\r\n\tpublic void notifyMe();\r\n}", "public interface MarkAsReadNotificationCallback {\n void onNotificationMarkedAsRead(int pos);\n\n void onNotificationMarkAsReadFailed();\n}", "public interface VerificateObservable {\n\n\n public void notifyDataChange();\n\n /**\n * subscribe to Obervable\n * @param obs Observer that want to be be subscribe\n */\n public void addLikeObserver(VerificateObserver obs);\n\n public void removeObserver(VerificateObserver obs);\n\n\n public void setGlobalParamActivator(GlobalParamActivator globalParamActivator);\n}", "public interface ISubscriber {\n void onPropertyChange(String property);\n}", "public interface ObservableListener<T> {\n /**\n * Is called upon an update to the observable\n */\n public void onUpdate(T oldValue, T newValue);\n}", "public interface IntfOnChange\n{\n /**\n The method is called when the broker sends a change notification event.\n\n @param subscribers the number of clients subscribed to the topic.\n @param tid the topic name requested or the ephemeral topic ID\n requested to be observed.\n */\n public void smqOnChange(final long subscribers, final long tid);\n}", "public interface MyObserver {\n\n public void myNotify(MyObservable observable);\n\n}", "public interface Observer {\n\tvoid update(Observable o, String event);\n}", "@Override\n public void register(Object subscriber) {\n }", "public interface EventReceiver {\n\n void onNotify(Event event);\n\n }", "@Override\n\tpublic void NotifyObserver() {\n\n\t}", "interface MessageCallback {\n /**\n * Called when a new message arrives on the subscription consumer. the\n * message should be delivered to the STOMP client.\n * \n * @param subscription\n * the original subscription information\n * @param msg\n * the message that just arrived\n */\n public void onMessage(ClientSubscription subscription,\n HazelcastMQMessage msg);\n }", "protected abstract void registerObserver();", "public interface INotificationListener extends INotifyObject{\r\n\t\r\n\tvoid OnNotificationEvent(int notification, INotifyObject notificationData);\r\n}", "public interface SubscriptionListener {\n public void onReceivedMessage(String message);\n}", "public interface Listener {\n\n /** Called when the tracked downloads changed. */\n void onDownloadsChanged();\n }", "public interface Listener {\n\n /** Called when the tracked downloads changed. */\n void onDownloadsChanged();\n }", "public interface Observer {\n /**\n * Called when createAndSetLocalDescription or setRemoteDescription failed.\n */\n void onFailure(String description);\n\n /**\n * Called when createAndSetLocalDescription succeeded.\n */\n void onLocalDescriptionCreatedAndSet(SessionDescriptionType type, String description);\n\n /**\n * Called when setRemoteDescription succeeded.\n */\n void onRemoteDescriptionSet();\n\n /**\n * New ICE candidate available. String representation defined in the IceCandidate class.\n * To be sent to the remote peer connection.\n */\n void onIceCandidate(String iceCandidate);\n\n /**\n * Called when connected or disconnected. In disconnected state recovery procedure\n * should only rely on signaling channel.\n */\n void onIceConnectionChange(boolean connected);\n }", "@Override\n\tpublic void info(Marker marker, String message) {\n\n\t}", "public interface Observer {\n\n void register(Listener listener);\n void unRegister(Listener listener);\n void update(String name);\n String getName();\n}", "@Override\n\tpublic void info(Marker marker, Object message) {\n\n\t}", "@Override\n\tpublic void info(Marker marker, MessageSupplier msgSupplier) {\n\n\t}", "public void onSubscribe() {\n\n }", "public interface Client extends ClientBase {\n\n\t/**\n\t * Adds a new listener for the client.<br>\n\t * <b>Note</b> that listeners should be added immediately when receiving the incoming notification.\n\t */\n\tpublic Client addListener(ClientListener listener);\n\n}", "public interface onMarkerClickListener{\n void onMarkerClick(int id);\n }", "public interface OSCMessageObserver {\r\n\t\r\n\t/**\r\n\t * Sets the received OSC message to the data management class to process it.\r\n\t * <p>\r\n\t * This method is automatically called when a new OSC message is received.\r\n\t * \r\n\t * @param aMessage the received OSC message\r\n\t */\r\n\tpublic void messageReceived(OscMessage aMessage);\r\n}", "public interface MapPresenter {\n /**\n * 注册广播\n */\n void registerReceiver();\n\n /**\n * 注销广播\n */\n void unregisterReceiver();\n}", "public interface MapMarkerClickHandler {\r\n\r\n\t\t\r\n\t////////////////////////////////////////////////////////////\r\n\t// PUBLIC INTERFACE METHODS\r\n\t////////////////////////////////////////////////////////////\r\n\tpublic void markerClicked(Object markerId,\r\n\t\t\t\t\t\t\t\tString markerLabel,\r\n\t\t\t\t\t\t\t\tint clickXCoordinate,\r\n\t\t\t\t\t\t\t\tint clickYCoordinate);\r\n\r\n\r\n\t\r\n}", "public interface Observer<T> {\n\n /**\n * Notifies the observer that the provider has finished sending push-based notifications.\n */\n void onComplete();\n\n /**\n * Notifies the observer that the provider has experienced an error condition.\n * @param throwable An object that provides additional information about the error.\n */\n void onError(Throwable throwable);\n\n /**\n * Provides the observer with new data.\n * @param item The current notification information.\n */\n void onNext(T item);\n}", "public interface DataObserver {\n }", "public interface BioObserver {\n\n\t/**\n\t * Updates the application according to the message passed by an observable class.\n\t * This happens whenever the observer class gets notified by an observable class.\n\t *\n\t * @param message\n\t * - the message transmitted when the observer gets notified.\n\t */\n\tpublic abstract void update(Message message);\n\n}", "public interface INotifyChangeListenerServer\n{\n /**\n * 患者状态监听\n *\n * @param listener 消息状态监听器\n * @param registerType 注册类型\n */\n void registerPatientStatusChangeListener(@NonNull IChange<String> listener, @NonNull RegisterType registerType);\n\n /**\n * 医生状态监听\n *\n * @param listener 接收消息监听器\n * @param registerType 注册类型\n */\n void registerDoctorStatusChangeListener(@NonNull IChange<String> listener, @NonNull RegisterType registerType);\n /**\n * 医生转诊申请监听\n *\n * @param listener 接收消息监听器\n * @param registerType 注册类型\n */\n void registerDoctorTransferPatientListener(@NonNull IChange<String> listener, @NonNull RegisterType registerType);\n /**\n * 医生认证状态监听\n *\n * @param listener 接收消息监听器\n * @param registerType 注册类型\n */\n void registerDoctorAuthStatusChangeListener(@NonNull IChange<Integer> listener, @NonNull RegisterType registerType);\n /**\n * 最近联系人监听\n *\n * @param listener 接收消息监听器\n * @param registerType 注册类型\n */\n void registerRecentContactChangeListener(@NonNull IChange<String> listener, @NonNull RegisterType registerType);\n /**\n * 服务包订单状态\n *\n * @param listener 接收消息监听器\n * @param registerType 注册类型\n */\n void registerOrderStatusChangeListener(@NonNull IChange<String> listener, @NonNull RegisterType registerType);\n}", "public interface BPSubject {\n\n void registerObserver(BPObserver bpObserver);\n\n void removeObserver(BPObserver bpObserver);\n\n void notifyItemInserted(Object obj);\n\n void notifyItemChanged(Object obj);\n\n void notifyItemRemoved(Object obj);\n\n}", "interface Observer {\r\n public void update(String msg);\r\n}", "@Override\n\tpublic void info(Marker marker, Message msg) {\n\n\t}", "public interface ClientUpdateListener {\n\n /**\n * This method notify the implementer that a message has been received\n *\n * @param message the received message from the server\n */\n void onUpdate(Message message);\n}", "@Override\n\tpublic void info(Marker marker, CharSequence message) {\n\n\t}", "@Override\n public void subscribe(ISubscriber subscriber) {\n subscribers.add(subscriber);\n }", "public interface Observer {\n /**\n * This method is called by observed object (Observable) when it wants to notify their observers.\n */\n void update();\n}", "public interface NotificationListener {\n void onReceivedNotification(Notification notification);\n void onRemovedNotification(Notification notification);\n}", "public interface OnDeliveriesUpdatedListener {\n void onDeliveriesUpdated(List<Delivery> deliveries);\n}", "public interface DistanceSubscriber extends Subscriber<DistanceEvent>{\n}", "public interface Listener {\n\n public void onRecievedCustomBroadCast(String msg);\n}", "public interface Observer {\n public void hearTelephone(String hearMess);\n}", "public abstract void publishSelf (SubscriberInterface subscriber);", "public interface Inner_3dMap_locationListener\n{\n\n\tpublic abstract void onLocationChanged(Inner_3dMap_location inner_3dmap_location);\n}", "public interface ArtistResponseListener {\n\t// you can define any parameter as per your requirement\n\tpublic void callbackArtistResponse(List<Artist>artistList);\n}", "public interface ISubsManager {\n\n public void subscribe(NodeId nodeId);\n}", "@Override\n\t\t\t\tpublic void notifyReceived(LinphoneCore lc, LinphoneCall call,\n\t\t\t\t\t\tLinphoneAddress from, byte[] event) {\n\t\t\t\t\t\n\t\t\t\t}", "public interface OnMarkerClickListener{\n\t\tabstract boolean onMarkerClick(Marker marker, MapView mapView); \n\t}", "public interface Observer {\n\tpublic abstract void update(ArrayList<Document> documents);\n}", "public interface Publisher {\n\n public void registerObserver(Observer o);\n public void removeObserver(Observer o);\n public void notifyObservers();\n\n\n}", "public interface PositioningListener extends SignalListener {\n\n /**\n\t * This method is called by the positioning system in order to notify new\n\t * location information.\n\t * \n\t * @param data the current position information\n\t */\n public void updatePositioningData(PositioningData data);\n\n /**\n * This method is called by the positioning system in order to notify that\n * there is currently no position info available (e.g. if a GPS receiver\n * is operated indoors).\n */\n // TODO diese Methode ist überflüssig\n// public void removePositioningData();\n\n /**\n * Use this signal in order to send all positioning system listeners that\n * device position has to be updated.\n */\n public static class UpdateLocationInfoSignal implements Signal {\n\n private PositioningData locationSystemInfo;\n\n /**\n * Construct a new position info signal\n * @param positioningData the new position information\n */\n public UpdateLocationInfoSignal(PositioningData positioningData) {\n this.locationSystemInfo = positioningData;\n }\n\n public void handle(SignalListener service) {\n PositioningListener listener = (PositioningListener)service;\n listener.updatePositioningData(locationSystemInfo);\n }\n\n public Dispatchable copy() {\n return this;\n }\n\n public Class getReceiverServiceClass() {\n return PositioningListener.class;\n }\n\n }\n\n /**\n * Use this signal in order to notify all positioning system listeners that\n * there is no valid position information available at the moment.\n */\n public static class RemoveLocationInfoSignal implements Signal {\n\n public Class getReceiverServiceClass() {\n return PositioningListener.class;\n }\n\n public void handle(SignalListener service) {\n PositioningListener listener = (PositioningListener)service;\n listener.updatePositioningData(null);\n }\n\n public Dispatchable copy() {\n return this;\n }\n \n }\n\n}", "public interface OnJokeReceivedListener\n{\n void onJokeReceived(String joke);\n}", "public interface Publisher {\n\n public void registerObserver(Observer observer);\n public void notifyAllObservers(String eventName,String message);\n\n}", "public interface OnReceiveListener {\n\n /**\n * Called when client receives a message.\n * @param response received message.\n */\n void onReceive( String response );\n }", "public interface NotifyLocationObtained {\n void onSuccess(Pair<Double, Double> location);\n}", "@Override\n\tpublic void notifyReceived(LinphoneCore lc, LinphoneCall call,\n\t\t\tLinphoneAddress from, byte[] event) {\n\t\t\n\t}", "public interface Observer <T> {\n /**\n * The method that is called by the notify method of the Observable classes.\n * @param message The message sent by the notify method of the observable classes.\n */\n void update(T message);\n}", "void addListener(MapChangeListener<? super K, ? super V> listener);", "public interface OnCustomerListChangedListener {\n void onNoteListChanged(List<Customer> customers);\n}", "public interface Observer {\n void update(Observable o, Object arg);\n}", "public interface LocationObserver {\n void newLocationPoint(Location location);\n}", "@Override\n\tpublic void info(Marker marker, Supplier<?> msgSupplier) {\n\n\t}", "@Override\r\n\tpublic void registerObserver(Observer observer) {\n\t\t\r\n\t}", "public interface DataReceiver {\n LogReplicationEntry receive(LogReplicationEntry message);\n}", "void notificationReceived(Notification notification);", "public interface IMarketObserver {\n\n //To be defined in which format MarketAgent publishes stockprice\n /**\n * This method is called when information about an IMarket\n * which was previously requested using an asynchronous\n * interface becomes available.\n */\n public void onStockpriceChanged();\n\n /**\n * This method is called when information about an IMarket\n * which was previously requested using an asynchronous\n * interface becomes available.\n *\n * @param transactionEntry the transaction entry\n */\n public void onTransactionAdded(TransactionEntry transactionEntry);\n \n /**\n * This method is called when information about an IMarket\n * which was previously requested using an asynchronous\n * interface becomes available.\n *\n * @param orderEntry the order entry\n */\n public void onOrderAdded(OrderEntry orderEntry);\n \n /**\n * This method is called when information about an IMarket\n * which was previously requested using an asynchronous\n * interface becomes available.\n *\n * @param shareEntry the share entry\n */\n public void onShareAdded(ShareEntry shareEntry);\n}", "public interface OnCustomerListChangedListener {\n\n void onNoteListChanged(ArrayList<String> weathers);\n}", "@Override\r\n\tpublic void notifyObservers() {\n\t\t\r\n\t}", "public interface MarkHotProductListener {\n\n public void setMarkHotProduct(int posi,String isHot);\n}", "public Ice.AsyncResult begin_addObserver(ServiceObserverPrx observer);", "public interface Observer {\n public void notification(String handle, String tweet);\n}", "public Ice.AsyncResult begin_addObserver(ServiceObserverPrx observer, Ice.Callback __cb);", "public interface OnMessageReceived {\n public void messageReceived(String message);\n }", "public interface OnMessageReceived {\n\t\tpublic void messageReceived(String message);\n\t}", "public interface ProjectDiagramListener {\n\n /**\n * Listener method. Whenever any publishable change occurs, this method of all listeners is invoked.\n *\n * @param change is an object holding info about the change\n *\n * @see cz.cvut.promod.services.projectService.treeProjectNode.ProjectDiagramChange\n */\n public void changePerformed(final ProjectDiagramChange change);\n}", "public interface AddressListener {\n void onAddressReceived();\n}", "public interface OnArrivalListener {\n void onDestinationArrived();\n}", "public interface IMonitorListener {\n public void onEvent(Message cim);\n}", "String registerObserver(StreamObserver observer);", "public interface ObservableOnSubcribe<T> {\n\n void subscribe(@NonNull ObservableEmitter<T> emitter) throws Exception;\n\n}", "public interface ILocationListener\n{\n /**\n * Called when the speed changes.\n * @param speed The new speed value.\n */\n void OnSpeedChanges(float speed);\n\n /**\n * Called when the location signal is lost.\n */\n void OnSignalLost();\n}", "void subscribe();", "@Override\n public void subscribe(Observer observer) {\n this.observers.add(observer);\n }", "@Override\n public void receiverAddressChanged(String receiver) {\n }", "public void notifyObservers() {}", "private interface Observer {\n void update(Observable observable, String errorMessage);\n }", "public interface MarkCompleteListener {\n void onMarkedComplete(int position);\n}", "public static interface DataChangeObserver {\n /**\n * Called when data has been changed.\n */\n void onDataChanged();\n /**\n * Called when data has been cleared.\n */\n void onDataCleared();\n /**\n * Called when usage reports can be reported to local indexing service.\n */\n void startReportingTask();\n /**\n * Called when usage reports can't be reported to local indexing service any more.\n */\n void stopReportingTask();\n }", "public interface Observer {\n void update();\n}", "public void notifyObservers();", "public void notifyObservers();", "public void notifyObservers();", "public interface ARDInstance extends Closeable {\n public InstanceMap getMap();\n /**\n * Provide a subscriber interface that gets notified when the broker receives marker changes.\n * \n * @param subscriber\n */\n public void setSubscriber(ARDInstanceSubscriber subscriber);\n \n /**\n * Notify the instance on ARDd that the device has moved.\n * \n * @param geoCoord The new location\n * @throws ARDInstanceException\n */\n public void move(GeoCoordFine geoCoord) throws ARDInstanceException;\n public void close() throws IOException;\n}" ]
[ "0.71029466", "0.65054566", "0.6322934", "0.62900865", "0.62900597", "0.62044275", "0.6185504", "0.6147839", "0.61286306", "0.6122212", "0.60772157", "0.6062797", "0.6049129", "0.6022186", "0.6006001", "0.59923124", "0.5920763", "0.58915186", "0.5889504", "0.58022475", "0.57969767", "0.57899284", "0.57899284", "0.5784047", "0.5782205", "0.57796484", "0.5775362", "0.5765604", "0.5758044", "0.57467693", "0.5746604", "0.5741365", "0.5728021", "0.5727501", "0.57263345", "0.5724639", "0.5716917", "0.5714675", "0.5710488", "0.57103086", "0.56982434", "0.5697073", "0.56965715", "0.56912035", "0.5689277", "0.5682438", "0.5682356", "0.56707776", "0.5670424", "0.5658915", "0.5648177", "0.5646417", "0.56453884", "0.5639931", "0.56395996", "0.5637695", "0.56353426", "0.56269103", "0.56141144", "0.56098473", "0.5606716", "0.5601267", "0.55971223", "0.55920786", "0.5591707", "0.55905193", "0.5587058", "0.5581756", "0.558096", "0.5579714", "0.5573805", "0.55703366", "0.55700594", "0.5569618", "0.5568537", "0.55592096", "0.553992", "0.553945", "0.5538826", "0.552866", "0.5523132", "0.55214685", "0.5521355", "0.5513564", "0.5510066", "0.5509377", "0.5508195", "0.549982", "0.54998046", "0.5494169", "0.54855615", "0.54843205", "0.5481405", "0.5479951", "0.5479457", "0.54722154", "0.54716814", "0.5468837", "0.5468837", "0.5468837", "0.54670686" ]
0.0
-1
Notify the instance on ARDd that the device has moved.
public void move(GeoCoordFine geoCoord) throws ARDInstanceException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onMovement() {\n showToast(\"设备移动\");\n LogUtil.e(\"move\");\n }", "protected void onMove() {\r\n }", "@Override\n\tpublic void move(Direction d) {\n\t\t\n\t}", "@Override\n\tpublic void move() {\n\t\tSystem.out.println(\"Driving a airplane!\");\n\t}", "@Override // see item.java\n\tpublic void move(Direction dir, Distance d) {\n\n\t}", "public interface ARDInstance extends Closeable {\n public InstanceMap getMap();\n /**\n * Provide a subscriber interface that gets notified when the broker receives marker changes.\n * \n * @param subscriber\n */\n public void setSubscriber(ARDInstanceSubscriber subscriber);\n \n /**\n * Notify the instance on ARDd that the device has moved.\n * \n * @param geoCoord The new location\n * @throws ARDInstanceException\n */\n public void move(GeoCoordFine geoCoord) throws ARDInstanceException;\n public void close() throws IOException;\n}", "public void updatemove() {\n\t\tmove = new Movement(getX(), getY(),dungeon,this);\n\t\t//System.out.println(\"Updated\");\n\t\tnotifys();\n\t\tif(this.getInvincible()) {\n\t\t\tsteptracer++;\n\t\t}\n\t\tdungeon.checkGoal();\n\t}", "private void move() {\n acceleration.accelerate(velocity, position);\r\n }", "public abstract void notifyMoveResult(boolean hasMoved);", "@Override\n public void onStationary() {\n showToast(\"设备停止移动\");\n LogUtil.e(\"stop_move\");\n }", "@Override\n public void onCameraMoveStarted(int reason) {}", "@Override\n public void onMove(float x, float y) {\n }", "protected final void fireMove() {\r\n\t\tfireEvent(new MoveEvent(this));\r\n\t}", "@Override\r\n\tprotected void onMove() {\n\t\t\r\n\t}", "public void moving()\n {\n if(onPlatform()&&endPlatform()){\n direction();\n }\n if(onPlatform()&&!endPlatform()){\n changeDirection();\n direction();\n }\n collideMoveLocation(horzVelocity,1);\n //sharaz\n if(isTouching(PushObject.class)){\n changeDirection();\n direction();\n }\n \n \n }", "@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)\n\tpublic void onPlayerMove(PlayerMoveEvent event) {\n\t\t\n\t\tlong time = new Date().getTime();\n\t\t\n\t\tthis.edhPlayer.PlayerUpdateLocation(event.getPlayer(),time);\n\t\n\t\tthis.edhPlayer.PlayerMove(event.getPlayer(), event.getPlayer().getVehicle() != null ? event.getPlayer().getVehicle().getClass() : null);\n\t}", "@Override\n public void move(){\n setDirectionSpeed(180, 7);\n this.moveTowardsAPoint(target.getCenterX(), target.getCenterY());\n }", "void onMove();", "@Override\r\n\tpublic void move()\r\n\t{\r\n\t\t//Updates the X and Y position by using dx and dy\r\n float x = location.getX() + dx;\r\n float y = location.getY() + dy;\r\n \r\n //Updates the particle emitter's position to the missiles current position\r\n emitter.setPosition(this.getPositionX(), this.getPositionY(),false);\r\n \r\n //Updates the location of the missile\n setLocation(x, y);\n\t}", "@Override\n public void move() {\n System.out.println(\"I roam here and there\");\n }", "@Override\n public void onMove(boolean absolute) {\n \n }", "public void move() {\n\t\tSystem.out.println(\"Robot Can Move\");\n\t}", "public void move() {\n\t\t// Override move so we don't move, then get location set by owner.\n\t}", "@Override\n public void move () {\n }", "@Override\n\tpublic void move() {\n\t\tSystem.out.println(\"Can Move\");\n\t}", "@Override\n\tpublic void move() {\n\n\t}", "private void notifyMove(Move move) {\r\n\t\tfor (Player e : spectators)\r\n\t\t\te.registerMove(move);\r\n\t}", "@Override\n public void update(double millis) throws InvalidDataException {\n myMovable.update(millis);\n }", "@Override\n public void updateDispatcher(int newDistance) {\n dispatcher.updateVehicleDistance(this, newDistance);\n }", "private void notifyVehicleMovement() {\n if (getOwner() != null && getOwner().isVehicle() && getOwner().getOwner() != null && getOwner().getOwner().isPlayer()) {\n// getOwner().sendBroadcastPacket(new SMMoveNonPlayer(getOwner()));\n }\n }", "@Override\n\tpublic void move() {\n\t}", "public void move() {\n\t\tthis.hero.setPF(1);\n\t\tthis.hero.setState(this.hero.getMoved());\n\t}", "void onDirectionChanged(Direction direction);", "protected final void handleMove(final int x, final int y,\n final boolean updateTarget) {\n if (updateTarget) {\n AWTAccessor.getComponentAccessor().setLocation(getTarget(), x, y);\n postEvent(new ComponentEvent(getTarget(),\n ComponentEvent.COMPONENT_MOVED));\n }\n }", "public void move(float dx, float dy)\n {\n bounds.offset(dx, dy);\n notifyParentOfPositionChange();\n conditionallyRelayout();\n }", "public void setMoved() {\r\n\t\tmoved = true;\r\n\t}", "public void onTick(long nanosSincePreviousTick) {\n\t\tif (_freeMoving) \n\t\t\tthis.move(_dx, _dy);\n\t}", "@Override\n\tpublic void move() {\n\t\t\n\t}", "@Override\r\n\tpublic void onMovableChanged(Movable movable) {\r\n\t\tControllerEventSource.notifyMovableChanged(movable);\r\n\t}", "@Override\r\n public void run() {\r\n if (event.getEventType().equals(DrivingEventType.OVERSPEED)) {\r\n overspeedStartTimestamp = System.currentTimeMillis();\r\n LocationController.addListenerToContainer(this);\r\n } else {\r\n AccelerometerValuesController.addListenerToContainer(this);\r\n }\r\n }", "@Override\r\n\tpublic void move() {\n\r\n\t}", "private void deviceUpdated() {\n if (!mIsCreate) {\n mSyncthingService.getApi().editDevice(mDevice, getActivity(), this);\n }\n }", "public void update() {\n this.move(this.getDX(), this.getDY());\n }", "public void move() {\n float diffX = cDestination.getX() - getCenterX();\n float diffY = cDestination.getY() - getCenterY();\n\n float newX = cPosition.getX() + cSpeed * Math.signum(diffX);\n float newY = cPosition.getY() + cSpeed * Math.signum(diffY);\n\n cPosition.setX(newX);\n cPosition.setY(newY);\n }", "public void listenForMove(Display disp){\n MoveListener moveListener = new MoveListener(disp, receiver);\n moveListener.start();\n }", "public void move() {\n if(Objects.nonNull(this.position)) {\n Position position = this.getPosition();\n Function<Position, Position> move = moveRobotInDirectionMap.get(position.getDirection());\n this.position = move.apply(position);\n }\n }", "public void move() {\n spriteBase.move();\n\n Double newX = spriteBase.getXCoordinate() + spriteBase.getDxCoordinate();\n Double newY = spriteBase.getYCoordinate() + spriteBase.getDyCoordinate();\n\n if (!newX.equals(spriteBase.getXCoordinate())\n || !newY.equals(spriteBase.getYCoordinate())) {\n Logger.log(String.format(\"Monster moved from (%f, %f) to (%f, %f)\",\n spriteBase.getXCoordinate(), spriteBase.getYCoordinate(), newX, newY));\n }\n }", "@Override\r\n\tpublic void notifyIncomingDrone(IDrone d) {\n\t\t\r\n\t}", "public void move() {\n\t\tthis.move(velocity.x, velocity.y);\n\t}", "public void move()\n {\n double angle = Math.toRadians( getRotation() );\n int x = (int) Math.round(getX() + Math.cos(angle) * WALKING_SPEED);\n int y = (int) Math.round(getY() + Math.sin(angle) * WALKING_SPEED);\n setLocation(x, y);\n }", "public void move(Direction direction) {\n observedNode = observedNode.getNode(direction);\n }", "protected synchronized void updateDrag(Point moveTarget) {\n if (beingDragged) {\n int dx = moveSource.x - moveTarget.x;\n int dy = moveSource.y - moveTarget.y;\n moveSource = moveTarget;\n \n int x = getHAdjustable().getValue() + dx;\n int y = getVAdjustable().getValue() + dy;\n setOrigin(x, y);\n }\n }", "default void onMoveMade(ScotlandYardView view, Move move) {}", "protected void move()\n {\n // Find a location to move to.\n Debug.print(\"Fish \" + toString() + \" attempting to move. \");\n Location nextLoc = nextLocation();\n\n // If the next location is different, move there.\n if ( ! nextLoc.equals(location()) )\n {\n // Move to new location.\n Location oldLoc = location();\n changeLocation(nextLoc);\n\n // Update direction in case fish had to turn to move.\n Direction newDir = environment().getDirection(oldLoc, nextLoc);\n changeDirection(newDir);\n Debug.println(\" Moves to \" + location() + direction());\n }\n else\n Debug.println(\" Does not move.\");\n }", "public void onMoveGestureStarted()\n\t{\n\t\tfireEvent(TiC.EVENT_MOVE_START, null);\n\t}", "void moving() {\n\t\tSystem.out.println(\"Moving the car\");\r\n\t}", "private void handleMoved()\n {\n toolkit.postEvent(new ComponentEvent(target, ComponentEvent.COMPONENT_MOVED));\n }", "public void move() {\r\n\t\tSystem.out.print(\"This animal moves forward\");\r\n\t}", "@Override\n public void notifyEndMove() {\n try {\n if (getClientInterface() != null)\n getClientInterface().notifyEndMove();\n }\n catch (RemoteException e) {\n System.out.println(\"remote sending end move error\");\n }\n }", "public void move() {\n\t\tthis.position.stepForwad();\n\t\tthis.position.spin();\n\t}", "public void moveForward(){\n\t\tSystem.out.println(\"Vehicle moved forward\");\n\t}", "@Override\n public void move()\n {\n System.out.println(\"tightrope walking\");\n }", "protected void updateMove(float delta) {\n\n if (freeX && dx != 0) {\n setX(getX() + getDx());\n }\n if (freeY && dy != 0) {\n setY(getY() + getDy());\n }\n }", "@Override\n\tpublic void drive() {\n\t\tSystem.out.println(\"VAN IS DRIVING\");\n\t}", "void updateStick() { \n Arrow a = (Arrow) this.arrow;\n a.updateArrow(this.strokeAcc, this.golfBall.coord);\n }", "public void move() { \n\t\tSystem.out.println(\"MOVING\");\n\t\tswitch(direction) {\n\t\t\tcase NORTH: {\n\t\t\t\tyloc -= ySpeed;\n\t\t\t}\n\t\t\tcase SOUTH: {\n\t\t\t\tyloc+= xSpeed;\n\t\t\t}\n\t\t\tcase EAST: {\n\t\t\t\txloc+= xSpeed;\n\t\t\t}\n\t\t\tcase WEST: {\n\t\t\t\txloc-= xSpeed;\n\t\t\t}\n\t\t\tcase NORTHEAST: {\n\t\t\t\txloc+=xSpeed;\n\t\t\t\tyloc-=ySpeed;\n\t\t\t}\n\t\t\tcase NORTHWEST: {\n\t\t\t\txloc-=xSpeed;\n\t\t\t\tyloc-=ySpeed;\n\t\t\t}\n\t\t\tcase SOUTHEAST: {\n\t\t\t\txloc+=xSpeed;\n\t\t\t\tyloc+=ySpeed;\n\t\t\t}\n\t\t\tcase SOUTHWEST: {\n\t\t\t\txloc-=xSpeed;\n\t\t\t\tyloc+= ySpeed;\n\t\t\t}\n\t\t}\n\t}", "public void update() {\n if (isActive()) {\n updatePosition(dx, dy);\n }\n }", "public void move (long delta){\r\n\r\n super.move(delta);\r\n }", "void onIdentityMove(int fromPosition, int toPosition);", "@Override\n\tpublic void update() {\n\t\tmove();\n\t\tplace();\n\t}", "public void move() {\r\n\t\tthis.vector2D = this.vector2D.add(Direction.DOWN.getUnitVector());\r\n\t}", "public void move(Direction direction) {\n position.translate(direction);\n update();\n }", "public boolean moveOn() {\n\t\t\n\t}", "@Override\n public void onDragPositionsChanged(int oldPosition, int newPosition) {\n }", "public void update()\r\n\t{\n\t\t\r\n\t\tif (Game.clock > nextMoveTime)\r\n\t\t{\r\n\t\t\t//If there is a mob in front of the arrow, damage it. Otherwise, move the arrow\r\n\t\t\tTile frontTile = getAdjacentTile(rotation);\r\n\t\t\tMob frontMob = null;\r\n\t\t\tif (frontTile != null)\r\n\t\t\t{\r\n\t\t\t\tfrontMob = frontTile.getMob();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (frontMob != null)\r\n\t\t\t{\r\n\t\t\t\t//damage the mob, then remove this arrow\r\n\t\t\t\tfrontMob.damage(atkDmg);\r\n\t\t\t\tGame.tiles.get(y).get(x).getItems().remove(this);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tmove();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//set the next move time (only allow moves during an update check)\r\n\t\t\tnextMoveTime = Game.clock + timePerMove;\r\n\t\t}\r\n\t}", "@Override\r\n\tpublic void onTouchMove(LTouch e) {\n\t\t\r\n\t}", "public void move() {\n\r\n\t}", "public void move(float deltaTime) {\n }", "@Override\n\tpublic void move(int xPos, int yPos) {\n\t}", "@Override\n \t\t\t\tpublic void doMove() {\n \n \t\t\t\t}", "@Override\n\tpublic void excute() {\n\t\tmoveEvent.move(commandinfo.getValue() * 200);\n\t}", "@Override\n\tpublic void moveCamera() {\n\n\t}", "@Override\n\tvoid update(){\n\n\t\t\tif(Frogger.flag==1){\n\t\t\t\tif(orientation == Orientation.UP) y -= step;\n\t\t\t\telse if (orientation == Orientation.DOWN) y += step;\n\t\t\t\telse if (orientation == Orientation.RIGHT) x += step;\n\t\t\t\telse if (orientation == Orientation.LEFT) x -= step;\n\t\t}\n\t\tsetChanged();\n\t\tnotifyObservers();\n\t}", "public void move(){\n\t\t\n\t}", "protected void move() {\n\t\tx += dx;\n\t\ty += dy;\n\t\tif (distance() > range) remove();\n\t}", "@Override\n\tpublic void move() {\n\t\tSystem.out.println(\"fly\");\n\n\t}", "public void toMoving() {\n notifyStartMoving(this.getCurrentTurn().getCurrentPlayer().getNickname());\n if (getCurrentTurn().getCurrentPlayer().isHasSpecialMove()) {\n notifyAskForEffect(currentTurn.getCurrentPlayer().getNickname());\n } else {\n notifyChooseWorker(this.getCurrentTurn().getCurrentPlayer().getNickname(), board);\n }\n }", "public void move(String direction) {\n \n }", "void move(String direction) {\n \tif (direction.equals(\"A\")) { \n \t\tsetXCoord(getXCoord()-getHSpeed());\n \t} else if (direction.equals(\"D\")) {\n \t\tsetXCoord(getXCoord()+getHSpeed());\n \t}\n }", "public void move()\n\t{\n\t\tx = x + dx;\n\t}", "public void move(Direction d) {\n this.center.addVectorInPlace(d.getVector());\n }", "@Override\n\t\t\t\tpublic void onTouchMove() {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n\t\t\t\tpublic void onTouchMove() {\n\t\t\t\t\t\n\t\t\t\t}", "protected void move(Direction d) {\n\t\tbody.move(d);\n\t}", "protected void execute() {\n \tRobot.debug.Update(Robot.lift.DebugMotionMagic());\n }", "public void updatePosition() {\n \t\r\n \tx += dx;\r\n \ty += dy;\r\n \t\r\n\t}", "public void move()\n\t{\n\t\tx = x + logDx;\n\t}", "public void startMoving ()\n {\n if (canMove()) {\n ((Mobile)_actor).setDirection(_actor.getRotation());\n _actor.set(Mobile.MOVING);\n }\n }", "private void move() {\n\n if(currentPosition.getX() == -1 && currentPosition.getY() == -1) {\n System.out.println(\"Robot is not placed, yet.\");\n return;\n }\n\n Position.Direction direction = currentPosition.getDirection();\n int newX = -1;\n int newY = -1;\n switch (direction) {\n case EAST:\n newX = currentPosition.getX() + 1;\n newY = currentPosition.getY();\n break;\n case WEST:\n newX = currentPosition.getX() - 1;\n newY = currentPosition.getY();\n break;\n case NORTH:\n newX = currentPosition.getX();\n newY = currentPosition.getY() + 1;\n break;\n case SOUTH:\n newX = currentPosition.getX();\n newY = currentPosition.getY() - 1;\n break;\n }\n\n if(newX < lowerBound.getX() || newY < lowerBound.getY()\n || newX > upperBound.getX() || newY > upperBound.getY()) {\n System.out.println(\"Cannot move to \" + direction);\n return;\n }\n\n currentPosition.setX(newX);\n currentPosition.setY(newY);\n }", "@Override\n public void run() {\n updateMovement();\n }" ]
[ "0.6376211", "0.6100403", "0.60284567", "0.59576106", "0.5900015", "0.5894795", "0.58103377", "0.5745", "0.57341427", "0.5697587", "0.56833345", "0.56770486", "0.56414837", "0.5636741", "0.5632117", "0.5630843", "0.56220543", "0.56204593", "0.55409044", "0.55394554", "0.5538145", "0.5537555", "0.553576", "0.5533771", "0.55147904", "0.5497797", "0.5494615", "0.5480083", "0.54741836", "0.5473907", "0.5471246", "0.5469766", "0.54641855", "0.5458422", "0.5444685", "0.5440622", "0.5436738", "0.54357636", "0.5429485", "0.54235125", "0.5421596", "0.54082114", "0.54008996", "0.5380279", "0.5380012", "0.53789955", "0.53657544", "0.5358867", "0.5349463", "0.534475", "0.53406256", "0.5328755", "0.53242505", "0.531015", "0.5309907", "0.52966213", "0.52872616", "0.5286057", "0.5284568", "0.5277689", "0.52771634", "0.52763706", "0.5272058", "0.5256687", "0.5256162", "0.5254018", "0.5252814", "0.5252452", "0.524055", "0.5238177", "0.523526", "0.52280444", "0.5227074", "0.52227634", "0.52174956", "0.52164596", "0.521372", "0.52092826", "0.5206029", "0.520571", "0.52043176", "0.51991117", "0.5198738", "0.51932484", "0.5191327", "0.51882136", "0.5179652", "0.5174552", "0.5173422", "0.51604354", "0.5156413", "0.5153037", "0.5153037", "0.5149882", "0.51472116", "0.5143263", "0.5141131", "0.5140088", "0.51393443", "0.5138316" ]
0.541421
41
This Interface wich has metods for work with JobSeekers on the Dao layer
public interface IDAOJobSeeker { /** * method which adds new {@link Profile} for {@link User} by incoming params * * @return {@link List} {@link Object} */ List<Object> addNewProfile(String... profileParams) throws DaoException; /** * method which removes {@link Profile} by {@link User#userId} * * @return {@link User} */ User removeProfileByUserId(int userId) throws DaoException; /** * method which update {@link Profile} by incoming profile params * * @return {@link Profile} */ Profile updateOldProfileByParams(String... profileParams) throws DaoException; /** * method which adds new {@link Resume} for {@link User} by incoming params * * @return {@link User} */ User addNewResumeByParams(String... resumeParams) throws DaoException; /** * method which delete {@link Resume} for {@link User} by {@link Resume#idUser} * * @return {@link User} */ User deleteResumeByIdUser(int idUserResume) throws DaoException; /** * method which searches {@link Vacancy} incoming by params * * @return {@link List} {@link Vacancy} */ List<Vacancy> searchVacancyByParam(String... params) throws DaoException; /** * method which searches {@link RespondVacancy} by incoming by * {@link User#userId} * * @return {@link List} {@link String} */ List<String> searchRespondVacancyByUserId(int userId) throws DaoException; /** * method which gets count all rows for tables by tableName and fild avaliable * * @return int value */ int getCountAllRowsForTable(String tableName) throws DaoException; /** * method which update {@link Vacancy} when {@link User} respond and add in * table by {@link User#userId} and {@link Vacancy#idvacancy} * * @return int value */ boolean updateVacancyWhenRespondAndAddInTable(int userId, int vacancyId) throws DaoException; /** * method which update {@link Vacancy} when {@link User} respond and delete from * table by {@link User#userId} and {@link Vacancy#idvacancy} * * @return int value */ boolean updateVacancyWhenRespondAndDeleteInTable(int userId, int vacancyId) throws DaoException; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface JobMapper {\n int addJob (Jobs job);\n List<Jobs> listJob();\n int deleteJob(int jid);\n int updateJob(Jobs job);\n List<Jobs> findByName(String jname);\n Jobs selectJob(int jid);\n //出手之后兼职state的变化\n int updateJobByState(Jobs job);\n int findByState(int jobid);\n List<Jobs> selectJobByUser(int userid);\n //关于简历部分的功能\n int addResume (Resumes resumes);\n List<Resumes> findResumeByJobId (int jid);\n Resumes selectOneResume(int resid);\n List<Jobs> selectResumeJob(int userid);\n List<Jobs> selectJobByReq(Jobs jobs);\n}", "public interface JobInterface {\n\n public Integer getId();\n\n public void setId(Integer id);\n\n public String getType();\n\n public void setType(String type);\n\n public String getInformation();\n\n public void setInformation(String information);\n\n public Date getStartDate();\n\n public void setStartDate(Date startDate);\n\n public Date getEndDate();\n\n public void setEndDate(Date endDate);\n\n public String getName();\n\n public void setName(String name);\n\n public int getVersion();\n\n public void setVersion(int version);\n\n @Override\n public int hashCode();\n\n @Override\n public boolean equals(Object object);\n\n @Override\n public String toString();\n\n}", "public interface IJobInfoService {\n /**\n * 列表查询\n * @param vo\n * @return\n */\n DataListVo queryList(QueryJobInfoListVo vo);\n\n /**\n * 列表查询\n * @param vo\n * @return\n */\n JobInfoDetailVo queryDetail(BaseQueryVo vo);\n}", "public interface JobManager {\n void startJob(JobConfig<String, JsonRecord> name);\n}", "public interface JobsDao {\n\n void saveJob(Job job);\n\n Job getJob(String jobId) throws DataAccessException;\n\n void updateJobProgress(String jobId, String componentName, int progress, Status status) throws DataAccessException;\n\n void removeJob(String jobId) throws DataAccessException;\n\n void addError(String jobId, String errorCode, String error, Status status);\n\n void updateJobPhase(String jobId, Status status);\n\n List<Job> getJobsByPhases(List<Status> statuses, Type jobType);\n}", "public interface TOP0201JobMapper {\n\n public int insertTOP0201(Map params) throws Exception;\n\n public int deleteTOP0201(Map params) throws Exception;\n}", "public interface BaseJob {\n Object start();\n\n Object initJob(Map<String, Object> param);\n\n Object stop();\n}", "public interface JobPlan \n{\n\t/**\n\t * A method that sets a job identifier for the current job in a JobPlan\n\t * @param jobId - the job identifier for the current job\n\t */\n\tpublic void setJobId( int jobId ) ;\n\t\n\t/**\n\t * A method that returns the job identifier for the current job\n\t * @return the job identifier for the current job\n\t */\n\tpublic int getJobId() ;\n\t\n\t/**\n\t * A method that stores the association between a predicate and its TriplePattern\n\t * @param pred - the predicate of every triple pattern\n\t * @param tp - the associated TriplePattern object\n\t */\n\tpublic void setPredicateBasedTriplePattern( String pred, TriplePattern tp ) ;\n\t\n\t/**\n\t * A method that returns the TriplePattern associated with a predicate\n\t * @param pred - the predicate to be searched\n\t * @return the associated TriplePattern object\n\t */\n\tpublic TriplePattern getPredicateBasedTriplePattern( String pred ) ;\n\t\n\t/**\n\t * A method that sets the total number of variables expected in the result\n\t * @param totalVars - the total number of variables expected in the result of the SPARQL query\n\t */\n\tpublic void setTotalVariables( int totalVars ) ;\n\t\n\t/**\n\t * A method that returns the total number of variables that are expected in the result\n\t * @return the total number of variables in the SPARQL query\n\t */\n\tpublic int getTotalVariables() ;\n\t\n\t/**\n\t * A method that sets the Hadoop Job object to be used by the current job plan\n\t * @param currJob - the Hadoop Job object\n\t */\n\tpublic void setHadoopJob( Job currJob ) ;\n\t\n\t/**\n\t * A method that returns the Hadoop Job object used by the current job plan\n\t * @return - the Hadoop Job used by the current job plan\n\t */\n\tpublic Job getHadoopJob() ;\n\t\n\t/**\n\t * A method that sets whether there are any more jobs to follow after the current one\n\t * @param hasMoreJobs - true iff there are more Hadoop jobs to follow, false otherwise\n\t */\n\tpublic void setHasMoreJobs( boolean hasMoreJobs ) ;\n\t\n\t/**\n\t * A method that returns true if there are more jobs to follow, false otherwise\n\t * @return true iff there are more Hadoop jobs to follow, false otherwise\n\t */\n\tpublic boolean getHasMoreJobs() ;\n\t\n\t/**\n\t * A method that adds the association between a variable and the number of triple patterns that contain the variable\n\t * to a map\n\t * @param var - a variable from the SPARQL query\n\t * @param count - the number of triple patterns that contain the given variable\n\t */\n\tpublic void setVarTrPatternCount( String var, Integer count ) ;\n\t\n\t/**\n\t * A method that returns the number of triple patterns that contain the given variable\n\t * @param var - the variable for which the number of triple patterns is desired\n\t * @return the number of triple patterns that cotain the given variable\n\t */\n\tpublic Integer getVarTrPatternCount( String var ) ;\n\t\n\t/**\n\t * A method that adds the given variable to a list of joining variables\n\t * @param var - a given variable \n\t */\n\tpublic void addVarToJoiningVariables( String var ) ;\n\t\n\t/**\n\t * A method that returns the list of joining variables\n\t * @return the list that contains all joining variables for a job\n\t */\n\tpublic List<String> getJoiningVariablesList() ;\n\t\n\t/**\n\t * A method that sets the list of variables in the SELECT clause\n\t * @param listVars - a list of variables in the SELECT clause of the SPARQL query\n\t */\n\tpublic void setSelectClauseVarList( List<String> listVars ) ;\n\t\n\t/**\n\t * A method that returns the list of variables in the SELECT clause of the SPARQL query\n\t * @return a list containing variables in the SELECT clause\n\t */\n\tpublic List<String> getSelectClauseVarList() ;\n}", "public interface MemoryJobInstance<ID> extends JobInstance<ID> {\n\n /**\n * Sets the given id.\n *\n * @param id The id\n */\n void setId(ID id);\n\n /**\n * Returns the version.\n *\n * @return the version\n */\n long getVersion();\n\n /**\n * Sets the given version.\n *\n * @param version The version\n */\n void setVersion(long version);\n\n}", "public interface OnGetJobItemsCallback {\n void onSuccess(JobResponse jobResponse);\n\n void onFailed(String errorString);\n}", "public AbstractJob(){\n \n }", "public interface Job {\n\n /** unique id for this job that is used as a reference in the service methods */\n String getId();\n\n /** job executor identification that has acquired this job and is going to execute it */\n String getLockOwner();\n\n /** in case this is a timer, it is the time that the timer should fire, in case this \n * is a message, it is null. */\n Date getDueDate();\n\n /** in case this is a timer, it is the time that the timer should fire, in case this \n * is a message, it is null.\n * @deprecated call {@link #getDueDate()} instead */\n @Deprecated\n Date getDuedate();\n\n /** exception that occurred during the last execution of this job. The transaction \n * of the job execution is rolled back. A synchronization is used to create \n * a separate transaction to update the exception and decrement the retries. */\n String getException();\n\n /** number of retries left. This is only decremented when an exception occurs during job \n * execution. The transaction of the job execution is rolled back. A synchronization is used to create \n * a separate transaction to update the exception and decrement the retries. */\n int getRetries();\n\n /** indicates if this job should be executed separate from any other job \n * in the same process instance */\n boolean isExclusive();\n\n /** the related execution */\n Execution getExecution();\n\n /** the related process instance */\n Execution getProcessInstance();\n\n Date getLockExpirationTime();\n\n}", "public interface IUploadJobNeedReplyDataListener {\n public void finishAllJobNeedReplyUpload();\n public void finishJobNeedReplyUpload(int status);\n}", "public interface Recordable \n{\n\t/**\n\t * Returns the date that the work was created.\n\t * @return The task creation date\n\t */\n\tLocalDateTime getCreationDate();\n\t\n\t/**\n\t * Returns the date the work was completed.\n\t * @return The task completion date\n\t */\n\tLocalDateTime getCompletionDate();\n}", "public interface AsyncLoadableMarkerOptions {\r\n\r\n\t/**\r\n\t * Load data in asynchronous process, e.g. IntentService, etc.\r\n\t */\r\n\tpublic void loadMarkerOptions();\r\n\t\r\n}", "public interface FitmentLiveModel {\n void loadBaseInformationDatas(String buildingId, CallbcakBaseInformation callbcakBaseInformation);\n interface CallbcakBaseInformation{\n void loadBaseInformationDatasSuccess(ResponseBasicInformation responseBasicInformation);\n void loadBaseInformationDatasFailed(Exception e);\n }\n void loadFitmentProgressDatas(String progressId, String buildingId, int page, int pageSize, CallbackFitmentProgress callbackFitmentProgress);\n interface CallbackFitmentProgress{\n void loadFitmentProgressSuccess(ResponseFitmentPorgress responseFitmentPorgress);\n void loadFitmentProgressFailed(Exception e);\n }\n}", "public interface RunningJobDao extends BaseDao<RunningJob,String,RunningJobQo>{\n List<RunningJob> getByPlanInstIdAndStatus(String planInstId,String status);\n\n /**\n * 根据callPlanInstId和planInstId 查找\n * @param callPlanInstId\n * @param planInstId\n * @return\n */\n RunningJob findByCallPlanInstIdAndPlanInstId(String callPlanInstId,String planInstId);\n\n /**\n * 根据planInstId和jobId查询\n * @param planInstId\n * @param jobId\n * @return\n */\n RunningJob findByPlanInstIdAndJobId(String planInstId,String jobId);\n\n List<RunningJob> findJobsByStatus(String status);\n\n RunningJob findJobsBylanInstIdAndJobIdAndStatus(String planInstId,String jobId);\n int updateRuningJob(RunningJob job);\n}", "public interface CenterDependencyService {\n List<Long> selectParentJobIdList(long jobId);\n}", "public interface Job {\n\n public enum Status {\n IDLE,\n RUNNING,\n SUCCESS,\n ERROR,\n FAIL\n }\n\n /**\n * @return the job ID.\n */\n public default JobId getId() {\n return getContext().getId();\n }\n\n /**\n * @return the job status\n */\n public Status getStatus();\n\n /**\n * @return the job priority\n */\n public Priority getPriority();\n\n /**\n * @return The context of this job.\n */\n public JobContext getContext();\n\n /**\n * Run the job using the {@link XProcEngine}.\n */\n public void run(XProcEngine engine);\n\n}", "public interface IJobService {\n\n void process();\n\n}", "public Job getJob();", "public interface JobTrackingReporter {\n\n /**\n * Reports the progress of a job task to the Job Database.\n * @param jobTaskId identifies the job task whose progress is to be reported\n * @param estimatedPercentageCompleted an indication of progress on the job task\n * @throws JobReportingException if a failure occurs in connecting or reporting to a Job Database\n */\n void reportJobTaskProgress(final String jobTaskId, final int estimatedPercentageCompleted) throws JobReportingException;\n\n\n /**\n * Reports the completion of a job task to the Job Database.\n * @param jobTaskId identifies the completed job task\n * @return JobTrackingWorkerDependency list containing any dependent jobs that are now available for processing\n * @throws JobReportingException if a failure occurs in connecting or reporting to a Job Database\n */\n List<JobTrackingWorkerDependency> reportJobTaskComplete(final String jobTaskId) throws JobReportingException;\n\n\n /**\n * Reports the completion of a list of job tasks to the Job Database.\n * @param partitionId identifies the partition\n * @param jobId identifies the job\n * @param jobTaskIds identifies the task ids\n * @return JobTrackingWorkerDependency list containing any dependent jobs that are now available for processing\n * @throws JobReportingException if a failure occurs in connecting or reporting to a Job Database\n */\n List<JobTrackingWorkerDependency> reportJobTasksComplete(final String partitionId, final String jobId,\n final List<String> jobTaskIds) throws JobReportingException;\n\n\n /**\n * Reports the failure and retry of a job task to the Job Database.\n * @param jobTaskId identifies the failed job task\n * @param retryDetails an explanation of the retry of this job task\n * @throws JobReportingException if a failure occurs in connecting or reporting to a Job Database\n */\n void reportJobTaskRetry(final String jobTaskId, final String retryDetails) throws JobReportingException;\n\n\n /**\n * Reports the failure and rejection of a job task to the Job Database.\n * @param jobTaskId identifies the rejected job task\n * @param rejectionDetails an explanation of the failure and rejection of the job task\n * @throws JobReportingException if a failure occurs in connecting or reporting to a Job Database\n */\n void reportJobTaskRejected(final String jobTaskId, final JobTrackingWorkerFailure rejectionDetails) throws JobReportingException;\n\n\n /**\n * Verifies that the Job Database can be contacted.\n * @return true if connection can be established with the Job Database, false otherwise\n */\n boolean verifyJobDatabase();\n}", "public interface IJobshelper {\n\n\t/**\n\t * Can do some initialization for task like file location, Emailer list, Emailer\n\t * message etc This is used to set some configuration for this Job and should be\n\t * using some properties file so that each Job could use specific configuration\n\t * \n\t * @throws JobExecutionException\n\t */\n\tpublic void initialJobContext(String configFileName) throws JobExecutionException;\n\n}", "public interface SnIndexerBatchRunnable extends Runnable\r\n{\r\n\t/**\r\n\t * Initializes the indexer batch runnable.\r\n\t *\r\n\t * @param indexerContext\r\n\t * - the indexer context\r\n\t * @param indexerItemSourceOperations\r\n\t * - the indexer item source operations\r\n\t * @param indexerBatchId\r\n\t * - the indexer batch id\r\n\t */\r\n\tvoid initialize(SnIndexerContext indexerContext, List<SnIndexerItemSourceOperation> indexerItemSourceOperations,\r\n\t\t\tString indexerBatchId);\r\n\r\n\t/**\r\n\t * Returns the indexer batch response.\r\n\t *\r\n\t * @return the indexer batch response\r\n\t */\r\n\tSnIndexerBatchResponse getIndexerBatchResponse();\r\n}", "public interface JobService {\n boolean registerJob(Job job);\n\n boolean deleteJob(String domain, String jobId);\n\n List<JobWrapper> listJob(String domain);\n\n JobWrapper readJob(String domain, String jobId);\n\n NodeResult readNodeResult(String domain, String jobId, String ip);\n\n boolean runJob(String domain, String jobId);\n\n}", "public interface RecordLoader {\n \n public void load(BaseFilter filter, EntityManager em);\n\n}", "public interface CHStoJCRMigrator\n{\n\n\t/*\n\t * Start the Migration\n\t */\n\tpublic void startMigrating();\n\n\t/*\n\t * Stop/Pause the Migration. Will finish the current batch of files/folders\n\t */\n\tpublic void stopMigrating();\n\n\t/*\n\t * Find out if we're currently copying files in the background. @return Are\n\t * we currently migrating?\n\t */\n\tpublic boolean isCurrentlyMigrating();\n\t\n\t/*\n\t * Returns number finished and total number to convert. example: There are\n\t * 32 out of 3000 files remaining. [ 32 , 3000 ]\n\t */\n\tpublic int[] filesRemaining();\n\n\t/**\n\t * Details whether the migration has been started. Really, we are just looking\n\t * at the database table that holds the queue to see if it has any rows yet\n\t * (which would mean that we did copy the original files to start and that\n\t * it has started).\n\t */\n\tpublic boolean hasMigrationStarted();\n\n\t/**\n\t * Is the migration over? Are all the items in the queue marked as finished?\n\t * \n\t * @return\n\t */\n\tpublic boolean hasMigrationFinished();\n\n}", "public interface WorkoutBatch extends UnObfuscable, Parcelable{\n\n\t/**\n\t * attribute given record to this batch\n\t * @param record which is to be attributed to this batch\n\t */\n\tvoid addRecord(DistRecord record, boolean persistPoints);\n\n\t/**\n\t * @return distance covered in this batch\n\t */\n\tfloat getDistance();\n\n\t/**\n\t * adds distance in this batch\n\t */\n\tvoid addDistance(float distanceToAdd);\n\n\t/**\n\t * sets the start point for this batch\n\t * @param location\n\t */\n\tvoid setStartPoint(Location location, boolean persistPoints);\n\n\t/**\n\t * @return the epoch (in millis) at which this batch began\n\t */\n\tlong getStartTimeStamp();\n\n\t/**\n\t * @return the epoch (in millis) at which this batch ended, or 0 if the batch has not ended yet\n\t */\n\tlong getEndTimeStamp();\n\n\t/**\n\t * @return Name of the file (internal storage) in which this batche's location data is stored\n\t */\n\tString getLocationDataFileName();\n\n\t/**\n\t * @return the epoch (in millis) at which the last point of this batch was recorded\n\t */\n\tlong getLastRecordedTimeStamp();\n\n\t/**\n\t * @return elapsed time, till the batch is running, since the beginning of this batch in secs;\n\t * once the batch completes it returns the total time for which the batch was running\n\t */\n\tfloat getElapsedTime();\n\n\t/**\n\t * @return time interval in secs for which distance has been recorded\n\t */\n\tfloat getRecordedTime();\n\n\t/**\n\t * @return true if user was caught inside a vehicle for this batch, false otherwise\n\t */\n\tboolean wasInVehicle();\n\n\t/**\n\t * @return list of all points of this batch\n\t */\n\tList<WorkoutPoint> getPoints();\n\n\t/**\n\t *completes this batch and returns this after whatever post processing is required\n\t */\n\tWorkoutBatch end(boolean wasInVehicle);\n\n\t/**\n\t * Creates a Deep copy of this batch\n\t */\n\tWorkoutBatch copy();\n}", "public interface ReadJob {\n\n Map<String, Object> getSharedNodesInfo();\n\n String getSharedKey(String value);\n\n void setSharedNodesInfo(Map<String, Object> sharedNodesInfo);\n\n String[] getShareNodeIds();\n}", "public interface FileLoaderDescriptor {\r\n\r\n\t/**\r\n\t * Check if the specified file is acceptable for this type of job.\r\n\t * \r\n\t * @param filename The file name,\r\n\t * @return <code>true</code> if this job should work on the specified file, <code>false</code> otherwise.\r\n\t */\r\n\r\n\tboolean accept(String filename);\r\n\r\n\t/**\r\n\t * Create a new job instance for this type of job.\r\n\t * \r\n\t * @param reader A file reader to read from.\r\n\t * @return A new job instance.\r\n\t */\r\n\r\n\tFileLoader createJob(Reader reader);\r\n}", "public interface ISchedulerManager {\n //\n void registerJob(String profileId, int period) throws SchedulerException;\n void quitScheduler() throws SchedulerException;\n void pauseJobList() throws SchedulerException;\n void restartJobList() throws SchedulerException;\n void pauseJob(String profileId) throws SchedulerException;\n void restartJob(String profileId) throws SchedulerException;\n List<ProfileForDB> retrieveExecuteJobList();\n List<ProfileForDB> retrieveReadyJobList();\n void updateJob(String profileId, int period) throws SchedulerException;\n void stopJobListAndChangeStatus();\n}", "public Job getJob(){\n return job;\n }", "public interface LoadStepDetail {\n\n void loadStepDetail(int position);\n}", "public Dsjob getJobObject() { return job; }", "public interface JobService {\n List<Job> findAllJobs();\n Job findOneJob(String id);\n void deleteOneJob(String jobId);\n void saveOneJob(String jobId, String jobTitle, int minSalary, int maxSalary);\n}", "public interface JobScheduleService {\n void addJobScheduleHistory(JobContext jobInfo, ScheduleStatusEnum scheduleStatus);\n}", "public interface IJobChangeEvent {\n \t/**\n \t * The amount of time in milliseconds to wait after scheduling the job before it \n \t * should be run, or <code>-1</code> if not applicable for this type of event. \n \t * This value is only applicable for the <code>scheduled</code> event.\n \t * \n \t * @return the delay time for this event\n \t */\n \tpublic long getDelay();\n \n \t/**\n \t * The job on which this event occurred.\n \t * \n \t * @return the job for this event\n \t */\n \tpublic Job getJob();\n \n \t/**\n \t * The result returned by the job's run method, or <code>null</code> if\n \t * not applicable. This value is only applicable for the <code>done</code> event.\n \t * \n \t * @return the status for this event\n \t */\n \tpublic IStatus getResult();\n }", "public interface I_IHC_JobDataChange \n{\n\n /** TableName=IHC_JobDataChange */\n public static final String Table_Name = \"IHC_JobDataChange\";\n\n /** AD_Table_ID=1100135 */\n public static final int Table_ID = MTable.getTable_ID(Table_Name);\n\n KeyNamePair Model = new KeyNamePair(Table_ID, Table_Name);\n\n /** AccessLevel = 3 - Client - Org \n */\n BigDecimal accessLevel = BigDecimal.valueOf(3);\n\n /** Load Meta Data */\n\n /** Column name AD_Client_ID */\n public static final String COLUMNNAME_AD_Client_ID = \"AD_Client_ID\";\n\n\t/** Get Client.\n\t * Client/Tenant for this installation.\n\t */\n\tpublic int getAD_Client_ID();\n\n /** Column name AD_Org_ID */\n public static final String COLUMNNAME_AD_Org_ID = \"AD_Org_ID\";\n\n\t/** Set Organization.\n\t * Organizational entity within client\n\t */\n\tpublic void setAD_Org_ID (int AD_Org_ID);\n\n\t/** Get Organization.\n\t * Organizational entity within client\n\t */\n\tpublic int getAD_Org_ID();\n\n /** Column name BPJSRegistrationDate */\n public static final String COLUMNNAME_BPJSRegistrationDate = \"BPJSRegistrationDate\";\n\n\t/** Set BPJS Registration Date\t */\n\tpublic void setBPJSRegistrationDate (Timestamp BPJSRegistrationDate);\n\n\t/** Get BPJS Registration Date\t */\n\tpublic Timestamp getBPJSRegistrationDate();\n\n /** Column name Created */\n public static final String COLUMNNAME_Created = \"Created\";\n\n\t/** Get Created.\n\t * Date this record was created\n\t */\n\tpublic Timestamp getCreated();\n\n /** Column name CreatedBy */\n public static final String COLUMNNAME_CreatedBy = \"CreatedBy\";\n\n\t/** Get Created By.\n\t * User who created this records\n\t */\n\tpublic int getCreatedBy();\n\n /** Column name Description */\n public static final String COLUMNNAME_Description = \"Description\";\n\n\t/** Set Description.\n\t * Optional short description of the record\n\t */\n\tpublic void setDescription (String Description);\n\n\t/** Get Description.\n\t * Optional short description of the record\n\t */\n\tpublic String getDescription();\n\n /** Column name DescriptionNew */\n public static final String COLUMNNAME_DescriptionNew = \"DescriptionNew\";\n\n\t/** Set Description New\t */\n\tpublic void setDescriptionNew (String DescriptionNew);\n\n\t/** Get Description New\t */\n\tpublic String getDescriptionNew();\n\n /** Column name HC_Compensation1 */\n public static final String COLUMNNAME_HC_Compensation1 = \"HC_Compensation1\";\n\n\t/** Set Compensation 1\t */\n\tpublic void setHC_Compensation1 (BigDecimal HC_Compensation1);\n\n\t/** Get Compensation 1\t */\n\tpublic BigDecimal getHC_Compensation1();\n\n /** Column name HC_Compensation2 */\n public static final String COLUMNNAME_HC_Compensation2 = \"HC_Compensation2\";\n\n\t/** Set Compensation 2\t */\n\tpublic void setHC_Compensation2 (BigDecimal HC_Compensation2);\n\n\t/** Get Compensation 2\t */\n\tpublic BigDecimal getHC_Compensation2();\n\n /** Column name HC_Compensation3 */\n public static final String COLUMNNAME_HC_Compensation3 = \"HC_Compensation3\";\n\n\t/** Set Compensation 3\t */\n\tpublic void setHC_Compensation3 (BigDecimal HC_Compensation3);\n\n\t/** Get Compensation 3\t */\n\tpublic BigDecimal getHC_Compensation3();\n\n /** Column name HC_Compensation4 */\n public static final String COLUMNNAME_HC_Compensation4 = \"HC_Compensation4\";\n\n\t/** Set Compensation 4\t */\n\tpublic void setHC_Compensation4 (BigDecimal HC_Compensation4);\n\n\t/** Get Compensation 4\t */\n\tpublic BigDecimal getHC_Compensation4();\n\n /** Column name HC_EffectiveSeq */\n public static final String COLUMNNAME_HC_EffectiveSeq = \"HC_EffectiveSeq\";\n\n\t/** Set Effective Sequence\t */\n\tpublic void setHC_EffectiveSeq (int HC_EffectiveSeq);\n\n\t/** Get Effective Sequence\t */\n\tpublic int getHC_EffectiveSeq();\n\n /** Column name HC_Employee_ID */\n public static final String COLUMNNAME_HC_Employee_ID = \"HC_Employee_ID\";\n\n\t/** Set Employee Data\t */\n\tpublic void setHC_Employee_ID (int HC_Employee_ID);\n\n\t/** Get Employee Data\t */\n\tpublic int getHC_Employee_ID();\n\n\tpublic I_HC_Employee getHC_Employee() throws RuntimeException;\n\n /** Column name HC_EmployeeGrade_ID */\n public static final String COLUMNNAME_HC_EmployeeGrade_ID = \"HC_EmployeeGrade_ID\";\n\n\t/** Set Employee Grade\t */\n\tpublic void setHC_EmployeeGrade_ID (int HC_EmployeeGrade_ID);\n\n\t/** Get Employee Grade\t */\n\tpublic int getHC_EmployeeGrade_ID();\n\n\tpublic I_HC_EmployeeGrade getHC_EmployeeGrade() throws RuntimeException;\n\n /** Column name HC_EmployeeGrade2_ID */\n public static final String COLUMNNAME_HC_EmployeeGrade2_ID = \"HC_EmployeeGrade2_ID\";\n\n\t/** Set Employee Grade To\t */\n\tpublic void setHC_EmployeeGrade2_ID (int HC_EmployeeGrade2_ID);\n\n\t/** Get Employee Grade To\t */\n\tpublic int getHC_EmployeeGrade2_ID();\n\n\tpublic I_HC_EmployeeGrade getHC_EmployeeGrade2() throws RuntimeException;\n\n /** Column name HC_EmployeeJob_ID */\n public static final String COLUMNNAME_HC_EmployeeJob_ID = \"HC_EmployeeJob_ID\";\n\n\t/** Set Employee Job Data\t */\n\tpublic void setHC_EmployeeJob_ID (int HC_EmployeeJob_ID);\n\n\t/** Get Employee Job Data\t */\n\tpublic int getHC_EmployeeJob_ID();\n\n\tpublic I_HC_EmployeeJob getHC_EmployeeJob() throws RuntimeException;\n\n /** Column name HC_Job_ID */\n public static final String COLUMNNAME_HC_Job_ID = \"HC_Job_ID\";\n\n\t/** Set Job\t */\n\tpublic void setHC_Job_ID (int HC_Job_ID);\n\n\t/** Get Job\t */\n\tpublic int getHC_Job_ID();\n\n\tpublic I_HC_Job getHC_Job() throws RuntimeException;\n\n /** Column name HC_JobAction */\n public static final String COLUMNNAME_HC_JobAction = \"HC_JobAction\";\n\n\t/** Set Job Action\t */\n\tpublic void setHC_JobAction (String HC_JobAction);\n\n\t/** Get Job Action\t */\n\tpublic String getHC_JobAction();\n\n /** Column name HC_JobDataChange_ID */\n public static final String COLUMNNAME_HC_JobDataChange_ID = \"HC_JobDataChange_ID\";\n\n\t/** Set Job Data Change\t */\n\tpublic void setHC_JobDataChange_ID (int HC_JobDataChange_ID);\n\n\t/** Get Job Data Change\t */\n\tpublic int getHC_JobDataChange_ID();\n\n\tpublic I_HC_JobDataChange getHC_JobDataChange() throws RuntimeException;\n\n /** Column name HC_Manager_ID */\n public static final String COLUMNNAME_HC_Manager_ID = \"HC_Manager_ID\";\n\n\t/** Set Manager Name\t */\n\tpublic void setHC_Manager_ID (int HC_Manager_ID);\n\n\t/** Get Manager Name\t */\n\tpublic int getHC_Manager_ID();\n\n\tpublic I_HC_Employee getHC_Manager() throws RuntimeException;\n\n /** Column name HC_ManagerTo_ID */\n public static final String COLUMNNAME_HC_ManagerTo_ID = \"HC_ManagerTo_ID\";\n\n\t/** Set Manager To ID\t */\n\tpublic void setHC_ManagerTo_ID (int HC_ManagerTo_ID);\n\n\t/** Get Manager To ID\t */\n\tpublic int getHC_ManagerTo_ID();\n\n\tpublic I_HC_Employee getHC_ManagerTo() throws RuntimeException;\n\n /** Column name HC_Org_ID */\n public static final String COLUMNNAME_HC_Org_ID = \"HC_Org_ID\";\n\n\t/** Set HC Organization\t */\n\tpublic void setHC_Org_ID (int HC_Org_ID);\n\n\t/** Get HC Organization\t */\n\tpublic int getHC_Org_ID();\n\n\tpublic I_HC_Org getHC_Org() throws RuntimeException;\n\n /** Column name HC_Org2_ID */\n public static final String COLUMNNAME_HC_Org2_ID = \"HC_Org2_ID\";\n\n\t/** Set HC Organization To\t */\n\tpublic void setHC_Org2_ID (int HC_Org2_ID);\n\n\t/** Get HC Organization To\t */\n\tpublic int getHC_Org2_ID();\n\n\tpublic I_HC_Org getHC_Org2() throws RuntimeException;\n\n /** Column name HC_PayGroup_ID */\n public static final String COLUMNNAME_HC_PayGroup_ID = \"HC_PayGroup_ID\";\n\n\t/** Set Payroll Group\t */\n\tpublic void setHC_PayGroup_ID (int HC_PayGroup_ID);\n\n\t/** Get Payroll Group\t */\n\tpublic int getHC_PayGroup_ID();\n\n\tpublic I_HC_PayGroup getHC_PayGroup() throws RuntimeException;\n\n /** Column name HC_PreviousJob_ID */\n public static final String COLUMNNAME_HC_PreviousJob_ID = \"HC_PreviousJob_ID\";\n\n\t/** Set Job Sekarang\t */\n\tpublic void setHC_PreviousJob_ID (int HC_PreviousJob_ID);\n\n\t/** Get Job Sekarang\t */\n\tpublic int getHC_PreviousJob_ID();\n\n\tpublic I_HC_Job getHC_PreviousJob() throws RuntimeException;\n\n /** Column name HC_Reason_ID */\n public static final String COLUMNNAME_HC_Reason_ID = \"HC_Reason_ID\";\n\n\t/** Set HC Reason\t */\n\tpublic void setHC_Reason_ID (int HC_Reason_ID);\n\n\t/** Get HC Reason\t */\n\tpublic int getHC_Reason_ID();\n\n\tpublic I_HC_Reason getHC_Reason() throws RuntimeException;\n\n /** Column name HC_Status */\n public static final String COLUMNNAME_HC_Status = \"HC_Status\";\n\n\t/** Set HC Status\t */\n\tpublic void setHC_Status (String HC_Status);\n\n\t/** Get HC Status\t */\n\tpublic String getHC_Status();\n\n /** Column name HC_WorkEndDate */\n public static final String COLUMNNAME_HC_WorkEndDate = \"HC_WorkEndDate\";\n\n\t/** Set Work End Date\t */\n\tpublic void setHC_WorkEndDate (Timestamp HC_WorkEndDate);\n\n\t/** Get Work End Date\t */\n\tpublic Timestamp getHC_WorkEndDate();\n\n /** Column name HC_WorkPeriodDate */\n public static final String COLUMNNAME_HC_WorkPeriodDate = \"HC_WorkPeriodDate\";\n\n\t/** Set WorkPeriodDate\t */\n\tpublic void setHC_WorkPeriodDate (String HC_WorkPeriodDate);\n\n\t/** Get WorkPeriodDate\t */\n\tpublic String getHC_WorkPeriodDate();\n\n /** Column name HC_WorkStartDate */\n public static final String COLUMNNAME_HC_WorkStartDate = \"HC_WorkStartDate\";\n\n\t/** Set WorkStartDate\t */\n\tpublic void setHC_WorkStartDate (Timestamp HC_WorkStartDate);\n\n\t/** Get WorkStartDate\t */\n\tpublic Timestamp getHC_WorkStartDate();\n\n /** Column name HC_WorkStartDate2 */\n public static final String COLUMNNAME_HC_WorkStartDate2 = \"HC_WorkStartDate2\";\n\n\t/** Set Work Start Date Baru\t */\n\tpublic void setHC_WorkStartDate2 (Timestamp HC_WorkStartDate2);\n\n\t/** Get Work Start Date Baru\t */\n\tpublic Timestamp getHC_WorkStartDate2();\n\n /** Column name IHC_JobDataChange_ID */\n public static final String COLUMNNAME_IHC_JobDataChange_ID = \"IHC_JobDataChange_ID\";\n\n\t/** Set IHC_JobDayaChange\t */\n\tpublic void setIHC_JobDataChange_ID (int IHC_JobDataChange_ID);\n\n\t/** Get IHC_JobDayaChange\t */\n\tpublic int getIHC_JobDataChange_ID();\n\n /** Column name IHC_JobDataChange_UU */\n public static final String COLUMNNAME_IHC_JobDataChange_UU = \"IHC_JobDataChange_UU\";\n\n\t/** Set IHC_JobDataChange_UU\t */\n\tpublic void setIHC_JobDataChange_UU (String IHC_JobDataChange_UU);\n\n\t/** Get IHC_JobDataChange_UU\t */\n\tpublic String getIHC_JobDataChange_UU();\n\n /** Column name IsActive */\n public static final String COLUMNNAME_IsActive = \"IsActive\";\n\n\t/** Set Active.\n\t * The record is active in the system\n\t */\n\tpublic void setIsActive (boolean IsActive);\n\n\t/** Get Active.\n\t * The record is active in the system\n\t */\n\tpublic boolean isActive();\n\n /** Column name IsCancelled */\n public static final String COLUMNNAME_IsCancelled = \"IsCancelled\";\n\n\t/** Set Cancelled.\n\t * The transaction was cancelled\n\t */\n\tpublic void setIsCancelled (boolean IsCancelled);\n\n\t/** Get Cancelled.\n\t * The transaction was cancelled\n\t */\n\tpublic boolean isCancelled();\n\n /** Column name NomorSK */\n public static final String COLUMNNAME_NomorSK = \"NomorSK\";\n\n\t/** Set Nomor SK\t */\n\tpublic void setNomorSK (String NomorSK);\n\n\t/** Get Nomor SK\t */\n\tpublic String getNomorSK();\n\n /** Column name NomorSK2 */\n public static final String COLUMNNAME_NomorSK2 = \"NomorSK2\";\n\n\t/** Set Nomor SK Baru\t */\n\tpublic void setNomorSK2 (String NomorSK2);\n\n\t/** Get Nomor SK Baru\t */\n\tpublic String getNomorSK2();\n\n /** Column name OriginalServiceData */\n public static final String COLUMNNAME_OriginalServiceData = \"OriginalServiceData\";\n\n\t/** Set Original Service Date\t */\n\tpublic void setOriginalServiceData (Timestamp OriginalServiceData);\n\n\t/** Get Original Service Date\t */\n\tpublic Timestamp getOriginalServiceData();\n\n /** Column name Processed */\n public static final String COLUMNNAME_Processed = \"Processed\";\n\n\t/** Set Processed.\n\t * The document has been processed\n\t */\n\tpublic void setProcessed (boolean Processed);\n\n\t/** Get Processed.\n\t * The document has been processed\n\t */\n\tpublic boolean isProcessed();\n\n /** Column name SeqNo */\n public static final String COLUMNNAME_SeqNo = \"SeqNo\";\n\n\t/** Set Sequence.\n\t * Method of ordering records;\n lowest number comes first\n\t */\n\tpublic void setSeqNo (int SeqNo);\n\n\t/** Get Sequence.\n\t * Method of ordering records;\n lowest number comes first\n\t */\n\tpublic int getSeqNo();\n\n /** Column name Updated */\n public static final String COLUMNNAME_Updated = \"Updated\";\n\n\t/** Get Updated.\n\t * Date this record was updated\n\t */\n\tpublic Timestamp getUpdated();\n\n /** Column name UpdatedBy */\n public static final String COLUMNNAME_UpdatedBy = \"UpdatedBy\";\n\n\t/** Get Updated By.\n\t * User who updated this records\n\t */\n\tpublic int getUpdatedBy();\n}", "public interface DailycarePreseterDao {\n\n public List<Event> getDataFromServer();\n}", "public interface FeedDbRequest {\n }", "public interface JobCommonInterface {\n\n Session getSession();\n}", "public interface ViewOwn_Job_CV_Interface {\n void reloadChangedData(Object object);\n}", "public interface solveProgress {\n\n public void updateProgress(SeekBar seekBar);\n}", "public interface QJobManager {\r\n\t/**\r\n\t * <!-- begin-user-doc -->\r\n\t * <!-- end-user-doc -->\r\n\t * @model capabilityRequired=\"true\"\r\n\t * @generated\r\n\t */\r\n\tboolean checkCapability(QJobCapability capability);\r\n\r\n\t/**\r\n\t * <!-- begin-user-doc -->\r\n\t * <!-- end-user-doc -->\r\n\t * @model capabilityRequired=\"true\"\r\n\t * @generated\r\n\t */\r\n\tvoid close(QJobCapability capability);\r\n\r\n\t/**\r\n\t * <!-- begin-user-doc -->\r\n\t * <!-- end-user-doc -->\r\n\t * @model jobRequired=\"true\"\r\n\t * @generated\r\n\t */\r\n\tvoid close(QJob job);\r\n\r\n\t/**\r\n\t * <!-- begin-user-doc -->\r\n\t * <!-- end-user-doc -->\r\n\t * @model\r\n\t * @generated\r\n\t */\r\n\tint countActiveJobs();\r\n\r\n\t/**\r\n\t * <!-- begin-user-doc -->\r\n\t * <!-- end-user-doc -->\r\n\t * @model required=\"true\" identityRequired=\"true\"\r\n\t * @generated\r\n\t */\r\n\tQJobCapability create(QIdentity<?> identity);\r\n\r\n\t/**\r\n\t * <!-- begin-user-doc -->\r\n\t * <!-- end-user-doc -->\r\n\t * @model required=\"true\" identityRequired=\"true\" jobNameRequired=\"true\"\r\n\t * @generated\r\n\t */\r\n\tQJobCapability create(QIdentity<?> identity, String jobName);\r\n\r\n\t/**\r\n\t * <!-- begin-user-doc --> <!-- end-user-doc -->\r\n\t * @model jobRequired=\"true\" statusRequired=\"true\"\r\n\t * @generated\r\n\t */\r\n\tvoid updateStatus(QJob job, JobStatus status);\r\n\r\n\t/**\r\n\t * <!-- begin-user-doc -->\r\n\t * <!-- end-user-doc -->\r\n\t * @model millisRequired=\"true\"\r\n\t * @generated\r\n\t */\r\n\tvoid delay(long millis);\r\n\r\n\t/**\r\n\t * <!-- begin-user-doc -->\r\n\t * <!-- end-user-doc -->\r\n\t * @model resumeTimeRequired=\"true\"\r\n\t * @generated\r\n\t */\r\n\tvoid delay(String resumeTime);\r\n\r\n\t/**\r\n\t * <!-- begin-user-doc --> <!-- end-user-doc -->\r\n\t * @model kind=\"operation\" required=\"true\"\r\n\t * @generated\r\n\t */\r\n\tList<QJob> getActiveJobs();\r\n\r\n\t/**\r\n\t * <!-- begin-user-doc -->\r\n\t * <!-- end-user-doc -->\r\n\t * @model required=\"true\"\r\n\t * @generated\r\n\t */\r\n\tList<QJob> getUserJobs(String user);\r\n\r\n\t/**\r\n\t * <!-- begin-user-doc -->\r\n\t * <!-- end-user-doc -->\r\n\t * @model contextIDRequired=\"true\" jobReferenceRequired=\"true\"\r\n\t * @generated\r\n\t */\r\n\tQJob lookup(String contextID, QJobReference jobReference);\r\n\r\n\t/**\r\n\t * <!-- begin-user-doc -->\r\n\t * <!-- end-user-doc -->\r\n\t * @model contextIDRequired=\"true\" nameRequired=\"true\" userRequired=\"true\" numberRequired=\"true\"\r\n\t * @generated\r\n\t */\r\n\tQJob lookup(String contextID, String name, String user, int number);\r\n\r\n\t/**\r\n\t * <!-- begin-user-doc -->\r\n\t * <!-- end-user-doc -->\r\n\t * @model contextIDRequired=\"true\" nameRequired=\"true\" userRequired=\"true\" numberRequired=\"true\"\r\n\t * @generated\r\n\t */\r\n\tQJob lookup(String contextID, String name, String user, String number);\r\n\r\n\t/**\r\n\t * <!-- begin-user-doc -->\r\n\t * <!-- end-user-doc -->\r\n\t * @model contextIDRequired=\"true\" jobIDRequired=\"true\"\r\n\t * @generated\r\n\t */\r\n\tQJob lookupActiveJob(String contextID, String jobID);\r\n\r\n\t/**\r\n\t * <!-- begin-user-doc -->\r\n\t * <!-- end-user-doc -->\r\n\t * @model contextIDRequired=\"true\" nameRequired=\"true\" userRequired=\"true\" numberRequired=\"true\"\r\n\t * @generated\r\n\t */\r\n\tQJob lookupActiveJob(String contextID, String name, String user, String number);\r\n\r\n\t/**\r\n\t * <!-- begin-user-doc -->\r\n\t * <!-- end-user-doc -->\r\n\t * @model capabilityRequired=\"true\"\r\n\t * @generated\r\n\t */\r\n\tQJob lookup(QJobCapability capability);\r\n\r\n\t/**\r\n\t * <!-- begin-user-doc -->\r\n\t * <!-- end-user-doc -->\r\n\t * @model contextIDRequired=\"true\"\r\n\t * @generated\r\n\t */\r\n\tQJob lookup(String contextID);\r\n\r\n\t/**\r\n\t * <!-- begin-user-doc -->\r\n\t * <!-- end-user-doc -->\r\n\t * @model required=\"true\" jobRequired=\"true\"\r\n\t * @generated\r\n\t */\r\n\tDate now(QJob job);\r\n\r\n\t/**\r\n\t * <!-- begin-user-doc -->\r\n\t * <!-- end-user-doc -->\r\n\t * @model listenerRequired=\"true\"\r\n\t * @generated\r\n\t */\r\n\tvoid registerListener(QJobListener listener);\r\n\r\n\t/**\r\n\t * <!-- begin-user-doc -->\r\n\t * <!-- end-user-doc -->\r\n\t * @model capabilityRequired=\"true\" nameRequired=\"true\" writerRequired=\"true\"\r\n\t * @generated\r\n\t */\r\n\tvoid registerWriter(QJobCapability capability, String name, QObjectWriter writer);\r\n\r\n\t/**\r\n\t * <!-- begin-user-doc -->\r\n\t * <!-- end-user-doc -->\r\n\t * @model capabilityRequired=\"true\" nameRequired=\"true\"\r\n\t * @generated\r\n\t */\r\n\tvoid setDefaultWriter(QJobCapability capability, String name);\r\n\r\n\t/**\r\n\t * <!-- begin-user-doc -->\r\n\t * <!-- end-user-doc -->\r\n\t * @model required=\"true\" parentRequired=\"true\" jobNameRequired=\"true\" copyEnvironmentVariablesRequired=\"true\"\r\n\t * @generated\r\n\t */\r\n\tQJobCapability spawn(QJob parent, String jobName, boolean copyEnvironmentVariables);\r\n\r\n}", "public interface IJobListService {\n\n public JobListModel getJobListBySelect(JobListSelectRequestParam selectRequestParam);\n\n}", "@Override\n\tpublic void beforeJob(JobExecution arg0) {\n\t\t\n\t}", "public interface OnRecordCallBack {\n\n int onSaveRecord(DataSource dataSource, int record);\n\n int onGetRecord(DataSource dataSource);\n\n int onResetRecord(DataSource dataSource);\n\n int onRemoveRecord(DataSource dataSource);\n\n void onClearRecord();\n\n}", "public interface JobManager {\n /**\n * Add a job to the execution queue.\n * @param job encapsulation of the execution data.\n * @return the unique id of the job.\n */\n String submitJob(JPPFJob job);\n\n /**\n * Add a task job to the execution queue.\n * @param job encapsulation of the execution data.\n * @param listener an optional listener to receive job status change notifications, may be null.\n * @return the unique id of the job.\n */\n String submitJob(JPPFJob job, JobStatusListener listener);\n\n /**\n * Add an existing job back into the execution queue.\n * @param job encapsulation of the execution data.\n * @return the unique id of the job.\n */\n String resubmitJob(JPPFJob job);\n\n /**\n * Determine whether there is a client connection available for execution.\n * @return true if at least one connection is available, false otherwise.\n */\n boolean hasAvailableConnection();\n\n /**\n * Determine whether local execution is enabled on this client.\n * @return <code>true</code> if local execution is enabled, <code>false</code> otherwise.\n */\n boolean isLocalExecutionEnabled();\n\n /**\n * Specify whether local execution is enabled on this client.\n * @param localExecutionEnabled <code>true</code> to enable local execution, <code>false</code> otherwise\n */\n void setLocalExecutionEnabled(final boolean localExecutionEnabled);\n\n /**\n * Get the list of available connections.\n * @return a vector of connections instances.\n */\n Vector<JPPFClientConnection> getAvailableConnections();\n\n /**\n * Get a listener to the status of the managed connections.\n * @return a {@link ClientConnectionStatusListener} instance.\n */\n ClientConnectionStatusListener getClientConnectionStatusListener();\n\n /**\n * Close this job manager and all the resources it uses.\n */\n void close();\n\n /**\n * Reset this job manager.\n */\n void reset();\n\n /**\n * Cancel the job with the specified id.\n * @param jobId the id of the job to cancel.\n * @return a <code>true</code> when cancel was successful <code>false</code> otherwise.\n * @throws Exception if any error occurs.\n */\n boolean cancelJob(String jobId) throws Exception;\n\n /**\n * Get the current load-balancer settings.\n * @return a {@link LoadBalancingInformation} instance, which encapsulates a load-balancing alfgorithm name, along with its parameters.\n */\n public LoadBalancingInformation getLoadBalancerSettings();\n\n /**\n * Change the load balancer settings for the client.\n * @param algorithm the name of load-balancing alogrithm to use.\n * @param parameters the algorithm's parameters, if any. The parmeter names are assumed no to be prefixed.\n * @throws Exception if any error occurs or if the algorithm name is {@code null} or not known.\n */\n public void setLoadBalancerSettings(final String algorithm, final Properties parameters) throws Exception;\n}", "public interface BeeDataDao {\n\n /*获取兼职数据*/\n BeeJobTime getBeeJobTime();\n\n /*分页获取兼职数据*/\n BeeJobTime getBeeJobTimes(@Param(\"startIndex\") int startIndex, @Param(\"endAmount\") int endAmount);\n\n /*获取暑期工数据*/\n BeeSummerJob getBeeSummerJob();\n\n /*分页获取暑期工数据*/\n BeeSummerJob getBeeSummerJobs(@Param(\"startIndex\") int startIndex, @Param(\"endAmount\") int endAmount);\n\n /*根据JID获取兼职详细信息*/\n BeeJobTimeDetailed getBeeJobTimeDetailed(int jid);\n\n /*根据SID获取兼职详细信息*/\n BeeSummerJobDetailed getSummerJobDetailed(int sid);\n\n /*分页获取兼职报名信息*/\n UserMessageList getSignUpJobFairs(@Param(\"startIndex\") int startIndex, @Param(\"endAmount\") int endAmount);\n\n /*获取兼职报名List*/\n UserMessageList getSignUpJobFair();\n\n /*根据phone查询兼职报名人员*/\n UserMessageList selectJobFairUser(String phone);\n\n /*兼职报名*/\n void putSignUpJobFair(@Param(\"userMessage\") UserMessage userMessage);\n\n /*根据UserId查询报名人员*/\n String selectSignUpJobFairByUserId(int UserId);\n\n /*插入amount*/\n void insertAmount(@Param(\"amount\") String amount,@Param(\"jobNames\") String jobNames,@Param(\"userId\") int userId);\n\n /*暑期工报名*/\n void putSignUpSummerJob(@Param(\"userMessage\") UserMessage userMessage);\n\n /*暑期工发布*/\n void publishSummerJob(@Param(\"beeSummerJobDetailed\") BeeSummerJobDetailed beeSummerJobDetailed,@Param(\"tag\") String tag);\n\n /*兼职发布*/\n void publishJobFair(@Param(\"beeSummerJobDetailed\") BeeSummerJobDetailed beeSummerJobDetailed,@Param(\"tag\") String tag);\n\n /*分页获取暑期工报名信息*/\n UserMessageList getSignUpSummerJobs(@Param(\"startIndex\") int startIndex, @Param(\"endAmount\") int endAmount);\n\n /*获取暑期工报名List*/\n UserMessageList getSignUpSummerJob();\n\n BeeSummerJobDetailedList AuditingJobFairs(@Param(\"startIndex\") int startIndex, @Param(\"endAmount\") int endAmount);\n\n BeeSummerJobDetailedList AuditingJobFair();\n\n BeeSummerJobDetailedList AuditingSummerJob();\n\n BeeSummerJobDetailedList AuditingSummerJobs(@Param(\"startIndex\") int startIndex, @Param(\"endAmount\") int endAmount);\n\n String selectSignUpJobFairByJIDS(int userId);\n\n UserMessageList selectSummerJobUser(String phone);\n\n String selectSignUpSummerJobByJIDS(int userId);\n\n String selectSignUpSummerJobByUserId(int userId);\n\n void insertAmount1(String jids, String jobNameS, int userId);\n\n int getSid(int id);\n\n int getJid(int id);\n\n void putOpenId(@Param(\"openId\") Object openId,@Param(\"targetId\") int targetId);\n\n BeeJobTime getAuditingBeeJobTimeByOpenId(String openId);\n\n BeeJobTime getAuditingBeeJobTimesByOpenId(@Param(\"openId\") String openId, @Param(\"startIndex\") int startIndex, @Param(\"endAmount\") int endAmount);\n\n BeeJobTime getBeeJobTimesByOpenId(@Param(\"openId\") String openId, @Param(\"startIndex\") int startIndex, @Param(\"endAmount\") int endAmount);\n\n BeeJobTime getBeeJobTimeByOpenId(String openId);\n\n int selectIsGet(int i);\n\n UserMessageList getSignUpJobFairsByJid();\n\n UserMessageList getSignUpJobFairByJid(@Param(\"jid\") String jid,@Param(\"startIndex\") int startIndex, @Param(\"endAmount\") int endAmount);\n\n int selectargetId(String openId);\n\n BeeJobTimeDetailed getAuditingBeeJobTimeDetailed(int jid);\n\n int selectOpenId(Object openId);\n\n Object selectOpenIds(Object openId);\n\n List<Integer> getJidByOpenId(String openId);\n\n void getJobTimeUserByJid(List<Integer> jid);\n\n String getJidsByOpenId(String openId);\n\n BeeJobTime getJobTimeByOpenId(@Param(\"jidS\") List<String> jidS);\n\n BeeJobTime getBeeJobTimesByOpenIds(int startIndex, int endAmount);\n\n String getJidsByJid(int i);\n\n String[] getJids();\n}", "public interface INewsDataSource {\r\n\r\n\r\n void getHandyLifeData( LoadNewsDataCallback loadNewsDataCallback) ;\r\n\r\n\r\n /**\r\n * the callback of getHandyLifeData\r\n */\r\n interface LoadNewsDataCallback {\r\n void onHandyLifeDataSuccess(ArticlesResult handyLifeResultBeans);\r\n void onHandyLifeDataFailed(int code, String message);\r\n }\r\n\r\n}", "public interface TrackDatasource {\n\n}", "public interface OnSearchRecDataListener {\n\n public void OnSearchRecData(int startTime, int endTime, int recType, int index, int end);\n}", "cb.Careerbuilder.Job getJobs(int index);", "@Override\n\t\t\tpublic void beforeJob(JobExecution jobExecution) {\n\t\t\t\t\n\t\t\t}", "public interface Work {\n}", "public interface EpgFetcher {\n\n /**\n * Starts the routine service of EPG fetching. It use {@link JobScheduler} to schedule the EPG\n * fetching routine. The EPG fetching routine will be started roughly every 4 hours, unless the\n * channel scanning of tuner input is started.\n */\n @MainThread\n void startRoutineService();\n\n /**\n * Fetches EPG immediately if current EPG data are out-dated, i.e., not successfully updated by\n * routine fetching service due to various reasons.\n */\n @MainThread\n void fetchImmediatelyIfNeeded();\n\n /** Fetches EPG immediately. */\n @MainThread\n void fetchImmediately();\n\n /** Notifies EPG fetch service that channel scanning is started. */\n @MainThread\n void onChannelScanStarted();\n\n /** Notifies EPG fetch service that channel scanning is finished. */\n @MainThread\n void onChannelScanFinished();\n\n @MainThread\n boolean executeFetchTaskIfPossible(JobService jobService, JobParameters params);\n\n @MainThread\n void stopFetchingJob();\n}", "public interface ITalent {\n\n void newJob(String job);\n}", "public interface PaginationLoader\n{\n\n\tpublic abstract boolean isLoading();\n\n\tpublic abstract void loadMore();\n\n\tpublic abstract void onDetach();\n\n\tpublic abstract void onStart();\n\n\tpublic abstract void onStop();\n\n\tpublic abstract void reload();\n\n\tpublic abstract void setFilters(Set set);\n\n\tpublic abstract void setListener(PaginationLoaderListener paginationloaderlistener);\n}", "public interface LnzylqtjMapper {\n\n void batchSaveLnzylqtj(List<Lnzylqtj> lnzylqtjs);\n\n /**\n * 修改历年专业录取统计信息\n *\n * @param lnzylqtj 历年专业录取统计信息\n */\n void update(Lnzylqtj lnzylqtj);\n\n /**\n * 分页查询历年专业录取统计\n *\n * @param params 参数\n * @return 历年专业录取统计\n */\n List<Lnzylqtj> queryByPage(Map<String, Object> params);\n\n /**\n * 查询总数\n *\n * @return 总数\n */\n int count();\n\n /**\n * 清空表数据\n */\n void empty();\n}", "public GetJobs() {\r\n\t\tsuper();\r\n\t}", "public interface TaskCallback extends RunningTaskCallback {\r\n\r\n\r\n /**\r\n * Calling when the task is preparing to start .\r\n */\r\n void onTaskStart();\r\n\r\n @Override\r\n void onTaskRunning(PreTaskResult preTaskResult, int numerator, int denominator);\r\n\r\n /**\r\n * Calling while the task is completed.\r\n *\r\n * @param taskResult TaskResult bean\r\n */\r\n void onTaskCompleted(TaskResult taskResult);\r\n}", "public interface FeedBackMapper {\n\n /**\n * 根据项目的ID精确查找反馈的记录\n * @param projectId\n * @return\n */\n List<FeedBackEntity> findHistoryByProjectId (int projectId);\n\n /**\n * 根据ID来删除反馈湖库\n * @param id\n * @return\n */\n int deleteFeedBack(int id);\n\n}", "public interface QueueManager {\n /**\n * Method to enqueue a Job inside a transaction.\n * <b> Note that we want to enqueue all tasks within a transaction. So even when this\n * method does not consume Objectify Transaciton directly, it is required to ensure that it was\n * called inside a transaction.\n * \n * @param ofy\n * @param jobId\n */\n public void enqueueGoogleDocInteractionJob(Objectify ofy, JobId jobId);\n \n public void enqueuePollingJob(Objectify ofy, JobId jobId);\n \n public void enqueueLightJob(Objectify ofy, JobId jobId);\n \n public void enqueueLightJobWithoutTxn(JobId jobId);\n \n public void enqueueSearchIndexTask(Objectify ofy);\n \n public void enqueueSearchIndexGSSTask(Objectify ofy);\n \n public <T extends AbstractNotification<T>> void enqueueNotification(\n Objectify ofy, T notification);\n}", "@Override\r\n\tpublic void doBeforeJob() {\n\r\n\t}", "public interface JobProfileRepositoryCustom {\n\n /**\n * Retrieves a partial list of {@link com.techmahindra.citrus.model.JobProfile}.\n * \n * @param pageable\n * The pagination parameters\n * @param query\n * The search query\n * \n * @return\n */\n Page<JobProfile> searchJobProfiles(Pageable pageable, JobProfileSearchBeans searchBean);\n\n /**\n * Retrieves\n * \n * @return\n */\n List<JobProfile> getActiveJobProfiles();\n}", "public interface IHistoryDaoCallback {\n /**\n * 添加历史的结果\n *\n * @param isSuccess\n */\n void onHistoryAdd(boolean isSuccess);\n\n\n /**\n * 删除历史的结果\n *\n * @param isSuccess\n */\n void onHistoryDel(boolean isSuccess);\n\n\n /**\n * 历史数据加载的结果\n *\n * @param tracks\n */\n void onHistoriesLoaded(List<Track> tracks);\n\n\n /**\n * 历史内容清楚结果\n */\n void onHistoriesClean(boolean isSuccess);\n}", "@Override\n\tvoid startWork() {\n\t\t\n\t}", "@Override\n\tvoid startWork() {\n\t\t\n\t}", "public interface WorkService {\n}", "public interface HistoryModel {\n\n void getData(String date, LoadListener listener);\n\n}", "public interface CreatePageMarker {\n}", "public interface OnBaseProgressListener {\r\n void onDownloading(boolean done, long total, long current);\r\n}", "public interface OnPlaylistPreparedListener {\n void OnPlaylistPrepared (ArrayList<Object> autoGeneratedPlaylistMetaDataHashMap, ArrayList<PlaylistMetaData> userGeneratedPlaylistMetaDataHashMap);\n}", "public interface EtsyJobBuilder<Result extends BaseModel> {\n void m1556a(EtsyResult<Result> etsyResult);\n}", "public interface NetTaskModel<T> {\n\n Disposable execute(T data,LoadTaskCallBack callBack);\n}", "public interface DataWriter extends DataAdapter {\n\n /**\n * add an item to the list of pending work to be written.\n *\n * @param record DataRecord to add\n */\n void addItem(DataRecord record);\n\n /**\n * flush the list of work to be written\n */\n void flushBatch();\n\n /**\n * called by the system just prior to a normal shutdown.\n */\n void finish();\n\n\n}", "public interface Worker extends WorkerModel, PersistedModel {\n /*\n * NOTE FOR DEVELOPERS:\n *\n * Never modify this interface directly. Add methods to {@link com.liferay.docs.servicebuilder.model.impl.WorkerImpl} and rerun ServiceBuilder to automatically copy the method declarations to this interface.\n */\n}", "public interface FindOrdersListener {\n void onFindOrdersTaskComplete(FindOrdersREST findOrdersREST);\n void onFindOrderLinesTaskComplete(long commande_ref, long commande_id, FindOrderLinesREST findOrderLinesREST);\n}", "public interface IModel {\n void requestData(String url, OnHomeDataChangeLister onHomeDataChangeLister);\n\n interface OnHomeDataChangeLister {\n //头条\n void onHomeData(Toutiao1 toutiao1);\n }\n// //视频\n// void VideoData(OnVideoDataChangeLister onVideoDataChangeLister);\n// interface OnVideoDataChangeLister{\n// void OnVideoLister(Video video);\n// }\n}", "public interface IRequestFlowMapper extends BaseMapper<RequestFlow> {\n\n int changeState(RequestFlow requestFlow) throws Exception;\n\n int updateRequestFlowByRequestNum(RequestFlow requestFlow);\n\n List<RequestFlow> queryBatch(QureyCondition condition);\n}", "public interface TaxisRepository {\n\n interface LoadTaxisCallback {\n void onTaxisLoaded(List<Taxi> loadedTaxis);\n }\n\n void getTaxis(@NonNull LoadTaxisCallback callback);\n\n// void refreshData();\n}", "public interface Hardener extends Runnable {\n\n void open(File journal, Channel eventQueue) throws IOException;\n void close() throws IOException;\n long getNextCheckPointID();\n long getLastClearedCheckPointID();\n void replayFromCheckpoint(long checkpointID, ReplayListener listener) throws IOException;\n}", "public interface TrackingRepositoryI {\n\n void saveLocation(String lat, String lng, Object object);\n void setmRestAdapter(Object object);\n int getIdFromEmployee();\n}", "public interface DataLoaderListener {\n\n /**\n * Invoked when the AsyncTask has completed its execution.\n *\n * @param //results The resulting object from the AsyncTask.\n */\n void onDataLoaded(int requestId, Object data);\n}", "public interface SerialcontentListInfoModelInterface {\n void getdata(String id, OnSerialcontentListInfoModelInterfaceListener listener);\n}", "public interface JungleDataKeeper {\n void keepData(String identifier, int iteration, double biomass);\n}", "public interface OnQueueDataChangedListener {\n\n void onQueueDataChanged();\n }", "@Override\r\n\tpublic void addJobEventListener(JobEventListener eventListener) {\n\r\n\t}", "public interface MpdPlaylistAdapterIF {\n MpdSongAdapterIF getCurrentSong();\n\n int getPlaylistSize();\n\n MpdSongAdapterIF getSongInfo(int songPosition);\n\n void play(int songPos);\n\n void setListener(MpdPlaylistListenerIF playlistListenerIF);\n\n List<MpdSongAdapterIF> search(String query);\n\n void play(MpdSongAdapterIF mpdSongAdapterIF);\n\n interface MpdPlaylistListenerIF {\n void playlistUpdated(int newLength);\n }\n}", "@Override\r\n\tpublic void executer() {\n\t}", "public JobService(){\r\n\t dao = new JobDAO();\r\n//\t allJobVO = getAllJobVO();\r\n }", "public interface DataProvider {\r\n\t/**\r\n\t *\r\n\t * Since javascript is asynchronous, after the Results object is create the\r\n\t * updateTableCallback needs to be executed. Usually you will retrieve\r\n\t * results via a remote servlet, so you can call your service with the\r\n\t * callback.\r\n\t *\r\n\t * Ex. service.find(parameters, callback);\r\n\t *\r\n\t * @param parameters\r\n\t * @param callback\r\n\t * @return\r\n\t */\r\n\tpublic abstract void update(PaginationParameters parameters,\r\n\t\t\tAsyncCallback updateTableCallback);\r\n}", "public interface IListviewBiz {\n\n void findItem(OnFinishedListener listener);\n\n}", "public interface MeetingoneView {\n void showLoadingProgress();\n void dismissLoadingProgress();\n void update(List<MyConnectionList.ResultEntity> userMeeting);\n}", "public interface RecordManager {\n\n void startRecord(String path);\n\n void stopRecord(Runnable endCallback);\n\n void init();\n\n void release();\n\n}", "public interface TradeRecordManager {\n /**\n * 插入充值记录\n * @param tradeRecordDTO 订单记录对象\n * @return 充值记录ID\n * @throws UserException\n * */\n Long addTradeRecord(TradeRecordDTO tradeRecordDTO) throws UserException;\n\n /**\n * 根据用户ID查询充值记录\n * @param userId 用户编号\n * @return 更新是否成功\n * @throws UserException\n * */\n TradeRecordDTO queryTradeRecordByUserId(Long userId) throws UserException;\n\n /**\n * 查询充值记录\n * */\n List<TradeRecordDTO> queryAll() throws UserException;\n\n /**\n * 条件查询充值记录\n * */\n List<TradeRecordDTO> query(TradeRecordQTO tradeRecordQTO) throws UserException;\n\n /**\n * 查询总量\n * */\n Long totalCount(TradeRecordQTO tradeRecordQTO) throws UserException;\n\n /**\n * 通过用户ID删除充值记录\n * */\n int deleteByUserId(Long userId) throws UserException;\n\n /**\n * 通过用户ID进行更新\n * */\n int updateByUserId(Long userId, TradeRecordDO tradeRecordDO) throws UserException;\n}", "abstract void doJob();", "@Override\n\tpublic void myWork() {\n\t\t\n\t}", "public interface JobScheduleMapper {\n @Select(\"select * from job_schedule where id = #{id}\")\n public JobSchedule findById(@Param(\"id\") long id);\n\n @Select(\"select status from job_schedule where id = #{id}\")\n public int getStatus(@Param(\"id\")long id);\n\n @Insert(\"insert into job_schedule (created_datetime, schedule_datetime, job_id, job_group_name, run_as, status) \" +\n \"values(#{created_datetime}, #{schedule_datetime}, #{job_id}, #{job_group_name}, #{run_as}, #{status})\")\n @Options(useGeneratedKeys = true, keyProperty = \"id\", keyColumn = \"id\")\n public void insert(JobSchedule jobSchedule);\n\n @Update(\"update job_schedule set status = #{status} where id = #{id}\")\n public void updateStatus(@Param(\"id\") long id, @Param(\"status\")int status);\n\n @Update(\"update job_schedule set status = \" + JobSchedule.JOB_SCHEDULE_STATUS_PENDING + \", retried = retried + 1 where id = #{id}\")\n public void retry(@Param(\"id\") long id);\n\n @Update(\"update job_schedule set next_job_schedule_id = #{nextId} where id = #{thisId}\")\n public void updateNextScheduleId(@Param(\"thisId\")long thisId, @Param(\"nextId\")long nextId);\n}", "public interface DataListener {\n void saveStuInfo(StuInfo stuInfo);\n\n void getStuInfo(HttpManagerListener.LoginCallBack callBack);\n\n void saveSchedule(Course course);\n\n List<Course> getAllCoursesByTerm(int termId);\n\n Course getCourse(int id);\n\n void upDateCourse(List<Course> courses, int termId);\n\n List<Score> getScoresByType(int type, int id);\n\n void saveScore(Score score);\n\n void saveNews(News news);\n News getNewsByUrl(String url);\n List<News> getNewsByEditor(String editor);\n List<News> getAllNews();\n\n void saveJobs(Job job);\n List<Job> getAllJobsByType(String type);\n\n void saveEditor(List<String> list, boolean type);\n List<String> getEditor(boolean type);\n\n List<MainImage> getImages();\n List<Todo> getTodos();\n List<Course> getCourseByDayAndTerm(int day, int termId);\n void saveTodos(List<Todo> todoList);\n\n List<Term> getTerms();\n void saveTerms(List<Term> terms);\n\n void saveCurrentTerm(int currentTerm);\n int getCurrentTerm();\n}" ]
[ "0.6550543", "0.64056754", "0.638222", "0.6264372", "0.6190887", "0.6180711", "0.6125415", "0.5972237", "0.5960622", "0.5933715", "0.5932625", "0.5914006", "0.5903251", "0.58961546", "0.5871407", "0.5845651", "0.5838413", "0.5815475", "0.58123755", "0.58038205", "0.58020455", "0.5788961", "0.5767669", "0.57626426", "0.5759304", "0.57553643", "0.5743686", "0.5734459", "0.57221824", "0.5715931", "0.56738377", "0.5672663", "0.5668864", "0.5667724", "0.5652165", "0.564287", "0.5630373", "0.5628301", "0.5621172", "0.56164503", "0.5609801", "0.5605133", "0.5587197", "0.5577051", "0.55762535", "0.5574542", "0.5569327", "0.5568806", "0.5562647", "0.5555401", "0.5555256", "0.5538885", "0.55231583", "0.55202603", "0.55128366", "0.55108887", "0.5488765", "0.5475748", "0.5475152", "0.54751134", "0.5473241", "0.5453604", "0.5451674", "0.54483205", "0.54457647", "0.54449207", "0.54439557", "0.54439557", "0.54395515", "0.54386324", "0.5436545", "0.54361546", "0.54231334", "0.54187196", "0.5417977", "0.5416694", "0.54159427", "0.54107577", "0.54057956", "0.5403288", "0.5402067", "0.5398781", "0.5392799", "0.53925234", "0.5386502", "0.538615", "0.5382207", "0.5381565", "0.5379878", "0.5379544", "0.53680265", "0.5366312", "0.536024", "0.53546274", "0.5348051", "0.5342409", "0.53396523", "0.5339562", "0.53394127", "0.5335564" ]
0.7140357
0
method which gets count all rows for tables by tableName and fild avaliable
int getCountAllRowsForTable(String tableName) throws DaoException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int getRowCount(String table) {\n return getIntFromQuery(\"SELECT COUNT(*) from \" + table, null);\n }", "int getTablesCount();", "private static int getTableCount(ISession session, String tableName) {\n int result = -1;\n ResultSet rs = null;\n try {\n String sql = \"select count(*) from \"+tableName; \n rs = executeQuery(session, sql);\n if (rs.next()) {\n result = rs.getInt(1);\n }\n } catch (Exception e) {\n /* Do Nothing - this can happen when the table doesn't exist */\n } finally {\n SQLUtilities.closeResultSet(rs, true);\n }\n return result; \n }", "protected int countRows(String tableName) \n\t{\n\t\tint result = -1;\n\t\t\n\t\ttry {\n\t\t\tStatement stat = conn.createStatement();\n\t\t\tResultSet rs = stat.executeQuery(\"select count(*) from \" + tableName + \";\");\n\t\t\tresult = rs.getInt(rs.getRow());\n\t\t\t// freakin hell wat een @#*$@#($* werk om deze op te zoeken :/\n\t\t} \n\t\tcatch (SQLException e) \n\t\t{\n\t\t\tSystem.out.println(\"Something went wrong counting users from Persons\");\n\t\t}\n\t\t\n\t\treturn result;\n\t}", "int get_row_count(String table) {\n //table does not exist\n if (!get_table_names().contains(table) && !table.equals(\"relationship\")) {\n throw new RuntimeException(\"Table does not exist.\");\n }\n\n //maybe use select count(id) from table instead\n String sql = \"select * from \" + table;\n int count = 0;\n\n ResultSet resultSet = execute_statement(sql, true);\n try {\n while (resultSet.next()) {\n count++; //count number of entities\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n\n try {\n this.disconnect(resultSet, null, null); //disconnect from database\n } catch (SQLException e) {\n e.printStackTrace();\n }\n return count;\n }", "protected int countRowsInTable( String tableName ) {\n return SimpleJdbcTestUtils.countRowsInTable( this.simpleJdbcTemplate, tableName );\n }", "public long getTableRowCount(String tableName) throws SQLException {\n throw new UnsupportedOperationException();\n }", "int getRowsCount();", "public int getNumEntries(String tableName){\n\t\tint numEntries = -9999;\n\t\ttry{\n\t\t\tpst = con.prepareStatement(\"SELECT COUNT(*) FROM \" + tableName);\n\t\t\trs = pst.executeQuery();\n\t\t if (rs.next()) // COUNT(*) query should only return 1 row of result\n\t\t numEntries = Integer.parseInt(rs.getString(1));\n }catch(SQLException ex){\n \tLogger lgr = Logger.getLogger(FillRelations.class.getName());\n \tlgr.log(Level.WARNING, ex.getMessage(), ex);\n }\n return numEntries;\n\t}", "int countRows() throws IOException {\n Scan s = new Scan();\n ResultScanner rs = tbl.getScanner(s);\n int i = 0;\n while(rs.next() !=null) {\n i++;\n }\n return i;\n }", "public boolean tableHasRecords(String tableName) {\n\n int count = 0;\n\n try{\n PreparedStatement query = conn.prepareStatement(\"SELECT COUNT(id) AS 'count' FROM \" + tableName + \";\");\n ResultSet results = query.executeQuery();\n\n while (results.next()){\n count = results.getInt(\"count\");\n } \n\n if(count > 0){\n return true;\n }\n\n } catch (SQLException e){\n e.printStackTrace();\n }\n\n return false;\n }", "int countByExample(Assist_tableExample example);", "public int getListCount() {\n String countQuery = \"SELECT * FROM \" + TABLE_NAME;\n SQLiteDatabase db = this.getReadableDatabase();\n Cursor cursor = db.rawQuery(countQuery, null);\n cursor.close();\n return cursor.getCount();\n }", "public int getUangCount(){\n String countQuery = \"SELECT * FROM \" + TABLE_NAME;\n SQLiteDatabase db = this.getReadableDatabase();\n Cursor cursor = db.rawQuery(countQuery, null);\n cursor.close();\n return cursor.getCount();\n }", "public int totalRowsCount();", "public int countAll() throws DAOException;", "public int countAll() throws SQLException\n {\n return countWhere(\"\");\n }", "public int countAll() throws SQLException\n {\n return countWhere(\"\");\n }", "public int countAll() throws SQLException\n {\n return countWhere(\"\");\n }", "private int countTables() {\r\n\tint result = -1;\r\n\r\n\tStatement stat = null;\r\n\tResultSet rs = null;\r\n\ttry {\r\n\t stat = conn.createStatement();\r\n\r\n\t rs = stat\r\n\t\t .executeQuery(\"SELECT count(1) FROM sqlite_master where name not like '%sequence%'\");\r\n\r\n\t if (rs.next()) {\r\n\t\tint count = rs.getInt(1);\r\n\r\n\t\tif (count > 0) {\r\n\t\t result = count;\r\n\t\t}\r\n\t }\r\n\t} catch (Exception e) {\r\n\t // nothing todo here\r\n\t} finally {\r\n\t Cleanup(stat, rs);\r\n\t}\r\n\r\n\treturn result;\r\n }", "public long countRecords(String tableName) {\r\n\tlong result = -1;\r\n\r\n\tStatement st = null;\r\n\tResultSet rs = null;\r\n\ttry {\r\n\t st = conn.createStatement();\r\n\r\n\t rs = st.executeQuery(\"select count(1) from \" + tableName + \";\");\r\n\r\n\t if (rs.next()) {\r\n\t\tresult = rs.getLong(1);\r\n\t }\r\n\t} catch (Exception e) {\r\n\t // nothing todo here\r\n\t} finally {\r\n\t Cleanup(st, rs);\r\n\t}\r\n\r\n\treturn result;\r\n }", "public int getRowCount(String tableName) throws SQLException {\n\t\tString rows = null;\n\t\ttry {\n\t\t\tif (stmt == null || con == null) {\n\t\t\t\tSystem.out.println(\"Null value found for statement or connection\");\n\t\t\t}\n\t\t\trs = stmt.executeQuery(\"SELECT count(*) from \" + tableName + \";\");\n\t\t\twhile (rs.next()) {\n\t\t\t\trows = rs.getString(1);\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"SQL Exception \");\n\t\t\te.printStackTrace();\n\t\t}\n\t\tSystem.out.println(rows);\n\t\tint rowCount = Integer.parseInt(rows);\n\t\treturn rowCount;\n\t}", "@Override\n\tpublic int getCount() throws TableException\n\t{\n\t\tAtomicInteger count = new AtomicInteger(0);\n\t\ttry\n\t\t{\n\t\t\tcountTuplesRec(protocol, count);\n\t\t}\n\t\tcatch (DatabaseException e)\n\t\t{\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\t\treturn count.get();\n\t}", "public int getTableCount(int tableID){\n int count = -1;\n\n try {\n PreparedStatement getCount = db.getConnection()\n .prepareStatement(\"SELECT * FROM \" + DBConst.TABLE_RESERVATIONS + \" WHERE \"\n + DBConst.RESERVATIONS_COLUMN_TABLE + \" = '\" + tableID + \"'\", ResultSet.TYPE_SCROLL_SENSITIVE,\n ResultSet.CONCUR_UPDATABLE);\n ResultSet data = getCount.executeQuery();\n data.last();\n count = data.getRow();\n }\n catch(SQLException e) {\n e.printStackTrace();\n }\n return count;\n\n }", "long countByExample(Table2Example example);", "private int getJTableNumberOfRows() {\n\n\t\tint count = 0; /* create a integer object for rows count */\n\t\tConnection connection = null;\n\t\tStatement statement = null;\n\t\ttry {\n\t\t\tconnection = DriverManager.getConnection(DATABASE_URL, UserName_SQL, Password_SQL);\n\t\t\tstatement = connection.createStatement();\n\t\t\tResultSet resultSet = statement.executeQuery(\"SELECT COUNT(*) as numberOfRows FROM invoice\");\n\t\t\tresultSet.next();\n\t\t\tcount = resultSet.getInt(\"numberOfRows\");\n\t\t\tresultSet.close();\n\t\t} // end try\n\t\tcatch (SQLException sqlException) {\n\t\t\tsqlException.printStackTrace();\n\t\t\tSystem.exit(1);\n\t\t} // end catch\n\t\tfinally // ensure statement and connection are closed properly\n\t\t{\n\t\t\ttry {\n\t\t\t\tstatement.close();\n\t\t\t\tconnection.close();\n\t\t\t} // end try\n\t\t\tcatch (Exception exception) {\n\t\t\t\texception.printStackTrace();\n\t\t\t\tSystem.exit(1);\n\t\t\t} // end catch\n\t\t} // end finally\n\t\treturn count; /* return the result of rows count */\n\t}", "@Override\n\tpublic int selectCount(Map<String, Object> params) {\n\t\treturn this.tableConfigDao.selectCount(params);\n\t}", "public int total(){\n int rows = 0;\n \n try {\n rs = stmt.executeQuery \n (\"SELECT * FROM JEREMY.TICKET\");\n while (rs.next()) {rows++;}\n System.out.println(\"There are \"+ rows + \" record in the table\"); \n \n } catch (Exception e) {}\n \n return rows;\n }", "@Override\n\tpublic Long count() {\n\t\treturn SApplicationcategorydao.count(\"select count(*) from \"+tablename+\" t\");\n\t}", "public long countRecords();", "@Override\n\tpublic Long count(Map<String, Object> params) {\n\t\tString hql=\"select count(*) from \"+tablename+\" t\";\n\t\treturn SApplicationcategorydao.count(hql, params);\n\t}", "@Override\n\t\tpublic int getRowCount() \n\t\t{\n\t\t\treturn tables.size();\n\t\t}", "int findAllCount() ;", "public int countAll() throws SQLException {\n\t\tfinal String sql = \"SELECT count(*) FROM \" + table_name;\n\t\tPreparedStatement statement = null;\n\t\tResultSet result = null;\n\t\tint allRows = ROW_COUNT_ZERO;\n\n\t\ttry {\n\t\t\tfinal Connection connection = _database.getConnection();\n\t\t\tstatement = connection.prepareStatement(sql);\n\t\t\tresult = statement.executeQuery();\n\n\t\t\tif (result.next()) {\n\t\t\t\tallRows = result.getInt(INDEX_ONE);\n\t\t\t}\n\t\t} finally {\n\t\t\tif (result != null) {\n\t\t\t\tresult.close();\n\t\t\t}\n\t\t\tif (statement != null) {\n\t\t\t\tstatement.close();\n\t\t\t}\n\t\t}\n\t\treturn allRows;\n\t}", "int tableSize();", "Integer getBlockCountByMinMax(@Param(\"tableName\") String tableName);", "public int countAll();", "public int countAll();", "public int countAll();", "public int countAll();", "public int countAll();", "public int countAll();", "public int countAll();", "public int countAll();", "public int countAll();", "public int countAll();", "public int countAll();", "public long countAll();", "public int getTotalRows();", "public int getcount() {\n\t\tString countQuery = \"SELECT * FROM \" + DATABASE_TABLE1;\n\t \n\t Cursor cursor = ourDatabase.rawQuery(countQuery, null);\n\t int cnt = cursor.getCount();\n\t cursor.close();\n\t return cnt;\n\t\n\t}", "Long getAllCount();", "@Override\n public int getTablesCount() {\n return tables_.size();\n }", "int countByExample(ParseTableLogExample example);", "public int CountTable(String TableName) throws SQLException {\n int count = 0;\n Connect();\n Statement stmt = conn.createStatement();\n ResultSet r = stmt.executeQuery(\"SELECT COUNT(*) AS rowcount FROM \" + TableName);\n while (r.next()) {\n count = r.getInt(1);\n }\n r.close();\n DisConnect();\n return count;\n }", "long countAll();", "long countAll();", "public int searchRowsCount(SearchCriteria cri);", "int countByExample(TABLE41Example example);", "public long getAllStatementCount();", "public Integer countAll();", "public int getAllCount(){\r\n\t\tString sql=\"select count(*) from board_notice\";\r\n\t\tint result=0;\r\n\t\tConnection conn=null;\r\n\t\tStatement stmt=null;\r\n\t\tResultSet rs=null;\r\n\t\ttry{\r\n\t\t\tconn=DBManager.getConnection();\r\n\t\t\tstmt=conn.createStatement();\r\n\t\t\trs=stmt.executeQuery(sql);\r\n\t\t\trs.next();\r\n\t\t\tresult=rs.getInt(1);\r\n\t\t}catch(Exception e){\r\n\t\t\te.printStackTrace();\r\n\t\t}finally{\r\n\t\t\tDBManager.close(conn, stmt, rs);\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "public int getTargetTableRecordsCount(final DataSource dataSource, final String tableName) {\n List<Map<String, Object>> targetList = queryForListWithLog(dataSource, \"SELECT COUNT(1) AS count FROM \" + tableName);\n assertFalse(targetList.isEmpty());\n return ((Number) targetList.get(0).get(\"count\")).intValue();\n }", "public static long getRowCount(Session session, String tableName) {\n\t\tObjects.requireNonNull(session, \"Session must not be null\");\n\t\tObjects.requireNonNull(tableName, \"Table must not be null\");\n\t\tlong count = 0;\n\t\tResultSet resultSet = executeStatement(session, String.format(\"SELECT COUNT(*) as total FROM %s\", tableName));\n\t\tfor (Row row : resultSet) {\n\t\t\tcount += row.getLong(\"total\");\n\t\t}\n\t\treturn count;\n\t}", "@Override\n public int findTotal(){\n try {\n return runner.query(con.getThreadConnection(),\"select count(*) from user\",new BeanHandler<Integer>(Integer.class));\n } catch (SQLException e) {\n System.out.println(\"执行失败\");\n throw new RuntimeException(e);\n }\n }", "@Override\n\tpublic long countBy(ITableDBContext context, Table table, IDBFilter filter) throws Throwable {\n\t\tthrow new Warning(\"not impl\");\n\t}", "@Override\r\n\t@Transactional\r\n\tpublic int getCount(List<Filter> filters){\r\n\t\ttry{\r\n\t\t\tString sql = \"select count(*) \"\r\n\t\t\t\t\t + \"from FmtEstado \";\r\n\t\t\t\r\n\t\t\tsql = sqlFunctions.completeSQL(null, filters, sql, FmtEstado.getColumnNames());\r\n\t\t\t\r\n\t\t\tQuery query = getSession().createQuery(sql);\r\n\t \r\n\t\t\t query=sqlFunctions.setParameters(filters, query);\r\n\t\t\t \r\n\t\t\tIterator it = query.list().iterator();\r\n\t Long ret = new Long(0);\r\n\t \r\n\t if (it != null)\r\n\t\t if (it.hasNext()){\r\n\t\t \tret = (Long) it.next();\r\n\t\t }\r\n\t \r\n\t\t\treturn ret.intValue();\r\n\t\t}catch(Exception e){\r\n\t\t\te.printStackTrace();\r\n\t\t\treturn 0;\r\n\t\t}\r\n\t}", "long countNumberOfProductsInDatabase();", "@Override\n public long count() {\n String countQuery = \"SELECT COUNT(*) FROM \" + getTableName();\n return getJdbcTemplate().query(countQuery, SingleColumnRowMapper.newInstance(Long.class))\n .get(0);\n }", "public int CountByArgs(String TableName, String Args) throws SQLException {\n int count = 0;\n Connect();\n Statement s = conn.createStatement();\n ResultSet r = s.executeQuery(\"SELECT COUNT(*) AS rowcount FROM \" + TableName + \" WHERE \" + Args);\n while (r.next())\n count = r.getInt(1);\n r.close();\n DisConnect();\n return count;\n }", "public static int getTableCount(ISession session, \n String catalog,\n String schema, \n String tableName,\n int sessionType) \n throws UserCancelledOperationException\n {\n String table = getQualifiedObjectName(session, \n catalog, \n schema,\n tableName, \n sessionType);\n return getTableCount(session, table);\n }", "public int resultCount(){\n\n int c = 0;\n\n try{\n if(res.last()){\n c = res.getRow();\n res.beforeFirst();\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n return c;\n }", "int getLevelTableListCount();", "public abstract int getNumOfRows();", "int rowCount();", "@Override\n public int cantAlumnos(String curso) throws Exception {\n Connection c = null;\n PreparedStatement pstmt = null;\n ResultSet rs = null;\n int cantAlumnos = 0;\n try {\n c = DBUtils.getConnection();\n pstmt = c.prepareStatement(\"select count(a.id) as cant from alumno a, curso cu \"\n + \"where a.idCurso = cu.idcurso \"\n + \"and UPPER(cu.nombreCurso) like UPPER(?)\");\n pstmt.setString(1, curso); \n rs = pstmt.executeQuery();\n\n while (rs.next()) { \n cantAlumnos = rs.getInt(\"cant\");\n } \n return cantAlumnos;\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n try {\n if (rs != null) {\n rs.close();\n }\n if (pstmt != null) {\n pstmt.close();\n }\n DBUtils.closeConnection(c);\n } catch (SQLException ex) {\n Logger.getLogger(JdbcCursoRepository.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n return cantAlumnos;\n }", "@Override\n\tpublic Long totalRegistrosTabela(String table) throws Exception {\n\t\treturn null;\n\t}", "public static int getCountofPeople(){\n int training_set = 0;\n \n try (Connection con = DriverManager.getConnection(url, user, password)){\n String query = \"SELECT count(*) FROM \"+DATABASE_NAME+\".People;\";\n Statement st = con.createStatement();\n ResultSet rs = st.executeQuery(query);\n if (rs.next()) {\n training_set = rs.getInt(1);\n }\n con.close();\n }catch (SQLException ex) {\n ex.printStackTrace();\n } \n\n return training_set;\n }", "abstract public TypedQuery<?> getCountQuery() ;", "public Long getCountAllResults() {\n\n //create a querybuilder for count\n QueryBuilder queryBuilderCount = dao.getQueryBuilder()\n .from(dao.getEntityClass(), (joinBuilder != null ? joinBuilder.getRootAlias() : null))\n .join(joinBuilder)\n .add(getCurrentQueryRestrictions())\n .debug(debug);\n\n Long rowCount;\n //added distinct verification\n if (joinBuilder != null && joinBuilder.isDistinct()) {\n rowCount = queryBuilderCount.countDistinct(joinBuilder.getRootAlias());\n } else {\n rowCount = queryBuilderCount.count();\n }\n\n return rowCount;\n }", "protected String getCountSql(String table,\r\n String whereClause) {\r\n StringBuffer sql = new StringBuffer(\"select count(*) from \");\r\n\r\n sql.append(table);\r\n sql.append(\" \");\r\n sql.append(whereClause);\r\n return sql.toString();\r\n }", "@Test\n public void testGetTables() throws Exception {\n Map<String, Long> tableCounts = managementService.getTableCount();\n\n CloseableHttpResponse response = executeRequest(new HttpGet(SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_TABLES_COLLECTION)),\n HttpStatus.SC_OK);\n\n // Check table array\n JsonNode responseNode = objectMapper.readTree(response.getEntity().getContent());\n closeResponse(response);\n assertThat(responseNode).isNotNull();\n assertThat(responseNode.isArray()).isTrue();\n assertThat(responseNode).hasSize(tableCounts.size());\n\n for (int i = 0; i < responseNode.size(); i++) {\n ObjectNode table = (ObjectNode) responseNode.get(i);\n assertThat(table.get(\"name\").textValue()).isNotNull();\n assertThat(table.get(\"count\").longValue()).isNotNull();\n assertThat(table.get(\"url\").textValue()).endsWith(RestUrls.createRelativeResourceUrl(RestUrls.URL_TABLE, table.get(\"name\").textValue()));\n assertThat(table.get(\"count\").longValue()).isEqualTo(tableCounts.get(table.get(\"name\").textValue()).longValue());\n }\n }", "public abstract int getNumRows();", "@Override\r\n\tpublic int getAllRowCount(String hql) {\n\t\tTransaction tx = null;\r\n int allRows = 0;\r\n try{\r\n \tSession session = MyHibernateSessionFactory.getSessionFactory().getCurrentSession();\r\n tx = session.beginTransaction();\r\n Query query = session.createQuery(hql);\r\n allRows = query.list().size();\r\n tx.commit();\r\n return allRows;\r\n }catch(Exception ex){\r\n\t\t\tex.printStackTrace();\r\n\t\t\treturn -1;\r\n\t\t}finally{\r\n\t\t\tif(tx!=null){\r\n\t\t\t\ttx=null;\r\n\t\t\t}\r\n\t\t\t//HibernateUtil.closeSession(session);\r\n\t\t}\r\n \r\n \r\n\t}", "public int getRowCount() {\r\n String countQuery = \"SELECT * FROM \" + User.TABLE_USER_NAME;\r\n SQLiteDatabase db = this.getReadableDatabase();\r\n Cursor cursor = db.rawQuery(countQuery, null);\r\n int rowCount = cursor.getCount();\r\n db.close();\r\n cursor.close();\r\n\r\n // return row count\r\n return rowCount;\r\n }", "public static int getRowCount() {\n ResultSet rs = null;\n int rows = 0;\n try (\n Statement stmt = conn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_READ_ONLY);) {\n rs = stmt.executeQuery(\"SELECT * FROM sensors\");\n rs.last();\n rows = rs.getRow();\n\n } catch (SQLException e) {\n System.err.println(e);\n } finally {\n if (rs != null) {\n try {\n rs.close();\n } catch (SQLException ex) {\n Logger.getLogger(DBExecute.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n }\n }\n return rows;\n }", "int colCount();", "public int numberOfRows(){\n SQLiteDatabase db = this.getReadableDatabase();\n int numRows = (int) DatabaseUtils.queryNumEntries(db,TABLE_NAME);\n return numRows;\n }", "public int getFullCount(String table, String where) {\r\n Cursor cursor = db.query(false, table, null, where, null, null, null, null, null);\r\n try {\r\n if (cursor != null) {\r\n cursor.moveToFirst();\r\n no = cursor.getCount();\r\n cursor.close();\r\n }\r\n } finally {\r\n cursor.close();\r\n }\r\n return no;\r\n }", "int countByExample(AdminTabExample example);", "public int getSoupKitchenCount() {\n\n MapSqlParameterSource params = new MapSqlParameterSource();\n //here we want to get total from food pantry table\n String sql = \"SELECT COUNT(*) FROM cs6400_sp17_team073.Soup_kitchen\";\n\n Integer skcount = jdbc.queryForObject(sql,params,Integer.class);\n\n return skcount;\n }", "@Override\r\n\tpublic int getCountByAll() throws Exception {\n\t\treturn 0;\r\n\t}", "public static int getNumberOfRowsTBLSERVERS() throws SQLException {\n\t\tstmt = conn.createStatement();\r\n\t\tStatement stmt4 = conn.createStatement();\r\n\t\tResultSet rownumber = stmt4.executeQuery(\"SELECT COUNT (*) AS count1 FROM TBLSERVERS\"); // SQL Count query\r\n\t\trownumber.next();\r\n\r\n\t\tint rnum = rownumber.getInt(1);\r\n\t\tSystem.out.println(rnum); // for debugging purposes\r\n\t\treturn rnum; //return value\r\n\r\n\t}", "public int findRowCount () throws DataAccessException;", "@Override\n public final long countAll(final DataTablePredicate predicate) {\n\treturn (long) getEntityManager()\n\t\t.createQuery(\"select count(*) from \"\n\t\t\t+ searchQuery)\n\t\t.setParameter(\"search\", predicate.getSearch() + \"%\")\n\t\t.getSingleResult();\n }", "public long getCount(String setName) throws Exception {\n long count = 0;\n Table set = HbaseManager.getInstance().getTable(setName);\n\n //TODO: assume only one row key exists\n Get get = new Get(setName.getBytes());\n get.setMaxVersions(1);\n get.setMaxVersions(1);\n get.setConsistency(Consistency.TIMELINE);\n get.isCheckExistenceOnly();\n Result rs = null;\n\n try {\n rs = set.get(get);\n } catch (IOException e) {\n e.printStackTrace();\n throw new Exception(e);\n }\n if (rs != null) {\n\n if (rs.listCells() != null) {\n for (Cell cell : rs.listCells()) {\n count++;\n }\n }\n }\n return count;\n }", "private int numRows(){\n return attrTable.getModel().getRowCount();\n }", "public int selectRowCount (final String sql) throws DataAccessException;", "public int countArticle(){\n\n DatabaseHelper databaseHelper = DatabaseHelper.getInstance(this.mExecutionContext);\n SQLiteDatabase sqLiteDatabase = databaseHelper.getReadableDatabase();\n\n Cursor Count= sqLiteDatabase.rawQuery(\"select count(*) from\"+ ConfigDAO.TABLE_AISLE, null);\n Count.moveToFirst();\n int count= Count.getInt(0);\n Count.close();\n return count;\n }", "private int getForFunCount(){\n int count = 0;\n\n String whereClause = DbHelper.IS_FOR_FUN + \" = ?\";\n String[] whereArgs = new String[]{String.valueOf(true)};\n\n Cursor cursor = mDbHelper.getReadableDatabase().query(DbHelper.TABLE_NAME, null, whereClause, whereArgs, null, null, null);\n\n while(cursor.moveToNext()){\n count++;\n }\n\n return count;\n }", "@Override\r\n\tpublic String count(String sql) {\n\t\treturn null;\r\n\t}" ]
[ "0.7671549", "0.76430076", "0.7530218", "0.74304396", "0.7396591", "0.7358546", "0.719564", "0.70868874", "0.69678926", "0.69536346", "0.6926337", "0.68926144", "0.68755895", "0.6847196", "0.6832651", "0.6831768", "0.67870486", "0.67870486", "0.67870486", "0.6779048", "0.67388505", "0.6736683", "0.67285043", "0.6724928", "0.6702099", "0.6669853", "0.6653829", "0.66526216", "0.6616282", "0.65996414", "0.6593969", "0.65904117", "0.6572277", "0.65699464", "0.65584505", "0.6542993", "0.64826185", "0.64826185", "0.64826185", "0.64826185", "0.64826185", "0.64826185", "0.64826185", "0.64826185", "0.64826185", "0.64826185", "0.64826185", "0.64571387", "0.6435937", "0.64286584", "0.641262", "0.6411823", "0.6388142", "0.63518316", "0.63504046", "0.63504046", "0.6344246", "0.63441145", "0.63400215", "0.6325086", "0.6315377", "0.63143915", "0.6313301", "0.6304008", "0.6292661", "0.6290592", "0.62813926", "0.627948", "0.6261106", "0.6257139", "0.62538296", "0.6249819", "0.62460536", "0.62400913", "0.6215602", "0.6209966", "0.62047833", "0.6203618", "0.61886066", "0.61839986", "0.61764914", "0.6175774", "0.61686105", "0.6158888", "0.6149794", "0.6145028", "0.61393774", "0.6137704", "0.6130418", "0.6128076", "0.61221063", "0.6119737", "0.61140406", "0.6105758", "0.60999054", "0.60665756", "0.6064684", "0.6052665", "0.6049656", "0.60430074" ]
0.86447835
0
Used to send reply back to client using routing hint and client socket stored in clientMap
private static void sendBytesToClient(String routingHint, byte[] bytes) throws IOException { Socket clientSocket = clientMap.get(routingHint); DataOutputStream outputStream = new DataOutputStream(clientSocket.getOutputStream()); outputStream.writeInt(bytes.length); outputStream.write(bytes); outputStream.flush(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void reply(Server server);", "private void sendReply(Gossip_message reply, DataOutputStream clientStream) {\n\t\ttry {\n\t\t\tSystem.out.println(\"Invio risposta: \"+reply.getJsonString());\n\t\t\tclientStream.writeUTF(reply.getJsonString());\n\t\t} catch (IOException e) {}\n\t}", "private void handleClient() {\n\t\t//Socket link = null;\n\t\tRequestRecord reqRec = new RequestRecord();\n\t\tResponder respondR = new Responder();\n\t\t\n\t\ttry {\n\t\t\t// STEP 1 : accepting client request in client socket\n\t\t\t//link = servSock.accept(); //-----> already done in *ThreadExecutor*\n\t\t\t\n\t\t\t// STEP 2 : creating i/o stream for socket\n\t\t\tScanner input = new Scanner(link.getInputStream());\n\t\t\tdo{\n\t\t\t\t//PrintWriter output = new PrintWriter(link.getOutputStream(),true);\n\t\t\t\t//DataOutputStream ds = new DataOutputStream(link.getOutputStream());\n\t\t\t\tint numMsg = 0;\n\t\t\t\tString msg = input.nextLine();\n\t\t\t\t\n\t\t\t\t//to write all requests to a File\n\t\t\t\tFileOutputStream reqFile = new FileOutputStream(\"reqFile.txt\");\n\t\t\t\tDataOutputStream dat = new DataOutputStream(reqFile);\n\t\t\t\t\n\t\t\t\t// STEP 4 : listening iteratively till close string send\n\t\t\t\twhile(msg.length()>0){\n\t\t\t\t\tnumMsg++;\n\t\t\t\t\tdat.writeChars(msg + \"\\n\");\n\t\t\t\t\tSystem.out.println(\"\\nNew Message Received\");\n\t\t\t\t\tif(reqRec.setRecord(msg)==false)\n\t\t\t\t\t\tSystem.out.println(\"\\n-----\\nMsg#\"+numMsg+\": \"+msg+\":Error with Request Header Parsing\\n-----\\n\");\n\t\t\t\t\telse\n\t\t\t\t\t\tSystem.out.println(\"Msg#\" + numMsg + \": \" + msg);\n\t\t\t\t\tmsg = input.nextLine();\n\t\t\t\t};\n\t\t\t\tdat.writeChars(\"\\n-*-*-*-*-*-*-*-*-*-*-*-*-*-\\n\\n\");\n\t\t\t\tdat.close();\n\t\t\t\treqFile.close();\n\t\t\t\tSystem.out.println(\"---newEST : \" + reqRec.getResource());\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"\\n==========Send HTTP Response for Get Request of\\n\"+reqRec.getResource()+\"\\n***********\\n\");\n\t\t\t\tif(respondR.sendHTTPResponseGET(reqRec.getResource(), link)==true)//RES, ds)==true)\n\t\t\t\t\tSystem.out.println(\"-----------Resource Read\");\n\t\t\t\tSystem.out.println(\"Total Messages Transferred: \" + numMsg);\n\t\t\t\t//link.close();\n\t\t\t\tif(reqRec.getConnection().equalsIgnoreCase(\"Keep-Alive\")==true && respondR.isResourceExisting(reqRec.getResource())==true)\n\t\t\t\t\tlink.setKeepAlive(true);\n\t\t\t\telse\n\t\t\t\t\tbreak;\n\t\t\t}while(true);\n\t\t\tSystem.out.print(\"Request Link Over as Connection: \" + reqRec.getConnection());\n\t\t} catch (IOException e) {\n\t\t\tif(link.isClosed())\n\t\t\t\tSystem.out.print(\"\\n\\nCritical(report it to developer):: link closed at exception\\n\\n\");\n\t\t\tSystem.out.println(\"Error in listening.\\n {Error may be here or with RespondR}\\nTraceString: \");\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\t// STEP 5 : closing the connection\n\t\t\tSystem.out.println(\"\\nClosing Connection\\n\");\n\t\t\ttry {\t\t\t\t\n\t\t\t\tlink.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.out.println(\"Unable to disconnect.\\nTraceString: \");\n\t\t\t\te.printStackTrace();\n\t\t\t\tSystem.exit(1);\n\t\t\t}\n\t\t}/*ends :: try...catch...finally*/\n\t\t\n\t}", "private void sendMessage(WeakReference<Messenger> client, int msgCode, int requestCode, String message){\n \tLog.v(TAG,\"sendMessage: The message was: \" + message + \" (\" + msgCode + \")\" + \" requestCode was \" + requestCode);\n try {\n \t\tclient.get().send(Message.obtain(null, msgCode, requestCode, mState.ordinal(), message));\n } catch (RemoteException e) {\n // The client is dead. \n \t\tLog.e(TAG,\"sendMessage: The client is dead. Message was: \" + message + \" (\" + msgCode + \")\");\n } catch (NullPointerException e) {\n // The reply to client is does not exist. \n \t\tLog.e(TAG,\"sendMessage: client was null. Message was: \" + message + \" (\" + msgCode + \")\");\n }\n }", "public void responseSent(DesktopCtrl desktopCtrl, String channel, String reqId, Object resInfo);", "@Test\n public void testReplyFromClient(TestContext context) {\n NetClient client = vertx.createNetClient();\n final Async async = context.async();\n final String address = \"test\";\n client.connect(7000, \"localhost\").onComplete(context.asyncAssertSuccess(socket -> {\n\n final FrameParser parser = new FrameParser(parse -> {\n context.assertTrue(parse.succeeded());\n JsonObject frame = parse.result();\n if (\"message\".equals(frame.getString(\"type\"))) {\n context.assertEquals(true, frame.getBoolean(\"send\"));\n context.assertEquals(\"Vert.x\", frame.getJsonObject(\"body\").getString(\"value\"));\n FrameHelper.sendFrame(\"send\", frame.getString(\"replyAddress\"), new JsonObject().put(\"value\", \"You got it\"), socket);\n }\n });\n\n socket.handler(parser);\n\n FrameHelper.sendFrame(\"register\", address, null, socket);\n\n // There is now way to know that the register actually happened, wait a bit before sending.\n vertx.setTimer( 500L, timerId -> {\n vertx.eventBus().<JsonObject>request(address, new JsonObject().put(\"value\", \"Vert.x\")).onComplete(respMessage -> {\n context.assertTrue(respMessage.succeeded());\n context.assertEquals(\"You got it\", respMessage.result().body().getString(\"value\"));\n client.close();\n async.complete();\n });\n });\n\n }));\n\n }", "private void makeReply(JSONObject request, DataOutputStream clientStream) throws ParseException, IOException {\n\t\tGossip_client_message.Op op = Gossip_parser.getClientOp(request);\n\t\tString sender = Gossip_parser.getClientName(request);\n\t\ttry {\n\t\t\t\tswitch(op) {\n\t\t\t\n\t\t\t\tcase REGISTER_OP: {\n\t\t\t\t\tString password = Gossip_parser.getPassword(request);\n\t\t\t\t\tString language = Gossip_parser.getLanguage(request);\n\t\t\t\t\tdata.addUser(sender, password, language);\n\t\t\t\t\t//recupero la lista delle chat\n\t\t\t\t\tArrayList<Gossip_chat> chatlist = data.getChats();\n\t\t\t\t\t//invio dati di registrazione\n\t\t\t\t\tsendReply(new Gossip_info_registration_message(chatlist, data.getUser(sender)), clientStream);\n\t\t\t\t} break;\n\t\t\t\t\n\t\t\t\tcase LOGIN_OP: {\n\t\t\t\t\tString password = Gossip_parser.getPassword(request);\n\t\t\t\t\tif (data.getUser(sender).getPassword().equals(password)) {\n\t\t\t\t\t\t//imposto l'utente come online\n\t\t\t\t\t\tdata.setStatus(sender, true);\n\t\t\t\t\t\t//recupero la lista degli amici e quella delle chat\n\t\t\t\t\t\tArrayList<Gossip_user> friendlist = data.getFriends(sender);\n\t\t\t\t\t\tArrayList<Gossip_chat> chatlist = data.getChats();\n\t\t\t\t\t\t//invio dati di login\n\t\t\t\t\t\tsendReply(new Gossip_info_login_message(friendlist, chatlist, data.getUser(sender)), clientStream);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t//password errata\n\t\t\t\t\t\tsendReply(new Gossip_fail_message(Gossip_fail_message.failMsg.WRONGPASSWORD), clientStream);\n\t\t\t\t} break;\n\t\t\t\t\t\n\t\t\t\tcase LOGOUT_OP: {\n\t\t\t\t\tdata.setStatus(sender, false);\n\t\t\t\t\tsendReply(new Gossip_server_message(Gossip_server_message.Op.SUCCESS_OP), clientStream);\n\t\t\t\t} break;\n\t\t\t\t\t\n\t\t\t\tcase ACTION_OP:\n\t\t\t\t\tmakeAction(request, clientStream);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase LISTENING_OP:\n\t\t\t\t\tString password = Gossip_parser.getPassword(request);\n\t\t\t\t\t//memorizzo il socket solo se la password è esatta\n\t\t\t\t\tif (data.getUser(sender).getPassword().equals(password)) {\n\t\t\t\t\t\tdata.getUser(sender).setMessageSocket(clientSocket);\n\t\t\t\t\t\t//è un socket solo per le notifiche, faccio terminare il thread\n\t\t\t\t\t\tcloseThread = true;\n\t\t\t\t\t\tsendReply(new Gossip_server_message(Gossip_server_message.Op.SUCCESS_OP), clientStream);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t//termino comunque il thread\n\t\t\t\t\t\tcloseThread = true;\n\t\t\t\t\t\tsendReply(new Gossip_fail_message(Gossip_fail_message.failMsg.WRONGPASSWORD), clientStream);\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tcase CHAT_OP:\n\t\t\t\t\t//operazione di interazione con chatroom\n\t\t\t\t\tmakeChatOp(request, clientStream);\n\t\t\t\t\tbreak;\n\t\t\t\t\t\n\t\t\t\tdefault:\n\t\t\t\t\tsendReply(new Gossip_fail_message(Gossip_fail_message.failMsg.UNKNOWN_REQUEST), clientStream);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t} catch (NodeAlreadyException e) {\n\t\t\t//username già in uso\n\t\t\tsendReply(new Gossip_fail_message(Gossip_fail_message.failMsg.NICKALREADY), clientStream);\n\t\t} catch (NodeNotFoundException e) {\n\t\t\t//utente non registrato\n\t\t\tsendReply(new Gossip_fail_message(Gossip_fail_message.failMsg.NICKUNKNOWN), clientStream);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "@Test\n public void testReplyStringMessageFromClient(TestContext context) {\n NetClient client = vertx.createNetClient();\n final Async async = context.async();\n final String address = \"test\";\n client.connect(7000, \"localhost\").onComplete(context.asyncAssertSuccess(socket -> {\n\n final FrameParser parser = new FrameParser(parse -> {\n context.assertTrue(parse.succeeded());\n JsonObject frame = parse.result();\n if (\"message\".equals(frame.getString(\"type\"))) {\n context.assertEquals(true, frame.getBoolean(\"send\"));\n context.assertEquals(\"Vert.x\", frame.getJsonObject(\"body\").getString(\"value\"));\n FrameHelper.sendFrame(\"send\", frame.getString(\"replyAddress\"), \"You got it\", socket);\n }\n });\n\n socket.handler(parser);\n\n FrameHelper.sendFrame(\"register\", address, null, socket);\n\n // There is now way to know that the register actually happened, wait a bit before sending.\n vertx.setTimer( 500L, timerId -> {\n vertx.eventBus().<JsonObject>request(address, new JsonObject().put(\"value\", \"Vert.x\")).onComplete(respMessage -> {\n context.assertTrue(respMessage.succeeded());\n context.assertEquals(\"You got it\", respMessage.result().body());\n client.close();\n async.complete();\n });\n });\n\n }));\n\n }", "private synchronized void sendToClient(PrintWriter pw, String message)\n {\n pw.write(message + \"\\n\");\n pw.flush();\n }", "private void sendMessageToClient(String messageToClient){\n SwingUtilities.invokeLater(new Runnable() {\n @Override\n public void run() {\n output.println(\"\\n\" + \"Server: \" + messageToClient);\n output.flush();\n }\n });\n }", "void handlePacket(String devReplyStr);", "public void sendReply(PrintWriter output, String message) {\n \n // PENDING(gww) Better check that the remote server sends a valid document\n // with header otherwise this is a pile.\n output.println(message);\n \n }", "public void sendReply(String cmd, String reply) {\n if (cmd.equals(\"ACTION_REPLY\")){\n long now = System.currentTimeMillis();\n long processTime = now - startTime;\n out.println(cmd + \"<<\"+processTime+\":\"+ reply);\n }else{\n //out.println(cmd + \"<<null\" + reply);\n out.println(cmd + \"<<\" + reply); //changed per drew's suggestion\n }\n \n }", "private void sendReceiveRes(){\n\t}", "private void run() throws IOException {\n\n // Establish connection with a server and create streams for communication\n System.out.println(\"Enter IP Address of the Server: \");\n String serverAddress = getClientInput();\n Socket socket = new Socket(serverAddress, 9001);\n in = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n out = new PrintWriter(socket.getOutputStream(), true);\n\n String clientName;\n\n // Process replies from server\n while (true) {\n String line = in.readLine();\n if (line.startsWith(\"SUBMITNAME\")) {\n System.out.println(\"Enter a client name: \");\n clientName = getClientInput();\n out.println(clientName);\n }\n else if (line.startsWith(\"WELCOME\")) {\n System.out.println(line);\n String tempLine = \"\";\n while (!tempLine.startsWith(\"5\")){\n tempLine = in.readLine();\n System.out.println(tempLine);\n }\n }\n else if (line.startsWith(\"COMMAND\")) {\n System.out.println(\"Enter a command: \");\n out.println(getClientInput());\n }\n else if(line.startsWith(\"SERVER\")) {\n String answer = in.readLine();\n System.out.println(line + \": \" + answer);\n //Close after client calls exit and server closes the client thread.\n if(answer.equals(\"EXIT\")) {\n System.out.println(\"Session closed.\");\n break;\n }\n else {\n System.out.println(\"Enter a command: \");\n out.println(getClientInput());\n }\n }\n }\n }", "private void reply(HttpServletRequest request, HttpServletResponse response) throws IOException {\n\t\tint id = Integer.parseInt(request.getParameter(\"id\"));\r\n\t\tcomplainVo complainVo = new complainVo();\r\n\t\tcomplainVo.setComplainId(id);\r\n\t\tcomplainDao complainDao = new complainDao();\r\n\t\tList ls = complainDao.edit(complainVo);\r\n\t\tHttpSession session = request.getSession();\r\n\t\tsession.setAttribute(\"replyList\", ls);\r\n\t\t\r\n\t\tresponse.sendRedirect(\"Admin/replyComplain.jsp\");\r\n\t}", "protected int route(byte buffer[], int source) {\n \n // Get the message level\n byte messageLevel = getMessageLevel( buffer );\n // get the messageID\n byte messageID[] = getMessageID( buffer );\n \n // Check that the message was not received before\n if( messageIsNew( messageID )){\n \trecordMessageID( messageID );\n }\n else{\n \treturn Constants.SUCCESS;\n }\n \n // If I am not the sender of the message\n // add it to the message queue\n if (messageLevel == Constants.MESSAGE_ALL && source != Constants.SRC_ME){\n // Add message to message queue\n \taddMessageToQueue( buffer );\n }\n else if (messageLevel == Constants.MESSAGE_TARGET){\n \tbyte[] target = getTarget( buffer );\n \tif (target == this.address) {\n \t\t//Add to the message queue\n \t\treturn Constants.SUCCESS; //DO NOT send to all threads.\n \t}\n }\n \n // Send the message to all the threads\n synchronized (this.rwThreads) {\n for (ReadWriteThread aThread : rwThreads) {\n Log.d(TAG, \"Writing to device on thread: \" + aThread.getName());\n aThread.write(buffer);\n }\n }\n \n return Constants.SUCCESS;\n }", "public static void chooseNeighbour() {\n clique.handler(ConnectReq.class, (i, req) -> {\n int randomIndex = new Random().nextInt(connections.size());\n connections.get(randomIndex).send(req);\n });\n }", "void respondToMessage(Map<String, String> message);", "public void process( Socket client, HashMap< String, BufferedOutputStream > map ) throws java.io.IOException {\n BufferedOutputStream toClient = null;\n BufferedReader fromClient = null;\n String userName = null;\n String message;\n byte[] buffer = new byte[ 10000 ];\n \n try { \n while( true ){\n fromClient = new BufferedReader( new InputStreamReader( client.getInputStream() ) );\n toClient = new BufferedOutputStream( client.getOutputStream() );\n message = fromClient.readLine() + \"\\r\\n\";\n //add new user to map and write the intro user statement to the clients\n if ( message.split(\" \") [ 0 ].equals( \"JOIN\" ) ){\n userName = message.split(\" \")[ 1 ];\n map.put( userName, toClient );\n //System.out.println(map);\n \n BufferedOutputStream users = null;\n for ( String user : map.keySet() ){\n \n users = map.get( user );\n users.write( ( userName + \"has Joined the chat. \\r\\n\" ).getBytes() );\n users.flush();\n } \n }\n //broadcast logoff message when user clicks exit from ChatScreen\n else if ( message.split(\" \")[ 0 ].equals( \"LOGOFF\" ) ){\n BufferedOutputStream users = null;\n for ( String user : map.keySet() ){\n users = map.get( user );\n users.write( ( userName + \"has left the chat. \\r\\n\" ).getBytes());\n users.flush();\n }\n }\n //broadcast a message from client\n else{\n System.out.println( \" Broadcast: \" + message );\n //truncated msg \n String msg = message.split( \" \",2 )[ 1 ];\n System.out.println( msg );\n BufferedOutputStream users = null;\n for ( String user : map.keySet() ){\n users = map.get( user );\n System.out.println( msg );\n if( msg != null ){\n users.write( msg.getBytes() );\n users.flush();\n }\n }\n }\n }\n \n }\n catch ( IOException ioe ) {\n System.err.println( ioe );\n }\n finally {\n // close streams and socket\n if ( toClient != null )\n toClient.close();\n }\n }", "public String sendMessage(){\n System.out.print(handle);\n try{ \n message = inFromUser.readLine();\n if(message.equals(\"SIGINT\")){\n outToServer.writeBytes(\"SIGINT\");\n System.out.println(\"\\nTCP connection closed and program terminated.\");\n response = inFromServer.readLine();\n if(!response.isEmpty()){\n System.out.println(response + \" message received from server means OK to close connection\");\n clientSocket.close();\n }\n return \"INTERRUPT\";\n } \n else if(message.equals(\"\\\\quit\")){\n outToServer.writeBytes(\"SIGQUIT\");\n System.out.println(\"\\nTCP connection closed.\");\n response = inFromServer.readLine();\n if(!response.isEmpty()) {\n System.out.println(response + \" message received from server means OK to close connection on this side\");\n clientSocket.close();\n }\n return \"QUIT\";\n }\n else{\n handleMsg = handle + message;\n int lengthInt = handleMsg.length();\n outToServer.writeBytes(handleMsg); \n return \"OK\";\n }\n }catch(IOException e){\n System.err.println(\"Caught IOException in sendMessage(): \" + e.getMessage());\n } \n return null;\n }", "private synchronized String processMessage(Socket clientSocket, PrintWriter printWriter, String rawMessage)\n {\n Hashtable<Server.TokenType,String> parsedMessage = Server.parseRawMessage(rawMessage);\n String result = \"OK\";\n\n switch (parsedMessage.get(Server.TokenType.ACTION).toUpperCase())\n {\n case \"REGISTER\":\n String rTopic = parsedMessage.get(Server.TokenType.TOPIC);\n if(clientTopicsTable.get(clientSocket).add(rTopic))\n {\n sendToClient(printWriter, \"OK\");\n //print on server\n System.out.println(\"[\" + Server.getCurrentDateTimeStamp() + \"] Client \" + clientSocket + \" REGISTER \" + rTopic);\n //write to log\n writeToLog(Server.LOG_LEVEL.INFO.toString(), \"Client \" + clientSocket + \" REGISTER \" + rTopic);\n }\n else\n {\n sendToClient(printWriter, \"ERROR\");\n //print on server\n System.out.println(\"[\" + Server.getCurrentDateTimeStamp() + \"] ERROR - Client \" + clientSocket + \" REGISTER to existing topic - \" + rTopic);\n //write to log\n writeToLog(Server.LOG_LEVEL.ERROR.toString(), \"Client \" + clientSocket + \" REGISTER to existing topic - \" + rTopic);\n }\n break;\n case \"LEAVE\":\n String lTopic = parsedMessage.get(Server.TokenType.TOPIC);\n if(clientTopicsTable.get(clientSocket).remove(lTopic))\n {\n sendToClient(printWriter, \"OK\");\n //print on server\n System.out.println(\"[\" + Server.getCurrentDateTimeStamp() + \"] Client \" + clientSocket + \" LEAVE \" + lTopic);\n //write to log\n writeToLog(Server.LOG_LEVEL.INFO.toString(), \"Client \" + clientSocket + \" LEAVE \" + lTopic);\n }\n else\n {\n sendToClient(printWriter, \"ERROR\");\n\n //print on server\n System.out.println(\"[\" + Server.getCurrentDateTimeStamp() + \"] ERROR - Client \" + clientSocket + \" LEAVE an unregistered topic - \" + lTopic);\n //write to log\n writeToLog(Server.LOG_LEVEL.ERROR.toString(), \"Client \" + clientSocket + \" LEAVE an unregistered topic - \" + lTopic);\n }\n break;\n case \"SEND\":\n String topic = parsedMessage.get(Server.TokenType.TOPIC);\n String content = parsedMessage.get(Server.TokenType.CONTENT);\n\n //print on server\n System.out.println(\"[\" + Server.getCurrentDateTimeStamp() + \"] Client \" + clientSocket + \" sent \" + content + \" on topic \" + topic);\n //write to log\n writeToLog(Server.LOG_LEVEL.INFO.toString(), \"Client \" + clientSocket + \" sent \" + content + \" on topic \" + topic);\n String ipPort = clientSocket.getInetAddress() + \":\" + clientSocket.getPort();\n //Send the message to the subscribers\n clientTopicsTable.forEach((client, topics) ->\n {\n if (topics.contains(topic)) {\n try {\n PrintWriter pw = new PrintWriter(client.getOutputStream());\n String output = \"( \" + topic + \" ) \" + ipPort + \" \" + Server.getCurrentTimeStamp() + \" - \" + content;\n\n //send to client\n sendToClient(pw, output);\n\n //print on server\n System.out.println(\"[\" + Server.getCurrentDateTimeStamp() + \"] FORWARD ( \" + topic + \" ) \" + ipPort + \" \" + Server.getCurrentTimeStamp() + \" - \" + content + \" to client - \" + client);\n //write to log\n writeToLog(Server.LOG_LEVEL.INFO.toString(), \"FORWARD ( \" + topic + \" ) \" + ipPort + \" \" + Server.getCurrentTimeStamp() + \" - \" + content + \" to client - \" + client);\n } catch (IOException e) {\n System.out.println(\"Error occurred while sending message to client \" + client);\n }\n }\n });\n break;\n case \"CLOSE\":\n System.out.println(\"[\" + Server.getCurrentDateTimeStamp() + \"] CLOSE connection with \" + clientSocket);\n //write to log\n writeToLog(Server.LOG_LEVEL.INFO.toString(), \"CLOSE connection with \" + clientSocket);\n this.stop = true;\n result = \"CLOSE\";\n break;\n }\n return result;\n }", "@Override\n public void run(){\n System.out.println(clientID+\" run\");\n open();\n if(isHost){ //HostClient listening\n try{\n controller.sendHostAddress(ip, port);\n socket = hostSocket.accept();\n System.out.println(clientID+\": run: accept\");\n close(); //closes hostSocket\n connected = true;\n open(); //gets streams\n controller.sendConnect(); \n }catch(IOException e){\n System.out.println(clientID+\": run: accept: failed: IOException: \"+e);\n }\n }\n while(connected){ //interprets requests from other client\n try{\n String request = streamIn.readUTF();\n System.out.println(clientID+\": receive: \"+request);\n String response[] = request.split(\"<&>\");\n controller.interpretRequest(response);\n }catch(IOException ioe){\n System.out.println(clientID+\": receive: failed: IOException:\"+ioe);\n connected = false; \n }\n }\n }", "public void callCompleted(InetAddress clientId, int xid, RpcResponse response) {\n ClientRequest req = new ClientRequest(clientId, xid);\n CacheEntry e;\n synchronized(map) {\n e = map.get(req);\n }\n e.response = response;\n }", "public void send(int highOption, int option) throws InstantiationException, IllegalAccessException, IOException, InterruptedException, ClassNotFoundException, RemoteReadException\n\t{\n\t\tint index = 0;\n\t\tClientHelloWorldBroadcastResponse broadcastResponse;\n\t\tClientHelloWorldAnycastResponse anycastResponse;\n\t\tClientHelloWorldUnicastResponse unicastResponse;\n\t\tswitch (option)\n\t\t{\n\t\t\tcase ChatOptions.TYPE_CHAT:\n\t\t\t\tSystem.out.println(\"Please type your message: \");\n\t\t\t\tString message = in.nextLine();\n\t\t\t\tswitch (highOption)\n\t\t\t\t{\n\t\t\t\t\tcase MulticastOptions.BROADCAST_NOTIFICATION:\n\t\t\t\t\t\tMulticastClient.FRONT().syncNotify(new HelloWorldBroadcastNotification(new HelloWorld(message)));\n\t\t\t\t\t\tSystem.out.println(\"You notification is broadcast!\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tcase MulticastOptions.ANYCAST_NOTIFICATION:\n\t\t\t\t\t\tMulticastClient.FRONT().syncNotify(new HelloWorldAnycastNotification(new HelloWorld(message)));\n\t\t\t\t\t\tSystem.out.println(\"You notification is anycast!\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tcase MulticastOptions.UNICAST_NOTIFICATION:\n\t\t\t\t\t\tMulticastClient.FRONT().syncNotify(new HelloWorldUnicastNotification(new HelloWorld(message)));\n\t\t\t\t\t\tSystem.out.println(\"You notification is unicast!\");\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tcase MulticastOptions.BROADCAST_REQUEST:\n\t\t\t\t\t\tbroadcastResponse = (ClientHelloWorldBroadcastResponse)MulticastClient.FRONT().read(new ClientHelloWorldBroadcastRequest(new HelloWorld(message)));\n\t\t\t\t\t\tSystem.out.println(\"You request is broadcast!\");\n\t\t\t\t\t\tSystem.out.println(\"You got \" + broadcastResponse.getResponses().size() + \" responses\");\n\t\t\t\t\t\tfor (HelloWorldBroadcastResponse response : broadcastResponse.getResponses())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSystem.out.println(++index + \") response = \" + response.getHelloWorld().getHelloWorld());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tcase MulticastOptions.UNICAST_REQUEST:\n\t\t\t\t\t\tunicastResponse = (ClientHelloWorldUnicastResponse)MulticastClient.FRONT().read(new ClientHelloWorldUnicastRequest(new HelloWorld(message)));\n\t\t\t\t\t\tSystem.out.println(\"You request is unicast!\");\n\t\t\t\t\t\tSystem.out.println(\"You got \" + unicastResponse.getResponses().size() + \" responses\");\n\t\t\t\t\t\tfor (HelloWorldUnicastResponse response : unicastResponse.getResponses())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSystem.out.println(++index + \") response = \" + response.getHelloWorld().getHelloWorld());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\n\t\t\t\t\tcase MulticastOptions.ANYCAST_REQUEST:\n\t\t\t\t\t\tanycastResponse = (ClientHelloWorldAnycastResponse)MulticastClient.FRONT().read(new ClientHelloWorldAnycastRequest(new HelloWorld(message)));\n\t\t\t\t\t\tSystem.out.println(\"You request is anycast!\");\n\t\t\t\t\t\tSystem.out.println(\"You got \" + anycastResponse.getResponses().size() + \" responses\");\n\t\t\t\t\t\tfor (HelloWorldAnycastResponse response : anycastResponse.getResponses())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSystem.out.println(++index + \") response = \" + response.getHelloWorld().getHelloWorld());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase ChatOptions.QUIT_CHAT:\n\t\t\t\tbreak;\n\t\t}\n\t}", "public void sendMsgToSocket(String message,Socket client){\n\t\tSocket clientSocket = client;\n\t\ttry {\n\t\t\toutToClient = new PrintWriter(clientSocket.getOutputStream(),true);\n\t\t\toutToClient.println(message);\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\t\n\t}", "@Override\n public void run(){\n try {\n while(true) {\n Thread.sleep(10);\n\n InputStream inputStream = socket.getInputStream();\n BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(inputStream));\n OutputStream outputStream = socket.getOutputStream();\n PrintWriter printWriter = new PrintWriter(outputStream, true);\n\n // Konwersja ze strumienia na stringa\n String fromClient = bufferedReader.readLine();\n if(fromClient != null) {\n\n System.out.println(\"From client: \" + fromClient);\n String serverResponse = Commands.serverAction(fromClient);\n printWriter.println(serverResponse);\n printWriter.flush();\n System.out.println(\"Server respond: \" + serverResponse);\n break;\n\n }\n }\n }catch (IOException | InterruptedException e) {\n System.out.println(\"Connection lost\");\n try {\n socket.close();\n } catch (IOException ex) {\n ex.printStackTrace();\n }\n }\n\n\n }", "private Future sendDataServerLocation(final Location clientLocation,final Location serverLocation) {\n return executor.submit(new Runnable() {\n public void run() {\n try {\n byte[] sendDataServerAddress = serialize(serverLocation);\n DatagramSocket clientSocket = new DatagramSocket();\n DatagramPacket pongPacket = new DatagramPacket(sendDataServerAddress,\n sendDataServerAddress.length,\n clientLocation.getLocation());\n clientSocket.send(pongPacket);\n clientSocket.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n });\n }", "protected void serveClient() {\r\n\t\tif (lineIn == null || lineOut == null) {\r\n\t\t\tSystem.err.printf(\"I/O has not been set up.%n\");\r\n\t\t} else {\r\n\t\t\ttry {\r\n\t\t\t\tString clientRequest;\r\n\t\t\t\tStringTokenizer args;\r\n\r\n\t\t\t\t// control loop, receiving client requests\r\n\t\t\t\twhile (!exitRecieved) {\r\n\t\t\t\t\t// PRESENT PROMPT\r\n\t\t\t\t\tsendMessage(PROMPT);\r\n\r\n\t\t\t\t\t// ACCEPT & PROCESS INPUT\r\n\t\t\t\t\tclientRequest = receiveMessage();\r\n\t\t\t\t\targs = new StringTokenizer(clientRequest);\r\n\t\t\t\t\tprocessCommand(args);\r\n\t\t\t\t}\r\n\r\n\t\t\t} catch (IOException ioe) {\r\n\t\t\t\tSystem.err.printf(\"IO Error receiving client input: %s%n\", ioe);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void sendToCurrClient ( String message ){\n currClient.send( message );\n ServerConnection[] clients = new ServerConnection[]{client1, client2, client3};\n for(ServerConnection c: clients){\n if(c != currClient && c != null )\n if ( !message.contains(\"You won\") )\n c.send(\"Wait for \" + currClient.getName() + \" to end his turn\" );\n else c.send(\"You lost the match. \" + currClient.getName() + \" won the game.\");\n }\n }", "public void processReq(){\n //Using auto cloable for reader ;)\n try( BufferedReader reader = new BufferedReader(new InputStreamReader(clientSock.getInputStream()))){\n String mess = reader.readLine();\n String returnMess = getData(mess);\n\n PrintWriter writer = new PrintWriter(clientSock.getOutputStream());\n writer.println(returnMess);\n writer.flush();\n\n //Close sockets\n clientSock.close();\n sock.close();\n } catch (IOException e) {\n System.err.println(\"ERROR: Problem while opening / close a stream\");\n }\n }", "public void sentRecieve() throws UnknownHostException, IOException, ClassNotFoundException, InterruptedException {\n InetAddress host = InetAddress.getLocalHost();\r\n Socket socket = null;\r\n ObjectOutputStream output = null;\r\n ObjectInputStream input = null;\r\n \r\n LinkedList client = new LinkedList();\r\n client.add(\"Elifas\");\r\n client.add(\"Andrew\");\r\n client.add(\"Claudia\");\r\n client.add(\"Ester\");\r\n client.add(\"Emilie\");\r\n \r\n for (int i = 0; i < client.size(); i++) {\r\n int size = client.size();\r\n //establishing socket connection to a server\r\n socket = new Socket(host.getHostName(), 2535);\r\n //write to the socket using ObjectOutputStream\r\n output = new ObjectOutputStream(socket.getOutputStream());\r\n System.out.println(client.get(i)+\" sending request to the server\");\r\n if (size > 5) {\r\n output.writeObject(\"exit\");\r\n }\r\n else{\r\n output.writeObject(\" \"+ client.get(i));\r\n }\r\n //reading the server response\r\n input = new ObjectInputStream(socket.getInputStream());\r\n String message = (String) input.readObject();\r\n System.out.println(\"Response: \"+message);\r\n \r\n //close resources\r\n input.close();\r\n output.close();\r\n Thread.sleep(2000);\r\n }\r\n }", "SockHandle(Socket client,String my_ip,String my_port,int my_c_id,HashMap<Integer, SockHandle> c_list,HashMap<Integer, SockHandle> s_list, boolean rx_hdl,boolean svr_hdl,ClientNode cnode) \n {\n \tthis.client = client;\n \tthis.my_ip = my_ip;\n \tthis.my_port = my_port;\n this.my_c_id = my_c_id;\n this.remote_c_id = remote_c_id;\n this.c_list = c_list;\n this.s_list = s_list;\n this.rx_hdl = rx_hdl;\n this.svr_hdl = svr_hdl;\n this.cnode = cnode;\n // get input and output streams from socket\n \ttry \n \t{\n \t in = new BufferedReader(new InputStreamReader(client.getInputStream()));\n \t out = new PrintWriter(client.getOutputStream(), true);\n \t} \n \tcatch (IOException e) \n \t{\n \t System.out.println(\"in or out failed\");\n \t System.exit(-1);\n \t}\n try\n {\n // only when this is started from a listening node\n // send a initial_setup message to the initiator node (like an acknowledgement message)\n // and get some information from the remote initiator node\n if(rx_hdl == true)\n {\n \t System.out.println(\"send cmd 1: setup sockets to other clients\");\n out.println(\"initial_setup\");\n ip = in.readLine();\n \t System.out.println(\"ip:\"+ip);\n port=in.readLine();\n \t System.out.println(\"port:\"+port);\n remote_c_id=Integer.valueOf(in.readLine());\n \t out.println(my_ip);\n \t out.println(my_port);\n \t out.println(my_c_id);\n \t System.out.println(\"neighbor connection, PID:\"+ Integer.toString(remote_c_id)+ \" ip:\" + ip + \" port = \" + port);\n // when this handshake is done\n // add this object to the socket handle list as part of the main Client object\n synchronized (c_list)\n {\n c_list.put(remote_c_id,this);\n }\n }\n }\n \tcatch (IOException e)\n \t{\n \t System.out.println(\"Read failed\");\n \t System.exit(1);\n \t}\n \t// handle unexpected connection loss during a session\n \tcatch (NullPointerException e)\n \t{\n \t System.out.println(\"peer connection lost\");\n \t System.exit(1);\n \t}\n // thread that continuously runs and waits for incoming messages\n // to process it and perform actions accordingly\n \tThread read = new Thread()\n {\n \t public void run()\n {\n \t while(rx_cmd(in,out) != 0) { }\n }\n \t};\n \tread.setDaemon(true); \t// terminate when main ends\n read.setName(\"rx_cmd_\"+my_c_id+\"_SockHandle_to_Server\"+svr_hdl);\n read.start();\t\t// start the thread\t\n }", "@Override\n\tpublic void run(){\n\t\tInetAddress IPAddress = serverTcpSocket.getInetAddress();\n\t\tfor (ClientObj c: clients)\n\t\t\tif (c.getId() == client.getId()){\n\t\t\t\tSystem.out.print(IPAddress + \" Client already connected!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\ttry{\n\t\t\t// Check handshake received for correctness\n\t\t\t//(connect c->s) [herader | \"JUSTIN\\0\" | connection port] (udp)\n\t\t\t//(connect response s->c) [header | client id | port] (udp)\n\t \n\t // open the connection\n\t\t clientSocket = null;\n\t\t Socket clientListener = null;\n\t\t // wait for client connection on tcp port\n\t\t //serverTcpSocket.setSoTimeout(5000);\n\t \tSystem.out.println (\" Waiting for tcp connection.....\");\n\t \tclientSocket = serverTcpSocket.accept();\n\t \tclientListener = serverTcpSocket.accept();\n\t \tclient.setListenerSocket(clientListener);\n\t\t\tIPAddress = clientSocket.getInetAddress();\n\t\t\tint recv_port = clientSocket.getPort();\n\t\t\tSystem.out.println(IPAddress + \": Client connected @ port \" + recv_port);\n\n\t\t // handle tcp connection\n\t\t\tclientSocket.setSoTimeout(Constants.ACK_TIMEOUT);\n\t\t out = new BufferedOutputStream(clientSocket.getOutputStream());\n\t\t\tin = new BufferedInputStream(clientSocket.getInputStream());\n\t\t\tclient.setAddress(clientSocket.getInetAddress());\n\t\t\tclient.setPort(clientSocket.getPort());\n\t\t clients.add(client);\n\t\t\t\n\t\t // handle requests\n\t\t\twhile (!shutdown_normally) {\n\t\t\t\t// read just the header, then handle the req based on the info in the header\n\t\t\t\tif ((buf = Utility.readIn(in, Constants.HEADER_LEN)) == null)\n\t\t\t\t\tbreak;\n\t\t\t\tint flag = buf.getInt(0);\n\t\t\t\tint len2 = buf.getInt(4);\n\t\t\t\tint id = buf.getInt(8);\n\t\t\t\t\n\t\t\t\t// check for correctness of header\n\t\t\t\t\n\t\t\t\tif (flag < Constants.OPEN_CONNECTION || \n\t\t\t\t\t\tflag > Constants.NUM_FLAGS || \n\t\t\t\t\t\tid != client.getId() || \n\t\t\t\t\t\tlen2 < 0){\n\t\t\t\t\tout.close(); \n\t\t\t\t\tin.close(); \n\t\t\t\t\tclientSocket.close(); \n\t\t\t\t\tserverTcpSocket.close();\n\t\t\t\t\tclients.remove(client);\n\t\t\t\t\tthrow new RuntimeException(\n\t\t\t\t\t\t\t\"Connection - FAILURE! (malformed header)\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// read payload\n\t\t\t\tif ((buf = Utility.readIn(in, Utility.getPaddedLength(len2))) == null)\n\t\t\t\t\tthrow new IOException(\"read failed.\");\n\t\t\t\t// update address (necessary?)\n\t\t\t\tclients.get(clients.indexOf(client)).setAddress(clientSocket.getInetAddress());\n\t\t\t\tclient.setAddress(clientSocket.getInetAddress());\n\t\t\t\tswitch (flag){\n\t\t\t\t\tcase Constants.ACK:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Constants.VIEW_REQ:\n\t\t\t\t\t\tSystem.out.println(client.getAddress() + \n\t\t\t\t\t\t\t\t\": Processing view request...\");\n\t\t\t\t\t\tViewFiles(buf);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Constants.DOWNLOAD_REQ:\n\t\t\t\t\t\tSystem.out.println(client.getAddress() + \n\t\t\t\t\t\t\t\t\": Processing download request...\");\n\t\t\t\t\t\tDownload(buf);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Constants.UPLOAD_REQ:\n\t\t\t\t\t\tSystem.out.println(client.getAddress() + \n\t\t\t\t\t\t\t\t\": Processing upload request...\");\n\t\t\t\t\t\tUpload(buf);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Constants.DOWNLOAD_ACK:\n\t\t\t\t\t\tSystem.out.println(client.getAddress() + \n\t\t\t\t\t\t\t\t\": Processing download acknowledgment...\");\n\t\t\t\t\t\tDownloadCompleted(buf);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase Constants.CLOSE_CONNECTION:\n\t\t\t\t\t\tshutdown_normally = true;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// close all open sockets\n\t\t out.close(); \n\t\t in.close(); \n\t\t clientSocket.close(); \n\t\t serverTcpSocket.close();\n\t\t} catch (SocketTimeoutException e) {\n\t\t\tSystem.err.println(IPAddress + \": Timeout waiting for response.\");\n\t\t} catch (UnknownHostException e) {\n\t\t\t// IPAdress unknown\n\t\t\tSystem.err.println(\"Don't know about host \" + IPAddress);\n\t\t} catch (IOException e) {\n\t\t\t// Error in communication\n\t\t\tSystem.err.println(\"Couldn't get I/O for the connection to \" +\n\t\t\t\t\tIPAddress);\n\t\t} catch (RuntimeException e){\n\t\t\t// Malformed Header or payload most likely\n\t\t\tSystem.err.println(IPAddress + \": Connection - FAILURE! (\" + e.getMessage() + \")\");\n\t\t} finally {\n\t\t\t// remove this client from active lists, close all (possibly) open sockets\n\t\t\tSystem.out.println(IPAddress + \": Connection - Closing!\");\n\t\t\tclients.remove(client);\n\t\t\ttry {\n\t\t\t\tSocket clientConnection = client.getListenerSocket();\n\t\t\t\tOutputStream out_c = new BufferedOutputStream(clientConnection.getOutputStream());\n\t\t\t\tbuf = Utility.addHeader(Constants.CLOSE_CONNECTION, 0, client.getId());\n\t\t\t\tout_c.write(buf.array());\n\t\t\t\tout_c.flush();\n\t\t\t\tout_c.close();\n\t\t\t\tclientConnection.close();\n\n\t\t\t\tif (out != null)\n\t\t\t\t\tout.close();\n\t\t\t\tif (in != null)\n\t\t\t\t\tin.close();\n\t\t\t\tif (!clientSocket.isClosed())\n\t\t\t\t\tclientSocket.close();\n\t\t\t\tif (!serverTcpSocket.isClosed())\n\t\t\t\t\tserverTcpSocket.close();\n\t\t\t} catch (IOException e){\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n }", "public void messageResp(int respId) {\n\r\n\t}", "long sendRequestToClient(long client, byte[] content, int prio) throws IOException, MlmqException;", "@Override\r\n \tpublic void clientConnectedCallback(RoMClient newClient) {\r\n \t\t// Add new client and start listening to this one\r\n \t\tthis.clients.addClient(newClient);\r\n \r\n \t\t// Create the ReceiveClientCommandThread for this client\r\n \t\tReceiveClientCommandThread receiveCommandThread = new ReceiveClientCommandThread(newClient, this, this);\r\n \t\treceiveCommandThread.start();\r\n \r\n \t\t// Create the CommandQueue Thread for this client\r\n \t\tClientCommandQueueThread commandQueueThread = new ClientCommandQueueThread(newClient);\r\n \t\tcommandQueueThread.start();\r\n \t}", "@Override\n\tpublic void run() {\n\t\tInetSocketAddress remoteAddr = (InetSocketAddress) socket.getRemoteSocketAddress();\n\t\tChatServer.log(\"[server] connected by client[\" + remoteAddr.getAddress().getHostAddress() + \":\" + remoteAddr.getPort());\n\t\t\n\t\ttry {\n\t\t\t//2. 스트림 얻기\n\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(socket.getInputStream(), \"utf-8\"));\n\t\t PrintWriter writer = new PrintWriter(new OutputStreamWriter(socket.getOutputStream() ,\"utf-8\"),true);\n\t\t \n\t\t while(true) {\n\t\t \tString request = reader.readLine();\n\t\t \tSystem.out.println(request);\n\t\t \tif(request == null) {\n\t\t \t\tChatServer.log(\"클라이언트로 부터 연결 끊김\");\n\t\t \t\tbreak;\n\t\t \t}\n\t\t \tString[] tokens = request.split(\":\");\n\t\t \t// Join:둘리 일때 - 0은 Join 1은 둘리\n\t\t \tif(\"join\".equals(tokens[0])) {\n\t\t \t\tnickname = tokens[1]; \n\t\t \t\tdoJoin(nickname + \"님이 입장하였습니다.\", writer);\n\t\t \t}else if(\"message\".equals(tokens[0])) {\n\t\t \t\t\n\t\t \t\tdoMessage(nickname + \":\" + tokens[1] );\n\t\t \t}else if(\"quit\".equals(tokens[0])) {\n\t\t \t\tdoQuit(nickname + \"님이 퇴장하였습니다.\", writer);\n\t\t \t}else {\n\t\t \t\tChatServer.log(\"에러: 알수 없는 요청(\" + tokens[0] + \")\");\n\t\t \t}\n\t\t }\n\t\t\n\t\t} catch (SocketException e) {\n\t\t\tChatServer.log(nickname);\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public String ireply(String openId, Map<String, String> map)\r\n/* 23: */ {\r\n/* 24:25 */ WxMessage wx = getLocotion(openId);\r\n/* 25:26 */ if ((wx != null) && \r\n/* 26:27 */ (new Date().getTime() - DateUtil.stringToTime(wx.getCreateTime()).getTime() < UtilProperties.getTokenLimit().longValue())) {\r\n/* 27: */ try\r\n/* 28: */ {\r\n/* 29:29 */ return MsgUtil.parseNewsMsg(openId, PlaceUtil.getItems(wx.getLatitude(), wx.getLongitude(), \"兴华农商行\"));\r\n/* 30: */ }\r\n/* 31: */ catch (Exception e)\r\n/* 32: */ {\r\n/* 33:31 */ log.fatal(\"百度API异常\", e);\r\n/* 34: */ }\r\n/* 35: */ }\r\n/* 36:35 */ return MsgUtil.parseTextMsg(openId, \"请先发送您的位置信息,或者开启提供位置\");\r\n/* 37: */ }", "@Override\n public void onMessage(Message message) {\n try {\n TextMessage requestMessage = (TextMessage) message;\n\n\n Destination replyDestination = requestMessage.getJMSReplyTo();\n\n // TODO\n // String value =\n // ActiveMQDestination.getClientId((ActiveMQDestination)\n // replyDestination);\n // assertEquals(\"clientID from the temporary destination must be the\n // same\", clientSideClientID, value);\n\n TextMessage replyMessage = serverSession.createTextMessage(\"Hello: \" + requestMessage.getText());\n\n replyMessage.setJMSCorrelationID(requestMessage.getJMSMessageID());\n\n if (dynamicallyCreateProducer) {\n replyProducer = serverSession.createProducer(replyDestination);\n replyProducer.send(replyMessage);\n } else {\n replyProducer.send(replyDestination, replyMessage);\n }\n\n } catch (JMSException e) {\n onException(e);\n }\n }", "Map<String, Object> send();", "public static void main(String[] args) throws IOException, UnknownHostException{\n\n\t\t Scanner scan = new Scanner(System.in);\n\n\t\t System.out.println(\"Bitte hostname und port eingeben:\");\n\t\t String hostname= scan.nextLine();\n\t\t int port = scan.nextInt();\n\n\t\t Socket client = new Socket(hostname,port);\n\t\t //rfhpc987\n\t\t InputStream in = client.getInputStream();\n\t\t BufferedReader reader = new BufferedReader(new InputStreamReader(in));\n\n\n\t\t OutputStream out = client.getOutputStream();\n\t\t PrintWriter writer = new PrintWriter(out);\n\n\t\t //BufferedReader msgReader = new BufferedReader(new InputStreamReader(System.in));\n\t\t System.out.println(\"Bitte geben Sie einen Text ein: \");\n\t\t Scanner msgReader = new Scanner(System.in);\n \n \n\t\t // Nachricht an server senden\n\t\t String result= msgReader.nextLine();\n\t\t writer.println(result);\n\t\t writer.flush();\n\n\t\t // die von Server gesendete Nachricht\n\t\t String msgServer = reader.readLine();\n\t\t // Nachricht von Client\n\t\t System.out.println(\"Message von Server:\"+msgServer);\n\n\n\n\n\t}", "private void __getReply() throws IOException\n {\n __getReply(true); // tagged response\n }", "protected void sendMessage(\n byte[] msg,\n int seq,\n InetAddress peerAddress,\n int peerPort,\n String peerProtocol,\n boolean retry)\n throws IOException {\n // Via is not included in the request so silently drop the reply.\n if (peerPort == -1) {\n if (LogWriter.needsLogging) {\n this.stack.logWriter.logMessage(\n getClass().getName() + \":sendMessage: Dropping reply!\");\n }\n throw new IOException(\"Receiver port not set \");\n } else {\n if (LogWriter.needsLogging) {\n this.stack.logWriter.logMessage(\n getClass().getName()\n + \":sendMessage \"\n + peerAddress.getHostAddress()\n + \"/\"\n + peerPort\n + \"\\n\"\n + new String(msg));\n this.stack.logWriter.logMessage(\"*******************\\n\");\n }\n }\n if (peerProtocol.compareToIgnoreCase(\"UDP\") == 0) {\n DatagramPacket reply =\n new DatagramPacket(msg, msg.length, peerAddress, peerPort);\n \n try {\n DatagramSocket sock;\n if (stack.udpFlag) {\n sock = ((UDPMessageProcessor) messageProcessor).sock;\n \n } else {\n // bind to any interface and port.\n sock = stack.getNetworkLayer().createDatagramSocket();\n }\n // PC 2.0 add logging statement for all SIP messages \n // sent fom the socket\n \t\t\tthis.stack.logWriter.logInfo(\"<<<<< TX:\\tLength = \" + msg.length \n \t \t\t+ \"\\nSent from IP|Port=\" + myAddress + \"|\" + myPort \n \t \t\t+ \"\\nTo IP|Port=\" + peerAddress + \"|\" + peerPort\n \t \t\t+ \"\\nSequencer=\" + seq\n \t \t\t+ \"\\nTransport=\" + peerProtocol\n \t \t\t+ \"\\n[\" + new String(msg, 0, msg.length) + \"]\");\n \t\t\tsock.send(reply);\n if (!stack.udpFlag)\n sock.close();\n } catch (IOException ex) {\n throw ex;\n } catch (Exception ex) {\n InternalErrorHandler.handleException(ex);\n }\n \n } else {\n // Use TCP to talk back to the sender.\n Socket outputSocket =\n stack.ioHandler.sendBytes(\n peerAddress,\n peerPort,\n \"tcp\",\n msg,\n retry);\n OutputStream myOutputStream = outputSocket.getOutputStream();\n myOutputStream.write(msg, 0, msg.length);\n myOutputStream.flush();\n\t // The socket is cached (dont close it!);\n }\n }", "public void run() {\n try {\n\n // Create character streams for the socket.\n in = new BufferedReader(new InputStreamReader(\n socket.getInputStream()));\n out = new PrintWriter(socket.getOutputStream(), true);\n System.out.println(\"...\"+socket.getInetAddress());\n\n // Request a name from this client. Keep requesting until\n // a name is submitted that is not already used. Note that\n // checking for the existence of a name and adding the name\n // must be done while locking the set of names.\n while (true) {\n out.println(\"SUBMIT NAME\");\n name = in.readLine();\n \tString[] arr= name.split(\":\", 2);\n \tname= arr[1];\n if (name == null) {\n return;\n }\n if (!ip.contains(socket.getInetAddress())) {\n ip.add(socket.getInetAddress());\n }\n else\n {\n \tout.println(\"already opened once.\");\n \tcontinue;\n }\n synchronized (clientOut) {\n if (clientOut.get(name) == null) {\n client.put(count, name);\n id= count;\n break;\n }\n }\n }\n\n // Now that a successful name has been chosen, add the\n // socket's print writer to the set of all writers so\n // this client can receive broadcast messages.\n clientOut.put(name, out);\n out.println(\"NAMEACCEPTED\"+name);\n //adding online users to the new user.\n for (int i= 0;i < count;i++) {\n \tString str;\n\t\t\t\t\tif((str= (String)client.get(i)) != null)\n \t\tout.println(\"TAB\"+i+str);\n }\n \n //adding new user to all the users who are online.\n for (int i= 0;i < count;i++) {\n \tPrintWriter wrt;\n \tif((wrt= clientOut.get(client.get(i))) != null)\n \t\twrt.println(\"TAB\"+count+name);\n }\n count++;\n\n // Accept messages from this client and broadcast them.\n // Ignore other clients that cannot be broadcasted to.\n while (true) {\n \tString input= in.readLine();\n \tchar c1;\n \tint c2;\n \tString[] arr= input.split(\":\", 2);\n \tif(arr[0].equals(\"FILE\"))\n \t{\n \t\tString[] arr1= input.split(\":\", 3);\n \t\tPrintWriter p= clientOut.get(client.get(Integer.valueOf(arr1[1])));\n \t\tp.println(\"FILE:\"+id+\":\"+arr1[2]);\n \t\twhile((input= in.readLine()) != \"stop\")\n \t\t{\n \t\t\tp.println(input);\n \t\t\tp.flush();\n \t\t}\n \t\tp.println(\"stop\");\n \t\tp.flush();\n \t\tSystem.out.println(\"sent.........\");\n/* \t\twhile((c2= in.read()) != -1)\n \t\t{\n \t\t\tc1= (char) c2;\n \t\t\tp.print(c1);\n \t\t\tp.flush();\n \t\t\tSystem.out.print(c2);\n \t\t}\n \t\tSystem.out.println(c2+\".......\");\n \t\tp.print((char)-1);*/\n \t}\n \telse\n \t\tclientOut.get(client.get(Integer.valueOf(arr[0]))).println(\"MESSAGE:\"+id+\":\"+name+\":\"+arr[1]);\n }\n } catch (IOException e) {\n System.out.println(e);\n } finally {\n // This client is going down! Remove its name and its print\n // writer from the sets, and close its socket.\n \t//remove this client from every other client.(TAB)\n \tfor (int i= 0;i < count;i++) {\n \t\tPrintWriter wrt;\n\t\t\t\t\tif(i != id && (wrt= clientOut.get(client.get(i))) != null)\n \t\t\twrt.println(\"REMOVE\"+id);\n }\n\n if (name != null) {\n \tclient.remove(id);\n \tclientOut.remove(name);\n \tip.remove(socket.getInetAddress());\n }\n try {\n socket.close();\n } catch (IOException e) {\n }\n }\n }", "private final void forwardVirtualMessageAck(long index, int data) {\n try {\n synchronized (out) {\n out.write(MessageForwarderProtocol.MESSAGE_VIRTUAL_ACK);\n out.writeLong(index);\n out.writeInt(data);\n out.flush();\n }\n } catch (Exception e) {\n handleDisconnect(e);\n }\n }", "byte[] getReplyAddress();", "public void send(){ \n\t\tserverAddress=tfTxtIpServer.getText();\n\t\tserverPort=\"3232\";\n\t\ttext=tfTxtMsg.getText();\n try{\n\t\t\t// get the \"registry\"\n registry=LocateRegistry.getRegistry(\n serverAddress,\n (new Integer(serverPort)).intValue()\n );\n\t\t // look up the remote object\n rmiServer=(ReceiveMessageInterface)(registry.lookup(\"rmiServer\"));\n\t\t\t// call the remote method\n rmiServer.receiveMessage(text);\n }\n catch(RemoteException e){\n e.printStackTrace();\n }\n catch(NotBoundException e){\n e.printStackTrace();\n } \n }", "private final void forwardVirtualConnect(DirectSocketAddress source,\n DirectSocketAddress sourceHub, DirectSocketAddress target,\n DirectSocketAddress targetHub, long index, int timeout, int port,\n int fragment, int buffer) {\n try {\n synchronized (out) {\n out.write(MessageForwarderProtocol.CREATE_VIRTUAL);\n\n DirectSocketAddress.write(source, out);\n DirectSocketAddress.write(sourceHub, out);\n\n DirectSocketAddress.write(target, out);\n DirectSocketAddress.write(targetHub, out);\n\n out.writeLong(index);\n\n out.writeInt(timeout);\n out.writeInt(port);\n out.writeInt(fragment);\n out.writeInt(buffer);\n\n out.flush();\n }\n } catch (Exception e) {\n handleDisconnect(e);\n }\n }", "@Override\n public void completed(Integer result, AsynchronousSocketChannel channel ) {\n\n //ipaddress\n String ipAdr = \"\";\n try{\n\n //Print IPAdress\n ipAdr = channel.getRemoteAddress().toString();\n System.out.println(ipAdr);\n }catch(IOException e) {\n e.printStackTrace();\n }\n\n //if client is close ,return\n buf.flip();\n if (buf.limit() == 0) return;\n\n //Print Message\n String msg = getString(buf);\n\n //time\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss.SSS\");\n sdf.setTimeZone(TimeZone.getTimeZone(\"Asia/Taipei\"));\n System.out.println(sdf.format(new Date()) + \" \" + buf.limit() + \" client: \"+ ipAdr + \" \" + msg);\n\n //\n order ord = null;\n try{\n ord = ParseOrder(sdf.format(new Date()), msg, ipAdr);\n }catch(Exception ex){\n startRead( channel );\n return;\n }\n //2021/05/23 15:55:14.763,TXF,B,10000.0,1,127.0.0.1\n //2021/05/23 15:55:14.763,TXF,S,10000.0,1,127.0.0.1\n\n if (ord.BS.equals(\"B\")) {\n limit(ord, bid);\n }\n if (ord.BS.equals(\"S\")) {\n limit(ord, ask);\n }\n if (trade(bid, ask, match) == true){\n startWrite(clientChannel, \"Mat:\" + match.get(match.size()-1).sysTime + \",\" + match.get(match.size()-1).stockNo+\",\"+\n match.get(match.size()-1).BS+\",\"+match.get(match.size()-1).qty+\",\"+match.get(match.size()-1).price+\"\\n\");\n }\n\n //send to all \n startWrite(clientChannel, \"Ord:\" + getAllOrder(bid, ask)+\"\\n\");\n \n //bid size and ask size\n System.out.println(\"Blist:\" + bid.size() + \" Alist:\" + ask.size());\n\n // echo the message\n//------------------> //startWrite( channel, buf );\n \n //start to read next message again\n startRead( channel );\n }", "private void responseToServer() throws ReversiException {\n try {\n while (!done) {\n int msg = fromServer.readInt();\n report(\"Msg from server: \" + msg);\n switch (msg) {\n case ENTERROOM:\n othersEnterRoom();\n break;\n case ASSIGN:\n assign();\n break;\n case TURN:\n turn();\n break;\n case DRAWBLACK:\n drawBlack();\n break;\n case DRAWWHITE:\n drawWhite();\n break;\n case READY:\n ready();\n break;\n case INVALIDTRY:\n invalidTry();\n break;\n case INVALID:\n invalidMove();\n break;\n case WIN:\n win();\n break;\n case RESIGN:\n resign();\n break;\n case NEWGAME:\n startGame();\n break;\n case QUIT:\n othersQuit();\n break;\n case DONE:\n doQuit();\n break;\n case RETRIEVE:\n retrieve();\n break;\n case CHAT:\n showMessage();\n break;\n default:\n report(\"uncaught: \" + msg);\n }\n }\n } catch (IOException e){\n\n throw new ReversiException(\"Quit, unsolved exception catch.\");\n\n }\n }", "private void receiveAndDispatchMessage() {\n String response = null;\n try {\n while((response = bufferedReader.readLine()) != null) {\n System.out.println(\"received message from server: \" + response);\n String messageKind = \"\";\n if(response.contains(\":\")) {\n messageKind = response.substring(0, response.indexOf(\":\"));\n } else {\n messageKind = response;\n }\n Bundle bundle = new Bundle();\n bundle.putString(\"response\", response);\n switch (messageKind) {\n case ClientMessageKind.SIGNUPDENIED:\n case ClientMessageKind.SIGNUPOK:\n if(resultReceiverMap.keySet().contains(ActivityNames.COMMONSIGNUPACTIVITY)) {\n resultReceiverMap.get(ActivityNames.COMMONSIGNUPACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.SIGNINDENIED:\n case ClientMessageKind.SIGNINOK:\n if(resultReceiverMap.keySet().contains(ActivityNames.COMMONSIGNINACTIVITY)) {\n resultReceiverMap.get(ActivityNames.COMMONSIGNINACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.DRIVERLOC:\n if(resultReceiverMap.keySet().contains(ActivityNames.PASSENGERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.PASSENGERLOC:\n if(resultReceiverMap.keySet().contains(ActivityNames.DRIVERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.CHATFROMDRIVER:\n if(resultReceiverMap.keySet().contains(ActivityNames.PASSENGERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.CHATFROMPASSENGER:\n if(resultReceiverMap.keySet().contains(ActivityNames.DRIVERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.PASSENGERDEST:\n if(resultReceiverMap.containsKey(ActivityNames.DRIVERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.STARTRIDE:\n if(resultReceiverMap.containsKey(ActivityNames.PASSENGERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n } else if(resultReceiverMap.containsKey(ActivityNames.DRIVERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.ENDRIDE:\n if(resultReceiverMap.containsKey(ActivityNames.PASSENGERENDSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERENDSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.DRIVERCANCEL:\n if(resultReceiverMap.containsKey(ActivityNames.PASSENGERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.PASSENGERCANCEL:\n if(resultReceiverMap.containsKey(ActivityNames.DRIVERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.UPDATEPASSENGERPROFILEDENIED:\n case ClientMessageKind.UPDATEPASSENGERPROFILEOKAY:\n if(resultReceiverMap.containsKey(ActivityNames.PASSENGERUPDATEPROFILEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERUPDATEPROFILEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.UPDATEDRIVERPROFILEDENIED:\n case ClientMessageKind.UPDATEDRIVERPROFILEOKAY:\n if(resultReceiverMap.containsKey(ActivityNames.DRIVERUPDATEPROFILEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERUPDATEPROFILEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.DRIVERREQUESTLOC:\n if(resultReceiverMap.containsKey(ActivityNames.PASSENGERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.PASSENGERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n case ClientMessageKind.PASSENGERREQUESTLOC:\n if(resultReceiverMap.containsKey(ActivityNames.DRIVERSTARTSERVICEACTIVITY)) {\n resultReceiverMap.get(ActivityNames.DRIVERSTARTSERVICEACTIVITY).send(\n ResultCode.RESULTCODE,\n bundle\n );\n }\n break;\n default:\n break;\n }\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "@DSGenerator(tool_name = \"Doppelganger\", tool_version = \"2.0\", generated_on = \"2013-12-30 12:59:45.528 -0500\", hash_original_method = \"9F609FC4DF465EEA0A9F2C3A79A2C6B4\", hash_generated_method = \"B9D65B71D31F113C9D169E78F4EAE96E\")\n \npublic void replyToMessage(Message srcMsg, Message dstMsg) {\n try {\n dstMsg.replyTo = mSrcMessenger;\n srcMsg.replyTo.send(dstMsg);\n } catch (RemoteException e) {\n log(\"TODO: handle replyToMessage RemoteException\" + e);\n e.printStackTrace();\n }\n }", "public static void sendCoordinatorMsg() {\n int numberOfRequestsNotSent = 0;\n for ( int key : ServerState.getInstance().getServers().keySet() ) {\n if ( key != ServerState.getInstance().getSelfID() ){\n Server destServer = ServerState.getInstance().getServers().get(key);\n\n try {\n MessageTransfer.sendServer(\n ServerMessage.getCoordinator( String.valueOf(ServerState.getInstance().getSelfID()) ),\n destServer\n );\n System.out.println(\"INFO : Sent leader ID to s\"+destServer.getServerID());\n }\n catch(Exception e) {\n numberOfRequestsNotSent += 1;\n System.out.println(\"WARN : Server s\"+destServer.getServerID()+\n \" has failed, it will not receive the leader\");\n }\n }\n }\n if( numberOfRequestsNotSent == ServerState.getInstance().getServers().size()-1 ) {\n // add self clients and chat rooms to leader state\n List<String> selfClients = ServerState.getInstance().getClientIdList();\n List<List<String>> selfRooms = ServerState.getInstance().getChatRoomList();\n\n for( String clientID : selfClients ) {\n LeaderState.getInstance().addClientLeaderUpdate( clientID );\n }\n\n for( List<String> chatRoom : selfRooms ) {\n LeaderState.getInstance().addApprovedRoom( chatRoom.get( 0 ),\n chatRoom.get( 1 ), Integer.parseInt(chatRoom.get( 2 )) );\n }\n\n leaderUpdateComplete = true;\n }\n }", "@Override\r\n public synchronized void connect(SelectionKey clientKey)\r\n { \r\n // Local Variable Declaration \r\n Map<String, String> headers = new HashMap<>(); \r\n String headerString = \"\", rqsMethod = \"\", socKey = \"\";\r\n float rqsVersion = 0;\r\n \r\n // Read headers from socket client\r\n headerString = receiveHeaders(clientKey);\r\n \r\n // Parse and validate the headers if the headerString could be read\r\n if(!headerString.equals(null))\r\n {\r\n headers = parseAndValidateHeaders(headerString);\r\n \r\n // Extract the HTTP method and version used in this connection request\r\n rqsMethod = headers.get(RQS_METHOD);\r\n rqsVersion = Float.parseFloat(headers.get(RQS_VERSION));\r\n socKey = headers.get(\"Sec-WebSocket-Key\");\r\n }\r\n \r\n /* Make sure the header contained the GET method has a version higher \r\n * 1.1 and that the socket key exists */ \r\n if (!headerString.equals(null) && rqsMethod.equals(new String(\"GET\")) && \r\n rqsVersion >= 1.1 && socKey != null)\r\n {\r\n // Complete handshake, by sending response header confirming connection terms\r\n finishConnection(headers, clientKey);\r\n \r\n // Add the socket to the map of sockets by the name passed \r\n this.sockets.put(clientKey, new WebSocketData()); \r\n }\r\n else\r\n {\r\n // Send a Bad Request HTTP response \r\n SocketChannel sc = (SocketChannel) clientKey.channel();\r\n \r\n try \r\n {\r\n // Build a response header for the error \r\n byte rsp[] = (this.BAD_RQST_HDR \r\n + \"Malformed request. The connection request must \"\r\n + \"use a 'GET' method, must have a version greater \"\r\n + \"than 1.1 and have 'Sec-WebSocket-Key'. Please\"\r\n + \"check your headers\"\r\n + \"\\\\r\\\\n\").getBytes(\"UTF-8\");\r\n \r\n // Send the response error header to the client\r\n sc.write(ByteBuffer.wrap(rsp));\r\n } \r\n catch (IOException ex) \r\n {\r\n Logger.getLogger(RecptionRoom.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }\r\n }", "@Test\n public void testSendMessageWithReplyBacktrack(TestContext context) {\n NetClient client = vertx.createNetClient();\n final Async async = context.async();\n\n client.connect(7000, \"localhost\").onComplete(context.asyncAssertSuccess(socket -> {\n\n final FrameParser parser = new FrameParser(parse -> {\n context.assertTrue(parse.succeeded());\n JsonObject frame = parse.result();\n context.assertNotEquals(\"err\", frame.getString(\"type\"));\n context.assertEquals(true, frame.getBoolean(\"send\"));\n context.assertEquals(\"Hello vert.x\", frame.getJsonObject(\"body\").getString(\"value\"));\n client.close();\n async.complete();\n });\n\n socket.handler(parser);\n\n FrameHelper.sendFrame(\"send\", \"hello\", \"#backtrack\", new JsonObject().put(\"value\", \"vert.x\"), socket);\n }));\n }", "public int setreply(int messageid, String reply, String replyer){\n int receiverId = allmessage.get(messageid).getSenderid();\n int senderId = allmessage.get(messageid).getGetterid();\n int replyId = createmessage(allmessage.get(messageid).getReplyer(), senderId, receiverId, reply);\n Message msg = getmessage(messageid);\n msg.setReply(replyId);\n try{\n this.gateWay.updateReplyId(messageid, replyId);\n }catch (IOException ignored){}\n msg.setReplyer(replyer);\n try{\n this.gateWay.updateReplier(messageid, replyer);\n }catch (IOException ignored){}\n return replyId;\n }", "private static void handleJoin(DatagramPacket packet){\n byte[] packetData = packet.getData();\n InetAddress packetAddr = packet.getAddress();\n if(packetData[0]== (byte)'W') {\n if (!map.containsKey(packetAddr)) {\n byte[] bytes = new byte[8];\n for (int i = 0; i < 8; i++) {\n bytes[i] = packetData[i + 1];\n }\n String name = \"\";\n for (int i = 9; i < packetData.length; i++) {\n name += (char) packetData[i];\n }\n System.out.println(\"Adding \"+name+\":\"+packetAddr.getHostAddress());\n DH dh = new DH(BigInteger.valueOf('&'));\n BigInteger[] bigs = dh.generateRandomKeys(BigInteger.valueOf(77));\n// DH.getSharedSecretKey(bigs[0],BigInteger.valueOf(77),new BigInteger(bytes));\n map.put(packetAddr, new Client(DH.getSharedSecretKey(bigs[0], BigInteger.valueOf(77), new BigInteger(bytes)),name));\n map.get(packetAddr).setB(new BigInteger(bytes));\n map.get(packetAddr).setAddress(packetAddr);\n map.get(packetAddr).lives=5;\n System.out.println(Arrays.toString(bigs) + \":\" + new BigInteger(bytes));\n sendWRQResponse(bigs[1], packet);\n }\n }\n }", "public void sendClientMsg(Client client, String message){\n\t\tsendMsg(message, client.getIPaddr(), client.getPort());\n\t}", "public Handler_ClientChat(Socket clientSocket, PrintWriter user) \r\n\t\t{\r\n\t\t\tPrintWriter_client = user;\r\n\t\t\ttry \r\n\t\t\t{\r\n\t\t\t\tsocket_1 = clientSocket;\r\n\t\t\t\t\r\n\t\t\t\tInputStreamReader isReader = new InputStreamReader(socket_1.getInputStream());\r\n\t\t\t\tbuff_reader = new BufferedReader(isReader);\r\n\t\t\t}\r\n\t\t\tcatch (Exception ex) \r\n\t\t\t{\r\n\t\t\t\tChat.append(\"Unlooked-for Error... \\n\");\r\n\t\t\t}\r\n\t\t}", "@Test\n public void testSendMessageWithDuplicateReplyID(TestContext context) {\n\n NetClient client = vertx.createNetClient();\n final Async async = context.async();\n\n client.connect(7000, \"localhost\").onComplete(context.asyncAssertSuccess(socket -> {\n\n vertx.eventBus().consumer(\"third-party-receiver\", msg -> context.fail());\n\n final FrameParser parser = new FrameParser(parse -> {\n context.assertTrue(parse.succeeded());\n client.close();\n async.complete();\n });\n\n socket.handler(parser);\n\n\n FrameHelper.sendFrame(\"send\", \"hello\", \"third-party-receiver\", new JsonObject().put(\"value\", \"vert.x\"), socket);\n }));\n }", "public void run() {\r\n\t\ttry {\r\n\t\t\toutput = clientSocket.getOutputStream();\r\n\t\t\tinput = clientSocket.getInputStream();\r\n\t\t// send initial message on connect\r\n\t\t\tsendMessage(new common.messages.KVAdminMessage(\"connect\", \"CONNECT_SUCCESS\", \"\", \"\")); \r\n\r\n\t\t\r\n\t\t\twhile(isOpen) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\t// Receive the KV Message from Client and check if it is valid\r\n\t\t\t\t\tcommon.messages.KVMessage latestMsg = receiveMessage();\r\n\t\t\t\t\tif (latestMsg.validityCheck() == null) {\r\n\t\t\t\t\t\t// If it is valid Handle the message by calling the function in KVServer\r\n\t\t\t\t\t\tcommon.messages.KVMessage returnMsg = m_server.handleClientMessage(latestMsg);\r\n\t\t\t\t\t\tif (returnMsg.validityCheck() == null) {\r\n\t\t\t\t\t\t\t// If returned KVMessage was valid send it back to the client\r\n\t\t\t\t\t\t\tif (returnMsg.getStatus().equals(\"SERVER_STOPPED\") || returnMsg.getStatus().equals(\"SERVER_WRITE_LOCK\") || returnMsg.getStatus().equals(\"SERVER_NOT_RESPONSIBLE\")){\r\n\t\t\t\t\t\t\t\tSystem.out.println(\"Last command from client \" + latestMsg.getHeader() + \" was not processed by Server.\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\tSystem.out.println(\"Last command from client \" + latestMsg.getHeader() + \" was Successfully Processed by Server!\");\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tsendMessage(returnMsg);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t// If returned KVMessage is not valid it will have all blank fields\r\n\t\t\t\t\t\t\tSystem.out.println(\"Last command from client \" + latestMsg + \" encountered a problem on Server side!\");\r\n\t\t\t\t\t\t\tsendMessage(returnMsg);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t} \r\n\t\t\t\t\telse if (latestMsg.getHeader().trim().equals(\"\")) {\r\n\t\t\t\t\t\t//echo empty messages\r\n\t\t\t\t\t\tsendMessage(latestMsg);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t// If it is a bad message output error and echo it back to the client\r\n\t\t\t\t\t\tlogger.debug(\"Message from Client was not valid, sending errorous message back to client\");\r\n\t\t\t\t\t\tlogger.debug(latestMsg.getError());\r\n\t\t\t\t\t\tsendMessage(new common.messages.KVAdminMessage(latestMsg.getHeader(), \"FAILED\", latestMsg.getKey(), latestMsg.getValue()));\r\n\t\t\t\t\t}\r\n\t\t\t\t/* connection either terminated by the client or lost due to \r\n\t\t\t\t * network problems*/\t\r\n\t\t\t\t} catch (IOException ioe) {\r\n\t\t\t\t\tlogger.error(\"Connection lost!\");\r\n\t\t\t\t\tisOpen = false;\r\n\t\t\t\t}\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t} catch (IOException ioe) {\r\n\t\t\tlogger.error(\"Error! Connection could not be established!\", ioe);\r\n\t\t\t\r\n\t\t} finally {\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tif (clientSocket != null) {\r\n\t\t\t\t\tinput.close();\r\n\t\t\t\t\toutput.close();\r\n\t\t\t\t\tclientSocket.close();\r\n\t\t\t\t}\r\n\t\t\t} catch (IOException ioe) {\r\n\t\t\t\tlogger.error(\"Error! Unable to tear down connection!\", ioe);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n\tpublic void reSendRequest(int rentId, String message) {\n\t\trentPortMapper.modifyRentPort(rentId, message);\n\t}", "public String getReplyString()\n {\n StringBuilder buffer = new StringBuilder(256);\n for (String s : _replyLines)\n {\n buffer.append(s);\n buffer.append(SocketClient.NETASCII_EOL);\n }\n \n return buffer.toString();\n }", "private void processClientCommand(RoMClient client, ClientCommand clientCommand) {\r\n \t\tServerCommand serverResponseCommand = null;\r\n \t\tCollection<RoMClient> receiverClients = new ArrayList<>();\r\n \r\n \t\t// Check which command was sent\r\n \t\t// ---------------------------\r\n \t\t// UserLoginCommand\r\n \t\tif (clientCommand instanceof UserLoginClientCommand) {\r\n \r\n \t\t\tUserLoginClientCommand loginCommand = (UserLoginClientCommand) clientCommand;\r\n \t\t\tserverResponseCommand = this.processUserLoginCommand(client, loginCommand);\r\n \r\n \t\t\t// LoginResponse to client\r\n \t\t\treceiverClients.add(client);\r\n \t\t}\r\n \r\n \t\t// PrivateMessageCommand\r\n \t\telse if (clientCommand instanceof PrivateMessageClientCommand) {\r\n \t\t\tPrivateMessageClientCommand privateMessageCommand = (PrivateMessageClientCommand) clientCommand;\r\n \t\t\tserverResponseCommand = this.processPrivateMesageCommand(client, privateMessageCommand);\r\n \r\n \t\t\t// Sender\r\n \t\t\treceiverClients.add(client);\r\n \t\t\t// Receiver\r\n \t\t\treceiverClients.add(this.clients.getClientByUsername(privateMessageCommand.getToUser()));\r\n \t\t}\r\n \r\n \t\t// MessageClientCommand\r\n \t\telse if (clientCommand instanceof MessageClientCommand) {\r\n \t\t\tMessageClientCommand messageCommand = (MessageClientCommand) clientCommand;\r\n \t\t\tserverResponseCommand = this.processMessageCommand(client, messageCommand);\r\n \r\n \t\t\t// MessageClient to everybody\r\n \t\t\treceiverClients = this.groupList.getClientsInSameGroup(client);\r\n \t\t}\r\n \r\n \t\t// CreateUserClientCommand\r\n \t\telse if (clientCommand instanceof CreateUserClientCommand) {\r\n \t\t\tCreateUserClientCommand newUserCommand = (CreateUserClientCommand) clientCommand;\r\n \t\t\tserverResponseCommand = this.processCreateUserCommand(client, newUserCommand);\r\n \r\n \t\t\treceiverClients.add(client);\r\n \t\t}\r\n \r\n \t\t// GetGroupsClientCommand\r\n \t\telse if (clientCommand instanceof GetGroupsClientCommand) {\r\n \t\t\tGetGroupsClientCommand getGroupsCommand = (GetGroupsClientCommand) clientCommand;\r\n \t\t\tserverResponseCommand = this.processGetGroupsCommand(client, getGroupsCommand);\r\n \r\n \t\t\treceiverClients.add(client);\r\n \t\t}\r\n \r\n \t\t// JoinGroupClientCommand\r\n \t\telse if (clientCommand instanceof JoinGroupClientCommand) {\r\n \t\t\tJoinGroupClientCommand joinGroupCommand = (JoinGroupClientCommand) clientCommand;\r\n \t\t\tserverResponseCommand = this.processJoinGroupCommand(client, joinGroupCommand);\r\n \r\n \t\t\treceiverClients.add(client);\r\n \t\t}\r\n \t\t// NewGroupClientCommnad\r\n \t\telse if (clientCommand instanceof CreateGroupClientCommand) {\r\n \t\t\tCreateGroupClientCommand createGroupCommand = (CreateGroupClientCommand) clientCommand;\r\n \t\t\tserverResponseCommand = this.processCreateGroupCommand(client, createGroupCommand);\r\n \r\n\t\t\tif (serverResponseCommand != null) {\r\n\t\t\t\treceiverClients = this.clients.getClients();\r\n\t\t\t}\r\n \t\t}\r\n \r\n \t\t// DeleteGroupClientCommand\r\n \t\telse if (clientCommand instanceof DeleteGroupClientCommand) {\r\n \t\t\tDeleteGroupClientCommand delteGroupCommand = (DeleteGroupClientCommand) clientCommand;\r\n \t\t\tserverResponseCommand = this.processDeleteGroupCommand(client, delteGroupCommand);\r\n \r\n \t\t\treceiverClients.add(client);\r\n \t\t}\r\n \r\n \t\t// CreateUserClientCommand\r\n \t\telse if (clientCommand instanceof CreateUserClientCommand) {\r\n \t\t\tCreateUserClientCommand createUserCommand = (CreateUserClientCommand) clientCommand;\r\n \t\t\tserverResponseCommand = this.processCreateUserCommand(client, createUserCommand);\r\n \r\n \t\t\treceiverClients.add(client);\r\n \t\t}\r\n \r\n \t\t// DeleteUserClientCommand\r\n \t\telse if (clientCommand instanceof DeleteUserClientCommand) {\r\n \t\t\tDeleteUserClientCommand deleteUserCommand = (DeleteUserClientCommand) clientCommand;\r\n \t\t\tserverResponseCommand = this.processDeleteUserCommand(client, deleteUserCommand);\r\n \r\n \t\t\treceiverClients.add(client);\r\n \t\t}\r\n \r\n \t\t// GetUserListClientCommand\r\n \t\telse if (clientCommand instanceof GetUserListClientCommand) {\r\n \t\t\tGetUserListClientCommand userListCommand = (GetUserListClientCommand) clientCommand;\r\n \t\t\tserverResponseCommand = this.processGetUserListCommand(client, userListCommand);\r\n \r\n \t\t\treceiverClients.add(client);\r\n \t\t}\r\n \r\n \t\t// UserLogoffCommand\r\n \t\telse if (clientCommand instanceof UserLogoffClientCommand) {\r\n \t\t\t// We won't send a response to a disconnting client\r\n \t\t\tUserLogoffClientCommand logoffCommand = (UserLogoffClientCommand) clientCommand;\r\n \t\t\tserverResponseCommand = this.processUserLogoffCommand(client, logoffCommand);\r\n \r\n \t\t\treceiverClients = null;\r\n \t\t}\r\n \t\t// ---------------------------------\r\n \r\n \t\t// Send server response\r\n \t\tif (serverResponseCommand != null) {\r\n \t\t\tif (receiverClients == null) {\r\n \t\t\t\tLogger.logMessage(\"Tried to send a ServerCommand but receiverClients list is emtpy!\");\r\n \t\t\t} else {\r\n \t\t\t\tthis.sendCommandToClient(receiverClients, serverResponseCommand);\r\n \t\t\t}\r\n \t\t}\r\n \t}", "public void run() {\n\t\tPrintWriter out = null;\r\n\t\ttry {\r\n\t\t\tout = new PrintWriter(clientSocket.getOutputStream(), true);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tBufferedReader in = null;\r\n\t\ttry {\r\n\t\t\tin = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()));\r\n\t\t} catch (IOException e1) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te1.printStackTrace();\r\n\t\t}\r\n\t\tString inputLine, outputLine;\r\n\t\tProtocol kkp = new Protocol();\r\n\r\n\t\toutputLine = kkp.processInput(null);\r\n\t\tout.println(outputLine);\r\n\t\t// Leo continuamente e interactuo\r\n\t\ttry {\r\n\t\t\twhile ((inputLine = in.readLine()) != null) {\r\n//\t\t\t\toutputLine = kkp.processInput(inputLine);\r\n\t\t\t\toutputLine = inputLine;\r\n\t\t\t\tout.println(outputLine);\r\n\t\t\t\tif (outputLine.equals(\"Bye.\")){\r\n\t\t\t\t\tbreak;\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (IOException e1) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te1.printStackTrace();\r\n\t\t}\r\n\t\ttry {\r\n\t\t\t// Cierro la entrada y salida\r\n\t\t\tout.close();\r\n\t\t\tin.close();\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} finally{\r\n\t\t\tlog.info(\"Clientes activos: \"+ (taskExecutor.getThreadPoolExecutor().getActiveCount()-1));\t\t\t\r\n\t\t}\r\n\t}", "public void handleMessageFromClient (Object msg, ConnectionToClient client)\n {\n\t int i=0;\n\t int scanCode=0;\n\t ArrayList<Object> answer = new ArrayList<Object>();\n\t \n\t String command = (String)( ((ArrayList<Object>)msg).get(0) );\n\t \t \n\t scanCode = convertToScanCode( command );\n\t \n\t String logLine = new String (client.getName() + \" \" + command + \" \"); \n\t logger.addString(logLine);\n\t\n\t switch (scanCode)\n\t {\n\t \n\t case(001):\n\t\t {\n\t\t\ttry {\n\t\t\t\t\t\n\t\t\t\t\t\tanswer = functions.login( (UserEntity) ((ArrayList<Object>)msg).get(1) );\n\t\t\t\t\t\n\t\t\t\t\t\tclient.sendToClient(answer);\n\n\t\t\t\t\t}catch (IOException e){\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t//\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\t\n\t\t }\n\t\t \n\t case(002):\n\t\t {\n\t\t\t\n\t\n\t\t\t String userID = new String((String) ((ArrayList<Object>)msg).get(1));\n\t\t\t answer = functions.getInfo(userID);\n\t\t\t try {\n\t\t\t\tclient.sendToClient(answer);\n\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t//\te.printStackTrace();\n\t\t\t}\n\t\t\t\tbreak;\n\t\t }\n\t\t \n\t case(003):\n\t {\n\t \tRequestEntity request= (RequestEntity) ((ArrayList<Object>)msg).get(1);\n\t \t//int fileLength= (int) ((ArrayList<Object>)msg).get(3);\n\t \tint fileLength= Integer.parseInt((((ArrayList<Object>)msg).get(3).toString()));\n\t \tbyte[] bytes= (byte[]) ((ArrayList<Object>)msg).get(2);\t\t\n\t\tanswer = functions.request( (RequestEntity) ((ArrayList<Object>)msg).get(1) );\n\t \tif(fileLength>0){\n\t \t\tfunctions.uploadFile(request, bytes, fileLength);\n\t \t}\n\t\ttry {\n\t\t\tclient.sendToClient(answer);\n\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t//\te.printStackTrace();\n\t\t}\n\t\tbreak;\n\t }\n\t\t \n\t case(004):\n\t\t {\n\t\t\t \n\t\t \tanswer = functions.getListOfColumn(\"systeminfo\", \"Description\", \"listOfSystems\"); // General reusable method\n\t\t\t try {\n\t\t\t\tclient.sendToClient(answer);\n\t\t\t} catch (IOException e) \n\t\t\t{\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t//e.printStackTrace();\n\t\t\t}\n\t\t\t\tbreak;\n\t\t }\n\t\t\n\n\t case(007):\n\t {\n\t\t\n\t\t String userID = new String((String) ((ArrayList<Object>)msg).get(1));\n\t\t answer = functions.getRequestHistory(userID);\n\t\t try {\n\t\t\tclient.sendToClient(answer);\n\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\t//e.printStackTrace();\n\t\t}\n\t\t\tbreak;\n\t }\n\t \n\t case(8):\n\t {\n\t\t\n\t\t String requestID = new String((String) ((ArrayList<Object>)msg).get(1));\n\t\t answer = functions.getRequest(requestID);\n\t\t try {\n\t\t\tclient.sendToClient(answer);\n\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\t//e.printStackTrace();\n\t\t}\n\t\t\tbreak;\n\t }\n\t case(9):\n\t {\n\t\t \n\t\t\n\t\t answer = functions.getReq((String)( ((ArrayList<Object>)msg).get(1)));\n\t\t try {\n\t\t\tclient.sendToClient(answer);\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t//\te.printStackTrace();\n\t\t\t}\n\t\t\t\tbreak;\n\t\t }\n\t case(102):\n\t {\n\t\t\n\t\t \n\t\t\n\t\t String userID = new String((String) ((ArrayList<Object>)msg).get(1));\n\t\t String currentStatus= new String((String) ((ArrayList<Object>)msg).get(2));\n\t\t \n\t\t \n\t\t answer = functions.getlistOfRequests(userID,currentStatus);\n\t\t try {\n\t\t\t \n\t\t\t \n\t\t\tclient.sendToClient(answer);\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t//\te.printStackTrace();\n\t\t}\n\t\t\tbreak;\n\t }\n case(101):\n {\n\t scanCode=000;\n\t String request = new String((String) ((ArrayList<Object>)msg).get(1));\n\t String days = new String((String) ((ArrayList<Object>)msg).get(2));\n\t String newStatus= new String((String) ((ArrayList<Object>)msg).get(3));\n\t answer = functions.setTaskDuration(request,days,newStatus);\n\t try { \n\t\tclient.sendToClient(answer);\n\t} catch (IOException e) {\n\t\t// TODO Auto-generated catch block\n\t//\te.printStackTrace();\n\t}\n\t\tbreak;\n }\n\n \n case(302):\n { \n\t\t\n \tString assID = new String((String) ((ArrayList<Object>)msg).get(1));\t\n \tanswer = functions.getReviewAndDecision(assID); \n \n \t\t try {\n \t\t\tclient.sendToClient(answer);\n \t\t} catch (IOException e)\n \t\t{\n \t\t//\te.printStackTrace();\n \t\t}\n \t\t\tbreak;\n }\n \n case(303):\n { \n \tString requestID = new String((String) ((ArrayList<Object>)msg).get(1));\n \tString discussionLog = new String((String) ((ArrayList<Object>)msg).get(2));\n \tanswer = functions.setValueByRequestID(\"reviewanddecision\", \"reviewAndDecision\", \"reqID\", requestID, discussionLog, \"discussionLogAnswer\" ); \n \t\n \t\t try {\n \t\t\tclient.sendToClient(answer);\n \t\t} catch (IOException e)\n \t\t{\n \t\t\t//e.printStackTrace();\n \t\t}\n \t\t\tbreak;\n }\n \n case(304):\n\t {\n\t\t\n\t\t String assessmentID = new String((String) ((ArrayList<Object>)msg).get(1));\n\t\t answer = functions.getAssessment(assessmentID);\n\t\t try {\n\t\t\tclient.sendToClient(answer);\n\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t//\te.printStackTrace();\n\t\t}\n\t\t\tbreak;\n\t }\n \n case(200):\n {\n\t String userID = new String((String) ((ArrayList<Object>)msg).get(1));\n\t String currentStatus= new String((String) ((ArrayList<Object>)msg).get(2));\n\t String Elid = (String) ((ArrayList<Object>)msg).get(3);\n\t String table = (String) ((ArrayList<Object>)msg).get(4);\n\t answer = functions.getlistOfExRequests(userID,currentStatus,Elid,table);\n\t try {\n\t\tclient.sendToClient(answer);\n\t} catch (IOException e) {\n\t\t//e.printStackTrace();\n\t}\n\t\tbreak;\n }\n \n case(305):\n { \n \t\n \tanswer = functions.getRequestsWithTwoValues(\"request\", \"Status\", \"Rid\", \"5\", \"6\", \"reviewableRequests\"); \n\t\t try {\n\t\t\tclient.sendToClient(answer);\n\t\t} catch (IOException e)\n\t\t{\n\t\t\t//e.printStackTrace();\n\t\t}\n\t\t\tbreak;\n }\n \n case(307):\n { \n\t \tString requestID = new String((String) ((ArrayList<Object>)msg).get(1));\n\t \tString discussionLog = new String((String) ((ArrayList<Object>)msg).get(2));\n \tanswer = functions.insertValuesToReviewAndDecision (requestID, discussionLog ); \n\t\t try {\n\t\t\tclient.sendToClient(answer);\n\t\t} catch (IOException e)\n\t\t{\n\t\t\t//e.printStackTrace();\n\t\t}\n\t\t\tbreak;\n }\n \n case(308):\n { \n\t \tString requestID = new String((String) ((ArrayList<Object>)msg).get(1));\n \tanswer = functions.convertRequestIDtoAssessmentID(requestID); \n\t\t try {\n\t\t\tclient.sendToClient(answer);\n\t\t} catch (IOException e)\n\t\t{\n\t\t\t//e.printStackTrace();\n\t\t}\n\t\t\tbreak;\n }\n \n case(309):\n\t {\n\t\t\n\t\t String requestID = new String((String) ((ArrayList<Object>)msg).get(1));\n\t\t answer = functions.getRequest(requestID);\n\t\t try {\n\t\t\tclient.sendToClient(answer);\n\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\t//e.printStackTrace();\n\t\t}\n\t\t\tbreak;\n\t }\n case(310):\n {\n\t\n\t\n\t answer = functions.getAss();\n\t try {\n\t\tclient.sendToClient(answer);\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\t//e.printStackTrace();\n\t\t}\n\t\t\tbreak;\n\t }\n\t \n\n case(201):\n {\n\t String code = ((String)((ArrayList<Object>)msg).get(0));\n\t String request = new String((String) ((ArrayList<Object>)msg).get(1));\n\t String det= new String((String) ((ArrayList<Object>)msg).get(2));\n\t String newStatus = (String) ((ArrayList<Object>)msg).get(4);\n\t functions.changeStatus(request, newStatus);\n\t int req = Integer.parseInt(request);\n\t answer = functions.getExeccutionEntity(code,req);\n\t if (answer.get(1).equals(\"Valid\"))\n\t {\n\t\t answer = functions.updateExecutedReq(code, request, det);\n\t }\n\t else{\n\t\t answer = functions.enterNewExecutionRecord(code, request, det, \"no\");\n\t }\n\t if(!((ArrayList<Object>)msg).get(5).equals(\"nothing\"))\n\t {\n\t\t ArrayList<Object> ex = new ArrayList<Object>();\n\t\t String code1=((String)((ArrayList<Object>)msg).get(5));\n\t\t int number = Integer.parseInt((((ArrayList<Object>)msg).get(6)).toString());\n\t\t RequestEntity en = ((RequestEntity)((ArrayList<Object>)msg).get(7));\n\t\t String status = ((String)((ArrayList<Object>)msg).get(8));\n\t\t String pid1 = ((String)((ArrayList<Object>)msg).get(9));\n\t\t ex = functions.fillInExceeded(code1,en.getRID(),en.getUid(),number,status);\n\t\t ArrayList<Object> eleader = functions.getUsers(\"getEleader\",pid1);\n\t\t if(eleader.get(1).equals(\"Valid\"))\n\t\t {\n\t\t\t EmailEntity eleMail = (EmailEntity) eleader.get(2);\n\t\t\t String mail = eleMail.getMail();\n\t\t\t SendMailSSL.SendEmail(mail, \"Ass' exceeded\", \"For your notice ! the ass number\" + request + \"have Exceeded!\" );\n\t\t\t SendMailSSL.SendEmail(\"[email protected]\",\"Ass' exceeded\", \"For your notice ! the ass number\"+request + \"have Exceeded!\");\n\t\t\t SendMailSSL.SendEmail(\"[email protected]\",\"Ass' exceeded\", \"For your notice ! the ass number\" + request + \"have Exceeded!\");\n\t\t }\n\t\t \n\t\t \n\t\t answer.add(ex);\n\t }\n\t else\t// was put in order not to check out of bounds place .\n\t {\n\t\t ArrayList<Object> ex = new ArrayList<Object>();\n\t\t String code1 = \"fillInExceeded\";\n\t\t String Valid = \"notValid\";\n\t\t ex.add(code1);\n\t\t ex.add(Valid);\n\t\t answer.add(ex);\n\t }\n\t try {\n\t\tclient.sendToClient(answer);\n\t} catch (IOException e) {\n\t\t// TODO Auto-generated catch block\n\t\t//e.printStackTrace();\n\t}\n\t\tbreak; \n }\n \n case(900):\n { \n\t \tExtendEntity deadlineRequest = ((ExtendEntity) ((ArrayList<Object>)msg).get(1));\n \tanswer = functions.extendDeadlineRequest(deadlineRequest); \n\t\t try {\n\t\t\tclient.sendToClient(answer);\n\t\t} catch (IOException e)\n\t\t{\n\t\t\t//e.printStackTrace();\n\t\t}\n\t\t\tbreak;\n }\n\t \n case(901):\n { \n\t \t\n \tanswer.add(\"extentionRequestWasSent\");\n\t\t try {\n\t\t\tclient.sendToClient(answer);\n\t\t} catch (IOException e)\n\t\t{\n\t\t//\te.printStackTrace();\n\t\t}\n\t\t\tbreak;\n }\n \n case(902):\n { \n\t String requestID = ((String)((ArrayList<Object>)msg).get(1));\n\t \tanswer = functions.changeStatus(requestID,\"62\");\n\t\t try {\n\t\t\tclient.sendToClient(answer);\n\t\t} catch (IOException e)\n\t\t{\n\t\t\t//e.printStackTrace();\n\t\t}\n\t\t\tbreak;\n }\n \n\r\n case(903):\n { \n\t String requestID = ((String)((ArrayList<Object>)msg).get(1));\n\t \tanswer = functions.changeStatus(requestID,\"7\");\n\t\t try {\n\t\t\tclient.sendToClient(answer);\n\t\t} catch (IOException e)\n\t\t{\n\t\t//\te.printStackTrace();\n\t\t}\n\t\t\tbreak;\n }\n \n case(904):\n { \n\t String requestID = ((String)((ArrayList<Object>)msg).get(1));\n\t String additionalInformation = ((String)((ArrayList<Object>)msg).get(2));\n\t \n\t \tanswer = functions.requireAdditionalInformation(requestID,additionalInformation);\n\t\t try {\n\t\t\tclient.sendToClient(answer);\n\t\t} catch (IOException e)\n\t\t{\n\t\t//\te.printStackTrace();\n\t\t}\n\t\t\tbreak;\n }\n \n\r\n case(800):\n {\n\r\n\t\n\t String userID = new String((String) ((ArrayList<Object>)msg).get(1));\n\t answer = functions.getUser(userID);\n\t try {\n\t\tclient.sendToClient(answer);\n\n\t} catch (IOException e) {\n\t\t// TODO Auto-generated catch block\n\t\t//e.printStackTrace();\n\t}\n\t\tbreak;\n }\n case(801):\n {\n\t\n\t String reqID = new String((String) ((ArrayList<Object>)msg).get(1));\n\t String ID = new String((String) ((ArrayList<Object>)msg).get(2));\n\t String identity =new String((String) ((ArrayList<Object>)msg).get(3));\n\t String status =new String((String) ((ArrayList<Object>)msg).get(4));\n\t \n\t answer = functions.Pair(reqID,ID,identity,status);\n\t try {\n\t\tclient.sendToClient(answer);\n\n\t} catch (IOException e) {\n\t\t// TODO Auto-generated catch block\n\t\t//e.printStackTrace();\n\t}\n\t\tbreak;\n }\n case(802):\n {\n\t \n\t\n\t answer = functions.getExe();\n\t try {\n\t\tclient.sendToClient(answer);\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\t//e.printStackTrace();\n\t\t}\n\t\t\tbreak;\n\t }\n\t\n case(103):\n {\n\t \n\t AssessmentEntity assessmentEntity=((AssessmentEntity) ((ArrayList<Object>)msg).get(1));\n\t String newStatus= new String((String) ((ArrayList<Object>)msg).get(2));\n\t String requestID= assessmentEntity.getRid();\n\t String userID = functions.requestToUserID(requestID);\n\t String email;\n\t \n\t ArrayList<Object> requestArray = functions.getRequest(requestID);\n\t RequestEntity request = (RequestEntity)(requestArray.get(1));\n\t if (CommonMethods.exceededDeadline(request.getDeadline()))\n\t {\n\t\t functions.fillInExceeded(\"fillInExceeded\", Integer.parseInt(requestID), request.getUid(),CommonMethods.getExceededTime(request.getDeadline()), request.getStatusid());\n\t\t if (!userID.equalsIgnoreCase(\"none\"))\n\t\t {\n\t\t\t ArrayList<Object> user = functions.getInfo(userID);\n\t\t\t email = (String)user.get(3);\n\t\t\tSendMailSSL.SendEmail(email, \"Deadline exceeded!\", \"You have exceeded the deadline for request \" + requestID);\n\t\t }\n\t\t\n\t\t\n\t }\n\t \n\t \n\t answer = functions.setAssessment(assessmentEntity, newStatus);\n\t try {\n\t\t \n\t\t client.sendToClient(answer);\n\t\t \n\t } catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t//\te.printStackTrace();\n\t }\n\t break;\n }\n\n case(202):\n { \n\t \tArrayList<Object> extra = new ArrayList<Object>();\n\t \tString code = new String((String) ((ArrayList<Object>)msg).get(0));\n \t\tString requestID = new String((String) ((ArrayList<Object>)msg).get(1));\n\t\tanswer = functions.getRequest(requestID);\n \tint request = Integer.parseInt(requestID);\n \textra = functions.getExeccutionEntity(code,request);\n \tanswer.add(extra);\n \ttry {\n\t\t\tclient.sendToClient(answer);\n\t\t} catch (IOException e)\n\t\t{\n\t\t\t//e.printStackTrace();\n\t\t}\n\t\t\tbreak;\n }\n \n case(905):\n { \n\t String status = new String((String) ((ArrayList<Object>)msg).get(1));\n\t \tanswer = functions.getListsForAssignment(status);\n\t\t try {\n\t\t\tclient.sendToClient(answer);\n\t\t} catch (IOException e)\n\t\t{\n\t\t//\te.printStackTrace();\n\t\t}\n\t\t\tbreak;\n }\n \n case(906):\n { \n\t String userSkill = new String((String) ((ArrayList<Object>)msg).get(1));\n\t \tanswer = functions.getListOfUsers(userSkill);\n\t\t try {\n\t\t\tclient.sendToClient(answer);\n\t\t} catch (IOException e)\n\t\t{\n\t\t//\te.printStackTrace();\n\t\t}\n\t\t\tbreak;\n }\n case(803):\n {\n\t\n\t String reqID = new String((String) ((ArrayList<Object>)msg).get(1));\n\t String status = new String((String) ((ArrayList<Object>)msg).get(2));\n\t answer = functions.approveEXDu(reqID, status);\n\t try {\n\t\tclient.sendToClient(answer);\n\n\t} catch (IOException e) {\n\t\t// TODO Auto-generated catch block\n\t\t//e.printStackTrace();\n\t}\n\t\tbreak;\n }\n case(804):\n {\n\t\n\t String reqID = new String((String) ((ArrayList<Object>)msg).get(1));\n\t\t\n\n\t answer = functions.getDu(reqID);\n\t try {\n\t\tclient.sendToClient(answer);\n\n\t} catch (IOException e) {\n\t\t// TODO Auto-generated catch block\n\t\t//e.printStackTrace();\n\t}\n\t\tbreak;\n }\n \n case(907):\n { \n\t String inspectorID = new String((String) ((ArrayList<Object>)msg).get(1));\n\t String requestID = new String((String) ((ArrayList<Object>)msg).get(2));\n\t \tanswer = functions.setInspectorToRequest(requestID, inspectorID);\n\t\t try {\n\t\t\tclient.sendToClient(answer);\n\t\t} catch (IOException e)\n\t\t{\n\t\t//\te.printStackTrace();\n\t\t}\n\t\t\tbreak;\n }\n case(805):\n { \n\t\t\n\n\t String reqID = new String((String) ((ArrayList<Object>)msg).get(1));\n\t //int newDuration=(int)((ArrayList<Object>) msg).get(2);\n\t int newDuration= Integer.parseInt((((ArrayList<Object>) msg).get(2)).toString());\n\t\t\n\t \tanswer = functions.setNewDuration(reqID,newDuration);\n\n\t\t try {\n\t\t\tclient.sendToClient(answer);\n\t\t} catch (IOException e)\n\t\t{\n\t\t//\te.printStackTrace();\n\t\t}\n\t\t\tbreak;\n }\n case(205):\n {\n\t String code = ((String)((ArrayList<Object>)msg).get(0));\n\t String request = new String((String) ((ArrayList<Object>)msg).get(1));\n\t String det= new String((String) ((ArrayList<Object>)msg).get(2));\n\t String bool = new String((String) ((ArrayList<Object>)msg).get(3));\n\t answer = functions.enterNewExecutionRecord(code,request,det,bool);\n\t try {\n\t\t\tclient.sendToClient(answer);\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t//\te.printStackTrace();\n\t\t}\n\t\t\tbreak; \n }\n case(204):\n {\n\t String code = ((String)((ArrayList<Object>)msg).get(0));\n\t String request = new String((String) ((ArrayList<Object>)msg).get(1));\n\t String det= new String((String) ((ArrayList<Object>)msg).get(2));\n\t answer = functions.updateExecutedReq(code,request,det);\n\t try {\n\t\tclient.sendToClient(answer);\n\t} catch (IOException e) {\n\t//\te.printStackTrace();\n\t}\n\t\tbreak; \n }\n \n case(203):\n { \n\t \tArrayList<Object> extra = new ArrayList<Object>();\n \tString code = ((String) ((ArrayList<Object>)msg).get(0));\n \tString requestID = new String((String) ((ArrayList<Object>)msg).get(1));\n \tint request = Integer.parseInt(requestID);\n \textra = functions.getExeccutionEntity(code,request);\n \ttry {\n\t\t\tclient.sendToClient(extra);\n\t\t} catch (IOException e)\n\t\t{\n\t\t//\te.printStackTrace();\n\t\t}\n\t\t\tbreak;\n } \n\ncase(908):\n{ \n\t\tString inspectorID = new String((String) ((ArrayList<Object>)msg).get(1));\n\t \tanswer = functions.getRequestsWithTwoValues(\"request\", \"Status\", \"Rid\", \"12\", \"5555\", \"listOfInspectionableRequests\");\n\t\t try\n\t\t {\n\t\t\tclient.sendToClient(answer);\n\t\t}catch (IOException e)\n\t\t{\n\t\t//\te.printStackTrace();\n\t\t}\n\t\t\tbreak;\n}\n\n\n\ncase(909):\n{ \n\t\tString requestID = new String((String) ((ArrayList<Object>)msg).get(1));\n\t \tanswer = functions.getExeccutionEntity(\"executionEntity\",Integer.parseInt(requestID));\n\r\n\t\t try\n\t\t {\n\t\t\tclient.sendToClient(answer);\n\t\t}catch (IOException e)\n\t\t{\n\t\t\t//e.printStackTrace();\n\t\t}\n\t\t\tbreak;\n}\n\ncase(910):\n{ \n\t\tString requestID = new String((String) ((ArrayList<Object>)msg).get(1));\n\t \tanswer = functions.getInspection(requestID);\n\t\t try\n\t\t {\n\t\t\tclient.sendToClient(answer);\n\t\t}catch (IOException e)\n\t\t{\n\t\t\t//e.printStackTrace();\n\t\t}\n\t\t\tbreak;\n\t\t\t\n}\n\ncase(911):\n{ \n\t\n\t\tInspectionEntity inspection = ((InspectionEntity) ((ArrayList<Object>)msg).get(1));\n\t\tArrayList<Object> ans1 = new ArrayList<Object>();\n\t\tString action = ((String)((ArrayList<Object>)msg).get(2));\n\t\tanswer = functions.setInspection(inspection, action);\n\t \n\t\tif (action.equalsIgnoreCase(\"approve\") && ((String)answer.get(1)).equalsIgnoreCase(\"Valid\") )\n\t \t{\n\t \t\tans1=functions.changeStatus(inspection.getRequestID(), \"121\");\n\t \t}\n\t \telse\n\t \tif (action.equalsIgnoreCase(\"deny\") && ((String)answer.get(1)).equalsIgnoreCase(\"Valid\") )\n\t\t{\n\t\t \tans1=functions.changeStatus(inspection.getRequestID(), \"122\");\n\t\t}\t\n\t \telse\n\t \t{\n\t\t\tans1.add(\"somthing\");\n\t\t\tans1.add(\"StatusNotSet\");\n\t\t}\t\n\t\tanswer.add(ans1.get(1).toString());\n\t\t try\n\t\t {\n\t\t\tclient.sendToClient(answer);\n\t\t}catch (IOException e)\n\t\t{\n\t\t//\te.printStackTrace();\n\t\t}\n\t\t\tbreak;\n\t\t\t\n} \ncase(806):\n{ \n\t\n\t \tanswer = functions.getExtend();\n\t\t try\n\t\t {\n\t\t\tclient.sendToClient(answer);\n\t\t}catch (IOException e)\n\t\t{\n\t\t//\te.printStackTrace();\n\t\t}\n\t\t\tbreak;\n\t\t\t\n}\n\ncase(500):\n{ \n\t\t\n\t\tanswer = functions.initializeMangeEmployees();\n\t\t\n\t\t try\n\t\t {\n\t\t\tclient.sendToClient(answer);\n\t\t}catch (IOException e)\n\t\t{\n\t\t//\te.printStackTrace();\n\t\t}\n\t\t\tbreak;\n\t\t\t\n} \ncase(807):\n{ \n\t\tString reqID = new String( (String)((ArrayList<Object>)msg).get(1));\n\t \tanswer = functions.getExtendInfo(reqID);\n\t\t try\n\t\t {\n\t\t\tclient.sendToClient(answer);\n\t\t}catch (IOException e)\n\t\t{\n\t\t//\te.printStackTrace();\n\t\t}\n\t\t\tbreak;\n\t\t\t\n}\n\ncase(501):\n{ \n\t\tUserEntity oldChairman = ((UserEntity) ((ArrayList<Object>)msg).get(1));\n\t\tUserEntity newChairman = ((UserEntity) ((ArrayList<Object>)msg).get(2));\n\t\tanswer = functions.switchChairman(oldChairman, newChairman);\n\t \n\t\t try\n\t\t {\n\t\t\tclient.sendToClient(answer);\n\t\t}catch (IOException e)\n\t\t{\n\t\t//\te.printStackTrace();\n\t\t}\n\t\t\tbreak;\n\t\t\t\n} \ncase(104):\n{\n\t \n\t AssessmentEntity assessmentEntity=((AssessmentEntity) ((ArrayList<Object>)msg).get(1));\n\t answer = functions.newAssessmentRow(assessmentEntity);\n\t try {\n\t\t \n\t\t client.sendToClient(answer);\n\t\t \n\t } catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\t//e.printStackTrace();\n\t }\n\t break;\n}\ncase(808):\n{ \n\t\tString code = new String((String) ((ArrayList<Object>)msg).get(1));\n\t\tString extID = new String((String) ((ArrayList<Object>)msg).get(2));\n\t \tanswer = functions.approvDenyExt(code,extID);\n\t\t try\n\t\t {\n\t\t\tclient.sendToClient(answer);\n\t\t}catch (IOException e)\n\t\t{\n\t//\t\te.printStackTrace();\n\t\t}\n\t\t\tbreak;\n\t\t\t\n}\n\ncase(502):\n{ \n\t\tUserEntity oldCommitteeMember = ((UserEntity) ((ArrayList<Object>)msg).get(1));\n\t\tUserEntity newCommitteeMember = ((UserEntity) ((ArrayList<Object>)msg).get(2));\n\t\tanswer = functions.switchCommitteeMembers(oldCommitteeMember, newCommitteeMember);\n\t \n\t\t try\n\t\t {\n\t\t\tclient.sendToClient(answer);\n\t\t}catch (IOException e)\n\t\t{\n\t\t\t//e.printStackTrace();\n\t\t}\n\t\t\tbreak;\n\t\t\t\n} \n\ncase(206):\n{\n\t\n\tString code = ((String) ((ArrayList<Object>)msg).get(0));\n\tString pid = ((String) ((ArrayList<Object>)msg).get(1));\n\tString oldStatus =((String) ((ArrayList<Object>)msg).get(2));\n\tanswer = functions.getDeniedExecutions(code,pid,oldStatus);\n\ttry {\n\t\tclient.sendToClient(answer);\n\t}\n\tcatch (Exception e)\n\t{\n\t\te.getCause();\n\t\t\n\t}\n\tbreak;\n}\n\ncase(207):\n{\n\tArrayList<Object> extra = new ArrayList<Object>();\n\tString code = ((String) ((ArrayList<Object>)msg).get(0));\n\tString rid = ((String) ((ArrayList<Object>)msg).get(1));\n\tString newStatus =((String) ((ArrayList<Object>)msg).get(2));\n\tanswer = functions.changeStatus(rid,newStatus);\n\textra = functions.DelExeReq(rid);\n\ttry{\n\t\tclient.sendToClient(extra);\n\t}\n\tcatch(Exception e)\n\t{\n\t\te.getCause();\n\t\t\n\t}\n\tbreak;\n}\n\ncase(503):\n{ \n\t\tUserEntity currentUser = ((UserEntity) ((ArrayList<Object>)msg).get(1));\n\t\tanswer = functions.setUserAccess(currentUser);\n\t \n\t\t try\n\t\t {\n\t\t\tclient.sendToClient(answer);\n\t\t}catch (IOException e)\n\t\t{\n\t\t//\te.printStackTrace();\n\t\t}\n\t\t\tbreak;\n\t\t\t\n}\ncase(105):\n{\n\tanswer = functions.changeStatus();\n\ttry\n\t{\n\t\tclient.sendToClient(answer);\n\t}\n\tcatch (IOException e)\n\t{\n\t//\te.printStackTrace();\n\t}\n\tbreak;\n}\ncase(809):\n{\n\tString reqID = ((String) ((ArrayList<Object>)msg).get(1));\n\tString currentS = ((String) ((ArrayList<Object>)msg).get(2));\n\tString change = ((String) ((ArrayList<Object>)msg).get(3));\n\tString explanation =((String) ((ArrayList<Object>)msg).get(4));\n\tString supervisorID = ((String) ((ArrayList<Object>)msg).get(5));\n\tanswer = functions.updateFields(reqID,currentS,change,explanation,supervisorID);\n\ttry {\n\t\tclient.sendToClient(answer);\n\t\t\n\t}\n\tcatch (Exception e)\n\t{\n\t\te.getCause();\n\t\t}\n\tbreak;\n}\ncase(810):\n{\n\tString status1 = ((String) ((ArrayList<Object>)msg).get(1));\n\tString status2 = ((String) ((ArrayList<Object>)msg).get(2));\n\tanswer = functions.completeReq(status1,status2);\n\ttry {\n\t\tclient.sendToClient(answer);\n\t\t\n\t}\n\tcatch (Exception e)\n\t{\n\t\te.getCause();\n\t\t}\n\tbreak;\n}\n\n\n\ncase(504):\n{ \n\t\tString userID = ((String) ((ArrayList<Object>)msg).get(1));\n\t\tfunctions.logOff(userID);\n\t\t\n\t\n\t\t\tbreak;\n}\n\n\n\n\n\ncase(811):\n{\n\tString reqID = ((String) ((ArrayList<Object>)msg).get(1));\n\tString status = ((String) ((ArrayList<Object>)msg).get(2));\n\tanswer = functions.changeStatus(reqID,status);\n\ttry {\n\t\tclient.sendToClient(answer);\n\t\t\n\t}\n\tcatch (Exception e)\n\t{\n\t\te.getCause();\n\t\t}\n\tbreak;\n}\ncase(106):\n{\n\tString reqID = ((String) ((ArrayList<Object>)msg).get(1));\n\tanswer = functions.getFile(reqID);\n\n\ttry{\n\t\tclient.sendToClient(answer);\n\t}\n\tcatch(IOException e)\n\t{\n\t\t//e.printStackTrace();\n\t}\n\tbreak;\n}\n\n\ncase(812):\n{\n\tString exeID = ((String) ((ArrayList<Object>)msg).get(1));\n\t\n\tanswer = functions.getExecute(exeID);\n\ttry {\n\t\tclient.sendToClient(answer);\n\t\t\n\t}\n\tcatch (Exception e)\n\t{\n\t\te.getCause();\n\t\t}\n\tbreak;\n}\ncase(813):\n{\n\tString rID = ((String) ((ArrayList<Object>)msg).get(1));\n\t\n\tanswer = functions.ridToAid(rID);\n\ttry {\n\t\tclient.sendToClient(answer);\n\t\t\n\t}\n\tcatch (Exception e)\n\t{\n\t\te.getCause();\n\t\t}\n\tbreak;\n}\n\ncase(912):\n{\n\t \n\tanswer = functions.getListOfColumn(\"request\", \"Rid\", \"getListOfAllRequests\"); // General reusable method\n\t try {\n\t\tclient.sendToClient(answer);\n\t} catch (IOException e) \n\t{\n\t\t// TODO Auto-generated catch block\n\t//\te.printStackTrace();\n\t}\n\t\tbreak;\n}\ncase(913):\n{\n\t \n\tanswer = functions.getListOfColumn(\"assessment\", \"Assid\", \"getListOfAllAssessments\"); // General reusable method\n\t try {\n\t\tclient.sendToClient(answer);\n\t} catch (IOException e) \n\t{\n\t\t// TODO Auto-generated catch block\n\t\t//e.printStackTrace();\n\t}\n\t\tbreak;\n}\n\n\ncase(914):\n{\n\t \n\tanswer = functions.getListOfColumn(\"assessment\", \"Assid\", \"getListOfAllExecutions\"); // General reusable method\n\t try {\n\t\tclient.sendToClient(answer);\n\t} catch (IOException e) \n\t{\n\t\t// TODO Auto-generated catch block\n\t//\te.printStackTrace();\n\t}\n\t\tbreak;\n}\n\n\ncase(915):\n{\n\tint numberofdays;\n\tString days;\n\tString requestID = ((String) ((ArrayList<Object>)msg).get(1));\n\tArrayList<Object> request = functions.getRequest(requestID);\n\t\n\tRequestEntity myrequest = ((RequestEntity) ((ArrayList<Object>)request).get(1));\n\t\t\n\tnumberofdays = functions.getexceedTime(requestID);\n\tnumberofdays = numberofdays + CommonMethods.numberOfDays(myrequest.getDate(), myrequest.getDeadline());\n\tdays= Integer.toString(numberofdays);\n\t\n\tanswer = functions.changeStatus(requestID , \"999\");\n\tfunctions.setTaskDuration(requestID, days, \"999\");\n\t try {\n\t\tclient.sendToClient(answer);\n\t} catch (IOException e) \n\t{\n\t\t// TODO Auto-generated catch block\n\t\t//e.printStackTrace();\n\t}\n\t\tbreak;\n}\n\ncase(814):\n{\n \n answer = functions.getAllReq();\n try {\n client.sendToClient(answer);\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n break;\n }\ncase(815):\n{\n String rID = ((String) ((ArrayList<Object>)msg).get(1));\n String reason= ((String) ((ArrayList<Object>)msg).get(2));\n answer = functions.suspend(rID, reason);\n try {\n client.sendToClient(answer);\n \n }\n catch (Exception e)\n {\n e.getCause();\n }\n break;\n}\ncase(816):\n{\n String rID = ((String) ((ArrayList<Object>)msg).get(1));\n answer = functions.resume(rID);\n try {\n client.sendToClient(answer);\n \n }\n catch (Exception e)\n {\n e.getCause();\n }\n break;\n}\ncase(817):\n{\n String rID = ((String) ((ArrayList<Object>)msg).get(1));\n answer = functions.susInfo(rID);\n try {\n client.sendToClient(answer);\n \n }\n catch (Exception e)\n {\n e.getCause();\n }\n break;\n}\ncase(107):\n{\n\tString from = ((String) ((ArrayList<Object>)msg).get(1));\n\tString to = ((String) ((ArrayList<Object>)msg).get(2));\n\tanswer = functions.activityReport(from, to);\n\tSystem.out.println(\"after answer sent to user\");\n\ttry {\n\t\tclient.sendToClient(answer);\t\t\n\t}\n\tcatch (Exception e)\n\t{\n\t\te.getCause();\n\t}\n\tbreak;\n}\ncase(108):\n{\n\tString date = ((String) ((ArrayList<Object>)msg).get(1));\n\tbyte[] bytes = ((byte[]) ((ArrayList<Object>)msg).get(2));\n\tint fileLength=((int) ((ArrayList<Object>)msg).get(3));\n\tanswer = functions.saveReport(date, bytes, fileLength);\n\ttry {\n\t\tclient.sendToClient(answer);\t\t\n\t}\n\tcatch (Exception e)\n\t{\n\t\te.getCause();\n\t}\n\tbreak;\n}\ncase(109):\n{\n\tString date = ((String) ((ArrayList<Object>)msg).get(1));\n\tanswer = functions.getReport(date);\n\ttry {\n\t\tclient.sendToClient(answer);\t\t\n\t}\n\tcatch (Exception e)\n\t{\n\t\te.getCause();\n\t}\n\tbreak;\n}\n\n }\n}", "public void run() {\n try {\n while (true) {\n BufferedReader inFromKeyBoard = new BufferedReader(new InputStreamReader(System.in));\n OutputStream outToClient = socket.getOutputStream();\n BufferedReader inFromClient = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n DataInputStream inFromServer = null;\n DataOutputStream outToServer = null;\n String cmd = inFromClient.readLine();\n System.out.println(\"The Client request for: \" + cmd);\n if (cmd == null)\n continue;\n\n /**\n * Process the command from client and identify the method and address.\n * If command error, write the error response and break.\n *\n */\n String[] strs = cmd.split(\" \");\n\n String method = strs[0];\n\n if (!method.equals(\"GET\")) {\n continue;\n }\n\n String url = strs[1];\n if (!url.contains(\"://\")) {\n url = url + \"http://\";\n }\n\n /**\n * Process the file name and make sure the server name, the file path and the number of port.\n *\n */\n int port = 0;\n String serverName = \"\";\n String filePath = \"\";\n\n URL new_url = new URL(url);\n serverName = new_url.getHost();\n port = new_url.getPort();\n if (port == -1) {\n port = 80;\n }\n url = url.substring(url.indexOf(\"//\") + 2);\n filePath = url.substring(url.indexOf(\"/\"));\n\n /**\n * Response the right format request. Identify the file type and write it to the client.\n *\n */\n System.out.println(\"HOST: \" + serverName);\n System.out.println(\"PORT: \" + port);\n System.out.println(filePath);\n System.out.println(\"Now respond the Client \\'s request: \");\n\n Socket clientSocket = new Socket(serverName, port);// the Proxy Server Functions as client\n\n inFromServer = new DataInputStream(clientSocket.getInputStream());\n outToServer = new DataOutputStream(clientSocket.getOutputStream());\n\n outToServer.writeBytes(\"GET \" + filePath + \" HTTP/1.0\\r\\n\\r\\n\");\n\n byte[] bytes = new byte[1024];\n\n int size = 0;\n\n /**\n * Read from Server and Write to Client.\n *\n */\n while ((size = inFromServer.read(bytes, 0, 1024)) != -1) {\n outToClient.write(bytes, 0, size);\n outToClient.flush();\n }\n break;\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n // close the socket\n finally {\n try {\n if (socket != null) {\n socket.close();\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }", "private void sendToClient(String string) {\n\t\r\n}", "public void sendToClient(String message, boolean srvPrefix) {\r\n String send = ((srvPrefix)?(\":\" + ServerConfig.SERVER_NAME + \" \"):\"\")\r\n + message+\"\\r\\n\";\r\n ServerLogger.log(this.myID + \" sending:\" + send);\r\n try {outputStream.writeBytes(send);}catch (Exception e){\r\n ServerLogger.log(this.myID + \" error on sendToClient \" + e.getMessage());}\r\n }", "public static void regThread(SocketClient socketClient) {\n mSocketClient = socketClient;\n\n initMsg();\n movement();\n\n try {\n// mSocketClient.send(msg);\n String msg = mSocketClient.receive();\n System.out.println(\"From CP's msg : \" + msg);\n String[] line = msg.split(\",\");\n if (line[0].equals(\"e\")) {\n if (Integer.valueOf(line[1]) == EID) {\n if (Integer.valueOf(line[1]) < Integer.valueOf(line[2])) {\n upQueue.add(Integer.valueOf(line[1]));\n upQueue.add(Integer.valueOf(line[2]));\n } else {\n downQueue.add(Integer.valueOf(line[1]));\n downQueue.add(Integer.valueOf(line[2]));\n }\n }\n }\n\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "protected void reply_ok() throws java.io.IOException {\n byte[] ok = PushCacheProtocol.instance().okPacket();\n _socket.getOutputStream().write(ok, 0, ok.length);\n }", "public void run() {\n\t\tString choice = null;\n\t\tBufferedReader inFromClient = null;\n\t\tDataOutputStream outToClient = null;\n\t\t\n\t\ttry {\n\t\t\tinFromClient = new BufferedReader(new InputStreamReader(client.getInputStream()));\n\t\t\toutToClient = new DataOutputStream(client.getOutputStream());\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\ttry {\n\t\t\t// Loops until the client's connection is lost\n\t\t\twhile (true) {\t\n\t\t\t\t// Request that was sent from the client\n\t\t\t\tchoice = inFromClient.readLine();\n\t\t\t\tif(choice != null) {\n\t\t\t\t\tSystem.out.println(choice);\n\t\t\t\t\tswitch (choice) {\n\t\t\t\t\t\t// Calculates the next even fib by creating a new\n\t\t\t\t\t\t// thread to handle that calculation\n\t\t\t\t\t\tcase \"NEXTEVENFIB\":\n\t\t\t\t\t\t\tnew EvenFib(client).run();\n\t\t\t\t\t\t\t// Increments the fib index tracker so no duplicates\n\t\t\t\t\t\t\t// are sent\n\t\t\t\t\t\t\tServer.fib++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t// Calculates the next even nextLargerRan by creating a new\n\t\t\t\t\t\t// thread to handle that calculation\n\t\t\t\t\t\tcase \"NEXTLARGERRAND\":\n\t\t\t\t\t\t\tnew NextLargeRan(client).run();\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t// Calculates the next prime by creating a new\n\t\t\t\t\t\t// thread to handle that calculation\n\t\t\t\t\t\tcase \"NEXTPRIME\":\n\t\t\t\t\t\t\tnew NextPrime(client).run();\n\t\t\t\t\t\t\t// Increments the prime index tracker so no duplicates\n\t\t\t\t\t\t\t// are sent\n\t\t\t\t\t\t\tServer.prime++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t// Displays that the client it was connected to\n\t\t\t// has disconnected\n\t\t\tSystem.out.println(\"Client Disconnected\");\n\t\t}\n\n\t}", "private void returnToSender(ClientMessage m) {\n\n if (m.returnToSender) {\n // should never happen!\n // System.out.println(\"**** Returning to sender says EEK\");\n return;\n }\n\n // System.out.println(\"**** Returning to sender says her I go!\");\n m.returnToSender = true;\n forward(m, true);\n }", "public static void main(String[] args) throws IOException {\n DateFormat dateFormat = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss.SSS\");\n /*\n These variables are to print the details of client and server\n */\n InetAddress ipAddress = null;\n String hostname = null;\n String message = null;\n\n String serverHostname = new String(\"127.0.0.1\");\n int portNumberA = 10007;\n int portNumberB = 10008;\n\n /*\n This is to print the details of client and server\n */\n System.out.println(\"[CLIENT][\" + dateFormat.format(new Date()) + \"] - Initializing Simple Client\");\n ipAddress = InetAddress.getLocalHost();\n hostname = InetAddress.getLocalHost().getHostName();\n\n Socket echoSocketA = null;\n PrintWriter outA = null;\n BufferedReader inA = null;\n\n System.out.println(\"[CLIENT][\" + ipAddress + \"][\" + dateFormat.format(new Date()) + \"] - Attemping to connect to host \" + serverHostname + \" on port \" + portNumberA);\n try {\n echoSocketA = new Socket(serverHostname, portNumberA);\n outA = new PrintWriter(echoSocketA.getOutputStream(), true);\n inA = new BufferedReader(new InputStreamReader(\n echoSocketA.getInputStream()));\n } catch (UnknownHostException e) {\n System.err.println(\"[CLIENT][\" + ipAddress + \"][\" + dateFormat.format(new Date()) + \"] - Don't know about host: \" + serverHostname + \":\" + portNumberA);\n System.exit(1);\n } catch (IOException e) {\n System.err.println(\"[CLIENT][\" + ipAddress + \"][\" + dateFormat.format(new Date()) + \"] - Couldn't get I/O for the connection to: \" + serverHostname + \":\" + portNumberA);\n System.exit(1);\n }\n\n Socket echoSocketB = null;\n PrintWriter outB = null;\n BufferedReader inB = null;\n\n System.out.println(\"[CLIENT][\" + ipAddress + \"][\" + dateFormat.format(new Date()) + \"] - Attemping to connect to host \" + serverHostname + \" on port \" + portNumberB);\n try {\n echoSocketB = new Socket(serverHostname, portNumberB);\n outB = new PrintWriter(echoSocketB.getOutputStream(), true);\n inB = new BufferedReader(new InputStreamReader(\n echoSocketB.getInputStream()));\n } catch (UnknownHostException e) {\n System.err.println(\"[CLIENT][\" + ipAddress + \"][\" + dateFormat.format(new Date()) + \"] - Don't know about host: \" + serverHostname + \":\" + portNumberB);\n System.exit(1);\n } catch (IOException e) {\n System.err.println(\"[CLIENT][\" + ipAddress + \"][\" + dateFormat.format(new Date()) + \"] - Couldn't get I/O for the connection to: \" + serverHostname + \":\" + portNumberB);\n System.exit(1);\n }\n\n BufferedReader stdIn = new BufferedReader(\n new InputStreamReader(System.in));\n String userInput;\n\n System.out.print(\"[CLIENT][\" + ipAddress + \"][\" + dateFormat.format(new Date()) + \"] - Enter the message to send to \" + serverHostname + \":\" + portNumberA + \",\" + portNumberB + \": \");\n while ((userInput = stdIn.readLine()) != null) {\n outA.println(userInput);\n outB.println(userInput);\n System.out.println();\n System.out.println(\"[CLIENT][\" + ipAddress + \"][\" + dateFormat.format(new Date()) + \"] - Received \" + inA.readLine() + \" from \" + serverHostname + \":\" + portNumberA + \": \");\n System.out.println(\"[CLIENT][\" + ipAddress + \"][\" + dateFormat.format(new Date()) + \"] - Received \" + inB.readLine() + \" from \" + serverHostname + \":\" + portNumberB + \": \");\n System.out.print(\"[CLIENT][\" + ipAddress + \"][\" + dateFormat.format(new Date()) + \"] - Enter the message to send to \" + serverHostname + \":\" + portNumberA + \",\" + portNumberB + \": \");\n }\n\n outA.close();\n inA.close();\n outB.close();\n inB.close();\n stdIn.close();\n echoSocketA.close();\n echoSocketB.close();\n }", "@Override\n\t\t\tpublic void onlogicRes(long server_id) {\n\t\t\t\tif (gameState == GAME_STATE_TOPLIST) {\n\t\t\t\t\tUserRequest.getUser().ReqTopList(); // 排行榜请求\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t// case GAME_STATE_USER_VIEW://联网返回了发送好友到服务器\n\t\t\t\tIterator iterator = playerMap.keySet().iterator();\n\t\t\t\twhile (iterator.hasNext()) {\n\t\t\t\t\tFaceBookPlayer player = playerMap.get(iterator.next());\n\t\t\t\t\tif (player.getid_server() == FaceBookPlayer.L_NULL) { // 表示没付过id\n\t\t\t\t\t\t// 联网成功发送请求\n\t\t\t\t\t\tUserViewReq.request(http, 0, player.getId_facebook(), false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif(player != null && player.getOrderIndex() == FaceBookPlayer.I_NULL){\n\t\t\t\t\t\t// 联网成功发送请求\n\t\t\t\t\t\tUserViewReq.request(http, 0, player.getId_facebook(), false);\n\t\t\t\t\t \n\t\t\t\t}\n\t\t\t}", "protected void abcdefg(String host, byte[] buf) throws Exception {\n String clientId = hostmap.get(host);\n if (clientId == null) {\n NgrokAgent.httpResp(_out, 404, \"Tunnel \" + host + \" not found\");\n return;\n }\n NgrokServerClient client = clients.get(clientId);\n if (client == null) {\n NgrokAgent.httpResp(_out, 404, \"Tunnel \" + host + \" is Closed\");\n return;\n }\n ProxySocket proxySocket;\n try {\n proxySocket = client.getProxy(host);\n }\n catch (Exception e) {\n log.debug(\"Get ProxySocket FAIL host=\" + host, e);\n NgrokAgent.httpResp(_out,\n 500,\n \"Tunnel \" + host + \" did't has any proxy conntion yet!!\");\n return;\n }\n //sw.tag(\"After Get ProxySocket\");\n PipedStreamThread srv2loc = null;\n PipedStreamThread loc2srv = null;\n //NgrokAgent.writeMsg(proxySocket.socket.getOutputStream(), NgrokMsg.startProxy(\"http://\" + host, \"\"));\n //sw.tag(\"After Send Start Proxy\");\n proxySocket.socket.getOutputStream().write(buf);\n // 服务器-->本地\n srv2loc = new PipedStreamThread(\"http2proxy\",\n _ins,\n NgrokAgent.gzip_out(client.gzip_proxy,\n proxySocket.socket.getOutputStream()),\n bufSize);\n // 本地-->服务器\n loc2srv = new PipedStreamThread(\"proxy2http\",\n NgrokAgent.gzip_in(client.gzip_proxy,\n proxySocket.socket.getInputStream()),\n _out,\n bufSize);\n //sw.tag(\"After PipedStream Make\");\n //sw.stop();\n //log.debug(\"ProxyConn Timeline = \" + sw.toString());\n // 等待其中任意一个管道的关闭\n String exitFirst = executorService.invokeAny(Arrays.asList(srv2loc, loc2srv));\n if (log.isDebugEnabled())\n log.debug(\"proxy conn exit first at \" + exitFirst);\n }", "public void relay(ControlPacket pkt) {\n for(Client client : clients)\n if(client.getNumber() == pkt.getDestination())\n client.sendControlPacket(pkt);\n }", "@Override\n public void sendToProxy(String message) {\n }", "public static void sendResponse(Socket clientSocket, int imagecont) {\n\n\t\ttry{\n\t\t\n\t\t\tDataOutputStream out= new DataOutputStream(clientSocket.getOutputStream());\n\t\t\tout.writeUTF(\"ok\"+ Integer.toString(imagecont));\n\t\t\tSystem.out.println(\"Se ha enviado un ok\" + Integer.toString(imagecont));\n\t\t}\n\n\t\tcatch(Exception e) {\n\n\t\t\tSystem.out.println(\"Error: \" + e.toString());\n\t\t}\n\n\t\treturn;\n\t}", "@Override\n\tpublic void onClientMessage(ClientThread client, String msg) {\n\t\ttry {\n\t\t\tlockClients.readLock().lock();\n\t\t\tLocalDateTime now = LocalDateTime.now();\n\t\t\tString toSend = \"[\"+dtf.format(now)+\"] \"+client.getClientName()+\" : \"+msg;\n\t\t\tfor (ClientThread ct : this.clients) {\n\t\t\t\tct.sendMessage(toSend);\n\t\t\t}\n\t\t\taddToHistory(toSend);\n\t\t} finally {\n\t\t\tlockClients.readLock().unlock();\n\t\t}\n\t}", "void sendMessageToClient(long clientId, byte[] content, int prio) throws IOException, MlmqException;", "public void run() {\n\t\ttry { \n\t\t\tBufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n\t\t\tPrintWriter out = new PrintWriter(socket.getOutputStream(), true);\n\t\t\t \n\t\t\tString fromServer= null;\n\t\t\tString fromUser = null;\n\n\t\t\twhile(true){\n\t\t\t\t//If the user types \"BACKUP\" will make a file of the messages\n\t\t\t\tif ((fromUser = in.readLine()).equals(\"BACKUP\")){\n\t\t\t\t\tbuffer.add(\"BACKUP\");\n\t\t\t\t\tfor(int i = 0; i < buffer.size(); i++){\n\t\t\t\t\t\tout.println(buffer.get(i));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//put whatever the user input to the Server Buffer\n\t\t\t\tbuffer.add(fromUser);\n\n\t\t\t\t//Displaying the option menu\n\t\t\t\tSystem.out.print(\"\\n1. Send Message to all clients\\n\" +\n\t\t\t\t\t\"2. Print message from client\\n\" +\n\t\t\t\t\t\"3. Quit\\n\\n\" + \n\t\t\t\t\t\"Please choice 1, 2, or 3\\n\" +\n\t\t\t\t\t\"Choice: \");\n\t\t\t\tfromServer = stdIn.readLine();\n\t\t\t\tif(fromServer.equals(\"1\")){ \n\t\t\t\t\tout.println(buffer.lastElement());\n\t\t\t\t}\n\t\t\t\telse if(fromServer.equals(\"2\")){\n\t\t\t\t\tSystem.out.println(buffer.lastElement());\n\t\t\t\t}\n\t\t\t\telse if(fromServer.equals(\"3\")){\n\t\t\t\t\tSystem.out.println(\"\\nLeaving the program. Good Bye!\\n\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.println(\"Options 1~3 Please\");\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tLogger.dump(0, \"Client Exited by force quitting\");\n\t\t\tSystem.exit(1);\n\t\t} catch (NullPointerException e) {\n\t\t\tLogger.dump(0, \"Client Exited\");\n\t\t} \n\t}", "@Override\n public void receivedReply(final RequestTargetReply reply) {\n }", "private void psReplControllerSend(String data, String returnTag) throws IOException {\n String wrapped = \"(\" + RUNTIME_REPL_COMMUNICATION_INPUT_WRAPPER + \" \"\n + data + \" \\\"\" + returnTag + \"\\\")\";\n /* Kawa's REPL behaves nastily when you give it an input that has linebreaks\n * in it. It seems to echo those back and spits out a prompt for each new\n * line.So we avoid the multiple prompts by replacing all whitespace with spaces.\n * This will mess up if we want to get results that really do have whitespace\n * in them: We'll see them as spaces. Can we live with that as a documented\n * misfeature?\n */\n String noWhitespace = wrapped.replaceAll(\"\\\\s\", \" \");\n if (DEBUG) {\n System.out.println(\"Sending to phone: \" + noWhitespace);\n }\n // Note that this send can trigger an IOException\n boolean projectLoading = false;\n try {\n setSendingToPhone(true);\n if (returnTag.startsWith(REPL_PROJECT_LOADING)) {\n setWaitingForProjectLoad(true);\n projectLoading = true;\n }\n psReplController.send(noWhitespace);\n } catch (IOException e) {\n if (projectLoading) {\n setWaitingForProjectLoad(false);\n }\n throw e;\n } finally {\n setSendingToPhone(false);\n }\n }", "public void sendBack(SelectionKey key, String message) {\r\n\t\tsocketChannel = (SocketChannel) key.channel(); \r\n\t\tmessage += \"\\r\\n\";\r\n\t\tbuffer = CharBuffer.wrap(message);\r\n\t\twhile (buffer.hasRemaining()) {\r\n\t\t\ttry {\r\n\t\t\t\tsocketChannel.write(Charset.defaultCharset().encode(buffer));\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\tLong x = System.nanoTime();\r\n\t\tserviceTime = x - pollTime;\r\n\t\tresponseTime = x - currentJob.queueEntranceTime;\r\n\t\ttimeInSystem = x - currentJob.timeOfArrival;\r\n\t\t\r\n\t\ttimes.add(myNumber + \"\\t\" + type + \"\\t\" + queueTime + \"\\t\" + workerTime +\"\\t\" + processingTime +\"\\t\" + serviceTime +\"\\t\" + responseTime +\"\\t\" + timeInSystem );\r\n\t\tnumOfRequests.incrementAndGet();\r\n\t\tmyNumOfRequests++;\r\n\t}", "public static void main(String[] args) {\n try {\n String servhostname=\"localhost\";\n //String servhostname=\"133.14.44.133\";//ここに隣の人のアドレスを入れる。\n\n InetAddress serverAddress = InetAddress.getByName(servhostname);\n String message=\"abc\";\n byte[] bytesToSend = message.getBytes();\n\n System.out.println(\"sending msg is \"+message);\n //int serverPort = Integer.parseInt(portnumstr);\n int serverPort = 5000;\n DatagramSocket socket = new DatagramSocket();\n DatagramPacket sendPacket = new DatagramPacket(bytesToSend, bytesToSend.length, serverAddress, serverPort);\n socket.send(sendPacket);\n socket.close();\n\n } catch (UnknownHostException e) {\n e.printStackTrace();\n } catch (SocketException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }//try catch end\n\n\n try {\n final int DMAX = 15;\n\n int serverPort = 5001;\n System.out.println(\"UDP client is waiting replay at \" + serverPort);\n DatagramSocket socket = new DatagramSocket(serverPort);\n DatagramPacket receivePacket = new DatagramPacket(\n new byte[DMAX], DMAX);\n\n socket.receive(receivePacket);\n String replaymessage=new String(receivePacket.getData());\n System.out.println(\"Receiced Packet Message is \"\n +replaymessage );\n\n socket.close();\n\n } catch (UnknownHostException e) {\n e.printStackTrace();\n } catch (SocketException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }//try end\n\n\n\n\n\n\n }", "private void sendMsgToClient(String msg) {\n controlOutWriter.println(msg);\n }", "private void send()\n {\n\n\tRouterPacket pkt;\n if(poisonEnabled){\n\t // Create a false distance table\n int[] tmpDistTable = new int[RouterSimulator.NUM_NODES];\n System.arraycopy(myDistTable,0,tmpDistTable,0,RouterSimulator.NUM_NODES);\n for(int i = 0;i<neighbours.length;i++){\n if(neighbours[i]){\n\t\t //Poisoned reverse\n for(int j = 0;j<route.length;j++){\n\t\t\t// All routes that goes through my node, set to infinity\n if(route[j] == i && j!=i){\n tmpDistTable[j] = RouterSimulator.INFINITY;\n }\n }\n\t\t // Send new packet\n pkt = new RouterPacket(myID,i,tmpDistTable);\n sendUpdate(pkt);\n }\n }\n } else {\n for (int i = 0; i < neighbours.length; i++) {\n if (neighbours[i]) {\n\t\t // Send new packet\n pkt = new RouterPacket(myID, i, myDistTable);\n sendUpdate(pkt);\n }\n }\n }\n\n\n }", "Object routeMessage(Message message) throws IOException;", "private void sendReply(Integer toID) {\n restTemplate.postForObject(\n config.getConfigNodeInfos().get(toID).getNodeURL() + \"/message/reply\",\n new ReplyMessage(updateAndGetLTS(null), nodeID),\n String.class);\n }", "@SuppressWarnings(\"unchecked\")\r\n\tpublic void run() {\r\n\t\t//prendo gli streams per comunicare con il server\r\n\t\tDataOutputStream writer = ClientMain.WRITER;\r\n\t\tDataInputStream reader = ClientMain.READER;\r\n\t\t\r\n\t\t//creo la richiesta di look up\r\n\t\tJSONObject request = new JSONObject();\r\n\t\trequest.put(\"OP\", \"LOOKUP\");\r\n\t\trequest.put(\"ID\", nickname);\r\n\t\t\t\t\r\n\t\t//variabili per gestire la riposta del server\r\n\t\tString response = null;\r\n\t\tJSONObject responseJSON = null;\r\n\t\t\t\t\t\t\t\t\r\n\t\ttry {\r\n\t\t\t//mando la richiesta\r\n\t\t\twriter.writeUTF(request.toJSONString());\r\n\t\t\twriter.flush();\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t//ricevo la risposta\r\n\t\t\tresponse = reader.readUTF();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t//trasformo in formato JSON la risposta ricevuta dal server\r\n\t\t\tresponseJSON = \t(JSONObject) new JSONParser().parse(response);\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\t//se c'è qualche problema di comunicazione con il server\r\n\t\t\t//o se non è possibile parsare il messaggio ricevuto\r\n\t\t\te.printStackTrace();\r\n\t\t\t//termino il client\r\n\t\t\tClientMain.cleanUp();\r\n\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\r\n\t\t//controllo l'esito della risposta\r\n\t\tOperations esito = Operations.valueOf((String) responseJSON.get(\"OP\"));\r\n\t\tif (esito==Operations.OP_OK) {\r\n\t\t\t//prendo il responso della ricerca\r\n\t\t\tString msg = (String) responseJSON.get (\"MSG\");\r\n\t\t\t\t\t\t\t\r\n\t\t\t//apro l'interfaccia grafica per comunicare l'errore\r\n\t\t\tResponseGUI responseGUI = new ResponseGUI(msg);\r\n\t\t\tresponseGUI.setVisible(true);\r\n\t\t}\r\n\t\telse {\r\n\t\t\t//prendo il messaggio di errore trasmesso dal server\r\n\t\t\tString msgErr = (String) responseJSON.get (\"MSG\");\r\n\t\t\t\t\t\t\t\r\n\t\t\t//apro l'interfaccia grafica per comunicare l'errore\r\n\t\t\tResponseGUI responseGUI = new ResponseGUI(msgErr);\r\n\t\t\tresponseGUI.setVisible(true);\r\n\t\t}\r\n\t}", "public void forwardResponse(int dest, String file) throws UnknownHostException, SocketException, IOException {\n InetAddress IPAddress = InetAddress.getByName(\"127.0.0.1\");\n\n // Canal de comunicação não orientado à conexão\n //DatagramSocket serverSocket = new DatagramSocket();\n\n // Montando a mensagem a ser enviada\n String msg = file + \"#\" + this.getClient() + \"#\" + this.getTtl();\n\n // Preenche o buffer de envio\n final byte[] sendData = msg.getBytes();\n\n // Montando o pacote com o offset do tamanho do nome do arquivo.\n DatagramPacket sendPacket \n = new DatagramPacket(sendData, sendData.length,\n IPAddress, dest);\n\n this.getServerSocket().send(sendPacket);\n\n // Reseta o ttl para o Peer em questao\n //this.setTtl(Peer.TTLREFERENCE);\n }", "public void sendMessage2Client(String msg){\n\t\t\t\n\t\t\toutPrintStream.println(msg);\n\t\t\t\n\t\t}", "interface NotifyClient extends Remote {\n\n\t/**\n\t * An identity has been assigned to this node.\n\t * \n\t * @param id\n\t * the identity\n\t * @param oldNode\n\t * the last node the identity was assigned to, or {@code null} if\n\t * this is a new node assignment\n\t * @throws IOException\n\t * if there is a communication problem\n\t */\n\tvoid added(Identity id, Node oldNode) throws IOException;\n\n\t/**\n\t * \n\t * An identity has been removed from this node.\n\t * \n\t * @param id\n\t * the identity\n\t * @param newNode\n\t * the new node the identity is assigned to, or {@code null} if\n\t * the identity is being removed from the map\n\t * @throws IOException\n\t * if there is a communication problem\n\t */\n\tvoid removed(Identity id, Node newNode) throws IOException;\n\n\t/**\n\t * An identity has been selected for relocation from this node.\n\t * \n\t * @param id\n\t * the identity\n\t * @param newNodeId\n\t * the ID of the new node the identity will be relocated to\n\t * @throws IOException\n\t * if there is a communication problem\n\t */\n\tvoid prepareRelocate(Identity id, long newNodeId) throws IOException;\n}", "public void handleMessageFromClient(Object msg) {\n\n }", "void responseSent( C conn ) ;", "private void sendClientMessage() throws IOException {\n ArrayList<ByteString> blindedFriends = Crypto.byteArraysToStrings(mClientPSI.encodeBlindedItems());\n ClientMessage cm = new ClientMessage.Builder()\n .messages(getMessages())\n .blindedFriends(blindedFriends)\n .build();\n boolean success = lengthValueWrite(out, cm);\n if (!success) {\n setExchangeStatus(Status.ERROR);\n setErrorMessage(\"Length/value write of client message failed.\");\n throw new IOException(\"Length/value write of client message failed, but exception is hidden (see Exchange.java)\");\n }\n }", "public void messageFromController(MidiMessage message, boolean interceptedForInternalUse, boolean routedToSynth)\n {\n return; \n }", "private void processPacket(DatagramPacket packet) {\n String data = new String(packet.getData());\n if (data.startsWith(\"/c/\")) {\n int ID = UniqueIdentifier.getIdentifier();\n clients.add(new ServerClient(data.split(\"/c/|/e/\")[1], packet.getAddress(), packet.getPort(), ID));\n System.out.println(\"Client connected with the name: '\" + data.split(\"/c/|/e/\")[1] + \"' @ \" + packet.getAddress() + \":\" + packet.getPort() + \" and is now using the ID: \" + ID);\n send((\"/c/\" + ID + \"/e/\").getBytes(), packet.getAddress(), packet.getPort());\n } else if (data.startsWith(\"/d/\")) {\n disconnect(Integer.parseInt(data.split(\"/d/|/e/\")[1]), true);\n } else if (data.startsWith(\"/sa/\")) {\n sendToAll((\"/m/\" + data.split(\"/sa/|/e/\")[1] + \"/e/\").getBytes());\n } else if (data.startsWith(\"/s/\")) { //TODO - FIX INDIVIDUAL PACKET SENDING\n String decodedData = data.split(\"/s/|/e/\")[1];\n String targetID = decodedData;\n targetID = targetID.substring(targetID.indexOf(\"&\") + 1);\n targetID = targetID.substring(0, targetID.indexOf(\"&\"));\n int id = Integer.parseInt(targetID);\n decodedData = decodedData.replace(\"&\" + id + \"&\", \"\");\n ServerClient targetClient = null;\n for (ServerClient item : clients) {\n if (item.getID() == id) {\n targetClient = item;\n break;\n }\n }\n assert targetClient != null;\n send(decodedData.getBytes(), targetClient.getAddress(), targetClient.getPort());\n } else if (data.startsWith(\"/p/\")) {\n clientResponse.add(Integer.parseInt(data.split(\"/p/|/e/\")[1]));\n } else if (data.startsWith(\"/dp/\")) {\n sendToAll(data.substring(0, data.length() - 3).getBytes());\n } else {\n System.out.println(packet.getAddress() + \":\" + packet.getPort() + \" sent an unknown packet: \" + data);\n }\n }" ]
[ "0.6287095", "0.61883944", "0.58681005", "0.5756466", "0.5642758", "0.55003303", "0.5425889", "0.54197204", "0.54157615", "0.539301", "0.5386787", "0.5378284", "0.5373648", "0.5364226", "0.53583616", "0.5349015", "0.5313908", "0.5293643", "0.52928853", "0.52621347", "0.5247895", "0.5238297", "0.5234181", "0.52266836", "0.5200123", "0.519221", "0.51618713", "0.5158873", "0.5158834", "0.515619", "0.5154587", "0.51493186", "0.51454365", "0.5138605", "0.5128399", "0.5128377", "0.5121428", "0.51182586", "0.5103931", "0.51006037", "0.5095131", "0.50910324", "0.50772035", "0.5075825", "0.50679713", "0.50664246", "0.50633717", "0.5058501", "0.5046431", "0.5042423", "0.50420433", "0.5037683", "0.5032239", "0.50275517", "0.50258756", "0.50258577", "0.5022753", "0.50225884", "0.5021296", "0.5017739", "0.50148016", "0.5011742", "0.5010397", "0.5009753", "0.50050503", "0.500164", "0.4998018", "0.49943385", "0.4993195", "0.49927416", "0.4974821", "0.49747488", "0.49730614", "0.4969992", "0.49657992", "0.49653226", "0.4964798", "0.49501175", "0.494949", "0.49469298", "0.49383906", "0.493271", "0.49299145", "0.4929769", "0.4928141", "0.4925339", "0.49219573", "0.49212143", "0.49206105", "0.4918713", "0.49130756", "0.49099883", "0.49081388", "0.49039376", "0.49000028", "0.48943716", "0.48840523", "0.48742637", "0.48715207", "0.48676783" ]
0.57160765
4
No arg constructor, denne constructor giver Media objectet et assetID og en dato for skabelsen af objectet.
public Media() { assetId = MediaID.generate(); created = Date.from(Instant.now()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Media() {\n\t}", "private Asset() {\r\n super(IAsset.TYPE_ID);\r\n }", "public HrCmsMedia() {\n this(\"hr_cms_media\", null);\n }", "public NewDigitalMediaObject() {\n this(DSL.name(\"new_digital_media_object\"), null);\n }", "private Media(Element media)\n\t\t{\n\t\t\tthis.mediaElement = media;\n\t\t}", "public SieteYMedia(){\r\n\t\ttitle = \"Siete y Media v1.0\";\r\n\t\twidth = 1024;\r\n\t\theight = 748;\r\n\t}", "public MediaItemBase(org.semanticwb.platform.SemanticObject base)\r\n {\r\n super(base);\r\n }", "public Media(String url) {\n\t\tthis.url = url;\n\t}", "@Override\n public String toString() {\n return \"Media{\" +\n \"assetId=\" + assetId +\n \", name='\" + name + '\\'' +\n \", created=\" + created +\n \", fileName='\" + fileName + '\\'' +\n '}';\n }", "public Media(String title, String year){\n\t\tthis.title = title;\n\t\tthis.year = year;\n\t}", "protected VideoData() {}", "public HrCmsMedia(String alias) {\n this(alias, HR_CMS_MEDIA);\n }", "public abstract MediaItem getMediaItem(String id);", "public EAsset() {\n this(DSL.name(\"E_ASSET\"), null);\n }", "public Media(String label, String url) {\n\t\tthis.label = new Label(label, null);\n\t\tthis.url = url;\n\t}", "public Video( ) { \n\t\tsuper( );\n\t}", "public Video() {\n\t}", "public CalculoMedia() {\n initComponents();\n \n }", "Media getMedia(long mediaId);", "public static Media createEntity(EntityManager em) {\n Media media = new Media().fileName(DEFAULT_FILE_NAME).fileType(DEFAULT_FILE_TYPE).fileDesc(DEFAULT_FILE_DESC);\n return media;\n }", "public NewDigitalMediaObject(Name alias) {\n this(alias, NEW_DIGITAL_MEDIA_OBJECT);\n }", "public TAssetsDeviceRecord() {\n super(TAssetsDevice.T_ASSETS_DEVICE);\n }", "public Video( int arg1 ) { \n\t\tsuper( );\n\t}", "public DcMediaModule(XmlModule module) {\n super(module);\n }", "public SongRecord(){\n\t}", "public Photo() {\n super();\n }", "public EAsset(Name alias) {\n this(alias, E_ASSET);\n }", "public AmusementsObject(int imageId_A, int imageId_B,String amusementActivityName,\r\n String amusementActivityDescription, Uri amusementActivityWebsite){\r\n\r\n amusementObjectImageA = 0;\r\n amusementObjectImageB = 0;\r\n amusementObjectTitle = \"\";\r\n amusementObjectDesscription = \"\";\r\n amusementObjectWebsite = null;\r\n\r\n amusementObjectImageA = imageId_A;\r\n amusementObjectImageB = imageId_B;\r\n amusementObjectTitle = amusementActivityName;\r\n amusementObjectDesscription = amusementActivityDescription;\r\n amusementObjectWebsite = amusementActivityWebsite;\r\n }", "public Song() {}", "public Video( int arg1, int arg2 ) { \n\t\tsuper( );\n\t}", "public VideoMaterial(VideoMaterial source) {\n if (source.MetaData != null) {\n this.MetaData = new MediaMetaData(source.MetaData);\n }\n if (source.ImageSpriteInfo != null) {\n this.ImageSpriteInfo = new MediaImageSpriteInfo(source.ImageSpriteInfo);\n }\n if (source.MaterialUrl != null) {\n this.MaterialUrl = new String(source.MaterialUrl);\n }\n if (source.CoverUrl != null) {\n this.CoverUrl = new String(source.CoverUrl);\n }\n if (source.Resolution != null) {\n this.Resolution = new String(source.Resolution);\n }\n if (source.MaterialStatus != null) {\n this.MaterialStatus = new MaterialStatus(source.MaterialStatus);\n }\n if (source.OriginalUrl != null) {\n this.OriginalUrl = new String(source.OriginalUrl);\n }\n if (source.VodFileId != null) {\n this.VodFileId = new String(source.VodFileId);\n }\n }", "public ImageContent() {\n }", "public void importMedia(){\r\n \r\n }", "public Media(String label, String url, String type) {\n\t\tthis.label = new Label(label, null);\n\t\tthis.url = url;\n\t\tthis.type = type;\n\t}", "private Movie(Parcel in) {\n mId = in.readString();\n mTitle = in.readString();\n mOverview = in.readString();\n mReleaseDate = in.readString();\n mRate = in.readString();\n mPosterPath = in.readString();\n mRuntime = in.readString();\n mPosterImg = new byte[in.readInt()];\n in.readByteArray(mPosterImg);\n }", "@Override\n public Media getMediaById(int id) {\n try {\n return mediaDao.getMediaById(id);\n } catch (ObjectNotFoundException e) {\n throw new RuntimeException(String.format(\"Media instance with id=%s not found\", id));\n } catch (FailedOperationException e) {\n throw new RuntimeException(e.getMessage());\n }\n }", "public Album(Parcel in) {\n\t\tID = in.readInt();\n\t\tname = in.readString();\n\t\trelease = new Date(in.readLong());\n\t\tmbid = in.readString();\n\t\turl = in.readString();\n\t\timg_small = in.readString();\n\t\timg_medium = in.readString();\n\t\timg_large = in.readString();\n\t\timg_xlarge = in.readString();\n\t\tisNew = (in.readInt() == 1) ? true : false;\n\t\tisStarred = (in.readInt() == 1) ? true : false;\n\t\tartist = in.readParcelable(this.getClass().getClassLoader());\n\t}", "public MediaFile(String name, String path, int audiobitrate, int videobitrate) {\n this.name = name;\n this.path = path;\n this.audiobitrate = audiobitrate;\n this.videobitrate = videobitrate;\n }", "public Video(String nombre) {\n super(nombre);\n }", "public DashMediaSource createMediaSource(MediaItem mediaItem) {\n long l10;\n ParsingLoadable$Parser parsingLoadable$Parser;\n Object object;\n boolean bl2;\n List list;\n boolean bl3;\n DashMediaSource$Factory dashMediaSource$Factory = this;\n Object object2 = mediaItem;\n Assertions.checkNotNull(mediaItem.playbackProperties);\n Object object3 = this.manifestParser;\n if (object3 == null) {\n object3 = new DashManifestParser();\n }\n if (!(bl3 = (list = (bl2 = (list = object2.playbackProperties.streamKeys).isEmpty()) ? dashMediaSource$Factory.streamKeys : object2.playbackProperties.streamKeys).isEmpty())) {\n object = new FilteringManifestParser((ParsingLoadable$Parser)object3, list);\n parsingLoadable$Parser = object;\n } else {\n parsingLoadable$Parser = object3;\n }\n object3 = ((MediaItem)object2).playbackProperties;\n object = ((MediaItem$PlaybackProperties)object3).tag;\n boolean bl4 = true;\n Object object4 = null;\n if (object == null && (object = dashMediaSource$Factory.tag) != null) {\n bl3 = bl4;\n } else {\n bl3 = false;\n object = null;\n }\n object3 = ((MediaItem$PlaybackProperties)object3).streamKeys;\n boolean bl5 = object3.isEmpty();\n if (bl5 && !(bl5 = list.isEmpty())) {\n bl5 = bl4;\n } else {\n bl5 = false;\n object3 = null;\n }\n MediaItem$LiveConfiguration mediaItem$LiveConfiguration = ((MediaItem)object2).liveConfiguration;\n long l11 = mediaItem$LiveConfiguration.targetOffsetMs;\n long l12 = -9223372036854775807L;\n long l13 = l11 == l12 ? 0 : (l11 < l12 ? -1 : 1);\n if (l13 != false || (l13 = (l10 = (l11 = dashMediaSource$Factory.targetLiveOffsetOverrideMs) - l12) == 0L ? 0 : (l10 < 0L ? -1 : 1)) == false) {\n bl4 = false;\n }\n if (bl3 || bl5 || bl4) {\n object2 = mediaItem.buildUpon();\n if (bl3) {\n object = dashMediaSource$Factory.tag;\n ((MediaItem$Builder)object2).setTag(object);\n }\n if (bl5) {\n ((MediaItem$Builder)object2).setStreamKeys(list);\n }\n if (bl4) {\n long l14 = dashMediaSource$Factory.targetLiveOffsetOverrideMs;\n ((MediaItem$Builder)object2).setLiveTargetOffsetMs(l14);\n }\n object2 = ((MediaItem$Builder)object2).build();\n }\n object4 = object2;\n DataSource$Factory dataSource$Factory = dashMediaSource$Factory.manifestDataSourceFactory;\n DashChunkSource$Factory dashChunkSource$Factory = dashMediaSource$Factory.chunkSourceFactory;\n CompositeSequenceableLoaderFactory compositeSequenceableLoaderFactory = dashMediaSource$Factory.compositeSequenceableLoaderFactory;\n DrmSessionManager drmSessionManager = dashMediaSource$Factory.drmSessionManagerProvider.get((MediaItem)object4);\n LoadErrorHandlingPolicy loadErrorHandlingPolicy = dashMediaSource$Factory.loadErrorHandlingPolicy;\n long l15 = dashMediaSource$Factory.fallbackTargetLiveOffsetMs;\n return new DashMediaSource((MediaItem)object4, null, dataSource$Factory, parsingLoadable$Parser, dashChunkSource$Factory, compositeSequenceableLoaderFactory, drmSessionManager, loadErrorHandlingPolicy, l15, null);\n }", "public FileDicomBaseInner() {}", "public AudioList(){}", "public MediaImageSpriteItem(MediaImageSpriteItem source) {\n if (source.Definition != null) {\n this.Definition = new Long(source.Definition);\n }\n if (source.Height != null) {\n this.Height = new Long(source.Height);\n }\n if (source.Width != null) {\n this.Width = new Long(source.Width);\n }\n if (source.TotalCount != null) {\n this.TotalCount = new Long(source.TotalCount);\n }\n if (source.ImagePathSet != null) {\n this.ImagePathSet = new String[source.ImagePathSet.length];\n for (int i = 0; i < source.ImagePathSet.length; i++) {\n this.ImagePathSet[i] = new String(source.ImagePathSet[i]);\n }\n }\n if (source.WebVttPath != null) {\n this.WebVttPath = new String(source.WebVttPath);\n }\n if (source.Storage != null) {\n this.Storage = new TaskOutputStorage(source.Storage);\n }\n }", "public MediaCell(Media media)\n\t{\n\t\tsuper(new File(media.getJacket()), (media instanceof SeriesEpisode) ? \"S\"+((SeriesEpisode)media).getSeasonNumber() + \"E\" + ((SeriesEpisode)media).getEpisodeNumber() + \" \" +media.getName() : media.getName());\n\t\t_media = media;\n\t\t_type = Type.MEDIA;\n\t}", "private void prepareMediaPlayer(int id) {\n if (mediaPlayer != null) {\n mediaPlayer.stop();\n mediaPlayer.release();\n }\n mediaPlayer = MediaPlayer.create(this, id);\n mediaPlayer.start();\n if (true)\n return;\n mediaPlayer = new MediaPlayer();\n\n AssetFileDescriptor fileDescriptor = getResources().openRawResourceFd(id);\n try {\n mediaPlayer.stop();\n mediaPlayer.setDataSource(fileDescriptor.getFileDescriptor(),\n fileDescriptor.getStartOffset(), fileDescriptor.getLength());\n fileDescriptor.close();\n mediaPlayer.prepare();\n mediaPlayer.start();\n } catch (Exception e) {\n Log.e(\"Main\", \"On Error: \" + e.getMessage());\n }\n }", "public NewDigitalMediaObject(String alias) {\n this(DSL.name(alias), NEW_DIGITAL_MEDIA_OBJECT);\n }", "public FileObject() {\n\t}", "public Material() {}", "public Music()\n {\n this(0, \"\", \"\", \"\", \"\", \"\");\n }", "abstract public MediaFile getMainFile();", "public Media addNewMedia(String id)\n\t\t{\n\t\t\tElement mediaElement = document.createElement(MEDIA_ELEMENT_NAME);\n\t\t\tMedia media = new Media(mediaElement);\n\t\t\tmedia.setId(id);\n\n\t\t\tendpointElement.appendChild(mediaElement);\n\t\t\tmediasList.add(media);\n\n\t\t\treturn media;\n\t\t}", "public Gallery() {\r\n }", "public Sound(Context context) {\r\n\t\tthis.mp = MediaPlayer.create(context, R.raw.baby);\r\n\t\r\n\t}", "public AudioFragment() {\n }", "public PurchaseRequestAttachmentContent() {\r\n }", "public /*@NonNull*/ String getMediaId() {\n return mId;\n }", "private Audio() {}", "public DcMediaModule(int index, \n boolean topModule,\n String name,\n String description,\n String objectName,\n String objectNamePlural,\n String tableName,\n String tableShortName) {\n \n super(index, topModule, name, description, objectName, objectNamePlural, \n tableName, tableShortName);\n }", "public VideoDetails(VideoTeaser obj)\n {\n super(obj);\n }", "public EAsset(String alias) {\n this(DSL.name(alias), E_ASSET);\n }", "Builder addAssociatedMedia(MediaObject value);", "public WritableMp3File() {\n super();\n // TODO Auto-generated constructor stub\n }", "public Photo(String fileName){\n\tthis.fileName=fileName;\n}", "public DVD()\n\t{\n\n\t}", "public interface IMedia extends Parcelable {\n\n enum Type {\n MOVIE(\"movie\"), TV(\"tv\");\n\n private String name;\n\n Type(String name) {\n this.name = name;\n }\n\n @Override\n public String toString() {\n return name;\n }\n }\n\n String getBackdropPath();\n\n int[] getGenreIds();\n\n Genre[] getGenres();\n\n long getId();\n\n String getOriginalTitle();\n\n String getTitle();\n\n String getOverview();\n\n String getReleaseDate();\n\n String getPosterPath();\n\n String getHomePage();\n\n float getPopularity();\n\n boolean isVideo();\n\n float getVoteAverage();\n\n int getVoteCount();\n\n VideosResponse getVideos();\n\n Type getType();\n\n Creator<IMedia> CREATOR = new Creator<IMedia>() {\n @Override\n public IMedia createFromParcel(Parcel parcel) {\n String type = parcel.readString();\n if(Type.MOVIE.name.equals(type)){\n return Movie.CREATOR.createFromParcel(parcel);\n }else{\n return TV.CREATOR.createFromParcel(parcel);\n }\n }\n\n @Override\n public IMedia[] newArray(int i) {\n return new IMedia[i];\n }\n };\n\n}", "@NonNull\n @Override\n public Loader<Cursor> onCreateLoader(int id, @Nullable Bundle args) {\n return new CursorLoader(getActivity().getApplicationContext()\n ,MediaStore.Audio.Media.getContentUri(\"external\")\n ,null\n ,null\n ,null\n ,null);\n }", "public Track() {\r\n }", "public Album() {\n }", "public DBEpisode() {}", "public Video(long id,\n String title,\n long duration,\n String contentType,\n String dataUrl) {\n this.id = id;\n this.title = title;\n this.duration = duration;\n this.contentType = contentType;\n this.dataUrl = dataUrl;\n }", "public PurchaseRequestAttachmentContent(Integer id) {\r\n super(id);\r\n }", "public FileBean(){\r\n\t\tmedia = null;\r\n\t\tlocation = new SimpleStringProperty();\r\n\t\tsongName = new SimpleStringProperty();\r\n\t\talbum = new SimpleStringProperty();\r\n\t\tartist = new SimpleStringProperty();\r\n\t\turl = new SimpleStringProperty();\r\n\t\t\r\n\t\t/**\r\n\t\t * must initialize with a number because this field will be called\r\n\t\t * before the MediaPlayer's status has changed which would cause a \r\n\t\t * null pointer exception to be thrown if not initialized\r\n\t\t */\r\n\t\tduration = new SimpleStringProperty(\"0.0\");\r\n\t\t\r\n//\t\tduration.addListener(this);\r\n\t}", "public Mitarbeit() {\r\n }", "public Photo() {\n\t\tthis(UUID.randomUUID().toString() + \".jpg\");\n\t}", "public Picture(String fileName)\n {\n // let the parent class handle this fileName\n super(fileName);\n }", "public Picture(String fileName)\n {\n // let the parent class handle this fileName\n super(fileName);\n }", "public Digital(int id, String title, String description, String image, String author, Date timePost, String shortDes) {\n this.id = id;\n this.title = title;\n this.description = description;\n this.image = image;\n this.author = author;\n this.timePost = timePost;\n this.shortDes = shortDes;\n }", "public MultiMedia(String title,\n int year, List<Director> directorsList,\n List<Actors> actorsList) {\n\n this.title = title;\n this.year = year;\n this.directorsList = directorsList;\n this.actorsList = actorsList;\n\n }", "public Html5Video(String id, IModel<List<MediaSource>> model)\n\t{\n\t\tsuper(id, model);\n\t}", "public TrackMetaData(final String id, final String parentId, final String res, final String streamContent, final String albumArtUri, final String title,\n final String upnpClass, final String creator, final String album, final String albumArtist) {\n this.id = id;\n this.parentId = parentId;\n resource = res;\n this.streamContent = streamContent;\n this.albumArtUri = albumArtUri;\n this.title = title;\n this.upnpClass = upnpClass;\n this.creator = creator;\n this.album = album;\n this.albumArtist = albumArtist;\n }", "public MusicOpenDetail(MusicOpenDetail source) {\n if (source.MusicId != null) {\n this.MusicId = new String(source.MusicId);\n }\n if (source.AlbumName != null) {\n this.AlbumName = new String(source.AlbumName);\n }\n if (source.AlbumImageUrl != null) {\n this.AlbumImageUrl = new String(source.AlbumImageUrl);\n }\n if (source.MusicName != null) {\n this.MusicName = new String(source.MusicName);\n }\n if (source.MusicImageUrl != null) {\n this.MusicImageUrl = new String(source.MusicImageUrl);\n }\n if (source.Singers != null) {\n this.Singers = new String[source.Singers.length];\n for (int i = 0; i < source.Singers.length; i++) {\n this.Singers[i] = new String(source.Singers[i]);\n }\n }\n if (source.Duration != null) {\n this.Duration = new Long(source.Duration);\n }\n if (source.Tags != null) {\n this.Tags = new String[source.Tags.length];\n for (int i = 0; i < source.Tags.length; i++) {\n this.Tags[i] = new String(source.Tags[i]);\n }\n }\n if (source.LyricUrl != null) {\n this.LyricUrl = new String(source.LyricUrl);\n }\n if (source.WaveformUrl != null) {\n this.WaveformUrl = new String(source.WaveformUrl);\n }\n }", "public void setMedia(JRMediaObject mediaObject) {\n if (mMedia == null)\n mMedia = new ArrayList<JRMediaObject>();\n mMedia.add(mediaObject);\n }", "public CheckedOutMedia(Media media, Member member, Date dueDate) {\r\n\t\tsuper();\r\n\t\tsetMedia(media);\r\n\t\tsetMember(member);\r\n\t\tsetDueDate(dueDate);\r\n\t}", "@Override\n\tpublic DAOIncidencias CrearInformesMedicos() {\n\t\treturn null;\n\t}", "com.google.ads.googleads.v6.resources.MediaFile getMediaFile();", "public void setMedia(String m) {\n\t\tmedia = m;\n\t}", "public RatingContainer(Media media) {\n this(media, true);\n }", "public Imagen(){\n \n }", "private FSArquivo(Construtor construtor) {\n nome = construtor.nome;\n tipoMedia = construtor.tipoMedia;\n base = construtor.base;\n prefixo = construtor.prefixo;\n sufixo = construtor.sufixo;\n }", "public VideoIntroduction() {\n\n }", "@DISPID(1093) //= 0x445. The runtime will prefer the VTID if present\n @VTID(13)\n void media(\n java.lang.String p);", "public AlbumSeriesRecord() {\n super(AlbumSeries.ALBUM_SERIES);\n }", "public Value(MusicFile musicFile){\n this.musicFile = musicFile;\n }", "public S_RESOURCEObj() {\r\n }", "public FileBean(File file) throws FileNotFoundException, UnsupportedEncodingException{\r\n\t\tlocation = new SimpleStringProperty();\r\n\t\tsongName = new SimpleStringProperty();\r\n\t\talbum = new SimpleStringProperty();\r\n\t\tartist = new SimpleStringProperty();\r\n\t\turl = new SimpleStringProperty();\r\n\t\t\r\n\t\t/**\r\n\t\t * must initialize with a number because this field will be called\r\n\t\t * before the MediaPlayer's status has changed which would cause a \r\n\t\t * null pointer exception to be thrown if not initialized\r\n\t\t */\r\n\t\tduration = new SimpleStringProperty(\"0.0\");\r\n\t\tlocation.set(file.getAbsolutePath().replace(\"\\\\\", \"/\"));\r\n\t\t\r\n\t\t/*\r\n\t\t * encode all special characters.\r\n\t\t * URLEncoder puts a '+' where a ' ' is so change all '+' to encoded space '%20'.\r\n\t\t */\r\n\t\turl.set(\"file:///\" + URLEncoder.encode(location.get(), \"UTF-8\").replace(\"+\", \"%20\"));\r\n\t\t\r\n\t\t/*\r\n\t\t * Could not easily figure out how to set an action event for when the Media\r\n\t\t * object is done loading. Using the MediaPlayer status change event instead.\r\n\t\t * Looking for a better option\r\n\t\t */\r\n\t\tmedia = new Media(url.get());\r\n//\t\tmedia.getMetadata().addListener(new SetMetaData());\r\n\t\tthis.player = new MediaPlayer(media);\r\n//\t\ttempPlayer.setOnReady(new OnMediaReadyEvent());\r\n\t\tsetDefaultSongNameAndArtist();\r\n\t}", "public Content() {\n\t}", "public MediaPlayerContainer(String filePath, Image icon) {\n\n javax.swing.SwingUtilities.updateComponentTreeUI(this);\n \n /*\n try\n {\n for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {\n if (\"Nimbus\".equals(info.getName())) {\n javax.swing.UIManager.setLookAndFeel(info.getClassName());\n javax.swing.UIManager.getLookAndFeelDefaults().put(\"nimbusOrange\", (new Color(getRandomColorNumber(), \n getRandomColorNumber(), \n getRandomColorNumber())));\n break;\n }\n }\n } catch (ClassNotFoundException ex) {\n java.util.logging.Logger.getLogger(MediaManagerUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (InstantiationException ex) {\n java.util.logging.Logger.getLogger(MediaManagerUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (IllegalAccessException ex) {\n java.util.logging.Logger.getLogger(MediaManagerUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n } catch (javax.swing.UnsupportedLookAndFeelException ex) {\n java.util.logging.Logger.getLogger(MediaManagerUI.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);\n }\n */\n \n imageIcon = icon;\n \n initComponents();\n \n setAdditionalUI(filePath);\n }", "public Media(String title, int copiesAvailable){\n\t\tthis.title = title;\n\t\tthis.copiesAvailable = copiesAvailable;\n\n\t}", "private Assets (){}", "private MediaSource createMediaSource(){\n DataSource.Factory dataSourceFactory = new DefaultDataSourceFactory(mcontainer.getContext(),\n Util.getUserAgent(mcontainer.getContext(), \"MicroMobility\"));\n\n // This is the MediaSource representing the media to be played.\n Uri uri = Uri.fromFile(mediafile);\n MediaSource videoSource = new ProgressiveMediaSource.Factory(dataSourceFactory).createMediaSource(uri);\n // Clip to start at 5 seconds and end at 10 seconds.\n ClippingMediaSource clippingSource =new ClippingMediaSource(videoSource,/* startPositionUs= */ 0_000_000,/* endPositionUs= */ C.TIME_END_OF_SOURCE);\n return videoSource;\n }" ]
[ "0.7379787", "0.7005752", "0.6968712", "0.6592795", "0.6580441", "0.6433927", "0.6393248", "0.6319817", "0.6262723", "0.6232049", "0.6226993", "0.6172566", "0.614932", "0.60988504", "0.6083939", "0.6056625", "0.60528105", "0.6044647", "0.6015797", "0.59960544", "0.5971162", "0.5878573", "0.5870349", "0.5865558", "0.58227354", "0.58080673", "0.57889616", "0.5780918", "0.5770239", "0.575124", "0.57255775", "0.57167214", "0.5703441", "0.5679765", "0.56777644", "0.5664433", "0.5647411", "0.5630165", "0.56209666", "0.5617233", "0.56150055", "0.5598945", "0.5596929", "0.5590888", "0.5579775", "0.55730844", "0.5567359", "0.55629593", "0.55543375", "0.5534698", "0.552903", "0.55258256", "0.55201596", "0.5509826", "0.5500768", "0.5494883", "0.5486086", "0.5462295", "0.54543644", "0.54525596", "0.54468656", "0.54448545", "0.54441273", "0.5436611", "0.5434267", "0.54138017", "0.5408252", "0.5407452", "0.5406765", "0.5403472", "0.54015464", "0.53999424", "0.5376791", "0.5372986", "0.53696346", "0.53696346", "0.5355032", "0.535391", "0.5346394", "0.53360856", "0.5335668", "0.53316855", "0.53289044", "0.53260607", "0.53230137", "0.53140414", "0.5313951", "0.5309345", "0.52993643", "0.529147", "0.52909124", "0.5287992", "0.5286871", "0.5286265", "0.52675396", "0.52665496", "0.5260399", "0.52599776", "0.5257013", "0.5252005" ]
0.7920322
0
Override object classens to string metode, med selv lavet metode.
@Override public String toString() { return "Media{" + "assetId=" + assetId + ", name='" + name + '\'' + ", created=" + created + ", fileName='" + fileName + '\'' + '}'; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n public void setObject(String object) {\n }", "public InterrogationMeteoString() {\r\n\t\tthis(null, null, null, null, null);\r\n\t}", "@Override\n public void handleString(String s) {\n\n }", "@Override\n public Object construct(Object... args) {\n CharSequence stringData = (args.length > 0 ? ToString(realm(), args[0]) : \"\");\n ExoticString obj = new ExoticString(realm(), stringData);\n obj.setPrototype(realm().getIntrinsic(Intrinsics.StringPrototype));\n return obj;\n }", "public SeriesInstance setType( String theString) {\n\t\tmyType = new StringDt(theString); \n\t\treturn this; \n\t}", "@Override\n public String toString() {\n return metaObject.getType().toString();\n }", "@Override\n\tpublic void WriteData(String obj) {\n\t\t\n\t}", "@objid (\"261a4d72-4079-4832-9c3d-48b507d6b152\")\n @Override\n public Object convertToObject(String value, ModelElement object) {\n if (getType().getBaseType() == null) {\n return value;\n }\n \n IDynamicPropertyResolver resolver = getDynamicPropertyResolver();\n if (resolver != null) {\n return resolver.convertToObject(this, value, object);\n } else {\n throw new UnsupportedOperationException(\"No DynamicBehavior found for the \" + this.toString() + \" property.\");\n }\n }", "public abstract String getObjectType();", "public abstract String getString();", "public abstract String getString();", "@Override\n\tpublic String toString() {\n\t\treturn \"string dari class Main\";\n\t}", "public final /* synthetic */ void mo14896a(Object obj) {\n mo14896a((String) obj);\n }", "public T caseURDFAttrSTRING(URDFAttrSTRING object) {\r\n\t\treturn null;\r\n\t}", "@Override\n\tpublic T get(String obj) {\n\t\treturn null;\n\t}", "public T caseString(sensorDeploymentLanguage.String object) {\n\t\treturn null;\n\t}", "public abstract String getContentString();", "@Override\n\tpublic String getText(Object object) {\n\t\tString label = ((EntityAttribute)object).getName();\n\t\treturn label == null || label.length() == 0 ?\n\t\t\tgetString(\"_UI_EntityAttribute_type\") :\n\t\t\tgetString(\"_UI_EntityAttribute_type\") + \" \" + label;\n\t}", "String getStringClass();", "default T handleString(String val) {\n throw new UnsupportedOperationException();\n }", "public StringTemplateElement()\n {\n super(String.class);\n }", "protected static String translateObject(EditorDataType type, String value)\r\n\t{\r\n\t\tif (type.isArrayType())\r\n\t\t\treturn \"New \" + EditorLanguage.VB.getName(type) + EditorLanguage.VB.fixLiteral(value, type);\r\n\t\telse\r\n\t\t\treturn EditorLanguage.VB.fixLiteral(value, type);\r\n\t}", "@Override\r\n\tpublic String getText(Object object) {\r\n\t\treturn super.getText(object);\r\n\t}", "@Override\n public String getData() {\n return \"T \" + super.getData();\n }", "@Override\n public abstract String asText();", "@Override\n\tpublic Object visit(ASTQuotString node, Object data)\n\t{\n\t\tFormulaSemantics semantics = (FormulaSemantics) data;\n\t\tsemantics.setInfo(FormulaSemanticsUtilities.SEM_FORMAT,\n\t\t\tnew FormulaFormat(STRING_CLASS));\n\t\treturn semantics;\n\t}", "@Override\n public void setInfo(String s) {\n this.info = s;\n\n }", "static String filterString(Object o, String str) {\r\n // if (o instanceof Named) {\r\n // Named n = (Named) o;\r\n // str = str.replace(\"$name\", n.getName());\r\n // // System.out.println(n.getName());\r\n // }\r\n // if (o instanceof Described) {\r\n // Described n = (Described) o;\r\n // str = str.replace(\"$description\", n.getDescription());\r\n // }\r\n return str;\r\n }", "public interface StringTranslation<T> {\n\n /**\n * Method defines hos to change string representation to instance of object.\n * @param stringRepresentation string that will be dispatched into object.\n * @return instance of expected object.\n */\n T translate(final String stringRepresentation);\n\n /**\n * Helper method that gives a hint, in case when during reading a null indicator would be found\n * what will should be returned. It can look kind of artificial, but this was introduced to solve problem\n * with raw types, and define behaviour of such translation, externally and give ability of control for user.\n *\n * To understand please have a look for example StringToDoubleTranslation vs StringToRawDoubleTranslation.\n * @return null representation.\n */\n T getNullRepresentation();\n}", "@Override\n\tpublic void setPrimitiveAsString(boolean arg0) {\n\n\t}", "public abstract String mo83558a(Object obj);", "public Value(String s) {\n string = s;\n itemClass = String.class;\n type = DataType.STRING;\n }", "@Override\n\tpublic void setExtraData(String arg0) {\n\n\t}", "@Override\n public StringType asString() {\n return TypeFactory.getStringType(this.getValue());\n }", "@Override String toString();", "public String getStringAttribute();", "public interface Text {\n \n /**\n * Method find name of class which object are instance\n * @return \n */\n String getStringClass();\n\n @Override\n public String toString();\n \n \n \n}", "abstract String moodString();", "@Override\n protected String className(ClassType t, boolean longform, Locale locale) {\n Symbol sym = t.tsym;\n if (sym.name.length() == 0 && (sym.flags() & COMPOUND) != 0) {\n return OBJECT;\n } else if (sym.name.length() == 0) {\n // Anonymous\n String s;\n ClassType norm = (ClassType) t.tsym.type;\n if (norm == null) {\n s = OBJECT;\n } else if (norm.interfaces_field != null && norm.interfaces_field.nonEmpty()) {\n s = visit(norm.interfaces_field.head, locale);\n } else {\n s = visit(norm.supertype_field, locale);\n }\n return s;\n } else if (longform) {\n String pkg = \"\";\n for (Symbol psym = sym; psym != null; psym = psym.owner) {\n if (psym.kind == PCK) {\n pkg = psym.getQualifiedName().toString();\n break;\n }\n }\n return fullClassNameAndPackageToClass.apply(\n sym.getQualifiedName().toString(),\n pkg\n );\n } else {\n return sym.name.toString();\n }\n }", "@Override\n\tpublic String getText(Object object) {\n\t\tString label = ((ColumnType4)object).getName();\n\t\treturn label == null || label.length() == 0 ?\n\t\t\tgetString(\"_UI_ColumnType4_type\") :\n\t\t\tgetString(\"_UI_ColumnType4_type\") + \" \" + label;\n\t}", "@Override\n public String getType() {\n return super.getType().toLowerCase();\n }", "protected abstract T prepareObject(String extracted);", "public T caseMeta(Meta object) {\n\t\treturn null;\n\t}", "public T caseMeta(Meta object) {\n\t\treturn null;\n\t}", "@Override\n public String toString() {\n return mString;\n }", "public abstract String construct();", "@Override\n\t\t\tpublic String getValue(Bewerbung object) {\n\t\t\t\treturn object.getBewerbungstext();\n\t\t\t}", "public Object stringToObject(String s, Class c){\n Gson gson = new Gson();\n Object o = gson.fromJson(s, c);\n return o;\n }", "public final void testNotificationStringObjectlongString() {\n Notification n = new Notification(\"type\", \"src\", 1, \"msg\");\n assertEquals(\"type\", n.getType());\n assertEquals(\"src\", n.getSource());\n assertEquals(1, n.getSequenceNumber());\n assertEquals(\"msg\", n.getMessage());\n }", "@Override\n public String getStringFromDatabase(int objectID) {\n return \"From Class one result\"+objectID;\n }", "public MyObject(String objectName){\n\n this.objectName = objectName;\n }", "@Override\n public String toString() {\n return string;\n }", "protected String getStrainType()\n{\n\treturn \"Met E\";\n}", "public GongDomObject(String string) throws ParserConfigurationException, InvalidTagException, SAXException, IOException {\r\n super(string);\r\n }", "public void setString(String string) {\n this.string = string;\n }", "@Override\n\tpublic void setClassValue(final String value) {\n\n\t}", "public <T> T toObject(Class<T> type, String source) {\n return toObject(String.class, new EntityType<T>(type), source);\n }", "@Override // m.h\n public String a(Object obj) {\n return obj.toString();\n }", "void setObjectType(String objectType);", "String objectRead();", "public Builder setObject(java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n object_ = value;\n bitField0_ |= 0x00000002;\n onChanged();\n return this;\n }", "public AbstractLocalisationBasePurString() {\t\t\r\n\t\tthis(null, null, null, null);\t\t\r\n\t}", "protected StringValue() {\r\n value = \"\";\r\n typeLabel = BuiltInAtomicType.STRING;\r\n }", "private void addToString(JavaObject object) {\n\t\tToStringMethod method = new ToStringBuilderMethod(getFields());\n\t\tobject.addBlock(method);\n\t}", "@Override\n public final String getAsString(FacesContext context, UIComponent component, Object value) {\n if (value == null || value.equals(\"\")) {\n return null;\n } else {\n //Get ID from the Person Object (primitive operation in the subclass)\n Integer id = getIdFromObjectPerson(value);\n //Create an Array for persisting personal Info (FirstName, LastName, E-mail - 3 fields)\n String [] personalInfo = getPersonalInfo(value);\n //Create String from the Person object\n String toString = getNewStringFromPerson(id, personalInfo[0], personalInfo[1], personalInfo[2]);\n \n return toString;\n }\n }", "@Override\r\n\tpublic String getAsString(FacesContext context, UIComponent component,\r\n\t\t\tObject object) {\n\t\tloggerService.logPortalInfo(\" start getAsString method of ServiceConverter \");\r\n\t\tif (object instanceof String)\r\n\t\t\treturn null;\r\n\t\tif (object != null) {\r\n\t\t\treturn String.valueOf(((ProductTypeDTO) object).getId());\r\n\t\t} else {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t}", "public abstract String pickle(Object obj);", "public abstract void fromString(String s, String context);", "@Override\r\n\t@SuppressWarnings(\"unchecked\")\r\n\tpublic <T> T asObject(String string, Class<T> valueType) throws IllegalArgumentException {\r\n\t\t// at this point value type is guaranteed to be a Locale\r\n\t\tint dashIndex = string.indexOf('-');\r\n\t\tif (dashIndex == -1) {\r\n\t\t\tthrow new IllegalArgumentException(String.format(\"Cannot convert |%s| to locale instance.\", string));\r\n\t\t}\r\n\t\treturn (T) new Locale(string.substring(0, dashIndex), string.substring(dashIndex + 1));\r\n\t}", "public MyAdapter(Context context, int resource, String []objects) //string ki parenthoti hai object\n {\n super(context, resource, objects);\n }", "@Override\n void load(String data) {\n }", "@Override\n\tpublic Object visit(StringNode stringNode) {\n\treturn null; }", "@Override\r\n\tpublic String getText(Object object) {\r\n\t\tString label = ((ContenedorDetalleVehiculoViewModel)object).getPropietario();\r\n\t\treturn label == null || label.length() == 0 ?\r\n\t\t\tgetString(\"_UI_ContenedorDetalleVehiculoViewModel_type\") :\r\n\t\t\tgetString(\"_UI_ContenedorDetalleVehiculoViewModel_type\") + \" \" + label;\r\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn \"Object [name = \" + name.get() + \", typ = \" + typ.get() + \"]\";\n\t}", "public T caseExpression_String(Expression_String object)\r\n {\r\n return null;\r\n }", "@java.lang.Override\n public java.lang.String getObject() {\n java.lang.Object ref = object_;\n if (ref instanceof java.lang.String) {\n return (java.lang.String) ref;\n } else {\n com.google.protobuf.ByteString bs = (com.google.protobuf.ByteString) ref;\n java.lang.String s = bs.toStringUtf8();\n object_ = s;\n return s;\n }\n }", "@Override\r\n\tpublic String getText(Object object) {\r\n\t\tString label = ((Track)object).getName();\r\n\t\treturn label == null || label.length() == 0 ?\r\n\t\t\tgetString(\"_UI_Track_type\") :\r\n\t\t\tgetString(\"_UI_Track_type\") + \" \" + label;\r\n\t}", "public Specific(@NotNull String str) {\n super(str, null);\n Intrinsics.checkNotNullParameter(str, \"title\");\n }", "public String getStr(String attr) {\n return (String) super.get(attr);\n }", "public static void main(String[] args) {\n\t\tObject o3=\"chandan\";\n String n1=(String)o3;\n\t\t\n\t}", "public StringObj(int d, String s) {\n\t\t\tthis.distance = d;\n\t\t\tthis.str = s;\n\t\t}", "@Override\n //Method for getting output from String declaration\n //First set of accessor/mutator that returns value as String\n public String toString(){\n return \"[\"+name+\",\"+type+\",\"+value+\"]\";\n }", "CamembertdeNormandie(Machecoulais machecoulais, Context context, String str) {\n super(0);\n this.f16562a = machecoulais;\n this.f16563b = context;\n this.f16564c = str;\n }", "private Object wrapperObject(final String item)\n {\n return new Object()\n {\n public String toString()\n {\n return item;\n }\n };\n }", "@Override abstract public String type();", "@Override\n public String getObjectCopy() {\n return null;\n }", "public Object get(String string) {\n\t\treturn null;\n\t}", "@Override\n\tpublic String getText(Object object) {\n\t\tShape labelValue = ((Line)object).getShape();\n\t\tString label = labelValue == null ? null : labelValue.toString();\n\t\treturn label == null || label.length() == 0 ?\n\t\t\tgetString(\"_UI_Line_type\") :\n\t\t\tgetString(\"_UI_Line_type\") + \" \" + label;\n\t}", "public String superToString() {\n\t\treturn super.toString();\n\t}", "@Override // com.amap.api.col.stln3.nc\n public final /* synthetic */ Object a(String str) throws AMapException {\n return 0;\n }", "private void toHandler(String str, Class clazz) throws IOException {\n C c = (C) gson.fromJson(str, clazz);\n Message message = handler.obtainMessage();\n message.obj = c;\n handler.sendMessage(message);\n }", "@Override\n public String getType()\n {\n return \"OO\";\n }", "private java.lang.String getTypeString() {\n /*\n // Can't load method instructions: Load method exception: bogus opcode: 00f0 in method: android.location.GpsClock.getTypeString():java.lang.String, dex: \n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.location.GpsClock.getTypeString():java.lang.String\");\n }", "private <T> T formatObject(String objectName, JSONObject object, Class objectClass){\n Gson gson = new Gson();\n String stringObject = object.getJSONObject(objectName).toString();\n T formattedObject = (T) gson.fromJson(stringObject,objectClass);\n return formattedObject;\n }", "private ARXOrderedString(){\r\n this(\"Default\");\r\n }", "protected String myString(){\n \treturn( \"gate \" + name ); \n }", "public final void testNotificationStringObjectlong() {\n Notification n = new Notification(\"type\", \"src\", 1);\n assertEquals(\"type\", n.getType());\n assertEquals(\"src\", n.getSource());\n assertEquals(1, n.getSequenceNumber());\n }", "void set_str(ThreadContext tc, RakudoObject classHandle, String Value);", "public static String stringType(Obj type) {\n\t\tString str = ObjStr.get(type);\n\t\t\treturn str != null ? str : \"\";\n\t}", "@Override\n public void setObjectType(String type) {\n this.objectType = type;\n }", "protected abstract void setName(String string);" ]
[ "0.6622901", "0.6202737", "0.5799406", "0.5796371", "0.5720083", "0.5718506", "0.5700383", "0.5679417", "0.56333494", "0.5617577", "0.5617577", "0.558096", "0.5560422", "0.55130714", "0.5501015", "0.5474555", "0.5423731", "0.541809", "0.5416613", "0.54032755", "0.5391152", "0.5381626", "0.5349847", "0.5344286", "0.5340933", "0.5328305", "0.5322141", "0.5319542", "0.5287316", "0.52846825", "0.52825785", "0.52818334", "0.52772635", "0.5268083", "0.52651906", "0.52609795", "0.52599525", "0.5249912", "0.5248596", "0.5239874", "0.5238954", "0.5237548", "0.5231854", "0.5231854", "0.5225108", "0.52109003", "0.52106285", "0.52100635", "0.52097714", "0.51960075", "0.51921666", "0.5186939", "0.5185791", "0.51843476", "0.5183661", "0.5180049", "0.5173972", "0.51724297", "0.5169701", "0.51687306", "0.51642096", "0.5164194", "0.51636845", "0.5162669", "0.5160609", "0.51567495", "0.51562166", "0.51485586", "0.51411104", "0.5132255", "0.5122563", "0.51138544", "0.5112761", "0.51095873", "0.5109198", "0.51086533", "0.51072216", "0.5107037", "0.5106318", "0.5105428", "0.5103586", "0.51028425", "0.51019", "0.5098101", "0.50944126", "0.5093948", "0.5090442", "0.5082646", "0.507926", "0.5068621", "0.5067371", "0.5064663", "0.50606143", "0.5057089", "0.5054431", "0.5052679", "0.5050328", "0.5046383", "0.50418776", "0.5041154", "0.50266117" ]
0.0
-1
Created by Admin on 201699.
public interface OnLoadDataListener<T> { void onSuccess(T obj); void onFailure(String msg); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private stendhal() {\n\t}", "@Override\n public void perish() {\n \n }", "public final void mo51373a() {\n }", "public void mo38117a() {\n }", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "protected MetadataUGWD() {/* intentionally empty block */}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "public void mo4359a() {\n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "public void mo55254a() {\n }", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "public void mo1531a() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "public void mo12930a() {\n }", "protected void mo6255a() {\n }", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "protected boolean func_70814_o() { return true; }", "@Override\n public void func_104112_b() {\n \n }", "public void designBasement() {\n\t\t\r\n\t}", "@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}", "public Pitonyak_09_02() {\r\n }", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n public void memoria() {\n \n }", "public void mo9848a() {\n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "public void mo6081a() {\n }", "@Override\n protected void getExras() {\n }", "private static void cajas() {\n\t\t\n\t}", "public final void mo91715d() {\n }", "private Rekenhulp()\n\t{\n\t}", "@Override\n\tpublic void create () {\n\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "private void m50366E() {\n }", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tpublic void create() {\n\t\t\n\t}", "public void mo21877s() {\n }", "private TMCourse() {\n\t}", "public void autoDetails() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@SuppressWarnings(\"unused\")\n private void generateInfo()\n {\n }", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "private void getStatus() {\n\t\t\n\t}", "@SuppressWarnings(\"unused\")\n\tprivate void version() {\n\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "Petunia() {\r\n\t\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n protected void initialize() {\n\n \n }", "@Override\n public void init() {\n\n }", "@Override\n public int describeContents() { return 0; }", "public void mo12628c() {\n }", "public void mo21878t() {\n }", "public void gored() {\n\t\t\n\t}", "public void mo3376r() {\n }", "public void create() {\n\t\t\n\t}", "public contrustor(){\r\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\n public Date getCreated()\n {\n return null;\n }", "private ReportGenerationUtil() {\n\t\t\n\t}", "public static void listing5_14() {\n }", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n protected void initialize() \n {\n \n }", "public void mo21779D() {\n }", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "public void mo21795T() {\n }", "@Override\n\tpublic void create() {\n\n\t}", "private CompareDB () {\n\t\tthrow new UnsupportedOperationException();\n\t}", "public void m23075a() {\n }", "public void mo21794S() {\n }", "@Override\r\n\tpublic void create() {\n\t\t\r\n\t}", "public void mo21825b() {\n }", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "private Singletion3() {}", "@Override\r\n\tpublic void create() {\n\r\n\t}", "CreationData creationData();", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "public abstract void mo56925d();", "private MetallicityUtils() {\n\t\t\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n protected void init() {\n }", "@Override\n public void settings() {\n // TODO Auto-generated method stub\n \n }" ]
[ "0.60707754", "0.60124326", "0.5994787", "0.5899942", "0.5883198", "0.58431774", "0.5801735", "0.5801735", "0.5801735", "0.5801735", "0.5801735", "0.5801735", "0.5801735", "0.57569003", "0.573543", "0.5720198", "0.5691369", "0.56516707", "0.56516707", "0.5647968", "0.56430256", "0.56380373", "0.5627876", "0.56223917", "0.5618319", "0.5617861", "0.5616616", "0.56053644", "0.5588274", "0.55812234", "0.557375", "0.55693954", "0.55619", "0.55563205", "0.5555246", "0.55369216", "0.5533441", "0.55334127", "0.55244625", "0.54993415", "0.5496168", "0.5486052", "0.5485707", "0.5483405", "0.54825795", "0.54791975", "0.5472943", "0.54635245", "0.5463266", "0.5459088", "0.54581165", "0.5453631", "0.5437786", "0.5434932", "0.543386", "0.54302853", "0.541146", "0.541146", "0.5408481", "0.5394967", "0.539151", "0.53893244", "0.5389152", "0.5389058", "0.5388886", "0.53886753", "0.5382578", "0.5373553", "0.53717107", "0.5367827", "0.53515077", "0.53490394", "0.5347398", "0.53405714", "0.53386647", "0.5336871", "0.53346425", "0.53346425", "0.53346425", "0.53346425", "0.53346425", "0.5333502", "0.5331989", "0.5330593", "0.532953", "0.53281", "0.5327145", "0.53250504", "0.53247243", "0.5319365", "0.5315056", "0.53128296", "0.53105456", "0.53076285", "0.53076285", "0.53076285", "0.53063273", "0.530313", "0.53015006", "0.5297966", "0.52954894" ]
0.0
-1
TODO Autogenerated method stub
@Override protected void onListItemClick(ListView l, View v, int position, long id) { File file = new File(path.get(position)); if (file.isDirectory()) { if(file.canRead()){ getDir(path.get(position)); }else{ new AlertDialog.Builder(this) .setIcon(R.drawable.ic_launcher) .setTitle("[" + file.getName() + "] folder can't be read!") .setPositiveButton("OK", null).show(); } }else { /*new AlertDialog.Builder(this) .setIcon(R.drawable.ic_launcher) .setTitle("[" + file.getName() + "]") .setPositiveButton("OK", null).show(); */ counter ++; Mat image = Highgui.imread(file.getAbsolutePath()); this.refSetImages.add(image); Mat descriptors1 = new Mat(); MatOfKeyPoint keypoints1 = new MatOfKeyPoint(); detector.detect(image, keypoints1); descriptor.compute(image, keypoints1, descriptors1); keypoints.add(keypoints1); descriptors.add(descriptors1); if(counter ==1 ){ PreferenceManager.getInstance().setPassFilePath(file.getName()); PreferenceManager.getInstance().setPassMat(image); PreferenceManager.getInstance().setPassDescriptors(descriptors1); PreferenceManager.getInstance().setPassKeypoints(keypoints1); } else if(counter == 2){ PreferenceManager.getInstance().setPassFilePath1(file.getName()); PreferenceManager.getInstance().setPassMat1(image); PreferenceManager.getInstance().setPassDescriptors1(descriptors1); PreferenceManager.getInstance().setPassKeypoints1(keypoints1); } else if(counter == 3){ PreferenceManager.getInstance().setPassFilePath2(file.getName()); PreferenceManager.getInstance().setPassMat2(image); PreferenceManager.getInstance().setPassDescriptors2(descriptors1); PreferenceManager.getInstance().setPassKeypoints2(keypoints1); PutTheReferenceSetInPreferences put = new PutTheReferenceSetInPreferences(); put.execute(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\n public void perish() {\n \n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n\tpublic void nefesAl() {\n\n\t}", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tprotected void initdata() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n public void function()\n {\n }", "@Override\n public void function()\n {\n }", "public final void mo51373a() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tprotected void initData() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tprotected void InitData() {\n\t\t\r\n\t}", "public void designBasement() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void initialize() {\n\n \n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initData() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void ic() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tprotected void initData() {\n\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n public void init() {\n\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "public contrustor(){\r\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void dispase() {\n\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\n\tpublic void dtd() {\n\t\t\n\t}", "@Override\n\tprotected void logic() {\n\n\t}", "@Override\n\tprotected void lazyLoad() {\n\t\t\n\t}", "public void mo4359a() {\n }", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\n\t\tpublic void method() {\n\t\t\t\n\t\t}", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\r\n\tpublic void getProposition() {\n\r\n\t}", "@Override\n\tpublic void particular1() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n protected void prot() {\n }", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\n\tprotected void initValue()\n\t{\n\n\t}", "public void mo55254a() {\n }" ]
[ "0.6671074", "0.6567672", "0.6523024", "0.6481211", "0.6477082", "0.64591026", "0.64127725", "0.63762105", "0.6276059", "0.6254286", "0.623686", "0.6223679", "0.6201336", "0.61950207", "0.61950207", "0.61922914", "0.6186996", "0.6173591", "0.61327106", "0.61285484", "0.6080161", "0.6077022", "0.6041561", "0.6024072", "0.6020252", "0.59984857", "0.59672105", "0.59672105", "0.5965777", "0.59485507", "0.5940904", "0.59239364", "0.5910017", "0.5902906", "0.58946234", "0.5886006", "0.58839184", "0.58691067", "0.5857751", "0.58503544", "0.5847024", "0.58239377", "0.5810564", "0.5810089", "0.5806823", "0.5806823", "0.5800025", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5792378", "0.5790187", "0.5789414", "0.5787092", "0.57844025", "0.57844025", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5774479", "0.5761362", "0.57596046", "0.57596046", "0.575025", "0.575025", "0.575025", "0.5747959", "0.57337177", "0.57337177", "0.57337177", "0.5721452", "0.5715831", "0.57142824", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.57140535", "0.5711723", "0.57041645", "0.56991017", "0.5696783", "0.56881124", "0.56774884", "0.56734604", "0.56728", "0.56696945", "0.5661323", "0.5657007", "0.5655942", "0.5655942", "0.5655942", "0.56549734", "0.5654792", "0.5652974", "0.5650185" ]
0.0
-1
param 0 which is come from requestData
@Override protected String doInBackground(String... params) { String content = HttpManager.getData(params[0],params[1],params[2]); return content; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void requestData();", "public T getRequestData();", "private void onRequestData(int tag) {\n \ttry {\n \t data = request.request();\n \t} catch(MatjiException e) {\n \t lastOccuredException = e;\n \t}\n }", "@Override\n\tpublic void setRequest(Map<String, Object> arg0) {\n\n\t}", "private void onPreRequestData(int tag) {\n }", "private String callback(Map<String, String> requestData) {\n\t\tString[] args = requestData.get(\"data\").split(\";\")[1].split(\"#\");\n\t\tString item = args[0];\n\t\t\n\t\treturn \"{\\\"type\\\": \\\"edit\\\", \\\"text\\\": \\\"HTTP Server - You Selected \"+item.toUpperCase()+\"\\\"}\";\n\t}", "public int getDataParam() {\n return dataParam;\n }", "KijiDataRequest getClientRequest();", "public void parseParameter(byte[] data)\n {\n return; \n }", "@Override\n\tpublic void setRequest(Map<String, Object> arg0) {\n\t\tthis.request = arg0;\n\t}", "protected byte[] onRequest(String topic, String item, int uFmt)\n {\n return null;\n }", "@Override\n\tpublic void initRequest() {\n\n\t}", "protected Object getSingleValueFromRequest(HttpServletRequest request_p, String strID_p)\r\n {\r\n return request_p.getParameter(strID_p);\r\n }", "@Override\n\tpublic RequestParams onParams(int paramFlag) {\n\t\treturn null;\n\t}", "void onDataLoaded(int requestId, Object data);", "public java.lang.String getParam0(){\n return localParam0;\n }", "public java.lang.String getParam0(){\n return localParam0;\n }", "public java.lang.String getParam0(){\n return localParam0;\n }", "public java.lang.String getParam0(){\n return localParam0;\n }", "public DataHolder processRequest(DataHolder indataholder) throws java.rmi.RemoteException;", "public void receiveGeneratedData(byte[] arg0) {\n\t}", "@Override\n protected Map<String, String> getParams() {\n int noofstudent = 2*Integer.parseInt(noofconflicts);\n String checkconflicts = \"jbscjas\";//send anything part\n String uid = AppController.getString(WingForm.this,\"Student_id\");\n Map<String, String> params = new LinkedHashMap<String, String>();\n //using LinkedHashmap because backend does not check key value and sees order of variables\n params.put(\"checkconflicts\", checkconflicts);\n params.put(\"noofstudent\", String.valueOf(noofstudent));\n for(int m=0;m<noofstudent;m++){\n params.put(\"sid[\"+m+\"]\",sid[m]);\n }\n\n\n return params;\n }", "private void extractData() {\n String[] info = request.split(\";\");\n actionCode = info[0];\n\n // if the code is 102, 103... then it has data attached\n List listOfCodes = Arrays.asList(\"102\", \"103\", \"104\", \"202\", \"203\");\n\n // extract data attached with the action code\n if (listOfCodes.contains(actionCode)) {\n data = info[1];\n }\n }", "@Override\n public void onNext(RequestData request) {\n System.out.println(\"Requestor:\" + request.getName());\n System.out.println(\"Request Message:\" + request.getMessage());\n }", "TransmissionProtocol.Request getRequest(int index);", "@Override\r\n\t\t\tpublic void onRequest() {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\t\t\tpublic void onResponseReceived(Request request, Response response) {\n\t\t\t\t\n\t\t\t}", "private void wrapGuiDataRequest(JSONObject msg)\n\t{\n\t\tMap<String, Object> map = new HashMap<String, Object>();\n\n\t\tJSONObject data = (JSONObject) msg.get(\"data\");\n\t\tmap.put(\"data\", data);\n\t\tmap.put(\"msgId\", Server.ServerQueueIds.REQ_MSG_ID);\n\n\t\tJSONObject req = new JSONObject(map);\n\t\tserver.putMsgOnServerQueue(req);\n\t}", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "@Override\n protected Map<String, DataPart> getByteData() {\n Map<String, DataPart> params = new HashMap<>();\n\n return params;\n }", "@Override\n protected Map<String, String> getParams() {\n return requestParams;\n }", "@Override\n protected Map<String, String> getParams() {\n return requestParams;\n }", "@Override\r\n\tprotected void validateData(ActionMapping arg0, HttpServletRequest arg1) {\n\t\t\r\n\t}", "@Override\n\t\t\t\t\tpublic void onReqStart() {\n\t\t\t\t\t}", "@Override\n protected Map<String, String> getParams() {\n int noofstudent = 2*Integer.parseInt(noOfStudents);\n String creatre = \"jbscjas\";//send anything part\n String uid = AppController.getString(WingForm.this,\"Student_id\");\n Map<String, String> params = new LinkedHashMap<String, String>();\n //using LinkedHashmap because backend does not check key value and sees order of variables\n params.put(\"createsubmittedform\", creatre);\n params.put(\"uid\",uid);\n params.put(\"noofstudent\", String.valueOf(noofstudent));\n for(int m=1;m<3;m++){\n String z= String.valueOf(m);\n params.put(\"pfid[\"+m+\"]\",z);\n params.put(\"hostelid[\"+m+\"]\",hostelid[m-1]);\n params.put(\"floorno[\"+m+\"]\",floorno[m-1]);\n }\n for (int k = 0; k < noofstudent; k++) {\n int m = k/2 +1;\n String z= String.valueOf(m);\n params.put(\"sid[\"+k+\"]\", sid[k]);\n params.put(\"roominwing[\"+k+\"]\",z );\n }\n return params;\n }", "public T getRequestData() {\n return requestData;\n }", "@Override\n\t\t\t\tpublic void onResponseReceived(Request request, Response response) {\n\t\t\t\t\t\n\t\t\t\t}", "public void postData() {\n\n\t}", "@Override\r\n\tpublic Map<String, Object> referenceData(HttpServletRequest request) {\n\t\treturn null;\r\n\t}", "@Override \n\t\tprotected int getNumParam() {\n\t\t\treturn 1;\n\t\t}", "@Override\n\tpublic String init_request() {\n\t\treturn null;\n\t}", "@Override\n\t\t\t\t\tpublic void onDataCallBack(String request, int code) {\n\t\t\t\t\t\tuploadMsg(fUerInfo);\n\t\t\t\t\t}", "public abstract void param(byte[] data,SplitDetails name, SplitDetails value) throws ParseException;", "@Override\n public void getData(int a, int b) {\n\n }", "@Override\n protected Map<String, String> getParams() {\n int noofstudent = 2*Integer.parseInt(noOfStudents);\n String creatre = \"jbscjas\";//send anything part\n String uid = AppController.getString(WingForm.this,\"Student_id\");\n Map<String, String> params = new LinkedHashMap<String, String>();\n //using LinkedHashmap because backend does not check key value and sees order of variables\n params.put(\"createsavedform\", creatre);\n params.put(\"uid\",uid);\n params.put(\"noofstudent\", String.valueOf(noofstudent));\n for(int m=1;m<3;m++){\n String z= String.valueOf(m);\n params.put(\"pfid[\"+m+\"]\",z);\n params.put(\"hostelid[\"+m+\"]\",hostelid[m-1]);\n params.put(\"floorno[\"+m+\"]\",floorno[m-1]);\n }\n for (int k = 0; k < noofstudent; k++) {\n int m = k/2 +1;\n String z= String.valueOf(m);\n params.put(\"sid[\"+k+\"]\", sid[k]);\n params.put(\"sname[\"+k+\"]\", sname[k]);\n params.put(\"roominwing[\"+k+\"]\",z );\n }\n\n return params;\n }", "private void decodePostRequest(SocketFilter nextFilter,SelectionKey selectionKey,ByteBuffer dataBuf){\n\t\t\n\t\tSelectionKeyAttachment attachment = (SelectionKeyAttachment) selectionKey.attachment();\n\t\t\n\t\tbyte[] bytes = new byte[attachment.getPostHeaderEnd()];\n\t\tdataBuf.get(bytes);\n\t\ttry {\n\t\t\tHttpRequest request = decodeRequestHeader(selectionKey,new String(bytes, PWSConfig.CHARSET));\n\t\t\t\n\t\t\tif (request!=null) {\n\t\t\t\tattachment.setHttpRequest(request);\n\t\t\t\t\n\t\t\t\tif (dataBuf.hasRemaining()) {\n\t\t\t\t\tbyte[] b = new byte[dataBuf.remaining()];\n\t\t\t\t\tdataBuf.get(b);\n\t\t\t\t\ttry {\n\t\t\t\t\t\trequest.writePostBuffedData(b);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (request.isPostDataCompleted()) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tnextFilter.onMessageReceived(selectionKey, request);\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\tclose(selectionKey);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else{\n\t\t\t\tclose(selectionKey);\n\t\t\t}\n\t\t\t\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\te.printStackTrace();\n\t\t\tclose(selectionKey);\n\t\t}\n\t\t\n\t}", "@Override\n\tprotected byte[] getArgByte() {\n\t\treturn paramsJson.getBytes();\n\t}", "public static void vu0UploadData(int index, byte[] data) { }", "@Override\n protected Map<String, String> getParams() {\n Map<String, String> params = new HashMap<String, String>();\n params.put(\"Eid\", id + \"\");\n\n\n return params;\n }", "pb4client.TransportRequest getReq(int index);", "public static int getRequestNum(){\n return requestNum;\n }", "@Override\r\n\tpublic Map<String, Object> returnData(Map<String, Object> map,Model model, HttpServletRequest request) {\n\t\treturn null;\r\n\t}", "com.indosat.eai.catalist.standardInputOutput.RequestType getRequest();", "Call mo35727a(Request request);", "@Override\n\tpublic void onRequestStart(String reqId) {\n\t\t\n\t}", "@Override\n\tpublic void OnRequest() {\n\t\t\n\t}", "protected byte[] onRequest(String topic, String item, int uFmt, long hconv)\n {\n return onRequest(topic, item, uFmt);\n }", "public int getParameterOffset();", "public void initRequest() {\n repo.getData();\n }", "private void changeRequest(InstanceRequest request) {\r\n\t\t\r\n\t}", "@Override\n\tpublic InterChildrenRequest prepareRequest(IntercastRequest request)\n\t{\n\t\treturn null;\n\t}", "@Override\n public void onNext(RequestData request) {\n System.out.println(\"Requestor:\" + request.getName());\n System.out.println(\"Request Message:\" + request.getMessage());\n responseObserver.onNext(ResponseData.newBuilder().setMessage(request.getMessage() + \" - \" + request.getName()).build());\n }", "public void setRequestData(T requestData) {\n this.requestData = requestData;\n }", "protected String getRequestData(HttpServletRequest request) {\n\n\t\tStringBuilder stringBuilder = new StringBuilder();\n\t\ttry {\n\t\t\tBufferedReader reader = request.getReader();\n\t\t\tString currentLine = \"\";\n\t\t\twhile ((currentLine = reader.readLine()) != null) {\n\n\t\t\t\tstringBuilder.append(currentLine);\n\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn stringBuilder.toString();\n\n\t}", "private BigInteger extractFromRequest(ServletRequest req) {\n return null;\r\n }", "@Override\n protected Map<String, String> getParams() {\n Map<String, String> params = new HashMap<>();\n\n params.put(\"complex_id\",complex_id);\n Log.d(TAG, \"complex_id: \"+params);\n\n return params;\n }", "@Override\n\tprotected void initData() {\n\t\trequestUserInfo();\n\t}", "@Override\r\n\tpublic void onOk(HttpRequest paramHttpRequest, Object paramObject) {\n\r\n\t}", "private void sendLocalParamData(){\n String json = gson.toJson(parameters);\n getJSON(hostUrl + sendLocalParamScript.getFilename() + \"?matchId=\" + matchId + \"&param=\" + json, 2000);\n }", "@Override\n public void onReceivedData(byte[] arg0) {\n try {\n ultimoDadoRecebido = ultimoDadoRecebido + new String(arg0, \"UTF-8\");\n } catch (UnsupportedEncodingException e) {\n e.printStackTrace();\n }\n }", "@Override\n protected Map<String, String> getParams() {\n Map<String, String> params = new HashMap<>();\n\n params.put(\"id\", id);\n params.put(\"type\", type);\n\n Log.d(TAG, \"getParams: \"+params);\n\n\n\n return params;\n }", "@Override\n protected Map<String, String> getParams() {\n Map<String, String> params = new HashMap<String, String>();\n params.put(\"id\", id);\n\n\n\n\n return params;\n }", "void request(RequestParams params);", "@Override\n\tprotected void getData() {\n\t\t\n\t}", "TransferInitiateResponse initiateProviderRequest(DataRequest dataRequest);", "private void addRequest(InstanceRequest request) {\r\n\t\t\r\n\t}", "double clientData(final int index, final int data);", "@Override\n protected Map<String, String> getParams() {\n Map<String, String> params = new HashMap<String, String>();\n params.put(\"id\", idb);\n params.put(\"correo\", correob);\n return params;\n }", "private void getParameters(HttpServletRequest request) {\n\t\t// Recoger datos\n\t\tconcepto = request.getParameter(\"concepto\");\n\t\tString importeTexto = request.getParameter(\"importe\");\n\t\ttry {\n\t\t\timporte = Double.parseDouble(importeTexto);\n\n\t\t} catch (NumberFormatException e) {\n\t\t\timporte = (double) 0;\n\t\t}\n\t\tLong idCoche = Long.parseLong(request.getParameter(\"id_coche\"));\n\t\tc = daoCoche.getBYId(idCoche);\n\t\tidAgente = Long.parseLong(request.getParameter(\"id_agente\"));\n\t}", "protected abstract void nextRequest ();", "@Override\n public void channelRead0(ChannelHandlerContext ctx, String request) throws Exception {\n final JsonObject json = (JsonObject) parser.parse(request);\n if(json.has(\"operation\") && ((json.get(\"operation\").getAsString()).equals(\"data\"))) {\n final DataToProcess obj = GSON.fromJson(json, DataToProcess.class);\n QueuerManager.getInstance().pushPacket(ctx.channel().id().asShortText(), obj);\n// System.out.println(\"REC Data Received \" + ctx.channel().id().asShortText());\n }\n else {\n// System.out.println(\"REC hello packet\");\n }\n }", "int getNumOfRetrievelRequest();", "int getNumOfRetrievelRequest();", "@Override\n protected Map<String, String> getParams() {\n return params;\n }", "private void parseData() {\n\t\t\r\n\t}", "private void setRequestValue(JoinPoint joinPoint, OperateLog operateLog) {\n String requestMethod = operateLog.getRequestMethod();\n if (HttpMethod.PUT.matches(requestMethod) || HttpMethod.POST.matches(requestMethod)) {\n String params = argsArrayToString(joinPoint.getArgs());\n operateLog.setParam(StringUtils.substring(params, 0, 2000));\n } else {\n Map<?, ?> paramsMap = (Map<?, ?>) ServletUtils.getRequest().getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE);\n operateLog.setParam(StringUtils.substring(paramsMap.toString(), 0, 2000));\n }\n }", "private void parseCompleteReqMessage() {\r\n byte result = _partialMessage.get(0);\r\n byte opCode = _partialMessage.get(1);\r\n byte numberOfParams = _partialMessage.get(2);\r\n\r\n /* cursor of bytes within 'message'. Parameters start at position 2 */\r\n int messageIndex = 3;\r\n int availableChars = (int) _partialMessage.size();\r\n\r\n List<String> paramList = new ArrayList<>();\r\n String param;\r\n\r\n for (byte i = 0; (i < numberOfParams) && (messageIndex < availableChars); i++) {\r\n param = \"\";\r\n\r\n /* collect data up to terminator */\r\n while ((messageIndex < availableChars) &&\r\n (_partialMessage.get(messageIndex) != '\\0')) {\r\n param += (char)((byte)(_partialMessage.get(messageIndex)));\r\n ++ messageIndex;\r\n }\r\n\r\n /* skip after terminator */\r\n if (messageIndex < availableChars) {\r\n ++ messageIndex;\r\n }\r\n\r\n paramList.add( param);\r\n }\r\n\r\n _replyDispatcher.onReplyReceivedForRequest(opCode, result, paramList);\r\n }", "public void Data(){\n\t\t\t\t\t\t\n\t\t\t\t\t}", "@Override\n protected Map<String, String> getParams() {\n Map<String, String> params = new HashMap<>();\n\n params.put(\"complex_id\", complex_id);\n params.put(\"block\", block_name);\n params.put(\"type\", user_type);\n\n // Log.d(TAG, \"city_id: \"+params);\n\n return params;\n }", "@Override\n public void onCallInformationRequestRequest(CallInformationRequestRequest arg0) {\n\n }", "io.envoyproxy.envoy.type.metadata.v3.MetadataKind.Request getRequest();", "java.lang.String getParameterId();", "KafkaRequestParam getRequest();", "java.lang.String getRequestID();", "private void formRequest() {\r\n\t\tbyte[] user_bytes = _userName.getBytes();\r\n\t\tbyte[] password_bytes = _password.getBytes();\r\n\r\n\t\t_request = new byte[3 + user_bytes.length + password_bytes.length];\r\n\t\t_request[0] = (byte) 1;\r\n\t\t_request[1] = (byte) user_bytes.length;\r\n\t\tSystem.arraycopy(user_bytes, 0, _request, 2, user_bytes.length);\r\n\t\t_request[2 + user_bytes.length] = (byte) password_bytes.length;\r\n\t\tSystem.arraycopy(password_bytes, 0, _request, 3 + user_bytes.length, password_bytes.length);\r\n\t}", "@ProcessData()\n public Data sayHello(Data<MyData> param) {\n MyData data = param.getContent();\n System.out.println(\"call processor\");\n if (data != null) {\n data.put(\"Response\", \"Hello (\" + data.get(\"user.name\") + \") value = \" + data.getName());\n }\n return param;\n }", "java.lang.String getData();", "@Override\n\tpublic void processData() {\n\t\t\n\t}", "String getRequest();" ]
[ "0.635393", "0.63140625", "0.62747914", "0.62675774", "0.62371486", "0.6049323", "0.6000523", "0.5946017", "0.59371096", "0.5923521", "0.5890787", "0.58122736", "0.57939637", "0.5778041", "0.57381713", "0.5699614", "0.5699614", "0.5699614", "0.5699614", "0.56875896", "0.56852007", "0.5670645", "0.5651539", "0.5627113", "0.5617337", "0.561338", "0.5597795", "0.55952096", "0.55277216", "0.55277216", "0.55277216", "0.55277216", "0.5524103", "0.5524103", "0.5522736", "0.5521753", "0.5518604", "0.55169415", "0.5508358", "0.549578", "0.54851437", "0.5478889", "0.5463579", "0.5462199", "0.54476744", "0.5439804", "0.5434019", "0.5432413", "0.5431213", "0.53891927", "0.53877", "0.53862077", "0.5384068", "0.5381638", "0.53600234", "0.53476113", "0.53463995", "0.5338486", "0.5334499", "0.5332234", "0.53320056", "0.53271294", "0.5317325", "0.5307862", "0.53051037", "0.52883667", "0.5281584", "0.5277726", "0.5277074", "0.5275565", "0.52706015", "0.52694494", "0.5254859", "0.52502114", "0.5246331", "0.5241019", "0.5239448", "0.5237586", "0.52341145", "0.52102834", "0.52068865", "0.52064455", "0.5199463", "0.5199434", "0.5199434", "0.5198675", "0.5187323", "0.5184144", "0.51831037", "0.51830953", "0.51801074", "0.51798964", "0.5177997", "0.51647985", "0.516147", "0.5157936", "0.51447767", "0.5143188", "0.5143141", "0.5140351", "0.5137424" ]
0.0
-1
content of dobackground pass to the dopostexcute
@Override protected void onPostExecute(String result) { myTasksList.remove(this); if (myTasksList.size()==0){ progressBar.setVisibility(View.INVISIBLE); } if (result==null){ Toast.makeText(Login.this,"Sorry Username or password doesnot match",Toast.LENGTH_LONG).show(); return; } //list of object from content //from json updateDisplay(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void enterBackground();", "public void afterBackground(OUT out) {\n\n }", "private void backgroundExecution() {\n // This moves the time consuming operation to a child thread.\n Thread thread=new Thread(null, doBackgroundThreadProcessing, \"Background\");\n thread.start();\n }", "void backgroundRefresh();", "public void actionBackground() {\n int num1 = (int) Math.floor(Math.random() * 6 + 1);\n int num2 = (int) Math.floor(Math.random() * 6 + 1);\n MensajeTrayIcon(\"Haciendo algo: \" + num1 + \" + \" + num2 + \" = \" + (num1 + num2), TrayIcon.MessageType.INFO);\n }", "void enableBackgroundData();", "@Override\n public void run() {\n Message uiMSG;\n //Create message with only SHOW_ORIGINAL_COLOR argument\n uiMSG = BackgroundThread.this.uiHandler.obtainMessage(BidirectionalMessageActivity.SHOW_ORIGINAL_COLOR, 0, 0, null);\n BackgroundThread.this.uiHandler.sendMessage(uiMSG); //Send start message to UI thread\n\n fillProgressbar(progressBar); //Fill progress bar as a long time operation\n //Message with information SHOW_NEW_COLOR as a end of long time operation\n uiMSG = BackgroundThread.this.uiHandler.obtainMessage(BidirectionalMessageActivity.SHOW_NEW_COLOR, 0, 0, null);\n BackgroundThread.this.uiHandler.sendMessage(uiMSG); //Message with end result is sent\n }", "void backgroundProcess();", "public void backgroundProcess();", "void onRenderBackground(RenderArguments arguments);", "String getRemediationBackground();", "@Override\n protected Void doInBackground(String... args) {\n String usrnmed=args[0];\n back(usrnmed);\n try {\n Thread.sleep(1000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n Log.d(\"MAIN\",\"in background!\");\n return null;\n }", "@Override\r\n\tpublic void renderBackground() {\n\r\n\t}", "@Override\n\tprotected void onResume() {\n\t\tisbackground=0;\n\t\tsuper.onResume();\n\t\t\n\t}", "public void getBackground() throws LRException\n\t{\n\t\tif (background==null) background=(DataRBackground)getBackground(\"data\");\n\t}", "private void updateBackground() {\n \t\t\t\ttextRed.setText(\"\" + redBar.getProgress());\n \t\t\t\ttextGreen.setText(\"\" + greenBar.getProgress());\n \t\t\t\ttextBlue.setText(\"\" + blueBar.getProgress());\n \t\t\t\ttextAlpha.setText(\"\" + alphaBar.getProgress());\n \t\t\t\tcolorTest.setBackgroundColor(Color.argb(alphaBar.getProgress(), redBar.getProgress(), greenBar.getProgress(), blueBar.getProgress()));\n \t\t\t}", "public void stopBackgroundVcsOperation() {\n assert ! ApplicationManager.getApplication().isDispatchThread();\n LOG.assertTrue(myBackgroundOperationCounter > 0, \"myBackgroundOperationCounter > 0\");\n myBackgroundOperationCounter--;\n }", "public void run() {\n scroolViewScanner.setBackgroundColor(Color.TRANSPARENT);\n scroolViewDefect.setBackgroundColor(Color.TRANSPARENT);\n linLayOverView.setBackgroundColor(Color.TRANSPARENT);\n }", "@Test(enabled = false, retryAnalyzer = Retry.class, testName = \"Sanity Tests\", description = \" Backup running in background -> make sure process keeps alive and completes its queue even in background AND if taking new shots they are automatically backed up\",\n\t\t\tgroups = { \"Sanity Android\" })\n\tpublic void backupInBackground() throws Exception, Throwable {\n\t\tdriver.lockScreen(60);\n\t\t\n\t\t//Bring App back to foreground & make sure that backup has finished successfully\n\t\t\n\t\t\n\t\t//Verify that the backup is completed\n\t\t\n\t\t\n\t\t// Make sure that a random image is open successfully\n\t\n\n\t\t// Make sure that the \"Image not available\" text doesn't displayed\n\t\t\n\n\n\t}", "protected void addopqueueonBackground() {\n\t\tlv.setClickable(false);\n\t\tlvx.setClickable(false);\n\t\trefresh.setClickable(false);\n\t\tsearch.setClickable(false);\n\t\tsearch.setEnabled(false);\n\t\tlv.setEnabled(false);\n\t\tlvx.setEnabled(false);\n\t\trefresh.setEnabled(false);\n\t\tcancelButton.setClickable(false);\n\t\tcancelButton.setEnabled(false);\n\t\tlistbackground.setAlpha(0.5f);\n\t\tbackground.setAlpha(0.5f);\n\t}", "protected void drawForegroundToBackground() {\n if (backgroundColor == null) { return; }\n\n final BufferedImage backgroundBufferedImage = new BufferedImage(dimension.width, dimension.height, this.bufferedImage.getType());\n final Graphics graphics = backgroundBufferedImage.getGraphics();\n\n // draw current color\n graphics.setColor(backgroundColor);\n graphics.fillRect(0, 0, dimension.width, dimension.height);\n graphics.drawImage(bufferedImage, 0, 0, null);\n\n // draw back to original\n final Graphics graphics2 = bufferedImage.getGraphics();\n graphics2.drawImage(backgroundBufferedImage, 0, 0, null);\n }", "@Override\n\t\t\tpublic void paintControl(PaintEvent arg0) {\n\t\t\t\tgc.drawImage(background,0,0);\n\t\t\t}", "@Override\n public void run() {\n overlay.remove(shadowContainerLayer);\n mViewToAnimate.setBackground(oldBackground);\n if (mViewBitmap != null) {\n mViewBitmap.recycle();\n }\n }", "public void appMovedToBackground(final AppForegroundEvent e);", "public synchronized void stopBackgroundAbruptly(){\r\n if(currentLoop0) backgroundMusicLoop0.stopClip();\r\n else backgroundMusicLoop1.stopClip();\r\n }", "public void mouseReleased(MouseEvent e) {\n\t\tif(debeColocar1) {\n \ttry {\n \t\tubicarBarco(e);\n \t} catch(NullPointerException f) {\n \t\tint color = 220;\n \t\tColor defecto = getBackground();\n \t\tfor(int i = 0; i < color ; i++) {\n \t\t\tsetBackground(new Color(i, 0, 0));\n \t\t\ttry {\n \t\t\t\tThread.sleep(1);\n \t\t\t}catch(InterruptedException j) {}\n \t\t}\n \t\tsetBackground(defecto);\n \t}\n }\n\t\t}", "protected void onPostExecute(Drawable result) {\n\t\tif(result != null){\n\t\t\tholdMe.setBackground(result);\n\t\t}\n }", "private void backgroundThreadProcessing() {\n // [ ... Time consuming operations ... ]\n }", "public void requestBackgroundChange()\n\t\t{\n\t\t\tisBackgroundChangeRequested = true;\n\t\t\trequestRender();\n\t\t}", "public void processSetImageBackground() {\n AppYesNoDialogSingleton dialog = AppYesNoDialogSingleton.getSingleton();\n \n // POP UP THE DIALOG\n dialog.show(\"Set Image Background\", \"Would you like to have a background image?\");\n \n // IF USER CHOSE YES\n if (dialog.getSelection()) {\n // WE'LL NEED TO GET CUSTOMIZED STUFF WITH THIS\n PropertiesManager props = PropertiesManager.getPropertiesManager();\n\n // AND NOW ASK THE USER FOR THE FILE TO OPEN\n FileChooser fc = new FileChooser();\n fc.setInitialDirectory(new File(PATH_WORK));\n fc.setTitle(props.getProperty(LOAD_WORK_TITLE));\n File selectedFile = fc.showOpenDialog(app.getGUI().getWindow());\n \n // SET THE BACKGROUND IMAGE\n dataManager.setImageBackground(selectedFile);\n }\n else {\n // REMOVE THE BACKGROUND IMAGE\n dataManager.removeImageBackground();\n } \n }", "@WorkerThread\n public abstract void zzaso();", "public void run() {\n mEmoteButton.setBackgroundResource(R.drawable.button_yellow);\n mIsEmotePlayable = true;\n\n }", "public void mo1402b() {\n if (CarlifeConfig.m4065a()) {\n LogUtil.d(f2837a, \"onStop: Internal screen capture not send background msg. \");\n return;\n }\n LogUtil.d(f2837a, \"onStop: full screen capture send background msg.\");\n BtHfpProtocolHelper.m3442a(false, false);\n }", "@Override\n\tprotected void onPause() {\n\t\t isbackground=1;\n\t\tsuper.onPause();\n\t\tLog.e(\"AudioDoubt\",\"OnPause called\");\n\t\t\n\t\t\n\t\t////// Code remove////\n\t\t\n\t\t///////Remove this\n\t\t\n\t\n\t\t\n\t\t\n\t}", "@Override\n public void background(Background background) {\n if (testedFeature.getBackground() == null) {\n testedFeature.setBackground(new ScenarioDefinition());\n testedFeature.getBackground().setType(ScenarioType.BACKGROUND);\n setDescribedStatementAttributes(testedFeature.getBackground(), background);\n\n backgroundSteps = true;\n }\n\n backGroundStepsRemain = backgroundStepsCount;\n }", "@Override\n public void run() {\n AnimationDrawable frameAnimation = (AnimationDrawable) img.getBackground();\n frameAnimation.stop();\n }", "private void drawBackground(Graphics2D g2d, ScreenParameters screenParameters) {\n Composite defaultComposite = g2d.getComposite();\n g2d.setComposite(LOW_OPACITY);\n g2d.drawImage(background, 0, 0, screenParameters.x, screenParameters.y, null);\n g2d.setComposite(defaultComposite);\n }", "private void setBackground() throws IOException{\n\t\tBufferedImage backgroundBufferedImage = ImageLoader.getBufferedImage(backgroundImagePath);\n\t\tmainWindow.setBackgroundImage(backgroundBufferedImage);\n\t}", "@Override\n\t\tpublic void run() {\n\t\t\tsuper.run();\n\t\t\tpreserved(bitmap);\n\t\t}", "private String addBackground() {\n\t\t// One Parameter: BGName\n\t\tStringBuilder tag = new StringBuilder();\n\t\ttag.append(\"|background:\" + parameters[0]);\n\t\treturn tag.toString();\n\n\t}", "private void updateBackground() {\n\t\tif (World.getObjects().size() < numOfParticles) {\n\t\t\tfloat x = (float) (Math.random()\n\t\t\t\t\t* (Screen.getWidth() + LEDLogo.WIDTH * 2) - LEDLogo.WIDTH), y = (float) (Math\n\t\t\t\t\t.random() * (Screen.getHeight() + LEDLogo.HEIGHT * 2) - LEDLogo.HEIGHT);\n\t\t\tWorld.add(new LEDLogo(x, y, (float) Math.random() * 0.8f + 0.2f));\n\t\t}\n\t}", "void setupBackgrounds() {\n // initialize the background tool\n BackgroundTool bgTool = new BackgroundTool(codeBaseString);\n bgSwitch = bgTool.getSwitch();\n bgChooser = bgTool.getChooser();\n }", "@DebugLog\n public int goBackground() {\n if(mLocked) return mScanManager.getMode();\n mScanManager.setMode(SCAN_BACKGROUND);\n return mScanManager.getMode();\n }", "protected void onExit() {\r\n\t\tnew DelayAsyncTask(this, 500).execute();\r\n\t}", "public void paintFinalScreen() {\n\t\tapp.image(end, 0, 0);\n\t}", "void PostRun() {\n }", "@Override\r\n public void paintComponent(Graphics g) {\r\n\r\n //Paint background\r\n g.drawImage (background, 0, 0, null);\r\n }", "@Override\n public void postFade() {\n startCapsules();\n heartBeat.startTimer();\n }", "public void enterBackground() {\n if (mRenderView != null && !(mRenderView instanceof SurfaceRenderView)) {\n removeView(mRenderView.getView());\n }\n }", "protected android.graphics.Bitmap doInBackground(java.lang.Object... r5) {\n /*\n r4 = this;\n r3 = 0;\n r1 = com.lidroid.xutils.BitmapUtils.this;\n r2 = r1.pauseTaskLock;\n monitor-enter(r2);\n L_0x0008:\n r1 = com.lidroid.xutils.BitmapUtils.this;\t Catch:{ all -> 0x007b }\n r1 = r1.pauseTask;\t Catch:{ all -> 0x007b }\n if (r1 == 0) goto L_0x0016;\n L_0x0010:\n r1 = r4.isCancelled();\t Catch:{ all -> 0x007b }\n if (r1 == 0) goto L_0x0067;\n L_0x0016:\n monitor-exit(r2);\t Catch:{ all -> 0x007b }\n r0 = 0;\n r1 = r4.isCancelled();\n if (r1 != 0) goto L_0x0042;\n L_0x001e:\n r1 = r4.getTargetContainer();\n if (r1 == 0) goto L_0x0042;\n L_0x0024:\n r1 = 1;\n r1 = new java.lang.Object[r1];\n r2 = java.lang.Integer.valueOf(r3);\n r1[r3] = r2;\n r4.publishProgress(r1);\n r1 = com.lidroid.xutils.BitmapUtils.this;\n r1 = r1.globalConfig;\n r1 = r1.getBitmapCache();\n r2 = r4.uri;\n r3 = r4.displayConfig;\n r0 = r1.getBitmapFromDiskCache(r2, r3);\n L_0x0042:\n if (r0 != 0) goto L_0x0066;\n L_0x0044:\n r1 = r4.isCancelled();\n if (r1 != 0) goto L_0x0066;\n L_0x004a:\n r1 = r4.getTargetContainer();\n if (r1 == 0) goto L_0x0066;\n L_0x0050:\n r1 = com.lidroid.xutils.BitmapUtils.this;\n r1 = r1.globalConfig;\n r1 = r1.getBitmapCache();\n r2 = r4.uri;\n r3 = r4.displayConfig;\n r0 = r1.downloadBitmap(r2, r3, r4);\n r1 = com.lidroid.xutils.bitmap.callback.BitmapLoadFrom.URI;\n r4.from = r1;\n L_0x0066:\n return r0;\n L_0x0067:\n r1 = com.lidroid.xutils.BitmapUtils.this;\t Catch:{ Throwable -> 0x007e }\n r1 = r1.pauseTaskLock;\t Catch:{ Throwable -> 0x007e }\n r1.wait();\t Catch:{ Throwable -> 0x007e }\n r1 = com.lidroid.xutils.BitmapUtils.this;\t Catch:{ Throwable -> 0x007e }\n r1 = r1.cancelAllTask;\t Catch:{ Throwable -> 0x007e }\n if (r1 == 0) goto L_0x0008;\n L_0x0078:\n monitor-exit(r2);\t Catch:{ all -> 0x007b }\n r0 = 0;\n goto L_0x0066;\n L_0x007b:\n r1 = move-exception;\n monitor-exit(r2);\t Catch:{ all -> 0x007b }\n throw r1;\n L_0x007e:\n r1 = move-exception;\n goto L_0x0008;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.lidroid.xutils.BitmapUtils.BitmapLoadTask.doInBackground(java.lang.Object[]):android.graphics.Bitmap\");\n }", "@Override\n protected BackgroundTaskResult doInBackground(Object... params)\n {\n BackgroundTaskResult retval = null;\n int paramCount = params.length;\n Object param = null;\n\n if (paramCount != 0) {\n param = params[0];\n }\n\n // controller that implements the function to be executed in background\n BaseController controller = getController();\n if (controller != null && controller instanceof BackgroundTaskListener) {\n retval = ((BackgroundTaskListener)controller).executeInBackground(param);\n }\n\n return retval;\n }", "@Override\r\n\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\twhile(!gpt.done);\r\n\t\t\t\t\t\t\t\t\tx.task().post(new Runnable(){\r\n\r\n\t\t\t\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\t\t\t\t\t\t\tNoteInJson[] pattern=gpt.getPattern();\r\n\t\t\t\t\t\t\t\t\t\t\tgotoLiveView(pattern,sound_cache);\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t}", "@Override\n\tprotected void postRun() {\n\n\t}", "private void initBackground() throws IOException{\n\t\tBufferedImage backgroundImage = ImageLoader.getBufferedImage(BACKGROUND_IMAGE_PATH);\n\t\tmainWindow.setBackgroundImage(backgroundImage);\n\t}", "@Override\n\tpublic void postRun() {\n\t}", "@Override\n\tpublic void run() {\n\t\tsuper.run();\n\t\t\n\t\tthis.alternarImagens();\n\t\t\n\t\t\n\t}", "void showProfileBackground();", "public void run() {\n \tdisposeColor(errorColor);\n \tdisposeColor(inputColor);\n \tdisposeColor(messageColor); \t\n \tdisposeColor(bkgColor); \t\n \tRGB errorRGB = PreferenceConverter.getColor(CUIPlugin.getDefault().getPreferenceStore(), BuildConsolePreferencePage.PREF_BUILDCONSOLE_ERROR_COLOR);\n \tRGB inputRGB = PreferenceConverter.getColor(CUIPlugin.getDefault().getPreferenceStore(), BuildConsolePreferencePage.PREF_BUILDCONSOLE_OUTPUT_COLOR);\n \tRGB messageRGB = PreferenceConverter.getColor(CUIPlugin.getDefault().getPreferenceStore(), BuildConsolePreferencePage.PREF_BUILDCONSOLE_INFO_COLOR);\n \tRGB bkgRGB = PreferenceConverter.getColor(CUIPlugin.getDefault().getPreferenceStore(), BuildConsolePreferencePage.PREF_BUILDCONSOLE_BACKGROUND_COLOR); \t\n \terrorColor = new Color(d, errorRGB);\n \tinputColor = new Color(d, inputRGB);\n \tmessageColor = new Color(d, messageRGB);\n \tbkgColor = new Color(d, bkgRGB);\n error.setColor(errorColor);\n input.setColor(inputColor);\n message.setColor(messageColor);\n console.setBackground(bkgColor);\n }", "private void clearbackground() {\n\t\tfive_direct_single.setBackgroundResource(0);\r\n\t\tfour_direct_single.setBackgroundResource(0);\r\n\t\ttopthree_group_three_single.setBackgroundResource(0);\r\n\t\ttopthree_group_six_single.setBackgroundResource(0);\r\n\t\ttopthree_direct_single.setBackgroundResource(0);\r\n\t\tbottomthree_direct_single.setBackgroundResource(0);\r\n\t\tbottompthree_group_three_single.setBackgroundResource(0);\r\n\t\tbottompthree_group_six_single.setBackgroundResource(0);\r\n\t\ttwo_direct_toptwo_single.setBackgroundResource(0);\r\n\t\ttwo_group_toptwo_single.setBackgroundResource(0);\r\n\t\ttwo_group_bottomtwo_single.setBackgroundResource(0);\r\n\t\ttwo_direct_bottomtwo_single.setBackgroundResource(0);\r\n\t\ttopthree_mix_group.setBackgroundResource(0);\r\n\t\tbottompthree_mix_group.setBackgroundResource(0);\r\n\t\tfive_direct_double.setBackgroundResource(0);\r\n\t\tfive_group_120.setBackgroundResource(0);\r\n\t\tfive_group_60.setBackgroundResource(0);\r\n\t\tfive_group_30.setBackgroundResource(0);\r\n\t\tfive_group_20.setBackgroundResource(0);\r\n\t\tfive_group_10.setBackgroundResource(0);\r\n\t\tfive_group_5.setBackgroundResource(0);\r\n\t\tfour_direct_double.setBackgroundResource(0);\r\n\t\tfour_group_24.setBackgroundResource(0);\r\n\t\tfour_group_12.setBackgroundResource(0);\r\n\t\ttopthree_direct_double.setBackgroundResource(0);\r\n\t\ttopthree_group_three.setBackgroundResource(0);\r\n\t\ttopthree_group_six.setBackgroundResource(0);\r\n\t\ttopthree_group_sum.setBackgroundResource(0);\r\n\t\ttopthree_group_container.setBackgroundResource(0);\r\n\t\tbottomthree_direct_double.setBackgroundResource(0);\r\n\t\tbottomthree_group_span.setBackgroundResource(0);\r\n\t\tbottomthree_group_three.setBackgroundResource(0);\r\n\t\tbottomthree_group_six.setBackgroundResource(0);\r\n\t\tbottomthree_group_sum.setBackgroundResource(0);\r\n\t\tbottomthree_group_container.setBackgroundResource(0);\r\n\t\ttwo_direct_bottomtwo_double.setBackgroundResource(0);\r\n\t\ttwo_direct_bottomtwo_sum.setBackgroundResource(0);\r\n\t\ttwo_direct_bottomtwo_span.setBackgroundResource(0);\r\n\t\ttwo_direct_toptwo_double.setBackgroundResource(0);\r\n\t\ttwo_direct_toptwo_span.setBackgroundResource(0);\r\n\t\ttwo_group_bottomtwo_double.setBackgroundResource(0);\r\n\t\ttwo_group_toptwo_double.setBackgroundResource(0);\r\n\t\tfixed_position.setBackgroundResource(0);\r\n\t\tthree_bottomthree_one_notposition.setBackgroundResource(0);\r\n\t\tthree_bottomthree_two_notposition.setBackgroundResource(0);\r\n\t\tthree_topthree_one_notposition.setBackgroundResource(0);\r\n\t\tthree_topthree_two_notposition.setBackgroundResource(0);\r\n\t\tfour_bottomfour_two_notposition.setBackgroundResource(0);\r\n\t\tfive_bottomfive_two_notposition.setBackgroundResource(0);\r\n\t\tfive_bottomfive_three_notposition.setBackgroundResource(0);\r\n\t\ttwo_group_toptwo_sum.setBackgroundResource(0);\r\n\t\tfour_group_6.setBackgroundResource(0);\r\n\t\tfour_group_4.setBackgroundResource(0);\r\n\t\tbottomthree_direct_sum.setBackgroundResource(0);\r\n\t\ttopthree_direct_sum.setBackgroundResource(0);\r\n\t\ttopthree_direct_span.setBackgroundResource(0);\r\n\t\ttopthree_sum_end.setBackgroundResource(0);\r\n\t\tbottomthree_sum_end.setBackgroundResource(0);\r\n\t\ttwo_direct_toptwo_sum.setBackgroundResource(0);\r\n\t\ttwo_group_toptwo_container.setBackgroundResource(0);\r\n\t\ttwo_group_bottomtwo_container.setBackgroundResource(0);\r\n\t\ttwo_group_bottomtwo_sum.setBackgroundResource(0);\r\n\t\tfour_bottomfour_one_notposition.setBackgroundResource(0);\r\n\t\tmaxmin_bottomtwo.setBackgroundResource(0);\r\n\t\tmaxmin_bottomthree.setBackgroundResource(0);\r\n\t\tmaxmin_toptwo.setBackgroundResource(0);\r\n\t\tmaxmin_topthree.setBackgroundResource(0);\r\n\t}", "public void finishPassing() {\n\t\n\tmyGlass = null;\n controller.donePass();\n // System.out.println(\"done animating\");\n}", "private void prepareTabBackground(final Tab tab) {\n if (!CustomTabIntentDataProvider.isTrustedCustomTab(mIntent, mSession)) return;\n\n int backgroundColor = mIntentDataProvider.getColorProvider().getInitialBackgroundColor();\n if (backgroundColor == Color.TRANSPARENT) return;\n\n // Set the background color.\n tab.getView().setBackgroundColor(backgroundColor);\n\n // Unset the background when the page has rendered.\n EmptyTabObserver mediaObserver = new EmptyTabObserver() {\n @Override\n public void didFirstVisuallyNonEmptyPaint(final Tab tab) {\n tab.removeObserver(this);\n\n // Blink has rendered the page by this point, but we need to wait for the compositor\n // frame swap to avoid flash of white content.\n mCompositorViewHolder.get().getCompositorView().surfaceRedrawNeededAsync(() -> {\n if (!tab.isInitialized()\n || ActivityUtils.isActivityFinishingOrDestroyed(mActivity)) {\n return;\n }\n tab.getView().setBackgroundResource(0);\n });\n }\n };\n\n tab.addObserver(mediaObserver);\n }", "@Override\n public void ejecutarFrame() {\n //INICIAMOS EL HILO\n try{\n Thread.sleep(250);\n }\n catch (InterruptedException ie){\n ie.printStackTrace();\n }\n\n //VAMOS CAMBIANDO EL COLOR DE LAS LETRAS DE LA PANTALLA DE INICIO\n colorLetra = colorLetra == Color.WHITE ? Color.LIGHT_GRAY : Color.WHITE;\n }", "private void drawBackground(Graphics g){\r\n g.setColor(Colors.ColorAlpha(Colors.blacks,a1));\r\n g.fillRect(0,0,w,h);\r\n if(moving){\r\n g.drawImage(Assets.burst.get((int)((game.counter%8)*0.625)),(int)(w*0.472),(int)(h*0.455),null);\r\n g.drawImage(Assets.sparks.get(((game.counter%20)/2)),(int)(w*0.465),(int)(h*0.345),null);\r\n }\r\n drawWires(g);\r\n }", "@Test(enabled = false, retryAnalyzer = Retry.class, testName = \"Sanity Tests\", description = \"Switching from Foreground to Background and vice versa use cases\",\n\t\t\tgroups = { \"Sanity Android\" })\n\tpublic void foregroundBackgroundSwitch() throws Exception, Throwable {\n\t\n\n\t}", "@OnLifecycleEvent(Lifecycle.Event.ON_STOP)\n public void onMoveToBackground() {\n Log.i(\"AppLifecycleListener\", \"Background\");\n\n }", "@Override\n\tpublic void onMessageBackgroundThread(Object arg0) {\n\t\t\n\t}", "public void overDraw() {\r\n\t\t\r\n\t\tisDrawCalled = false;\r\n\t\t\r\n\t\tLog.d(\"core\", \"Scheduler: All step done in \" + \r\n\t\t\t\t(System.currentTimeMillis() - logTimerMark) + \" ms;\");\r\n\t\t\r\n\t\tint delay = 3;\r\n\t\tstartWork(delay);\r\n\t}", "@Override\n\t\t\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tcancel.setAlpha((float)0.5);\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}", "void execute ( )\n {\n //Now do nothing because all actions are done in the graphic thread.\n //A more complex application can handle some actions in its main thread simultaneously and independent of the graphic thread.\n //\n while(this.gui.gralMng.isRunning()) {\n try {\n if(this.gui.wdgButton2.wasReleased()) {\n String textOfField = this.gui.wdgInputText.getText();\n this.gui.widgOutput.append(\"Button2 \" + (++this.ctKeyStroke2) + \" time, text=\" + textOfField + \"\\n\");\n throw new Exception(\"test\");\n }\n Thread.sleep(100); \n } catch(Exception exc){\n CharSequence sText = org.vishia.util.ExcUtil.exceptionInfo(\"unexpected: \", exc, 1, 10);\n this.log.sendMsg(9999, sText);\n }\n \n }\n }", "public void run() {\n sight.setImageBitmap(bmp);\n // old = null;\n }", "public void enterForeground();", "@WorkerThread\n public final void zza() {\n this.zza.zzc();\n if (this.zza.zzs().zza(zzat.zzbk) && this.zzb != null) {\n this.zza.zzc.removeCallbacks(this.zzb);\n }\n if (this.zza.zzs().zza(zzat.zzbw)) {\n this.zza.zzr().zzr.zza(false);\n }\n }", "private void notifyForbiddenTile(){\n\t\t\tJPanel pnl = EditorGUI.current;\n\t\t\tColor oldColor = pnl.getBackground();\n\t\t\t\n\t\t\tpnl.setBackground(new Color(240,125,125));\n\t\t\tnew Timer(delay, new ActionListener() {\t\n\t\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\t\tpnl.setBackground(oldColor);\n\t\t\t\t\t((Timer) e.getSource()).stop();\n\t\t\t\t}\n\t\t\t}).start();\n\t\t}", "@Override\n public void onDismiss() {\n backgroundAlpha(1f);\n }", "@Override\n\t\t\t\t\t\t\tpublic void onOnlineDiveDataPostBackground(\n\t\t\t\t\t\t\t\t\tArrayList<Object> resultList, String message) {\n\n\t\t\t\t\t\t\t}", "private void drawBackground() {\n\t\timgG2.setColor(Color.BLACK);\n\t\timgG2.fillRect(0,0,512, 512);\n\t\t\n\t\timgG2.setColor(Color.BLACK);\n\t\timgG2.fillRect(128, 0, 256, 512);\n\t}", "protected void doBright() {\r\n\t\talpha = 1.0f;\r\n\t\tsetAlphaOnTiles();\r\n\t\trepaint();\r\n\t}", "@Override\n protected void paintBackground(Graphics2D g) {\n g.drawImage(image, 0, 0, this);\n }", "public void run() {\n mShakeButton.setBackgroundResource(R.drawable.button_red);\n mIsShakePlayable = true;\n\n }", "public final void dyC() {\n AppMethodBeat.i(29675);\n com.tencent.mm.blink.b.HQ().o(new Runnable() {\n public final void run() {\n AppMethodBeat.i(29667);\n if (w.this.ynU) {\n ab.i(\"MicroMsg.LauncherUI.MainTabUnreadMgr\", \"remove setTagRunnable\");\n al.af(w.this.ynV);\n }\n AppMethodBeat.o(29667);\n }\n });\n AppMethodBeat.o(29675);\n }", "@Override\n public void paint(Graphics g) {\n\tsuper.paint(g);\n\t// getContentPane().setBackground(Color.orange);\n\timg = Util.createImage(getContentPane());\n\tbackColor = new Color(img.getRGB(3, 3));\n\t// img.getGraphics().setColor(Color.blue);\n\t// img.getGraphics().fillRect(0, 0, img.getWidth(), img.getHeight());\n\tdrawEntrance(new Point(557, 70), 0, img.getGraphics());\n\tgetContentPane().getGraphics().drawImage(img, 0, 0, null);\n\tanimate(g);\n\t// img = Util.createImage(getContentPane());\n\n }", "@Override\r\n\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\twhile(!(gst.done&&gpt.done));\r\n\t\t\t\t\t\t\t\t\tx.task().post(new Runnable(){\r\n\r\n\t\t\t\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\t\t\t\t\t\t\tNoteInJson[] pattern=gpt.getPattern();\r\n\t\t\t\t\t\t\t\t\t\t\tgotoLiveView(pattern,gst.resultFile);\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t}", "public synchronized void stopBackgroundSmoothly(){\r\n if(currentLoop0) backgroundMusicLoop0.fadeOut();\r\n else backgroundMusicLoop1.fadeOut();\r\n }", "@Override\r\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\tdimensionclip3.start();\r\n\t\t\t\t\t\t\tTimer fourtheffect = new Timer();\r\n\t\t\t\t\t\t\tTimerTask fourtheffecttask = new TimerTask() {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\t\t\t\t\tdimensionclip4.start();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\tfourtheffect.schedule(fourtheffecttask, 1300);\r\n\t\t\t\t\t\t}", "String getIssueBackground();", "public void stopBackground(){\n\t if(loopingSound != null){\n\t loopingSound.terminate();\n\t }\n\t\tloopingSound = null;\n\t\tactiveSounds--;\n\t}", "public void run() {\n Looper.prepare();\n backgroundHandler = new Handler(); //Handler processes only runnables. It is not required to implement handleMessage(msg)\n Looper.loop();\n }", "@Override\n\t protected Void doInBackground() throws Exception {\n Thread.sleep(SLEEP_TIME);\n return null;\n }", "void disableBackgroundDate();", "@Override\r\n\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\tdimensionclip4.start();\r\n\t\t\t\t\t\t\t\t}", "private void createBackground()\n {\n GreenfootImage background = getBackground();\n background.setColor(Color.BLACK);\n background.fill();\n }", "@Override\n public void run() {\n AnimationDrawable frameAnimation = (AnimationDrawable) img.getBackground();\n frameAnimation.start();\n }", "@Override\r\n\t\t\t\tpublic void run() {\n\t\t\t\t\tdimensionclip2.start(); // 두번째 효과음 재생\r\n\t\t\t\t\tTimer thirdeffect = new Timer();\r\n\t\t\t\t\tTimerTask thirdeffecttask = new TimerTask() {\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\t\t\tdimensionclip3.start();\r\n\t\t\t\t\t\t\tTimer fourtheffect = new Timer();\r\n\t\t\t\t\t\t\tTimerTask fourtheffecttask = new TimerTask() {\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\t\t\t\t\tdimensionclip4.start();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t};\r\n\t\t\t\t\t\t\tfourtheffect.schedule(fourtheffecttask, 1300);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t};\r\n\t\t\t\t\tthirdeffect.schedule(thirdeffecttask, 1400);\r\n\t\t\t\t}", "@Override\n\tpublic void postProcessAction(GwtEvent e) {\n\t\t\n\t}", "@Override\r\n\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\twhile(!gpt.done);\r\n\t\t\t\t\t\t\t\tx.task().post(new Runnable(){\r\n\r\n\t\t\t\t\t\t\t\t\t@Override\r\n\t\t\t\t\t\t\t\t\tpublic void run() {\r\n\t\t\t\t\t\t\t\t\t\t// TODO Auto-generated method stub\r\n\t\t\t\t\t\t\t\t\t\tNoteInJson[] pattern=gpt.getPattern();\r\n\t\t\t\t\t\t\t\t\t\tif(change_tempo){\r\n\t\t\t\t\t\t\t\t\t\t\tPatternMaker.changeSpeed(pattern, ratio);\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\tgotoPractice(pattern);\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t}", "@Override\n\tpublic void run() {\n\t\twhile (runFlag) {\n//\t\t\tSystem.out.println(\"\");\n\t\t\ttry {\n\t\t\t\tThread.sleep(30);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tCanvas canvas = null;\n\t\t\ttry {\n\t\t\t\tcanvas = holder.lockCanvas();\n\t\t\t\tDataInfo.canvas = canvas;\n\t\t\t\t\n\t\t\t\t// 画出,移动人物\n\t\t\t\tDataInfo.fish.draw(canvas);\n\t\t\t\t\n\t\t\t\t\n//\t\t\t\tif(GameData.BACKPRESS){\n//\t\t\t\t\treturn ;\n//\t\t\t\t}\n\t\t\t\t\n\n\t\t\t} catch (Exception ex) {\n\t\t\t\tex.printStackTrace();\n\n\t\t\t} finally {\n\t\t\t\tif (canvas != null)\n\t\t\t\t\tholder.unlockCanvasAndPost(canvas);\n\t\t\t}\n\t\t}\n\t}", "@Override\n\t\tpublic void run() {\n\n\t\t\tif (cancel == true)\n\t\t\t\tupdateBarHandler.removeCallbacks(updateThread2);\n\t\t\telse {\n\t\t\t\t// 执行预处理:简单线性灰度变换\n\t\t\t\tbm = preProcess.linearGray(bm);\n\t\t\t\t// 装载\n\t\t\t\tmyImageView2.setImageBitmap(bm);\n\t\t\t\t// 设置进度条\n\t\t\t\tbar.setProgress(100 / N * 3);\n\t\t\t\tupdateBarHandler.post(updateThread3);\n\t\t\t}\n\t\t}", "public void act() \r\n {\r\n GreenfootImage img = new GreenfootImage(500,500);\r\n img.setColor(Color.RED);\r\n float fontSize = 25.0f; \r\n Font font = img.getFont().deriveFont(fontSize);\r\n img.setFont(font); \r\n img.drawString(\"Press enter to retry\",50,50);\r\n setImage(img);\r\n }", "private void drawBackground(Graphics2D g2d, int wid, int hei) {\n g2d.setColor(Light_Gray);\n Triangle triangle1 = new Triangle(new Point(0, 0), new Point(0, hei), new Point(wid, 0));\n triangle1.fill(g2d);\n g2d.setColor(Dark_Gray);\n Triangle triangle2 = new Triangle(new Point(wid, hei), new Point(0, hei), new Point(wid, 0));\n triangle2.fill(g2d);\n Triangle triangle3 = new Triangle(new Point(wid, 0), new Point(wid, 15), new Point(wid - 15, 15));\n triangle3.fill(g2d);\n g2d.setColor(Light_Gray);\n Triangle triangle4 = new Triangle(new Point(0, hei), new Point(0, hei - 15), new Point(15, hei - 15));\n triangle4.fill(g2d);\n g2d.setColor(Gray);\n g2d.fillRect(6, 6, wid - 12, hei - 12);\n }", "@Override\r\n\t\tpublic void mouseExited(MouseEvent e) {\n\t\t\tComponent com = (Component)e.getSource(); //마우스가 올라간 컴포넌트 알아냄.\r\n\t\t\tcom.setBackground(null);\r\n\t\t\t\r\n\t\t}", "private void drawBG(Batch batch) {\n\t\tbackgroundSprite.setRegion(baybayinAnimation.getKeyFrame(animationCounter, true));\n\t}" ]
[ "0.7111375", "0.67072487", "0.62702256", "0.62490106", "0.6175428", "0.60353327", "0.6016679", "0.60026246", "0.59887743", "0.58195907", "0.5681197", "0.56440127", "0.56204414", "0.5489005", "0.5480766", "0.5471633", "0.5446574", "0.54459715", "0.5435274", "0.5425006", "0.5419573", "0.5418326", "0.5417172", "0.54117477", "0.54067343", "0.5388589", "0.5380083", "0.53538644", "0.53513426", "0.53481406", "0.53469217", "0.5341204", "0.5333001", "0.5324811", "0.53177017", "0.531704", "0.52890706", "0.5276509", "0.5269306", "0.5267764", "0.52662534", "0.5243486", "0.5233795", "0.52249545", "0.5211762", "0.52074325", "0.5181545", "0.5175098", "0.51668936", "0.5162644", "0.5152926", "0.5141027", "0.5128377", "0.51254237", "0.5115339", "0.5111796", "0.5108584", "0.50913066", "0.50803757", "0.50735015", "0.5067516", "0.5064397", "0.50629354", "0.5058178", "0.5057734", "0.5051011", "0.50483096", "0.5048072", "0.5046075", "0.50454766", "0.50421566", "0.5041989", "0.5038094", "0.5037035", "0.5030235", "0.50281954", "0.50271726", "0.502438", "0.50176054", "0.50050384", "0.50030565", "0.5002569", "0.50012195", "0.49946958", "0.4992182", "0.4988363", "0.49868295", "0.4979958", "0.49796388", "0.4976731", "0.49700415", "0.4969529", "0.49662173", "0.4964096", "0.49622518", "0.4954851", "0.49527353", "0.494729", "0.49453706", "0.49434504", "0.4942167" ]
0.0
-1
Created by Administrator on 2017/5/25.
public interface IAwardPresenter { void setBgaAdpaterAndClick(Context context,int pagepn); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private stendhal() {\n\t}", "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "public final void mo51373a() {\n }", "public void mo38117a() {\n }", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n public void memoria() {\n \n }", "private static void cajas() {\n\t\t\n\t}", "@Override\n protected void initialize() {\n\n \n }", "@Override\n\tpublic void anular() {\n\n\t}", "public void mo4359a() {\n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "private Rekenhulp()\n\t{\n\t}", "Petunia() {\r\n\t\t}", "@Override\n protected void initialize() \n {\n \n }", "public contrustor(){\r\n\t}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n public void settings() {\n // TODO Auto-generated method stub\n \n }", "private TMCourse() {\n\t}", "@Override\n public void init() {\n\n }", "@Override\r\n\tpublic void publierEnchere() {\n\t\t\r\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n\tpublic void create () {\n\n\t}", "public Pitonyak_09_02() {\r\n }", "protected MetadataUGWD() {/* intentionally empty block */}", "public void mo55254a() {\n }", "private RepositorioAtendimentoPublicoHBM() {\r\t}", "@Override\n\tpublic void create() {\n\t\t\n\t}", "Constructor() {\r\n\t\t \r\n\t }", "public void designBasement() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "public void mo6081a() {\n }", "public void autoDetails() {\n\t\t\r\n\t}", "private void init() {\n\n\t}", "@Override\n void init() {\n }", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n public void func_104112_b() {\n \n }", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "public void gored() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "public void verarbeite() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n public void init() {\n }", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "public void create() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "private void poetries() {\n\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "private UsineJoueur() {}", "public void mo12930a() {\n }", "private Singletion3() {}", "@SuppressWarnings(\"unused\")\n\tprivate void version() {\n\n\t}", "protected Doodler() {\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "@Override\n\tpublic void create() {\n\n\t}", "private ReportGenerationUtil() {\n\t\t\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "private static void oneUserExample()\t{\n\t}", "private void getStatus() {\n\t\t\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void create() {\n\r\n\t}", "@Override\n\tpublic void emprestimo() {\n\n\t}", "@Override\r\n\tprotected void initialize() {\n\r\n\t}" ]
[ "0.6291351", "0.61143273", "0.58851165", "0.58840513", "0.5849571", "0.5833249", "0.5821043", "0.5759452", "0.5758597", "0.5744525", "0.5744525", "0.57264096", "0.5725081", "0.5725081", "0.57208633", "0.5675805", "0.56750727", "0.5670423", "0.5668386", "0.5660013", "0.5659535", "0.565196", "0.5645848", "0.5643266", "0.562847", "0.559021", "0.5578287", "0.55771106", "0.55709696", "0.55709696", "0.55709696", "0.55709696", "0.55709696", "0.55709696", "0.55709696", "0.5562488", "0.55605227", "0.5555354", "0.55550194", "0.5519246", "0.5513858", "0.5513858", "0.5513858", "0.5513858", "0.5513858", "0.5513858", "0.5513417", "0.5505368", "0.547867", "0.5476232", "0.5475802", "0.5471311", "0.54706544", "0.54590106", "0.54491025", "0.5445278", "0.54399097", "0.54359275", "0.54283506", "0.54257256", "0.54257256", "0.5425445", "0.5424171", "0.5423091", "0.54179", "0.5414309", "0.5413727", "0.5399325", "0.5396978", "0.5396059", "0.5396059", "0.5396059", "0.5396059", "0.5396059", "0.5391855", "0.5389068", "0.53837126", "0.53813666", "0.5377854", "0.5369685", "0.5367293", "0.53607786", "0.5360645", "0.53597856", "0.5358552", "0.5358087", "0.5358087", "0.5356884", "0.53503656", "0.5349873", "0.5348465", "0.5348465", "0.5348465", "0.53423166", "0.53382075", "0.53347856", "0.53347856", "0.53347856", "0.533217", "0.533012", "0.5328129" ]
0.0
-1
Handle action bar item clicks here. The action bar will automatically handle clicks on the Home/Up button, so long as you specify a parent activity in AndroidManifest.xml.
@Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { return true; } return super.onOptionsItemSelected(item); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onOptionsItemSelected(MenuItem item) { Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n\n //\n // HANDLE BACK BUTTON\n //\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // Back button clicked\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // app icon in action bar clicked; goto parent activity.\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n switch (id) {\r\n case android.R.id.home:\r\n // app icon in action bar clicked; go home\r\n this.finish();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // app icon in action bar clicked; go home\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n Log.e(\"clik\", \"action bar clicked\");\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n\t public boolean onOptionsItemSelected(MenuItem item) {\n\t int id = item.getItemId();\n\t \n\t\t\tif (id == android.R.id.home) {\n\t\t\t\t// Respond to the action bar's Up/Home button\n\t\t\t\t// NavUtils.navigateUpFromSameTask(this);\n\t\t\t\tonBackPressed();\n\t\t\t\treturn true;\n\t\t\t}\n\t \n\t \n\t return super.onOptionsItemSelected(item);\n\t }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n switch (item.getItemId()) {\r\n // Respond to the action bar's Up/Home button\r\n case android.R.id.home:\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n\n switch (item.getItemId()) {\n case android.R.id.home:\n\n // app icon in action bar clicked; goto parent activity.\n this.finish();\n return true;\n default:\n\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n\n switch (item.getItemId()) {\n case android.R.id.home:\n\n // app icon in action bar clicked; goto parent activity.\n this.finish();\n return true;\n default:\n\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tonBackPressed();\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Handle presses on the action bar items\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n case R.id.action_clear:\n return true;\n case R.id.action_done:\n\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n onActionHomePressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n switch (item.getItemId())\n {\n case android.R.id.home :\n super.onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId ()) {\n case android.R.id.home:\n onBackPressed ();\n return true;\n\n default:\n break;\n }\n return super.onOptionsItemSelected ( item );\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t switch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\t// app icon in action bar clicked; go home \n\t\t\tIntent intent = new Intent(this, Kelutral.class); \n\t\t\tintent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); \n\t\t\tstartActivity(intent); \n\t\t\treturn true;\t\t\n\t case R.id.Search:\n\t \treturn onSearchRequested();\n\t\tcase R.id.AppInfo:\n\t\t\t// Place holder menu item\n\t\t\tIntent newIntent = new Intent(Intent.ACTION_VIEW,\n\t\t\t\t\tUri.parse(\"http://forum.learnnavi.org/mobile-apps/\"));\n\t\t\tstartActivity(newIntent);\n\t\t\treturn true;\n\t\tcase R.id.Preferences:\n\t\t\tnewIntent = new Intent(getBaseContext(), Preferences.class);\n\t\t\tstartActivity(newIntent);\n\t\t\treturn true;\t\n\t }\n\t return false;\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\n case android.R.id.home:\n onBackPressed();\n return true;\n\n }\n return super.onOptionsItemSelected(item);\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // Intent homeIntent = new Intent(this, MainActivity.class);\n // homeIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n // startActivity(homeIntent);\n finish();\n return true;\n default:\n return (super.onOptionsItemSelected(item));\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // setResult and close the activity when Action Bar Up Button clicked.\n if (item.getItemId() == android.R.id.home) {\n setResult(RESULT_CANCELED);\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // This ID represents the Home or Up button. In the case of this\n // activity, the Up button is shown. Use NavUtils to allow users\n // to navigate up one level in the application structure. For\n // more details, see the Navigation pattern on Android Design:\n //\n // http://developer.android.com/design/patterns/navigation.html#up-vs-back\n //\n \tgetActionBar().setDisplayHomeAsUpEnabled(false);\n \tgetFragmentManager().popBackStack();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n switch (item.getItemId()) {\n case android.R.id.home:\n super.onBackPressed();\n return true;\n\n default:\n // If we got here, the user's action was not recognized.\n // Invoke the superclass to handle it.\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if(id == android.R.id.home){\n onBackPressed();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@RequiresApi(api = Build.VERSION_CODES.M)\n @Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tif(item.getItemId()==android.R.id.home)\r\n\t\t{\r\n\t\t\tgetActivity().onBackPressed();\r\n\t\t}\r\n\t\treturn super.onOptionsItemSelected(item);\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if(item.getItemId()==android.R.id.home){\n super.onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n return false;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n //Back arrow\n case android.R.id.home:\n onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // android.R.id.home是Android内置home按钮的id\n finish();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n super.onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n this.onBackPressed();\n return false;\n }\n return false;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n int id = item.getItemId();\n\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n switch (item.getItemId()) {\r\n\r\n case android.R.id.home:\r\n /*Intent i= new Intent(getApplication(), MainActivity.class);\r\n i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);\r\n startActivity(i);*/\r\n onBackPressed();\r\n finish();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case android.R.id.home:\n this.finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n NavUtils.navigateUpFromSameTask(getActivity());\n return true;\n case R.id.action_settings:\n Intent i = new Intent(getActivity(), SettingsActivity.class);\n startActivity(i);\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Pass the event to ActionBarDrawerToggle, if it returns\n // true, then it has handled the app icon touch event\n if (mDrawerToggle.onOptionsItemSelected(item)) {\n return true;\n }\n\n // Handle your other action bar items...\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n //Fixes the Up Button\n if(id == android.R.id.home) {\n BuildRoute.this.finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()){\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return true;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n if (id == android.R.id.home) {\n NavUtils.navigateUpFromSameTask(this);\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\r\n case android.R.id.home:\r\n onBackPressed();\r\n break;\r\n }\r\n return true;\r\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tif (item.getItemId() == android.R.id.home) {\n\t\t\tfinish();\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n onBackPressed();\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n if ( id == android.R.id.home ) {\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.home) {\r\n NavUtils.navigateUpFromSameTask(this);\r\n return true;\r\n }\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_about) {\r\n AboutDialog();\r\n return true;\r\n }\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_exit) {\r\n finish();\r\n return true;\r\n }\r\n\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n//noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n// finish the activity\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item)\n {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if( id == android.R.id.home ) // Back button of the actionbar\n {\n finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\t\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\t\tswitch (item.getItemId()) {\r\n\t\t\tcase android.R.id.home:\r\n\t\t\t\tfinish();\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\treturn super.onOptionsItemSelected(item);\r\n\t\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n\n this.finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n onBackPressed();\n return true;\n }\n return false;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n if(id == android.R.id.home){\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n if (item.getItemId() == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\r\n\t\tcase android.R.id.home:\r\n\t\t\tsetResult(RESULT_OK, getIntent());\r\n\t\t\tfinish();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n finish();\n return true;\n default:\n // If we got here, the user's action was not recognized.\n // Invoke the superclass to handle it.\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\tbreak;\n\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n\n case android.R.id.home:\n this.finish();\n return true;\n }\n return true;\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tint id = item.getItemId();\n\t\tif (id == android.R.id.home) {\n\t\t\tfinish();\n\t\t\treturn true;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n if (id == android.R.id.home) {\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n //NavUtils.navigateUpFromSameTask(this);\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // todo: goto back activity from here\n finish();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n // Handle item selection\r\n switch (item.getItemId()) {\r\n case android.R.id.home:\r\n onBackPressed();\r\n return true;\r\n\r\n case me.cchiang.lookforthings.R.id.action_sample:\r\n// Snackbar.make(parent_view, item.getTitle() + \" Clicked \", Snackbar.LENGTH_SHORT).show();\r\n return true;\r\n default:\r\n return super.onOptionsItemSelected(item);\r\n }\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n\n\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tonBackPressed();\n\t\t\treturn true;\n\t\tcase R.id.scan_menu:\n\t\t\tonScan();\n\t\t\tbreak;\n\t\tcase R.id.opt_about:\n\t\t\t//onAbout();\n\t\t\tbreak;\n\t\tcase R.id.opt_exit:\n\t\t\tfinish();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t\treturn true;\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n super.onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n this.finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(@NonNull MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\n case android.R.id.home:\n finish();\n return true;\n\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\r\n\t switch (item.getItemId()) {\r\n\t \t// back to previous page\r\n\t case android.R.id.home:\r\n\t finish();\r\n\t return true;\r\n\t }\r\n\t return super.onOptionsItemSelected(item);\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if(id==android.R.id.home){\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == android.R.id.home) {\r\n // finish the activity\r\n onBackPressed();\r\n return true;\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == android.R.id.home) {\r\n // finish the activity\r\n onBackPressed();\r\n return true;\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId())\n {\n case android.R.id.home:\n this.finish();\n return (true);\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case R.id.home:{\n NavUtils.navigateUpFromSameTask(this);\n return true;\n }\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n switch(item.getItemId())\n {\n case android.R.id.home:\n super.onBackPressed();\n break;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\treturn true;\n\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t}", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n\r\n int id = item.getItemId();\r\n if(id==android.R.id.home){\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }" ]
[ "0.7904066", "0.7804976", "0.7766218", "0.7726716", "0.7631313", "0.76221544", "0.7584775", "0.7530617", "0.74878734", "0.7457033", "0.7457033", "0.74380976", "0.7421477", "0.7402898", "0.7391322", "0.7386477", "0.73788774", "0.7370012", "0.7362617", "0.73555875", "0.73451835", "0.73418057", "0.73298967", "0.73283297", "0.7325109", "0.7318501", "0.73162323", "0.7313179", "0.7303658", "0.7303658", "0.7301155", "0.7297718", "0.7292956", "0.7286341", "0.72828627", "0.72805357", "0.7278157", "0.72596914", "0.72593665", "0.72593665", "0.72593665", "0.7259005", "0.724937", "0.72248167", "0.7219095", "0.7217289", "0.72042423", "0.7200424", "0.72000813", "0.71935385", "0.71848804", "0.7178161", "0.71682125", "0.71670973", "0.7153767", "0.71535325", "0.7136499", "0.71345866", "0.71345866", "0.7129392", "0.7128763", "0.71239245", "0.7122973", "0.7122687", "0.7122104", "0.71169454", "0.7116821", "0.71165425", "0.71165425", "0.71165425", "0.71165425", "0.71160954", "0.711461", "0.711215", "0.71094537", "0.71084976", "0.7105594", "0.70996004", "0.7098039", "0.7095679", "0.70935696", "0.70935696", "0.70862824", "0.70829386", "0.70803833", "0.70799434", "0.7073132", "0.70682305", "0.7061713", "0.7060338", "0.7060053", "0.70512676", "0.7037155", "0.7037155", "0.7035636", "0.70352966", "0.70352966", "0.70329386", "0.70302224", "0.7029258", "0.70191014" ]
0.0
-1
Handle navigation view item clicks here.
@SuppressWarnings("StatementWithEmptyBody") @Override public boolean onNavigationItemSelected(MenuItem item) { int getid = item.getItemId(); if (getid == R.id.nav_home) { Intent intent1 = new Intent(this, MenuActivity.class); bundleData = new Bundle(); bundleData.putString("ID",id); bundleData.putString("POSITION",position); intent1.putExtra("ID_DATA", bundleData); startActivity(intent1); Toast.makeText(this, "home", Toast.LENGTH_SHORT).show(); } else if (getid == R.id.nav_check) { Intent intent2 = new Intent(this, checkActivity.class); bundleData = new Bundle(); bundleData.putString("ID",id); bundleData.putString("POSITION",position); intent2.putExtra("ID_DATA", bundleData); startActivity(intent2); Toast.makeText(this, "check", Toast.LENGTH_SHORT).show(); } else if (getid == R.id.nav_checkList) { Intent intent3 = new Intent(this, st_CheckListActivity.class); bundleData = new Bundle(); bundleData.putString("ID",id); bundleData.putString("POSITION",position); intent3.putExtra("ID_DATA", bundleData); startActivity(intent3); Toast.makeText(this, "nav_checkList", Toast.LENGTH_SHORT).show(); } DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout); drawer.closeDrawer(GravityCompat.START); return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void onNavigationItemClicked(Element element);", "@Override\n public void onClick(View view) { listener.onItemClick(view, getPosition()); }", "void onDialogNavigationItemClicked(Element element);", "@Override\n public void onClick(View view) {\n itemInterface.OnItemClickedListener(tracks, getAdapterPosition());\n }", "@Override\n public void onClickItem(MeowBottomNavigation.Model item) {\n }", "@Override\n public void onClickItem(MeowBottomNavigation.Model item) {\n }", "@Override\n public void onClick(View view) {\n listener.menuButtonClicked(view.getId());\n }", "@Override\r\n\tpublic boolean onNavigationItemSelected(int itemPosition, long itemId) {\n\t\tLog.d(\"SomeTag\", \"Get click event at position: \" + itemPosition);\r\n\t\tswitch (itemPosition) {\r\n\t\tcase 1:\r\n\t\t\tIntent i = new Intent();\r\n\t\t\ti.setClass(getApplicationContext(), MainActivity.class);\r\n\t\t\tstartActivity(i);\r\n\t\t\t//return true;\r\n\t\t\tbreak;\r\n\t\tcase 2 :\r\n\t\t\tIntent intent = new Intent(this,WhiteListActivity.class);\r\n\t\t\tstartActivity(intent);\r\n\t\t\t//return true;\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t}", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n String name = navDrawerItems.get(position).getListItemName();\n // call a helper method to perform a corresponding action\n performActionOnNavDrawerItem(name);\n }", "@Override\n\tpublic void rightNavClick() {\n\t\t\n\t}", "@Override\n public void OnItemClick(int position) {\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif (itemClicked != null)\n\t\t\t\t\titemClicked.OnItemClicked((BusinessType)item.getTag(), item);\n\t\t\t}", "@Override\n public void onClick(View view) {\n clickListener.onItemClicked(getBindingAdapterPosition());\n }", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\n\t\t\t\t\tint position, long id) {\n\t\t\t\thandleClick(position);\n\t\t\t}", "@Override\n public void onItemClicked(int itemPosition, Object dataObject) {\n }", "@Override\n public void onItemClick(int pos) {\n }", "@Override\n public void onClick(View v) {\n if (listener != null)\n listener.onItemClick(itemView, getPosition());\n }", "private void handleNavClick(View view) {\n final String label = ((TextView) view).getText().toString();\n if (\"Logout\".equals(label)) {\n logout();\n }\n if (\"Profile\".equals(label)) {\n final Intent intent = new Intent(this, ViewProfileActivity.class);\n startActivity(intent);\n }\n if (\"Search\".equals(label)){\n final Intent intent = new Intent(this, SearchActivity.class);\n startActivity(intent);\n }\n if (\"Home\".equals(label)) {\n final Intent intent = new Intent(this, HomeActivity.class);\n startActivity(intent);\n }\n }", "void onMenuItemClicked();", "@Override\n public void onClick(View view) {\n\n switch (view.getId()) {\n case R.id.tvSomeText:\n listener.sendDataToActivity(\"MainActivity: TextView clicked\");\n break;\n\n case -1:\n listener.sendDataToActivity(\"MainActivity: ItemView clicked\");\n break;\n }\n }", "@Override\n\t\t\t\t\t\t\t\tpublic void onClick(View arg0) {\n\t\t\t\t\t\t\t\t\tMainActivity sct = (MainActivity) act;\n\t\t\t\t\t\t\t\t\tsct.onItemClick(posit2, 11);\n\t\t\t\t\t\t\t\t}", "@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t}", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\n\t\t\t}", "@Override\n public void onClick(View v) {\n listener.onItemClick(v, position);\n }", "@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t\t\n\t}", "@Override\n public void onItemClick(View view, String data) {\n }", "abstract public void onSingleItemClick(View view);", "@Override\n public void onClick(View v) {\n this.itemClickListener.onItemClick(v, getLayoutPosition());\n }", "@Override\n public void itemClick(int pos) {\n }", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {\n TextView textView = (TextView)view;\n switch(textView.getText().toString()){\n case \"NavBar\":\n Intent nav = new Intent(this, NavDrawerActivity.class);\n startActivity(nav);\n break;\n }\n\n //Toast.makeText(MainActivity.this,\"Go to \" + textView.getText().toString() + \" page.\",Toast.LENGTH_LONG).show();\n }", "@Override\r\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\t\t\r\n\t}", "@Override\n\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\tlong arg3) {\n\t\t\t\n\t\t}", "@Override\n public void onItemClick(Nson parent, View view, int position) {\n }", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\t\t\t\t\tlong arg3) {\n\t\t\t}", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\t\t\t\t\n\t\t\t}", "@Override\n public void onClick(View view) {\n int position = getAdapterPosition();\n\n // Check if listener!=null bcz it is not guarantee that we'll call setOnItemClickListener\n // RecyclerView.NO_POSITION - Constant for -1, so that we don't click item at Invalid position (safety measure)\n if (listener != null && position != RecyclerView.NO_POSITION) {\n //listener.onItemClick(notes.get(position)); - used in RecyclerView.Adapter\n listener.onItemClick(getItem(position)); // getting data from superclass\n }\n }", "@Override\n public void onClick(View v) {\n itemClickListener.itemClicked(movieId, v);\n }", "@Override\n\t\tpublic void onClick(View view) {\n\t\t\tif (iOnItemClickListener != null) {\n\t\t\t\tiOnItemClickListener.onItemClick(view, null, getAdapterPosition());\n\t\t\t}\n\t\t}", "@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\n\t}", "@Override\n\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {\n\n\t}", "public void onItemClick(View view, int position);", "@Override\n public void onClick(View v) {\n if (mListener != null){\n mListener.onItemClick(itemView, getLayoutPosition());\n }\n }", "@Override\n public void onItemClick(int position) {\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\titemClickListener.Callback(itemInfo);\n\t\n\t\t\t}", "@Override\n public void onItemClick(View view, int position) {\n }", "@Override\n public void onItemClick(View view, int position) {\n }", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\t\t\t}", "@Override\n public void onItemOfListClicked(Object o) {\n UserProfileFragmentDirections.ActionUserProfileFragmentToEventProfileFragment action = UserProfileFragmentDirections.actionUserProfileFragmentToEventProfileFragment((MyEvent) o);\n navController.navigate(action);\n }", "@Override\n public void onClick(View view) {\n if(mFrom.equals(NetConstants.BOOKMARK_IN_TAB)) {\n IntentUtil.openDetailActivity(holder.itemView.getContext(), NetConstants.G_BOOKMARK_DEFAULT,\n bean.getArticleUrl(), position, bean.getArticleId());\n }\n else {\n IntentUtil.openDetailActivity(holder.itemView.getContext(), mFrom,\n bean.getArticleUrl(), position, bean.getArticleId());\n }\n }", "@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_ds_note) {\n // Handle the camera action\n } else if (id == R.id.nav_ds_todo) {\n\n } else if (id == R.id.nav_ql_the) {\n\n } else if (id == R.id.nav_tuychinh) {\n Intent intent = new Intent(this, CustomActivity.class);\n startActivity(intent);\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "@Override\n\t\t\t\t\t\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\n\t\t\t\t\t\t\t\t\t\tint position, long id) {\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t}", "@Override\n public void onItemClick(View view, ListItem obj, int position) {\n }", "@Override\n\tpublic void onItemClick(Object o, int position) {\n\n\t}", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\n\t\t\t}", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\n\t\t\t}", "void onLinkClicked(@Nullable ContentId itemId);", "@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case R.id.home:\n Intent homeIntent = new Intent(this, MainActivity.class);\n startActivity(homeIntent);\n break;\n case R.id.send_email:\n Intent mailIntent = new Intent(this, ContactActivity.class);\n startActivity(mailIntent);\n break;\n case R.id.send_failure_ticket:\n Intent ticketIntent = new Intent(this, TicketActivity.class);\n startActivity(ticketIntent);\n break;\n case R.id.position:\n Intent positionIntent = new Intent(this, LocationActivity.class);\n startActivity(positionIntent);\n break;\n case R.id.author:\n UrlRedirect urlRed = new UrlRedirect(this.getApplicationContext(),getString(R.string.linkedinDeveloper));\n urlRed.redirect();\n break;\n default:\n break;\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout_main_activity);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "@SuppressWarnings(\"ConstantConditions\")\n public void onItemClicked(@NonNull Item item) {\n getView().openDetail(item);\n }", "void onItemClick(View view, int position);", "@Override\n public void onClick(View v) {\n startNavigation();\n }", "void onItemClick(int position);", "@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(@NonNull MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_logs) {\n startActivity(new Intent(this, LogView.class));\n } else if (id == R.id.nav_signOut) {\n signOut();\n }\n\n DrawerLayout drawer = findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "@Override\n public void onClick(View v) {\n if(listener!=null & getLayoutPosition()!=0)\n listener.onItemClick(itemView, getLayoutPosition());\n }", "@Override\n\tpublic void onItemClick(AdapterView<?> parent, View view, int position,\n\t\t\tlong id) {\n\t\tpresenter.onItemClicked(position);\n\t}", "@Override\n public void onClick(View view) {\n listener.onMenuButtonSelected(view.getId());\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view,\n int position, long id) {\n }", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\t\t\t\tHashMap<String, Object> item = (HashMap<String, Object>) arg0\n\t\t\t\t\t\t.getAdapter().getItem(arg2);\n\n\t\t\t\tIntent intent = new Intent(ViewActivity.this,\n\t\t\t\t\t\tContentActivity.class);\n\t\t\t\tBundle bundle = new Bundle();\n\t\t\t\tbundle.putString(\"_id\", item.get(\"_id\").toString());\n\t\t\t\tbundle.putString(\"_CityEventID\", item.get(\"_CityEventID\")\n\t\t\t\t\t\t.toString());\n\t\t\t\tbundle.putString(\"_type\", String.valueOf(_type));\n\t\t\t\tintent.putExtras(bundle);\n\t\t\t\tstartActivity(intent);\n\t\t\t}", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onClick(View view) {\n Navigation.findNavController(view).navigate(R.id.addEventFragment);\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n Log.w(TAG , \"POSITION : \" + position);\n\n itemClick(position);\n }", "void clickItem(int uid);", "@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(@NonNull MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_categories) {\n Intent intent = new Intent(getApplicationContext(), CategoryActivity.class);\n startActivity(intent, compat.toBundle());\n newsHere.setSourceActivity(\"search\");\n newsHere.setTargetActivity(\"category\");\n\n } else if (id == R.id.nav_top_headlines) {\n newsHere.setSourceActivity(\"search\");\n newsHere.setTargetActivity(\"home\");\n Intent intent = new Intent(getApplicationContext(), HomeActivity.class);\n startActivity(intent, compat.toBundle());\n } else if (id == R.id.nav_search) {\n // Do nothing\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "@Override\n public void onItemClick(View view, int position) {\n\n }", "@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_orders) {\n\n Intent orderStatusIntent = new Intent(Home.this , OrderStatus.class);\n startActivity(orderStatusIntent);\n\n } else if (id == R.id.nav_banner) {\n\n Intent bannerIntent = new Intent(Home.this , BannerActivity.class);\n startActivity(bannerIntent);\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n }", "public void onItemClick(View view, int position) {\n\n }", "@Override\n\tpublic void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n\t}", "@Override\n\tpublic void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n\t}", "@Override\r\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\r\n\t\t\t\t\tlong arg3) {\n\r\n\t\t\t}", "void onClick(View item, View widget, int position, int which);", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position,\n long id) {\n\n\n }", "@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n Intent intent;\n switch(item.getItemId()){\n case R.id.nav_home:\n finish();\n intent = new Intent(this, NavigationActivity.class);\n startActivity(intent);\n return true;\n case R.id.nav_calendar:\n finish();\n intent = new Intent(this, EventHome.class);\n startActivity(intent);\n return true;\n case R.id.nav_discussion:\n return true;\n case R.id.nav_settings:\n intent = new Intent(this, SettingsActivity.class);\n startActivity(intent);\n return true;\n case R.id.nav_app_blocker:\n intent = new Intent(this, AppBlockingActivity.class);\n startActivity(intent);\n return true;\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "@Override\n public boolean onNavigationItemSelected(@NonNull MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n\n case R.id.nav_home:\n break;\n\n case R.id.nav_favourites:\n\n if (User.getInstance().getUser() == null) {\n Intent intent = new Intent(getApplicationContext(), LoginActivity.class);\n startActivity(intent);\n }\n\n Intent intent = new Intent(getApplicationContext(), PlaceItemListActivity.class);\n startActivity(intent);\n\n break;\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tonRgtRgtMenuClick(v);\n\t\t\t}", "@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_camera) {\n // Handle the camera action\n } else if (id == R.id.nav_gallery) {\n Toast.makeText(this, \"gallery is clicked!\", Toast.LENGTH_LONG).show();\n\n } else if (id == R.id.nav_slideshow) {\n\n } else if (id == R.id.nav_manage) {\n\n } else if (id == R.id.nav_share) {\n\n } else if (id == R.id.nav_send) {\n\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "public void menuClicked(MenuItem menuItemSelected);", "@Override\n public void onItemClick(int position) {\n }", "@Override\n public void onItemClick(int position) {\n }", "@SuppressWarnings(\"StatementWithEmptyBody\")\n @Override\n public boolean onNavigationItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == R.id.nav_my_account) {\n startActivity(new Intent(this, MyAccountActivity.class));\n } else if (id == R.id.nav_message_inbox) {\n startActivity(new Intent(this, MessageInboxActivity.class));\n } else if (id == R.id.nav_view_offers) {\n //Do Nothing\n } else if (id == R.id.nav_create_listing) {\n startActivity(new Intent(this, CreateListingActivity.class));\n } else if (id == R.id.nav_view_listings) {\n startActivity(new Intent(this, ViewListingsActivity.class));\n }\n\n DrawerLayout drawer = (DrawerLayout) findViewById(R.id.drawer_layout);\n drawer.closeDrawer(GravityCompat.START);\n return true;\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position,\n long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position,\n long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n }", "@Override\r\n\t\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\r\n\t\t\t\t\t\tint position, long id) {\n\t\t\t\t}" ]
[ "0.7882029", "0.7235578", "0.6987005", "0.69458413", "0.6917864", "0.6917864", "0.6883472", "0.6875181", "0.68681556", "0.6766498", "0.67418456", "0.67207", "0.6716157", "0.6713947", "0.6698189", "0.66980195", "0.66793925", "0.66624063", "0.66595167", "0.6646381", "0.6641224", "0.66243863", "0.6624042", "0.66207093", "0.6602551", "0.6602231", "0.6599443", "0.65987265", "0.65935796", "0.6585869", "0.658491", "0.65811735", "0.65765643", "0.65751576", "0.65694076", "0.6561757", "0.65582377", "0.65581614", "0.6552827", "0.6552827", "0.6549224", "0.65389794", "0.65345114", "0.65337104", "0.652419", "0.652419", "0.6522521", "0.652146", "0.6521068", "0.6519354", "0.65165275", "0.65159816", "0.65028816", "0.6498054", "0.6498054", "0.64969087", "0.64937705", "0.6488544", "0.64867324", "0.64866185", "0.64865905", "0.6484047", "0.6481108", "0.6474686", "0.64628965", "0.64551884", "0.6446893", "0.64436555", "0.64436555", "0.64436555", "0.64436555", "0.64436555", "0.64386237", "0.643595", "0.64356565", "0.64329195", "0.6432562", "0.6429554", "0.64255124", "0.64255124", "0.64121485", "0.64102405", "0.64095175", "0.64095175", "0.64094734", "0.640727", "0.64060104", "0.640229", "0.6397359", "0.6392996", "0.63921124", "0.63899696", "0.63885015", "0.63885015", "0.63873845", "0.6368818", "0.6368818", "0.63643163", "0.63643163", "0.63643163", "0.6358884" ]
0.0
-1
Represents an individual SQL datasource, created by the library.
public interface Sql extends Terminable { /** * Gets the Hikari instance backing the datasource * * @return the hikari instance */ @Nonnull HikariDataSource getHikari(); /** * Gets a connection from the datasource. * * <p>The connection should be returned once it has been used.</p> * * @return a connection */ @Nonnull Connection getConnection() throws SQLException; /** * Gets a {@link SqlStream} instance for this {@link Sql}. * * @return a instance of the stream library for this connection. */ @Nonnull SqlStream stream(); /** * Executes a database statement with no preparation. * * <p>This will be executed on an asynchronous thread.</p> * * @param statement the statement to be executed * @return a Promise of an asynchronous database execution * @see #execute(String) to perform this action synchronously */ @Nonnull default Promise<Void> executeAsync(@Language("MySQL") @Nonnull String statement) { return Schedulers.async().run(() -> this.execute(statement)); } /** * Executes a database statement with no preparation. * * <p>This will be executed on whichever thread it's called from.</p> * * @param statement the statement to be executed * @see #executeAsync(String) to perform the same action asynchronously */ default void execute(@Language("MySQL") @Nonnull String statement) { this.execute(statement, stmt -> {}); } /** * Executes a database statement with preparation. * * <p>This will be executed on an asynchronous thread.</p> * * @param statement the statement to be executed * @param preparer the preparation used for this statement * @return a Promise of an asynchronous database execution * @see #executeAsync(String, SqlConsumer) to perform this action synchronously */ @Nonnull default Promise<Void> executeAsync(@Language("MySQL") @Nonnull String statement, @Nonnull SqlConsumer<PreparedStatement> preparer) { return Schedulers.async().run(() -> this.execute(statement, preparer)); } /** * Executes a database statement with preparation. * * <p>This will be executed on whichever thread it's called from.</p> * * @param statement the statement to be executed * @param preparer the preparation used for this statement * @see #executeAsync(String, SqlConsumer) to perform this action asynchronously */ void execute(@Language("MySQL") @Nonnull String statement, @Nonnull SqlConsumer<PreparedStatement> preparer); /** * Executes a database query with no preparation. * * <p>This will be executed on an asynchronous thread.</p> * * <p>In the case of a {@link SQLException} or in the case of * no data being returned, or the handler evaluating to null, * this method will return an {@link Optional#empty()} object.</p> * * @param query the query to be executed * @param handler the handler for the data returned by the query * @param <R> the returned type * @return a Promise of an asynchronous database query * @see #query(String, SqlFunction) to perform this query synchronously */ default <R> Promise<Optional<R>> queryAsync(@Language("MySQL") @Nonnull String query, @Nonnull SqlFunction<ResultSet, R> handler) { return Schedulers.async().supply(() -> this.query(query, handler)); } /** * Executes a database query with no preparation. * * <p>This will be executed on whichever thread it's called from.</p> * * <p>In the case of a {@link SQLException} or in the case of * no data being returned, or the handler evaluating to null, * this method will return an {@link Optional#empty()} object.</p> * * @param query the query to be executed * @param handler the handler for the data returned by the query * @param <R> the returned type * @return the results of the database query * @see #queryAsync(String, SqlFunction) to perform this query asynchronously */ default <R> Optional<R> query(@Language("MySQL") @Nonnull String query, @Nonnull SqlFunction<ResultSet, R> handler) { return this.query(query, stmt -> {}, handler); } /** * Executes a database query with preparation. * * <p>This will be executed on an asynchronous thread.</p> * * <p>In the case of a {@link SQLException} or in the case of * no data being returned, or the handler evaluating to null, * this method will return an {@link Optional#empty()} object.</p> * * @param query the query to be executed * @param preparer the preparation used for this statement * @param handler the handler for the data returned by the query * @param <R> the returned type * @return a Promise of an asynchronous database query * @see #query(String, SqlFunction) to perform this query synchronously */ default <R> Promise<Optional<R>> queryAsync(@Language("MySQL") @Nonnull String query, @Nonnull SqlConsumer<PreparedStatement> preparer, @Nonnull SqlFunction<ResultSet, R> handler) { return Schedulers.async().supply(() -> this.query(query, preparer, handler)); } /** * Executes a database query with preparation. * * <p>This will be executed on whichever thread it's called from.</p> * * <p>In the case of a {@link SQLException} or in the case of * no data being returned, or the handler evaluating to null, * this method will return an {@link Optional#empty()} object.</p> * * @param query the query to be executed * @param preparer the preparation used for this statement * @param handler the handler for the data returned by the query * @param <R> the returned type * @return the results of the database query * @see #queryAsync(String, SqlFunction) to perform this query asynchronously */ <R> Optional<R> query(@Language("MySQL") @Nonnull String query, @Nonnull SqlConsumer<PreparedStatement> preparer, @Nonnull SqlFunction<ResultSet, R> handler); /** * Executes a batched database execution. * * <p>This will be executed on an asynchronous thread.</p> * * <p>Note that proper implementations of this method should determine * if the provided {@link BatchBuilder} is actually worth of being a * batched statement. For instance, a BatchBuilder with only one * handler can safely be referred to {@link #executeAsync(String, SqlConsumer)}</p> * * @param builder the builder to be used. * @return a Promise of an asynchronous batched database execution * @see #executeBatch(BatchBuilder) to perform this action synchronously */ default Promise<Void> executeBatchAsync(@Nonnull BatchBuilder builder) { return Schedulers.async().run(() -> this.executeBatch(builder)); } /** * Executes a batched database execution. * * <p>This will be executed on whichever thread it's called from.</p> * * <p>Note that proper implementations of this method should determine * if the provided {@link BatchBuilder} is actually worth of being a * batched statement. For instance, a BatchBuilder with only one * handler can safely be referred to {@link #execute(String, SqlConsumer)}</p> * * @param builder the builder to be used. * @see #executeBatchAsync(BatchBuilder) to perform this action asynchronously */ void executeBatch(@Nonnull BatchBuilder builder); /** * Gets a {@link BatchBuilder} for the provided statement. * * @param statement the statement to prepare for batching. * @return a BatchBuilder */ BatchBuilder batch(@Language("MySQL") @Nonnull String statement); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getDatasource()\r\n\t{\r\n\t\treturn _dataSource;\r\n\t}", "protected abstract String getDatasourceName();", "public DataSource getDatasource() {\n return datasource;\n }", "public void setDatasource(DataSource datasource) {\n this.datasource = datasource;\n }", "public String getDataSource() {\n return dataSource;\n }", "String getDataSource();", "@Override\n public String getDataSource()\n {\n return dataSource;\n }", "public void setDatasource(DataSource source) {\n datasource = source;\n }", "public String getDatasourceType() {\r\n return IPentahoConnection.XML_DATASOURCE;\r\n }", "public String getDataSourceName()\n {\n return dataSourceName;\n }", "EDataSourceType getDataSource();", "@Override\n\tpublic DataSource getDataSource() {\t\t\n\t\treturn dataSource;\n\t}", "public String getDataSource() {\n return dataSource;\n }", "public String getDatasourceName()\n {\n return m_dsName;\n }", "public void setDatasource( String ds )\n {\n datasource = ds;\n }", "public int getDatasource() throws java.rmi.RemoteException;", "public DataSource getDataSource() {\n return datasource;\n }", "public interface IDataSourceConfiguration {\r\n\r\n\t/**\r\n\t * \r\n\t * @return Nombre del driver \r\n\t */\r\n\tpublic String getDriverName();\r\n\t\r\n\t/**\r\n\t * \r\n\t * @param driverName Nombre del driver\r\n\t */\r\n\tpublic void setDriverName(String driverName);\r\n\t\r\n\t/**\r\n\t * \r\n\t * @return User name de conexion\r\n\t */\r\n\tpublic String getUserName();\r\n\t\r\n\t/**\r\n\t * \r\n\t * @param userName User name de conexion\r\n\t */\r\n\tpublic void setUserName(String userName);\r\n\t\r\n\t/**\r\n\t * \r\n\t * @return Password de conexion\r\n\t */\r\n\tpublic String getPassword();\r\n\t\r\n\t/**\r\n\t * \r\n\t * @param password Password de conexion\r\n\t */\r\n\tpublic void setPassword(String password);\r\n\t\r\n\t/**\r\n\t * \r\n\t * @return URL de conexion. Por ejemplo jdbc:postgresql://55.55.55.55:5432/ehcos\r\n\t */\r\n\tpublic String getUrl();\r\n\t\r\n\t/**\r\n\t * \r\n\t * @param url URL de conexion. Por ejemplo jdbc:postgresql://55.55.55.55:5432/ehcos\r\n\t */\r\n\tpublic void setUrl(String url);\r\n\t\r\n\t/**\r\n\t * \r\n\t * @return Alternative User name de conexion\r\n\t */\r\n\tpublic String getAltUserName();\r\n\t\r\n\t/**\r\n\t * \r\n\t * @param userName Alternative User name de conexion\r\n\t */\r\n\tpublic void setAltUserName(String altUserName);\r\n\t\r\n\t/**\r\n\t * \r\n\t * @return Password de conexion\r\n\t */\r\n\tpublic String getAltPassword();\r\n\t\r\n\t/**\r\n\t * \r\n\t * @param password Alternative Password de conexion\r\n\t */\r\n\tpublic void setAltPassword(String altPassword);\r\n\t\r\n}", "public String getDataSourceType () {\n return dataSourceType;\n }", "@Bean(name = \"dataSource\")\n\tpublic DataSource dataSource() {\n\t\tEmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();\n\t\tEmbeddedDatabase db = builder.setType(EmbeddedDatabaseType.HSQL).addScript(\"db/create-db.sql\").addScript(\"db/insert-data.sql\").build();\n\t\treturn db;\n\t}", "public synchronized String getDataSource(){\n\t\treturn dataSource;\n\t}", "public EODataSource queryDataSource();", "public interface DataSource<T> {\n\t/**\n\t * open data source.\n\t */\n\tpublic void open();\n\t/**\n\t * Get the next data object.\n\t * @return data object.\n\t */\n\tpublic T next();\n\t/**\n\t * move vernier to head.\n\t * @return\n\t */\n\tpublic void head();\n\t/**\n\t * close data source.\n\t */\n\tpublic void close();\n\t/**\n\t * get attributes. \n\t * @return\n\t */\n\tpublic Map<String, Object> attributes();\n}", "public static MyTownDatasource getDatasource() {\n return datasource;\n }", "public ConnectorDataSource() {\n super(CONNECTOR_BEAN_NAME, CONNECTOR_TABLE_NAME);\n }", "public DataSource getDataSource() {\n return _dataSource;\n }", "public DataSource(Type type)\n {\n super();\n _type = type;\n }", "public DataSource getDataSource() {\n\t\treturn dataSource;\n\t}", "public ConnectionPoolDataSource createPoolDataSource(CConnection connection);", "public ConnectionPoolDataSource createPoolDataSource(CConnection connection);", "public DataSource getConfigDatasource() {\n return configDatasource;\n }", "public DataSource getDataSource() {\n\t\treturn this.dataSource;\n\t}", "public DataSource getDataSource() {\r\n return dataSource;\r\n }", "public void setDatasource(String val)\r\n\t{\r\n\t\t_dataSource = val;\r\n\t}", "public DataBaseConnector()\n {\n dataSource = new SQLServerDataSource();\n dataSource.setServerName(\"EASV-DB2\");\n dataSource.setPortNumber(1433);\n dataSource.setDatabaseName(\"AutistMovies\");\n dataSource.setUser(\"CS2017A_15\");\n dataSource.setPassword(\"Bjoernhart1234\");\n }", "public DataSource getDataSource() {\n return dataSource;\n }", "public DataSource getDataSource() {\n return dataSource;\n }", "public int getDatasource() throws java.rmi.RemoteException, javax.ejb.CreateException, javax.ejb.FinderException, javax.naming.NamingException {\n return (((Integer) __getCache(\"datasource\")).intValue());\n }", "public DataSource getDataSource(final QueriesConfig qryConfig) throws DBMissingValueException {\n validate(qryConfig);\n\n final var connectionString = qryConfig.getConnectionString();\n\n var dataSource = DATA_SOURCES.get(connectionString);\n\n if (dataSource==null) {\n try {\n LOCK.lock();\n dataSource = DATA_SOURCES.get(connectionString);\n if (dataSource==null) {\n LOG.trace(String.format(\"Registering %s to pool.\", connectionString));\n Class.forName(qryConfig.getJdbcDriver());\n\n final var basicDataSource = new BasicDataSource();\n basicDataSource.setUrl(connectionString);\n\n if (qryConfig.getWindowsAuthentication()==null) {\n basicDataSource.setUsername(qryConfig.getUsername());\n basicDataSource.setPassword(qryConfig.getPassword());\n }\n\n basicDataSource.setMinIdle(dbPoolConfig.getMinIdle());\n basicDataSource.setMaxIdle(dbPoolConfig.getMaxIdle());\n basicDataSource.setMaxOpenPreparedStatements(dbPoolConfig.getMaxOpenPreparedStatements());\n dataSource = basicDataSource;\n\n DATA_SOURCES.put(connectionString, dataSource);\n }\n } catch (ClassNotFoundException e) {\n throw new RuntimeException(e);\n } finally {\n LOCK.unlock();\n }\n }\n else {\n LOG.trace(String.format(\"Retrieve %s from pool.\", connectionString));\n }\n\n return dataSource;\n }", "protected DataSource getDataSource() {\n\t\treturn dataSource;\n\t}", "public String getDescription() {\n return \"Non-Pooling DataSource from \" + org.postgresql.util.DriverInfo.DRIVER_FULL_NAME;\n }", "@Override\n public Datasource createDatasource(final String name, final String url, \n final String username, final String password, final String driverClassName) \n throws ConfigurationException, DatasourceAlreadyExistsException {\n List<Datasource> conflictingDS = new ArrayList<>();\n for (Datasource datasource : getDatasources()) {\n if (name.equals(datasource.getJndiName())) {\n conflictingDS.add(datasource);\n }\n }\n if (conflictingDS.size() > 0) {\n throw new DatasourceAlreadyExistsException(conflictingDS);\n }\n if (tomcatVersion.isAtLeast(TomcatVersion.TOMCAT_55)) {\n if (tomeeVersion != null) {\n // we need to store it to resources.xml\n TomeeResources resources = getResources(true);\n assert resources != null;\n modifyResources( (TomeeResources tomee) -> {\n Properties props = new Properties();\n props.put(\"userName\", username); // NOI18N\n props.put(\"password\", password); // NOI18N\n props.put(\"jdbcUrl\", url); // NOI18N\n props.put(\"jdbcDriver\", driverClassName); // NOI18N\n StringWriter sw = new StringWriter();\n try {\n props.store(sw, null);\n } catch (IOException ex) {\n // should not really happen\n LOGGER.log(Level.WARNING, null, ex);\n }\n int idx = tomee.addTomeeResource(sw.toString());\n tomee.setTomeeResourceId(idx, name);\n tomee.setTomeeResourceType(idx, \"javax.sql.DataSource\"); // NOI18N\n });\n } else {\n // Tomcat 5.5.x or Tomcat 6.0.x\n modifyContext((Context context) -> {\n int idx = context.addResource(true);\n context.setResourceName(idx, name);\n context.setResourceAuth(idx, \"Container\"); // NOI18N\n context.setResourceType(idx, \"javax.sql.DataSource\"); // NOI18N\n context.setResourceDriverClassName(idx, driverClassName);\n context.setResourceUrl(idx, url);\n context.setResourceUsername(idx, username);\n context.setResourcePassword(idx, password);\n context.setResourceMaxActive(idx, \"20\"); // NOI18N\n context.setResourceMaxIdle(idx, \"10\"); // NOI18N\n context.setResourceMaxWait(idx, \"-1\"); // NOI18N\n });\n }\n } else {\n // Tomcat 5.0.x\n modifyContext((Context context) -> {\n int idx = context.addResource(true);\n context.setResourceName(idx, name);\n context.setResourceAuth(idx, \"Container\"); // NOI18N\n context.setResourceType(idx, \"javax.sql.DataSource\"); // NOI18N\n // check whether resource params not already defined\n ResourceParams[] resourceParams = context.getResourceParams();\n for (int i = 0; i < resourceParams.length; i++) {\n if (name.equals(resourceParams[i].getName())) {\n // if this happens in means that for this ResourceParams\n // element was no repspective Resource element - remove it\n context.removeResourceParams(resourceParams[i]);\n }\n }\n ResourceParams newResourceParams = createResourceParams(\n name,\n new Parameter[] {\n createParameter(\"factory\", \"org.apache.commons.dbcp.BasicDataSourceFactory\"), // NOI18N\n createParameter(\"driverClassName\", driverClassName), // NOI18N\n createParameter(\"url\", url), // NOI18N\n createParameter(\"username\", username), // NOI18N\n createParameter(\"password\", password), // NOI18N\n createParameter(\"maxActive\", \"20\"), // NOI18N\n createParameter(\"maxIdle\", \"10\"), // NOI18N\n createParameter(\"maxWait\", \"-1\") // NOI18N\n }\n );\n context.addResourceParams(newResourceParams);\n });\n }\n return new TomcatDatasource(username, url, password, name, driverClassName);\n }", "public DataSourceType getDataSourceType() {\n return dataSourceType;\n }", "public DataSourceId(DataverseName dataverseName, String datasourceName) {\n this(dataverseName, datasourceName, null);\n }", "public String toString() {\n return Helper.getShortClassName(getClass()) + ToStringLocalization.buildMessage(\"datasource_name\", (Object[])null) + \"=>\" + getName();\n }", "public static DataSource getDataSource() throws SQLException {\n return getDataSource(FxContext.get().getDivisionId(), true);\n }", "public DataSourcePool() throws NamingException, \r\n SQLException, InstantiationException, IllegalAccessException, ClassNotFoundException {\r\n InitialContext ctx = new InitialContext();\r\n //DataSource ds =(DataSource)ctx.lookup(\"java:jboss/jdbc/webapp\");\r\n DataSource ds =(DataSource)ctx.lookup(\"java:jboss/datasources/WebApp\");\r\n connection = ds.getConnection();\r\n }", "public static JRDataSource getDataSource() {\n\t\treturn new CustomDataSource(1000);\n\t}", "@Override\n\tpublic void setDataSource(DataSource dataSource) {\n\t}", "public DataSource getDataSource() {\n return dataSource;\n }", "public SimpleDataSource(String jdbcUrl) {\n this.jdbcUrl = jdbcUrl;\n }", "@Bean\n public DataSource dataSource() {\n EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();\n return builder.setType(EmbeddedDatabaseType.HSQL).build();\n }", "@Override\n public DataSource getDataSource() {\n\n // PostgreSQL does not provide connection pool (as of version 42.1.3) so make one using Apache Commons DBCP \n ds = new BasicDataSource();\n\n // max number of active connections\n Integer maxTotal = AtsSystemProperties.getPropertyAsNumber(\"dbcp.maxTotal\");\n if (maxTotal == null) {\n maxTotal = 8;\n } else {\n log.info(\"Max number of active connections is \"\n + maxTotal);\n }\n ds.setMaxTotal(maxTotal);\n\n // wait time for new connection\n Integer maxWaitMillis = AtsSystemProperties.getPropertyAsNumber(\"dbcp.maxWaitMillis\");\n if (maxWaitMillis == null) {\n maxWaitMillis = 60 * 1000;\n } else {\n log.info(\"Connection creation wait is \"\n + maxWaitMillis\n + \" msec\");\n }\n ds.setMaxWaitMillis(maxWaitMillis);\n\n String logAbandoned = System.getProperty(\"dbcp.logAbandoned\");\n if (logAbandoned != null && (\"true\".equalsIgnoreCase(logAbandoned))\n || \"1\".equalsIgnoreCase(logAbandoned)) {\n String removeAbandonedTimeoutString = System.getProperty(\"dbcp.removeAbandonedTimeout\");\n int removeAbandonedTimeout = (int) ds.getMaxWaitMillis() / (2 * 1000);\n if (!StringUtils.isNullOrEmpty(removeAbandonedTimeoutString)) {\n removeAbandonedTimeout = Integer.parseInt(removeAbandonedTimeoutString);\n }\n log.info(\n \"Will log and remove abandoned connections if not cleaned in \"\n + removeAbandonedTimeout\n + \" sec\");\n // log not closed connections\n ds.setLogAbandoned(true); // issue stack trace of not closed connection\n ds.setAbandonedUsageTracking(true);\n ds.setLogExpiredConnections(true);\n ds.setRemoveAbandonedTimeout(removeAbandonedTimeout);\n ds.setRemoveAbandonedOnBorrow(true);\n ds.setRemoveAbandonedOnMaintenance(true);\n ds.setAbandonedLogWriter(new PrintWriter(System.err));\n }\n ds.setValidationQuery(\"SELECT 1\");\n ds.setDriverClassName(getDriverClass().getName());\n ds.setUsername(user);\n ds.setPassword(password);\n ds.setUrl(getURL());\n return ds;\n }", "static public void setDataSource(DataSource source) {\n ds = source;\n }", "public void setDataSource(DataSource dataSource) {\n this.dataSource = dataSource;\n }", "public void setDataSource(DataSource dataSource) {\n this.dataSource = dataSource;\n }", "public void setDataSource(DataSource dataSource) {\n this.dataSource = dataSource;\n }", "public static Database of(DataSource dataSource) {\n return new DataSourceWrapper(dataSource);\n }", "protected String getDataSourceId() {\n return getDataSourceId(sourceComboBox);\n }", "public void setDataSource(DataSource ds);", "public void setDataSource(DataSource ds);", "public void setDataSource(DataSource ds);", "public void setDataSource(DataSource ds);", "public void setDataSource(DataSource ds);", "public void setDataSource(DataSource ds);", "@Override\n public void setDataSource(DataSource dataSource) {\n }", "@Override\n public void setDataSource(DataSource dataSource) {\n }", "@Override\n public void setDataSource(DataSource dataSource) {\n }", "public DataSourceId(DataverseName dataverseName, String datasourceName, String[] parameters) {\n this.dataverseName = dataverseName;\n this.datasourceName = datasourceName;\n this.parameters = parameters;\n }", "public DataSource getDataSource()\n\t{\n\t\tLOGGER.info(\"Getting DataSource object\");\n\t\treturn this.dataSource;\n\t}", "public String getDataSourceName() {\n\treturn strDSName;\n }", "Source createDatasourceOAI(Source ds, Provider prov) throws RepoxException;", "private DataSource dereference() throws SQLException\n {\n\tObject jndiName = this.getJndiName();\n\tHashtable jndiEnv = this.getJndiEnv();\n\ttry\n\t {\n\t\tInitialContext ctx;\n\t\tif (jndiEnv != null)\n\t\t ctx = new InitialContext( jndiEnv );\n\t\telse\n\t\t ctx = new InitialContext();\n\t\tif (jndiName instanceof String)\n\t\t return (DataSource) ctx.lookup( (String) jndiName );\n\t\telse if (jndiName instanceof Name)\n\t\t return (DataSource) ctx.lookup( (Name) jndiName );\n\t\telse\n\t\t throw new SQLException(\"Could not find ConnectionPoolDataSource with \" +\n\t\t\t\t\t \"JNDI name: \" + jndiName);\n\t }\n\tcatch( NamingException e )\n\t {\n\t\t//e.printStackTrace();\n\t\tif ( logger.isLoggable( MLevel.WARNING ) )\n\t\t logger.log( MLevel.WARNING, \"An Exception occurred while trying to look up a target DataSource via JNDI!\", e );\n\t\tthrow SqlUtils.toSQLException( e ); \n\t }\n }", "public interface TrackDatasource {\n\n}", "public SPARQLDataSource(String endpointUrl, String sparqlStatement) {\n this.endpointUrl = endpointUrl;\n this.sparqlStatement = sparqlStatement;\n }", "public void setDataSource( DataSource dataSource) {\n\t\tthis.dataSource = dataSource;\n\t}", "public DataSourceDetail(DataSourceDetail source) {\n if (source.Id != null) {\n this.Id = new String(source.Id);\n }\n if (source.Title != null) {\n this.Title = new String(source.Title);\n }\n if (source.Name != null) {\n this.Name = new String(source.Name);\n }\n if (source.Type != null) {\n this.Type = new String(source.Type);\n }\n if (source.Description != null) {\n this.Description = new String(source.Description);\n }\n if (source.Schema != null) {\n this.Schema = new String(source.Schema);\n }\n if (source.CmsProject != null) {\n this.CmsProject = new String(source.CmsProject);\n }\n if (source.PkgId != null) {\n this.PkgId = new String(source.PkgId);\n }\n if (source.SchemaVersion != null) {\n this.SchemaVersion = new String(source.SchemaVersion);\n }\n if (source.CreatorId != null) {\n this.CreatorId = new String(source.CreatorId);\n }\n if (source.CreatedAt != null) {\n this.CreatedAt = new String(source.CreatedAt);\n }\n if (source.UpdatedAt != null) {\n this.UpdatedAt = new String(source.UpdatedAt);\n }\n if (source.EnvId != null) {\n this.EnvId = new String(source.EnvId);\n }\n if (source.DataSourceVersion != null) {\n this.DataSourceVersion = new String(source.DataSourceVersion);\n }\n if (source.AppUsageList != null) {\n this.AppUsageList = new DataSourceLinkApp[source.AppUsageList.length];\n for (int i = 0; i < source.AppUsageList.length; i++) {\n this.AppUsageList[i] = new DataSourceLinkApp(source.AppUsageList[i]);\n }\n }\n if (source.PublishedAt != null) {\n this.PublishedAt = new String(source.PublishedAt);\n }\n if (source.ChildDataSourceIds != null) {\n this.ChildDataSourceIds = new String[source.ChildDataSourceIds.length];\n for (int i = 0; i < source.ChildDataSourceIds.length; i++) {\n this.ChildDataSourceIds[i] = new String(source.ChildDataSourceIds[i]);\n }\n }\n if (source.Fun != null) {\n this.Fun = new String(source.Fun);\n }\n if (source.ScfStatus != null) {\n this.ScfStatus = new Long(source.ScfStatus);\n }\n if (source.Methods != null) {\n this.Methods = new String(source.Methods);\n }\n if (source.ChildDataSourceNames != null) {\n this.ChildDataSourceNames = new String[source.ChildDataSourceNames.length];\n for (int i = 0; i < source.ChildDataSourceNames.length; i++) {\n this.ChildDataSourceNames[i] = new String(source.ChildDataSourceNames[i]);\n }\n }\n if (source.IsNewDataSource != null) {\n this.IsNewDataSource = new Long(source.IsNewDataSource);\n }\n if (source.ViewId != null) {\n this.ViewId = new String(source.ViewId);\n }\n if (source.Configuration != null) {\n this.Configuration = new String(source.Configuration);\n }\n if (source.TemplateCode != null) {\n this.TemplateCode = new String(source.TemplateCode);\n }\n if (source.Source != null) {\n this.Source = new Long(source.Source);\n }\n if (source.PublishVersion != null) {\n this.PublishVersion = new String(source.PublishVersion);\n }\n if (source.PublishViewId != null) {\n this.PublishViewId = new String(source.PublishViewId);\n }\n if (source.SubType != null) {\n this.SubType = new String(source.SubType);\n }\n if (source.AuthStatus != null) {\n this.AuthStatus = new Long(source.AuthStatus);\n }\n if (source.AuthInfo != null) {\n this.AuthInfo = new TicketAuthInfo(source.AuthInfo);\n }\n }", "public static DataSource getDs() {\n return ds;\n }", "public static DataSource MySqlConn() throws SQLException {\n\t\t\n\t\t/**\n\t\t * check if the database object is already defined\n\t\t * if it is, return the connection, \n\t\t * no need to look it up again\n\t\t */\n\t\tif (MySql_DataSource != null){\n\t\t\treturn MySql_DataSource;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\t/**\n\t\t\t * This only needs to run one time to get the database object\n\t\t\t * context is used to lookup the database object in MySql\n\t\t\t * MySql_Utils will hold the database object\n\t\t\t */\n\t\t\tif (context == null) {\n\t\t\t\tcontext = new InitialContext();\n\t\t\t}\n\t\t\tContext envContext = (Context)context.lookup(\"java:/comp/env\");\n\t\t\tMySql_DataSource = (DataSource)envContext.lookup(\"jdbc/customers\");\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t return MySql_DataSource;\n\t}", "public interface DBStructure {\n\n String save(DataSource dataSource);\n\n void update(DataSource dataSource, String fileMask) throws UpdateException;\n\n void dropAll(DataSource dataSource) throws DropAllException;\n\n String getSqlScript(DataSource dataSource);\n\n void unlock(DataSource dataSource);\n}", "@Bean(name = \"dataSource\")\n @ConfigurationProperties(prefix = \"spring.datasource\")\n public DataSource dataSource() {\n return DataSourceBuilder.create().build();\n }", "public void setDataSource(BasicDataSource dataSource) {\n this.dataSource = dataSource;\n }", "public String getDataSourceUri() {\n\t\treturn dataSourceUri;\n\t}", "@Bean(name = \"datasource1\")\n\t@ConfigurationProperties(prefix = \"database1.datasource\")\n\t@Primary\n\tpublic DataSource dataSource1() {\n\t\treturn DataSourceBuilder.create().build();\n\t}", "@Bean\n\tpublic DataSourceDao dataSourceDao() {\n\t\tDataSourceDao metadata = new DataSourceDao();\n\t\tmetadata.put(\"rslite\", dsRSLite());\n\t\tmetadata.put(\"rastreosat\", dsRS());\n\t\tmetadata.put(\"entel\", dsEntel());\n\t\tmetadata.put(\"mongo\", dsMongo());\n\t\treturn metadata;\n\t}", "public synchronized void setDataSource(String dataSource){\n\t\tthis.dataSource=dataSource;\n\t}", "public DataSource getDataSource(CConnection connection)\n\t{\n\t\t//throw new UnsupportedOperationException(\"Not supported/implemented\");\n\t\tif (m_ds != null)\n\t\t\treturn m_ds;\n\t\t\n\t\t//org.postgresql.ds.PGPoolingDataSource ds = new org.postgresql.ds.PGPoolingDataSource();\n\t\torg.postgresql.jdbc3.Jdbc3PoolingDataSource ds = new org.postgresql.jdbc3.Jdbc3PoolingDataSource();\n\t\tds.setDataSourceName(\"CompiereDS\");\n\t\tds.setServerName(connection.getDbHost());\n\t\tds.setDatabaseName(connection.getDbName());\n\t\tds.setUser(connection.getDbUid());\n\t\tds.setPassword(connection.getDbPwd());\n\t\tds.setPortNumber(connection.getDbPort());\n\t\tds.setMaxConnections(50);\n\t\tds.setInitialConnections(20);\n\t\t\n\t\t//new InitialContext().rebind(\"DataSource\", source);\t\t\n\t\tm_ds = ds;\n\t\t\n\t\treturn m_ds;\n\t}", "public void setDataSource(DataSource dataSource) {\n\t\tthis.dataSource = dataSource;\n\t}", "public TemporaryDataSource(DataSource dataSource){\n\t\tthis.ds = dataSource;\n\t}", "String afficherDataSource();", "@Bean\n\tpublic DataSource getDataSource() {\n\t\tEmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();\n\t\tEmbeddedDatabase db = builder.setType(EmbeddedDatabaseType.HSQL)\n\t\t\t\t.addScript(\"crate-db.sql\")\n\t\t\t\t.addScript(\"insert-db.sql\")\n\t\t\t\t.build();\n\t\treturn db;\n\t}", "@Override\n public Set<Datasource> getDatasources() throws ConfigurationException {\n Context context = getContext();\n Set<Datasource> result = new HashSet<>();\n int length = context.getResource().length;\n if (tomcatVersion.isAtLeast(TomcatVersion.TOMCAT_55)) {\n // Tomcat 5.5.x or Tomcat 6.0.x\n for (int i = 0; i < length; i++) {\n String type = context.getResourceType(i);\n if (\"javax.sql.DataSource\".equals(type)) { // NOI18N\n String name = context.getResourceName(i);\n String username = context.getResourceUsername(i);\n String url = context.getResourceUrl(i);\n String password = context.getResourcePassword(i);\n String driverClassName = context.getResourceDriverClassName(i);\n if (name != null && username != null && url != null && driverClassName != null) {\n // return the datasource only if all the needed params are non-null except the password param\n result.add(new TomcatDatasource(username, url, password, name, driverClassName));\n }\n }\n }\n if (tomeeVersion != null) {\n TomeeResources actualResources = getResources(false);\n if (actualResources != null) {\n result.addAll(getTomeeDatasources(actualResources));\n }\n }\n } else {\n // Tomcat 5.0.x\n ResourceParams[] resourceParams = context.getResourceParams();\n for (int i = 0; i < length; i++) {\n String type = context.getResourceType(i);\n if (\"javax.sql.DataSource\".equals(type)) { // NOI18N\n String name = context.getResourceName(i);\n // find the resource params for the selected resource\n for (int j = 0; j < resourceParams.length; j++) {\n if (name.equals(resourceParams[j].getName())) {\n Parameter[] params = resourceParams[j].getParameter();\n HashMap paramNameValueMap = new HashMap(params.length);\n for (Parameter parameter : params) {\n paramNameValueMap.put(parameter.getName(), parameter.getValue());\n }\n String username = (String) paramNameValueMap.get(\"username\"); // NOI18N\n String url = (String) paramNameValueMap.get(\"url\"); // NOI18N\n String password = (String) paramNameValueMap.get(\"password\"); // NOI18N\n String driverClassName = (String) paramNameValueMap.get(\"driverClassName\"); // NOI18N\n if (username != null && url != null && driverClassName != null) {\n // return the datasource only if all the needed params are non-null except the password param\n result.add(new TomcatDatasource(username, url, password, name, driverClassName));\n }\n }\n }\n }\n }\n }\n return result;\n }", "public void setDataSourceType (String dataSourceType) {\n this.dataSourceType = dataSourceType;\n }", "String getConnectionAlias();", "String getConnectionAlias();", "public DataSourceFactory() {}", "public interface Sqlable {\n\n Map<String, Object> getSqlMap();\n\n String getTableName();\n\n}", "public DataSource mo12629d() {\n return DataSource.LOCAL;\n }", "public DataSource createImpl()\n {\n if (_impl == null)\n {\n // create a param defining the datasource\n \n \tJdbcDataSourceParam dsParam = new JdbcDataSourceParam(getName(),\n getJdbcDriver(), getJdbcUrl() , //getJdbcCatalog(),\n getJdbcUser(), getJdbcPassword());//+ \":\" + getJdbcCatalog()\n\n // get/create the datasource\n _impl = DataManager.getDataSource(dsParam);\n\n // get the entities, create and add them\n Vector v = getEntities();\n for (int i = 0; i < v.size(); i++)\n {\n EntityDobj ed = (EntityDobj) v.get(i);\n _impl.addEntity(ed.createImpl());\n }\n\n // get the joins, create and add them\n v = getJoins();\n for (int i = 0; i < v.size(); i++)\n {\n JoinDobj jd = (JoinDobj) v.get(i);\n _impl.addJoin(jd.createImpl());\n }\n }\n\n return _impl;\n }", "public DataSourceFactory getDataSourceFactory() {\n return database;\n }", "@Override\n public void setDataSource(@Qualifier(\"dataSource\") DataSource dataSource) {\n super.setDataSource(dataSource);\n }" ]
[ "0.67589706", "0.66981256", "0.6506671", "0.64805526", "0.63838446", "0.6368361", "0.63654923", "0.6311554", "0.62660617", "0.6191819", "0.6165955", "0.61528814", "0.6138633", "0.61375433", "0.61221355", "0.6110213", "0.6109384", "0.60990703", "0.608725", "0.60788363", "0.60415494", "0.6036038", "0.59808385", "0.59409153", "0.59354675", "0.5933522", "0.5925632", "0.59247917", "0.5912374", "0.5912374", "0.59019977", "0.58853215", "0.58797395", "0.5876813", "0.5869868", "0.58422387", "0.58422387", "0.5838549", "0.58328474", "0.58301985", "0.58244735", "0.582008", "0.5816097", "0.5809999", "0.5783518", "0.57809544", "0.57802975", "0.5760477", "0.5752682", "0.575097", "0.57494044", "0.57460135", "0.57092637", "0.5689241", "0.5676266", "0.5676266", "0.5676266", "0.56604683", "0.56499106", "0.56329036", "0.56329036", "0.56329036", "0.56329036", "0.56329036", "0.56329036", "0.5632186", "0.5632186", "0.5632186", "0.5632028", "0.562507", "0.56067723", "0.5599803", "0.55992365", "0.55824053", "0.5567512", "0.55481344", "0.55310416", "0.5523571", "0.550433", "0.54982126", "0.549098", "0.5481346", "0.5480913", "0.5480199", "0.5477409", "0.5476026", "0.54734206", "0.54692346", "0.54671276", "0.5460752", "0.5448047", "0.54359734", "0.54214305", "0.541017", "0.541017", "0.54080623", "0.5406924", "0.5405915", "0.53972954", "0.5376007", "0.53749" ]
0.0
-1
Gets the Hikari instance backing the datasource
@Nonnull HikariDataSource getHikari();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Connection getHikariConnection() {\n ConnectionPool connectionPool = new ConnectionPool();\n connectionPool.getResource();\n connectionPool.getConfig();\n try {\n return dataSource.getConnection();\n } catch (SQLException exception) {\n exception.printStackTrace();\n }\n return null;\n }", "@Bean(destroyMethod = \"close\")\n\tpublic DataSource dataSource() {\n\t\tHikariConfig config = Utils.getDbConfig(dataSourceClassName, url, port, \"postgres\", user, password);\n\n try {\n\t\t\tlogger.info(\"Configuring datasource {} {} {}\", dataSourceClassName, url, user);\n config.setMinimumIdle(0);\n\t\t\tHikariDataSource ds = new HikariDataSource(config);\n\t\t\ttry {\n\t\t\t\tString dbExist = \"SELECT datname FROM pg_catalog.pg_database WHERE lower(datname) = lower('\"+databaseName+\"')\";\n\t\t\t\tPreparedStatement statementdbExist = ds.getConnection().prepareStatement(dbExist);\n\t\t\t\tif(statementdbExist.executeQuery().next()) {\n\t\t\t\t\tstatementdbExist.close();\n\t\t\t\t\tds.close();\n\t\t\t\t\tthis.dataBaseExist = true;\n\t\t\t\t} else {\n\t\t\t\t\tstatementdbExist.close();\n\t\t\t\t\tString sql = \"CREATE DATABASE \" + databaseName;\n\t\t\t\t\tPreparedStatement statement = ds.getConnection().prepareStatement(sql);\n\t\t\t\t\tstatement.executeUpdate();\n\t\t\t\t\tstatement.close();\n\t\t\t\t\tds.close();\n\t\t\t\t}\n\t\t\t} catch (SQLException e) {\n\t\t\t\tlogger.error(\"ERROR Configuring datasource SqlException {} {} {}\", e);\n\t\t\t\tthis.dataBaseExist = true;\n\t\t\t} catch (Exception ee) {\n\t\t\t\tthis.dataBaseExist = true;\n\t\t\t\tlogger.debug(\"ERROR Configuring datasource catch \", ee);\n\t\t\t}\n\t\t\tHikariConfig config2 = Utils.getDbConfig(dataSourceClassName, url, port, databaseName, user, password);\n\t\t\treturn new HikariDataSource(config2);\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(\"ERROR in database configuration \", e);\n\t\t} finally {\n\t\t\t\n\t\t}\n\t\treturn null;\n\t}", "private HikariDataSource getPool() {\n switch (DBtype) {\n case \"mariadb\":\n MariadbPool();\n break;\n case \"postgresql\":\n PostgresPool();\n break;\n }\n return null;\n\n }", "@Bean\r\n\tpublic DataSource getDataSource() {\r\n\t\tfinal HikariDataSource dataSource = new HikariDataSource();\r\n\t\t/*\r\n\t\t * The Following is the Oracle Database Configuration With Hikari Datasource\r\n\t\t */\r\n\t\tdataSource.setMaximumPoolSize(maxPoolSize);\r\n\t\tdataSource.setMinimumIdle(minIdleTime);\r\n\t\tdataSource.setDriverClassName(driver);\r\n\t\tdataSource.setJdbcUrl(url);\r\n\t\tdataSource.addDataSourceProperty(\"user\", userName);\r\n\t\tdataSource.addDataSourceProperty(\"password\", password);\r\n\t\tdataSource.addDataSourceProperty(\"cachePrepStmts\", cachePrepareStmt);\r\n\t\tdataSource.addDataSourceProperty(\"prepStmtCacheSize\", prepareStmtCacheSize);\r\n\t\tdataSource.addDataSourceProperty(\"prepStmtCacheSqlLimit\", prepareStmtCacheSqlLimit);\r\n\t\tdataSource.addDataSourceProperty(\"useServerPrepStmts\", useServerPrepareStmt);\r\n\t\treturn dataSource;\r\n\t}", "@Bean(destroyMethod = \"close\")\n public HikariDataSource dataSource() {\n HikariDataSource dataSource = new HikariDataSource();\n config.setJdbcUrl(\"jdbc:mysql://projects-db.ewi.tudelft.nl/projects_oopp5353\");\n config.setUsername(\"pu_oopp5353\");\n config.setPassword(\"WZijSwzXlaBG\");\n // config.setJdbcUrl(\"jdbc:mysql://localhost:3306/reserve\");\n // config.setUsername(\"user\");\n // config.setPassword(\"password\");\n HikariDataSource ds = new HikariDataSource(config);\n return ds;\n }", "@Bean(destroyMethod = \"shutdown\")\n public DataSource dataSource() {\n log.debug(\"test\");\n log.debug(\"Configuring Datasource\");\n if (propertyResolver.getProperty(\"url\") == null && propertyResolver.getProperty(\"databaseName\") == null) {\n log.error(\"Your database connection pool configuration is incorrect! The application\" +\n \"cannot start. Please check your Spring profile, current profiles are: {}\",\n Arrays.toString(environment.getActiveProfiles()));\n\n throw new ApplicationContextException(\"Database connection pool is not configured correctly\");\n }\n HikariConfig config = new HikariConfig();\n if (propertyResolver.getProperty(\"url\") != null) {\n config.setDataSourceClassName(propertyResolver.getProperty(\"dataSourceClassName\"));\n config.addDataSourceProperty(\"url\", propertyResolver.getProperty(\"url\"));\n } else {\n config.setDriverClassName(propertyResolver.getProperty(\"driverClassName\"));\n config.setJdbcUrl(propertyResolver.getProperty(\"jdbcUrl\"));\n }\n\n config.setInitializationFailFast(true);\n config.setConnectionTestQuery(propertyResolver.getProperty(\"connectionTestQuery\"));\n config.setUsername(propertyResolver.getProperty(\"username\"));\n config.setPassword(propertyResolver.getProperty(\"password\"));\n config.setIdleTimeout(getIdleTimeout());\n config.setMaxLifetime(getMaxLife());\n config.setMaximumPoolSize(getMaxPoolSize());\n\n if (StringUtils.isBlank(config.getPassword())\n || StringUtils.containsIgnoreCase(config.getPassword(), \"secret\")\n || StringUtils.startsWith(config.getPassword(), \"'\")) {\n return null;\n }\n\n return new HikariDataSource(config);\n }", "@Bean\n public DataSource dataSource() {\n HikariConfig hikariConfig = new HikariConfig();\n hikariConfig.setDriverClassName(environment.getProperty(\"jdbc.driver\"));\n hikariConfig.setJdbcUrl(environment.getProperty(\"jdbc.url\"));\n hikariConfig.setUsername(environment.getProperty(\"jdbc.user\"));\n hikariConfig.setPassword(environment.getProperty(\"jdbc.password\"));\n hikariConfig.setMaximumPoolSize(Integer.parseInt(\n Objects.requireNonNull(environment.getProperty(\"jdbc.availableConnections\"))));\n return new HikariDataSource(hikariConfig);\n }", "@Bean\n public DataSource getDataSource() {\n HikariConfig config = new HikariConfig();\n config.setDriverClassName(\"org.postgresql.Driver\");\n config.setJdbcUrl(\"jdbc:postgresql://127.0.0.1:5432/beauty\");\n config.setUsername(\"testing\");\n config.setPassword(\"testing\");\n config.addDataSourceProperty(\"characterEncoding\",\"utf8\");\n config.addDataSourceProperty(\"useUnicode\",\"true\");\n config.setIdleTimeout(10);\n config.setMinimumIdle(2);\n config.setMaximumPoolSize(100);\n\n\n return new HikariDataSource(config);\n }", "@Bean\n public DataSource dataSource() {\n List<String> dataSourceNames = Arrays.asList(\"BasicDbcpPooledDataSourceCreator\",\n \"TomcatJdbcPooledDataSourceCreator\", \"HikariCpPooledDataSourceCreator\",\n \"TomcatDbcpPooledDataSourceCreator\");\n \n DataSourceConfig dbConfig = new DataSourceConfig(dataSourceNames);\n DataSource hikariDataSource = connectionFactory().dataSource(dbConfig);\n// DataSource myConnection = DataSourceBuilder.create()\n// \t\t\t\t\t\t .type(HikariDataSource.class)\n// \t\t\t\t\t\t .driverClassName(com.sap.db.jdbc.Driver.class.getName())\n// \t\t\t\t\t\t .url(hostname)\n// \t\t\t\t\t\t .username(username)\n// \t\t\t\t\t\t .password(password)\n// \t\t\t\t\t\t .build();\n// \n// try {\n//\t\t\tmyConnection.getConnection().setSchema(schemaname);\n//\t\t} catch (SQLException e) {\n//\t\t\t// TODO Auto-generated catch block\n//\t\t\te.printStackTrace();\n//\t\t}\n \n cloudFoundryDataSourceConfigLogger.info(\"Detected Host name is : \" + this.hostname);\n cloudFoundryDataSourceConfigLogger.info(\"Detected port name is : \" + this.port);\n cloudFoundryDataSourceConfigLogger.info(\"Detected DB name is : \" + this.dbname);\n cloudFoundryDataSourceConfigLogger.info(\"Detected User name is : \" + this.username);\n \n return hikariDataSource;\n \n }", "private DatabaseConnectionService() {\n ds = new HikariDataSource();\n ds.setMaximumPoolSize(20);\n ConfigProperties configProperties = ConfigurationLoader.load();\n if (configProperties == null) {\n throw new RuntimeException(\"Unable to read the config.properties.\");\n }\n ds.setDriverClassName(configProperties.getDatabaseDriverClassName());\n ds.setJdbcUrl(configProperties.getDatabaseConnectionUrl());\n ds.addDataSourceProperty(\"user\", configProperties.getDatabaseUsername());\n ds.addDataSourceProperty(\"password\", configProperties.getDatabasePassword());\n ds.setAutoCommit(false);\n }", "@Primary\n @Bean\n DataSource dataSource(Environment env) {\n HikariConfig dataSourceConfig = new HikariConfig();\n dataSourceConfig.setPoolName(\"pool-postgres-vehicle\");\n dataSourceConfig.setDriverClassName(env.getRequiredProperty(PROPERTY_NAME_DB_DRIVER_CLASS));\n dataSourceConfig.setJdbcUrl(env.getRequiredProperty(PROPERTY_NAME_DB_URL));\n dataSourceConfig.setUsername(env.getRequiredProperty(PROPERTY_NAME_DB_USER));\n dataSourceConfig.setPassword(env.getRequiredProperty(PROPERTY_NAME_DB_PASSWORD));\n\n String hikariMaximumPoolSize = env.getProperty(PROPERTY_HIKARI_MAXIMUM_POOL_SIZE);\n dataSourceConfig.setMaximumPoolSize(hikariMaximumPoolSize == null || hikariMaximumPoolSize.isEmpty() ? 50 : Integer.valueOf(hikariMaximumPoolSize));\n\n String hikariMinimumIdle = env.getProperty(PROPERTY_HIKARI_MINIMUM_IDLE);\n dataSourceConfig.setMinimumIdle(hikariMinimumIdle == null || hikariMinimumIdle.isEmpty() ? 20 : Integer.valueOf(hikariMinimumIdle));\n\n String hikariMaxLifetime = env.getProperty(PROPERTY_HIKARI_MAXLIFETIME);\n dataSourceConfig.setMaxLifetime(hikariMaxLifetime == null || hikariMaxLifetime.isEmpty() ? 300000 : Integer.valueOf(hikariMaxLifetime));\n\n String hikariIdleTimeout = env.getProperty(PROPERTY_HIKARI_IDLETIMEOUT);\n dataSourceConfig.setIdleTimeout(hikariIdleTimeout == null || hikariIdleTimeout.isEmpty() ? 240000 : Integer.valueOf(hikariIdleTimeout));\n\n String hikariLeakDetectionThreshold = env.getProperty(PROPERTY_HIKARI_LEAK_DETECTION_THRESHOLD);\n dataSourceConfig.setLeakDetectionThreshold(hikariLeakDetectionThreshold == null || hikariLeakDetectionThreshold.isEmpty() ? 60000 : Integer.valueOf(hikariLeakDetectionThreshold));\n\n return new HikariDataSource(dataSourceConfig);\n }", "public Connection getConnection() {\n try {\n return dataSource.getConnection();\n } catch (SQLException e) {\n e.printStackTrace();\n return null;\n }\n }", "@Override\n\tpublic DataSource getDataSource() {\n\t\tif(this.dataSource == null) {\n\t\t\ttry {\n\t\t\t\tInitialContext initialContext = new InitialContext();\n\t\t\t\tthis.dataSource = (DataSource) initialContext.lookup(\"java:comp/env/jdbc/DefaultDB\");\n\t\t\t} catch(NamingException e){\n\t\t\t\tthrow new IllegalStateException(e);\n\t\t\t}\n\t\t}\n\t\treturn this.dataSource;\n\t}", "@Bean(name = \"dataSource\")\n @ConfigurationProperties(prefix = \"spring.datasource\")\n public DataSource dataSource() {\n return DataSourceBuilder.create().build();\n }", "private synchronized Connection getConnection() throws SQLException {\n return datasource.getConnection();\r\n }", "public DataSource getDatasource() {\n return datasource;\n }", "public Connection getConnection() throws SQLException {\r\n return dataSource.getConnection();\r\n }", "public static DataSource getDataSource(){\n try {\n Context context = new InitialContext();\n DataSource ds = (DataSource) context.lookup(\"jdbc/oracle\");\n return ds;\n } catch (NamingException ex) {\n Logger.getLogger(DataSourceBean.class.getName()).log(Level.SEVERE, null, ex);\n return null;\n }\n }", "public DatabaseConnector() {\n HikariConfig config = new HikariConfig();\n config.setJdbcUrl(\"jdbc:postgresql://localhost:5547/go_it_homework\");\n config.setUsername(\"postgres\");\n config.setPassword(\"Sam@64hd!+4\");\n this.ds = new HikariDataSource(config);\n ds.setMaximumPoolSize(5);\n }", "public static DataSource getDataSource() throws SQLException {\n return getDataSource(FxContext.get().getDivisionId(), true);\n }", "private DataSource dereference() throws SQLException\n {\n\tObject jndiName = this.getJndiName();\n\tHashtable jndiEnv = this.getJndiEnv();\n\ttry\n\t {\n\t\tInitialContext ctx;\n\t\tif (jndiEnv != null)\n\t\t ctx = new InitialContext( jndiEnv );\n\t\telse\n\t\t ctx = new InitialContext();\n\t\tif (jndiName instanceof String)\n\t\t return (DataSource) ctx.lookup( (String) jndiName );\n\t\telse if (jndiName instanceof Name)\n\t\t return (DataSource) ctx.lookup( (Name) jndiName );\n\t\telse\n\t\t throw new SQLException(\"Could not find ConnectionPoolDataSource with \" +\n\t\t\t\t\t \"JNDI name: \" + jndiName);\n\t }\n\tcatch( NamingException e )\n\t {\n\t\t//e.printStackTrace();\n\t\tif ( logger.isLoggable( MLevel.WARNING ) )\n\t\t logger.log( MLevel.WARNING, \"An Exception occurred while trying to look up a target DataSource via JNDI!\", e );\n\t\tthrow SqlUtils.toSQLException( e ); \n\t }\n }", "@Bean(name = \"dataSource\")\n\tpublic DataSource getDataSource() {\n\t\tDriverManagerDataSource dataSource = new DriverManagerDataSource();\n\t\tdataSource.setDriverClassName(\"com.mysql.cj.jdbc.Driver\");\n\t\tdataSource.setUrl(\"jdbc:mysql://localhost:3306/test_db\");\n\t\tdataSource.setUsername(\"root\");\n\t\tdataSource.setPassword(\"password\");\n\t\treturn dataSource;\n\t}", "public int getDatasource() throws java.rmi.RemoteException, javax.ejb.CreateException, javax.ejb.FinderException, javax.naming.NamingException {\n return (((Integer) __getCache(\"datasource\")).intValue());\n }", "public static DataSource MySqlConn() throws SQLException {\n\t\t\n\t\t/**\n\t\t * check if the database object is already defined\n\t\t * if it is, return the connection, \n\t\t * no need to look it up again\n\t\t */\n\t\tif (MySql_DataSource != null){\n\t\t\treturn MySql_DataSource;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\t/**\n\t\t\t * This only needs to run one time to get the database object\n\t\t\t * context is used to lookup the database object in MySql\n\t\t\t * MySql_Utils will hold the database object\n\t\t\t */\n\t\t\tif (context == null) {\n\t\t\t\tcontext = new InitialContext();\n\t\t\t}\n\t\t\tContext envContext = (Context)context.lookup(\"java:/comp/env\");\n\t\t\tMySql_DataSource = (DataSource)envContext.lookup(\"jdbc/customers\");\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t return MySql_DataSource;\n\t}", "public Connection getConnection() throws ClassNotFoundException, SQLException\n\t{\n\t /* Class.forName(\"org.postgresql.Driver\");*/\n\t\tcon=dataSource.getConnection();\n\t\treturn con;\t\n\t}", "@Bean\n public DataSource dataSource() {\n EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();\n return builder.setType(EmbeddedDatabaseType.HSQL).build();\n }", "protected DataSource getDataSource() {\n\t\treturn dataSource;\n\t}", "public DataSource getDataSource() {\n return datasource;\n }", "public DataSourceFactory getDataSourceFactory() {\n return database;\n }", "public DataSource getDataSource()\n\t{\n\t\tLOGGER.info(\"Getting DataSource object\");\n\t\treturn this.dataSource;\n\t}", "@Bean(name = \"dataSource\")\n\tpublic DataSource dataSource() {\n\t\tEmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();\n\t\tEmbeddedDatabase db = builder.setType(EmbeddedDatabaseType.HSQL).addScript(\"db/create-db.sql\").addScript(\"db/insert-data.sql\").build();\n\t\treturn db;\n\t}", "public DataSourcePool() throws NamingException, \r\n SQLException, InstantiationException, IllegalAccessException, ClassNotFoundException {\r\n InitialContext ctx = new InitialContext();\r\n //DataSource ds =(DataSource)ctx.lookup(\"java:jboss/jdbc/webapp\");\r\n DataSource ds =(DataSource)ctx.lookup(\"java:jboss/datasources/WebApp\");\r\n connection = ds.getConnection();\r\n }", "public DataSource getDataSource(CConnection connection)\n\t{\n\t\t//throw new UnsupportedOperationException(\"Not supported/implemented\");\n\t\tif (m_ds != null)\n\t\t\treturn m_ds;\n\t\t\n\t\t//org.postgresql.ds.PGPoolingDataSource ds = new org.postgresql.ds.PGPoolingDataSource();\n\t\torg.postgresql.jdbc3.Jdbc3PoolingDataSource ds = new org.postgresql.jdbc3.Jdbc3PoolingDataSource();\n\t\tds.setDataSourceName(\"CompiereDS\");\n\t\tds.setServerName(connection.getDbHost());\n\t\tds.setDatabaseName(connection.getDbName());\n\t\tds.setUser(connection.getDbUid());\n\t\tds.setPassword(connection.getDbPwd());\n\t\tds.setPortNumber(connection.getDbPort());\n\t\tds.setMaxConnections(50);\n\t\tds.setInitialConnections(20);\n\t\t\n\t\t//new InitialContext().rebind(\"DataSource\", source);\t\t\n\t\tm_ds = ds;\n\t\t\n\t\treturn m_ds;\n\t}", "public static Connection getConnection() {\r\n\r\n\t\tConfigLoader loader = new ConfigLoader();\r\n\t\tProperties properties = null;\r\n\t\t;\r\n\t\ttry {\r\n\t\t\tproperties = loader.loadConfigurations();\r\n\t\t} catch (IOException e) {\r\n\t\t\tlogger.error(e.getStackTrace().toString());\r\n\t\t}\r\n\t\tConnection connection = null;\r\n\t\ttry {\r\n\t\t\tString url = properties.getProperty(\"hsqldb.url\");\r\n\t\t\tString user = properties.getProperty(\"hsqldb.user\");\r\n\t\t\tString password = properties.getProperty(\"hsqldb.password\");\r\n\t\t\tlogger.info(\"Connecting to hsqlDB with db:\" + url);\r\n\t\t\tconnection = DriverManager.getConnection(url, user, password);\r\n\t\t} catch (SQLException e) {\r\n\t\t\tlogger.error(e.getStackTrace().toString());\r\n\t\t}\r\n\t\treturn connection;\r\n\t}", "private Connection getConnection() throws SQLException{\n return ds.getConnection();\n }", "@Bean\n public DataSource dataSource() {\n PGSimpleDataSource dataSource = new PGSimpleDataSource();\n dataSource.setServerName(hostName);\n dataSource.setDatabaseName(databaseName);\n dataSource.setUser(databaseUser);\n dataSource.setPassword(databasePassword);\n return dataSource;\n }", "public DataSource getDataSource() {\n return _dataSource;\n }", "@Bean(name=\"dataSource\")\n\tpublic DataSource getDataSource() {\n\t\tBasicDataSource dataSource = new BasicDataSource();\n\t\tdataSource.setDriverClassName(\"com.mysql.jdbc.Driver\");\n\t\tdataSource.setUrl(\"jdbc:mysql://localhost:3306/elearningforum\");\n\t\tdataSource.setUsername(\"root\");\n\t\tdataSource.setPassword(\"\");\n\t\tdataSource.addConnectionProperty(\"useUnicode\", \"yes\");\n\t\tdataSource.addConnectionProperty(\"characterEncoding\", \"UTF-8\");\n\t\treturn dataSource;\n\t}", "public Connection connection()\n {\n String host = main.getConfig().getString(\"db.host\");\n int port = main.getConfig().getInt(\"db.port\");\n String user = main.getConfig().getString(\"db.user\");\n String password = main.getConfig().getString(\"db.password\");\n String db = main.getConfig().getString(\"db.db\");\n\n MysqlDataSource dataSource = new MysqlDataSource();\n dataSource.setServerName(host);\n dataSource.setPort(port);\n dataSource.setUser(user);\n if (password != null ) dataSource.setPassword(password);\n dataSource.setDatabaseName(db);\n Connection connection = null;\n try\n {\n connection = dataSource.getConnection();\n }\n catch (SQLException sqlException)\n {\n sqlException.printStackTrace();\n }\n return connection;\n }", "public DataSource getDataSource() {\n return dataSource;\n }", "public DataSource getDataSource() {\n return dataSource;\n }", "public Connection getConnection() throws SQLServerException\n {\n return dataSource.getConnection();\n }", "public DataSource getDataSource() {\r\n return dataSource;\r\n }", "public static Connection getConnection() {\n \t\treturn connPool.getConnection();\n \t}", "@Override\n\tpublic DataSource getDataSource() {\t\t\n\t\treturn dataSource;\n\t}", "public DataSource getDataSource() {\n return dataSource;\n }", "private Connection getConnection() throws SQLException, ClassNotFoundException {\n return connectionBuilder.getConnection();\n }", "public Connection getConnection() throws SQLException{\n return ds.getConnection();\n }", "public DataSource getDataSource() {\n\t\treturn this.dataSource;\n\t}", "@Bean\n\tpublic DataSource dataSource () {\n\t\treturn DataSourceBuilder.create()\n\t\t\t\t\t\t\t\t.url(\"jdbc:mysql://localhost:3306/sillibus\")\n\t\t\t\t\t\t\t\t.username(\"root\")\n\t\t\t\t\t\t\t\t.password(\"root\")\n\t\t\t\t\t\t\t\t.driverClassName(databaseDriver)\n\t\t\t\t\t\t\t\t.build();\n\t}", "@Bean\n public DataSource dataSource() {\n DriverManagerDataSource dataSource = new DriverManagerDataSource();\n dataSource.setDriverClassName(env.getRequiredProperty(DRIVER_CLASS_NAME));\n dataSource.setUrl(env.getRequiredProperty(DATABASE_URL));\n dataSource.setUsername(env.getRequiredProperty(DATABASE_USERNAME));\n dataSource.setPassword(env.getRequiredProperty(DATABASE_PASSWORD));\n\n return dataSource;\n }", "public static ConnectionSource cs() {\n String dbName = \"pegadaian\";\n String dbUrl = \"jdbc:mysql://localhost:3306/\" + dbName;\n String user = \"root\";\n String pass = \"catur123\";\n\n //inisiasi sumber koneksi\n ConnectionSource csInit = null;\n try {\n csInit = new JdbcConnectionSource(dbUrl, user, pass);\n } catch (SQLException ex) {\n Logger.getLogger(Koneksi.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n //kembalikan hasil koneksi\n return csInit;\n\n }", "public static DataSourceSwapperRegistry getInstance() {\n return INSTANCE;\n }", "public DataSource getDataSource() {\n\t\treturn dataSource;\n\t}", "private Connection getConnection() throws Exception {\n\n\t\tContext initCtx = new InitialContext();\n\t\tContext envCtx = (Context) initCtx.lookup(\"java:comp/env\");\n\t\tDataSource ds = (DataSource) envCtx.lookup(\"jdbc/TestDB\");\n\n\t\treturn ds.getConnection();\n\t}", "public DataSourceRegistry getDataSourceRegistry();", "public SimpleDriverDataSource getDataSource() {\n\t\tString path = context.getRealPath(\"/\");\n\t\tString dbpath = path + Utility.DB_PATH;\n\t\tSimpleDriverDataSource dataSource = new SimpleDriverDataSource();\n\t\tFileInputStream fileInputStreamSystemSettings = null;\n\t\tProperties prop = new Properties();\n\t\ttry {\n\t\t\tfileInputStreamSystemSettings = new FileInputStream(dbpath);\n\t\t\ttry {\n\t\t\t\tprop.load(fileInputStreamSystemSettings);\n\t\t\t\ttry {\n\t\t\t\t\t// set datasource parameters\n\t\t\t\t\t// set driver\n\t\t\t\t\tdataSource.setDriver(new com.mysql.jdbc.Driver());\n\t\t\t\t\t// set username\n\t\t\t\t\tdataSource.setUsername(prop.getProperty(\"jdbc.username\"));\n\t\t\t\t\t// set password\n\t\t\t\t\tdataSource.setPassword(prop.getProperty(\"jdbc.password\"));\n\t\t\t\t\t// set jdbc url\n\t\t\t\t\tdataSource.setUrl(prop.getProperty(\"jdbc.url\"));\n\n\t\t\t\t} catch (SQLException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tfileInputStreamSystemSettings.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\treturn dataSource;\n\t}", "public int getDatasource() throws java.rmi.RemoteException;", "@Override\n public DataSource getDataSource() {\n\n // PostgreSQL does not provide connection pool (as of version 42.1.3) so make one using Apache Commons DBCP \n ds = new BasicDataSource();\n\n // max number of active connections\n Integer maxTotal = AtsSystemProperties.getPropertyAsNumber(\"dbcp.maxTotal\");\n if (maxTotal == null) {\n maxTotal = 8;\n } else {\n log.info(\"Max number of active connections is \"\n + maxTotal);\n }\n ds.setMaxTotal(maxTotal);\n\n // wait time for new connection\n Integer maxWaitMillis = AtsSystemProperties.getPropertyAsNumber(\"dbcp.maxWaitMillis\");\n if (maxWaitMillis == null) {\n maxWaitMillis = 60 * 1000;\n } else {\n log.info(\"Connection creation wait is \"\n + maxWaitMillis\n + \" msec\");\n }\n ds.setMaxWaitMillis(maxWaitMillis);\n\n String logAbandoned = System.getProperty(\"dbcp.logAbandoned\");\n if (logAbandoned != null && (\"true\".equalsIgnoreCase(logAbandoned))\n || \"1\".equalsIgnoreCase(logAbandoned)) {\n String removeAbandonedTimeoutString = System.getProperty(\"dbcp.removeAbandonedTimeout\");\n int removeAbandonedTimeout = (int) ds.getMaxWaitMillis() / (2 * 1000);\n if (!StringUtils.isNullOrEmpty(removeAbandonedTimeoutString)) {\n removeAbandonedTimeout = Integer.parseInt(removeAbandonedTimeoutString);\n }\n log.info(\n \"Will log and remove abandoned connections if not cleaned in \"\n + removeAbandonedTimeout\n + \" sec\");\n // log not closed connections\n ds.setLogAbandoned(true); // issue stack trace of not closed connection\n ds.setAbandonedUsageTracking(true);\n ds.setLogExpiredConnections(true);\n ds.setRemoveAbandonedTimeout(removeAbandonedTimeout);\n ds.setRemoveAbandonedOnBorrow(true);\n ds.setRemoveAbandonedOnMaintenance(true);\n ds.setAbandonedLogWriter(new PrintWriter(System.err));\n }\n ds.setValidationQuery(\"SELECT 1\");\n ds.setDriverClassName(getDriverClass().getName());\n ds.setUsername(user);\n ds.setPassword(password);\n ds.setUrl(getURL());\n return ds;\n }", "public Connection getConnection() throws SQLException {\r\n if (user != null) {\r\n return dataSource.getConnection(user, password);\r\n } else {\r\n return dataSource.getConnection();\r\n }\r\n }", "public Connection getConnection(){\n try{\n if(connection == null || connection.isClosed()){\n connection = FabricaDeConexao.getConnection();\n return connection;\n } else return connection;\n } catch (SQLException e){throw new RuntimeException(e);}\n }", "public static MyTownDatasource getDatasource() {\n return datasource;\n }", "private Connection getConnection() throws SQLException{\n return DriverManager.getConnection(\"jdbc:h2:file:./target/db/testdb;MODE=MYSQL\", \"anonymous\", \"\");\n }", "public static Connection getConnection() {\n Connection conn = null;\n try {\n Class.forName(\"org.hsqldb.jdbcDriver\");\n //conn = DriverManager.getConnection(\"jdbc:hsqldb:hsql://localhost/bancodb\", \"sa\", \"\");\n conn = DriverManager.getConnection(\"jdbc:hsqldb:hsql://localhost/paciente2db\", \"sa\", \"\");\n } catch (SQLException e) {\n System.out.println(\"Problemas ao conectar no banco de dados\");\n } catch (ClassNotFoundException e) {\n System.out.println(\"O driver não foi configurado corretamente\");\n }\n\n return conn;\n }", "public static Connection getConnection()\n {\n if (ds == null) {\n try {\n initCtx = new InitialContext();\n envCtx = (Context) initCtx.lookup(\"java:comp/env\");\n ds = (DataSource) envCtx.lookup(dbName);\n }\n catch (javax.naming.NamingException e) {\n Logger.log(Logger.ERROR, \"A problem occurred while retrieving a DataSource object\");\n Logger.log(Logger.ERROR, e.toString());\n }\n }\n\n Connection dbCon = null;\n try {\n dbCon = ds.getConnection();\n }\n catch (java.sql.SQLException e) {\n Logger.log(Logger.ERROR, \"A problem occurred while connecting to the database.\");\n Logger.log(Logger.ERROR, e.toString());\n }\n return dbCon;\n }", "private Connection getConnection() throws SQLException {\n return DriverManager.getConnection(\"jdbc:hsqldb:file:\" + this.path + \";shutdown=true\", \"SA\", \"\");\n }", "@Bean\r\n public DataSource dataSource() {\r\n String message = messageSource.getMessage(\"begin\", null, \"locale not found\", Locale.getDefault())\r\n + \" \" + messageSource.getMessage(\"config.data.source\", null, \"locale not found\", Locale.getDefault());\r\n logger.info(message);\r\n DriverManagerDataSource dataSource = new DriverManagerDataSource();\r\n dataSource.setDriverClassName(propDatabaseDriver);\r\n dataSource.setUrl(propDatabaseUrl);\r\n dataSource.setUsername(propDatabaseUserName);\r\n dataSource.setPassword(propDatabasePassword);\r\n\r\n message = messageSource.getMessage(\"end\", null, \"locale not found\", Locale.getDefault())\r\n + \" \" + messageSource.getMessage(\"config.data.source\", null, \"locale not found\", Locale.getDefault());\r\n logger.info(message);\r\n return dataSource;\r\n }", "public String getDatasource()\r\n\t{\r\n\t\treturn _dataSource;\r\n\t}", "public static EntityManagerFactory getConnection() {\r\n return emf;\r\n }", "public Connection getConnection();", "public Connection getConnection();", "public Connection getConnection();", "private DataSource getDataSource(DataSourceConfig key) {\n\t\tDataSource dataSource = adminService.getComponent(key.getBeanName(), DataSource.class);\n\t\treturn dataSource;\n\t}", "@Profile(\"production\")\r\n @Bean(name=\"DataSourceBean\") \r\n public DataSource getDataSource(){\r\n final JndiDataSourceLookup dsLookup = new JndiDataSourceLookup();\r\n dsLookup.setResourceRef(true);\r\n DataSource dataSource = dsLookup.getDataSource(\"jdbc/eshop_db\"); \t \r\n return dataSource;\r\n }", "public static Connection GetConnection() throws SQLException {\n return connectionPool.getConnection();\n }", "public Connection getConnection() {\n try {\n return ds.getConnection();\n } catch (SQLException e) {\n System.err.println(\"Error while connecting to database: \" + e.toString());\n }\n return null;\n }", "public static Connection getConnection() {\n Connection conn = null;\n\n try {\n DataSource dataSource = (DataSource) new InitialContext().lookup(\"jdbc/library\");\n conn = dataSource.getConnection();\n } catch (SQLException | NamingException e) {\n LOG.error(e.getMessage(), e);\n }\n return conn;\n }", "public DataSource getDataSource(){\n\n // open/read the applicliation context file\n // belove instruction to ger absolute path of current java apps\n //URL location = NaicsUtility.class.getProtectionDomain().getCodeSource().getLocation();\n //System.out.println(location);\n ClassPathXmlApplicationContext appContext = new ClassPathXmlApplicationContext(\"./../db.xml\");\n DataSource dataSource = null;\n try{ \n dataSource = (DataSource) appContext.getBean(\"dataSource\");\n } catch ( Exception ex ) {\n logger.log( Level.SEVERE, \"ERROR: can't create spring context and data source from application context\", ex.getMessage() );\n } finally {\n appContext.close();\n }\n return dataSource;\n }", "public static Connection getConnection() {\n Connection con = null;\n try {\n Class.forName(\"org.hsqldb.jdbcDriver\");\n con = DriverManager.getConnection(\n \"jdbc:hsqldb:mem:avdosdb\", \"sa\", \"\");\n } catch(Exception e) {\n e.printStackTrace();\n }\n return con;\n }", "public static Connection getInstance() {\n return LazyHolder.INSTANCE;\n }", "public IDatabaseConnection getConnection() {\n try {\n DatabaseConnection databaseConnection = new DatabaseConnection(getDataSource().getConnection());\n editConfig(databaseConnection.getConfig());\n return databaseConnection;\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n }", "public static DBCatalog getInstance(){\n return instance;\n }", "protected Connection getConnection () {\n \t\treturn connection;\n \t}", "@Bean\n\tpublic BasicDataSource getDataSource() {\n\t\tBasicDataSource ds = new BasicDataSource();\n\t\tds.setDriverClassName(\"com.mysql.jdbc.Driver\");\n\t\tds.setUrl(\"jdbc:mysql://localhost:3306/manageservice?useSSL=false\");\n\t\tds.setUsername(\"root\");\n\t\tds.setPassword(\"251090\");\n\t\tds.setMaxTotal(2);\n\t\tds.setInitialSize(1);\n\t\tds.setTestOnBorrow(true);\n\t\tds.setValidationQuery(\"SELECT 1\");\n\t\tds.setDefaultAutoCommit(true);\n\t\treturn ds;\n\t}", "@Override\n public Connection getConnection() throws SQLException {\n\t\tif (transactionProvider == null)\n\t\t\treturn delegate.getConnection();\n\t\tif (xaConnection == null)\n\t\t\txaConnection = delegate.getXAConnection();\n\t\tenlistResource(xaConnection.getXAResource());\n\t\tConnection connection = xaConnection.getConnection();\n\t\treturn connection;\n }", "public DataSource getConfigDatasource() {\n return configDatasource;\n }", "@Override\n\tpublic Connection getConnection() throws SQLException {\n\t\tConnection conn;\n\t\tconn = ConnectionFactory.getInstance().getConnection();\n\t\treturn conn;\n\t}", "Connection getConnection() {\n\t\treturn connection;\n\t}", "public Connection getConnection(){\n try {\n return connectionFactory.getConnection(); // wird doch schon im Konstruktor von TodoListApp aufgerufen ???\n } catch (SQLException e) {\n e.printStackTrace();\n throw new RuntimeException(e);\n }\n }", "public static DatabaseConnection getInstance() throws SQLException {\n if (instance == null) {//if we didn't create it earlier\n instance = new DatabaseConnection();//we create new one\n }\n return instance;//otherwise it returns old one\n }", "@Bean\n\tpublic DataSource getDataSource() {\n\t\tEmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder();\n\t\tEmbeddedDatabase db = builder.setType(EmbeddedDatabaseType.HSQL)\n\t\t\t\t.addScript(\"crate-db.sql\")\n\t\t\t\t.addScript(\"insert-db.sql\")\n\t\t\t\t.build();\n\t\treturn db;\n\t}", "public Connection getConnection(){\n\t\tif(connection == null){\r\n\t\t\tinitConnection();\r\n\t\t}\r\n\t\treturn connection;\r\n\t}", "public static Connection getConnection() {\n\treturn null;\n}", "@Override\n public Set<Datasource> getDatasources() throws ConfigurationException {\n Context context = getContext();\n Set<Datasource> result = new HashSet<>();\n int length = context.getResource().length;\n if (tomcatVersion.isAtLeast(TomcatVersion.TOMCAT_55)) {\n // Tomcat 5.5.x or Tomcat 6.0.x\n for (int i = 0; i < length; i++) {\n String type = context.getResourceType(i);\n if (\"javax.sql.DataSource\".equals(type)) { // NOI18N\n String name = context.getResourceName(i);\n String username = context.getResourceUsername(i);\n String url = context.getResourceUrl(i);\n String password = context.getResourcePassword(i);\n String driverClassName = context.getResourceDriverClassName(i);\n if (name != null && username != null && url != null && driverClassName != null) {\n // return the datasource only if all the needed params are non-null except the password param\n result.add(new TomcatDatasource(username, url, password, name, driverClassName));\n }\n }\n }\n if (tomeeVersion != null) {\n TomeeResources actualResources = getResources(false);\n if (actualResources != null) {\n result.addAll(getTomeeDatasources(actualResources));\n }\n }\n } else {\n // Tomcat 5.0.x\n ResourceParams[] resourceParams = context.getResourceParams();\n for (int i = 0; i < length; i++) {\n String type = context.getResourceType(i);\n if (\"javax.sql.DataSource\".equals(type)) { // NOI18N\n String name = context.getResourceName(i);\n // find the resource params for the selected resource\n for (int j = 0; j < resourceParams.length; j++) {\n if (name.equals(resourceParams[j].getName())) {\n Parameter[] params = resourceParams[j].getParameter();\n HashMap paramNameValueMap = new HashMap(params.length);\n for (Parameter parameter : params) {\n paramNameValueMap.put(parameter.getName(), parameter.getValue());\n }\n String username = (String) paramNameValueMap.get(\"username\"); // NOI18N\n String url = (String) paramNameValueMap.get(\"url\"); // NOI18N\n String password = (String) paramNameValueMap.get(\"password\"); // NOI18N\n String driverClassName = (String) paramNameValueMap.get(\"driverClassName\"); // NOI18N\n if (username != null && url != null && driverClassName != null) {\n // return the datasource only if all the needed params are non-null except the password param\n result.add(new TomcatDatasource(username, url, password, name, driverClassName));\n }\n }\n }\n }\n }\n }\n return result;\n }", "@Bean(initMethod = \"start\", destroyMethod = \"stop\")\n @Profile(JHipsterConstants.SPRING_PROFILE_DEVELOPMENT)\n public Object h2TCPServer() throws SQLException {\n String port = getValidPortForH2();\n log.debug(\"H2 database is available on port {}\", port);\n return H2ConfigurationHelper.createServer(port);\n }", "public static Connection getConnection() {\n return singleInstance.createConnection();\n }", "public Connection getConnection() throws SQLException {\n\t\treturn Database.getConnection();\n\t}", "public Connection getTransactionConnection(){\n try {\n return rawDataSource.getConnection();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n return null;\n }", "public Connection getConnection(){\r\n\t\treturn connection;\r\n\t}", "public\n Connection getConnection();" ]
[ "0.8010664", "0.66041243", "0.6461621", "0.6443032", "0.6439417", "0.6307465", "0.6306158", "0.6262977", "0.61677676", "0.6021021", "0.58476275", "0.58409375", "0.57778037", "0.5678278", "0.5667149", "0.564689", "0.56366676", "0.56280386", "0.5611191", "0.5569303", "0.5531311", "0.54853", "0.54671186", "0.545211", "0.5443236", "0.54331875", "0.54210275", "0.5402031", "0.54010415", "0.5385015", "0.53749985", "0.53679734", "0.5365826", "0.5355571", "0.5348698", "0.5324548", "0.53052396", "0.5305159", "0.53026235", "0.52984023", "0.52984023", "0.5297359", "0.5290396", "0.52901906", "0.5257547", "0.52434874", "0.523568", "0.5230264", "0.52279603", "0.5224115", "0.5202235", "0.52006215", "0.5173519", "0.5157722", "0.5149615", "0.51464826", "0.5141211", "0.5132987", "0.51242894", "0.5116581", "0.511083", "0.51094013", "0.5108892", "0.5098726", "0.5097457", "0.5088438", "0.50863254", "0.5073012", "0.50662607", "0.50609314", "0.50609314", "0.50609314", "0.50532496", "0.5052403", "0.5037949", "0.50323105", "0.50311816", "0.5030885", "0.502944", "0.50282913", "0.50276375", "0.5026092", "0.50259286", "0.5021734", "0.5019093", "0.50186265", "0.5011054", "0.49954623", "0.49875197", "0.4985082", "0.49740142", "0.49625126", "0.49580824", "0.49500272", "0.49469444", "0.4938815", "0.49381685", "0.49233487", "0.4922511", "0.49207726" ]
0.8476138
0
Gets a connection from the datasource. The connection should be returned once it has been used.
@Nonnull Connection getConnection() throws SQLException;
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Connection getConnection() {\n try {\n return dataSource.getConnection();\n } catch (SQLException e) {\n e.printStackTrace();\n return null;\n }\n }", "private synchronized Connection getConnection() throws SQLException {\n return datasource.getConnection();\r\n }", "public Connection getConnection() throws SQLException {\r\n return dataSource.getConnection();\r\n }", "public Connection getConnection() {\n try {\n return ds.getConnection();\n } catch (SQLException e) {\n System.err.println(\"Error while connecting to database: \" + e.toString());\n }\n return null;\n }", "public Connection getConnection() throws SQLException{\n return ds.getConnection();\n }", "public Connection getConnection() throws SQLException {\r\n if (user != null) {\r\n return dataSource.getConnection(user, password);\r\n } else {\r\n return dataSource.getConnection();\r\n }\r\n }", "public Connection getConnection() throws SQLServerException\n {\n return dataSource.getConnection();\n }", "public static Connection GetConnection() throws SQLException {\n return connectionPool.getConnection();\n }", "private Connection getConnection() throws SQLException{\n return ds.getConnection();\n }", "public static Connection getConnection()\n {\n if (ds == null) {\n try {\n initCtx = new InitialContext();\n envCtx = (Context) initCtx.lookup(\"java:comp/env\");\n ds = (DataSource) envCtx.lookup(dbName);\n }\n catch (javax.naming.NamingException e) {\n Logger.log(Logger.ERROR, \"A problem occurred while retrieving a DataSource object\");\n Logger.log(Logger.ERROR, e.toString());\n }\n }\n\n Connection dbCon = null;\n try {\n dbCon = ds.getConnection();\n }\n catch (java.sql.SQLException e) {\n Logger.log(Logger.ERROR, \"A problem occurred while connecting to the database.\");\n Logger.log(Logger.ERROR, e.toString());\n }\n return dbCon;\n }", "private static Connection getConnection(){\n Connection conn = THREAD_CONNECTION.get();\n if(conn == null){\n try {\n conn = DATA_SOURCE.getConnection();\n } catch (SQLException e) {\n e.printStackTrace();\n LOGGER.error(\"getConnection error\", e);\n throw new RuntimeException(e);\n } finally {\n THREAD_CONNECTION.set(conn);\n }\n }\n AssertUtil.notNull(conn);\n return conn;\n }", "private Connection getConnection() {\n if (_connection != null) return _connection;\n\n Element ncElement = getNetcdfElement();\n \n //See if we can get the database connection from a JNDI resource.\n String jndi = ncElement.getAttributeValue(\"jndi\");\n if (jndi != null) {\n try {\n Context initCtx = new InitialContext();\n Context envCtx = (Context) initCtx.lookup(\"java:comp/env\");\n DataSource ds = (DataSource) envCtx.lookup(jndi);\n _connection = ds.getConnection();\n } catch (Exception e) {\n String msg = \"Failed to get database connection from JNDI: \" + jndi;\n _logger.error(msg, e);\n throw new TSSException(msg, e);\n }\n return _connection;\n }\n\n //Make the connection ourselves.\n String connectionString = ncElement.getAttributeValue(\"connectionString\");\n String dbUser = ncElement.getAttributeValue(\"dbUser\");\n String dbPassword = ncElement.getAttributeValue(\"dbPassword\");\n String jdbcDriver = ncElement.getAttributeValue(\"jdbcDriver\");\n \n try {\n Class.forName(jdbcDriver);\n _connection = DriverManager.getConnection(connectionString, dbUser, dbPassword);\n } catch (Exception e) {\n String msg = \"Failed to get database connection: \" + connectionString;\n _logger.error(msg, e);\n throw new TSSException(msg, e);\n } \n \n return _connection;\n }", "public final Connection getConnection() throws SQLException {\n\t\treturn this.ds != null ? this.ds.getConnection() : DriverManager\n\t\t\t\t.getConnection(this.url);\n\t}", "public static Connection getConnection() {\n Connection conn = null;\n\n try {\n DataSource dataSource = (DataSource) new InitialContext().lookup(\"jdbc/library\");\n conn = dataSource.getConnection();\n } catch (SQLException | NamingException e) {\n LOG.error(e.getMessage(), e);\n }\n return conn;\n }", "public Connection getConnection() throws SQLServerException\n {\n return ds.getConnection();\n }", "public Connection getConnection(){\n try{\n if(connection == null || connection.isClosed()){\n connection = FabricaDeConexao.getConnection();\n return connection;\n } else return connection;\n } catch (SQLException e){throw new RuntimeException(e);}\n }", "public Connection getConnection() {\r\n\tConnection result = null;\r\n\tif (isConnected()) {\r\n\t result = conn;\r\n\t}\r\n\treturn result;\r\n }", "public static Connection getConnection() {\n \t\treturn connPool.getConnection();\n \t}", "protected Connection getConnection() throws DAOException {\n\t\ttry {\n\t\t\treturn source.getConnection();\n\t\t} catch (SQLException cause) {\n\t\t\tthrow new DAOException(cause);\n\t\t}\n\t}", "public Connection getConnection() throws SQLException {\r\n return connection;\r\n }", "public Connection getConnection(){\n\t\tif(connection == null){\r\n\t\t\tinitConnection();\r\n\t\t}\r\n\t\treturn connection;\r\n\t}", "public Connection getConnection() {\n this.connect();\n return this.connection;\n }", "public final Connection getConnection() throws SQLException {\n\t\tString[] threadCredentials = (String[]) this.threadBoundCredentials.get();\n\t\tif (threadCredentials != null) {\n\t\t\treturn doGetConnection(threadCredentials[0], threadCredentials[1]);\n\t\t}\n\t\telse {\n\t\t\treturn doGetConnection(this.username, this.password);\n\t\t}\n\t}", "public static Connection getConnection() {\n\t\t\n\t\treturn conn;\n\t}", "private Connection getConnection() throws SQLException {\n OracleDataSource ods = new OracleDataSource();\n ods.setURL(url);\n ods.setUser(user);\n ods.setPassword(password);\n\n // Creates a physical connection to the database.\n return ods.getConnection();\n }", "public static Connection getConnection() {\n\t\ttry {\n\t\t\treturn DBUtil.getInstance().ds.getConnection();\n\t\t} catch (SQLException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn null;\n\n\t}", "@Override\n\tpublic Connection getConnection() throws SQLException {\n\t\tConnection conn;\n\t\tconn = ConnectionFactory.getInstance().getConnection();\n\t\treturn conn;\n\t}", "public static Connection getConnection() {\n\t\tConnection conn = null;\n\t\ttry {\n\t\t\tconn = getConnectionPool().getConnection();\n\t\t\t// will get a thread-safe connection from the BoneCP connection\n\t\t\t// pool.\n\t\t\t// synchronization of the method will be done inside BoneCP source\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn conn;\n\t}", "public IDatabaseConnection getConnection() {\n try {\n DatabaseConnection databaseConnection = new DatabaseConnection(getDataSource().getConnection());\n editConfig(databaseConnection.getConfig());\n return databaseConnection;\n } catch (Exception e) {\n throw new RuntimeException(e);\n }\n }", "public Connection getConnection()\n\t{\n\t\treturn connection;\n\t}", "protected Connection getConnection() {\r\n\t\treturn getProcessor().getConnection();\r\n\t}", "public Connection getConnection() {\n return conn;\n }", "public Connection getConnection() {\n return conn;\n }", "public Connection getConnection();", "public Connection getConnection();", "public Connection getConnection();", "public Connection getConnection() throws ResourceException\n {\n return (Connection)cm.allocateConnection(mcf, null);\n }", "public Connection getConnection() {\n if (con == null) {\n try {\n con = DriverManager.getConnection(url, user, password);\n return con;\n } catch (SQLException e) {\n System.err.println(e.getMessage());\n }\n }\n\n return con;\n }", "public Connection getConnection() throws SQLException {\n\t\treturn Database.getConnection();\n\t}", "public DataSource getDataSource(CConnection connection)\n\t{\n\t\t//throw new UnsupportedOperationException(\"Not supported/implemented\");\n\t\tif (m_ds != null)\n\t\t\treturn m_ds;\n\t\t\n\t\t//org.postgresql.ds.PGPoolingDataSource ds = new org.postgresql.ds.PGPoolingDataSource();\n\t\torg.postgresql.jdbc3.Jdbc3PoolingDataSource ds = new org.postgresql.jdbc3.Jdbc3PoolingDataSource();\n\t\tds.setDataSourceName(\"CompiereDS\");\n\t\tds.setServerName(connection.getDbHost());\n\t\tds.setDatabaseName(connection.getDbName());\n\t\tds.setUser(connection.getDbUid());\n\t\tds.setPassword(connection.getDbPwd());\n\t\tds.setPortNumber(connection.getDbPort());\n\t\tds.setMaxConnections(50);\n\t\tds.setInitialConnections(20);\n\t\t\n\t\t//new InitialContext().rebind(\"DataSource\", source);\t\t\n\t\tm_ds = ds;\n\t\t\n\t\treturn m_ds;\n\t}", "public Connection getConnection() {\r\n return connection;\r\n }", "public Connection getConnection() {\r\n return connection;\r\n }", "public Connection getConnection() {\n return connection;\n }", "public Connection getConnection() throws SQLException {\n\t\tif (connection == null) {\n\t\t\tconnection = ConnectBDD.jdbcConnexion();\n\t\t}\n\t\treturn connection;\n\t}", "public Connection connection()\n {\n String host = main.getConfig().getString(\"db.host\");\n int port = main.getConfig().getInt(\"db.port\");\n String user = main.getConfig().getString(\"db.user\");\n String password = main.getConfig().getString(\"db.password\");\n String db = main.getConfig().getString(\"db.db\");\n\n MysqlDataSource dataSource = new MysqlDataSource();\n dataSource.setServerName(host);\n dataSource.setPort(port);\n dataSource.setUser(user);\n if (password != null ) dataSource.setPassword(password);\n dataSource.setDatabaseName(db);\n Connection connection = null;\n try\n {\n connection = dataSource.getConnection();\n }\n catch (SQLException sqlException)\n {\n sqlException.printStackTrace();\n }\n return connection;\n }", "public Connection getConnection() {\n\t\treturn this.connection;\n\t}", "Connection getConnection() {\n\t\treturn connection;\n\t}", "public static DataSource MySqlConn() throws SQLException {\n\t\t\n\t\t/**\n\t\t * check if the database object is already defined\n\t\t * if it is, return the connection, \n\t\t * no need to look it up again\n\t\t */\n\t\tif (MySql_DataSource != null){\n\t\t\treturn MySql_DataSource;\n\t\t}\n\t\t\n\t\ttry {\n\t\t\t/**\n\t\t\t * This only needs to run one time to get the database object\n\t\t\t * context is used to lookup the database object in MySql\n\t\t\t * MySql_Utils will hold the database object\n\t\t\t */\n\t\t\tif (context == null) {\n\t\t\t\tcontext = new InitialContext();\n\t\t\t}\n\t\t\tContext envContext = (Context)context.lookup(\"java:/comp/env\");\n\t\t\tMySql_DataSource = (DataSource)envContext.lookup(\"jdbc/customers\");\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t return MySql_DataSource;\n\t}", "protected Connection getConnection () {\n \t\treturn connection;\n \t}", "@Override\n public Connection getConnection() throws SQLException {\n\t\tif (transactionProvider == null)\n\t\t\treturn delegate.getConnection();\n\t\tif (xaConnection == null)\n\t\t\txaConnection = delegate.getXAConnection();\n\t\tenlistResource(xaConnection.getXAResource());\n\t\tConnection connection = xaConnection.getConnection();\n\t\treturn connection;\n }", "public Connection getConnection(){\r\n\t\treturn connection;\r\n\t}", "public Connection getConnection() {\n if(connection == null) throw new RuntimeException(\"Attempt to get database connection before it was initialized\");\n return connection;\n }", "public static MyConnection getConnection() throws SQLException{\n\t\treturn MyConnection.getConnection();\n\t}", "@Override\n public Connection getConnection() throws SQLException\n {\n return connection;\n }", "protected Connection doGetConnection(String username, String password) throws SQLException {\n\t\tAssert.state(getTargetDataSource() != null, \"targetDataSource is required\");\n\t\tif (!\"\".equals(username)) {\n\t\t\treturn getTargetDataSource().getConnection(username, password);\n\t\t}\n\t\telse {\n\t\t\treturn getTargetDataSource().getConnection();\n\t\t}\n\t}", "protected IXConnection getConnection() {\n return eloCmisConnectionManager.getConnection(this.getCallContext());\n }", "public static Connection getConnection() {\n if (connection == null) {\n try {\n connect();\n } catch (IOException e) {\n if (sc != null) {\n sc.log(\"connect \", e);\n }\n }\n }\n if (connection == null) {\n if (sc != null) {\n sc.log(\"BigtableHelper-No Connection\");\n }\n }\n return connection;\n }", "public static Connection getConnection() {\n\n\t\tConnection conn = null;\n\t\ttry {\n\t\t\tconn = getConnectionPool().getConnection();\n\t\t} catch (Exception e) {\n\n\t\t\tthrow new SystemException(\"Getting Connection from DB Connection Pool\",e,SystemCode.UNABLE_TO_EXECUTE);\n\t\t}\n\t\treturn conn;\n\n\t}", "public static Connection getConnection() {\n return singleInstance.createConnection();\n }", "public static Connection getConnection() throws SQLException{\n\t\tif( conn != null ){\n\t\t\treturn conn;\n\t\t}else{\n\t\t\topenConnection();\n\t\t\treturn conn;\n\t\t}\n\t}", "public static Connection getConnection() {\n\t\treturn null;\r\n\t}", "public static Connection getConnection() throws Exception {\n\t\treturn jdbcConnectionPool.getConnection();\r\n\r\n\t\t// return getInstance().dataSourse.getConnection();\r\n\t}", "public Connection getConnection() {\n \t\treturn this.connect;\n \t}", "protected Connection getConnection() {\n return con;\n }", "private Connection getConnection() throws SQLException, ClassNotFoundException {\n return connectionBuilder.getConnection();\n }", "public static Connection getConnection() throws SQLException\n\t{\n\t\ttry\n\t\t{\n\t\t\treturn (con == null || con.isClosed()) ? init() : con;\n\t\t} \n\t\tcatch(SQLException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t\treturn init();\n\t\t}\n\t}", "public static Connection getConnection() {\n\t\treturn null;\n\t}", "public Connection getSQLConnection() throws SQLException {\n WorkReportSQLApplication app = adaptersAPI.getJaxRsApplication(WorkReportSQLApplication.class);\n return app.dataSource.getConnection();\n }", "protected Connection connection() {\n\t\tif (connection == null) {\n\t\t\ttry {\n\t\t\t\tdblogger.info(\"Connecting to \" + connectionUrlString);\n\t\t\t\tconnection = DriverManager.getConnection(connectionUrlString,\n\t\t\t\t\t\tusername, password);\n\t\t\t} catch (SQLException exception) {\n\t\t\t\tdblogger.fatal(\"Failed to connect to database using \"\n\t\t\t\t\t\t+ connectionUrlString + \" User: \" + username\n\t\t\t\t\t\t+ \" Password: \" + password);\n\t\t\t\tthrow new IllegalStateException(\n\t\t\t\t\t\t\"Failed to connect to the database using \"\n\t\t\t\t\t\t\t\t+ connectionUrlString\n\t\t\t\t\t\t\t\t+ \". Please contact your DBA.\");\n\t\t\t}\n\t\t}\n\t\treturn connection;\n\t}", "public static Connection GetConnection_s() {\n try {\n return connectionPool.getConnection(); \n } catch (SQLException e) {\n return null;\n }\n }", "public Connection getConnection() throws SQLException {\n\t\treturn DriverManager.getConnection(this.url, this.username, this.password);\n\t}", "public DataSource getDataSource()\n\t{\n\t\tLOGGER.info(\"Getting DataSource object\");\n\t\treturn this.dataSource;\n\t}", "public synchronized Connection getConnection() throws SQLException {\n/* 158 */ return getConnection(true, false);\n/* */ }", "private Connection getConnection() throws JobReportingException\n {\n LOG.debug(\"Connecting to database host {}, port {}, name {} ...\", jobDatabaseHost, jobDatabasePortString, jobDatabaseName);\n\n final PGSimpleDataSource dbSource = new PGSimpleDataSource();\n dbSource.setServerNames(new String[]{jobDatabaseHost});\n dbSource.setDatabaseName(jobDatabaseName);\n dbSource.setUser(jobDatabaseUsername);\n dbSource.setPassword(jobDatabasePassword);\n dbSource.setApplicationName(appName);\n\n try {\n dbSource.setPortNumbers(new int[]{Integer.parseInt(jobDatabasePortString)});\n return dbSource.getConnection();\n } catch (final NumberFormatException ex){\n LOG.error(FAILED_TO_CONNECT_INVALID_PORT, jobDatabaseName, jobDatabasePortString, ex);\n throw new JobReportingException(ex.getMessage(), ex);\n }catch (final SQLTransientException ex) {\n LOG.error(FAILED_TO_CONNECT, jobDatabaseHost+\" / \"+jobDatabasePortString+\" / \"+jobDatabaseName, ex);\n throw new JobReportingTransientException(ex.getMessage(), ex);\n } catch (final SQLException ex) {\n LOG.error(FAILED_TO_CONNECT, jobDatabaseHost+\" / \"+jobDatabasePortString+\" / \"+jobDatabaseName, ex);\n\n // Declare error code for issues like not enough connections, memory, disk, etc.\n final String CONNECTION_EXCEPTION = \"08\";\n final String INSUFFICIENT_RESOURCES = \"53\";\n\n if (isSqlStateIn(ex, CONNECTION_EXCEPTION, INSUFFICIENT_RESOURCES, POSTGRES_OPERATOR_FAILURE_CODE_PREFIX)) {\n throw new JobReportingTransientException(ex.getMessage(), ex);\n } else {\n throw new JobReportingException(ex.getMessage(), ex);\n }\n }\n }", "protected Connection getConnection() throws EJBException {\n try {\n Context jndi = new InitialContext();\n DataSource ds = (DataSource) jndi.lookup(\"java:comp/env/jdbc/TestDatabase\");\n return ds.getConnection();\n\n } catch (NamingException e) {\n throw new EJBException(\"Error getting datasource from JNDI\", e);\n\n } catch (SQLException e) {\n throw new EJBException(\"Error getting connection from datasource\", e);\n }\n }", "public IConnection getConnection () { \n\t\treturn connection;\n\t}", "protected static Connection getConnection() {\r\n\t\t\r\n\t\tSystem.out.print(\"CONSOLE -- ENTROU NA PACKAGE DATA ACCESS OBJECT: getConnection \\n\" ); \r\n\t\t\r\n\t\tConnection connection = null;\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tClass.forName(\"com.mysql.cj.jdbc.Driver\");\r\n\t\t\tconnection = DriverManager.getConnection(jdbcURL, jdbcUsername, jdbcPassword);\r\n\t\t\t\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t\t\r\n\t\t} catch (ClassNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn connection;\r\n\t\t\r\n\t}", "public\n Connection getConnection();", "public static Connection getConn() {\n return conn;\n }", "public Connection getConnection() throws SQLException {\n\t\treturn null;\n\t}", "public Connection getConnection() throws ClassNotFoundException, SQLException\n\t{\n\t /* Class.forName(\"org.postgresql.Driver\");*/\n\t\tcon=dataSource.getConnection();\n\t\treturn con;\t\n\t}", "public static Connection getHikariConnection() {\n ConnectionPool connectionPool = new ConnectionPool();\n connectionPool.getResource();\n connectionPool.getConfig();\n try {\n return dataSource.getConnection();\n } catch (SQLException exception) {\n exception.printStackTrace();\n }\n return null;\n }", "public Connection getConnection() {\n\t// register the JDBC driver\n\ttry {\n\t Class.forName(super.driver);\n\t} catch (ClassNotFoundException e) {\n\t e.printStackTrace();\n\t}\n \n\t// create a connection\n\tConnection connection = null;\n\ttry {\n\t connection = DriverManager.getConnection (super.jdbc_url,super.getu(), super.getp());\n\t} catch (SQLException e) {\n\t e.printStackTrace();\n\t}\n\treturn connection;\n }", "public static Connection getConnection() {\n\n if (concount<conns-1) {\n concount++;\n } else {\n concount=0;\n }\n return con_pool[concount];\n }", "public Connection getConnection() throws SQLException {\n return new ConnectionWrapper(currentPreparedStatement.getConnection());\n }", "public static Connection getCon()throws SQLException{\n\n//\tSystem.out.println(\"创建了一个Connection....\");\n//\tConnection con= null;\n//\ttry {\n//\t\tClass.forName(jdbcName);\n//\t\tcon = DriverManager.getConnection(dburl, dbUserName, dbPassword);\n//\t}catch (Exception e){\n//\t\te.printStackTrace();\n//\t}\n\n\treturn dataSource.getConnection();\n}", "private Connection getConn(){\n \n return new util.ConnectionPar().getConn();\n }", "public DataSource getDatasource() {\n return datasource;\n }", "public Connection getConnection() throws SQLException {\n return null;\r\n }", "private Connection getConnection() {\n Connection conn = null;\n\n // Force the class loader to load the JDBC driver\n try { \n // The newInstance() call is a work around for some \n // broken Java implementations\n Class.forName(jdbcDriver).newInstance(); \n } catch (Exception ex) { \n System.err.println(\"Failed to load the JDBC driver: \" + jdbcDriver);\n }\n\n // Include the username and password on the URL\n StringBuffer url = new StringBuffer();\n url.append(jdbcUrl);\n if (jdbcUsername != null) {\n url.append(\"?user=\" + jdbcUsername);\n if (jdbcPassword != null) {\n url.append(\"&password=\" + jdbcPassword);\n }\n }\n\n // Establish a connection to the database\n try {\n conn = DriverManager.getConnection(url.toString());\n } catch (SQLException ex) {\n System.err.println(\"Failed to establish a database connection: url=\" + url.toString());\n System.err.println(\"SQLException: \" + ex.getMessage()); \n System.err.println(\"SQLState: \" + ex.getSQLState()); \n System.err.println(\"VendorError: \" + ex.getErrorCode()); \n ex.printStackTrace();\n }\n\n return conn;\n }", "public Connection getConnection() throws SQLException {\n String connectionUrl = \"jdbc:postgresql://\" + url + \":\" + port + \"/\" + database;\n return DriverManager.getConnection(connectionUrl, SISOBProperties.getDataBackendUsername(), SISOBProperties.getDataBackendPassword());\n }", "public String getConnection()\n {\n return this.connection;\n }", "@Override\n public Connection getConnection() {\n boolean createNewConnection = false;\n Connection returnConnection = null;\n synchronized (connections) { //Lock the arraylist\n if (connections.isEmpty()) { //Check if any connections available\n createNewConnection = true; //If not, create new one\n } else {\n returnConnection = connections.get(0); //Get first available one\n connections.remove(0); //And remove from list\n }\n }\n if (createNewConnection) { //If new connection needed\n returnConnection = createConnection();\n }\n return returnConnection;\n }", "private DataSource dereference() throws SQLException\n {\n\tObject jndiName = this.getJndiName();\n\tHashtable jndiEnv = this.getJndiEnv();\n\ttry\n\t {\n\t\tInitialContext ctx;\n\t\tif (jndiEnv != null)\n\t\t ctx = new InitialContext( jndiEnv );\n\t\telse\n\t\t ctx = new InitialContext();\n\t\tif (jndiName instanceof String)\n\t\t return (DataSource) ctx.lookup( (String) jndiName );\n\t\telse if (jndiName instanceof Name)\n\t\t return (DataSource) ctx.lookup( (Name) jndiName );\n\t\telse\n\t\t throw new SQLException(\"Could not find ConnectionPoolDataSource with \" +\n\t\t\t\t\t \"JNDI name: \" + jndiName);\n\t }\n\tcatch( NamingException e )\n\t {\n\t\t//e.printStackTrace();\n\t\tif ( logger.isLoggable( MLevel.WARNING ) )\n\t\t logger.log( MLevel.WARNING, \"An Exception occurred while trying to look up a target DataSource via JNDI!\", e );\n\t\tthrow SqlUtils.toSQLException( e ); \n\t }\n }", "public Connection getConnection(String dataSourceName) throws PersistenceException {\r\n Connection conn;\r\n DataSource ds = DatabaseCache.getDataSource(dataSourceName);\r\n if (ds == null) {\r\n throw new IllegalStateException(\"DataSource \" + dataSourceName + \" not found.\");\r\n }\r\n if (connections.containsKey(dataSourceName)) {\r\n conn = (Connection) connections.get(dataSourceName);\r\n } else {\r\n try {\r\n conn = new TransConnection(ds.getConnection());\r\n connections.put(dataSourceName, conn);\r\n setDefaults(conn);\r\n } catch (SQLException ex) {\r\n throw new PersistenceException(ex.getMessage(), ex);\r\n }\r\n }\r\n return conn;\r\n }", "public synchronized Connection getConnection() throws DBException {\n Connection con = null;\n try{\n if (s_ds != null) {\n try {\n con = s_ds.getConnection();\n } catch (Exception e) {\n SystemLog.getInstance().getErrorLog().error(\"ERR,HSQLDBTomCTRL,getCon-JNDI,\" + e\n , e);\n }\n } \n // If null try another method\n \n\t\t\tif ( con == null ){\n\t DriverManager.setLoginTimeout(5);\n\t\t\t\tcon = DriverManager.getConnection(m_dbURL , m_userName , m_password);\n\t\t\t\tSystem.out.println(\"HSQLDB-DBCON:user=\"+m_userName+\":Connection !!\");\n\t\t\t}\n\n return con;\n }catch(SQLException e) {\n System.err.println( \"DBCON:ERROR: user=\"+m_userName+\":Get Connection from pool-HSQLDB\");\n\t\t\tthrow new DBException(\"DBCON:ERROR: user=\"+m_userName+\":Get Connection HSQLDB:\" + e.getMessage()); \n }\n }", "protected Connection getConnection()\n {\n Connection connection = null;\n try\n {\n connection = DriverManager.getConnection(url, user, password);\n }\n catch (SQLException ex)\n {\n Logger.getLogger(DB_Utils.class.getName()).log(Level.SEVERE, null, ex);\n }\n return connection;\n }", "public static Connection getDataSourceConnection(String datasourceName) throws DiagnoseException {\r\n Connection con = null;\r\n String errorMsg = \"Unable to find or connect to [\" + datasourceName + \"]\";\r\n try {\r\n DataSource ds = (DataSource) (new InitialContext().lookup(datasourceName));\r\n con = ds.getConnection();\r\n } catch (ClassCastException e) {\r\n throw new DiagnoseException(errorMsg, e);\r\n } catch (NamingException e) {\r\n throw new DiagnoseException(errorMsg, e);\r\n } catch (SQLException e) {\r\n throw new DiagnoseException(errorMsg, e);\r\n }\r\n return con;\r\n }", "protected static Connection getConnection(String jndiName) throws DataSourceLookupException, DataAccessException {\n\t\tif (jndiName == null) {\n\t\t\tlogger.log(Level.FATAL, \"Input JNDI name was null. JNDI=[null]\");\n\t\t\tthrow new DataSourceLookupException(\"DataSource lookup failed. JNDI=[null]\");\n\t\t}\n\t\ttry {\n\t\t\tContext context = new InitialContext();\n\t\t\tDataSource dataSource = (DataSource) context.lookup(jndiName);\n\t\t\tif (dataSource == null) {\n\t\t\t\tlogger.log(Level.FATAL, \"Context data source lookup returned null. JNDI=[\" + jndiName + \"]\");\n\t\t\t\tthrow new DataSourceLookupException(\"No data source. See server logs for details.\");\n\t\t\t} else {\n\t\t\t\treturn dataSource.getConnection();\n\t\t\t}\n\t\t} catch (NamingException e) {\n\t\t\tlogger.log(Level.FATAL, \"DataSource lookup failed. JNDI=[\" + jndiName + \"]\", e);\n\t\t\tthrow new DataSourceLookupException(\"DataSource lookup failed. See server logs for details.\", e);\n\t\t} catch (SQLException e) {\n\t\t\tlogger.log(Level.FATAL, \"No connection. JNDI=[\" + jndiName + \"]\", e);\n\t\t\tthrow new DataAccessException(\"No connection. See server logs for details.\", e);\n\t\t}\n\t}", "public static Connection getConnection() {\n Connection localConnection = connection;\n if (localConnection == null) synchronized (DB_ConnectionProvider.class) {\n\n // multi thread supported, double checker lock\n\n localConnection = connection;\n if (localConnection == null) {\n try {\n Class.forName(\"oracle.jdbc.driver.OracleDriver\");\n // oracle driver: oracle.jdbc.driver.OracleDriver\n // mysql driver: com.mysql.jdbc.Driver\n connection = localConnection = DriverManager.getConnection(\n \"jdbc:oracle:thin:@localhost:1521:XE\", USERNAME, PASSWORD);\n // mysql url: jdbc:mysql://localhost:3306/world\n // oracle url: jdbc:oracle:thin:@localhost:1521:XE\n } catch (Exception ex) {\n System.out.println(\"Could not connect with the database.\");\n }\n }\n }\n return localConnection;\n }" ]
[ "0.8099758", "0.7863434", "0.7770543", "0.7745346", "0.76382536", "0.75903976", "0.75170267", "0.7468186", "0.74631286", "0.74435204", "0.73703825", "0.7340839", "0.73180073", "0.72770137", "0.7271528", "0.7230587", "0.72124654", "0.71825767", "0.7171418", "0.7159717", "0.71467197", "0.7125742", "0.7089902", "0.7088048", "0.7079588", "0.70786244", "0.70571446", "0.7024262", "0.7022757", "0.6992505", "0.69774", "0.69755316", "0.69755316", "0.6948389", "0.6948389", "0.6948389", "0.6945256", "0.69384253", "0.693294", "0.6926919", "0.69225174", "0.69225174", "0.69073623", "0.6903721", "0.68954724", "0.68946326", "0.68857193", "0.68852925", "0.68815714", "0.68781394", "0.687631", "0.68695855", "0.68622786", "0.68622565", "0.68617386", "0.6859026", "0.68574333", "0.6856476", "0.6852214", "0.6829256", "0.6812929", "0.6797243", "0.67897934", "0.6785129", "0.67764634", "0.67763317", "0.6774264", "0.6760127", "0.67584753", "0.6756895", "0.67395926", "0.67287153", "0.6725936", "0.6723221", "0.672096", "0.6715326", "0.6698595", "0.6694421", "0.66925174", "0.66832745", "0.6678964", "0.6674309", "0.666746", "0.6662667", "0.66600037", "0.6648343", "0.66332835", "0.6624015", "0.6613799", "0.66064966", "0.6602931", "0.6593476", "0.65870416", "0.6584985", "0.658383", "0.657968", "0.65681857", "0.65593386", "0.65592396", "0.6557867" ]
0.67050344
76
Executes a database statement with no preparation. This will be executed on an asynchronous thread.
@Nonnull default Promise<Void> executeAsync(@Language("MySQL") @Nonnull String statement) { return Schedulers.async().run(() -> this.execute(statement)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "DBCursor execute();", "@Nonnull\n default Promise<Void> executeAsync(@Language(\"MySQL\") @Nonnull String statement, @Nonnull SqlConsumer<PreparedStatement> preparer) {\n return Schedulers.async().run(() -> this.execute(statement, preparer));\n }", "private void executeQuery() {\n }", "public void execute() throws SQLException {\n\t\ttry {\n\t\t\tselect.setUsername(\"INTRANET\");\n\t\t\tselect.setPassword(\"INTRANET\");\n\t\t\tselect.execute();\n\t\t}\n\n\t\t// Liberar recursos del objeto select.\n\t\tfinally {\n\t\t\tselect.close();\n\t\t}\n\t}", "public void execute() throws SQLException {\n\t\tif (this.ds == null) {\n\t\t\tthrow new RuntimeException(\n\t\t\t\"Please pass a DataSource to the ListSqlHelper!\");\n\t\t}\n\t\t\n\t\texecuteCountSql();\n\t\texecuteItemRangeSql();\n\t}", "public<T> T execute() throws DatabaseException;", "public void prepareExecuteNoSelect() {\n setCallFromStatement();\n // The statement is no longer require so can be released.\n clearStatement();\n\n super.prepareExecuteNoSelect();\n }", "@SuppressWarnings(\"unchecked\")\n public void execute() {\n execute(null, null);\n }", "private void executeImmediate(String stmtText) throws SQLException\n {\n // execute the statement and auto-close it as well\n try (final Statement statement = this.createStatement();)\n {\n statement.execute(stmtText);\n }\n }", "public void execute() {\n // empty\n }", "public void execute() {\n execute0();\n }", "public void exec(String sql) {\r\n try (Statement stmt = connection.createStatement()) {\r\n stmt.execute(sql);\r\n } catch (SQLException e) {\r\n throw new DbException(connectionString + \"\\nError executing \" + sql, e);\r\n }\r\n }", "public boolean Execute(String statement) throws SQLException{\r\n\t\treturn _dbStatement.execute(statement);\r\n\t}", "protected static void execute(ReviewDb db, String sql) throws SQLException {\n try (Statement s = newStatement(db)) {\n s.execute(sql);\n }\n }", "default void execute(@Language(\"MySQL\") @Nonnull String statement) {\n this.execute(statement, stmt -> {});\n }", "public void prepareExecuteSelect() {\n setCallFromStatement();\n // The statement is no longer require so can be released.\n clearStatement();\n\n super.prepareExecuteSelect();\n }", "public void run(Statement state) throws SQLException {\n\n System.out.println(\"INFO: -= Inserting data via dummy table ...\");\n state.execute(multipleRowInsertDummySQL);\n System.out.println(\"INFO: -= The data are inserted via dummy table:\");\n selectAllFromTable(state, tableName, 10);\n\n System.out.println(\"INFO: -= Inserting data using INSERT INTO statement ...\");\n state.execute(multipleRowInsertIntoSQL);\n System.out.println(\"INFO: -= The data are inserted via INSERT INTO statement:\");\n selectAllFromTable(state, tableName, 20);\n }", "void execute(Context context) throws SQLException;", "@SuppressWarnings(\"deprecation\")\n\tpublic void execute() throws BuildException {\n // Create a new build listener for parsing events\n Connection conn = getConnection();\n DbProgressListener listener = new DbProgressListener(conn, buildId, getProgressTargets(), dbTable);\n\n // Add the event listeners to the project\n project.addBuildListener(listener);\n\n // Add a thread to poll the database\n if (pollingEnabled) {\n polling = new DbStatusThread(conn);\n polling.setInterval(pollingInterval * 1000);\n polling.start();\n }\n }", "protected void executeThread() {\n if (thread == null || !thread.isAlive()) {\n thread = new Thread(() -> {\n while (!queries.isEmpty() && !disconnect) {\n queries.remove().execute(queryRunner, connection);\n }\n if (disconnect) {\n disconnect();\n }\n });\n thread.start();\n }\n }", "public void execute (String query) throws java.sql.SQLException {\n try {\n /*\n if (query.indexOf('(') != -1)\n Logger.write(\"VERBOSE\", \"DB\", \"execute(\\\"\" + query.substring(0,query.indexOf('(')) + \"...\\\")\");\n else\n Logger.write(\"VERBOSE\", \"DB\", \"execute(\\\"\" + query.substring(0,20) + \"...\\\")\");\n */\n Logger.write(\"VERBOSE\", \"DB\", \"execute(\\\"\" + query + \"\\\")\");\n \n Statement statement = dbConnection.createStatement();\n statement.setQueryTimeout(30);\n dbConnection.setAutoCommit(false);\n statement.executeUpdate(query);\n dbConnection.commit();\n dbConnection.setAutoCommit(true);\n } catch (java.sql.SQLException e) {\n Logger.write(\"ERROR\", \"DB\", \"SQLException: \" + e);\n throw e;\n }\n }", "void runQueries();", "public abstract ResultList executeSQL(RawQuery rawQuery);", "public void execute() {\n /*\n r6 = this;\n java.lang.String r0 = \"Failed to close connection after DBUnit operation: \"\n java.util.logging.Logger r1 = log\n java.lang.StringBuilder r2 = new java.lang.StringBuilder\n r2.<init>()\n java.lang.String r3 = \"Executing DBUnit operations: \"\n r2.append(r3)\n int r3 = r6.size()\n r2.append(r3)\n java.lang.String r2 = r2.toString()\n r1.info(r2)\n org.dbunit.database.IDatabaseConnection r1 = r6.getConnection() // Catch:{ all -> 0x005a }\n r6.disableReferentialIntegrity(r1) // Catch:{ all -> 0x0058 }\n java.util.Iterator r2 = r6.iterator() // Catch:{ all -> 0x0058 }\n L_0x0027:\n boolean r3 = r2.hasNext() // Catch:{ all -> 0x0058 }\n if (r3 == 0) goto L_0x0037\n java.lang.Object r3 = r2.next() // Catch:{ all -> 0x0058 }\n org.seamless.util.dbunit.DBUnitOperations$Op r3 = (org.seamless.util.dbunit.DBUnitOperations.Op) r3 // Catch:{ all -> 0x0058 }\n r3.execute(r1) // Catch:{ all -> 0x0058 }\n goto L_0x0027\n L_0x0037:\n r6.enableReferentialIntegrity(r1) // Catch:{ all -> 0x0058 }\n if (r1 == 0) goto L_0x0057\n r1.close() // Catch:{ Exception -> 0x0040 }\n goto L_0x0057\n L_0x0040:\n r1 = move-exception\n java.util.logging.Logger r2 = log\n java.util.logging.Level r3 = java.util.logging.Level.WARNING\n java.lang.StringBuilder r4 = new java.lang.StringBuilder\n r4.<init>()\n r4.append(r0)\n r4.append(r1)\n java.lang.String r0 = r4.toString()\n r2.log(r3, r0, r1)\n L_0x0057:\n return\n L_0x0058:\n r2 = move-exception\n goto L_0x005c\n L_0x005a:\n r2 = move-exception\n r1 = 0\n L_0x005c:\n if (r1 == 0) goto L_0x0079\n r1.close() // Catch:{ Exception -> 0x0062 }\n goto L_0x0079\n L_0x0062:\n r1 = move-exception\n java.util.logging.Logger r3 = log\n java.util.logging.Level r4 = java.util.logging.Level.WARNING\n java.lang.StringBuilder r5 = new java.lang.StringBuilder\n r5.<init>()\n r5.append(r0)\n r5.append(r1)\n java.lang.String r0 = r5.toString()\n r3.log(r4, r0, r1)\n L_0x0079:\n goto L_0x007b\n L_0x007a:\n throw r2\n L_0x007b:\n goto L_0x007a\n */\n throw new UnsupportedOperationException(\"Method not decompiled: org.seamless.util.dbunit.DBUnitOperations.execute():void\");\n }", "@Override\n protected Void doInBackground(Void... params) {\n try{\n System.setProperty(\"FBAdbLog\", \"true\");\n Class.forName(\"org.firebirdsql.jdbc.FBDriver\");\n String sCon = \"jdbc:firebirdsql:\"+Server+\":C:/\"+Database+\".FDB?allowMultiQueries=true?encoding=ISO8859_1\";\n if(con == null){\n // Connection con = DriverManager.getConnection(sCon, \"SYSDBA\", \"masterkey\");\n }\n Connection con = DriverManager.getConnection(sCon, \"SYSDBA\", \"masterkey\");\n Statement stmt = con.createStatement();\n con.setAutoCommit(false);\n String sql = \"INSERT INTO CLIENT VALUES ('1','NASSER','2222222')\";\n String sql2 = \"INSERT INTO CLIENT VALUES ('2','SALIM','3333333')\";\n stmt.addBatch(sql);\n stmt.addBatch(sql2);\n stmt.executeBatch();\n // Statement stmt1 = con.createStatement();\n con.commit();\n //con.setAutoCommit(true);\n etatCon = true;\n }\n catch(Exception e){\n Log.e(\"FirebirdExample\", e.getMessage());\n etatCon = false;\n }\n return null;\n }", "protected void execSQL(String sql) throws Exception {\n\t\tPreparedStatement statement = null;\n\t\ttry {\n\t\t\tstatement = connection.prepareStatement(sql);\n\t\t\tstatement.execute();\n\t\t} catch (Exception e) {\n\t\t\tthrow e;\n\t\t} finally {\n\t\t\tPersistenceUtils.closeStatement(statement);\n\t\t}\n\n\t}", "public final void execute() {\n try {\n\n StringBuffer preparedTableBuf = new StringBuffer();\n preparedTableBuf.append(\"create table if not exists \");\n preparedTableBuf.append(tableName + \" (\");\n\n boolean isCompoundKey = false;\n boolean isAutoKey = \"generated\".equals(pkey);\n\n String[] pkeys = pkey.split(\",\");\n StringBuffer compoundKey = new StringBuffer();\n if (pkeys.length > 1) {\n isCompoundKey = true;\n compoundKey.append(\", PRIMARY KEY (\");\n for (int i = 0; i < pkeys.length; i++) {\n compoundKey.append(pkeys[i] + (i == pkeys.length - 1 ? \")\" : \", \"));\n }\n }\n\n if (isAutoKey) {\n preparedTableBuf\n .append(\"id integer NOT NULL PRIMARY KEY AUTO_INCREMENT, \");\n }\n for (int i = 0; i < fields.length; i++) {\n preparedTableBuf.append(fields[i]\n + \" \"\n + columnTypes[i]\n + (pkey.equals(fields[i]) ? \" NOT NULL UNIQUE PRIMARY KEY\" : \"\")\n + (i == fields.length - 1 ? (isCompoundKey ? compoundKey.toString()\n : \"\") + \")\" : \", \"));\n }\n\n PreparedStatement preparedTableCreate = conn\n .prepareStatement(preparedTableBuf.toString());\n\n log.info(\"Prepared Table Statement : \" + preparedTableBuf.toString());\n preparedTableCreate.executeUpdate();\n conn.commit();\n\n } catch (Exception e) {\n log.error(e);\n }\n\n try {\n\n StringBuffer preparedInsertBuf = new StringBuffer();\n preparedInsertBuf.append(\"insert into \");\n preparedInsertBuf.append(tableName + \" (\");\n\n for (int i = 0; i < fields.length; i++) {\n preparedInsertBuf.append(fields[i]\n + (i == fields.length - 1 ? \")\" : \", \"));\n }\n\n preparedInsertBuf.append(\" values(\");\n\n for (int i = 0; i < fields.length; i++) {\n preparedInsertBuf.append(\"?\" + (i == fields.length - 1 ? \")\" : \", \"));\n }\n\n PreparedStatement insertItemRecord = conn\n .prepareStatement(preparedInsertBuf.toString());\n\n log.info(\"Rows : \" + fileImporter.getRowCount());\n log.info(\"Prepared Insert Statement : \" + preparedInsertBuf.toString());\n\n Iterator<Row> riter = fileImporter.getRowIterator();\n\n int rows = 0;\n\n int[] result = null;\n\n while (riter.hasNext()) {\n Row row = riter.next();\n\n if (!row.isValid()) {\n continue;\n } else {\n rows++;\n }\n\n try {\n for (int i = 0; i < fields.length; i++) {\n if (columnTypes[i].contains(\"char\")) {\n insertItemRecord.setString(i + 1, row.getValue(fields[i]));\n } else if (\"integer\".equals(columnTypes[i])) {\n try {\n Integer value = Integer.parseInt(row.getValue(fields[i]));\n insertItemRecord.setInt(i + 1, value);\n } catch (Exception e) {\n insertItemRecord.setInt(i + 1, 0);\n }\n } else {\n log.error(\"unsupported column type\");\n }\n }\n\n insertItemRecord.addBatch();\n\n if (rows % batchSize == 0) {\n\n try {\n result = insertItemRecord.executeBatch();\n\n conn.commit();\n log.info(\"batch update : \" + result.length);\n } catch (BatchUpdateException e) {\n log.error(\"Batch Update failed\", e);\n log.error(\"result size: \"\n + (result == null ? \"null\" : result.length));\n\n }\n\n }\n } catch (Exception e) {\n log.error(\"couldn't process row properly\", e);\n }\n }\n // the last set of updates will probably not mod to 0\n\n try {\n result = insertItemRecord.executeBatch();\n conn.commit();\n log.info(\"batch update : \" + result.length);\n } catch (BatchUpdateException e) {\n log.error(\"Batch Update failed\", e);\n log.error(\"\");\n }\n\n } catch (Exception e) {\n log.error(e);\n e.printStackTrace();\n }\n }", "public void execute();", "public void execute();", "public void execute();", "public void execute();", "private void executeRequest(String sql) {\n\t}", "public void runStatement(String statement) throws SQLException{\n\t\tConnection conn = null;\n\t\tPreparedStatement stmt = null;\n\t\ttry\n\t\t{\n\t\t\tconn = setUpConnection();\t\t\n\t\t\tstmt = conn.prepareStatement(statement);\t\t\n\t\t\tstmt.executeUpdate();\n\t\t\tconn.commit();\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tcloseJDBCResources(conn, stmt);\n\t\t}\n\t}", "CommandResult execute();", "public abstract ExecuteResult<T> execute() throws SQLException;", "public abstract void execute(SQLiteDatabase database);", "protected void execute() {\n \t// literally still do nothing\n }", "public void runStatement(final QueriesConfig qryConfig, final String statement) throws DBMissingValueException {\n final var dataSource = getDataSource(qryConfig);\n Connection conn = null;\n PreparedStatement stmt = null;\n try {\n conn = dataSource.getConnection();\n stmt = conn.prepareStatement(statement);\n\n switch (new QueryModeWrapper(qryConfig.getMode()).getMode()) {\n case QUERY:\n case SINGLE_QUERY_SCRIPT:\n final ResultSet rs = stmt.executeQuery();\n final var metaData = rs.getMetaData();\n long rsCount = 0;\n try {\n var firstLoad = true;\n final var listeners = qryConfig.getListeners();\n\n while (rs.next()) {\n rsCount++;\n StringBuilder sbHdr = new StringBuilder();\n StringBuilder sbRec = new StringBuilder();\n\n for (int idx = 1; idx <= metaData.getColumnCount(); idx++) {\n sbHdr.append(sbHdr.length()>0?\",\":\"\").append(metaData.getColumnName(idx));\n sbRec.append(sbRec.length()>0?\",\":\"\").append(rs.getString(idx));\n }\n\n if (firstLoad) {\n final var rawHdr = sbHdr.toString();\n LOG.info(String.format(\"[%s] [HDR]: %s\", qryConfig.getDescription(), rawHdr));\n\n if (listeners.getOnHeader()!=null) {\n runCmd(qryConfig, listeners.getOnHeader(), qryConfig.getDescription(), statement, rawHdr);\n }\n }\n final var rawData = sbRec.toString();\n LOG.info(String.format(\"[%s] [REC]: %s\", qryConfig.getDescription(), rawData));\n\n if (listeners.getOnData()!=null) {\n runCmd(qryConfig, listeners.getOnData(), qryConfig.getDescription(), statement, rawData);\n }\n firstLoad = false;\n }\n }\n finally {\n LOG.info(String.format(\"[%s] %s rows\", qryConfig.getDescription(), rsCount));\n try {rs.close();} catch (Exception e) {}\n }\n break;\n default:\n stmt.execute();\n try {LOG.info(String.format(\"[%s] %s rows affected\", qryConfig.getDescription(), stmt.getUpdateCount()));}\n catch(Exception e) {}\n break;\n }\n } catch (SQLException | QueryModeException e) {\n throw new RuntimeException(e);\n } finally {\n try {stmt.close();} catch (Exception e) {}\n try {conn.close();} catch (Exception e) {}\n }\n }", "@Override\r\n\tpublic void execute() {\n }", "void execute();", "void execute();", "void execute();", "void execute();", "void execute();", "void execute();", "void execute();", "public boolean execute() throws SQLException {\n return currentPreparedStatement.execute();\n }", "protected void execute() {}", "@Override\n public void execute() {}", "boolean execute() throws SQLException;", "public abstract ResultList executeQuery(DatabaseQuery query);", "public ResultSet executeSQL() {\t\t\n\t\tif (rs != null) {\n\t\t\ttry {\n\t\t\t\trs.close();\n\t\t\t} catch(SQLException se) {\n\t\t\t} finally {\n\t\t\t\trs = null;\n\t\t\t}\n\t\t}\n\t\ttry {\n\t\t\trs = pstmt.executeQuery();\n\t\t} catch (SQLException se) {\n\t\t\tse.printStackTrace();\n\t\t}\n\t\treturn rs;\n\t}", "public void execute() {\n\t\t\n\t}", "@Override\r\n\tpublic void execute() {\n\t}", "@Override\r\n\tpublic void execute() {\n\t}", "protected void execute() {\n \t\n }", "protected void execute() {\n \t\n }", "public void execute() {\n }", "protected abstract void execute();", "Object executeSelectQuery(String sql) { return null;}", "@Override\n\tpublic void execute() {\n\t}", "@Override\n\tpublic void execute() {\n\t\t\n\t}", "public void execute() {\r\n\t\r\n\t}", "private void executeSelect(String query){\n try {\n statement = connection.createStatement();\n rs = statement.executeQuery(query);\n } catch (SQLException e) {\n throw new RuntimeException(e);\n } \n }", "ResultSet runSQL(String query) {\n try {\n return connection.prepareStatement(query).executeQuery();\n }\n catch (SQLException e) {\n System.err.println(e.getMessage());\n return null;\n }\n }", "public void execute() {\n\t\t\r\n\t}", "public void execute() {\n\t\t\r\n\t}", "public void execute() {\n\t\t\r\n\t}", "@Override\r\n\tpublic ResultSet call() throws Exception {\n\t\tif (statement.execute()) {\r\n\t\t\tpool.checkIn(conn);\r\n\t\t\treturn statement.getResultSet();\r\n\t\t}\r\n\t\tpool.checkIn(conn); // Release the connection back to the pool\r\n\t\treturn null;\r\n\t}", "public abstract void run(Context context) throws SQLException;", "public void execute() {\n\n\t}", "public abstract void execute();", "public abstract void execute();", "public abstract void execute();", "@Override\n public void execute() {\n }", "@Override\n public void execute()\n {\n mDbHandle.execSQL(CREATE_TABLE_BLOOD_SUGAR);\n }", "public int execute();", "public boolean execute( ) throws OdaException\n \t{\n \t\tlogger.logp( java.util.logging.Level.FINE,\n \t\t\t\tStatement.class.getName( ),\n \t\t\t\t\"execute\",\n \t\t\t\t\"Statement.execute( )\" );\n \t\tassertNotNull( preStat );\n \t\ttry\n \t\t{\n \t\t\tif ( maxrows >= 0 && !maxRowsUpToDate )\n \t\t\t{\n \t\t\t\tpreStat.setMaxRows( maxrows );\n \t\t\t\tmaxRowsUpToDate = true;\n \t\t\t}\n \t\t\t/* redirect the call to JDBC preparedStatement.execute() */\n \t\t\treturn preStat.execute( );\n \t\t}\n \t\tcatch ( SQLException e )\n \t\t{\n \t\t\tthrow new JDBCException( ResourceConstants.QUERY_EXECUTE_FAIL, e );\n \t\t}\n \t}", "@Override\n\tpublic Object execute() {\n\n\t\treturn null;\n\t}", "abstract protected void execute();", "protected void execute()\n\t{\n\t}", "private static void deploy(SQLiteDatabase sqlLiteDb, InputStreamReader dbReader) throws IOException {\n String sqlLine = null;\n StringBuffer sqlBuffer = new StringBuffer();\n BufferedReader bufferedReader = new BufferedReader(dbReader);\n\n sqlLiteDb.beginTransaction();\n try {\n while ((sqlLine = bufferedReader.readLine()) != null) {\n String sql = sqlLine.trim();\n if (!isIgnoreSQL(sql)) {\n if (sql.endsWith(\";\")) {\n sqlBuffer.append(sql);\n String execSQL = sqlBuffer.toString();\n Log.d(TAG, \"running sql=>\" + execSQL);\n sqlLiteDb.execSQL(execSQL);\n sqlBuffer.delete(0, sqlBuffer.length());\n } else {\n if (sqlBuffer.length() > 0) {\n sqlBuffer.append(' ');\n }\n sqlBuffer.append(sql);\n }\n }\n }\n sqlLiteDb.setTransactionSuccessful();\n } finally {\n sqlLiteDb.endTransaction();\n }\n }", "public boolean execute(String sql) throws SQLException {\n return currentPreparedStatement.execute(sql);\n }", "public ResultSet executeQuery() throws SQLException {\n return statement.executeQuery();\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "private void doDBProcessing() throws InterruptedException {\n\t\tThread.sleep(5000);\r\n\t\t\r\n\t}", "ResultSet executeQuery() throws SQLException;", "public void executeSql(String sql, boolean doCommit, int fetchSize, int fetchDirn) throws SQLException {\n\n connectionCheck();\n blankStringCheck(sql, \"DB : Cannot execute null or empty SQL.\");\n\n LOGGER.info(\"DB : Executing the SQL : {}\", sql);\n\n Statement stmt = connection.createStatement();\n stmt.setFetchDirection(fetchDirn);\n stmt.setFetchSize(fetchSize);\n stmt.executeUpdate(sql);\n stmt.close();\n\n if (doCommit) {\n LOGGER.info(\"DB : Committing the changes.\");\n connection.commit();\n }\n }", "protected void execute() {\n\t\t\n\t}" ]
[ "0.6336187", "0.6241967", "0.6177818", "0.61180425", "0.60848653", "0.6041111", "0.6033396", "0.60024965", "0.59401983", "0.5886985", "0.5879832", "0.5841366", "0.5813763", "0.5812017", "0.5800251", "0.575419", "0.575329", "0.5750248", "0.5740996", "0.57149786", "0.5700528", "0.56995976", "0.5683789", "0.56639016", "0.56490237", "0.5647171", "0.5627958", "0.56034595", "0.56034595", "0.56034595", "0.56034595", "0.560284", "0.5601525", "0.5601084", "0.5595427", "0.55857164", "0.5578339", "0.55749285", "0.55681145", "0.55654943", "0.55654943", "0.55654943", "0.55654943", "0.55654943", "0.55654943", "0.55654943", "0.55564636", "0.5548903", "0.55425316", "0.5539111", "0.5523808", "0.55148846", "0.55012846", "0.5497568", "0.5497568", "0.54929936", "0.54929936", "0.5490509", "0.5487584", "0.5480931", "0.54613525", "0.5461151", "0.5458407", "0.54564303", "0.5440029", "0.54286504", "0.54286504", "0.54286504", "0.54253966", "0.5408903", "0.5405635", "0.5378741", "0.5378741", "0.5378741", "0.5371468", "0.53673595", "0.53659725", "0.53569114", "0.53506595", "0.53404963", "0.5331997", "0.53290313", "0.532752", "0.53262126", "0.53221846", "0.53221846", "0.53221846", "0.53221846", "0.53221846", "0.53221846", "0.53221846", "0.53221846", "0.53221846", "0.53221846", "0.53221846", "0.53221846", "0.5316871", "0.5309582", "0.5308435", "0.5303887" ]
0.6814547
0
Executes a database statement with no preparation. This will be executed on whichever thread it's called from.
default void execute(@Language("MySQL") @Nonnull String statement) { this.execute(statement, stmt -> {}); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "DBCursor execute();", "public void prepareExecuteNoSelect() {\n setCallFromStatement();\n // The statement is no longer require so can be released.\n clearStatement();\n\n super.prepareExecuteNoSelect();\n }", "public void execute() throws SQLException {\n\t\tif (this.ds == null) {\n\t\t\tthrow new RuntimeException(\n\t\t\t\"Please pass a DataSource to the ListSqlHelper!\");\n\t\t}\n\t\t\n\t\texecuteCountSql();\n\t\texecuteItemRangeSql();\n\t}", "private void executeQuery() {\n }", "protected static void execute(ReviewDb db, String sql) throws SQLException {\n try (Statement s = newStatement(db)) {\n s.execute(sql);\n }\n }", "public void execute() throws SQLException {\n\t\ttry {\n\t\t\tselect.setUsername(\"INTRANET\");\n\t\t\tselect.setPassword(\"INTRANET\");\n\t\t\tselect.execute();\n\t\t}\n\n\t\t// Liberar recursos del objeto select.\n\t\tfinally {\n\t\t\tselect.close();\n\t\t}\n\t}", "void execute(Context context) throws SQLException;", "public<T> T execute() throws DatabaseException;", "private void executeImmediate(String stmtText) throws SQLException\n {\n // execute the statement and auto-close it as well\n try (final Statement statement = this.createStatement();)\n {\n statement.execute(stmtText);\n }\n }", "@SuppressWarnings(\"unchecked\")\n public void execute() {\n execute(null, null);\n }", "public void run(Statement state) throws SQLException {\n\n System.out.println(\"INFO: -= Inserting data via dummy table ...\");\n state.execute(multipleRowInsertDummySQL);\n System.out.println(\"INFO: -= The data are inserted via dummy table:\");\n selectAllFromTable(state, tableName, 10);\n\n System.out.println(\"INFO: -= Inserting data using INSERT INTO statement ...\");\n state.execute(multipleRowInsertIntoSQL);\n System.out.println(\"INFO: -= The data are inserted via INSERT INTO statement:\");\n selectAllFromTable(state, tableName, 20);\n }", "public void exec(String sql) {\r\n try (Statement stmt = connection.createStatement()) {\r\n stmt.execute(sql);\r\n } catch (SQLException e) {\r\n throw new DbException(connectionString + \"\\nError executing \" + sql, e);\r\n }\r\n }", "protected void execute() {\n \t// literally still do nothing\n }", "public void prepareExecuteSelect() {\n setCallFromStatement();\n // The statement is no longer require so can be released.\n clearStatement();\n\n super.prepareExecuteSelect();\n }", "protected void execSQL(String sql) throws Exception {\n\t\tPreparedStatement statement = null;\n\t\ttry {\n\t\t\tstatement = connection.prepareStatement(sql);\n\t\t\tstatement.execute();\n\t\t} catch (Exception e) {\n\t\t\tthrow e;\n\t\t} finally {\n\t\t\tPersistenceUtils.closeStatement(statement);\n\t\t}\n\n\t}", "void runQueries();", "public void runStatement(String statement) throws SQLException{\n\t\tConnection conn = null;\n\t\tPreparedStatement stmt = null;\n\t\ttry\n\t\t{\n\t\t\tconn = setUpConnection();\t\t\n\t\t\tstmt = conn.prepareStatement(statement);\t\t\n\t\t\tstmt.executeUpdate();\n\t\t\tconn.commit();\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tcloseJDBCResources(conn, stmt);\n\t\t}\n\t}", "public void execute() {\n /*\n r6 = this;\n java.lang.String r0 = \"Failed to close connection after DBUnit operation: \"\n java.util.logging.Logger r1 = log\n java.lang.StringBuilder r2 = new java.lang.StringBuilder\n r2.<init>()\n java.lang.String r3 = \"Executing DBUnit operations: \"\n r2.append(r3)\n int r3 = r6.size()\n r2.append(r3)\n java.lang.String r2 = r2.toString()\n r1.info(r2)\n org.dbunit.database.IDatabaseConnection r1 = r6.getConnection() // Catch:{ all -> 0x005a }\n r6.disableReferentialIntegrity(r1) // Catch:{ all -> 0x0058 }\n java.util.Iterator r2 = r6.iterator() // Catch:{ all -> 0x0058 }\n L_0x0027:\n boolean r3 = r2.hasNext() // Catch:{ all -> 0x0058 }\n if (r3 == 0) goto L_0x0037\n java.lang.Object r3 = r2.next() // Catch:{ all -> 0x0058 }\n org.seamless.util.dbunit.DBUnitOperations$Op r3 = (org.seamless.util.dbunit.DBUnitOperations.Op) r3 // Catch:{ all -> 0x0058 }\n r3.execute(r1) // Catch:{ all -> 0x0058 }\n goto L_0x0027\n L_0x0037:\n r6.enableReferentialIntegrity(r1) // Catch:{ all -> 0x0058 }\n if (r1 == 0) goto L_0x0057\n r1.close() // Catch:{ Exception -> 0x0040 }\n goto L_0x0057\n L_0x0040:\n r1 = move-exception\n java.util.logging.Logger r2 = log\n java.util.logging.Level r3 = java.util.logging.Level.WARNING\n java.lang.StringBuilder r4 = new java.lang.StringBuilder\n r4.<init>()\n r4.append(r0)\n r4.append(r1)\n java.lang.String r0 = r4.toString()\n r2.log(r3, r0, r1)\n L_0x0057:\n return\n L_0x0058:\n r2 = move-exception\n goto L_0x005c\n L_0x005a:\n r2 = move-exception\n r1 = 0\n L_0x005c:\n if (r1 == 0) goto L_0x0079\n r1.close() // Catch:{ Exception -> 0x0062 }\n goto L_0x0079\n L_0x0062:\n r1 = move-exception\n java.util.logging.Logger r3 = log\n java.util.logging.Level r4 = java.util.logging.Level.WARNING\n java.lang.StringBuilder r5 = new java.lang.StringBuilder\n r5.<init>()\n r5.append(r0)\n r5.append(r1)\n java.lang.String r0 = r5.toString()\n r3.log(r4, r0, r1)\n L_0x0079:\n goto L_0x007b\n L_0x007a:\n throw r2\n L_0x007b:\n goto L_0x007a\n */\n throw new UnsupportedOperationException(\"Method not decompiled: org.seamless.util.dbunit.DBUnitOperations.execute():void\");\n }", "public final void execute() {\n try {\n\n StringBuffer preparedTableBuf = new StringBuffer();\n preparedTableBuf.append(\"create table if not exists \");\n preparedTableBuf.append(tableName + \" (\");\n\n boolean isCompoundKey = false;\n boolean isAutoKey = \"generated\".equals(pkey);\n\n String[] pkeys = pkey.split(\",\");\n StringBuffer compoundKey = new StringBuffer();\n if (pkeys.length > 1) {\n isCompoundKey = true;\n compoundKey.append(\", PRIMARY KEY (\");\n for (int i = 0; i < pkeys.length; i++) {\n compoundKey.append(pkeys[i] + (i == pkeys.length - 1 ? \")\" : \", \"));\n }\n }\n\n if (isAutoKey) {\n preparedTableBuf\n .append(\"id integer NOT NULL PRIMARY KEY AUTO_INCREMENT, \");\n }\n for (int i = 0; i < fields.length; i++) {\n preparedTableBuf.append(fields[i]\n + \" \"\n + columnTypes[i]\n + (pkey.equals(fields[i]) ? \" NOT NULL UNIQUE PRIMARY KEY\" : \"\")\n + (i == fields.length - 1 ? (isCompoundKey ? compoundKey.toString()\n : \"\") + \")\" : \", \"));\n }\n\n PreparedStatement preparedTableCreate = conn\n .prepareStatement(preparedTableBuf.toString());\n\n log.info(\"Prepared Table Statement : \" + preparedTableBuf.toString());\n preparedTableCreate.executeUpdate();\n conn.commit();\n\n } catch (Exception e) {\n log.error(e);\n }\n\n try {\n\n StringBuffer preparedInsertBuf = new StringBuffer();\n preparedInsertBuf.append(\"insert into \");\n preparedInsertBuf.append(tableName + \" (\");\n\n for (int i = 0; i < fields.length; i++) {\n preparedInsertBuf.append(fields[i]\n + (i == fields.length - 1 ? \")\" : \", \"));\n }\n\n preparedInsertBuf.append(\" values(\");\n\n for (int i = 0; i < fields.length; i++) {\n preparedInsertBuf.append(\"?\" + (i == fields.length - 1 ? \")\" : \", \"));\n }\n\n PreparedStatement insertItemRecord = conn\n .prepareStatement(preparedInsertBuf.toString());\n\n log.info(\"Rows : \" + fileImporter.getRowCount());\n log.info(\"Prepared Insert Statement : \" + preparedInsertBuf.toString());\n\n Iterator<Row> riter = fileImporter.getRowIterator();\n\n int rows = 0;\n\n int[] result = null;\n\n while (riter.hasNext()) {\n Row row = riter.next();\n\n if (!row.isValid()) {\n continue;\n } else {\n rows++;\n }\n\n try {\n for (int i = 0; i < fields.length; i++) {\n if (columnTypes[i].contains(\"char\")) {\n insertItemRecord.setString(i + 1, row.getValue(fields[i]));\n } else if (\"integer\".equals(columnTypes[i])) {\n try {\n Integer value = Integer.parseInt(row.getValue(fields[i]));\n insertItemRecord.setInt(i + 1, value);\n } catch (Exception e) {\n insertItemRecord.setInt(i + 1, 0);\n }\n } else {\n log.error(\"unsupported column type\");\n }\n }\n\n insertItemRecord.addBatch();\n\n if (rows % batchSize == 0) {\n\n try {\n result = insertItemRecord.executeBatch();\n\n conn.commit();\n log.info(\"batch update : \" + result.length);\n } catch (BatchUpdateException e) {\n log.error(\"Batch Update failed\", e);\n log.error(\"result size: \"\n + (result == null ? \"null\" : result.length));\n\n }\n\n }\n } catch (Exception e) {\n log.error(\"couldn't process row properly\", e);\n }\n }\n // the last set of updates will probably not mod to 0\n\n try {\n result = insertItemRecord.executeBatch();\n conn.commit();\n log.info(\"batch update : \" + result.length);\n } catch (BatchUpdateException e) {\n log.error(\"Batch Update failed\", e);\n log.error(\"\");\n }\n\n } catch (Exception e) {\n log.error(e);\n e.printStackTrace();\n }\n }", "public abstract void run(Context context) throws SQLException;", "protected void executeThread() {\n if (thread == null || !thread.isAlive()) {\n thread = new Thread(() -> {\n while (!queries.isEmpty() && !disconnect) {\n queries.remove().execute(queryRunner, connection);\n }\n if (disconnect) {\n disconnect();\n }\n });\n thread.start();\n }\n }", "public void execute() {\n // empty\n }", "public ResultSet executeSQL() {\t\t\n\t\tif (rs != null) {\n\t\t\ttry {\n\t\t\t\trs.close();\n\t\t\t} catch(SQLException se) {\n\t\t\t} finally {\n\t\t\t\trs = null;\n\t\t\t}\n\t\t}\n\t\ttry {\n\t\t\trs = pstmt.executeQuery();\n\t\t} catch (SQLException se) {\n\t\t\tse.printStackTrace();\n\t\t}\n\t\treturn rs;\n\t}", "public boolean Execute(String statement) throws SQLException{\r\n\t\treturn _dbStatement.execute(statement);\r\n\t}", "@Nonnull\n default Promise<Void> executeAsync(@Language(\"MySQL\") @Nonnull String statement) {\n return Schedulers.async().run(() -> this.execute(statement));\n }", "public void execute (String query) throws java.sql.SQLException {\n try {\n /*\n if (query.indexOf('(') != -1)\n Logger.write(\"VERBOSE\", \"DB\", \"execute(\\\"\" + query.substring(0,query.indexOf('(')) + \"...\\\")\");\n else\n Logger.write(\"VERBOSE\", \"DB\", \"execute(\\\"\" + query.substring(0,20) + \"...\\\")\");\n */\n Logger.write(\"VERBOSE\", \"DB\", \"execute(\\\"\" + query + \"\\\")\");\n \n Statement statement = dbConnection.createStatement();\n statement.setQueryTimeout(30);\n dbConnection.setAutoCommit(false);\n statement.executeUpdate(query);\n dbConnection.commit();\n dbConnection.setAutoCommit(true);\n } catch (java.sql.SQLException e) {\n Logger.write(\"ERROR\", \"DB\", \"SQLException: \" + e);\n throw e;\n }\n }", "private void executeRequest(String sql) {\n\t}", "public abstract void execute(SQLiteDatabase database);", "@SuppressWarnings(\"deprecation\")\n\tpublic void execute() throws BuildException {\n // Create a new build listener for parsing events\n Connection conn = getConnection();\n DbProgressListener listener = new DbProgressListener(conn, buildId, getProgressTargets(), dbTable);\n\n // Add the event listeners to the project\n project.addBuildListener(listener);\n\n // Add a thread to poll the database\n if (pollingEnabled) {\n polling = new DbStatusThread(conn);\n polling.setInterval(pollingInterval * 1000);\n polling.start();\n }\n }", "public void execute() {\n execute0();\n }", "protected void execute() {}", "protected abstract Object execute(JdbcChannel con,\n PreparedStatement stmt,\n String flags)\n throws ProcedureException;", "Object executeSelectQuery(String sql) { return null;}", "@Override\r\n\tpublic void execute() {\n }", "public void executeCountSql() throws SQLException {\n\t\tPreparedStatement stmt = null;\n\t\tResultSet rs = null;\n\t\ttry {\t\t\t\n\t\t\tSqlStatement countSqlStatement = getCountSqlStatement();\n\t\t\t\n\t\t\tlog.debug(\"Counting database query: \" + countSqlStatement.getQuery());\n\t\t\tlog.debug(\"Counting statement parameters: \" + countSqlStatement.getParams());\n\t\t\t\n\t\t\tstmt = this.con.prepareStatement(countSqlStatement.getQuery());\n\t\t\tcountSqlStatement.propagateStatementWithParams(stmt);\n\t\t\t\n\t\t\trs = stmt.executeQuery();\n\t\t\tif (rs.next()) {\n\t\t\t\tthis.totalCount = new Long(rs.getLong(1));\n\t\t\t}\n\t\t} finally {\n\t\t\tDbHelper.closeDbObjects(null, stmt, rs);\n\t\t}\n\t}", "public boolean execute() throws SQLException {\n return currentPreparedStatement.execute();\n }", "public abstract ResultList executeSQL(RawQuery rawQuery);", "public void runStatement(final QueriesConfig qryConfig, final String statement) throws DBMissingValueException {\n final var dataSource = getDataSource(qryConfig);\n Connection conn = null;\n PreparedStatement stmt = null;\n try {\n conn = dataSource.getConnection();\n stmt = conn.prepareStatement(statement);\n\n switch (new QueryModeWrapper(qryConfig.getMode()).getMode()) {\n case QUERY:\n case SINGLE_QUERY_SCRIPT:\n final ResultSet rs = stmt.executeQuery();\n final var metaData = rs.getMetaData();\n long rsCount = 0;\n try {\n var firstLoad = true;\n final var listeners = qryConfig.getListeners();\n\n while (rs.next()) {\n rsCount++;\n StringBuilder sbHdr = new StringBuilder();\n StringBuilder sbRec = new StringBuilder();\n\n for (int idx = 1; idx <= metaData.getColumnCount(); idx++) {\n sbHdr.append(sbHdr.length()>0?\",\":\"\").append(metaData.getColumnName(idx));\n sbRec.append(sbRec.length()>0?\",\":\"\").append(rs.getString(idx));\n }\n\n if (firstLoad) {\n final var rawHdr = sbHdr.toString();\n LOG.info(String.format(\"[%s] [HDR]: %s\", qryConfig.getDescription(), rawHdr));\n\n if (listeners.getOnHeader()!=null) {\n runCmd(qryConfig, listeners.getOnHeader(), qryConfig.getDescription(), statement, rawHdr);\n }\n }\n final var rawData = sbRec.toString();\n LOG.info(String.format(\"[%s] [REC]: %s\", qryConfig.getDescription(), rawData));\n\n if (listeners.getOnData()!=null) {\n runCmd(qryConfig, listeners.getOnData(), qryConfig.getDescription(), statement, rawData);\n }\n firstLoad = false;\n }\n }\n finally {\n LOG.info(String.format(\"[%s] %s rows\", qryConfig.getDescription(), rsCount));\n try {rs.close();} catch (Exception e) {}\n }\n break;\n default:\n stmt.execute();\n try {LOG.info(String.format(\"[%s] %s rows affected\", qryConfig.getDescription(), stmt.getUpdateCount()));}\n catch(Exception e) {}\n break;\n }\n } catch (SQLException | QueryModeException e) {\n throw new RuntimeException(e);\n } finally {\n try {stmt.close();} catch (Exception e) {}\n try {conn.close();} catch (Exception e) {}\n }\n }", "protected void execute() {\n \t\n }", "protected void execute() {\n \t\n }", "protected void execute()\n\t{\n\t}", "boolean execute() throws SQLException;", "protected void execute() {\n\t\t\n\t}", "public void execute() {\n\t\t\n\t}", "public void executeSql(String sql, boolean doCommit, int fetchSize, int fetchDirn) throws SQLException {\n\n connectionCheck();\n blankStringCheck(sql, \"DB : Cannot execute null or empty SQL.\");\n\n LOGGER.info(\"DB : Executing the SQL : {}\", sql);\n\n Statement stmt = connection.createStatement();\n stmt.setFetchDirection(fetchDirn);\n stmt.setFetchSize(fetchSize);\n stmt.executeUpdate(sql);\n stmt.close();\n\n if (doCommit) {\n LOGGER.info(\"DB : Committing the changes.\");\n connection.commit();\n }\n }", "public abstract ResultList executeQuery(DatabaseQuery query);", "public void execSql(String sql) {\n\t\tjdbcTemplate.execute(sql);\n\t}", "public boolean execute( ) throws OdaException\n \t{\n \t\tlogger.logp( java.util.logging.Level.FINE,\n \t\t\t\tStatement.class.getName( ),\n \t\t\t\t\"execute\",\n \t\t\t\t\"Statement.execute( )\" );\n \t\tassertNotNull( preStat );\n \t\ttry\n \t\t{\n \t\t\tif ( maxrows >= 0 && !maxRowsUpToDate )\n \t\t\t{\n \t\t\t\tpreStat.setMaxRows( maxrows );\n \t\t\t\tmaxRowsUpToDate = true;\n \t\t\t}\n \t\t\t/* redirect the call to JDBC preparedStatement.execute() */\n \t\t\treturn preStat.execute( );\n \t\t}\n \t\tcatch ( SQLException e )\n \t\t{\n \t\t\tthrow new JDBCException( ResourceConstants.QUERY_EXECUTE_FAIL, e );\n \t\t}\n \t}", "ResultSet executeQuery() throws SQLException;", "@Override\n\tpublic void execute() {\n\t\t\n\t}", "@Override\r\n\tpublic void execute() {\n\t}", "@Override\r\n\tpublic void execute() {\n\t}", "@Nonnull\n default Promise<Void> executeAsync(@Language(\"MySQL\") @Nonnull String statement, @Nonnull SqlConsumer<PreparedStatement> preparer) {\n return Schedulers.async().run(() -> this.execute(statement, preparer));\n }", "protected void execute() {\n\t}", "protected final void executeQuery() {\n\ttry {\n\t executeQuery(queryBox.getText());\n\t} catch(SQLException e) {\n\t e.printStackTrace();\n\t clearTable();\n\t JOptionPane.showMessageDialog(\n\t\tnull, e.getMessage(),\n\t\t\"Database Error\",\n\t\tJOptionPane.ERROR_MESSAGE);\n\t}\n }", "@Override\n public void execute() {}", "public void execute() {\r\n\t\r\n\t}", "public boolean execute(String sql) throws SQLException {\n return currentPreparedStatement.execute(sql);\n }", "@Override\n\t@Nullable\n\tpublic <T> T execute(PreparedStatementCreator psc, PreparedStatementCallback<T> action) throws DataAccessException {\n\n\t\tAssert.notNull(psc, \"PreparedStatementCreator must not be null\");\n\t\tAssert.notNull(action, \"Callback object must not be null\");\n\t\tif (logger.isDebugEnabled()) {\n\t\t\tString sql = getSql(psc);\n\t\t\tlogger.debug(\"Executing prepared SQL statement\" + (sql != null ? \" [\" + sql + \"]\" : \"\"));\n\t\t}\n\n\t\tConnection con = getTracedConnection();\n\n\t\tSpan queryExecSpan = tracer.spanBuilder(\"execute statement\").setRecordEvents(true).setSampler(Samplers.alwaysSample()).startSpan();\n\n\t\tPreparedStatement ps = null;\n\t\ttry (Scope ws = tracer.withSpan(queryExecSpan)) {\n\t\t\tps = psc.createPreparedStatement(con);\n\t\t\tapplyStatementSettings(ps);\n\t\t\tqueryExecSpan.addAnnotation(\"Statement:\" + ps.toString());\n\t\t\tT result = action.doInPreparedStatement(ps);\n\t\t\thandleWarnings(ps);\n\t\t\treturn result;\n\t\t} catch (SQLException ex) {\n\t\t\t// Release Connection early, to avoid potential connection pool deadlock\n\t\t\t// in the case when the exception translator hasn't been initialized yet.\n\t\t\tif (psc instanceof ParameterDisposer) {\n\t\t\t\t((ParameterDisposer) psc).cleanupParameters();\n\t\t\t}\n\t\t\tString sql = getSql(psc);\n\t\t\tJdbcUtils.closeStatement(ps);\n\t\t\tps = null;\n\t\t\tDataSourceUtils.releaseConnection(con, getDataSource());\n\t\t\tcon = null;\n\t\t\tthrow translateException(\"PreparedStatementCallback\", sql, ex);\n\t\t} finally {\n\t\t\tif (psc instanceof ParameterDisposer) {\n\t\t\t\t((ParameterDisposer) psc).cleanupParameters();\n\t\t\t}\n\t\t\tJdbcUtils.closeStatement(ps);\n\t\t\tDataSourceUtils.releaseConnection(con, getDataSource());\n\t\t\tqueryExecSpan.end();\n\t\t}\n\t}", "public abstract ExecuteResult<T> execute() throws SQLException;", "@Override\n\tpublic void execute() {\n\t}", "@Override\n public void execute()\n {\n mDbHandle.execSQL(CREATE_TABLE_BLOOD_SUGAR);\n }", "private void doDBProcessing() throws InterruptedException {\n\t\tThread.sleep(5000);\r\n\t\t\r\n\t}", "void execute();", "void execute();", "void execute();", "void execute();", "void execute();", "void execute();", "void execute();", "private void executeSelect(String query){\n try {\n statement = connection.createStatement();\n rs = statement.executeQuery(query);\n } catch (SQLException e) {\n throw new RuntimeException(e);\n } \n }", "@Override\n protected Void doInBackground(Void... params) {\n try{\n System.setProperty(\"FBAdbLog\", \"true\");\n Class.forName(\"org.firebirdsql.jdbc.FBDriver\");\n String sCon = \"jdbc:firebirdsql:\"+Server+\":C:/\"+Database+\".FDB?allowMultiQueries=true?encoding=ISO8859_1\";\n if(con == null){\n // Connection con = DriverManager.getConnection(sCon, \"SYSDBA\", \"masterkey\");\n }\n Connection con = DriverManager.getConnection(sCon, \"SYSDBA\", \"masterkey\");\n Statement stmt = con.createStatement();\n con.setAutoCommit(false);\n String sql = \"INSERT INTO CLIENT VALUES ('1','NASSER','2222222')\";\n String sql2 = \"INSERT INTO CLIENT VALUES ('2','SALIM','3333333')\";\n stmt.addBatch(sql);\n stmt.addBatch(sql2);\n stmt.executeBatch();\n // Statement stmt1 = con.createStatement();\n con.commit();\n //con.setAutoCommit(true);\n etatCon = true;\n }\n catch(Exception e){\n Log.e(\"FirebirdExample\", e.getMessage());\n etatCon = false;\n }\n return null;\n }", "ResultSet executeQuery(DatabaseConnection dbConnection, ParameterList parameters, JDataRow parentRow)\n throws PLException {\n ps = this.getStatement(dbConnection);\n this.fillValues(ps, parameters, parentRow);\n ResultSet rs;\n try {\n // StatementInfo\n TransactionInfo tInfo = dbConnection.getDatabase().getTransactionInfo(dbConnection.getId());\n if(tInfo != null) {\n tInfo.addStatement(dbConnection, this);\n }\n if(myRequest.isDebug()) {\n String sql = this.toString();\n logger.debug(sql);\n }\n // Statement ausführen\n long _startTime = System.currentTimeMillis();\n rs = ps.executeQuery();\n // Zeit messen\n long _dura = System.currentTimeMillis() - _startTime;\n // 1. default aus Datenbank\n long maxExecutionTime = dbConnection.getDatabase().getDefaultMaxExecutionTime();\n // 2. aus Statement\n if(this.getMaxExecutionTime() != Integer.MAX_VALUE) {\n maxExecutionTime = this.getMaxExecutionTime();\n }\n // 3. aus Parameter\n if(parameters != null && parameters.getMaxExecutionTime() != Integer.MAX_VALUE) {\n maxExecutionTime = parameters.getMaxExecutionTime();\n }\n if(_dura > maxExecutionTime) {\n Logger slowLog = dbConnection.getDatabase().getSlowQueryLogger();\n if(slowLog != null) {\n String msg = \"Statement: \" + this.getSql() + \"\\n Paramter: \" + parameters\n + \"\\n maxExecutionTime exceeded: \" + _dura + \">\" + maxExecutionTime;\n slowLog.warn(msg);\n }\n }\n return rs;\n }\n catch(SQLException ex) {\n String msg = \"PL [ \" + myRequest.getLayerName() + \" ] Error executing query statement: \" + ex.getMessage();\n logger.error(msg, ex);\n throw new PLException(msg, ex);\n }\n }", "public void execute();", "public void execute();", "public void execute();", "public void execute();", "private static void deploy(SQLiteDatabase sqlLiteDb, InputStreamReader dbReader) throws IOException {\n String sqlLine = null;\n StringBuffer sqlBuffer = new StringBuffer();\n BufferedReader bufferedReader = new BufferedReader(dbReader);\n\n sqlLiteDb.beginTransaction();\n try {\n while ((sqlLine = bufferedReader.readLine()) != null) {\n String sql = sqlLine.trim();\n if (!isIgnoreSQL(sql)) {\n if (sql.endsWith(\";\")) {\n sqlBuffer.append(sql);\n String execSQL = sqlBuffer.toString();\n Log.d(TAG, \"running sql=>\" + execSQL);\n sqlLiteDb.execSQL(execSQL);\n sqlBuffer.delete(0, sqlBuffer.length());\n } else {\n if (sqlBuffer.length() > 0) {\n sqlBuffer.append(' ');\n }\n sqlBuffer.append(sql);\n }\n }\n }\n sqlLiteDb.setTransactionSuccessful();\n } finally {\n sqlLiteDb.endTransaction();\n }\n }", "public void executeQuery_Other(String query) {\n\n \n Connection con = DBconnect.connectdb();\n Statement st;\n\n try {\n st = con.createStatement();\n st.executeUpdate(query);\n\n \n } catch (Exception e) {\n //JOptionPane.showMessageDialog(null, e);\n\n }\n\n }", "public boolean execute(UniversalDatabaseConnector target);", "public void execute() {\n\t\t\r\n\t}", "public void execute() {\n\t\t\r\n\t}", "public void execute() {\n\t\t\r\n\t}", "@Override\r\n public void runCode(String sql)\r\n throws DatabaseException {\r\n try {\r\n Class.forName(driverClassName);\r\n conn = DriverManager.getConnection(url, userName, password);\r\n \r\n } catch (ClassNotFoundException ex) {\r\n throw new DatabaseException(\"Could not load JDBC driver\");\r\n }\r\n catch(SQLException sq){\r\n throw new DatabaseException(\"Connection Failed\");\r\n }\r\n \r\n try {\r\n stmt = conn.createStatement();\r\n stmt.executeUpdate(sql); \r\n } catch (SQLException sqle) {\r\n throw new DatabaseException(\"Execution of SQL failed\");\r\n } catch (Exception e) {\r\n } finally {\r\n try {\r\n stmt.close();\r\n conn.close();\r\n } catch (Exception e) {\r\n throw new DatabaseException(\"Unknown error\");\r\n }\r\n }\r\n }", "protected void execute() {\r\n }", "protected abstract void execute();", "public void afterExecution(PreparedStatement stmt, StatementContext ctx) throws SQLException\n {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "protected void execute() {\n }", "ResultSet runSQL(String query) {\n try {\n return connection.prepareStatement(query).executeQuery();\n }\n catch (SQLException e) {\n System.err.println(e.getMessage());\n return null;\n }\n }" ]
[ "0.63538224", "0.6266484", "0.62355345", "0.6188492", "0.6165908", "0.61642873", "0.6046777", "0.5992281", "0.59618574", "0.59596956", "0.5950604", "0.5901076", "0.5856395", "0.58480567", "0.5839253", "0.5828735", "0.58275634", "0.5781085", "0.5779042", "0.57701564", "0.57686764", "0.574668", "0.57341623", "0.5731476", "0.57192343", "0.5710534", "0.568896", "0.5687777", "0.5665257", "0.56410223", "0.5593877", "0.5583016", "0.55746716", "0.5553527", "0.55492306", "0.5548157", "0.55437636", "0.55262434", "0.55259436", "0.55259436", "0.5496109", "0.54933983", "0.54890734", "0.54878396", "0.5487524", "0.5485468", "0.5475976", "0.5473104", "0.5467629", "0.54587734", "0.54577595", "0.54577595", "0.5455871", "0.54491585", "0.5434536", "0.5431939", "0.54159576", "0.5412477", "0.54086864", "0.5406633", "0.53985095", "0.5395163", "0.53856313", "0.53691506", "0.53691506", "0.53691506", "0.53691506", "0.53691506", "0.53691506", "0.53691506", "0.5367725", "0.5364598", "0.5363259", "0.53564405", "0.53564405", "0.53564405", "0.53564405", "0.535043", "0.53501153", "0.53490317", "0.5345444", "0.5345444", "0.5345444", "0.534425", "0.5343146", "0.53425074", "0.53399503", "0.5338824", "0.5338824", "0.5338824", "0.5338824", "0.5338824", "0.5338824", "0.5338824", "0.5338824", "0.5338824", "0.5338824", "0.5338824", "0.5338824", "0.5328934" ]
0.5892974
12
Executes a database statement with preparation. This will be executed on an asynchronous thread.
@Nonnull default Promise<Void> executeAsync(@Language("MySQL") @Nonnull String statement, @Nonnull SqlConsumer<PreparedStatement> preparer) { return Schedulers.async().run(() -> this.execute(statement, preparer)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final void execute() {\n try {\n\n StringBuffer preparedTableBuf = new StringBuffer();\n preparedTableBuf.append(\"create table if not exists \");\n preparedTableBuf.append(tableName + \" (\");\n\n boolean isCompoundKey = false;\n boolean isAutoKey = \"generated\".equals(pkey);\n\n String[] pkeys = pkey.split(\",\");\n StringBuffer compoundKey = new StringBuffer();\n if (pkeys.length > 1) {\n isCompoundKey = true;\n compoundKey.append(\", PRIMARY KEY (\");\n for (int i = 0; i < pkeys.length; i++) {\n compoundKey.append(pkeys[i] + (i == pkeys.length - 1 ? \")\" : \", \"));\n }\n }\n\n if (isAutoKey) {\n preparedTableBuf\n .append(\"id integer NOT NULL PRIMARY KEY AUTO_INCREMENT, \");\n }\n for (int i = 0; i < fields.length; i++) {\n preparedTableBuf.append(fields[i]\n + \" \"\n + columnTypes[i]\n + (pkey.equals(fields[i]) ? \" NOT NULL UNIQUE PRIMARY KEY\" : \"\")\n + (i == fields.length - 1 ? (isCompoundKey ? compoundKey.toString()\n : \"\") + \")\" : \", \"));\n }\n\n PreparedStatement preparedTableCreate = conn\n .prepareStatement(preparedTableBuf.toString());\n\n log.info(\"Prepared Table Statement : \" + preparedTableBuf.toString());\n preparedTableCreate.executeUpdate();\n conn.commit();\n\n } catch (Exception e) {\n log.error(e);\n }\n\n try {\n\n StringBuffer preparedInsertBuf = new StringBuffer();\n preparedInsertBuf.append(\"insert into \");\n preparedInsertBuf.append(tableName + \" (\");\n\n for (int i = 0; i < fields.length; i++) {\n preparedInsertBuf.append(fields[i]\n + (i == fields.length - 1 ? \")\" : \", \"));\n }\n\n preparedInsertBuf.append(\" values(\");\n\n for (int i = 0; i < fields.length; i++) {\n preparedInsertBuf.append(\"?\" + (i == fields.length - 1 ? \")\" : \", \"));\n }\n\n PreparedStatement insertItemRecord = conn\n .prepareStatement(preparedInsertBuf.toString());\n\n log.info(\"Rows : \" + fileImporter.getRowCount());\n log.info(\"Prepared Insert Statement : \" + preparedInsertBuf.toString());\n\n Iterator<Row> riter = fileImporter.getRowIterator();\n\n int rows = 0;\n\n int[] result = null;\n\n while (riter.hasNext()) {\n Row row = riter.next();\n\n if (!row.isValid()) {\n continue;\n } else {\n rows++;\n }\n\n try {\n for (int i = 0; i < fields.length; i++) {\n if (columnTypes[i].contains(\"char\")) {\n insertItemRecord.setString(i + 1, row.getValue(fields[i]));\n } else if (\"integer\".equals(columnTypes[i])) {\n try {\n Integer value = Integer.parseInt(row.getValue(fields[i]));\n insertItemRecord.setInt(i + 1, value);\n } catch (Exception e) {\n insertItemRecord.setInt(i + 1, 0);\n }\n } else {\n log.error(\"unsupported column type\");\n }\n }\n\n insertItemRecord.addBatch();\n\n if (rows % batchSize == 0) {\n\n try {\n result = insertItemRecord.executeBatch();\n\n conn.commit();\n log.info(\"batch update : \" + result.length);\n } catch (BatchUpdateException e) {\n log.error(\"Batch Update failed\", e);\n log.error(\"result size: \"\n + (result == null ? \"null\" : result.length));\n\n }\n\n }\n } catch (Exception e) {\n log.error(\"couldn't process row properly\", e);\n }\n }\n // the last set of updates will probably not mod to 0\n\n try {\n result = insertItemRecord.executeBatch();\n conn.commit();\n log.info(\"batch update : \" + result.length);\n } catch (BatchUpdateException e) {\n log.error(\"Batch Update failed\", e);\n log.error(\"\");\n }\n\n } catch (Exception e) {\n log.error(e);\n e.printStackTrace();\n }\n }", "@Nonnull\n default Promise<Void> executeAsync(@Language(\"MySQL\") @Nonnull String statement) {\n return Schedulers.async().run(() -> this.execute(statement));\n }", "DBCursor execute();", "public Promise<PreparedStatement> prepare(final RegularStatement query) {\n return futureToPromise(session.prepareAsync(query));\n }", "public void run(Statement state) throws SQLException {\n\n System.out.println(\"INFO: -= Inserting data via dummy table ...\");\n state.execute(multipleRowInsertDummySQL);\n System.out.println(\"INFO: -= The data are inserted via dummy table:\");\n selectAllFromTable(state, tableName, 10);\n\n System.out.println(\"INFO: -= Inserting data using INSERT INTO statement ...\");\n state.execute(multipleRowInsertIntoSQL);\n System.out.println(\"INFO: -= The data are inserted via INSERT INTO statement:\");\n selectAllFromTable(state, tableName, 20);\n }", "public void execute() throws SQLException {\n\t\ttry {\n\t\t\tselect.setUsername(\"INTRANET\");\n\t\t\tselect.setPassword(\"INTRANET\");\n\t\t\tselect.execute();\n\t\t}\n\n\t\t// Liberar recursos del objeto select.\n\t\tfinally {\n\t\t\tselect.close();\n\t\t}\n\t}", "public Promise<PreparedStatement> prepare(final String query) {\n return futureToPromise(session.prepareAsync(query));\n }", "public void execute() throws SQLException {\n\t\tif (this.ds == null) {\n\t\t\tthrow new RuntimeException(\n\t\t\t\"Please pass a DataSource to the ListSqlHelper!\");\n\t\t}\n\t\t\n\t\texecuteCountSql();\n\t\texecuteItemRangeSql();\n\t}", "public void prepareExecuteSelect() {\n setCallFromStatement();\n // The statement is no longer require so can be released.\n clearStatement();\n\n super.prepareExecuteSelect();\n }", "private void executeQuery() {\n }", "public static void doDataProcessPrepareSt(String name, String sql, PreparedStatementProcessor pd)\n {\n executorService.execute(() -> PolledDb.doDataProcessPrepareSt(name, sql, pd));\n }", "protected void execSQL(String sql) throws Exception {\n\t\tPreparedStatement statement = null;\n\t\ttry {\n\t\t\tstatement = connection.prepareStatement(sql);\n\t\t\tstatement.execute();\n\t\t} catch (Exception e) {\n\t\t\tthrow e;\n\t\t} finally {\n\t\t\tPersistenceUtils.closeStatement(statement);\n\t\t}\n\n\t}", "void execute(@Language(\"MySQL\") @Nonnull String statement, @Nonnull SqlConsumer<PreparedStatement> preparer);", "void execute(Context context) throws SQLException;", "public void prepareExecuteNoSelect() {\n setCallFromStatement();\n // The statement is no longer require so can be released.\n clearStatement();\n\n super.prepareExecuteNoSelect();\n }", "@Override\n protected Void doInBackground(Void... params) {\n try{\n System.setProperty(\"FBAdbLog\", \"true\");\n Class.forName(\"org.firebirdsql.jdbc.FBDriver\");\n String sCon = \"jdbc:firebirdsql:\"+Server+\":C:/\"+Database+\".FDB?allowMultiQueries=true?encoding=ISO8859_1\";\n if(con == null){\n // Connection con = DriverManager.getConnection(sCon, \"SYSDBA\", \"masterkey\");\n }\n Connection con = DriverManager.getConnection(sCon, \"SYSDBA\", \"masterkey\");\n Statement stmt = con.createStatement();\n con.setAutoCommit(false);\n String sql = \"INSERT INTO CLIENT VALUES ('1','NASSER','2222222')\";\n String sql2 = \"INSERT INTO CLIENT VALUES ('2','SALIM','3333333')\";\n stmt.addBatch(sql);\n stmt.addBatch(sql2);\n stmt.executeBatch();\n // Statement stmt1 = con.createStatement();\n con.commit();\n //con.setAutoCommit(true);\n etatCon = true;\n }\n catch(Exception e){\n Log.e(\"FirebirdExample\", e.getMessage());\n etatCon = false;\n }\n return null;\n }", "@Override\n\t@Nullable\n\tpublic <T> T execute(PreparedStatementCreator psc, PreparedStatementCallback<T> action) throws DataAccessException {\n\n\t\tAssert.notNull(psc, \"PreparedStatementCreator must not be null\");\n\t\tAssert.notNull(action, \"Callback object must not be null\");\n\t\tif (logger.isDebugEnabled()) {\n\t\t\tString sql = getSql(psc);\n\t\t\tlogger.debug(\"Executing prepared SQL statement\" + (sql != null ? \" [\" + sql + \"]\" : \"\"));\n\t\t}\n\n\t\tConnection con = getTracedConnection();\n\n\t\tSpan queryExecSpan = tracer.spanBuilder(\"execute statement\").setRecordEvents(true).setSampler(Samplers.alwaysSample()).startSpan();\n\n\t\tPreparedStatement ps = null;\n\t\ttry (Scope ws = tracer.withSpan(queryExecSpan)) {\n\t\t\tps = psc.createPreparedStatement(con);\n\t\t\tapplyStatementSettings(ps);\n\t\t\tqueryExecSpan.addAnnotation(\"Statement:\" + ps.toString());\n\t\t\tT result = action.doInPreparedStatement(ps);\n\t\t\thandleWarnings(ps);\n\t\t\treturn result;\n\t\t} catch (SQLException ex) {\n\t\t\t// Release Connection early, to avoid potential connection pool deadlock\n\t\t\t// in the case when the exception translator hasn't been initialized yet.\n\t\t\tif (psc instanceof ParameterDisposer) {\n\t\t\t\t((ParameterDisposer) psc).cleanupParameters();\n\t\t\t}\n\t\t\tString sql = getSql(psc);\n\t\t\tJdbcUtils.closeStatement(ps);\n\t\t\tps = null;\n\t\t\tDataSourceUtils.releaseConnection(con, getDataSource());\n\t\t\tcon = null;\n\t\t\tthrow translateException(\"PreparedStatementCallback\", sql, ex);\n\t\t} finally {\n\t\t\tif (psc instanceof ParameterDisposer) {\n\t\t\t\t((ParameterDisposer) psc).cleanupParameters();\n\t\t\t}\n\t\t\tJdbcUtils.closeStatement(ps);\n\t\t\tDataSourceUtils.releaseConnection(con, getDataSource());\n\t\t\tqueryExecSpan.end();\n\t\t}\n\t}", "public<T> T execute() throws DatabaseException;", "protected static void execute(ReviewDb db, String sql) throws SQLException {\n try (Statement s = newStatement(db)) {\n s.execute(sql);\n }\n }", "private static void deploy(SQLiteDatabase sqlLiteDb, InputStreamReader dbReader) throws IOException {\n String sqlLine = null;\n StringBuffer sqlBuffer = new StringBuffer();\n BufferedReader bufferedReader = new BufferedReader(dbReader);\n\n sqlLiteDb.beginTransaction();\n try {\n while ((sqlLine = bufferedReader.readLine()) != null) {\n String sql = sqlLine.trim();\n if (!isIgnoreSQL(sql)) {\n if (sql.endsWith(\";\")) {\n sqlBuffer.append(sql);\n String execSQL = sqlBuffer.toString();\n Log.d(TAG, \"running sql=>\" + execSQL);\n sqlLiteDb.execSQL(execSQL);\n sqlBuffer.delete(0, sqlBuffer.length());\n } else {\n if (sqlBuffer.length() > 0) {\n sqlBuffer.append(' ');\n }\n sqlBuffer.append(sql);\n }\n }\n }\n sqlLiteDb.setTransactionSuccessful();\n } finally {\n sqlLiteDb.endTransaction();\n }\n }", "private static void runDDL(String JDBC_DRIVER, String DB_URL, String USER, String PASS, String sql) {\r\n\r\n\t\tConnection conn = null;\r\n\t\tStatement stmt = null;\r\n\t\ttry {\r\n\t\t\t// STEP 2: Register JDBC driver\r\n\t\t\tSystem.out.println(\"Loading driver...\");\r\n\t\t\tClass.forName(JDBC_DRIVER);\r\n\r\n\t\t\t// STEP 3: Open a connection\r\n\t\t\tSystem.out.println(\"Connecting to database...\");\r\n\t\t\t\r\n\t\t\tif (USER.equals(\" \") && PASS.equals(\" \")) {\r\n\t\t\t\tconn = DriverManager.getConnection(DB_URL);\r\n\t\t\t} else {\r\n\t\t\t\tconn = DriverManager.getConnection(DB_URL, USER, PASS);\r\n\t\t\t}\r\n\r\n\t\t\t// STEP 4: Execute a query\r\n\t\t\tSystem.out.println(\"Creating statement...\");\r\n\t\t\tstmt = conn.createStatement();\r\n\r\n\t\t\t// ResultSet rs = null;\r\n\t\t\tstmt.executeUpdate(sql);\r\n\t\t\t// stmt.executeQuery(sql);\r\n\r\n\t\t\t// STEP 5: Extract data from result set\r\n\r\n\t\t\t/*\r\n\t\t\t * while (rs.next()) { // Retrieve by column name //int id =\r\n\t\t\t * rs.getInt(\"id\"); //String name = rs.getString(\"name\");\r\n\t\t\t * \r\n\t\t\t * // Display values //System.out.print(\"ID: \" + id);\r\n\t\t\t * //System.out.println(\", name: \" + name); }\r\n\t\t\t */\r\n\r\n\t\t\tSystem.out.println(\"[\" + DB_URL.substring(0, (DB_URL.length() - 1)) + \"]: sql success\");\r\n\t\t\tsuccessful = true;\r\n\r\n\t\t\t// rs.close();\r\n\t\t\tstmt.close();\r\n\t\t\tconn.close();\r\n\t\t} catch (SQLException se) {\r\n\t\t\t// Handle errors for JDBC\r\n\t\t\t//se.printStackTrace();\r\n\t\t\tSystem.out.println(\"[\" + DB_URL.substring(0, (DB_URL.length() - 1)) + \"]: sql failed\");\r\n\t\t} catch (Exception e) {\r\n\t\t\t// Handle errors for Class.forName\r\n\t\t\t//e.printStackTrace();\r\n\t\t\tSystem.out.println(\"[\" + DB_URL.substring(0, (DB_URL.length() - 1)) + \"]: sql failed\");\r\n\t\t} finally {\r\n\t\t\t// finally block used to close resources\r\n\t\t\ttry {\r\n\t\t\t\tif (stmt != null)\r\n\t\t\t\t\tstmt.close();\r\n\t\t\t} catch (SQLException se2) {\r\n\t\t\t} // nothing we can do\r\n\t\t\ttry {\r\n\t\t\t\tif (conn != null)\r\n\t\t\t\t\tconn.close();\r\n\t\t\t} catch (SQLException se) {\r\n\t\t\t\tse.printStackTrace();\r\n\t\t\t} // end finally try\r\n\t\t} // end try\r\n\t\t\t// System.out.println(\"Goodbye!\");\r\n\r\n\t}", "public void exec(String sql) {\r\n try (Statement stmt = connection.createStatement()) {\r\n stmt.execute(sql);\r\n } catch (SQLException e) {\r\n throw new DbException(connectionString + \"\\nError executing \" + sql, e);\r\n }\r\n }", "@Override\n public void prepare(PreparedStatement statement) {\n }", "@SuppressWarnings(\"deprecation\")\n\tpublic void execute() throws BuildException {\n // Create a new build listener for parsing events\n Connection conn = getConnection();\n DbProgressListener listener = new DbProgressListener(conn, buildId, getProgressTargets(), dbTable);\n\n // Add the event listeners to the project\n project.addBuildListener(listener);\n\n // Add a thread to poll the database\n if (pollingEnabled) {\n polling = new DbStatusThread(conn);\n polling.setInterval(pollingInterval * 1000);\n polling.start();\n }\n }", "public void prepareInsertObject() {\n // Require modify row to prepare.\n if (getModifyRow() == null) {\n return;\n }\n\n if (hasMultipleStatements()) {\n for (Enumeration statementEnum = getSQLStatements().elements();\n statementEnum.hasMoreElements();) {\n ((SQLModifyStatement)statementEnum.nextElement()).setModifyRow(getModifyRow());\n }\n } else if (getSQLStatement() != null) {\n ((SQLModifyStatement)getSQLStatement()).setModifyRow(getModifyRow());\n }\n setCallFromStatement();\n // The statement is no longer require so can be released.\n clearStatement();\n\n super.prepareInsertObject();\n }", "public void prepare() {\n if ((!hasMultipleStatements()) && (getSQLStatement() == null)) {\n throw QueryException.sqlStatementNotSetProperly(getQuery());\n }\n\n // Cannot call super yet as the call is not built.\n }", "@Override\n\tpublic void prepareStatements() throws Exception\n\t{\n\t\tsuper.prepareStatements();\n\t\t//transaction statements\n\t\tbeginTransactionStatement = conn.prepareStatement(BEGIN_TRANSACTION_SQL);\n\t\tcommitTransactionStatement = conn.prepareStatement(COMMIT_SQL);\n\t\trollbackTransactionStatement = conn.prepareStatement(ROLLBACK_SQL);\n\t\t//check statements \n\t\tcheckUserameStatement = conn.prepareStatement(CHECK_USERNAME_SQL);\n\t\tcheckLoginStatement = conn.prepareStatement(CHECK_LOGIN_SQL);\n\t\tcheckUnpaidReservationStatement = conn.prepareStatement(CHECK_UNPAID_RESERVATION_SQL);\n\t\tcheckTravelStatement = conn.prepareStatement(CHECK_TRAVEL_SQL);\n\t\tcheckNotCanceledReservationStatement = conn.prepareStatement(CHECK_NOT_CANCELED_SQL);\n\t\t//insert statements\n\t\tinsertUserStatement = conn.prepareStatement(INSERT_USER_SQL);\n\t\tinsertTravelStatement = conn.prepareStatement(INSERT_TRAVEL_SQL);\n\t\tinsertReservationStatement = conn.prepareStatement(INSERT_RESERVATION_SQL);\n\t\tinsertRidStatement = conn.prepareStatement(INSERT_RID_SQL);\n\t\t//update statements\n\t\tupdateBalanceStatement = conn.prepareStatement(UPDATE_BALANCE_SQL);\n\t\tupdateRidStatement = conn.prepareStatement(UPDATE_RID_SQL);\n\t\tupdateReservationCancelStatement = conn.prepareStatement(UPDATE_RESERVATION_CANCEL_SQL);\n\t\tupdateReservationPaidStatement = conn.prepareStatement(UPDATE_RESERVATION_PAID_SQL);\n\t\t//get statements\n\t\tgetReservationsStatement = conn.prepareStatement(GET_RESERVATIONS_SQL);\n\t\tgetFlightStatement = conn.prepareStatement(GET_FLIGHT_SQL);\n\t\tgetBalanceStatement = conn.prepareStatement(GET_BALANCE_SQL);\n\t\tgetReservationStatement = conn.prepareStatement(GET_RESERVATION_SQL);\n\t\tgetNumReservationsStatement = conn.prepareStatement(GET_NUM_RESERVATION_SQL);\n\t\tgetRidStatement = conn.prepareStatement(GET_RID_SQL);\n\t\t//clear statements\n\t\tdeleteTravelStatement = conn.prepareStatement(DELETE_TRAVEL_SQL);\n\t\tclearStatement = conn.prepareStatement(CLEAR_SQL);\n\t}", "public void runStatement(String statement) throws SQLException{\n\t\tConnection conn = null;\n\t\tPreparedStatement stmt = null;\n\t\ttry\n\t\t{\n\t\t\tconn = setUpConnection();\t\t\n\t\t\tstmt = conn.prepareStatement(statement);\t\t\n\t\t\tstmt.executeUpdate();\n\t\t\tconn.commit();\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tcloseJDBCResources(conn, stmt);\n\t\t}\n\t}", "protected void createStmt(String sql, boolean returnGeneratedKeys) throws SQLException {\n if (stmt != null) {\n throw new IllegalStateException(\"A statement has already been prepared!\");\n }\n\n this.query = sql;\n\n stmt = returnGeneratedKeys ?\n context.getConnection(getDescriptor().getRealm())\n .prepareStatement(sql, Statement.RETURN_GENERATED_KEYS) :\n context.getConnection(getDescriptor().getRealm())\n .prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);\n }", "public void runStatement(final QueriesConfig qryConfig, final String statement) throws DBMissingValueException {\n final var dataSource = getDataSource(qryConfig);\n Connection conn = null;\n PreparedStatement stmt = null;\n try {\n conn = dataSource.getConnection();\n stmt = conn.prepareStatement(statement);\n\n switch (new QueryModeWrapper(qryConfig.getMode()).getMode()) {\n case QUERY:\n case SINGLE_QUERY_SCRIPT:\n final ResultSet rs = stmt.executeQuery();\n final var metaData = rs.getMetaData();\n long rsCount = 0;\n try {\n var firstLoad = true;\n final var listeners = qryConfig.getListeners();\n\n while (rs.next()) {\n rsCount++;\n StringBuilder sbHdr = new StringBuilder();\n StringBuilder sbRec = new StringBuilder();\n\n for (int idx = 1; idx <= metaData.getColumnCount(); idx++) {\n sbHdr.append(sbHdr.length()>0?\",\":\"\").append(metaData.getColumnName(idx));\n sbRec.append(sbRec.length()>0?\",\":\"\").append(rs.getString(idx));\n }\n\n if (firstLoad) {\n final var rawHdr = sbHdr.toString();\n LOG.info(String.format(\"[%s] [HDR]: %s\", qryConfig.getDescription(), rawHdr));\n\n if (listeners.getOnHeader()!=null) {\n runCmd(qryConfig, listeners.getOnHeader(), qryConfig.getDescription(), statement, rawHdr);\n }\n }\n final var rawData = sbRec.toString();\n LOG.info(String.format(\"[%s] [REC]: %s\", qryConfig.getDescription(), rawData));\n\n if (listeners.getOnData()!=null) {\n runCmd(qryConfig, listeners.getOnData(), qryConfig.getDescription(), statement, rawData);\n }\n firstLoad = false;\n }\n }\n finally {\n LOG.info(String.format(\"[%s] %s rows\", qryConfig.getDescription(), rsCount));\n try {rs.close();} catch (Exception e) {}\n }\n break;\n default:\n stmt.execute();\n try {LOG.info(String.format(\"[%s] %s rows affected\", qryConfig.getDescription(), stmt.getUpdateCount()));}\n catch(Exception e) {}\n break;\n }\n } catch (SQLException | QueryModeException e) {\n throw new RuntimeException(e);\n } finally {\n try {stmt.close();} catch (Exception e) {}\n try {conn.close();} catch (Exception e) {}\n }\n }", "@Override\n public void execute()\n {\n mDbHandle.execSQL(CREATE_TABLE_BLOOD_SUGAR);\n }", "private long prepareSQL(SQLiteDatabase db, String statement, JSArray values) {\n boolean success = true;\n String stmtType = \"\";\n long lastId = Long.valueOf(-1);\n stmtType = statement.substring(0, 6).toUpperCase();\n SQLiteStatement stmt = db.compileStatement(statement);\n if (values != null && values.length() > 0) {\n // bind the values if any\n stmt.clearBindings();\n try {\n bindValues(stmt, values);\n } catch (JSONException e) {\n Log.d(TAG, \"Error: prepareSQL failed: \" + e.getMessage());\n success = false;\n }\n }\n if (success) {\n if (stmtType.equals(\"INSERT\")) {\n lastId = stmt.executeInsert();\n } else {\n lastId = Long.valueOf(stmt.executeUpdateDelete());\n }\n }\n stmt.close();\n return lastId;\n }", "private void doDBProcessing() throws InterruptedException {\n\t\tThread.sleep(5000);\r\n\t\t\r\n\t}", "Statement createStatement();", "Statement createStatement();", "Statement createStatement();", "public void afterExecution(PreparedStatement stmt, StatementContext ctx) throws SQLException\n {\n }", "private void executeImmediate(String stmtText) throws SQLException\n {\n // execute the statement and auto-close it as well\n try (final Statement statement = this.createStatement();)\n {\n statement.execute(stmtText);\n }\n }", "private void executeRequest(String sql) {\n\t}", "public abstract void run(Context context) throws SQLException;", "public void execute (String query) throws java.sql.SQLException {\n try {\n /*\n if (query.indexOf('(') != -1)\n Logger.write(\"VERBOSE\", \"DB\", \"execute(\\\"\" + query.substring(0,query.indexOf('(')) + \"...\\\")\");\n else\n Logger.write(\"VERBOSE\", \"DB\", \"execute(\\\"\" + query.substring(0,20) + \"...\\\")\");\n */\n Logger.write(\"VERBOSE\", \"DB\", \"execute(\\\"\" + query + \"\\\")\");\n \n Statement statement = dbConnection.createStatement();\n statement.setQueryTimeout(30);\n dbConnection.setAutoCommit(false);\n statement.executeUpdate(query);\n dbConnection.commit();\n dbConnection.setAutoCommit(true);\n } catch (java.sql.SQLException e) {\n Logger.write(\"ERROR\", \"DB\", \"SQLException: \" + e);\n throw e;\n }\n }", "public abstract void execute(SQLiteDatabase database);", "public void prepStmt(String sql) {\n\t\ttry {\n\t\t\tpstmt = conn.prepareStatement(sql);\n\t\t} catch(SQLException se) {\n\t\t\tse.printStackTrace();\n\t\t}\n\t}", "public void prepareStatements() throws Exception {\r\n beginTransactionStatement = conn.prepareStatement(BEGIN_TRANSACTION_SQL);\r\n commitTransactionStatement = conn.prepareStatement(COMMIT_SQL);\r\n rollbackTransactionStatement = conn.prepareStatement(ROLLBACK_SQL);\r\n\r\n\t\tdeleteReservationStatement = conn.prepareStatement(DELETE_RESERVATION_SQL);\r\n\t\tdeleteBookingStatement = conn.prepareStatement(DELETE_BOOKING_SQL);\r\n\t\tdeleteUserStatement = conn.prepareStatement(DELETE_USER_SQL);\r\n\t\t\r\n checkFlightCapacityStatement = conn.prepareStatement(CHECK_FLIGHT_CAPACITY);\r\n\t\tcheckReservationRowStatement = conn.prepareStatement(CHECK_RESERVATION_ROW_NUMBER);\r\n\r\n /* add here more prepare statements for all the other queries you need */\r\n /* . . . . . . */\r\n\t\tuserLoginStatement = conn.prepareStatement(LOGIN_SQL);\r\n\t\t\r\n\t\tcreateUserStatement = conn.prepareStatement(CREATE_USER_SQL);\r\n\t\t\r\n\t\tsearchOneHopStatement = conn.prepareStatement(SEARCH_ONE_HOP_SQL);\r\n\t\tsearchTwoHopStatement = conn.prepareStatement(SEARCH_TWO_HOP_SQL);\r\n\t\t\r\n\t\tcheckBookingStatement = conn.prepareStatement(CHECK_BOOKING_SQL);\r\n\t\tnewBookingStatement = conn.prepareStatement(NEW_BOOKING_SQL);\r\n\t\tupdateBookingStatement = conn.prepareStatement(UPDATE_BOOKING_SQL);\r\n\t\t\r\n\t\toneReservationStatement = conn.prepareStatement(ONE_RESERVATION_SQL);\r\n\t\ttwoReservationStatement = conn.prepareStatement(TWO_RESERVATION_SQL);\r\n\t\t\r\n\t\tsearchReservationStatement = conn.prepareStatement(SEARCH_RESERVATION_SQL);\r\n\t\tunpaidReservationStatement = conn.prepareStatement(SEARCH_UNPAID_SQL);\r\n\t\t\r\n\t\tsearchFlightStatement = conn.prepareStatement(SEARCH_FLIGHT_SQL);\r\n\t\t\r\n\t\tupdatePaidStatement = conn.prepareStatement(UPDATE_UNPAID_SQL);\r\n\t\tcheckPriceStatement = conn.prepareStatement(FLIGHT_PRICE_SQL);\r\n\t\tupdateBalanceStatement = conn.prepareStatement(UPDATE_BALANCE_SQL);\r\n\t\tcheckBalanceStatement = conn.prepareStatement(SEARCH_BALANCE_SQL);\r\n\t\tunpaidReservationStatement2 = conn.prepareStatement(SEARCH_UNPAID_SQL_2);\r\n\t\t\r\n\t\tsearchFirstFidStatement = conn.prepareStatement(FIRST_FID_SQL);\r\n\t\tsearchSecondFidStatement = conn.prepareStatement(SECOND_FID_SQL);\r\n\t\tcancelReservationStatement = conn.prepareStatement(CANCEL_RESERVATION_SQL);\r\n\t\titineraries = new ArrayList<ArrayList<Integer>>();\r\n }", "public void beforeExecution(PreparedStatement stmt, StatementContext ctx) throws SQLException\n {\n }", "public abstract ResultList executeSQL(RawQuery rawQuery);", "void runQueries();", "default void execute(@Language(\"MySQL\") @Nonnull String statement) {\n this.execute(statement, stmt -> {});\n }", "protected PreparedStatement prepareStmt() throws SQLException {\n if (stmt == null) {\n buildSQL();\n }\n\n return stmt;\n }", "public void execute() {\n /*\n r6 = this;\n java.lang.String r0 = \"Failed to close connection after DBUnit operation: \"\n java.util.logging.Logger r1 = log\n java.lang.StringBuilder r2 = new java.lang.StringBuilder\n r2.<init>()\n java.lang.String r3 = \"Executing DBUnit operations: \"\n r2.append(r3)\n int r3 = r6.size()\n r2.append(r3)\n java.lang.String r2 = r2.toString()\n r1.info(r2)\n org.dbunit.database.IDatabaseConnection r1 = r6.getConnection() // Catch:{ all -> 0x005a }\n r6.disableReferentialIntegrity(r1) // Catch:{ all -> 0x0058 }\n java.util.Iterator r2 = r6.iterator() // Catch:{ all -> 0x0058 }\n L_0x0027:\n boolean r3 = r2.hasNext() // Catch:{ all -> 0x0058 }\n if (r3 == 0) goto L_0x0037\n java.lang.Object r3 = r2.next() // Catch:{ all -> 0x0058 }\n org.seamless.util.dbunit.DBUnitOperations$Op r3 = (org.seamless.util.dbunit.DBUnitOperations.Op) r3 // Catch:{ all -> 0x0058 }\n r3.execute(r1) // Catch:{ all -> 0x0058 }\n goto L_0x0027\n L_0x0037:\n r6.enableReferentialIntegrity(r1) // Catch:{ all -> 0x0058 }\n if (r1 == 0) goto L_0x0057\n r1.close() // Catch:{ Exception -> 0x0040 }\n goto L_0x0057\n L_0x0040:\n r1 = move-exception\n java.util.logging.Logger r2 = log\n java.util.logging.Level r3 = java.util.logging.Level.WARNING\n java.lang.StringBuilder r4 = new java.lang.StringBuilder\n r4.<init>()\n r4.append(r0)\n r4.append(r1)\n java.lang.String r0 = r4.toString()\n r2.log(r3, r0, r1)\n L_0x0057:\n return\n L_0x0058:\n r2 = move-exception\n goto L_0x005c\n L_0x005a:\n r2 = move-exception\n r1 = 0\n L_0x005c:\n if (r1 == 0) goto L_0x0079\n r1.close() // Catch:{ Exception -> 0x0062 }\n goto L_0x0079\n L_0x0062:\n r1 = move-exception\n java.util.logging.Logger r3 = log\n java.util.logging.Level r4 = java.util.logging.Level.WARNING\n java.lang.StringBuilder r5 = new java.lang.StringBuilder\n r5.<init>()\n r5.append(r0)\n r5.append(r1)\n java.lang.String r0 = r5.toString()\n r3.log(r4, r0, r1)\n L_0x0079:\n goto L_0x007b\n L_0x007a:\n throw r2\n L_0x007b:\n goto L_0x007a\n */\n throw new UnsupportedOperationException(\"Method not decompiled: org.seamless.util.dbunit.DBUnitOperations.execute():void\");\n }", "public final void execute() {\n\t\tLogUtils.i(TAG, \"execute\");\n\t\tpurelySetState(TaskState.Preparing);\n\t\tTaskQueue.addTask(this);\n\t}", "@Override\r\n public PreparedStatement prepareStatement(DatabaseQueryBuilder query) throws SQLException {\r\n final PreparedStatement ps = super.prepareStatement(query);\r\n ps.setQueryTimeout(OracleERPUtil.ORACLE_TIMEOUT);\r\n return ps;\r\n }", "private void executeSelect(String query){\n try {\n statement = connection.createStatement();\n rs = statement.executeQuery(query);\n } catch (SQLException e) {\n throw new RuntimeException(e);\n } \n }", "protected void execute() {\n \t\n }", "protected void execute() {\n \t\n }", "@SuppressWarnings(\"unchecked\")\n public void execute() {\n execute(null, null);\n }", "protected void execute() {}", "ResultSet runSQL(String query) {\n try {\n return connection.prepareStatement(query).executeQuery();\n }\n catch (SQLException e) {\n System.err.println(e.getMessage());\n return null;\n }\n }", "public void execute() {\n execute0();\n }", "public void execute() {\n // empty\n }", "public static void doDataProcess(String name, StatementProcessor pd)\n {\n executorService.execute(() -> PolledDb.doDataProcess(name, pd));\n }", "private void createDatabase(final String databaseName) {\n\n try {\n final Connection connection =\n DriverManager.getConnection(url + databaseName, databaseProperties);\n\n try {\n NaviLogger.info(\"[i] Generating database tables for %s.\", databaseName);\n connection.prepareStatement(AbstractSQLProvider.parseResourceAsSQLFile(\n this.getClass().getResourceAsStream(TEST_DATA_DIRECTORY + \"database_schema.sql\")))\n .execute();\n } catch (final IOException exception) {\n CUtilityFunctions.logException(exception);\n }\n\n final File testDataDir = new File(\n \"./third_party/zynamics/javatests/com/google/security/zynamics/binnavi/testdata/\"\n + databaseName + \"/\");\n\n final CopyManager manager = new CopyManager((BaseConnection) connection);\n\n for (final File currentFile : testDataDir.listFiles()) {\n try (FileReader reader = new FileReader(currentFile)) {\n final String tableName = currentFile.getName().split(\".sql\")[0];\n NaviLogger.info(\"[i] Importing: %s.%s from %s\", databaseName, tableName,\n currentFile.getAbsolutePath());\n manager.copyIn(\"COPY \" + tableName + \" FROM STDIN\", reader);\n } catch (final IOException exception) {\n CUtilityFunctions.logException(exception);\n }\n }\n\n try {\n NaviLogger.warning(\"[i] Generating constraints for %s.\", databaseName);\n connection.prepareStatement(AbstractSQLProvider.parseResourceAsSQLFile(\n this.getClass().getResourceAsStream(TEST_DATA_DIRECTORY + \"database_constraints.sql\")))\n .execute();\n } catch (final IOException exception) {\n CUtilityFunctions.logException(exception);\n }\n\n final String findSequencesQuery = \"SELECT 'SELECT SETVAL(' ||quote_literal(S.relname)|| \"\n + \"', MAX(' ||quote_ident(C.attname)|| ') ) FROM ' ||quote_ident(T.relname)|| ';' \"\n + \" FROM pg_class AS S, pg_depend AS D, pg_class AS T, pg_attribute AS C \"\n + \" WHERE S.relkind = 'S' AND S.oid = D.objid AND D.refobjid = T.oid \"\n + \" AND D.refobjid = C.attrelid AND D.refobjsubid = C.attnum ORDER BY S.relname; \";\n\n try (PreparedStatement statement = connection.prepareStatement(findSequencesQuery);\n ResultSet resultSet = statement.executeQuery()) {\n while (resultSet.next()) {\n final PreparedStatement fixSequence = connection.prepareStatement(resultSet.getString(1));\n fixSequence.execute();\n }\n } catch (final SQLException exception) {\n CUtilityFunctions.logException(exception);\n }\n\n } catch (final SQLException exception) {\n CUtilityFunctions.logException(exception);\n }\n }", "private void setupDBs()\n {\n\t mSetupDBTask = new SetupDBTask(this);\n\t\tmSetupDBTask.execute((Void[])null);\n }", "abstract void prepare();", "boolean execute() throws SQLException;", "@Override\n public void execute() {}", "public void prepareStatements() throws SQLException {\n\t\tpstmt_updateTicket = connection.prepareStatement(\r\n\t\t \"UPDATE ticket \" +\r\n \"SET kunde = ? \" +\r\n \"WHERE tid IN (\" +\r\n \"SELECT tid FROM ticket WHERE kunde IS NULL AND auffuehrung = ? LIMIT ?)\" +\r\n \"RETURNING preis\");\r\n\t}", "public boolean execute() throws SQLException {\n return currentPreparedStatement.execute();\n }", "public long prepareSQL(SQLiteDatabase db, String statement, JSArray values) {\n boolean success = true;\n String stmtType = \"\";\n long lastId = Long.valueOf(-1);\n stmtType = statement.substring(0, 6).toUpperCase();\n SQLiteStatement stmt = db.compileStatement(statement);\n if (values != null && values.length() > 0) {\n // bind the values if any\n stmt.clearBindings();\n try {\n binding.bindValues(stmt, values);\n } catch (JSONException e) {\n Log.d(TAG, \"Error: prepareSQL failed: \" + e.getMessage());\n success = false;\n }\n }\n if (success) {\n if (stmtType.equals(\"INSERT\")) {\n lastId = stmt.executeInsert();\n } else {\n lastId = Long.valueOf(stmt.executeUpdateDelete());\n }\n }\n stmt.close();\n return lastId;\n }", "public void pass(String order) throws SQLException\n\t{\n\t\tStatement stmt = con.createStatement();\n\t\ttry\n\t\t{\n\t\t\tstmt.executeUpdate(order);\n\t\t} finally\n\t\t{\n\t\t\tif (stmt != null)\n\t\t\t{\n\t\t\t\tstmt.close(); // aint giving the solution but good practice\n\t\t\t}\n\t\t}\n\t}", "public ResultSet executeSQL() {\t\t\n\t\tif (rs != null) {\n\t\t\ttry {\n\t\t\t\trs.close();\n\t\t\t} catch(SQLException se) {\n\t\t\t} finally {\n\t\t\t\trs = null;\n\t\t\t}\n\t\t}\n\t\ttry {\n\t\t\trs = pstmt.executeQuery();\n\t\t} catch (SQLException se) {\n\t\t\tse.printStackTrace();\n\t\t}\n\t\treturn rs;\n\t}", "protected void executeThread() {\n if (thread == null || !thread.isAlive()) {\n thread = new Thread(() -> {\n while (!queries.isEmpty() && !disconnect) {\n queries.remove().execute(queryRunner, connection);\n }\n if (disconnect) {\n disconnect();\n }\n });\n thread.start();\n }\n }", "public abstract ExecuteResult<T> execute() throws SQLException;", "public void createDB(){\r\n\t\t\r\n\t\t Connection connection = null;\r\n\t try\r\n\t {\r\n\t // create a database connection\r\n\t connection = DriverManager.getConnection(\"jdbc:sqlite:project.sqlite\");\r\n\t Statement statement = connection.createStatement();\r\n\t statement.setQueryTimeout(30); // set timeout to 30 sec.\r\n\r\n\t statement.executeUpdate(\"drop table if exists task\");\r\n\t statement.executeUpdate(\"create table task (taskId integer primary key asc, description string, status string, createDate datetime default current_timestamp)\");\r\n\t statement.executeUpdate(\"insert into task values(1, 'leo', 'Active', null)\");\r\n\t statement.executeUpdate(\"insert into task values(2, 'yui', 'Complete', null)\");\r\n\t }\r\n\t catch(SQLException ex){\r\n\t \tthrow new RuntimeException(ex);\r\n\t }\r\n\t\t\r\n\t}", "public String prepareStatementString() throws SQLException {\n\t\tList<Object> argList = new ArrayList<Object>();\n\t\treturn buildStatementString(argList);\n\t}", "public void prepare(AnalyzerOptions options) {\n Preconditions.checkState(!prepared);\n Preconditions.checkState(!closed);\n this.options = options;\n PrepareRequest.Builder request = PrepareRequest.newBuilder();\n request.setSql(sql);\n fileDescriptorSetsBuilder = new FileDescriptorSetsBuilder();\n request.setOptions(options.serialize(fileDescriptorSetsBuilder));\n for (FileDescriptorSet fileDescriptorSet : fileDescriptorSetsBuilder.build()) {\n request.addFileDescriptorSet(fileDescriptorSet);\n }\n\n PrepareResponse resp;\n try {\n resp = Client.getStub().prepare(request.build());\n } catch (StatusRuntimeException e) {\n throw new SqlException(e);\n }\n\n // TODO: Remove this backwards compatibility code\n final PreparedState prepared;\n if (resp.hasPrepared()) {\n prepared = resp.getPrepared();\n } else {\n prepared = PreparedState.newBuilder()\n .setOutputType(resp.getOutputType())\n .setPreparedExpressionId(resp.getPreparedExpressionId())\n .build();\n }\n setPrepared(prepared);\n }", "protected abstract Object execute(JdbcChannel con,\n PreparedStatement stmt,\n String flags)\n throws ProcedureException;", "public boolean Execute(String statement) throws SQLException{\r\n\t\treturn _dbStatement.execute(statement);\r\n\t}", "@Override\r\n\tpublic void execute() {\n }", "protected static PreparedStatement prepareStatement(ReviewDb db, String sql)\n throws SQLException {\n return ((JdbcSchema) db).getConnection().prepareStatement(sql);\n }", "public static void prepDb(Configuration conf) throws Exception {\n\n Connection conn = null;\n Statement stmt = null;\n try {\n conn = getConnection(conf);\n stmt = conn.createStatement();\n stmt.execute(\"CREATE TABLE TXNS (\" +\n \" TXN_ID bigint PRIMARY KEY,\" +\n \" TXN_STATE char(1) NOT NULL,\" +\n \" TXN_STARTED bigint NOT NULL,\" +\n \" TXN_LAST_HEARTBEAT bigint NOT NULL,\" +\n \" TXN_USER varchar(128) NOT NULL,\" +\n \" TXN_HOST varchar(128) NOT NULL,\" +\n \" TXN_TYPE integer)\");\n\n stmt.execute(\"CREATE TABLE TXN_COMPONENTS (\" +\n \" TC_TXNID bigint NOT NULL REFERENCES TXNS (TXN_ID),\" +\n \" TC_DATABASE varchar(128) NOT NULL,\" +\n \" TC_TABLE varchar(128),\" +\n \" TC_PARTITION varchar(767),\" +\n \" TC_OPERATION_TYPE char(1) NOT NULL,\" +\n \" TC_WRITEID bigint)\");\n stmt.execute(\"CREATE TABLE COMPLETED_TXN_COMPONENTS (\" +\n \" CTC_TXNID bigint NOT NULL,\" +\n \" CTC_DATABASE varchar(128) NOT NULL,\" +\n \" CTC_TABLE varchar(128),\" +\n \" CTC_PARTITION varchar(767),\" +\n \" CTC_TIMESTAMP timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL,\" +\n \" CTC_WRITEID bigint,\" +\n \" CTC_UPDATE_DELETE char(1) NOT NULL)\");\n stmt.execute(\"CREATE TABLE NEXT_TXN_ID (\" + \" NTXN_NEXT bigint NOT NULL)\");\n stmt.execute(\"INSERT INTO NEXT_TXN_ID VALUES(1)\");\n\n stmt.execute(\"CREATE TABLE TXN_TO_WRITE_ID (\" +\n \" T2W_TXNID bigint NOT NULL,\" +\n \" T2W_DATABASE varchar(128) NOT NULL,\" +\n \" T2W_TABLE varchar(256) NOT NULL,\" +\n \" T2W_WRITEID bigint NOT NULL)\");\n stmt.execute(\"CREATE TABLE NEXT_WRITE_ID (\" +\n \" NWI_DATABASE varchar(128) NOT NULL,\" +\n \" NWI_TABLE varchar(256) NOT NULL,\" +\n \" NWI_NEXT bigint NOT NULL)\");\n\n stmt.execute(\"CREATE TABLE MIN_HISTORY_LEVEL (\" +\n \" MHL_TXNID bigint NOT NULL,\" +\n \" MHL_MIN_OPEN_TXNID bigint NOT NULL,\" +\n \" PRIMARY KEY(MHL_TXNID))\");\n\n stmt.execute(\"CREATE TABLE HIVE_LOCKS (\" +\n \" HL_LOCK_EXT_ID bigint NOT NULL,\" +\n \" HL_LOCK_INT_ID bigint NOT NULL,\" +\n \" HL_TXNID bigint NOT NULL,\" +\n \" HL_DB varchar(128) NOT NULL,\" +\n \" HL_TABLE varchar(128),\" +\n \" HL_PARTITION varchar(767),\" +\n \" HL_LOCK_STATE char(1) NOT NULL,\" +\n \" HL_LOCK_TYPE char(1) NOT NULL,\" +\n \" HL_LAST_HEARTBEAT bigint NOT NULL,\" +\n \" HL_ACQUIRED_AT bigint,\" +\n \" HL_USER varchar(128) NOT NULL,\" +\n \" HL_HOST varchar(128) NOT NULL,\" +\n \" HL_HEARTBEAT_COUNT integer,\" +\n \" HL_AGENT_INFO varchar(128),\" +\n \" HL_BLOCKEDBY_EXT_ID bigint,\" +\n \" HL_BLOCKEDBY_INT_ID bigint,\" +\n \" PRIMARY KEY(HL_LOCK_EXT_ID, HL_LOCK_INT_ID))\");\n stmt.execute(\"CREATE INDEX HL_TXNID_INDEX ON HIVE_LOCKS (HL_TXNID)\");\n\n stmt.execute(\"CREATE TABLE NEXT_LOCK_ID (\" + \" NL_NEXT bigint NOT NULL)\");\n stmt.execute(\"INSERT INTO NEXT_LOCK_ID VALUES(1)\");\n\n stmt.execute(\"CREATE TABLE COMPACTION_QUEUE (\" +\n \" CQ_ID bigint PRIMARY KEY,\" +\n \" CQ_DATABASE varchar(128) NOT NULL,\" +\n \" CQ_TABLE varchar(128) NOT NULL,\" +\n \" CQ_PARTITION varchar(767),\" +\n \" CQ_STATE char(1) NOT NULL,\" +\n \" CQ_TYPE char(1) NOT NULL,\" +\n \" CQ_TBLPROPERTIES varchar(2048),\" +\n \" CQ_WORKER_ID varchar(128),\" +\n \" CQ_START bigint,\" +\n \" CQ_RUN_AS varchar(128),\" +\n \" CQ_HIGHEST_WRITE_ID bigint,\" +\n \" CQ_META_INFO varchar(2048) for bit data,\" +\n \" CQ_HADOOP_JOB_ID varchar(32))\");\n\n stmt.execute(\"CREATE TABLE NEXT_COMPACTION_QUEUE_ID (NCQ_NEXT bigint NOT NULL)\");\n stmt.execute(\"INSERT INTO NEXT_COMPACTION_QUEUE_ID VALUES(1)\");\n\n stmt.execute(\"CREATE TABLE COMPLETED_COMPACTIONS (\" +\n \" CC_ID bigint PRIMARY KEY,\" +\n \" CC_DATABASE varchar(128) NOT NULL,\" +\n \" CC_TABLE varchar(128) NOT NULL,\" +\n \" CC_PARTITION varchar(767),\" +\n \" CC_STATE char(1) NOT NULL,\" +\n \" CC_TYPE char(1) NOT NULL,\" +\n \" CC_TBLPROPERTIES varchar(2048),\" +\n \" CC_WORKER_ID varchar(128),\" +\n \" CC_START bigint,\" +\n \" CC_END bigint,\" +\n \" CC_RUN_AS varchar(128),\" +\n \" CC_HIGHEST_WRITE_ID bigint,\" +\n \" CC_META_INFO varchar(2048) for bit data,\" +\n \" CC_HADOOP_JOB_ID varchar(32))\");\n\n stmt.execute(\"CREATE TABLE AUX_TABLE (\" +\n \" MT_KEY1 varchar(128) NOT NULL,\" +\n \" MT_KEY2 bigint NOT NULL,\" +\n \" MT_COMMENT varchar(255),\" +\n \" PRIMARY KEY(MT_KEY1, MT_KEY2))\");\n\n stmt.execute(\"CREATE TABLE WRITE_SET (\" +\n \" WS_DATABASE varchar(128) NOT NULL,\" +\n \" WS_TABLE varchar(128) NOT NULL,\" +\n \" WS_PARTITION varchar(767),\" +\n \" WS_TXNID bigint NOT NULL,\" +\n \" WS_COMMIT_ID bigint NOT NULL,\" +\n \" WS_OPERATION_TYPE char(1) NOT NULL)\"\n );\n\n stmt.execute(\"CREATE TABLE REPL_TXN_MAP (\" +\n \" RTM_REPL_POLICY varchar(256) NOT NULL, \" +\n \" RTM_SRC_TXN_ID bigint NOT NULL, \" +\n \" RTM_TARGET_TXN_ID bigint NOT NULL, \" +\n \" PRIMARY KEY (RTM_REPL_POLICY, RTM_SRC_TXN_ID))\"\n );\n\n stmt.execute(\"CREATE TABLE MATERIALIZATION_REBUILD_LOCKS (\" +\n \" MRL_TXN_ID BIGINT NOT NULL, \" +\n \" MRL_DB_NAME VARCHAR(128) NOT NULL, \" +\n \" MRL_TBL_NAME VARCHAR(256) NOT NULL, \" +\n \" MRL_LAST_HEARTBEAT BIGINT NOT NULL, \" +\n \" PRIMARY KEY(MRL_TXN_ID))\"\n );\n\n try {\n stmt.execute(\"CREATE TABLE \\\"APP\\\".\\\"SEQUENCE_TABLE\\\" (\\\"SEQUENCE_NAME\\\" VARCHAR(256) NOT \" +\n\n \"NULL, \\\"NEXT_VAL\\\" BIGINT NOT NULL)\"\n );\n } catch (SQLException e) {\n if (e.getMessage() != null && e.getMessage().contains(\"already exists\")) {\n LOG.info(\"SEQUENCE_TABLE table already exist, ignoring\");\n } else {\n throw e;\n }\n }\n\n try {\n stmt.execute(\"CREATE TABLE \\\"APP\\\".\\\"NOTIFICATION_SEQUENCE\\\" (\\\"NNI_ID\\\" BIGINT NOT NULL, \" +\n\n \"\\\"NEXT_EVENT_ID\\\" BIGINT NOT NULL)\"\n );\n } catch (SQLException e) {\n if (e.getMessage() != null && e.getMessage().contains(\"already exists\")) {\n LOG.info(\"NOTIFICATION_SEQUENCE table already exist, ignoring\");\n } else {\n throw e;\n }\n }\n\n try {\n stmt.execute(\"CREATE TABLE \\\"APP\\\".\\\"NOTIFICATION_LOG\\\" (\\\"NL_ID\\\" BIGINT NOT NULL, \" +\n \"\\\"DB_NAME\\\" VARCHAR(128), \\\"EVENT_ID\\\" BIGINT NOT NULL, \\\"EVENT_TIME\\\" INTEGER NOT\" +\n\n \" NULL, \\\"EVENT_TYPE\\\" VARCHAR(32) NOT NULL, \\\"MESSAGE\\\" CLOB, \\\"TBL_NAME\\\" \" +\n \"VARCHAR\" +\n \"(256), \\\"MESSAGE_FORMAT\\\" VARCHAR(16))\"\n );\n } catch (SQLException e) {\n if (e.getMessage() != null && e.getMessage().contains(\"already exists\")) {\n LOG.info(\"NOTIFICATION_LOG table already exist, ignoring\");\n } else {\n throw e;\n }\n }\n\n stmt.execute(\"INSERT INTO \\\"APP\\\".\\\"SEQUENCE_TABLE\\\" (\\\"SEQUENCE_NAME\\\", \\\"NEXT_VAL\\\") \" +\n \"SELECT * FROM (VALUES ('org.apache.hadoop.hive.metastore.model.MNotificationLog', \" +\n \"1)) tmp_table WHERE NOT EXISTS ( SELECT \\\"NEXT_VAL\\\" FROM \\\"APP\\\"\" +\n \".\\\"SEQUENCE_TABLE\\\" WHERE \\\"SEQUENCE_NAME\\\" = 'org.apache.hadoop.hive.metastore\" +\n \".model.MNotificationLog')\");\n\n stmt.execute(\"INSERT INTO \\\"APP\\\".\\\"NOTIFICATION_SEQUENCE\\\" (\\\"NNI_ID\\\", \\\"NEXT_EVENT_ID\\\")\" +\n \" SELECT * FROM (VALUES (1,1)) tmp_table WHERE NOT EXISTS ( SELECT \" +\n \"\\\"NEXT_EVENT_ID\\\" FROM \\\"APP\\\".\\\"NOTIFICATION_SEQUENCE\\\")\");\n } catch (SQLException e) {\n try {\n conn.rollback();\n } catch (SQLException re) {\n LOG.error(\"Error rolling back: \" + re.getMessage());\n }\n\n // Another thread might have already created these tables.\n if (e.getMessage() != null && e.getMessage().contains(\"already exists\")) {\n LOG.info(\"Txn tables already exist, returning\");\n return;\n }\n\n // This might be a deadlock, if so, let's retry\n if (e instanceof SQLTransactionRollbackException && deadlockCnt++ < 5) {\n LOG.warn(\"Caught deadlock, retrying db creation\");\n prepDb(conf);\n } else {\n throw e;\n }\n } finally {\n deadlockCnt = 0;\n closeResources(conn, stmt, null);\n }\n }", "private void constructExecuteSql() {\n getMetaData();\n // Validate that the primary keys are present in the underlying SQL\n StringBuilder orderBySql = new StringBuilder(super.getExecuteSql()).append(\"\\n order by \");\n switch (metaData.getDbType()) {\n case ORACLE:\n orderBySql.append(createOracleOrderedByClause ());\n break;\n case SQL_SERVER:\n orderBySql.append(createSqlServerOrderedByClause());\n break;\n case UNKNOWN:\n default:\n orderBySql.append(createUnknownDBOrderedByClause());\n }\n this.executeSql = orderBySql.toString();\n }", "public void execute() { // FIXME extract to utility class\n\t\ttry {\n\t\t\tif (errorMsg != null && errorMsg.trim().length() > 0) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif (connection == null || connection.isClosed()) {\n\t\t\t\terrorMsg = Messages.error_getConnection;\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t//databaseInfo.getServerInfo().compareVersionKey(\"8.2.2\") >= 0;\n\t\t\tboolean isSupportCache = CompatibleUtil.isSupportCache(databaseInfo);\n\t\t\tString sql = \"SELECT owner.name, db_serial.* FROM db_serial WHERE class_name IS NULL\";\n\n\t\t\t// [TOOLS-2425]Support shard broker\n\t\t\tif (databaseInfo.isShard()) {\n\t\t\t\tsql = databaseInfo.wrapShardQuery(sql);\n\t\t\t}\n\n\t\t\tstmt = connection.createStatement();\n\t\t\trs = stmt.executeQuery(sql);\n\t\t\twhile (rs.next()) {\n\t\t\t\tString name = rs.getString(\"name\");\n\t\t\t\tString owner = rs.getString(\"owner.name\");\n\t\t\t\tString currentVal = rs.getString(\"current_val\");\n\t\t\t\tString incrementVal = rs.getString(\"increment_val\");\n\t\t\t\tString maxVal = rs.getString(\"max_val\");\n\t\t\t\tString minVal = rs.getString(\"min_val\");\n\t\t\t\tString cyclic = rs.getString(\"cyclic\");\n\t\t\t\tString startVal = rs.getString(\"started\");\n\t\t\t\tString className = rs.getString(\"class_name\");\n\t\t\t\tString attName = rs.getString(\"att_name\");\n\t\t\t\tboolean isCycle = false;\n\t\t\t\tif (cyclic != null && cyclic.equals(\"1\")) {\n\t\t\t\t\tisCycle = true;\n\t\t\t\t}\n\t\t\t\tString cacheCount = null;\n\t\t\t\tif (isSupportCache) {\n\t\t\t\t\tcacheCount = rs.getString(\"cached_num\");\n\t\t\t\t}\n\t\t\t\tSerialInfo serialInfo = new SerialInfo(name, owner, currentVal,\n\t\t\t\t\t\tincrementVal, maxVal, minVal, isCycle, startVal,\n\t\t\t\t\t\tcacheCount, className, attName);\n\t\t\t\tserialInfoList.add(serialInfo);\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\terrorMsg = e.getMessage();\n\t\t\tLOGGER.error(e.getMessage(), e);\n\t\t} finally {\n\t\t\tfinish();\n\t\t}\n\t}", "@Override\r\n\tpublic void execute() {\n\t}", "@Override\r\n\tpublic void execute() {\n\t}", "public void connect() throws NamingException, SQLException {\n if (con != null) disconnect();\n try {\n \tString url = \"jdbc:postgresql://localhost/stocksim\";\n \tProperties props = new Properties();\n props.setProperty(\"user\", \"ubuntu\");\n props.setProperty(\"password\", \"reverse\");\n con = DriverManager.getConnection(url, props);\n \n // Prepare statements:\n for (PreparedStatementID i: PreparedStatementID.values()) {\n PreparedStatement preparedStatement = con.prepareStatement(i.sql);\n _preparedStatements.put(i, preparedStatement);\n }\n } catch (SQLException e) {\n if (con != null) disconnect();\n throw e;\n }\n }", "private PipelineResult runWrite() {\n pipelineWrite\n .apply(GenerateSequence.from(0).to(numberOfRows))\n .apply(ParDo.of(new TestRow.DeterministicallyConstructTestRowFn()))\n .apply(ParDo.of(new TimeMonitor<>(NAMESPACE, \"write_time\")))\n .apply(\n JdbcIO.<TestRow>write()\n .withDataSourceConfiguration(JdbcIO.DataSourceConfiguration.create(dataSource))\n .withStatement(String.format(\"insert into %s values(?, ?)\", tableName))\n .withPreparedStatementSetter(new JdbcTestHelper.PrepareStatementFromTestRow()));\n\n return pipelineWrite.run();\n }", "public abstract void prepare();", "public void ejecutarSql(String query) throws Exception {\n stmt.executeUpdate(query);\n }", "public abstract ResultList executeQuery(DatabaseQuery query);", "public void prepare(IDb db, List<? extends Relation> relations);", "public interface StatementHandler {\n void supplyToStatement(PreparedStatement statement);\n}", "public void executeCountSql() throws SQLException {\n\t\tPreparedStatement stmt = null;\n\t\tResultSet rs = null;\n\t\ttry {\t\t\t\n\t\t\tSqlStatement countSqlStatement = getCountSqlStatement();\n\t\t\t\n\t\t\tlog.debug(\"Counting database query: \" + countSqlStatement.getQuery());\n\t\t\tlog.debug(\"Counting statement parameters: \" + countSqlStatement.getParams());\n\t\t\t\n\t\t\tstmt = this.con.prepareStatement(countSqlStatement.getQuery());\n\t\t\tcountSqlStatement.propagateStatementWithParams(stmt);\n\t\t\t\n\t\t\trs = stmt.executeQuery();\n\t\t\tif (rs.next()) {\n\t\t\t\tthis.totalCount = new Long(rs.getLong(1));\n\t\t\t}\n\t\t} finally {\n\t\t\tDbHelper.closeDbObjects(null, stmt, rs);\n\t\t}\n\t}", "protected abstract void execute();", "public void execute() {\n\t\t\n\t}", "public void prepareSelectOneRow() {\n setCallFromStatement();\n // The statement is no longer require so can be released.\n clearStatement();\n\n super.prepareSelectOneRow();\n }", "public void prepare() {\n this.taskHandler.run(this::inlinePrepare);\n }", "public SimpleDatabase executeSqlFile(String name) {\n // possibly trim .sql extension\n if (name.toLowerCase().endsWith(\".sql\")) {\n name = name.substring(0, name.length() - 4);\n }\n SQLiteDatabase db = context.openOrCreateDatabase(name);\n int id = context.getResourceId(name, \"raw\");\n return executeSqlFile(db, id);\n }", "public void execute() {\n }", "@Override\n\tpublic void execute() {\n\t\t\n\t}" ]
[ "0.63772297", "0.6136827", "0.603592", "0.59520507", "0.59483355", "0.5905285", "0.5880579", "0.58676404", "0.58454466", "0.5818644", "0.5666565", "0.56395674", "0.5608095", "0.5568182", "0.5548164", "0.55312496", "0.5528476", "0.5522674", "0.55141383", "0.54966813", "0.5484468", "0.5473342", "0.54560095", "0.54494405", "0.5444042", "0.54257077", "0.5416254", "0.5410134", "0.5405336", "0.5370412", "0.5362839", "0.5356087", "0.53369594", "0.5336139", "0.5336139", "0.5336139", "0.53317297", "0.5300127", "0.5271792", "0.5267609", "0.5262522", "0.5258765", "0.52556926", "0.52444905", "0.52421916", "0.5240353", "0.52229315", "0.52212095", "0.52106714", "0.52076536", "0.5192842", "0.51905257", "0.5189263", "0.51769173", "0.51769173", "0.5176896", "0.5175032", "0.51618564", "0.51564854", "0.51261336", "0.51183856", "0.511157", "0.51112765", "0.51047075", "0.5104186", "0.510266", "0.5094362", "0.5093168", "0.50804496", "0.50771004", "0.5068627", "0.50648695", "0.5057915", "0.50559276", "0.50492436", "0.50439894", "0.504323", "0.5043034", "0.5039875", "0.5036448", "0.50284123", "0.5022922", "0.50195765", "0.50065416", "0.50065416", "0.5002547", "0.5000433", "0.49990904", "0.49959266", "0.49940637", "0.49922708", "0.49862197", "0.49756512", "0.4973082", "0.49722895", "0.49722272", "0.49590865", "0.49565595", "0.49544522", "0.49537113" ]
0.64991415
0
Executes a database statement with preparation. This will be executed on whichever thread it's called from.
void execute(@Language("MySQL") @Nonnull String statement, @Nonnull SqlConsumer<PreparedStatement> preparer);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final void execute() {\n try {\n\n StringBuffer preparedTableBuf = new StringBuffer();\n preparedTableBuf.append(\"create table if not exists \");\n preparedTableBuf.append(tableName + \" (\");\n\n boolean isCompoundKey = false;\n boolean isAutoKey = \"generated\".equals(pkey);\n\n String[] pkeys = pkey.split(\",\");\n StringBuffer compoundKey = new StringBuffer();\n if (pkeys.length > 1) {\n isCompoundKey = true;\n compoundKey.append(\", PRIMARY KEY (\");\n for (int i = 0; i < pkeys.length; i++) {\n compoundKey.append(pkeys[i] + (i == pkeys.length - 1 ? \")\" : \", \"));\n }\n }\n\n if (isAutoKey) {\n preparedTableBuf\n .append(\"id integer NOT NULL PRIMARY KEY AUTO_INCREMENT, \");\n }\n for (int i = 0; i < fields.length; i++) {\n preparedTableBuf.append(fields[i]\n + \" \"\n + columnTypes[i]\n + (pkey.equals(fields[i]) ? \" NOT NULL UNIQUE PRIMARY KEY\" : \"\")\n + (i == fields.length - 1 ? (isCompoundKey ? compoundKey.toString()\n : \"\") + \")\" : \", \"));\n }\n\n PreparedStatement preparedTableCreate = conn\n .prepareStatement(preparedTableBuf.toString());\n\n log.info(\"Prepared Table Statement : \" + preparedTableBuf.toString());\n preparedTableCreate.executeUpdate();\n conn.commit();\n\n } catch (Exception e) {\n log.error(e);\n }\n\n try {\n\n StringBuffer preparedInsertBuf = new StringBuffer();\n preparedInsertBuf.append(\"insert into \");\n preparedInsertBuf.append(tableName + \" (\");\n\n for (int i = 0; i < fields.length; i++) {\n preparedInsertBuf.append(fields[i]\n + (i == fields.length - 1 ? \")\" : \", \"));\n }\n\n preparedInsertBuf.append(\" values(\");\n\n for (int i = 0; i < fields.length; i++) {\n preparedInsertBuf.append(\"?\" + (i == fields.length - 1 ? \")\" : \", \"));\n }\n\n PreparedStatement insertItemRecord = conn\n .prepareStatement(preparedInsertBuf.toString());\n\n log.info(\"Rows : \" + fileImporter.getRowCount());\n log.info(\"Prepared Insert Statement : \" + preparedInsertBuf.toString());\n\n Iterator<Row> riter = fileImporter.getRowIterator();\n\n int rows = 0;\n\n int[] result = null;\n\n while (riter.hasNext()) {\n Row row = riter.next();\n\n if (!row.isValid()) {\n continue;\n } else {\n rows++;\n }\n\n try {\n for (int i = 0; i < fields.length; i++) {\n if (columnTypes[i].contains(\"char\")) {\n insertItemRecord.setString(i + 1, row.getValue(fields[i]));\n } else if (\"integer\".equals(columnTypes[i])) {\n try {\n Integer value = Integer.parseInt(row.getValue(fields[i]));\n insertItemRecord.setInt(i + 1, value);\n } catch (Exception e) {\n insertItemRecord.setInt(i + 1, 0);\n }\n } else {\n log.error(\"unsupported column type\");\n }\n }\n\n insertItemRecord.addBatch();\n\n if (rows % batchSize == 0) {\n\n try {\n result = insertItemRecord.executeBatch();\n\n conn.commit();\n log.info(\"batch update : \" + result.length);\n } catch (BatchUpdateException e) {\n log.error(\"Batch Update failed\", e);\n log.error(\"result size: \"\n + (result == null ? \"null\" : result.length));\n\n }\n\n }\n } catch (Exception e) {\n log.error(\"couldn't process row properly\", e);\n }\n }\n // the last set of updates will probably not mod to 0\n\n try {\n result = insertItemRecord.executeBatch();\n conn.commit();\n log.info(\"batch update : \" + result.length);\n } catch (BatchUpdateException e) {\n log.error(\"Batch Update failed\", e);\n log.error(\"\");\n }\n\n } catch (Exception e) {\n log.error(e);\n e.printStackTrace();\n }\n }", "public void run(Statement state) throws SQLException {\n\n System.out.println(\"INFO: -= Inserting data via dummy table ...\");\n state.execute(multipleRowInsertDummySQL);\n System.out.println(\"INFO: -= The data are inserted via dummy table:\");\n selectAllFromTable(state, tableName, 10);\n\n System.out.println(\"INFO: -= Inserting data using INSERT INTO statement ...\");\n state.execute(multipleRowInsertIntoSQL);\n System.out.println(\"INFO: -= The data are inserted via INSERT INTO statement:\");\n selectAllFromTable(state, tableName, 20);\n }", "DBCursor execute();", "public void execute() throws SQLException {\n\t\tif (this.ds == null) {\n\t\t\tthrow new RuntimeException(\n\t\t\t\"Please pass a DataSource to the ListSqlHelper!\");\n\t\t}\n\t\t\n\t\texecuteCountSql();\n\t\texecuteItemRangeSql();\n\t}", "public void execute() throws SQLException {\n\t\ttry {\n\t\t\tselect.setUsername(\"INTRANET\");\n\t\t\tselect.setPassword(\"INTRANET\");\n\t\t\tselect.execute();\n\t\t}\n\n\t\t// Liberar recursos del objeto select.\n\t\tfinally {\n\t\t\tselect.close();\n\t\t}\n\t}", "void execute(Context context) throws SQLException;", "protected static void execute(ReviewDb db, String sql) throws SQLException {\n try (Statement s = newStatement(db)) {\n s.execute(sql);\n }\n }", "private void executeQuery() {\n }", "public void prepareExecuteSelect() {\n setCallFromStatement();\n // The statement is no longer require so can be released.\n clearStatement();\n\n super.prepareExecuteSelect();\n }", "public void prepare() {\n if ((!hasMultipleStatements()) && (getSQLStatement() == null)) {\n throw QueryException.sqlStatementNotSetProperly(getQuery());\n }\n\n // Cannot call super yet as the call is not built.\n }", "protected void execSQL(String sql) throws Exception {\n\t\tPreparedStatement statement = null;\n\t\ttry {\n\t\t\tstatement = connection.prepareStatement(sql);\n\t\t\tstatement.execute();\n\t\t} catch (Exception e) {\n\t\t\tthrow e;\n\t\t} finally {\n\t\t\tPersistenceUtils.closeStatement(statement);\n\t\t}\n\n\t}", "public static void doDataProcessPrepareSt(String name, String sql, PreparedStatementProcessor pd)\n {\n executorService.execute(() -> PolledDb.doDataProcessPrepareSt(name, sql, pd));\n }", "public void prepareInsertObject() {\n // Require modify row to prepare.\n if (getModifyRow() == null) {\n return;\n }\n\n if (hasMultipleStatements()) {\n for (Enumeration statementEnum = getSQLStatements().elements();\n statementEnum.hasMoreElements();) {\n ((SQLModifyStatement)statementEnum.nextElement()).setModifyRow(getModifyRow());\n }\n } else if (getSQLStatement() != null) {\n ((SQLModifyStatement)getSQLStatement()).setModifyRow(getModifyRow());\n }\n setCallFromStatement();\n // The statement is no longer require so can be released.\n clearStatement();\n\n super.prepareInsertObject();\n }", "@Override\n public void prepare(PreparedStatement statement) {\n }", "public void beforeExecution(PreparedStatement stmt, StatementContext ctx) throws SQLException\n {\n }", "@Nonnull\n default Promise<Void> executeAsync(@Language(\"MySQL\") @Nonnull String statement, @Nonnull SqlConsumer<PreparedStatement> preparer) {\n return Schedulers.async().run(() -> this.execute(statement, preparer));\n }", "@Override\n\tpublic void prepareStatements() throws Exception\n\t{\n\t\tsuper.prepareStatements();\n\t\t//transaction statements\n\t\tbeginTransactionStatement = conn.prepareStatement(BEGIN_TRANSACTION_SQL);\n\t\tcommitTransactionStatement = conn.prepareStatement(COMMIT_SQL);\n\t\trollbackTransactionStatement = conn.prepareStatement(ROLLBACK_SQL);\n\t\t//check statements \n\t\tcheckUserameStatement = conn.prepareStatement(CHECK_USERNAME_SQL);\n\t\tcheckLoginStatement = conn.prepareStatement(CHECK_LOGIN_SQL);\n\t\tcheckUnpaidReservationStatement = conn.prepareStatement(CHECK_UNPAID_RESERVATION_SQL);\n\t\tcheckTravelStatement = conn.prepareStatement(CHECK_TRAVEL_SQL);\n\t\tcheckNotCanceledReservationStatement = conn.prepareStatement(CHECK_NOT_CANCELED_SQL);\n\t\t//insert statements\n\t\tinsertUserStatement = conn.prepareStatement(INSERT_USER_SQL);\n\t\tinsertTravelStatement = conn.prepareStatement(INSERT_TRAVEL_SQL);\n\t\tinsertReservationStatement = conn.prepareStatement(INSERT_RESERVATION_SQL);\n\t\tinsertRidStatement = conn.prepareStatement(INSERT_RID_SQL);\n\t\t//update statements\n\t\tupdateBalanceStatement = conn.prepareStatement(UPDATE_BALANCE_SQL);\n\t\tupdateRidStatement = conn.prepareStatement(UPDATE_RID_SQL);\n\t\tupdateReservationCancelStatement = conn.prepareStatement(UPDATE_RESERVATION_CANCEL_SQL);\n\t\tupdateReservationPaidStatement = conn.prepareStatement(UPDATE_RESERVATION_PAID_SQL);\n\t\t//get statements\n\t\tgetReservationsStatement = conn.prepareStatement(GET_RESERVATIONS_SQL);\n\t\tgetFlightStatement = conn.prepareStatement(GET_FLIGHT_SQL);\n\t\tgetBalanceStatement = conn.prepareStatement(GET_BALANCE_SQL);\n\t\tgetReservationStatement = conn.prepareStatement(GET_RESERVATION_SQL);\n\t\tgetNumReservationsStatement = conn.prepareStatement(GET_NUM_RESERVATION_SQL);\n\t\tgetRidStatement = conn.prepareStatement(GET_RID_SQL);\n\t\t//clear statements\n\t\tdeleteTravelStatement = conn.prepareStatement(DELETE_TRAVEL_SQL);\n\t\tclearStatement = conn.prepareStatement(CLEAR_SQL);\n\t}", "@Override\n\t@Nullable\n\tpublic <T> T execute(PreparedStatementCreator psc, PreparedStatementCallback<T> action) throws DataAccessException {\n\n\t\tAssert.notNull(psc, \"PreparedStatementCreator must not be null\");\n\t\tAssert.notNull(action, \"Callback object must not be null\");\n\t\tif (logger.isDebugEnabled()) {\n\t\t\tString sql = getSql(psc);\n\t\t\tlogger.debug(\"Executing prepared SQL statement\" + (sql != null ? \" [\" + sql + \"]\" : \"\"));\n\t\t}\n\n\t\tConnection con = getTracedConnection();\n\n\t\tSpan queryExecSpan = tracer.spanBuilder(\"execute statement\").setRecordEvents(true).setSampler(Samplers.alwaysSample()).startSpan();\n\n\t\tPreparedStatement ps = null;\n\t\ttry (Scope ws = tracer.withSpan(queryExecSpan)) {\n\t\t\tps = psc.createPreparedStatement(con);\n\t\t\tapplyStatementSettings(ps);\n\t\t\tqueryExecSpan.addAnnotation(\"Statement:\" + ps.toString());\n\t\t\tT result = action.doInPreparedStatement(ps);\n\t\t\thandleWarnings(ps);\n\t\t\treturn result;\n\t\t} catch (SQLException ex) {\n\t\t\t// Release Connection early, to avoid potential connection pool deadlock\n\t\t\t// in the case when the exception translator hasn't been initialized yet.\n\t\t\tif (psc instanceof ParameterDisposer) {\n\t\t\t\t((ParameterDisposer) psc).cleanupParameters();\n\t\t\t}\n\t\t\tString sql = getSql(psc);\n\t\t\tJdbcUtils.closeStatement(ps);\n\t\t\tps = null;\n\t\t\tDataSourceUtils.releaseConnection(con, getDataSource());\n\t\t\tcon = null;\n\t\t\tthrow translateException(\"PreparedStatementCallback\", sql, ex);\n\t\t} finally {\n\t\t\tif (psc instanceof ParameterDisposer) {\n\t\t\t\t((ParameterDisposer) psc).cleanupParameters();\n\t\t\t}\n\t\t\tJdbcUtils.closeStatement(ps);\n\t\t\tDataSourceUtils.releaseConnection(con, getDataSource());\n\t\t\tqueryExecSpan.end();\n\t\t}\n\t}", "public void prepareExecuteNoSelect() {\n setCallFromStatement();\n // The statement is no longer require so can be released.\n clearStatement();\n\n super.prepareExecuteNoSelect();\n }", "public abstract void run(Context context) throws SQLException;", "public void runStatement(String statement) throws SQLException{\n\t\tConnection conn = null;\n\t\tPreparedStatement stmt = null;\n\t\ttry\n\t\t{\n\t\t\tconn = setUpConnection();\t\t\n\t\t\tstmt = conn.prepareStatement(statement);\t\t\n\t\t\tstmt.executeUpdate();\n\t\t\tconn.commit();\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tcloseJDBCResources(conn, stmt);\n\t\t}\n\t}", "public void prepStmt(String sql) {\n\t\ttry {\n\t\t\tpstmt = conn.prepareStatement(sql);\n\t\t} catch(SQLException se) {\n\t\t\tse.printStackTrace();\n\t\t}\n\t}", "public void exec(String sql) {\r\n try (Statement stmt = connection.createStatement()) {\r\n stmt.execute(sql);\r\n } catch (SQLException e) {\r\n throw new DbException(connectionString + \"\\nError executing \" + sql, e);\r\n }\r\n }", "protected PreparedStatement prepareStmt() throws SQLException {\n if (stmt == null) {\n buildSQL();\n }\n\n return stmt;\n }", "public void afterExecution(PreparedStatement stmt, StatementContext ctx) throws SQLException\n {\n }", "public void prepareStatements() throws Exception {\r\n beginTransactionStatement = conn.prepareStatement(BEGIN_TRANSACTION_SQL);\r\n commitTransactionStatement = conn.prepareStatement(COMMIT_SQL);\r\n rollbackTransactionStatement = conn.prepareStatement(ROLLBACK_SQL);\r\n\r\n\t\tdeleteReservationStatement = conn.prepareStatement(DELETE_RESERVATION_SQL);\r\n\t\tdeleteBookingStatement = conn.prepareStatement(DELETE_BOOKING_SQL);\r\n\t\tdeleteUserStatement = conn.prepareStatement(DELETE_USER_SQL);\r\n\t\t\r\n checkFlightCapacityStatement = conn.prepareStatement(CHECK_FLIGHT_CAPACITY);\r\n\t\tcheckReservationRowStatement = conn.prepareStatement(CHECK_RESERVATION_ROW_NUMBER);\r\n\r\n /* add here more prepare statements for all the other queries you need */\r\n /* . . . . . . */\r\n\t\tuserLoginStatement = conn.prepareStatement(LOGIN_SQL);\r\n\t\t\r\n\t\tcreateUserStatement = conn.prepareStatement(CREATE_USER_SQL);\r\n\t\t\r\n\t\tsearchOneHopStatement = conn.prepareStatement(SEARCH_ONE_HOP_SQL);\r\n\t\tsearchTwoHopStatement = conn.prepareStatement(SEARCH_TWO_HOP_SQL);\r\n\t\t\r\n\t\tcheckBookingStatement = conn.prepareStatement(CHECK_BOOKING_SQL);\r\n\t\tnewBookingStatement = conn.prepareStatement(NEW_BOOKING_SQL);\r\n\t\tupdateBookingStatement = conn.prepareStatement(UPDATE_BOOKING_SQL);\r\n\t\t\r\n\t\toneReservationStatement = conn.prepareStatement(ONE_RESERVATION_SQL);\r\n\t\ttwoReservationStatement = conn.prepareStatement(TWO_RESERVATION_SQL);\r\n\t\t\r\n\t\tsearchReservationStatement = conn.prepareStatement(SEARCH_RESERVATION_SQL);\r\n\t\tunpaidReservationStatement = conn.prepareStatement(SEARCH_UNPAID_SQL);\r\n\t\t\r\n\t\tsearchFlightStatement = conn.prepareStatement(SEARCH_FLIGHT_SQL);\r\n\t\t\r\n\t\tupdatePaidStatement = conn.prepareStatement(UPDATE_UNPAID_SQL);\r\n\t\tcheckPriceStatement = conn.prepareStatement(FLIGHT_PRICE_SQL);\r\n\t\tupdateBalanceStatement = conn.prepareStatement(UPDATE_BALANCE_SQL);\r\n\t\tcheckBalanceStatement = conn.prepareStatement(SEARCH_BALANCE_SQL);\r\n\t\tunpaidReservationStatement2 = conn.prepareStatement(SEARCH_UNPAID_SQL_2);\r\n\t\t\r\n\t\tsearchFirstFidStatement = conn.prepareStatement(FIRST_FID_SQL);\r\n\t\tsearchSecondFidStatement = conn.prepareStatement(SECOND_FID_SQL);\r\n\t\tcancelReservationStatement = conn.prepareStatement(CANCEL_RESERVATION_SQL);\r\n\t\titineraries = new ArrayList<ArrayList<Integer>>();\r\n }", "public<T> T execute() throws DatabaseException;", "protected void createStmt(String sql, boolean returnGeneratedKeys) throws SQLException {\n if (stmt != null) {\n throw new IllegalStateException(\"A statement has already been prepared!\");\n }\n\n this.query = sql;\n\n stmt = returnGeneratedKeys ?\n context.getConnection(getDescriptor().getRealm())\n .prepareStatement(sql, Statement.RETURN_GENERATED_KEYS) :\n context.getConnection(getDescriptor().getRealm())\n .prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY);\n }", "private static void runDDL(String JDBC_DRIVER, String DB_URL, String USER, String PASS, String sql) {\r\n\r\n\t\tConnection conn = null;\r\n\t\tStatement stmt = null;\r\n\t\ttry {\r\n\t\t\t// STEP 2: Register JDBC driver\r\n\t\t\tSystem.out.println(\"Loading driver...\");\r\n\t\t\tClass.forName(JDBC_DRIVER);\r\n\r\n\t\t\t// STEP 3: Open a connection\r\n\t\t\tSystem.out.println(\"Connecting to database...\");\r\n\t\t\t\r\n\t\t\tif (USER.equals(\" \") && PASS.equals(\" \")) {\r\n\t\t\t\tconn = DriverManager.getConnection(DB_URL);\r\n\t\t\t} else {\r\n\t\t\t\tconn = DriverManager.getConnection(DB_URL, USER, PASS);\r\n\t\t\t}\r\n\r\n\t\t\t// STEP 4: Execute a query\r\n\t\t\tSystem.out.println(\"Creating statement...\");\r\n\t\t\tstmt = conn.createStatement();\r\n\r\n\t\t\t// ResultSet rs = null;\r\n\t\t\tstmt.executeUpdate(sql);\r\n\t\t\t// stmt.executeQuery(sql);\r\n\r\n\t\t\t// STEP 5: Extract data from result set\r\n\r\n\t\t\t/*\r\n\t\t\t * while (rs.next()) { // Retrieve by column name //int id =\r\n\t\t\t * rs.getInt(\"id\"); //String name = rs.getString(\"name\");\r\n\t\t\t * \r\n\t\t\t * // Display values //System.out.print(\"ID: \" + id);\r\n\t\t\t * //System.out.println(\", name: \" + name); }\r\n\t\t\t */\r\n\r\n\t\t\tSystem.out.println(\"[\" + DB_URL.substring(0, (DB_URL.length() - 1)) + \"]: sql success\");\r\n\t\t\tsuccessful = true;\r\n\r\n\t\t\t// rs.close();\r\n\t\t\tstmt.close();\r\n\t\t\tconn.close();\r\n\t\t} catch (SQLException se) {\r\n\t\t\t// Handle errors for JDBC\r\n\t\t\t//se.printStackTrace();\r\n\t\t\tSystem.out.println(\"[\" + DB_URL.substring(0, (DB_URL.length() - 1)) + \"]: sql failed\");\r\n\t\t} catch (Exception e) {\r\n\t\t\t// Handle errors for Class.forName\r\n\t\t\t//e.printStackTrace();\r\n\t\t\tSystem.out.println(\"[\" + DB_URL.substring(0, (DB_URL.length() - 1)) + \"]: sql failed\");\r\n\t\t} finally {\r\n\t\t\t// finally block used to close resources\r\n\t\t\ttry {\r\n\t\t\t\tif (stmt != null)\r\n\t\t\t\t\tstmt.close();\r\n\t\t\t} catch (SQLException se2) {\r\n\t\t\t} // nothing we can do\r\n\t\t\ttry {\r\n\t\t\t\tif (conn != null)\r\n\t\t\t\t\tconn.close();\r\n\t\t\t} catch (SQLException se) {\r\n\t\t\t\tse.printStackTrace();\r\n\t\t\t} // end finally try\r\n\t\t} // end try\r\n\t\t\t// System.out.println(\"Goodbye!\");\r\n\r\n\t}", "private static void deploy(SQLiteDatabase sqlLiteDb, InputStreamReader dbReader) throws IOException {\n String sqlLine = null;\n StringBuffer sqlBuffer = new StringBuffer();\n BufferedReader bufferedReader = new BufferedReader(dbReader);\n\n sqlLiteDb.beginTransaction();\n try {\n while ((sqlLine = bufferedReader.readLine()) != null) {\n String sql = sqlLine.trim();\n if (!isIgnoreSQL(sql)) {\n if (sql.endsWith(\";\")) {\n sqlBuffer.append(sql);\n String execSQL = sqlBuffer.toString();\n Log.d(TAG, \"running sql=>\" + execSQL);\n sqlLiteDb.execSQL(execSQL);\n sqlBuffer.delete(0, sqlBuffer.length());\n } else {\n if (sqlBuffer.length() > 0) {\n sqlBuffer.append(' ');\n }\n sqlBuffer.append(sql);\n }\n }\n }\n sqlLiteDb.setTransactionSuccessful();\n } finally {\n sqlLiteDb.endTransaction();\n }\n }", "@SuppressWarnings(\"deprecation\")\n\tpublic void execute() throws BuildException {\n // Create a new build listener for parsing events\n Connection conn = getConnection();\n DbProgressListener listener = new DbProgressListener(conn, buildId, getProgressTargets(), dbTable);\n\n // Add the event listeners to the project\n project.addBuildListener(listener);\n\n // Add a thread to poll the database\n if (pollingEnabled) {\n polling = new DbStatusThread(conn);\n polling.setInterval(pollingInterval * 1000);\n polling.start();\n }\n }", "void runQueries();", "private void executeRequest(String sql) {\n\t}", "private void doDBProcessing() throws InterruptedException {\n\t\tThread.sleep(5000);\r\n\t\t\r\n\t}", "protected static PreparedStatement prepareStatement(ReviewDb db, String sql)\n throws SQLException {\n return ((JdbcSchema) db).getConnection().prepareStatement(sql);\n }", "public abstract void execute(SQLiteDatabase database);", "public void execute() {\n /*\n r6 = this;\n java.lang.String r0 = \"Failed to close connection after DBUnit operation: \"\n java.util.logging.Logger r1 = log\n java.lang.StringBuilder r2 = new java.lang.StringBuilder\n r2.<init>()\n java.lang.String r3 = \"Executing DBUnit operations: \"\n r2.append(r3)\n int r3 = r6.size()\n r2.append(r3)\n java.lang.String r2 = r2.toString()\n r1.info(r2)\n org.dbunit.database.IDatabaseConnection r1 = r6.getConnection() // Catch:{ all -> 0x005a }\n r6.disableReferentialIntegrity(r1) // Catch:{ all -> 0x0058 }\n java.util.Iterator r2 = r6.iterator() // Catch:{ all -> 0x0058 }\n L_0x0027:\n boolean r3 = r2.hasNext() // Catch:{ all -> 0x0058 }\n if (r3 == 0) goto L_0x0037\n java.lang.Object r3 = r2.next() // Catch:{ all -> 0x0058 }\n org.seamless.util.dbunit.DBUnitOperations$Op r3 = (org.seamless.util.dbunit.DBUnitOperations.Op) r3 // Catch:{ all -> 0x0058 }\n r3.execute(r1) // Catch:{ all -> 0x0058 }\n goto L_0x0027\n L_0x0037:\n r6.enableReferentialIntegrity(r1) // Catch:{ all -> 0x0058 }\n if (r1 == 0) goto L_0x0057\n r1.close() // Catch:{ Exception -> 0x0040 }\n goto L_0x0057\n L_0x0040:\n r1 = move-exception\n java.util.logging.Logger r2 = log\n java.util.logging.Level r3 = java.util.logging.Level.WARNING\n java.lang.StringBuilder r4 = new java.lang.StringBuilder\n r4.<init>()\n r4.append(r0)\n r4.append(r1)\n java.lang.String r0 = r4.toString()\n r2.log(r3, r0, r1)\n L_0x0057:\n return\n L_0x0058:\n r2 = move-exception\n goto L_0x005c\n L_0x005a:\n r2 = move-exception\n r1 = 0\n L_0x005c:\n if (r1 == 0) goto L_0x0079\n r1.close() // Catch:{ Exception -> 0x0062 }\n goto L_0x0079\n L_0x0062:\n r1 = move-exception\n java.util.logging.Logger r3 = log\n java.util.logging.Level r4 = java.util.logging.Level.WARNING\n java.lang.StringBuilder r5 = new java.lang.StringBuilder\n r5.<init>()\n r5.append(r0)\n r5.append(r1)\n java.lang.String r0 = r5.toString()\n r3.log(r4, r0, r1)\n L_0x0079:\n goto L_0x007b\n L_0x007a:\n throw r2\n L_0x007b:\n goto L_0x007a\n */\n throw new UnsupportedOperationException(\"Method not decompiled: org.seamless.util.dbunit.DBUnitOperations.execute():void\");\n }", "public Promise<PreparedStatement> prepare(final RegularStatement query) {\n return futureToPromise(session.prepareAsync(query));\n }", "private void executeImmediate(String stmtText) throws SQLException\n {\n // execute the statement and auto-close it as well\n try (final Statement statement = this.createStatement();)\n {\n statement.execute(stmtText);\n }\n }", "protected abstract Object execute(JdbcChannel con,\n PreparedStatement stmt,\n String flags)\n throws ProcedureException;", "@Override\n public void execute()\n {\n mDbHandle.execSQL(CREATE_TABLE_BLOOD_SUGAR);\n }", "public void runStatement(final QueriesConfig qryConfig, final String statement) throws DBMissingValueException {\n final var dataSource = getDataSource(qryConfig);\n Connection conn = null;\n PreparedStatement stmt = null;\n try {\n conn = dataSource.getConnection();\n stmt = conn.prepareStatement(statement);\n\n switch (new QueryModeWrapper(qryConfig.getMode()).getMode()) {\n case QUERY:\n case SINGLE_QUERY_SCRIPT:\n final ResultSet rs = stmt.executeQuery();\n final var metaData = rs.getMetaData();\n long rsCount = 0;\n try {\n var firstLoad = true;\n final var listeners = qryConfig.getListeners();\n\n while (rs.next()) {\n rsCount++;\n StringBuilder sbHdr = new StringBuilder();\n StringBuilder sbRec = new StringBuilder();\n\n for (int idx = 1; idx <= metaData.getColumnCount(); idx++) {\n sbHdr.append(sbHdr.length()>0?\",\":\"\").append(metaData.getColumnName(idx));\n sbRec.append(sbRec.length()>0?\",\":\"\").append(rs.getString(idx));\n }\n\n if (firstLoad) {\n final var rawHdr = sbHdr.toString();\n LOG.info(String.format(\"[%s] [HDR]: %s\", qryConfig.getDescription(), rawHdr));\n\n if (listeners.getOnHeader()!=null) {\n runCmd(qryConfig, listeners.getOnHeader(), qryConfig.getDescription(), statement, rawHdr);\n }\n }\n final var rawData = sbRec.toString();\n LOG.info(String.format(\"[%s] [REC]: %s\", qryConfig.getDescription(), rawData));\n\n if (listeners.getOnData()!=null) {\n runCmd(qryConfig, listeners.getOnData(), qryConfig.getDescription(), statement, rawData);\n }\n firstLoad = false;\n }\n }\n finally {\n LOG.info(String.format(\"[%s] %s rows\", qryConfig.getDescription(), rsCount));\n try {rs.close();} catch (Exception e) {}\n }\n break;\n default:\n stmt.execute();\n try {LOG.info(String.format(\"[%s] %s rows affected\", qryConfig.getDescription(), stmt.getUpdateCount()));}\n catch(Exception e) {}\n break;\n }\n } catch (SQLException | QueryModeException e) {\n throw new RuntimeException(e);\n } finally {\n try {stmt.close();} catch (Exception e) {}\n try {conn.close();} catch (Exception e) {}\n }\n }", "public void execute (String query) throws java.sql.SQLException {\n try {\n /*\n if (query.indexOf('(') != -1)\n Logger.write(\"VERBOSE\", \"DB\", \"execute(\\\"\" + query.substring(0,query.indexOf('(')) + \"...\\\")\");\n else\n Logger.write(\"VERBOSE\", \"DB\", \"execute(\\\"\" + query.substring(0,20) + \"...\\\")\");\n */\n Logger.write(\"VERBOSE\", \"DB\", \"execute(\\\"\" + query + \"\\\")\");\n \n Statement statement = dbConnection.createStatement();\n statement.setQueryTimeout(30);\n dbConnection.setAutoCommit(false);\n statement.executeUpdate(query);\n dbConnection.commit();\n dbConnection.setAutoCommit(true);\n } catch (java.sql.SQLException e) {\n Logger.write(\"ERROR\", \"DB\", \"SQLException: \" + e);\n throw e;\n }\n }", "default void execute(@Language(\"MySQL\") @Nonnull String statement) {\n this.execute(statement, stmt -> {});\n }", "public void prepareStatements() throws SQLException {\n\t\tpstmt_updateTicket = connection.prepareStatement(\r\n\t\t \"UPDATE ticket \" +\r\n \"SET kunde = ? \" +\r\n \"WHERE tid IN (\" +\r\n \"SELECT tid FROM ticket WHERE kunde IS NULL AND auffuehrung = ? LIMIT ?)\" +\r\n \"RETURNING preis\");\r\n\t}", "public void pass(String order) throws SQLException\n\t{\n\t\tStatement stmt = con.createStatement();\n\t\ttry\n\t\t{\n\t\t\tstmt.executeUpdate(order);\n\t\t} finally\n\t\t{\n\t\t\tif (stmt != null)\n\t\t\t{\n\t\t\t\tstmt.close(); // aint giving the solution but good practice\n\t\t\t}\n\t\t}\n\t}", "Statement createStatement();", "Statement createStatement();", "Statement createStatement();", "public ResultSet executeSQL() {\t\t\n\t\tif (rs != null) {\n\t\t\ttry {\n\t\t\t\trs.close();\n\t\t\t} catch(SQLException se) {\n\t\t\t} finally {\n\t\t\t\trs = null;\n\t\t\t}\n\t\t}\n\t\ttry {\n\t\t\trs = pstmt.executeQuery();\n\t\t} catch (SQLException se) {\n\t\t\tse.printStackTrace();\n\t\t}\n\t\treturn rs;\n\t}", "abstract void prepare();", "@Override\n protected Void doInBackground(Void... params) {\n try{\n System.setProperty(\"FBAdbLog\", \"true\");\n Class.forName(\"org.firebirdsql.jdbc.FBDriver\");\n String sCon = \"jdbc:firebirdsql:\"+Server+\":C:/\"+Database+\".FDB?allowMultiQueries=true?encoding=ISO8859_1\";\n if(con == null){\n // Connection con = DriverManager.getConnection(sCon, \"SYSDBA\", \"masterkey\");\n }\n Connection con = DriverManager.getConnection(sCon, \"SYSDBA\", \"masterkey\");\n Statement stmt = con.createStatement();\n con.setAutoCommit(false);\n String sql = \"INSERT INTO CLIENT VALUES ('1','NASSER','2222222')\";\n String sql2 = \"INSERT INTO CLIENT VALUES ('2','SALIM','3333333')\";\n stmt.addBatch(sql);\n stmt.addBatch(sql2);\n stmt.executeBatch();\n // Statement stmt1 = con.createStatement();\n con.commit();\n //con.setAutoCommit(true);\n etatCon = true;\n }\n catch(Exception e){\n Log.e(\"FirebirdExample\", e.getMessage());\n etatCon = false;\n }\n return null;\n }", "public void prepareUpdateObject() {\n // Require modify row to prepare.\n if (getModifyRow() == null) {\n return;\n }\n\n if (hasMultipleStatements()) {\n for (Enumeration statementEnum = getSQLStatements().elements();\n statementEnum.hasMoreElements();) {\n ((SQLModifyStatement)statementEnum.nextElement()).setModifyRow(getModifyRow());\n }\n } else if (getSQLStatement() != null) {\n ((SQLModifyStatement)getSQLStatement()).setModifyRow(getModifyRow());\n }\n setCallFromStatement();\n // The statement is no longer require so can be released.\n clearStatement();\n\n super.prepareUpdateObject();\n }", "@Override\r\n public PreparedStatement prepareStatement(DatabaseQueryBuilder query) throws SQLException {\r\n final PreparedStatement ps = super.prepareStatement(query);\r\n ps.setQueryTimeout(OracleERPUtil.ORACLE_TIMEOUT);\r\n return ps;\r\n }", "@Override\r\n\tpublic int execPrepareStatement(String stmt, List<Object> args)\r\n\t\tthrows SQLException\r\n\t{\n\t\tPreparedStatement prepStmt = prepareStatement(stmt);\r\n\t\t\r\n\t\t// Fill the statement with data\r\n\t\tint index = 1;\r\n\t\tfor(Object o : args)\r\n\t\t{\r\n\t\t\tif (o instanceof Integer) \r\n\t\t\t{\r\n\t\t\t\tprepStmt.setInt(index, (Integer)o);\r\n\t\t\t}\r\n\t\t\telse if (o instanceof Double) \r\n\t\t\t{\r\n\t\t\t\tprepStmt.setDouble(index, (Double)o);\r\n\t\t\t}\r\n\t\t\telse if (o instanceof Boolean) \r\n\t\t\t{\r\n\t\t\t\tprepStmt.setBoolean(index, (Boolean)o);\r\n\t\t\t}\r\n\t\t\telse if (o instanceof Timestamp) \r\n\t\t\t{\r\n\t\t\t\tprepStmt.setTimestamp(index, (Timestamp)o);\r\n\t\t\t}\r\n\t\t\telse if (o instanceof LocalDate) \r\n\t\t\t{\r\n\t\t\t\tprepStmt.setDate(index, Date.valueOf(\r\n\t\t\t\t\t(LocalDate)o));\r\n\t\t\t}\r\n\t\t\telse if (o instanceof Blob) \r\n\t\t\t{\r\n\t\t\t\tprepStmt.setBinaryStream(index, \r\n\t\t\t\t\t((Blob)o).getBinaryStream());\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tprepStmt.setString(index, (String)o);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tindex++;\r\n\t\t}\r\n\t\t\r\n\t\t// Build the log statement string\r\n\t\tfor(Object a : args)\r\n\t\t{\r\n\t\t\tstmt = stmt.replaceFirst(\"\\\\?\", \r\n\t\t\t\t\"\\\"\" + String.valueOf(a) + \"\\\"\");\r\n\t\t}\r\n\r\n\t\tCooLog.debug(\"Executing prepared SQL Update \"\r\n\t\t\t+ \"statement: \\\"\" + stmt + \"\\\" \");\r\n\t\treturn prepStmt.executeUpdate();\r\n\t}", "public void executeCountSql() throws SQLException {\n\t\tPreparedStatement stmt = null;\n\t\tResultSet rs = null;\n\t\ttry {\t\t\t\n\t\t\tSqlStatement countSqlStatement = getCountSqlStatement();\n\t\t\t\n\t\t\tlog.debug(\"Counting database query: \" + countSqlStatement.getQuery());\n\t\t\tlog.debug(\"Counting statement parameters: \" + countSqlStatement.getParams());\n\t\t\t\n\t\t\tstmt = this.con.prepareStatement(countSqlStatement.getQuery());\n\t\t\tcountSqlStatement.propagateStatementWithParams(stmt);\n\t\t\t\n\t\t\trs = stmt.executeQuery();\n\t\t\tif (rs.next()) {\n\t\t\t\tthis.totalCount = new Long(rs.getLong(1));\n\t\t\t}\n\t\t} finally {\n\t\t\tDbHelper.closeDbObjects(null, stmt, rs);\n\t\t}\n\t}", "private void constructExecuteSql() {\n getMetaData();\n // Validate that the primary keys are present in the underlying SQL\n StringBuilder orderBySql = new StringBuilder(super.getExecuteSql()).append(\"\\n order by \");\n switch (metaData.getDbType()) {\n case ORACLE:\n orderBySql.append(createOracleOrderedByClause ());\n break;\n case SQL_SERVER:\n orderBySql.append(createSqlServerOrderedByClause());\n break;\n case UNKNOWN:\n default:\n orderBySql.append(createUnknownDBOrderedByClause());\n }\n this.executeSql = orderBySql.toString();\n }", "public Promise<PreparedStatement> prepare(final String query) {\n return futureToPromise(session.prepareAsync(query));\n }", "protected void execute() {}", "protected void execute() {\n \t\n }", "protected void execute() {\n \t\n }", "public void execSql(String sql) {\n\t\tjdbcTemplate.execute(sql);\n\t}", "protected void executeThread() {\n if (thread == null || !thread.isAlive()) {\n thread = new Thread(() -> {\n while (!queries.isEmpty() && !disconnect) {\n queries.remove().execute(queryRunner, connection);\n }\n if (disconnect) {\n disconnect();\n }\n });\n thread.start();\n }\n }", "public String prepareStatementString() throws SQLException {\n\t\tList<Object> argList = new ArrayList<Object>();\n\t\treturn buildStatementString(argList);\n\t}", "@SuppressWarnings(\"unchecked\")\n public void execute() {\n execute(null, null);\n }", "public void prepareDatabase(String testName) throws Exception {\n prepareDatabaseFromPath('/' + testName + \"/\" + prepareFileName);\n }", "public void finalPass() throws Exception {\n if (_CommandText != null)\n _CommandText.finalPass();\n \n if (_QueryParameters != null)\n _QueryParameters.finalPass();\n \n // verify the data source\n DataSourceDefn ds = null;\n if (OwnerReport.getDataSourcesDefn() != null && OwnerReport.getDataSourcesDefn().getItems() != null)\n {\n ds = OwnerReport.getDataSourcesDefn().get___idx(_DataSourceName);\n }\n \n if (ds == null)\n {\n OwnerReport.rl.logError(8,\"Query references unknown data source '\" + _DataSourceName + \"'\");\n return ;\n }\n \n _DataSourceDefn = ds;\n IDbConnection cnSQL = ds.sqlConnect(null);\n if (cnSQL == null || _CommandText == null)\n return ;\n \n // Treat this as a SQL statement\n String sql = _CommandText.evaluateString(null,null);\n IDbCommand cmSQL = null;\n IDataReader dr = null;\n try\n {\n cmSQL = cnSQL.CreateCommand();\n cmSQL.CommandText = addParametersAsLiterals(null,cnSQL,sql,false);\n if (this._QueryCommandType == QueryCommandTypeEnum.StoredProcedure)\n cmSQL.CommandType = CommandType.StoredProcedure;\n \n addParameters(null,cnSQL,cmSQL,false);\n dr = cmSQL.ExecuteReader(CommandBehavior.SchemaOnly);\n if (dr.FieldCount < 10)\n _Columns = new ListDictionary();\n else\n // Hashtable is overkill for small lists\n _Columns = new Hashtable(dr.FieldCount); \n for (int i = 0;i < dr.FieldCount;i++)\n {\n QueryColumn qc = new QueryColumn(i, dr.GetName(i), Type.GetTypeCode(dr.GetFieldType(i)));\n try\n {\n _Columns.Add(qc.colName, qc);\n }\n catch (Exception __dummyCatchVar0)\n {\n // name has already been added to list:\n // According to the RDL spec SQL names are matched by Name not by relative\n // position: this seems wrong to me and causes this problem; but\n // user can fix by using \"as\" keyword to name columns in Select\n // e.g. Select col as \"col1\", col as \"col2\" from tableA\n OwnerReport.rl.LogError(8, String.Format(\"Column '{0}' is not uniquely defined within the SQL Select columns.\", qc.colName));\n }\n \n }\n }\n catch (Exception e)\n {\n OwnerReport.rl.logError(4,\"SQL Exception during report compilation: \" + e.Message + \"\\r\\nSQL: \" + sql);\n }\n finally\n {\n if (cmSQL != null)\n {\n cmSQL.Dispose();\n if (dr != null)\n dr.Close();\n \n }\n \n }\n return ;\n }", "public void prepare() {\n long millis, nanos;\n TestCaseImpl tc = _testCase;\n \n nanos = Util.currentTimeNanos();\n prepare(tc);\n nanos = Util.currentTimeNanos() - nanos;\n tc.setDoubleParam(Constants.ACTUAL_PREPARE_TIME, \n Util.nanosToMillis(nanos));\n }", "public static void doDataProcess(String name, StatementProcessor pd)\n {\n executorService.execute(() -> PolledDb.doDataProcess(name, pd));\n }", "@Override\r\n public void runCode(String sql)\r\n throws DatabaseException {\r\n try {\r\n Class.forName(driverClassName);\r\n conn = DriverManager.getConnection(url, userName, password);\r\n \r\n } catch (ClassNotFoundException ex) {\r\n throw new DatabaseException(\"Could not load JDBC driver\");\r\n }\r\n catch(SQLException sq){\r\n throw new DatabaseException(\"Connection Failed\");\r\n }\r\n \r\n try {\r\n stmt = conn.createStatement();\r\n stmt.executeUpdate(sql); \r\n } catch (SQLException sqle) {\r\n throw new DatabaseException(\"Execution of SQL failed\");\r\n } catch (Exception e) {\r\n } finally {\r\n try {\r\n stmt.close();\r\n conn.close();\r\n } catch (Exception e) {\r\n throw new DatabaseException(\"Unknown error\");\r\n }\r\n }\r\n }", "@Nonnull\n default Promise<Void> executeAsync(@Language(\"MySQL\") @Nonnull String statement) {\n return Schedulers.async().run(() -> this.execute(statement));\n }", "public QueryCore executionQ() throws SQLException\n {\n rs = prepStm.executeQuery();\n return this;\n }", "@Override\r\n\t\tpublic PreparedStatement prepareStatement(String sql,\r\n\t\t\t\tint resultSetType, int resultSetConcurrency,\r\n\t\t\t\tint resultSetHoldability) throws SQLException {\n\t\t\treturn null;\r\n\t\t}", "public abstract void prepare();", "private void setupDBs()\n {\n\t mSetupDBTask = new SetupDBTask(this);\n\t\tmSetupDBTask.execute((Void[])null);\n }", "public void executeSql(String sql, boolean doCommit, int fetchSize, int fetchDirn) throws SQLException {\n\n connectionCheck();\n blankStringCheck(sql, \"DB : Cannot execute null or empty SQL.\");\n\n LOGGER.info(\"DB : Executing the SQL : {}\", sql);\n\n Statement stmt = connection.createStatement();\n stmt.setFetchDirection(fetchDirn);\n stmt.setFetchSize(fetchSize);\n stmt.executeUpdate(sql);\n stmt.close();\n\n if (doCommit) {\n LOGGER.info(\"DB : Committing the changes.\");\n connection.commit();\n }\n }", "public abstract ResultList executeSQL(RawQuery rawQuery);", "private void setupDatabase()\n {\n try\n {\n Class.forName(\"com.mysql.jdbc.Driver\");\n }\n catch (ClassNotFoundException e)\n {\n simpleEconomy.getLogger().severe(\"Could not load database driver.\");\n simpleEconomy.getServer().getPluginManager().disablePlugin(simpleEconomy);\n e.printStackTrace();\n }\n\n try\n {\n connection = DriverManager\n .getConnection(String.format(\"jdbc:mysql://%s/%s?user=%s&password=%s\",\n simpleEconomy.getConfig().getString(\"db.host\"),\n simpleEconomy.getConfig().getString(\"db.database\"),\n simpleEconomy.getConfig().getString(\"db.username\"),\n simpleEconomy.getConfig().getString(\"db.password\")\n ));\n\n // Loads the ddl from the jar and commits it to the database.\n InputStream input = getClass().getResourceAsStream(\"/ddl.sql\");\n try\n {\n String s = IOUtils.toString(input);\n connection.createStatement().execute(s);\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n finally\n {\n try\n {\n input.close();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n }\n }\n catch (SQLException e)\n {\n simpleEconomy.getLogger().severe(\"Could not connect to database.\");\n simpleEconomy.getServer().getPluginManager().disablePlugin(simpleEconomy);\n e.printStackTrace();\n }\n }", "@Override\r\n\t\tpublic PreparedStatement prepareStatement(String sql)\r\n\t\t\t\tthrows SQLException {\n\t\t\treturn this.conn.prepareStatement(sql);\r\n\t\t}", "public void prepare(IDb db, List<? extends Relation> relations);", "public void prepareDeleteAll() {\n setCallFromStatement();\n // The statement is no longer require so can be released.\n clearStatement();\n\n super.prepareDeleteAll();\n }", "public boolean execute() throws SQLException {\n return currentPreparedStatement.execute();\n }", "public void prepare() {\n\t}", "private long prepareSQL(SQLiteDatabase db, String statement, JSArray values) {\n boolean success = true;\n String stmtType = \"\";\n long lastId = Long.valueOf(-1);\n stmtType = statement.substring(0, 6).toUpperCase();\n SQLiteStatement stmt = db.compileStatement(statement);\n if (values != null && values.length() > 0) {\n // bind the values if any\n stmt.clearBindings();\n try {\n bindValues(stmt, values);\n } catch (JSONException e) {\n Log.d(TAG, \"Error: prepareSQL failed: \" + e.getMessage());\n success = false;\n }\n }\n if (success) {\n if (stmtType.equals(\"INSERT\")) {\n lastId = stmt.executeInsert();\n } else {\n lastId = Long.valueOf(stmt.executeUpdateDelete());\n }\n }\n stmt.close();\n return lastId;\n }", "private void executeSelect(String query){\n try {\n statement = connection.createStatement();\n rs = statement.executeQuery(query);\n } catch (SQLException e) {\n throw new RuntimeException(e);\n } \n }", "@Test\n public void testPreparedStatementOne() throws Throwable\n {\n assertNotNull(ds);\n Connection c = ds.getConnection();\n assertNotNull(c);\n \n Statement st = c.createStatement();\n assertNotNull(st);\n \n // Create\n st.execute(\"CREATE TABLE Employees (Employee_ID INTEGER, Name VARCHAR(30));\");\n st.execute(\"INSERT INTO Employees VALUES (1, '#1')\");\n st.execute(\"INSERT INTO Employees VALUES (2, '#2')\");\n \n // Prepared statement\n PreparedStatement pstmt = c.prepareStatement(\"SELECT * FROM Employees WHERE Employee_ID = ?\");\n assertNotNull(pstmt);\n \n pstmt.setInt(1, 1);\n \n ResultSet rs = pstmt.executeQuery();\n assertNotNull(rs);\n \n assertTrue(rs.next());\n \n // Drop\n st.execute(\"DROP TABLE Employees\");\n \n rs.close();\n pstmt.close();\n st.close();\n c.close();\n }", "public void prepare(AnalyzerOptions options) {\n Preconditions.checkState(!prepared);\n Preconditions.checkState(!closed);\n this.options = options;\n PrepareRequest.Builder request = PrepareRequest.newBuilder();\n request.setSql(sql);\n fileDescriptorSetsBuilder = new FileDescriptorSetsBuilder();\n request.setOptions(options.serialize(fileDescriptorSetsBuilder));\n for (FileDescriptorSet fileDescriptorSet : fileDescriptorSetsBuilder.build()) {\n request.addFileDescriptorSet(fileDescriptorSet);\n }\n\n PrepareResponse resp;\n try {\n resp = Client.getStub().prepare(request.build());\n } catch (StatusRuntimeException e) {\n throw new SqlException(e);\n }\n\n // TODO: Remove this backwards compatibility code\n final PreparedState prepared;\n if (resp.hasPrepared()) {\n prepared = resp.getPrepared();\n } else {\n prepared = PreparedState.newBuilder()\n .setOutputType(resp.getOutputType())\n .setPreparedExpressionId(resp.getPreparedExpressionId())\n .build();\n }\n setPrepared(prepared);\n }", "protected void execute() {\n\t\t\n\t}", "public static void main(String[] args) {\n try (Connection connection = ConnectorDB.getConnection();\n Statement statement = connection.createStatement()) {\n dropTablesFromDatabase(statement);\n createTablesInDatabase(statement);\n addObjectsInList();\n insertListsInDataBase();\n } catch (SQLException e) {\n System.out.println(\"Error connection/sql query\" + e);\n e.printStackTrace();\n }\n }", "abstract public void execute(Parameters p);", "protected abstract void prepareStatementForUpdate(PreparedStatement statement, T object) throws PersistException;", "public interface StatementHandler {\n void supplyToStatement(PreparedStatement statement);\n}", "@Override\r\n\t\tpublic PreparedStatement prepareStatement(String sql,\r\n\t\t\t\tint resultSetType, int resultSetConcurrency)\r\n\t\t\t\tthrows SQLException {\n\t\t\treturn null;\r\n\t\t}", "protected void execute()\n\t{\n\t}", "protected void PerformSQLCommand(SQLStatement sqlStat, int sqlParameterOrder, boolean measure) {\n try\n {\n pstmt = sConnection.prepareStatement(sqlStat.mStatementText);\n for (int i = 1; i <= sqlStat.mParameterCount; i++) {\n //System.out.println(i + \":\" + sqlStat.mParameters.get(sqlParameterOrder)[i - 1]);\n pstmt.setString(i, sqlStat.mParameters.get(sqlParameterOrder)[i - 1]);\n }\n long before = System.nanoTime();\n pstmt.execute();\n long after = System.nanoTime();\n\n SQLWarning warning = pstmt.getWarnings();\n while (warning != null) {\n //System.out.println(warning.getMessage());\n ResultGenerator.errors.add(new ResultError(ResponseTexts.SQL_WARNING + sqlStat.mStatementText, warning.getMessage(), ResultError.TYPE_WARNING));\n warning = warning.getNextWarning();\n }\n if (measure)\n {\n sqlStat.addMeasuredTime(sqlParameterOrder, (int) ((after - before) / 1000000.0));\n }\n pstmt.clearParameters();\n } catch (SQLException e) {\n ResultGenerator.errors.add(new ResultError(ResponseTexts.SQL_EXCEPTION + sqlStat.mStatementText, e.getMessage(), ResultError.TYPE_ERROR));\n //System.out.println(e.getMessage());\n } \n }", "protected abstract void prepareStatementForInsert(PreparedStatement statement, T object)\n throws PersistException;", "boolean execute() throws SQLException;", "public PreparedStatement prepare(String str, Connection connection) throws SQLException {\n if (this.generatedResultReader == null) {\n return connection.prepareStatement(str, 2);\n }\n if (this.configuration.getPlatform().supportsGeneratedColumnsInPrepareStatement()) {\n return connection.prepareStatement(str, this.generatedResultReader.generatedColumns());\n }\n return connection.prepareStatement(str, 1);\n }", "ResultSet runSQL(String query) {\n try {\n return connection.prepareStatement(query).executeQuery();\n }\n catch (SQLException e) {\n System.err.println(e.getMessage());\n return null;\n }\n }", "public void prepareUpdateAll() {\n setCallFromStatement();// Will build an SQLUpdateAllStatement\n clearStatement();// The statement is no longer require so can be released.\n super.prepareUpdateAll();\n }" ]
[ "0.6443434", "0.6140801", "0.612386", "0.6055407", "0.59995645", "0.59091574", "0.58953637", "0.5895115", "0.5893136", "0.58891183", "0.5861905", "0.58594704", "0.5843973", "0.5824171", "0.58034223", "0.5789722", "0.577119", "0.57204205", "0.56904614", "0.56816334", "0.5669532", "0.5624095", "0.5582506", "0.5561064", "0.55534846", "0.55464584", "0.5538268", "0.55071217", "0.55068755", "0.5492695", "0.54573274", "0.5442713", "0.543881", "0.5424754", "0.5408355", "0.5406469", "0.5378995", "0.5367131", "0.5357382", "0.53470004", "0.5346813", "0.53374684", "0.5333956", "0.53302443", "0.5329418", "0.5317396", "0.5313215", "0.5313215", "0.5313215", "0.53093934", "0.5304162", "0.5303299", "0.5285465", "0.52790374", "0.5278288", "0.5271279", "0.5270786", "0.5261663", "0.5260898", "0.5248604", "0.5248604", "0.52374196", "0.5223681", "0.5211743", "0.520808", "0.52071565", "0.5202234", "0.5197951", "0.518269", "0.5182327", "0.51821923", "0.5180066", "0.51797605", "0.5176089", "0.51749015", "0.51747423", "0.5171266", "0.51643753", "0.5151024", "0.51499856", "0.51494724", "0.5149232", "0.5148517", "0.5147966", "0.51425445", "0.51413023", "0.51377493", "0.5135522", "0.51323825", "0.51258767", "0.5122921", "0.51208806", "0.51064223", "0.5106157", "0.51052254", "0.51010925", "0.50983566", "0.5096287", "0.50951934", "0.5093385" ]
0.58259594
13
Created by gorkemgok on 21/05/16.
public interface BackTestService { BackTestResult doSimulationBackTest (String code, Symbol symbol, Period period, Date startDate, Date endDate) throws PrerequisiteException; BackTestResult doBackTest(String code, Symbol symbol, Period period, Date startDate, Date endDate) throws PrerequisiteException; BackTestResult doBackTest(SignalGenerator signalGenerator, Symbol symbol, Period period, Date startDate, Date endDate) throws PrerequisiteException; boolean doBackTestAndSave(SignalGenerator signalGenerator, Symbol symbol, Period period, Date startDate, Date endDate) throws PrerequisiteException;; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "private stendhal() {\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void bicar() {\n\t\t\r\n\t}", "public final void mo51373a() {\n }", "@Override\n public void func_104112_b() {\n \n }", "public void gored() {\n\t\t\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "private void poetries() {\n\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "private static void cajas() {\n\t\t\n\t}", "public void mo38117a() {\n }", "@Override\n public void init() {\n\n }", "@Override\n\tpublic void ligar() {\n\t\t\n\t}", "protected boolean func_70814_o() { return true; }", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "private void m50366E() {\n }", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\n\tpublic void jugar() {\n\t\t\n\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "private void kk12() {\n\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "public void mo4359a() {\n }", "private void init() {\n\n\t}", "@Override\n public void init() {\n }", "@Override\n\tpublic void nghe() {\n\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\n protected void initialize() {\n\n \n }", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void einkaufen() {\n\t}", "@Override\n protected void init() {\n }", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void init() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "@Override\r\n\tpublic void init() {}", "@Override\n public void init() {}", "@Override\n void init() {\n }", "@Override\r\n\tprotected void initialize() {\r\n\t\t\r\n\t\t\r\n\t}", "private void strin() {\n\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\r\n\tpublic void init()\r\n\t{\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\n\tpublic void init() {\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n\tpublic void init()\n\t{\n\n\t}", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\n public int describeContents() { return 0; }", "@Override\n\tpublic void debite() {\n\t\t\n\t}", "public void method_4270() {}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "@Override\n protected void getExras() {\n }", "private Rekenhulp()\n\t{\n\t}", "@Override\r\n\tprotected void initialize() {\n\r\n\t}", "@Override\r\n\tprotected void doF6() {\n\t\t\r\n\t}", "public void m23075a() {\n }", "@Override\n\tprotected void initialize() {\n\t}", "@Override\n\tprotected void initialize() {\n\t}", "private void init() {\n\n\n\n }", "@Override\n public void initialize() { \n }", "public void mo21877s() {\n }", "public abstract void mo70713b();", "@Override\n\tpublic int mettreAJour() {\n\t\treturn 0;\n\t}" ]
[ "0.60570574", "0.60255027", "0.59288657", "0.58927214", "0.58647037", "0.58647037", "0.58416694", "0.5821806", "0.5788463", "0.5786141", "0.5783129", "0.5771687", "0.57629", "0.5743055", "0.57429874", "0.57315326", "0.57315326", "0.57315326", "0.57315326", "0.57315326", "0.5727835", "0.5707438", "0.5706381", "0.56812257", "0.5679997", "0.56783044", "0.5672674", "0.56675476", "0.566206", "0.5660282", "0.5653599", "0.5651301", "0.565037", "0.5643455", "0.5643393", "0.5631629", "0.5621304", "0.5621304", "0.5590914", "0.5579266", "0.55770373", "0.5573832", "0.55626154", "0.55626154", "0.55626154", "0.5549806", "0.5549754", "0.5549754", "0.5549754", "0.55372304", "0.55328876", "0.5530197", "0.5530197", "0.5530197", "0.5526827", "0.5518482", "0.5518482", "0.55182374", "0.5514864", "0.5514601", "0.55106294", "0.5503799", "0.5499765", "0.5497665", "0.5497411", "0.54960364", "0.54960364", "0.54958445", "0.5494763", "0.5489218", "0.5489218", "0.5489218", "0.5489218", "0.5489218", "0.5489218", "0.54678106", "0.54562235", "0.5452389", "0.54334867", "0.54292744", "0.54289484", "0.5426914", "0.5426914", "0.5426914", "0.5426914", "0.5426914", "0.5426914", "0.5426914", "0.5417811", "0.540827", "0.54075813", "0.54041535", "0.5399053", "0.53960085", "0.5386433", "0.5386433", "0.537784", "0.53755736", "0.53714806", "0.5367083", "0.5367059" ]
0.0
-1
adds another message to the send queue for sending when channel is ready, notifies parent torrent if there are enqueued blocks that could be unlocked, first message is at index [0] See class implementation comments for queuebuffer processing details.
protected void enqueue(StdPeerMessage message) { // if (DEBUG) { // if (message.type == StdPeerMessage.REQUEST) { // System.out.println(System.nanoTime() + " [stdpc] enqueue: req " + message.index + " " + (message.begin >> 14)); // } else { // System.out.println("[stdpc] enqueue: " + message.type); // } // } if (message.type == StdPeerMessage.CHOKE) { // remove reply messages with piece (block) data // from the send queue (due to spec) for (int i = sendQueue.size() - 1; 0 <= i; i--) { StdPeerMessage pm = sendQueue.get(i); if (pm.type == StdPeerMessage.PIECE) { sendQueue.remove(i); TorrentStorage.Block block = (TorrentStorage.Block) message.params; block.release(); pmCache.release(pm); } } // set choke status choke = true; // send choke asap sendQueue.add(0, message); } else if (message.type == StdPeerMessage.CANCEL) { // remove the linked request if it's still in the queue for (int i = sendQueue.size() - 1; 0 <= i; i--) { StdPeerMessage pm = sendQueue.get(i); if ((pm.type == StdPeerMessage.REQUEST) && (pm.index == message.index) && (pm.begin == message.begin) && (pm.length == message.length)) // this check is redundant as length is fixed { sendQueue.remove(i); pmCache.release(pm); // don't really enqueue CANCEL as the linked request // has been found and removed pmCache.release(message); return; } } // send asap sendQueue.add(0, message); } else { if (message.type == StdPeerMessage.INTERESTED) { interested = true; } else if (message.type == StdPeerMessage.NOT_INTERESTED) { interested = false; } else if (message.type == StdPeerMessage.UNCHOKE) { choke = false; } // enqueue message sendQueue.add(message); } // sendQueue.forEach(pm -> System.out.println(" -x> " + System.identityHashCode(pm) + pm.type + " ," + pm.index +"," + pm.begin +"," + pm.length) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void writeNextMessageInQueue() {\n // This should not happen in practice since this method is private and should only be called\n // for a non-empty queue.\n if (mMessageQueue.isEmpty()) {\n Log.e(TAG, \"Call to write next message in queue, but the message queue is empty.\");\n return;\n }\n\n if (mMessageQueue.size() == 1) {\n writeValueAndNotify(mMessageQueue.remove().toByteArray());\n return;\n }\n\n mHandler.post(mSendMessageWithTimeoutRunnable);\n }", "protected void addChannelToReadCompletePendingQueue() {\n/* 354 */ while (!Http2MultiplexHandler.this.readCompletePendingQueue.offer(this)) {\n/* 355 */ Http2MultiplexHandler.this.processPendingReadCompleteQueue();\n/* */ }\n/* */ }", "private void push() {\n ImmutableSortedSet<T> myAvailable = _outstanding.apply(\n new Syncd.Transformer<ImmutableSortedSet<T>, ImmutableSortedSet<T>>() {\n public Tuple<ImmutableSortedSet<T>, ImmutableSortedSet<T>> apply(ImmutableSortedSet<T> aBefore) {\n final SortedSet<T> myRemaining = new TreeSet<>(new MessageComparator<T>());\n\n // Identify those messages that are sequentially contiguous from _floor and can be passed on\n //\n ImmutableSortedSet<T> myAccessible =\n new ImmutableSortedSet.Builder<>(new MessageComparator<T>()).addAll(\n Iterables.filter(aBefore, new Predicate<T>() {\n public boolean apply(T aMessage) {\n Long myCurrent = _floor.get();\n\n if (aMessage.getSeq() == myCurrent) {\n // This message can be sent out to listeners so long as we're first to try\n //\n if (_floor.testAndSet(myCurrent, myCurrent + 1))\n return true;\n } else\n // This message must remain\n //\n myRemaining.add(aMessage);\n\n // Couldn't send message out or it must remain\n //\n return false;\n }\n })\n ).build();\n\n return new Tuple<>(new ImmutableSortedSet.Builder<>(\n new MessageComparator<T>()).addAll(myRemaining).build(),\n myAccessible);\n }\n }\n );\n\n send(myAvailable);\n archive(myAvailable);\n }", "private void addMessageToQueue( byte[] buffer ){\n \tsynchronized (this.messages) {\n byte message[] = new byte[buffer.length\n - Constants.MESSAGE_ID_LEN - 1];\n for (int i = Constants.MESSAGE_ID_LEN + 1; i < buffer.length; i++) {\n message[i - Constants.MESSAGE_ID_LEN - 1] = buffer[i];\n }\n messages.add(message);\n }\n }", "public void queueMessage(ByteBuffer bb) {\n queue.add(bb);\n processOut();\n updateInterestOps();\n }", "public void queueMessage(ByteBuffer bb) {\n\t\tqueue.add(bb);\n\t\tprocessOut();\n\t\tupdateInterestOps();\n\t}", "public void append(Serializable message){\n taskQueue.addLast(message);\n unlockWaiter();//unblocks for taskQueue\n unlockPoolWaiter();//unblocks for threadPool\n }", "public synchronized void enqueue(Object msg) {\n\t\tqueue.add(msg);\n\n\t\t// if any threads wait on empty queue then wake them up\n\t\tnotifyAll();\n\t}", "public void queueMessage(Message message);", "public void sendFromMessageQueue() throws IOException {\n Date canSendDate = new Date(lastReceiveMsgDate.getTime() + 2000);\n if (canSendDate.before(new Date())) {\n String msg = messageQueue.poll();\n if (msg == null)\n return;\n\n output.writeBytes(msg + \"\\n\");\n }\n }", "public void addIntoQueue(Integer block_id){\n if(this.queue_set){\n if(this.queue.contains(block_id) == false){\n this.queue.add(block_id);\n }\n }\n }", "@Override\n void enqueuePiece(ByteBuffer buffer, int index, int position, int length, Object params)\n {\n// if (DEBUG) System.out.println(\"[stdpc] enqueuePiece:\" + index + \",\" + position + \",\" + length + \" buf:\" + buffer.remaining());\n// sendQueue.forEach(pm ->\n// System.out.println(\" -s> \" + System.identityHashCode(pm) + \" \" +pm.type + \" ,\" + pm.index +\",\" + pm.begin + \",\" + pm.length)\n// );\n// peerBlockRequests.forEach(pm -> {\n// System.out.println(\" -p> \" + pm.type + \" ,\" + pm.index +\",\" + pm.begin + \",\" + pm.length);\n// });\n\n\n boolean found = false;\n\n // check for the active linked peer request and remove it\n for (int i = 0; i < peerBlockRequests.size(); i++) {\n StdPeerMessage pm = peerBlockRequests.get(i);\n if ((pm.index == index)\n && (pm.begin == position)\n && (pm.length == length))\n {\n peerBlockRequests.remove(i);\n pmCache.release(pm);\n found = true;\n break;\n }\n }\n if (!found && DEBUG) {\n if (DEBUG) System.out.println(\"[stdpc] pBR not found\");\n }\n\n enqueue(pmCache.piece(index, position, length, buffer, params));\n }", "public void sendMessage(Event event){\n // find the last queue and add the message to that\n // if the last queue is full then create a new queue and add to that\n if(messageQueues.size() <= 0){\n Queue<Event> newQueue = new LinkedList<>();\n Queue<Event> newBackupQueue = new LinkedList<>();\n messageQueues.add(newQueue);\n backupMessageQueues.add(newBackupQueue);\n// System.out.println(\"Size of new Q: \" + messageQueues.size());\n }\n\n // getting hold of the working queue and the backup queue.\n Queue<Event> queue = messageQueues.get(messageQueues.size() - 1);\n Queue<Event> backupQueue = backupMessageQueues.get(backupMessageQueues.size() - 1);\n\n try{\n if(queue.size() >= queueSize){\n Queue<Event> newQueue = new LinkedList<>();\n Queue<Event> newBackupQueue = new LinkedList<>();\n // throw an excpetion for a certain message\n if(event.payload.trim().equals(\"CrashQueue\"))\n // this is done to simulate the queue crashing when it tries to add messages\n throw new Exception(\"Queue has been crashed\");\n // adding the message to both the backup and the main queue\n newQueue.add(event);\n messageQueues.add(newQueue);\n\n newBackupQueue.add(event);\n backupMessageQueues.add(newBackupQueue);\n } else {\n if(event.payload.trim().equals(\"CrashQueue\"))\n // this is done to simulate the queue crashing when it tries to add messages\n throw new Exception(\"Queue has been crashed\");\n queue.add(event);\n backupQueue.add(event);\n }\n }catch(Exception e){\n System.out.println(\"Queue crashed, switching it with the backup queue\");\n // if the queue fails then switch it with the backup queue and create a new backup\n messageQueues = backupMessageQueues;\n // create a duplicate backup message queue\n }\n// System.out.println(\"The message queuesss are : \" + messageQueues);\n }", "@Override\n\tpublic Future<Integer> write(ByteBuffer bb) {\n\t\tthis.outcomingMessageQ.offer(bb);\n\n\t\t/*\n\t\t * Read the Q and send the packet util the Q is empty.\n\t\t * \n\t\t * This method will for ever called after the offer call on the Q to\n\t\t * make sure write will be triggered if the Q isn't empty.\n\t\t */\n\t\treturn sendOne();\n\n\t}", "public void enqueue(Message msg){\n\t\tqueue.add(msg);\n\t}", "@Override\n public void sendMessage(Message<M> message) {\n long vertexId = message.getReceiver();\n Queue<Message<M>> sendQueue = sendQueues.get(vertexId);\n if (sendQueue == null) {\n sendQueue = new LinkedList<>();\n sendQueues.put(vertexId, sendQueue);\n }\n\n Message<M> initial = sendQueue.peek();\n if (combiner != null && initial != null) {\n initial = sendQueue.poll();\n M value = combiner.combine(initial.getValue(), message.getValue());\n message.setValue(value);\n }\n sendQueue.offer(message);\n\n if (sendQueue.size() > sendThreshold) {\n sendMessages(sendQueue);\n }\n }", "public void addQueuedPassenger(){\n this._queuedPassengers +=1;\n }", "public int flush() throws IOException {\n while (sendbuffer != null) {\n channel.write(sendbuffer);\n if (sendbuffer.remaining() == 0) {\n sendbuffer = sendqueue.poll();\n } else {\n return sendbuffer.remaining();\n }\n }\n return 0;\n }", "public synchronized void bufferMessage() throws Exception\r\n {\r\n\r\n System.out.println(\"BUFFER: Message from future round received. Buffering message.\");\r\n // Wait until node moves to next round.\r\n wait();\r\n\r\n }", "public void sendAsync() {\n\t\tstartTime = System.currentTimeMillis();\n\t\t\n\t\tif(logMINOR) Logger.minor(this, \"Starting async send on \"+this);\n\t\tincRunningBlockTransmits();\n\t\t\n\t\ttry {\n\t\t\tsynchronized(_prb) {\n\t\t\t\t_unsent = _prb.addListener(myListener = new PartiallyReceivedBlock.PacketReceivedListener() {;\n\n\t\t\t\t\tpublic void packetReceived(int packetNo) {\n\t\t\t\t\t\tsynchronized(_senderThread) {\n\t\t\t\t\t\t\tif(_unsent.contains(packetNo)) {\n\t\t\t\t\t\t\t\tLogger.error(this, \"Already in unsent: \"+packetNo+\" for \"+this+\" unsent is \"+_unsent, new Exception(\"error\"));\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(_sentPackets.bitAt(packetNo)) {\n\t\t\t\t\t\t\t\tLogger.error(this, \"Already sent packet in packetReceived: \"+packetNo+\" for \"+this+\" unsent is \"+_unsent+\" sent is \"+_sentPackets, new Exception(\"error\"));\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t_unsent.addLast(packetNo);\n\t\t\t\t\t\t\ttimeAllSent = -1;\n\t\t\t\t\t\t\t_senderThread.schedule();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tpublic void receiveAborted(int reason, String description) {\n\t\t\t\t\t\tonAborted(reason, description);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\t_senderThread.schedule();\n\t\t\t\n\t\t\tmfAllReceived = MessageFilter.create().setType(DMT.allReceived).setField(DMT.UID, _uid).setSource(_destination).setNoTimeout();\n\t\t\tmfSendAborted = MessageFilter.create().setType(DMT.sendAborted).setField(DMT.UID, _uid).setSource(_destination).setNoTimeout();\n\t\t\t\n\t\t\ttry {\n\t\t\t\t_usm.addAsyncFilter(mfAllReceived, cbAllReceived, _ctr);\n\t\t\t\t_usm.addAsyncFilter(mfSendAborted, cbSendAborted, _ctr);\n\t\t\t} catch (DisconnectedException e) {\n\t\t\t\tonDisconnect();\n\t\t\t}\n\t\t\t\n\t\t} catch (AbortedException e) {\n\t\t\tonAborted(_prb._abortReason, _prb._abortDescription);\n\t\t}\n\t}", "void blockUntilFreeSlotForMessage() throws InterruptedException {\n lock.lockInterruptibly();\n try {\n while (messageQueue.size() == messageCapacity) {\n messageQueueNotFull.await();\n }\n } finally {\n lock.unlock();\n }\n }", "public MessageSelectingQueueChannel(BlockingQueue<Message<?>> queue) {\n super(queue);\n \n this.queue = queue;\n }", "@Override\n\tpublic void addToQueue() {\n\t}", "@Override\n public synchronized void push(String queueName, QueueMessage message) throws QueueFullException {\n if(this.itemsInQueue == this.ringBufferQueue.length) {\n throw new QueueFullException(\"The queue is full\");\n }\n\n int pushLocation = this.pushQueueLocation;\n boolean search = true;\n\n // Find the first free space starting from the last location\n while(search) {\n if(this.ringBufferQueue[pushLocation] == null) {\n search = false;\n }\n else {\n pushLocation = this.incrementPosition(pushLocation);\n }\n }\n\n message.setQueueLocation(pushLocation);\n this.ringBufferQueue[pushLocation] = message;\n\n // Move the next push location to where we inserted as anything before is filled\n this.pushQueueLocation = this.incrementPosition(pushLocation);\n this.itemsInQueue++;\n }", "private void putOneQueue(BlockingQueue q, List buffer) throws InterruptedException {\n q.put(buffer);\n// System.err.println(Thread.currentThread().getName() + \"[MC] puts \" + buffer.size() + \" on \" + q.hashCode() + \" done\");\n// System.err.println(Thread.currentThread().getName() + \"[MC] puts \" + buffer.size() + \" on \" + q.hashCode() + \" first record \" + buffer.get(0));\n }", "public void queueMessage(Message message) {\r\n\t\tsynchronized (this.messages) {\r\n\t\t\tif (this.sendMessages)\r\n\t\t\t\tthis.messages.add(message);\r\n\t\t}\r\n\t}", "Message sendAndWait();", "public void putMessageMinerChannel(Message message) {\n\t\ttry{\n\t\t\tchann2.put(message);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void putMessageMinerChannel(Message message) {\n\t\t\n\t\ttry {\n\t\t\t//se pune mmesajul in buffer\n\t\t\tbufferMinerChannel.put(message);\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t\n\t}", "void notifyBlockComplete(MessageSnapshot snapshot);", "public synchronized void available (A_MessageThread aMessageThread)\n\t{\n\t\tif (!aMessageThread.isQueued ())\n\t\t{\n\t\t\tthreads.add (aMessageThread);\n\t\t\taMessageThread.setQueued (true);\n\t\t}\n\t\t\n\t\tif (messages.size () > 0)\n\t\t{\n\t\t\tpostMessageToThread (messages.remove ());\n\t\t}\n\t}", "private void enterToRunwayQueue() {\n\t\tqueue.insert(this);\n\t}", "protected abstract long waitOnQueue();", "private static void handleReceivedMessage(){\r\n\t\t// checks if the arrayList with the received blockNumbers contains the last received blockNumber\r\n\t\tif (!receivedBlockNumbers.contains(actualReceivedBlockNumber)){\r\n\t\t\t// if the arrayList with the BlockNumbers of the received messages does not contain the current received Message (blocknumber), the blocknumber will be added to the array\r\n\t\t\treceivedBlockNumbers.add(actualReceivedBlockNumber);\r\n\t\t\t// only messages which were't received yet will be added to the data output stream\r\n\t\t\ttry {\r\n\t\t\t\tdos.write(incomingPacket.getData(), 4, incomingPacket.getLength() - 4);\r\n\t\t\t\t// System.out.println(\"CLIENT: Block with the Blocknumber (\" + actualReceivedBlockNumber + \") was added to the DataOutputStream\");\t\r\n\t\t\t\tblockNumberExpected++;\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\t// ERROR NUMBER 6 - File already exists\r\n\t\t\terrorNumber = 6;\r\n\t\t\tmessage.sendErrorMessage(errorNumber, \"A message with the same blocknumber was already received and will therefore be discarded.\", sendData, ipAddress, SERVER_PORT, clientSocket);\t\r\n\r\n\t\t}\t\r\n\t}", "public void joinQueue(Passenger newPassenger){ \t\n \t//find the shortest queue\n \tLinkedList<Passenger> shortest = queues.get(0);\n \t\n \tfor(LinkedList<Passenger> queue : queues) {\n \t\tif(queue.size() < shortest.size())\n \t \tshortest = queue;\n \t}\n \t\n \tsynchronized(shortest) {\n\t \tshortest.add(newPassenger);\n\t \tshortest.notifyAll();\n\t \t\n \t}\n \t\n \t//notify security officer and CheckInHandler that new passenger has been added\n \tsynchronized(this) {\n \t\tthis.notifyAll();\n \t}\n \t\n \tnotifyObservers();\n }", "private void sendInternal(Payload payload) {\n synchronized (internalLock) {\n outBuffer.addLast(payload);\n pendingMessages = true;\n internalLock.notify();\n }\n }", "public int queue() \n { return waiting; }", "public void addToMessageQueue(String message)\r\n {\r\n messageQueue.appendText(message + \"...\" + \"\\n\");\r\n }", "String addReceiveQueue();", "public void sendBack(SelectionKey key, String message) {\r\n\t\tsocketChannel = (SocketChannel) key.channel(); \r\n\t\tmessage += \"\\r\\n\";\r\n\t\tbuffer = CharBuffer.wrap(message);\r\n\t\twhile (buffer.hasRemaining()) {\r\n\t\t\ttry {\r\n\t\t\t\tsocketChannel.write(Charset.defaultCharset().encode(buffer));\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\tLong x = System.nanoTime();\r\n\t\tserviceTime = x - pollTime;\r\n\t\tresponseTime = x - currentJob.queueEntranceTime;\r\n\t\ttimeInSystem = x - currentJob.timeOfArrival;\r\n\t\t\r\n\t\ttimes.add(myNumber + \"\\t\" + type + \"\\t\" + queueTime + \"\\t\" + workerTime +\"\\t\" + processingTime +\"\\t\" + serviceTime +\"\\t\" + responseTime +\"\\t\" + timeInSystem );\r\n\t\tnumOfRequests.incrementAndGet();\r\n\t\tmyNumOfRequests++;\r\n\t}", "public void run() {\r\n while(true) { // outer loop\r\n if(first) // we already have the queue CAS acquired\r\n first=false;\r\n else {\r\n if(!queue.acquire())\r\n return;\r\n }\r\n\r\n try {\r\n Message msg_to_deliver;\r\n while((msg_to_deliver=queue.remove()) != null) { // inner loop\r\n try {\r\n up_prot.up(new Event(Event.MSG, msg_to_deliver));\r\n }\r\n catch(Throwable t) {\r\n log.error(\"couldn't deliver message \" + msg_to_deliver, t);\r\n }\r\n }\r\n }\r\n finally {\r\n queue.release();\r\n }\r\n\r\n // although ConcurrentLinkedQueue.size() iterates through the list, this is not costly,\r\n // as at this point, the queue is almost always empty, or has only a few elements\r\n if(queue.size() == 0) // prevents a concurrent add() (which returned) to leave a dangling message in the queue\r\n break;\r\n }\r\n }", "@Override\n\tpublic void channelActive(ChannelHandlerContext ctx) throws Exception {\n\t\tctx.writeAndFlush(firstMessage);\n\t}", "private int consumeElement(int index) throws InterruptedException {\n\t while (sharedBuffer.isEmpty()) {\r\n\t synchronized (sharedBuffer) {\r\n\t \tString msg=\"Queue is empty \" + Thread.currentThread().getName()\r\n + \" is waiting , size: \" + sharedBuffer.size();\r\n\t \t\r\n\t // \t System.out.println(msg);\r\n\t\t writeLn(msg);\r\n\r\n\t sharedBuffer.wait();\r\n\t \r\n\t }\r\n\t }\r\n\r\n\t // Consume data from Buffer and Notify Producer that Data has been consumed from Buffer\r\n\t synchronized (sharedBuffer) {\r\n\t \tsharedBuffer.notifyAll();\r\n\t \t\r\n\t return (Integer) sharedBuffer.poll();\r\n\t }\r\n\t }", "public void sendAsyncMessage(String to, Message message) {\r\n\r\n BlockingQueue<Message> asyncQueue = getAsyncQueue(to);\r\n boolean success = asyncQueue.offer(message);\r\n if (!success)\r\n throw new RuntimeException(\"AsyncQueue has not any more space to receive the new item.\");\r\n }", "private void pushBeaconMessage(BeaconMessage beaconMessage) {\n if (messageQueue.size() >= maximumSize) {\r\n return;\r\n }\r\n // Adding the beacon messages is synchronized as it is typical for producer consumer scenarios.\r\n synchronized(this.messageQueue) {\r\n this.messageQueue.add(beaconMessage);\r\n // Wake up all threads that are waiting for incoming messages.\r\n this.messageQueue.notifyAll();\r\n }\r\n }", "public boolean addMessageToBufferingTracker(Slot slot, AndesMessageMetadata andesMessageMetadata) {\n long messageID = andesMessageMetadata.getMessageID();\n boolean isOKToBuffer;\n if(log.isDebugEnabled()) {\n log.debug(\"Buffering message id = \" + messageID + \" slot = \" + slot.toString());\n }\n ConcurrentHashMap<Long, MsgData> messagesOfSlot = messageBufferingTracker.get(slot);\n if (messagesOfSlot == null) {\n messagesOfSlot = new ConcurrentHashMap<Long, MsgData>();\n messageBufferingTracker.put(slot, messagesOfSlot);\n }\n MsgData trackingData = messagesOfSlot.get(messageID);\n if (trackingData == null) {\n trackingData = new MsgData(messageID, slot, false,\n andesMessageMetadata.getDestination(),\n System.currentTimeMillis(), andesMessageMetadata.getExpirationTime(),\n 0, null, 0,MessageStatus.Buffered);\n msgId2MsgData.put(messageID, trackingData);\n messagesOfSlot.put(messageID, msgId2MsgData.get(messageID));\n isOKToBuffer = true;\n } else {\n log.debug(\"Buffering rejected message id = \" + messageID);\n isOKToBuffer = false;\n }\n return isOKToBuffer;\n }", "public synchronized void enqueue(T thing) {\r\n\t\twhile (queue.size()==maxSize){\r\n\t\t\ttry{\r\n\t\t\t\tthis.wait();\r\n\t\t\t} catch(InterruptedException e){\r\n\t\t\t\tSystem.out.println(\"Interruption during enqueue\");\r\n\t\t\t}\r\n\t\t}\r\n\t\tqueue.addLast(thing);\r\n\t\tthis.notifyAll();\r\n\t}", "@Override\n public void finishMessageSending() {\n for (int i = 0; i < fragNum; ++i) {\n long bytesWriten = cacheOut[i].bytesWriten();\n cacheOut[i].finishSetting();\n cacheOut[i].writeLong(0, bytesWriten - SIZE_OF_LONG);\n\n if (bytesWriten == SIZE_OF_LONG) {\n logger.debug(\n \"[Finish msg] sending skip msg from {} -> {}, since msg size: {}\",\n fragId,\n i,\n bytesWriten);\n continue;\n }\n if (i == fragId) {\n nextIncomingMessageStore.digest(cacheOut[i].getVector());\n logger.info(\n \"In final step, Frag [{}] digest msg to self of size: {}\",\n fragId,\n bytesWriten);\n } else {\n grapeMessager.sendToFragment(i, cacheOut[i].getVector());\n logger.info(\n \"In final step, Frag [{}] send msg to [{}] of size: {}\",\n fragId,\n i,\n bytesWriten);\n }\n }\n // if (maxSuperStep > 0) {\n // grapeMessager.ForceContinue();\n // maxSuperStep -= 1;\n // }\n\n // logger.debug(\"[Unused res] {}\", unused);\n // logger.debug(\"adaptor hasNext {}, grape hasNext{}\", adaptorHasNext, grapeHasNext);\n // logger.debug(\"adaptor next {}, grape next {}\", adaptorNext, grapeNext);\n // logger.debug(\"adaptor neighbor {}, grape neighbor {}\", adaptorNeighbor,\n // grapeNeighbor);\n }", "@Override\n\tpublic void visit(SendBlock sb) {\n\t\tSystem.out.println(\"SendBlock reću\");\n\t\tbyte[] body = sb.getBody();\n\t\tbyte[] indexB = new byte[4], beginB = new byte[4];\n\t\tTorrent torrent = ph.getTorrent();\n\t\tint index = 0, begin = 0;\n\t\tbyte[] block = new byte[sb.length - 9];\n\n\t\tindexB = Arrays.copyOfRange(body, 0, 4);\n\t\tindex = byteArrayToInt(indexB);\n\n\t\tbeginB = Arrays.copyOfRange(body, 4, 8);\n\t\tbegin = byteArrayToInt(beginB);\n\n\t\tblock = Arrays.copyOfRange(body, 8, body.length);\n\n\t\tPiece piece = torrent.getPieces().get(index);\n\t\tpiece.feed(begin, block);\n\t\tSystem.out.println(\"piece fed\");\n\t\tif (piece.getChecked()) {\n\t\t\tHave h = new Have(indexB);\n\t\t\tthis.ph.addMessageQueue(h);\n\t\t\tSystem.out.println(\"have envoye, block bien reću\");\n\t\t}\n\t}", "private void sendMessage()\n\t{\n\t\tfinal String message = messageTextArea.getText(); \n\t\tif(message.length() == 0)\n\t\t{\n\t\t\treturn;\n\t\t}\n\t\tmessageTextArea.setText(\"\");\n\t\ttry\n\t\t{\n\t\t\teventsBlockingQueue.put(new MessageEvent(message));\n\t\t}\n\t\tcatch (final InterruptedException e1)\n\t\t{\n\t\t}\n\t}", "private void sendQueue() {\r\n firePropertyChange(\"boardQueue\", null, myBoardQueue);\r\n firePropertyChange(\"scaleQueue\", null, myScaleDialogQueue);\r\n firePropertyChange(\"gui\", null, this);\r\n }", "public void newQueue(){\r\n\t\tgenerateQueue();\r\n\t\trefreshLeft = true;\r\n\t}", "void addToQueue(WebhookMessage msg);", "@Override\n public void send(Message message) {\n\n expensiveResource.addToResourcesQueue(message);\n expensiveResource.processNextMessage();\n\n }", "private void AsyncPush(String topic){\n\t\t\t\t \t\n\t \t/**\n\t \t * output a map, delete existed items\n\t \t */\n\t \t//Map<Key, Integer> deduplicatedBuff = mergeDuplicatedItemsAndDelte(buff);\n\t \t\n\t \t//not in, create, delay\n\t \tif(!producerMap.containsKey(topic)){\n\t \t\ttry {\n\t\t\t\t\t\t\tCreateProducer(topic,LogicController.batchMessagesMaxMessagesPerBatch);\n\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t} catch (ExecutionException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\t \t\t \n\t \t}\n\t \tlog.info(\"#publish\"+topic+\", \"+buffMap.size());\n\t \tProducer<byte[]> producer = producerMap.get(topic);\n\t \t/**\n\t \t * init set, copy to hash set\n\t \t */\n\t \t//Set<Key> Keys = Sets.newConcurrentHashSet(buffMap.keySet());\n\t \t\n\t \t \n\t \tfor (Key key : buffMap.keySet()){\n\t \t\t \n\t \t\t //if(buffMap.containsKey(key)){\n\t \t\t \n\t \t\t \n\t \t\t if(buffMap.containsKey(key)){\n\t \t\t\t Integer val = buffMap.get(key);\n\t \t\t\t //clear,skip\n\t \t\t\t if(val<=0){buffMap.remove(key);continue;}\n\t \t\t\t //concenate\n\t \t\t\t byte[] out = createKVByte(key,val);\n\t \t\t\t \n\t \t\t\t//get producer\n\t\t\t \t\t\t \n\t\t\t \t\t\t //byte[] tempTable = new byte[](buffMap);\n\t\t producer.sendAsync(out).thenRun(() -> {\n\t\t\t messagesSent.increment();\n\t\t\t bytesSent.add(out.length);\n\t\t\t //update\n\t\t\t TopicMap.replace(topic, TopicMap.get(topic)+out.length);\t\n\t\t\t \n\t\t\t //delete\n\t\t\t rescaleBufferMap(buffMap,key,val);\n\t\t\t \n\t\t\t //CheckNumberPacketsEnoughEndMessageAndSend(topic);\n\t\t\t //buffMap.remove(key);\n\t\t\t //remove from the set\n\t\t\t //ier.remove();\n\t\t\t \t\t \t\t \n\t\t\t }).exceptionally(ex -> {\n\t\t\t log.warn(\"Write error on message\", ex);\n\t\t\t //System.exit(-1);\n\t\t\t return null;\n\t\t\t });\n\t \t\t }\n\t \t\t }\n\t \t\t \n\t \t }", "public void enqueue ()\n {\n count++;\n questionList.add(newQuestion);\n //System.out.println(\"Question #\"+ totNumQ + \" is added to the queue.\");\n }", "protected int putMessage(Message message) throws InterruptedException {\n log.trace(\"MessageListenerImpl.putMessage() start ...\");\n return addMessage(message);\n }", "public void onQueue();", "public void putMessageWizardChannel(Message message) {\n\t\tif(!reentrantlock.isHeldByCurrentThread())\n\t\t\treentrantlock.lock();\n\t\t\n\t\ttry{\n\t\t\t\tchann1.put(message);\n\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t}\n\n\t\tif(message.getData().equals(\"END\")&&message.getCurrentRoom()==-1)\n\t\t{\n\t\t\treentrantlock.unlock();\n\t\t}\n\t}", "private void addMessageToUI (Message message) {\n if (message == null) {\n return;\n }\n\n //find the correct position based on timestamp\n int index = chatMessages.size() - 1;\n while (index >= 0 && message.getTimestamp() < chatMessages.get(index).getTimestamp()) {\n index--;\n }\n\n //update inerted message show time/sender flags\n Message lastMsg = index >= 0 ? chatMessages.get(index) : null;\n message.showMessageTime = lastMsg == null || message.getTimestamp() - lastMsg.getTimestamp() > Message.GROUP_TIME_THRESHOLD;\n message.showMessageSender = lastMsg == null || message.showMessageTime || !message.getSenderId().equals(lastMsg.getSenderId());\n chatMessages.add(index + 1, message);\n chatRoomAdapter.notifyItemInserted(index + 1);\n\n //upate next message show time/sender flags\n Message nextMsg = index + 2 < chatMessages.size() ? chatMessages.get(index + 2) : null;\n if (nextMsg != null) {\n boolean nextMsgShowMsgTime = nextMsg.getTimestamp() - message.getTimestamp() > Message.GROUP_TIME_THRESHOLD;\n boolean nextMsgShowMsgSender = nextMsgShowMsgTime || !nextMsg.getSenderId().equals(message.getSenderId());\n if (nextMsgShowMsgTime != nextMsg.showMessageTime || nextMsgShowMsgSender != nextMsg.showMessageSender) {\n nextMsg.showMessageTime = nextMsgShowMsgTime;\n nextMsg.showMessageSender = nextMsgShowMsgSender;\n chatRoomAdapter.notifyItemChanged(index + 2);\n }\n }\n\n chatLayoutManager.scrollToPosition(chatMessages.size() - 1);\n }", "private void send(byte[] message)\n\t\t\tthrows IOException\n\t{\n\t\tchannel.basicPublish(BUNGEECORD_QUEUE, \"\", null, message);\n\t}", "private void enqueue(E x) {\n final Object[] items = this.items;\n items[putIndex] = x;\n if (++putIndex == items.length) putIndex = 0;\n count++;\n notEmpty.signal();\n }", "public void requeue() {\n\t\tenqueue(queue.removeFirst());\n\t}", "public void enqueue(String message) {\n\t\tqueue.add (message);\n\t}", "private void sendMessages(Queue<Message<M>> sendQueue) {\n while (!sendQueue.isEmpty()) {\n context.sendMessage(sendQueue.poll());\n numMessageSent++;\n }\n }", "@Override\n\tprotected void doAction(Object message) {\n\t\tlogger.info(\"File Scanner Fetch message Name -->:\"+message.toString());\n\t\ttry {\n\t\t\tFileParser.queue.put(message);\n\t\t} catch (InterruptedException e) {\n\t\t\tlogger.error(\"Error on add message to Parser\");\n\t\t}\n\t}", "private void sendQueueToWear() {\n new APITask(new APICallback() {\n @Override\n public void r(String result) {\n try {\n JSONArray normalOrderQueue = new JSONObject(result).getJSONArray(\"queue\");\n\n for (int i = 0; i < normalOrderQueue.length(); i++) {\n if (gettingHelp(normalOrderQueue.getJSONObject(i)))\n if (mAdapter.helpedByMe(normalOrderQueue.getJSONObject(i))) {\n JSONObject attendedUser = normalOrderQueue.getJSONObject(i);\n normalOrderQueue = new JSONArray();\n normalOrderQueue.put(attendedUser);\n break;\n } else {\n normalOrderQueue.remove(i);\n i--;\n }\n }\n\n String queue = normalOrderQueue.toString();\n\n PutDataMapRequest putDataMapReq = PutDataMapRequest.create(\"/stayawhile/queue\");\n putDataMapReq.getDataMap().putString(QUEUE_KEY, queue);\n PutDataRequest putDataReq = putDataMapReq.asPutDataRequest();\n putDataReq.setUrgent();\n PendingResult<DataApi.DataItemResult> pendingResult =\n Wearable.DataApi.putDataItem(mGoogleApiClient, putDataReq);\n }\n catch (JSONException e) {\n e.printStackTrace();\n }\n }\n }).execute(\"method\", \"queue/\" + Uri.encode(mQueueName));\n }", "private void send(Message outgoing, ByteBuffer buffer, SocketChannel channel, boolean debug) throws IOException {\n\t\tif (debug)\n\t\t\tSystem.out.println(\"Worker Thread \" + threadID + \" sending new message: \" + outgoing.toString());\n\t\tbuffer = ByteBuffer.wrap(Serializer.serialize(outgoing));\n\t\tchannel.write(buffer);\n\t\tif (debug)\n\t\t\tSystem.out.println(\"Worker Thread \" + threadID + \"sent message\");\n\t}", "public void addNextMessage(String message){\n synchronized (ChatMessage){\n hasMessages = true;\n ChatMessage.push(message);\n }\n }", "private void addFromQueue()\n\t{\n\t\twhile( humanQueue.size()>0 )\n\t\t\thumans.add(humanQueue.remove(0));\n\t\twhile( zombieQueue.size()>0 )\n\t\t\tzombies.add(zombieQueue.remove(0));\n\t}", "public void put(_Producteur arg0, Message arg1) throws Exception,\n\tInterruptedException {\n\t\tnotFull.p();\n\t\tmutex.p();\n\n\t\tif(!((Producteur) arg0).actif()){\n\t\t\tTestProdCons.prodActif--;\n\t\t}\n\n\t\tbuffer[in] = arg1;\n\t\tin = (in+1)%size;\n\t\tnbmsg++;\n\n\t\tmutex.signal();\n\t\tnotEmpty.signal();\n\t}", "public void insertMsg (SimpleMessage msg) {\t\t\n\t\trouter.add(msg);\n\t\tSimpleMessage peek = router.peek();\n\t\tif ((double)peek.size/1000 <= maxUpload - totSize){\n\t\t\ttotSize+= sendMsg()/1000;\n\t\t}\n\t}", "private void workOnQueue() {\n }", "private void receiveMessage() throws InterruptedException {\n Map<Integer, Integer> transTimeMap = new HashMap<>();\n for (int i = 0; i < incomingLinks.size(); i++) {\n int transTime= new Random().nextInt(11);\n transTimeMap.put(i, transTime);\n }\n\n // Sort the random transmission time for the message in the channel.\n List<Map.Entry<Integer, Integer>> timeInfo = new ArrayList<>(transTimeMap.entrySet());\n timeInfo.sort((t1, t2) -> t1.getValue() - t2.getValue());\n\n int time = 0;\n for(int i = 0; i < timeInfo.size(); i++) {\n int index = timeInfo.get(i).getKey();\n int value = timeInfo.get(i).getValue();\n\n // After transmission time units, receive the message.\n Thread.sleep((value - time) * timeUnit);\n time += value - time;\n Message message = incomingLinks.get(index).receive();\n\n\n if (message != null) {\n String type = message.type;\n if (type.equals(\"init\")) {\n // If the process receives a larger id, it let the sender as its parent and broadcast this new\n // max id to all its neighbor except for its new parent.\n if (this.maxId < message.maxId) {\n this.maxId = message.maxId;\n this.parent = message.uid;\n this.listOfChild.clear();\n broadcast(new Message(this.uid, this.maxId, \"init\"), this.parent);\n numOfAck = 0;\n //If the process receives a smaller id, it will reply the sender a nack message.\n } else {\n sendTo(new Message(this.uid, message.maxId, \"nack\"), message.uid);\n }\n } else if (type.equals(\"ack\")) {\n // After receiving the ack message, it adds the number of ack and let the sender as its child.\n if (this.maxId == message.maxId) {\n numOfAck++;\n listOfChild.add(message.uid);\n }\n } else if (type.equals(\"nack\")) {\n // After receiving the nack message, it adds the number of ack.\n if (this.maxId == message.maxId) {\n numOfAck++;\n }\n }\n }\n }\n checkResult();\n }", "private void startQueuedItemsSender() {\n if (ctrlSenderTimerRunning)\n return;\n\n ctrlSenderTimer = new Timer(true);\n ctrlSenderTimer.schedule(new TimerTask() {\n @Override\n public void run() {\n JSONObject item = dataSource.getNextTxClient2Server();\n Log.i(TAG, \"Client2Server sender executed, assembling JSON and sending to Server...\");\n\n try {\n // no more? stop timer\n if (!item.has(\"moreInQueue\") || !item.getBoolean(\"moreInQueue\")) {\n stopQueuedItemsSender();\n }\n\n if (!item.getBoolean(\"fetched\")) {\n Log.w(TAG, \" ...warning, nothing fetched from BD!\");\n stopQueuedItemsSender();\n return;\n }\n\n CtrlMessage msg = new CtrlMessage(item.getString(\"jsonPackage\"));\n msg.setTXsender(item.getInt(\"TXclient\"));\n\n sendSocket(msg.buildMessage());\n }\n catch (JSONException e) {\n e.printStackTrace();\n }\n }\n }, 15, 85);\n ctrlSenderTimerRunning = true;\n }", "public void addReceived() {\n this.indexExpected++;\n }", "public void addMessage() {\n }", "public synchronized boolean send( Message message )\n {\n if ( debug_receive )\n {\n System.out.println( \"\\n**** RECEIVED MESSAGE **** : \");\n System.out.println( \"QUEUE: \" + message.getName() );\n System.out.println( \"VALUE: \" + message.getValue() );\n System.out.println();\n }\n\n if ( message == null )\n {\n System.out.println(\"Warning: null message in \" \n + center_name + \" MessageCenter.receive()\");\n return false;\n }\n\n Object name = message.getName();\n if ( name == null )\n {\n System.out.println(\"Warning: null message name in \"\n + center_name + \" MessageCenter.receive()\");\n return false;\n }\n\n synchronized(lists_lock)\n {\n Vector<Message> list = message_table.get( name );\n if ( list == null )\n {\n list = new Vector<Message>();\n message_table.put( name, list );\n }\n\n if ( message.replace() )\n list.clear();\n\n message.setTag( tag_count++ ); // record the tag count, to serve as\n // tie breaker when sorting\n list.add( message );\n }\n\n return true;\n }", "public synchronized void beginWrite() {\n\t\tSystem.out.println(\"WRITER BEGIN: \" + Thread.currentThread().getId());\t\n\t\tint writeTurn = currentTurn;\n\t\tcurrentTurn++;\n\n\t\twhile(writeTurn != nextTurn || numReaders > 0 || numWriters > 0 ){ \n\t\t\t/********WAIT CALL*********/\n\t\t\ttry {\n//\t\t\tSystem.out.println(\"WRITER BLOCKED: \" + Thread.currentThread().getId());\t\n\t\t\t\tthis.wait();\n//\t\t\tSystem.out.println(\"WRITER UNBLOCKED: \" + Thread.currentThread().getId());\t\n\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t/**************************/\n\t\t}\n\t\t\n\t\t//Only increment when the writer is not blocked\n\t\t// (it is at front of queue)\n\t\tnumWriters++;\n\n\t}", "public void push(E e) throws InterruptedException {\n while (!isFree) {\n synchronized (this) {\n wait();\n }\n }\n\n synchronized (this) {\n if (queue != null) {\n queue.add(e);\n }\n isFree = true;\n notifyAll();\n }\n }", "private void growQueue() {\n int newSize = (int)(QUEUE.length * 1.5f);\n \n Logger.log(\"INFO\", \"Queue is full, growing to new size: \" + Integer.toString(newSize));\n \n Object[] newQueue = new Object[newSize];\n lockQueue();\n copyQueue(newQueue);\n unlockQueue();\n }", "private synchronized void flushMessageQueue() {\n\t\tif(peers.size() > 0) {\n\t\t\twhile(!noPeersMessageQueue.isEmpty()) {\n\t\t\t\tpropagateToAllPeers(noPeersMessageQueue.poll());\n\t\t\t}\n\t\t}\n\t}", "public synchronized boolean addKeepingLast(Cincamimis message) throws QueueException, InterruptedException\r\n {\r\n if(message==null) return false;\r\n if(measurementQueue==null) throw new QueueException(\"CINCAMIMIS Queue not found\");\r\n \r\n boolean rdo=measurementQueue.offer(message);\r\n \r\n while(!rdo)\r\n {\r\n measurementQueue.take();\r\n rdo=measurementQueue.offer(message);\r\n }\r\n \r\n if(rdo)\r\n {\r\n this.notifyObservers();\r\n return true;\r\n }\r\n \r\n return false;\r\n }", "public void addNotifyMessage(NotifyMessage msg) {\n messageQueue.offer(msg);\n }", "@Override\n public boolean messagePending() {\n return commReceiver.messagePending();\n }", "public void add(Message aMessage) \n { \n elements[tail] = aMessage; \n tail = (tail + 1) % elements.length; \n count++; \n }", "void sendMessage(long queueId, byte[] content, int prio) throws IOException, MlmqException;", "protected void addMessage(IDBSMessage pMessage){\n\t\twMessages.add(pMessage);\n\t}", "void onInterested(boolean state)\n {\n peerInterested = state;\n\n if (!peerInterested) {\n // remove all piece if enqueued,\n // most likely will not happen\n for (int i = sendQueue.size() - 1; 0 <= i; i--) {\n StdPeerMessage pm = sendQueue.get(i);\n if (pm.type == StdPeerMessage.PIECE) {\n sendQueue.remove(i);\n TorrentStorage.Block block = (TorrentStorage.Block) pm.params;\n block.release();\n pmCache.release(pm);\n }\n }\n }\n }", "@Override\n void enqueueBlockRequest(int index, int position, int length) {\n enqueue(pmCache.request(index, position, length));\n }", "public synchronized void add(Integer item) {\r\n while (true) {\r\n if (buffer.size() == SIZE) {\r\n try {\r\n wait();\r\n } catch (InterruptedException e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n buffer.add(item);\r\n notifyAll();\r\n return;\r\n }\r\n }", "void onMessageProcessingSuccess(String internalQueueName);", "protected void onQueued() {}", "public void appendBuffer(ByteArrayOutputStream qlikTableBaos) {\n synchronized (this) {\n totalOps++;\n sendBuffer(qlikTableBaos);\n /*\n try {\n qlikTableBaos.writeTo(baos);\n if (baos.size() >= maxBufferSize) {\n sendBuffer(baos);\n resetBuffer();\n }\n } catch (IOException e) {\n LOG.error(\"error adding message\", e);\n }\n */\n }\n }", "private boolean enqueueWrite(ChannelHandlerContext ctx, HttpObject msg, ChannelPromise promise) {\n if (ctx.channel().isWritable() && queuedWrites.isEmpty()) {\n ctx.write(msg, promise);\n return true;\n } else {\n queuedWrites.add(new WriteOperation(msg, promise));\n return false;\n }\n }", "protected final void send(Event event) {\n logger.debug(\"new event: {}\", event);\n Stats.received.incrementAndGet();\n if(! outQueue.offer(event)) {\n Stats.dropped.incrementAndGet();\n logger.error(\"send failed for {}, destination blocked\", event);\n }\n }", "synchronized void putBlock(ICBlock block) {\n mQueue.add(block);\n }", "@Override\n\tpublic void onSendChatDone(byte arg0) {\n\t\t\n\t}", "@Override\n\tpublic void enqueue(String msgid, EmailAddress recipient) throws MessageEngineException {\n\t\t\n\t}", "protected byte[] getNextMessage(){\n if (messages.size() > 0) {\n byte message[] = messages.get(0).clone();\n messages.remove(0);\n return message;\n } else {\n return null;\n }\n \n }" ]
[ "0.6628951", "0.6176206", "0.6124395", "0.6059437", "0.6057704", "0.5958921", "0.5946561", "0.5914167", "0.58844894", "0.5864838", "0.58373576", "0.58129585", "0.574333", "0.57304054", "0.56753904", "0.5638795", "0.5608065", "0.5601403", "0.5600865", "0.5585989", "0.5583834", "0.55766046", "0.5526167", "0.5520907", "0.5499228", "0.54854083", "0.5476393", "0.5466202", "0.5436476", "0.5429336", "0.54254323", "0.5424783", "0.5421441", "0.5411499", "0.5383366", "0.5372201", "0.53614354", "0.5345747", "0.5341661", "0.53410006", "0.53195226", "0.5312628", "0.53057045", "0.52980477", "0.5297593", "0.5270911", "0.52674735", "0.5249025", "0.5248109", "0.5239219", "0.52091354", "0.5201378", "0.51804346", "0.51656365", "0.5161004", "0.5160556", "0.5156609", "0.5155792", "0.5155775", "0.5154451", "0.51473206", "0.51469475", "0.51414627", "0.51335275", "0.51314193", "0.513054", "0.51268077", "0.51264757", "0.5120416", "0.5111239", "0.51066875", "0.5104869", "0.51007736", "0.5081007", "0.50657266", "0.50646687", "0.5058031", "0.50472474", "0.5047111", "0.5046905", "0.5046563", "0.50397456", "0.50381076", "0.5034559", "0.5031908", "0.5030678", "0.50278294", "0.5017928", "0.5012495", "0.5012206", "0.5003044", "0.5000262", "0.49926537", "0.4991212", "0.49903816", "0.49733466", "0.49714544", "0.49684614", "0.4967116", "0.49636185" ]
0.64876014
1
NOTE: method is for internal use and debug only, doesn't use any synchronization
int getActiveBlockRequestsNumber() { return blockRequests.size(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}", "public final void mo51373a() {\n }", "private static byte[] m2539e(Context context) {\n Throwable th;\n int i = 0;\n ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n byte[] bArr = new byte[0];\n String a = Log.m2547a(context, Log.f1857e);\n DiskLruCache diskLruCache = null;\n try {\n diskLruCache = DiskLruCache.m2767a(new File(a), 1, 1, 10240);\n File file = new File(a);\n if (file != null && file.exists()) {\n String[] list = file.list();\n int length = list.length;\n while (i < length) {\n String str = list[i];\n if (str.contains(\".0\")) {\n byteArrayOutputStream.write(StatisticsManager.m2535a(diskLruCache, str.split(\"\\\\.\")[0]));\n }\n i++;\n }\n }\n bArr = byteArrayOutputStream.toByteArray();\n if (byteArrayOutputStream != null) {\n try {\n byteArrayOutputStream.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n if (diskLruCache != null) {\n try {\n diskLruCache.close();\n } catch (Throwable th2) {\n th = th2;\n }\n }\n } catch (IOException th3) {\n BasicLogHandler.m2542a(th3, \"StatisticsManager\", \"getContent\");\n if (byteArrayOutputStream != null) {\n try {\n byteArrayOutputStream.close();\n } catch (IOException e2) {\n e2.printStackTrace();\n }\n }\n if (diskLruCache != null) {\n diskLruCache.close();\n }\n } catch (Throwable th4) {\n th3 = th4;\n }\n return bArr;\n th3.printStackTrace();\n return bArr;\n }", "@Override\n\tprotected void interr() {\n\t}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "static com.qiyukf.nimlib.p470f.p471a.C5826a m23369a(android.os.Parcel r4) {\n /*\n com.qiyukf.nimlib.f.a.a r0 = new com.qiyukf.nimlib.f.a.a\n r1 = 0\n r0.m50001init(r1)\n int r2 = r4.readInt()\n r0.f18499a = r2\n int r2 = r4.readInt()\n if (r2 <= 0) goto L_0x001d\n byte[] r2 = r4.createByteArray()\n java.nio.ByteBuffer r2 = java.nio.ByteBuffer.wrap(r2)\n r0.f18501c = r2\n L_0x001d:\n int r2 = r4.readInt()\n r0.f18500b = r2\n int r2 = r4.readInt()\n if (r2 <= 0) goto L_0x0061\n byte[] r4 = r4.createByteArray()\n int r3 = r0.f18500b\n if (r3 <= 0) goto L_0x005c\n int r1 = r0.f18500b\n if (r1 != r2) goto L_0x0049\n java.nio.ByteBuffer r4 = java.nio.ByteBuffer.wrap(r4)\n r0.f18502d = r4\n java.nio.ByteBuffer r4 = r0.f18502d\n r4.position(r2)\n goto L_0x0068\n L_0x0049:\n int r1 = r0.f18500b\n java.nio.ByteBuffer r1 = java.nio.ByteBuffer.allocate(r1)\n r0.f18502d = r1\n java.nio.ByteBuffer r1 = r0.f18502d\n r1.put(r4)\n goto L_0x0068\n L_0x005c:\n java.nio.ByteBuffer r4 = java.nio.ByteBuffer.wrap(r4, r1, r2)\n goto L_0x0065\n L_0x0061:\n java.nio.ByteBuffer r4 = java.nio.ByteBuffer.allocate(r1)\n L_0x0065:\n r0.f18502d = r4\n L_0x0068:\n boolean r4 = m23372b(r0)\n if (r4 == 0) goto L_0x006f\n return r0\n L_0x006f:\n int r4 = r0.f18500b\n if (r4 <= 0) goto L_0x007d\n android.util.SparseArray<com.qiyukf.nimlib.f.a.a> r4 = f18504a\n int r1 = r0.f18499a\n r4.put(r1, r0)\n goto L_0x00a2\n L_0x007d:\n android.util.SparseArray<com.qiyukf.nimlib.f.a.a> r4 = f18504a\n int r1 = r0.f18499a\n java.lang.Object r4 = r4.get(r1)\n com.qiyukf.nimlib.f.a.a r4 = (com.qiyukf.nimlib.p470f.p471a.C5826a) r4\n if (r4 == 0) goto L_0x00a2\n java.nio.ByteBuffer r1 = r4.f18502d\n java.nio.ByteBuffer r0 = r0.f18502d\n r1.put(r0)\n boolean r0 = m23372b(r4)\n if (r0 == 0) goto L_0x00a2\n android.util.SparseArray<com.qiyukf.nimlib.f.a.a> r0 = f18504a\n int r1 = r4.f18499a\n r0.remove(r1)\n return r4\n L_0x00a2:\n r4 = 0\n return r4\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.qiyukf.nimlib.p470f.p471a.C5826a.C5829b.m23369a(android.os.Parcel):com.qiyukf.nimlib.f.a.a\");\n }", "private final void m11968d() {\n synchronized (this.f10173g) {\n for (zzsk a : this.f10174h) {\n a.m11971a();\n }\n }\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t}", "private void c() {\n /*\n r14 = this;\n r12 = android.os.SystemClock.elapsedRealtime();\n r8 = r14.d();\n r0 = r14.t;\n if (r0 == 0) goto L_0x007a;\n L_0x000c:\n r0 = 1;\n r7 = r0;\n L_0x000e:\n r0 = r14.r;\n r0 = r0.a();\n if (r0 != 0) goto L_0x0018;\n L_0x0016:\n if (r7 == 0) goto L_0x007d;\n L_0x0018:\n r0 = 1;\n r10 = r0;\n L_0x001a:\n if (r10 != 0) goto L_0x0095;\n L_0x001c:\n r0 = r14.d;\n r0 = r0.b;\n if (r0 != 0) goto L_0x0028;\n L_0x0022:\n r0 = -1;\n r0 = (r8 > r0 ? 1 : (r8 == r0 ? 0 : -1));\n if (r0 != 0) goto L_0x0032;\n L_0x0028:\n r0 = r14.p;\n r0 = r12 - r0;\n r2 = 2000; // 0x7d0 float:2.803E-42 double:9.88E-321;\n r0 = (r0 > r2 ? 1 : (r0 == r2 ? 0 : -1));\n if (r0 <= 0) goto L_0x0095;\n L_0x0032:\n r14.p = r12;\n r0 = r14.d;\n r1 = r14.f;\n r1 = r1.size();\n r0.a = r1;\n r0 = r14.c;\n r1 = r14.f;\n r2 = r14.o;\n r4 = r14.m;\n r6 = r14.d;\n r0.getChunkOperation(r1, r2, r4, r6);\n r0 = r14.d;\n r0 = r0.a;\n r0 = r14.a(r0);\n r1 = r14.d;\n r1 = r1.b;\n if (r1 != 0) goto L_0x0080;\n L_0x0059:\n r4 = -1;\n L_0x005b:\n r0 = r14.b;\n r2 = r14.m;\n r1 = r14;\n r6 = r10;\n r0 = r0.update(r1, r2, r4, r6);\n if (r7 == 0) goto L_0x0087;\n L_0x0067:\n r0 = r14.v;\n r0 = r12 - r0;\n r2 = r14.u;\n r2 = (long) r2;\n r2 = r14.c(r2);\n r0 = (r0 > r2 ? 1 : (r0 == r2 ? 0 : -1));\n if (r0 < 0) goto L_0x0079;\n L_0x0076:\n r14.e();\n L_0x0079:\n return;\n L_0x007a:\n r0 = 0;\n r7 = r0;\n goto L_0x000e;\n L_0x007d:\n r0 = 0;\n r10 = r0;\n goto L_0x001a;\n L_0x0080:\n if (r0 == 0) goto L_0x0095;\n L_0x0082:\n r4 = r14.d();\n goto L_0x005b;\n L_0x0087:\n r1 = r14.r;\n r1 = r1.a();\n if (r1 != 0) goto L_0x0079;\n L_0x008f:\n if (r0 == 0) goto L_0x0079;\n L_0x0091:\n r14.f();\n goto L_0x0079;\n L_0x0095:\n r4 = r8;\n goto L_0x005b;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.exoplayer.chunk.ChunkSampleSource.c():void\");\n }", "private void getStatus() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void run() {\n\n\t\t\t}", "private void m50366E() {\n }", "@Override\n public void perish() {\n \n }", "private static void iterator() {\n\t\t\r\n\t}", "private synchronized void flushCache() {\n /*\n r6 = this;\n monitor-enter(r6)\n r0 = 0\n java.util.Map<java.lang.String, java.lang.String> r1 = r6.cdY // Catch:{ all -> 0x005a }\n boolean r1 = r1.isEmpty() // Catch:{ all -> 0x005a }\n if (r1 == 0) goto L_0x000c\n monitor-exit(r6)\n return\n L_0x000c:\n r1 = 4\n if (r0 >= r1) goto L_0x0058\n int r1 = r6.cdS // Catch:{ all -> 0x005a }\n r2 = 64\n if (r1 > r2) goto L_0x001e\n int r1 = r6.cdT // Catch:{ all -> 0x005a }\n long r1 = (long) r1 // Catch:{ all -> 0x005a }\n long r3 = r6.cdV // Catch:{ all -> 0x005a }\n int r1 = (r1 > r3 ? 1 : (r1 == r3 ? 0 : -1))\n if (r1 <= 0) goto L_0x0058\n L_0x001e:\n java.util.Map<java.lang.String, java.lang.String> r1 = r6.cdY // Catch:{ all -> 0x005a }\n java.util.Set r1 = r1.entrySet() // Catch:{ all -> 0x005a }\n java.util.Iterator r1 = r1.iterator() // Catch:{ all -> 0x005a }\n java.lang.Object r1 = r1.next() // Catch:{ all -> 0x005a }\n java.util.Map$Entry r1 = (java.util.Map.Entry) r1 // Catch:{ all -> 0x005a }\n java.io.File r2 = new java.io.File // Catch:{ all -> 0x005a }\n java.lang.Object r3 = r1.getValue() // Catch:{ all -> 0x005a }\n java.lang.String r3 = (java.lang.String) r3 // Catch:{ all -> 0x005a }\n r2.<init>(r3) // Catch:{ all -> 0x005a }\n long r2 = r2.length() // Catch:{ all -> 0x005a }\n java.util.Map<java.lang.String, java.lang.String> r4 = r6.cdY // Catch:{ all -> 0x005a }\n java.lang.Object r1 = r1.getKey() // Catch:{ all -> 0x005a }\n r4.remove(r1) // Catch:{ all -> 0x005a }\n java.util.Map<java.lang.String, java.lang.String> r1 = r6.cdY // Catch:{ all -> 0x005a }\n int r1 = r1.size() // Catch:{ all -> 0x005a }\n r6.cdS = r1 // Catch:{ all -> 0x005a }\n int r1 = r6.cdT // Catch:{ all -> 0x005a }\n long r4 = (long) r1 // Catch:{ all -> 0x005a }\n long r4 = r4 - r2\n int r1 = (int) r4 // Catch:{ all -> 0x005a }\n r6.cdT = r1 // Catch:{ all -> 0x005a }\n int r0 = r0 + 1\n goto L_0x000c\n L_0x0058:\n monitor-exit(r6)\n return\n L_0x005a:\n r0 = move-exception\n monitor-exit(r6)\n throw r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.introvd.template.common.bitmapfun.util.DiskLruCache.flushCache():void\");\n }", "@SuppressWarnings(\"unused\")\n private void _read() {\n }", "private void b044904490449щ0449щ() {\n /*\n r7 = this;\n r0 = new rrrrrr.ccrcrc;\n r1 = new java.lang.StringBuilder;\n r1.<init>();\n r2 = r7.bнн043Dннн;\n r2 = com.immersion.aws.analytics.ImmrAnalytics.b044C044C044C044Cьь(r2);\n r2 = r2.getFilesDir();\n r1 = r1.append(r2);\n r2 = java.io.File.separator;\n r1 = r1.append(r2);\n L_0x001b:\n r2 = 1;\n switch(r2) {\n case 0: goto L_0x001b;\n case 1: goto L_0x0024;\n default: goto L_0x001f;\n };\n L_0x001f:\n r2 = 0;\n switch(r2) {\n case 0: goto L_0x0024;\n case 1: goto L_0x001b;\n default: goto L_0x0023;\n };\n L_0x0023:\n goto L_0x001f;\n L_0x0024:\n r2 = \"3HC4C-01.txt\";\n r1 = r1.append(r2);\n r1 = r1.toString();\n r0.<init>(r1);\n r0.load();\n L_0x0034:\n r1 = r0.size();\n if (r1 <= 0) goto L_0x007a;\n L_0x003a:\n r1 = r0.peek();\n r2 = new rrrrrr.rcccrr;\n r2.<init>();\n r3 = r7.bнн043Dннн;\n r3 = com.immersion.aws.analytics.ImmrAnalytics.b044Cь044C044Cьь(r3);\n monitor-enter(r3);\n r4 = r7.bнн043Dннн;\t Catch:{ all -> 0x0074 }\n r4 = com.immersion.aws.analytics.ImmrAnalytics.bь044C044C044Cьь(r4);\t Catch:{ all -> 0x0074 }\n r4 = r4.bЛ041B041BЛ041BЛ;\t Catch:{ all -> 0x0074 }\n r5 = r7.bнн043Dннн;\t Catch:{ all -> 0x0074 }\n r5 = com.immersion.aws.analytics.ImmrAnalytics.bь044C044C044Cьь(r5);\t Catch:{ all -> 0x0074 }\n r5 = r5.b041B041B041BЛ041BЛ;\t Catch:{ all -> 0x0074 }\n r6 = r7.bнн043Dннн;\t Catch:{ all -> 0x0074 }\n r6 = com.immersion.aws.analytics.ImmrAnalytics.bь044C044C044Cьь(r6);\t Catch:{ all -> 0x0074 }\n r6 = r6.bЛЛЛ041B041BЛ;\t Catch:{ all -> 0x0074 }\n monitor-exit(r3);\t Catch:{ all -> 0x0074 }\n r1 = r2.sendHttpRequestFromCache(r4, r5, r6, r1);\n if (r1 == 0) goto L_0x0077;\n L_0x0069:\n if (r4 == 0) goto L_0x0077;\n L_0x006b:\n if (r5 == 0) goto L_0x0077;\n L_0x006d:\n r0.remove();\n r0.save();\n goto L_0x0034;\n L_0x0074:\n r0 = move-exception;\n monitor-exit(r3);\t Catch:{ all -> 0x0074 }\n throw r0;\n L_0x0077:\n r0.save();\n L_0x007a:\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: rrrrrr.cccccr.b044904490449щ0449щ():void\");\n }", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\r\n\tprotected void processFinish() {\n\r\n\t}", "@Override\r\n\tprotected void processFinish() {\n\r\n\t}", "@Override\r\n\tprotected void processFinish() {\n\r\n\t}", "public final void run() {\n /*\n r7 = this;\n r1 = r7.zzasj;\n monitor-enter(r1);\n r0 = r7.zzasi;\t Catch:{ RemoteException -> 0x006e }\n r0 = r0.zzasc;\t Catch:{ RemoteException -> 0x006e }\n if (r0 != 0) goto L_0x0034;\n L_0x000b:\n r0 = r7.zzasi;\t Catch:{ RemoteException -> 0x006e }\n r0 = r0.zzgt();\t Catch:{ RemoteException -> 0x006e }\n r0 = r0.zzjg();\t Catch:{ RemoteException -> 0x006e }\n r2 = \"Failed to get user properties\";\n r3 = r7.zzagj;\t Catch:{ RemoteException -> 0x006e }\n r3 = com.google.android.gms.measurement.internal.zzas.zzbw(r3);\t Catch:{ RemoteException -> 0x006e }\n r4 = r7.zzads;\t Catch:{ RemoteException -> 0x006e }\n r5 = r7.zzadz;\t Catch:{ RemoteException -> 0x006e }\n r0.zzd(r2, r3, r4, r5);\t Catch:{ RemoteException -> 0x006e }\n r0 = r7.zzasj;\t Catch:{ RemoteException -> 0x006e }\n r2 = java.util.Collections.emptyList();\t Catch:{ RemoteException -> 0x006e }\n r0.set(r2);\t Catch:{ RemoteException -> 0x006e }\n r0 = r7.zzasj;\t Catch:{ all -> 0x0059 }\n r0.notify();\t Catch:{ all -> 0x0059 }\n monitor-exit(r1);\t Catch:{ all -> 0x0059 }\n L_0x0033:\n return;\n L_0x0034:\n r2 = r7.zzagj;\t Catch:{ RemoteException -> 0x006e }\n r2 = android.text.TextUtils.isEmpty(r2);\t Catch:{ RemoteException -> 0x006e }\n if (r2 == 0) goto L_0x005c;\n L_0x003c:\n r2 = r7.zzasj;\t Catch:{ RemoteException -> 0x006e }\n r3 = r7.zzads;\t Catch:{ RemoteException -> 0x006e }\n r4 = r7.zzadz;\t Catch:{ RemoteException -> 0x006e }\n r5 = r7.zzaeg;\t Catch:{ RemoteException -> 0x006e }\n r6 = r7.zzaqk;\t Catch:{ RemoteException -> 0x006e }\n r0 = r0.zza(r3, r4, r5, r6);\t Catch:{ RemoteException -> 0x006e }\n r2.set(r0);\t Catch:{ RemoteException -> 0x006e }\n L_0x004d:\n r0 = r7.zzasi;\t Catch:{ RemoteException -> 0x006e }\n r0.zzcy();\t Catch:{ RemoteException -> 0x006e }\n r0 = r7.zzasj;\t Catch:{ all -> 0x0059 }\n r0.notify();\t Catch:{ all -> 0x0059 }\n L_0x0057:\n monitor-exit(r1);\t Catch:{ all -> 0x0059 }\n goto L_0x0033;\n L_0x0059:\n r0 = move-exception;\n monitor-exit(r1);\t Catch:{ all -> 0x0059 }\n throw r0;\n L_0x005c:\n r2 = r7.zzasj;\t Catch:{ RemoteException -> 0x006e }\n r3 = r7.zzagj;\t Catch:{ RemoteException -> 0x006e }\n r4 = r7.zzads;\t Catch:{ RemoteException -> 0x006e }\n r5 = r7.zzadz;\t Catch:{ RemoteException -> 0x006e }\n r6 = r7.zzaeg;\t Catch:{ RemoteException -> 0x006e }\n r0 = r0.zza(r3, r4, r5, r6);\t Catch:{ RemoteException -> 0x006e }\n r2.set(r0);\t Catch:{ RemoteException -> 0x006e }\n goto L_0x004d;\n L_0x006e:\n r0 = move-exception;\n r2 = r7.zzasi;\t Catch:{ all -> 0x0095 }\n r2 = r2.zzgt();\t Catch:{ all -> 0x0095 }\n r2 = r2.zzjg();\t Catch:{ all -> 0x0095 }\n r3 = \"Failed to get user properties\";\n r4 = r7.zzagj;\t Catch:{ all -> 0x0095 }\n r4 = com.google.android.gms.measurement.internal.zzas.zzbw(r4);\t Catch:{ all -> 0x0095 }\n r5 = r7.zzads;\t Catch:{ all -> 0x0095 }\n r2.zzd(r3, r4, r5, r0);\t Catch:{ all -> 0x0095 }\n r0 = r7.zzasj;\t Catch:{ all -> 0x0095 }\n r2 = java.util.Collections.emptyList();\t Catch:{ all -> 0x0095 }\n r0.set(r2);\t Catch:{ all -> 0x0095 }\n r0 = r7.zzasj;\t Catch:{ all -> 0x0059 }\n r0.notify();\t Catch:{ all -> 0x0059 }\n goto L_0x0057;\n L_0x0095:\n r0 = move-exception;\n r2 = r7.zzasj;\t Catch:{ all -> 0x0059 }\n r2.notify();\t Catch:{ all -> 0x0059 }\n throw r0;\t Catch:{ all -> 0x0059 }\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.measurement.internal.zzep.run():void\");\n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "public final void run() {\n /*\n r6 = this;\n r1 = r6.zzapo;\n monitor-enter(r1);\n r0 = r6.zzapn;\t Catch:{ RemoteException -> 0x006b }\n r0 = r0.zzaph;\t Catch:{ RemoteException -> 0x006b }\n if (r0 != 0) goto L_0x0035;\n L_0x000b:\n r0 = r6.zzapn;\t Catch:{ RemoteException -> 0x006b }\n r0 = r0.zzgf();\t Catch:{ RemoteException -> 0x006b }\n r0 = r0.zzis();\t Catch:{ RemoteException -> 0x006b }\n r2 = \"Failed to get conditional properties\";\n r3 = r6.zzant;\t Catch:{ RemoteException -> 0x006b }\n r3 = com.google.android.gms.internal.measurement.zzfh.zzbl(r3);\t Catch:{ RemoteException -> 0x006b }\n r4 = r6.zzanr;\t Catch:{ RemoteException -> 0x006b }\n r5 = r6.zzans;\t Catch:{ RemoteException -> 0x006b }\n r0.zzd(r2, r3, r4, r5);\t Catch:{ RemoteException -> 0x006b }\n r0 = r6.zzapo;\t Catch:{ RemoteException -> 0x006b }\n r2 = java.util.Collections.emptyList();\t Catch:{ RemoteException -> 0x006b }\n r0.set(r2);\t Catch:{ RemoteException -> 0x006b }\n r0 = r6.zzapo;\t Catch:{ all -> 0x0058 }\n r0.notify();\t Catch:{ all -> 0x0058 }\n monitor-exit(r1);\t Catch:{ all -> 0x0058 }\n L_0x0034:\n return;\n L_0x0035:\n r2 = r6.zzant;\t Catch:{ RemoteException -> 0x006b }\n r2 = android.text.TextUtils.isEmpty(r2);\t Catch:{ RemoteException -> 0x006b }\n if (r2 == 0) goto L_0x005b;\n L_0x003d:\n r2 = r6.zzapo;\t Catch:{ RemoteException -> 0x006b }\n r3 = r6.zzanr;\t Catch:{ RemoteException -> 0x006b }\n r4 = r6.zzans;\t Catch:{ RemoteException -> 0x006b }\n r5 = r6.zzano;\t Catch:{ RemoteException -> 0x006b }\n r0 = r0.zza(r3, r4, r5);\t Catch:{ RemoteException -> 0x006b }\n r2.set(r0);\t Catch:{ RemoteException -> 0x006b }\n L_0x004c:\n r0 = r6.zzapn;\t Catch:{ RemoteException -> 0x006b }\n r0.zzcu();\t Catch:{ RemoteException -> 0x006b }\n r0 = r6.zzapo;\t Catch:{ all -> 0x0058 }\n r0.notify();\t Catch:{ all -> 0x0058 }\n L_0x0056:\n monitor-exit(r1);\t Catch:{ all -> 0x0058 }\n goto L_0x0034;\n L_0x0058:\n r0 = move-exception;\n monitor-exit(r1);\t Catch:{ all -> 0x0058 }\n throw r0;\n L_0x005b:\n r2 = r6.zzapo;\t Catch:{ RemoteException -> 0x006b }\n r3 = r6.zzant;\t Catch:{ RemoteException -> 0x006b }\n r4 = r6.zzanr;\t Catch:{ RemoteException -> 0x006b }\n r5 = r6.zzans;\t Catch:{ RemoteException -> 0x006b }\n r0 = r0.zze(r3, r4, r5);\t Catch:{ RemoteException -> 0x006b }\n r2.set(r0);\t Catch:{ RemoteException -> 0x006b }\n goto L_0x004c;\n L_0x006b:\n r0 = move-exception;\n r2 = r6.zzapn;\t Catch:{ all -> 0x0093 }\n r2 = r2.zzgf();\t Catch:{ all -> 0x0093 }\n r2 = r2.zzis();\t Catch:{ all -> 0x0093 }\n r3 = \"Failed to get conditional properties\";\n r4 = r6.zzant;\t Catch:{ all -> 0x0093 }\n r4 = com.google.android.gms.internal.measurement.zzfh.zzbl(r4);\t Catch:{ all -> 0x0093 }\n r5 = r6.zzanr;\t Catch:{ all -> 0x0093 }\n r2.zzd(r3, r4, r5, r0);\t Catch:{ all -> 0x0093 }\n r0 = r6.zzapo;\t Catch:{ all -> 0x0093 }\n r2 = java.util.Collections.emptyList();\t Catch:{ all -> 0x0093 }\n r0.set(r2);\t Catch:{ all -> 0x0093 }\n r0 = r6.zzapo;\t Catch:{ all -> 0x0058 }\n r0.notify();\t Catch:{ all -> 0x0058 }\n goto L_0x0056;\n L_0x0093:\n r0 = move-exception;\n r2 = r6.zzapo;\t Catch:{ all -> 0x0058 }\n r2.notify();\t Catch:{ all -> 0x0058 }\n throw r0;\t Catch:{ all -> 0x0058 }\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.internal.measurement.zzit.run():void\");\n }", "private TestsResultQueueEntry() {\n\t\t}", "private final void m110462aw() {\n if (this.f89224c != null) {\n DownloaderManagerHolder.m75524a().mo51669a(this.f89224c, hashCode());\n this.f89224c = null;\n }\n }", "protected void runBeforeIteration() {}", "private void m2139m() {\n /*\n r18 = this;\n r3 = 0;\n r0 = r18;\n r15 = r0.f1119g;\t Catch:{ FileNotFoundException -> 0x0023 }\n r0 = r18;\n r0 = r0.f1120h;\t Catch:{ FileNotFoundException -> 0x0023 }\n r16 = r0;\n r3 = r15.openFileInput(r16);\t Catch:{ FileNotFoundException -> 0x0023 }\n r8 = android.util.Xml.newPullParser();\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r15 = 0;\n r8.setInput(r3, r15);\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r12 = 0;\n L_0x0018:\n r15 = 1;\n if (r12 == r15) goto L_0x0025;\n L_0x001b:\n r15 = 2;\n if (r12 == r15) goto L_0x0025;\n L_0x001e:\n r12 = r8.next();\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n goto L_0x0018;\n L_0x0023:\n r4 = move-exception;\n L_0x0024:\n return;\n L_0x0025:\n r15 = \"historical-records\";\n r16 = r8.getName();\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r15 = r15.equals(r16);\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n if (r15 != 0) goto L_0x0062;\n L_0x0031:\n r15 = new org.xmlpull.v1.XmlPullParserException;\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r16 = \"Share records file does not start with historical-records tag.\";\n r15.<init>(r16);\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n throw r15;\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n L_0x0039:\n r14 = move-exception;\n r15 = f1113a;\t Catch:{ all -> 0x00e9 }\n r16 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00e9 }\n r16.<init>();\t Catch:{ all -> 0x00e9 }\n r17 = \"Error reading historical recrod file: \";\n r16 = r16.append(r17);\t Catch:{ all -> 0x00e9 }\n r0 = r18;\n r0 = r0.f1120h;\t Catch:{ all -> 0x00e9 }\n r17 = r0;\n r16 = r16.append(r17);\t Catch:{ all -> 0x00e9 }\n r16 = r16.toString();\t Catch:{ all -> 0x00e9 }\n r0 = r16;\n android.util.Log.e(r15, r0, r14);\t Catch:{ all -> 0x00e9 }\n if (r3 == 0) goto L_0x0024;\n L_0x005c:\n r3.close();\t Catch:{ IOException -> 0x0060 }\n goto L_0x0024;\n L_0x0060:\n r15 = move-exception;\n goto L_0x0024;\n L_0x0062:\n r0 = r18;\n r5 = r0.f1118f;\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r5.clear();\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n L_0x0069:\n r12 = r8.next();\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r15 = 1;\n if (r12 != r15) goto L_0x0078;\n L_0x0070:\n if (r3 == 0) goto L_0x0024;\n L_0x0072:\n r3.close();\t Catch:{ IOException -> 0x0076 }\n goto L_0x0024;\n L_0x0076:\n r15 = move-exception;\n goto L_0x0024;\n L_0x0078:\n r15 = 3;\n if (r12 == r15) goto L_0x0069;\n L_0x007b:\n r15 = 4;\n if (r12 == r15) goto L_0x0069;\n L_0x007e:\n r7 = r8.getName();\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r15 = \"historical-record\";\n r15 = r15.equals(r7);\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n if (r15 != 0) goto L_0x00bd;\n L_0x008a:\n r15 = new org.xmlpull.v1.XmlPullParserException;\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r16 = \"Share records file not well-formed.\";\n r15.<init>(r16);\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n throw r15;\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n L_0x0092:\n r6 = move-exception;\n r15 = f1113a;\t Catch:{ all -> 0x00e9 }\n r16 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00e9 }\n r16.<init>();\t Catch:{ all -> 0x00e9 }\n r17 = \"Error reading historical recrod file: \";\n r16 = r16.append(r17);\t Catch:{ all -> 0x00e9 }\n r0 = r18;\n r0 = r0.f1120h;\t Catch:{ all -> 0x00e9 }\n r17 = r0;\n r16 = r16.append(r17);\t Catch:{ all -> 0x00e9 }\n r16 = r16.toString();\t Catch:{ all -> 0x00e9 }\n r0 = r16;\n android.util.Log.e(r15, r0, r6);\t Catch:{ all -> 0x00e9 }\n if (r3 == 0) goto L_0x0024;\n L_0x00b5:\n r3.close();\t Catch:{ IOException -> 0x00ba }\n goto L_0x0024;\n L_0x00ba:\n r15 = move-exception;\n goto L_0x0024;\n L_0x00bd:\n r15 = 0;\n r16 = \"activity\";\n r0 = r16;\n r2 = r8.getAttributeValue(r15, r0);\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r15 = 0;\n r16 = \"time\";\n r0 = r16;\n r15 = r8.getAttributeValue(r15, r0);\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r10 = java.lang.Long.parseLong(r15);\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r15 = 0;\n r16 = \"weight\";\n r0 = r16;\n r15 = r8.getAttributeValue(r15, r0);\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r13 = java.lang.Float.parseFloat(r15);\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r9 = new android.support.v7.internal.widget.b$d;\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r9.<init>(r2, r10, r13);\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r5.add(r9);\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n goto L_0x0069;\n L_0x00e9:\n r15 = move-exception;\n if (r3 == 0) goto L_0x00ef;\n L_0x00ec:\n r3.close();\t Catch:{ IOException -> 0x00f0 }\n L_0x00ef:\n throw r15;\n L_0x00f0:\n r16 = move-exception;\n goto L_0x00ef;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.support.v7.internal.widget.b.m():void\");\n }", "private final synchronized void zzem() {\n /*\n r5 = this;\n monitor-enter(r5);\n r0 = r5.zzvw;\t Catch:{ all -> 0x005b }\n r1 = \"save_data\";\n r2 = 0;\n r0 = r0.getString(r1, r2);\t Catch:{ all -> 0x005b }\n if (r0 != 0) goto L_0x000e;\n L_0x000c:\n monitor-exit(r5);\n return;\n L_0x000e:\n r1 = new org.json.JSONObject;\t Catch:{ JSONException -> 0x0047 }\n r1.<init>(r0);\t Catch:{ JSONException -> 0x0047 }\n r0 = \"castSessionId\";\n r0 = r1.getString(r0);\t Catch:{ JSONException -> 0x0047 }\n r2 = r5.zzvx;\t Catch:{ JSONException -> 0x0047 }\n r0 = r2.equals(r0);\t Catch:{ JSONException -> 0x0047 }\n if (r0 == 0) goto L_0x0045;\n L_0x0021:\n r0 = \"playerTokenMap\";\n r0 = r1.getJSONObject(r0);\t Catch:{ JSONException -> 0x0047 }\n r1 = r0.keys();\t Catch:{ JSONException -> 0x0047 }\n L_0x002b:\n r2 = r1.hasNext();\t Catch:{ JSONException -> 0x0047 }\n if (r2 == 0) goto L_0x0041;\n L_0x0031:\n r2 = r1.next();\t Catch:{ JSONException -> 0x0047 }\n r2 = (java.lang.String) r2;\t Catch:{ JSONException -> 0x0047 }\n r3 = r5.zzvv;\t Catch:{ JSONException -> 0x0047 }\n r4 = r0.getString(r2);\t Catch:{ JSONException -> 0x0047 }\n r3.put(r2, r4);\t Catch:{ JSONException -> 0x0047 }\n goto L_0x002b;\n L_0x0041:\n r0 = 0;\n r5.zzwe = r0;\t Catch:{ JSONException -> 0x0047 }\n L_0x0045:\n monitor-exit(r5);\n return;\n L_0x0047:\n r0 = move-exception;\n r1 = zzbf;\t Catch:{ all -> 0x005b }\n r2 = \"Error while loading data: %s\";\n r3 = 1;\n r3 = new java.lang.Object[r3];\t Catch:{ all -> 0x005b }\n r4 = 0;\n r0 = r0.getMessage();\t Catch:{ all -> 0x005b }\n r3[r4] = r0;\t Catch:{ all -> 0x005b }\n r1.w(r2, r3);\t Catch:{ all -> 0x005b }\n monitor-exit(r5);\n return;\n L_0x005b:\n r0 = move-exception;\n monitor-exit(r5);\n throw r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.internal.cast.zzcb.zzem():void\");\n }", "@Override\n\tprotected void postRun() {\n\n\t}", "@Override\n public void func_104112_b() {\n \n }", "private void remplirFabricantData() {\n\t}", "private void updateInternalState()\n {\n m_isCodePointHiragana_ = false;\n m_buffer_.setLength(0);\n m_bufferOffset_ = -1;\n m_CEBufferOffset_ = 0;\n m_CEBufferSize_ = 0;\n m_FCDLimit_ = -1;\n m_FCDStart_ = m_source_.getLength();\n //m_isHiragana4_ = m_collator_.m_isHiragana4_;\n m_isForwards_ = true;\n }", "@Override\n public void sync(){\n }", "@Override\r\n\tprotected void prepare()\r\n\t{\r\n\r\n\t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n public Object preProcess() {\n return null;\n }", "protected void reInitialize() {\n resetCurrent();\n incrementIterCount();\n setFirst(true);\n recoverRunningVersion();\n }", "@Override\n\tpublic void preBacktrack() {\n\t\t\n\t}", "@Override\n\tprotected void prepare() {\n\t\t\n\t}", "@Override\n public void onCancelled(CancelledException arg0) {\n }", "@Override\n public void onCancelled(CancelledException arg0) {\n }", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "public final void mo91715d() {\n }", "@Override\n public void preRun() {\n super.preRun();\n }", "@Override\r\n\tpublic void runn() {\n\t\t\r\n\t}", "@Override\r\n\t\t\t\tpublic void run() {\n\r\n\t\t\t\t}", "@Override\r\n\t\t\t\tpublic void run() {\n\r\n\t\t\t\t}", "@Override // androidx.databinding.ViewDataBinding\n /* renamed from: d */\n public void mo5926d() {\n synchronized (this) {\n long j = this.f67002l;\n this.f67002l = 0;\n }\n }", "@Override\r\n\tprotected void processInit() {\n\r\n\t}", "public void run() {\n /*\n r18 = this;\n r3 = 0;\n r10 = 0;\n r0 = r18;\n r13 = com.actionbarsherlock.widget.ActivityChooserModel.this;\n r14 = r13.mInstanceLock;\n monitor-enter(r14);\n r11 = new java.util.ArrayList;\t Catch:{ all -> 0x005c }\n r0 = r18;\n r13 = com.actionbarsherlock.widget.ActivityChooserModel.this;\t Catch:{ all -> 0x005c }\n r13 = r13.mHistoricalRecords;\t Catch:{ all -> 0x005c }\n r11.<init>(r13);\t Catch:{ all -> 0x005c }\n monitor-exit(r14);\t Catch:{ all -> 0x0142 }\n r0 = r18;\n r13 = com.actionbarsherlock.widget.ActivityChooserModel.this;\t Catch:{ FileNotFoundException -> 0x005f }\n r13 = r13.mContext;\t Catch:{ FileNotFoundException -> 0x005f }\n r0 = r18;\n r14 = com.actionbarsherlock.widget.ActivityChooserModel.this;\t Catch:{ FileNotFoundException -> 0x005f }\n r14 = r14.mHistoryFileName;\t Catch:{ FileNotFoundException -> 0x005f }\n r15 = 0;\n r3 = r13.openFileOutput(r14, r15);\t Catch:{ FileNotFoundException -> 0x005f }\n r12 = android.util.Xml.newSerializer();\n r13 = 0;\n r12.setOutput(r3, r13);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r13 = \"UTF-8\";\n r14 = 1;\n r14 = java.lang.Boolean.valueOf(r14);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r12.startDocument(r13, r14);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r13 = 0;\n r14 = \"historical-records\";\n r12.startTag(r13, r14);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r9 = r11.size();\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r4 = 0;\n L_0x004b:\n if (r4 < r9) goto L_0x007f;\n L_0x004d:\n r13 = 0;\n r14 = \"historical-records\";\n r12.endTag(r13, r14);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r12.endDocument();\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n if (r3 == 0) goto L_0x005b;\n L_0x0058:\n r3.close();\t Catch:{ IOException -> 0x013f }\n L_0x005b:\n return;\n L_0x005c:\n r13 = move-exception;\n L_0x005d:\n monitor-exit(r14);\t Catch:{ all -> 0x005c }\n throw r13;\n L_0x005f:\n r2 = move-exception;\n r13 = com.actionbarsherlock.widget.ActivityChooserModel.LOG_TAG;\n r14 = new java.lang.StringBuilder;\n r15 = \"Error writing historical recrod file: \";\n r14.<init>(r15);\n r0 = r18;\n r15 = com.actionbarsherlock.widget.ActivityChooserModel.this;\n r15 = r15.mHistoryFileName;\n r14 = r14.append(r15);\n r14 = r14.toString();\n android.util.Log.e(r13, r14, r2);\n goto L_0x005b;\n L_0x007f:\n r13 = 0;\n r8 = r11.remove(r13);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r8 = (com.actionbarsherlock.widget.ActivityChooserModel.HistoricalRecord) r8;\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r13 = 0;\n r14 = \"historical-record\";\n r12.startTag(r13, r14);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r13 = 0;\n r14 = \"activity\";\n r15 = r8.activity;\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r15 = r15.flattenToString();\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r12.attribute(r13, r14, r15);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r13 = 0;\n r14 = \"time\";\n r0 = r8.time;\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r16 = r0;\n r15 = java.lang.String.valueOf(r16);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r12.attribute(r13, r14, r15);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r13 = 0;\n r14 = \"weight\";\n r15 = r8.weight;\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r15 = java.lang.String.valueOf(r15);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r12.attribute(r13, r14, r15);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r13 = 0;\n r14 = \"historical-record\";\n r12.endTag(r13, r14);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r4 = r4 + 1;\n goto L_0x004b;\n L_0x00bb:\n r5 = move-exception;\n r13 = com.actionbarsherlock.widget.ActivityChooserModel.LOG_TAG;\t Catch:{ all -> 0x0136 }\n r14 = new java.lang.StringBuilder;\t Catch:{ all -> 0x0136 }\n r15 = \"Error writing historical recrod file: \";\n r14.<init>(r15);\t Catch:{ all -> 0x0136 }\n r0 = r18;\n r15 = com.actionbarsherlock.widget.ActivityChooserModel.this;\t Catch:{ all -> 0x0136 }\n r15 = r15.mHistoryFileName;\t Catch:{ all -> 0x0136 }\n r14 = r14.append(r15);\t Catch:{ all -> 0x0136 }\n r14 = r14.toString();\t Catch:{ all -> 0x0136 }\n android.util.Log.e(r13, r14, r5);\t Catch:{ all -> 0x0136 }\n if (r3 == 0) goto L_0x005b;\n L_0x00dc:\n r3.close();\t Catch:{ IOException -> 0x00e1 }\n goto L_0x005b;\n L_0x00e1:\n r13 = move-exception;\n goto L_0x005b;\n L_0x00e4:\n r7 = move-exception;\n r13 = com.actionbarsherlock.widget.ActivityChooserModel.LOG_TAG;\t Catch:{ all -> 0x0136 }\n r14 = new java.lang.StringBuilder;\t Catch:{ all -> 0x0136 }\n r15 = \"Error writing historical recrod file: \";\n r14.<init>(r15);\t Catch:{ all -> 0x0136 }\n r0 = r18;\n r15 = com.actionbarsherlock.widget.ActivityChooserModel.this;\t Catch:{ all -> 0x0136 }\n r15 = r15.mHistoryFileName;\t Catch:{ all -> 0x0136 }\n r14 = r14.append(r15);\t Catch:{ all -> 0x0136 }\n r14 = r14.toString();\t Catch:{ all -> 0x0136 }\n android.util.Log.e(r13, r14, r7);\t Catch:{ all -> 0x0136 }\n if (r3 == 0) goto L_0x005b;\n L_0x0105:\n r3.close();\t Catch:{ IOException -> 0x010a }\n goto L_0x005b;\n L_0x010a:\n r13 = move-exception;\n goto L_0x005b;\n L_0x010d:\n r6 = move-exception;\n r13 = com.actionbarsherlock.widget.ActivityChooserModel.LOG_TAG;\t Catch:{ all -> 0x0136 }\n r14 = new java.lang.StringBuilder;\t Catch:{ all -> 0x0136 }\n r15 = \"Error writing historical recrod file: \";\n r14.<init>(r15);\t Catch:{ all -> 0x0136 }\n r0 = r18;\n r15 = com.actionbarsherlock.widget.ActivityChooserModel.this;\t Catch:{ all -> 0x0136 }\n r15 = r15.mHistoryFileName;\t Catch:{ all -> 0x0136 }\n r14 = r14.append(r15);\t Catch:{ all -> 0x0136 }\n r14 = r14.toString();\t Catch:{ all -> 0x0136 }\n android.util.Log.e(r13, r14, r6);\t Catch:{ all -> 0x0136 }\n if (r3 == 0) goto L_0x005b;\n L_0x012e:\n r3.close();\t Catch:{ IOException -> 0x0133 }\n goto L_0x005b;\n L_0x0133:\n r13 = move-exception;\n goto L_0x005b;\n L_0x0136:\n r13 = move-exception;\n if (r3 == 0) goto L_0x013c;\n L_0x0139:\n r3.close();\t Catch:{ IOException -> 0x013d }\n L_0x013c:\n throw r13;\n L_0x013d:\n r14 = move-exception;\n goto L_0x013c;\n L_0x013f:\n r13 = move-exception;\n goto L_0x005b;\n L_0x0142:\n r13 = move-exception;\n r10 = r11;\n goto L_0x005d;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.actionbarsherlock.widget.ActivityChooserModel.HistoryPersister.run():void\");\n }", "protected void additionalProcessing() {\n\t}", "private void optimiseEVProfile()\n\t{\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "public void mo4058a() {\n imageCacheStatsTracker.mo4071e();\n }", "@android.annotation.SuppressLint({\"NewApi\"})\n private void listRoots() {\n /*\n r23 = this;\n r21 = 0;\n r0 = r21;\n r1 = r23;\n r1.currentDir = r0;\n r0 = r23;\n r0 = r0.items;\n r21 = r0;\n r21.clear();\n r17 = new java.util.HashSet;\n r17.<init>();\n r21 = android.os.Environment.getExternalStorageDirectory();\n r5 = r21.getPath();\n r12 = android.os.Environment.isExternalStorageRemovable();\n r6 = android.os.Environment.getExternalStorageState();\n r21 = \"mounted\";\n r0 = r21;\n r21 = r6.equals(r0);\n if (r21 != 0) goto L_0x003c;\n L_0x0031:\n r21 = \"mounted_ro\";\n r0 = r21;\n r21 = r6.equals(r0);\n if (r21 == 0) goto L_0x0084;\n L_0x003c:\n r8 = new org.telegram.ui.DocumentSelectActivity$ListItem;\n r21 = 0;\n r0 = r23;\n r1 = r21;\n r8.<init>();\n r21 = android.os.Environment.isExternalStorageRemovable();\n if (r21 == 0) goto L_0x02ae;\n L_0x004d:\n r21 = \"SdCard\";\n r22 = 2131494825; // 0x7f0c07a9 float:1.861317E38 double:1.0530983673E-314;\n r21 = org.telegram.messenger.LocaleController.getString(r21, r22);\n r0 = r21;\n r8.title = r0;\n r21 = 2131165433; // 0x7f0700f9 float:1.7945083E38 double:1.052935626E-314;\n r0 = r21;\n r8.icon = r0;\n L_0x0062:\n r0 = r23;\n r21 = r0.getRootSubtitle(r5);\n r0 = r21;\n r8.subtitle = r0;\n r21 = android.os.Environment.getExternalStorageDirectory();\n r0 = r21;\n r8.file = r0;\n r0 = r23;\n r0 = r0.items;\n r21 = r0;\n r0 = r21;\n r0.add(r8);\n r0 = r17;\n r0.add(r5);\n L_0x0084:\n r3 = 0;\n r4 = new java.io.BufferedReader;\t Catch:{ Exception -> 0x0302 }\n r21 = new java.io.FileReader;\t Catch:{ Exception -> 0x0302 }\n r22 = \"/proc/mounts\";\n r21.<init>(r22);\t Catch:{ Exception -> 0x0302 }\n r0 = r21;\n r4.<init>(r0);\t Catch:{ Exception -> 0x0302 }\n L_0x0094:\n r14 = r4.readLine();\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r14 == 0) goto L_0x02dd;\n L_0x009a:\n r21 = \"vfat\";\n r0 = r21;\n r21 = r14.contains(r0);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r21 != 0) goto L_0x00b0;\n L_0x00a5:\n r21 = \"/mnt\";\n r0 = r21;\n r21 = r14.contains(r0);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r21 == 0) goto L_0x0094;\n L_0x00b0:\n r21 = org.telegram.messenger.BuildVars.LOGS_ENABLED;\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r21 == 0) goto L_0x00b7;\n L_0x00b4:\n org.telegram.messenger.FileLog.d(r14);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n L_0x00b7:\n r19 = new java.util.StringTokenizer;\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r21 = \" \";\n r0 = r19;\n r1 = r21;\n r0.<init>(r14, r1);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r20 = r19.nextToken();\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r16 = r19.nextToken();\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r0 = r17;\n r1 = r16;\n r21 = r0.contains(r1);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r21 != 0) goto L_0x0094;\n L_0x00d5:\n r21 = \"/dev/block/vold\";\n r0 = r21;\n r21 = r14.contains(r0);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r21 == 0) goto L_0x0094;\n L_0x00e0:\n r21 = \"/mnt/secure\";\n r0 = r21;\n r21 = r14.contains(r0);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r21 != 0) goto L_0x0094;\n L_0x00eb:\n r21 = \"/mnt/asec\";\n r0 = r21;\n r21 = r14.contains(r0);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r21 != 0) goto L_0x0094;\n L_0x00f6:\n r21 = \"/mnt/obb\";\n r0 = r21;\n r21 = r14.contains(r0);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r21 != 0) goto L_0x0094;\n L_0x0101:\n r21 = \"/dev/mapper\";\n r0 = r21;\n r21 = r14.contains(r0);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r21 != 0) goto L_0x0094;\n L_0x010c:\n r21 = \"tmpfs\";\n r0 = r21;\n r21 = r14.contains(r0);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r21 != 0) goto L_0x0094;\n L_0x0117:\n r21 = new java.io.File;\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r0 = r21;\n r1 = r16;\n r0.<init>(r1);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r21 = r21.isDirectory();\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r21 != 0) goto L_0x0163;\n L_0x0126:\n r21 = 47;\n r0 = r16;\n r1 = r21;\n r11 = r0.lastIndexOf(r1);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r21 = -1;\n r0 = r21;\n if (r11 == r0) goto L_0x0163;\n L_0x0136:\n r21 = new java.lang.StringBuilder;\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r21.<init>();\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r22 = \"/storage/\";\n r21 = r21.append(r22);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r22 = r11 + 1;\n r0 = r16;\n r1 = r22;\n r22 = r0.substring(r1);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r21 = r21.append(r22);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r15 = r21.toString();\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r21 = new java.io.File;\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r0 = r21;\n r0.<init>(r15);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r21 = r21.isDirectory();\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r21 == 0) goto L_0x0163;\n L_0x0161:\n r16 = r15;\n L_0x0163:\n r0 = r17;\n r1 = r16;\n r0.add(r1);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r13 = new org.telegram.ui.DocumentSelectActivity$ListItem;\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n r21 = 0;\n r0 = r23;\n r1 = r21;\n r13.<init>();\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n r21 = r16.toLowerCase();\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n r22 = \"sd\";\n r21 = r21.contains(r22);\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n if (r21 == 0) goto L_0x02c5;\n L_0x0182:\n r21 = \"SdCard\";\n r22 = 2131494825; // 0x7f0c07a9 float:1.861317E38 double:1.0530983673E-314;\n r21 = org.telegram.messenger.LocaleController.getString(r21, r22);\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n r0 = r21;\n r13.title = r0;\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n L_0x0190:\n r21 = 2131165433; // 0x7f0700f9 float:1.7945083E38 double:1.052935626E-314;\n r0 = r21;\n r13.icon = r0;\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n r0 = r23;\n r1 = r16;\n r21 = r0.getRootSubtitle(r1);\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n r0 = r21;\n r13.subtitle = r0;\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n r21 = new java.io.File;\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n r0 = r21;\n r1 = r16;\n r0.<init>(r1);\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n r0 = r21;\n r13.file = r0;\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n r0 = r23;\n r0 = r0.items;\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n r21 = r0;\n r0 = r21;\n r0.add(r13);\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n goto L_0x0094;\n L_0x01bd:\n r7 = move-exception;\n org.telegram.messenger.FileLog.e(r7);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n goto L_0x0094;\n L_0x01c3:\n r7 = move-exception;\n r3 = r4;\n L_0x01c5:\n org.telegram.messenger.FileLog.e(r7);\t Catch:{ all -> 0x0300 }\n if (r3 == 0) goto L_0x01cd;\n L_0x01ca:\n r3.close();\t Catch:{ Exception -> 0x02ec }\n L_0x01cd:\n r9 = new org.telegram.ui.DocumentSelectActivity$ListItem;\n r21 = 0;\n r0 = r23;\n r1 = r21;\n r9.<init>();\n r21 = \"/\";\n r0 = r21;\n r9.title = r0;\n r21 = \"SystemRoot\";\n r22 = 2131495071; // 0x7f0c089f float:1.8613668E38 double:1.053098489E-314;\n r21 = org.telegram.messenger.LocaleController.getString(r21, r22);\n r0 = r21;\n r9.subtitle = r0;\n r21 = 2131165426; // 0x7f0700f2 float:1.7945069E38 double:1.0529356226E-314;\n r0 = r21;\n r9.icon = r0;\n r21 = new java.io.File;\n r22 = \"/\";\n r21.<init>(r22);\n r0 = r21;\n r9.file = r0;\n r0 = r23;\n r0 = r0.items;\n r21 = r0;\n r0 = r21;\n r0.add(r9);\n r18 = new java.io.File;\t Catch:{ Exception -> 0x02f7 }\n r21 = android.os.Environment.getExternalStorageDirectory();\t Catch:{ Exception -> 0x02f7 }\n r22 = \"Telegram\";\n r0 = r18;\n r1 = r21;\n r2 = r22;\n r0.<init>(r1, r2);\t Catch:{ Exception -> 0x02f7 }\n r21 = r18.exists();\t Catch:{ Exception -> 0x02f7 }\n if (r21 == 0) goto L_0x0254;\n L_0x0223:\n r10 = new org.telegram.ui.DocumentSelectActivity$ListItem;\t Catch:{ Exception -> 0x02f7 }\n r21 = 0;\n r0 = r23;\n r1 = r21;\n r10.<init>();\t Catch:{ Exception -> 0x02f7 }\n r21 = \"Telegram\";\n r0 = r21;\n r10.title = r0;\t Catch:{ Exception -> 0x02fd }\n r21 = r18.toString();\t Catch:{ Exception -> 0x02fd }\n r0 = r21;\n r10.subtitle = r0;\t Catch:{ Exception -> 0x02fd }\n r21 = 2131165426; // 0x7f0700f2 float:1.7945069E38 double:1.0529356226E-314;\n r0 = r21;\n r10.icon = r0;\t Catch:{ Exception -> 0x02fd }\n r0 = r18;\n r10.file = r0;\t Catch:{ Exception -> 0x02fd }\n r0 = r23;\n r0 = r0.items;\t Catch:{ Exception -> 0x02fd }\n r21 = r0;\n r0 = r21;\n r0.add(r10);\t Catch:{ Exception -> 0x02fd }\n r9 = r10;\n L_0x0254:\n r9 = new org.telegram.ui.DocumentSelectActivity$ListItem;\n r21 = 0;\n r0 = r23;\n r1 = r21;\n r9.<init>();\n r21 = \"Gallery\";\n r22 = 2131493847; // 0x7f0c03d7 float:1.8611186E38 double:1.053097884E-314;\n r21 = org.telegram.messenger.LocaleController.getString(r21, r22);\n r0 = r21;\n r9.title = r0;\n r21 = \"GalleryInfo\";\n r22 = 2131493848; // 0x7f0c03d8 float:1.8611188E38 double:1.0530978846E-314;\n r21 = org.telegram.messenger.LocaleController.getString(r21, r22);\n r0 = r21;\n r9.subtitle = r0;\n r21 = 2131165529; // 0x7f070159 float:1.7945278E38 double:1.0529356735E-314;\n r0 = r21;\n r9.icon = r0;\n r21 = 0;\n r0 = r21;\n r9.file = r0;\n r0 = r23;\n r0 = r0.items;\n r21 = r0;\n r0 = r21;\n r0.add(r9);\n r0 = r23;\n r0 = r0.listView;\n r21 = r0;\n org.telegram.messenger.AndroidUtilities.clearDrawableAnimation(r21);\n r21 = 1;\n r0 = r21;\n r1 = r23;\n r1.scrolling = r0;\n r0 = r23;\n r0 = r0.listAdapter;\n r21 = r0;\n r21.notifyDataSetChanged();\n return;\n L_0x02ae:\n r21 = \"InternalStorage\";\n r22 = 2131493929; // 0x7f0c0429 float:1.8611352E38 double:1.0530979246E-314;\n r21 = org.telegram.messenger.LocaleController.getString(r21, r22);\n r0 = r21;\n r8.title = r0;\n r21 = 2131165528; // 0x7f070158 float:1.7945276E38 double:1.052935673E-314;\n r0 = r21;\n r8.icon = r0;\n goto L_0x0062;\n L_0x02c5:\n r21 = \"ExternalStorage\";\n r22 = 2131493730; // 0x7f0c0362 float:1.8610948E38 double:1.0530978263E-314;\n r21 = org.telegram.messenger.LocaleController.getString(r21, r22);\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n r0 = r21;\n r13.title = r0;\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n goto L_0x0190;\n L_0x02d5:\n r21 = move-exception;\n r3 = r4;\n L_0x02d7:\n if (r3 == 0) goto L_0x02dc;\n L_0x02d9:\n r3.close();\t Catch:{ Exception -> 0x02f2 }\n L_0x02dc:\n throw r21;\n L_0x02dd:\n if (r4 == 0) goto L_0x0305;\n L_0x02df:\n r4.close();\t Catch:{ Exception -> 0x02e5 }\n r3 = r4;\n goto L_0x01cd;\n L_0x02e5:\n r7 = move-exception;\n org.telegram.messenger.FileLog.e(r7);\n r3 = r4;\n goto L_0x01cd;\n L_0x02ec:\n r7 = move-exception;\n org.telegram.messenger.FileLog.e(r7);\n goto L_0x01cd;\n L_0x02f2:\n r7 = move-exception;\n org.telegram.messenger.FileLog.e(r7);\n goto L_0x02dc;\n L_0x02f7:\n r7 = move-exception;\n L_0x02f8:\n org.telegram.messenger.FileLog.e(r7);\n goto L_0x0254;\n L_0x02fd:\n r7 = move-exception;\n r9 = r10;\n goto L_0x02f8;\n L_0x0300:\n r21 = move-exception;\n goto L_0x02d7;\n L_0x0302:\n r7 = move-exception;\n goto L_0x01c5;\n L_0x0305:\n r3 = r4;\n goto L_0x01cd;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: org.telegram.ui.DocumentSelectActivity.listRoots():void\");\n }", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "@Override\r\n\t\t\tpublic void autInitProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autInitProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autInitProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autInitProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autInitProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "public static void sync() {\n /*\n int r0 = android.os.Build.VERSION.SDK_INT\n r1 = 24\n if (r0 >= r1) goto L_0x001f\n java.io.File r0 = new java.io.File\n java.lang.String r1 = mStrPath\n r0.<init>(r1)\n r2 = 0\n java.io.FileInputStream r1 = new java.io.FileInputStream // Catch:{ Exception -> 0x0020, all -> 0x0030 }\n r1.<init>(r0) // Catch:{ Exception -> 0x0020, all -> 0x0030 }\n java.io.FileDescriptor r0 = r1.getFD() // Catch:{ Exception -> 0x0044 }\n r0.sync() // Catch:{ Exception -> 0x0044 }\n if (r1 == 0) goto L_0x001f\n r1.close() // Catch:{ Exception -> 0x003d }\n L_0x001f:\n return\n L_0x0020:\n r0 = move-exception\n r1 = r2\n L_0x0022:\n r0.printStackTrace() // Catch:{ all -> 0x0042 }\n if (r1 == 0) goto L_0x001f\n r1.close() // Catch:{ Exception -> 0x002b }\n goto L_0x001f\n L_0x002b:\n r0 = move-exception\n r0.printStackTrace()\n goto L_0x001f\n L_0x0030:\n r0 = move-exception\n r1 = r2\n L_0x0032:\n if (r1 == 0) goto L_0x0037\n r1.close() // Catch:{ Exception -> 0x0038 }\n L_0x0037:\n throw r0\n L_0x0038:\n r1 = move-exception\n r1.printStackTrace()\n goto L_0x0037\n L_0x003d:\n r0 = move-exception\n r0.printStackTrace()\n goto L_0x001f\n L_0x0042:\n r0 = move-exception\n goto L_0x0032\n L_0x0044:\n r0 = move-exception\n goto L_0x0022\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.syu.util.MySharePreference.sync():void\");\n }", "@Override\n public void retrack() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override // androidx.databinding.ViewDataBinding\n /* renamed from: d */\n public void mo5926d() {\n synchronized (this) {\n long j = this.f102361i;\n this.f102361i = 0;\n }\n }", "boolean scavengeSome()\r\n/* 472: */ {\r\n/* 473:505 */ Recycler.WeakOrderQueue cursor = this.cursor;\r\n/* 474: */ Recycler.WeakOrderQueue prev;\r\n/* 475:506 */ if (cursor == null)\r\n/* 476: */ {\r\n/* 477:507 */ Recycler.WeakOrderQueue prev = null;\r\n/* 478:508 */ cursor = this.head;\r\n/* 479:509 */ if (cursor == null) {\r\n/* 480:510 */ return false;\r\n/* 481: */ }\r\n/* 482: */ }\r\n/* 483: */ else\r\n/* 484: */ {\r\n/* 485:513 */ prev = this.prev;\r\n/* 486: */ }\r\n/* 487:516 */ boolean success = false;\r\n/* 488: */ do\r\n/* 489: */ {\r\n/* 490:518 */ if (cursor.transfer(this))\r\n/* 491: */ {\r\n/* 492:519 */ success = true;\r\n/* 493:520 */ break;\r\n/* 494: */ }\r\n/* 495:522 */ Recycler.WeakOrderQueue next = Recycler.WeakOrderQueue.access$1800(cursor);\r\n/* 496:523 */ if (Recycler.WeakOrderQueue.access$1900(cursor).get() == null)\r\n/* 497: */ {\r\n/* 498:527 */ if (cursor.hasFinalData()) {\r\n/* 499:529 */ while (cursor.transfer(this)) {\r\n/* 500:530 */ success = true;\r\n/* 501: */ }\r\n/* 502: */ }\r\n/* 503:537 */ if (prev != null) {\r\n/* 504:538 */ Recycler.WeakOrderQueue.access$1700(prev, next);\r\n/* 505: */ }\r\n/* 506: */ }\r\n/* 507: */ else\r\n/* 508: */ {\r\n/* 509:541 */ prev = cursor;\r\n/* 510: */ }\r\n/* 511:544 */ cursor = next;\r\n/* 512:546 */ } while ((cursor != null) && (!success));\r\n/* 513:548 */ this.prev = prev;\r\n/* 514:549 */ this.cursor = cursor;\r\n/* 515:550 */ return success;\r\n/* 516: */ }", "@Override\n\t\tpublic void run() {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void run() {\n\t\t\t\n\t\t}", "protected abstract void trace_pre_updates();", "@Override\r\n\tprotected void processInit() {\n\t\t\r\n\t}", "protected java.util.List x (java.lang.String r19){\n /*\n r18 = this;\n r0 = r18;\n r2 = r0.K;\n r0 = r19;\n r2 = r2.getAllSortStackTraces(r0);\n r2 = (java.util.List) r2;\n if (r2 == 0) goto L_0x000f;\n L_0x000e:\n return r2;\n L_0x000f:\n r12 = java.util.Collections.emptyList();\n r2 = r18.bp();\n r3 = r18.TaskHandler(r19);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n r4 = r2.setDrawable(r3);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n if (r4 != 0) goto L_0x0026;\n L_0x0021:\n r18.bq();\n r2 = r12;\n goto L_0x000e;\n L_0x0026:\n r13 = r2.getScaledMaximumFlingVelocity(r3);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n r14 = new java.io.ByteArrayOutputStream;\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n r2 = 2048; // 0x800 float:2.87E-42 double:1.0118E-320;\n r14.<creatCallTask>(r2);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n com.duokan.core.io.getTriangleEdge.setDrawable(r13, r14);\t Catch:{ all -> 0x00f2 }\n r2 = r14.toByteArray();\t Catch:{ all -> 0x00f2 }\n r2 = com.duokan.kernel.DkUtils.decodeSimpleDrm(r2);\t Catch:{ all -> 0x00f2 }\n r3 = new java.lang.String;\t Catch:{ all -> 0x00f2 }\n r4 = \"UTF-8\";\n r3.<creatCallTask>(r2, r4);\t Catch:{ all -> 0x00f2 }\n r2 = new org.json.JSONObject;\t Catch:{ all -> 0x00f2 }\n r2.<creatCallTask>(r3);\t Catch:{ all -> 0x00f2 }\n if (r2 != 0) goto L_0x0055;\n L_0x004a:\n com.duokan.core.io.getTriangleEdge.setDrawable(r13);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n com.duokan.core.io.getTriangleEdge.setDrawable(r14);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n r18.bq();\n r2 = r12;\n goto L_0x000e;\n L_0x0055:\n r3 = \"pictures\";\n r15 = com.duokan.reader.common.getPhysicalYPixels.setDrawable(r2, r3);\t Catch:{ all -> 0x00f2 }\n r16 = new java.util.ArrayList;\t Catch:{ all -> 0x00f2 }\n r2 = r15.length();\t Catch:{ all -> 0x00f2 }\n r0 = r16;\n r0.<creatCallTask>(r2);\t Catch:{ all -> 0x00f2 }\n r2 = 0;\n L_0x0067:\n r3 = r15.length();\t Catch:{ all -> 0x00f2 }\n if (r2 >= r3) goto L_0x00d0;\n L_0x006d:\n r3 = r15.getJSONObject(r2);\t Catch:{ all -> 0x00f2 }\n r4 = \"sm_md5\";\n r7 = r3.getString(r4);\t Catch:{ all -> 0x00f2 }\n r4 = \"sm_url\";\n r6 = r3.getString(r4);\t Catch:{ all -> 0x00f2 }\n r4 = \"sm_size\";\n r8 = r3.getLong(r4);\t Catch:{ all -> 0x00f2 }\n r4 = \"width\";\n r10 = r3.getInt(r4);\t Catch:{ all -> 0x00f2 }\n r4 = \"height\";\n r11 = r3.getInt(r4);\t Catch:{ all -> 0x00f2 }\n r3 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00f2 }\n r3.<creatCallTask>();\t Catch:{ all -> 0x00f2 }\n r0 = r19;\n r3 = r3.append(r0);\t Catch:{ all -> 0x00f2 }\n r4 = \".\";\n r3 = r3.append(r4);\t Catch:{ all -> 0x00f2 }\n r3 = r3.append(r2);\t Catch:{ all -> 0x00f2 }\n r4 = r3.toString();\t Catch:{ all -> 0x00f2 }\n r5 = new java.lang.String;\t Catch:{ all -> 0x00f2 }\n r3 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00f2 }\n r3.<creatCallTask>();\t Catch:{ all -> 0x00f2 }\n r17 = \"file:///stuffs/\";\n r0 = r17;\n r3 = r3.append(r0);\t Catch:{ all -> 0x00f2 }\n r3 = r3.append(r7);\t Catch:{ all -> 0x00f2 }\n r3 = r3.toString();\t Catch:{ all -> 0x00f2 }\n r5.<creatCallTask>(r3);\t Catch:{ all -> 0x00f2 }\n r3 = r18;\n r3 = r3.setDrawable(r4, r5, r6, r7, r8, r10, r11);\t Catch:{ all -> 0x00f2 }\n r0 = r16;\n r0.add(r3);\t Catch:{ all -> 0x00f2 }\n r2 = r2 + 1;\n goto L_0x0067;\n L_0x00d0:\n r0 = r18;\n r2 = r0.K;\t Catch:{ all -> 0x00f2 }\n r0 = r19;\n r1 = r16;\n r2.putIfAbsent(r0, r1);\t Catch:{ all -> 0x00f2 }\n r0 = r18;\n r2 = r0.K;\t Catch:{ all -> 0x00f2 }\n r0 = r19;\n r2 = r2.getAllSortStackTraces(r0);\t Catch:{ all -> 0x00f2 }\n r2 = (java.util.List) r2;\t Catch:{ all -> 0x00f2 }\n com.duokan.core.io.getTriangleEdge.setDrawable(r13);\t Catch:{ Throwable -> 0x0106, all -> 0x0101 }\n com.duokan.core.io.getTriangleEdge.setDrawable(r14);\t Catch:{ Throwable -> 0x0106, all -> 0x0101 }\n r18.bq();\n goto L_0x000e;\n L_0x00f2:\n r2 = move-exception;\n com.duokan.core.io.getTriangleEdge.setDrawable(r13);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n com.duokan.core.io.getTriangleEdge.setDrawable(r14);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n throw r2;\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n L_0x00fa:\n r2 = move-exception;\n r2 = r12;\n L_0x00fc:\n r18.bq();\n goto L_0x000e;\n L_0x0101:\n r2 = move-exception;\n r18.bq();\n throw r2;\n L_0x0106:\n r3 = move-exception;\n goto L_0x00fc;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.duokan.reader.domain.bookshelf.jv.MyContextWrapper(java.lang.String):java.util.List\");\n }", "private void Initialized_Data() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "private void workOnQueue() {\n }", "@Override\n public void cleanup() {\n \n }", "@Override\n public void cleanup() {\n \n }", "public void run() {\n\t\t\t\t\t\t}", "@Override\r\n\t\t\t\tpublic void autInitProcess() {\n\t\t\t\t\t\r\n\t\t\t\t}", "@Override\r\n\t\t\t\tpublic void autInitProcess() {\n\t\t\t\t\t\r\n\t\t\t\t}", "protected void mo6255a() {\n }", "public java.util.Map<java.lang.String, java.util.ArrayList> m17238b() {\n /*\n r18 = this;\n r3 = new java.util.HashMap;\n r3.<init>();\n r4 = new java.util.ArrayList;\n r4.<init>();\n r5 = new java.util.ArrayList;\n r5.<init>();\n r0 = r18;\n r2 = r0.f20995e;\n r2.lock();\n r6 = r18.m17234d();\n r2 = \"select * from result limit 0,500\";\n r7 = 0;\n r7 = r6.rawQuery(r2, r7);\n L_0x0022:\n r2 = r7.moveToNext();\t Catch:{ SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9, Exception -> 0x0120 }\n if (r2 == 0) goto L_0x0106;\n L_0x0028:\n r2 = new org.json.JSONObject;\t Catch:{ SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9, Exception -> 0x0120 }\n r2.<init>();\t Catch:{ SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9, Exception -> 0x0120 }\n r8 = \"_id\";\n r8 = r7.getColumnIndex(r8);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r8 = r7.getInt(r8);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r9 = \"time\";\n r9 = r7.getColumnIndex(r9);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r9 = r7.getString(r9);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r10 = \"code\";\n r10 = r7.getColumnIndex(r10);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r10 = r7.getInt(r10);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r11 = \"cmd_type\";\n r11 = r7.getColumnIndex(r11);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r11 = r7.getInt(r11);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r12 = \"cmd_id\";\n r12 = r7.getColumnIndex(r12);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r12 = r7.getInt(r12);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r13 = \"result\";\n r13 = r7.getColumnIndex(r13);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r13 = r7.getString(r13);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r14 = \"time\";\n r16 = java.lang.Long.parseLong(r9);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r0 = r16;\n r2.put(r14, r0);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r9 = \"error_code\";\n r2.put(r9, r10);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n if (r10 != 0) goto L_0x0095;\n L_0x0083:\n r9 = \"cmd_type\";\n r2.put(r9, r11);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r9 = \"cmd_id\";\n r2.put(r9, r12);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r9 = \"voice_to_text_result\";\n r2.put(r9, r13);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n L_0x0095:\n r8 = java.lang.Integer.valueOf(r8);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r5.add(r8);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r4.add(r2);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n goto L_0x0022;\n L_0x00a0:\n r2 = move-exception;\n r2.printStackTrace();\t Catch:{ SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9, Exception -> 0x0120 }\n goto L_0x0022;\n L_0x00a6:\n r2 = move-exception;\n r4 = \"SynthesizeResultDb\";\n r5 = new java.lang.StringBuilder;\t Catch:{ all -> 0x014d }\n r5.<init>();\t Catch:{ all -> 0x014d }\n r8 = \"exception:\";\n r5 = r5.append(r8);\t Catch:{ all -> 0x014d }\n r2 = r2.toString();\t Catch:{ all -> 0x014d }\n r2 = r5.append(r2);\t Catch:{ all -> 0x014d }\n r2 = r2.toString();\t Catch:{ all -> 0x014d }\n com.baidu.tts.chainofresponsibility.logger.LoggerProxy.m17001d(r4, r2);\t Catch:{ all -> 0x014d }\n r7.close();\n r6.close();\n r0 = r18;\n r2 = r0.f20995e;\n r2.unlock();\n L_0x00d2:\n return r3;\n L_0x00d3:\n r2 = move-exception;\n r2.printStackTrace();\t Catch:{ SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9, Exception -> 0x0120 }\n goto L_0x0022;\n L_0x00d9:\n r2 = move-exception;\n r4 = \"SynthesizeResultDb\";\n r5 = new java.lang.StringBuilder;\t Catch:{ all -> 0x014d }\n r5.<init>();\t Catch:{ all -> 0x014d }\n r8 = \"exception:\";\n r5 = r5.append(r8);\t Catch:{ all -> 0x014d }\n r2 = r2.toString();\t Catch:{ all -> 0x014d }\n r2 = r5.append(r2);\t Catch:{ all -> 0x014d }\n r2 = r2.toString();\t Catch:{ all -> 0x014d }\n com.baidu.tts.chainofresponsibility.logger.LoggerProxy.m17001d(r4, r2);\t Catch:{ all -> 0x014d }\n r7.close();\n r6.close();\n r0 = r18;\n r2 = r0.f20995e;\n r2.unlock();\n goto L_0x00d2;\n L_0x0106:\n r2 = \"listId\";\n r3.put(r2, r5);\t Catch:{ SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9, Exception -> 0x0120 }\n r2 = \"list\";\n r3.put(r2, r4);\t Catch:{ SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9, Exception -> 0x0120 }\n r7.close();\n r6.close();\n r0 = r18;\n r2 = r0.f20995e;\n r2.unlock();\n goto L_0x00d2;\n L_0x0120:\n r2 = move-exception;\n r4 = \"SynthesizeResultDb\";\n r5 = new java.lang.StringBuilder;\t Catch:{ all -> 0x014d }\n r5.<init>();\t Catch:{ all -> 0x014d }\n r8 = \"exception:\";\n r5 = r5.append(r8);\t Catch:{ all -> 0x014d }\n r2 = r2.toString();\t Catch:{ all -> 0x014d }\n r2 = r5.append(r2);\t Catch:{ all -> 0x014d }\n r2 = r2.toString();\t Catch:{ all -> 0x014d }\n com.baidu.tts.chainofresponsibility.logger.LoggerProxy.m17001d(r4, r2);\t Catch:{ all -> 0x014d }\n r7.close();\n r6.close();\n r0 = r18;\n r2 = r0.f20995e;\n r2.unlock();\n goto L_0x00d2;\n L_0x014d:\n r2 = move-exception;\n r7.close();\n r6.close();\n r0 = r18;\n r3 = r0.f20995e;\n r3.unlock();\n throw r2;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.baidu.tts.e.c.b():java.util.Map<java.lang.String, java.util.ArrayList>\");\n }" ]
[ "0.55562544", "0.5524281", "0.5422254", "0.5408466", "0.53997767", "0.53997767", "0.5378079", "0.5330925", "0.5330925", "0.53158784", "0.5268941", "0.5230672", "0.5230672", "0.52290064", "0.52268237", "0.5221294", "0.52173245", "0.5188653", "0.51828784", "0.5172161", "0.5159342", "0.51419955", "0.51419324", "0.5134902", "0.5134902", "0.5134902", "0.5134561", "0.5129321", "0.51248544", "0.5113029", "0.5108576", "0.5104469", "0.50980794", "0.50951105", "0.5094646", "0.5091167", "0.50885606", "0.50751764", "0.5074092", "0.50639087", "0.5059525", "0.50580573", "0.5055486", "0.50530887", "0.5043913", "0.5039544", "0.50169826", "0.50169826", "0.5015922", "0.50152135", "0.50152135", "0.50152135", "0.50062793", "0.5000634", "0.49899", "0.49815956", "0.49815956", "0.49806455", "0.4979194", "0.4979089", "0.4977998", "0.49737734", "0.4968453", "0.4968453", "0.4968453", "0.4968453", "0.4968453", "0.4968453", "0.49627706", "0.49611887", "0.49611202", "0.49600077", "0.49578217", "0.49578217", "0.49567172", "0.49567172", "0.49567172", "0.49567172", "0.49567172", "0.49558997", "0.49558997", "0.49521732", "0.49501336", "0.49448287", "0.49441397", "0.4942802", "0.49397263", "0.49397263", "0.4939649", "0.49395615", "0.49381623", "0.49346033", "0.49344596", "0.49287847", "0.49246958", "0.49246958", "0.49222624", "0.4917453", "0.4917453", "0.4915337", "0.49137303" ]
0.0
-1
NOTE: method is for internal use and debug only, doesn't use any synchronization
int getEnqueuedBlockRequestsNumber() { int count = 0; for (StdPeerMessage pm : sendQueue) { if (pm.type == StdPeerMessage.REQUEST) { count++; } } return count; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}", "public final void mo51373a() {\n }", "private static byte[] m2539e(Context context) {\n Throwable th;\n int i = 0;\n ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();\n byte[] bArr = new byte[0];\n String a = Log.m2547a(context, Log.f1857e);\n DiskLruCache diskLruCache = null;\n try {\n diskLruCache = DiskLruCache.m2767a(new File(a), 1, 1, 10240);\n File file = new File(a);\n if (file != null && file.exists()) {\n String[] list = file.list();\n int length = list.length;\n while (i < length) {\n String str = list[i];\n if (str.contains(\".0\")) {\n byteArrayOutputStream.write(StatisticsManager.m2535a(diskLruCache, str.split(\"\\\\.\")[0]));\n }\n i++;\n }\n }\n bArr = byteArrayOutputStream.toByteArray();\n if (byteArrayOutputStream != null) {\n try {\n byteArrayOutputStream.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n if (diskLruCache != null) {\n try {\n diskLruCache.close();\n } catch (Throwable th2) {\n th = th2;\n }\n }\n } catch (IOException th3) {\n BasicLogHandler.m2542a(th3, \"StatisticsManager\", \"getContent\");\n if (byteArrayOutputStream != null) {\n try {\n byteArrayOutputStream.close();\n } catch (IOException e2) {\n e2.printStackTrace();\n }\n }\n if (diskLruCache != null) {\n diskLruCache.close();\n }\n } catch (Throwable th4) {\n th3 = th4;\n }\n return bArr;\n th3.printStackTrace();\n return bArr;\n }", "@Override\n\tprotected void interr() {\n\t}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "static com.qiyukf.nimlib.p470f.p471a.C5826a m23369a(android.os.Parcel r4) {\n /*\n com.qiyukf.nimlib.f.a.a r0 = new com.qiyukf.nimlib.f.a.a\n r1 = 0\n r0.m50001init(r1)\n int r2 = r4.readInt()\n r0.f18499a = r2\n int r2 = r4.readInt()\n if (r2 <= 0) goto L_0x001d\n byte[] r2 = r4.createByteArray()\n java.nio.ByteBuffer r2 = java.nio.ByteBuffer.wrap(r2)\n r0.f18501c = r2\n L_0x001d:\n int r2 = r4.readInt()\n r0.f18500b = r2\n int r2 = r4.readInt()\n if (r2 <= 0) goto L_0x0061\n byte[] r4 = r4.createByteArray()\n int r3 = r0.f18500b\n if (r3 <= 0) goto L_0x005c\n int r1 = r0.f18500b\n if (r1 != r2) goto L_0x0049\n java.nio.ByteBuffer r4 = java.nio.ByteBuffer.wrap(r4)\n r0.f18502d = r4\n java.nio.ByteBuffer r4 = r0.f18502d\n r4.position(r2)\n goto L_0x0068\n L_0x0049:\n int r1 = r0.f18500b\n java.nio.ByteBuffer r1 = java.nio.ByteBuffer.allocate(r1)\n r0.f18502d = r1\n java.nio.ByteBuffer r1 = r0.f18502d\n r1.put(r4)\n goto L_0x0068\n L_0x005c:\n java.nio.ByteBuffer r4 = java.nio.ByteBuffer.wrap(r4, r1, r2)\n goto L_0x0065\n L_0x0061:\n java.nio.ByteBuffer r4 = java.nio.ByteBuffer.allocate(r1)\n L_0x0065:\n r0.f18502d = r4\n L_0x0068:\n boolean r4 = m23372b(r0)\n if (r4 == 0) goto L_0x006f\n return r0\n L_0x006f:\n int r4 = r0.f18500b\n if (r4 <= 0) goto L_0x007d\n android.util.SparseArray<com.qiyukf.nimlib.f.a.a> r4 = f18504a\n int r1 = r0.f18499a\n r4.put(r1, r0)\n goto L_0x00a2\n L_0x007d:\n android.util.SparseArray<com.qiyukf.nimlib.f.a.a> r4 = f18504a\n int r1 = r0.f18499a\n java.lang.Object r4 = r4.get(r1)\n com.qiyukf.nimlib.f.a.a r4 = (com.qiyukf.nimlib.p470f.p471a.C5826a) r4\n if (r4 == 0) goto L_0x00a2\n java.nio.ByteBuffer r1 = r4.f18502d\n java.nio.ByteBuffer r0 = r0.f18502d\n r1.put(r0)\n boolean r0 = m23372b(r4)\n if (r0 == 0) goto L_0x00a2\n android.util.SparseArray<com.qiyukf.nimlib.f.a.a> r0 = f18504a\n int r1 = r4.f18499a\n r0.remove(r1)\n return r4\n L_0x00a2:\n r4 = 0\n return r4\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.qiyukf.nimlib.p470f.p471a.C5826a.C5829b.m23369a(android.os.Parcel):com.qiyukf.nimlib.f.a.a\");\n }", "private final void m11968d() {\n synchronized (this.f10173g) {\n for (zzsk a : this.f10174h) {\n a.m11971a();\n }\n }\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t}", "private void c() {\n /*\n r14 = this;\n r12 = android.os.SystemClock.elapsedRealtime();\n r8 = r14.d();\n r0 = r14.t;\n if (r0 == 0) goto L_0x007a;\n L_0x000c:\n r0 = 1;\n r7 = r0;\n L_0x000e:\n r0 = r14.r;\n r0 = r0.a();\n if (r0 != 0) goto L_0x0018;\n L_0x0016:\n if (r7 == 0) goto L_0x007d;\n L_0x0018:\n r0 = 1;\n r10 = r0;\n L_0x001a:\n if (r10 != 0) goto L_0x0095;\n L_0x001c:\n r0 = r14.d;\n r0 = r0.b;\n if (r0 != 0) goto L_0x0028;\n L_0x0022:\n r0 = -1;\n r0 = (r8 > r0 ? 1 : (r8 == r0 ? 0 : -1));\n if (r0 != 0) goto L_0x0032;\n L_0x0028:\n r0 = r14.p;\n r0 = r12 - r0;\n r2 = 2000; // 0x7d0 float:2.803E-42 double:9.88E-321;\n r0 = (r0 > r2 ? 1 : (r0 == r2 ? 0 : -1));\n if (r0 <= 0) goto L_0x0095;\n L_0x0032:\n r14.p = r12;\n r0 = r14.d;\n r1 = r14.f;\n r1 = r1.size();\n r0.a = r1;\n r0 = r14.c;\n r1 = r14.f;\n r2 = r14.o;\n r4 = r14.m;\n r6 = r14.d;\n r0.getChunkOperation(r1, r2, r4, r6);\n r0 = r14.d;\n r0 = r0.a;\n r0 = r14.a(r0);\n r1 = r14.d;\n r1 = r1.b;\n if (r1 != 0) goto L_0x0080;\n L_0x0059:\n r4 = -1;\n L_0x005b:\n r0 = r14.b;\n r2 = r14.m;\n r1 = r14;\n r6 = r10;\n r0 = r0.update(r1, r2, r4, r6);\n if (r7 == 0) goto L_0x0087;\n L_0x0067:\n r0 = r14.v;\n r0 = r12 - r0;\n r2 = r14.u;\n r2 = (long) r2;\n r2 = r14.c(r2);\n r0 = (r0 > r2 ? 1 : (r0 == r2 ? 0 : -1));\n if (r0 < 0) goto L_0x0079;\n L_0x0076:\n r14.e();\n L_0x0079:\n return;\n L_0x007a:\n r0 = 0;\n r7 = r0;\n goto L_0x000e;\n L_0x007d:\n r0 = 0;\n r10 = r0;\n goto L_0x001a;\n L_0x0080:\n if (r0 == 0) goto L_0x0095;\n L_0x0082:\n r4 = r14.d();\n goto L_0x005b;\n L_0x0087:\n r1 = r14.r;\n r1 = r1.a();\n if (r1 != 0) goto L_0x0079;\n L_0x008f:\n if (r0 == 0) goto L_0x0079;\n L_0x0091:\n r14.f();\n goto L_0x0079;\n L_0x0095:\n r4 = r8;\n goto L_0x005b;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.exoplayer.chunk.ChunkSampleSource.c():void\");\n }", "private void getStatus() {\n\t\t\n\t}", "@Override\n\t\t\tpublic void run() {\n\n\t\t\t}", "private void m50366E() {\n }", "@Override\n public void perish() {\n \n }", "private static void iterator() {\n\t\t\r\n\t}", "private synchronized void flushCache() {\n /*\n r6 = this;\n monitor-enter(r6)\n r0 = 0\n java.util.Map<java.lang.String, java.lang.String> r1 = r6.cdY // Catch:{ all -> 0x005a }\n boolean r1 = r1.isEmpty() // Catch:{ all -> 0x005a }\n if (r1 == 0) goto L_0x000c\n monitor-exit(r6)\n return\n L_0x000c:\n r1 = 4\n if (r0 >= r1) goto L_0x0058\n int r1 = r6.cdS // Catch:{ all -> 0x005a }\n r2 = 64\n if (r1 > r2) goto L_0x001e\n int r1 = r6.cdT // Catch:{ all -> 0x005a }\n long r1 = (long) r1 // Catch:{ all -> 0x005a }\n long r3 = r6.cdV // Catch:{ all -> 0x005a }\n int r1 = (r1 > r3 ? 1 : (r1 == r3 ? 0 : -1))\n if (r1 <= 0) goto L_0x0058\n L_0x001e:\n java.util.Map<java.lang.String, java.lang.String> r1 = r6.cdY // Catch:{ all -> 0x005a }\n java.util.Set r1 = r1.entrySet() // Catch:{ all -> 0x005a }\n java.util.Iterator r1 = r1.iterator() // Catch:{ all -> 0x005a }\n java.lang.Object r1 = r1.next() // Catch:{ all -> 0x005a }\n java.util.Map$Entry r1 = (java.util.Map.Entry) r1 // Catch:{ all -> 0x005a }\n java.io.File r2 = new java.io.File // Catch:{ all -> 0x005a }\n java.lang.Object r3 = r1.getValue() // Catch:{ all -> 0x005a }\n java.lang.String r3 = (java.lang.String) r3 // Catch:{ all -> 0x005a }\n r2.<init>(r3) // Catch:{ all -> 0x005a }\n long r2 = r2.length() // Catch:{ all -> 0x005a }\n java.util.Map<java.lang.String, java.lang.String> r4 = r6.cdY // Catch:{ all -> 0x005a }\n java.lang.Object r1 = r1.getKey() // Catch:{ all -> 0x005a }\n r4.remove(r1) // Catch:{ all -> 0x005a }\n java.util.Map<java.lang.String, java.lang.String> r1 = r6.cdY // Catch:{ all -> 0x005a }\n int r1 = r1.size() // Catch:{ all -> 0x005a }\n r6.cdS = r1 // Catch:{ all -> 0x005a }\n int r1 = r6.cdT // Catch:{ all -> 0x005a }\n long r4 = (long) r1 // Catch:{ all -> 0x005a }\n long r4 = r4 - r2\n int r1 = (int) r4 // Catch:{ all -> 0x005a }\n r6.cdT = r1 // Catch:{ all -> 0x005a }\n int r0 = r0 + 1\n goto L_0x000c\n L_0x0058:\n monitor-exit(r6)\n return\n L_0x005a:\n r0 = move-exception\n monitor-exit(r6)\n throw r0\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.introvd.template.common.bitmapfun.util.DiskLruCache.flushCache():void\");\n }", "@SuppressWarnings(\"unused\")\n private void _read() {\n }", "private void b044904490449щ0449щ() {\n /*\n r7 = this;\n r0 = new rrrrrr.ccrcrc;\n r1 = new java.lang.StringBuilder;\n r1.<init>();\n r2 = r7.bнн043Dннн;\n r2 = com.immersion.aws.analytics.ImmrAnalytics.b044C044C044C044Cьь(r2);\n r2 = r2.getFilesDir();\n r1 = r1.append(r2);\n r2 = java.io.File.separator;\n r1 = r1.append(r2);\n L_0x001b:\n r2 = 1;\n switch(r2) {\n case 0: goto L_0x001b;\n case 1: goto L_0x0024;\n default: goto L_0x001f;\n };\n L_0x001f:\n r2 = 0;\n switch(r2) {\n case 0: goto L_0x0024;\n case 1: goto L_0x001b;\n default: goto L_0x0023;\n };\n L_0x0023:\n goto L_0x001f;\n L_0x0024:\n r2 = \"3HC4C-01.txt\";\n r1 = r1.append(r2);\n r1 = r1.toString();\n r0.<init>(r1);\n r0.load();\n L_0x0034:\n r1 = r0.size();\n if (r1 <= 0) goto L_0x007a;\n L_0x003a:\n r1 = r0.peek();\n r2 = new rrrrrr.rcccrr;\n r2.<init>();\n r3 = r7.bнн043Dннн;\n r3 = com.immersion.aws.analytics.ImmrAnalytics.b044Cь044C044Cьь(r3);\n monitor-enter(r3);\n r4 = r7.bнн043Dннн;\t Catch:{ all -> 0x0074 }\n r4 = com.immersion.aws.analytics.ImmrAnalytics.bь044C044C044Cьь(r4);\t Catch:{ all -> 0x0074 }\n r4 = r4.bЛ041B041BЛ041BЛ;\t Catch:{ all -> 0x0074 }\n r5 = r7.bнн043Dннн;\t Catch:{ all -> 0x0074 }\n r5 = com.immersion.aws.analytics.ImmrAnalytics.bь044C044C044Cьь(r5);\t Catch:{ all -> 0x0074 }\n r5 = r5.b041B041B041BЛ041BЛ;\t Catch:{ all -> 0x0074 }\n r6 = r7.bнн043Dннн;\t Catch:{ all -> 0x0074 }\n r6 = com.immersion.aws.analytics.ImmrAnalytics.bь044C044C044Cьь(r6);\t Catch:{ all -> 0x0074 }\n r6 = r6.bЛЛЛ041B041BЛ;\t Catch:{ all -> 0x0074 }\n monitor-exit(r3);\t Catch:{ all -> 0x0074 }\n r1 = r2.sendHttpRequestFromCache(r4, r5, r6, r1);\n if (r1 == 0) goto L_0x0077;\n L_0x0069:\n if (r4 == 0) goto L_0x0077;\n L_0x006b:\n if (r5 == 0) goto L_0x0077;\n L_0x006d:\n r0.remove();\n r0.save();\n goto L_0x0034;\n L_0x0074:\n r0 = move-exception;\n monitor-exit(r3);\t Catch:{ all -> 0x0074 }\n throw r0;\n L_0x0077:\n r0.save();\n L_0x007a:\n return;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: rrrrrr.cccccr.b044904490449щ0449щ():void\");\n }", "@Override\n\tprotected void update() {\n\t\t\n\t}", "@Override\r\n\tprotected void processFinish() {\n\r\n\t}", "@Override\r\n\tprotected void processFinish() {\n\r\n\t}", "@Override\r\n\tprotected void processFinish() {\n\r\n\t}", "public final void run() {\n /*\n r7 = this;\n r1 = r7.zzasj;\n monitor-enter(r1);\n r0 = r7.zzasi;\t Catch:{ RemoteException -> 0x006e }\n r0 = r0.zzasc;\t Catch:{ RemoteException -> 0x006e }\n if (r0 != 0) goto L_0x0034;\n L_0x000b:\n r0 = r7.zzasi;\t Catch:{ RemoteException -> 0x006e }\n r0 = r0.zzgt();\t Catch:{ RemoteException -> 0x006e }\n r0 = r0.zzjg();\t Catch:{ RemoteException -> 0x006e }\n r2 = \"Failed to get user properties\";\n r3 = r7.zzagj;\t Catch:{ RemoteException -> 0x006e }\n r3 = com.google.android.gms.measurement.internal.zzas.zzbw(r3);\t Catch:{ RemoteException -> 0x006e }\n r4 = r7.zzads;\t Catch:{ RemoteException -> 0x006e }\n r5 = r7.zzadz;\t Catch:{ RemoteException -> 0x006e }\n r0.zzd(r2, r3, r4, r5);\t Catch:{ RemoteException -> 0x006e }\n r0 = r7.zzasj;\t Catch:{ RemoteException -> 0x006e }\n r2 = java.util.Collections.emptyList();\t Catch:{ RemoteException -> 0x006e }\n r0.set(r2);\t Catch:{ RemoteException -> 0x006e }\n r0 = r7.zzasj;\t Catch:{ all -> 0x0059 }\n r0.notify();\t Catch:{ all -> 0x0059 }\n monitor-exit(r1);\t Catch:{ all -> 0x0059 }\n L_0x0033:\n return;\n L_0x0034:\n r2 = r7.zzagj;\t Catch:{ RemoteException -> 0x006e }\n r2 = android.text.TextUtils.isEmpty(r2);\t Catch:{ RemoteException -> 0x006e }\n if (r2 == 0) goto L_0x005c;\n L_0x003c:\n r2 = r7.zzasj;\t Catch:{ RemoteException -> 0x006e }\n r3 = r7.zzads;\t Catch:{ RemoteException -> 0x006e }\n r4 = r7.zzadz;\t Catch:{ RemoteException -> 0x006e }\n r5 = r7.zzaeg;\t Catch:{ RemoteException -> 0x006e }\n r6 = r7.zzaqk;\t Catch:{ RemoteException -> 0x006e }\n r0 = r0.zza(r3, r4, r5, r6);\t Catch:{ RemoteException -> 0x006e }\n r2.set(r0);\t Catch:{ RemoteException -> 0x006e }\n L_0x004d:\n r0 = r7.zzasi;\t Catch:{ RemoteException -> 0x006e }\n r0.zzcy();\t Catch:{ RemoteException -> 0x006e }\n r0 = r7.zzasj;\t Catch:{ all -> 0x0059 }\n r0.notify();\t Catch:{ all -> 0x0059 }\n L_0x0057:\n monitor-exit(r1);\t Catch:{ all -> 0x0059 }\n goto L_0x0033;\n L_0x0059:\n r0 = move-exception;\n monitor-exit(r1);\t Catch:{ all -> 0x0059 }\n throw r0;\n L_0x005c:\n r2 = r7.zzasj;\t Catch:{ RemoteException -> 0x006e }\n r3 = r7.zzagj;\t Catch:{ RemoteException -> 0x006e }\n r4 = r7.zzads;\t Catch:{ RemoteException -> 0x006e }\n r5 = r7.zzadz;\t Catch:{ RemoteException -> 0x006e }\n r6 = r7.zzaeg;\t Catch:{ RemoteException -> 0x006e }\n r0 = r0.zza(r3, r4, r5, r6);\t Catch:{ RemoteException -> 0x006e }\n r2.set(r0);\t Catch:{ RemoteException -> 0x006e }\n goto L_0x004d;\n L_0x006e:\n r0 = move-exception;\n r2 = r7.zzasi;\t Catch:{ all -> 0x0095 }\n r2 = r2.zzgt();\t Catch:{ all -> 0x0095 }\n r2 = r2.zzjg();\t Catch:{ all -> 0x0095 }\n r3 = \"Failed to get user properties\";\n r4 = r7.zzagj;\t Catch:{ all -> 0x0095 }\n r4 = com.google.android.gms.measurement.internal.zzas.zzbw(r4);\t Catch:{ all -> 0x0095 }\n r5 = r7.zzads;\t Catch:{ all -> 0x0095 }\n r2.zzd(r3, r4, r5, r0);\t Catch:{ all -> 0x0095 }\n r0 = r7.zzasj;\t Catch:{ all -> 0x0095 }\n r2 = java.util.Collections.emptyList();\t Catch:{ all -> 0x0095 }\n r0.set(r2);\t Catch:{ all -> 0x0095 }\n r0 = r7.zzasj;\t Catch:{ all -> 0x0059 }\n r0.notify();\t Catch:{ all -> 0x0059 }\n goto L_0x0057;\n L_0x0095:\n r0 = move-exception;\n r2 = r7.zzasj;\t Catch:{ all -> 0x0059 }\n r2.notify();\t Catch:{ all -> 0x0059 }\n throw r0;\t Catch:{ all -> 0x0059 }\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.measurement.internal.zzep.run():void\");\n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "public final void run() {\n /*\n r6 = this;\n r1 = r6.zzapo;\n monitor-enter(r1);\n r0 = r6.zzapn;\t Catch:{ RemoteException -> 0x006b }\n r0 = r0.zzaph;\t Catch:{ RemoteException -> 0x006b }\n if (r0 != 0) goto L_0x0035;\n L_0x000b:\n r0 = r6.zzapn;\t Catch:{ RemoteException -> 0x006b }\n r0 = r0.zzgf();\t Catch:{ RemoteException -> 0x006b }\n r0 = r0.zzis();\t Catch:{ RemoteException -> 0x006b }\n r2 = \"Failed to get conditional properties\";\n r3 = r6.zzant;\t Catch:{ RemoteException -> 0x006b }\n r3 = com.google.android.gms.internal.measurement.zzfh.zzbl(r3);\t Catch:{ RemoteException -> 0x006b }\n r4 = r6.zzanr;\t Catch:{ RemoteException -> 0x006b }\n r5 = r6.zzans;\t Catch:{ RemoteException -> 0x006b }\n r0.zzd(r2, r3, r4, r5);\t Catch:{ RemoteException -> 0x006b }\n r0 = r6.zzapo;\t Catch:{ RemoteException -> 0x006b }\n r2 = java.util.Collections.emptyList();\t Catch:{ RemoteException -> 0x006b }\n r0.set(r2);\t Catch:{ RemoteException -> 0x006b }\n r0 = r6.zzapo;\t Catch:{ all -> 0x0058 }\n r0.notify();\t Catch:{ all -> 0x0058 }\n monitor-exit(r1);\t Catch:{ all -> 0x0058 }\n L_0x0034:\n return;\n L_0x0035:\n r2 = r6.zzant;\t Catch:{ RemoteException -> 0x006b }\n r2 = android.text.TextUtils.isEmpty(r2);\t Catch:{ RemoteException -> 0x006b }\n if (r2 == 0) goto L_0x005b;\n L_0x003d:\n r2 = r6.zzapo;\t Catch:{ RemoteException -> 0x006b }\n r3 = r6.zzanr;\t Catch:{ RemoteException -> 0x006b }\n r4 = r6.zzans;\t Catch:{ RemoteException -> 0x006b }\n r5 = r6.zzano;\t Catch:{ RemoteException -> 0x006b }\n r0 = r0.zza(r3, r4, r5);\t Catch:{ RemoteException -> 0x006b }\n r2.set(r0);\t Catch:{ RemoteException -> 0x006b }\n L_0x004c:\n r0 = r6.zzapn;\t Catch:{ RemoteException -> 0x006b }\n r0.zzcu();\t Catch:{ RemoteException -> 0x006b }\n r0 = r6.zzapo;\t Catch:{ all -> 0x0058 }\n r0.notify();\t Catch:{ all -> 0x0058 }\n L_0x0056:\n monitor-exit(r1);\t Catch:{ all -> 0x0058 }\n goto L_0x0034;\n L_0x0058:\n r0 = move-exception;\n monitor-exit(r1);\t Catch:{ all -> 0x0058 }\n throw r0;\n L_0x005b:\n r2 = r6.zzapo;\t Catch:{ RemoteException -> 0x006b }\n r3 = r6.zzant;\t Catch:{ RemoteException -> 0x006b }\n r4 = r6.zzanr;\t Catch:{ RemoteException -> 0x006b }\n r5 = r6.zzans;\t Catch:{ RemoteException -> 0x006b }\n r0 = r0.zze(r3, r4, r5);\t Catch:{ RemoteException -> 0x006b }\n r2.set(r0);\t Catch:{ RemoteException -> 0x006b }\n goto L_0x004c;\n L_0x006b:\n r0 = move-exception;\n r2 = r6.zzapn;\t Catch:{ all -> 0x0093 }\n r2 = r2.zzgf();\t Catch:{ all -> 0x0093 }\n r2 = r2.zzis();\t Catch:{ all -> 0x0093 }\n r3 = \"Failed to get conditional properties\";\n r4 = r6.zzant;\t Catch:{ all -> 0x0093 }\n r4 = com.google.android.gms.internal.measurement.zzfh.zzbl(r4);\t Catch:{ all -> 0x0093 }\n r5 = r6.zzanr;\t Catch:{ all -> 0x0093 }\n r2.zzd(r3, r4, r5, r0);\t Catch:{ all -> 0x0093 }\n r0 = r6.zzapo;\t Catch:{ all -> 0x0093 }\n r2 = java.util.Collections.emptyList();\t Catch:{ all -> 0x0093 }\n r0.set(r2);\t Catch:{ all -> 0x0093 }\n r0 = r6.zzapo;\t Catch:{ all -> 0x0058 }\n r0.notify();\t Catch:{ all -> 0x0058 }\n goto L_0x0056;\n L_0x0093:\n r0 = move-exception;\n r2 = r6.zzapo;\t Catch:{ all -> 0x0058 }\n r2.notify();\t Catch:{ all -> 0x0058 }\n throw r0;\t Catch:{ all -> 0x0058 }\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.internal.measurement.zzit.run():void\");\n }", "private TestsResultQueueEntry() {\n\t\t}", "private final void m110462aw() {\n if (this.f89224c != null) {\n DownloaderManagerHolder.m75524a().mo51669a(this.f89224c, hashCode());\n this.f89224c = null;\n }\n }", "protected void runBeforeIteration() {}", "private void m2139m() {\n /*\n r18 = this;\n r3 = 0;\n r0 = r18;\n r15 = r0.f1119g;\t Catch:{ FileNotFoundException -> 0x0023 }\n r0 = r18;\n r0 = r0.f1120h;\t Catch:{ FileNotFoundException -> 0x0023 }\n r16 = r0;\n r3 = r15.openFileInput(r16);\t Catch:{ FileNotFoundException -> 0x0023 }\n r8 = android.util.Xml.newPullParser();\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r15 = 0;\n r8.setInput(r3, r15);\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r12 = 0;\n L_0x0018:\n r15 = 1;\n if (r12 == r15) goto L_0x0025;\n L_0x001b:\n r15 = 2;\n if (r12 == r15) goto L_0x0025;\n L_0x001e:\n r12 = r8.next();\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n goto L_0x0018;\n L_0x0023:\n r4 = move-exception;\n L_0x0024:\n return;\n L_0x0025:\n r15 = \"historical-records\";\n r16 = r8.getName();\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r15 = r15.equals(r16);\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n if (r15 != 0) goto L_0x0062;\n L_0x0031:\n r15 = new org.xmlpull.v1.XmlPullParserException;\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r16 = \"Share records file does not start with historical-records tag.\";\n r15.<init>(r16);\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n throw r15;\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n L_0x0039:\n r14 = move-exception;\n r15 = f1113a;\t Catch:{ all -> 0x00e9 }\n r16 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00e9 }\n r16.<init>();\t Catch:{ all -> 0x00e9 }\n r17 = \"Error reading historical recrod file: \";\n r16 = r16.append(r17);\t Catch:{ all -> 0x00e9 }\n r0 = r18;\n r0 = r0.f1120h;\t Catch:{ all -> 0x00e9 }\n r17 = r0;\n r16 = r16.append(r17);\t Catch:{ all -> 0x00e9 }\n r16 = r16.toString();\t Catch:{ all -> 0x00e9 }\n r0 = r16;\n android.util.Log.e(r15, r0, r14);\t Catch:{ all -> 0x00e9 }\n if (r3 == 0) goto L_0x0024;\n L_0x005c:\n r3.close();\t Catch:{ IOException -> 0x0060 }\n goto L_0x0024;\n L_0x0060:\n r15 = move-exception;\n goto L_0x0024;\n L_0x0062:\n r0 = r18;\n r5 = r0.f1118f;\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r5.clear();\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n L_0x0069:\n r12 = r8.next();\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r15 = 1;\n if (r12 != r15) goto L_0x0078;\n L_0x0070:\n if (r3 == 0) goto L_0x0024;\n L_0x0072:\n r3.close();\t Catch:{ IOException -> 0x0076 }\n goto L_0x0024;\n L_0x0076:\n r15 = move-exception;\n goto L_0x0024;\n L_0x0078:\n r15 = 3;\n if (r12 == r15) goto L_0x0069;\n L_0x007b:\n r15 = 4;\n if (r12 == r15) goto L_0x0069;\n L_0x007e:\n r7 = r8.getName();\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r15 = \"historical-record\";\n r15 = r15.equals(r7);\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n if (r15 != 0) goto L_0x00bd;\n L_0x008a:\n r15 = new org.xmlpull.v1.XmlPullParserException;\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r16 = \"Share records file not well-formed.\";\n r15.<init>(r16);\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n throw r15;\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n L_0x0092:\n r6 = move-exception;\n r15 = f1113a;\t Catch:{ all -> 0x00e9 }\n r16 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00e9 }\n r16.<init>();\t Catch:{ all -> 0x00e9 }\n r17 = \"Error reading historical recrod file: \";\n r16 = r16.append(r17);\t Catch:{ all -> 0x00e9 }\n r0 = r18;\n r0 = r0.f1120h;\t Catch:{ all -> 0x00e9 }\n r17 = r0;\n r16 = r16.append(r17);\t Catch:{ all -> 0x00e9 }\n r16 = r16.toString();\t Catch:{ all -> 0x00e9 }\n r0 = r16;\n android.util.Log.e(r15, r0, r6);\t Catch:{ all -> 0x00e9 }\n if (r3 == 0) goto L_0x0024;\n L_0x00b5:\n r3.close();\t Catch:{ IOException -> 0x00ba }\n goto L_0x0024;\n L_0x00ba:\n r15 = move-exception;\n goto L_0x0024;\n L_0x00bd:\n r15 = 0;\n r16 = \"activity\";\n r0 = r16;\n r2 = r8.getAttributeValue(r15, r0);\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r15 = 0;\n r16 = \"time\";\n r0 = r16;\n r15 = r8.getAttributeValue(r15, r0);\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r10 = java.lang.Long.parseLong(r15);\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r15 = 0;\n r16 = \"weight\";\n r0 = r16;\n r15 = r8.getAttributeValue(r15, r0);\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r13 = java.lang.Float.parseFloat(r15);\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r9 = new android.support.v7.internal.widget.b$d;\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r9.<init>(r2, r10, r13);\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n r5.add(r9);\t Catch:{ XmlPullParserException -> 0x0039, IOException -> 0x0092 }\n goto L_0x0069;\n L_0x00e9:\n r15 = move-exception;\n if (r3 == 0) goto L_0x00ef;\n L_0x00ec:\n r3.close();\t Catch:{ IOException -> 0x00f0 }\n L_0x00ef:\n throw r15;\n L_0x00f0:\n r16 = move-exception;\n goto L_0x00ef;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: android.support.v7.internal.widget.b.m():void\");\n }", "@Override\n\tprotected void postRun() {\n\n\t}", "private final synchronized void zzem() {\n /*\n r5 = this;\n monitor-enter(r5);\n r0 = r5.zzvw;\t Catch:{ all -> 0x005b }\n r1 = \"save_data\";\n r2 = 0;\n r0 = r0.getString(r1, r2);\t Catch:{ all -> 0x005b }\n if (r0 != 0) goto L_0x000e;\n L_0x000c:\n monitor-exit(r5);\n return;\n L_0x000e:\n r1 = new org.json.JSONObject;\t Catch:{ JSONException -> 0x0047 }\n r1.<init>(r0);\t Catch:{ JSONException -> 0x0047 }\n r0 = \"castSessionId\";\n r0 = r1.getString(r0);\t Catch:{ JSONException -> 0x0047 }\n r2 = r5.zzvx;\t Catch:{ JSONException -> 0x0047 }\n r0 = r2.equals(r0);\t Catch:{ JSONException -> 0x0047 }\n if (r0 == 0) goto L_0x0045;\n L_0x0021:\n r0 = \"playerTokenMap\";\n r0 = r1.getJSONObject(r0);\t Catch:{ JSONException -> 0x0047 }\n r1 = r0.keys();\t Catch:{ JSONException -> 0x0047 }\n L_0x002b:\n r2 = r1.hasNext();\t Catch:{ JSONException -> 0x0047 }\n if (r2 == 0) goto L_0x0041;\n L_0x0031:\n r2 = r1.next();\t Catch:{ JSONException -> 0x0047 }\n r2 = (java.lang.String) r2;\t Catch:{ JSONException -> 0x0047 }\n r3 = r5.zzvv;\t Catch:{ JSONException -> 0x0047 }\n r4 = r0.getString(r2);\t Catch:{ JSONException -> 0x0047 }\n r3.put(r2, r4);\t Catch:{ JSONException -> 0x0047 }\n goto L_0x002b;\n L_0x0041:\n r0 = 0;\n r5.zzwe = r0;\t Catch:{ JSONException -> 0x0047 }\n L_0x0045:\n monitor-exit(r5);\n return;\n L_0x0047:\n r0 = move-exception;\n r1 = zzbf;\t Catch:{ all -> 0x005b }\n r2 = \"Error while loading data: %s\";\n r3 = 1;\n r3 = new java.lang.Object[r3];\t Catch:{ all -> 0x005b }\n r4 = 0;\n r0 = r0.getMessage();\t Catch:{ all -> 0x005b }\n r3[r4] = r0;\t Catch:{ all -> 0x005b }\n r1.w(r2, r3);\t Catch:{ all -> 0x005b }\n monitor-exit(r5);\n return;\n L_0x005b:\n r0 = move-exception;\n monitor-exit(r5);\n throw r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.google.android.gms.internal.cast.zzcb.zzem():void\");\n }", "@Override\n public void func_104112_b() {\n \n }", "private void remplirFabricantData() {\n\t}", "private void updateInternalState()\n {\n m_isCodePointHiragana_ = false;\n m_buffer_.setLength(0);\n m_bufferOffset_ = -1;\n m_CEBufferOffset_ = 0;\n m_CEBufferSize_ = 0;\n m_FCDLimit_ = -1;\n m_FCDStart_ = m_source_.getLength();\n //m_isHiragana4_ = m_collator_.m_isHiragana4_;\n m_isForwards_ = true;\n }", "@Override\n public void sync(){\n }", "@Override\r\n\tprotected void prepare()\r\n\t{\r\n\r\n\t}", "@Override\r\n\tprotected void doF8() {\n\t\t\r\n\t}", "private stendhal() {\n\t}", "@Override\n public Object preProcess() {\n return null;\n }", "protected void reInitialize() {\n resetCurrent();\n incrementIterCount();\n setFirst(true);\n recoverRunningVersion();\n }", "@Override\n\tpublic void preBacktrack() {\n\t\t\n\t}", "@Override\n\tprotected void prepare() {\n\t\t\n\t}", "@Override\n public void onCancelled(CancelledException arg0) {\n }", "@Override\n public void onCancelled(CancelledException arg0) {\n }", "@Override\r\n\tprotected void doF4() {\n\t\t\r\n\t}", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "public final void mo91715d() {\n }", "@Override\n public void preRun() {\n super.preRun();\n }", "@Override\r\n\tpublic void runn() {\n\t\t\r\n\t}", "@Override\r\n\t\t\t\tpublic void run() {\n\r\n\t\t\t\t}", "@Override\r\n\t\t\t\tpublic void run() {\n\r\n\t\t\t\t}", "@Override\r\n\tprotected void processInit() {\n\r\n\t}", "public void run() {\n /*\n r18 = this;\n r3 = 0;\n r10 = 0;\n r0 = r18;\n r13 = com.actionbarsherlock.widget.ActivityChooserModel.this;\n r14 = r13.mInstanceLock;\n monitor-enter(r14);\n r11 = new java.util.ArrayList;\t Catch:{ all -> 0x005c }\n r0 = r18;\n r13 = com.actionbarsherlock.widget.ActivityChooserModel.this;\t Catch:{ all -> 0x005c }\n r13 = r13.mHistoricalRecords;\t Catch:{ all -> 0x005c }\n r11.<init>(r13);\t Catch:{ all -> 0x005c }\n monitor-exit(r14);\t Catch:{ all -> 0x0142 }\n r0 = r18;\n r13 = com.actionbarsherlock.widget.ActivityChooserModel.this;\t Catch:{ FileNotFoundException -> 0x005f }\n r13 = r13.mContext;\t Catch:{ FileNotFoundException -> 0x005f }\n r0 = r18;\n r14 = com.actionbarsherlock.widget.ActivityChooserModel.this;\t Catch:{ FileNotFoundException -> 0x005f }\n r14 = r14.mHistoryFileName;\t Catch:{ FileNotFoundException -> 0x005f }\n r15 = 0;\n r3 = r13.openFileOutput(r14, r15);\t Catch:{ FileNotFoundException -> 0x005f }\n r12 = android.util.Xml.newSerializer();\n r13 = 0;\n r12.setOutput(r3, r13);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r13 = \"UTF-8\";\n r14 = 1;\n r14 = java.lang.Boolean.valueOf(r14);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r12.startDocument(r13, r14);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r13 = 0;\n r14 = \"historical-records\";\n r12.startTag(r13, r14);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r9 = r11.size();\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r4 = 0;\n L_0x004b:\n if (r4 < r9) goto L_0x007f;\n L_0x004d:\n r13 = 0;\n r14 = \"historical-records\";\n r12.endTag(r13, r14);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r12.endDocument();\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n if (r3 == 0) goto L_0x005b;\n L_0x0058:\n r3.close();\t Catch:{ IOException -> 0x013f }\n L_0x005b:\n return;\n L_0x005c:\n r13 = move-exception;\n L_0x005d:\n monitor-exit(r14);\t Catch:{ all -> 0x005c }\n throw r13;\n L_0x005f:\n r2 = move-exception;\n r13 = com.actionbarsherlock.widget.ActivityChooserModel.LOG_TAG;\n r14 = new java.lang.StringBuilder;\n r15 = \"Error writing historical recrod file: \";\n r14.<init>(r15);\n r0 = r18;\n r15 = com.actionbarsherlock.widget.ActivityChooserModel.this;\n r15 = r15.mHistoryFileName;\n r14 = r14.append(r15);\n r14 = r14.toString();\n android.util.Log.e(r13, r14, r2);\n goto L_0x005b;\n L_0x007f:\n r13 = 0;\n r8 = r11.remove(r13);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r8 = (com.actionbarsherlock.widget.ActivityChooserModel.HistoricalRecord) r8;\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r13 = 0;\n r14 = \"historical-record\";\n r12.startTag(r13, r14);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r13 = 0;\n r14 = \"activity\";\n r15 = r8.activity;\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r15 = r15.flattenToString();\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r12.attribute(r13, r14, r15);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r13 = 0;\n r14 = \"time\";\n r0 = r8.time;\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r16 = r0;\n r15 = java.lang.String.valueOf(r16);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r12.attribute(r13, r14, r15);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r13 = 0;\n r14 = \"weight\";\n r15 = r8.weight;\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r15 = java.lang.String.valueOf(r15);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r12.attribute(r13, r14, r15);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r13 = 0;\n r14 = \"historical-record\";\n r12.endTag(r13, r14);\t Catch:{ IllegalArgumentException -> 0x00bb, IllegalStateException -> 0x00e4, IOException -> 0x010d }\n r4 = r4 + 1;\n goto L_0x004b;\n L_0x00bb:\n r5 = move-exception;\n r13 = com.actionbarsherlock.widget.ActivityChooserModel.LOG_TAG;\t Catch:{ all -> 0x0136 }\n r14 = new java.lang.StringBuilder;\t Catch:{ all -> 0x0136 }\n r15 = \"Error writing historical recrod file: \";\n r14.<init>(r15);\t Catch:{ all -> 0x0136 }\n r0 = r18;\n r15 = com.actionbarsherlock.widget.ActivityChooserModel.this;\t Catch:{ all -> 0x0136 }\n r15 = r15.mHistoryFileName;\t Catch:{ all -> 0x0136 }\n r14 = r14.append(r15);\t Catch:{ all -> 0x0136 }\n r14 = r14.toString();\t Catch:{ all -> 0x0136 }\n android.util.Log.e(r13, r14, r5);\t Catch:{ all -> 0x0136 }\n if (r3 == 0) goto L_0x005b;\n L_0x00dc:\n r3.close();\t Catch:{ IOException -> 0x00e1 }\n goto L_0x005b;\n L_0x00e1:\n r13 = move-exception;\n goto L_0x005b;\n L_0x00e4:\n r7 = move-exception;\n r13 = com.actionbarsherlock.widget.ActivityChooserModel.LOG_TAG;\t Catch:{ all -> 0x0136 }\n r14 = new java.lang.StringBuilder;\t Catch:{ all -> 0x0136 }\n r15 = \"Error writing historical recrod file: \";\n r14.<init>(r15);\t Catch:{ all -> 0x0136 }\n r0 = r18;\n r15 = com.actionbarsherlock.widget.ActivityChooserModel.this;\t Catch:{ all -> 0x0136 }\n r15 = r15.mHistoryFileName;\t Catch:{ all -> 0x0136 }\n r14 = r14.append(r15);\t Catch:{ all -> 0x0136 }\n r14 = r14.toString();\t Catch:{ all -> 0x0136 }\n android.util.Log.e(r13, r14, r7);\t Catch:{ all -> 0x0136 }\n if (r3 == 0) goto L_0x005b;\n L_0x0105:\n r3.close();\t Catch:{ IOException -> 0x010a }\n goto L_0x005b;\n L_0x010a:\n r13 = move-exception;\n goto L_0x005b;\n L_0x010d:\n r6 = move-exception;\n r13 = com.actionbarsherlock.widget.ActivityChooserModel.LOG_TAG;\t Catch:{ all -> 0x0136 }\n r14 = new java.lang.StringBuilder;\t Catch:{ all -> 0x0136 }\n r15 = \"Error writing historical recrod file: \";\n r14.<init>(r15);\t Catch:{ all -> 0x0136 }\n r0 = r18;\n r15 = com.actionbarsherlock.widget.ActivityChooserModel.this;\t Catch:{ all -> 0x0136 }\n r15 = r15.mHistoryFileName;\t Catch:{ all -> 0x0136 }\n r14 = r14.append(r15);\t Catch:{ all -> 0x0136 }\n r14 = r14.toString();\t Catch:{ all -> 0x0136 }\n android.util.Log.e(r13, r14, r6);\t Catch:{ all -> 0x0136 }\n if (r3 == 0) goto L_0x005b;\n L_0x012e:\n r3.close();\t Catch:{ IOException -> 0x0133 }\n goto L_0x005b;\n L_0x0133:\n r13 = move-exception;\n goto L_0x005b;\n L_0x0136:\n r13 = move-exception;\n if (r3 == 0) goto L_0x013c;\n L_0x0139:\n r3.close();\t Catch:{ IOException -> 0x013d }\n L_0x013c:\n throw r13;\n L_0x013d:\n r14 = move-exception;\n goto L_0x013c;\n L_0x013f:\n r13 = move-exception;\n goto L_0x005b;\n L_0x0142:\n r13 = move-exception;\n r10 = r11;\n goto L_0x005d;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.actionbarsherlock.widget.ActivityChooserModel.HistoryPersister.run():void\");\n }", "@Override // androidx.databinding.ViewDataBinding\n /* renamed from: d */\n public void mo5926d() {\n synchronized (this) {\n long j = this.f67002l;\n this.f67002l = 0;\n }\n }", "protected void additionalProcessing() {\n\t}", "private void optimiseEVProfile()\n\t{\n\t}", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\r\n \tpublic void process() {\n \t\t\r\n \t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "public void mo4058a() {\n imageCacheStatsTracker.mo4071e();\n }", "@android.annotation.SuppressLint({\"NewApi\"})\n private void listRoots() {\n /*\n r23 = this;\n r21 = 0;\n r0 = r21;\n r1 = r23;\n r1.currentDir = r0;\n r0 = r23;\n r0 = r0.items;\n r21 = r0;\n r21.clear();\n r17 = new java.util.HashSet;\n r17.<init>();\n r21 = android.os.Environment.getExternalStorageDirectory();\n r5 = r21.getPath();\n r12 = android.os.Environment.isExternalStorageRemovable();\n r6 = android.os.Environment.getExternalStorageState();\n r21 = \"mounted\";\n r0 = r21;\n r21 = r6.equals(r0);\n if (r21 != 0) goto L_0x003c;\n L_0x0031:\n r21 = \"mounted_ro\";\n r0 = r21;\n r21 = r6.equals(r0);\n if (r21 == 0) goto L_0x0084;\n L_0x003c:\n r8 = new org.telegram.ui.DocumentSelectActivity$ListItem;\n r21 = 0;\n r0 = r23;\n r1 = r21;\n r8.<init>();\n r21 = android.os.Environment.isExternalStorageRemovable();\n if (r21 == 0) goto L_0x02ae;\n L_0x004d:\n r21 = \"SdCard\";\n r22 = 2131494825; // 0x7f0c07a9 float:1.861317E38 double:1.0530983673E-314;\n r21 = org.telegram.messenger.LocaleController.getString(r21, r22);\n r0 = r21;\n r8.title = r0;\n r21 = 2131165433; // 0x7f0700f9 float:1.7945083E38 double:1.052935626E-314;\n r0 = r21;\n r8.icon = r0;\n L_0x0062:\n r0 = r23;\n r21 = r0.getRootSubtitle(r5);\n r0 = r21;\n r8.subtitle = r0;\n r21 = android.os.Environment.getExternalStorageDirectory();\n r0 = r21;\n r8.file = r0;\n r0 = r23;\n r0 = r0.items;\n r21 = r0;\n r0 = r21;\n r0.add(r8);\n r0 = r17;\n r0.add(r5);\n L_0x0084:\n r3 = 0;\n r4 = new java.io.BufferedReader;\t Catch:{ Exception -> 0x0302 }\n r21 = new java.io.FileReader;\t Catch:{ Exception -> 0x0302 }\n r22 = \"/proc/mounts\";\n r21.<init>(r22);\t Catch:{ Exception -> 0x0302 }\n r0 = r21;\n r4.<init>(r0);\t Catch:{ Exception -> 0x0302 }\n L_0x0094:\n r14 = r4.readLine();\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r14 == 0) goto L_0x02dd;\n L_0x009a:\n r21 = \"vfat\";\n r0 = r21;\n r21 = r14.contains(r0);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r21 != 0) goto L_0x00b0;\n L_0x00a5:\n r21 = \"/mnt\";\n r0 = r21;\n r21 = r14.contains(r0);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r21 == 0) goto L_0x0094;\n L_0x00b0:\n r21 = org.telegram.messenger.BuildVars.LOGS_ENABLED;\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r21 == 0) goto L_0x00b7;\n L_0x00b4:\n org.telegram.messenger.FileLog.d(r14);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n L_0x00b7:\n r19 = new java.util.StringTokenizer;\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r21 = \" \";\n r0 = r19;\n r1 = r21;\n r0.<init>(r14, r1);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r20 = r19.nextToken();\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r16 = r19.nextToken();\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r0 = r17;\n r1 = r16;\n r21 = r0.contains(r1);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r21 != 0) goto L_0x0094;\n L_0x00d5:\n r21 = \"/dev/block/vold\";\n r0 = r21;\n r21 = r14.contains(r0);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r21 == 0) goto L_0x0094;\n L_0x00e0:\n r21 = \"/mnt/secure\";\n r0 = r21;\n r21 = r14.contains(r0);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r21 != 0) goto L_0x0094;\n L_0x00eb:\n r21 = \"/mnt/asec\";\n r0 = r21;\n r21 = r14.contains(r0);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r21 != 0) goto L_0x0094;\n L_0x00f6:\n r21 = \"/mnt/obb\";\n r0 = r21;\n r21 = r14.contains(r0);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r21 != 0) goto L_0x0094;\n L_0x0101:\n r21 = \"/dev/mapper\";\n r0 = r21;\n r21 = r14.contains(r0);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r21 != 0) goto L_0x0094;\n L_0x010c:\n r21 = \"tmpfs\";\n r0 = r21;\n r21 = r14.contains(r0);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r21 != 0) goto L_0x0094;\n L_0x0117:\n r21 = new java.io.File;\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r0 = r21;\n r1 = r16;\n r0.<init>(r1);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r21 = r21.isDirectory();\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r21 != 0) goto L_0x0163;\n L_0x0126:\n r21 = 47;\n r0 = r16;\n r1 = r21;\n r11 = r0.lastIndexOf(r1);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r21 = -1;\n r0 = r21;\n if (r11 == r0) goto L_0x0163;\n L_0x0136:\n r21 = new java.lang.StringBuilder;\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r21.<init>();\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r22 = \"/storage/\";\n r21 = r21.append(r22);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r22 = r11 + 1;\n r0 = r16;\n r1 = r22;\n r22 = r0.substring(r1);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r21 = r21.append(r22);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r15 = r21.toString();\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r21 = new java.io.File;\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r0 = r21;\n r0.<init>(r15);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r21 = r21.isDirectory();\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n if (r21 == 0) goto L_0x0163;\n L_0x0161:\n r16 = r15;\n L_0x0163:\n r0 = r17;\n r1 = r16;\n r0.add(r1);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n r13 = new org.telegram.ui.DocumentSelectActivity$ListItem;\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n r21 = 0;\n r0 = r23;\n r1 = r21;\n r13.<init>();\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n r21 = r16.toLowerCase();\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n r22 = \"sd\";\n r21 = r21.contains(r22);\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n if (r21 == 0) goto L_0x02c5;\n L_0x0182:\n r21 = \"SdCard\";\n r22 = 2131494825; // 0x7f0c07a9 float:1.861317E38 double:1.0530983673E-314;\n r21 = org.telegram.messenger.LocaleController.getString(r21, r22);\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n r0 = r21;\n r13.title = r0;\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n L_0x0190:\n r21 = 2131165433; // 0x7f0700f9 float:1.7945083E38 double:1.052935626E-314;\n r0 = r21;\n r13.icon = r0;\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n r0 = r23;\n r1 = r16;\n r21 = r0.getRootSubtitle(r1);\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n r0 = r21;\n r13.subtitle = r0;\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n r21 = new java.io.File;\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n r0 = r21;\n r1 = r16;\n r0.<init>(r1);\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n r0 = r21;\n r13.file = r0;\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n r0 = r23;\n r0 = r0.items;\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n r21 = r0;\n r0 = r21;\n r0.add(r13);\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n goto L_0x0094;\n L_0x01bd:\n r7 = move-exception;\n org.telegram.messenger.FileLog.e(r7);\t Catch:{ Exception -> 0x01c3, all -> 0x02d5 }\n goto L_0x0094;\n L_0x01c3:\n r7 = move-exception;\n r3 = r4;\n L_0x01c5:\n org.telegram.messenger.FileLog.e(r7);\t Catch:{ all -> 0x0300 }\n if (r3 == 0) goto L_0x01cd;\n L_0x01ca:\n r3.close();\t Catch:{ Exception -> 0x02ec }\n L_0x01cd:\n r9 = new org.telegram.ui.DocumentSelectActivity$ListItem;\n r21 = 0;\n r0 = r23;\n r1 = r21;\n r9.<init>();\n r21 = \"/\";\n r0 = r21;\n r9.title = r0;\n r21 = \"SystemRoot\";\n r22 = 2131495071; // 0x7f0c089f float:1.8613668E38 double:1.053098489E-314;\n r21 = org.telegram.messenger.LocaleController.getString(r21, r22);\n r0 = r21;\n r9.subtitle = r0;\n r21 = 2131165426; // 0x7f0700f2 float:1.7945069E38 double:1.0529356226E-314;\n r0 = r21;\n r9.icon = r0;\n r21 = new java.io.File;\n r22 = \"/\";\n r21.<init>(r22);\n r0 = r21;\n r9.file = r0;\n r0 = r23;\n r0 = r0.items;\n r21 = r0;\n r0 = r21;\n r0.add(r9);\n r18 = new java.io.File;\t Catch:{ Exception -> 0x02f7 }\n r21 = android.os.Environment.getExternalStorageDirectory();\t Catch:{ Exception -> 0x02f7 }\n r22 = \"Telegram\";\n r0 = r18;\n r1 = r21;\n r2 = r22;\n r0.<init>(r1, r2);\t Catch:{ Exception -> 0x02f7 }\n r21 = r18.exists();\t Catch:{ Exception -> 0x02f7 }\n if (r21 == 0) goto L_0x0254;\n L_0x0223:\n r10 = new org.telegram.ui.DocumentSelectActivity$ListItem;\t Catch:{ Exception -> 0x02f7 }\n r21 = 0;\n r0 = r23;\n r1 = r21;\n r10.<init>();\t Catch:{ Exception -> 0x02f7 }\n r21 = \"Telegram\";\n r0 = r21;\n r10.title = r0;\t Catch:{ Exception -> 0x02fd }\n r21 = r18.toString();\t Catch:{ Exception -> 0x02fd }\n r0 = r21;\n r10.subtitle = r0;\t Catch:{ Exception -> 0x02fd }\n r21 = 2131165426; // 0x7f0700f2 float:1.7945069E38 double:1.0529356226E-314;\n r0 = r21;\n r10.icon = r0;\t Catch:{ Exception -> 0x02fd }\n r0 = r18;\n r10.file = r0;\t Catch:{ Exception -> 0x02fd }\n r0 = r23;\n r0 = r0.items;\t Catch:{ Exception -> 0x02fd }\n r21 = r0;\n r0 = r21;\n r0.add(r10);\t Catch:{ Exception -> 0x02fd }\n r9 = r10;\n L_0x0254:\n r9 = new org.telegram.ui.DocumentSelectActivity$ListItem;\n r21 = 0;\n r0 = r23;\n r1 = r21;\n r9.<init>();\n r21 = \"Gallery\";\n r22 = 2131493847; // 0x7f0c03d7 float:1.8611186E38 double:1.053097884E-314;\n r21 = org.telegram.messenger.LocaleController.getString(r21, r22);\n r0 = r21;\n r9.title = r0;\n r21 = \"GalleryInfo\";\n r22 = 2131493848; // 0x7f0c03d8 float:1.8611188E38 double:1.0530978846E-314;\n r21 = org.telegram.messenger.LocaleController.getString(r21, r22);\n r0 = r21;\n r9.subtitle = r0;\n r21 = 2131165529; // 0x7f070159 float:1.7945278E38 double:1.0529356735E-314;\n r0 = r21;\n r9.icon = r0;\n r21 = 0;\n r0 = r21;\n r9.file = r0;\n r0 = r23;\n r0 = r0.items;\n r21 = r0;\n r0 = r21;\n r0.add(r9);\n r0 = r23;\n r0 = r0.listView;\n r21 = r0;\n org.telegram.messenger.AndroidUtilities.clearDrawableAnimation(r21);\n r21 = 1;\n r0 = r21;\n r1 = r23;\n r1.scrolling = r0;\n r0 = r23;\n r0 = r0.listAdapter;\n r21 = r0;\n r21.notifyDataSetChanged();\n return;\n L_0x02ae:\n r21 = \"InternalStorage\";\n r22 = 2131493929; // 0x7f0c0429 float:1.8611352E38 double:1.0530979246E-314;\n r21 = org.telegram.messenger.LocaleController.getString(r21, r22);\n r0 = r21;\n r8.title = r0;\n r21 = 2131165528; // 0x7f070158 float:1.7945276E38 double:1.052935673E-314;\n r0 = r21;\n r8.icon = r0;\n goto L_0x0062;\n L_0x02c5:\n r21 = \"ExternalStorage\";\n r22 = 2131493730; // 0x7f0c0362 float:1.8610948E38 double:1.0530978263E-314;\n r21 = org.telegram.messenger.LocaleController.getString(r21, r22);\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n r0 = r21;\n r13.title = r0;\t Catch:{ Exception -> 0x01bd, all -> 0x02d5 }\n goto L_0x0190;\n L_0x02d5:\n r21 = move-exception;\n r3 = r4;\n L_0x02d7:\n if (r3 == 0) goto L_0x02dc;\n L_0x02d9:\n r3.close();\t Catch:{ Exception -> 0x02f2 }\n L_0x02dc:\n throw r21;\n L_0x02dd:\n if (r4 == 0) goto L_0x0305;\n L_0x02df:\n r4.close();\t Catch:{ Exception -> 0x02e5 }\n r3 = r4;\n goto L_0x01cd;\n L_0x02e5:\n r7 = move-exception;\n org.telegram.messenger.FileLog.e(r7);\n r3 = r4;\n goto L_0x01cd;\n L_0x02ec:\n r7 = move-exception;\n org.telegram.messenger.FileLog.e(r7);\n goto L_0x01cd;\n L_0x02f2:\n r7 = move-exception;\n org.telegram.messenger.FileLog.e(r7);\n goto L_0x02dc;\n L_0x02f7:\n r7 = move-exception;\n L_0x02f8:\n org.telegram.messenger.FileLog.e(r7);\n goto L_0x0254;\n L_0x02fd:\n r7 = move-exception;\n r9 = r10;\n goto L_0x02f8;\n L_0x0300:\n r21 = move-exception;\n goto L_0x02d7;\n L_0x0302:\n r7 = move-exception;\n goto L_0x01c5;\n L_0x0305:\n r3 = r4;\n goto L_0x01cd;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: org.telegram.ui.DocumentSelectActivity.listRoots():void\");\n }", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "@Override\r\n\t\t\tpublic void autInitProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autInitProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autInitProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autInitProcess() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void autInitProcess() {\n\t\t\t\t\r\n\t\t\t}", "public static void sync() {\n /*\n int r0 = android.os.Build.VERSION.SDK_INT\n r1 = 24\n if (r0 >= r1) goto L_0x001f\n java.io.File r0 = new java.io.File\n java.lang.String r1 = mStrPath\n r0.<init>(r1)\n r2 = 0\n java.io.FileInputStream r1 = new java.io.FileInputStream // Catch:{ Exception -> 0x0020, all -> 0x0030 }\n r1.<init>(r0) // Catch:{ Exception -> 0x0020, all -> 0x0030 }\n java.io.FileDescriptor r0 = r1.getFD() // Catch:{ Exception -> 0x0044 }\n r0.sync() // Catch:{ Exception -> 0x0044 }\n if (r1 == 0) goto L_0x001f\n r1.close() // Catch:{ Exception -> 0x003d }\n L_0x001f:\n return\n L_0x0020:\n r0 = move-exception\n r1 = r2\n L_0x0022:\n r0.printStackTrace() // Catch:{ all -> 0x0042 }\n if (r1 == 0) goto L_0x001f\n r1.close() // Catch:{ Exception -> 0x002b }\n goto L_0x001f\n L_0x002b:\n r0 = move-exception\n r0.printStackTrace()\n goto L_0x001f\n L_0x0030:\n r0 = move-exception\n r1 = r2\n L_0x0032:\n if (r1 == 0) goto L_0x0037\n r1.close() // Catch:{ Exception -> 0x0038 }\n L_0x0037:\n throw r0\n L_0x0038:\n r1 = move-exception\n r1.printStackTrace()\n goto L_0x0037\n L_0x003d:\n r0 = move-exception\n r0.printStackTrace()\n goto L_0x001f\n L_0x0042:\n r0 = move-exception\n goto L_0x0032\n L_0x0044:\n r0 = move-exception\n goto L_0x0022\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.syu.util.MySharePreference.sync():void\");\n }", "@Override\n public void retrack() {\n }", "@Override\r\n\tpublic void stehReagieren() {\r\n\t\t//\r\n\t}", "@Override // androidx.databinding.ViewDataBinding\n /* renamed from: d */\n public void mo5926d() {\n synchronized (this) {\n long j = this.f102361i;\n this.f102361i = 0;\n }\n }", "boolean scavengeSome()\r\n/* 472: */ {\r\n/* 473:505 */ Recycler.WeakOrderQueue cursor = this.cursor;\r\n/* 474: */ Recycler.WeakOrderQueue prev;\r\n/* 475:506 */ if (cursor == null)\r\n/* 476: */ {\r\n/* 477:507 */ Recycler.WeakOrderQueue prev = null;\r\n/* 478:508 */ cursor = this.head;\r\n/* 479:509 */ if (cursor == null) {\r\n/* 480:510 */ return false;\r\n/* 481: */ }\r\n/* 482: */ }\r\n/* 483: */ else\r\n/* 484: */ {\r\n/* 485:513 */ prev = this.prev;\r\n/* 486: */ }\r\n/* 487:516 */ boolean success = false;\r\n/* 488: */ do\r\n/* 489: */ {\r\n/* 490:518 */ if (cursor.transfer(this))\r\n/* 491: */ {\r\n/* 492:519 */ success = true;\r\n/* 493:520 */ break;\r\n/* 494: */ }\r\n/* 495:522 */ Recycler.WeakOrderQueue next = Recycler.WeakOrderQueue.access$1800(cursor);\r\n/* 496:523 */ if (Recycler.WeakOrderQueue.access$1900(cursor).get() == null)\r\n/* 497: */ {\r\n/* 498:527 */ if (cursor.hasFinalData()) {\r\n/* 499:529 */ while (cursor.transfer(this)) {\r\n/* 500:530 */ success = true;\r\n/* 501: */ }\r\n/* 502: */ }\r\n/* 503:537 */ if (prev != null) {\r\n/* 504:538 */ Recycler.WeakOrderQueue.access$1700(prev, next);\r\n/* 505: */ }\r\n/* 506: */ }\r\n/* 507: */ else\r\n/* 508: */ {\r\n/* 509:541 */ prev = cursor;\r\n/* 510: */ }\r\n/* 511:544 */ cursor = next;\r\n/* 512:546 */ } while ((cursor != null) && (!success));\r\n/* 513:548 */ this.prev = prev;\r\n/* 514:549 */ this.cursor = cursor;\r\n/* 515:550 */ return success;\r\n/* 516: */ }", "@Override\r\n\tprotected void processInit() {\n\t\t\r\n\t}", "@Override\n\t\tpublic void run() {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void run() {\n\t\t\t\n\t\t}", "protected abstract void trace_pre_updates();", "protected java.util.List x (java.lang.String r19){\n /*\n r18 = this;\n r0 = r18;\n r2 = r0.K;\n r0 = r19;\n r2 = r2.getAllSortStackTraces(r0);\n r2 = (java.util.List) r2;\n if (r2 == 0) goto L_0x000f;\n L_0x000e:\n return r2;\n L_0x000f:\n r12 = java.util.Collections.emptyList();\n r2 = r18.bp();\n r3 = r18.TaskHandler(r19);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n r4 = r2.setDrawable(r3);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n if (r4 != 0) goto L_0x0026;\n L_0x0021:\n r18.bq();\n r2 = r12;\n goto L_0x000e;\n L_0x0026:\n r13 = r2.getScaledMaximumFlingVelocity(r3);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n r14 = new java.io.ByteArrayOutputStream;\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n r2 = 2048; // 0x800 float:2.87E-42 double:1.0118E-320;\n r14.<creatCallTask>(r2);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n com.duokan.core.io.getTriangleEdge.setDrawable(r13, r14);\t Catch:{ all -> 0x00f2 }\n r2 = r14.toByteArray();\t Catch:{ all -> 0x00f2 }\n r2 = com.duokan.kernel.DkUtils.decodeSimpleDrm(r2);\t Catch:{ all -> 0x00f2 }\n r3 = new java.lang.String;\t Catch:{ all -> 0x00f2 }\n r4 = \"UTF-8\";\n r3.<creatCallTask>(r2, r4);\t Catch:{ all -> 0x00f2 }\n r2 = new org.json.JSONObject;\t Catch:{ all -> 0x00f2 }\n r2.<creatCallTask>(r3);\t Catch:{ all -> 0x00f2 }\n if (r2 != 0) goto L_0x0055;\n L_0x004a:\n com.duokan.core.io.getTriangleEdge.setDrawable(r13);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n com.duokan.core.io.getTriangleEdge.setDrawable(r14);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n r18.bq();\n r2 = r12;\n goto L_0x000e;\n L_0x0055:\n r3 = \"pictures\";\n r15 = com.duokan.reader.common.getPhysicalYPixels.setDrawable(r2, r3);\t Catch:{ all -> 0x00f2 }\n r16 = new java.util.ArrayList;\t Catch:{ all -> 0x00f2 }\n r2 = r15.length();\t Catch:{ all -> 0x00f2 }\n r0 = r16;\n r0.<creatCallTask>(r2);\t Catch:{ all -> 0x00f2 }\n r2 = 0;\n L_0x0067:\n r3 = r15.length();\t Catch:{ all -> 0x00f2 }\n if (r2 >= r3) goto L_0x00d0;\n L_0x006d:\n r3 = r15.getJSONObject(r2);\t Catch:{ all -> 0x00f2 }\n r4 = \"sm_md5\";\n r7 = r3.getString(r4);\t Catch:{ all -> 0x00f2 }\n r4 = \"sm_url\";\n r6 = r3.getString(r4);\t Catch:{ all -> 0x00f2 }\n r4 = \"sm_size\";\n r8 = r3.getLong(r4);\t Catch:{ all -> 0x00f2 }\n r4 = \"width\";\n r10 = r3.getInt(r4);\t Catch:{ all -> 0x00f2 }\n r4 = \"height\";\n r11 = r3.getInt(r4);\t Catch:{ all -> 0x00f2 }\n r3 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00f2 }\n r3.<creatCallTask>();\t Catch:{ all -> 0x00f2 }\n r0 = r19;\n r3 = r3.append(r0);\t Catch:{ all -> 0x00f2 }\n r4 = \".\";\n r3 = r3.append(r4);\t Catch:{ all -> 0x00f2 }\n r3 = r3.append(r2);\t Catch:{ all -> 0x00f2 }\n r4 = r3.toString();\t Catch:{ all -> 0x00f2 }\n r5 = new java.lang.String;\t Catch:{ all -> 0x00f2 }\n r3 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00f2 }\n r3.<creatCallTask>();\t Catch:{ all -> 0x00f2 }\n r17 = \"file:///stuffs/\";\n r0 = r17;\n r3 = r3.append(r0);\t Catch:{ all -> 0x00f2 }\n r3 = r3.append(r7);\t Catch:{ all -> 0x00f2 }\n r3 = r3.toString();\t Catch:{ all -> 0x00f2 }\n r5.<creatCallTask>(r3);\t Catch:{ all -> 0x00f2 }\n r3 = r18;\n r3 = r3.setDrawable(r4, r5, r6, r7, r8, r10, r11);\t Catch:{ all -> 0x00f2 }\n r0 = r16;\n r0.add(r3);\t Catch:{ all -> 0x00f2 }\n r2 = r2 + 1;\n goto L_0x0067;\n L_0x00d0:\n r0 = r18;\n r2 = r0.K;\t Catch:{ all -> 0x00f2 }\n r0 = r19;\n r1 = r16;\n r2.putIfAbsent(r0, r1);\t Catch:{ all -> 0x00f2 }\n r0 = r18;\n r2 = r0.K;\t Catch:{ all -> 0x00f2 }\n r0 = r19;\n r2 = r2.getAllSortStackTraces(r0);\t Catch:{ all -> 0x00f2 }\n r2 = (java.util.List) r2;\t Catch:{ all -> 0x00f2 }\n com.duokan.core.io.getTriangleEdge.setDrawable(r13);\t Catch:{ Throwable -> 0x0106, all -> 0x0101 }\n com.duokan.core.io.getTriangleEdge.setDrawable(r14);\t Catch:{ Throwable -> 0x0106, all -> 0x0101 }\n r18.bq();\n goto L_0x000e;\n L_0x00f2:\n r2 = move-exception;\n com.duokan.core.io.getTriangleEdge.setDrawable(r13);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n com.duokan.core.io.getTriangleEdge.setDrawable(r14);\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n throw r2;\t Catch:{ Throwable -> 0x00fa, all -> 0x0101 }\n L_0x00fa:\n r2 = move-exception;\n r2 = r12;\n L_0x00fc:\n r18.bq();\n goto L_0x000e;\n L_0x0101:\n r2 = move-exception;\n r18.bq();\n throw r2;\n L_0x0106:\n r3 = move-exception;\n goto L_0x00fc;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.duokan.reader.domain.bookshelf.jv.MyContextWrapper(java.lang.String):java.util.List\");\n }", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "private void Initialized_Data() {\n\t\t\r\n\t}", "private void workOnQueue() {\n }", "@Override\n public void cleanup() {\n \n }", "@Override\n public void cleanup() {\n \n }", "public void run() {\n\t\t\t\t\t\t}", "@Override\r\n\t\t\t\tpublic void autInitProcess() {\n\t\t\t\t\t\r\n\t\t\t\t}", "@Override\r\n\t\t\t\tpublic void autInitProcess() {\n\t\t\t\t\t\r\n\t\t\t\t}", "protected void mo6255a() {\n }", "public java.util.Map<java.lang.String, java.util.ArrayList> m17238b() {\n /*\n r18 = this;\n r3 = new java.util.HashMap;\n r3.<init>();\n r4 = new java.util.ArrayList;\n r4.<init>();\n r5 = new java.util.ArrayList;\n r5.<init>();\n r0 = r18;\n r2 = r0.f20995e;\n r2.lock();\n r6 = r18.m17234d();\n r2 = \"select * from result limit 0,500\";\n r7 = 0;\n r7 = r6.rawQuery(r2, r7);\n L_0x0022:\n r2 = r7.moveToNext();\t Catch:{ SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9, Exception -> 0x0120 }\n if (r2 == 0) goto L_0x0106;\n L_0x0028:\n r2 = new org.json.JSONObject;\t Catch:{ SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9, Exception -> 0x0120 }\n r2.<init>();\t Catch:{ SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9, Exception -> 0x0120 }\n r8 = \"_id\";\n r8 = r7.getColumnIndex(r8);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r8 = r7.getInt(r8);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r9 = \"time\";\n r9 = r7.getColumnIndex(r9);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r9 = r7.getString(r9);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r10 = \"code\";\n r10 = r7.getColumnIndex(r10);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r10 = r7.getInt(r10);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r11 = \"cmd_type\";\n r11 = r7.getColumnIndex(r11);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r11 = r7.getInt(r11);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r12 = \"cmd_id\";\n r12 = r7.getColumnIndex(r12);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r12 = r7.getInt(r12);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r13 = \"result\";\n r13 = r7.getColumnIndex(r13);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r13 = r7.getString(r13);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r14 = \"time\";\n r16 = java.lang.Long.parseLong(r9);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r0 = r16;\n r2.put(r14, r0);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r9 = \"error_code\";\n r2.put(r9, r10);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n if (r10 != 0) goto L_0x0095;\n L_0x0083:\n r9 = \"cmd_type\";\n r2.put(r9, r11);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r9 = \"cmd_id\";\n r2.put(r9, r12);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r9 = \"voice_to_text_result\";\n r2.put(r9, r13);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n L_0x0095:\n r8 = java.lang.Integer.valueOf(r8);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r5.add(r8);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n r4.add(r2);\t Catch:{ JSONException -> 0x00a0, Exception -> 0x00d3, SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9 }\n goto L_0x0022;\n L_0x00a0:\n r2 = move-exception;\n r2.printStackTrace();\t Catch:{ SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9, Exception -> 0x0120 }\n goto L_0x0022;\n L_0x00a6:\n r2 = move-exception;\n r4 = \"SynthesizeResultDb\";\n r5 = new java.lang.StringBuilder;\t Catch:{ all -> 0x014d }\n r5.<init>();\t Catch:{ all -> 0x014d }\n r8 = \"exception:\";\n r5 = r5.append(r8);\t Catch:{ all -> 0x014d }\n r2 = r2.toString();\t Catch:{ all -> 0x014d }\n r2 = r5.append(r2);\t Catch:{ all -> 0x014d }\n r2 = r2.toString();\t Catch:{ all -> 0x014d }\n com.baidu.tts.chainofresponsibility.logger.LoggerProxy.m17001d(r4, r2);\t Catch:{ all -> 0x014d }\n r7.close();\n r6.close();\n r0 = r18;\n r2 = r0.f20995e;\n r2.unlock();\n L_0x00d2:\n return r3;\n L_0x00d3:\n r2 = move-exception;\n r2.printStackTrace();\t Catch:{ SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9, Exception -> 0x0120 }\n goto L_0x0022;\n L_0x00d9:\n r2 = move-exception;\n r4 = \"SynthesizeResultDb\";\n r5 = new java.lang.StringBuilder;\t Catch:{ all -> 0x014d }\n r5.<init>();\t Catch:{ all -> 0x014d }\n r8 = \"exception:\";\n r5 = r5.append(r8);\t Catch:{ all -> 0x014d }\n r2 = r2.toString();\t Catch:{ all -> 0x014d }\n r2 = r5.append(r2);\t Catch:{ all -> 0x014d }\n r2 = r2.toString();\t Catch:{ all -> 0x014d }\n com.baidu.tts.chainofresponsibility.logger.LoggerProxy.m17001d(r4, r2);\t Catch:{ all -> 0x014d }\n r7.close();\n r6.close();\n r0 = r18;\n r2 = r0.f20995e;\n r2.unlock();\n goto L_0x00d2;\n L_0x0106:\n r2 = \"listId\";\n r3.put(r2, r5);\t Catch:{ SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9, Exception -> 0x0120 }\n r2 = \"list\";\n r3.put(r2, r4);\t Catch:{ SQLiteException -> 0x00a6, IllegalStateException -> 0x00d9, Exception -> 0x0120 }\n r7.close();\n r6.close();\n r0 = r18;\n r2 = r0.f20995e;\n r2.unlock();\n goto L_0x00d2;\n L_0x0120:\n r2 = move-exception;\n r4 = \"SynthesizeResultDb\";\n r5 = new java.lang.StringBuilder;\t Catch:{ all -> 0x014d }\n r5.<init>();\t Catch:{ all -> 0x014d }\n r8 = \"exception:\";\n r5 = r5.append(r8);\t Catch:{ all -> 0x014d }\n r2 = r2.toString();\t Catch:{ all -> 0x014d }\n r2 = r5.append(r2);\t Catch:{ all -> 0x014d }\n r2 = r2.toString();\t Catch:{ all -> 0x014d }\n com.baidu.tts.chainofresponsibility.logger.LoggerProxy.m17001d(r4, r2);\t Catch:{ all -> 0x014d }\n r7.close();\n r6.close();\n r0 = r18;\n r2 = r0.f20995e;\n r2.unlock();\n goto L_0x00d2;\n L_0x014d:\n r2 = move-exception;\n r7.close();\n r6.close();\n r0 = r18;\n r3 = r0.f20995e;\n r3.unlock();\n throw r2;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.baidu.tts.e.c.b():java.util.Map<java.lang.String, java.util.ArrayList>\");\n }" ]
[ "0.55547273", "0.5521987", "0.5422122", "0.540735", "0.53982013", "0.53982013", "0.5376895", "0.53289247", "0.53289247", "0.5315107", "0.52663845", "0.5229126", "0.5229126", "0.52274525", "0.52255684", "0.52196586", "0.5215247", "0.5187267", "0.5181621", "0.5170449", "0.51570594", "0.5140945", "0.5140727", "0.5134961", "0.5134961", "0.5134961", "0.51323724", "0.5127551", "0.5122229", "0.5113181", "0.5108016", "0.51036865", "0.5097763", "0.50939214", "0.509369", "0.5088969", "0.50871664", "0.50750273", "0.5073152", "0.506417", "0.50580806", "0.5056314", "0.50552386", "0.5053402", "0.5042969", "0.5039578", "0.50175476", "0.50175476", "0.50142896", "0.5013499", "0.5013499", "0.5013499", "0.50035995", "0.49995938", "0.4987859", "0.4980008", "0.4980008", "0.4978808", "0.49787387", "0.49785978", "0.49768084", "0.49725085", "0.49685284", "0.49685284", "0.49685284", "0.49685284", "0.49685284", "0.49685284", "0.49616376", "0.49604493", "0.49597573", "0.49588504", "0.49561194", "0.49561194", "0.4956037", "0.4956037", "0.49558225", "0.49558225", "0.49558225", "0.49558225", "0.49558225", "0.49522704", "0.49492598", "0.49433455", "0.49420154", "0.49407393", "0.49391997", "0.49379545", "0.49379545", "0.49377975", "0.49364668", "0.49339253", "0.4933774", "0.49269545", "0.49256572", "0.49256572", "0.49202338", "0.4916652", "0.4916652", "0.49138674", "0.49134633" ]
0.0
-1
integration method for parent torrent, allows to make back call with parameters of blocks that should be downloaded by this connection NOTE: not very OOP, but remove extra objects' creation CALLED by parent TORRENT only
@Override void enqueueBlockRequest(int index, int position, int length) { enqueue(pmCache.request(index, position, length)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Mono<PieceEvent> downloadBlock(Link link, RequestMessage requestMessage);", "@Override\n public void downloadBlockChain() {\n startBlockChainDownload(fastcoinWalletDownloadListener);\n }", "public interface BlockDownloader {\n\n /**\n * send the request and check that we received the correct block.\n */\n Mono<PieceEvent> downloadBlock(Link link, RequestMessage requestMessage);\n}", "void onRequest(int index, int begin, int length)\n {\n if (DEBUG) System.out.println(\"[stdpc] onRequest:\" + index + \",\" + begin + \",\" + length);\n\n// sendQueue.forEach(pm -> System.out.println(\"[stdpc] onRequest -b>\" + System.identityHashCode(pm) +\n// \" \" +pm.type + \" ,\" + pm.index +\",\" + pm.begin + \",\" + pm.length) );\n\n // validate common block parameters\n boolean correct = torrent.validateBlock(index, begin, length);\n if (!correct) {\n // just ignore such requests\n statistics.blocksRequestedIncorrect++;\n return;\n }\n\n // this could be moved to send(), but doesn't really matter\n statistics.blocksSent++;\n\n // track active requests\n StdPeerMessage pm = pmCache.request(index, begin, length);\n peerBlockRequests.add(pm);\n\n // notify torrent to read and enqueue block\n torrent.onRequest(this, index, begin, length);\n\n// sendQueue.forEach(x -> System.out.println(\"[stdpc] onRequest -a<\" + System.identityHashCode(x) +\n// \" \" +x.type + \" ,\" + x.index +\",\" + x.begin + \",\" + x.length) );\n\n }", "List<Transfer> requestDownloads(Leecher leecher);", "public String a(Context var1_1, URL var2_2, String var3_3, a var4_4) {\n block39 : {\n block41 : {\n block44 : {\n block43 : {\n block46 : {\n block45 : {\n block38 : {\n var5_5 = new StringBuilder();\n var5_5.append(\"Downloading video from \");\n var5_5.append((Object)var2_2);\n g.a(\"StartAppWall.ProgressiveVideoManager\", 3, var5_5.toString());\n this.c = var2_2.toString();\n this.a = true;\n var8_6 = com.startapp.android.publish.adsCommon.b.a().H().l();\n var21_7 = h.a(var1_1, var3_3);\n var22_8 = new File(var21_7);\n var23_9 = var22_8.exists();\n if (!var23_9) break block38;\n try {\n this.c = null;\n null.close();\n null.close();\n null.close();\n return var21_7;\n }\n catch (Exception v0) {}\n return var21_7;\n }\n var24_10 = var2_2.openConnection();\n var24_10.connect();\n var25_11 = var24_10.getContentLength();\n var12_12 = var24_10.getInputStream();\n var13_13 = new DataInputStream(var12_12);\n try {\n var26_14 = new byte[4096];\n var27_15 = new StringBuilder();\n var27_15.append(var3_3);\n var27_15.append(\".temp\");\n var11_16 = var27_15.toString();\n var30_17 = new StringBuilder();\n var30_17.append(var21_7);\n var30_17.append(\".temp\");\n var33_18 = var30_17.toString();\n var10_19 = var1_1.openFileOutput(var11_16, 0);\n var34_20 = 0;\n var35_21 = false;\n var36_22 = 0;\n }\n catch (Throwable var15_39) {\n var10_19 = null;\n break block44;\n }\nlbl45: // 2 sources:\n do {\n block40 : {\n var37_23 = var13_13.read(var26_14);\n if (var37_23 <= 0) break block39;\n var38_24 = var21_7;\n if (!this.a) break block40;\n var10_19.write(var26_14, 0, var37_23);\n var43_25 = var34_20 + var37_23;\n var44_26 = var22_8;\n var45_27 = var43_25;\n Double.isNaN((double)var45_27);\n var48_28 = var45_27 * 100.0;\n var50_29 = var26_14;\n var51_30 = var25_11;\n Double.isNaN((double)var51_30);\n var54_31 = (int)(var48_28 / var51_30);\n if (var54_31 >= var8_6) {\n if (!var35_21 && var4_4 != null) {\n this.a(var4_4, var33_18);\n var35_21 = true;\n }\n if (var54_31 >= var36_22 + 1) {\n this.a(var54_31);\n var36_22 = var54_31;\n }\n }\n break block41;\n }\nlbl73: // 2 sources:\n do {\n block42 : {\n var39_32 = var22_8;\n if (this.a || var37_23 <= 0) break block42;\n g.a(\"StartAppWall.ProgressiveVideoManager\", 3, \"Video downloading disabled\");\n new File(h.a(var1_1, var11_16)).delete();\n try {\n this.c = null;\n var12_12.close();\n var13_13.close();\n var10_19.close();\n return \"downloadInterrupted\";\n }\n catch (Exception v1) {}\n return \"downloadInterrupted\";\n }\n this.a(var1_1, new File(h.a(var1_1, var11_16)), var39_32);\n try {\n this.c = null;\n var12_12.close();\n var13_13.close();\n var10_19.close();\n return var38_24;\n }\n catch (Exception v2) {}\n return var38_24;\n catch (Exception var9_33) {\n break block43;\n }\n break;\n } while (true);\n break;\n } while (true);\n {\n catch (Exception var9_34) {\n var10_19 = null;\n break block43;\n }\n }\n {\n catch (Exception var9_35) {\n var10_19 = null;\n var11_16 = null;\n break block43;\n }\n }\n catch (Throwable var15_40) {\n break block45;\n }\n catch (Exception var9_36) {\n var10_19 = null;\n var11_16 = null;\n break block46;\n }\n catch (Throwable var15_41) {\n var12_12 = null;\n }\n }\n var10_19 = null;\n var13_13 = null;\n break block44;\n catch (Exception var9_37) {\n var10_19 = null;\n var11_16 = null;\n var12_12 = null;\n }\n }\n var13_13 = null;\n }\n var14_44 = new StringBuilder();\n var14_44.append(\"Error downloading video from \");\n var14_44.append((Object)var2_2);\n g.a(\"StartAppWall.ProgressiveVideoManager\", 6, var14_44.toString(), (Throwable)var9_38);\n new File(h.a(var1_1, var11_16)).delete();\n try {\n this.c = null;\n var12_12.close();\n var13_13.close();\n var10_19.close();\n return null;\n }\n catch (Exception v3) {}\n return null;\n catch (Throwable var15_43) {\n // empty catch block\n }\n }\n try {\n this.c = null;\n var12_12.close();\n var13_13.close();\n var10_19.close();\n throw var15_42;\n }\n catch (Exception v4) {}\n throw var15_42;\n }\n var22_8 = var44_26;\n var21_7 = var38_24;\n var26_14 = var50_29;\n var34_20 = var43_25;\n ** while (true)\n }\n var38_24 = var21_7;\n ** while (true)\n }\n\n public void a(c.c c2) {\n this.b = c2;\n }\n\n public void a(String string) {\n if (string != null && string.equals((Object)this.c)) {\n this.a = false;\n }\n }\n\n public boolean b(String string) {\n return string != null && string.endsWith(\".temp\");\n }\n\n public void c(String string) {\n if (this.b(string)) {\n new File(string).delete();\n }\n }\n\n public static interface a {\n public void a(String var1);\n }\n\n private static class b {\n private static final c a = new c();\n }\n\n}", "@Override\n\tpublic void run() {\n\t\t\n\t\t\n\t\tOpenFileRequest.Builder openFileReqObj = OpenFileRequest.newBuilder();\n\t\topenFileReqObj.setFileName(fileName);\t\t\n\t\topenFileReqObj.setForRead(true);\n\t\t\n\t\t\n\t\tFileWriterClass fileWriteObj = new FileWriterClass(localOutFile);\n\t\tfileWriteObj.createFile();\n\t\t\n\t\tbyte[] responseArray;\n\t\t\n\t\ttry {\n\t\t\tRegistry registry=LocateRegistry.getRegistry(Constants.NAME_NODE_IP,Registry.REGISTRY_PORT);\n\t\t\tINameNode nameStub;\n\t\t\tnameStub=(INameNode) registry.lookup(Constants.NAME_NODE);\n\t\t\tresponseArray = nameStub.openFile(openFileReqObj.build().toByteArray());\n\t\t\t\n\t\t\ttry {\n\t\t\t\tOpenFileResponse responseObj = OpenFileResponse.parseFrom(responseArray);\n\t\t\t\tif(responseObj.getStatus()==Constants.STATUS_NOT_FOUND)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"File not found fatal error\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tList<Integer> blockNums = responseObj.getBlockNumsList();\n\t\t\t\tBlockLocationRequest.Builder blockLocReqObj = BlockLocationRequest.newBuilder();\n\t\t\t\t\n//\t\t\t\tSystem.out.println(blockNums);\n\t\t\t\t/**Now perform Read Block Request from all the blockNums**/\n\t\t\t\tblockLocReqObj.addAllBlockNums(blockNums);\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tresponseArray = nameStub.getBlockLocations(blockLocReqObj.build().toByteArray());\n\t\t\t\t} catch (RemoteException e1) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tBlockLocationResponse blockLocResObj = BlockLocationResponse.parseFrom(responseArray);\n//\t\t\t\tSystem.out.println(blockLocResObj.toString());\n\t\t\t\t\n\t\t\t\tif(blockLocResObj.getStatus()==Constants.STATUS_FAILED)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"Fatal error!\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tList<BlockLocations> blockLocations = blockLocResObj.getBlockLocationsList();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tfor(int i=0;i<blockLocations.size();i++)\n\t\t\t\t{\n\t\t\t\t\tBlockLocations thisBlock = blockLocations.get(i);\n\t\t\t\t\t\n\t\t\t\t\tint blockNumber = thisBlock.getBlockNumber();\t\t\t\t\t\n\t\t\t\t\tList<DataNodeLocation> dataNodes = thisBlock.getLocationsList();\n\t\t\t\t\t\n\t\t\t\t\tif(dataNodes==null || dataNodes.size()==0)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"All nodes are down :( \");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tint dataNodeCounter=0;\n\t\t\t\t\t\n\t\t\t\t\tDataNodeLocation thisDataNode = null;//dataNodes.get(dataNodeCounter);\t\t\t\t\t\n\t\t\t\t\tString ip;// = thisDataNode.getIp();\n\t\t\t\t\tint port ; //= thisDataNode.getPort();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tIDataNode dataStub=null;\n\t\t\t\t\t\n\t\t\t\t\tboolean gotDataNodeFlag=false;\n\t\t\t\t\t\n\t\t\t\t\tdo\n\t\t\t\t\t{\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthisDataNode = dataNodes.get(dataNodeCounter);\n\t\t\t\t\t\t\tip = thisDataNode.getIp();\n\t\t\t\t\t\t\tport = thisDataNode.getPort();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tRegistry registry2=LocateRegistry.getRegistry(ip,port);\t\t\t\t\t\n\t\t\t\t\t\t\tdataStub = (IDataNode) registry2.lookup(Constants.DATA_NODE_ID);\n\t\t\t\t\t\t\tgotDataNodeFlag=true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (RemoteException e) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tgotDataNodeFlag=false;\n//\t\t\t\t\t\t\tSystem.out.println(\"Remote Exception\");\n\t\t\t\t\t\t\tdataNodeCounter++;\n\t\t\t\t\t\t} \n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\twhile(gotDataNodeFlag==false && dataNodeCounter<dataNodes.size());\n\t\t\t\t\t\n\t\t\t\t\tif(dataNodeCounter == dataNodes.size())\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"All data nodes are down :( \");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t\t\n\n\t\t\t\t\t/**Construct Read block request **/\n\t\t\t\t\tReadBlockRequest.Builder readBlockReqObj = ReadBlockRequest.newBuilder();\n\t\t\t\t\treadBlockReqObj.setBlockNumber(blockNumber);\n\t\t\t\t\t\n\t\t\t\t\t/**Read block request call **/\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tresponseArray = dataStub.readBlock(readBlockReqObj.build().toByteArray());\n\t\t\t\t\t\tReadBlockResponse readBlockResObj = ReadBlockResponse.parseFrom(responseArray);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(readBlockResObj.getStatus()==Constants.STATUS_FAILED)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSystem.out.println(\"In method openFileGet(), readError\");\n\t\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tresponseArray = readBlockResObj.getData(0).toByteArray();\t\t\t\t\t\t\n\t\t\t\t\t\tString str = new String(responseArray, StandardCharsets.UTF_8);\t\t\t\t\t\t\n\t\t\t\t\t\tfileWriteObj.writeonly(str);\t\t\t\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t} catch (InvalidProtocolBufferException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t} catch (NotBoundException e) {\n\t\t\tSystem.out.println(\"Exception caught: NotBoundException \");\t\t\t\n\t\t} catch (RemoteException e2) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te2.printStackTrace();\n\t\t}\n\t\tfileWriteObj.closeFile();\n\t\t\n\t\t\n\t}", "public abstract void start_block();", "public interface TorrentDownloader {\n void start() throws Exception;\n}", "@Override\n\tpublic void visit(Request r) {\n\t\tif (!ph.getPeerChoked()) {\n\t\t\tSystem.out.println(\"requete rećue\");\n\t\t\tbyte[] body = r.getBody();\n\t\t\tbyte[] indexB = new byte[4], beginB = new byte[4], lengthB = new byte[4];\n\t\t\tTorrent torrent = ph.getTorrent();\n\t\t\tint index = 0, begin = 0, length = 0;\n\n\t\t\tindexB = Arrays.copyOfRange(body, 0, 4);\n\t\t\tindex = byteArrayToInt(indexB);\n\n\t\t\tbeginB = Arrays.copyOfRange(body, 4, 8);\n\t\t\tbegin = byteArrayToInt(beginB);\n\n\t\t\tlengthB = Arrays.copyOfRange(body, 8, body.length);\n\t\t\tlength = byteArrayToInt(lengthB);\n\n\t\t\tPiece piece = torrent.getPieces().get(index);\n\t\t\tif (index <= torrent.getPieces().size()) {\n\t\t\t\tbyte[] block = new byte[length];\n\t\t\t\tbyte[] pieceByte = piece.getData();\n\t\t\t\tfor (int i = 0; i < length; i++) {\n\t\t\t\t\tblock[i] = pieceByte[begin + i];\n\t\t\t\t}\n\t\t\t\tsb = new SendBlock(index, begin, block);\n\t\t\t\tthis.ph.addMessageQueue(sb);\n\t\t\t\tSystem.out.println(\"sendBlock envoyé\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Index trop grand\");\n\t\t\t}\n\t\t}\n\t}", "BlockFor createBlockFor();", "entities.Torrent.DownloadResponse getDownloadResponse();", "@Override\n protected Void call() {\n if(download_queue.isEmpty()) return null;\n \n //Proceed to create a file with a list of addresses\n Writer writer = null;\n String file_dir = Configuration.root_dir + \"Download_list.txt\";\n try{\n writer = new BufferedWriter(\n new OutputStreamWriter(\n new FileOutputStream(\n file_dir), \"utf-8\"));\n String server_root = Configuration.getInstance().getSina_server_root();\n //Traverse through the download list and write each download address to file\n String content = \"\";\n for(int i = 0; i < download_queue.size(); i++){\n SoundTrack track = download_queue.get(i);\n String address = server_root + track.getLocalFileName();\n content += address;\n if(i < (download_queue.size() - 1)){\n content += \"\\n\";\n }\n }\n //Write to file\n writer.write(content);\n \n } catch (UnsupportedEncodingException ex) {\n Logger.getLogger(IOHandler.class.getName()).log(Level.SEVERE, null, ex);\n } catch (FileNotFoundException ex) {\n Logger.getLogger(IOHandler.class.getName()).log(Level.SEVERE, null, ex);\n } catch (IOException ex) {\n Logger.getLogger(IOHandler.class.getName()).log(Level.SEVERE, null, ex);\n } finally{\n try {\n if(writer != null)\n writer.close();\n } catch (IOException ex) {\n Logger.getLogger(IOHandler.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n \n //Run wget command to download the listed files\n String command = \"wget\";\n command += \" -P \" + Configuration.root_dir + \"SoundTracks/\";\n command += \" -i list\";\n try {\n Process p = Runtime.getRuntime().exec(command);\n p.waitFor();\n } catch (IOException ex) {\n Logger.getLogger(IOHandler.class.getName()).log(Level.SEVERE, null, ex);\n } catch (InterruptedException ex) {\n Logger.getLogger(IOHandler.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n return null;\n }", "public interface DownloadCallback {\n void finished(List<Book> list);\n\n void finished(String description);\n}", "@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\thandlHttpRequest(url, trackerinfo.get_info_hash(), Settings.PEER_DEFAULT_ID);\n\t\t\t\t\t}", "entities.Torrent.DownloadRequest getDownloadRequest();", "void mo54428b(DownloadTask downloadTask);", "public abstract void blockNext();", "public void run() {\n xmitsInProgress++;\n try {\n Socket s = new Socket();\n s.connect(curTarget, READ_TIMEOUT);\n s.setSoTimeout(READ_TIMEOUT);\n DataOutputStream out = new DataOutputStream(new BufferedOutputStream(s.getOutputStream()));\n try {\n long filelen = data.getLength(b);\n DataInputStream in = new DataInputStream(new BufferedInputStream(data.getBlockData(b)));\n try {\n //\n // Header info\n //\n out.write(OP_WRITE_BLOCK);\n out.writeBoolean(true);\n b.write(out);\n out.writeInt(targets.length);\n for (int i = 0; i < targets.length; i++) {\n targets[i].write(out);\n }\n out.write(RUNLENGTH_ENCODING);\n out.writeLong(filelen);\n\n //\n // Write the data\n //\n while (filelen > 0) {\n int bytesRead = in.read(buf, 0, (int) Math.min(filelen, buf.length));\n out.write(buf, 0, bytesRead);\n filelen -= bytesRead;\n }\n } finally {\n in.close();\n }\n } finally {\n out.close();\n }\n LOG.info(\"Transmitted block \" + b + \" to \" + curTarget);\n } catch (IOException ie) {\n LOG.warn(\"Failed to transfer \"+b+\" to \"+curTarget, ie);\n } finally {\n xmitsInProgress--;\n }\n }", "public void downloadFile(final Context context, final String fileKey, String pageFileKey, String fileType, final DownloadListener downloadListener) {\n\n final String pathName = Config.getPathName(context) + fileType + getFIleNameFromFileKEy(fileKey);\n final String pagePathName = Config.getPathName(context) + PAGES_FILE + getFIleNameFromFileKEy(pageFileKey);\n\n final long totalBytes = 0;\n TransferObserver downloadObserver = transferUtility.download(\n Config.BUCKET_NAME,\n fileKey,\n new File(pathName));\n\n\n // Attach a listener to the observer to get state update and progress notifications\n downloadObserver.setTransferListener(new TransferListener() {\n\n @Override\n public void onStateChanged(int id, TransferState state) {\n if (TransferState.COMPLETED == state) {\n\n downloadListener.onDownloadFinish(id, state.name(), pathName, pagePathName);\n }\n }\n\n @Override\n public void onProgressChanged(int id, long bytesCurrent,long bytesTotal) {\n\n\n if (bytesTotal == 0){\n\n bitesCorrent = bytesCurrent;\n\n Thread thread = new Thread(new Runnable() {\n @Override\n public void run() {\n\n URL url = null;\n try {\n url = new URL(S3_JABRUTOUCH + fileKey);\n } catch (MalformedURLException e) {\n e.printStackTrace();\n }\n URLConnection conection = null;\n try {\n conection = url.openConnection();\n } catch (IOException e) {\n e.printStackTrace();\n }\n // getting file length\n int lengthOfFile = conection.getContentLength();\n\n float percentDonef = ((float) bitesCorrent / (float) lengthOfFile) * 100;\n final int percentDone = (int) percentDonef;\n\n new Handler(Looper.getMainLooper()).post(new Runnable() {\n @Override\n public void run() {\n downloadListener.onProgressChanged(percentDone);\n }\n });\n }\n });\n thread.start();\n\n }else {\n\n\n float percentDonef = ((float) bytesCurrent / (float) bytesTotal) * 100;\n int percentDone = (int) percentDonef;\n\n downloadListener.onProgressChanged(percentDone);\n }\n\n\n }\n\n @Override\n public void onError(int id, Exception ex) {\n\n Toast.makeText(context, \"Error downloading file \" + fileKey, Toast.LENGTH_LONG).show();\n downloadListener.onDownloadError();\n\n }\n\n });\n\n // If you prefer to poll for the data, instead of attaching a\n // listener, check for the state and progress in the observer.\n if (TransferState.COMPLETED == downloadObserver.getState()) {\n // Handle a completed upload.\n\n\n }\n\n\n }", "public interface Transport {\n\n /**\n * This method returns id of the current transport\n * @return\n */\n String id();\n\n /**\n * This methos returns Id of the upstream node\n * @return\n */\n String getUpstreamId();\n\n /**\n * This method returns random\n *\n * @param id\n * @param exclude\n * @return\n */\n String getRandomDownstreamFrom(String id, String exclude);\n\n /**\n * This method returns consumer that accepts messages for delivery\n * @return\n */\n Consumer<VoidMessage> outgoingConsumer();\n\n /**\n * This method returns flow of messages for parameter server\n * @return\n */\n Publisher<INDArrayMessage> incomingPublisher();\n\n /**\n * This method starts this Transport instance\n */\n void launch();\n\n /**\n * This method will start this Transport instance\n */\n void launchAsMaster();\n\n /**\n * This method shuts down this Transport instance\n */\n void shutdown();\n\n /**\n * This method will send message to the network, using tree structure\n * @param message\n */\n void propagateMessage(VoidMessage message, PropagationMode mode) throws IOException;\n\n /**\n * This method will send message to the node specified by Id\n *\n * @param message\n * @param id\n */\n void sendMessage(VoidMessage message, String id);\n\n /**\n * This method will send message to specified node, and will return its response\n *\n * @param message\n * @param id\n * @param <T>\n * @return\n */\n <T extends ResponseMessage> T sendMessageBlocking(RequestMessage message, String id) throws InterruptedException;\n\n /**\n * This method will send message to specified node, and will return its response\n *\n * @param message\n * @param id\n * @param <T>\n * @return\n */\n <T extends ResponseMessage> T sendMessageBlocking(RequestMessage message, String id, long waitTime, TimeUnit timeUnit) throws InterruptedException;\n\n /**\n * This method will be invoked for all incoming messages\n * PLEASE NOTE: this method is mostly suited for tests\n *\n * @param message\n */\n void processMessage(VoidMessage message);\n\n\n /**\n * This method allows to set callback instance, which will be called upon restart event\n * @param callback\n */\n void setRestartCallback(RestartCallback callback);\n\n /**\n * This methd allows to set callback instance for various\n * @param cls\n * @param callback\n * @param <T1> RequestMessage class\n * @param <T2> ResponseMessage class\n */\n <T extends RequestMessage> void addRequestConsumer(Class<T> cls, Consumer<T> consumer);\n\n /**\n * This method will be called if mesh update was received\n *\n * PLEASE NOTE: This method will be called ONLY if new mesh differs from current one\n * @param mesh\n */\n void onMeshUpdate(MeshOrganizer mesh);\n\n /**\n * This method will be called upon remap request\n * @param id\n */\n void onRemap(String id);\n\n /**\n * This method returns total number of nodes known to this Transport\n * @return\n */\n int totalNumberOfNodes();\n\n\n /**\n * This method returns ID of the root node\n * @return\n */\n String getRootId();\n\n /**\n * This method checks if all connections required for work are established\n * @return true\n */\n boolean isConnected();\n\n /**\n * This method checks if this node was properly introduced to driver\n * @return\n */\n boolean isIntroduced();\n\n /**\n * This method checks connection to the given node ID, and if it's not connected - establishes connection\n * @param id\n */\n void ensureConnection(String id);\n}", "@Override public String Async_key() {return Key_wiki_download;}", "@Override\r\n\tpublic void download() {\n\t\t\r\n\t}", "public interface INetworkHandler<T> extends Runnable {\n\n /**\n * The main method which starts the protocol implementation.\n * <p>\n * {@inheritDoc}\n */\n void run();\n\n /**\n * Sends the request of the network handler to all online peers of the node.\n *\n * @throws ConnectionFailedException If the other online clients can not be determined\n */\n void sendRequest(IRequest request)\n throws ConnectionFailedException;\n\n /**\n * Blocks until all notified clients have responded\n *\n * @throws InterruptedException If the thread got interrupted while waiting\n */\n void await()\n throws InterruptedException;\n\n /**\n * Blocks for the given timeout.\n *\n * @param timeout The timeout to wait\n * @param timeUnit The time unit which qualifies the timeout\n *\n * @throws InterruptedException If the thread got interrupted while waiting\n */\n void await(long timeout, TimeUnit timeUnit)\n throws InterruptedException;\n\n /**\n * Returns true once all notified clients have responded.\n *\n * @return True, if all notified clients have responded, false otherwise.\n */\n boolean isCompleted();\n\n /**\n * Returns the progress until this handler's communication\n * is considered complete (See {@link INetworkHandler#isCompleted()}).\n *\n * Returns values between 100 and 0 (inclusive).\n *\n * @return The progress\n */\n int getProgress();\n\n\n /**\n * Returns the final result of the exchange.\n * Note, that the result may be null before all clients have responded.\n *\n * @return The result once the all necessary clients responded. May be null before all clients have responded\n */\n T getResult();\n}", "public interface CallbackMultiDownload<F extends DefaultDownload> extends CallbackError {\n\n void downloadSuccessPart(int curPos, List<F> dataList);\n\n void downloadSuccessAll(List<F> dataList);\n\n void downloadFailure();\n}", "public void downloadStarted();", "void mo54417a(DownloadChunk downloadChunk);", "public interface LowLevelNetworkHandler {\n\n /**\n * Send a byte[] over a connection in a way in which the respective receiver is able to receive\n * and decode it.\n * @param msg The byte[] to send\n */\n public void sendBytes(byte[] msg);\n\n /**\n * Set the callback method. A LowLevelNetworkHandler MUST pass any received bytes to the\n * callback if it is set. The byte[] passed to the Callback MUST be equal to the byte[] passed\n * to the sendBytes(byte[] msg) function on the other end.\n * @param callback An instantiated Object implementing the Callback interface\n * @return The LowLevelNetworkHandler instance (\"this\")\n */\n public LowLevelNetworkHandler setCallback(Callback callback);\n\n /**\n * Disconnect any active connections, stop all started threads, generally clean up.\n */\n public void disconnect();\n\n}", "public void processBlockwiseResponseTransferFailed() {\n //to be overridden by extending classes\n }", "public interface HttpTxnHandle\n{\n\n void respond(String data);\n\n void reject(int status, String reason);\n\n String path();\n\n default void reject(int code)\n {\n reject(code, \"Unknown\");\n }\n\n String host();\n\n void send(FullHttpResponse res);\n\n String cookie(String name);\n\n String method();\n\n String uri();\n\n Map<String, List<String>> query();\n\n InputStream input();\n\n Map<String, List<String>> headers();\n\n Runnable schedule(Duration timeout, Runnable callback);\n\n}", "void onCancel(int index, int begin, int length)\n {\n // validate common block parameters\n boolean correct = torrent.validateBlock(index, begin, length);\n if (!correct) {\n close(Peer.CloseReason.PROTOCOL_ERROR);\n return;\n }\n\n // check if are processing this request right now\n for (int i = 0; i < peerBlockRequests.size(); i++) {\n StdPeerMessage pm = peerBlockRequests.get(i);\n if ((pm.index == index)\n && (pm.begin == begin)\n && (pm.length == length))\n {\n peerBlockRequests.remove(i);\n pmCache.release(pm);\n break;\n }\n }\n\n // check if response has been enqueued,\n // could be skipped if found in pBR\n for (int i = 0; i < sendQueue.size(); i++) {\n StdPeerMessage pm = sendQueue.get(i);\n if ((pm.type == StdPeerMessage.PIECE)\n && (pm.index == index)\n && (pm.begin == begin)\n && (pm.length == length))\n {\n sendQueue.remove(i);\n // let storage to unlock block of data\n // and return it into cache of blocks\n TorrentStorage.Block block = (TorrentStorage.Block) pm.params;\n block.release();\n\n pmCache.release(pm);\n break;\n }\n }\n }", "@Override\n\t\tpublic void onBlock(User arg0, User arg1) {\n\t\t\t\n\t\t}", "public BlockTransferNode()\r\n/* 45: */ {\r\n/* 46: 44 */ super(0);\r\n/* 47: 45 */ setBlockName(\"extrautils:extractor_base\");\r\n/* 48: 46 */ setBlockTextureName(\"extrautils:extractor_base\");\r\n/* 49: 47 */ setCreativeTab(ExtraUtils.creativeTabExtraUtils);\r\n/* 50: 48 */ setHardness(0.5F);\r\n/* 51: 49 */ setStepSound(soundTypeStone);\r\n/* 52: */ }", "@Override\r\n\t public void run() {\n\t\tsuper.run();\r\n\t\ttry {\r\n\t\t // String newParams=URLEncoder.encode(params, \"utf-8\");\r\n\t\t String newurl = url + \"?\" + params;\r\n\r\n\t\t URL uri = new URL(newurl);\r\n\t\t try {\r\n\t\t\tHttpURLConnection conn = (HttpURLConnection) uri\r\n\t\t\t\t.openConnection();\r\n\t\t\tconn.connect();\r\n\t\t\t// 获取返回结果\r\n\t\t\tif (conn.getResponseCode() == 200) {\r\n\t\t\t InputStream is = conn.getInputStream();\r\n\t\t\t String result = convertInputStreamToString(is);\r\n\t\t\t // 通过handle发送消息\r\n\t\t\t Message msg = new Message();\r\n\t\t\t msg.what = 2;\r\n\t\t\t msg.obj = result;\r\n\t\t\t handle.sendMessage(msg);\r\n\t\t\t}\r\n\t\t } catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t }\r\n\t\t} catch (MalformedURLException e) {\r\n\t\t // TODO Auto-generated catch block\r\n\t\t e.printStackTrace();\r\n\t\t}\r\n\t }", "@Override public java.lang.CharSequence download(java.lang.String appId, java.lang.String url, long duration, java.lang.String folder) throws android.os.RemoteException\n{\nandroid.os.Parcel _data = android.os.Parcel.obtain();\nandroid.os.Parcel _reply = android.os.Parcel.obtain();\njava.lang.CharSequence _result;\ntry {\n_data.writeInterfaceToken(DESCRIPTOR);\n_data.writeString(appId);\n_data.writeString(url);\n_data.writeLong(duration);\n_data.writeString(folder);\nmRemote.transact(Stub.TRANSACTION_download, _data, _reply, 0);\n_reply.readException();\nif ((0!=_reply.readInt())) {\n_result = android.text.TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(_reply);\n}\nelse {\n_result = null;\n}\n}\nfinally {\n_reply.recycle();\n_data.recycle();\n}\nreturn _result;\n}", "@Override\n\tpublic void run() {\n\t\tdispBlocks();\n\t\tsendData();\n\t}", "public void run() {\n /*\n r28 = this;\n r0 = r28\n java.util.concurrent.atomic.AtomicBoolean r0 = r0.isCancelled\n r24 = r0\n boolean r24 = r24.get()\n if (r24 == 0) goto L_0x000d\n L_0x000c:\n return\n L_0x000d:\n r6 = 0\n r17 = 0\n r14 = 0\n java.io.File r9 = new java.io.File // Catch:{ Exception -> 0x02f2 }\n r0 = r28\n anetwork.channel.download.DownloadManager r0 = anetwork.channel.download.DownloadManager.this // Catch:{ Exception -> 0x02f2 }\n r24 = r0\n r0 = r28\n java.net.URL r0 = r0.url // Catch:{ Exception -> 0x02f2 }\n r25 = r0\n java.lang.String r25 = r25.toString() // Catch:{ Exception -> 0x02f2 }\n java.lang.String r24 = r24.getTempFile(r25) // Catch:{ Exception -> 0x02f2 }\n r0 = r24\n r9.<init>(r0) // Catch:{ Exception -> 0x02f2 }\n boolean r15 = r9.exists() // Catch:{ Exception -> 0x02f2 }\n anetwork.channel.entity.RequestImpl r19 = new anetwork.channel.entity.RequestImpl // Catch:{ Exception -> 0x02f2 }\n r0 = r28\n java.net.URL r0 = r0.url // Catch:{ Exception -> 0x02f2 }\n r24 = r0\n r0 = r19\n r1 = r24\n r0.<init>((java.net.URL) r1) // Catch:{ Exception -> 0x02f2 }\n r24 = 0\n r0 = r19\n r1 = r24\n r0.setRetryTime(r1) // Catch:{ Exception -> 0x02f2 }\n r24 = 1\n r0 = r19\n r1 = r24\n r0.setFollowRedirects(r1) // Catch:{ Exception -> 0x02f2 }\n if (r15 == 0) goto L_0x007e\n java.lang.String r24 = \"Range\"\n java.lang.StringBuilder r25 = new java.lang.StringBuilder // Catch:{ Exception -> 0x02f2 }\n r25.<init>() // Catch:{ Exception -> 0x02f2 }\n java.lang.String r26 = \"bytes=\"\n java.lang.StringBuilder r25 = r25.append(r26) // Catch:{ Exception -> 0x02f2 }\n long r26 = r9.length() // Catch:{ Exception -> 0x02f2 }\n java.lang.StringBuilder r25 = r25.append(r26) // Catch:{ Exception -> 0x02f2 }\n java.lang.String r26 = \"-\"\n java.lang.StringBuilder r25 = r25.append(r26) // Catch:{ Exception -> 0x02f2 }\n java.lang.String r25 = r25.toString() // Catch:{ Exception -> 0x02f2 }\n r0 = r19\n r1 = r24\n r2 = r25\n r0.addHeader(r1, r2) // Catch:{ Exception -> 0x02f2 }\n L_0x007e:\n anetwork.channel.degrade.DegradableNetwork r16 = new anetwork.channel.degrade.DegradableNetwork // Catch:{ Exception -> 0x02f2 }\n r0 = r28\n anetwork.channel.download.DownloadManager r0 = anetwork.channel.download.DownloadManager.this // Catch:{ Exception -> 0x02f2 }\n r24 = r0\n android.content.Context r24 = r24.context // Catch:{ Exception -> 0x02f2 }\n r0 = r16\n r1 = r24\n r0.<init>(r1) // Catch:{ Exception -> 0x02f2 }\n r24 = 0\n r0 = r16\n r1 = r19\n r2 = r24\n anetwork.channel.aidl.Connection r24 = r0.getConnection(r1, r2) // Catch:{ Exception -> 0x02f2 }\n r0 = r24\n r1 = r28\n r1.conn = r0 // Catch:{ Exception -> 0x02f2 }\n r0 = r28\n anetwork.channel.aidl.Connection r0 = r0.conn // Catch:{ Exception -> 0x02f2 }\n r24 = r0\n int r20 = r24.getStatusCode() // Catch:{ Exception -> 0x02f2 }\n if (r20 <= 0) goto L_0x00c7\n r24 = 200(0xc8, float:2.8E-43)\n r0 = r20\n r1 = r24\n if (r0 == r1) goto L_0x0121\n r24 = 206(0xce, float:2.89E-43)\n r0 = r20\n r1 = r24\n if (r0 == r1) goto L_0x0121\n r24 = 416(0x1a0, float:5.83E-43)\n r0 = r20\n r1 = r24\n if (r0 == r1) goto L_0x0121\n L_0x00c7:\n r24 = -102(0xffffffffffffff9a, float:NaN)\n java.lang.StringBuilder r25 = new java.lang.StringBuilder // Catch:{ Exception -> 0x02f2 }\n r25.<init>() // Catch:{ Exception -> 0x02f2 }\n java.lang.String r26 = \"ResponseCode:\"\n java.lang.StringBuilder r25 = r25.append(r26) // Catch:{ Exception -> 0x02f2 }\n r0 = r25\n r1 = r20\n java.lang.StringBuilder r25 = r0.append(r1) // Catch:{ Exception -> 0x02f2 }\n java.lang.String r25 = r25.toString() // Catch:{ Exception -> 0x02f2 }\n r0 = r28\n r1 = r24\n r2 = r25\n r0.notifyFail(r1, r2) // Catch:{ Exception -> 0x02f2 }\n if (r6 == 0) goto L_0x00ef\n r6.close() // Catch:{ Exception -> 0x0421 }\n L_0x00ef:\n if (r17 == 0) goto L_0x00f4\n r17.close() // Catch:{ Exception -> 0x0424 }\n L_0x00f4:\n if (r14 == 0) goto L_0x00f9\n r14.close() // Catch:{ Exception -> 0x0427 }\n L_0x00f9:\n r0 = r28\n anetwork.channel.download.DownloadManager r0 = anetwork.channel.download.DownloadManager.this\n r24 = r0\n android.util.SparseArray r25 = r24.taskMap\n monitor-enter(r25)\n r0 = r28\n anetwork.channel.download.DownloadManager r0 = anetwork.channel.download.DownloadManager.this // Catch:{ all -> 0x011e }\n r24 = r0\n android.util.SparseArray r24 = r24.taskMap // Catch:{ all -> 0x011e }\n r0 = r28\n int r0 = r0.taskId // Catch:{ all -> 0x011e }\n r26 = r0\n r0 = r24\n r1 = r26\n r0.remove(r1) // Catch:{ all -> 0x011e }\n monitor-exit(r25) // Catch:{ all -> 0x011e }\n goto L_0x000c\n L_0x011e:\n r24 = move-exception\n monitor-exit(r25) // Catch:{ all -> 0x011e }\n throw r24\n L_0x0121:\n if (r15 == 0) goto L_0x0195\n r24 = 416(0x1a0, float:5.83E-43)\n r0 = r20\n r1 = r24\n if (r0 != r1) goto L_0x018c\n r15 = 0\n java.util.List r24 = r19.getHeaders() // Catch:{ Exception -> 0x02f2 }\n r0 = r28\n r1 = r24\n r0.removeRangeHeader(r1) // Catch:{ Exception -> 0x02f2 }\n r0 = r28\n java.util.concurrent.atomic.AtomicBoolean r0 = r0.isCancelled // Catch:{ Exception -> 0x02f2 }\n r24 = r0\n boolean r24 = r24.get() // Catch:{ Exception -> 0x02f2 }\n if (r24 == 0) goto L_0x017a\n if (r6 == 0) goto L_0x0148\n r6.close() // Catch:{ Exception -> 0x042a }\n L_0x0148:\n if (r17 == 0) goto L_0x014d\n r17.close() // Catch:{ Exception -> 0x042d }\n L_0x014d:\n if (r14 == 0) goto L_0x0152\n r14.close() // Catch:{ Exception -> 0x0430 }\n L_0x0152:\n r0 = r28\n anetwork.channel.download.DownloadManager r0 = anetwork.channel.download.DownloadManager.this\n r24 = r0\n android.util.SparseArray r25 = r24.taskMap\n monitor-enter(r25)\n r0 = r28\n anetwork.channel.download.DownloadManager r0 = anetwork.channel.download.DownloadManager.this // Catch:{ all -> 0x0177 }\n r24 = r0\n android.util.SparseArray r24 = r24.taskMap // Catch:{ all -> 0x0177 }\n r0 = r28\n int r0 = r0.taskId // Catch:{ all -> 0x0177 }\n r26 = r0\n r0 = r24\n r1 = r26\n r0.remove(r1) // Catch:{ all -> 0x0177 }\n monitor-exit(r25) // Catch:{ all -> 0x0177 }\n goto L_0x000c\n L_0x0177:\n r24 = move-exception\n monitor-exit(r25) // Catch:{ all -> 0x0177 }\n throw r24\n L_0x017a:\n r24 = 0\n r0 = r16\n r1 = r19\n r2 = r24\n anetwork.channel.aidl.Connection r24 = r0.getConnection(r1, r2) // Catch:{ Exception -> 0x02f2 }\n r0 = r24\n r1 = r28\n r1.conn = r0 // Catch:{ Exception -> 0x02f2 }\n L_0x018c:\n r24 = 200(0xc8, float:2.8E-43)\n r0 = r20\n r1 = r24\n if (r0 != r1) goto L_0x0195\n r15 = 0\n L_0x0195:\n r0 = r28\n java.util.concurrent.atomic.AtomicBoolean r0 = r0.isCancelled // Catch:{ Exception -> 0x02f2 }\n r24 = r0\n boolean r24 = r24.get() // Catch:{ Exception -> 0x02f2 }\n if (r24 == 0) goto L_0x01d8\n if (r6 == 0) goto L_0x01a6\n r6.close() // Catch:{ Exception -> 0x0433 }\n L_0x01a6:\n if (r17 == 0) goto L_0x01ab\n r17.close() // Catch:{ Exception -> 0x0436 }\n L_0x01ab:\n if (r14 == 0) goto L_0x01b0\n r14.close() // Catch:{ Exception -> 0x0439 }\n L_0x01b0:\n r0 = r28\n anetwork.channel.download.DownloadManager r0 = anetwork.channel.download.DownloadManager.this\n r24 = r0\n android.util.SparseArray r25 = r24.taskMap\n monitor-enter(r25)\n r0 = r28\n anetwork.channel.download.DownloadManager r0 = anetwork.channel.download.DownloadManager.this // Catch:{ all -> 0x01d5 }\n r24 = r0\n android.util.SparseArray r24 = r24.taskMap // Catch:{ all -> 0x01d5 }\n r0 = r28\n int r0 = r0.taskId // Catch:{ all -> 0x01d5 }\n r26 = r0\n r0 = r24\n r1 = r26\n r0.remove(r1) // Catch:{ all -> 0x01d5 }\n monitor-exit(r25) // Catch:{ all -> 0x01d5 }\n goto L_0x000c\n L_0x01d5:\n r24 = move-exception\n monitor-exit(r25) // Catch:{ all -> 0x01d5 }\n throw r24\n L_0x01d8:\n r12 = 0\n if (r15 != 0) goto L_0x0250\n java.io.BufferedOutputStream r7 = new java.io.BufferedOutputStream // Catch:{ Exception -> 0x02f2 }\n java.io.FileOutputStream r24 = new java.io.FileOutputStream // Catch:{ Exception -> 0x02f2 }\n r0 = r24\n r0.<init>(r9) // Catch:{ Exception -> 0x02f2 }\n r0 = r24\n r7.<init>(r0) // Catch:{ Exception -> 0x02f2 }\n r6 = r7\n L_0x01eb:\n r0 = r28\n anetwork.channel.aidl.Connection r0 = r0.conn // Catch:{ Exception -> 0x02f2 }\n r24 = r0\n java.util.Map r24 = r24.getConnHeadFields() // Catch:{ Exception -> 0x02f2 }\n r0 = r28\n r1 = r20\n r2 = r24\n long r22 = r0.parseContentLength(r1, r2, r12) // Catch:{ Exception -> 0x02f2 }\n r0 = r28\n anetwork.channel.aidl.Connection r0 = r0.conn // Catch:{ Exception -> 0x02f2 }\n r24 = r0\n anetwork.channel.aidl.ParcelableInputStream r14 = r24.getInputStream() // Catch:{ Exception -> 0x02f2 }\n if (r14 != 0) goto L_0x0279\n r24 = -103(0xffffffffffffff99, float:NaN)\n java.lang.String r25 = \"input stream is null.\"\n r0 = r28\n r1 = r24\n r2 = r25\n r0.notifyFail(r1, r2) // Catch:{ Exception -> 0x02f2 }\n if (r6 == 0) goto L_0x021e\n r6.close() // Catch:{ Exception -> 0x043c }\n L_0x021e:\n if (r17 == 0) goto L_0x0223\n r17.close() // Catch:{ Exception -> 0x043f }\n L_0x0223:\n if (r14 == 0) goto L_0x0228\n r14.close() // Catch:{ Exception -> 0x0442 }\n L_0x0228:\n r0 = r28\n anetwork.channel.download.DownloadManager r0 = anetwork.channel.download.DownloadManager.this\n r24 = r0\n android.util.SparseArray r25 = r24.taskMap\n monitor-enter(r25)\n r0 = r28\n anetwork.channel.download.DownloadManager r0 = anetwork.channel.download.DownloadManager.this // Catch:{ all -> 0x024d }\n r24 = r0\n android.util.SparseArray r24 = r24.taskMap // Catch:{ all -> 0x024d }\n r0 = r28\n int r0 = r0.taskId // Catch:{ all -> 0x024d }\n r26 = r0\n r0 = r24\n r1 = r26\n r0.remove(r1) // Catch:{ all -> 0x024d }\n monitor-exit(r25) // Catch:{ all -> 0x024d }\n goto L_0x000c\n L_0x024d:\n r24 = move-exception\n monitor-exit(r25) // Catch:{ all -> 0x024d }\n throw r24\n L_0x0250:\n java.io.RandomAccessFile r18 = new java.io.RandomAccessFile // Catch:{ Exception -> 0x02f2 }\n java.lang.String r24 = \"rw\"\n r0 = r18\n r1 = r24\n r0.<init>(r9, r1) // Catch:{ Exception -> 0x02f2 }\n long r12 = r18.length() // Catch:{ Exception -> 0x0474, all -> 0x046f }\n r0 = r18\n r0.seek(r12) // Catch:{ Exception -> 0x0474, all -> 0x046f }\n java.io.BufferedOutputStream r7 = new java.io.BufferedOutputStream // Catch:{ Exception -> 0x0474, all -> 0x046f }\n java.nio.channels.FileChannel r24 = r18.getChannel() // Catch:{ Exception -> 0x0474, all -> 0x046f }\n java.io.OutputStream r24 = java.nio.channels.Channels.newOutputStream(r24) // Catch:{ Exception -> 0x0474, all -> 0x046f }\n r0 = r24\n r7.<init>(r0) // Catch:{ Exception -> 0x0474, all -> 0x046f }\n r17 = r18\n r6 = r7\n goto L_0x01eb\n L_0x0279:\n r10 = -1\n r21 = 0\n r24 = 2048(0x800, float:2.87E-42)\n r0 = r24\n byte[] r8 = new byte[r0] // Catch:{ Exception -> 0x02f2 }\n L_0x0282:\n int r10 = r14.read(r8) // Catch:{ Exception -> 0x02f2 }\n r24 = -1\n r0 = r24\n if (r10 == r0) goto L_0x0354\n r0 = r28\n java.util.concurrent.atomic.AtomicBoolean r0 = r0.isCancelled // Catch:{ Exception -> 0x02f2 }\n r24 = r0\n boolean r24 = r24.get() // Catch:{ Exception -> 0x02f2 }\n if (r24 == 0) goto L_0x02d8\n r0 = r28\n anetwork.channel.aidl.Connection r0 = r0.conn // Catch:{ Exception -> 0x02f2 }\n r24 = r0\n r24.cancel() // Catch:{ Exception -> 0x02f2 }\n if (r6 == 0) goto L_0x02a6\n r6.close() // Catch:{ Exception -> 0x0445 }\n L_0x02a6:\n if (r17 == 0) goto L_0x02ab\n r17.close() // Catch:{ Exception -> 0x0448 }\n L_0x02ab:\n if (r14 == 0) goto L_0x02b0\n r14.close() // Catch:{ Exception -> 0x044b }\n L_0x02b0:\n r0 = r28\n anetwork.channel.download.DownloadManager r0 = anetwork.channel.download.DownloadManager.this\n r24 = r0\n android.util.SparseArray r25 = r24.taskMap\n monitor-enter(r25)\n r0 = r28\n anetwork.channel.download.DownloadManager r0 = anetwork.channel.download.DownloadManager.this // Catch:{ all -> 0x02d5 }\n r24 = r0\n android.util.SparseArray r24 = r24.taskMap // Catch:{ all -> 0x02d5 }\n r0 = r28\n int r0 = r0.taskId // Catch:{ all -> 0x02d5 }\n r26 = r0\n r0 = r24\n r1 = r26\n r0.remove(r1) // Catch:{ all -> 0x02d5 }\n monitor-exit(r25) // Catch:{ all -> 0x02d5 }\n goto L_0x000c\n L_0x02d5:\n r24 = move-exception\n monitor-exit(r25) // Catch:{ all -> 0x02d5 }\n throw r24\n L_0x02d8:\n int r21 = r21 + r10\n r24 = 0\n r0 = r24\n r6.write(r8, r0, r10) // Catch:{ Exception -> 0x02f2 }\n r0 = r21\n long r0 = (long) r0 // Catch:{ Exception -> 0x02f2 }\n r24 = r0\n long r24 = r24 + r12\n r0 = r28\n r1 = r24\n r3 = r22\n r0.notifyProgress(r1, r3) // Catch:{ Exception -> 0x02f2 }\n goto L_0x0282\n L_0x02f2:\n r11 = move-exception\n L_0x02f3:\n java.lang.String r24 = \"anet.DownloadManager\"\n java.lang.String r25 = \"file download failed!\"\n r26 = 0\n r27 = 0\n r0 = r27\n java.lang.Object[] r0 = new java.lang.Object[r0] // Catch:{ all -> 0x03ee }\n r27 = r0\n r0 = r24\n r1 = r25\n r2 = r26\n r3 = r27\n anet.channel.util.ALog.e(r0, r1, r2, r11, r3) // Catch:{ all -> 0x03ee }\n r24 = -104(0xffffffffffffff98, float:NaN)\n java.lang.String r25 = r11.toString() // Catch:{ all -> 0x03ee }\n r0 = r28\n r1 = r24\n r2 = r25\n r0.notifyFail(r1, r2) // Catch:{ all -> 0x03ee }\n if (r6 == 0) goto L_0x0322\n r6.close() // Catch:{ Exception -> 0x0460 }\n L_0x0322:\n if (r17 == 0) goto L_0x0327\n r17.close() // Catch:{ Exception -> 0x0463 }\n L_0x0327:\n if (r14 == 0) goto L_0x032c\n r14.close() // Catch:{ Exception -> 0x0466 }\n L_0x032c:\n r0 = r28\n anetwork.channel.download.DownloadManager r0 = anetwork.channel.download.DownloadManager.this\n r24 = r0\n android.util.SparseArray r25 = r24.taskMap\n monitor-enter(r25)\n r0 = r28\n anetwork.channel.download.DownloadManager r0 = anetwork.channel.download.DownloadManager.this // Catch:{ all -> 0x0351 }\n r24 = r0\n android.util.SparseArray r24 = r24.taskMap // Catch:{ all -> 0x0351 }\n r0 = r28\n int r0 = r0.taskId // Catch:{ all -> 0x0351 }\n r26 = r0\n r0 = r24\n r1 = r26\n r0.remove(r1) // Catch:{ all -> 0x0351 }\n monitor-exit(r25) // Catch:{ all -> 0x0351 }\n goto L_0x000c\n L_0x0351:\n r24 = move-exception\n monitor-exit(r25) // Catch:{ all -> 0x0351 }\n throw r24\n L_0x0354:\n r6.flush() // Catch:{ Exception -> 0x02f2 }\n r0 = r28\n java.util.concurrent.atomic.AtomicBoolean r0 = r0.isCancelled // Catch:{ Exception -> 0x02f2 }\n r24 = r0\n boolean r24 = r24.get() // Catch:{ Exception -> 0x02f2 }\n if (r24 == 0) goto L_0x039a\n if (r6 == 0) goto L_0x0368\n r6.close() // Catch:{ Exception -> 0x044e }\n L_0x0368:\n if (r17 == 0) goto L_0x036d\n r17.close() // Catch:{ Exception -> 0x0451 }\n L_0x036d:\n if (r14 == 0) goto L_0x0372\n r14.close() // Catch:{ Exception -> 0x0454 }\n L_0x0372:\n r0 = r28\n anetwork.channel.download.DownloadManager r0 = anetwork.channel.download.DownloadManager.this\n r24 = r0\n android.util.SparseArray r25 = r24.taskMap\n monitor-enter(r25)\n r0 = r28\n anetwork.channel.download.DownloadManager r0 = anetwork.channel.download.DownloadManager.this // Catch:{ all -> 0x0397 }\n r24 = r0\n android.util.SparseArray r24 = r24.taskMap // Catch:{ all -> 0x0397 }\n r0 = r28\n int r0 = r0.taskId // Catch:{ all -> 0x0397 }\n r26 = r0\n r0 = r24\n r1 = r26\n r0.remove(r1) // Catch:{ all -> 0x0397 }\n monitor-exit(r25) // Catch:{ all -> 0x0397 }\n goto L_0x000c\n L_0x0397:\n r24 = move-exception\n monitor-exit(r25) // Catch:{ all -> 0x0397 }\n throw r24\n L_0x039a:\n java.io.File r24 = new java.io.File // Catch:{ Exception -> 0x02f2 }\n r0 = r28\n java.lang.String r0 = r0.filePath // Catch:{ Exception -> 0x02f2 }\n r25 = r0\n r24.<init>(r25) // Catch:{ Exception -> 0x02f2 }\n r0 = r24\n r9.renameTo(r0) // Catch:{ Exception -> 0x02f2 }\n r0 = r28\n java.lang.String r0 = r0.filePath // Catch:{ Exception -> 0x02f2 }\n r24 = r0\n r0 = r28\n r1 = r24\n r0.notifySuccess(r1) // Catch:{ Exception -> 0x02f2 }\n if (r6 == 0) goto L_0x03bc\n r6.close() // Catch:{ Exception -> 0x0457 }\n L_0x03bc:\n if (r17 == 0) goto L_0x03c1\n r17.close() // Catch:{ Exception -> 0x045a }\n L_0x03c1:\n if (r14 == 0) goto L_0x03c6\n r14.close() // Catch:{ Exception -> 0x045d }\n L_0x03c6:\n r0 = r28\n anetwork.channel.download.DownloadManager r0 = anetwork.channel.download.DownloadManager.this\n r24 = r0\n android.util.SparseArray r25 = r24.taskMap\n monitor-enter(r25)\n r0 = r28\n anetwork.channel.download.DownloadManager r0 = anetwork.channel.download.DownloadManager.this // Catch:{ all -> 0x03eb }\n r24 = r0\n android.util.SparseArray r24 = r24.taskMap // Catch:{ all -> 0x03eb }\n r0 = r28\n int r0 = r0.taskId // Catch:{ all -> 0x03eb }\n r26 = r0\n r0 = r24\n r1 = r26\n r0.remove(r1) // Catch:{ all -> 0x03eb }\n monitor-exit(r25) // Catch:{ all -> 0x03eb }\n goto L_0x000c\n L_0x03eb:\n r24 = move-exception\n monitor-exit(r25) // Catch:{ all -> 0x03eb }\n throw r24\n L_0x03ee:\n r24 = move-exception\n L_0x03ef:\n if (r6 == 0) goto L_0x03f4\n r6.close() // Catch:{ Exception -> 0x0469 }\n L_0x03f4:\n if (r17 == 0) goto L_0x03f9\n r17.close() // Catch:{ Exception -> 0x046b }\n L_0x03f9:\n if (r14 == 0) goto L_0x03fe\n r14.close() // Catch:{ Exception -> 0x046d }\n L_0x03fe:\n r0 = r28\n anetwork.channel.download.DownloadManager r0 = anetwork.channel.download.DownloadManager.this\n r25 = r0\n android.util.SparseArray r25 = r25.taskMap\n monitor-enter(r25)\n r0 = r28\n anetwork.channel.download.DownloadManager r0 = anetwork.channel.download.DownloadManager.this // Catch:{ all -> 0x041e }\n r26 = r0\n android.util.SparseArray r26 = r26.taskMap // Catch:{ all -> 0x041e }\n r0 = r28\n int r0 = r0.taskId // Catch:{ all -> 0x041e }\n r27 = r0\n r26.remove(r27) // Catch:{ all -> 0x041e }\n monitor-exit(r25) // Catch:{ all -> 0x041e }\n throw r24\n L_0x041e:\n r24 = move-exception\n monitor-exit(r25) // Catch:{ all -> 0x041e }\n throw r24\n L_0x0421:\n r24 = move-exception\n goto L_0x00ef\n L_0x0424:\n r24 = move-exception\n goto L_0x00f4\n L_0x0427:\n r24 = move-exception\n goto L_0x00f9\n L_0x042a:\n r24 = move-exception\n goto L_0x0148\n L_0x042d:\n r24 = move-exception\n goto L_0x014d\n L_0x0430:\n r24 = move-exception\n goto L_0x0152\n L_0x0433:\n r24 = move-exception\n goto L_0x01a6\n L_0x0436:\n r24 = move-exception\n goto L_0x01ab\n L_0x0439:\n r24 = move-exception\n goto L_0x01b0\n L_0x043c:\n r24 = move-exception\n goto L_0x021e\n L_0x043f:\n r24 = move-exception\n goto L_0x0223\n L_0x0442:\n r24 = move-exception\n goto L_0x0228\n L_0x0445:\n r24 = move-exception\n goto L_0x02a6\n L_0x0448:\n r24 = move-exception\n goto L_0x02ab\n L_0x044b:\n r24 = move-exception\n goto L_0x02b0\n L_0x044e:\n r24 = move-exception\n goto L_0x0368\n L_0x0451:\n r24 = move-exception\n goto L_0x036d\n L_0x0454:\n r24 = move-exception\n goto L_0x0372\n L_0x0457:\n r24 = move-exception\n goto L_0x03bc\n L_0x045a:\n r24 = move-exception\n goto L_0x03c1\n L_0x045d:\n r24 = move-exception\n goto L_0x03c6\n L_0x0460:\n r24 = move-exception\n goto L_0x0322\n L_0x0463:\n r24 = move-exception\n goto L_0x0327\n L_0x0466:\n r24 = move-exception\n goto L_0x032c\n L_0x0469:\n r25 = move-exception\n goto L_0x03f4\n L_0x046b:\n r25 = move-exception\n goto L_0x03f9\n L_0x046d:\n r25 = move-exception\n goto L_0x03fe\n L_0x046f:\n r24 = move-exception\n r17 = r18\n goto L_0x03ef\n L_0x0474:\n r11 = move-exception\n r17 = r18\n goto L_0x02f3\n */\n throw new UnsupportedOperationException(\"Method not decompiled: anetwork.channel.download.DownloadManager.DownloadTask.run():void\");\n }", "void mo54418a(DownloadTask downloadTask);", "public void torrentScrape() {\n\t\tAlfred.getTorrentScraper().scrape();\n\t}", "@Override\r\n\tpublic void run() {\r\n\t\ttry {\r\n\t\t\tthis.inputStream = socket.getInputStream();\r\n\t\t\tthis.outputStream = socket.getOutputStream();\r\n\t\t\t// Get the peer that is asking me for fragments.\r\n\t\t\tpeerState = torrentClient.getPeerStateList().getByAddress(\r\n\t\t\t\t\tsocket.getInetAddress().getHostAddress(), socket.getPort());\r\n\t\t\t// read handhake\r\n\t\t\tbyte[] received = new byte[68];\r\n\t\t\tinputStream.read(received);\r\n\t\t\t//Parse the handshake received\r\n\t\t\tHandsake handshakeMessage = Handsake\r\n\t\t\t\t\t.parseStringToHandsake(new String(received));\r\n\t\t\t// validate hash\r\n\t\t\tString torrentHash = new String(torrentClient.getMetainf()\r\n\t\t\t\t\t.getInfo().getInfoHash());\r\n\t\t\t//if the received handshake is correct send my handshake\r\n\t\t\tif (Handsake.isValidHandsakeForBitTorrentProtocol(handshakeMessage,\r\n\t\t\t\t\ttorrentHash)) {\r\n\t\t\t\t// send handshake\r\n\t\t\t\tHandsake handShakeToSend = new Handsake(torrentHash,\r\n\t\t\t\t\t\tthis.torrentClient.getPeerId());\r\n\t\t\t\tthis.outputStream.write(handShakeToSend.getBytes());\r\n\t\t\t\t// enviar bitfield\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.sendBitfield();\r\n\t\t\t\t\t// leer\r\n\t\t\t\t\tPeerProtocolMessage message = this.readNormalMessage();\r\n\t\t\t\t\t// Check if I have received an interested message\r\n\t\t\t\t\tif (message.getType().equals(\r\n\t\t\t\t\t\t\tPeerProtocolMessage.Type.INTERESTED)) {\r\n\t\t\t\t\t\tif (this.peerState != null) {\r\n\t\t\t\t\t\t\tpeerState = torrentClient.getPeerStateList()\r\n\t\t\t\t\t\t\t\t\t.getByAddress(\r\n\t\t\t\t\t\t\t\t\t\t\tsocket.getInetAddress()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.getHostAddress(),\r\n\t\t\t\t\t\t\t\t\t\t\tsocket.getPort());\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//Set the peer status\r\n\t\t\t\t\t\tif (this.peerState != null) {\r\n\t\t\t\t\t\t\tthis.peerState.setPeer_interested(true);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// send unchoke to the peer\r\n\t\t\t\t\t\tthis.outputStream.write(new UnChokeMsg().getBytes());\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//set the peer status\r\n\t\t\t\t\t\tif (this.peerState != null) {\r\n\t\t\t\t\t\t\tthis.peerState.setAm_choking(false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//Continue receiveing messages if the message type is Keep_alive, Request or Have.\r\n\t\t\t\t\t\tboolean continueReading = true;\r\n\t\t\t\t\t\twhile (continueReading) {\r\n\t\t\t\t\t\t\tmessage = this.readNormalMessage();\r\n\t\t\t\t\t\t\tcontinueReading = processMessage(message);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// if I have not received interested send unchoke\r\n\t\t\t\t\t\tthis.outputStream.write(new ChokeMsg().getBytes());\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} catch (IOException ioe) {\r\n\t\t\t\t\tioe.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// close connection\r\n\t\t\tthis.inputStream.close();\r\n\t\t\tthis.outputStream.close();\r\n\t\t\tsocket.close();\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\tSystem.out.println(\"Sending thread closed\");\r\n\t\t\te.printStackTrace();\r\n\t\t\ttry {\r\n\t\t\t\tthis.inputStream.close();\r\n\t\t\t\tthis.outputStream.close();\r\n\t\t\t\tsocket.close();\r\n\t\t\t} catch (IOException e1) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te1.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override public byte Async_init() {\n\t\tString src = \"http://ftp.sunet.se/pub/multimedia/graphics/ImageMagick/binaries/ImageMagick-6.8.8-1-Q16-x86-windows.zip\";\r\n\t\tthis.Init(\"downloading\", src, trg);\r\n\t\treturn super.Async_init();\r\n\t}", "public void download() {\n }", "public interface EventSink {\n\n /**\n * Generate event, that a new peer has been discovered for some torrent.\n *\n * @since 1.5\n */\n void firePeerDiscovered(TorrentId torrentId, Peer peer);\n\n /**\n * Generate event, that a new connection with some peer has been established.\n *\n * @since 1.9\n */\n void firePeerConnected(ConnectionKey connectionKey);\n\n /**\n * Generate event, that a connection with some peer has been terminated.\n *\n * @since 1.9\n */\n void firePeerDisconnected(ConnectionKey connectionKey);\n\n /**\n * Generate event, that local information about some peer's data has been updated.\n *\n * @since 1.9\n */\n void firePeerBitfieldUpdated(TorrentId torrentId, ConnectionKey connectionKey, Bitfield bitfield);\n\n /**\n * Generate event, that processing of some torrent has begun.\n *\n * @since 1.5\n */\n void fireTorrentStarted(TorrentId torrentId);\n\n /**\n * Generate event, that torrent's metadata has been fetched.\n *\n * @since 1.9\n */\n void fireMetadataAvailable(TorrentId torrentId, Torrent torrent);\n\n /**\n * Generate event, that processing of some torrent has finished.\n *\n * @since 1.5\n */\n void fireTorrentStopped(TorrentId torrentId);\n\n /**\n * Generate event, that the downloading and verification\n * of one of torrent's pieces has been finished.\n *\n * @since 1.8\n */\n void firePieceVerified(TorrentId torrentId, int pieceIndex);\n}", "public interface ReceivedBlockHandler {\n /** Cleanup old blocks older than the given threshold time */\n public void cleanupOldBlocks (long threshTime) ;\n /** Store a received block with the given block id and return related metadata */\n public org.apache.spark.streaming.receiver.ReceivedBlockStoreResult storeBlock (org.apache.spark.storage.StreamBlockId blockId, org.apache.spark.streaming.receiver.ReceivedBlock receivedBlock) ;\n}", "@Override\n public void onCoinsReceived(Wallet w, Transaction tx, Coin prevBalance, Coin newBalance) {\n Coin value = tx.getValueSentToMe(w);\n System.out.println(\"Received tx for \" + value.toFriendlyString() + \": \" + tx);\n System.out.println(\"Transaction will be forwarded after it confirms.\");\n // Wait until it's made it into the block chain (may run immediately if it's already there).\n //\n // For this dummy app of course, we could just forward the unconfirmed transaction. If it were\n // to be double spent, no harm done. Wallet.allowSpendingUnconfirmedTransactions() would have to\n // be called in onSetupCompleted() above. But we don't do that here to demonstrate the more common\n // case of waiting for a block.\n Context.propagate(w.getContext());\n Futures.addCallback(tx.getConfidence().getDepthFuture(2), new FutureCallback<TransactionConfidence>() {\n @Override\n public void onSuccess(TransactionConfidence result) {\n System.out.println(\"Confirmation received.\");\n forwardCoins(tx);\n }\n\n @Override\n public void onFailure(Throwable t) {\n // This kind of future can't fail, just rethrow in case something weird happens.\n throw new RuntimeException(t);\n }\n }, MoreExecutors.directExecutor());\n\n Futures.addCallback(tx.getConfidence().getDepthFuture(1), new FutureCallback<TransactionConfidence>() {\n @Override\n public void onSuccess(TransactionConfidence result) {\n System.out.println(\"Confirmation received.\");\n blockchainIdentity(tx);\n }\n\n @Override\n public void onFailure(Throwable t) {\n // This kind of future can't fail, just rethrow in case something weird happens.\n throw new RuntimeException(t);\n }\n }, MoreExecutors.directExecutor());\n\n /*Futures.addCallback(tx.getConfidence().getDepthFuture(3), new FutureCallback<TransactionConfidence>() {\n @Override\n public void onSuccess(TransactionConfidence result) {\n System.out.println(\"3 confirmations received. -- create user\");\n blockchainUser(tx);\n }\n\n @Override\n public void onFailure(Throwable t) {\n // This kind of future can't fail, just rethrow in case something weird happens.\n throw new RuntimeException(t);\n }\n }, MoreExecutors.directExecutor());*/\n }", "void onDownloadComplete(EzDownloadRequest downloadRequest);", "synchronized void addDownloadedBlock(int index, int blockLength) {\n for (int i = 0; i < blocks.size(); i++) {\n final Block b = (Block) blocks.get(i);\n if (b.isConnectedToStart(index, blockLength)) {\n b.prepend(blockLength);\n updateState();\n return;\n } else if (b.isConnectedToEnd(index)) {\n b.append(blockLength);\n updateState();\n return;\n }\n }\n blocks.add(new Block(index, blockLength));\n }", "public void visit(SendBlock sb);", "public void OnFileDataReceived(byte[] data,int read, int length, int downloaded);", "public void callback() {\n showProgress(false);\n this.completed = true;\n if (!isActive()) {\n skip(this.url, this.result, this.status);\n } else if (this.callback != null) {\n Class[] clsArr = {String.class, this.type, AjaxStatus.class};\n AQUtility.invokeHandler(getHandler(), this.callback, true, true, clsArr, DEFAULT_SIG, this.url, this.result, this.status);\n } else {\n try {\n callback(this.url, this.result, this.status);\n } catch (Exception e) {\n AQUtility.report(e);\n }\n }\n filePut();\n if (!this.blocked) {\n this.status.close();\n }\n wake();\n AQUtility.debugNotify();\n }", "public LowLevelNetworkHandler setCallback(Callback callback);", "@Override\n\tpublic void run() {\n\t\ttry{\n\t\t\tboolean redirected=false;\n\t\t\tint responseCode=0;\n\t\t\tint tries=0;\n\t\t\tString location=site.getUrl();\n\t\t\tHttpURLConnection urlConnection=null;\n\t\t\tdo{\n\t\t\t\tURL url = new URL(location);\n\t\t\t\turlConnection = (HttpURLConnection) url.openConnection();\n\t\t\t\turlConnection.setRequestProperty(\"User-Agent\", \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11\");\n\t\t\t\turlConnection.setConnectTimeout(Constants.CONNECTION_TIMEOUT);\n\t\t\t\turlConnection.setReadTimeout(Constants.READ_TIMEOUT);\n\t\t\t\turlConnection.setRequestMethod(\"GET\");\n\t\t\t\turlConnection.setInstanceFollowRedirects(true);\n\t\t\t\turlConnection.setUseCaches(false);\n\t\t\t\turlConnection.setAllowUserInteraction(false);\n\t\t\t\turlConnection.setRequestProperty(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\t\t\t\tresponseCode = urlConnection.getResponseCode();\n\t\t\t\t\n\t\t\t\tif(responseCode==HttpURLConnection.HTTP_MOVED_TEMP || responseCode==HttpURLConnection.HTTP_MOVED_PERM){ //handle 302 and 301 redirect. \n\t\t\t\t\tredirected=true;\n\t\t\t\t\tlocation = urlConnection.getHeaderField(\"Location\");\n\t\t\t\t\ttries++;\n\t\t\t\t}else\n\t\t\t\t\tredirected=false;\n\t\t\t}while(redirected && tries<3);\n\t\t\t\n\t\t\tif (responseCode == HttpURLConnection.HTTP_OK){\n\t\t\t\ttry (InputStream is = urlConnection.getInputStream();\n\t\t BufferedReader br = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8))) {\n\t\t String content = br.lines().collect(Collectors.joining(System.lineSeparator()));\n\t \tthis.callback.webContentCallBack(site, content);\n\t\t } \n\t\t\t}else this.callback.webContentCallBack(site, null); //any other case, null is returned as the content. \n\t\t}catch (Exception e) {\n\t\t\tLogger.getLogger(Fetcher.class.getName()).log(Level.WARNING, \"Site:\"+site.getUrl()+\" failed fetching.\", e);\n\t\t\ttry {\n\t\t\t\tthis.callback.webContentCallBack(site, null); //any exception, null is returned as the content. \n\t\t\t} catch (Exception e1) {\n\t\t\t} \n\t\t}\n\t}", "@Override\n public void completed(Integer result, AsynchronousSocketChannel channel ) {\n\n //ipaddress\n String ipAdr = \"\";\n try{\n\n //Print IPAdress\n ipAdr = channel.getRemoteAddress().toString();\n System.out.println(ipAdr);\n }catch(IOException e) {\n e.printStackTrace();\n }\n\n //if client is close ,return\n buf.flip();\n if (buf.limit() == 0) return;\n\n //Print Message\n String msg = getString(buf);\n\n //time\n SimpleDateFormat sdf = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss.SSS\");\n sdf.setTimeZone(TimeZone.getTimeZone(\"Asia/Taipei\"));\n System.out.println(sdf.format(new Date()) + \" \" + buf.limit() + \" client: \"+ ipAdr + \" \" + msg);\n\n //\n order ord = null;\n try{\n ord = ParseOrder(sdf.format(new Date()), msg, ipAdr);\n }catch(Exception ex){\n startRead( channel );\n return;\n }\n //2021/05/23 15:55:14.763,TXF,B,10000.0,1,127.0.0.1\n //2021/05/23 15:55:14.763,TXF,S,10000.0,1,127.0.0.1\n\n if (ord.BS.equals(\"B\")) {\n limit(ord, bid);\n }\n if (ord.BS.equals(\"S\")) {\n limit(ord, ask);\n }\n if (trade(bid, ask, match) == true){\n startWrite(clientChannel, \"Mat:\" + match.get(match.size()-1).sysTime + \",\" + match.get(match.size()-1).stockNo+\",\"+\n match.get(match.size()-1).BS+\",\"+match.get(match.size()-1).qty+\",\"+match.get(match.size()-1).price+\"\\n\");\n }\n\n //send to all \n startWrite(clientChannel, \"Ord:\" + getAllOrder(bid, ask)+\"\\n\");\n \n //bid size and ask size\n System.out.println(\"Blist:\" + bid.size() + \" Alist:\" + ask.size());\n\n // echo the message\n//------------------> //startWrite( channel, buf );\n \n //start to read next message again\n startRead( channel );\n }", "public void sendRRequests() {\n\n }", "@Override\r\n\tpublic void run() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t//Get a list of pairs. The pair will be a chunkname with a chunkserver \r\n\t\t/*for(Pair<String, String> p: EventFactory.hostToFiles.getChunkLocations(message.getContent())){\r\n\t\t\tSystem.out.println(\"The location is: \" + p.getKey() + \" and the chunkname is: \" + p.getValue());\r\n\t\t\t\r\n\t\t\t//actual code will contact chunk servers and tell them to read and forward the file to the client\r\n\t\t\tMessage forwardToClient = new Message(\"ForwardChunkToClient\");\r\n\t\t\t//chunkname, servername, port\r\n\t\t\tforwardToClient.setContent(p.getKey());\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tTCPSender sender = new TCPSender(new Socket(p.getValue().split(\" \")[0], Integer.parseInt(p.getValue().split(\" \")[1])));\r\n\t\t\t\tsender.sendData(forwardToClient);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t} catch (NumberFormatException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (UnknownHostException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}*/\r\n\t\t//Send the list to the client so it can request the chunks from chunkServers\r\n\t\t//Any other way seems like it would be beyond a pain. \r\n\t\tLinkedList<String> fileAndHosts = new LinkedList<String>();\r\n\t\tfor(PairStrings p: EventFactory.hostToFiles.getChunkLocations(message.getContent())) {\r\n\t\t\tString fileAndHost = p.getValue() + \" \" + p.getKey();\r\n\t\t\tfileAndHosts.add(fileAndHost);\r\n\t\t}\r\n\t\t\r\n\t\tMessage getFromChunkServers = new Message(\"RequestChunksFromServers\");\r\n\t\t\r\n\t\t//If the list is empy, the no file was found, report invalid.\r\n\t\tif(fileAndHosts.size() == 0) {\r\n\t\t\tgetFromChunkServers.setList(fileAndHosts);\r\n\t\t\tgetFromChunkServers.setContent(\"invalid\" + \" \" + message.getContent());\r\n\t\t} else {\r\n\t\t\tgetFromChunkServers.setList(fileAndHosts);\r\n\t\t\tgetFromChunkServers.setContent(\"valid\" + \" \" + message.getContent());\r\n\t\t}\r\n\t\t\r\n\t\ttry {\r\n\t\t\tTCPSender sender = new TCPSender(new Socket(message.getSenderHostName(), message.getSenderPort()));\r\n\t\t\tsender.sendData(getFromChunkServers);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "public synchronized void run() {\n\n try {\n\n while(true) {\n\n Thread.sleep(10000);\n\n Socket s = new Socket(server, 8999); // Request list in port 8999\n ObjectInputStream r = new ObjectInputStream(s.getInputStream());\n Message m = (Message) r.readObject();\n peerList = (PeerList) m.peerList; // Store new peer list\n\n for (int i = peerList.getSize() - 1; i >= 0; i--)\n new Thread(new download(peerList.getIP(i), peerList.getPort(i))).start(); // start thread to download image blocks from other peers\n\n }\n\n } catch (Exception e){\n\n // e.printStackTrace();\n\n }\n\n }", "public interface TransferAgent\n extends Closeable\n{\n //-------------------------------------------------------------------------\n void throttle(long maxBytesPerSecond);\n void unThrottle();\n\n\n //-------------------------------------------------------------------------\n ShellFile file (String remoteFilePath);\n List<ShellFile> files(String inRemoteFilePath);\n\n\n //-------------------------------------------------------------------------\n // @returns true if the file already exists, or if it was created\n boolean makeDir (String remoteDirectoryPath);\n boolean makeDirs(String remoteDirectoryPath);\n\n\n //-------------------------------------------------------------------------\n boolean upload(\n String localFileName, String remoteFileName);\n\n boolean upload(\n File localFile, String remoteFile);\n\n /**\n * Does not automatically close the given source stream.\n * \n * Works only on the immediate host to which this agent logged into.\n * If you would like to transfer data that are one or more network\n * hops away (i.e. recursive ssh calls), then you will need to\n * upload to the immediate host, then scp to the destination host,\n * and then delete the immediate copy (to clean up).\n *\n * @param source data to be uploaded\n * @param remoteFileName destination file path/name\n * @return true if the entire uploaded was successful\n */\n boolean upload(\n InputStream source, String remoteFileName);\n \n \n //-------------------------------------------------------------------------\n boolean download(\n String remoteFileName, String localFileName);\n\n boolean download(\n String remoteFileName, File localFile);\n\n /**\n * Does not automatically close the given source stream.\n *\n * For downloading data from multiple network hops away,\n * use a similar method as described for uploading.\n * @see #upload(InputStream, String)\n * \n * @param remoteFileName file path/name to download\n * @param destination sink for remote file data\n * @return true if the entire download was successful\n */\n boolean download(\n String remoteFileName, OutputStream destination);\n\n\n //-------------------------------------------------------------------------\n boolean open();\n void openChecked() throws IOException;\n\n @Override\n void close();\n}", "public JSONPeers(String base) {\n\t\tthis.l = new Semaphore(1);\n\t\tthis.path = Paths.get(base, Peer.jsonPeerPath).toString();\n\t}", "public interface Uploader extends BandwidthTracker {\n\n\tpublic static final int CONNECTING = 0;\n\tpublic static final int FREELOADER = 1;\n\tpublic static final int LIMIT_REACHED = 2;\n\tpublic static final int UPLOADING = 3;\n\tpublic static final int COMPLETE = 4;\n\tpublic static final int INTERRUPTED = 5;\n\tpublic static final int FILE_NOT_FOUND = 7;\n public static final int BROWSE_HOST = 8;\n public static final int QUEUED = 9;\n public static final int UPDATE_FILE = 10;\n public static final int MALFORMED_REQUEST = 11;\n public static final int PUSH_PROXY = 12;\n public static final int UNAVAILABLE_RANGE = 13;\n public static final int BANNED_GREEDY \t = 14;\n public static final int THEX_REQUEST = 15;\n public static final int BROWSER_CONTROL = 16;\n public static final int NOT_VALIDATED = 17;\n\n /**\n\t * Stops this upload. If the download is already \n\t * stopped, it does nothing.\n\t */ \n\tpublic void stop();\n \n\t/**\n\t * returns the name of the file being uploaded.\n\t */\n\tpublic String getFileName();\n\t\n\t/**\n\t * returns the length of the file being uploaded.\n\t */ \n\tpublic long getFileSize();\n\t\n\t/**\n\t * returns the length of the requested size for uploading\n\t */ \n\tpublic long getAmountRequested();\t\n\n\t/**\n\t * Returns the <tt>FileDesc</tt> for this uploader -- the file that\n\t * is being uploaded.\n\t *\n\t * @return the <tt>FileDesc</tt> for this uploader -- the file that\n\t * is being uploaded, which can be <tt>null</tt> in cases such as when\n\t * the file can't be found\n\t */\n\tpublic FileDesc getFileDesc();\n\n\t/**\n\t * returns the index of the file being uploaded.\n\t */ \n\tpublic int getIndex();\n\n\t/**\n\t * returns the amount that of data that has been uploaded.\n\t * this method was previously called \"amountRead\", but the\n\t * name was changed to make more sense.\n\t */ \n\tpublic long amountUploaded();\n\t\n\t/**\n\t * Returns the amount of data that this uploader and all previous\n\t * uploaders exchanging this file have uploaded.\n\t */\n\tpublic long getTotalAmountUploaded();\n\n\t/**\n\t * returns the string representation of the IP Address\n\t * of the host being uploaded to.\n\t */\n\tpublic String getHost();\n\n /**\n * Returns the current state of this uploader.\n */\n public int getState();\n \n /**\n * Returns the last transfer state of this uploader.\n * Transfers states are all states except INTERRUPTED, COMPLETE,\n * and CONNECTING.\n */\n public int getLastTransferState();\n\n\t/**\n\t * Sets the state of this uploader.\n\t */\n\tpublic void setState(int state);\n\n\tpublic void writeResponse() throws IOException;\n\n\t/**\n\t * returns true if chat for the host is on, false if it is not.\n\t */\n\tpublic boolean isChatEnabled();\n\t\n\t/**\n\t * returns true if browse host is enabled, false if it is not.\n\t */\n\tpublic boolean isBrowseHostEnabled();\n\t\n\t/**\n\t * return the port of the gnutella-client host (not the HTTP port)\n\t */\n\tpublic int getGnutellaPort();\n\t\n\t/** \n\t * return the userAgent\n\t */\n\tpublic String getUserAgent();\n\t\n\t/** \n\t * return whether or not the headers have been parsed\n\t */\n\tpublic boolean isHeaderParsed();\n\n public boolean supportsQueueing();\n \n /**\n * returns the current request method.\n */\n public HTTPRequestMethod getMethod();\n \n /**\n * Returns the current queue position if queued.\n */\n public int getQueuePosition();\n \n /**\n * Returns whether or not the uploader is in an inactive state.\n */\n public boolean isInactive();\n}", "private void onReceivedResponseData(org.apache.http.HttpResponse r14, com.tencent.tmassistantsdk.protocol.jce.DownloadChunkLogInfo r15) {\n /*\n r13 = this;\n r2 = 705; // 0x2c1 float:9.88E-43 double:3.483E-321;\n r6 = 206; // 0xce float:2.89E-43 double:1.02E-321;\n r7 = 0;\n r12 = 0;\n r0 = r14.getEntity();\n r1 = r13.verifyTotalLen(r14, r0);\n if (r1 != 0) goto L_0x0022;\n L_0x0010:\n r0 = \"_DownloadTask\";\n r1 = \"verifyTotalLen false\";\n com.tencent.tmassistantsdk.util.TMLog.i(r0, r1);\n r0 = new com.tencent.tmassistantsdk.downloadservice.StopRequestException;\n r1 = \"totalLen is not match the requestSize\";\n r0.<init>(r2, r1);\n throw r0;\n L_0x0022:\n r1 = r13.mDownloadInfo;\n r2 = r1.getTotalSize();\n r4 = 0;\n r1 = (r2 > r4 ? 1 : (r2 == r4 ? 0 : -1));\n if (r1 != 0) goto L_0x015c;\n L_0x002e:\n r1 = r14.getStatusLine();\n r1 = r1.getStatusCode();\n r2 = 200; // 0xc8 float:2.8E-43 double:9.9E-322;\n if (r1 != r2) goto L_0x00f9;\n L_0x003a:\n r1 = r13.mDownloadInfo;\n r2 = r0.getContentLength();\n r1.setTotalSize(r2);\n r1 = \"_DownloadTask\";\n r2 = new java.lang.StringBuilder;\n r3 = \"HTTPCode 200, totalBytes:\";\n r2.<init>(r3);\n r3 = r13.mDownloadInfo;\n r4 = r3.getTotalSize();\n r2 = r2.append(r4);\n r2 = r2.toString();\n com.tencent.tmassistantsdk.util.TMLog.i(r1, r2);\n L_0x005f:\n r1 = \"_DownloadTask\";\n r2 = new java.lang.StringBuilder;\n r3 = \"first start downloadinfoTotalSize = \";\n r2.<init>(r3);\n r3 = r13.mDownloadInfo;\n r4 = r3.getTotalSize();\n r2 = r2.append(r4);\n r2 = r2.toString();\n com.tencent.tmassistantsdk.util.TMLog.w(r1, r2);\n r1 = \"content-range\";\n r1 = r14.getFirstHeader(r1);\n if (r1 == 0) goto L_0x00a0;\n L_0x0084:\n r1 = r1.getValue();\n r1 = com.tencent.tmassistantsdk.downloadservice.ByteRange.parseContentRange(r1);\n r2 = r1.getStart();\n r15.responseRangePosition = r2;\n r2 = r1.getEnd();\n r4 = r1.getStart();\n r2 = r2 - r4;\n r4 = 1;\n r2 = r2 + r4;\n r15.responseRangeLength = r2;\n L_0x00a0:\n r1 = r13.mDownloadInfo;\n r2 = r1.getTotalSize();\n r15.responseContentLength = r2;\n L_0x00a8:\n r1 = r13.mSaveFile;\n if (r1 != 0) goto L_0x00bb;\n L_0x00ac:\n r1 = new com.tencent.tmassistantsdk.storage.TMAssistantFile;\n r2 = r13.mDownloadInfo;\n r2 = r2.mTempFileName;\n r3 = r13.mDownloadInfo;\n r3 = r3.mFileName;\n r1.<init>(r2, r3);\n r13.mSaveFile = r1;\n L_0x00bb:\n r2 = 0;\n r10 = r0.getContent();\t Catch:{ SocketException -> 0x0406 }\n r0 = \"_DownloadTask\";\n r1 = new java.lang.StringBuilder;\t Catch:{ SocketException -> 0x0406 }\n r4 = \"start write file, fileName: \";\n r1.<init>(r4);\t Catch:{ SocketException -> 0x0406 }\n r4 = r13.mDownloadInfo;\t Catch:{ SocketException -> 0x0406 }\n r4 = r4.mFileName;\t Catch:{ SocketException -> 0x0406 }\n r1 = r1.append(r4);\t Catch:{ SocketException -> 0x0406 }\n r1 = r1.toString();\t Catch:{ SocketException -> 0x0406 }\n com.tencent.tmassistantsdk.util.TMLog.i(r0, r1);\t Catch:{ SocketException -> 0x0406 }\n r8 = r2;\n L_0x00dc:\n r0 = r13.mRecvBuf;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r3 = r10.read(r0);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n if (r3 <= 0) goto L_0x00eb;\n L_0x00e4:\n r0 = r13.mStopTask;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n if (r0 == 0) goto L_0x0262;\n L_0x00e8:\n r10.close();\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n L_0x00eb:\n r0 = r13.mSaveFile;\n if (r0 == 0) goto L_0x00f6;\n L_0x00ef:\n r0 = r13.mSaveFile;\n r0.close();\n r13.mSaveFile = r12;\n L_0x00f6:\n r15.receiveDataSize = r8;\n return;\n L_0x00f9:\n r1 = r14.getStatusLine();\n r1 = r1.getStatusCode();\n if (r1 != r6) goto L_0x0135;\n L_0x0103:\n r1 = \"content-range\";\n r1 = r14.getFirstHeader(r1);\n r2 = r13.mDownloadInfo;\n r1 = r1.getValue();\n r4 = com.tencent.tmassistantsdk.downloadservice.ByteRange.getTotalSize(r1);\n r2.setTotalSize(r4);\n r1 = \"_DownloadTask\";\n r2 = new java.lang.StringBuilder;\n r3 = \"HTTPCode 206, totalBytes:\";\n r2.<init>(r3);\n r3 = r13.mDownloadInfo;\n r4 = r3.getTotalSize();\n r2 = r2.append(r4);\n r2 = r2.toString();\n com.tencent.tmassistantsdk.util.TMLog.i(r1, r2);\n goto L_0x005f;\n L_0x0135:\n r1 = \"_DownloadTask\";\n r2 = new java.lang.StringBuilder;\n r3 = \"statusCode=\";\n r2.<init>(r3);\n r3 = r14.getStatusLine();\n r3 = r3.getStatusCode();\n r2 = r2.append(r3);\n r3 = \" onReceivedResponseData error.\";\n r2 = r2.append(r3);\n r2 = r2.toString();\n com.tencent.tmassistantsdk.util.TMLog.w(r1, r2);\n goto L_0x005f;\n L_0x015c:\n r1 = r14.getStatusLine();\n r1 = r1.getStatusCode();\n if (r1 != r6) goto L_0x00a8;\n L_0x0166:\n r1 = \"content-range\";\n r1 = r14.getFirstHeader(r1);\t Catch:{ Throwable -> 0x0214 }\n r2 = r1.getValue();\t Catch:{ Throwable -> 0x0214 }\n r2 = com.tencent.tmassistantsdk.downloadservice.ByteRange.parseContentRange(r2);\t Catch:{ Throwable -> 0x0214 }\n r3 = r1.getValue();\t Catch:{ Throwable -> 0x0214 }\n r4 = com.tencent.tmassistantsdk.downloadservice.ByteRange.getTotalSize(r3);\t Catch:{ Throwable -> 0x0214 }\n r8 = r2.getStart();\t Catch:{ Throwable -> 0x0214 }\n r15.responseRangePosition = r8;\t Catch:{ Throwable -> 0x0214 }\n r8 = r2.getEnd();\t Catch:{ Throwable -> 0x0214 }\n r10 = r2.getStart();\t Catch:{ Throwable -> 0x0214 }\n r8 = r8 - r10;\n r10 = 1;\n r8 = r8 + r10;\n r15.responseRangeLength = r8;\t Catch:{ Throwable -> 0x0214 }\n r15.responseContentLength = r4;\t Catch:{ Throwable -> 0x0214 }\n r3 = \"_DownloadTask\";\n r6 = new java.lang.StringBuilder;\t Catch:{ Throwable -> 0x0214 }\n r8 = \"totalSize = \";\n r6.<init>(r8);\t Catch:{ Throwable -> 0x0214 }\n r6 = r6.append(r4);\t Catch:{ Throwable -> 0x0214 }\n r8 = \" downloadinfoTotalSize = \";\n r6 = r6.append(r8);\t Catch:{ Throwable -> 0x0214 }\n r8 = r13.mDownloadInfo;\t Catch:{ Throwable -> 0x0214 }\n r8 = r8.getTotalSize();\t Catch:{ Throwable -> 0x0214 }\n r6 = r6.append(r8);\t Catch:{ Throwable -> 0x0214 }\n r6 = r6.toString();\t Catch:{ Throwable -> 0x0214 }\n com.tencent.tmassistantsdk.util.TMLog.w(r3, r6);\t Catch:{ Throwable -> 0x0214 }\n r3 = \"_DownloadTask\";\n r6 = new java.lang.StringBuilder;\t Catch:{ Throwable -> 0x0214 }\n r8 = \"mReceivedBytes = \";\n r6.<init>(r8);\t Catch:{ Throwable -> 0x0214 }\n r8 = r13.mDownloadInfo;\t Catch:{ Throwable -> 0x0214 }\n r8 = r8.mReceivedBytes;\t Catch:{ Throwable -> 0x0214 }\n r6 = r6.append(r8);\t Catch:{ Throwable -> 0x0214 }\n r6 = r6.toString();\t Catch:{ Throwable -> 0x0214 }\n com.tencent.tmassistantsdk.util.TMLog.i(r3, r6);\t Catch:{ Throwable -> 0x0214 }\n r3 = \"_DownloadTask\";\n r6 = new java.lang.StringBuilder;\t Catch:{ Throwable -> 0x0214 }\n r8 = \"start = \";\n r6.<init>(r8);\t Catch:{ Throwable -> 0x0214 }\n r8 = r2.getStart();\t Catch:{ Throwable -> 0x0214 }\n r6 = r6.append(r8);\t Catch:{ Throwable -> 0x0214 }\n r8 = \", end = \";\n r6 = r6.append(r8);\t Catch:{ Throwable -> 0x0214 }\n r8 = r2.getEnd();\t Catch:{ Throwable -> 0x0214 }\n r6 = r6.append(r8);\t Catch:{ Throwable -> 0x0214 }\n r6 = r6.toString();\t Catch:{ Throwable -> 0x0214 }\n com.tencent.tmassistantsdk.util.TMLog.i(r3, r6);\t Catch:{ Throwable -> 0x0214 }\n r2 = r2.getStart();\t Catch:{ Throwable -> 0x0214 }\n r6 = r13.mDownloadInfo;\t Catch:{ Throwable -> 0x0214 }\n r8 = r6.mReceivedBytes;\t Catch:{ Throwable -> 0x0214 }\n r2 = (r2 > r8 ? 1 : (r2 == r8 ? 0 : -1));\n if (r2 == 0) goto L_0x022a;\n L_0x0209:\n r0 = new com.tencent.tmassistantsdk.downloadservice.StopRequestException;\t Catch:{ Throwable -> 0x0214 }\n r1 = 706; // 0x2c2 float:9.9E-43 double:3.49E-321;\n r2 = \"The received size is not equal with ByteRange.\";\n r0.<init>(r1, r2);\t Catch:{ Throwable -> 0x0214 }\n throw r0;\t Catch:{ Throwable -> 0x0214 }\n L_0x0214:\n r0 = move-exception;\n r1 = new com.tencent.tmassistantsdk.downloadservice.StopRequestException;\t Catch:{ all -> 0x021d }\n r2 = 704; // 0x2c0 float:9.87E-43 double:3.48E-321;\n r1.<init>(r2, r0);\t Catch:{ all -> 0x021d }\n throw r1;\t Catch:{ all -> 0x021d }\n L_0x021d:\n r0 = move-exception;\n r1 = r13.mSaveFile;\n if (r1 == 0) goto L_0x0229;\n L_0x0222:\n r1 = r13.mSaveFile;\n r1.close();\n r13.mSaveFile = r12;\n L_0x0229:\n throw r0;\n L_0x022a:\n r2 = r13.mDownloadInfo;\t Catch:{ Throwable -> 0x0214 }\n r2 = r2.getTotalSize();\t Catch:{ Throwable -> 0x0214 }\n r2 = (r4 > r2 ? 1 : (r4 == r2 ? 0 : -1));\n if (r2 == 0) goto L_0x023f;\n L_0x0234:\n r0 = new com.tencent.tmassistantsdk.downloadservice.StopRequestException;\t Catch:{ Throwable -> 0x0214 }\n r1 = 705; // 0x2c1 float:9.88E-43 double:3.483E-321;\n r2 = \"The total size is not equal with ByteRange.\";\n r0.<init>(r1, r2);\t Catch:{ Throwable -> 0x0214 }\n throw r0;\t Catch:{ Throwable -> 0x0214 }\n L_0x023f:\n r2 = \"_DownloadTask\";\n r3 = new java.lang.StringBuilder;\t Catch:{ Throwable -> 0x0214 }\n r4 = \"response ByteRange: \";\n r3.<init>(r4);\t Catch:{ Throwable -> 0x0214 }\n r1 = r3.append(r1);\t Catch:{ Throwable -> 0x0214 }\n r1 = r1.toString();\t Catch:{ Throwable -> 0x0214 }\n com.tencent.tmassistantsdk.util.TMLog.d(r2, r1);\t Catch:{ Throwable -> 0x0214 }\n r1 = r13.mSaveFile;\n if (r1 == 0) goto L_0x00a8;\n L_0x0259:\n r1 = r13.mSaveFile;\n r1.close();\n r13.mSaveFile = r12;\n goto L_0x00a8;\n L_0x0262:\n r0 = r13.mDownloadInfo;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = r0.mReceivedBytes;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r4 = (long) r3;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = r0 + r4;\n r2 = r13.mDownloadInfo;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r4 = r2.getTotalSize();\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r2 = (r0 > r4 ? 1 : (r0 == r4 ? 0 : -1));\n if (r2 > 0) goto L_0x03be;\n L_0x0272:\n r2 = r13.mDownloadInfo;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r4 = r2.getTotalSize();\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = (r0 > r4 ? 1 : (r0 == r4 ? 0 : -1));\n if (r0 != 0) goto L_0x0315;\n L_0x027c:\n r6 = 1;\n L_0x027d:\n r0 = r13.mSaveFile;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = r13.mRecvBuf;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r2 = 0;\n r4 = r13.mDownloadInfo;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r4 = r4.mReceivedBytes;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = r0.write(r1, r2, r3, r4, r6);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n if (r0 != 0) goto L_0x03b4;\n L_0x028c:\n r0 = com.tencent.tmassistantsdk.storage.TMAssistantFile.getSavePathRootDir();\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = r13.mDownloadInfo;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r4 = r1.getTotalSize();\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = com.tencent.tmassistantsdk.downloadservice.DownloadHelper.isSpaceEnough(r0, r4);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n if (r0 == 0) goto L_0x0367;\n L_0x029c:\n r0 = com.tencent.tmassistantsdk.storage.TMAssistantFile.isSDCardExistAndCanWrite();\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n if (r0 == 0) goto L_0x0318;\n L_0x02a2:\n r0 = new java.lang.StringBuilder;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = \"write file failed, fileName: \";\n r0.<init>(r1);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = r13.mDownloadInfo;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = r1.mFileName;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = r0.append(r1);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = \" receivedSize: \";\n r0 = r0.append(r1);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = r13.mDownloadInfo;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r4 = r1.mReceivedBytes;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = r0.append(r4);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = \" readedSize: \";\n r0 = r0.append(r1);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = r0.append(r3);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = \" totalSize: \";\n r0 = r0.append(r1);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = r13.mDownloadInfo;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r2 = r1.getTotalSize();\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = r0.append(r2);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = r0.toString();\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = \"_DownloadTask\";\n com.tencent.tmassistantsdk.util.TMLog.w(r1, r0);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = new com.tencent.tmassistantsdk.downloadservice.StopRequestException;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r2 = 703; // 0x2bf float:9.85E-43 double:3.473E-321;\n r1.<init>(r2, r0);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n throw r1;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n L_0x02ef:\n r0 = move-exception;\n r2 = r8;\n L_0x02f1:\n r1 = \"_DownloadTask\";\n r4 = \"\";\n r5 = 0;\n r5 = new java.lang.Object[r5];\t Catch:{ all -> 0x0305 }\n com.tencent.mm.sdk.platformtools.w.printErrStackTrace(r1, r0, r4, r5);\t Catch:{ all -> 0x0305 }\n r1 = new com.tencent.tmassistantsdk.downloadservice.StopRequestException;\t Catch:{ all -> 0x0305 }\n r4 = 605; // 0x25d float:8.48E-43 double:2.99E-321;\n r1.<init>(r4, r0);\t Catch:{ all -> 0x0305 }\n throw r1;\t Catch:{ all -> 0x0305 }\n L_0x0305:\n r0 = move-exception;\n r8 = r2;\n L_0x0307:\n r1 = r13.mSaveFile;\n if (r1 == 0) goto L_0x0312;\n L_0x030b:\n r1 = r13.mSaveFile;\n r1.close();\n r13.mSaveFile = r12;\n L_0x0312:\n r15.receiveDataSize = r8;\n throw r0;\n L_0x0315:\n r6 = r7;\n goto L_0x027d;\n L_0x0318:\n r0 = new java.lang.StringBuilder;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = \"write file failed, no sdCard! fileName: \";\n r0.<init>(r1);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = r13.mDownloadInfo;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = r1.mFileName;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = r0.append(r1);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = \" receivedSize: \";\n r0 = r0.append(r1);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = r13.mDownloadInfo;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r4 = r1.mReceivedBytes;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = r0.append(r4);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = \" readedSize: \";\n r0 = r0.append(r1);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = r0.append(r3);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = \" totalSize: \";\n r0 = r0.append(r1);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = r13.mDownloadInfo;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r2 = r1.getTotalSize();\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = r0.append(r2);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = r0.toString();\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = \"_DownloadTask\";\n com.tencent.tmassistantsdk.util.TMLog.w(r1, r0);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = new com.tencent.tmassistantsdk.downloadservice.StopRequestException;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r2 = 711; // 0x2c7 float:9.96E-43 double:3.513E-321;\n r1.<init>(r2, r0);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n throw r1;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n L_0x0365:\n r0 = move-exception;\n goto L_0x0307;\n L_0x0367:\n r0 = new java.lang.StringBuilder;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = \"write file failed, no enough space! fileName: \";\n r0.<init>(r1);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = r13.mDownloadInfo;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = r1.mFileName;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = r0.append(r1);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = \" receivedSize: \";\n r0 = r0.append(r1);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = r13.mDownloadInfo;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r4 = r1.mReceivedBytes;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = r0.append(r4);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = \" readedSize: \";\n r0 = r0.append(r1);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = r0.append(r3);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = \" totalSize: \";\n r0 = r0.append(r1);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = r13.mDownloadInfo;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r2 = r1.getTotalSize();\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = r0.append(r2);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = r0.toString();\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = \"_DownloadTask\";\n com.tencent.tmassistantsdk.util.TMLog.w(r1, r0);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = new com.tencent.tmassistantsdk.downloadservice.StopRequestException;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r2 = 710; // 0x2c6 float:9.95E-43 double:3.51E-321;\n r1.<init>(r2, r0);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n throw r1;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n L_0x03b4:\n r0 = r13.mDownloadInfo;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r4 = (long) r3;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0.updateReceivedSize(r4);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r0 = (long) r3;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r8 = r8 + r0;\n goto L_0x00dc;\n L_0x03be:\n r0 = \"write file size too long.\";\n r1 = \"_DownloadTask\";\n r2 = new java.lang.StringBuilder;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r4 = \"write file size too long.\\r\\nreadedLen: \";\n r2.<init>(r4);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r2 = r2.append(r3);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r3 = \"\\r\\nreceivedSize: \";\n r2 = r2.append(r3);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r3 = r13.mDownloadInfo;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r4 = r3.mReceivedBytes;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r2 = r2.append(r4);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r3 = \"\\r\\ntotalSize: \";\n r2 = r2.append(r3);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r3 = r13.mDownloadInfo;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r4 = r3.getTotalSize();\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r2 = r2.append(r4);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r3 = \"\\r\\nisTheEndData: false\";\n r2 = r2.append(r3);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r2 = r2.toString();\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n com.tencent.tmassistantsdk.util.TMLog.w(r1, r2);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r1 = new com.tencent.tmassistantsdk.downloadservice.StopRequestException;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n r2 = 703; // 0x2bf float:9.85E-43 double:3.473E-321;\n r1.<init>(r2, r0);\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n throw r1;\t Catch:{ SocketException -> 0x02ef, all -> 0x0365 }\n L_0x0406:\n r0 = move-exception;\n goto L_0x02f1;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.tencent.tmassistantsdk.downloadservice.DownloadTask.onReceivedResponseData(org.apache.http.HttpResponse, com.tencent.tmassistantsdk.protocol.jce.DownloadChunkLogInfo):void\");\n }", "void onProgress(EzDownloadRequest downloadRequest, long totalBytes, long downloadedBytes, int progress);", "@Override\n public void run() {\n downloadInfo.state = STATE_DOWNLOADING;\n notifyStateChange(downloadInfo);\n\n //6.specific download, two kinds of education\n // re-download and resume downloads\n Request request;\n File file = new File(downloadInfo.path);\n if (!file.exists() || file.length() != downloadInfo.currentLength) {\n //file is not exists, or file size in downloadInfo saved inconsistent\n //the file is invalid\n file.delete();\n downloadInfo.currentLength = 0;\n\n //need to re-download\n String url = String.format(Url.APP_DOWNLOAD, downloadInfo.downloadUrl);\n request = new Request.Builder().url(url).build();\n } else {\n //need to resume download\n String url = String.format(Url.APP_BREAK_DOWNLOAD, downloadInfo.downloadUrl, downloadInfo.currentLength);\n request = new Request.Builder().url(url).build();\n }\n\n Response response = null;\n InputStream is = null;\n FileOutputStream fos = null;\n\n try {\n response = okHttpClient.newCall(request).execute();\n is = response.body().byteStream();\n\n if (response != null && is != null) {\n fos = new FileOutputStream(file, true);\n\n byte[] buffer = new byte[1024 * 8];\n int len = -1;\n while ((len = is.read(buffer)) != -1 && downloadInfo.state == STATE_DOWNLOADING) {\n fos.write(buffer, 0, len);\n fos.flush();\n\n downloadInfo.currentLength = downloadInfo.currentLength + len;\n notifyProgressChange(downloadInfo);\n }\n } else {\n //the server return an error\n downloadInfo.state = STATE_ERROR;\n downloadInfo.currentLength = 0;\n file.delete();\n notifyStateChange(downloadInfo);\n }\n\n\n } catch (IOException e) {\n e.printStackTrace();\n\n downloadInfo.state = STATE_ERROR;\n downloadInfo.currentLength = 0;\n file.delete();\n notifyStateChange(downloadInfo);\n } finally {\n try {\n fos.close();\n is.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }\n\n //handle the case did not come here,there are has three situation\n //1.download finish 2.download error 3.download pause\n if (file.length() == downloadInfo.currentLength && downloadInfo.state == STATE_DOWNLOADING) {\n //说明下载完成\n downloadInfo.state = STATE_FINISH;\n notifyStateChange(downloadInfo);\n } else if (downloadInfo.state == STATE_PAUSE) {\n notifyStateChange(downloadInfo);\n } else {\n downloadInfo.state = STATE_ERROR;\n downloadInfo.currentLength = 0;\n file.delete();\n notifyStateChange(downloadInfo);\n }\n\n //requires runnable is removed from the current from downloadTaskMap at the end of the task\n downloadTaskMap.remove(downloadInfo.id);\n }", "private IOHandler(){\n download_queue = new ArrayList<>(); \n initialize();\n }", "@Override\r\n\t public void run() {\n\r\n\t\ttry {\r\n\t\t URL uri = new URL(url);\r\n\t\t String newParams = URLEncoder.encode(params, \"utf-8\");\r\n\t\t HttpURLConnection conn = (HttpURLConnection) uri\r\n\t\t\t .openConnection();\r\n\t\t conn.setRequestMethod(\"POST\");\r\n\t\t // 设置请求的参数\r\n\t\t conn.setDoInput(true);\r\n\t\t conn.setDoOutput(true);\r\n\r\n\t\t conn.getOutputStream().write(newParams.getBytes());\r\n\r\n\t\t if (conn.getResponseCode() == 200) {\r\n\t\t\tInputStream is = conn.getInputStream();\r\n\t\t\tString result = convertInputStreamToString(is);\r\n\t\t\t// 通过handler发送消息\r\n\t\t\tMessage msg = new Message();\r\n\t\t\tmsg.what = 1;\r\n\t\t\tmsg.obj = result;\r\n\t\t\thandler.sendMessage(msg);\r\n\t\t }\r\n\t\t} catch (MalformedURLException e) {\r\n\t\t // TODO Auto-generated catch block\r\n\t\t e.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t // TODO Auto-generated catch block\r\n\t\t e.printStackTrace();\r\n\t\t}\r\n\t }", "MovilizerRequest prepareDownloadRequest(Long systemId, String password, Integer numResponses,\n MovilizerRequest request);", "public void init() {\n // TODO start asynchronous download of heavy resources\n }", "private void getBlockListNetworkCall(final Context context, int offset, int limit) {\n\n HashMap<String, Object> serviceParams = new HashMap<String, Object>();\n HashMap<String, Object> tokenServiceHeaderParams = new HashMap<String, Object>();\n\n tokenServiceHeaderParams.put(Keys.TOKEN, UserSharedPreference.readUserToken());\n serviceParams.put(Keys.LIST_OFFSET, offset);\n serviceParams.put(Keys.LIST_LIMIT, limit);\n\n new WebServicesVolleyTask(context, false, \"\",\n EnumUtils.ServiceName.get_blocked_user,\n EnumUtils.RequestMethod.GET, serviceParams, tokenServiceHeaderParams, new AsyncResponseCallBack() {\n\n @Override\n public void onTaskComplete(TaskItem taskItem) {\n\n if (taskItem != null) {\n\n if (taskItem.isError()) {\n if (getUserVisibleHint())\n showNoResult(true);\n } else {\n try {\n\n if (taskItem.getResponse() != null) {\n\n JSONObject jsonObject = new JSONObject(taskItem.getResponse());\n\n // todo parse actual model\n JSONArray favoritesJsonArray = jsonObject.getJSONArray(\"users\");\n\n Gson gson = new Gson();\n Type listType = new TypeToken<List<BlockUserBO>>() {\n }.getType();\n List<BlockUserBO> newStreams = (List<BlockUserBO>) gson.fromJson(favoritesJsonArray.toString(),\n listType);\n\n totalRecords = jsonObject.getInt(\"total_records\");\n if (totalRecords == 0) {\n showNoResult(true);\n } else {\n if (blockListAdapter != null) {\n if (startIndex != 0) {\n //for the case of load more...\n blockListAdapter.removeLoadingItem();\n } else {\n //for the case of pulltoRefresh...\n blockListAdapter.clearItems();\n }\n }\n\n showNoResult(false);\n setUpBlockListRecycler(newStreams);\n }\n }\n } catch (Exception ex) {\n showNoResult(true);\n ex.printStackTrace();\n }\n }\n }\n }\n });\n }", "public interface DownloadFile {\n\n void start(ZionDownloadListener downloadListener);\n\n}", "public interface BlockWorkerClient extends Closeable {\n\n /**\n * @return the address of the worker\n */\n WorkerNetAddress getWorkerNetAddress();\n\n /**\n * Updates the latest block access time on the worker.\n *\n * @param blockId The id of the block\n * @throws IOException if an I/O error occurs\n */\n void accessBlock(final long blockId) throws IOException;\n\n /**\n * Notifies the worker the block is cached.\n *\n * @param blockId The id of the block\n * @throws IOException if an I/O error occurs\n * @throws AlluxioException if an Alluxio error occurs\n */\n void cacheBlock(final long blockId) throws IOException, AlluxioException;\n\n /**\n * Notifies worker that the block has been cancelled.\n *\n * @param blockId The Id of the block to be cancelled\n * @throws IOException if an I/O error occurs\n * @throws AlluxioException if an Alluxio error occurs\n */\n void cancelBlock(final long blockId) throws IOException, AlluxioException;\n\n /**\n * @return the address of the worker's data server\n */\n InetSocketAddress getDataServerAddress();\n\n /**\n * @return the id of the session\n */\n long getSessionId();\n\n /**\n * Locks the block, therefore, the worker will not evict the block from the memory until it is\n * unlocked.\n *\n * @param blockId The id of the block\n * @return the path of the block file locked\n * @throws IOException if a non-Alluxio exception occurs\n */\n LockBlockResult lockBlock(final long blockId) throws IOException;\n\n /**\n * Promotes block back to the top StorageTier.\n *\n * @param blockId The id of the block that will be promoted\n * @return true if succeed, false otherwise\n * @throws IOException if an I/O error occurs\n * @throws AlluxioException if an Alluxio error occurs\n */\n boolean promoteBlock(final long blockId) throws IOException, AlluxioException;\n\n /**\n * Gets temporary path for the block from the worker.\n *\n * @param blockId The id of the block\n * @param initialBytes The initial size bytes allocated for the block\n * @return the temporary path of the block\n * @throws IOException if a non-Alluxio exception occurs\n */\n String requestBlockLocation(final long blockId, final long initialBytes) throws IOException;\n\n /**\n * Requests space for some block from worker.\n *\n * @param blockId The id of the block\n * @param requestBytes The requested space size, in bytes\n * @return true if space was successfully allocated, false if the worker is unable to allocate\n * space due to space exhaustion\n * @throws IOException if an exception occurs\n */\n boolean requestSpace(final long blockId, final long requestBytes) throws IOException;\n\n /**\n * Unlocks the block.\n *\n * @param blockId The id of the block\n * @return true if success, false otherwise\n * @throws IOException if an I/O error occurs\n */\n boolean unlockBlock(final long blockId) throws IOException;\n\n /**\n * Sends a session heartbeat to the worker. This renews the client's lease on resources such as\n * locks and temporary files.\n *\n * @throws IOException if an I/O error occurs\n * @throws InterruptedException if this thread is interrupted\n */\n void sessionHeartbeat() throws IOException, InterruptedException;\n\n /**\n * Called only by {@link BlockWorkerClientHeartbeatExecutor}, encapsulates\n * {@link #sessionHeartbeat()} in order to handle the exceptions.\n * @throws InterruptedException if this thread is interrupted\n */\n void periodicHeartbeat() throws InterruptedException;\n\n /**\n * Closes the client.\n */\n @Override\n void close();\n}", "void fireTorrentStarted(TorrentId torrentId);", "@Override\n\t\t\t\t\tpublic void run() {\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tList<String> headers = readRequest(client);\n\t\t\t\t\t\t\tif (headers != null && headers.size() >= 1) {\n\t\t\t\t\t\t\t\tString requestURL = getRequestURL(headers.get(0));\n\t\t\t\t\t\t\t\tLog.d(TAG, requestURL);\n\n\t\t\t\t\t\t\t\tif (requestURL.startsWith(\"http://\")) {\n\n\t\t\t\t\t\t\t\t\t// HttpRequest request = new\n\t\t\t\t\t\t\t\t\t// BasicHttpRequest(\"GET\", requestURL);\n\n\t\t\t\t\t\t\t\t\tprocessHttpRequest(requestURL, client, headers);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tprocessFileRequest(requestURL, client, headers);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} catch (IllegalStateException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "@Ignore\n @Test\n public void startReiver() throws IOException, InterruptedException {\n\n final int maxPeers = 10;\n PeerDHT[] peers = createPeers(PORT, maxPeers, \"receiver\");\n for (int i = 1; i < maxPeers; i++) {\n \tPeerDHT peer = peers[i];\n peer.peer().bootstrap().peerAddress(peers[0].peer().peerAddress()).start().awaitUninterruptibly();\n peer.peer().objectDataReply(new ObjectDataReply() {\n @Override\n public Object reply(final PeerAddress sender, final Object request) throws Exception {\n System.out.println(\"got it!\");\n return \"recipient got it\";\n }\n });\n }\n Thread.sleep(Long.MAX_VALUE);\n }", "entities.Torrent.ChunkResponse getChunkResponse();", "Tetrisblock()\n {\n newblockparam();\n newmapparam();\n setboundary();\n }", "void fireMetadataAvailable(TorrentId torrentId, Torrent torrent);", "@SuppressWarnings(\"WeakerAccess\")\n protected void makeRequest() {\n if (mCallback == null) {\n CoreLogger.logError(addLoaderInfo(\"mCallback == null\"));\n return;\n }\n\n synchronized (mWaitLock) {\n mWaitForResponse.set(true);\n }\n\n doProgressSafe(true);\n\n Utils.runInBackground(true, new Runnable() {\n @Override\n public void run() {\n try {\n CoreLogger.log(addLoaderInfo(\"makeRequest\"));\n makeRequest(mCallback);\n }\n catch (Exception exception) {\n CoreLogger.log(addLoaderInfo(\"makeRequest failed\"), exception);\n callbackHelper(false, wrapException(exception));\n }\n }\n });\n }", "@Override\n public void run() {\n new ConnectBT().execute();\n }", "int getFollowRequests(AsyncResultHandler handler);", "@Override\n public void endBlock() {\n }", "void notifyBlockComplete(MessageSnapshot snapshot);", "@Override\n\t\t\tpublic void onConnectRemoteNode(String url) {\t \t\t\t\n\t\t\t}", "void firePeerDiscovered(TorrentId torrentId, Peer peer);", "@Override\n public TransferMode startBlock(Block block) {\n if (block.type == 1) {\n // return SIMPLE mode to received the payload as \"payload()\" calls\n return TransferMode.SIMPLE;\n } else {\n // return NULL to discard the payload of this block\n return TransferMode.NULL;\n }\n }", "void mo54427b(DownloadInfo downloadInfo);", "@Override\n public void run() {\n DownloadListener.getListener().execute();\n }", "private AdesaNetworkCall(){ }", "public Recv_args() {\r\n\t\tsuper();\r\n\t\trecv_args = new BRecv_args();\r\n\t}", "@Override\n public void onVersionFileDownloadTimeout() {\n\n }", "protected abstract boolean sendNextRequests();", "public abstract Downloader createDownloader(DownloaderConstructorHelper downloaderConstructorHelper);", "@Override\n\t\t\tpublic void callbackCall() {\n\t\t\t}", "private void startDownload(){\n final DownloadCurrent downloadCurrent = new DownloadCurrent(this);\n downloadCurrent.execute(UpdateTalesData.sData_HTTP);\n sProgDialDownload.setOnCancelListener(new DialogInterface.OnCancelListener() {\n @Override\n public void onCancel(DialogInterface dialog) {\n downloadCurrent.cancel(true);\n }\n });\n\n }", "public interface FileDownloader {\n boolean setInputSteam(String sourceUrl);\n void downloadFileFromStream();\n String getFileName();\n\n}", "public void downloadData(final String tripId, final String username) {\n HashMap<String, String> map = new HashMap<>();\n map.put(db.KEY_IS_BEGIN_DAY, \"false\");\n map.put(db.KEY_IS_LOAD_VERIFIED, \"false\");\n map.put(db.KEY_IS_END_DAY, \"false\");\n db.addData(db.LOCK_FLAGS, map);\n Chain chain = new Chain(new Chain.Link() {\n @Override\n public void run() {\n go();\n }\n });\n chain.setFail(new Chain.Link() {\n @Override\n public void run() throws Exception {\n fail();\n }\n });\n chain.add(new Chain.Link() {\n @Override\n public void run() {\n TripHeader.load(SettingsActivity.this, tripId, db);\n LoadDelivery.load(SettingsActivity.this, tripId, db);\n ArticleHeaders.load(SettingsActivity.this, tripId, db);\n CustomerHeaders.load(SettingsActivity.this, tripId, db);\n VisitList.load(SettingsActivity.this, tripId, db);\n Messages.load(SettingsActivity.this, username, db);\n CustomerDelivery.load(SettingsActivity.this, tripId, db);\n /*ArticleHeaders.loadData(getApplicationContext());\n CustomerHeaders.loadData(getApplicationContext());*/\n }\n });\n chain.add(new Chain.Link() {\n @Override\n public void run() {\n /*TripHeader.load(LoginActivity.this,tripId, db);\n LoadDelivery.load(LoginActivity.this,tripId, db);\n ArticleHeaders.load(LoginActivity.this, tripId, db);\n CustomerHeaders.load(LoginActivity.this, tripId, db);\n VisitList.load(LoginActivity.this,tripId, db);\n Messages.load(LoginActivity.this,username,db);*/\n ArticleHeaders.loadData(getApplicationContext());\n CustomerHeaders.loadData(getApplicationContext());\n OrderReasons.loadData(getApplicationContext());\n }\n });\n chain.start();\n }", "@Override\n public void taskProgress(String urlString, Object progress) {\n\n }", "public abstract void setNextBlockInstant();", "public void download() {\r\n\t\t\ttThread = new Thread(this);\r\n\t\t\ttThread.start();\r\n\t\t}", "public InnerSessionRequestCallback() {\r\n super();\r\n// this.requestCount = requestCount;\r\n }", "private void initializeDownload() {\n if (videoWorkerQueue.isEmpty()) {\n return;\n }\n\n mainPanel.getDownloadProgressPanel().setQueue(videoWorkerQueue);\n mainPanel.getDownloadProgressPanel().setVisible(true);\n\n// TwitchVideoInfo tvi = videoWorkerQueue.pop();\n\n videoInfo = videoWorkerQueue.poll(); // get the next Video\n videoInfo.setState(DOWNLOADING);\n try {\n // Select quality based on TwitchToolsPreferences\n String quality = videoInfo.getDownloadInfo().getPreferredQuality(TwitchLeecherPreferences.getQualityOrder());\n videoParts = videoInfo.getDownloadInfo().getTwitchBroadcastParts(quality); // get the Parts of a Video\n } catch (IOException e) {\n JOptionPane.showMessageDialog(mainPanel, e.getMessage(), \"Error\", ERROR_MESSAGE);\n }\n\n mainPanel.getDownloadProgressPanel().setMaximum(videoParts.size() * 100);\n mainPanel.getDownloadProgressPanel().setValue(0);\n mainPanel.getDownloadProgressPanel().setTitle(videoInfo.getTitle());\n\n //Add Part numbers for the WorkerThread\n int i = 0;\n\n File destinationFilenameTemplate = getVideoFile(videoInfo, false);\n\n List<File> destinationFiles = new ArrayList<>();\n\n for (TwitchVideoPart videoPart : videoParts) {\n videoPart.getFileExtension();\n videoPart.setPartNumber(i++);\n String destinationFilePath = String.format(\n \"%s_%04d%s\",\n destinationFilenameTemplate.getAbsolutePath(),\n videoPart.getPartNumber(),\n videoPart.getFileExtension()\n );\n\n File destinationFile = new File(destinationFilePath);\n// File destinationFile = new File(destinationFilenameTemplate.getAbsolutePath() + \"_\" +\n// String.valueOf(videoPart.getPartNumber() + videoPart.getFileExtension()));\n destinationFiles.add(destinationFile);\n TwitchDownloadWorker tdw = new TwitchDownloadWorker(destinationFile, videoPart);\n tdw.addPropertyChangeListener(this);\n tdw.addPropertyChangeListener(mainPanel.getDownloadProgressPanel());\n downloadExecutor.execute(tdw);\n }\n\n createPlaylistsFolder();\n\n playlist = new File(playlistFolderPath + videoInfo.getId() + \".m3u\");\n createM3uPlaylist(playlist, destinationFiles);\n ffmpegFileListFile = new File(playlistFolderPath + videoInfo.getId() + \".ffmpeglist\");\n createFFmpegFileList(ffmpegFileListFile, destinationFiles);\n }", "public static void main(String[] args){\n subThing st = new subThing(\"RAWR\");\n st.ep.start(Executors.newCachedThreadPool());\n for(;;){\n // try {\n // Thread.sleep(1);\n // } catch (InterruptedException e) {\n // e.printStackTrace();\n // }\n st.ep.execute();\n Thread.yield();\n }\n/*\n try {\n st.ep.listen(Constants.PROXY_PORT);\n // System.out.println((String) t.p.invoke(\"roar\"));\n for(;;) {\n st.ep.accept();\n }\n } catch (IOException e) {\n e.printStackTrace();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n }\n */\n /*Command cmdTwo = null;\n Command cmd = new Command(\"concat\",\"-nyan\");\n\n Method[] m = String.class.getMethods();\n Map<String,Method> coolMap = new HashMap<String,Method>();\n for (Method M: m){\n coolMap.put(M.getName(),M);\n }\n\n Object o = \" and again\";\n\n try {\n ObjectOutputStream oos = new ObjectOutputStream(new BufferedOutputStream(new FileOutputStream(\"./cmd.ser\")));\n oos.writeObject(cmd);\n oos.flush();\n oos.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n try {\n ObjectInputStream ois = new ObjectInputStream(new BufferedInputStream(new FileInputStream(\"./cmd.ser\")));\n cmdTwo = (Command)ois.readObject();\n System.out.println(coolMap.get(cmdTwo.method).invoke(\"rawr\", cmdTwo.args));\n } catch (IOException e) {\n e.printStackTrace();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n } catch (InvocationTargetException e) {\n e.printStackTrace();\n } catch (IllegalAccessException e) {\n e.printStackTrace();\n }\n\n */\n }", "@Override\n public void run() {\n System.out.println(\"Blockchain Identity Funding Transaction hash is \" + sendResult.tx.getTxId());\n System.out.println(sendResult.tx.toString());\n System.out.println(\"Blockchain Identity object Initialization\" + sendResult.tx.getTxId());\n blockchainIdentity = new BlockchainIdentity(platform, (CreditFundingTransaction)sendRequest.tx, kit.wallet(), null);\n }" ]
[ "0.6128051", "0.60799235", "0.5859956", "0.57879424", "0.5720575", "0.5484154", "0.5424303", "0.53937846", "0.53516495", "0.5329091", "0.53173816", "0.53146386", "0.53041977", "0.52944255", "0.5265086", "0.5258553", "0.52406883", "0.52375907", "0.52247465", "0.5223008", "0.5220745", "0.5187817", "0.5178703", "0.51723146", "0.51626605", "0.51303726", "0.51241755", "0.51152086", "0.5100539", "0.5076379", "0.50292474", "0.50289494", "0.49964398", "0.49888426", "0.49748558", "0.4955544", "0.49436656", "0.49385512", "0.4931225", "0.4929611", "0.49158618", "0.49116975", "0.49113", "0.4904913", "0.4887695", "0.4875965", "0.4875765", "0.4871601", "0.48652196", "0.4858488", "0.48484772", "0.48465976", "0.48433658", "0.48327368", "0.4829258", "0.4827589", "0.48126805", "0.4803768", "0.4799967", "0.4798372", "0.4797629", "0.47975093", "0.4792021", "0.47851554", "0.47830093", "0.477929", "0.4778719", "0.47780976", "0.47774333", "0.477348", "0.47676548", "0.47632185", "0.4758069", "0.4755712", "0.47523728", "0.47521508", "0.47445956", "0.47355893", "0.47342744", "0.4726025", "0.47258458", "0.47163245", "0.4710628", "0.47062743", "0.47047383", "0.46997178", "0.4699248", "0.46930417", "0.469217", "0.46877354", "0.46856987", "0.46804577", "0.467125", "0.46711963", "0.46627152", "0.4655371", "0.46522892", "0.46441206", "0.46423873", "0.4640699", "0.4636075" ]
0.0
-1
integration method for parent torrent, allows to make back calls with data loaded from a storage and ready to be sent to a peer CALLED by parent torrent only
@Override void enqueuePiece(ByteBuffer buffer, int index, int position, int length, Object params) { // if (DEBUG) System.out.println("[stdpc] enqueuePiece:" + index + "," + position + "," + length + " buf:" + buffer.remaining()); // sendQueue.forEach(pm -> // System.out.println(" -s> " + System.identityHashCode(pm) + " " +pm.type + " ," + pm.index +"," + pm.begin + "," + pm.length) // ); // peerBlockRequests.forEach(pm -> { // System.out.println(" -p> " + pm.type + " ," + pm.index +"," + pm.begin + "," + pm.length); // }); boolean found = false; // check for the active linked peer request and remove it for (int i = 0; i < peerBlockRequests.size(); i++) { StdPeerMessage pm = peerBlockRequests.get(i); if ((pm.index == index) && (pm.begin == position) && (pm.length == length)) { peerBlockRequests.remove(i); pmCache.release(pm); found = true; break; } } if (!found && DEBUG) { if (DEBUG) System.out.println("[stdpc] pBR not found"); } enqueue(pmCache.piece(index, position, length, buffer, params)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public interface Transport {\n\n /**\n * This method returns id of the current transport\n * @return\n */\n String id();\n\n /**\n * This methos returns Id of the upstream node\n * @return\n */\n String getUpstreamId();\n\n /**\n * This method returns random\n *\n * @param id\n * @param exclude\n * @return\n */\n String getRandomDownstreamFrom(String id, String exclude);\n\n /**\n * This method returns consumer that accepts messages for delivery\n * @return\n */\n Consumer<VoidMessage> outgoingConsumer();\n\n /**\n * This method returns flow of messages for parameter server\n * @return\n */\n Publisher<INDArrayMessage> incomingPublisher();\n\n /**\n * This method starts this Transport instance\n */\n void launch();\n\n /**\n * This method will start this Transport instance\n */\n void launchAsMaster();\n\n /**\n * This method shuts down this Transport instance\n */\n void shutdown();\n\n /**\n * This method will send message to the network, using tree structure\n * @param message\n */\n void propagateMessage(VoidMessage message, PropagationMode mode) throws IOException;\n\n /**\n * This method will send message to the node specified by Id\n *\n * @param message\n * @param id\n */\n void sendMessage(VoidMessage message, String id);\n\n /**\n * This method will send message to specified node, and will return its response\n *\n * @param message\n * @param id\n * @param <T>\n * @return\n */\n <T extends ResponseMessage> T sendMessageBlocking(RequestMessage message, String id) throws InterruptedException;\n\n /**\n * This method will send message to specified node, and will return its response\n *\n * @param message\n * @param id\n * @param <T>\n * @return\n */\n <T extends ResponseMessage> T sendMessageBlocking(RequestMessage message, String id, long waitTime, TimeUnit timeUnit) throws InterruptedException;\n\n /**\n * This method will be invoked for all incoming messages\n * PLEASE NOTE: this method is mostly suited for tests\n *\n * @param message\n */\n void processMessage(VoidMessage message);\n\n\n /**\n * This method allows to set callback instance, which will be called upon restart event\n * @param callback\n */\n void setRestartCallback(RestartCallback callback);\n\n /**\n * This methd allows to set callback instance for various\n * @param cls\n * @param callback\n * @param <T1> RequestMessage class\n * @param <T2> ResponseMessage class\n */\n <T extends RequestMessage> void addRequestConsumer(Class<T> cls, Consumer<T> consumer);\n\n /**\n * This method will be called if mesh update was received\n *\n * PLEASE NOTE: This method will be called ONLY if new mesh differs from current one\n * @param mesh\n */\n void onMeshUpdate(MeshOrganizer mesh);\n\n /**\n * This method will be called upon remap request\n * @param id\n */\n void onRemap(String id);\n\n /**\n * This method returns total number of nodes known to this Transport\n * @return\n */\n int totalNumberOfNodes();\n\n\n /**\n * This method returns ID of the root node\n * @return\n */\n String getRootId();\n\n /**\n * This method checks if all connections required for work are established\n * @return true\n */\n boolean isConnected();\n\n /**\n * This method checks if this node was properly introduced to driver\n * @return\n */\n boolean isIntroduced();\n\n /**\n * This method checks connection to the given node ID, and if it's not connected - establishes connection\n * @param id\n */\n void ensureConnection(String id);\n}", "@Override\n public void run() {\n load_remote_data();\n }", "void fireTorrentStarted(TorrentId torrentId);", "public void sendRemainData();", "@Override\n public ForwardStatus forward(IPersistable data)\n throws StoreForwardException\n {\n // Received data from callback.\n if ( data.getData() == null ) return null;\n\n StringBuilder sb = new StringBuilder(2048); // Define a size if you have an idea of it.\n char[] read = new char[128]; // Your buffer size.\n\n try (InputStreamReader ir = new InputStreamReader(data.getData(), StandardCharsets.UTF_8))\n {\n for (int i; -1 != (i = ir.read(read)); sb.append(read, 0, i))\n {\n // do nothing\n }\n }\n catch (Throwable t) // NOSONAR\n {\n // ignore\n }\n\n _logger.info(\"Received to forward data with data: \" + sb.toString()); //$NON-NLS-1$\n\n // When signal recieved, send the ForwardStatus\n return ForwardStatus.SUCCESSFUL;\n // return ForwardStatus.FAILED;\n\n }", "public interface Uploader extends BandwidthTracker {\n\n\tpublic static final int CONNECTING = 0;\n\tpublic static final int FREELOADER = 1;\n\tpublic static final int LIMIT_REACHED = 2;\n\tpublic static final int UPLOADING = 3;\n\tpublic static final int COMPLETE = 4;\n\tpublic static final int INTERRUPTED = 5;\n\tpublic static final int FILE_NOT_FOUND = 7;\n public static final int BROWSE_HOST = 8;\n public static final int QUEUED = 9;\n public static final int UPDATE_FILE = 10;\n public static final int MALFORMED_REQUEST = 11;\n public static final int PUSH_PROXY = 12;\n public static final int UNAVAILABLE_RANGE = 13;\n public static final int BANNED_GREEDY \t = 14;\n public static final int THEX_REQUEST = 15;\n public static final int BROWSER_CONTROL = 16;\n public static final int NOT_VALIDATED = 17;\n\n /**\n\t * Stops this upload. If the download is already \n\t * stopped, it does nothing.\n\t */ \n\tpublic void stop();\n \n\t/**\n\t * returns the name of the file being uploaded.\n\t */\n\tpublic String getFileName();\n\t\n\t/**\n\t * returns the length of the file being uploaded.\n\t */ \n\tpublic long getFileSize();\n\t\n\t/**\n\t * returns the length of the requested size for uploading\n\t */ \n\tpublic long getAmountRequested();\t\n\n\t/**\n\t * Returns the <tt>FileDesc</tt> for this uploader -- the file that\n\t * is being uploaded.\n\t *\n\t * @return the <tt>FileDesc</tt> for this uploader -- the file that\n\t * is being uploaded, which can be <tt>null</tt> in cases such as when\n\t * the file can't be found\n\t */\n\tpublic FileDesc getFileDesc();\n\n\t/**\n\t * returns the index of the file being uploaded.\n\t */ \n\tpublic int getIndex();\n\n\t/**\n\t * returns the amount that of data that has been uploaded.\n\t * this method was previously called \"amountRead\", but the\n\t * name was changed to make more sense.\n\t */ \n\tpublic long amountUploaded();\n\t\n\t/**\n\t * Returns the amount of data that this uploader and all previous\n\t * uploaders exchanging this file have uploaded.\n\t */\n\tpublic long getTotalAmountUploaded();\n\n\t/**\n\t * returns the string representation of the IP Address\n\t * of the host being uploaded to.\n\t */\n\tpublic String getHost();\n\n /**\n * Returns the current state of this uploader.\n */\n public int getState();\n \n /**\n * Returns the last transfer state of this uploader.\n * Transfers states are all states except INTERRUPTED, COMPLETE,\n * and CONNECTING.\n */\n public int getLastTransferState();\n\n\t/**\n\t * Sets the state of this uploader.\n\t */\n\tpublic void setState(int state);\n\n\tpublic void writeResponse() throws IOException;\n\n\t/**\n\t * returns true if chat for the host is on, false if it is not.\n\t */\n\tpublic boolean isChatEnabled();\n\t\n\t/**\n\t * returns true if browse host is enabled, false if it is not.\n\t */\n\tpublic boolean isBrowseHostEnabled();\n\t\n\t/**\n\t * return the port of the gnutella-client host (not the HTTP port)\n\t */\n\tpublic int getGnutellaPort();\n\t\n\t/** \n\t * return the userAgent\n\t */\n\tpublic String getUserAgent();\n\t\n\t/** \n\t * return whether or not the headers have been parsed\n\t */\n\tpublic boolean isHeaderParsed();\n\n public boolean supportsQueueing();\n \n /**\n * returns the current request method.\n */\n public HTTPRequestMethod getMethod();\n \n /**\n * Returns the current queue position if queued.\n */\n public int getQueuePosition();\n \n /**\n * Returns whether or not the uploader is in an inactive state.\n */\n public boolean isInactive();\n}", "@Override\n\tpublic void run() {\n\t\t\n\t\t\n\t\tOpenFileRequest.Builder openFileReqObj = OpenFileRequest.newBuilder();\n\t\topenFileReqObj.setFileName(fileName);\t\t\n\t\topenFileReqObj.setForRead(true);\n\t\t\n\t\t\n\t\tFileWriterClass fileWriteObj = new FileWriterClass(localOutFile);\n\t\tfileWriteObj.createFile();\n\t\t\n\t\tbyte[] responseArray;\n\t\t\n\t\ttry {\n\t\t\tRegistry registry=LocateRegistry.getRegistry(Constants.NAME_NODE_IP,Registry.REGISTRY_PORT);\n\t\t\tINameNode nameStub;\n\t\t\tnameStub=(INameNode) registry.lookup(Constants.NAME_NODE);\n\t\t\tresponseArray = nameStub.openFile(openFileReqObj.build().toByteArray());\n\t\t\t\n\t\t\ttry {\n\t\t\t\tOpenFileResponse responseObj = OpenFileResponse.parseFrom(responseArray);\n\t\t\t\tif(responseObj.getStatus()==Constants.STATUS_NOT_FOUND)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"File not found fatal error\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tList<Integer> blockNums = responseObj.getBlockNumsList();\n\t\t\t\tBlockLocationRequest.Builder blockLocReqObj = BlockLocationRequest.newBuilder();\n\t\t\t\t\n//\t\t\t\tSystem.out.println(blockNums);\n\t\t\t\t/**Now perform Read Block Request from all the blockNums**/\n\t\t\t\tblockLocReqObj.addAllBlockNums(blockNums);\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tresponseArray = nameStub.getBlockLocations(blockLocReqObj.build().toByteArray());\n\t\t\t\t} catch (RemoteException e1) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tBlockLocationResponse blockLocResObj = BlockLocationResponse.parseFrom(responseArray);\n//\t\t\t\tSystem.out.println(blockLocResObj.toString());\n\t\t\t\t\n\t\t\t\tif(blockLocResObj.getStatus()==Constants.STATUS_FAILED)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"Fatal error!\");\n\t\t\t\t\tSystem.exit(0);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tList<BlockLocations> blockLocations = blockLocResObj.getBlockLocationsList();\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tfor(int i=0;i<blockLocations.size();i++)\n\t\t\t\t{\n\t\t\t\t\tBlockLocations thisBlock = blockLocations.get(i);\n\t\t\t\t\t\n\t\t\t\t\tint blockNumber = thisBlock.getBlockNumber();\t\t\t\t\t\n\t\t\t\t\tList<DataNodeLocation> dataNodes = thisBlock.getLocationsList();\n\t\t\t\t\t\n\t\t\t\t\tif(dataNodes==null || dataNodes.size()==0)\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"All nodes are down :( \");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tint dataNodeCounter=0;\n\t\t\t\t\t\n\t\t\t\t\tDataNodeLocation thisDataNode = null;//dataNodes.get(dataNodeCounter);\t\t\t\t\t\n\t\t\t\t\tString ip;// = thisDataNode.getIp();\n\t\t\t\t\tint port ; //= thisDataNode.getPort();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tIDataNode dataStub=null;\n\t\t\t\t\t\n\t\t\t\t\tboolean gotDataNodeFlag=false;\n\t\t\t\t\t\n\t\t\t\t\tdo\n\t\t\t\t\t{\n\t\t\t\t\t\ttry\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tthisDataNode = dataNodes.get(dataNodeCounter);\n\t\t\t\t\t\t\tip = thisDataNode.getIp();\n\t\t\t\t\t\t\tport = thisDataNode.getPort();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tRegistry registry2=LocateRegistry.getRegistry(ip,port);\t\t\t\t\t\n\t\t\t\t\t\t\tdataStub = (IDataNode) registry2.lookup(Constants.DATA_NODE_ID);\n\t\t\t\t\t\t\tgotDataNodeFlag=true;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcatch (RemoteException e) {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tgotDataNodeFlag=false;\n//\t\t\t\t\t\t\tSystem.out.println(\"Remote Exception\");\n\t\t\t\t\t\t\tdataNodeCounter++;\n\t\t\t\t\t\t} \n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\twhile(gotDataNodeFlag==false && dataNodeCounter<dataNodes.size());\n\t\t\t\t\t\n\t\t\t\t\tif(dataNodeCounter == dataNodes.size())\n\t\t\t\t\t{\n\t\t\t\t\t\tSystem.out.println(\"All data nodes are down :( \");\n\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t}\n\t\t\t\t\t\n\n\t\t\t\t\t/**Construct Read block request **/\n\t\t\t\t\tReadBlockRequest.Builder readBlockReqObj = ReadBlockRequest.newBuilder();\n\t\t\t\t\treadBlockReqObj.setBlockNumber(blockNumber);\n\t\t\t\t\t\n\t\t\t\t\t/**Read block request call **/\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tresponseArray = dataStub.readBlock(readBlockReqObj.build().toByteArray());\n\t\t\t\t\t\tReadBlockResponse readBlockResObj = ReadBlockResponse.parseFrom(responseArray);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif(readBlockResObj.getStatus()==Constants.STATUS_FAILED)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tSystem.out.println(\"In method openFileGet(), readError\");\n\t\t\t\t\t\t\tSystem.exit(0);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\tresponseArray = readBlockResObj.getData(0).toByteArray();\t\t\t\t\t\t\n\t\t\t\t\t\tString str = new String(responseArray, StandardCharsets.UTF_8);\t\t\t\t\t\t\n\t\t\t\t\t\tfileWriteObj.writeonly(str);\t\t\t\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t} catch (InvalidProtocolBufferException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t} catch (NotBoundException e) {\n\t\t\tSystem.out.println(\"Exception caught: NotBoundException \");\t\t\t\n\t\t} catch (RemoteException e2) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te2.printStackTrace();\n\t\t}\n\t\tfileWriteObj.closeFile();\n\t\t\n\t\t\n\t}", "void fireMetadataAvailable(TorrentId torrentId, Torrent torrent);", "void firePeerDiscovered(TorrentId torrentId, Peer peer);", "@Override\n public void run() {\n Send enoughPeers = new Send(Send.ENOUGH_NODES, replicationDegree);\n Send ret = enoughPeers.writeAndRead(enoughPeers, p, Peer.PROTOCOL, p.centralizedChordManagerAddress,\n p.centralizedChordManagerPort);\n // CHECK IF THERE ARE ENOUGH NODES\n if (ret.enough) {\n MessageDigest md3 = null;\n try {\n md3 = MessageDigest.getInstance(\"SHA1\");\n } catch (NoSuchAlgorithmException e2) {\n e2.printStackTrace();\n }\n md3.reset();\n md3.update(path.getBytes());\n byte[] hashBytes3 = md3.digest();\n BigInteger hashNum3 = new BigInteger(1, hashBytes3);\n int key3 = Math.abs(hashNum3.intValue()) % Peer.numDHT;\n System.out.println(\"Generated key \" + key3 + \" for file: \" + path);\n FileModel file = new FileModel(path, replicationDegree, p.me);\n file.loadFileContent();\n p.initiatorPeerFiles.add(file);\n if (file.fileData.length != 0) {\n Peer destination = null;\n try {\n destination = ChordManager.find_successor(key3);\n // if dest is myself then i increase the retries by 1 because I'm sending the\n // file to myself first\n if (destination.getSslEnginePort() == p.getSslEnginePort()) {\n file.retries += 1;\n }\n } catch (Exception e1) {\n e1.printStackTrace();\n }\n SendFileThread thread = new SendFileThread(p.initiatorPeerFiles.get(p.initiatorPeerFiles.indexOf(file)),\n p, destination);\n thread.start();\n\n try {\n thread.join();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n if (!file.replicationDegreeAchieved())\n System.out.println(\"File \" + path + \" was backed up with lower repDegree: \"\n + file.perceivedReplicationDegree + \" of: \" + file.perceivedReplicationDegree);\n else {\n System.out.println(\"File \" + path + \" was backed up with repDegree wanted\");\n }\n } else {\n System.err.println(\"File \" + path + \" was not backed up\");\n }\n } else {\n System.err.println(\"File \" + path + \" was not backed up replication degree of : \" + replicationDegree\n + \" could not be achived due to less number of peers available\");\n }\n }", "List<Transfer> requestDownloads(Leecher leecher);", "@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t\tUri uri = dataContract.SOURCE_CONTENT_URI;\n\t\t\t\tif (catergory.equals(\"thumbnail\"))\n\t\t\t\t{\n\t\t\t\t\turi = dataContract.THUMBNAIL_CONTENT_URI;\n\t\t\t\t}\n\t\t\t\tUri dataUri = uri.buildUpon()\n\t\t\t\t\t\t\t.appendPath(giftId).build();\n\t\t\t\t\n\t\t\t\tbyte data[] = null;\n\t\t\t\tint dataRead = 0;\n\t\t\t\tint tdatalen = 0;\n\t\t\t\tint buffer_size = 2048;\n\t\t\t\ttry {\n\t\t\t\t\tInputStream in = resolver.openInputStream(dataUri);\n\t\t\t\t\tdata = new byte[buffer_size];\n\t\t\t\t\tdo {\n\t\t\t\t\t\tdataRead = in.read(data, tdatalen, buffer_size);\n\t\t\t\t\t\tif (dataRead != -1) {\n\t\t\t\t\t\t\tbyte tmp[] = new byte[data.length + buffer_size];\n\t\t\t\t\t\t\tSystem.arraycopy(data, 0, tmp, 0, data.length);\n\t\t\t\t\t\t\ttdatalen += dataRead;\n\t\t\t\t\t\t\tdata = tmp;\n\t\t\t\t\t\t}\n\t\t\t\t\t} while (dataRead != -1);\n\t\t\t\t\tin.close();\n\t\t\t\t} \n\t\t\t\t\n\t\t\t\tcatch (FileNotFoundException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tcatch (IOException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tMessage msg = Message.obtain(handler, PotlatchMsg.GET_DATA.getVal());\n\t\t\t\tBundle b = new Bundle();\n\t\t\t\tb.putByteArray(PotlatchConst.get_data, data);\n\t\t\t\tmsg.setData(b);\n\t\t\t\thandler.sendMessage(msg);\n\t\n\t\t\t}", "public String sendDataToChildren(byte[] data) throws RemoteException;", "private void uploadFromDataStorage() {\n }", "public void OnFileDataReceived(byte[] data,int read, int length, int downloaded);", "@Override\n\t\t\t\t\t\t\tpublic void onOnlineDiveDataProgress(Object result) {\n\n\t\t\t\t\t\t\t}", "public interface TorrentDownloader {\n void start() throws Exception;\n}", "@Override\r\n\tpublic void download() {\n\t\t\r\n\t}", "@Override\n\tpublic void run() {\n\t\tString request;\n\t\ttry {\n\t\t\tSocketBuilder socketBuilder = new SocketBuilder(this.IP);\n\n\t\t\tSocket clientSocketStrings = socketBuilder.createStringSocket();\n\t\t\tSocket clientSocketBytes = socketBuilder.createByteSocket();\n\n\t\t\tDataOutputStream outToServer = new DataOutputStream(clientSocketStrings.getOutputStream());\n\n\t\t\tDataInputStream bytesStream = new DataInputStream(clientSocketBytes.getInputStream());\n\n\t\t\tBufferedReader inFromServer = new BufferedReader(\n\t\t\t\t\tnew InputStreamReader(clientSocketStrings.getInputStream(), StandardCharsets.UTF_8));\n\t\t\t\n\t\t\tMessage requestMessage = new Message();\n\t\t\trequestMessage.createDownloadMessage(path);\n\n\t\t\trequest = JsonParser.messageToJson(requestMessage);\n\n\t\t\toutToServer.write(request.getBytes(\"UTF-8\"));\n\t\t\toutToServer.writeByte('\\n');\n\n\t\t\tMessage responseMessage = JsonParser.jsonToMessage(inFromServer.readLine());\n\n\t\t\t// check if operation is possible\n\t\t\tif (responseMessage.isERRORMessage()) {\n\t\t\t\t/*\n\t\t\t\t * Handle Error Here\n\t\t\t\t */\n\t\t\t} else {\n\n\t\t\t\tFileTransfer fileTransfer = new FileTransfer();\n\n\t\t\t\tlong size = Long.parseLong(inFromServer.readLine());\n\n\t\t\t\tEstimationViewManagementThread manage = new EstimationViewManagementThread(size, \n\t\t\t\t\t\tfileTransfer, clientSocketStrings, clientSocketBytes);\n\t\t\t\tmanage.start();\n\t\t\t\tfileTransfer.receiveFiles(bytesStream, inFromServer, locationToSave);\n\t\t\t}\n\t\t\t\n\t\t\toutToServer.close();\n\t\t\tbytesStream.close();\n\t\t\tinFromServer.close();\n\t\t\tclientSocketBytes.close();\n\t\t\tclientSocketStrings.close();\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "void onRequest(int index, int begin, int length)\n {\n if (DEBUG) System.out.println(\"[stdpc] onRequest:\" + index + \",\" + begin + \",\" + length);\n\n// sendQueue.forEach(pm -> System.out.println(\"[stdpc] onRequest -b>\" + System.identityHashCode(pm) +\n// \" \" +pm.type + \" ,\" + pm.index +\",\" + pm.begin + \",\" + pm.length) );\n\n // validate common block parameters\n boolean correct = torrent.validateBlock(index, begin, length);\n if (!correct) {\n // just ignore such requests\n statistics.blocksRequestedIncorrect++;\n return;\n }\n\n // this could be moved to send(), but doesn't really matter\n statistics.blocksSent++;\n\n // track active requests\n StdPeerMessage pm = pmCache.request(index, begin, length);\n peerBlockRequests.add(pm);\n\n // notify torrent to read and enqueue block\n torrent.onRequest(this, index, begin, length);\n\n// sendQueue.forEach(x -> System.out.println(\"[stdpc] onRequest -a<\" + System.identityHashCode(x) +\n// \" \" +x.type + \" ,\" + x.index +\",\" + x.begin + \",\" + x.length) );\n\n }", "@Override\n public void prepare() {\n //Caching as file resource.\n File file = this.getResource().file;\n logger.info(\"Preparing {} streams for file: {}\", this.getTransferType(), file.getName());\n\n if (this.getTransferType() == ResourceTransferType.OUTBOUND) {\n //Sending\n try {\n buffer = new byte[BUFFER_SIZE];\n sent = 0;\n inputChannel = new FileInputStream(file).getChannel();\n inputBuffer = inputChannel.map(FileChannel.MapMode.READ_ONLY, 0, inputChannel.size());\n } catch (FileNotFoundException e) { //File doesn't exist.\n //Calling a transfer error.\n callError(e);\n } catch (IOException e) {\n e.printStackTrace();\n }\n } else {\n //Receiving\n //Checking if file already exists.\n written = 0;\n saved = 0;\n if (getResource().isLocal()) {\n getResource().calcNetworkId();\n if (getResource().getNetworkID().equals(getTunnel().getDestination())) {\n //The file is already stored locally.\n getTunnel().sendMessage(new ResourceTransferControlMessage(this.getTransferId(), -2));\n this.close();\n return;\n }\n }\n\n //Creating or replacing the file.\n buffer = new byte[BUFFER_SIZE * 16];\n if (file.exists()) {\n file.delete();\n }\n try { //Creating new file.\n file.createNewFile();\n outputStream = new FileOutputStream(file);\n } catch (IOException e) {\n //Calling a transfer error.\n callError(e);\n return;\n }\n\n //Requesting the first chunk.\n getTunnel().sendMessage(new ResourceTransferControlMessage(this.getTransferId(), 0));\n }\n }", "public interface TransferAgent\n extends Closeable\n{\n //-------------------------------------------------------------------------\n void throttle(long maxBytesPerSecond);\n void unThrottle();\n\n\n //-------------------------------------------------------------------------\n ShellFile file (String remoteFilePath);\n List<ShellFile> files(String inRemoteFilePath);\n\n\n //-------------------------------------------------------------------------\n // @returns true if the file already exists, or if it was created\n boolean makeDir (String remoteDirectoryPath);\n boolean makeDirs(String remoteDirectoryPath);\n\n\n //-------------------------------------------------------------------------\n boolean upload(\n String localFileName, String remoteFileName);\n\n boolean upload(\n File localFile, String remoteFile);\n\n /**\n * Does not automatically close the given source stream.\n * \n * Works only on the immediate host to which this agent logged into.\n * If you would like to transfer data that are one or more network\n * hops away (i.e. recursive ssh calls), then you will need to\n * upload to the immediate host, then scp to the destination host,\n * and then delete the immediate copy (to clean up).\n *\n * @param source data to be uploaded\n * @param remoteFileName destination file path/name\n * @return true if the entire uploaded was successful\n */\n boolean upload(\n InputStream source, String remoteFileName);\n \n \n //-------------------------------------------------------------------------\n boolean download(\n String remoteFileName, String localFileName);\n\n boolean download(\n String remoteFileName, File localFile);\n\n /**\n * Does not automatically close the given source stream.\n *\n * For downloading data from multiple network hops away,\n * use a similar method as described for uploading.\n * @see #upload(InputStream, String)\n * \n * @param remoteFileName file path/name to download\n * @param destination sink for remote file data\n * @return true if the entire download was successful\n */\n boolean download(\n String remoteFileName, OutputStream destination);\n\n\n //-------------------------------------------------------------------------\n boolean open();\n void openChecked() throws IOException;\n\n @Override\n void close();\n}", "@Override\n protected Void call() {\n if(download_queue.isEmpty()) return null;\n \n //Proceed to create a file with a list of addresses\n Writer writer = null;\n String file_dir = Configuration.root_dir + \"Download_list.txt\";\n try{\n writer = new BufferedWriter(\n new OutputStreamWriter(\n new FileOutputStream(\n file_dir), \"utf-8\"));\n String server_root = Configuration.getInstance().getSina_server_root();\n //Traverse through the download list and write each download address to file\n String content = \"\";\n for(int i = 0; i < download_queue.size(); i++){\n SoundTrack track = download_queue.get(i);\n String address = server_root + track.getLocalFileName();\n content += address;\n if(i < (download_queue.size() - 1)){\n content += \"\\n\";\n }\n }\n //Write to file\n writer.write(content);\n \n } catch (UnsupportedEncodingException ex) {\n Logger.getLogger(IOHandler.class.getName()).log(Level.SEVERE, null, ex);\n } catch (FileNotFoundException ex) {\n Logger.getLogger(IOHandler.class.getName()).log(Level.SEVERE, null, ex);\n } catch (IOException ex) {\n Logger.getLogger(IOHandler.class.getName()).log(Level.SEVERE, null, ex);\n } finally{\n try {\n if(writer != null)\n writer.close();\n } catch (IOException ex) {\n Logger.getLogger(IOHandler.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n \n //Run wget command to download the listed files\n String command = \"wget\";\n command += \" -P \" + Configuration.root_dir + \"SoundTracks/\";\n command += \" -i list\";\n try {\n Process p = Runtime.getRuntime().exec(command);\n p.waitFor();\n } catch (IOException ex) {\n Logger.getLogger(IOHandler.class.getName()).log(Level.SEVERE, null, ex);\n } catch (InterruptedException ex) {\n Logger.getLogger(IOHandler.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n return null;\n }", "entities.Torrent.DownloadResponse getDownloadResponse();", "@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\thandlHttpRequest(url, trackerinfo.get_info_hash(), Settings.PEER_DEFAULT_ID);\n\t\t\t\t\t}", "public interface BlockDownloader {\n\n /**\n * send the request and check that we received the correct block.\n */\n Mono<PieceEvent> downloadBlock(Link link, RequestMessage requestMessage);\n}", "@Override\n public void eventoCargarData() {\n }", "private void getBinaryFileFromPeer(Host h, String nombre, ObjectOutputStream out) {\n\n log.info(\"Starting thread to download binary from peer in \" + h.getIp() + \":\" + h.getPort() );\n ClientDownloadThread c = new ClientDownloadThread(h,nombre,this.sharedFolder);\n c.start();\n try {\n c.join();\n\n Consulta c2 = new Consulta();\n c2.setFileName(c.getFileName());\n c2.setMethod(ADD_FILE);\n\n log.info(\"Updating server w new file downloaded\");\n\n out.writeObject(c2);\n\n log.info(\"Update sucessfuly\");\n\n } catch (InterruptedException | IOException e) {\n log.info(\"Error while joining download thread\",e);\n }\n\n\n }", "@Override\n\t\t\t\tpublic void fileTransferRecv(LinphoneCore lc, LinphoneChatMessage message,\n\t\t\t\t\t\tLinphoneContent content, byte[] buffer, int size) {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\r\n\tpublic void runSystem() throws IOException {\n\t\tclientWithHalf.setHalfFile(fileHalf);\r\n\t\tserverWithTotal.setTotalFile(fileTotal);\r\n\t\tclientWithHalf.connect(serverWithTotal);\r\n\t\tserverWithTotal.connect(clientWithHalf);\r\n\t\tclientWithHalf.sendCheckSumFile();\r\n\t\tserverWithTotal.receieveCheckSumFile();\r\n\t\tserverWithTotal.startMatch();\r\n\t\tserverWithTotal.sendBackData();\r\n\t\tclientWithHalf.rebuidFile();\r\n\t\tclientWithHalf.checkFileEqual();\r\n\t\tclientWithHalf.clearTempData();\r\n\t\tserverWithTotal.getConfirm();\r\n\t\tserverWithTotal.clearTempData();\r\n\t}", "public void store() {\r\n\t\tdata = busExt.get();\r\n\t}", "@Override\r\n\tpublic void run() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t//Get a list of pairs. The pair will be a chunkname with a chunkserver \r\n\t\t/*for(Pair<String, String> p: EventFactory.hostToFiles.getChunkLocations(message.getContent())){\r\n\t\t\tSystem.out.println(\"The location is: \" + p.getKey() + \" and the chunkname is: \" + p.getValue());\r\n\t\t\t\r\n\t\t\t//actual code will contact chunk servers and tell them to read and forward the file to the client\r\n\t\t\tMessage forwardToClient = new Message(\"ForwardChunkToClient\");\r\n\t\t\t//chunkname, servername, port\r\n\t\t\tforwardToClient.setContent(p.getKey());\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tTCPSender sender = new TCPSender(new Socket(p.getValue().split(\" \")[0], Integer.parseInt(p.getValue().split(\" \")[1])));\r\n\t\t\t\tsender.sendData(forwardToClient);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t} catch (NumberFormatException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (UnknownHostException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}*/\r\n\t\t//Send the list to the client so it can request the chunks from chunkServers\r\n\t\t//Any other way seems like it would be beyond a pain. \r\n\t\tLinkedList<String> fileAndHosts = new LinkedList<String>();\r\n\t\tfor(PairStrings p: EventFactory.hostToFiles.getChunkLocations(message.getContent())) {\r\n\t\t\tString fileAndHost = p.getValue() + \" \" + p.getKey();\r\n\t\t\tfileAndHosts.add(fileAndHost);\r\n\t\t}\r\n\t\t\r\n\t\tMessage getFromChunkServers = new Message(\"RequestChunksFromServers\");\r\n\t\t\r\n\t\t//If the list is empy, the no file was found, report invalid.\r\n\t\tif(fileAndHosts.size() == 0) {\r\n\t\t\tgetFromChunkServers.setList(fileAndHosts);\r\n\t\t\tgetFromChunkServers.setContent(\"invalid\" + \" \" + message.getContent());\r\n\t\t} else {\r\n\t\t\tgetFromChunkServers.setList(fileAndHosts);\r\n\t\t\tgetFromChunkServers.setContent(\"valid\" + \" \" + message.getContent());\r\n\t\t}\r\n\t\t\r\n\t\ttry {\r\n\t\t\tTCPSender sender = new TCPSender(new Socket(message.getSenderHostName(), message.getSenderPort()));\r\n\t\t\tsender.sendData(getFromChunkServers);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "@Override\r\n\tpublic void run() {\r\n\t\ttry {\r\n\t\t\tthis.inputStream = socket.getInputStream();\r\n\t\t\tthis.outputStream = socket.getOutputStream();\r\n\t\t\t// Get the peer that is asking me for fragments.\r\n\t\t\tpeerState = torrentClient.getPeerStateList().getByAddress(\r\n\t\t\t\t\tsocket.getInetAddress().getHostAddress(), socket.getPort());\r\n\t\t\t// read handhake\r\n\t\t\tbyte[] received = new byte[68];\r\n\t\t\tinputStream.read(received);\r\n\t\t\t//Parse the handshake received\r\n\t\t\tHandsake handshakeMessage = Handsake\r\n\t\t\t\t\t.parseStringToHandsake(new String(received));\r\n\t\t\t// validate hash\r\n\t\t\tString torrentHash = new String(torrentClient.getMetainf()\r\n\t\t\t\t\t.getInfo().getInfoHash());\r\n\t\t\t//if the received handshake is correct send my handshake\r\n\t\t\tif (Handsake.isValidHandsakeForBitTorrentProtocol(handshakeMessage,\r\n\t\t\t\t\ttorrentHash)) {\r\n\t\t\t\t// send handshake\r\n\t\t\t\tHandsake handShakeToSend = new Handsake(torrentHash,\r\n\t\t\t\t\t\tthis.torrentClient.getPeerId());\r\n\t\t\t\tthis.outputStream.write(handShakeToSend.getBytes());\r\n\t\t\t\t// enviar bitfield\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.sendBitfield();\r\n\t\t\t\t\t// leer\r\n\t\t\t\t\tPeerProtocolMessage message = this.readNormalMessage();\r\n\t\t\t\t\t// Check if I have received an interested message\r\n\t\t\t\t\tif (message.getType().equals(\r\n\t\t\t\t\t\t\tPeerProtocolMessage.Type.INTERESTED)) {\r\n\t\t\t\t\t\tif (this.peerState != null) {\r\n\t\t\t\t\t\t\tpeerState = torrentClient.getPeerStateList()\r\n\t\t\t\t\t\t\t\t\t.getByAddress(\r\n\t\t\t\t\t\t\t\t\t\t\tsocket.getInetAddress()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.getHostAddress(),\r\n\t\t\t\t\t\t\t\t\t\t\tsocket.getPort());\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//Set the peer status\r\n\t\t\t\t\t\tif (this.peerState != null) {\r\n\t\t\t\t\t\t\tthis.peerState.setPeer_interested(true);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// send unchoke to the peer\r\n\t\t\t\t\t\tthis.outputStream.write(new UnChokeMsg().getBytes());\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//set the peer status\r\n\t\t\t\t\t\tif (this.peerState != null) {\r\n\t\t\t\t\t\t\tthis.peerState.setAm_choking(false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//Continue receiveing messages if the message type is Keep_alive, Request or Have.\r\n\t\t\t\t\t\tboolean continueReading = true;\r\n\t\t\t\t\t\twhile (continueReading) {\r\n\t\t\t\t\t\t\tmessage = this.readNormalMessage();\r\n\t\t\t\t\t\t\tcontinueReading = processMessage(message);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// if I have not received interested send unchoke\r\n\t\t\t\t\t\tthis.outputStream.write(new ChokeMsg().getBytes());\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} catch (IOException ioe) {\r\n\t\t\t\t\tioe.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// close connection\r\n\t\t\tthis.inputStream.close();\r\n\t\t\tthis.outputStream.close();\r\n\t\t\tsocket.close();\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\tSystem.out.println(\"Sending thread closed\");\r\n\t\t\te.printStackTrace();\r\n\t\t\ttry {\r\n\t\t\t\tthis.inputStream.close();\r\n\t\t\t\tthis.outputStream.close();\r\n\t\t\t\tsocket.close();\r\n\t\t\t} catch (IOException e1) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te1.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\n\tpublic void loadPlayerData(InputStream arg0)\n\t{\n\n\t}", "@Override\n\tpublic void loadPlayerData(InputStream arg0) {\n\n\t}", "public void torrentScrape() {\n\t\tAlfred.getTorrentScraper().scrape();\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void initSelfData() {\n\t\t\r\n\t}", "@Override\n public void onOnlineDiveDataProgress(\n Object result) {\n\n }", "@Override\n public void run() {\n\n queryForRoutingManager();\n File f = IMbuffer.fetchFromIMInputBuffer();\n if (f.getName().startsWith(\"Responseto\")) {\n transfertopurge(f);\n }\n }", "entities.Torrent.UploadResponse getUploadResponse();", "private void recieveData() throws IOException, InterruptedException {\n String senderIP= JOptionPane.showInputDialog(WED_ZERO.lang.getInstruct().get(1)[17]);\n if(senderIP==null) {\n ERROR.ERROR_359(Launch.frame);\n return;\n }\n JOptionPane.showMessageDialog(Launch.frame, WED_ZERO.lang.getInstruct().get(1)[18]);\n Networking net=new Networking(true);\n net.setIPAddress(senderIP);\n String to=net.initClient();\n int res = JOptionPane.showConfirmDialog(null, WED_ZERO.lang.getInstruct().get(1)[19]+\" \"\n +to+\".\", WED_ZERO.lang.getInstruct().get(1)[12],\n JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); \n if(res==JOptionPane.NO_OPTION||res==JOptionPane.CANCEL_OPTION) {\n return;\n }\n Map<Integer, ArrayList<String>> data=new HashMap<Integer, ArrayList<String>>();\n ArrayList<String> folderName=new ArrayList();\n net.transferData_RECIEVE(folderName, data);\n this.processNewData(data, folderName);\n \n }", "entities.Torrent.DownloadRequest getDownloadRequest();", "protected abstract void retrievedata();", "public void downloadData(final String tripId, final String username) {\n HashMap<String, String> map = new HashMap<>();\n map.put(db.KEY_IS_BEGIN_DAY, \"false\");\n map.put(db.KEY_IS_LOAD_VERIFIED, \"false\");\n map.put(db.KEY_IS_END_DAY, \"false\");\n db.addData(db.LOCK_FLAGS, map);\n Chain chain = new Chain(new Chain.Link() {\n @Override\n public void run() {\n go();\n }\n });\n chain.setFail(new Chain.Link() {\n @Override\n public void run() throws Exception {\n fail();\n }\n });\n chain.add(new Chain.Link() {\n @Override\n public void run() {\n TripHeader.load(SettingsActivity.this, tripId, db);\n LoadDelivery.load(SettingsActivity.this, tripId, db);\n ArticleHeaders.load(SettingsActivity.this, tripId, db);\n CustomerHeaders.load(SettingsActivity.this, tripId, db);\n VisitList.load(SettingsActivity.this, tripId, db);\n Messages.load(SettingsActivity.this, username, db);\n CustomerDelivery.load(SettingsActivity.this, tripId, db);\n /*ArticleHeaders.loadData(getApplicationContext());\n CustomerHeaders.loadData(getApplicationContext());*/\n }\n });\n chain.add(new Chain.Link() {\n @Override\n public void run() {\n /*TripHeader.load(LoginActivity.this,tripId, db);\n LoadDelivery.load(LoginActivity.this,tripId, db);\n ArticleHeaders.load(LoginActivity.this, tripId, db);\n CustomerHeaders.load(LoginActivity.this, tripId, db);\n VisitList.load(LoginActivity.this,tripId, db);\n Messages.load(LoginActivity.this,username,db);*/\n ArticleHeaders.loadData(getApplicationContext());\n CustomerHeaders.loadData(getApplicationContext());\n OrderReasons.loadData(getApplicationContext());\n }\n });\n chain.start();\n }", "@Override\n public void downloadBlockChain() {\n startBlockChainDownload(fastcoinWalletDownloadListener);\n }", "public JSONPeers(String base) {\n\t\tthis.l = new Semaphore(1);\n\t\tthis.path = Paths.get(base, Peer.jsonPeerPath).toString();\n\t}", "public interface ExternalBlobIO {\n /**\n * Write data to blob store\n * @param in: InputStream containing data to be written\n * @param actualSize: size of data in stream, or -1 if size is unknown. To be used by implementor for optimization where possible\n * @param mbox: Mailbox which contains the blob. Can optionally be used by store for partitioning\n * @return locator string for the stored blob, unique identifier created by storage protocol\n * @throws IOException\n * @throws ServiceException\n */\n String writeStreamToStore(InputStream in, long actualSize, Mailbox mbox) throws IOException, ServiceException;\n\n /**\n * Create an input stream for reading data from blob store\n * @param locator: identifier string for the blob as returned from write operation\n * @param mbox: Mailbox which contains the blob. Can optionally be used by store for partitioning\n * @return InputStream containing the data\n * @throws IOException\n */\n InputStream readStreamFromStore(String locator, Mailbox mbox) throws IOException;\n\n /**\n * Delete a blob from the store\n * @param locator: identifier string for the blob\n * @param mbox: Mailbox which contains the blob. Can optionally be used by store for partitioning\n * @return true on success false on failure\n * @throws IOException\n */\n boolean deleteFromStore(String locator, Mailbox mbox) throws IOException;\n}", "private void uploadingPacketDealer(Packet packet) {\n short filenumber = packet.getFileNumber();\n boolean downloading = false;\n \n if (packet.hasSynchronizeFlag()) { \n receiver = new ReliableReceiver(sendQueue, filenumber, downloading, FOLDERPATHSERVER);\n this.receivingMap.put(filenumber, receiver);\n receiver.start();\n receiver.addToReadingQueue(packet.getContent(), packet.getSeqNumber(), packet.hasFinalFlag());\n } else if (packet.hasAcknowledgementFlag()) {\n sender = sendingMap.get(filenumber);\n sender.changeLastAcknowledgeReceived(packet.getAckNumber());\n sendQueue.stopTimeout(packet.getAckNumber()-1);\n } else {\n receiver = receivingMap.get(filenumber);\n receiver.addToReadingQueue(packet.getContent(), packet.getSeqNumber(), packet.hasFinalFlag());\n }\n \n }", "public interface PeerRMI extends Remote {\n\n\t/**\n\t * Allows the backup of a document amongst the peers of the network\n\t * @param request\n\t * \t\t\t\tString containing the details about the request\n\t * @return\n\t * \t\t\t\tString containing the status of the execution\n\t * @throws RemoteException\n\t */\n\tString backup(String request) throws RemoteException;\n\n\t/**\n\t * Allows the enhanced backup of a document amongst the peers of the network\n\t * @param request\n\t * \t\t\t\tString containing the details about the request\n\t * @return\n\t * \t\t\t\tString containing the status of the execution\n\t * @throws RemoteException\n\t */\n\tString backupENH(String request) throws RemoteException;\n\t\n\t/**\n\t * Allows the deletion of a document saved in the peers of the network\n\t * @param request\n\t * \t\t\t\tString containing the details about the request\n\t * @return\n\t * \t\t\t\tString containing the status of the execution\n\t * @throws RemoteException\n\t */\n\tString delete(String request) throws RemoteException;\n\n\t/**\n\t * Allows the enhanced deletion of a document saved in the peers of the network\n\t * @param request\n\t * \t\t\t\tString containing the details about the request\n\t * @return\n\t * \t\t\t\tString containing the status of the execution\n\t * @throws RemoteException\n\t */\n\tString deleteENH(String request) throws RemoteException;\n\n\t/**\n\t * Allows the restoration of a document saved in the other peers of the network, the restored file will be saved in the peer-iniatior\n\t * @param request\n\t * \t\t\t\tString containing the details about the request\n\t * @return\n\t * \t\t\t\tString containing the status of the execution\n\t * @throws RemoteException\n\t */\n\tString restore(String request) throws RemoteException;\n\n\t/**\n\t * Allows the restoration of a document saved in the other peers of the network, the restored file will be saved in the peer-iniatior\n\t * @param request\n\t * \t\t\t\tString containing the details about the request\n\t * @return\n\t * \t\t\t\tString containing the status of the execution\n\t * @throws RemoteException\n\t */\n\tString restoreENH(String request) throws RemoteException;\n\n\t/**\n\t * Allows the enhanced reclaim of space of the initiator-peer\n\t * @param request\n\t * \t\t\t\tString containing the details about the request\n\t * @return\n\t * \t\t\t\tString containing the status of the execution\n\t * @throws RemoteException\n\t */\n\tString reclaim(String request) throws RemoteException;\n\n\t/**\n\t * Allows the user to get the state of the initiator-peer\n\t * @param request\n\t * \t\t\t\tString containing the details about the request\n\t * @return\n\t * \t\t\t\tString containing the status of the execution\n\t * @throws RemoteException\n\t */\n\tString state() throws RemoteException;\n}", "@Override\n\t\t protected Void doInBackground(Void... params) {\n\t\t \tUnidataSuperActivity.setDone(false);\n\t\t \t\n\t\t \t/* Gets the URL address of the data wanted\n\t\t \t * URL comes from the Super, which is set by the MainActivity\n\t\t \t */\n\t\t URL textUrl;\n\t\t String address = UnidataSuperActivity.getURL();\n\t\t \n\t\t /* Converts the URL into a temporary XML file, which then is converted into a String\n\t\t * Uses the Commons IO library for FileUtils\n\t\t */\n\t\t try {\n\t\t textUrl = new URL(address);\n\t\t System.out.println(textUrl);\n\t\t File testFile2 = File.createTempFile(\"temp2\", \".dat\");\n\t\t testFile2.deleteOnExit();\n\t\t FileUtils.copyURLToFile(textUrl, testFile2);\n\t\t textResult = FileUtils.readFileToString(testFile2);\n\t\t \n\t\t } catch (MalformedURLException e) {\n\t\t e.printStackTrace();\n\t\t textResult = e.toString(); \n\t\t } catch (IOException e) {\n\t\t e.printStackTrace();\n\t\t textResult = e.toString(); \n\t\t }\n\t\t \n\t\t /* sets the XML String in the super class so it can be parsed in the main thread\n\t\t * and then lets the main thread know it has finished\n\t\t */\n\t\t UnidataSuperActivity.setXML(textResult);\n\t\t UnidataSuperActivity.setDone(true);\n\n\t\t return null;\n\t\t \n\t\t }", "public void recv_from_crawler() throws ClassNotFoundException\r\n {\n\r\n\r\n\t\tbyte[] yourBytes_url= new byte[10000];\r\n\r\n\r\n\r\n\t\t//10000 is assumed to be max url size\r\n\t\tStatus status = null;\r\n\t\ttry{\r\n\t\tstatus=MPI.COMM_WORLD.Recv(yourBytes_url,0,10000,MPI.BYTE,0,MPI.ANY_TAG);\r\n\t\t}\r\n\t\tcatch(MPIException e)\r\n\t\t{\r\n\t\t\t\r\n\t\t}\r\n\t // System.out.println(\"now indexer start........\");\r\n\r\n\t\tif(status.tag==1)\r\n\t\t{\r\n\t\t\tis_Recrawling=true;\r\n\t\t\tif(first)\r\n\t\t\t{\r\n\t\t\t\tfirst=false;\r\n\t\t\t\tSystem.out.println(\"reindexing------------\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\r\n\r\n\t\t//Create object from bytes\r\n\t\tByteArrayInputStream bis = new ByteArrayInputStream(yourBytes_url);\r\n\t\tObjectInput in = null;\r\n\t\ttry {\r\n\t\t in = new ObjectInputStream(bis);\r\n\t\t url = (URL) in.readObject();\r\n\t\t// System.out.println(\"url_from_crawler 1 ----> \"+url.toString());\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t} finally {\r\n\t\t try {\r\n\t\t if (in != null) {\r\n\r\n\t\t in.close();\r\n\t\t }\r\n\t\t } catch (IOException ex) {\r\n\t\t // ignore close exception\r\n\t\t }\r\n\t\t}\r\n\r\n\r\n\r\n\t\t//get_document_from_db();\r\n\r\n }", "@Override\n\tpublic void processData() {\n\t\t\n\t}", "@Override\n\t\t\t\tprotected EbooksPageFile doInBackground(String... params) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tThread.sleep(1000);\n\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\treturn Serialization.deserializeEbooksAndStore(getContext(),params[0]);\n\t\t\t\t}", "public interface DownloadData {\n public void download();\n public String getFileLocation();\n}", "private void initData() {\n\n MyLog.log(\"调用录音上传接口\");\n MosHelper.startCheck(new MosHelper.mosSourceListener() {\n\n @Override\n public void getMosSource(String testTest, ArrayList<String> source) {\n // TODO Auto-generated method stub\n\n }\n\n @Override\n public void getMosIMEIAndId(String IMEI,\n String sourceId) {\n // TODO Auto-generated method stub\n MyLog.log(\"IMEI::\" + IMEI);\n Message message = handler.obtainMessage();\n message.obj = \"IMEI::\" + IMEI + \"\\n\" + \"sourceID:\\n\" + sourceId;\n message.what = 8;\n handler.sendMessage(message);\n\n }\n });\n }", "static void startClient(String tracker_file, int port) throws UnknownHostException {\n\t\tTrackerInfo ctracker = new TrackerInfo(tracker_file);\n\t\tTransferManager.initial(getPiecesFromTrackerInfo(ctracker), ctracker);\n\t\tPeer peer = new Peer(InetAddress.getByName(\"127.0.0.1\"), port, ctracker);\n\t\tpeer.initialTCP();\n\t\tpeer.handShake();\n\t\twhile(!TransferManager.fileDonwloaded()) {\n\t\t\tif(peer.out_buf.size() > 0) {\n\t\t\t\tif(!peer.send()) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!peer.recieve()) {\n\t\t\t\tif(peer.out_buf.size() == 0) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\tpeer.recieveHandle();\n\t\t\t}\n\t\t}\n\t\tif(TransferManager.fileDonwloaded()) {\n\t\t\tTransferManager.writeToFile();\n\t\t\tSystem.out.println(\"Success Recieve The File: \" + ctracker.file_name);\n\t\t}else {\n\t\t\tSystem.out.println(\"Unable To Recieve The File: \" + ctracker.file_name);\n\t\t}\n\t\tpeer.closeTCP();\n\t}", "@Override\n public void dataAvailable(byte[] data, Connection ignoreMe) {\n // Now get the data, and send it back to the listener.\n try {\n disconnect(ignoreMe);\n Message message = NonblockingResolver.parseMessage(data);\n\n if (message != null && LOG.isTraceEnabled()) {\n LOG.trace(\"dataAvailable(\" + data.length + \" bytes)\");\n LOG.trace(message);\n }\n\n NonblockingResolver.verifyTSIG(query, message, data, tsig);\n // Now check that we got the whole message, if we're asked to do so\n if (!tcp && !ignoreTruncation\n && message.getHeader().getFlag(Flags.TC)) {\n // Redo the query, but use tcp this time.\n tcp = true;\n // Now start again with a TCP connection\n startConnect();\n return;\n }\n if (query.getHeader().getID() != message.getHeader().getID()) {\n// System.out.println(\"Query wrong id! Expected \" + query.getHeader().getID() + \" but got \" + message.getHeader().getID());\n return;\n }\n returnResponse(message);\n } catch (IOException e) {\n returnException(e, null);\n }\n }", "protected abstract void transfer(UUID[] players, String server, IntConsumer response);", "@Ignore\n @Test\n public void startReiver() throws IOException, InterruptedException {\n\n final int maxPeers = 10;\n PeerDHT[] peers = createPeers(PORT, maxPeers, \"receiver\");\n for (int i = 1; i < maxPeers; i++) {\n \tPeerDHT peer = peers[i];\n peer.peer().bootstrap().peerAddress(peers[0].peer().peerAddress()).start().awaitUninterruptibly();\n peer.peer().objectDataReply(new ObjectDataReply() {\n @Override\n public Object reply(final PeerAddress sender, final Object request) throws Exception {\n System.out.println(\"got it!\");\n return \"recipient got it\";\n }\n });\n }\n Thread.sleep(Long.MAX_VALUE);\n }", "private void transfer(Transfer associatedUpload) throws IOException {\n \t\ttry {\n \t\t\t_started = System.currentTimeMillis();\n \t\t\tif (_mode == 'A') {\n \t\t\t\t_out = new AddAsciiOutputStream(_out);\n \t\t\t}\n \n \t\t\tbyte[] buff = new byte[Math.max(_slave.getBufferSize(), 65535)];\n \t\t\tint count;\n \t\t\tlong currentTime = System.currentTimeMillis();\n \n \t\t\ttry {\n \t\t\t\twhile (true) {\n \t\t\t\t\tif (_abortReason != null) {\n \t\t\t\t\t\tthrow new TransferFailedException(\n \t\t\t\t\t\t\t\t\"Transfer was aborted - \" + _abortReason,\n \t\t\t\t\t\t\t\tgetTransferStatus());\n \t\t\t\t\t}\n \t\t\t\t\tcount = _in.read(buff);\n \t\t\t\t\tif (count == -1) {\n \t\t\t\t\t\tif (associatedUpload == null) {\n \t\t\t\t\t\t\tbreak; // done transferring\n \t\t\t\t\t\t}\n \t\t\t\t\t\tif (associatedUpload.getTransferStatus().isFinished()) {\n \t\t\t\t\t\t\tbreak; // done transferring\n \t\t\t\t\t\t}\n \t\t\t\t\t\ttry {\n \t\t\t\t\t\t\tThread.sleep(500);\n \t\t\t\t\t\t} catch (InterruptedException e) {\n \t\t\t\t\t\t}\n \t\t\t\t\t\tcontinue; // waiting for upload to catch up\n \t\t\t\t\t}\n \t\t\t\t\t// count != -1\n \t\t\t\t\tif ((System.currentTimeMillis() - currentTime) >= 1000) {\n \t\t\t\t\t\tTransferStatus ts = getTransferStatus();\n \t\t\t\t\t\tif (ts.isFinished()) {\n \t\t\t\t\t\t\tthrow new TransferFailedException(\n \t\t\t\t\t\t\t\t\t\"Transfer was aborted - \" + _abortReason,\n \t\t\t\t\t\t\t\t\tts);\n \t\t\t\t\t\t}\n \t\t\t\t\t\t_slave\n \t\t\t\t\t\t\t\t.sendResponse(new AsyncResponseTransferStatus(\n \t\t\t\t\t\t\t\t\t\tts));\n \t\t\t\t\t\tcurrentTime = System.currentTimeMillis();\n \t\t\t\t\t}\n \t\t\t\t\t_transfered += count;\n \t\t\t\t\t_out.write(buff, 0, count);\n \t\t\t\t}\n \n \t\t\t\t_out.flush();\n \t\t\t} catch (IOException e) {\n \t\t\t\tthrow new TransferFailedException(e, getTransferStatus());\n \t\t\t}\n \t\t} finally {\n \t\t\t_finished = System.currentTimeMillis();\n \t\t\t_slave.removeTransfer(this); // transfers are added in setting up\n \t\t\t\t\t\t\t\t\t\t\t// the transfer,\n \t\t\t\t\t\t\t\t\t\t\t// issueListenToSlave()/issueConnectToSlave()\n \t\t}\n \t}", "@Override\n\tpublic void visit(Request r) {\n\t\tif (!ph.getPeerChoked()) {\n\t\t\tSystem.out.println(\"requete rećue\");\n\t\t\tbyte[] body = r.getBody();\n\t\t\tbyte[] indexB = new byte[4], beginB = new byte[4], lengthB = new byte[4];\n\t\t\tTorrent torrent = ph.getTorrent();\n\t\t\tint index = 0, begin = 0, length = 0;\n\n\t\t\tindexB = Arrays.copyOfRange(body, 0, 4);\n\t\t\tindex = byteArrayToInt(indexB);\n\n\t\t\tbeginB = Arrays.copyOfRange(body, 4, 8);\n\t\t\tbegin = byteArrayToInt(beginB);\n\n\t\t\tlengthB = Arrays.copyOfRange(body, 8, body.length);\n\t\t\tlength = byteArrayToInt(lengthB);\n\n\t\t\tPiece piece = torrent.getPieces().get(index);\n\t\t\tif (index <= torrent.getPieces().size()) {\n\t\t\t\tbyte[] block = new byte[length];\n\t\t\t\tbyte[] pieceByte = piece.getData();\n\t\t\t\tfor (int i = 0; i < length; i++) {\n\t\t\t\t\tblock[i] = pieceByte[begin + i];\n\t\t\t\t}\n\t\t\t\tsb = new SendBlock(index, begin, block);\n\t\t\t\tthis.ph.addMessageQueue(sb);\n\t\t\t\tSystem.out.println(\"sendBlock envoyé\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Index trop grand\");\n\t\t\t}\n\t\t}\n\t}", "public abstract void loadData();", "public abstract void loadData();", "@Override\n public void Init() {\n strRemoteDownloadPath = strBasePath + (\"serialize/to/\");\n strRemoteUploadPath = strBasePath + (\"serialize/from/\");\n new File(strRemoteDownloadPath).mkdirs();\n new File(strRemoteUploadPath).mkdirs();\n }", "public interface EventSink {\n\n /**\n * Generate event, that a new peer has been discovered for some torrent.\n *\n * @since 1.5\n */\n void firePeerDiscovered(TorrentId torrentId, Peer peer);\n\n /**\n * Generate event, that a new connection with some peer has been established.\n *\n * @since 1.9\n */\n void firePeerConnected(ConnectionKey connectionKey);\n\n /**\n * Generate event, that a connection with some peer has been terminated.\n *\n * @since 1.9\n */\n void firePeerDisconnected(ConnectionKey connectionKey);\n\n /**\n * Generate event, that local information about some peer's data has been updated.\n *\n * @since 1.9\n */\n void firePeerBitfieldUpdated(TorrentId torrentId, ConnectionKey connectionKey, Bitfield bitfield);\n\n /**\n * Generate event, that processing of some torrent has begun.\n *\n * @since 1.5\n */\n void fireTorrentStarted(TorrentId torrentId);\n\n /**\n * Generate event, that torrent's metadata has been fetched.\n *\n * @since 1.9\n */\n void fireMetadataAvailable(TorrentId torrentId, Torrent torrent);\n\n /**\n * Generate event, that processing of some torrent has finished.\n *\n * @since 1.5\n */\n void fireTorrentStopped(TorrentId torrentId);\n\n /**\n * Generate event, that the downloading and verification\n * of one of torrent's pieces has been finished.\n *\n * @since 1.8\n */\n void firePieceVerified(TorrentId torrentId, int pieceIndex);\n}", "entities.Torrent.UploadRequest getUploadRequest();", "public abstract void onBinaryReceived(byte[] data);", "private void processStoreRequest(boolean initiatorPeer, Message request, ConcurrentHashMap<Integer, ChunkInfo> hashMap) {\n if (hashMap.get(request.getHeader().getChunkNo()) == null)\n return;\n\n ConcurrentHashMap<Integer, CopyOnWriteArrayList<Integer>> storesReceivedHash = peer.getFileSystem().getStoresReceived().get(request.getHeader().getFileId());\n\n if (storesReceivedHash == null) {\n storesReceivedHash = new ConcurrentHashMap<>();\n storesReceivedHash.put(request.getHeader().getSenderId(), new CopyOnWriteArrayList<>());\n }\n\n CopyOnWriteArrayList<Integer> listOfReceivedChunkOfThatSender = storesReceivedHash.get(request.getHeader().getSenderId());\n\n if (listOfReceivedChunkOfThatSender == null) {\n CopyOnWriteArrayList<Integer> newList = new CopyOnWriteArrayList<>();\n storesReceivedHash.put(request.getHeader().getSenderId(), newList);\n listOfReceivedChunkOfThatSender = newList;\n }\n\n\n if (listOfReceivedChunkOfThatSender.contains(request.getHeader().getChunkNo()))\n return;\n\n //Add the chunk No to the record\n listOfReceivedChunkOfThatSender.add(request.getHeader().getChunkNo());\n\n ChunkInfo chunkInfo = hashMap.get(request.getHeader().getChunkNo());\n\n chunkInfo.incrementReplicationLevel();\n\n hashMap.put(request.getHeader().getChunkNo(), chunkInfo);\n\n try {\n if (initiatorPeer) {\n peer.getFileSystem().writeInternalFileMetadataToDisk();\n } else {\n peer.getFileSystem().writeExternalFileChunksMetadataToDisk();\n }\n } catch (IOException e){\n log.error(\"Error while registering an increment of the perceivedReplication\");\n }\n }", "public void receiveBlob( BigInteger theBlob );", "private static void performInitialSync() throws IOException,ConfigurationException {\n\n LOGGER.info(\"Starting to perform initial sync\");\n //tapDump is basically that -- a dump of all data currently in CB.\n TapStream tapStream = tapClient.tapDump(tapName);\n SolrBatchImportEventHandler couchbaseToSolrEventHandler = new SolrBatchImportEventHandler();\n startupBatchDisruptor(couchbaseToSolrEventHandler);\n RingBuffer<CouchbaseEvent> ringBuffer = disruptor.getRingBuffer();\n\n CouchbaseEventProducer producer = new CouchbaseEventProducer(ringBuffer);\n //While there is data keep reading and producing\n while (!tapStream.isCompleted()) {\n while (tapClient.hasMoreMessages()) {\n ResponseMessage responseMessage;\n responseMessage = tapClient.getNextMessage();\n if (null != responseMessage) {\n String key = responseMessage.getKey();\n String value = new String(responseMessage.getValue());\n producer.onData(new String[] {key, value}, responseMessage.getOpcode());\n\n }\n }\n }\n LOGGER.info(\"Finished initial sync\");\n shutdownBatchDisruptor();\n //Since this event handler is batch based, we need to let it know we are done and it could flush the remaining data.\n couchbaseToSolrEventHandler.flush();\n\n }", "public interface PersistentDataCallbacks {\n \n /**\n * Provides keyed storage of strings. Should be used for per-folder data. Do not use for\n * per-message data.\n * @param key identifier for the data (e.g. \"sync.key\" or \"folder.id\")\n * @param value Data to persist. All data must be encoded into a string,\n * so use base64 or some other encoding if necessary.\n */\n public void setPersistentString(String key, String value);\n\n /**\n * @param key identifier for the data of interest\n * @return the data saved by the Folder, or defaultValue if never set.\n */\n public String getPersistentString(String key, String defaultValue);\n \n /**\n * In a single transaction: Set a key/value pair for the folder, and bulk set or clear\n * message flags. Typically used at the beginning or conclusion of a bulk sync operation.\n * \n * @param key if non-null, the transaction will set this folder persistent value\n * @param value the value that will be stored for the key\n * @param setFlags if non-null, flag(s) will be set for all messages in the folder\n * @param clearFlags if non-null, flag(s) will be cleared for all messages in the folder\n */\n public void setPersistentStringAndMessageFlags(String key, String value,\n Flag[] setFlags, Flag[] clearFlags) throws MessagingException;\n }", "private void getData() {\n\n //Adding the method to the queue by calling the method getDataFromServer\n requestQueue.add(getDataFromServer(pos));\n\n }", "@Override\n protected void connectionEstablished()\n {\n peer.resetConnectionClosed();\n\n // send our handshake directly as it doesn't fit into peer message\n // and there is always space in send buffer on new connection\n //enqueue(pmCache.handshake(torrent.getTorrentId(), torrent.getClientId()));\n }", "public void run() {\n try {\n //first send the file name to the receiver\n out.flush();\n out.writeUTF(fileName);\n out.flush();\n //sends the destination folder name\n out.writeUTF(destFolder);\n out.flush(); //flushes the buffer\n //array of bytes that holds the file bytes\n byte[] file = readFile(srcFilePath +\"/\"+fileName);\n System.out.println(\"Sending file: \"+fileName+\" to folder: \"+destFolder);\n //sends the file\n out.write(file,0,file.length);\n out.flush();\n if(notifDownloader) {\n NodeInterface nodeStub = (NodeInterface) Naming.lookup(\"/\"+clientSocket.getInetAddress().toString()+\"/Node\");\n nodeStub.fileDownloaded(fileName);\n }\n } catch (IOException e) {\n System.out.println(\"readline: \" + e.getMessage());\n } catch (NotBoundException e) {\n //e.printStackTrace();\n System.err.println(\"There was an error notifying the downloader \"+e.getMessage());\n } finally{\n try{\n //closes the socket\n clientSocket.close();\n }catch(IOException e){\n System.out.println(\"problem closing the socket: \"+e.getMessage());\n }\n }\n }", "@Override\n protected void onBinaryData(InputStream is) throws IOException {\n }", "@Override\n\t\t\t\tpublic int fileTransferSend(LinphoneCore lc, LinphoneChatMessage message,\n\t\t\t\t\t\tLinphoneContent content, ByteBuffer buffer, int size) {\n\t\t\t\t\treturn 0;\n\t\t\t\t}", "@Override\n\tpublic void conferenceroom() {\n\t\t\n\t}", "@Override\n\t\t\t\t\tpublic void onDataCallBack(String request, int code) {\n\t\t\t\t\t\tuploadMsg(fUerInfo);\n\t\t\t\t\t}", "private void remplirFabricantData() {\n\t}", "public void download() {\n }", "public void downloadStarted();", "public void callManager() throws IOException {\n\n\n }", "public void run() {\n // System.out.println(\"bsid\\tiid\\tid\\tmethod name\");\n\n while (true) {\n // get interaction\n Hashtable<Integer, ArrayList<Request>> interaction = father\n .getInteraction();\n\n if (interaction == null) {\n break;\n }\n\n // execute interaction\n executeInteraction(interaction);\n if (reqIndex >= maxNoOfRequests)\n break;\n }\n\n // System.out.println(\"Thread \" + threadId + \" is ending\");\n father.replayFinished();\n }", "@Override public java.lang.CharSequence download(java.lang.String appId, java.lang.String url, long duration, java.lang.String folder) throws android.os.RemoteException\n{\nandroid.os.Parcel _data = android.os.Parcel.obtain();\nandroid.os.Parcel _reply = android.os.Parcel.obtain();\njava.lang.CharSequence _result;\ntry {\n_data.writeInterfaceToken(DESCRIPTOR);\n_data.writeString(appId);\n_data.writeString(url);\n_data.writeLong(duration);\n_data.writeString(folder);\nmRemote.transact(Stub.TRANSACTION_download, _data, _reply, 0);\n_reply.readException();\nif ((0!=_reply.readInt())) {\n_result = android.text.TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(_reply);\n}\nelse {\n_result = null;\n}\n}\nfinally {\n_reply.recycle();\n_data.recycle();\n}\nreturn _result;\n}", "@Override\n public void run() {\n Groupe global;\n ConcurrentSkipListSet<GroupeNomme> listeGroupe;\n while(connecte){\n try {\n Paquet paquet = (Paquet) in.readObject();\n if(paquet.getAction()== Paquet.Action.AUTHENTIFICATION){\n System.out.println(\"Demande d'authentification de \"+paquet.getUtilisateur().getIdentifiant());\n\n Paquet retour = authentification(paquet);\n out.writeObject(retour);\n }\n else if(paquet.getAction()== Paquet.Action.REQUETTE){\n\n System.out.println(\"Demande de téléchargement de \"+paquet.getUtilisateur().getIdentifiant());\n\n// Paquet retour = new Paquet(Paquet.Action.REPONSE,paquet.getUtilisateur(),listeGroupe,global);\n Paquet retour = CommunicationBDD.download();\n /*Paquet retour = null;\n try {\n retour = ExtractDataBDD.download();\n } catch (SQLException e) {\n e.printStackTrace();\n }*/\n\n retour.setAction(Paquet.Action.REPONSE);\n retour.setUtilisateur(paquet.utilisateur);\n out.writeObject(retour);\n }else if(paquet.getAction()== Paquet.Action.REPONSE){\n\n System.out.println(\"Envoi infos depuis le Client \" + paquet.getUtilisateur().getIdentifiant());\n // serveur.maj(paquet.getListeGroupe(),paquet.getGroupeGlobal());\n CommunicationBDD.upload(new Paquet(null,null,paquet.getListeGroupe(),paquet.getGlobal()));\n if ( ! paquet.getListeGroupe().isEmpty()) {\n System.out.println(paquet.getListeGroupe().first().getFilsDeDiscussion());\n }\n }\n\n else if (paquet.getAction()== Paquet.Action.DECONNECT){\n System.out.println(\"Déconnexion de \"+paquet.getUtilisateur());\n connecte=false;\n }\n } catch (IOException e) {\n e.printStackTrace();\n } catch (ClassNotFoundException e) {\n e.printStackTrace();\n }\n }//while\n /*try {\n socket.close();\n } catch (IOException e) {\n e.printStackTrace();\n }*/\n\n }", "@Override\n public boolean accept(Player receiver, DataInputStream input) throws IOException {\n String subjectId = input.readUTF();\n UUID id = UUID.fromString(subjectId);\n\n //Reload the subject, if it is loaded as a group or user\n PermsManager.instance.getImplementation().getAsyncExecutor().execute(() -> {\n if (LadderManager.instance.isLadderLoaded(id)) {\n RankLadder ladder = LadderManager.instance.getLadder(id);\n LadderManager.instance.unloadLadder(id);\n LadderManager.instance.loadLadder(id);\n }\n });\n\n return false;\n }", "private void data(Messenger replyTo, int encoderId, Bundle data) {\n\n // obtain new message\n Message message = obtainMessage(Geotracer.MESSAGE_TYPE_DATA, encoderId, 0);\n message.setData(data);\n\n // send response\n send(replyTo, message);\n }", "public void onReceive(Object message) throws Throwable {\n if(message instanceof InitPublish) {\n //String fileDirectory = getAbsolutePath(directory,fileName);\n\n //send ce-bay message to publish the given file\n cebay.tell(new Publish(filePath, hashedFileName(), seederAddress()), getSelf());\n //receiving this message if someone wants to download our file\n } else if(message instanceof GetFile) {\n GetFile requestedFile = (GetFile) message;\n if(requestedFile.name().equals(this.fileName)) {\n byte[] data = new byte[(int)file.length()];\n FileInputStream fis = new FileInputStream(file);\n if(fis.read(data) != -1) {\n //send the sender a message with the requested file as byte[]\n getSender().tell(new FileRetrieved(data), getSelf());\n }\n fis.close();\n\n } else {\n //if a file is requested which we don't provide send the sender a fileNotFount-message\n getSender().tell(new FileNotFound(requestedFile.name()), getSelf());\n }\n //receiving this message from ce-bay\n } else if (message instanceof GetStatus) {\n //sending the message statusRetrieved back to ce-bay\n getSender().tell(new StatusRetrieved(), getSelf());\n } else {\n //if unknown message\n getSender().tell(\"Diese Nachricht konnte nicht verarbeitet werden!\", getSelf());\n }\n }", "public interface PeerRequestProcessor {\n\tpublic void processFileMetadataRequestMessage(FileMetadataRequestMessage msg) throws IOException;\n\tpublic void processFileBlockRequestMessage(FileBlockRequestMessage msg) throws IOException;\n\tpublic void processBlocksPresentRequestMessage(BlocksPresentRequestMessage msg) throws IOException;\n}", "void assignDataReceived(Serializable dataReceived);", "@Override public java.lang.CharSequence upload(java.lang.String appId, java.lang.String url, long duration, java.lang.String file) throws android.os.RemoteException\n{\nandroid.os.Parcel _data = android.os.Parcel.obtain();\nandroid.os.Parcel _reply = android.os.Parcel.obtain();\njava.lang.CharSequence _result;\ntry {\n_data.writeInterfaceToken(DESCRIPTOR);\n_data.writeString(appId);\n_data.writeString(url);\n_data.writeLong(duration);\n_data.writeString(file);\nmRemote.transact(Stub.TRANSACTION_upload, _data, _reply, 0);\n_reply.readException();\nif ((0!=_reply.readInt())) {\n_result = android.text.TextUtils.CHAR_SEQUENCE_CREATOR.createFromParcel(_reply);\n}\nelse {\n_result = null;\n}\n}\nfinally {\n_reply.recycle();\n_data.recycle();\n}\nreturn _result;\n}", "public void callback() {\n showProgress(false);\n this.completed = true;\n if (!isActive()) {\n skip(this.url, this.result, this.status);\n } else if (this.callback != null) {\n Class[] clsArr = {String.class, this.type, AjaxStatus.class};\n AQUtility.invokeHandler(getHandler(), this.callback, true, true, clsArr, DEFAULT_SIG, this.url, this.result, this.status);\n } else {\n try {\n callback(this.url, this.result, this.status);\n } catch (Exception e) {\n AQUtility.report(e);\n }\n }\n filePut();\n if (!this.blocked) {\n this.status.close();\n }\n wake();\n AQUtility.debugNotify();\n }", "private void sendToNodes(Sm.RetrieveChunkResponse chunkResponse, ArrayList<Sm.StorageNode> toSend) {\n\n System.out.println(\"Nodes to send to: \" + toSend);\n\n if (toSend.size() != 0) {\n EventLoopGroup workerGroup = new NioEventLoopGroup();\n PatrolMessagePipeline pipeline = new PatrolMessagePipeline();\n Bootstrap bootstrap = new Bootstrap()\n .group(workerGroup)\n .channel(NioSocketChannel.class)\n .option(ChannelOption.SO_KEEPALIVE, true)\n .handler(pipeline);\n\n// for (Sm.StorageNode node: toSend) {\n\n //create StoreChunkRequest\n Sm.StoreChunk chunk = Sm.StoreChunk.newBuilder()\n .setFileName(chunkResponse.getFilename())\n .setChunkId(chunkResponse.getChunkId())\n .setChunkSize(chunkResponse.getChunkSize())\n .setData(chunkResponse.getData())\n .setChunkName(chunkResponse.getChunkName())\n .build();\n\n Sm.StorageNodes nodes = Sm.StorageNodes.newBuilder()\n .addAllNodeList(toSend)\n .build();\n\n Sm.StorageNode primary = toSend.get(0);\n System.out.println(\"Primary: \" + primary.getIp());\n System.out.println(\"Primary: \" + primary.getPort());\n\n //Connect to the first replica\n ChannelFuture cf = bootstrap.connect(primary.getIp(), primary.getPort());\n cf.syncUninterruptibly();\n\n //Prepare Request & Wrap\n Sm.StoreChunkRequest request = Sm.StoreChunkRequest.newBuilder()\n .setChunk(chunk)\n .setNodes(nodes)\n .build();\n\n Sm.StorageMessageWrapper msgWrapper = Sm.StorageMessageWrapper.newBuilder()\n .setScRequest(request)\n .build();\n\n //Send\n Channel chan = cf.channel();\n PatrolInboundHandler handler = chan.pipeline().get(PatrolInboundHandler.class);\n Sm.StorageMessageWrapper response = handler.request(msgWrapper);\n\n if (response.getScResponse().getSuccess()) {\n System.out.println(\"StoreChunk successful?: \" + response.getScResponse().getSuccess());\n Controller.getInstance().updateReplicasAndChunkNames(toSend, chunk.getChunkName());\n }\n\n workerGroup.shutdownGracefully();\n }\n }", "void requestData();", "@MainThread\n @Override\n public void deliverResult(BaseResponse<R, E, D> data) {\n if (isReset()) // An async query came in while the loader is stopped. Result is not needed.\n releaseResources(data);\n\n final BaseResponse<R, E, D> prevData = mResult;\n mResult = data;\n\n if (isStarted()) // If the loader is currently started, we can immediately deliver its results.\n super.deliverResult(data);\n\n releaseResources(prevData);\n }", "protected abstract void loadData();", "private void doRequest() {\n\n try {\n JsonObject request = new JsonObject()\n .put(\"action\", Math.random() < 0.5 ? \"w\" : \"r\")\n .put(\"timeOfRequest\", System.currentTimeMillis());\n\n if (request.getString(\"action\") == \"w\") {\n request.put(\"data\", new JsonObject()\n .put(\"key\", \"value\")\n );\n logger.debug(\"requesting write: \" + request.toString());\n eb.send(\"storage-write-address\", request, new DeliveryOptions().setSendTimeout(1000), this);\n } else {\n Random random = new Random();\n List<String> keys = new ArrayList<String>(map.keySet());\n String randomKey = keys.get(random.nextInt(keys.size()));\n request.put(\"id\", randomKey);\n logger.debug(\"waiting for read: \" + request.toString());\n eb.send(\"storage-read-address\", request, new DeliveryOptions().setSendTimeout(1000), this);\n }\n } catch (Exception e) {\n logger.warn(\"Error\");\n makeRequest();\n }\n\n }", "public interface PeerInfoService extends PeerInfoCallback {\r\n}", "Mono<PieceEvent> downloadBlock(Link link, RequestMessage requestMessage);", "@Override\n public void run() {\n mProxyPrefs = new Preferences.ProxyPrefs(false, false, null, -1, null);\n mListFragment.loadNew(loaderState, mProxyPrefs.parcelableProxy);\n }" ]
[ "0.57097095", "0.5509383", "0.5482557", "0.54482615", "0.54289705", "0.5399499", "0.5377815", "0.5369875", "0.5320341", "0.52942365", "0.5281177", "0.52790475", "0.52763224", "0.52184266", "0.5214351", "0.5188049", "0.5169527", "0.51552474", "0.5155052", "0.514456", "0.5143107", "0.5142143", "0.5139938", "0.51358044", "0.5118417", "0.5118153", "0.50998443", "0.5087757", "0.505608", "0.5051917", "0.5046305", "0.5040756", "0.5039606", "0.5036914", "0.50341606", "0.50262916", "0.5021109", "0.5021109", "0.5008471", "0.5004502", "0.49919426", "0.49911165", "0.4956751", "0.49508947", "0.4949005", "0.49476987", "0.4946103", "0.49411783", "0.49380794", "0.49376598", "0.49288666", "0.49282736", "0.492546", "0.4917271", "0.4906913", "0.4905572", "0.4905432", "0.49043554", "0.48915046", "0.48811102", "0.4878574", "0.48713642", "0.48685008", "0.48685008", "0.48607358", "0.48565528", "0.48391238", "0.48365355", "0.48360366", "0.48358673", "0.48344055", "0.48342794", "0.48316064", "0.48267055", "0.4825082", "0.48226687", "0.48156378", "0.48103425", "0.48082715", "0.48039776", "0.47989613", "0.47921956", "0.4791221", "0.47888723", "0.47874972", "0.47834784", "0.47811815", "0.4779068", "0.47737825", "0.47714704", "0.4769976", "0.47698402", "0.47651505", "0.475685", "0.475623", "0.47521886", "0.47503185", "0.47465438", "0.47433642", "0.47431546", "0.4742218" ]
0.0
-1
checks collection of block requests being active for timeout and cancels them to allow Torrent to resend them later, must be called periodically
protected void cancelTimedOutBlockRequests() { long now = System.currentTimeMillis(); for (int i = blockRequests.size() - 1; 0 <= i; i--) { StdPeerMessage pm = blockRequests.get(i); if (pm.timestamp + DOWNLOAD_QUEUE_REQUESTS_TIMEOUT < now) { System.out.println("-Xo " + pm.index + " " + (pm.begin >> 14)); blockRequests.remove(i); torrent.cancelBlockRequest(pm.index, pm.begin); pmCache.release(pm); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void checkRequests()\n\t{\n\t\t// to be honest I don't see why this can't be 5 seconds, but I'm trying 1 second\n\t\t// now as the existing 0.1 second is crazy given we're checking for events that occur\n\t\t// at 60+ second intervals\n\n\t\tif ( mainloop_loop_count % MAINLOOP_ONE_SECOND_INTERVAL != 0 ){\n\n\t\t\treturn;\n\t\t}\n\n\t\tfinal long now =SystemTime.getCurrentTime();\n\n\t\t//for every connection\n\t\tfinal ArrayList peer_transports = peer_transports_cow;\n\t\tfor (int i =peer_transports.size() -1; i >=0 ; i--)\n\t\t{\n\t\t\tfinal PEPeerTransport pc =(PEPeerTransport)peer_transports.get(i);\n\t\t\tif (pc.getPeerState() ==PEPeer.TRANSFERING)\n\t\t\t{\n\t\t\t\tfinal List expired = pc.getExpiredRequests();\n\t\t\t\tif (expired !=null &&expired.size() >0)\n\t\t\t\t{ // now we know there's a request that's > 60 seconds old\n\t\t\t\t\tfinal boolean isSeed =pc.isSeed();\n\t\t\t\t\t// snub peers that haven't sent any good data for a minute\n\t\t\t\t\tfinal long timeSinceGoodData =pc.getTimeSinceGoodDataReceived();\n\t\t\t\t\tif (timeSinceGoodData <0 ||timeSinceGoodData >60 *1000)\n\t\t\t\t\t\tpc.setSnubbed(true);\n\n\t\t\t\t\t//Only cancel first request if more than 2 mins have passed\n\t\t\t\t\tDiskManagerReadRequest request =(DiskManagerReadRequest) expired.get(0);\n\n\t\t\t\t\tfinal long timeSinceData =pc.getTimeSinceLastDataMessageReceived();\n\t\t\t\t\tfinal boolean noData =(timeSinceData <0) ||timeSinceData >(1000 *(isSeed ?120 :60));\n\t\t\t\t\tfinal long timeSinceOldestRequest = now - request.getTimeCreated(now);\n\n\n\t\t\t\t\t//for every expired request \n\t\t\t\t\tfor (int j = (timeSinceOldestRequest >120 *1000 && noData) ? 0 : 1; j < expired.size(); j++)\n\t\t\t\t\t{\n\t\t\t\t\t\t//get the request object\n\t\t\t\t\t\trequest =(DiskManagerReadRequest) expired.get(j);\n\t\t\t\t\t\t//Only cancel first request if more than 2 mins have passed\n\t\t\t\t\t\tpc.sendCancel(request);\t\t\t\t//cancel the request object\n\t\t\t\t\t\t//get the piece number\n\t\t\t\t\t\tfinal int pieceNumber = request.getPieceNumber();\n\t\t\t\t\t\tPEPiece\tpe_piece = pePieces[pieceNumber];\n\t\t\t\t\t\t//unmark the request on the block\n\t\t\t\t\t\tif ( pe_piece != null )\n\t\t\t\t\t\t\tpe_piece.clearRequested(request.getOffset() /DiskManager.BLOCK_SIZE);\n\t\t\t\t\t\t// remove piece if empty so peers can choose something else, except in end game\n\t\t\t\t\t\tif (!piecePicker.isInEndGameMode())\n\t\t\t\t\t\t\tcheckEmptyPiece(pieceNumber);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}", "private void checkTimeout() {\n/* 169 */ if (this.socket != null) {\n/* */ \n/* 171 */ long i = this.keepaliveTimeoutMs;\n/* */ \n/* 173 */ if (this.listRequests.size() > 0)\n/* */ {\n/* 175 */ i = 5000L;\n/* */ }\n/* */ \n/* 178 */ long j = System.currentTimeMillis();\n/* */ \n/* 180 */ if (j > this.timeLastActivityMs + i)\n/* */ {\n/* 182 */ terminate(new InterruptedException(\"Timeout \" + i));\n/* */ }\n/* */ } \n/* */ }", "public static void blockRequests() {\n\t\tsynchronized (isRunning) {\n\t\t\ttry {\n\t\t\t\tisRunning.set(false);\n\t\t\t\tisRunning.wait();\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tisRunning.set(true);\n\t\t\t}\n\t\t}\n\t}", "public static void unblockRequests() {\n\t\tif (isRunning.compareAndSet(false, true)) {\n\t\t\tsynchronized (isRunning) {\n\t\t\t\tisRunning.notify();\n\t\t\t}\n\t\t}\n\t}", "@Test\n public void timeoutInactiveRequests() throws Exception {\n final Semaphore semaphore = new Semaphore(1);\n final int responseSize = 16;\n RpcHandler handler = new RpcHandler() {\n @Override\n public void receive(\n TransportClient client,\n ByteBuffer message,\n RpcResponseCallback callback) {\n try {\n semaphore.acquire();\n callback.onSuccess(ByteBuffer.allocate(responseSize));\n } catch (InterruptedException e) {\n // do nothing\n }\n }\n\n @Override\n public StreamManager getStreamManager() {\n return defaultManager;\n }\n };\n\n context = new TransportContext(conf, handler);\n server = context.createServer();\n clientFactory = context.createClientFactory();\n TransportClient client = clientFactory.createClient(TestUtils.getLocalHost(), server.getPort());\n\n // First completes quickly (semaphore starts at 1).\n TestCallback callback0 = new TestCallback();\n client.sendRpc(ByteBuffer.allocate(0), callback0);\n callback0.latch.await();\n assertEquals(responseSize, callback0.successLength);\n\n // Second times out after 10 seconds, with slack. Must be IOException.\n TestCallback callback1 = new TestCallback();\n client.sendRpc(ByteBuffer.allocate(0), callback1);\n callback1.latch.await(60, TimeUnit.SECONDS);\n assertNotNull(callback1.failure);\n assertTrue(callback1.failure instanceof IOException);\n\n semaphore.release();\n }", "public void checkTransactions() {\n\t\tif (log.isDebugEnabled()) {\n\t\t\tlog.debug(\"Checking {} transaction threads\", registeredThreads.size());\n\t\t}\n\t\tList<Thread> toInterrupt = registeredThreads.entrySet()\n\t\t\t.stream().filter(entry -> {\n\t\t\t\tlong now = System.currentTimeMillis();\n\t\t\t\tlong dur = now - entry.getValue();\n\t\t\t\tlong limit = storageOptions.getTxCommitTimeout();\n\t\t\t\tboolean exceedsLimit = dur > limit;\n\t\t\t\tif (exceedsLimit) {\n\t\t\t\t\tlog.warn(\"Thread {} exceeds time limit of {} with duration {}.\", entry.getKey(), limit, dur);\n\t\t\t\t}\n\t\t\t\treturn exceedsLimit;\n\t\t\t}).map(Map.Entry::getKey)\n\t\t\t.collect(Collectors.toList());\n\n\t\tinterrupt(toInterrupt);\n\t}", "@GuardedBy(\"mLock\")\n @VisibleForTesting\n protected void freeIfInactiveLocked() {\n mAttentionHandler.removeMessages(AttentionHandler.CHECK_CONNECTION_EXPIRATION);\n\n // Schedule resources cleanup if no one calls the API again.\n mAttentionHandler.sendEmptyMessageDelayed(AttentionHandler.CHECK_CONNECTION_EXPIRATION,\n CONNECTION_TTL_MILLIS);\n }", "public void timeout(){\n\t\tDate now = new Date();\n\t\tfor (Broadcast b : this.broadcasts){\n\t\t\tif (b.getTimeout().getTime() < now.getTime()){\n\t\t\t\tthis.remove(b);\n\t\t\t}\n\t\t}\n\t}", "public void triggerTimeout(List<TOMMessage> requestList) {\n\n ObjectOutputStream out = null;\n ByteArrayOutputStream bos = new ByteArrayOutputStream();\n\n int regency = lcManager.getNextReg();\n \n requestsTimer.stopTimer();\n requestsTimer.Enabled(false);\n\n\t// still not in the leader change phase?\n if (lcManager.getNextReg() == lcManager.getLastReg()) {\n\n lcManager.setNextReg(lcManager.getLastReg() + 1); // define next timestamp\n\n regency = lcManager.getNextReg(); // update variable \n\n // store messages to be ordered\n lcManager.setCurrentRequestTimedOut(requestList);\n\n // store information about messages that I'm going to send\n lcManager.addStop(regency, this.controller.getStaticConf().getProcessId());\n\n //execManager.stop(); // stop consensus execution\n\n //Get requests that timed out and the requests received in STOP messages\n //and add those STOPed requests to the client manager\n addSTOPedRequestsToClientManager();\n List<TOMMessage> messages = getRequestsToRelay();\n\n try { // serialize content to send in STOP message\n out = new ObjectOutputStream(bos);\n\n if (messages != null && messages.size() > 0) {\n\n\t\t\t\t\t//TODO: If this is null, then there was no timeout nor STOP messages.\n //What to do?\n byte[] serialized = bb.makeBatch(messages, 0, 0, controller.getStaticConf().getUseSignatures() == 1);\n out.writeBoolean(true);\n out.writeObject(serialized);\n } else {\n out.writeBoolean(false);\n logger.warn(\"Strange... did not include any request in my STOP message for regency \" + regency);\n }\n\n out.flush();\n bos.flush();\n\n byte[] payload = bos.toByteArray();\n\n out.close();\n bos.close();\n\n // send STOP-message \n logger.info(\"Sending STOP message to install regency \" + regency + \" with \" + (messages != null ? messages.size() : 0) + \" request(s) to relay\");\n \n LCMessage stop = new LCMessage(this.controller.getStaticConf().getProcessId(), TOMUtil.STOP, regency, payload);\n requestsTimer.setSTOP(regency, stop); // make replica re-transmit the stop message until a new regency is installed\n communication.send(this.controller.getCurrentViewOtherAcceptors(), stop);\n\n } catch (IOException ex) {\n logger.error(\"Could not serialize STOP message\", ex);\n } finally {\n try {\n out.close();\n bos.close();\n } catch (IOException ex) {\n logger.error(\"Could not serialize STOP message\", ex);\n }\n }\n\n }\n\n processOutOfContextSTOPs(regency); // the replica might have received STOPs\n // that were out of context at the time they\n // were received, but now can be processed\n \n startSynchronization(regency); // evaluate STOP messages\n \n }", "public boolean checkTimeout(){\n\t\tif((System.currentTimeMillis()-this.activeTime.getTime())/1000 >= this.expire){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "public void checkLastActive() {\n if (this.lastActive < System.nanoTime() - this.timeout) {\n this.logout();\n this.timer.cancel();\n }\n }", "private static void checkTimeoutAndRetry() {\n while (true) {\n for (ServerAckWindow window : windowsMap.values()) {\n window.responseCollectorMap.entrySet().stream()\n .filter(entry -> window.timeout(entry.getValue()))\n .forEach(entry -> window.retry(entry.getKey(), entry.getValue()));\n }\n }\n }", "public boolean hasStopped(int attempts, long timeout, TimeUnit timeUnit) {\n try {\n HttpResponse httpResponse = sendRequest(request().withMethod(\"PUT\").withPath(calculatePath(\"status\")), true, false);\n if (httpResponse != null && httpResponse.getStatusCode() == HttpStatusCode.OK_200.code()) {\n if (attempts <= 0) {\n return false;\n } else {\n try {\n timeUnit.sleep(timeout);\n } catch (InterruptedException e) {\n // ignore interrupted exception\n }\n return hasStopped(attempts - 1, timeout, timeUnit);\n }\n } else {\n return true;\n }\n } catch (SocketConnectionException | IllegalStateException sce) {\n return true;\n }\n }", "public void decrementActiveRequestsAndDeactivate() {\n if (--this.requests == 0 && !this.active) {\n synchronized (this) {\n this.notifyAll();\n }\n }\n }", "public void cancelAllRequests(boolean mayInterruptIfRunning, RequestHandle cnt) {\n // client.get\n\n }", "public void setBlockedTime() {\r\n\t\t\tthis.blockedTime = 0;\r\n\t\t}", "void onCancel(int index, int begin, int length)\n {\n // validate common block parameters\n boolean correct = torrent.validateBlock(index, begin, length);\n if (!correct) {\n close(Peer.CloseReason.PROTOCOL_ERROR);\n return;\n }\n\n // check if are processing this request right now\n for (int i = 0; i < peerBlockRequests.size(); i++) {\n StdPeerMessage pm = peerBlockRequests.get(i);\n if ((pm.index == index)\n && (pm.begin == begin)\n && (pm.length == length))\n {\n peerBlockRequests.remove(i);\n pmCache.release(pm);\n break;\n }\n }\n\n // check if response has been enqueued,\n // could be skipped if found in pBR\n for (int i = 0; i < sendQueue.size(); i++) {\n StdPeerMessage pm = sendQueue.get(i);\n if ((pm.type == StdPeerMessage.PIECE)\n && (pm.index == index)\n && (pm.begin == begin)\n && (pm.length == length))\n {\n sendQueue.remove(i);\n // let storage to unlock block of data\n // and return it into cache of blocks\n TorrentStorage.Block block = (TorrentStorage.Block) pm.params;\n block.release();\n\n pmCache.release(pm);\n break;\n }\n }\n }", "protected Request barrierBlockingRemoveOldest(long timeout) {\n long timeStartWaiting = 0;\n if (timeout > 0) {\n timeStartWaiting = System.currentTimeMillis();\n }\n while (((this.isEmpty() && this.shouldWait) || this.suspended ||\n (this.indexOfRequestToServe() == -1)) &&\n !this.specialExecution) {\n if (hasListeners()) {\n notifyAllListeners(new RequestQueueEvent(ownerID,\n RequestQueueEvent.WAIT_FOR_REQUEST));\n }\n try {\n wait(timeout);\n } catch (InterruptedException e) {\n }\n if ((System.currentTimeMillis() - timeStartWaiting) > timeout) {\n return removeOldest();\n }\n }\n if (specialExecution) {\n specialExecution = false;\n return blockingRemoveOldest(specialMethod);\n }\n return barrierRemoveOldest();\n }", "@Test\n public void testTripCircuitOnTimeouts() {\n try {\n HystrixCommandProperties.Setter properties = HystrixCommandPropertiesTest.getUnitTestPropertiesSetter();\n HystrixCommandMetrics metrics = getMetrics(properties);\n HystrixCircuitBreaker cb = getCircuitBreaker(key, CommandOwnerForUnitTest.OWNER_TWO, metrics, properties);\n\n // this should start as allowing requests\n assertTrue(cb.allowRequest());\n assertFalse(cb.isOpen());\n\n // timeouts\n metrics.markTimeout(2000);\n metrics.markTimeout(2000);\n metrics.markTimeout(2000);\n metrics.markTimeout(2000);\n\n // everything has been a timeout so we should not allow any requests\n assertFalse(cb.allowRequest());\n assertTrue(cb.isOpen());\n } catch (Exception e) {\n e.printStackTrace();\n fail(\"Error occurred: \" + e.getMessage());\n }\n }", "void requestRateLimited();", "private void setupTimeoutJob() {\n eventLoopGroup.scheduleAtFixedRate(() -> {\n\n /*\n * We cannot wait for the request infinitely, but we also cannot remove the object\n * from the queue - FIXME in case of situation when queue of waiting objects grow to X we have to\n * brake connection.\n */\n\n Iterator<RedisQueryRequest> iterator = queue.iterator();\n int i = 0;\n long timeNow = System.currentTimeMillis();\n /*\n * we are tracking 'i' because we want to do only some work, not all the work.\n * we cannot take too much time in timeout checking.\n */\n\n while (iterator.hasNext() && i < 100) {\n RedisQueryRequest current = iterator.next();\n if (current.isTimeouted()) {\n //already been here.\n continue;\n }\n long whenRequestStarted = current.getRequestTimeStart();\n long requestTimeUntilNow = timeNow - whenRequestStarted;\n if (requestTimeUntilNow >= 1000) {\n LOG.error(\"Timeouted request detected\");\n current.markTimeouted();\n current.getCompletableFuture().completeExceptionally(new TimeoutException(\"Timeout occurred.\"));\n }\n\n i++;\n }\n\n }, 100, 100, TimeUnit.MILLISECONDS);\n }", "public void removePendingTimeout() {\n if (logger.isTraceEnabled()) {\n logger.trace(\"Remove expired timeout event\");\n }\n try {\n queueLock.lock();\n if (pendingResponseEvents != null && !pendingResponseEvents.isEmpty()) {\n for (Iterator<Event> iterator = pendingResponseEvents.iterator(); iterator\n .hasNext();) {\n Event pendingEvent = iterator.next();\n if (pendingEvent instanceof TimeoutEvent) {\n iterator.remove();\n if (logger.isTraceEnabled()) {\n logger.trace(\"Expired timeout event: {} was removed from the context\",\n pendingEvent.getId());\n }\n break;\n }\n }\n }\n } finally {\n queueLock.unlock();\n }\n }", "private void finishRequests(){\n\t\tpeer.getRequests().removeAll(finishedRequestsList);\n\t\tfinishedRequestsList.clear();\n\t}", "void cancelTimeout() {\n timeoutCancelled = true;\n if (timeout != null) {\n timeout.cancel();\n }\n }", "public static boolean retrieveCanceledTimeList(List<ReserveTime> reserveTimes) {\n\t\tConnection connection = DBConnection.getConnection();\n\t\tfor(ReserveTime reserveTime : reserveTimes) {\n\t\t\treserveTime.setStatus(ReserveTimeStatus.RESERVABLE);\n\t\t\tif(!executeInsertUpdate(reserveTime, updateCommand + reserveTime.getID(), connection)) {\n\t\t\t\tDBConnection.closeConnection(connection);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tDBConnection.closeConnection(connection);\n\t\treturn true;\n\t}", "private void cancelTimeout(){\n\t\tSharedPreferences timeout = mContext.getSharedPreferences(\"Timeout\"+Integer.toString(mRid), Context.MODE_PRIVATE);\n\t SharedPreferences.Editor editor = timeout.edit();\n\t editor.putLong(\"start\", 0);\n\t editor.apply();\n\t}", "public void run() {\r\n removeIPBlockTimeout(link);\r\n removeTempUnavailTimeout(link);\r\n link.reset();\r\n }", "protected int maxTimeout() { return 15*1000*1000; }", "private void closeIdleTimeoutConnection() {\r\n if (poolState.get() == POOL_NORMAL) {\r\n PooledConnection[] array = connArray;\r\n for (int i = 0, len = array.length; i < len; i++) {\r\n PooledConnection pConn = array[i];\r\n int state = pConn.state;\r\n if (state == CONNECTION_IDLE && !existBorrower()) {\r\n boolean isTimeoutInIdle = (currentTimeMillis() - pConn.lastAccessTime - poolConfig.getIdleTimeout() >= 0);\r\n if (isTimeoutInIdle && ConnStUpd.compareAndSet(pConn, state, CONNECTION_CLOSED)) {//need close idle\r\n removePooledConn(pConn, DESC_REMOVE_IDLE);\r\n tryToCreateNewConnByAsyn();\r\n }\r\n } else if (state == CONNECTION_USING) {\r\n ProxyConnectionBase proxyConn = pConn.proxyConn;\r\n boolean isHoldTimeoutInNotUsing = currentTimeMillis() - pConn.lastAccessTime - poolConfig.getHoldTimeout() >= 0;\r\n if (isHoldTimeoutInNotUsing) {//recycle connection\r\n if (proxyConn != null) {\r\n proxyConn.trySetAsClosed();\r\n } else {\r\n removePooledConn(pConn, DESC_REMOVE_BAD);\r\n tryToCreateNewConnByAsyn();\r\n }\r\n }\r\n } else if (state == CONNECTION_CLOSED) {\r\n removePooledConn(pConn, DESC_REMOVE_CLOSED);\r\n tryToCreateNewConnByAsyn();\r\n }\r\n }\r\n ConnectionPoolMonitorVo vo = this.getMonitorVo();\r\n commonLog.debug(\"BeeCP({})idle:{},using:{},semaphore-waiter:{},wait-transfer:{}\", poolName, vo.getIdleSize(), vo.getUsingSize(), vo.getSemaphoreWaiterSize(), vo.getTransferWaiterSize());\r\n }\r\n }", "void disable()\n{\n synchronized (this) {\n is_enabled = false;\n request_queue.clear();\n for (DymonPatchRequest ar : active_requests) removeActive(ar);\n if (request_timer != null) request_timer.cancel();\n request_timer = null;\n }\n}", "@LargeTest\n @Test\n public void testRequestActiveScanFromMultipleClients_suppressActiveScanAfter30Seconds()\n throws Exception {\n sendDiscoveryRequest(mReceiveMessenger1, new MediaRouteDiscoveryRequest(mSelector, true));\n\n // Sleep 10 seconds and request active scan from client 2.\n Thread.sleep(10000);\n sendDiscoveryRequest(mReceiveMessenger2, new MediaRouteDiscoveryRequest(mSelector, true));\n\n // Active scan should be true.\n assertTrue(sActiveScanCountDownLatch.await(TIME_OUT_MS, TimeUnit.MILLISECONDS));\n\n // Right before the last client times out, active scan flag should still be true.\n resetActiveAndPassiveScanCountDownLatches();\n assertFalse(sActiveScanCountDownLatch.await(\n MAX_ACTIVE_SCAN_DURATION_MS - 1000, TimeUnit.MILLISECONDS));\n\n // Right after the active scan duration passed, active scan flag should be false.\n resetActiveAndPassiveScanCountDownLatches();\n assertTrue(sPassiveScanCountDownLatch.await(1000 + TIME_OUT_MS, TimeUnit.MILLISECONDS));\n }", "public synchronized void checkTimeoutMessages() {\n SQSMessage SQSMessage;\n String receiptHandler;\n long currentTimeStampDifference;\n for (Map.Entry pairs : receivedMessages.entrySet()) {\n SQSMessage = (SQSMessage) pairs.getValue();\n currentTimeStampDifference = System.currentTimeMillis() - SQSMessage.getReceivedTimeStamp();\n if (currentTimeStampDifference > SQSMessage.getDefaultVisibilityTimeout()) {\n receiptHandler = (String) pairs.getKey();\n SQSMessageQueue.addFirst(SQSMessage);\n receivedMessages.remove(receiptHandler);\n }\n }\n }", "private void cancelTasks() {\n\t\ttimer.cancel();\n\t\ttimer.purge();\n\t}", "private boolean isBlocked() {\n return block_state <= 1;\n }", "public void pauseRequests() {\n requestTracker.pauseRequests();\n }", "public void removeIPBlockTimeout(DownloadLink link) {\r\n /* reset ip waittimes only for local ip */\r\n ProxyController.getInstance().removeIPBlockTimeout(link.getHost(), true);\r\n LinkStatus ls = link.getLinkStatus();\r\n if (ls.hasStatus(LinkStatus.ERROR_IP_BLOCKED)) {\r\n ls.reset();\r\n }\r\n }", "public abstract void isCancel(long ms);", "public void finishedAllRequests() {\n hasMoreRequests = false;\n }", "private boolean requestLimitReached() {\n\t\treturn (requestCount >= maximumRequests);\n\t}", "private void cancelTimer() {\n Timer.cancelTimeout(this);\n responded = true;\n }", "public void setBlockingTimeout(int blockingTimeout) {\n this.blockingTimeout = blockingTimeout;\n }", "private void viewPendingRequests() {\n\n\t}", "public void checkCancel() throws CancellationException;", "public boolean checkBlockX()\n {\n if (mBlockedTime == 0)\n {\n return false;\n }\n\n double tBlockDelay = mBlockedTime - time();\n mBlockedTime = 0;\n if (tBlockDelay <= 0)\n {\n return false;\n }\n mBlockedMessage.add(mName + \" GC blocked from \" + time() + \" + until \" + (time() + tBlockDelay));\n hold(tBlockDelay);\n out();\n return true;\n }", "private void startEliminateExpiredClient() {\n this.expiredExecutorService.scheduleAtFixedRate(() -> {\n long currentTime = System.currentTimeMillis();\n List<ClientInformation> clients = ClientManager.getAllClient();\n if (clients != null && clients.size() > 0) {\n clients.stream().forEach(client -> {\n String clientId = ClientManager.getClientId(client.getAddress(), client.getPort());\n long intervalSeconds = (currentTime - client.getLastReportTime()) / 1000;\n if (intervalSeconds > configuration.getExpiredExcludeThresholdSeconds()\n && ClientStatus.ON_LINE.equals(client.getStatus())) {\n client.setStatus(ClientStatus.OFF_LINE);\n ClientManager.updateClientInformation(client);\n log.info(\"MessagePipe Client:{},status updated to offline.\", clientId);\n } else if (intervalSeconds <= configuration.getExpiredExcludeThresholdSeconds()\n && ClientStatus.OFF_LINE.equals(client.getStatus())) {\n client.setStatus(ClientStatus.ON_LINE);\n ClientManager.updateClientInformation(client);\n log.info(\"MessagePipe Client:{},status updated to online.\", clientId);\n }\n });\n }\n }, 5, configuration.getCheckClientExpiredIntervalSeconds(), TimeUnit.SECONDS);\n }", "public void requestEviction(int cMaximum);", "private void clearBlocked() {\n\n blocked_ = false;\n }", "protected void touchTimeoutCounter()\n\t{\n\t this.lastAccessTime = System.currentTimeMillis();\n\t thread.interrupt ();\n\t}", "private void stopRequest(){ Remove the clause synchronized of the stopRequest method.\n // Synchronization is isolated as possible to avoid thread lock.\n // Note: the method removeRequest from SendQ is synchronized.\n // fix bug jaw.00392.B\n //\n synchronized(this){\n setRequestStatus(stAborted);\n }\n informSession.getSnmpQManager().removeRequest(this);\n synchronized(this){\n requestId=0;\n }\n }", "void cancel() {\n if (mCurrentRequest != null) {\n mCurrentRequest.cancel();\n mCurrentRequest = null;\n }\n mPendingEntries.clear();\n }", "public void cancelAll() {\n terminateScheduleTask();\n for (CancellableCommand request : outstandingRequests) {\n request.onCancelled();\n }\n outstandingRequests.clear();\n }", "void cancelStickyRequest() {\n if (mStickyRequest) {\n cancelCurrentRequestLocked();\n }\n }", "public synchronized void closeExpiredConnections() {\n/* 337 */ if (this.isShutdown.get()) {\n/* */ return;\n/* */ }\n/* 340 */ if (!this.leased) {\n/* 341 */ checkExpiry();\n/* */ }\n/* */ }", "private void sendCancelRpcCall(int numberRetries) {\n\t}", "private void doWaitDueToLongResponse(BaseRequest request, long responseTime, String uri) {\n try {\n AgentConfig config = request.getLogUtil().getAgentConfig();\n long maxAgentResponseTime = config.getMaxAgentResponseTime();\n if (maxAgentResponseTime < responseTime) {\n long waitTime = Math.min(config.getMaxAgentWaitTime(), responseTime);\n LOG.warn(request.getLogUtil().getLogMessage(\"Response time to slow | delaying \" + waitTime + \" ms | url --> \" + uri, LogEventType.Script));\n Thread.sleep(waitTime);\n }\n } catch (InterruptedException e) {\n LOG.warn(\"Interrupted\", e);\n }\n }", "boolean waitForConfirmationOnAll(int timeout_ms) throws IOException;", "private void waitForStateChange(int maxTTW) throws MqttException {\n synchronized (caller) {\n if (!donext) {\n try {\n caller.wait(maxTTW);\n } catch (InterruptedException e) {\n Debug.logError(\"Timed out.\" + e.getMessage(), MODULE);\n }\n\n if (ex != null) {\n throw (MqttException) ex;\n }\n }\n donext = false;\n }\n }", "public void markRequestTimerDelete() throws JNCException {\n markLeafDelete(\"requestTimer\");\n }", "public void cancelAllRequests() {\n mPwsClient.cancelAllRequests();\n }", "public void cancelGetResponse() {\n impl.cancelGetResponse();\n }", "void rateLimitReset();", "int getActiveBlockRequestsNumber() {\n return blockRequests.size();\n }", "public void requestcanceled() {\n\n requestcancelcheck = true;\n\n String diatitle = \"Request cancelled.\";\n String msg = \"Request cancelled by Rider.\";\n\n marker.setEnabled(false);\n // mGoogleMap.clear();\n fullbutton.setVisibility(View.GONE);\n usercheck = false;\n touch.setVisibility(View.GONE);\n marker.setVisibility(View.INVISIBLE);\n checkonclick = false;\n timercheck = true;\n whilecheck = true;\n accheck = true;\n receivecheck = true;\n\n acc1 = acc;\n\n registerReceiver(mHandleMessageReceiver, new IntentFilter(Config.DISPLAY_MESSAGE_ACTION));\n dialogshow(diatitle, msg);\n\n }", "private void manageRequestIntervalTimer(boolean start) {\n synchronized (this) {\n if (start && (requestInterval > 0)) {\n // Start the timer.\n if (requestIntervalTimer == null) // otherwise the timer is already running\n {\n requestIntervalTimer = new Timer();\n requestIntervalTimer.schedule(new TimerTask() {\n public void run() {\n if (Log.isLoggable(AdManager.LOG, Log.DEBUG)) {\n int secs = requestInterval / 1000;\n\n if (Log.isLoggable(AdManager.LOG, Log.DEBUG)) {\n Log.d(AdManager.LOG, \"Requesting a fresh ad because a request interval passed (\" + secs + \" seconds).\");\n }\n }\n\n requestFreshAd();\n }\n },\n requestInterval, requestInterval);\n }\n } else if ((start == false) || (requestInterval == 0)) {\n // Stop the currently running timer.\n if (requestIntervalTimer != null) {\n requestIntervalTimer.cancel();\n requestIntervalTimer = null;\n }\n }\n }\n }", "@Test\n public void testTripCircuitOnTimeoutsAboveThreshold() {\n try {\n HystrixCommandProperties.Setter properties = HystrixCommandPropertiesTest.getUnitTestPropertiesSetter();\n HystrixCommandMetrics metrics = getMetrics(properties);\n HystrixCircuitBreaker cb = getCircuitBreaker(key, CommandOwnerForUnitTest.OWNER_TWO, metrics, properties);\n\n // this should start as allowing requests\n assertTrue(cb.allowRequest());\n assertFalse(cb.isOpen());\n\n // success with high latency\n metrics.markSuccess(400);\n metrics.markSuccess(400);\n metrics.markTimeout(10);\n metrics.markSuccess(400);\n metrics.markTimeout(10);\n metrics.markTimeout(10);\n metrics.markSuccess(400);\n metrics.markTimeout(10);\n metrics.markTimeout(10);\n\n // this should trip the circuit as the error percentage is above the threshold\n assertFalse(cb.allowRequest());\n assertTrue(cb.isOpen());\n } catch (Exception e) {\n e.printStackTrace();\n fail(\"Error occurred: \" + e.getMessage());\n }\n }", "RequestSender onTimeout(long timeout, Runnable runnable);", "void blocked(HttpServletRequest request, HttpServletResponse response) throws IOException;", "@Override\n\tpublic void waitTimedOut() {\n\t\t\n\t\tif( busylinetimer == null )\n\t\t\treturn;\n\t\t\n\t\tbusylinetimer.stop();\n\t\tbusylinetimer = null;\n\t\t\n\t\tlog.info(\"linea ocupada por mas de 120 segundos, iniciando proceso para colgar llamada.......\");\n\t\t\n\t\tnew CellPhoneHandUpCall(modem,false);\n\t}", "void handleTimeoutTask();", "public static void main(String... args) {\n List<Integer> data = new ArrayList<Integer>();\n data.add(1);\n data.add(1);\n data.add(1);\n data.add(1);\n data.add(2);\n data.add(2);\n data.add(3);\n data.add(4);\n data.add(4);\n data.add(4);\n data.add(4);\n data.add(5);\n data.add(5);\n data.add(5);\n data.add(5);\n data.add(6);\n data.add(6);\n data.add(7);\n data.add(7);\n data.add(7);\n data.add(8);\n data.add(9);\n data.add(10);\n data.add(10);\n data.add(10);\n data.add(10);\n data.add(10);\n data.add(11);\n data.add(12);\n data.add(12);\n\n int count = droppedRequests(data);\n System.out.println(count);\n }", "@Test\r\n public void test_stop() throws InterruptedException {\r\n final CountDownLatch expectedTimeoutReceivedLatch = new CountDownLatch(1);\r\n final CountDownLatch timeoutWhichShouldNeverBeReceivedLatch = new CountDownLatch(2);\r\n final IExpiryAction<Long> timeoutAction = new IExpiryAction<Long>() {\r\n @Override\r\n public void onTimeout(final Long payload) {\r\n //\r\n // count-down our latches. The first latch only requires one\r\n // invocation, the second expects two (though the second should\r\n // never be received)\r\n //\r\n expectedTimeoutReceivedLatch.countDown();\r\n timeoutWhichShouldNeverBeReceivedLatch.countDown();\r\n }\r\n };\r\n\r\n final int taskTimeout = 100;\r\n final ExpiryViceroy<Long> timeoutManager = ExpiryViceroy.start(timeoutAction, taskTimeout,\r\n TimeUnit.MILLISECONDS);\r\n\r\n //\r\n // ensure it's running - add a task which will expire\r\n //\r\n timeoutManager.onStartTask(Long.valueOf(1));\r\n final boolean timeoutReached = expectedTimeoutReceivedLatch.await(1, TimeUnit.SECONDS);\r\n Assert.assertTrue(\"timeout reached\", timeoutReached);\r\n\r\n //\r\n // now kill the timeout manager ...\r\n //\r\n timeoutManager.stop();\r\n\r\n //\r\n // ... and submit another task.\r\n //\r\n timeoutManager.onStartTask(Long.valueOf(2));\r\n final boolean timeoutNeverReceived = timeoutWhichShouldNeverBeReceivedLatch.await(taskTimeout + 100,\r\n TimeUnit.MILLISECONDS);\r\n Assert.assertFalse(\"a second timeout should never have been called\", timeoutNeverReceived);\r\n }", "private boolean keepAlive(Request request){\n MimeHeaders headers = request.getMimeHeaders();\n\n // Check connection header\n MessageBytes connectionValueMB = headers.getValue(\"connection\");\n if (connectionValueMB != null) {\n ByteChunk connectionValueBC = connectionValueMB.getByteChunk();\n if (findBytes(connectionValueBC, Constants.CLOSE_BYTES) != -1) {\n return false;\n } else if (findBytes(connectionValueBC, \n Constants.KEEPALIVE_BYTES) != -1) {\n return true;\n }\n }\n return false;\n }", "public void resendRequestingQueue() {\n Logger.m1416d(TAG, \"Action - resendRequestingQueue - size:\" + this.mRequestingQueue.size());\n printRequestingQueue();\n printRequestingCache();\n while (true) {\n Requesting requesting = (Requesting) this.mRequestingQueue.pollFirst();\n if (requesting == null) {\n return;\n }\n if (requesting.request.getCommand() == 2) {\n this.mRequestingQueue.remove(requesting);\n this.mRequestingCache.remove(requesting.request.getHead().getRid());\n } else {\n requesting.retryAgain();\n sendCommandWithLoggedIn(requesting);\n }\n }\n }", "void updateNextUnblockTime(int t);", "@Override\n protected void checkCanceled() {\n long l = System.currentTimeMillis();\n if (l >= myTime) {\n throw new ProcessCanceledException();\n }\n }", "public void acceptTimeout();", "public void tick() {\n Instant now = clock.instant();\n SortedMap<Instant, Set<Endpoint>> range = timeouts.headMap(now);\n\n Set<Endpoint> processed = new HashSet<>();\n for (Set<Endpoint> batch : range.values()) {\n for (Endpoint endpoint : batch) {\n if (processed.contains(endpoint)) {\n continue;\n }\n processed.add(endpoint);\n checkExpiration(now, endpoint);\n }\n }\n range.clear();\n }", "public void handleTimeout();", "protected Request blockingRemove(long timeout, boolean oldest) {\n return blockingRemove(null, oldest, timeout);\n }", "private void handleActiveFailure() {\n\t\tif (isElectedBackup) {\n\t\t\tterminateThread.set(true);\n\t\t\tnew Thread(LoadBalancer.getNewActiveLoadBalancer()).start();\n\t\t\tfor (RemoteLoadBalancer remoteLoadBalancer : remoteLoadBalancers) {\n\t\t\t\tremoteLoadBalancer.resetState();\n\t\t\t}\n\t\t} else {\n\t\t\tcurrentActive.setState(LoadBalancerState.PASSIVE);\n\t\t\tcurrentActive.setIsElectedBackup(false);\n\t\t\ttry {\n\t\t\tcurrentActive = remoteLoadBalancers.stream().filter(x -> x.isElectedBackup()).findFirst().get();\n\t\t\t} catch (NoSuchElementException e) {\n\t\t\t\tcurrentActive = null;\n\t\t\t}\n\t\t\tresetActiveHeartbeatTimer();\n\t\t}\n\t}", "protected void responseFail(){\n\t\tqueue.clear();\n\t}", "protected static void deleteTimedOutSessions() {\r\n Enumeration userLogins = activeUserLogins.keys();\r\n\r\n while (userLogins.hasMoreElements()) {\r\n long now = System.currentTimeMillis();\r\n String thisKey = (String)userLogins.nextElement();\r\n Login thisLogin = activeUserLogins.get(thisKey);\r\n if ((thisLogin.getTimeout() > 0) &&\r\n (now > (thisLogin.getLastAccessed().getTime() + thisLogin.getTimeout()))) {\r\n log.debug(\"Logging \" + thisLogin.getUserId() + \" out\");\r\n logout(thisKey);\r\n\r\n }\r\n }\r\n }", "@Override\n public void close() {\n if (!this.closed) {\n this.closed = true;\n this.requestsMap.values().forEach(request -> {\n try {\n ucpWorker.cancelRequest(request);\n } catch (NullPointerException nex) {\n // ignored, already cancelled\n }\n });\n }\n }", "private static void cleanReplyCache(RouterContext ctx, Map<HashPair, Long> tc) {\n long now = ctx.clock().now();\n for (Iterator<Long> iter = tc.values().iterator(); iter.hasNext(); ) {\n Long l = iter.next();\n if (l.longValue() < now - CLEAN_INTERVAL)\n iter.remove();\n }\n }", "@Override\r\n public long getTimeouts()\r\n {\n return 0;\r\n }", "private void stopPulling() {\n\n // un register this task\n eventDispatcher.unRegister(this);\n\n // tell the container to send response\n asyncContext.complete();\n\n // cancel data changed listening\n if (pullingTimeoutFuture != null){\n pullingTimeoutFuture.cancel(false);\n }\n }", "@Override\n protected boolean check(User user, UUID uuid, String service, String key) {\n if (this.timeOuts.containsKey(uuid) && this.timeOuts.get(uuid) + 1000 * 2 >= System\n .currentTimeMillis()) {\n user.sendMessage(Translation.RANKSYNC_COMMAND_REQUEST_LIMIT.getTranslation());\n return false;\n } else {\n this.timeOuts.put(uuid, System.currentTimeMillis());\n return true;\n }\n }", "void cancelOverrideRequest() {\n cancelCurrentRequestLocked();\n }", "public void purgeTimeouts() {\n\t\ttimeoutSet = new LinkedList<Event>();\n\t}", "@Scheduled(fixedRate = checkRate)\n public void CheckExpired() {\n log.info(\"Checking if links expired\");\n try {\n for(ShortURL s : urlList) {\n // Si la fecha guardada es antes que este momento\n Date then1 = s.getExpirationDate();\n java.util.Date then2= new java.util.Date(then1.getTime());\n Instant then = then2.toInstant();\n Instant now = ZonedDateTime.now().toInstant();\n if(then.isBefore(now)){\n log.info(\"URL {} expired.\", s.getUri().toString());\n s.setMode(HttpStatus.GONE.value());\n }\n }\n } catch( NullPointerException e) {\n //No se ha inicializado aun\n }\n\n }", "@Override\n protected void onRequestTimeout(Tuple request) {\n }", "@Override\n protected void afterExecute(final Runnable r, final Throwable t) {\n mActiveTasks.remove(r);\n\n // Perform a quick check to see if there are any remaining requests in\n // the blocked queue. Peek the head and check for duplicates in the \n // active and task queues. If no duplicates exist, add the request to\n // the task queue. Repeat this until a duplicate is found\n synchronized (mBlockedTasks) {\n while(mBlockedTasks.peek()!=null && \n !mTaskQueue.contains(mBlockedTasks.peek()) && \n !mActiveTasks.contains(mBlockedTasks.peek())){\n Runnable runnable = mBlockedTasks.poll();\n if(runnable!=null){\n mThreadPool.execute(runnable);\n }\n }\n }\n super.afterExecute(r, t);\n }", "public void resetTimeout(){\n this.timeout = this.timeoutMax;\n }", "public void timeoutCheckAndRetransmit() throws IOException{\n\t\tfor ( int j=0; j<window.size(); j++ ){\n\t\t\tif (window.get(j).counter > DEFAULT_COUNTER_BOUND && window.get(j).acked == false){//retransmit this packet\n\t\t\t\treTransmit( j );\n\t\t\t\tSystem.out.println(\"SRSender \"+senderID+\" > \"+\"retransmit< \"+window.get(j).indexS+\", \"+(window.get(j).indexE-1)+\">\");\n\t\t\t}\n\t\t}\n\t\treturn;\n\t}", "private synchronized void startPendingRequests() {\n for (InvocationRequest invocationRequest : pendingRequests) {\n if (!invocationRequest.aborted) {\n ThreadUtil.execute(invocationRequest);\n }\n }\n\n pendingRequests.clear();\n }", "@Test\n public void testConnectionNoIdleTimeout() throws Exception {\n long timeoutMillis = TimeUnit.SECONDS.toMillis(CONNECTION_IDLE_TIMEOUT_SECS) + 500;\n URL url = new URL(resolveURI(\"/v1/timeout/\" + timeoutMillis));\n HttpURLConnection urlConnection = openURL(url);\n Assert.assertEquals(200, urlConnection.getResponseCode());\n urlConnection.disconnect();\n }", "@Override\n\tboolean allow() {\n\t\tlong curTime = System.currentTimeMillis()/1000 * 1000;\n\t\tlong boundary = curTime - 1000;\n\t\tsynchronized (log) {\n\t\t\t//1. Remove old ones before the lower boundary\n\t\t\twhile (!log.isEmpty() && log.element() <= boundary) {\n\t\t\t\tlog.poll();\n\t\t\t}\n\t\t\t//2. Add / log the new time\n\t\t\tlog.add(curTime);\n\t\t\tboolean allow = log.size() <= maxReqPerUnitTime;\n\t\t\tSystem.out.println(curTime + \", log size = \" + log.size()+\", allow=\"+allow);\n\t\t\treturn allow;\n\t\t}\n\t}", "private int cancelSessionTasks(StringBuilder b) {\n int errcount = 0;\n // Stops scheduled tasks if any...\n //\n for (SessionTask task : tasklist) {\n try {\n task.cancel();\n tasklist.remove(task);\n } catch (Exception ex) {\n errcount++;\n append(b,\"\\t\",ex);\n }\n }\n return errcount;\n }", "@Test\n public void testMultipleTimeWindowRetriesBeforeClosingCircuit() {\n try {\n int sleepWindow = 200;\n HystrixCommandProperties.Setter properties = HystrixCommandPropertiesTest.getUnitTestPropertiesSetter().withCircuitBreakerSleepWindowInMilliseconds(sleepWindow);\n HystrixCommandMetrics metrics = getMetrics(properties);\n HystrixCircuitBreaker cb = getCircuitBreaker(key, CommandOwnerForUnitTest.OWNER_TWO, metrics, properties);\n\n // fail\n metrics.markFailure(1000);\n metrics.markFailure(1000);\n metrics.markFailure(1000);\n metrics.markFailure(1000);\n\n // everything has failed in the test window so we should return false now\n assertFalse(cb.allowRequest());\n assertTrue(cb.isOpen());\n\n // wait for sleepWindow to pass\n Thread.sleep(sleepWindow + 50);\n\n // we should now allow 1 request\n assertTrue(cb.allowRequest());\n // but the circuit should still be open\n assertTrue(cb.isOpen());\n // and further requests are still blocked\n assertFalse(cb.allowRequest());\n\n // the 'singleTest' fails so it should go back to sleep and not allow any requests again until another 'singleTest' after the sleep\n metrics.markFailure(1000);\n\n assertFalse(cb.allowRequest());\n assertFalse(cb.allowRequest());\n assertFalse(cb.allowRequest());\n\n // wait for sleepWindow to pass\n Thread.sleep(sleepWindow + 50);\n\n // we should now allow 1 request\n assertTrue(cb.allowRequest());\n // but the circuit should still be open\n assertTrue(cb.isOpen());\n // and further requests are still blocked\n assertFalse(cb.allowRequest());\n\n // the 'singleTest' fails again so it should go back to sleep and not allow any requests again until another 'singleTest' after the sleep\n metrics.markFailure(1000);\n\n assertFalse(cb.allowRequest());\n assertFalse(cb.allowRequest());\n assertFalse(cb.allowRequest());\n\n // wait for sleepWindow to pass\n Thread.sleep(sleepWindow + 50);\n\n // we should now allow 1 request\n assertTrue(cb.allowRequest());\n // but the circuit should still be open\n assertTrue(cb.isOpen());\n // and further requests are still blocked\n assertFalse(cb.allowRequest());\n\n // now it finally succeeds\n metrics.markSuccess(200);\n cb.markSuccess();\n\n // all requests should be open again\n assertTrue(cb.allowRequest());\n assertTrue(cb.allowRequest());\n assertTrue(cb.allowRequest());\n // and the circuit should be closed again\n assertFalse(cb.isOpen());\n\n } catch (Exception e) {\n e.printStackTrace();\n fail(\"Error occurred: \" + e.getMessage());\n }\n }", "private boolean timeout() {\n long time = SystemClock.currentThreadTimeMillis();\n while (bluetoothSync.getState() != BluetoothSync.STATE_CONNECTED) {\n if (SystemClock.currentThreadTimeMillis() > time + Constants.Bluetooth.CONNECTION_TIMEOUT) {\n return false;\n }\n }\n return true;\n }" ]
[ "0.67068845", "0.664599", "0.63177395", "0.6123126", "0.5913352", "0.5763617", "0.5737318", "0.5723898", "0.57087123", "0.5703962", "0.5681989", "0.56729704", "0.563065", "0.5614026", "0.5582999", "0.55037576", "0.5497935", "0.54781383", "0.5451209", "0.54431397", "0.54346097", "0.5432786", "0.5425903", "0.5424092", "0.54186684", "0.540452", "0.5373248", "0.5367084", "0.5347784", "0.5333363", "0.5329517", "0.5321242", "0.5306914", "0.52808", "0.52795494", "0.5267838", "0.5232929", "0.52224725", "0.5222372", "0.5217729", "0.521669", "0.52043426", "0.5203406", "0.5192599", "0.5190689", "0.518713", "0.51633906", "0.51586866", "0.5157948", "0.514682", "0.5126808", "0.51197183", "0.5114293", "0.5105988", "0.5095805", "0.50948447", "0.5092703", "0.50904465", "0.5089521", "0.50842005", "0.50784546", "0.5066509", "0.5065909", "0.50617296", "0.5055238", "0.5045797", "0.5044072", "0.50374955", "0.5035916", "0.5028801", "0.50285006", "0.50257367", "0.50215936", "0.50198406", "0.5011555", "0.500497", "0.500456", "0.50026375", "0.5000377", "0.4999366", "0.49991444", "0.49927688", "0.4985026", "0.49781632", "0.49670115", "0.49526453", "0.49440253", "0.49339417", "0.49330443", "0.49281824", "0.49233696", "0.4922962", "0.492244", "0.4913196", "0.4911272", "0.49034253", "0.49006304", "0.48922458", "0.48887482", "0.48821202" ]
0.7972276
0
reset error flag if we reuse the connection
@Override protected void connectionEstablished() { peer.resetConnectionClosed(); // send our handshake directly as it doesn't fit into peer message // and there is always space in send buffer on new connection //enqueue(pmCache.handshake(torrent.getTorrentId(), torrent.getClientId())); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void error() {\n this.error = true;\n this.clients[0].error();\n this.clients[1].error();\n }", "@Override\n \tpublic void reconnectionFailed(Exception arg0) {\n \t}", "public void resetConnection() {\n\t\ttry {\n\t\t\tconnection.close();\n\t\t\tDriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver());\n\t\t\tconnection = DriverManager.getConnection(url, username, password);\n\t\t} catch(Exception Ex) {\n\t\t\tSystem.out.println(\"Error connecting to database. Machine Error: \" + Ex.toString());\n\t\t\tEx.printStackTrace();\n\t\t\tSystem.out.println(\"\\nCONNECTION IS REQUIRED: EXITING\");\n\t\t\tSystem.exit(0); // No need to make sure connection is closed since it wasn't made\n\t\t}\n\t}", "private void signalError() {\n Connection connection = connectionRef.get();\n if (connection != null && connection.isDefunct()) {\n Host host = cluster.metadata.getHost(connection.address);\n // Host might be null in the case the host has been removed, but it means this has\n // been reported already so it's fine.\n if (host != null) {\n cluster.signalConnectionFailure(host, connection.lastException());\n return;\n }\n }\n\n // If the connection is not defunct, or the host has left, just reconnect manually\n reconnect();\n }", "public native int reEstablishConn() throws IOException,IllegalArgumentException;", "@Override\n \tpublic void reconnectionSuccessful() {\n \t}", "private static void checkConn() {\n try {\n if (conns.isClosed()) conns = Connect.getConnect();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "protected void onConnectionError() {\n\t}", "private void failTheWebSocketConnection() {\n failed = true;\n }", "public void onConnectionError()\n\t\t{\n\t\t}", "@Override\r\n\tpublic void connectionLost(Throwable t) {\n\t}", "private void initErrorState()\n\t{\n\t\tthis.initErrorPath();\n\t\tthis.initErrorLoopCount();\n\t}", "public Boolean tcpReuseConn();", "public void testConnecitonFails() {\n\t\ttry {\n\t\t\t@SuppressWarnings(\"unused\")\n\t\t\tConnection c = new Connection(\"localhost\", 4444, this, this);\n\t\t\t// this connection should fail... wait for that:\n\t\t\tfor (int i=0; i<10; i++) {\n\t\t\t\t// if we have a result before our max-wait-time, break\n\t\t\t\tif (connectionStatus != null)\n\t\t\t\t\tbreak;\n\t\t\t\tThread.sleep(500);\n\t\t\t}\n\t\t\t\n\t\t\tassertTrue(connectionStatus != null && connectionStatus.booleanValue() == false);\n\t\t} catch (Exception e) {\n\t\t\tassertTrue(\"should not get an exception\", false);\n\t\t}\n\t}", "@Override\n public boolean onError(Throwable t) {\n connected.completeExceptionally(t);\n return true; //hints at handler to disconnect due to this error\n }", "@Override\n public void connectionLost(Throwable cause) {\n }", "@Override\n public void connectionLost(Throwable arg0) {\n\n }", "void connectFailed();", "public static void disableConnectionReuseIfNecessary() {\n\t\t// HTTP connection reuse which was buggy pre-froyo\n\t\tif (hasHttpConnectionBug()) {\n\t\t\tSystem.setProperty(\"http.keepAlive\", \"false\");\n\t\t}\n\t}", "public void recycle(SnRpcConnection connection) throws Throwable {\n\t\tif (null != connection) {\n\t\t\tpool.returnObject(connection);\n\t\t}\n\t}", "@Override\r\n\tpublic void connectionLost(Throwable cause) {\n\t\t\r\n\t}", "private int reconnect() {\n if (!isClosed) {\n try {\n if (bootstrap != null) {\n bootstrap.config().group().shutdownGracefully();\n }\n } finally {\n bootstrap = null;\n }\n initBootstrap();\n\n return connectServer();\n }\n return ServiceConstant.CONNECT_STATE_FAILURE;\n }", "@Override\n public void connectionLost(Throwable cause) {\n\n }", "@Test\n public void testResetAndCanRetry() {\n assertTrue(rc.attempt());\n assertTrue(rc.attempt());\n assertTrue(rc.attempt());\n rc.reset();\n\n assertTrue(rc.attempt());\n assertTrue(rc.attempt());\n assertTrue(rc.attempt());\n assertFalse(rc.attempt());\n assertFalse(rc.attempt());\n assertFalse(rc.attempt());\n }", "@Override\n public void connectionLost(Throwable thrwbl) {\n System.out.println(\"服务器的连接丢失\");\n }", "int initConnection(){\n\t\tint status = -1; //the return value. -1 if connection failed, 0 if succeeded\r\n\t\ttry {\r\n\t\t\tconn = dbSource.getConnection();\r\n\t\t\tstatus = 0;\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\tSystem.out.println(\"Error: Could not connect to the tool rental database.\");\r\n\t\t}\r\n\t\treturn status;\r\n\t\t\r\n\t}", "protected void reset() {\n\t\tresetChannel();\n\t\tthis.connection = null;\n\t}", "@Override\n public void onConnectionFailed(ConnectionResult connectionResult) {\n return;\n }", "@Override\n public void connectionLost() {\n }", "public void queryError()\r\n {\r\n myFailedQueryCountProvider.setValue(Integer.valueOf(myFailedQueryCounter.incrementAndGet()));\r\n }", "@Override\n public void clearError() {\n\n }", "@Override\n\tpublic void netErrorReLoad() {\n\t\t\n\t}", "@Override\n\tpublic void netErrorReLoad() {\n\t\t\n\t}", "public void connectionLost(){\n\t\ttry {\n\t\t\tconnect(\"andrewTest\", false, (short) 100);\n\t\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\ttry {\n\t\t\t\tThread.sleep(1000);\n\t\t\t} catch (InterruptedException e1) {\t\t\t\n\t\t\t}\n\t\t\tconnectionLost();\n\t\t\t\n\t\t}\n\t}", "private boolean validateConnection() {\n boolean success = _vcVlsi.testConnection();\n if (!success) {\n _log.log(Level.WARNING, \"Found VC connection dropped; reconnecting\");\n return connect();\n }\n return success;\n }", "public void resetRecentError() throws OXException {\n errorHandler.removeRecentException();\n }", "final void checkEnsure() {\r\n\t\t\r\n\t\ttry {\r\n\t\t\tif (this.conn == null || this.conn.isClosed()) {\r\n\t\t\t\tthis.conn = this.ci.createConnection();\r\n\t\t\t\tthis.databaseType = ConnectionHolder.DT_UNKNOWN;\r\n\t\t\t\tthis.loops = this.ci.connectionMaxLoops();\r\n\t\t\t\tthis.date = System.currentTimeMillis() + this.ci.connectionTimeToLive();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (--this.loops < 0 || this.date < System.currentTimeMillis()) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.conn.close();\r\n\t\t\t\t} catch (final Throwable t) {\r\n\t\t\t\t\t// ignore\r\n\t\t\t\t}\r\n\t\t\t\tthis.conn = this.ci.createConnection();\r\n\t\t\t\tthis.databaseType = ConnectionHolder.DT_UNKNOWN;\r\n\t\t\t\tthis.loops = this.ci.connectionMaxLoops();\r\n\t\t\t\tthis.date = System.currentTimeMillis() + this.ci.connectionTimeToLive();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tif (this.databaseType == ConnectionHolder.DT_UNKNOWN) {\r\n\t\t\t\tthis.databaseType = this.conn.getMetaData().getDatabaseProductName().toUpperCase().indexOf(\"ORACLE\") == -1\r\n\t\t\t\t\t? ConnectionHolder.DT_NORMAL\r\n\t\t\t\t\t: ConnectionHolder.DT_ORACLE;\r\n\t\t\t}\r\n\t\t\ttry (final Statement st = this.conn.createStatement()) {\r\n\t\t\t\t/** Do not use it here, may be unsupported? */\r\n\t\t\t\ttry {\r\n\t\t\t\t\tst.setQueryTimeout(10);\r\n\t\t\t\t} catch (final Throwable t) {\r\n\t\t\t\t\t// ignore\r\n\t\t\t\t}\r\n\t\t\t\tst.execute(\r\n\t\t\t\t\t\tthis.databaseType == ConnectionHolder.DT_ORACLE\r\n\t\t\t\t\t\t\t? \"SELECT 5 FROM DUAL\"\r\n\t\t\t\t\t\t\t: \"SELECT 5\");\r\n\t\t\t}\r\n\t\t} catch (final SQLException e) {\r\n\t\t\tif (this.conn != null) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.conn.close();\r\n\t\t\t\t} catch (final Throwable t) {\r\n\t\t\t\t\t// ignore\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tthis.conn = this.ci.createConnection();\r\n\t\t\tthis.databaseType = ConnectionHolder.DT_UNKNOWN;\r\n\t\t\tthis.loops = this.ci.connectionMaxLoops();\r\n\t\t\tthis.date = System.currentTimeMillis() + this.ci.connectionTimeToLive();\r\n\t\t}\r\n\t}", "void setError();", "@Override\n\t\tpublic boolean wasRetried()\n\t\t{\n\t\t\treturn false;\n\t\t}", "public void reset() {\n this.errorNo = 0;\n this.errorStrings = \"\";\n }", "@Override\n\tpublic void connectionLost(Throwable cause) {\n\t\t\n\t}", "@Override\n public void OnError() {\n bRemoteInitOk = false;\n }", "private void connectionFailed() {\n if (debugging)\n Log.d(TAG, \"connection Failed\");\n setState(EBluetoothStates.DISCONNECTED);\n if (mConnectionManager != null) {\n mConnectionManager.closeSocket();\n }\n }", "protected void connectionClosed() {}", "@Override\r\n public boolean reconnect()\r\n {\n return state.isConnected();\r\n }", "public void OnConnectionError();", "public synchronized boolean isErrored() {\n return error != null;\n }", "ConnectionState( final C conn ) {\n this.connection = conn ;\n\n busyCount = 0 ;\n expectedResponseCount = 0 ;\n reclaimableHandle = null ;\n }", "int closeConnection() {\n\t\tint status = -1; //the return value. -1 if connection failed, 0 if succeeded\r\n\t\ttry {\r\n\t\t\tconn.close();\r\n\t\t\tstatus = 0;\r\n\t\t}\r\n\t\tcatch(Exception e) {\r\n\t\t\tSystem.out.println(\"Error: Could not close the connection to the tool rental database.\");\r\n\t\t}\r\n\t\treturn status;\r\n\t}", "private void closeConnection () {\n setConnection (null);\n }", "public void resetConnectBackoff() {\n try {\n synchronized (this.lock) {\n if (this.state.getState() != ConnectivityState.TRANSIENT_FAILURE) {\n this.syncContext.drain();\n return;\n }\n cancelReconnectTask();\n this.channelLogger.log(ChannelLogger.ChannelLogLevel.INFO, \"CONNECTING; backoff interrupted\");\n gotoNonErrorState(ConnectivityState.CONNECTING);\n startNewTransport();\n this.syncContext.drain();\n }\n } catch (Throwable th) {\n this.syncContext.drain();\n throw th;\n }\n }", "public synchronized void resetLocalConnection() throws IOException\n {\n closeLocalConnection();\n }", "public void makeError(){\n\t\tisError = true;\n\t}", "protected boolean closeOnReadError(Throwable cause) {\n/* 606 */ if (cause instanceof SocketException) {\n/* 607 */ return false;\n/* */ }\n/* 609 */ return super.closeOnReadError(cause);\n/* */ }", "public void resetConnection() {\n connected = new ArrayList<>(50);\n }", "protected boolean closeSessionOnUnrecoverableError() {\n return false;\n }", "@Override\n public void onConnectFailed()\n {\n Log.e(\"Dudu_SDK\",\n \"获取NS 业务服务器失败...onConnectFailed ... reconnect()...5 seconds later ...\");\n reconnect();\n if (connectCallBack != null)\n connectCallBack.onConnectFailed();\n }", "@Override\n protected boolean closeOnReadError(Throwable cause) {\n if (cause instanceof SocketException) {\n return false;\n }\n return super.closeOnReadError(cause);\n }", "@Override\n public void onConnectionFailed(ConnectionResult conRes) {}", "private void closeConnection()\n\t{\n\t\tif(result != null)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tresult.close();\n\t\t\t\tresult = null;\n\t\t\t}\n\t\t\tcatch(Exception ignore){}\n\t\t}\n\t\tif(con != null)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tcon.close();\n\t\t\t\tcon = null;\n\t\t\t}\n\t\t\tcatch(Exception ignore){}\n\t\t}\n\t}", "@Override\n public void onConnectionFailed(ConnectionResult result) {\n }", "@Override\n\t\t\tpublic void onFailure(Throwable caught) {\n\t\t\t\tSC.say(\"服务器连接已中断,请重新登录!\");\n\t\t\t}", "public boolean proceedOnErrors() {\n return false;\n }", "public synchronized void onError(Throwable t) {\n if (!isRetryPending.get()) {\n isRetryPending.set(true);\n connectionCallback.onError(new ConnectionUnavailableException(t));\n }\n }", "public boolean needsConnectionLeftOpen() {\n return false;\n }", "@Override\n\tpublic void reconnect() {\n\n\t}", "public void connectionLost(Throwable cause) {\n\t}", "public final synchronized void restart() {\r\n\t\tunblocked = false;\r\n\t\tcancelled = null;\r\n\t\terror = null;\r\n\t}", "public boolean checkConnected() {\n boolean isClosed = true;\n boolean isValid = false;\n boolean exists = (connection != null);\n\n // If we're waiting for server to recover then leave early\n if (nextReconnectTimestamp > 0 && nextReconnectTimestamp > System.nanoTime()) {\n return false;\n }\n\n if (exists) {\n try {\n isClosed = connection.isClosed();\n }\n catch (SQLException e) {\n isClosed = true;\n e.printStackTrace();\n printErrors(e);\n }\n\n if (!isClosed) {\n try {\n isValid = connection.isValid(VALID_TIMEOUT);\n }\n catch (SQLException e) {\n // Don't print stack trace because it's valid to lose idle connections to the server and have to restart them.\n isValid = false;\n }\n }\n }\n\n // Leave if all ok\n if (exists && !isClosed && isValid) {\n // Housekeeping\n nextReconnectTimestamp = 0;\n reconnectAttempt = 0;\n return true;\n }\n\n // Cleanup after ourselves for GC and MySQL's sake\n if (exists && !isClosed) {\n try {\n connection.close();\n }\n catch (SQLException ex) {\n // This is a housekeeping exercise, ignore errors\n }\n }\n\n // Try to connect again\n connect();\n\n // Leave if connection is good\n try {\n if (connection != null && !connection.isClosed()) {\n // Schedule a database save if we really had an outage\n if (reconnectAttempt > 1) {\n new SQLReconnectTask().runTaskLater(Assassin.p, 5);\n }\n nextReconnectTimestamp = 0;\n reconnectAttempt = 0;\n return true;\n }\n }\n catch (SQLException e) {\n // Failed to check isClosed, so presume connection is bad and attempt later\n e.printStackTrace();\n printErrors(e);\n }\n\n reconnectAttempt++;\n nextReconnectTimestamp = (long) (System.nanoTime() + Math.min(MAX_WAIT, (reconnectAttempt * SCALING_FACTOR * MIN_WAIT)));\n return false;\n }", "@Override\n public boolean init()\n {\n \tFile file = new File(\"err.txt\");\n\t\tFileOutputStream fos;\n\t\ttry {\n\t\t\tfos = new FileOutputStream(file);\n\t\t\tPrintStream ps = new PrintStream(fos);\n\t\t\tSystem.setErr(ps);\n\t\t} catch (FileNotFoundException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n if (connected)\n {\n System.out.println(\"Client connection already initialized.\");\n return true;\n }\n properties = getProperties();\n String driver = properties.getProperty(DRIVER_CLASS, DRIVER_CLASS_DEFAULT);\n String url = properties.getProperty(CONNECTION_URL, CONNECTION_URL_DEFAULT);\n String user = properties.getProperty(CONNECTION_USER, CONNECTION_USER_DEFAULT);\n String passwd = properties.getProperty(CONNECTION_PASSWD, CONNECTION_PASSWD_DEFAULT);\n try\n {\n if (driver != null)\n {\n Class.forName(driver);\n }\n connection = DriverManager.getConnection(url, user, passwd);\n System.out.println(\"Connection established successfully!\");\n connected = true;\n newCachedStatements = new ConcurrentHashMap<>();\n return true;\n }\n catch (ClassNotFoundException | SQLException ex)\n {\n Logger.getLogger(WindowsAzureClientInit.class.getName()).log(Level.SEVERE, null, ex);\n System.out.println(\"Error in creating a connection with the database!\");\n return false;\n }\n }", "public void rollback() {\n\t\ttry {\n\t\t\tif (conn != null) {\n\t\t\t\tconn.rollback();\n\t\t\t}\n\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"接続エラーが発生しました/Connection Rollback Error Occured\");\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "void checkClosed() throws SQLException {\n\n if (result == null) { throw Message.getSQLException(ErrorCode.OBJECT_CLOSED); }\n if (stat != null) {\n stat.checkClosed();\n }\n if (conn != null) {\n conn.checkClosed();\n }\n }", "@Override\n\t\tpublic boolean isRetry() { return false; }", "protected boolean continueOnWriteError() {\n/* 348 */ return true;\n/* */ }", "public boolean isReuseAddress()\r\n/* 159: */ {\r\n/* 160: */ try\r\n/* 161: */ {\r\n/* 162:176 */ return this.javaSocket.getReuseAddress();\r\n/* 163: */ }\r\n/* 164: */ catch (SocketException e)\r\n/* 165: */ {\r\n/* 166:178 */ throw new ChannelException(e);\r\n/* 167: */ }\r\n/* 168: */ }", "private void ensureConnectionRelease() {\n if (responseConnection != null) {\n responseConnection.releaseConnection();\n responseConnection = null;\n }\n }", "@Override\n protected void onActivityResult(\n int requestCode, int resultCode, Intent data) {\n // Decide what to do based on the original request code\n switch (requestCode) {\n case CONNECTION_FAILURE_RESOLUTION_REQUEST :\n /*\n * If the result code is Activity.RESULT_OK, try\n * to connect again\n */\n switch (resultCode) {\n case Activity.RESULT_OK :\n /*\n * Try the request again?\n */\n\n break;\n }\n }\n }", "public static void error()\r\n {\r\n valid=false;\r\n\r\n }", "private void checkClosedResultSet() {\n if(closed) {\n throw new IllegalStateException(\"Resultset is already closed\");\n }\n }", "private synchronized void closeConnection() {\n/* 212 */ if (this.conn != null) {\n/* 213 */ this.log.debug(\"Closing connection\");\n/* */ try {\n/* 215 */ this.conn.close();\n/* 216 */ } catch (IOException iox) {\n/* 217 */ if (this.log.isDebugEnabled()) {\n/* 218 */ this.log.debug(\"I/O exception closing connection\", iox);\n/* */ }\n/* */ } \n/* 221 */ this.conn = null;\n/* */ } \n/* */ }", "protected void connectionException(Exception exception) {}", "public static boolean testConn() {\r\n\t\tboolean bool = false;\r\n\t\ttry (Connection conn = DataSource.getConnection()) {\r\n\t\t\tbool = conn.isValid(0);\r\n\t\t\tif (bool == true){\r\n\t\t\t\tdbStatus = \"ONLINE\";\r\n\t\t\t}\r\n\t\t\telse dbStatus = \"OFFLINE\";\r\n\t\t} catch (SQLException e) {\r\n\t\t\tSystem.out.println(e);\r\n\t\t}\r\n\t\treturn bool;\r\n\t}", "private void connectionLost() {\n Log.d(TAG, \"BluetoothManager :: connectionLost()\");\n setState(STATE_LISTEN); //추가됨\n\n // Send a failure message back to the Activity\n // WARNING: This makes too many toast.\n //이것도 어차피 연결잃었다고하는거 알려주는거라 안해도 상관 없다.\n /*\n Message msg = mHandler.obtainMessage(MESSAGE_TOAST);\n Bundle bundle = new Bundle();\n bundle.putString(SERVICE_HANDLER_MSG_KEY_TOAST, \"연결되있던장치와 연결을 잃었어요\");\n msg.setData(bundle);\n mHandler.sendMessage(msg);\n */\n // Reserve re-connect timer\n reserveRetryConnect(); //수정됨\n }", "@Override\n\tprotected void finalize() throws Throwable {\n\t\t\n\t\tif (this.connection != null) {\n\t\t\tthis.connection.close();\t\t\n\t\t}\n\t\tsuper.finalize();\n\t}", "@Override\n protected boolean continueOnWriteError() {\n return true;\n }", "private void connectionFailed() {\n // Send a failure message back to the Activity\n Message msg = handler.obtainMessage(SdlRouterService.MESSAGE_LOG);\n Bundle bundle = new Bundle();\n bundle.putString(LOG, \"Unable to connect device\");\n msg.setData(bundle);\n handler.sendMessage(msg);\n\n // Start the service over to restart listening mode\n // BluetoothSerialServer.this.start();\n }", "@Override\n\t\t\tpublic void connectionLost(Throwable throwable) {\n\t\t\t\tSystem.out.println(\"connectionLost\");\n\t\t\t}", "public void clearErrorCount() {\n\t\terrorCount = 0;\n\t}", "public void connectionFailed() {\n\t\tlogin.setEnabled(true);\n\t\t// logout.setEnabled(false);\n\t\t// label.setText(\"Enter your username below\");\n\t\tun.setText(\"Anonymous\");\n\t\t// reset port number and host name as a construction time\n\t\ttfPort.setText(\"\" + defaultPort);\n\t\ttfServer.setText(defaultHost);\n\t\t// let the user change them\n\t\ttfServer.setEditable(false);\n\t\ttfPort.setEditable(false);\n\t\t// don't react to a <CR> after the username\n\t\tun.removeActionListener(this);\n\t\tconnected = false;\n\t}", "private static void disableConnectionReuseIfNecessary() {\n\t if (Integer.parseInt(Build.VERSION.SDK) < Build.VERSION_CODES.FROYO) {\n\t System.setProperty(\"http.keepAlive\", \"false\");\n\t }\n\t}", "@Override\n public void setConnectionStatus( int status )\n {\n }", "public void tidyConnection(Connection conn, Statement sp_stmt, ResultSet rs)\r\n throws MapflowAppException {\n if (rs != null) {\r\n try {\r\n rs.close();\r\n }\r\n catch (final SQLException sqe) {\r\n // logger.info(\"Unexpected exception closing rs: \"+\r\n // sqe.toString() + \", sqlstate = \" + sqe.getSQLState());\r\n // do nothing as this is tidy up\r\n // could do a sysout of the code...\r\n }\r\n rs = null;\r\n }\r\n if (sp_stmt != null) {\r\n try {\r\n sp_stmt.close();\r\n }\r\n catch (final SQLException sqe) {\r\n // logger.info(\"Unexpected exception closing rs: \"+\r\n // sqe.toString() + \", sqlstate = \" + sqe.getSQLState());\r\n // do nothing as this is tidy up\r\n // could do a sysout of the code...\r\n }\r\n sp_stmt = null;\r\n }\r\n if (conn != null) {\r\n try {\r\n conn.close();\r\n }\r\n catch (final SQLException sqe) {\r\n // logger.info(\"Unexpected exception closing rs: \"+\r\n // sqe.toString() + \", sqlstate = \" + sqe.getSQLState());\r\n // do nothing as this is tidy up\r\n // could do a sysout of the code...\r\n }\r\n conn = null;\r\n }\r\n }", "@Override\n public void onConnectionFailed(ConnectionResult result) {\n }", "@Override\n public void cleanup(boolean warmup)\n {\n try\n {\n connection.close();\n System.out.println(\"Connection closed successfully!\");\n }\n catch (SQLException ex)\n {\n Logger.getLogger(WindowsAzureClientInit.class.getName()).log(Level.SEVERE, null, ex);\n System.out.println(\"Error in closing connection!\");\n }\n }", "private void close() {\n\t\ttry {\n\t\t\tif (conn != null) {\n\t\t\t\tconn.close();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tlog(e);\n\t\t} finally {\n\t\t\tisConnected = false;\n\t\t}\n\t}", "protected void initError(String message, COMMAND command) {\t\n\t String id = (command != null ? command.getId() : \"no-command\");\t \n\t \n\t COMMAND_DONE done = new COMMAND_DONE(id);\n\t done.setSuccessful(false);\n\t done.setErrorNum(SERVER_INITIALIZATION_ERROR);\n\t done.setErrorString(\"Command: [\"+id+\"]: CAMP::\"+message);\n\t \n\t try { \t\n\t\tif (connection != null)\n\t\t connection.send(done); \n\t } catch (IOException e) {\n\t\tlogger.log(1,CLASS, \"-\", \"impl\",\n\t\t\t \"Failed to send error: \"+e);\n\t }\n\t \n\t if (handler != null)\n\t\thandler.dispose();\n\t if (connection != null)\n\t\tconnection.close();\n\t connection = null;\n\t command = null;\n\t \n\t}", "public void fail() {\n _siteStatus = false;\n _lockTable.clear();\n _accessedTransactions.clear();\n _uncommitDataMap.clear();\n _lastFailTime = _tm.getCurrentTime();\n }", "@Override\n\t\tpublic boolean isRetry() { return true; }", "private DataSource() {\n Connection tmpConn = null;\n while(tmpConn == null) {\n try {\n tmpConn = DriverManager.getConnection(CONNECTION_STRING);\n } catch(SQLException e) {\n print(\"Couldn't connect to \" + DB_NAME + \" database: \" + e.getMessage());\n print(\"Trying again in three seconds...\");\n try {\n Thread.sleep(3000);\n } catch(InterruptedException ie) {}\n }\n }\n conn = tmpConn;\n }", "private static boolean isNetworkProblem(Object error) {\r\n\t\treturn (error instanceof IOException);\r\n\t}", "private static void disableConnectionReuseIfNecessary() {\n if (Build.VERSION.SDK_INT < Build.VERSION_CODES.FROYO) {\n System.setProperty(\"http.keepAlive\", \"false\");\n }\n }" ]
[ "0.6903906", "0.6502599", "0.6393532", "0.63781613", "0.6205838", "0.61189324", "0.6099259", "0.5991837", "0.5948254", "0.58768636", "0.5820772", "0.58097684", "0.57958144", "0.5785618", "0.5785375", "0.5740341", "0.5683237", "0.5673974", "0.56631565", "0.5660167", "0.56542766", "0.5639453", "0.5624767", "0.5614642", "0.5610888", "0.56107855", "0.55936927", "0.5586235", "0.5576839", "0.5570922", "0.5569513", "0.5558066", "0.5558066", "0.5547529", "0.5536618", "0.55232584", "0.5521837", "0.55153364", "0.5512806", "0.5511219", "0.5489749", "0.54806435", "0.5478955", "0.5451128", "0.54449886", "0.5438918", "0.5431189", "0.54286075", "0.54234797", "0.542244", "0.5406911", "0.54011005", "0.5400635", "0.5398194", "0.53761333", "0.53712535", "0.53707117", "0.5369307", "0.53660643", "0.53625053", "0.5360099", "0.5353827", "0.5346786", "0.5338971", "0.5337789", "0.53369343", "0.53359944", "0.5326007", "0.5319438", "0.531882", "0.5318546", "0.5313452", "0.5312578", "0.530405", "0.53038675", "0.53009754", "0.52978987", "0.52959704", "0.52841175", "0.5279074", "0.5277995", "0.5265978", "0.5264781", "0.5253057", "0.52521086", "0.5250806", "0.5241862", "0.52406937", "0.5237884", "0.52335167", "0.52311283", "0.52310646", "0.5230059", "0.5229453", "0.52231616", "0.5218448", "0.52096736", "0.5207648", "0.5207012", "0.5206818", "0.5203671" ]
0.0
-1
the 1st message must be bitfield, but only in case if we have at least one block
@Override protected void handshakeCompleted() { if (0 < torrent.pieces.cardinality()) { enqueue(pmCache.bitfield((int)torrent.metainfo.pieces, torrent.pieces)); } /* todo if (client.node != null) { pc.enqueue(StdPeerMessage.port(client.node.port)); } */ }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean isThisType(byte[] block) {\n return block.length >= 8 && block[0] == 0 && block[1] == 0 &&\n block[2] == -1 && block[3] == -1 && block[4] == 105 &&\n block[5] == 109 && block[6] == 112 && block[7] == 114;\n }", "public MessageBitSection next();", "@Test\n void testFirstBlock() throws Exception {\n HMEFMessage msg;\n try (InputStream is = _samples.openResourceAsStream(\"quick-winmail.dat\")) {\n msg = new HMEFMessage(is);\n }\n\n MAPIAttribute attr = msg.getMessageMAPIAttribute(MAPIProperty.RTF_COMPRESSED);\n assertNotNull(attr);\n MAPIRtfAttribute rtfAttr = (MAPIRtfAttribute) attr;\n\n // Truncate to header + flag + data for flag\n byte[] data = Arrays.copyOf(rtfAttr.getRawData(), 16 + 12);\n\n // Decompress it\n CompressedRTF comp = new CompressedRTF();\n byte[] decomp = comp.decompress(new ByteArrayInputStream(data));\n String decompStr = new String(decomp, StandardCharsets.US_ASCII);\n\n // Test\n assertEquals(block1.length(), decomp.length);\n assertEquals(block1, decompStr);\n }", "private void sendBitfield() throws IOException{\r\n\t\tbyte[]bitfield=new byte[this.torrentClient.getNumberOfPieces()];\r\n\t\tFragmentsInformation fi=this.torrentClient.getFragmentsInformation();\r\n\t\t//IF the fragment information is null or the current fragment is -1 it means that I have all the pieces\r\n\t\tif(fi==null||fi.getCurrentFragment()==-1){\r\n\t\t\tfor(int i=0,ii=bitfield.length;i<ii;i++){\r\n\t\t\t\tbitfield[i]=1;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t//we only have some pieces\r\n\t\t\tint lastFragment=this.torrentClient.getFragmentsInformation().getCurrentFragment();\r\n\t\t\tint i=0;\r\n\t\t\t\r\n\t\t\tfor(;i<lastFragment;i++){\r\n\t\t\t\tbitfield[i]=1;\r\n\t\t\t}\r\n\t\t\tfor(int ii=bitfield.length;i<ii;i++){\r\n\t\t\t\tbitfield[i]=0;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tBitfieldMsg message= new BitfieldMsg(bitfield);\r\n\t\tthis.outputStream.write(message.getBytes());\r\n\t}", "public boolean hasField1() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasField1() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "@Override\n\tpublic void visit(BitField bf) {\n\t\tSystem.out.println(\"process bitfield\");\n\t\tpieces = new ArrayList<Integer>();\n\t\tbyte[] body = bf.getBody();\n\t\t// boucle afficher body\n\t\t/*\n\t\t * byte b, mask2 = 0x01; for (int i = 0; i < body.length; i++) { b =\n\t\t * body[i]; for (int j = 0; j < 8; j++) { if ((b & mask2) == 0) {\n\t\t * System.out.println(0); } else { System.out.println(1); } } }\n\t\t */\n\t\t// boucle afficher body\n\t\tint mask;\n\t\tfor (int i = 0; i < body.length; i++) {\n\t\t\tmask = body[i];\n\t\t\tfor (int j = 0; j < 8; j++) {\n\t\t\t\tif ((mask & 0x80) != 0) {\n\t\t\t\t\tpieces.add(j + (i * 8));\n\t\t\t\t}\n\t\t\t\tmask = mask << 1;\n\t\t\t}\n\t\t}\n\t\tph.setPeerPieces(pieces);\n\t\tSystem.out.println(pieces.size());\n\t\t// for(Integer i : pieces) {\n\t\t// System.out.println(\"bitfield : \" + i);\n\t\t// }\n\t\tSystem.out.println(\"taille bitfield : \" + pieces.size());\n\t}", "boolean hasNewBlock();", "boolean hasNewBlock();", "public boolean hasMsgType() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasNewBlock() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "@java.lang.Override\n public boolean hasReceivingMajorFragmentId() {\n return ((bitField0_ & 0x00000002) != 0);\n }", "@Test\n\tpublic void testFastBitfieldMessage() throws Exception {\n\n\t\t// Given\n\t\tfinal PieceDatabase pieceDatabase = MockPieceDatabase.create (\"00000\", 16384);\n\t\tBitField wantedPieces = pieceDatabase.getPresentPieces().not();\n\t\tpieceDatabase.start (true);\n\t\tPeerServices peerServices = mock (PeerServices.class);\n\t\tPeerSetContext peerSetContext = new PeerSetContext (peerServices, pieceDatabase, mock (RequestManager.class), null);\n\t\twhen(peerSetContext.requestManager.piecesAvailable (any (ManageablePeer.class))).thenReturn (true);\n\t\twhen(peerSetContext.requestManager.allocateRequests (any (ManageablePeer.class), anyInt(), eq (false))).thenReturn (new ArrayList<BlockDescriptor>());\n\t\tMockConnection mockConnection = new MockConnection();\n\t\tPeerHandler handler = new PeerHandler (peerSetContext, mockConnection, new PeerID(), new PeerStatistics(), true, false);\n\n\t\t// When\n\t\tmockConnection.mockInput (PeerProtocolBuilder.bitfieldMessage (wantedPieces));\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.haveNoneMessage());\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (0));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (1));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (2));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (3));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (4));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.interestedMessage());\n\t\tmockConnection.mockExpectNoMoreOutput();\n\t\tassertTrue (mockConnection.isOpen());\n\n\n\t\tpieceDatabase.terminate (true);\n\n\t}", "public boolean hasNewBlock() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "@java.lang.Override\n public boolean hasReceivingMajorFragmentId() {\n return ((bitField0_ & 0x00000002) != 0);\n }", "void onBitField(BitSet mask)\n {\n // BITFIELD only allowed once\n if (bitfieldReceived) {\n if (DEBUG) System.out.println(peer.address + \" second bitfield message received, dropping the connection\");\n close(Peer.CloseReason.PROTOCOL_ERROR);\n return;\n }\n\n peerPieces.clear();\n peerPieces.or(mask);\n\n // update linked peer with completion status\n if (peerPieces.cardinality() == torrent.getMetainfo().pieces) {\n peer.setCompleted(true);\n }\n\n bitfieldReceived = true;\n }", "public boolean hasMsgType() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "private Boolean validateRequest() {\n\t\tint cell = 2;\n\t\t\n\t\t// If the length is over max_buffer bytes, the message is too long.\n\t\tif (receivePacket.getLength() > TFTPCommons.max_buffer) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// If the first two bytes aren't 0 1 or 0 2, then the message is malformed.\n\t\tif ((receiveData[0] != 0) | !((receiveData[1] == 1) | (receiveData[1] == 2))) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t// Note which cell we're at now.\n\t\tint prev_cell = cell;\n\t\t\n\t\t// Fast-forward through the text to the first separator 0.\n\t\twhile (true) {\n\t\t\t// If cell equals length, the message is invalid,\n\t\t\t// likely because it was malformed.\n\t\t\tif (cell == receivePacket.getLength()) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t// If this is the first separator 0, break loop and go to next cell\n\t\t\t// Unless the first separator zero is the cell we started at,\n\t\t\t// then the message is invalid\n\t\t\tif (receiveData[cell] == 0) {\n\t\t\t\tif (cell == prev_cell) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tcell++;\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\t// Otherwise, go to next cell\n\t\t\t\tcell++;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Note which cell we're at now.\n\t\tprev_cell = cell;\n\t\t\t\t\n\t\t// Fast-forward through the text to the second separator 0.\n\t\twhile (true) {\n\t\t\t// If cell equals length, the message is invalid,\n\t\t\t// likely because it was malformed.\n\t\t\tif (cell == receivePacket.getLength()) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t\n\t\t\t// If this is the second separator 0, break loop and go to next cell.\n\t\t\t// Unless the first separator zero is the cell we started at,\n\t\t\t// then the message is invalid\n\t\t\tif (receiveData[cell] == 0) {\n\t\t\t\tif (cell == prev_cell) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tcell++;\n\t\t\t\tbreak;\n\t\t\t} else {\n\t\t\t\t// Otherwise, go to next cell\n\t\t\t\tcell++;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// At this point, we should have covered the whole message,\n\t\t// Unless it is malformed.\n\t\tif (cell == receivePacket.getLength()) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}", "private boolean isFull() {\n\t\treturn nbmsg==getSize();\n\t}", "public Message respondWithBitfield(Handshake hs) {\n \tBitSet bitfield = fileSupervisor.partsWithPeer();\n \tif(!bitfield.isEmpty())\n \t\treturn(new BitField(bitfield.toByteArray()));\n \telse\n \t\treturn null;\n }", "boolean hasBlockNumber();", "boolean hasBlockNumber();", "@Override\n\tpublic int getBlockNum() {\n\t\treturn 0;\n\t}", "protected abstract boolean processFirstFrameOfLargeMessage(IntactFrame frame, Limit endpointReserve, Limit globalReserve) throws IOException;", "@java.lang.Override\n public boolean hasSendingMajorFragmentId() {\n return ((bitField0_ & 0x00000004) != 0);\n }", "@Test\n public void bitfieldOperations() throws Exception {\n assumeThat(getEnv().serverVersion[0], is(greaterThanOrEqualTo(3)));\n\n awaitIndefinitely(commandClient.del(key(\"bf\")));\n\n List<Long> results = awaitIndefinitely(commandClient.bitfield(key(\"bf\"), asList(new Incrby(I05, 100L, 1L), new Get(U04, 0L))));\n assertThat(results, contains(1L, 0L));\n\n results.clear();\n for (int i = 0; i < 4; i++) {\n results.addAll(awaitIndefinitely(commandClient.bitfield(key(\"bf\"), asList(\n new Incrby(U02, 100L, 1L),\n new Overflow(SAT),\n new Incrby(U02, 102L, 1L)))));\n }\n assertThat(results, contains(1L, 1L, 2L, 2L, 3L, 3L, 0L, 3L));\n\n results = awaitIndefinitely(commandClient.bitfield(key(\"bf\"), asList(new Overflow(FAIL), new Incrby(U02, 102L, 1L))));\n assertThat(results, contains(nullValue()));\n\n awaitIndefinitely(commandClient.del(key(\"bf\")));\n\n // bitfield doesn't support non-numeric offsets (which are used for bitsize-based offsets)\n // but it's possible to get the same behaviour by using the bit size provided by the type enum,\n // ie. the following is equivalent to:\n // BITFIELD <key> SET u8 #2 200 GET u8 #2 GET u4 #4 GET u4 #5\n results = awaitIndefinitely(commandClient.bitfield(key(\"bf\"), asList(\n new Set(U08, U08.getBitSize() * 2, 200L),\n new Get(U08, U08.getBitSize() * 2),\n new Get(U04, U04.getBitSize() * 4),\n new Get(U04, U04.getBitSize() * 5))));\n assertThat(results, contains(0L, 200L, 12L, 8L));\n }", "public boolean hasNewBlock() {\n return ((bitField0_ & 0x00200000) == 0x00200000);\n }", "@Test\n void testFirstTwoBlocks() throws Exception {\n HMEFMessage msg;\n try (InputStream is = _samples.openResourceAsStream(\"quick-winmail.dat\")) {\n msg = new HMEFMessage(is);\n }\n\n MAPIAttribute attr = msg.getMessageMAPIAttribute(MAPIProperty.RTF_COMPRESSED);\n assertNotNull(attr);\n MAPIRtfAttribute rtfAttr = (MAPIRtfAttribute) attr;\n\n // Truncate to header + flag + data for flag + flag + data\n byte[] data = Arrays.copyOf(rtfAttr.getRawData(), 16 + 12 + 13);\n\n // Decompress it\n CompressedRTF comp = new CompressedRTF();\n byte[] decomp = comp.decompress(new ByteArrayInputStream(data));\n String decompStr = new String(decomp, StandardCharsets.US_ASCII);\n\n // Test\n assertEquals(block2, decompStr);\n }", "private final boolean checkHeader(int paramInt) {\n/* 406 */ if (paramInt != 1416784229) {\n/* 407 */ return false;\n/* */ }\n/* */ \n/* 410 */ if ((this.m_options_ & 0xF) != 5 || (this.m_options_ >> 4 & 0xF) != 2)\n/* */ {\n/* */ \n/* */ \n/* */ \n/* 415 */ return false;\n/* */ }\n/* 417 */ return true;\n/* */ }", "boolean verify(List<ChunkDescriptor> chunks, LocalBitfield bitfield);", "boolean hasBlockInfo();", "boolean hasBlockInfo();", "@java.lang.Override\n public boolean hasSendingMajorFragmentId() {\n return ((bitField0_ & 0x00000008) != 0);\n }", "public boolean hasData1() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasData1() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasNewBlock() {\n return ((bitField0_ & 0x00200000) == 0x00200000);\n }", "public boolean hasData1() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasData1() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "boolean hasMessageType();", "@java.lang.Override\n public boolean hasSendingMinorFragmentId() {\n return ((bitField0_ & 0x00000010) != 0);\n }", "public boolean check_upto_n(int packno) \n { \n for (int i=0; i<packno; i++) \n if (!(boolean)sentPackets[i].get(2)) \n return false; \n return true; \n }", "@java.lang.Override\n public boolean hasSendingMinorFragmentId() {\n return ((bitField0_ & 0x00000008) != 0);\n }", "public boolean hasBlockInfo() {\n return ((bitField0_ & 0x00000010) == 0x00000010);\n }", "public boolean hasBlockInfo() {\n return ((bitField0_ & 0x00000010) == 0x00000010);\n }", "public boolean hasUnknown1() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasUnknown1() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "void send(StrictBitVector messageZero, StrictBitVector messageOne);", "public boolean hasBlockNumber() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasBlockNumber() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasUnknown1() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasUnknown1() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasUnknown1() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasUnknown1() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasBlockNumber() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasBlockNumber() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "private boolean isEmpty(int frameNo){\n int bit = frameNo/32;\n int mask = frameNo%32;\n int test = bitMap[bit] & MASK[mask];\n return test==0;\n }", "public boolean hasBlockInfo() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "@Test\n\tpublic void testFastHandshakePeerIDBitfield() throws Exception {\n\n\t\t// Given\n\t\tPieceDatabase pieceDatabase = MockPieceDatabase.create (\"10\", 16384);\n\t\tpieceDatabase.start (true);\n\t\tBitField wantedPieces = pieceDatabase.getPresentPieces().not();\n\t\tPeerServices peerServices = mock (PeerServices.class);\n\t\tPeerSetContext peerSetContext = new PeerSetContext (peerServices, pieceDatabase, mock (RequestManager.class), null);\n\t\twhen(peerSetContext.requestManager.piecesAvailable (any (ManageablePeer.class))).thenReturn (false);\n\t\tMockConnection mockConnection = new MockConnection();\n\t\tPeerHandler handler = new PeerHandler (peerSetContext, mockConnection, new PeerID(), new PeerStatistics(), true, false);\n\n\t\t// When\n\t\tmockConnection.mockInput (PeerProtocolBuilder.bitfieldMessage (wantedPieces));\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.bitfieldMessage (pieceDatabase.getPresentPieces()));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (0));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (1));\n\t\tmockConnection.mockExpectNoMoreOutput();\n\n\n\t\tpieceDatabase.terminate (true);\n\n\t}", "@Override\n public TransferMode startBlock(Block block) {\n if (block.type == 1) {\n // return SIMPLE mode to received the payload as \"payload()\" calls\n return TransferMode.SIMPLE;\n } else {\n // return NULL to discard the payload of this block\n return TransferMode.NULL;\n }\n }", "public boolean hasBlockInfo() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "@Test\n public void testSingleBlock()\n {\n BlockMetadata.FileBlockMetadata block = new BlockMetadata.FileBlockMetadata(s3Directory + FILE_1, 0L, 0L,\n testMeta.dataFile.length(), true, -1, testMeta.dataFile.length());\n\n testMeta.blockReader.beginWindow(1);\n testMeta.blockReader.blocksMetadataInput.process(block);\n testMeta.blockReader.endWindow();\n\n List<Object> actualMessages = testMeta.messageSink.collectedTuples;\n Assert.assertEquals(\"No of records\", testMeta.messages.size(), actualMessages.size());\n\n for (int i = 0; i < actualMessages.size(); i++) {\n byte[] msg = (byte[])actualMessages.get(i);\n Assert.assertTrue(\"line \" + i, Arrays.equals(new String(msg).split(\",\"), testMeta.messages.get(i)));\n }\n }", "public boolean hasNum1() {\r\n\t\t\t\treturn ((bitField0_ & 0x00000002) == 0x00000002);\r\n\t\t\t}", "boolean canBuildBlock(Tile t);", "BAnyBlock createBAnyBlock();", "@java.lang.Override\n public boolean hasB() {\n return ((bitField0_ & 0x00000002) != 0);\n }", "com.randomm.server.ProtoBufMessage.Message.InputType getType();", "public boolean hasUnknown1() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasUnknown1() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasUnknown1() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasUnknown1() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasNum1() {\r\n\t\t\treturn ((bitField0_ & 0x00000002) == 0x00000002);\r\n\t\t}", "@Override\n\tpublic boolean supportsPartialMessages() {\n\t\treturn false;\n\t}", "public boolean hasUnknown1() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "public boolean hasUnknown1() {\n return ((bitField0_ & 0x00000001) == 0x00000001);\n }", "@java.lang.Override\n public boolean hasB() {\n return ((bitField0_ & 0x00000002) != 0);\n }", "private boolean processFrameOfContainedMessages(ShareableBytes bytes, Limit endpointReserve, Limit globalReserve) throws IOException\n {\n while (bytes.hasRemaining())\n if (!processOneContainedMessage(bytes, endpointReserve, globalReserve))\n return false;\n return true;\n }", "@Override public byte isBitShape(Type t) { throw AA.unimpl(); }", "int getOneof1305();", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000010) == 0x00000010);\n }", "private boolean isComplete() {\n for (boolean b : bitfield) {\n if (!b) {\n return false;\n }\n }\n return true;\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "private void m60366e(C15937b c15937b, int i, byte b, int i2) throws IOException {\n if (i2 != 0) {\n throw C15933c.m60314b(\"TYPE_SETTINGS streamId != 0\", new Object[0]);\n } else if ((b & (byte) 1) != (byte) 0) {\n if (i != 0) {\n throw C15933c.m60314b(\"FRAME_SIZE_ERROR ack frame should be empty!\", new Object[0]);\n }\n c15937b.mo13368a();\n } else if (i % 6 != (byte) 0) {\n throw C15933c.m60314b(\"TYPE_SETTINGS length %% 6 != 0: %s\", new Object[]{Integer.valueOf(i)});\n } else {\n C15943j c15943j = new C15943j();\n for (int i3 = 0; i3 < i; i3 += 6) {\n int readShort = this.f49425c.readShort() & 65535;\n int readInt = this.f49425c.readInt();\n switch (readShort) {\n case 1:\n case 6:\n break;\n case 2:\n if (!(readInt == 0 || readInt == 1)) {\n throw C15933c.m60314b(\"PROTOCOL_ERROR SETTINGS_ENABLE_PUSH != 0 or 1\", new Object[0]);\n }\n case 3:\n readShort = 4;\n break;\n case 4:\n readShort = 7;\n if (readInt >= 0) {\n break;\n }\n throw C15933c.m60314b(\"PROTOCOL_ERROR SETTINGS_INITIAL_WINDOW_SIZE > 2^31 - 1\", new Object[0]);\n case 5:\n if (readInt >= 16384 && readInt <= 16777215) {\n break;\n }\n throw C15933c.m60314b(\"PROTOCOL_ERROR SETTINGS_MAX_FRAME_SIZE: %s\", new Object[]{Integer.valueOf(readInt)});\n break;\n default:\n break;\n }\n c15943j.m60415a(readShort, readInt);\n }\n c15937b.mo13377a(false, c15943j);\n }\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "private boolean haveMBPattern()\n {\n return ((mbType & PATTERN) !=0 );\n }", "@Override\r\n\tpublic boolean supportsPartialMessages() {\n\t\treturn super.supportsPartialMessages();\r\n\t}", "private Union parseBitFields(StringBuffer buffer) {\n\t\t//NOTE:\n\t\t//Ghidra does not support bit fields, so we\n\t\t//simulate it by creating a union of the bit fields.\n\t\t//\n\t\tUnion bitFieldUnion =\n\t\t\tnew UnionDataType(getUniqueAnonymousTypeName(AnonymousTypes.BIT_FIELD_UNION));\n\t\ttry {\n\t\t\tbitFieldUnion.setCategoryPath(categoryPath);\n\t\t}\n\t\tcatch (DuplicateNameException e) {\n\t\t}\n\n\t\tList<String> names = new ArrayList<String>();\n\t\tint defaultFieldNameIndex = 0;\n\n\t\tint totalBits = 0;\n\n\t\twhile (true) {\n\t\t\tString name = parseQuotedName(buffer);\n\t\t\tif (buffer.charAt(0) != _C_BFLD) {\n\t\t\t\treinsertName(buffer, name);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif (name == null) {\n\t\t\t\tname = \"bitField\" + (defaultFieldNameIndex++);\n\t\t\t}\n\t\t\tbuffer.deleteCharAt(0);//_C_BFLD\n\t\t\tint nBits = parseNumber(buffer);\n\t\t\tnames.add(name + \"_\" + nBits);\n\t\t\ttotalBits += nBits;\n\t\t}\n\n\t\tDataType dt = getBitFieldDataType(totalBits);\n\t\ttry {\n\t\t\tdt.setCategoryPath(categoryPath);\n\t\t}\n\t\tcatch (DuplicateNameException e) {\n\t\t}\n\n\t\tfor (String name : names) {\n\t\t\tbitFieldUnion.add(dt, name, null);\n\t\t}\n\t\treturn bitFieldUnion;\n\t}", "int getOneof1072();", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000010) == 0x00000010);\n }", "public boolean hasMsg() {\n return ((bitField0_ & 0x00000020) == 0x00000020);\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public static int limitToValidMetadata(int par0)\n {\n return par0 & 1;\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMessage() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }", "public boolean hasMsgData() {\n return ((bitField0_ & 0x00000002) == 0x00000002);\n }" ]
[ "0.5915237", "0.57834727", "0.5782373", "0.57256585", "0.5718095", "0.5716901", "0.57113737", "0.5670141", "0.5670141", "0.5645189", "0.56437665", "0.5640291", "0.5629207", "0.5601698", "0.5577658", "0.5565123", "0.55538213", "0.547194", "0.54683846", "0.5415004", "0.54126793", "0.54126793", "0.5412521", "0.5411658", "0.5390622", "0.53861046", "0.5360378", "0.53506213", "0.5349419", "0.5343358", "0.534079", "0.534079", "0.5325629", "0.53222036", "0.53222036", "0.5311178", "0.53104675", "0.53104675", "0.53055674", "0.529678", "0.5294887", "0.5291121", "0.5274907", "0.52673596", "0.5261123", "0.5261123", "0.5245718", "0.52443916", "0.52443916", "0.5243541", "0.5243541", "0.5243541", "0.5243541", "0.5239278", "0.5239278", "0.5235158", "0.5223083", "0.52175766", "0.5216407", "0.52153677", "0.5202962", "0.5167273", "0.515649", "0.5144818", "0.51430136", "0.51382786", "0.512673", "0.512673", "0.512673", "0.512673", "0.51197", "0.5117065", "0.51149374", "0.51149374", "0.51146674", "0.51142085", "0.5113096", "0.5112837", "0.51114655", "0.5108534", "0.51057994", "0.51057994", "0.51055497", "0.5102189", "0.5102189", "0.5102189", "0.5102189", "0.5101147", "0.50985867", "0.5093015", "0.50885797", "0.50848734", "0.50816566", "0.50629884", "0.50629884", "0.50629884", "0.50629884", "0.5062087", "0.50606424", "0.50606424", "0.5053273" ]
0.0
-1
notify parent torrent to cancel requests that are enqueued and that have been already sent to the remote peer
@Override protected void connectionClosed(Peer.CloseReason reason) { Stream.concat(sendQueue.stream(), blockRequests.stream()) .filter(pm -> pm.type == StdPeerMessage.REQUEST) .forEach(pm -> { torrent.cancelBlockRequest(pm.index, pm.begin); }); // release messages sendQueue.forEach( pmCache::release); sendQueue.clear(); // and active requests blockRequests.forEach( pmCache::release); blockRequests.clear(); // peerRequests peerBlockRequests.forEach( pmCache::release); peerBlockRequests.clear(); peer.setConnectionClosed(reason); // incoming connections could be not linked yet if (torrent != null) { torrent.onPeerDisconnect(this); } // todo: release caches via connectionFactory }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract void sendCancel(Status reason);", "void onChoke(boolean state)\n {\n peerChoke = state;\n //if (DEBUG) System.out.println(peer.address + \" onChoke: \" + state);\n\n if (peerChoke) {\n // remove all enqueued requests as they will be dropped by the remote peer\n for (int i = sendQueue.size() - 1; 0 <= i; i--) {\n StdPeerMessage pm = sendQueue.get(i);\n if (pm.type == StdPeerMessage.REQUEST) {\n sendQueue.remove(i);\n // notify torrent about cancelled request\n torrent.cancelBlockRequest(pm.index, pm.begin);\n pmCache.release(pm);\n }\n }\n // it's possible that we have requests that were already sent to external peer,\n // notify torrent - they are cancelled too [who knows, maybe data will arrive]\n for (int i = 0; i < blockRequests.size(); i++) {\n StdPeerMessage pm = blockRequests.get(i);\n torrent.cancelBlockRequest(pm.index, pm.begin);\n pmCache.release(pm);\n }\n blockRequests.clear();\n }\n }", "public void notifyCancel() {\n Player senderPlayer = this.getToTeleport().getPlayerReference(Player.class),\n targetPlayer = this.getTarget().getPlayerReference(Player.class);\n\n if (senderPlayer == null || targetPlayer == null) {\n return;\n }\n\n MainData.getIns().getMessageManager().getMessage(\"TPA_CANCELLED\").sendTo(senderPlayer);\n MainData.getIns().getMessageManager().getMessage(\"TPA_SELF_CANCELLED\").sendTo(targetPlayer);\n\n }", "synchronized void cancel()\n {\n state = DNSState.CANCELED;\n notifyAll();\n }", "void sendCancelMessage();", "protected void cancelTimedOutBlockRequests()\n {\n long now = System.currentTimeMillis();\n for (int i = blockRequests.size() - 1; 0 <= i; i--) {\n StdPeerMessage pm = blockRequests.get(i);\n if (pm.timestamp + DOWNLOAD_QUEUE_REQUESTS_TIMEOUT < now) {\n System.out.println(\"-Xo \" + pm.index + \" \" + (pm.begin >> 14));\n blockRequests.remove(i);\n torrent.cancelBlockRequest(pm.index, pm.begin);\n pmCache.release(pm);\n }\n }\n }", "@CallByThread(\"Netty EventLoop\")\n void runCancel() {\n if (referenced > 0) { // is blocking\n incomingPublishService.drain();\n }\n }", "public void cancelAllRequests(boolean mayInterruptIfRunning, RequestHandle cnt) {\n // client.get\n\n }", "void canceledPendingNodeStop();", "void onCancel(int index, int begin, int length)\n {\n // validate common block parameters\n boolean correct = torrent.validateBlock(index, begin, length);\n if (!correct) {\n close(Peer.CloseReason.PROTOCOL_ERROR);\n return;\n }\n\n // check if are processing this request right now\n for (int i = 0; i < peerBlockRequests.size(); i++) {\n StdPeerMessage pm = peerBlockRequests.get(i);\n if ((pm.index == index)\n && (pm.begin == begin)\n && (pm.length == length))\n {\n peerBlockRequests.remove(i);\n pmCache.release(pm);\n break;\n }\n }\n\n // check if response has been enqueued,\n // could be skipped if found in pBR\n for (int i = 0; i < sendQueue.size(); i++) {\n StdPeerMessage pm = sendQueue.get(i);\n if ((pm.type == StdPeerMessage.PIECE)\n && (pm.index == index)\n && (pm.begin == begin)\n && (pm.length == length))\n {\n sendQueue.remove(i);\n // let storage to unlock block of data\n // and return it into cache of blocks\n TorrentStorage.Block block = (TorrentStorage.Block) pm.params;\n block.release();\n\n pmCache.release(pm);\n break;\n }\n }\n }", "void cancel()\n {\n cancelled = true;\n subjobComplete = true;\n result = null;\n }", "public void cancel()\n {\n this.controller.cancelDownloads();\n\n // Synchronised to avoid a race condition\n synchronized(this.cancelledMonitor)\n {\n // Set the cancelled field to true\n this.cancelled = true;\n }\n theLogger.info(\"Cancel request recieved from UI\");\n }", "private void finishRequests(){\n\t\tpeer.getRequests().removeAll(finishedRequestsList);\n\t\tfinishedRequestsList.clear();\n\t}", "protected abstract void onCancel();", "@Override\n\t\t\t\t\t\t\t\t\tpublic void cancel() {\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}", "public void cancelAll() {\n terminateScheduleTask();\n for (CancellableCommand request : outstandingRequests) {\n request.onCancelled();\n }\n outstandingRequests.clear();\n }", "private void sendCancelRpcCall(int numberRetries) {\n\t}", "void cancelOverrideRequest() {\n cancelCurrentRequestLocked();\n }", "@Override\n public void cancel() {\n }", "public void cancel() {\n request.disconnect();\n }", "@SuppressWarnings(\"unused\")\n @CalledByNative\n private void onCanceled() {\n postTaskToExecutor(new Runnable() {\n @Override\n public void run() {\n try {\n mCallback.onCanceled(CronetBidirectionalStream.this, mResponseInfo);\n } catch (Exception e) {\n Log.e(CronetUrlRequestContext.LOG_TAG, \"Exception in onCanceled method\", e);\n }\n mInflightDoneCallbackCount.decrement();\n }\n });\n }", "@Override\n\t\t\t\t\t\tpublic void cancel() {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}", "public void cancel(){\n\t\tstartTime = -1;\n\t\tplayersFinished = new ArrayList<>();\n\t\tplayersFinishedMarked = new ArrayList<Player>();\n\t\tDNFs = new ArrayList<>();\n\t\ttempNumber = 0;\n\t\tmarkedNum = 0;\n\t\t//normally we'd mark started racers as such, but we are don't know how many started.\n\t}", "public void requestcanceled() {\n\n requestcancelcheck = true;\n\n String diatitle = \"Request cancelled.\";\n String msg = \"Request cancelled by Rider.\";\n\n marker.setEnabled(false);\n // mGoogleMap.clear();\n fullbutton.setVisibility(View.GONE);\n usercheck = false;\n touch.setVisibility(View.GONE);\n marker.setVisibility(View.INVISIBLE);\n checkonclick = false;\n timercheck = true;\n whilecheck = true;\n accheck = true;\n receivecheck = true;\n\n acc1 = acc;\n\n registerReceiver(mHandleMessageReceiver, new IntentFilter(Config.DISPLAY_MESSAGE_ACTION));\n dialogshow(diatitle, msg);\n\n }", "@Override\n\tpublic void cancel() {\n\t\t\n\t}", "@Override\n\t\tpublic void cancel() {\n\t\t\t\n\t\t}", "void cancel() {\n if (mCurrentRequest != null) {\n mCurrentRequest.cancel();\n mCurrentRequest = null;\n }\n mPendingEntries.clear();\n }", "@Override\n\tpublic void cancel() {\n\n\t}", "@Override\n\tpublic void cancel() {\n\n\t}", "@Override\n\tpublic void cancel() {\n\n\t}", "@Override\r\n\tpublic void cancel() {\n\t\t\r\n\t}", "@Override\n public void cancel() {\n }", "public void cancel(){\n cancelled = true;\n }", "public void cancel();", "@Override\n\tpublic void canceled() {\n\t\t\n\t}", "@Override\n\tpublic void canceled() {\n\t\t\n\t}", "void onSynchronizationCancel();", "public void cancel( String reason );", "public void cancel() {\n\t\tcancelled = true;\n\t}", "@Override\n public void cancel() {\n\n }", "@objid (\"26d79ec6-186f-11e2-bc4e-002564c97630\")\n @Override\n public void performCancel() {\n }", "@Override\n public void cancel() {\n\n }", "protected void enqueue(StdPeerMessage message)\n {\n// if (DEBUG) {\n// if (message.type == StdPeerMessage.REQUEST) {\n// System.out.println(System.nanoTime() + \" [stdpc] enqueue: req \" + message.index + \" \" + (message.begin >> 14));\n// } else {\n// System.out.println(\"[stdpc] enqueue: \" + message.type);\n// }\n// }\n\n if (message.type == StdPeerMessage.CHOKE)\n {\n // remove reply messages with piece (block) data\n // from the send queue (due to spec)\n for (int i = sendQueue.size() - 1; 0 <= i; i--) {\n StdPeerMessage pm = sendQueue.get(i);\n if (pm.type == StdPeerMessage.PIECE) {\n sendQueue.remove(i);\n TorrentStorage.Block block = (TorrentStorage.Block) message.params;\n block.release();\n pmCache.release(pm);\n }\n }\n // set choke status\n choke = true;\n // send choke asap\n sendQueue.add(0, message);\n }\n else if (message.type == StdPeerMessage.CANCEL)\n {\n // remove the linked request if it's still in the queue\n for (int i = sendQueue.size() - 1; 0 <= i; i--) {\n StdPeerMessage pm = sendQueue.get(i);\n if ((pm.type == StdPeerMessage.REQUEST)\n && (pm.index == message.index)\n && (pm.begin == message.begin)\n && (pm.length == message.length)) // this check is redundant as length is fixed\n {\n sendQueue.remove(i);\n pmCache.release(pm);\n // don't really enqueue CANCEL as the linked request\n // has been found and removed\n pmCache.release(message);\n return;\n }\n }\n // send asap\n sendQueue.add(0, message);\n }\n else {\n if (message.type == StdPeerMessage.INTERESTED) {\n interested = true;\n }\n else if (message.type == StdPeerMessage.NOT_INTERESTED) {\n interested = false;\n }\n else if (message.type == StdPeerMessage.UNCHOKE) {\n choke = false;\n }\n\n // enqueue message\n sendQueue.add(message);\n }\n\n// sendQueue.forEach(pm -> System.out.println(\" -x> \" + System.identityHashCode(pm) + pm.type + \" ,\" + pm.index +\",\" + pm.begin +\",\" + pm.length) );\n\n }", "@Override\n\tpublic boolean hasCancelBeenRequested() {\n\t\treturn false;\n\t}", "@Override\n\t\tpublic void downloadCanceled() {\n\n\t\t}", "@Override\n public void cancelOngoingRequests(BootstrapSession destination) {\n sender.cancelRequests(destination.getId());\n }", "protected void onCancelRequestReceipts() {\n \tmTxtStatus.setText(\"requestReceipts onCancel\");\n }", "@Override\n public void cancel() {\n\n }", "@Override\n public void cancel() {\n\n }", "@Override\n public void cancel() {\n\n }", "public void onCancel();", "@Override\r\n public void cancelMsg() {\n System.out.println(\"Transaction has been cancelled for gas pump #1..\");\r\n }", "void fireTorrentStopped(TorrentId torrentId);", "public void cancel()\n\t{\n\t}", "public void cancel();", "public void cancel();", "public void cancel();", "public void cancel();", "public void cancel();", "public void cancel();", "protected abstract void handleCancel();", "Update withCancelRequested(Boolean cancelRequested);", "public void cancel() {\n\t}", "void cancel();", "void cancel();", "void cancel();", "void cancel();", "void cancel();", "public void checkCancel() throws CancellationException;", "private void stopRequest(){ Remove the clause synchronized of the stopRequest method.\n // Synchronization is isolated as possible to avoid thread lock.\n // Note: the method removeRequest from SendQ is synchronized.\n // fix bug jaw.00392.B\n //\n synchronized(this){\n setRequestStatus(stAborted);\n }\n informSession.getSnmpQManager().removeRequest(this);\n synchronized(this){\n requestId=0;\n }\n }", "@Override\n public void onCanceled(WorkerOperation.Result data) {\n super.onCanceled(data);\n\n }", "public abstract boolean cancel();", "public synchronized void cancel() {\n }", "void onCancel();", "@Override\r\n\t\tpublic void onCancel() {\n\t\t}", "@Override\n\t\t\tpublic void setCanceled(boolean value) {\n\t\t\t\t\n\t\t\t}", "@Override\n public void close() {\n if (!this.closed) {\n this.closed = true;\n this.requestsMap.values().forEach(request -> {\n try {\n ucpWorker.cancelRequest(request);\n } catch (NullPointerException nex) {\n // ignored, already cancelled\n }\n });\n }\n }", "@Override\n\t\t\tpublic void onCancel() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\tpublic void onCancel() {\n \n \t}", "void cancel(long inId);", "@Override\r\n\t\t\t\t\tpublic void onCancel() {\n\t\t\t\t\t\t\r\n\t\t\t\t\t}", "@Override\r\n\tpublic void setCanceled(boolean value) {\n\r\n\t}", "@Override\n protected void onCancel() {\n }", "public void cancelPendingRequests(Object tag) {\n if (mRequestQueue != null) {\n mRequestQueue.cancelAll(tag);\n }\n }", "public void cancelPendingRequests(Object tag) {\n if (mRequestQueue != null) {\n mRequestQueue.cancelAll(tag);\n }\n }", "public void cancelPendingRequests(Object tag) {\n if (mRequestQueue != null) {\n mRequestQueue.cancelAll(tag);\n }\n }", "@Override\n public void onCancel() {\n }", "public void cancelAllRequests() {\n mPwsClient.cancelAllRequests();\n }", "public void cancel() {\r\n\t\tthis.cancel = true;\r\n\t}", "public void onCancel() {\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}", "public void onCancel() {\n\t\t\t\t\t}", "public boolean cancel();", "void onCanceled();", "@Override\n public void onCancel() {\n }", "public void cancelUpload() {\n if (this.nativeFilesQueued.size() > 0) {\n cancelUpload(this.nativeFilesQueued.get(0).<File>cast().getId());\n }\n }", "@Override\n public void onCancel() {\n Log.w(tag, \"post cancel\" + this.getRequestURI());\n cancelmDialog();\n super.onCancel();\n }", "protected void cancel() {\n abort();\n if(cancelAction != null) {\n cancelAction.accept(getObject());\n }\n }", "public abstract boolean cancelable();", "public void cancel() {\r\n\t\tcanceled = true;\r\n\t\ttry {\r\n\t\t\tThread.sleep(51);\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "abstract protected ActionForward processCancel( UserRequest request )\n throws IOException, ServletException;" ]
[ "0.6575069", "0.6381271", "0.6377557", "0.63530564", "0.6211348", "0.6128806", "0.6060893", "0.6015263", "0.5996009", "0.59657454", "0.5950067", "0.59305996", "0.5915255", "0.5857902", "0.58420086", "0.5830937", "0.5816812", "0.57988787", "0.5788697", "0.5783756", "0.57610714", "0.5750709", "0.5750352", "0.5745872", "0.5743767", "0.57436115", "0.57350475", "0.5733092", "0.5733092", "0.5733092", "0.5724953", "0.571507", "0.5713733", "0.570712", "0.5675692", "0.5675692", "0.56743515", "0.56692266", "0.5663894", "0.56509286", "0.56458175", "0.56450915", "0.5643029", "0.5618879", "0.5601865", "0.55928135", "0.55851346", "0.5584437", "0.5584437", "0.5584437", "0.55761796", "0.55761397", "0.55685073", "0.55309916", "0.5527426", "0.5527426", "0.5527426", "0.5527426", "0.5527426", "0.5527426", "0.5525846", "0.5524369", "0.55118644", "0.5506769", "0.5506769", "0.5506769", "0.5506769", "0.5506769", "0.54977953", "0.5492421", "0.5479633", "0.5476876", "0.54762405", "0.54652107", "0.5451415", "0.54508996", "0.5442495", "0.543135", "0.542642", "0.54000473", "0.53952634", "0.5385375", "0.53851944", "0.5367842", "0.5367842", "0.5367842", "0.5346034", "0.53454894", "0.53381854", "0.5334026", "0.5333065", "0.53025067", "0.52810884", "0.52795935", "0.5279357", "0.52700937", "0.52624524", "0.5255177", "0.52548814", "0.5254446" ]
0.55535775
53
called on KEEP ALIVE messages
void onKeepAlive() {}
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void sendKeepAlive() {\n\t\tlong now = new java.util.Date().getTime() / 1000;\n\t\tif (now - lastKeepAlive > properties.getInt(\"keepAliveInterval\")) {\n\t\t\tfsmTeacher.handleAction(\"tap%\" + properties.get(\"keepAliveX\") + \"#\" + properties.get(\"keepAliveY\"));\n\t\t\tlastKeepAlive = now;\n\t\t\tSystem.out.println(\"Kept alive.\");\n\t\t}\n\t}", "@Override\n\tpublic void visit(KeepAlive ka) {\n\t\tSystem.out.println(\"peer keepAlive connection\");\n\t\tph.setAlive(true);\n\t\tthis.lastKeepAlive = System.currentTimeMillis();\n\t}", "@Override\r\n\tprotected void onPause() {\n\t\tsuper.onPause();\r\n\t\tMessageReceiver.ehList.remove(this);// 取消监听推送的消息\r\n\t}", "public void onPause() {\n super.onPause();\n this.pushManager.e();\n if (this.isLiving) {\n this.isPushInBackground = true;\n this.isNoNetEvent = false;\n startPausedTimer();\n }\n if (this.mLivePusherInfoView != null) {\n this.mLivePusherInfoView.onPause();\n }\n }", "@Override\r\n\tpublic boolean isLive() {\n\t\treturn false;\r\n\t}", "default void stayAlive() {\n\t\tSystem.out.println(\"Stayin alive\");\n\t}", "public void mo15789a() {\n if (mo15791c()) {\n C1557c.m7458a(f11337e, \"Publishing new messaging session event.\");\n this.f11340c.mo15485a(C4485k.f11123a, C4485k.class);\n this.f11341d = true;\n return;\n }\n C1557c.m7458a(f11337e, \"Messaging session not started.\");\n }", "private void onLost() {\n // TODO: broadcast\n }", "@Override\r\n\tpublic void onPause() {\n\t\tsuper.onPause();\r\n\t\t// getnewtime();\r\n\t\tLog.e(TAG, \"onpause\");\r\n\t}", "@Override\n protected void onResume() {\n new GeoChatSettings(this).clearNewMessagesCount();\n \n \tsuper.onResume();\n }", "void keepAliveUserDataStream(String listenKey, Long recvWindow, Long timestamp);", "@Override\n public void run() {\n super.run();\n while (!isPaused) {\n Message msg = mHandler.obtainMessage();\n msg.arg1 = REFRESH;\n mHandler.sendMessage(msg);\n try {\n Thread.sleep(REFRESHINTERVAL);\n } catch (InterruptedException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }\n }", "private synchronized void m16565c() {\n if (!(this.f14719b || this.f14723f.hasMessages(this.f14724g))) {\n this.f14723f.sendMessageDelayed(this.f14723f.obtainMessage(this.f14724g), 2000);\n }\n }", "public void onPause () {\n\t\t\n\t}", "public void mo15790b() {\n long a = C4472i3.m15480a();\n String str = f11337e;\n StringBuilder sb = new StringBuilder();\n sb.append(\"Messaging session stopped. Adding new messaging session timestamp: \");\n sb.append(a);\n C1557c.m7458a(str, sb.toString());\n this.f11338a.edit().putLong(\"messaging_session_timestamp\", a).apply();\n this.f11341d = false;\n }", "public void onRecieve(RoundTimeMessage message) {\n\n\n }", "void onStopped();", "@Override\n\tpublic void msgAtFrige() {\n\t\t\n\t}", "@Override\r\n public void run() {\n d7++;\r\n if (d7 == 1) {\r\n onReceive(new byte[]{Message.TIMER_MESSAGE, Message.TFP7_EXPIRE});\r\n }\r\n }", "void keepAlive();", "public void onMessage(Message message) {\n lastMessage = message;\n\n }", "@Override\n\tprotected void onPause() {\n\t\tSystem.out.println(\"onPause\");\n\t}", "private Message onPingMessageReceived(PingMessage m, DecentSocket origin) {\n\t\treturn null;\n\t}", "public void updateADMsg(OL_Message msg) {\n if (myState != HavePayload) {\n socket.appmsgArrived(msg, socket.callback);\n data = msg.getPayload();\n myState = HavePayload;\n messageStore.setTimer(this, DELETE_TIMER_INDEX, delete);\n }\n }", "@Override\n protected void onResume() {\n super.onResume();\n\n// queryTicket();\n// timer = new Timer();\n// timer.schedule(new TimerTask() {\n//\n// @Override\n// public void run() {\n// // TODO Auto-generated method stub\n// handler.sendEmptyMessage(1);\n// }\n// }, 0, 2000);\n }", "@Override\r\n\tpublic void onMessage(Message rcvMessage) {\n\r\n\t\tObjectMessage msg = null;\r\n\t\ttry {\r\n\r\n\t\t\tLOGGER.warning(\"Inicio\");\r\n\t\t\tThread.sleep(3000);\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\tLOGGER.warning(\"Desapachado.\");\r\n\r\n\t}", "public void onActive() {\n Methods.showMessage(\"Warning\", \"Welcome Back!\", \"Please Continue Filling Out Your Questionanire!\");\n }", "@Override\n public void postFade() {\n startCapsules();\n heartBeat.startTimer();\n }", "public void receiveGarbageLine() {\n\t\treceivedGarbageLines++;\n\t\t// overall\n\t\tgarbageLinesReceived++;\n//\t\ttry {\n//\t\t\twhile (!hasLanded) {\n//\t\t\t\tThread.sleep(10);\n//\t\t\t}\n//\t\t} catch (InterruptedException e) {\n//\t\t\te.printStackTrace();\n//\t\t}\n\t}", "@Override\n\tpublic void onMessageReceived(Message msg) {\n\t\tif ( msgSendTimes.containsKey(\"\"+msg.Payload)) {\n\t\t\tlong startTime = msgSendTimes.get((String)msg.Payload);\n\t\t\tlong elapsedTime = System.nanoTime() - startTime;\n\t\t\tmsgSendTimes.remove((String)msg.Payload);\n\t\t\tmsgTimes.add(elapsedTime);\n\t\t\tSystem.out.println(elapsedTime / 1000000000f);\n\t\t}\n\t}", "void onUserAttentionGone() {\n if (isPlaying()) { //If video is playing pause it.\n mPauseTime = getCurrentPosition(); //mPauseTime is an int\n super.pause();\n }\n }", "public void afterReceive() {\n\t}", "@Override\n protected void onPause() {\n super.onPause();\n MobclickAgent.onPause(this);\n // JPushInterface.onPause(this);\n isForeground = false;\n\n }", "boolean hasKeepAlive();", "public boolean isLingering();", "public void h() {\n long currentTimeMillis = System.currentTimeMillis();\n this.m.sendEmptyMessageDelayed(48, q.c(currentTimeMillis));\n this.m.sendEmptyMessageDelayed(49, q.d(currentTimeMillis));\n }", "@Override\n public void handleMessage(Message msg) {\n if (isPlaying() || mMediaplayerHandler.hasMessages(TRACK_ENDED)) {\n return;\n }\n // save the queue again, because it might have changed\n // since the user exited the music app (because of\n // party-shuffle or because the play-position changed)\n }", "@Override\r\n public void run() {\n d2++;\r\n if (d2 == 1) {\r\n onReceive(new byte[]{Message.TIMER_MESSAGE, Message.TFP2_EXPIRE});\r\n }\r\n }", "int getKeepAlive();", "private void handleNow(RemoteMessage remoteMessage) {\n Log.d(TAG, \"Short lived task is done.\");\n }", "@Override\r\n public void pause() {\r\n\r\n }", "@Override\r\n public void pause() {\r\n\r\n }", "@Override\n\tpublic void nowPlaying() {\n\t}", "int getKeepAliveTime();", "@Override\n public void onSpeakPaused() throws RemoteException {\n Log.d(TAG, \"onSpeakPaused\");\n }", "@Override\r\n\tpublic void onPause() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onPause() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onPause() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void onPause() {\n\t\t\r\n\t}", "@Override\r\n\tprotected void onResume() {\n\t\tsuper.onResume();\r\n\t\tStatService.onResume(this);\r\n\r\n\t\tif(!facade.hasMediator(NAME))\r\n\t\t\tfacade.registerMediator(this);\r\n\t\t\r\n\t\tisTop_ = true;\r\n\t\t\r\n\t\tgetLatestMsg();\r\n\t}", "@Override\r\n\tpublic void onMessage(BmobMsg message) {\n\t\trefreshNewMsg(message);\r\n\t}", "public void handleMessage(Message msg) {\n super.handleMessage(msg);\n switch (msg.what) {\n case 1:\n if (!isStop) {\n updateTimeSpent();\n mHandler.sendEmptyMessageDelayed(1, 1000);\n }\n break;\n case 0:\n break;\n }\n }", "public boolean isbLive() {\n\t\treturn true;\n\t}", "public boolean keepAlive() {\n\t\tDate date = LocPairsServerTime.getTime();\n\t\tthis.lastLifeSign = date;\n\t\treturn true;\n\t}", "@Override\n public void pause() {\n }", "@Override\r\n\tpublic void onPause() {\n\t\tsuper.onPause();\r\n\r\n\t\t// 友盟统计\r\n\t\tUmShare.UmPause(m_Context);\r\n\t}", "@Override\r\n public void pause() {}", "public void onPause() {\n LOG.mo8825d(\"[onPause]\");\n super.onPause();\n }", "@Override\r\n\tprotected void onPause() {\n\t\t\r\n\t}", "protected void onBSStop() {\n isFinishing = true;\n mCalled = true;\n }", "default void onMissedHeartBeat(SessionID sessionID) {\n }", "protected void onStopped() {\n // Do nothing.\n }", "public boolean hasHeartBeatMsg() {\n return msgCase_ == 3;\n }", "public synchronized void checkTimeoutMessages() {\n SQSMessage SQSMessage;\n String receiptHandler;\n long currentTimeStampDifference;\n for (Map.Entry pairs : receivedMessages.entrySet()) {\n SQSMessage = (SQSMessage) pairs.getValue();\n currentTimeStampDifference = System.currentTimeMillis() - SQSMessage.getReceivedTimeStamp();\n if (currentTimeStampDifference > SQSMessage.getDefaultVisibilityTimeout()) {\n receiptHandler = (String) pairs.getKey();\n SQSMessageQueue.addFirst(SQSMessage);\n receivedMessages.remove(receiptHandler);\n }\n }\n }", "public void newADMsg(OL_Message msg) {\n socket.appmsgArrived(msg, socket.callback);\n setADMsg(msg);\n myState = HavePayload;\n messageStore.setTimer(this, DELETE_TIMER_INDEX, delete);\n }", "@Override\n\tprotected void onResumed() {\n\t\t\n\t}", "@Override\r\n public void run() {\n d1++;\r\n if (d1 == 1) {\r\n onReceive(new byte[]{Message.TIMER_MESSAGE, Message.TFP1_EXPIRE});\r\n }\r\n if (d1 == 10) {\r\n onReceive(new byte[]{Message.TIMER_MESSAGE, Message.TFP1_EXPIRE_N});\r\n }\r\n }", "@Override\n public void pause() {\n\n }", "@Override\n public void pause() {\n\n }", "@Override\n public void pause() {\n\n }", "@Override\n\tpublic void onPause() {\n\n\t}", "@Override\r\n\tprotected void onResume() {\n\t\tsuper.onResume();\r\n\t\tMessageReceiver.ehList.add(this);// 监听推送的消息\r\n\t\t// 清空\r\n\t\tMessageReceiver.mNewNum = 0;\r\n\r\n\t}", "protected void pingReceived(){\r\n\t\tpings++;\r\n\t\troundTrip = System.currentTimeMillis() - pingSent;\r\n\t\tlastPing = System.currentTimeMillis();\r\n\t\tlog.trace(\"\\\"\" + getName() + \"\\\" responded to ping after \" + roundTrip + \"ms\");\r\n\t}", "@Override\n protected void onPause() {\n super.onPause();\n\n SharedPreferences sharedPreferences =\n getSharedPreferences(getString(R.string.keys_shared_prefs),\n Context.MODE_PRIVATE);\n if (sharedPreferences.getBoolean(getString(R.string.keys_sp_on), false)) {\n //stop the service from the foreground\n PullService.stopServiceAlarm(this);\n //restart but in the background\n PullService.startServiceAlarm(this, false);\n }\n if (mMessagesUpdateReceiver != null){\n unregisterReceiver(mMessagesUpdateReceiver);\n }\n if (mConnectionsUpdateReceiver != null) {\n unregisterReceiver(mConnectionsUpdateReceiver);\n }\n\n }", "public boolean hasHeartBeatMsg() {\n return msgCase_ == 3;\n }", "public void onIdleTimerTick()\n {\n GregorianCalendar now = new GregorianCalendar();\n \n // any player we haven't seen for 3 minutes is now AFK.\n now.add(Calendar.MINUTE, -3);\n \n Server server = this.getServer();\n Player[] players = server.getOnlinePlayers();\n \n for (int i = 0; i < players.length; i++)\n {\n String playerName = players[i].getName();\n \n if (this.afkLastSeen.containsKey(playerName) && this.afkLastSeen.get(playerName).after(now))\n {\n if (this.afkPlayersAuto.containsKey(playerName) && this.afkPlayersAuto.get(playerName))\n {\n // this player is no longer AFK.\n this.afkPlayers.put(playerName, false);\n this.afkPlayersAuto.put(playerName, false);\n \n server.broadcastMessage(ChatColor.YELLOW + playerName + \" is no longer away.\");\n }\n }\n else\n {\n if (!this.afkPlayers.containsKey(playerName) || !this.afkPlayers.get(playerName))\n {\n // mark this player as AFK, broadcast the message.\n this.afkPlayers.put(playerName, true);\n this.afkPlayersAuto.put(playerName, true);\n \n server.broadcastMessage(ChatColor.YELLOW + playerName + \" is now away (idle).\");\n }\n }\n }\n }", "@Override\r\n\tpublic void onServerDown() {\n\t\tString res=name + \" recived a notification\";\r\n\t\tLOGGER.info(res);\r\n\t\t\r\n\t}", "@Override\n public void onFeedbackServerStopped() {\n }", "public boolean keepAliveEnabled();", "@Override\n \tpublic void pause() {\n \t}", "@Override\n public void pause() {\n }", "@Override\n public void pause() {\n }", "@Override\n public void pause() {\n }", "@Override\n public void pause() {\n }", "@Override\n public void pause() {\n }", "@Override\n public void teleopPeriodic() {\n }", "@Override\n public void teleopPeriodic() {\n }", "public void onIdle() {\n Methods.showMessage(\"Warning\", \"No User Action for the Last 5 Minutes!\", \"Do You Need More Time?\");\n }", "void onConnectionLost();", "@Override\n public void pause() {\n \n }", "@Override\r\n public void pause() {\n }", "@Override\r\n public void pause() {\n }", "@Override\r\n public void pause() {\n }", "void record2_liveprices(DdfMarketBase msg, Quote quote, FeedEvent fe) {\n\t\t// /////////////////////////////////////////////////////////\n\t\t// record = 2 Exchange live quote messages\n\t\t// ///////////////////////////////////////////////////////////\n\n\t\t// ///////////////////////////\n\t\t// Update cached quote\n\t\t// ///////////////////////////\n\t\tquote.updateLastUpdated();\n\t\t// Save Original DDF message\n\t\tquote.setMessage(msg);\n\n\t\t/*\n\t\t * Session Logic\n\t\t */\n\t\tboolean bDoNotSetFlag = false;\n\t\t// Running cumulative Volume\n\t\tCumulativeVolume cv = getCumulativeVolume(msg.getSymbol());\n\n\t\tSession pCombinedSession = null;\n\t\tSession pPreviousSession = null;\n\n\t\t/*\n\t\t * Set current session to the message's \"day\", probably first message of\n\t\t * the day.\n\t\t */\n\t\tif (quote._combinedSession.getDayCode() == '\\0') {\n\t\t\tquote._combinedSession.setDayCode(msg.getDay());\n\t\t}\n\n\t\tint day1_dayFromCurrentQuoteSession = DDFDate.convertDayCodeToNumber(quote._combinedSession.getDayCode());\n\t\tint day2_dayFromMessage = DDFDate.convertDayCodeToNumber(msg.getDay());\n\n\t\tif (day1_dayFromCurrentQuoteSession == day2_dayFromMessage) {\n\t\t\t/*\n\t\t\t * The message is for the current session.\n\t\t\t */\n\t\t\tpCombinedSession = quote._combinedSession;\n\t\t\tpPreviousSession = quote._previousSession;\n\t\t} else if (msg.getDay() == quote._previousSession.getDayCode()) {\n\t\t\t/*\n\t\t\t * Message is for the previous session\n\t\t\t */\n\t\t\tpCombinedSession = quote._previousSession;\n\t\t\tpPreviousSession = new Session(quote);\n\n\t\t\t/* Don't set any flags, since we're in \"yesterday\" */\n\t\t\tbDoNotSetFlag = true;\n\t\t\tif (log.isDebugEnabled()) {\n\t\t\t\tlog.debug(\"Previous session: \" + msg);\n\t\t\t}\n\n\t\t} else if ((day2_dayFromMessage > day1_dayFromCurrentQuoteSession)\n\t\t\t\t|| ((day1_dayFromCurrentQuoteSession - day2_dayFromMessage) > 5)) {\n\t\t\t/*\n\t\t\t * Message is for a new session/day, so we have changed sessions.\n\t\t\t */\n\n\t\t\t/*\n\t\t\t * Only roll if the combined session has a valid last. The previous\n\t\t\t * day could have a been a holiday or there was no trades for that\n\t\t\t * day.\n\t\t\t */\n\t\t\tif (quote._combinedSession.getLast() == 0.0f) {\n\t\t\t\tif (log.isDebugEnabled()) {\n\t\t\t\t\tlog.debug(\"New session, last == 0: \" + msg);\n\t\t\t\t}\n\t\t\t\tpCombinedSession = quote._combinedSession;\n\t\t\t\tpPreviousSession = quote._previousSession;\n\t\t\t} else {\n\t\t\t\t// Current Session has a last price, start a new session\n\t\t\t\tif (log.isDebugEnabled()) {\n\t\t\t\t\tlog.debug(\"New session, last > 0: \" + msg);\n\t\t\t\t}\n\n\t\t\t\tSession pPrevious = quote._previousSession;\n\t\t\t\tquote._previousSession = quote._combinedSession;\n\t\t\t\t// Create new current session\n\t\t\t\tquote._combinedSession = new Session(quote, DDFDate.fromDayCode(msg.getDay()), msg.getSession());\n\t\t\t\tquote.setFlag('p');\n\n\t\t\t\t// Add MarketEvent.PreOpen\n\t\t\t\tMarketEvent me = addMarketEvent(fe, msg, MarketEventType.PreOpen, quote.getSymbolInfo().getSymbol());\n\t\t\t\tif (log.isDebugEnabled()) {\n\t\t\t\t\tlog.debug(me.toString());\n\t\t\t\t}\n\n\t\t\t\tquote._combinedSession._open = 0.0f;\n\t\t\t\tquote._combinedSession._high = 0.0f;\n\t\t\t\tquote._combinedSession._low = 0.0f;\n\t\t\t\tquote._combinedSession.setPrevious(quote._previousSession.getLast());\n\n\t\t\t\tif (quote._previousSession.getOpenInterest() == 0) {\n\t\t\t\t\tquote._previousSession._openInterest = pPrevious._openInterest;\n\t\t\t\t}\n\t\t\t\tpCombinedSession = quote._combinedSession;\n\t\t\t\tpPreviousSession = quote._previousSession;\n\n\t\t\t\tif (cv != null) {\n\t\t\t\t\t// It is a new session clear the cumulative volume for this\n\t\t\t\t\t// session\n\t\t\t\t\tDDFDate d = DDFDate.fromDayCode(msg.getDay());\n\t\t\t\t\tcv.setDate(d.getMillisCST());\n\t\t\t\t\tcv.getData().clear();\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t// Should never happen\n\t\t\treturn;\n\t\t}\n\n\t\t/*\n\t\t * We should update the Quote's Session session value with the inbound\n\t\t * message. Otherwise, we get stuck on something like a Form-T\n\t\t */\n\t\tpCombinedSession._session = msg.getSession();\n\n\t\tSession session = quote.createSession(msg.getDay(), msg.getSession());\n\n\t\tif (session == pCombinedSession) {\n\t\t\tsession = null;\n\t\t}\n\n\t\tif ((session != null) && (session.getPrevious() == 0.0f)) {\n\t\t\tsession.setPrevious(pCombinedSession.getPrevious());\n\t\t}\n\n\t\t// //////////////////////////////////////////////////////////\n\t\t// Process based on record type and subrecord type\n\t\t// ///////////////////////////////////////////////////////////\n\t\tif (msg instanceof DdfMarketParameter) {\n\t\t\t// ////////////////////////////////////////////\n\t\t\t// record 2, subrecord 0, Price Elements\n\t\t\t// ///////////////////////////////////////////\n\t\t\trecord2_subrecord0(msg, fe, quote, bDoNotSetFlag, pCombinedSession, pPreviousSession, session);\n\n\t\t} else if (msg instanceof DdfMarketRefresh) {\n\t\t\t// ////////////////////////////////////////////\n\t\t\t// record 2, subrecord 1,2,3,4,6\n\t\t\t// ///////////////////////////////////////////\n\t\t\trecord2_subrecord12346(msg, fe, quote, bDoNotSetFlag, pCombinedSession, pPreviousSession, session);\n\n\t\t} else if ((msg instanceof DdfMarketTrade) && (msg.getSession() == 'T')) {\n\t\t\t// ////////////////////////////////////////////\n\t\t\t// record 2, subrecord 7,T\n\t\t\t// Electronic (Form-T) Trade\n\t\t\t// ///////////////////////////////////////////\n\t\t\t/*\n\t\t\t * A 'T' session is for pre and post equities. These trades normally\n\t\t\t * do not affect the statistics (hi, low, etc..)\n\t\t\t */\n\t\t\tSession s2 = quote.createSession(pCombinedSession.getDayCode(), 'T');\n\n\t\t\trecord2_subrecord7T(msg, pCombinedSession, s2, session);\n\n\t\t} else if (msg instanceof DdfMarketTrade) {\n\t\t\t// ////////////////////////////////////////////\n\t\t\t// record 2, subrecord 7,Z\n\t\t\t// ///////////////////////////////////////////\n\t\t\trecord2_subrecord7Z(msg, quote, bDoNotSetFlag, cv, pCombinedSession, session);\n\n\t\t} else if (msg instanceof DdfMarketBidAsk) {\n\t\t\t// ////////////////////////////////////////////\n\t\t\t// record 2, subrecord 8\n\t\t\t// ///////////////////////////////////////////\n\t\t\trecord2_subrecord8(msg, quote, pCombinedSession, session);\n\n\t\t} else if (msg instanceof DdfMarketCondition) {\n\t\t\t// ////////////////////////////////////////////\n\t\t\t// record 2, subrecord 9 Market Condition/Trading Status\n\t\t\t// ///////////////////////////////////////////\n\t\t\tMarketConditionType marketConditon = ((DdfMarketCondition) msg).getMarketCondition();\n\t\t\tquote.setMarketCondition(marketConditon);\n\t\t\t// Send Market Event\n\t\t\tif (marketConditon == MarketConditionType.TRADING_HALT) {\n\t\t\t\t/* MarketEvent me = */ addMarketEvent(fe, msg, MarketEventType.TradingHalt,\n\t\t\t\t\t\tquote.getSymbolInfo().getSymbol());\n\t\t\t} else if (marketConditon == MarketConditionType.TRADING_RESUMTPION) {\n\t\t\t\t/* MarketEvent me = */ addMarketEvent(fe, msg, MarketEventType.TradingResumption,\n\t\t\t\t\t\tquote.getSymbolInfo().getSymbol());\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\tpublic void pause() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void pause() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void pause() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void pause() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void pause() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void pause() {\n\t\t\r\n\t}" ]
[ "0.67906904", "0.62909734", "0.60885125", "0.6027786", "0.59991956", "0.5981873", "0.593522", "0.5915601", "0.5817259", "0.57589895", "0.5734483", "0.5721786", "0.57187575", "0.567467", "0.5662714", "0.56500465", "0.56443757", "0.563675", "0.5624003", "0.5622359", "0.56213754", "0.5620834", "0.5618234", "0.5605775", "0.55945486", "0.55873513", "0.5583396", "0.55777824", "0.55751514", "0.5575138", "0.5574509", "0.5571174", "0.55695814", "0.5569036", "0.55654854", "0.55640644", "0.5560724", "0.5555727", "0.55498797", "0.55485", "0.55483264", "0.55483264", "0.554281", "0.5542801", "0.5532845", "0.55289155", "0.55289155", "0.55289155", "0.55289155", "0.5519266", "0.55170053", "0.551654", "0.55148286", "0.55114985", "0.55108553", "0.55037695", "0.5500675", "0.54999757", "0.54984736", "0.54776925", "0.54738647", "0.54727525", "0.54711956", "0.54681766", "0.54667944", "0.54657507", "0.546307", "0.54606634", "0.54606634", "0.54606634", "0.5460078", "0.5459369", "0.545526", "0.54539645", "0.5451809", "0.5448141", "0.544348", "0.54378307", "0.5437042", "0.54350054", "0.5431175", "0.5431175", "0.5431175", "0.5431175", "0.5431175", "0.5428996", "0.5428996", "0.54214096", "0.5417892", "0.54177946", "0.54149723", "0.54149723", "0.54149723", "0.5414568", "0.54125696", "0.54125696", "0.54125696", "0.54125696", "0.54125696", "0.54125696" ]
0.68736553
0
called on "request" message receive, simply notifies parent torrent to find data and enqueue it for sending
void onRequest(int index, int begin, int length) { if (DEBUG) System.out.println("[stdpc] onRequest:" + index + "," + begin + "," + length); // sendQueue.forEach(pm -> System.out.println("[stdpc] onRequest -b>" + System.identityHashCode(pm) + // " " +pm.type + " ," + pm.index +"," + pm.begin + "," + pm.length) ); // validate common block parameters boolean correct = torrent.validateBlock(index, begin, length); if (!correct) { // just ignore such requests statistics.blocksRequestedIncorrect++; return; } // this could be moved to send(), but doesn't really matter statistics.blocksSent++; // track active requests StdPeerMessage pm = pmCache.request(index, begin, length); peerBlockRequests.add(pm); // notify torrent to read and enqueue block torrent.onRequest(this, index, begin, length); // sendQueue.forEach(x -> System.out.println("[stdpc] onRequest -a<" + System.identityHashCode(x) + // " " +x.type + " ," + x.index +"," + x.begin + "," + x.length) ); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void enqueue(StdPeerMessage message)\n {\n// if (DEBUG) {\n// if (message.type == StdPeerMessage.REQUEST) {\n// System.out.println(System.nanoTime() + \" [stdpc] enqueue: req \" + message.index + \" \" + (message.begin >> 14));\n// } else {\n// System.out.println(\"[stdpc] enqueue: \" + message.type);\n// }\n// }\n\n if (message.type == StdPeerMessage.CHOKE)\n {\n // remove reply messages with piece (block) data\n // from the send queue (due to spec)\n for (int i = sendQueue.size() - 1; 0 <= i; i--) {\n StdPeerMessage pm = sendQueue.get(i);\n if (pm.type == StdPeerMessage.PIECE) {\n sendQueue.remove(i);\n TorrentStorage.Block block = (TorrentStorage.Block) message.params;\n block.release();\n pmCache.release(pm);\n }\n }\n // set choke status\n choke = true;\n // send choke asap\n sendQueue.add(0, message);\n }\n else if (message.type == StdPeerMessage.CANCEL)\n {\n // remove the linked request if it's still in the queue\n for (int i = sendQueue.size() - 1; 0 <= i; i--) {\n StdPeerMessage pm = sendQueue.get(i);\n if ((pm.type == StdPeerMessage.REQUEST)\n && (pm.index == message.index)\n && (pm.begin == message.begin)\n && (pm.length == message.length)) // this check is redundant as length is fixed\n {\n sendQueue.remove(i);\n pmCache.release(pm);\n // don't really enqueue CANCEL as the linked request\n // has been found and removed\n pmCache.release(message);\n return;\n }\n }\n // send asap\n sendQueue.add(0, message);\n }\n else {\n if (message.type == StdPeerMessage.INTERESTED) {\n interested = true;\n }\n else if (message.type == StdPeerMessage.NOT_INTERESTED) {\n interested = false;\n }\n else if (message.type == StdPeerMessage.UNCHOKE) {\n choke = false;\n }\n\n // enqueue message\n sendQueue.add(message);\n }\n\n// sendQueue.forEach(pm -> System.out.println(\" -x> \" + System.identityHashCode(pm) + pm.type + \" ,\" + pm.index +\",\" + pm.begin +\",\" + pm.length) );\n\n }", "private synchronized void onRequest(ObjectMessage message) {\n try {\n Serializable request = message.getObject(); //serializer.requestFromString(message.getText());\n activeRequests.put(request, message);\n requestListener.receivedRequest(request);\n } catch (JMSException ex) {\n Logger.getLogger(AsynchronousReplier.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n }", "public void handle_request(Request request){\n currentRequest.add(request);\n System.out.println(\"[Worker\"+String.valueOf(id)+\"] Received request of client \"+String.valueOf(request.getId()));\n }", "public void sendRequest(){\n fileServer.sendMessage(this.packet,new FileNode(ip,port));\n }", "@Override\n\tprotected void doAction(Object message) {\n\t\tlogger.info(\"File Scanner Fetch message Name -->:\"+message.toString());\n\t\ttry {\n\t\t\tFileParser.queue.put(message);\n\t\t} catch (InterruptedException e) {\n\t\t\tlogger.error(\"Error on add message to Parser\");\n\t\t}\n\t}", "@Override\n\tpublic void visit(Request r) {\n\t\tif (!ph.getPeerChoked()) {\n\t\t\tSystem.out.println(\"requete rećue\");\n\t\t\tbyte[] body = r.getBody();\n\t\t\tbyte[] indexB = new byte[4], beginB = new byte[4], lengthB = new byte[4];\n\t\t\tTorrent torrent = ph.getTorrent();\n\t\t\tint index = 0, begin = 0, length = 0;\n\n\t\t\tindexB = Arrays.copyOfRange(body, 0, 4);\n\t\t\tindex = byteArrayToInt(indexB);\n\n\t\t\tbeginB = Arrays.copyOfRange(body, 4, 8);\n\t\t\tbegin = byteArrayToInt(beginB);\n\n\t\t\tlengthB = Arrays.copyOfRange(body, 8, body.length);\n\t\t\tlength = byteArrayToInt(lengthB);\n\n\t\t\tPiece piece = torrent.getPieces().get(index);\n\t\t\tif (index <= torrent.getPieces().size()) {\n\t\t\t\tbyte[] block = new byte[length];\n\t\t\t\tbyte[] pieceByte = piece.getData();\n\t\t\t\tfor (int i = 0; i < length; i++) {\n\t\t\t\t\tblock[i] = pieceByte[begin + i];\n\t\t\t\t}\n\t\t\t\tsb = new SendBlock(index, begin, block);\n\t\t\t\tthis.ph.addMessageQueue(sb);\n\t\t\t\tSystem.out.println(\"sendBlock envoyé\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Index trop grand\");\n\t\t\t}\n\t\t}\n\t}", "public synchronized void processReq() throws UnknownHostException, IOException, InterruptedException{\n\t\tsynchronized(quorum.locked){\n\n\t\t\tString words[] = msgFromClient.split(\" \");\n\t\t\tint reqNode = Integer.parseInt(words[1]);\n\t\t\tint reqPriority = Integer.parseInt(words[2]);\n\t\t\t\n\t\t\t//Ticking clock for reciept of request\n\t\t\ttry {\n\t\t\t\tclock.tick(0, reqPriority);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\t\t\tif(quorum.locked.get()){\n\t\t\t\tSystem.out.println(t.getName() + \"\\t ****** Quorum is LOCKED for \"+ quorum.getPermissionGivenTo() + \" ****** \");\n\t\t\t\t//**************** If locked, then add to the queue and send INQ or FAIL msgs ***********************\n\t\t\t\t\n\t\t\t\t//Putting in queue\n\t\t\t\tsynchronized(q){\n\t\t\t\t\tq.put(msgFromClient);\n\t\t\t\t\tSystem.out.println(t.getName() + \"\\tSize of queue: \" + q.getQueue().size());\n\t\t\t\t\tSystem.out.println(t.getName() + \"\\tCONTENTS OF THE QUEUE: \");\n\t\t\t\t\tq.printQueue();\n\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t//Check whether to send INQ or FAIl\t\t\t\t\t\t\n\t\t\t\tint currNode = quorum.getPermissionGivenTo();\n\t\t\t\tint currPriority = quorum.getPermissionGivenToPriority();\n\t\t\t\t\n\t\t\t\t//If new request has higher priority, send INQ to the node with the token, JUST ONCE\n\t\t\t\tif(reqPriority < currPriority && quorum.isCanSendInq()){\n\t\t\t\t\tSystem.out.println(t.getName() + \"\\t___New REQ has HIGHER priority___\");\n\t\t\t\t\tsendInq(myNodeId, currNode, quorum, clock);\n\t\t\t\t\t\n\t\t\t\t\t//Sent an INQ already to node whose is request is being processed. Can't send anymore INQ\n\t\t\t\t\tquorum.setCanSendInq(false);\n\t\t\t\t}\n\t\t\t\telse if(reqPriority == currPriority && reqNode < currNode && quorum.isCanSendInq()){\n\t\t\t\t\tSystem.out.println(t.getName() + \"\\t_____ New REQ has SAME priority but LOWER NodeId___\");\n\t\t\t\t\tsendInq(myNodeId, currNode, quorum, clock);\n\t\t\t\t\t\n\t\t\t\t\t//Sent an INQ already to node whose is request is being processed. Can't send anymore INQ\n\t\t\t\t\tquorum.setCanSendInq(false);\n\t\t\t\t}\n\t\t\t\t//If new request has lower priority, send FAIL to requesting node, JUST ONCE\n\t\t\t\telse{\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(t.getName() + \"\\t___FAILED__\");\n\t\t\t\t\tsendFail(myNodeId, reqNode, quorum, clock);\n\t\t\t\t\t\n\t\t\t\t\t//If a fail has been sent to the node, further fails can't be sent\n\t\t\t\t\t//quorum.getSentFailTo().add(reqNode);\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\tSystem.out.println(t.getName() + \"\\t ****** Quorum is NOT LOCKED for \"+ quorum.getPermissionGivenTo() + \" ****** \");\n\t\t\t\t\n\t\t\t\t//Sending TOKEN to self\n\t\t\t\tif(reqNode == myNodeId){\n\t\t\t\t\tSystem.out.println(t.getName()+\"\\t********* Received TOKEN of OWN node *********\");\n\t\t\t\t\t\n\t\t\t\t\t//Remove the nodeId from the list of tokenPending\n\t\t\t\t\tquorum.removePermissionPending(reqNode);\n\t\t\t\t\t\n\t\t\t\t\t//Check if it can enter critical section\n\t\t\t\t\tif(quorum.canEnterCritSec())\n\t\t\t\t\t\tcritSecExec(myNodeId, quorum, file, clock);\n\t\t\t\t\telse{\n\t\t\t\t\t\tSystem.out.println(t.getName() + \"\\tCAN'T ENTER CRITICAL SECTION YET. PERMISSIONS PENDING FROM: \");\n\t\t\t\t\t\tquorum.printPermissionsPendingList();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//Setting details of request for which the TOKEN was sent\n\t\t\t\t\tquorum.setReqWithToken(msgFromClient);\n\t\t\t\t\tquorum.setPermissionGivenTo(reqNode);\n\t\t\t\t\tquorum.setPermissionGivenToPriority(reqPriority);\n\t\t\t\t\t\n\t\t\t\t\t//New TOKEN granted and so canSendInq and canSendFail booleans should be allowed\n\t\t\t\t\tquorum.setCanSendInq(true);\n\t\t\t\t\t//quorum.setCanSendFail(true);\n\t\t\t\t\t\n\t\t\t\t\t//Locking node for current request\n\t\t\t\t\tquorum.locked.compareAndSet(false, true);\n\n\t\t\t\t\t//continue;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t//Sending TOKEN to others\n\t\t\t\t\tString destIpAdd = file.getIpAddressList().get(reqNode);\n\t\t\t\t\tint destPort = file.getPortList().get(reqNode);\n\t\t\t\t\tSystem.out.println(t.getName() + \"\\tDestIpAdd: \" + destIpAdd + \" DestPortNo: \" + destPort);\n\t\t\t\t\t\n\t\t\t\t\t//Setting client according to the quorum hashMap\n\t\t\t\t if(quorum.getQuorumSockets().containsKey(reqNode)){\n\t\t\t\t \tSystem.out.println(t.getName() + \"\\tGetting old socket\");\n\t\t\t\t\t\tclient = quorum.getQuorumSockets().get(reqNode);\n\t\t\t\t }\n\t\t\t\t\telse{\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tSystem.out.println(t.getName() + \"\\tCreating new socket\");\n\t\t\t\t\t\t\tclient = new Socket(destIpAdd, destPort);\n\t\t\t\t\t\t\tquorum.getQuorumSockets().put(reqNode, client);\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t \n\t\t\t\t //Ticking clock for SEND event\n\t\t\t\t /*try {\n\t\t\t\t\t\tclock.tick(0, 0);\n\t\t\t\t\t} catch (InterruptedException e1) {\n\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\te1.printStackTrace();\n\t\t\t\t\t}*/\n\t\t\t\t \n\t\t\t\t\t//****************** If unlocked, check for no pending requests ***********************\n\n\t\t\t\t\toutToClient = new DataOutputStream(client.getOutputStream());\n\t\t\t\t\tString msgToSend = \"TOK \" + myNodeId + \" \" + clock.getClockVal();\n\t\t\t\t\t\n\t\t\t\t\tsynchronized(outToClient){\n\t\t\t\t\t\toutToClient.writeBytes(msgToSend+\"\\n\");\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(t.getName()+ \"\\t***************** PERMISSION GRANTED TOKEN TO: \" + reqNode + \" ******************\");\n\t\t\t\t\t\n\t\t\t\t\t//Setting details of request for which the TOKEN was sent\n\t\t\t\t\tquorum.setReqWithToken(msgFromClient);\n\t\t\t\t\tquorum.setPermissionGivenTo(reqNode);\n\t\t\t\t\tquorum.setPermissionGivenToPriority(reqPriority);\n\t\t\t\t\t\n\t\t\t\t\t//New TOKEN granted and so canSendInq and canSendFail booleans should be allowed\n\t\t\t\t\tquorum.setCanSendInq(true);\n\t\t\t\t\t\n\t\t\t\t\t//Locking node for current request\n\t\t\t\t\tquorum.locked.compareAndSet(false, true);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t}", "void fireTorrentStarted(TorrentId torrentId);", "@Override\n void enqueueBlockRequest(int index, int position, int length) {\n enqueue(pmCache.request(index, position, length));\n }", "public void passReq(Packet request){\r\n\t\ttry { bQueue.put(request);\r\n\t\t} catch (InterruptedException e) { e.printStackTrace(); }\r\n\t}", "@Override\n\t\t\t\t\tpublic void onDataCallBack(String request, int code) {\n\t\t\t\t\t\tuploadMsg(fUerInfo);\n\t\t\t\t\t}", "public void procRequest ()\r\n\t{\r\n\t\tthis.simTime = this.sim.getTimer();\r\n\t\tthis.request.setStartTime(simTime);\r\n\t\t//Debug/System.out.println(Fmt.time(simTime)\r\n\t\t//Debug/\t+ \": <procRequest> \" + request);\r\n\r\n\t\t//\tNeed to move from current cylinder to requested cylinder.\r\n\t\t//\tIf current == requested, no action.\r\n\t\tif (this.cylinder != this.request.getCylinder())\r\n\t\t\tthis.simTime += this.calcSeekTime(this.request.getCylinder());\r\n\t\tthis.sim.addEvent(new Event(Event.SEEK_SATISFIED, this.simTime));\r\n\t}", "private void getData() {\n\n //Adding the method to the queue by calling the method getDataFromServer\n requestQueue.add(getDataFromServer(pos));\n\n }", "private void preRequest() {\n\t\tSystem.out.println(\"pre request, i am playing job\");\n\t}", "@Override\r\n\tpublic void run() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t//Get a list of pairs. The pair will be a chunkname with a chunkserver \r\n\t\t/*for(Pair<String, String> p: EventFactory.hostToFiles.getChunkLocations(message.getContent())){\r\n\t\t\tSystem.out.println(\"The location is: \" + p.getKey() + \" and the chunkname is: \" + p.getValue());\r\n\t\t\t\r\n\t\t\t//actual code will contact chunk servers and tell them to read and forward the file to the client\r\n\t\t\tMessage forwardToClient = new Message(\"ForwardChunkToClient\");\r\n\t\t\t//chunkname, servername, port\r\n\t\t\tforwardToClient.setContent(p.getKey());\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\tTCPSender sender = new TCPSender(new Socket(p.getValue().split(\" \")[0], Integer.parseInt(p.getValue().split(\" \")[1])));\r\n\t\t\t\tsender.sendData(forwardToClient);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t} catch (NumberFormatException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (UnknownHostException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}*/\r\n\t\t//Send the list to the client so it can request the chunks from chunkServers\r\n\t\t//Any other way seems like it would be beyond a pain. \r\n\t\tLinkedList<String> fileAndHosts = new LinkedList<String>();\r\n\t\tfor(PairStrings p: EventFactory.hostToFiles.getChunkLocations(message.getContent())) {\r\n\t\t\tString fileAndHost = p.getValue() + \" \" + p.getKey();\r\n\t\t\tfileAndHosts.add(fileAndHost);\r\n\t\t}\r\n\t\t\r\n\t\tMessage getFromChunkServers = new Message(\"RequestChunksFromServers\");\r\n\t\t\r\n\t\t//If the list is empy, the no file was found, report invalid.\r\n\t\tif(fileAndHosts.size() == 0) {\r\n\t\t\tgetFromChunkServers.setList(fileAndHosts);\r\n\t\t\tgetFromChunkServers.setContent(\"invalid\" + \" \" + message.getContent());\r\n\t\t} else {\r\n\t\t\tgetFromChunkServers.setList(fileAndHosts);\r\n\t\t\tgetFromChunkServers.setContent(\"valid\" + \" \" + message.getContent());\r\n\t\t}\r\n\t\t\r\n\t\ttry {\r\n\t\t\tTCPSender sender = new TCPSender(new Socket(message.getSenderHostName(), message.getSenderPort()));\r\n\t\t\tsender.sendData(getFromChunkServers);\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "@Override\n public void run() {\n final Node node = infoData.getNode(query.getPath());\n if (!node.isEmpty()) {\n List<? extends Event> infoEvents =\n infoSyncTree.applyServerOverwrite(query.getPath(), node);\n postEvents(infoEvents);\n onComplete.onListenComplete(null);\n }\n }", "@Override\n void enqueuePiece(ByteBuffer buffer, int index, int position, int length, Object params)\n {\n// if (DEBUG) System.out.println(\"[stdpc] enqueuePiece:\" + index + \",\" + position + \",\" + length + \" buf:\" + buffer.remaining());\n// sendQueue.forEach(pm ->\n// System.out.println(\" -s> \" + System.identityHashCode(pm) + \" \" +pm.type + \" ,\" + pm.index +\",\" + pm.begin + \",\" + pm.length)\n// );\n// peerBlockRequests.forEach(pm -> {\n// System.out.println(\" -p> \" + pm.type + \" ,\" + pm.index +\",\" + pm.begin + \",\" + pm.length);\n// });\n\n\n boolean found = false;\n\n // check for the active linked peer request and remove it\n for (int i = 0; i < peerBlockRequests.size(); i++) {\n StdPeerMessage pm = peerBlockRequests.get(i);\n if ((pm.index == index)\n && (pm.begin == position)\n && (pm.length == length))\n {\n peerBlockRequests.remove(i);\n pmCache.release(pm);\n found = true;\n break;\n }\n }\n if (!found && DEBUG) {\n if (DEBUG) System.out.println(\"[stdpc] pBR not found\");\n }\n\n enqueue(pmCache.piece(index, position, length, buffer, params));\n }", "public void run()\n\t{\n\t\t// The instance of the received broadcast request. 11/29/2014, Bing Li\n\t\tSearchKeywordBroadcastRequest request;\n\t\t// The thread always runs until it is shutdown by the BoundNotificationDispatcher. 11/29/2014, Bing Li\n\t\twhile (!this.isShutdown())\n\t\t{\n\t\t\t// Check whether the notification queue is empty. 11/29/2014, Bing Li\n\t\t\twhile (!this.isEmpty())\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t// Dequeue the request. 11/29/2014, Bing Li\n\t\t\t\t\trequest = this.getNotification();\n\t\t\t\t\t// Disseminate the broadcast request to the local node's children. 11/29/2014, Bing Li\n\t\t\t\t\tMemoryMulticastor.STORE().disseminateSearchKeywordRequestAmongSubMemServers(request);\n\t\t\t\t\t// Notify the binder that the thread's task on the request has done. 11/29/2014, Bing Li\n\t\t\t\t\tthis.bind(super.getDispatcherKey(), request);\n\t\t\t\t}\n\t\t\t\tcatch (InterruptedException e)\n\t\t\t\t{\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// Wait for a moment after all of the existing requests are processed. 11/29/2014, Bing Li\n\t\t\t\tthis.holdOn(ServerConfig.NOTIFICATION_THREAD_WAIT_TIME);\n\t\t\t}\n\t\t\tcatch (InterruptedException e)\n\t\t\t{\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public synchronized void handle(PBFTRequest r){\n \n Object lpid = getLocalServerID();\n\n JDSUtility.debug(\"[handle(request)] s\" + lpid + \", at time \" + getClockValue() + \", received \" + r);\n\n StatedPBFTRequestMessage loggedRequest = getRequestInfo().getStatedRequest(r);\n \n /* if the request has not been logged anymore and it's a old request, so it was garbage by checkpoint procedure then I must send a null reply */\n if(loggedRequest == null && getRequestInfo().isOld(r)){\n IProcess client = new BaseProcess(r.getClientID());\n PBFTReply reply = new PBFTReply(r, null, lpid, getCurrentViewNumber());\n emit(reply, client);\n return;\n \n }\n \n try{\n /*if the request is new and hasn't added yet then it'll be added */\n if(loggedRequest == null){\n /* I received a new request so a must log it */\n loggedRequest = getRequestInfo().add(getRequestDigest(r), r, RequestState.WAITING);\n loggedRequest.setRequestReceiveTime(getClockValue());\n }\n\n /* if I have a entry in request log but I don't have the request then I must update my request log. */\n if(loggedRequest.getRequest() == null) loggedRequest.setRequest(r);\n \n /*if the request was served the I'll re-send the related reply if it has been logged yet.*/\n if(loggedRequest.getState().equals(RequestState.SERVED)){\n JDSUtility.debug(\"[handle(request)] s\" + lpid + \" has already served \" + r);\n\n /* retransmite the reply when the request was already served */\n PBFTReply reply = getRequestInfo().getReply(r);\n IProcess client = new BaseProcess(r.getClientID());\n emit(reply, client);\n return;\n }\n \n /* If I'm changing then I'll do nothing more .*/\n if(changing()) return;\n\n PBFTPrePrepare pp = getPrePreparebackupInfo().get(getCurrentViewNumber(), getCurrentPrimaryID(), loggedRequest.getDigest());\n\n if(pp != null && !isPrimary()){\n /* For each digest in backuped pre-prepare, I haven't all request then it'll be discarded. */\n DigestList digests = new DigestList();\n for(String digest : pp.getDigests()){\n if(!getRequestInfo().hasRequest(digest)){\n digests.add(digest);\n }\n }\n \n if(digests.isEmpty()){\n handle(pp);\n getPrePreparebackupInfo().rem(pp);\n return;\n } \n }\n\n boolean committed = loggedRequest.getState().equals( RequestState.COMMITTED );\n \n// /* if my request was commit and it hasn't been served yet I must check the stated of the request */\n if(committed){\n tryExecuteRequests();\n return;\n }\n \n /* performs the batch procedure if the server is the primary replica. */\n if(isPrimary()){\n JDSUtility.debug(\"[handle(request)] s\" + lpid + \" (primary) is executing the batch procedure for \" + r + \".\");\n batch();\n }else{\n /* schedules a timeout for the arriving of the pre-prepare message if the server is a secundary replica. */\n scheduleViewChange();\n }//end if is primary\n \n }catch(Exception e){\n e.printStackTrace();\n }\n }", "@Override\r\n\tprotected byte[] handleSpecificRequest(String request) {\r\n\t\tif (!Utils.isEmpty(request)) {\r\n\t\t\tlogger.info(\"$$$$$$$$$$$$Message received at Tracking Server:\" + request);\r\n\t\t\tif (request.startsWith(NODE_REQUEST_TO_SERVER.FILE_LIST.name())) {\r\n\t\t\t\thandleFileUpdateMessage(request);\r\n\t\t\t\treturn Utils.stringToByte(SharedConstants.COMMAND_SUCCESS);\r\n\t\t\t} else if (request.startsWith(NODE_REQUEST_TO_SERVER.FIND.name())) {\r\n\t\t\t\tString peers = handleFindFileRequest(request);\r\n\t\t\t\treturn Utils.stringToByte((Utils.isEmpty(peers) ? SharedConstants.COMMAND_FAILED\r\n\t\t\t\t\t\t: SharedConstants.COMMAND_SUCCESS) + SharedConstants.COMMAND_PARAM_SEPARATOR + peers);\r\n\r\n\t\t\t} else if (request.startsWith(NODE_REQUEST_TO_SERVER.FAILED_PEERS.name())) {\r\n\t\t\t\thandleFailedPeerRequest(request);\r\n\t\t\t\treturn Utils.stringToByte(SharedConstants.COMMAND_SUCCESS);\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn Utils.stringToByte(SharedConstants.INVALID_COMMAND);\r\n\r\n\t}", "@Override\n\tpublic void receiveRequest() {\n\n\t}", "public synchronized void onNewRequest() {\r\n\t\tallRequestsTracker.onNewRequest();\r\n\t\trecentRequestsTracker.onNewRequest();\r\n\t}", "@Override\n public void run() {\n\n queryForRoutingManager();\n File f = IMbuffer.fetchFromIMInputBuffer();\n if (f.getName().startsWith(\"Responseto\")) {\n transfertopurge(f);\n }\n }", "@Override\r\n\t\t\tprotected Vector prepareRequests(ACLMessage request) {\n\t\t\t\tString incomingRequestKey = (String) ((AchieveREResponder) parent).REQUEST_KEY;\r\n\t\t\t\tACLMessage incomingRequest = (ACLMessage) getDataStore().get(incomingRequestKey);\r\n\t\t\t\t// Prepare the request to forward to the responder\r\n\t\t\t\tSystem.out.println(\"Agent \"+getLocalName()+\": Forward the request to \"+bestOffer.getName());\r\n\t\t\t\tACLMessage outgoingRequest = new ACLMessage(ACLMessage.REQUEST);\r\n\t\t\t\toutgoingRequest.setProtocol(FIPANames.InteractionProtocol.FIPA_REQUEST);\r\n\t\t\t\toutgoingRequest.addReceiver(bestOffer);\r\n\t\t\t\toutgoingRequest.setContent(incomingRequest.getContent());\r\n\t\t\t\toutgoingRequest.setReplyByDate(incomingRequest.getReplyByDate());\r\n\t\t\t\tVector v = new Vector(1);\r\n\t\t\t\tv.addElement(outgoingRequest);\r\n\t\t\t\treturn v;\r\n\t\t\t}", "@Override\n //here the messageReceived method is implemented\n public void messageReceived(String message) {\n publishProgress(message);\n }", "@Override\n //here the messageReceived method is implemented\n public void messageReceived(String message) {\n publishProgress(message);\n }", "@Override\n //here the messageReceived method is implemented\n public void messageReceived(String message) {\n publishProgress(message);\n }", "@Override\n //here the messageReceived method is implemented\n public void messageReceived(String message) {\n publishProgress(message);\n }", "void fireMetadataAvailable(TorrentId torrentId, Torrent torrent);", "void enqueue(String object);", "entities.Torrent.UploadRequest getUploadRequest();", "@Override\n\t\t\t\t\tpublic void onReqStart() {\n\t\t\t\t\t}", "entities.Torrent.LocalSearchRequest getLocalSearchRequest();", "@Override\n public void handleClientRequest(User sender, ISFSObject params) {\n }", "public void start() {\n retainQueue();\n mRequestHandle = mRequestQueue.queueRequest(mUrl, \"GET\", null, this, null, 0);\n }", "@Override\n\tpublic void processRequest(RequestEvent requestEvent) {\n\t\t requestEvent.getServerTransaction();\n\t\tSystem.out.println(\"Sending ------------------------------------------------------------------------------------------\");\n\t\tSystem.out.println(\"[]:\"+requestEvent.toString());\n\t}", "private void sendSetRequest() {\r\n\t\tnumOfSets++;\r\n\t\ttype = \"0\";\r\n\t\tnumOfRecipients = servers.size();\r\n\t\tfor(ServerHandler s : servers) {\r\n\t\t\ts.send(this, input);\r\n\t\t}\r\n\t\tsendTime = System.nanoTime();\r\n\r\n\t\tworkerTime = sendTime - pollTime;\r\n\t\t\r\n\t\tfor(ServerHandler s : servers) {\r\n\t\t\tString ricevuto = s.receive();\r\n\t\t\treplies.add(ricevuto);\r\n\t\t}\r\n\t\treceiveTime = System.nanoTime();\r\n\t\tprocessingTime = receiveTime - sendTime;\r\n\t\t\r\n\t\t\r\n\t\tfor(String reply : replies) {\r\n\t\t\tif(!(\"STORED\".equals(reply))) {\r\n\t\t\t\tunproperRequests.add(reply);\r\n\t\t\t\tsendBack(currentJob.getClient(), reply);\r\n\t\t\t\treplies.clear();\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t}\r\n\t\tsendBack(currentJob.getClient(), \"STORED\");\r\n\t\treplies.clear();\r\n\t\t\r\n\t}", "public void sendRRequests() {\n\n }", "private void doRequest() {\n\n try {\n JsonObject request = new JsonObject()\n .put(\"action\", Math.random() < 0.5 ? \"w\" : \"r\")\n .put(\"timeOfRequest\", System.currentTimeMillis());\n\n if (request.getString(\"action\") == \"w\") {\n request.put(\"data\", new JsonObject()\n .put(\"key\", \"value\")\n );\n logger.debug(\"requesting write: \" + request.toString());\n eb.send(\"storage-write-address\", request, new DeliveryOptions().setSendTimeout(1000), this);\n } else {\n Random random = new Random();\n List<String> keys = new ArrayList<String>(map.keySet());\n String randomKey = keys.get(random.nextInt(keys.size()));\n request.put(\"id\", randomKey);\n logger.debug(\"waiting for read: \" + request.toString());\n eb.send(\"storage-read-address\", request, new DeliveryOptions().setSendTimeout(1000), this);\n }\n } catch (Exception e) {\n logger.warn(\"Error\");\n makeRequest();\n }\n\n }", "@Override\n public void run() {\n JSONObject ronfinfo = ConnectService\n .getIncidentbyHttpGet(AppConfig.URL_PUBLIC\n + \"Friend/ToApproveList?rongCloudIDs=\"\n + newbuilder);\n Log.e(\"url\", AppConfig.URL_PUBLIC\n + \"Friend/ToApproveList?rongCloudIDs=\" + newbuilder);\n List<AddFriend> addinfo = formatFrinds(ronfinfo);\n if (addinfo.size() > 0) {\n setFriendsNameTel(addinfo);\n }\n handler.obtainMessage(AppConfig.LOAD_FINISH).sendToTarget();\n }", "void onChoke(boolean state)\n {\n peerChoke = state;\n //if (DEBUG) System.out.println(peer.address + \" onChoke: \" + state);\n\n if (peerChoke) {\n // remove all enqueued requests as they will be dropped by the remote peer\n for (int i = sendQueue.size() - 1; 0 <= i; i--) {\n StdPeerMessage pm = sendQueue.get(i);\n if (pm.type == StdPeerMessage.REQUEST) {\n sendQueue.remove(i);\n // notify torrent about cancelled request\n torrent.cancelBlockRequest(pm.index, pm.begin);\n pmCache.release(pm);\n }\n }\n // it's possible that we have requests that were already sent to external peer,\n // notify torrent - they are cancelled too [who knows, maybe data will arrive]\n for (int i = 0; i < blockRequests.size(); i++) {\n StdPeerMessage pm = blockRequests.get(i);\n torrent.cancelBlockRequest(pm.index, pm.begin);\n pmCache.release(pm);\n }\n blockRequests.clear();\n }\n }", "@Override\n\tpublic void enqueue(ActorRef arg0, Envelope arg1) {\n\t\t\n\t}", "@Override\r\n\t\t\tpublic void onRequest() {\n\t\t\t\t\r\n\t\t\t}", "@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\thandlHttpRequest(url, trackerinfo.get_info_hash(), Settings.PEER_DEFAULT_ID);\n\t\t\t\t\t}", "public void sendRequest(byte[] request) {\n // send request\n try {\n //get file id and chunk number\n String[] req = new String(request).split(\" \",5);\n String fileID = req[3] , chunkNo = req[4];\n\n //create socket\n MulticastSocket socket = new MulticastSocket(this.mcastPort);\n\n socket.setTimeToLive(1);\n socket.joinGroup(InetAddress.getByName(mscastAdress));\n\n int time = new Random().nextInt(400);\n socket.setSoTimeout(time); //max time it will listen to\n\n //listen for x time\n long oldTime = System.currentTimeMillis();\n byte[] b = new byte[65000];\n\n DatagramPacket receive = new DatagramPacket(b,b.length);\n while(System.currentTimeMillis()-oldTime < time){\n\n try {\n socket.receive(receive);\n }catch (IOException e)\n {\n System.out.println(\"\\nReached time out - no one has sent PUTCHUNK!\");\n break;\n }\n\n String[] ms = new String(receive.getData()).split(\" \",6);\n\n if(ms[1]==\"PUTCHUNK\" && ms[3]==fileID && ms[4]==chunkNo){\n System.out.println(\"Someone already sent it!\");\n socket.close();\n return;//exit\n }\n }\n\n //sending request\n DatagramPacket replyPacket = new DatagramPacket(request, request.length, InetAddress.getByName(mscastAdress), mcastPort);\n socket.send(replyPacket);\n\n System.out.println(\"In PUTCHUNK - Sent packet, no one has sent it\");\n socket.close();\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "private void sendDataToQueue(byte[] data){\n\t\t//*****************************************\n\t\t//Se possuir o Prefixo de Comando Interno, então envia o Comando para a Fila de Comandos Internos do Core\n\t\t// Do contrário envia o Comando para a Fila de Dados a Serem enviados pelo BluetootSenderWorker ao Carro\n\t\tif(new String(data).contains(SystemProperties.COMANDO_INTERNO_PREFIXO)){\n\t\t\tthis.systemCore.addDataToInternalCommandQueue(data);\n\t\t\tthis.sendMessageToPrompt(\"Comando enviado a Fila de comandos Internos do Dispositivo Android...\");\n\t\t}else{\n\t\t\tthis.systemCore.addDataToCarControlQueue(data);\n\t\t\tthis.sendMessageToPrompt(\"Controle enviado a Fila de dados a serem enviados ao Carro...\");\n\t\t}\n\t}", "public void run(){\n // first register the producer\n m_DirectoryQueue.registerProducer();\n\n enqueueFiles(f_Root);\n\n //lastly unregister the producer\n m_DirectoryQueue.unregisterProducer();\n }", "private void sendRequest() {\n\t\tloading = ProgressDialog.show(this, \"Loading\", \"Please wait...\");\n\n\t\tUri.Builder uri = new Uri.Builder();\n\t\turi.authority(DatabaseContract.PROVIDER_NAME);\n\t\turi.path(Integer.toString(Constants.LOADREQUESTSCMD));\n\t\turi.scheme(\"content\");\n\n\t\tIntent intent = new Intent(this, MyService.class);\n\t\tintent.putExtra(\"ACTION\", \"QUERY\");\n\t\tintent.setData(uri.build());\n\n\t\trequestid = new Date().getTime();\n\t\tintent.putExtra(\"requestid\", requestid);\n\t\tstartService(intent);\n\t}", "void enqueue(BasePayload payload, EnqueueCallback callback);", "public void run()\n\t{\n\t\twhile (!this.isFinished)\n\t\t{\n\t\t\tMessage request = this.mBuff.get(); // get request from own mailbox\n\n\t\t\t// how many times has the follower danced with the requester.\n\t\t\t// might be faster with an array of timesDanced values for each leader known\n\t\t\tint count = 0;\n\t\t\tfor (int i=0; i<mDanceCard.length; i++)\n\t\t\t{\n\t\t\t\tif (mDanceCard[i] == request.dancer.getDancerID())\n\t\t\t\t\tcount++;\n\t\t\t}\n\t\t\t\n\t\t\t//System.out.println(mNumber + \" Being asked to dance: \" + request.dance_number + \" by \" \n\t\t\t//\t\t\t\t\t+ request.dancer.getDancerID());\n\n\t\t\tLeader leader = (Leader)request.dancer;\n\t\t\tif (mDanceCard[request.dance_number] != 0 || count >= 2) // nope.\n\t\t\t{\n\t\t\t\trequest.dance_number = -1;\n\t\t\t\tthis.put(request, leader); \t// send back request with -1 for dance_number\n\t\t\t}\n\t\t\telse // say yes! mark card and see if you're done\n\t\t\t{\n\t\t\t\tthis.markCard(request.dance_number, request.dancer.getDancerID());\n\t\t\t\trequest.dancer = this;\n\t\t\t\tthis.put(request, leader);\t// send back request, but with the follower's own number\n\t\t\t}\n\t\t}\n\t\t//System.out.println(\"Follower \" + mNumber + \" is finished.\");\n\t\t\n\t\t// still check requests, but refuse them all.\n\t\twhile (this.isFinished)\n\t\t{\n\t\t\tMessage request = this.mBuff.get();\n\n\t\t\tLeader leader = (Leader)request.dancer;\n\t\t\trequest.dance_number = -1;\n\t\t\tthis.put(request, leader);\n\t\t}\n\t}", "@Override\n public void dataAvailable(byte[] data, Connection ignoreMe) {\n // Now get the data, and send it back to the listener.\n try {\n disconnect(ignoreMe);\n Message message = NonblockingResolver.parseMessage(data);\n\n if (message != null && LOG.isTraceEnabled()) {\n LOG.trace(\"dataAvailable(\" + data.length + \" bytes)\");\n LOG.trace(message);\n }\n\n NonblockingResolver.verifyTSIG(query, message, data, tsig);\n // Now check that we got the whole message, if we're asked to do so\n if (!tcp && !ignoreTruncation\n && message.getHeader().getFlag(Flags.TC)) {\n // Redo the query, but use tcp this time.\n tcp = true;\n // Now start again with a TCP connection\n startConnect();\n return;\n }\n if (query.getHeader().getID() != message.getHeader().getID()) {\n// System.out.println(\"Query wrong id! Expected \" + query.getHeader().getID() + \" but got \" + message.getHeader().getID());\n return;\n }\n returnResponse(message);\n } catch (IOException e) {\n returnException(e, null);\n }\n }", "private void sendMsg()\n {\n try {\n spauldingApp.println(\"AckRequest.sendMsg() - sending request to nodeID= \" + node.getNodeID() + \" ...\");\n this.nbrTransmits++;\n //spauldingApp.eventLogger.writeMsgSentPing(fetchReqMsg);\n spauldingApp.getMoteIF().send(node.getNodeID(), requestMsg);\n } catch (Exception e) {\n spauldingApp.println(\"ERROR: Can't send message: \" + e);\n e.printStackTrace();\n }\n }", "private void add(Pair<MarketDataRequestAtom,Event> inData)\n {\n getQueue().add(inData);\n }", "@Override\r\n public void run() {\r\n \t// increases the internal producers counter of the queue by one.\r\n this.directory_queue.registerProducer();\r\n directory_queue.enqueue(this.root);\r\n try {\r\n \taddPath(this.root);\r\n } catch (IllegalArgumentException e) {\r\n \tSystem.err.println(e.toString());\r\n \t//e.printStackTrace();\r\n }\r\n // Unregisters a producer from the queue.\r\n this.directory_queue.unregisterProducer();\r\n }", "void process(ToSend m) {\n ByteBuffer requestBuffer = buildMsg(m.state.ordinal(), m.leader, m.zxid, m.electionEpoch, m.peerEpoch, m.configData);\n\n manager.toSend(m.sid, requestBuffer);\n\n }", "public void enqueue(Object data){\r\n super.insert(data, 0);//inserts it to the first index everytime (for tostring)\r\n }", "@Override\r\n\t\tpublic void action() {\n\t\t\t\r\n\t\t\tACLMessage request = new ACLMessage (ACLMessage.REQUEST);\r\n\t\t\trequest.setProtocol(FIPANames.InteractionProtocol.FIPA_REQUEST);\r\n\t\t\trequest.addReceiver(new AID(\"BOAgent\",AID.ISLOCALNAME));\r\n\t\t\trequest.setLanguage(new SLCodec().getName());\t\r\n\t\t\trequest.setOntology(RequestOntology.getInstance().getName());\r\n\t\t\tInformMessage imessage = new InformMessage();\r\n\t\t\timessage.setPrice(Integer.parseInt(price));\r\n\t\t\timessage.setVolume(Integer.parseInt(volume));\r\n\t\t\ttry {\r\n\t\t\t\tthis.agent.getContentManager().fillContent(request, imessage);\r\n\t\t\t} catch (CodecException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t} catch (OntologyException e) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tthis.agent.addBehaviour(new AchieveREInitiator(this.agent, request)\r\n\t\t\t{\t\t\t\r\n\t\t\t/**\r\n\t\t\t\t * \r\n\t\t\t\t */\r\n\t\t\t\tprivate static final long serialVersionUID = -8866775600403413061L;\r\n\r\n\t\t\t\tprotected void handleInform(ACLMessage inform)\r\n\t\t\t\t{\t\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t});\r\n\t\t}", "private Request(MarketDataRequestAtom inAtom,\n MarketDataRequest inCompleteRequest)\n {\n atom = inAtom;\n receiver.subscribe(this);\n flow = moduleManager.createDataFlow(new DataRequest[] { new DataRequest(feed.getURN(),generateRequestFromAtom(inAtom,inCompleteRequest)),new DataRequest(receiver.getURN()) });\n }", "@Override \n\t\t public void run() {\n\t\t \t\n\t\t \tif (isCompleteQuery) {\n\t\t \t\tisCompleteQuery = !isCompleteQuery;\n\t\t \t\t\n\t\t \t\tMessage message = new Message(); \n\t\t\t message.what = 911; \n\t\t\t handler.sendMessage(message); \n\t\t\t LogUtils.i(\"*****************定时任务查询\");\n\t\t\t\t}\n\t\t \n\t\t }", "public void sendGetRequest() {\r\n\t\tString[] requests = this.input.substring(4, this.input.length()).split(\" \"); \r\n\t\t\r\n\t\tif(requests.length <= 1 || !(MyMiddleware.readSharded)){\r\n\t\t\tnumOfRecipients = 1;\r\n\t\t\trecipient = servers.get(loadBalance());\r\n\r\n\t\t\trecipient.send(this, input);\r\n\t\t\tsendTime = System.nanoTime();\r\n\r\n\t\t\tworkerTime = sendTime - pollTime;\r\n\r\n\t\t\t\r\n\t\t\tif(requests.length <= 1) {\r\n\t\t\t\tnumOfGets++;\r\n\t\t\t\ttype= \"10\";\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\tnumOfMultiGets++;\r\n\t\t\t\ttype = requests.length+\"\";\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tString reply = recipient.receive();\r\n\t\t\treceiveTime = System.nanoTime();\r\n\t\t\tprocessingTime = receiveTime - sendTime;\r\n\t\t\t\r\n\t\t\tint hit = 0;\r\n\t\t\thit += reply.split(\"VALUE\").length - 1;\r\n\t\t\tmiss += requests.length-hit;\r\n\r\n\t\t\tif(!(reply.endsWith(\"END\"))) {\r\n\t\t\t\tunproperRequests.add(reply);\r\n\t\t\t\tsendBack(currentJob.getClient(), reply);\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\tsendBack(currentJob.getClient(), reply);\r\n\r\n\t\t}\r\n\t\telse {\r\n\t\t\tnumOfMultiGets++;\r\n\t\t\ttype = requests.length+\"\";\r\n\t\t\tnumOfRecipients = servers.size();\r\n\t\t\trequestsPerServer = requests.length / servers.size();\r\n\t\t\tremainingRequests = requests.length % servers.size() ;\r\n\t\t\t\r\n\t\t\t//The worker thread sends a number of requests to each server equal to requestsPerServer \r\n\t\t\t//and at most requestsPerServer + remainingRequests\r\n\t\t\t\r\n\t\t\tfor(int i = 0; i < servers.size(); i++) {\r\n\t\t\t\tmessage = requestType;\r\n\t\t\t\tfor(int j = 0; j < requestsPerServer; j++){\r\n\t\t\t\t\tmessage += \" \";\r\n\t\t\t\t\tmessage += requests[requestsPerServer*i+j];\r\n\t\t\t\t\tif(i < remainingRequests) {\r\n\t\t\t\t\t\tmessage += \" \";\r\n\t\t\t\t\t\tmessage += requests[requests.length - remainingRequests + i];\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tservers.get(i).send(this, message);\r\n\t\t\t}\r\n\t\t\tsendTime = System.nanoTime();\r\n\r\n\t\t\tworkerTime = sendTime - pollTime;\r\n\r\n\t\t\tint hit = 0;\r\n\t\t\tfor(ServerHandler s : servers) {\r\n\t\t\t\tString ricevuto = s.receive();\r\n\t\t\t\thit += ricevuto.split(\"VALUE\").length - 1;\r\n\t\t\t\treplies.add(ricevuto);\r\n\t\t\t}\r\n\t\t\treceiveTime = System.nanoTime();\r\n\t\t\tprocessingTime = receiveTime - sendTime;\r\n\r\n\t\t\tmiss += requests.length-hit;\r\n\t\t\t\r\n\t\t\tfinalReply = \"\";\r\n\t\t\tfor(String reply : replies) {\r\n\t\t\t\tif(!(reply.endsWith(\"END\"))) {\r\n\t\t\t\t\tunproperRequests.add(reply);\r\n\t\t\t\t\tsendBack(currentJob.getClient(), reply);\r\n\t\t\t\t\treplies.clear();\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\treply = reply.substring(0, reply.length() - 3);\r\n\t\t\t\t\tfinalReply += reply;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tfinalReply += \"END\";\r\n\t\t\tsendBack(currentJob.getClient(), finalReply);\r\n\t\t\treplies.clear();\r\n\r\n\t\t}\r\n\t\t\r\n\t}", "@Override\n public void executeUpdate() {\n EventBus.publish(new DialogCraftingReceivedEvent(requestId, title, groups, craftItems));\n }", "public void run() {\n // System.out.println(\"bsid\\tiid\\tid\\tmethod name\");\n\n while (true) {\n // get interaction\n Hashtable<Integer, ArrayList<Request>> interaction = father\n .getInteraction();\n\n if (interaction == null) {\n break;\n }\n\n // execute interaction\n executeInteraction(interaction);\n if (reqIndex >= maxNoOfRequests)\n break;\n }\n\n // System.out.println(\"Thread \" + threadId + \" is ending\");\n father.replayFinished();\n }", "@Override\n public void passSearchRequest(SearchReq searchReq) {\n\n// if (searchRequest.getCredential().getIp() == node.getCredential().getIp() && searchRequest.getCredential().getPort() == node.getCredential().getPort()) {\n if (searchReq.getCred().equals(node.getCred())) {\n return; // search query loop has eliminated\n }\n List<String> searchResult = checkFilesInFileList(searchReq.getFileName(), node.getFileList());\n logMe(\"Received SEARCH for \\\"\" + searchReq.getFileName() + \"\\\" from \" + searchReq.getCred().getNodeIp() + \":\" + searchReq.getCred().getNodePort() + \" at \" + getCurrentTime());\n if (!searchResult.isEmpty()) {\n SearchRes searchRes = new SearchRes(searchReq.getSeqNumber(), searchResult.size(), searchReq.getCred(), searchReq.getHopCount(), searchResult);\n searchOk(searchRes);\n } else {\n //logMe(\"File is not available at \" + node.getCredential().getIp() + \" : \" + node.getCredential().getPort() + \"\\n\");\n if (searchReq.getHopCount() <= TTL) {\n searchReq.setHopCount(searchReq.incHops());\n List<NetworkDetails> StatTableSearchResult = checkFilesInStatTable(searchReq.getFileName(), node.getNetworkDetailsTable());\n // Send search request to stat table members\n for (NetworkDetails networkDetails : StatTableSearchResult) {\n if (networkDetails.getQuery().equals(searchReq.getFileName())) {\n Cred cred = networkDetails.getServedNode();\n node.incForwardedQueryCount();\n search(searchReq, cred);\n }\n }\n //TODO: Wait and see for stat members rather flooding whole routing table\n // Send search request to routing table members\n for (Cred cred : node.getRoutingTable()) {\n node.incForwardedQueryCount();\n if (search(searchReq, cred)) {\n break;\n }\n }\n } else {\n// logMe(\"Search request from\" + searchRequest.getCredential().getIp() + \":\" + searchRequest.getCredential().getPort() + \"is blocked by hop TTL\\n\");\n }\n }\n// Thread.currentThread().interrupt();\n }", "@Override\n\tpublic void requestHandle(IPlayer player, IMessage message) {\n\t\t\n\t}", "entities.Torrent.DownloadRequest getDownloadRequest();", "@Override\n protected boolean performTask() {\n Map<WebSocketChannel, ProcessRequest> requests = this.channelManager.getRequests(MessageType.PROCESS_REQUEST);\n if (requests.isEmpty()) {\n return false;\n }\n\n List<Request> l = requests.entrySet().stream()\n .map(e -> new Request(e.getKey(), e.getValue()))\n .collect(Collectors.toList());\n\n dispatch(l);\n\n return false;\n }", "private void HandleRQ(DatagramSocket sendSocket, String requestedFile, int opcode) throws IOException {\n if(opcode == OP_RRQ) {\n // See \"TFTP Formats\" in TFTP specification for the DATA and ACK packet contents\n boolean result = send_DATA_receive_ACK(requestedFile, opcode, sendSocket);\n }\n\n else if (opcode == OP_WRQ) {\n boolean result = receive_DATA_send_ACK(requestedFile, opcode, sendSocket);\n }\n\n }", "private void processRequestMessage(ServerSessionFactory factory, JsonObject requestJsonObject,\n final ResponseSender responseSender, String transportId) throws IOException {\n\n final Request<JsonElement> request = JsonUtils.fromJsonRequest(requestJsonObject,\n JsonElement.class);\n\n switch (request.getMethod()) {\n case METHOD_CONNECT:\n\n log.debug(\"{} Req-> {} (transportId={})\", label, request, transportId);\n processReconnectMessage(factory, request, responseSender, transportId);\n break;\n case METHOD_PING:\n log.trace(\"{} Req-> {} (transportId={})\", label, request, transportId);\n processPingMessage(factory, request, responseSender, transportId);\n break;\n\n case METHOD_CLOSE:\n log.trace(\"{} Req-> {} (transportId={})\", label, request, transportId);\n processCloseMessage(factory, request, responseSender, transportId);\n\n break;\n default:\n\n final ServerSession session = getOrCreateSession(factory, transportId, request);\n\n log.debug(\"{} Req-> {} [jsonRpcSessionId={}, transportId={}]\", label, request,\n session.getSessionId(), transportId);\n\n // TODO, Take out this an put in Http specific handler. The main\n // reason is to wait for request before responding to the client.\n // And for no contaminate the ProtocolManager.\n if (request.getMethod().equals(Request.POLL_METHOD_NAME)) {\n\n Type collectionType = new TypeToken<List<Response<JsonElement>>>() {\n }.getType();\n\n List<Response<JsonElement>> responseList = JsonUtils.fromJson(request.getParams(),\n collectionType);\n\n for (Response<JsonElement> response : responseList) {\n session.handleResponse(response);\n }\n\n // Wait for some time if there is a request from server to\n // client\n\n // TODO Allow send empty responses. Now you have to send at\n // least an\n // empty string\n responseSender.sendResponse(new Response<Object>(request.getId(), Collections.emptyList()));\n\n } else {\n session.processRequest(new Runnable() {\n @Override\n public void run() {\n handlerManager.handleRequest(session, request, responseSender);\n }\n });\n }\n break;\n }\n\n }", "@Override\n public void run() {\n transmit_set();\n }", "private void requestHandler(Object context)\n {\n final String funcName = \"requestHandler\";\n @SuppressWarnings(\"unchecked\")\n TrcRequestQueue<Request>.RequestEntry entry = (TrcRequestQueue<Request>.RequestEntry) context;\n Request request = entry.getRequest();\n\n if (debugEnabled)\n {\n dbgTrace.traceEnter(funcName, TrcDbgTrace.TraceLevel.TASK, \"request=%s\", request);\n }\n\n request.canceled = entry.isCanceled();\n if (!request.canceled)\n {\n if (request.readRequest)\n {\n request.buffer = readData(request.address, request.length);\n if (debugEnabled)\n {\n if (request.buffer != null)\n {\n dbgTrace.traceInfo(funcName, \"readData(addr=0x%x,len=%d)=%s\",\n request.address, request.length, Arrays.toString(request.buffer));\n \n }\n }\n }\n else\n {\n request.length = writeData(request.address, request.buffer, request.length);\n }\n }\n\n if (request.completionEvent != null)\n {\n request.completionEvent.set(true);\n }\n\n if (request.completionHandler != null)\n {\n request.completionHandler.notify(request);\n }\n\n if (debugEnabled)\n {\n dbgTrace.traceExit(funcName, TrcDbgTrace.TraceLevel.TASK);\n }\n }", "private void uploadingPacketDealer(Packet packet) {\n short filenumber = packet.getFileNumber();\n boolean downloading = false;\n \n if (packet.hasSynchronizeFlag()) { \n receiver = new ReliableReceiver(sendQueue, filenumber, downloading, FOLDERPATHSERVER);\n this.receivingMap.put(filenumber, receiver);\n receiver.start();\n receiver.addToReadingQueue(packet.getContent(), packet.getSeqNumber(), packet.hasFinalFlag());\n } else if (packet.hasAcknowledgementFlag()) {\n sender = sendingMap.get(filenumber);\n sender.changeLastAcknowledgeReceived(packet.getAckNumber());\n sendQueue.stopTimeout(packet.getAckNumber()-1);\n } else {\n receiver = receivingMap.get(filenumber);\n receiver.addToReadingQueue(packet.getContent(), packet.getSeqNumber(), packet.hasFinalFlag());\n }\n \n }", "private void requestBucks() {\n\n\t}", "@Override\n\tpublic void onRequestStart(String reqId) {\n\t\t\n\t}", "private void HandleRQ(DatagramSocket sendSocket, String requestedFile, int opcode)\n {\n if(opcode == OP_RRQ)\n {\n // See \"TFTP Formats\" in TFTP specification for the DATA and ACK packet contents\n boolean result = send_DATA_receive_ACK(sendSocket, requestedFile);\n System.out.println(\"SENT SUCCESSFULLY: \" + result);\n }\n\n else if (opcode == OP_WRQ)\n {\n boolean result = receive_DATA_send_ACK(sendSocket, requestedFile);\n System.out.println(\"RECEIVED SUCCESSFULLY: \" + result);\n }\n }", "void sendData(String request) throws IOException {\n if (mmDevice == null) {\n Log.d(TAG, \"No device set\");\n }\n\n Log.d(TAG, \"Request is \" + request);\n if (mmOutputStream != null){\n mmOutputStream.write(request.getBytes(Charset.forName(\"UTF-8\")));\n }\n\n if (false && request.contains(\"travel\")) {\n closeBT();\n openBT();\n }\n }", "Aircraft enqueueAc(Aircraft aircraft);", "private void processStoreRequest(boolean initiatorPeer, Message request, ConcurrentHashMap<Integer, ChunkInfo> hashMap) {\n if (hashMap.get(request.getHeader().getChunkNo()) == null)\n return;\n\n ConcurrentHashMap<Integer, CopyOnWriteArrayList<Integer>> storesReceivedHash = peer.getFileSystem().getStoresReceived().get(request.getHeader().getFileId());\n\n if (storesReceivedHash == null) {\n storesReceivedHash = new ConcurrentHashMap<>();\n storesReceivedHash.put(request.getHeader().getSenderId(), new CopyOnWriteArrayList<>());\n }\n\n CopyOnWriteArrayList<Integer> listOfReceivedChunkOfThatSender = storesReceivedHash.get(request.getHeader().getSenderId());\n\n if (listOfReceivedChunkOfThatSender == null) {\n CopyOnWriteArrayList<Integer> newList = new CopyOnWriteArrayList<>();\n storesReceivedHash.put(request.getHeader().getSenderId(), newList);\n listOfReceivedChunkOfThatSender = newList;\n }\n\n\n if (listOfReceivedChunkOfThatSender.contains(request.getHeader().getChunkNo()))\n return;\n\n //Add the chunk No to the record\n listOfReceivedChunkOfThatSender.add(request.getHeader().getChunkNo());\n\n ChunkInfo chunkInfo = hashMap.get(request.getHeader().getChunkNo());\n\n chunkInfo.incrementReplicationLevel();\n\n hashMap.put(request.getHeader().getChunkNo(), chunkInfo);\n\n try {\n if (initiatorPeer) {\n peer.getFileSystem().writeInternalFileMetadataToDisk();\n } else {\n peer.getFileSystem().writeExternalFileChunksMetadataToDisk();\n }\n } catch (IOException e){\n log.error(\"Error while registering an increment of the perceivedReplication\");\n }\n }", "public synchronized void enqueue(TemperatureMessage t) throws RemoteException {\n //logger.log(Level.INFO, owner.ID() + \"Enqueueing \" + t.getPayload());\n\n this.temperatureQueue.add(t);\n }", "void fetchBarcodeData(String barcode) {\n if (!currentRequests.contains(barcode)) {\n networkRequest.sendRequest(barcode);\n currentRequests.add(barcode);\n }\n }", "public final synchronized void signalDataAvailable() {\n\n\t\t//\tNotify any waiting threads that the file data ia available\n\t\t\t\n\t\tnotifyAll();\n\t}", "void requestReceived( C conn ) ;", "private void sendReceiveRes(){\n\t}", "protected void onQueued() {}", "entities.Torrent.SearchRequest getSearchRequest();", "entities.Torrent.ChunkRequest getChunkRequest();", "@Override\n\tpublic void send(SendRequest req) {\n\t\tSystem.out.println(req);\n\t\t// send in s1.onentry\n\t\tif (\"This is some content!\".equals(req.getContent())) {\n\t\t\treturnEvent(new Event(\"received1\"));\n\t\t\treturn;\n\t\t}\n\t\t// send in s2.onentry\n\t\tif (req.getParams().containsKey(\"foo\")\n\t\t\t\t&& \"bar\".equals(req.getParams().get(\"foo\").get(0).getAtom())) {\n\t\t\treturnEvent(new Event(\"received2\"));\n\t\t\treturn;\n\t\t}\n\t\t// send in s3\n\t\tif (req.getXML().length() > 0) {\n\t\t\ttry {\n\t\t\t\tDocumentBuilderFactory factory = DocumentBuilderFactory\n\t\t\t\t\t\t.newInstance();\n\t\t\t\tDocument doc = factory.newDocumentBuilder().parse(\n\t\t\t\t\t\tnew InputSource(new StringReader(req.getXML())));\n\t\t\t\tSystem.out.println(\"Root element :\"\n\t\t\t\t\t\t+ doc.getDocumentElement().getNodeName());\n\t\t\t\tif (\"this\".equals(doc.getDocumentElement().getNodeName())) {\n\t\t\t\t\treturnEvent(new Event(\"received3\"));\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t} catch (ParserConfigurationException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (SAXException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\n\t}", "@Override\n\tpublic void action() {\n\t\tACLMessage msgRx = myAgent.receive();\n\t\tif (msgRx != null && msgRx.getPerformative() == ACLMessage.REQUEST) {\n\t\t\tContentManager contentManager = myAgent.getContentManager();\n\t\t\tSystem.out.println(\"RECEIVED = \" + msgRx.getContent());\n\t\t\tmsgRx.setLanguage(\"fipa-sl\");\n\t\t\tmsgRx.setOntology(\"blocks-ontology\");\n\t\t\t\n\t\t\ttry {\n\t\t\t\tContentElementList elementList = (ContentElementList) contentManager\n\t\t\t\t\t\t.extractContent(msgRx);\n\n\t\t\t\tIterator elementIterator = elementList.iterator();\n\n\t\t\t\twhile (elementIterator.hasNext()) {\n\t\t\t\t\tAction action = (Action) elementIterator.next();\n\t\t\t\t\t((Environment) myAgent).getWorld().getActionList().add((Executable) (action.getAction()));\n//\t\t\t\t\t((Executable) (action.getAction()))\n//\t\t\t\t\t\t\t.execute((Environment) myAgent);\n\t\t\t\t}\n\n\t\t\t} catch (UngroundedException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (CodecException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (OntologyException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t} else {\n\t\t\tblock();\n\t\t}\n\t\t\n\t}", "public synchronized void addRequest(Request request)\n {\n if (request.getStream().isBlacklisted())\n throw new BlacklistedStreamExcception();\n requests.add(request);\n needsReorder = true;\n notifyAll();\n }", "public void beforeSendingeGainChatRequest();", "public void processRequest(String request) {\r\n // Request for closing connection\r\n if (request.equals(\"CLOSE\")) {\r\n isOpen = false;\r\n\r\n // Request for getting all of the text on the Server's text areas\r\n } else if (request.equals(\"GET ALL TEXT\")) {\r\n String [] array = FileIOFunctions.getAllTexts();\r\n\r\n sendMessage(\"GET ALL TEXT\");\r\n sendMessage(array[0]);\r\n sendMessage(array[1]);\r\n } else {}\r\n }", "@Override\n\t\t\t\t\tpublic void run() {\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tList<String> headers = readRequest(client);\n\t\t\t\t\t\t\tif (headers != null && headers.size() >= 1) {\n\t\t\t\t\t\t\t\tString requestURL = getRequestURL(headers.get(0));\n\t\t\t\t\t\t\t\tLog.d(TAG, requestURL);\n\n\t\t\t\t\t\t\t\tif (requestURL.startsWith(\"http://\")) {\n\n\t\t\t\t\t\t\t\t\t// HttpRequest request = new\n\t\t\t\t\t\t\t\t\t// BasicHttpRequest(\"GET\", requestURL);\n\n\t\t\t\t\t\t\t\t\tprocessHttpRequest(requestURL, client, headers);\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tprocessFileRequest(requestURL, client, headers);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t} catch (IllegalStateException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "private void messagePhone(final String message, final byte[] byteMap){\n\n new AsyncTask<Void, Void, List<Node>>(){\n\n @Override\n protected List<Node> doInBackground(Void... params) {\n return getNodes();\n }\n\n @Override\n protected void onPostExecute(List<Node> nodeList) {\n for(Node node : nodeList) {\n Log.e(\"WATCH\", \"......Phone: Sending Msg: to node: \" + node.getId());\n Log.e(\"WATCH\", \"Sending to: \" + message.toString());\n PendingResult<MessageApi.SendMessageResult> result = Wearable.MessageApi.sendMessage(\n mGoogleApiClient,\n node.getId(),\n message.toString(),\n byteMap\n );\n\n result.setResultCallback(new ResultCallback<MessageApi.SendMessageResult>() {\n @Override\n public void onResult(MessageApi.SendMessageResult sendMessageResult) {\n Log.e(\"DEVELOPER\", \"......Phone: \" + sendMessageResult.getStatus().getStatusMessage());\n\n }\n });\n }\n }\n }.execute();\n\n }", "private void updatePeers() {\n\t\tif (files == null)\n\t\t\treturn;\n\t\tArrayList<Piece> neededPieces = files.getNeededPieces();\n\t\tfor (int i = 0; i < peers.size(); i++) {\n\t\t\tPeer p = peers.get(i);\n\t\t\tboolean hasNoPieces = true;\n\t\t\tfor (int j = 0; j < neededPieces.size(); j++) {\n\t\t\t\tif (p.getClient().getBitfield().hasPiece(neededPieces.get(j).getIndex())) {\n\t\t\t\t\thasNoPieces = false;\n\t\t\t\t\tif (!p.getClient().isInterested()) {\n\t\t\t\t\t\tp.addToQueue(new MessageInterested());\n\t\t\t\t\t\tp.getClient().interested();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (hasNoPieces && p.getClient().isInterested()) {\n\t\t\t\tp.addToQueue(new MessageUninterested());\n\t\t\t\tp.getClient().uninterested();\n\t\t\t}\n\t\t\tif (p.getMyClient().isInterested() && p.getClient().isChoked()) {\n\t\t\t\tp.addToQueue(new MessageUnchoke());\n\t\t\t\tp.getClient().unchoke();\n\t\t\t} else if (!p.getMyClient().isInterested() && !p.getClient().isChoked()) {\n\t\t\t\tp.addToQueue(new MessageChoke());\n\t\t\t\tp.getClient().choke();\n\t\t\t}\n\t\t}\n\t}", "void updateSearchableSendInfo(NodeRef document);", "public void request() {\n }", "private void sendQueueToWear() {\n new APITask(new APICallback() {\n @Override\n public void r(String result) {\n try {\n JSONArray normalOrderQueue = new JSONObject(result).getJSONArray(\"queue\");\n\n for (int i = 0; i < normalOrderQueue.length(); i++) {\n if (gettingHelp(normalOrderQueue.getJSONObject(i)))\n if (mAdapter.helpedByMe(normalOrderQueue.getJSONObject(i))) {\n JSONObject attendedUser = normalOrderQueue.getJSONObject(i);\n normalOrderQueue = new JSONArray();\n normalOrderQueue.put(attendedUser);\n break;\n } else {\n normalOrderQueue.remove(i);\n i--;\n }\n }\n\n String queue = normalOrderQueue.toString();\n\n PutDataMapRequest putDataMapReq = PutDataMapRequest.create(\"/stayawhile/queue\");\n putDataMapReq.getDataMap().putString(QUEUE_KEY, queue);\n PutDataRequest putDataReq = putDataMapReq.asPutDataRequest();\n putDataReq.setUrgent();\n PendingResult<DataApi.DataItemResult> pendingResult =\n Wearable.DataApi.putDataItem(mGoogleApiClient, putDataReq);\n }\n catch (JSONException e) {\n e.printStackTrace();\n }\n }\n }).execute(\"method\", \"queue/\" + Uri.encode(mQueueName));\n }", "void firePeerDiscovered(TorrentId torrentId, Peer peer);", "public void addRequest(T request) {\n\t\tinputQueue.add(request);\n\t}", "public void run() {\n JabberPacket packet=null;\n\n do {\n try {\n packet=queue.pull();\n\n if (packet!=null) {\n PacketHandler h=null;\n if (((JabberSkypeSettings) Main.Settings()).getDebug()) {\n \tSystem.out.println(\"Client: \" + packet.generateXML());\n }\n String e=packet.getElement();\n if (e!=null) {\n String key=null;\n\n if (e.equals(\"iq\")) {\n JabberPacket pQuery=packet.getFirstChild(\"query\");\n\n if (pQuery!=null) {\n key=pQuery.getAttribute(\"xmlns\");\n } else {\n \tJabberPacket pVcard=packet.getFirstChild(\"vcard\");\n \tif (pVcard!= null) {\n \t\tkey=pVcard.getAttribute(\"xmlns\");\n \t\t//need to do difference between setting vcard, and getting it for a user\n \t}\n }\n } else\n key=e;\n\n if (key!=null) {\n h=(PacketHandler)mHandlers.get(key);\n\n if (h==null)\n h=getDefaultHandler();\n\n h.processPacket(packet);\n } //key!=null\n } //e!=null\n } //packet!=null\n } //try\n catch (Exception e) {\n server.getLogger().severe(\"Caught exception: \"+e.getMessage());\n }\n } while (packet!=null && server.getRunning());\n }", "protected abstract boolean sendNextRequests();" ]
[ "0.63914895", "0.62539506", "0.6002979", "0.58689535", "0.5827305", "0.57492316", "0.57449186", "0.57287896", "0.5727841", "0.56802833", "0.56395286", "0.555093", "0.55145234", "0.55025417", "0.54914415", "0.544639", "0.544174", "0.5432624", "0.5430453", "0.5399774", "0.5352885", "0.5350598", "0.5339895", "0.5329574", "0.53275204", "0.53275204", "0.53275204", "0.53275204", "0.5306544", "0.52667737", "0.525273", "0.5252713", "0.5247779", "0.52476007", "0.52460337", "0.5225439", "0.52205867", "0.52203745", "0.52042687", "0.51982975", "0.5192116", "0.51875544", "0.5187374", "0.5181555", "0.5178156", "0.51767045", "0.5174519", "0.5167649", "0.51664484", "0.5159458", "0.5141661", "0.51297563", "0.51190186", "0.5104273", "0.5098299", "0.5057762", "0.50566274", "0.50531375", "0.50497454", "0.5049406", "0.50483936", "0.50429815", "0.503763", "0.5034477", "0.50314665", "0.50270474", "0.502697", "0.50240916", "0.50224257", "0.50214756", "0.5015736", "0.5014973", "0.501067", "0.5002111", "0.4997996", "0.49943712", "0.4991936", "0.49811321", "0.49736246", "0.49669737", "0.49668387", "0.4961729", "0.49616563", "0.49614486", "0.49592996", "0.495768", "0.49551603", "0.49519962", "0.4951625", "0.4945713", "0.49362057", "0.4933294", "0.49248946", "0.49202406", "0.49194062", "0.49161643", "0.49141982", "0.4909367", "0.4909299", "0.49058458" ]
0.6180755
2
called on "choke" and "unchoke" messages receive, notifies parent torrent about cancelled requests if enqueued or already sent at the moment and message is "choke"
void onChoke(boolean state) { peerChoke = state; //if (DEBUG) System.out.println(peer.address + " onChoke: " + state); if (peerChoke) { // remove all enqueued requests as they will be dropped by the remote peer for (int i = sendQueue.size() - 1; 0 <= i; i--) { StdPeerMessage pm = sendQueue.get(i); if (pm.type == StdPeerMessage.REQUEST) { sendQueue.remove(i); // notify torrent about cancelled request torrent.cancelBlockRequest(pm.index, pm.begin); pmCache.release(pm); } } // it's possible that we have requests that were already sent to external peer, // notify torrent - they are cancelled too [who knows, maybe data will arrive] for (int i = 0; i < blockRequests.size(); i++) { StdPeerMessage pm = blockRequests.get(i); torrent.cancelBlockRequest(pm.index, pm.begin); pmCache.release(pm); } blockRequests.clear(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void msgAtCook() {\n\t\t\n\t}", "protected void enqueue(StdPeerMessage message)\n {\n// if (DEBUG) {\n// if (message.type == StdPeerMessage.REQUEST) {\n// System.out.println(System.nanoTime() + \" [stdpc] enqueue: req \" + message.index + \" \" + (message.begin >> 14));\n// } else {\n// System.out.println(\"[stdpc] enqueue: \" + message.type);\n// }\n// }\n\n if (message.type == StdPeerMessage.CHOKE)\n {\n // remove reply messages with piece (block) data\n // from the send queue (due to spec)\n for (int i = sendQueue.size() - 1; 0 <= i; i--) {\n StdPeerMessage pm = sendQueue.get(i);\n if (pm.type == StdPeerMessage.PIECE) {\n sendQueue.remove(i);\n TorrentStorage.Block block = (TorrentStorage.Block) message.params;\n block.release();\n pmCache.release(pm);\n }\n }\n // set choke status\n choke = true;\n // send choke asap\n sendQueue.add(0, message);\n }\n else if (message.type == StdPeerMessage.CANCEL)\n {\n // remove the linked request if it's still in the queue\n for (int i = sendQueue.size() - 1; 0 <= i; i--) {\n StdPeerMessage pm = sendQueue.get(i);\n if ((pm.type == StdPeerMessage.REQUEST)\n && (pm.index == message.index)\n && (pm.begin == message.begin)\n && (pm.length == message.length)) // this check is redundant as length is fixed\n {\n sendQueue.remove(i);\n pmCache.release(pm);\n // don't really enqueue CANCEL as the linked request\n // has been found and removed\n pmCache.release(message);\n return;\n }\n }\n // send asap\n sendQueue.add(0, message);\n }\n else {\n if (message.type == StdPeerMessage.INTERESTED) {\n interested = true;\n }\n else if (message.type == StdPeerMessage.NOT_INTERESTED) {\n interested = false;\n }\n else if (message.type == StdPeerMessage.UNCHOKE) {\n choke = false;\n }\n\n // enqueue message\n sendQueue.add(message);\n }\n\n// sendQueue.forEach(pm -> System.out.println(\" -x> \" + System.identityHashCode(pm) + pm.type + \" ,\" + pm.index +\",\" + pm.begin +\",\" + pm.length) );\n\n }", "@Override\n\tpublic void msgAtCooking() {\n\t\t\n\t}", "@Override\n\tpublic void msgDoneCooking(Food food) {\n\t\t\n\t}", "private void doUnchokes() { \n\n\t\t// logic below is either 1 second or 10 secondly, bail out early id neither\n\n\t\tif( !UploadSlotManager.AUTO_SLOT_ENABLE ) {\t\t //manual per-torrent unchoke slot mode\n\n\t\t\tif( mainloop_loop_count % MAINLOOP_ONE_SECOND_INTERVAL != 0 ) { \n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tfinal int max_to_unchoke = adapter.getMaxUploads(); //how many simultaneous uploads we should consider\n\t\t\tfinal ArrayList peer_transports = peer_transports_cow;\n\n\t\t\t//determine proper unchoker\n\t\t\tif( seeding_mode ) {\n\t\t\t\tif( unchoker == null || !(unchoker.isSeedingUnchoker()) ) {\n\t\t\t\t\tunchoker = UnchokerFactory.getSingleton().getUnchoker( true );\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tif( unchoker == null || unchoker.isSeedingUnchoker()) {\n\t\t\t\t\tunchoker = UnchokerFactory.getSingleton().getUnchoker( false );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t\t//do main choke/unchoke update every 10 secs\n\t\t\t\n\t\t\tif ( mainloop_loop_count % MAINLOOP_TEN_SECOND_INTERVAL == 0 ){\n\n\t\t\t\tfinal boolean refresh = mainloop_loop_count % MAINLOOP_THIRTY_SECOND_INTERVAL == 0;\n\n\t\t\t\tunchoker.calculateUnchokes( max_to_unchoke, peer_transports, refresh, adapter.hasPriorityConnection());\n\n\t\t\t\tArrayList\tchokes \t\t= unchoker.getChokes();\n\t\t\t\tArrayList\tunchokes\t= unchoker.getUnchokes();\n\t\t\t\t\n\t\t\t\taddFastUnchokes( unchokes );\n\t\t\t\t\n\t\t\t\tUnchokerUtil.performChokes( chokes, unchokes );\n\t\t\t\t\n\t\t\t}else if ( mainloop_loop_count % MAINLOOP_ONE_SECOND_INTERVAL == 0 ) { //do quick unchoke check every 1 sec\n\n\t\t\t\tArrayList unchokes = unchoker.getImmediateUnchokes( max_to_unchoke, peer_transports );\n\n\t\t\t\taddFastUnchokes( unchokes );\n\t\t\t\t\n\t\t\t\tUnchokerUtil.performChokes( null, unchokes );\n\t\t\t}\n\t\t}\n\t}", "void sendCancelMessage();", "protected abstract void sendCancel(Status reason);", "@Override\r\n public void cancelMsg() {\n System.out.println(\"Transaction has been cancelled for gas pump #1..\");\r\n }", "protected boolean processChannelTell(String username, String titles, int channelNumber, String message){return false;}", "private void updatePeers() {\n\t\tif (files == null)\n\t\t\treturn;\n\t\tArrayList<Piece> neededPieces = files.getNeededPieces();\n\t\tfor (int i = 0; i < peers.size(); i++) {\n\t\t\tPeer p = peers.get(i);\n\t\t\tboolean hasNoPieces = true;\n\t\t\tfor (int j = 0; j < neededPieces.size(); j++) {\n\t\t\t\tif (p.getClient().getBitfield().hasPiece(neededPieces.get(j).getIndex())) {\n\t\t\t\t\thasNoPieces = false;\n\t\t\t\t\tif (!p.getClient().isInterested()) {\n\t\t\t\t\t\tp.addToQueue(new MessageInterested());\n\t\t\t\t\t\tp.getClient().interested();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (hasNoPieces && p.getClient().isInterested()) {\n\t\t\t\tp.addToQueue(new MessageUninterested());\n\t\t\t\tp.getClient().uninterested();\n\t\t\t}\n\t\t\tif (p.getMyClient().isInterested() && p.getClient().isChoked()) {\n\t\t\t\tp.addToQueue(new MessageUnchoke());\n\t\t\t\tp.getClient().unchoke();\n\t\t\t} else if (!p.getMyClient().isInterested() && !p.getClient().isChoked()) {\n\t\t\t\tp.addToQueue(new MessageChoke());\n\t\t\t\tp.getClient().choke();\n\t\t\t}\n\t\t}\n\t}", "@Override\n protected boolean shouldAck() {\n return true;\n }", "abstract public void acceptMessage(OSCMessage message, TuioTime currentTime);", "@Override\n\tprotected void doAction(Object message) {\n\t\tlogger.info(\"File Scanner Fetch message Name -->:\"+message.toString());\n\t\ttry {\n\t\t\tFileParser.queue.put(message);\n\t\t} catch (InterruptedException e) {\n\t\t\tlogger.error(\"Error on add message to Parser\");\n\t\t}\n\t}", "@Override\n\tpublic void onSendChatDone(byte arg0) {\n\t\t\n\t}", "@Override\n\tpublic void visit(NotInterested ni) {\n\t\tSystem.out.println(\"peer is notInterested\");\n\t\tph.addMessageQueue(new Choke());\n\t\tph.setPeerChoked(true);\n\t\tSystem.out.println(\"peerChoked : \" + ph.getPeerChoked());\n\t}", "public void notifyCancel() {\n Player senderPlayer = this.getToTeleport().getPlayerReference(Player.class),\n targetPlayer = this.getTarget().getPlayerReference(Player.class);\n\n if (senderPlayer == null || targetPlayer == null) {\n return;\n }\n\n MainData.getIns().getMessageManager().getMessage(\"TPA_CANCELLED\").sendTo(senderPlayer);\n MainData.getIns().getMessageManager().getMessage(\"TPA_SELF_CANCELLED\").sendTo(targetPlayer);\n\n }", "public void ack() {\n }", "boolean needsAck() { return true; }", "private void considerQueue(){\r\n\t\tif (queuedDialog != dialogToDisplay){\r\n\t\t\t// check to see if is skippable and if is finished\r\n\t\t\tif (thisDialog.get(dialogToDisplay).isSkippable()){\r\n\t\t\t// if isSkippable(), then it doesn't matter whether its done yet or not - we go on\r\n\t\t\t\tthisDialog.get(dialogToDisplay).switchBoxState();\r\n\t\t\t}else {\r\n\t\t\t\t// if its not skippable, check to see if its done yet.\r\n\t\t\t\tif (thisDialog.get(dialogToDisplay).isFinished()){\r\n\t\t\t\t\t// if so, go on\r\n\t\t\t\t\tthisDialog.get(dialogToDisplay).switchBoxState();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void performChokes(ArrayList<PEPeer> peers_to_choke, ArrayList<PEPeer> peers_to_unchoke) {\n // do chokes\n if (peers_to_choke != null) {\n for (int i = 0; i < peers_to_choke.size(); i++) {\n final PEPeerTransport peer = (PEPeerTransport) peers_to_choke.get(i);\n\n if (!peer.isChokedByMe()) {\n peer.sendChoke();\n }\n }\n }\n\n // do unchokes\n if (peers_to_unchoke != null) {\n for (int i = 0; i < peers_to_unchoke.size(); i++) {\n final PEPeer peer = peers_to_unchoke.get(i);\n\n if (peer.isChokedByMe()) { // TODO add UnchokerUtil.isUnchokable() test here to be safe?\n peer.sendUnChoke();\n }\n }\n }\n }", "@Override\n\tprotected void doAsyncExecute(VoiceMessage requestMessage) {\n\n\t}", "public synchronized void pokeClient(ClientThread sender, String recipientNickname) throws IOException {\n \tif (userExists(recipientNickname)) {\n nicknamesToClients.get(recipientNickname).writeToClient(sender.getNickname() + \" poked you!\");\n log(sender.getNickname() + \" pokes the s$%# out of \" + recipientNickname);\n }\n }", "protected boolean onPoke(String topic, String item, String data)\n {\n return false;\n }", "protected boolean processCShout(String username, String titles, String message){return false;}", "private void receiveNack(Evt e) {\n\t\tif (!nackReceived && e.getMessage()!= currentlyOptimisticallyTransmitted) {\r\n\t\t\tSystem.out.println(\"error\");\r\n\t\t//\tthrow new IllegalStateException(\"A nack corresponding to a message that isn't the one in the buffer has been received. This means that something is wrong (at time \" + e.getTimeNS() + \")\");\r\n\t\t}\r\n\t\t\r\n\t\tif (currentlyOptimisticallyTransmitted == null)\r\n\t\t\treturn;\r\n\r\n\t\tif (nackReceived == false) {\r\n\t\t\tif (lwSimExperiment.isWithTimeLine())\r\n\t\t\t\ttimeline.addJobPhase(lastPacketStart, e.getTimeNS(), currentlyOptimisticallyTransmitted.origin + \"->\" + currentlyOptimisticallyTransmitted.dest + \"\\n\" + currentlyOptimisticallyTransmitted.index + \":NACK\", Color.RED);\t\t\r\n\t\t\t// immediately resend\t\t\t\r\n\t\t\tnackReceived = true;\r\n\t\t\t// correct transmission time in the case of NACK Mode\r\n\t\t\tif (!this.ACKMode)\r\n\t\t\t\tlwSimExperiment.reportTransTime(index, e.getTimeNS() - lastPacketStart - packetDuration, currentlyOptimisticallyTransmitted);\r\n\t\t\t\r\n\t\t\tSpinetMessage dupl = currentlyOptimisticallyTransmitted.getCopy();\r\n\t\t\tgetQueue(dupl.dest).remove(currentlyOptimisticallyTransmitted);\r\n\t\t\tgetQueue(dupl.dest).addFirst(dupl);\r\n\t\t\tmainQueue.addFirst(dupl);\r\n\t\t\tdefineSpinetMessage(dupl);\r\n\t\t\tlwSimExperiment.packetRetransmitted(dupl);\r\n\t\t\tcurrentlyOptimisticallyTransmitted = null;\r\n\t\t}\t\t\r\n\t}", "public void beforeSendingeGainChatRequest();", "@Override\n public void run() {\n List<Integer> list = new ArrayList<Integer>();\n int num_peer = P.peer_port.length;\n int ind = -1;\n for (int i = 0; i < num_peer; i++) {\n list.add(i);\n }\n while (P.choke_thread_running) {\n synchronized (P.lock_current_neighbors) { //lock the object\n\n if(P.current_neighbors==null) continue;\n\n int[] cn = P.current_neighbors.clone(); //current neighbor.\n Arrays.sort(cn);\n if (P.own_file || P.finished) { //select randomly.\n java.util.Collections.shuffle(list);\n int cnt = 0; //#peers selected.\n for (int i = 0; i < num_peer && cnt < P.num_preferred_neighbors; i++) {\n ind = list.get(i);\n if (P.is_interested[ind] && P.peer_id[ind] != P.id) {\n P.current_neighbors[cnt++] = P.peer_id[ind];\n //send unchoke message to previously choked peer.\n if (Arrays.binarySearch(cn, P.peer_id[ind]) < 0) {\n Message msg = new Message();\n msg.length = 0; //no payload.\n msg.type = 1; //unchoke.\n msg.payload = null; //no payload.\n P.send(P.peer_id[ind], msg);\n }\n }\n }\n P.print(\"Choke selected \" + cnt + \" neighbors randomly.\");\n } else { //select according to the download rates.\n int[] order = getIndices(P.download_rates);\n int cnt = 0; //#peers selected.\n for (int i = 0; i < num_peer && cnt < P.num_preferred_neighbors; i++) {\n ind = order[i];\n if (P.is_interested[ind] && P.peer_id[ind] != P.id) {\n P.current_neighbors[cnt++] = P.peer_id[ind];\n //send unchoke message to previously choked peer.\n if (Arrays.binarySearch(cn, P.peer_id[ind]) < 0) {\n Message msg = new Message();\n msg.length = 0; //no payload.\n msg.type = 1; //unchoke.\n msg.payload = null; //no payload.\n P.send(P.peer_id[ind], msg);\n }\n }\n }\n //print debugging info.\n P.print(\"Choke selected \" + cnt + \" neighbors according to download rates.\");\n }\n //send choke message to peers previously unchoked but currently choked.\n Arrays.sort(Arrays.copyOfRange(P.current_neighbors, 0, P.num_preferred_neighbors - 1));\n for (int i = 0; i < P.num_preferred_neighbors; i++) {\n if (Arrays.binarySearch(P.current_neighbors, cn[i]) < 0) { //cn[i] not in current neighbor list.\n Message msg = new Message();\n msg.length = 0; //no payload.\n msg.type = 0; //choke.\n msg.payload = null; //no payload.\n P.send(P.peer_id[ind], msg);\n }\n }\n }\n //sleep some interval.\n try {\n Thread.sleep(1000 * P.unchoking_internal);\n } catch (InterruptedException ex) {\n Thread.currentThread().interrupt();\n }\n }\n }", "@Override\n public void run() {\n List<Integer> list = new ArrayList<Integer>();\n int num_peer = P.peer_port.length;\n int ind = -1;\n while (P.choke_thread_running) {\n synchronized (P.lock_current_neighbors) { //lock the object\n for (int i = 0; i < num_peer; i++) {\n list.add(i);\n }\n //select randomly.\n java.util.Collections.shuffle(list);\n int[] cn = P.current_neighbors.clone();\n Arrays.sort(cn);\n for (int i = 0; i < num_peer; i++) {\n int ind2 = list.get(i);\n if (P.is_interested[ind2] && Arrays.binarySearch(cn, P.peer_id[ind2]) < 0 && P.peer_id[ind2] != P.id && P.sockets[ind2]!=null) {\n ind = ind2;\n P.current_neighbors[P.current_neighbors.length - 1] = P.peer_id[ind];\n break;\n }\n\n }\n }\n //send unchoke message.\n Message msg = new Message();\n msg.length = 0; //no payload.\n msg.type = 1; //unchoke.\n msg.payload = null; //no payload.\n \n if (ind >= 0) //there is someone interested in my data.\n {\n P.send(P.peer_id[ind], msg);\n P.print(\"OptChoke unchoked peer with id \" + P.peer_id[ind]);\n }\n ind = -1;\n //print debugging info.\n \n //sleep some interval.\n try {\n Thread.sleep(1000 * P.optimistic_unchoking_interval);\n } catch (InterruptedException ex) {\n Thread.currentThread().interrupt();\n }\n }\n }", "private synchronized void onRequest(ObjectMessage message) {\n try {\n Serializable request = message.getObject(); //serializer.requestFromString(message.getText());\n activeRequests.put(request, message);\n requestListener.receivedRequest(request);\n } catch (JMSException ex) {\n Logger.getLogger(AsynchronousReplier.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n }", "public boolean echoCancellationEnabled();", "public void onAdvancingOpAccepted(Set<Long> affectedMessages);", "public void OnKickConfCallback(int nReason);", "protected void onCancelRequestReceipts() {\n \tmTxtStatus.setText(\"requestReceipts onCancel\");\n }", "@Override\n public void dealWithCommand(MessageReceivedEvent event) {\n List<String> contentSplit = new ArrayList<>(Arrays.asList(event.getMessage().getContentStripped().split(\" \")));\n\n // remove the command part of the message\n contentSplit.remove(0);\n boolean isXpDesired = DetermineArguments.determineIsXpDesired(contentSplit);\n boolean isCollection = DetermineArguments.determineIsCollection(contentSplit);\n long timeToSpend = DetermineArguments.determineTimeToSpend(contentSplit, event.getTextChannel());\n int classLevel = DetermineArguments.determineClassLevel(contentSplit, event.getTextChannel());\n long amountDesired = DetermineArguments.determineAmountDesired(contentSplit, event.getTextChannel());\n\n // be done if something bad was found\n if (timeToSpend == -2 || classLevel == -2 || amountDesired == -2)\n return;\n\n if (contentSplit.isEmpty()) {\n // user did not specify what player they want\n event.getChannel().sendMessage(\"Specify what player you want to analyze.\").queue();\n return;\n }\n String username = contentSplit.get(0);\n WynncraftPlayer player = GetPlayerStats.get(username);\n if (player == null) {\n event.getChannel().sendMessage(\"Either the api is down, or '\" + username + \"' is not a player.\").queue();\n return;\n }\n\n // tell the user we're working on the answer\n event.getMessage().addReaction(\"\\uD83D\\uDEE0\").queue();\n\n List<String> classNames = new ArrayList<>();\n for (WynncraftClass playerClass : player.classes) {\n classNames.add(playerClass.name);\n }\n ChoiceArguments choiceArguments = new ChoiceArguments(\n isXpDesired, isCollection, timeToSpend, amountDesired, classLevel, classNames, player, true);\n\n\n long xpDesiredGivenPerc = 0;\n long emeraldDesiredGivenPerc = 0;\n for (WynncraftClass wynncraftClass : player.classes)\n for (Quest quest : wynncraftClass.questsNotCompleted) {\n if (quest.levelMinimum <= (classLevel == -1 ? wynncraftClass.combatLevel : classLevel)) {\n xpDesiredGivenPerc += quest.xp;\n emeraldDesiredGivenPerc += quest.emerald;\n }\n }\n xpDesiredGivenPerc *= GetAnswers.DEFAULT_PERCENTAGE_AMOUNT;\n emeraldDesiredGivenPerc *= GetAnswers.DEFAULT_PERCENTAGE_AMOUNT;\n\n FinalQuestOptionsAll finalQuestOptionsAll = GetAnswers.getAllFullAnswers(player, choiceArguments);\n String spreadsheetId = SheetsWrite.writeSheet(finalQuestOptionsAll, event.getAuthor().getIdLong(), player.name, true);\n if (spreadsheetId == null) return;\n new QuestRecommendationMessagePlayer(spreadsheetId, finalQuestOptionsAll, event.getChannel(), choiceArguments, xpDesiredGivenPerc, emeraldDesiredGivenPerc);\n\n event.getMessage().removeReaction(\"\\uD83D\\uDEE0\", DiscordBot.client.getSelfUser()).queue();\n }", "protected boolean onPoke(String topic, String item, String data, long hconv)\n {\n return onPoke(topic, item, data);\n }", "@Override\n\tpublic void visit(Interested i) {\n\t\tSystem.out.println(\"interested reću\");\n\t\tph.addMessageQueue(new Unchoke());\n\t\tph.setPeerChoked(false);\n\t\tSystem.out.println(\"peerChoked : \" + ph.getPeerChoked());\n\t}", "void acked(boolean timedOutMessage);", "@Override\n\t\t\t\tpublic void isComposingReceived(LinphoneCore lc, LinphoneChatRoom cr) {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n public void run() {\n BlockPos cachePosition = teleportee.getPosition();\n while (cachePosition.equals(teleportee.getPosition()) || pendingTeleports.containsKey(originalSender)) {/*block execution until move or teleport*/}\n if (pendingTeleports.containsKey(originalSender)) { //has not teleported\n pendingTeleports.remove(sender.getName(), originalSender);\n sender.addChatMessage(new TextComponentString(TextFormatting.RED + \"Teleport canceled.\"));\n teleportee.addChatMessage(new TextComponentString(TextFormatting.RED + \"Teleport canceled.\"));\n }\n }", "protected void onQueued() {}", "@Override\n //here the messageReceived method is implemented\n public void messageReceived(String message) {\n publishProgress(message);\n }", "@Override\n //here the messageReceived method is implemented\n public void messageReceived(String message) {\n publishProgress(message);\n }", "@Override\n //here the messageReceived method is implemented\n public void messageReceived(String message) {\n publishProgress(message);\n }", "@Override\n //here the messageReceived method is implemented\n public void messageReceived(String message) {\n publishProgress(message);\n }", "public void detectAndSendChanges()\r\n\t{\r\n\t\t super.detectAndSendChanges();\r\n\r\n\t\t for (int i = 0; i < this.crafters.size(); ++i)\r\n\t\t {\r\n\t\t\t ICrafting icrafting = (ICrafting)this.crafters.get(i);\r\n\t\t\t icrafting.sendProgressBarUpdate(this, 0, this.enchantLevels[0]);\r\n\t\t\t icrafting.sendProgressBarUpdate(this, 1, this.enchantLevels[1]);\r\n\t\t\t icrafting.sendProgressBarUpdate(this, 2, this.enchantLevels[2]);\r\n\t\t }\r\n\t}", "void composingIndicatorReceived(IMSession session, String sender, int timeout);", "Message sendAndWait();", "@Override\n public void run() {\n try {\n pendingConfirms.remove(target.getName(),sender.getName());\n } catch (Exception ignored) {/*player has already confirmed*/}\n }", "@Override\n\tpublic void visit(Choke c) {\n\t\tSystem.out.println(\"visit choke\");\n\t\tph.setChoked(true);\n\t}", "private void busquets() {\n\t\ttry {\n\t\t\tThread.sleep(5000); // espera, para dar tempo de ver as mensagens iniciais\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tint xInit = -25;\n\t\tint yInit = -10;\n\t\tplayerDeafaultPosition = new Vector2D(xInit*selfPerception.getSide().value(), yInit *selfPerception.getSide().value());\n\t\t\n\t\twhile (commander.isActive()) {\n\t\t\tupdatePerceptions(); // deixar aqui, no começo do loop, para ler o resultado do 'move'\n\t\t\tswitch (matchPerception.getState()) {\n\t\t\tcase BEFORE_KICK_OFF:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\t\t\t\t\n\t\t\t\tbreak;\n\t\t\tcase PLAY_ON:\n\t\t\t\tstate = State.ATTACKING;\n\t\t\t\texecuteStateMachine();\n\t\t\t\tbreak;\n\t\t\tcase KICK_OFF_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase KICK_OFF_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\t//if(closer)\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CORNER_KICK_LEFT: // escanteio time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase CORNER_KICK_RIGHT: // escanteio time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase KICK_IN_LEFT: // lateral time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\tcase KICK_IN_RIGHT: // lateal time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_LEFT: // Tiro livre time esquerdo\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_RIGHT: // Tiro Livre time direito\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_FAULT_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase FREE_KICK_FAULT_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase GOAL_KICK_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase GOAL_KICK_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase AFTER_GOAL_LEFT:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\t\n\t\t\t\tbreak;\n\t\t\tcase AFTER_GOAL_RIGHT:\n\t\t\t\tcommander.doMoveBlocking(xInit, yInit);\t\n\t\t\t\tbreak;\n\t\t\tcase INDIRECT_FREE_KICK_LEFT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.LEFT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase INDIRECT_FREE_KICK_RIGHT:\n\t\t\t\tif (selfPerception.getSide() == EFieldSide.RIGHT) {\n\t\t\t\t\tstate = State.PASSING_BALL;\n\t\t\t\t\texecuteStateMachine();\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}", "void fireTorrentStopped(TorrentId torrentId);", "private void handleMessage(final ParentOverloaded msg) {\n if (parents.get(msg.getTreeID()) == null || !parents.get(msg.getTreeID()).equals(msg.sourceId)) {\n return;\n }\n sendUnderLoadedNeighborsOffer(msg.sourceId, msg.getTreeID());\n }", "@Override\n public void onTakeCoffeePodRaised() {\n }", "public void requestAccepted(String username)\n\t{\n\t\t// Player otherPlayer = TcpProtocolHandler.getPlayer(username);\n\t\tPlayer otherPlayer = ActiveConnections.getPlayer(username);\n\t\tif(otherPlayer != null)\n\t\t{\n\t\t\tif(m_requests.containsKey(username))\n\t\t\t\tswitch(m_requests.get(username))\n\t\t\t\t{\n\t\t\t\t\tcase BATTLE:\n\t\t\t\t\t\t/* First, ensure both players are on the same map */\n\t\t\t\t\t\tif(otherPlayer.getMap() != getMap())\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t/* Based on the map's pvp type, check this battle is possible If pvp is enforced, it will be started when the offer is made */\n\t\t\t\t\t\tif(getMap().getPvPType() != null)\n\t\t\t\t\t\t\tswitch(getMap().getPvPType())\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcase DISABLED:\n\t\t\t\t\t\t\t\t\t/* Some maps have pvp disabled */\n\t\t\t\t\t\t\t\t\tServerMessage sendNotOther = new ServerMessage(ClientPacket.PVP_PACKETS);\n\t\t\t\t\t\t\t\t\tsendNotOther.addInt(2);\n\t\t\t\t\t\t\t\t\totherPlayer.getSession().Send(sendNotOther);\n\t\t\t\t\t\t\t\t\tServerMessage sendNot = new ServerMessage(ClientPacket.PVP_PACKETS);\n\t\t\t\t\t\t\t\t\tsendNot.addInt(2);\n\t\t\t\t\t\t\t\t\tgetSession().Send(sendNot);\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\tcase ENABLED:\n\t\t\t\t\t\t\t\t\t/* This is a valid battle, start it */\n\t\t\t\t\t\t\t\t\tensureHealthyPokemon();\n\t\t\t\t\t\t\t\t\totherPlayer.ensureHealthyPokemon();\n\t\t\t\t\t\t\t\t\tm_battleField = new PvPBattleField(DataService.getBattleMechanics(), this, otherPlayer);\n\t\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t\tcase ENFORCED:\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tm_battleField = new PvPBattleField(DataService.getBattleMechanics(), this, otherPlayer);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase TRADE:\n\t\t\t\t\t\tif(canTrade() && otherPlayer.canTrade())\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t/* Set the player as talking so they can't move */\n\t\t\t\t\t\t\tm_isTalking = true;\n\t\t\t\t\t\t\t/* Create the trade */\n\t\t\t\t\t\t\tm_trade = new Trade(this, otherPlayer);\n\t\t\t\t\t\t\totherPlayer.setTrade(m_trade);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tServerMessage sendNotOther = new ServerMessage(ClientPacket.PVP_PACKETS);\n\t\t\t\t\t\t\tsendNotOther.addInt(4);\n\t\t\t\t\t\t\totherPlayer.getSession().Send(sendNotOther);\n\t\t\t\t\t\t\tServerMessage sendNot = new ServerMessage(ClientPacket.PVP_PACKETS);\n\t\t\t\t\t\t\tsendNot.addInt(4);\n\t\t\t\t\t\t\tgetSession().Send(sendNot);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tServerMessage sendNot = new ServerMessage(ClientPacket.PVP_PACKETS);\n\t\t\tsendNot.addInt(0);\n\t\t\tgetSession().Send(sendNot);\n\t\t}\n\t}", "private void delegate(MessageEvent event) throws IOException {\n MessageChannel channel = event.getChannel();\n BullyAlgorithmParticipantImpl.Message messageType = BullyAlgorithmParticipantImpl.Message.valueOf(event.getActionCommand());\n\n int senderProcessId = 0;\n try {\n senderProcessId = channel.readNextInt();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n switch(messageType) {\n case Election:\n self.onElectionMessage(senderProcessId);\n break;\n case Answer:\n self.onAnswerMessage(senderProcessId);\n break;\n case Victory:\n self.onVictoryMessage(senderProcessId);\n break;\n }\n }", "public void requestcanceled() {\n\n requestcancelcheck = true;\n\n String diatitle = \"Request cancelled.\";\n String msg = \"Request cancelled by Rider.\";\n\n marker.setEnabled(false);\n // mGoogleMap.clear();\n fullbutton.setVisibility(View.GONE);\n usercheck = false;\n touch.setVisibility(View.GONE);\n marker.setVisibility(View.INVISIBLE);\n checkonclick = false;\n timercheck = true;\n whilecheck = true;\n accheck = true;\n receivecheck = true;\n\n acc1 = acc;\n\n registerReceiver(mHandleMessageReceiver, new IntentFilter(Config.DISPLAY_MESSAGE_ACTION));\n dialogshow(diatitle, msg);\n\n }", "@Override\n\tpublic void orderCook(String name) {\n\t\t\n\t}", "@Override\n public void handleMessage(Message message) throws MessageHandlerException {\n\n // This message is sent by the LOCAL Spine instance to the REMOTE Spine instances\n // when they ask to be registered. If they are the first instance with that id to\n // request registration they will be given permission to start transmitting.\n if (RegisterConfirmation.class.isInstance(message)) {\n RegisterConfirmation registerConf = (RegisterConfirmation) message;\n TransactionUID uid = registerConf.getUid();\n // Is this a response to my request?\n if (uid.getOriginator().equals(clientId)) {\n registrationPermissionMessageReceived = true;\n boolean permission = registerConf.getPermission();\n log.trace(\"'{}' Received Registration Confirmation, permission: '{}'\", clientId, permission);\n if (permission) {\n registered = true;\n registrationSemaphore.signal();\n }\n else {\n registered = false;\n registrationSemaphore.signal();\n }\n }\n }\n\n // This message is sent by a Spine Client to request that the START_WATCHING\n // command be issued.\n else if (RequestStartWatching.class.isInstance(message)) {\n try {\n if (!watching) {\n TransactionUID uid = ((RequestStartWatching)message).getUid();\n spine.sendSystemMessage(new StartWatching(clientId, uid));\n watching = true;\n watchingSpines = new HashSet<String>();\n watchingSpines.add(message.getSender());\n }\n else {\n watchingSpines.add(message.getSender());\n log.trace(\"Watching has already been initiated by another client\");\n }\n } catch (Exception e) {\n log.warn(\"Exception while sending Start Watching Message\", e);\n }\n }\n\n // This message is sent by a Spine Client to request that the STOP_WATCHING\n // command be issued.\n else if (RequestStopWatching.class.isInstance(message)) {\n try {\n if (watchingSpines != null && watchingSpines.remove(message.getSender())) {\n if (watchingSpines.size() == 0) {\n TransactionUID uid = ((RequestStopWatching)message).getUid();\n spine.sendSystemMessage(new StopWatching(clientId, uid));\n watching = false;\n }\n }\n } catch (Exception e) {\n log.warn(\"Exception while sending Stop Watching Message\", e);\n }\n }\n\n // This message is sent by a Spine Client to request a Serial Number. This\n // function is managed by the LOCAL Spine instance\n else if (SerialNumberRequest.class.isInstance(message)) {\n try {\n TransactionUID uid = ((SerialNumberRequest)message).getUid();\n spine.sendSystemMessage(new SerialNumberResponse(clientId, uid, serialNumber++));\n } catch (Exception e) {\n log.warn(\"Exception while sending SerialNumberResponse Message\", e);\n }\n }\n\n // This message is sent from the Spines to the 'gather call issuing Spine' to allow\n // it to assemble the Types into one structure for return to the Spine Client\n else if (TypeListResult.class.isInstance(message)) {\n informGatheringThreads(message);\n\n }\n\n // This message is sent from the Spines to the 'gather call issuing Spine' to allow\n // it to assemble the Types into one structure for return to the Spine Client\n else if (TypeResult.class.isInstance(message)) {\n informGatheringThreads(message);\n }\n\n /*\n * This message is sent from the Spines to the 'gather call issuing\n * Spine' to allow it to assemble the results into one structure for\n * return to the Spine client.\n */\n else if (ExecutorListResult.class.isInstance(message)) {\n informGatheringThreads(message);\n }\n\n // This message is sent to the Spine instances from a REMOTE Spine instance when\n // it is about to shutdown. If that Spine instance had previously requested\n // START_WATCHING it will be treated as a STOP_WATCHING request.\n else if (JmsSpineClosing.class.isInstance(message) ) {\n // The Local instance needs to do extra work with this message\n if (clientType.equals(JmsClient.LOCAL)) {\n String closingSpine = message.getSender();\n log.trace(\"Spine closing received from: {}\", closingSpine);\n spineInstanceList.remove(closingSpine);\n if (watchingSpines != null && watchingSpines.remove(message.getSender())) {\n if (watchingSpines.size() == 0) {\n TransactionUID uid = ((JmsSpineClosing)message).getUid();\n try {\n spine.sendSystemMessage(new StopWatching(clientId, uid));\n } catch (Exception e) {\n log.warn(\"Exception while sending Stop Watching Message\", e);\n }\n watching = false;\n }\n }\n }\n }\n\n else {\n log.error(\"Unrecognized Internal message: {}\", message);\n }\n }", "@Test\n public void testControlMessagesNotSentWhenTetheringNotAccepted() throws Exception {\n createTethering(\"xyz\", NAMESPACES, REQUEST_TIME, DESCRIPTION);\n\n // Queue up a message for the peer\n TetheringControlMessage controlMessage =\n new TetheringControlMessage(TetheringControlMessage.Type.KEEPALIVE, new byte[0]);\n MessagePublisher publisher =\n new MultiThreadMessagingContext(messagingService).getMessagePublisher();\n String topicPrefix = cConf.get(Constants.Tethering.CLIENT_TOPIC_PREFIX);\n String topic = topicPrefix + \"xyz\";\n publisher.publish(NamespaceId.SYSTEM.getNamespace(), topic, GSON.toJson(controlMessage));\n\n // Poll the server\n HttpRequest.Builder builder =\n HttpRequest.builder(HttpMethod.POST, config.resolveURL(\"tethering/channels/xyz\"))\n .withBody(GSON.toJson(new TetheringControlChannelRequest(null, null)));\n HttpResponse response = HttpRequests.execute(builder.build());\n // Response should not contain any messages because the peer is in PENDING state\n TetheringControlResponseV2 controlResponse =\n GSON.fromJson(response.getResponseBodyAsString(), TetheringControlResponseV2.class);\n Assert.assertTrue(controlResponse.getControlMessages().isEmpty());\n }", "public abstract boolean cancelable();", "public void handleDone( CommandDone done )\n {\n TTL_CIL_Message msg = null;\n //\tTTL_CIL_Message msg = translator.translate( done );\n\n try\n {\n cil.sendMessage( msg );\n }\n catch( IOException ioe )\n {\n\n }\n // remove msg from Hashtable(?) after dealt with\n return;\n }", "protected void onReactionAdded(String channel, String sender, String receiver, String emojiName) {}", "@Override\r\n\t\tpublic void handleMessage(Message msg) {\n\r\n\t\t\tsuper.handleMessage(msg);\r\n\r\n\t\t\twantToClose = false;\r\n\r\n\t\t}", "protected void handleECEMarkedPacket() {\n //halveCongestionWindow();\n }", "@Override\n\t\tpublic void handleMessage(Message msg) {\n\t\t\tsuper.handleMessage(msg);\n\t\t\tisTaken = true;\n\t\t}", "private CancelMessage() {\n initFields();\n }", "@Override\n\t\t\tpublic void onCancelled() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void onCancelled() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void action() {\n\t\t\t\tACLMessage message =receive(messageTemplate);\n\t\t\t\tif(message!=null) {\n\t\t\t\t\tSystem.out.println(\"Sender => \" + message.getSender().getName());\n\t\t\t\t\tSystem.out.println(\"Content => \" + message.getContent());\n\t\t\t\t\tSystem.out.println(\"SpeechAct => \" + ACLMessage.getPerformative(message.getPerformative()));\n\t\t\t\t\t//reply with a message\n//\t\t\t\t\tACLMessage reply = new ACLMessage(ACLMessage.CONFIRM);\n//\t\t\t\t\treply.addReceiver(message.getSender());\n//\t\t\t\t\treply.setContent(\"Price = 1000\");\n//\t\t\t\t\tsend(reply);\n\t\t\t\t\t\n\t\t\t\t\tconsumerContainer.logMessage(message);\n\t\t\t\t\t\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.println(\"block() ...............\");\n\t\t\t\t\tblock();\n\t\t\t\t}\n\t\t\t}", "@Override\n public boolean messagePending() {\n return commReceiver.messagePending();\n }", "@Override\n public void run() {\n reprocessPendingMessage();\n }", "@Override\n\tprotected void onCancelled()\n\t{\n\t\tsuper.onCancelled();\n\t}", "private void checkRequests()\n\t{\n\t\t// to be honest I don't see why this can't be 5 seconds, but I'm trying 1 second\n\t\t// now as the existing 0.1 second is crazy given we're checking for events that occur\n\t\t// at 60+ second intervals\n\n\t\tif ( mainloop_loop_count % MAINLOOP_ONE_SECOND_INTERVAL != 0 ){\n\n\t\t\treturn;\n\t\t}\n\n\t\tfinal long now =SystemTime.getCurrentTime();\n\n\t\t//for every connection\n\t\tfinal ArrayList peer_transports = peer_transports_cow;\n\t\tfor (int i =peer_transports.size() -1; i >=0 ; i--)\n\t\t{\n\t\t\tfinal PEPeerTransport pc =(PEPeerTransport)peer_transports.get(i);\n\t\t\tif (pc.getPeerState() ==PEPeer.TRANSFERING)\n\t\t\t{\n\t\t\t\tfinal List expired = pc.getExpiredRequests();\n\t\t\t\tif (expired !=null &&expired.size() >0)\n\t\t\t\t{ // now we know there's a request that's > 60 seconds old\n\t\t\t\t\tfinal boolean isSeed =pc.isSeed();\n\t\t\t\t\t// snub peers that haven't sent any good data for a minute\n\t\t\t\t\tfinal long timeSinceGoodData =pc.getTimeSinceGoodDataReceived();\n\t\t\t\t\tif (timeSinceGoodData <0 ||timeSinceGoodData >60 *1000)\n\t\t\t\t\t\tpc.setSnubbed(true);\n\n\t\t\t\t\t//Only cancel first request if more than 2 mins have passed\n\t\t\t\t\tDiskManagerReadRequest request =(DiskManagerReadRequest) expired.get(0);\n\n\t\t\t\t\tfinal long timeSinceData =pc.getTimeSinceLastDataMessageReceived();\n\t\t\t\t\tfinal boolean noData =(timeSinceData <0) ||timeSinceData >(1000 *(isSeed ?120 :60));\n\t\t\t\t\tfinal long timeSinceOldestRequest = now - request.getTimeCreated(now);\n\n\n\t\t\t\t\t//for every expired request \n\t\t\t\t\tfor (int j = (timeSinceOldestRequest >120 *1000 && noData) ? 0 : 1; j < expired.size(); j++)\n\t\t\t\t\t{\n\t\t\t\t\t\t//get the request object\n\t\t\t\t\t\trequest =(DiskManagerReadRequest) expired.get(j);\n\t\t\t\t\t\t//Only cancel first request if more than 2 mins have passed\n\t\t\t\t\t\tpc.sendCancel(request);\t\t\t\t//cancel the request object\n\t\t\t\t\t\t//get the piece number\n\t\t\t\t\t\tfinal int pieceNumber = request.getPieceNumber();\n\t\t\t\t\t\tPEPiece\tpe_piece = pePieces[pieceNumber];\n\t\t\t\t\t\t//unmark the request on the block\n\t\t\t\t\t\tif ( pe_piece != null )\n\t\t\t\t\t\t\tpe_piece.clearRequested(request.getOffset() /DiskManager.BLOCK_SIZE);\n\t\t\t\t\t\t// remove piece if empty so peers can choose something else, except in end game\n\t\t\t\t\t\tif (!piecePicker.isInEndGameMode())\n\t\t\t\t\t\t\tcheckEmptyPiece(pieceNumber);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}", "public void run()\n\t{\n\t\twhile (!this.isFinished)\n\t\t{\n\t\t\tMessage request = this.mBuff.get(); // get request from own mailbox\n\n\t\t\t// how many times has the follower danced with the requester.\n\t\t\t// might be faster with an array of timesDanced values for each leader known\n\t\t\tint count = 0;\n\t\t\tfor (int i=0; i<mDanceCard.length; i++)\n\t\t\t{\n\t\t\t\tif (mDanceCard[i] == request.dancer.getDancerID())\n\t\t\t\t\tcount++;\n\t\t\t}\n\t\t\t\n\t\t\t//System.out.println(mNumber + \" Being asked to dance: \" + request.dance_number + \" by \" \n\t\t\t//\t\t\t\t\t+ request.dancer.getDancerID());\n\n\t\t\tLeader leader = (Leader)request.dancer;\n\t\t\tif (mDanceCard[request.dance_number] != 0 || count >= 2) // nope.\n\t\t\t{\n\t\t\t\trequest.dance_number = -1;\n\t\t\t\tthis.put(request, leader); \t// send back request with -1 for dance_number\n\t\t\t}\n\t\t\telse // say yes! mark card and see if you're done\n\t\t\t{\n\t\t\t\tthis.markCard(request.dance_number, request.dancer.getDancerID());\n\t\t\t\trequest.dancer = this;\n\t\t\t\tthis.put(request, leader);\t// send back request, but with the follower's own number\n\t\t\t}\n\t\t}\n\t\t//System.out.println(\"Follower \" + mNumber + \" is finished.\");\n\t\t\n\t\t// still check requests, but refuse them all.\n\t\twhile (this.isFinished)\n\t\t{\n\t\t\tMessage request = this.mBuff.get();\n\n\t\t\tLeader leader = (Leader)request.dancer;\n\t\t\trequest.dance_number = -1;\n\t\t\tthis.put(request, leader);\n\t\t}\n\t}", "synchronized void cancel()\n {\n state = DNSState.CANCELED;\n notifyAll();\n }", "@Override\n\t\tprotected void onCancelled() {\n\t\t\tsuper.onCancelled();\n\t\t\t\n\t\t}", "private void onMessage(JsonRpcMessage msg) {\n List<JsonRpcMessage> extraMessages = super.handleMessage(msg, true);\n notifyMessage(msg);\n for(JsonRpcMessage extraMsg: extraMessages) {\n notifyMessage(extraMsg);\n }\n }", "@Override\n public void onSuccess(IMqttToken asyncActionToken) {\n String topic = uniqueId+\"/\"+chipid+\"/addCommand\";\n int qos = 1;\n try {\n IMqttToken subToken = client.subscribe(topic, qos);\n subToken.setActionCallback(new IMqttActionListener() {\n @Override\n public void onSuccess(IMqttToken asyncActionToken) {\n MqttCallback mqttCallback = new MqttCallback() {\n\n @Override\n public void connectionLost(Throwable cause) {\n //COMMAND FAIL\n imgCommandPopup.setVisibility(View.INVISIBLE);\n textWaiting.setVisibility(View.INVISIBLE);\n // failed.setVisibility(View.VISIBLE);\n // commandStatus(textCommandPopup,getResources().getString(R.string.command_add_failed),fadePopup,CommandPopup);\n }\n\n @Override\n public void messageArrived(String topic, MqttMessage message) throws Exception {\n espResponse = message.toString();\n // Toast.makeText(TempCom.this, espResponse, Toast.LENGTH_SHORT).show();\n client.disconnect();\n }\n\n @Override\n public void deliveryComplete(IMqttDeliveryToken token) {}\n };\n client.setCallback(mqttCallback);\n }\n\n @Override\n public void onFailure(IMqttToken asyncActionToken, Throwable exception) {\n //COMMAND FAIL\n imgCommandPopup.setVisibility(View.INVISIBLE);\n textWaiting.setVisibility(View.INVISIBLE);\n failed.setVisibility(View.VISIBLE);\n commandStatus(textCommandPopup,getResources().getString(R.string.command_add_failed),fadePopup,CommandPopup);\n }\n });\n } catch (MqttException e) {\n e.printStackTrace();\n }\n }", "@Override\n\t\tprotected void onCancelled() {\n\t\t\tsuper.onCancelled();\n\t\t}", "@Override\n\t\tprotected void onCancelled() {\n\t\t\tsuper.onCancelled();\n\t\t}", "@Override\n\t\tprotected void onCancelled() {\n\t\t\tsuper.onCancelled();\n\t\t}", "private void handleMessage(final AdoptRequest msg) {\n if (!parents.containsKey(msg.getTreeID()) || bloomFilter.get(msg.getTreeID()).mightContain(msg.sourceId)\n || currLoad + 1 > upperThreshold) {\n if (!msg.isLoadBalancing()) {\n debugPrint(network.getAddress() + \" refused to latency-adopt \" + msg.sourceId);\n }\n network.send(new AdoptRequestDecline(getMessageTag(), network.getAddress(), msg.sourceId, msg.getTreeID(), msg\n .getThirdParty(), msg.isLoadBalancing()));\n } else {\n if (!msg.isLoadBalancing()) {\n debugPrint(network.getAddress() + \" agreed to latency-adopt \" + msg.sourceId);\n }\n addSonToTree(msg.getTreeID(), msg.sourceId);\n network.send(new AdoptRequestAccept(getMessageTag(), network.getAddress(), msg.sourceId, msg.getTreeID(),\n msg.getThirdParty(), bloomFilter.get(msg.getTreeID()).copy(), msg.isLoadBalancing()));\n }\n }", "@Override\r\n\tpublic void quack() {\n\t\tSystem.out.println(\"I do Quack Quack\");\r\n\t}", "@Override\r\n\tpublic void quack() {\n\t\tsuper.gobble();\r\n\t}", "public void onUaCallCancelled(UserAgent ua)\n { readyToReceive();\n }", "@Override\r\n\tprotected void onCancelled() {\n\t\tsuper.onCancelled();\r\n\t}", "@Override\n\t\t\t\t\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\t\t\t\t\tcancelsent=0;\n\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\tLog.e(\"About to get out\",\"before sending kickmeout\");\n\t\t\t\t\t\t\t\t\t\t\t\t\tif(dos!=null)\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif(ispeak==1)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{ispeak=0;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdos.writeUTF(\"kick_me_out_speaking\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tLog.e(\"Kick me\",\"KICKED SPEAKING\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\tdos.writeUTF(\"kick_me_out_waiting\");\n\t\t\t\t\t\t\t\t\t\t\t\t\tdos.writeUTF(TestConnection.macid);\n\t\t\t\t\t\t\t\t\t\t\t\t\tLog.e(\"Kick me\",\"KICKED WAITING\");\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\tcancelsent=1;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\t\t\t\trecSocket.close();\n\t\t\t\t\t\t\t\t\t\t\t\t\tLog.e(\"closing\", \"socket closed\");\n\t\t\t\t\t\t\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}", "public void signalCheck() {\n if(moves.length == 0){\n setiHaveCheck(false);\n pathToKing = null;\n rangeOfCheck = null;\n }\n for(int i = 0; i < moves.length; i++) {\n Space tmp = Board.fetchSpace(moves[i]);\n if(tmp.getPiece() != null) {\n if(this.getType().charAt(0) != tmp.getPiece().getType().charAt(0) && tmp.getPiece().getType().charAt(1) == 'K') {\n setiHaveCheck(true);\n calcPathToKing(tmp);\n break;\n }\n else {\n setiHaveCheck(false);\n pathToKing = null;\n rangeOfCheck = null;\n }\n }\n else {\n setiHaveCheck(false);\n pathToKing = null;\n rangeOfCheck = null;\n }\n }\n }", "@EventHandler\n public void onServerKick(ServerKickEvent event) {\n // check if its a \"fresh\" connection\n if (event.getPlayer().getServer() == null)\n return;\n\n if (event.getKickedFrom().getName().equals(Config.target)) {\n // Move Player back to the queue\n try {\n mutex.acquire();\n String reason = BaseComponent.toLegacyText(event.getKickReasonComponent());\n ProxiedPlayer player = event.getPlayer();\n\n // lost connection -> disconnected\n if (reason.toLowerCase().contains(\"banned\")) {\n // if banned don't add back to the queue;\n player.disconnect(event.getKickReasonComponent());\n } else if (!reason.toLowerCase().contains(\"lost connection\")) {\n // add to the queue again since the player did not left the queue and the event is not triggered\n if (event.getPlayer().getServer().getInfo() == ProxyServer.getInstance().getServerInfo(Config.queue)) {\n playersQueue.add(player);\n Main.log(\"onServerKick\", \"§3§b\" + player.toString() + \"§3 was added to the §b\" + Config.queue + \"§3. Queue count is \" + playersQueue.size() + \". Kicked count is \" + (kickedPlayers.size() + 1) + \".\");\n }\n\n // if config is not set to kick or if the server was kicked while connecting\n if(!Config.kick || event.getPlayer().getServer().getInfo() == ProxyServer.getInstance().getServerInfo(Config.queue)) {\n // cancel kick and send back to the queue\n event.setCancelled(true);\n event.setCancelServer(ProxyServer.getInstance().getServerInfo(Config.queue));\n\n player.sendMessage(TextComponent.fromLegacyText(\"§6You were sent back to the queue for: §c\" + reason + \"§r\"));\n Main.log(\"onServerKick\", \"§3§b\" + player.toString() + \"§3 was sent back to §b\" + Config.queue + \"§3 after a kick (\" + reason + \"§3). Kicked count is \" + (kickedPlayers.size() + 1) + \".\");\n\n kickedPlayers.put(player, Instant.now().getEpochSecond());\n }\n else {\n // kick the player if the event was not cancelled\n Main.log(\"onServerKick\", \"§3§b\" + player.toString() + \"§3 was kicked for \" + reason + \"§3.\");\n }\n }\n } catch (InterruptedException e1) {\n e1.printStackTrace();\n } finally {\n mutex.release();\n }\n }\n }", "public void acceptMessage(java.util.Date time, OSCMessage message) {\n\t\t// FOR DEBUGGING: to print the full message:\n\t\tif (debugging) {\n\t\t\tSystem.out.print(message.getAddress());\n\t\t\tfor(int i = 0; i < message.getArguments().length; i++) {\n\t\t\t\tSystem.out.print(\", \" + message.getArguments()[i].toString());\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t\t\n\t\tif (message.getAddress().matches(\"/done\")) {\n\t\t\tif (message.getArguments()[0].toString().matches(\"/b_allocRead\")) {\n\t\t\t\t//debugPrintln(\"A buffer was created.\");\n\t\t\t}\n\t\t}\n\n\t\t//TODO: this /synced watch will work as long as the buffers load correctly.\n\t\t//but there's not yet any way to know if they fail.\n\t\telse if (message.getAddress().matches(\"/synced\")) {\n\t\t\tint id = (Integer)(message.getArguments()[0]) - _bufferReadIdOffset;\n\t\t\tsynchronized (this) {\n\t\t\t\tif (_bufferMap.containsKey(id)) {\n\t\t\t\t\tdebugPrintln(\"Buffer \" + id + \" was loaded.\");\n\t\t\t\t\tif (_notifyListener != null) { _notifyListener.receiveNotification_BufferLoaded(id, _bufferMap.get(id)); }\n\t\t\t\t\tif (_controlPanel != null && _controlPanel._statsDisplay != null) {\n\t\t\t\t\t\t_controlPanel._statsDisplay.receiveNotification_BufferLoaded(id, _bufferMap.get(id));\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\telse if (message.getAddress().matches(\"/n_go\") ||\n\t\t\tmessage.getAddress().matches(\"/n_info\")) {\n\t\t\t//if it was node 1, then we can get going.\n\t\t\tif ((Integer)(message.getArguments()[0]) == _motherGroupID && \n\t\t\t\t(Integer)(message.getArguments()[1]) == 1 ) {\n\t\t\t\tif (!_serverBooted) {\n\t\t\t\t\t_serverBooted = true;\n\t\t\t\t\thandleServerBooted();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// handle notices of freed nodes\n\t\telse if (message.getAddress().matches(\"/n_end\")) {\n\t\t\t// take message.getArguments()[0] (the node id that was freed)\n\t\t\t// and free up any resources associated with it.\n\t\t\t//debugPrintln(\"node \" + message.getArguments()[0].toString() + \" was freed.\");\n\t\t\tInteger id = (Integer) (message.getArguments()[0]);\n\t\t\tif (id > _motherGroupID) {\n\t\t\t\t// it's a group node. a SoundNode has died.\n\t\t\t\tsynchronized (this) {\n\t\t\t\t\tSoundNode sn = _soundNodes.get(id);\n\t\t\t\t\tif (sn != null) {\n\t\t\t\t\t\tsn.setAlive(false);\n\t\t\t\t\t\tfreeBus(sn.get_busID());\n\t\t\t\t\t}\n\t\t\t\t\t_soundNodes.remove(id);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// free up that node from the node id list.\n\t\t\t\tsynchronized (this) {\n\t\t\t\t\t_nodeIdList.remove(message.getArguments()[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//handle /status responses (status.reply)\n\t\telse if (message.getAddress().matches(\"/status.*\")) {\n\t\t\t//TODO update control panel display with status data\n\t\t\tInteger numUgens = (Integer)(message.getArguments()[1]);\n\t\t\tInteger numSynths = (Integer)(message.getArguments()[2]);\n\t\t\tInteger numGroups = (Integer)(message.getArguments()[3]);\n\t\t\tInteger numSynthdefs = (Integer)(message.getArguments()[4]);\n\t\t\tFloat avgCPU = (Float)(message.getArguments()[5]);\n\t\t\tFloat peakCPU = (Float)(message.getArguments()[6]);\n\t\t\thandleServerStatusUpdate(numUgens, numSynths, numGroups, numSynthdefs, avgCPU, peakCPU);\n\t\t}\n\t\t\n\t}", "void receive(String watcher) throws ProtocolExecutionException;", "public void onCancelled();", "@Override\n public void handleMessage(Message msg) {\n if (isPlaying() || mMediaplayerHandler.hasMessages(TRACK_ENDED)) {\n return;\n }\n // save the queue again, because it might have changed\n // since the user exited the music app (because of\n // party-shuffle or because the play-position changed)\n }", "@Override\n public void onCanceled(WorkerOperation.Result data) {\n super.onCanceled(data);\n\n }", "@Override\n public void action() {\n ACLMessage acl = receive();\n if (acl != null) {\n if (acl.getPerformative() == ACLMessage.REQUEST) {\n try {\n ContentElement elemento = myAgent.getContentManager().extractContent(acl);\n if (elemento instanceof PublicarServicio) {\n PublicarServicio publicar = (PublicarServicio) elemento;\n Servicio servicio = publicar.getServicio();\n jadeContainer.iniciarChat(servicio.getTipo(), servicio.getDescripcion());\n //myAgent.addBehaviour(new IniciarChatBehaviour(myAgent, servicio.getTipo(), servicio.getDescripcion()));\n } else if (elemento instanceof EnviarMensaje) {\n EnviarMensaje enviar = (EnviarMensaje) elemento;\n Mensaje mensaje = enviar.getMensaje();\n jadeContainer.enviarMensajeChatJXTA(mensaje.getRemitente(), mensaje.getMensaje());\n }\n } catch (CodecException ex) {\n System.out.println(\"CodecException: \" + ex.getMessage());\n } catch (UngroundedException ex) {\n System.out.println(\"UngroundedException: \" + ex.getMessage());\n } catch (OntologyException ex) {\n System.out.println(\"OntologyException: \" + ex.getMessage());\n }\n }\n } else {\n block();\n }\n }", "private void onMakeCoffeeRetry(){\n\t\t// ui\n\t\tmMakeCoffeeProgress.setVisibility(View.INVISIBLE);\n\t\tmMakeCoffeeSuccess.setVisibility(View.INVISIBLE);\n\t\tmMakeCoffeeProgressTip.setText(MakeCoffeeCartActivity.this.getString(R.string.make_coffee_retry));\n\t\tmMakeCoffeeFailed.setVisibility(View.VISIBLE);\n\t\tmMakeCoffeeRetry.setVisibility(View.VISIBLE);\n\t\t// sound tip\n\t\tAudioPlayer.getInstance().play(this, R.raw.sound_coffee_make_retry);\n\t}", "@Override\n\t\t\t\tpublic void run() {\n//\t\t\t\t\t\n//\t\t\t\t\tSystem.out.printf(\"Ausgangs-Puffer: \");\n//\t\t\t\t\tfor(int i=0; i<Message.length; i++)\tSystem.out.printf(\"0x%02X \", eeipClient.O_T_IOData[i]);\n//\t\t\t\t\tSystem.out.printf(\"\\n\\n\");\n\t\t\t\t\tk++;\n\t\t\t\t\t\n\t\t\t\t\tif(k>=10) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\teeipClient.ForwardClose();\n\t\t\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t}\n\t\n\t\t\t\t\t\ttimerflag1=false;\n\t\t\t\t\t\tstatus_write=true;\n\t\t\t\t\t\tstate=3;\n\t\t\t\t\t\tk=0;\n\t\t\t\t\t\tthis.cancel();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n\tpublic void eventCancelled() {\n\t\tstatus=EventCancelled;\n\t}", "@Override\n\t\tpublic void action() {\n\t\t\tMessageTemplate mt = MessageTemplate.MatchPerformative(ACLMessage.REQUEST); \n\t\t\tACLMessage msg = receive(mt);\n\t\t\tif(msg != null){\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tContentElement ce = null;\n\t\t\t\t\tSystem.out.println(msg.getContent()); //print out the message content in SL\n\n\t\t\t\t\t// Let JADE convert from String to Java objects\n\t\t\t\t\t// Output will be a ContentElement\n\t\t\t\t\tce = getContentManager().extractContent(msg);\n\t\t\t\t\tSystem.out.println(ce);\n\t\t\t\t\tif(ce instanceof Action) {\n\t\t\t\t\t\tConcept action = ((Action)ce).getAction();\n\t\t\t\t\t\tif (action instanceof SupplierOrder) {\n\t\t\t\t\t\t\tSupplierOrder order = (SupplierOrder)action;\n\t\t\t\t\t\t\t//CustomerOrder cust = order.getItem();\n\t\t\t\t\t\t\t//OrderQuantity = order.getQuantity();\n\t\t\t\t\t\t\tif(!order.isFinishOrder()) {\n\t\t\t\t\t\t\tSystem.out.println(\"exp test: \" + order.getQuantity());\n\t\t\t\t\t\t\trecievedOrders.add(order);}\n\t\t\t\t\t\t\telse {orderReciever = true;}\n\t\t\t\t\t\t\t//Item it = order.getItem();\n\t\t\t\t\t\t\t// Extract the CD name and print it to demonstrate use of the ontology\n\t\t\t\t\t\t\t//if(it instanceof CD){\n\t\t\t\t\t\t\t\t//CD cd = (CD)it;\n\t\t\t\t\t\t\t\t//check if seller has it in stock\n\t\t\t\t\t\t\t\t//if(itemsForSale.containsKey(cd.getSerialNumber())) {\n\t\t\t\t\t\t\t\t\t//System.out.println(\"Selling CD \" + cd.getName());\n\t\t\t\t\t\t\t\t//}\n\t\t\t\t\t\t\t\t//else {\n\t\t\t\t\t\t\t\t\t//System.out.println(\"You tried to order something out of stock!!!! Check first!\");\n\t\t\t\t\t\t\t\t//}\n\n\t\t\t\t\t\t\t//}\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\n\t\t\t\t\t}\n\t\t\t\t\t//deal with bool set here\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tcatch (CodecException ce) {\n\t\t\t\t\tce.printStackTrace();\n\t\t\t\t}\n\t\t\t\tcatch (OntologyException oe) {\n\t\t\t\t\toe.printStackTrace();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse{\n\t\t\t\tblock();\n\t\t\t}\n\t\t}", "@Override\n\tpublic void msgAtKitchen() {\n\t\t\n\t}" ]
[ "0.622774", "0.6220891", "0.6100461", "0.5562551", "0.55527556", "0.55431896", "0.54606205", "0.5453156", "0.53058493", "0.5244387", "0.52004415", "0.5192758", "0.510799", "0.50959396", "0.5057214", "0.5054918", "0.504568", "0.5040048", "0.50270283", "0.5021875", "0.50200784", "0.49916276", "0.4988844", "0.49794516", "0.49739045", "0.49689355", "0.49625257", "0.49545938", "0.49508303", "0.49495527", "0.4948829", "0.4942742", "0.4924042", "0.49207404", "0.49203062", "0.49123013", "0.4907583", "0.49072832", "0.49054986", "0.49020383", "0.490156", "0.490156", "0.490156", "0.490156", "0.48968482", "0.4896203", "0.48951733", "0.489144", "0.4889333", "0.48787355", "0.4877267", "0.48705873", "0.4868826", "0.48685122", "0.48615152", "0.48606634", "0.4857138", "0.48466498", "0.48437014", "0.483428", "0.48333988", "0.4830253", "0.48165998", "0.48073396", "0.47938105", "0.47909427", "0.4790561", "0.4790561", "0.47815138", "0.47800893", "0.477867", "0.4778053", "0.477779", "0.47753754", "0.47746727", "0.47722253", "0.47696143", "0.47692555", "0.4762791", "0.4762791", "0.4762791", "0.4762734", "0.47604406", "0.47587425", "0.47558084", "0.47537157", "0.47495398", "0.47476426", "0.47453353", "0.47382903", "0.47334108", "0.4733213", "0.47323683", "0.47316435", "0.47291636", "0.4727656", "0.47215194", "0.4720621", "0.47195876", "0.47190747" ]
0.70227873
0
called on "cancel" message receive, removes correspondent enqueued message from the send queue if exists and notifies parent torrent to unlock the linked block of data (if buffered somehow)
void onCancel(int index, int begin, int length) { // validate common block parameters boolean correct = torrent.validateBlock(index, begin, length); if (!correct) { close(Peer.CloseReason.PROTOCOL_ERROR); return; } // check if are processing this request right now for (int i = 0; i < peerBlockRequests.size(); i++) { StdPeerMessage pm = peerBlockRequests.get(i); if ((pm.index == index) && (pm.begin == begin) && (pm.length == length)) { peerBlockRequests.remove(i); pmCache.release(pm); break; } } // check if response has been enqueued, // could be skipped if found in pBR for (int i = 0; i < sendQueue.size(); i++) { StdPeerMessage pm = sendQueue.get(i); if ((pm.type == StdPeerMessage.PIECE) && (pm.index == index) && (pm.begin == begin) && (pm.length == length)) { sendQueue.remove(i); // let storage to unlock block of data // and return it into cache of blocks TorrentStorage.Block block = (TorrentStorage.Block) pm.params; block.release(); pmCache.release(pm); break; } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected void enqueue(StdPeerMessage message)\n {\n// if (DEBUG) {\n// if (message.type == StdPeerMessage.REQUEST) {\n// System.out.println(System.nanoTime() + \" [stdpc] enqueue: req \" + message.index + \" \" + (message.begin >> 14));\n// } else {\n// System.out.println(\"[stdpc] enqueue: \" + message.type);\n// }\n// }\n\n if (message.type == StdPeerMessage.CHOKE)\n {\n // remove reply messages with piece (block) data\n // from the send queue (due to spec)\n for (int i = sendQueue.size() - 1; 0 <= i; i--) {\n StdPeerMessage pm = sendQueue.get(i);\n if (pm.type == StdPeerMessage.PIECE) {\n sendQueue.remove(i);\n TorrentStorage.Block block = (TorrentStorage.Block) message.params;\n block.release();\n pmCache.release(pm);\n }\n }\n // set choke status\n choke = true;\n // send choke asap\n sendQueue.add(0, message);\n }\n else if (message.type == StdPeerMessage.CANCEL)\n {\n // remove the linked request if it's still in the queue\n for (int i = sendQueue.size() - 1; 0 <= i; i--) {\n StdPeerMessage pm = sendQueue.get(i);\n if ((pm.type == StdPeerMessage.REQUEST)\n && (pm.index == message.index)\n && (pm.begin == message.begin)\n && (pm.length == message.length)) // this check is redundant as length is fixed\n {\n sendQueue.remove(i);\n pmCache.release(pm);\n // don't really enqueue CANCEL as the linked request\n // has been found and removed\n pmCache.release(message);\n return;\n }\n }\n // send asap\n sendQueue.add(0, message);\n }\n else {\n if (message.type == StdPeerMessage.INTERESTED) {\n interested = true;\n }\n else if (message.type == StdPeerMessage.NOT_INTERESTED) {\n interested = false;\n }\n else if (message.type == StdPeerMessage.UNCHOKE) {\n choke = false;\n }\n\n // enqueue message\n sendQueue.add(message);\n }\n\n// sendQueue.forEach(pm -> System.out.println(\" -x> \" + System.identityHashCode(pm) + pm.type + \" ,\" + pm.index +\",\" + pm.begin +\",\" + pm.length) );\n\n }", "public void decache(TransportMessage message) throws TransportException {\n\n try {\n storage(Q_STORENAME).remove(message);\n } catch(IllegalArgumentException iae) {\n //Already removed from the cache. Possibly by another sender. Not a problem.\n Logger._().log(\"transport\", \"Attempt to decache already decached message\", new Date());\n return;\n }\n message.setID(-1);\n\n // if we're dequeuing a successfully sent message\n // then transfer it to the recently sent list\n if (message.isSuccess()) {\n IStorageUtilityIndexed recent = storage(RECENTLY_SENT_STORENAME);\n // ensure that the recently sent store doesn't grow indefinitely\n // by limiting its size\n\n //With threads this gets tricky, since nextID can throw an exception if the iterator becomes invalid\n //before the next ID is retrieved. As such, we'll put this attempt to remove the message in\n //a loop and try to properly use the lock.\n\n boolean entered=false;\n int attempts = 0;\n\n while(attempts < 5 && !entered) {\n attempts++;\n\n if(recent.getNumRecords() == RECENTLY_SENT_STORE_MAXSIZE) {\n try {\n //I don't think we can simply grab the lock, since it's needed\n //by the actual storage processes\n IStorageIterator it = recent.iterate();\n int first = it.nextID();\n recent.remove(first);\n\n //ITERATOR IS NOW INVALID\n } catch(StorageModifiedException sme) {\n //The iterator became invalid before it could properly remove the record\n //in question. Will try again.\n Logger._().log(\"transport\", \"Iterator invalidated before message removal\", new Date());\n } catch(IllegalArgumentException iae) {\n //The record that was going to be removed was deleted before we\n //could get to it. Will try again.\n }\n }\n try {\n recent.write(message);\n entered = true;\n } catch (StorageFullException e) {\n throw new TransportException(e);\n }\n }\n }\n updateCachedCounts();\n }", "public void cancelReceive() {\n\t\tif(receiveInProgress) {\n\t\t\treceiveInProgress = false;\n\t\t\treceiveComplete = false;\n\t\t\t\n\t\t\t// delete current file\n\t\t\ttry {\n\t\t\t\tFiles.deleteIfExists(currentFile.toPath());\n\t\t\t} catch (IOException e1) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tfileOutput.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t} else {\n\t\t\t// nothing\n\t\t\treturn;\n\t\t}\n\t\t\n\t}", "@Override\n public void run() {\n BlockPos cachePosition = teleportee.getPosition();\n while (cachePosition.equals(teleportee.getPosition()) || pendingTeleports.containsKey(originalSender)) {/*block execution until move or teleport*/}\n if (pendingTeleports.containsKey(originalSender)) { //has not teleported\n pendingTeleports.remove(sender.getName(), originalSender);\n sender.addChatMessage(new TextComponentString(TextFormatting.RED + \"Teleport canceled.\"));\n teleportee.addChatMessage(new TextComponentString(TextFormatting.RED + \"Teleport canceled.\"));\n }\n }", "public void stopSending ();", "@Override\n protected void connectionClosed(Peer.CloseReason reason)\n {\n Stream.concat(sendQueue.stream(), blockRequests.stream())\n .filter(pm -> pm.type == StdPeerMessage.REQUEST)\n .forEach(pm -> {\n torrent.cancelBlockRequest(pm.index, pm.begin);\n });\n\n // release messages\n sendQueue.forEach( pmCache::release);\n sendQueue.clear();\n // and active requests\n blockRequests.forEach( pmCache::release);\n blockRequests.clear();\n // peerRequests\n peerBlockRequests.forEach( pmCache::release);\n peerBlockRequests.clear();\n\n peer.setConnectionClosed(reason);\n\n // incoming connections could be not linked yet\n if (torrent != null) {\n torrent.onPeerDisconnect(this);\n }\n\n // todo: release caches via connectionFactory\n }", "@CallByThread(\"Netty EventLoop\")\n void runCancel() {\n if (referenced > 0) { // is blocking\n incomingPublishService.drain();\n }\n }", "public final void cancel() {\n mHandler.removeMessages(MSG);\n mCancelled = true;\n }", "@Override\n public final void removeNextMessage() {\n }", "protected void cancelTimedOutBlockRequests()\n {\n long now = System.currentTimeMillis();\n for (int i = blockRequests.size() - 1; 0 <= i; i--) {\n StdPeerMessage pm = blockRequests.get(i);\n if (pm.timestamp + DOWNLOAD_QUEUE_REQUESTS_TIMEOUT < now) {\n System.out.println(\"-Xo \" + pm.index + \" \" + (pm.begin >> 14));\n blockRequests.remove(i);\n torrent.cancelBlockRequest(pm.index, pm.begin);\n pmCache.release(pm);\n }\n }\n }", "private void stopQueuedItemsSender() {\n if (ctrlSenderTimerRunning) {\n ctrlSenderTimer.cancel();\n }\n\n ctrlSenderTimerRunning = false;\n }", "void sendCancelMessage();", "protected void aq() {\n Object object = this.li;\n synchronized (object) {\n if (this.lz != null) {\n this.lp.unregisterReceiver(this.lz);\n this.lz = null;\n }\n return;\n }\n }", "private void dequeueMessages()\n\t{\n\t\twhile (_msg_queue.size() > 0)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_ml.messageReceived( (Serializable) _msg_queue.removeFirst());\n\t\t\t}\n\t\t\tcatch (RuntimeException rte)\n\t\t\t{\n\t\t\t\trte.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void run() {\n reprocessPendingMessage();\n }", "private void stopRequest(){ Remove the clause synchronized of the stopRequest method.\n // Synchronization is isolated as possible to avoid thread lock.\n // Note: the method removeRequest from SendQ is synchronized.\n // fix bug jaw.00392.B\n //\n synchronized(this){\n setRequestStatus(stAborted);\n }\n informSession.getSnmpQManager().removeRequest(this);\n synchronized(this){\n requestId=0;\n }\n }", "@Override\n public synchronized void delete(String queueName, QueueMessage message) {\n if(message == null) {\n return;\n }\n\n // If we process FIFO this makes it slightly faster\n // to find the next message to process\n this.readQueueLocation = message.getQueueLocation();\n\n this.ringBufferQueue[message.getQueueLocation()] = null;\n this.itemsInQueue--;\n }", "public void blockingReceiveSenderSide() throws OOBException {\n \t}", "private static void handleReceivedMessage(){\r\n\t\t// checks if the arrayList with the received blockNumbers contains the last received blockNumber\r\n\t\tif (!receivedBlockNumbers.contains(actualReceivedBlockNumber)){\r\n\t\t\t// if the arrayList with the BlockNumbers of the received messages does not contain the current received Message (blocknumber), the blocknumber will be added to the array\r\n\t\t\treceivedBlockNumbers.add(actualReceivedBlockNumber);\r\n\t\t\t// only messages which were't received yet will be added to the data output stream\r\n\t\t\ttry {\r\n\t\t\t\tdos.write(incomingPacket.getData(), 4, incomingPacket.getLength() - 4);\r\n\t\t\t\t// System.out.println(\"CLIENT: Block with the Blocknumber (\" + actualReceivedBlockNumber + \") was added to the DataOutputStream\");\t\r\n\t\t\t\tblockNumberExpected++;\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\t// ERROR NUMBER 6 - File already exists\r\n\t\t\terrorNumber = 6;\r\n\t\t\tmessage.sendErrorMessage(errorNumber, \"A message with the same blocknumber was already received and will therefore be discarded.\", sendData, ipAddress, SERVER_PORT, clientSocket);\t\r\n\r\n\t\t}\t\r\n\t}", "void onInterested(boolean state)\n {\n peerInterested = state;\n\n if (!peerInterested) {\n // remove all piece if enqueued,\n // most likely will not happen\n for (int i = sendQueue.size() - 1; 0 <= i; i--) {\n StdPeerMessage pm = sendQueue.get(i);\n if (pm.type == StdPeerMessage.PIECE) {\n sendQueue.remove(i);\n TorrentStorage.Block block = (TorrentStorage.Block) pm.params;\n block.release();\n pmCache.release(pm);\n }\n }\n }\n }", "public void stopSending() {\n shouldSend = false;\n connection.getChannel()\n .getApi()\n .getThreadPool()\n .removeAndShutdownSingleThreadExecutorService(threadName);\n }", "private void close() {\n\t\t\tassert this.sendLock.writeLock().isHeldByCurrentThread();\n\t\t\tthis.dead = true;\n\t\t\tStoreRequest s = writesByRows.remove(this.row);\n\t\t\t// This request was THE only request for its row\n\t\t\tassert this == s;\n\t\t\tlogger.fine(this.toString() + \" sent on \" + new Date(System.currentTimeMillis()) + \" and not replanned\");\n\t\t}", "private void discardQueued(boolean discardSavedBuffers) {\n ChannelBuffer buf, nxt;\n\n buf = inQueueHead;\n inQueueHead = null;\n inQueueTail = null;\n for (; buf != null; buf = nxt) {\n nxt = buf.next;\n recycleBuffer(buf, discardSavedBuffers);\n }\n\n // If discardSavedBuffers is true, must also discard any previously\n // saved buffer in the saveInBuf field.\n \n if (discardSavedBuffers) {\n if (saveInBuf != null) {\n saveInBuf = null;\n }\n }\n }", "protected void closeNotSuccessful() {\n\t\tthis.writer.deblockQueue();\n\t}", "@Override\r\n public void cancelMsg() {\n System.out.println(\"Transaction has been cancelled for gas pump #1..\");\r\n }", "public void clearReceived() {\n\t\t_received = false;\n\t}", "@Override\n public void run() {\n try {\n pendingConfirms.remove(target.getName(),sender.getName());\n } catch (Exception ignored) {/*player has already confirmed*/}\n }", "public void ejectTicket(){if(this.inProgress()){this.currentTicket=null;}}", "public void reject() {\n rejectBus.add(applicantQueue.dequeue());\n }", "public void releaseMessageBufferingFromTracking(Slot slot, long messageId) {\n if(log.isDebugEnabled()) {\n log.debug(\"Releasing message buffering tacking id= \" + messageId);\n }\n messageBufferingTracker.get(slot).remove(messageId);\n }", "private void handleFutileKill() {\n handler.removeMessages(15);\n Slog.i(TAG, \"handle futile kill, close zswapd\");\n closeZswapd();\n Message msg = handler.obtainMessage();\n msg.what = 15;\n handler.sendMessageDelayed(msg, (long) futileCloseDelay);\n }", "public void stampMessageAsDLCAndRemoveFromTacking(long messageID) throws AndesException {\n //remove actual object from memory\n if(log.isDebugEnabled()) {\n log.debug(\"Removing all tracking of message id = \" + messageID);\n }\n MsgData trackingData = msgId2MsgData.remove(messageID);\n UUID channelID = trackingData.channelId;\n String queueName = trackingData.queue;\n Slot slot = trackingData.slot;\n releaseMessageDeliveryFromTracking(channelID, messageID);\n releaseMessageBufferingFromTracking(slot, messageID);\n\n decrementMessageCountInSlotAndCheckToResend(slot, queueName);\n }", "public void ClearSentQueue() {\n \t\tjobsent.clear();\n \t}", "public void resendRequestingQueue() {\n Logger.m1416d(TAG, \"Action - resendRequestingQueue - size:\" + this.mRequestingQueue.size());\n printRequestingQueue();\n printRequestingCache();\n while (true) {\n Requesting requesting = (Requesting) this.mRequestingQueue.pollFirst();\n if (requesting == null) {\n return;\n }\n if (requesting.request.getCommand() == 2) {\n this.mRequestingQueue.remove(requesting);\n this.mRequestingCache.remove(requesting.request.getHead().getRid());\n } else {\n requesting.retryAgain();\n sendCommandWithLoggedIn(requesting);\n }\n }\n }", "private void finishRequests(){\n\t\tpeer.getRequests().removeAll(finishedRequestsList);\n\t\tfinishedRequestsList.clear();\n\t}", "public void onUnblock();", "@Override\n public void contractCompletedMethod(Messages.CompletedContract msg) {\n runningContracts.remove(msg.contID);\n if (isLeaving && runningContracts.size() == 0) {\n stop();\n }\n }", "public void ClearUnsentQueue() {\n \t\tjobqueue.clear();\n \t}", "synchronized void endCriticalUse(){\nSC = false;\nJeton=false;\n\nif (procId==0){\n\tSyncMessage sm = new SyncMessage(MsgType.JETON, 0, procId);\n\tsendTo(0, sm);\n}else{\n\tSyncMessage sm = new SyncMessage(MsgType.JETON, 1, procId);\n\tsendTo(1, sm);\n}\n\n}", "public void reQueueMessage(AndesMessageMetadata metadata) throws AndesException {\n QueueDeliveryWorker.QueueDeliveryInfo queueDeliveryInfo = QueueDeliveryWorker.getInstance().\n getQueueDeliveryInfo(metadata.getDestination());\n if (log.isDebugEnabled()) {\n log.debug(\"Re-Queueing message \" + metadata.getMessageID() + \" to readButUndeliveredMessages map\");\n }\n queueDeliveryInfo.readButUndeliveredMessages.add(metadata);\n }", "protected void delete () {\n OleThreadRequest request = \n new OleThreadRequest(DELETE,\n 0, 0, 0, 0);\n synchronized (this) {\n messagesWaiting.add(request);\n notify();\n }\n while (!request.finished) { \n synchronized(request) {\n try {\n request.wait(POLL_FOR_RESULT_HEARTBEAT);\n }\n catch (InterruptedException e) { \n }\n } \n }\n }", "synchronized void cancel()\n {\n state = DNSState.CANCELED;\n notifyAll();\n }", "protected abstract void sendCancel(Status reason);", "synchronized void \n receivedLast() \n {\n closedByWriter = true;\n notifyAll();\n }", "protected Request barrierBlockingRemove() {\n while (((this.isEmpty() && this.shouldWait) || this.suspended ||\n (this.indexOfRequestToServe() == -1)) &&\n !this.specialExecution) {\n if (this.hasListeners()) {\n this.notifyAllListeners(new RequestQueueEvent(this.ownerID,\n RequestQueueEvent.WAIT_FOR_REQUEST));\n }\n try {\n this.wait();\n } catch (InterruptedException e) {\n }\n }\n if (this.specialExecution) {\n this.specialExecution = false;\n return this.blockingRemoveOldest(this.specialMethod);\n }\n return this.barrierRemoveOldest();\n }", "public void invalidate() {\n for (int i = 0; true; i = (2 * i + 1) & 63) {\n synchronized (this) {\n this.listener = null;\n this.sema = null;\n if (!deliveryPending || (Thread.currentThread().getId() == id)) {\n return;\n }\n }\n if (i == 0) {\n Thread.yield();\n } else {\n if (i > 3) Log.finer(Log.FAC_NETMANAGER, \"invalidate spin {0}\", i);\n try {\n Thread.sleep(i);\n } catch (InterruptedException e) {\n }\n }\n }\n }", "public void endMessage()\n\t{\n\t}", "void blockUntilFreeSlotForMessage() throws InterruptedException {\n lock.lockInterruptibly();\n try {\n while (messageQueue.size() == messageCapacity) {\n messageQueueNotFull.await();\n }\n } finally {\n lock.unlock();\n }\n }", "public E remove() throws FileQueueClosedException;", "protected void addChannelToReadCompletePendingQueue() {\n/* 354 */ while (!Http2MultiplexHandler.this.readCompletePendingQueue.offer(this)) {\n/* 355 */ Http2MultiplexHandler.this.processPendingReadCompleteQueue();\n/* */ }\n/* */ }", "@Override\r\n\t\tpublic void handleMessage(Message msg) {\n\r\n\t\t\tsuper.handleMessage(msg);\r\n\r\n\t\t\twantToClose = false;\r\n\r\n\t\t}", "void stopMessageProcessing(int msgId) {\r\n\t\trCache.changesEnd(msgId);\r\n\t}", "public void loop() {\n try {\n Mail<T> mail = mailBox.remove();\n\n actor.setSender(mail.getSender());\n actor.receive(mail.getMessage());\n } catch (InterruptedException e) {\n }\n }", "public void removeReceived() {\n\t if (LogWriter.needsLogging(LogWriter.TRACE_DEBUG))\n LogWriter.logMessage(LogWriter.TRACE_DEBUG, \"removeReceived()\" );\n Via via=(Via)sipHeader;\n via.removeParameter(Via.RECEIVED);\n }", "void onSynchronizationCancel();", "public void run(){\n\t\t\t\t\t\tsynchronized(keyHashMap.get(key)){\r\n\t\t\t\t\t\t\tSystem.out.println(\"Removed Key: \" + key + \" Time: \" + timestamp);\r\n\t\t\t\t\t\t\tkeyHashMap.get(key).remove(timestamp);\r\n\t\t\t\t\t\t\tkeyHashMap.get(key).notifyAll();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\treq.response().putHeader(\"Content-Type\", \"text/plain\");\r\n\t\t\t\t\t\treq.response().end();\r\n\t\t\t\t\t\treq.response().close();\r\n\t\t\t\t\t}", "default void onCancel(MessageCreateEvent event, Message message) {\n message.delete();\n event.getMessage().delete();\n }", "public void run(){\r\n TaggedData d;\r\n try{\r\n dos = new DataOutputStream(new BufferedOutputStream(socket.getOutputStream()));\r\n while(true){\r\n synchronized(sendLock){\r\n if(queue.size() <= 0) sendLock.wait();\r\n try{ d = queue.removeLast(); }\r\n catch(NoSuchElementException e){ d = null; }\r\n }\r\n if(quit){\r\n cleanup();\r\n break;\r\n }\r\n if(d != null) send(d);\r\n }\r\n }\r\n catch(InterruptedException ie){ ie.printStackTrace(); cleanup(false); } // for now\r\n catch(IOException ioe){ ioe.printStackTrace(); cleanup(false); }\r\n finally{ cleanup(false); }\r\n \r\n if(dos != null){\r\n try{ dos.close(); } catch(IOException ioe){ ioe.printStackTrace(); }\r\n dos = null;\r\n }\r\n }", "@Override\n\t\tpublic void run() {\n\t\t\twhile (true) {\n\n\t\t\t\ttry {\n\t\t\t\t\tfor (Message message : pending) {\n\t\t\t\t\t\tif (canLCBdeliver(message)) {\n\t\t\t\t\t\t\tfifoBC.canDeliver(message);\n\t\t\t\t\t\t\tp.Pendinglock.lock();\n\t\t\t\t\t\t\tpending.remove(message);\n\t\t\t\t\t\t\tp.Pendinglock.unlock();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} finally {\n\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(100);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\tSystem.out.println(\"Failed to sleep in deliver thread.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public void deleteFromQueue(Integer block_id){\n if(this.queue_set){\n if(this.queue.contains(block_id) == true){\n this.queue.remove(block_id);\n }\n if(this.queue.isEmpty())\n {\n System.out.println(\"All blocks were computed!\");\n this.msgAllExecuted();\n this.queue_set = false;\n }\n }\n }", "public void sendAsync() {\n\t\tstartTime = System.currentTimeMillis();\n\t\t\n\t\tif(logMINOR) Logger.minor(this, \"Starting async send on \"+this);\n\t\tincRunningBlockTransmits();\n\t\t\n\t\ttry {\n\t\t\tsynchronized(_prb) {\n\t\t\t\t_unsent = _prb.addListener(myListener = new PartiallyReceivedBlock.PacketReceivedListener() {;\n\n\t\t\t\t\tpublic void packetReceived(int packetNo) {\n\t\t\t\t\t\tsynchronized(_senderThread) {\n\t\t\t\t\t\t\tif(_unsent.contains(packetNo)) {\n\t\t\t\t\t\t\t\tLogger.error(this, \"Already in unsent: \"+packetNo+\" for \"+this+\" unsent is \"+_unsent, new Exception(\"error\"));\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(_sentPackets.bitAt(packetNo)) {\n\t\t\t\t\t\t\t\tLogger.error(this, \"Already sent packet in packetReceived: \"+packetNo+\" for \"+this+\" unsent is \"+_unsent+\" sent is \"+_sentPackets, new Exception(\"error\"));\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t_unsent.addLast(packetNo);\n\t\t\t\t\t\t\ttimeAllSent = -1;\n\t\t\t\t\t\t\t_senderThread.schedule();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tpublic void receiveAborted(int reason, String description) {\n\t\t\t\t\t\tonAborted(reason, description);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\t_senderThread.schedule();\n\t\t\t\n\t\t\tmfAllReceived = MessageFilter.create().setType(DMT.allReceived).setField(DMT.UID, _uid).setSource(_destination).setNoTimeout();\n\t\t\tmfSendAborted = MessageFilter.create().setType(DMT.sendAborted).setField(DMT.UID, _uid).setSource(_destination).setNoTimeout();\n\t\t\t\n\t\t\ttry {\n\t\t\t\t_usm.addAsyncFilter(mfAllReceived, cbAllReceived, _ctr);\n\t\t\t\t_usm.addAsyncFilter(mfSendAborted, cbSendAborted, _ctr);\n\t\t\t} catch (DisconnectedException e) {\n\t\t\t\tonDisconnect();\n\t\t\t}\n\t\t\t\n\t\t} catch (AbortedException e) {\n\t\t\tonAborted(_prb._abortReason, _prb._abortDescription);\n\t\t}\n\t}", "@Override\n void enqueuePiece(ByteBuffer buffer, int index, int position, int length, Object params)\n {\n// if (DEBUG) System.out.println(\"[stdpc] enqueuePiece:\" + index + \",\" + position + \",\" + length + \" buf:\" + buffer.remaining());\n// sendQueue.forEach(pm ->\n// System.out.println(\" -s> \" + System.identityHashCode(pm) + \" \" +pm.type + \" ,\" + pm.index +\",\" + pm.begin + \",\" + pm.length)\n// );\n// peerBlockRequests.forEach(pm -> {\n// System.out.println(\" -p> \" + pm.type + \" ,\" + pm.index +\",\" + pm.begin + \",\" + pm.length);\n// });\n\n\n boolean found = false;\n\n // check for the active linked peer request and remove it\n for (int i = 0; i < peerBlockRequests.size(); i++) {\n StdPeerMessage pm = peerBlockRequests.get(i);\n if ((pm.index == index)\n && (pm.begin == position)\n && (pm.length == length))\n {\n peerBlockRequests.remove(i);\n pmCache.release(pm);\n found = true;\n break;\n }\n }\n if (!found && DEBUG) {\n if (DEBUG) System.out.println(\"[stdpc] pBR not found\");\n }\n\n enqueue(pmCache.piece(index, position, length, buffer, params));\n }", "public synchronized void unblock() {\n\t\tsetBlocked(false);\n\t}", "public BufferSlot remove();", "private void dealChatMsg() {\n /*\n r4 = this;\n r0 = new java.util.LinkedList;\n r0.<init>();\n r1 = com.tomatolive.library.ui.activity.live.PrepareLiveActivity.class;\n monitor-enter(r1);\n r2 = r4.receiveMsgQueue;\t Catch:{ all -> 0x0038 }\n if (r2 == 0) goto L_0x0033;\n L_0x000c:\n r2 = r4.receiveMsgQueue;\t Catch:{ all -> 0x0038 }\n r2 = r2.isEmpty();\t Catch:{ all -> 0x0038 }\n if (r2 == 0) goto L_0x0015;\n L_0x0014:\n goto L_0x0033;\n L_0x0015:\n r2 = 0;\n L_0x0016:\n r3 = 5;\n if (r2 >= r3) goto L_0x0029;\n L_0x0019:\n r3 = r4.receiveMsgQueue;\t Catch:{ all -> 0x0038 }\n r3 = r3.poll();\t Catch:{ all -> 0x0038 }\n r3 = (com.tomatolive.library.model.ChatEntity) r3;\t Catch:{ all -> 0x0038 }\n if (r3 == 0) goto L_0x0029;\n L_0x0023:\n r0.add(r3);\t Catch:{ all -> 0x0038 }\n r2 = r2 + 1;\n goto L_0x0016;\n L_0x0029:\n monitor-exit(r1);\t Catch:{ all -> 0x0038 }\n r1 = new com.tomatolive.library.ui.activity.live.-$$Lambda$PrepareLiveActivity$WexsRlm5pU6uK-2JwaAGWgcPHqs;\n r1.<init>(r4, r0);\n r4.handlerMainPost(r1);\n return;\n L_0x0033:\n r0 = 1;\n r4.asleep = r0;\t Catch:{ all -> 0x0038 }\n monitor-exit(r1);\t Catch:{ all -> 0x0038 }\n return;\n L_0x0038:\n r0 = move-exception;\n monitor-exit(r1);\t Catch:{ all -> 0x0038 }\n throw r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.tomatolive.library.ui.activity.live.PrepareLiveActivity.dealChatMsg():void\");\n }", "void rejectPutBuffer(RingBuffer ringBuffer, long uid);", "public void removeMessageRead(FermatMessage fermatMessage) {\n pendingIncomingMessages.remove(fermatMessage);\n }", "public synchronized Integer remove() {\r\n while (true) {\r\n if (buffer.size() == 0) {\r\n try {\r\n wait();\r\n } catch (InterruptedException e) {\r\n e.printStackTrace();\r\n }\r\n }\r\n Integer back = buffer.removeFirst();\r\n notifyAll();\r\n return back;\r\n }\r\n }", "public void syncRemoveQueue() {\n if (!this.removeQueue.isEmpty()) {\n CommonPacket packet = PacketType.OUT_ENTITY_DESTROY.newInstance(this.removeQueue);\n this.removeQueue.clear();\n Player p = this.playerRef.get();\n if (p != null) {\n PacketUtil.sendPacket(p, packet);\n }\n }\n }", "@Override\n public void onCanceled( List< Item > data ) {\n super.onCanceled( data );\n releaseResources( mData );\n }", "protected void deleteWithoutCommit() {\n \t\ttry {\n \t\t\tcheckedActivate(3); // TODO: Figure out a suitable depth.\n \t\t\t\n \t\t\tfor(MessageReference ref : getAllMessages(false)) {\n \t\t\t\tref.initializeTransient(mFreetalk);\n \t\t\t\tref.deleteWithoutCommit();\n \t\t\t}\n \n \t\t\tcheckedDelete();\n \t\t}\n \t\tcatch(RuntimeException e) {\n \t\t\tcheckedRollbackAndThrow(e);\n \t\t}\n \n \t}", "@Override\n public void onByteArrayMessage(ReceivedByteArrayMessage message) {\n //ignore the message\n }", "private void handleRecoverZswapd() {\n handler.removeMessages(15);\n setTargetBuffer();\n Slog.i(TAG, \"handle recover zswapd, set target to current\");\n }", "private void onAWRefuse(ACLMessage msg) {\n\t\tString content = msg.getContent();\n\t\tPerceptionMessage perceptionMsg = MessageUtil.getPerception(content);\n\t\tCellMessage cellMsg = perceptionMsg.getCell();\n\n\t\tPoint currentPos = new Point(cellMsg.getCol(), cellMsg.getRow());\n\t\tPoint oldPos = currentCell.getPosition();\n\n\t\tupdateCellFood(currentCell, cellMsg);\n\n\t\t// remove all pending actions\n\t\tactionQueue.clear();\n\n\t\tif (!\"ALIVE\".equals(perceptionMsg.getState())) {\n\t\t\tLOG.info(\"is dead at {}\", currentPos);\n\t\t\tdoDelete();\n\t\t\treturn;\n\t\t}\n\n\t\tif (currentPos.equals(oldPos)) {\n\t\t\tcheckMovementBlocked(perceptionMsg.getAction(), currentPos);\n\t\t\tprepareReply(msg);\n\t\t\treturn;\n\t\t}\n\n\t\tLOG.error(\"unchecked refuse message: {}\", msg);\n\t\tdoDelete();\n\t}", "synchronized String remove() throws InterruptedException {\n\t\ttry {\n\t\t\twhile (messages.size() == 0) wait();\n\n\t\t\treturn (messages.remove(0));\n\n\t\t} catch (InterruptedException e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}", "private void receiveNack(Evt e) {\n\t\tif (!nackReceived && e.getMessage()!= currentlyOptimisticallyTransmitted) {\r\n\t\t\tSystem.out.println(\"error\");\r\n\t\t//\tthrow new IllegalStateException(\"A nack corresponding to a message that isn't the one in the buffer has been received. This means that something is wrong (at time \" + e.getTimeNS() + \")\");\r\n\t\t}\r\n\t\t\r\n\t\tif (currentlyOptimisticallyTransmitted == null)\r\n\t\t\treturn;\r\n\r\n\t\tif (nackReceived == false) {\r\n\t\t\tif (lwSimExperiment.isWithTimeLine())\r\n\t\t\t\ttimeline.addJobPhase(lastPacketStart, e.getTimeNS(), currentlyOptimisticallyTransmitted.origin + \"->\" + currentlyOptimisticallyTransmitted.dest + \"\\n\" + currentlyOptimisticallyTransmitted.index + \":NACK\", Color.RED);\t\t\r\n\t\t\t// immediately resend\t\t\t\r\n\t\t\tnackReceived = true;\r\n\t\t\t// correct transmission time in the case of NACK Mode\r\n\t\t\tif (!this.ACKMode)\r\n\t\t\t\tlwSimExperiment.reportTransTime(index, e.getTimeNS() - lastPacketStart - packetDuration, currentlyOptimisticallyTransmitted);\r\n\t\t\t\r\n\t\t\tSpinetMessage dupl = currentlyOptimisticallyTransmitted.getCopy();\r\n\t\t\tgetQueue(dupl.dest).remove(currentlyOptimisticallyTransmitted);\r\n\t\t\tgetQueue(dupl.dest).addFirst(dupl);\r\n\t\t\tmainQueue.addFirst(dupl);\r\n\t\t\tdefineSpinetMessage(dupl);\r\n\t\t\tlwSimExperiment.packetRetransmitted(dupl);\r\n\t\t\tcurrentlyOptimisticallyTransmitted = null;\r\n\t\t}\t\t\r\n\t}", "private void handleWhiteboardCleared() {\n for (SocketConnection tobeNotified : SocketManager.getInstance()\n .getNotManagerConnectionList()) {\n tobeNotified.send(this.message);\n }\n }", "@Override\n public boolean messagePending() {\n return commReceiver.messagePending();\n }", "void cancel()\n {\n cancelled = true;\n subjobComplete = true;\n result = null;\n }", "public void requeue() {\n\t\tenqueue(queue.removeFirst());\n\t}", "public void kill() {\n\t\tif (combox == null){\n\t\t\treturn;\n\t\t}\n\t\tPOPBuffer popBuffer = combox.getBufferFactory().createBuffer();\n\t\tMessageHeader messageHeader = new MessageHeader(0,\n\t\t\t\tMessageHeader.KILL_ALL, Semantic.SYNCHRONOUS);\n\t\tmessageHeader.setRequestID(requestID.incrementAndGet());\n\t\tpopBuffer.setHeader(messageHeader);\n\n\t\tpopDispatch(popBuffer);\n\t\ttry {\n\t\t\tPOPBuffer responseBuffer = combox.getBufferFactory().createBuffer();\n\t\t\tpopResponse(responseBuffer, messageHeader.getRequestID());\n\t\t} catch (POPException e) {\n\t\t\treturn;\n\t\t}\n\t}", "void canceledPendingNodeStop();", "public void cancelReceiveMessageNotification(Object newTag) {\n if (newTag == null) {\n Logger.d(TAG,\n \"cancelReceiveMessageNotification chat tag is null\");\n return;\n }\n if (mUnReadMessagesChatInfos != null\n && mUnReadMessagesChatInfos.containsKey(newTag)) {\n mUnReadMessagesChatInfos.remove(newTag);\n String ticker = null;\n boolean isNewMessageNotification = false;\n updateReceiveMessageNotification(ticker,\n isNewMessageNotification);\n } else {\n Logger.d(\n TAG,\n \"cancelReceiveMessageNotification mUnReadMessagesChatInfos\" +\n \" didn't contain this chat tag\");\n }\n }", "void removeFromQueue(ActionEvent event){\n model.getQueueList().remove(podcast);\n podcast.setQueued(false);\n podcast.togglePlaying();\n cm.hide();\n }", "public void send (final TCNetworkMessage message) {\n if (channelSessionID == ((DSOMessageBase)message).getLocalSessionID()) {\n super.send(message); \n } else {\n logger.info(\"Drop old message: \"+ ((DSOMessageBase)message).getMessageType() + \" Expected \"+ channelSessionID + \" but got \" + ((DSOMessageBase)message).getLocalSessionID());\n }\n }", "public interface HoldBackQueueListener {\n public void messagePutInHoldBackQueue(Message message);\n public void messageRemovedFromHoldBackQueue(Message message);\n}", "public void cancelUpload() {\n if (this.nativeFilesQueued.size() > 0) {\n cancelUpload(this.nativeFilesQueued.get(0).<File>cast().getId());\n }\n }", "public void stopRinging();", "protected boolean processQTell(String message){return false;}", "private synchronized void flushMessageQueue() {\n\t\tif(peers.size() > 0) {\n\t\t\twhile(!noPeersMessageQueue.isEmpty()) {\n\t\t\t\tpropagateToAllPeers(noPeersMessageQueue.poll());\n\t\t\t}\n\t\t}\n\t}", "public static void removeMonitorFromQueue(BlockingQueue<UserMonitorData> queue, MonitorID monitorID) throws AiravataMonitorException {\n Iterator<UserMonitorData> iterator = queue.iterator();\n while (iterator.hasNext()) {\n UserMonitorData next = iterator.next();\n if (next.getUserName().equals(monitorID.getUserName())) {\n // then this is the right place to update\n List<HostMonitorData> hostMonitorData = next.getHostMonitorData();\n Iterator<HostMonitorData> iterator1 = hostMonitorData.iterator();\n while (iterator1.hasNext()) {\n HostMonitorData iHostMonitorID = iterator1.next();\n if (iHostMonitorID.getHost().toXML().equals(monitorID.getHost().toXML())) {\n Iterator<MonitorID> iterator2 = iHostMonitorID.getMonitorIDs().iterator();\n while (iterator2.hasNext()) {\n MonitorID iMonitorID = iterator2.next();\n if (iMonitorID.getJobID().equals(monitorID.getJobID())\n || iMonitorID.getJobName().equals(monitorID.getJobName())) {\n // OK we found the object, we cannot do list.remove(object) states of two objects\n // could be different, thats why we check the jobID\n iterator2.remove();\n logger.infoId(monitorID.getJobID(), \"Removed the jobId: {} JobName: {} from monitoring last \" +\n \"status:{}\", monitorID.getJobID(),monitorID.getJobName(), monitorID.getStatus().toString());\n if (iHostMonitorID.getMonitorIDs().size() == 0) {\n iterator1.remove();\n logger.debug(\"Removed host {} from monitoring queue\", iHostMonitorID.getHost()\n .getType().getHostAddress());\n if (hostMonitorData.size() == 0) {\n // no useful data so we have to remove the element from the queue\n queue.remove(next);\n logger.debug(\"Removed user {} from monitoring.\", next.getUserName());\n }\n }\n return;\n }\n }\n }\n }\n }\n }\n logger.info(\"Cannot find the given MonitorID in the queue with userName \" +\n monitorID.getUserName() + \" and jobID \" + monitorID.getJobID());\n logger.info(\"This might not be an error because someone else removed this job from the queue\");\n }", "public abstract void unblockNext();", "@Override\n public void handleMessage(Message message) {\n switch (message.what) {\n case Flinnt.SUCCESS:\n stopProgressDialog();\n if (LogWriter.isValidLevel(Log.INFO))\n LogWriter.write(\"SUCCESS_RESPONSE : \" + message.obj.toString());\n mAdapter.remove(courseID);\n // Delete Item from offline database\n Helper.showToast(context.getString(R.string.successfully_deleted), Toast.LENGTH_SHORT);\n break;\n\n case Flinnt.FAILURE:\n stopProgressDialog();\n if (LogWriter.isValidLevel(Log.INFO))\n LogWriter.write(\"FAILURE_RESPONSE : \" + message.obj.toString());\n if (((WishResponse) message.obj).errorResponse != null) {\n Helper.showAlertMessage(WishlistActivity.this, \"Error\", ((WishResponse) message.obj).errorResponse.getMessage(), \"CLOSE\");\n }\n\n break;\n default:\n super.handleMessage(message);\n }\n }", "private void receiveMessage() throws InterruptedException {\n Map<Integer, Integer> transTimeMap = new HashMap<>();\n for (int i = 0; i < incomingLinks.size(); i++) {\n int transTime= new Random().nextInt(11);\n transTimeMap.put(i, transTime);\n }\n\n // Sort the random transmission time for the message in the channel.\n List<Map.Entry<Integer, Integer>> timeInfo = new ArrayList<>(transTimeMap.entrySet());\n timeInfo.sort((t1, t2) -> t1.getValue() - t2.getValue());\n\n int time = 0;\n for(int i = 0; i < timeInfo.size(); i++) {\n int index = timeInfo.get(i).getKey();\n int value = timeInfo.get(i).getValue();\n\n // After transmission time units, receive the message.\n Thread.sleep((value - time) * timeUnit);\n time += value - time;\n Message message = incomingLinks.get(index).receive();\n\n\n if (message != null) {\n String type = message.type;\n if (type.equals(\"init\")) {\n // If the process receives a larger id, it let the sender as its parent and broadcast this new\n // max id to all its neighbor except for its new parent.\n if (this.maxId < message.maxId) {\n this.maxId = message.maxId;\n this.parent = message.uid;\n this.listOfChild.clear();\n broadcast(new Message(this.uid, this.maxId, \"init\"), this.parent);\n numOfAck = 0;\n //If the process receives a smaller id, it will reply the sender a nack message.\n } else {\n sendTo(new Message(this.uid, message.maxId, \"nack\"), message.uid);\n }\n } else if (type.equals(\"ack\")) {\n // After receiving the ack message, it adds the number of ack and let the sender as its child.\n if (this.maxId == message.maxId) {\n numOfAck++;\n listOfChild.add(message.uid);\n }\n } else if (type.equals(\"nack\")) {\n // After receiving the nack message, it adds the number of ack.\n if (this.maxId == message.maxId) {\n numOfAck++;\n }\n }\n }\n }\n checkResult();\n }", "@Override\n\t\t\tpublic void onEmsgClosedListener() {\n\t\t\t\t\n\t\t\t}", "@Override\n\tpublic void run() {\n\t\ttry {\n\t\t\tboolean shutdown = false;\n\t\t\twhile (true) {\n\t\t\t\ttry {\n\t\t\t\t\tLOG.debug(\"Waiting for command...\");\n\t\t\t\t\tint cmd = in.readCmd();\n\t\t\t\t\tLOG.debug(\"Received command \" + cmd);\n\t\t\t\t\tlong numArgs = in.readNumArgs();\n\t\t\t\t\tif (cmd == NimbusMaster.KILL_CMD) {\n\t\t\t\t\t\tLOG.info(\"Kill command received. Deleting Bloom filter from HDFS and exiting...\");\n\n\t\t\t\t\t\tFileSystem.get(NimbusConf.getConf()).delete(\n\t\t\t\t\t\t\t\tnew Path(Nimbus.CACHELET_ZNODE), false);\n\n\t\t\t\t\t\tNimbusShutdownHook.getInstance().cleanShutdown();\n\n\t\t\t\t\t\tshutdown = true;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t\tprocessMessage(cmd, numArgs, in);\n\n\t\t\t\t\tin.verifyEndOfMessage();\n\n\t\t\t\t} catch (EOFException e) {\n\t\t\t\t\t// ignore this error, the connection was likely closed\n\t\t\t\t\tbreak;\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tLOG.error(\"Caught exception while processing input\");\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tLOG.info(\"Closing worker\");\n\t\t\tout.close();\n\t\t\tin.close();\n\n\t\t\tif (shutdown) {\n\t\t\t\tserver.shutdown();\n\t\t\t}\n\t\t} catch (SocketException e) {\n\t\t\te.printStackTrace();\n\t\t\tLOG.error(e);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t\tLOG.error(e);\n\t\t}\n\t}", "protected void fastReTx() {\n\t\tActualSegment unackCur = unackHead;\n\n\t\twhile(unackCur != null) {\n\t\t\teventQueue.remove(unackCur);\n\t\t\tpipe.write(unackCur);\n\t\t\tunackCur = unackCur.next;\n\t\t}\n\t}", "@Override\n public void unsubscribe(Entity e) {\n unsub_queue.add(e);\n }", "public void cancel() {\n try {\n mmSocket.close();\n } catch (IOException e) {\n\n }\n }", "public void afterReceive() {\n\t}" ]
[ "0.6308832", "0.61708236", "0.6015521", "0.5877095", "0.5874131", "0.58591956", "0.5842569", "0.5821285", "0.579841", "0.5770106", "0.57081276", "0.56721467", "0.567101", "0.56706077", "0.56434065", "0.56193537", "0.5560698", "0.5554416", "0.55373776", "0.5489388", "0.54892826", "0.54705477", "0.5449653", "0.54414773", "0.5429023", "0.54282445", "0.54155177", "0.54122233", "0.54108334", "0.540985", "0.53880715", "0.53876126", "0.5386048", "0.53753394", "0.536465", "0.5362491", "0.53596604", "0.5355348", "0.53513056", "0.5348678", "0.53434634", "0.53419584", "0.5313421", "0.53055674", "0.5300849", "0.5297031", "0.52953774", "0.52938837", "0.5291054", "0.52683365", "0.52519447", "0.5249925", "0.52435225", "0.52397895", "0.5231839", "0.5226562", "0.52229244", "0.5211223", "0.5208575", "0.52052873", "0.52035695", "0.51970524", "0.51949483", "0.5183094", "0.51823604", "0.5176661", "0.5174184", "0.5158291", "0.51395", "0.51355517", "0.5130062", "0.5129142", "0.5127108", "0.5116784", "0.5112612", "0.5110001", "0.51062286", "0.510504", "0.5103763", "0.51037604", "0.5102262", "0.51011634", "0.5099702", "0.5098188", "0.5096016", "0.5094994", "0.50918436", "0.5089052", "0.50864995", "0.50785255", "0.507549", "0.5072072", "0.50663483", "0.5057496", "0.5055896", "0.505334", "0.50527287", "0.5052248", "0.5047291", "0.5045596" ]
0.6147407
2
called on "interested" and "not_interested" messages receive, notifies parent torrent to unlock blocks of data enqueued for sending (if buffered somehow)
void onInterested(boolean state) { peerInterested = state; if (!peerInterested) { // remove all piece if enqueued, // most likely will not happen for (int i = sendQueue.size() - 1; 0 <= i; i--) { StdPeerMessage pm = sendQueue.get(i); if (pm.type == StdPeerMessage.PIECE) { sendQueue.remove(i); TorrentStorage.Block block = (TorrentStorage.Block) pm.params; block.release(); pmCache.release(pm); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void notifyBlockComplete(MessageSnapshot snapshot);", "public final synchronized void signalDataAvailable() {\n\n\t\t//\tNotify any waiting threads that the file data ia available\n\t\t\t\n\t\tnotifyAll();\n\t}", "public void bufferedAmountChange() {\n // Webrtc.org fires the bufferedAmountChange event from a different\n // thread (B) while locking the native send call on the current\n // thread (A). This leads to a deadlock if we try to lock this\n // instance from (B). So, this... pleasant workaround prevents\n // deadlocking the send call.\n CompletableFuture.runAsync(() -> {\n synchronized (this) {\n final long bufferedAmount = this.dc.bufferedAmount();\n // Unpause once low water mark has been reached\n if (bufferedAmount <= this.lowWaterMark && !this.readyFuture.isDone()) {\n log.debug(this.dc.label() + \" resumed (buffered=\" + bufferedAmount + \")\");\n this.readyFuture.complete(null);\n }\n }\n });\n }", "protected void enqueue(StdPeerMessage message)\n {\n// if (DEBUG) {\n// if (message.type == StdPeerMessage.REQUEST) {\n// System.out.println(System.nanoTime() + \" [stdpc] enqueue: req \" + message.index + \" \" + (message.begin >> 14));\n// } else {\n// System.out.println(\"[stdpc] enqueue: \" + message.type);\n// }\n// }\n\n if (message.type == StdPeerMessage.CHOKE)\n {\n // remove reply messages with piece (block) data\n // from the send queue (due to spec)\n for (int i = sendQueue.size() - 1; 0 <= i; i--) {\n StdPeerMessage pm = sendQueue.get(i);\n if (pm.type == StdPeerMessage.PIECE) {\n sendQueue.remove(i);\n TorrentStorage.Block block = (TorrentStorage.Block) message.params;\n block.release();\n pmCache.release(pm);\n }\n }\n // set choke status\n choke = true;\n // send choke asap\n sendQueue.add(0, message);\n }\n else if (message.type == StdPeerMessage.CANCEL)\n {\n // remove the linked request if it's still in the queue\n for (int i = sendQueue.size() - 1; 0 <= i; i--) {\n StdPeerMessage pm = sendQueue.get(i);\n if ((pm.type == StdPeerMessage.REQUEST)\n && (pm.index == message.index)\n && (pm.begin == message.begin)\n && (pm.length == message.length)) // this check is redundant as length is fixed\n {\n sendQueue.remove(i);\n pmCache.release(pm);\n // don't really enqueue CANCEL as the linked request\n // has been found and removed\n pmCache.release(message);\n return;\n }\n }\n // send asap\n sendQueue.add(0, message);\n }\n else {\n if (message.type == StdPeerMessage.INTERESTED) {\n interested = true;\n }\n else if (message.type == StdPeerMessage.NOT_INTERESTED) {\n interested = false;\n }\n else if (message.type == StdPeerMessage.UNCHOKE) {\n choke = false;\n }\n\n // enqueue message\n sendQueue.add(message);\n }\n\n// sendQueue.forEach(pm -> System.out.println(\" -x> \" + System.identityHashCode(pm) + pm.type + \" ,\" + pm.index +\",\" + pm.begin +\",\" + pm.length) );\n\n }", "public void deliver() {\n try {\n if (null != this.listener) {\n ContentObject pending = null;\n CCNInterestListener listener = null;\n synchronized (this) {\n if (null != this.data && null != this.listener) {\n pending = this.data;\n this.data = null;\n listener = (CCNInterestListener) this.listener;\n }\n }\n if (null != pending) {\n if (Log.isLoggable(Log.FAC_NETMANAGER, Level.FINER)) Log.finer(Log.FAC_NETMANAGER, \"Interest callback (\" + pending + \" data) for: {0}\", this.interest.name());\n synchronized (this) {\n this.deliveryPending = false;\n }\n manager.unregisterInterest(this);\n Interest updatedInterest = listener.handleContent(pending, interest);\n if (null != updatedInterest) {\n if (Log.isLoggable(Log.FAC_NETMANAGER, Level.FINER)) Log.finer(Log.FAC_NETMANAGER, \"Interest callback: updated interest to express: {0}\", updatedInterest.name());\n manager.expressInterest(this.owner, updatedInterest, listener);\n }\n } else {\n if (Log.isLoggable(Log.FAC_NETMANAGER, Level.FINER)) Log.finer(Log.FAC_NETMANAGER, \"Interest callback skipped (no data) for: {0}\", this.interest.name());\n }\n } else {\n synchronized (this) {\n if (null != this.sema) {\n if (Log.isLoggable(Log.FAC_NETMANAGER, Level.FINER)) Log.finer(Log.FAC_NETMANAGER, \"Data consumes pending get: {0}\", this.interest.name());\n if (Log.isLoggable(Log.FAC_NETMANAGER, Level.FINEST)) Log.finest(Log.FAC_NETMANAGER, \"releasing {0}\", this.sema);\n this.sema.release();\n }\n }\n if (null == this.sema) {\n if (Log.isLoggable(Log.FAC_NETMANAGER, Level.FINER)) Log.finer(Log.FAC_NETMANAGER, \"Interest callback skipped (not valid) for: {0}\", this.interest.name());\n }\n }\n } catch (Exception ex) {\n _stats.increment(StatsEnum.DeliverContentFailed);\n Log.warning(Log.FAC_NETMANAGER, \"failed to deliver data: {0}\", ex);\n Log.warningStackTrace(ex);\n }\n }", "private static void handleReceivedMessage(){\r\n\t\t// checks if the arrayList with the received blockNumbers contains the last received blockNumber\r\n\t\tif (!receivedBlockNumbers.contains(actualReceivedBlockNumber)){\r\n\t\t\t// if the arrayList with the BlockNumbers of the received messages does not contain the current received Message (blocknumber), the blocknumber will be added to the array\r\n\t\t\treceivedBlockNumbers.add(actualReceivedBlockNumber);\r\n\t\t\t// only messages which were't received yet will be added to the data output stream\r\n\t\t\ttry {\r\n\t\t\t\tdos.write(incomingPacket.getData(), 4, incomingPacket.getLength() - 4);\r\n\t\t\t\t// System.out.println(\"CLIENT: Block with the Blocknumber (\" + actualReceivedBlockNumber + \") was added to the DataOutputStream\");\t\r\n\t\t\t\tblockNumberExpected++;\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\r\n\t\t} else {\r\n\t\t\t// ERROR NUMBER 6 - File already exists\r\n\t\t\terrorNumber = 6;\r\n\t\t\tmessage.sendErrorMessage(errorNumber, \"A message with the same blocknumber was already received and will therefore be discarded.\", sendData, ipAddress, SERVER_PORT, clientSocket);\t\r\n\r\n\t\t}\t\r\n\t}", "public void sendAsync() {\n\t\tstartTime = System.currentTimeMillis();\n\t\t\n\t\tif(logMINOR) Logger.minor(this, \"Starting async send on \"+this);\n\t\tincRunningBlockTransmits();\n\t\t\n\t\ttry {\n\t\t\tsynchronized(_prb) {\n\t\t\t\t_unsent = _prb.addListener(myListener = new PartiallyReceivedBlock.PacketReceivedListener() {;\n\n\t\t\t\t\tpublic void packetReceived(int packetNo) {\n\t\t\t\t\t\tsynchronized(_senderThread) {\n\t\t\t\t\t\t\tif(_unsent.contains(packetNo)) {\n\t\t\t\t\t\t\t\tLogger.error(this, \"Already in unsent: \"+packetNo+\" for \"+this+\" unsent is \"+_unsent, new Exception(\"error\"));\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(_sentPackets.bitAt(packetNo)) {\n\t\t\t\t\t\t\t\tLogger.error(this, \"Already sent packet in packetReceived: \"+packetNo+\" for \"+this+\" unsent is \"+_unsent+\" sent is \"+_sentPackets, new Exception(\"error\"));\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t_unsent.addLast(packetNo);\n\t\t\t\t\t\t\ttimeAllSent = -1;\n\t\t\t\t\t\t\t_senderThread.schedule();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tpublic void receiveAborted(int reason, String description) {\n\t\t\t\t\t\tonAborted(reason, description);\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\t_senderThread.schedule();\n\t\t\t\n\t\t\tmfAllReceived = MessageFilter.create().setType(DMT.allReceived).setField(DMT.UID, _uid).setSource(_destination).setNoTimeout();\n\t\t\tmfSendAborted = MessageFilter.create().setType(DMT.sendAborted).setField(DMT.UID, _uid).setSource(_destination).setNoTimeout();\n\t\t\t\n\t\t\ttry {\n\t\t\t\t_usm.addAsyncFilter(mfAllReceived, cbAllReceived, _ctr);\n\t\t\t\t_usm.addAsyncFilter(mfSendAborted, cbSendAborted, _ctr);\n\t\t\t} catch (DisconnectedException e) {\n\t\t\t\tonDisconnect();\n\t\t\t}\n\t\t\t\n\t\t} catch (AbortedException e) {\n\t\t\tonAborted(_prb._abortReason, _prb._abortDescription);\n\t\t}\n\t}", "private void updatePeers() {\n\t\tif (files == null)\n\t\t\treturn;\n\t\tArrayList<Piece> neededPieces = files.getNeededPieces();\n\t\tfor (int i = 0; i < peers.size(); i++) {\n\t\t\tPeer p = peers.get(i);\n\t\t\tboolean hasNoPieces = true;\n\t\t\tfor (int j = 0; j < neededPieces.size(); j++) {\n\t\t\t\tif (p.getClient().getBitfield().hasPiece(neededPieces.get(j).getIndex())) {\n\t\t\t\t\thasNoPieces = false;\n\t\t\t\t\tif (!p.getClient().isInterested()) {\n\t\t\t\t\t\tp.addToQueue(new MessageInterested());\n\t\t\t\t\t\tp.getClient().interested();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (hasNoPieces && p.getClient().isInterested()) {\n\t\t\t\tp.addToQueue(new MessageUninterested());\n\t\t\t\tp.getClient().uninterested();\n\t\t\t}\n\t\t\tif (p.getMyClient().isInterested() && p.getClient().isChoked()) {\n\t\t\t\tp.addToQueue(new MessageUnchoke());\n\t\t\t\tp.getClient().unchoke();\n\t\t\t} else if (!p.getMyClient().isInterested() && !p.getClient().isChoked()) {\n\t\t\t\tp.addToQueue(new MessageChoke());\n\t\t\t\tp.getClient().choke();\n\t\t\t}\n\t\t}\n\t}", "public void blockingReceiveSenderSide() throws OOBException {\n \t}", "private void notifyOnBinaryReceived(byte[] data) {\n synchronized (globalLock) {\n if (isRunning) {\n onBinaryReceived(data);\n }\n }\n }", "protected void addChannelToReadCompletePendingQueue() {\n/* 354 */ while (!Http2MultiplexHandler.this.readCompletePendingQueue.offer(this)) {\n/* 355 */ Http2MultiplexHandler.this.processPendingReadCompleteQueue();\n/* */ }\n/* */ }", "synchronized void \n receivedLast() \n {\n closedByWriter = true;\n notifyAll();\n }", "@Override\n \t\t\tpublic void run ()\n \t\t\t{\n \t\t\t\tsynchronized ( heard )\n \t\t\t\t{\n \t\t\t\t\theard.clear ();\n \t\t\t\t}\n \t\t\t\t// re-transmit own until not in a block\n \t\t\t\tsynchronized ( own )\n \t\t\t\t{\n \t\t\t\t\tif ( !own.isEmpty () )\n \t\t\t\t\t{\n \t\t\t\t\t\tfor ( BitcoinPeer peer : network.getConnectPeers () )\n \t\t\t\t\t\t{\n \t\t\t\t\t\t\tInvMessage tm = (InvMessage) peer.createMessage (\"inv\");\n \t\t\t\t\t\t\tfor ( Tx t : own )\n \t\t\t\t\t\t\t{\n \t\t\t\t\t\t\t\tlog.debug (\"Re-broadcast \" + t.getHash ());\n \t\t\t\t\t\t\t\ttm.getTransactionHashes ().add (new Hash (t.getHash ()).toByteArray ());\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\tpeer.send (tm);\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}", "@Override\n public void finishMessageSending() {\n for (int i = 0; i < fragNum; ++i) {\n long bytesWriten = cacheOut[i].bytesWriten();\n cacheOut[i].finishSetting();\n cacheOut[i].writeLong(0, bytesWriten - SIZE_OF_LONG);\n\n if (bytesWriten == SIZE_OF_LONG) {\n logger.debug(\n \"[Finish msg] sending skip msg from {} -> {}, since msg size: {}\",\n fragId,\n i,\n bytesWriten);\n continue;\n }\n if (i == fragId) {\n nextIncomingMessageStore.digest(cacheOut[i].getVector());\n logger.info(\n \"In final step, Frag [{}] digest msg to self of size: {}\",\n fragId,\n bytesWriten);\n } else {\n grapeMessager.sendToFragment(i, cacheOut[i].getVector());\n logger.info(\n \"In final step, Frag [{}] send msg to [{}] of size: {}\",\n fragId,\n i,\n bytesWriten);\n }\n }\n // if (maxSuperStep > 0) {\n // grapeMessager.ForceContinue();\n // maxSuperStep -= 1;\n // }\n\n // logger.debug(\"[Unused res] {}\", unused);\n // logger.debug(\"adaptor hasNext {}, grape hasNext{}\", adaptorHasNext, grapeHasNext);\n // logger.debug(\"adaptor next {}, grape next {}\", adaptorNext, grapeNext);\n // logger.debug(\"adaptor neighbor {}, grape neighbor {}\", adaptorNeighbor,\n // grapeNeighbor);\n }", "@Override\n public void receiveMessages() {\n // put message to currentIncoming message store\n FFIByteVector tmpVector = (FFIByteVector) FFIByteVectorFactory.INSTANCE.create();\n long bytesOfReceivedMsg = 0;\n while (grapeMessager.getPureMessage(tmpVector)) {\n // The retrieved tmp vector has been resized, so the cached objAddress is not available.\n // trigger the refresh\n tmpVector.touch();\n // OutArchive will do the resize;\n if (logger.isDebugEnabled()) {\n logger.debug(\"Frag [{}] digest message of size {}\", fragId, tmpVector.size());\n }\n ///////////////////////////////////////////\n currentIncomingMessageStore.digest(tmpVector);\n ///////////////////////////////////////////\n bytesOfReceivedMsg += tmpVector.size();\n }\n logger.info(\n \"Frag [{}] totally Received [{}] bytes from others starting deserialization\",\n fragId,\n bytesOfReceivedMsg);\n }", "public void onBlockingStateUpdated(boolean blocking) {\n \n }", "private void push() {\n ImmutableSortedSet<T> myAvailable = _outstanding.apply(\n new Syncd.Transformer<ImmutableSortedSet<T>, ImmutableSortedSet<T>>() {\n public Tuple<ImmutableSortedSet<T>, ImmutableSortedSet<T>> apply(ImmutableSortedSet<T> aBefore) {\n final SortedSet<T> myRemaining = new TreeSet<>(new MessageComparator<T>());\n\n // Identify those messages that are sequentially contiguous from _floor and can be passed on\n //\n ImmutableSortedSet<T> myAccessible =\n new ImmutableSortedSet.Builder<>(new MessageComparator<T>()).addAll(\n Iterables.filter(aBefore, new Predicate<T>() {\n public boolean apply(T aMessage) {\n Long myCurrent = _floor.get();\n\n if (aMessage.getSeq() == myCurrent) {\n // This message can be sent out to listeners so long as we're first to try\n //\n if (_floor.testAndSet(myCurrent, myCurrent + 1))\n return true;\n } else\n // This message must remain\n //\n myRemaining.add(aMessage);\n\n // Couldn't send message out or it must remain\n //\n return false;\n }\n })\n ).build();\n\n return new Tuple<>(new ImmutableSortedSet.Builder<>(\n new MessageComparator<T>()).addAll(myRemaining).build(),\n myAccessible);\n }\n }\n );\n\n send(myAvailable);\n archive(myAvailable);\n }", "@Override\n public void run() {\n currentContent = FileAccessServiceLocator.getStockOrderFileAccess().read();\n while (true) {\n String newlyReadContent = FileAccessServiceLocator.getStockOrderFileAccess().read();\n if (!newlyReadContent.equals(currentContent) || !newlyReadContent.isEmpty()){\n notify(newlyReadContent);\n currentContent = newlyReadContent;\n }\n try {\n Thread.sleep(500);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n//end of modifiable zone..................E/bfb5c4c0-88e6-44fa-9add-89d5b4394004\n }", "@Override\n\t\tpublic void run() {\n\t\t\twhile (true) {\n\n\t\t\t\ttry {\n\t\t\t\t\tfor (Message message : pending) {\n\t\t\t\t\t\tif (canLCBdeliver(message)) {\n\t\t\t\t\t\t\tfifoBC.canDeliver(message);\n\t\t\t\t\t\t\tp.Pendinglock.lock();\n\t\t\t\t\t\t\tpending.remove(message);\n\t\t\t\t\t\t\tp.Pendinglock.unlock();\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} finally {\n\n\t\t\t\t}\n\t\t\t\ttry {\n\t\t\t\t\tThread.sleep(100);\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\tSystem.out.println(\"Failed to sleep in deliver thread.\");\n\t\t\t\t}\n\t\t\t}\n\t\t}", "public synchronized void tellAt(){\n\t\tnotifyAll();\n\t}", "void blockUntilFreeSlotForMessage() throws InterruptedException {\n lock.lockInterruptibly();\n try {\n while (messageQueue.size() == messageCapacity) {\n messageQueueNotFull.await();\n }\n } finally {\n lock.unlock();\n }\n }", "@Override\n public void dataAvailable(byte[] data, Connection ignoreMe) {\n // Now get the data, and send it back to the listener.\n try {\n disconnect(ignoreMe);\n Message message = NonblockingResolver.parseMessage(data);\n\n if (message != null && LOG.isTraceEnabled()) {\n LOG.trace(\"dataAvailable(\" + data.length + \" bytes)\");\n LOG.trace(message);\n }\n\n NonblockingResolver.verifyTSIG(query, message, data, tsig);\n // Now check that we got the whole message, if we're asked to do so\n if (!tcp && !ignoreTruncation\n && message.getHeader().getFlag(Flags.TC)) {\n // Redo the query, but use tcp this time.\n tcp = true;\n // Now start again with a TCP connection\n startConnect();\n return;\n }\n if (query.getHeader().getID() != message.getHeader().getID()) {\n// System.out.println(\"Query wrong id! Expected \" + query.getHeader().getID() + \" but got \" + message.getHeader().getID());\n return;\n }\n returnResponse(message);\n } catch (IOException e) {\n returnException(e, null);\n }\n }", "private void flushOutbound0() {\n/* 454 */ runPendingTasks();\n/* */ \n/* 456 */ flush();\n/* */ }", "@Override\n //here the messageReceived method is implemented\n public void messageReceived(String message) {\n publishProgress(message);\n }", "@Override\n //here the messageReceived method is implemented\n public void messageReceived(String message) {\n publishProgress(message);\n }", "@Override\n //here the messageReceived method is implemented\n public void messageReceived(String message) {\n publishProgress(message);\n }", "@Override\n //here the messageReceived method is implemented\n public void messageReceived(String message) {\n publishProgress(message);\n }", "void onCancel(int index, int begin, int length)\n {\n // validate common block parameters\n boolean correct = torrent.validateBlock(index, begin, length);\n if (!correct) {\n close(Peer.CloseReason.PROTOCOL_ERROR);\n return;\n }\n\n // check if are processing this request right now\n for (int i = 0; i < peerBlockRequests.size(); i++) {\n StdPeerMessage pm = peerBlockRequests.get(i);\n if ((pm.index == index)\n && (pm.begin == begin)\n && (pm.length == length))\n {\n peerBlockRequests.remove(i);\n pmCache.release(pm);\n break;\n }\n }\n\n // check if response has been enqueued,\n // could be skipped if found in pBR\n for (int i = 0; i < sendQueue.size(); i++) {\n StdPeerMessage pm = sendQueue.get(i);\n if ((pm.type == StdPeerMessage.PIECE)\n && (pm.index == index)\n && (pm.begin == begin)\n && (pm.length == length))\n {\n sendQueue.remove(i);\n // let storage to unlock block of data\n // and return it into cache of blocks\n TorrentStorage.Block block = (TorrentStorage.Block) pm.params;\n block.release();\n\n pmCache.release(pm);\n break;\n }\n }\n }", "public void sendRemainData();", "@Override\n void enqueuePiece(ByteBuffer buffer, int index, int position, int length, Object params)\n {\n// if (DEBUG) System.out.println(\"[stdpc] enqueuePiece:\" + index + \",\" + position + \",\" + length + \" buf:\" + buffer.remaining());\n// sendQueue.forEach(pm ->\n// System.out.println(\" -s> \" + System.identityHashCode(pm) + \" \" +pm.type + \" ,\" + pm.index +\",\" + pm.begin + \",\" + pm.length)\n// );\n// peerBlockRequests.forEach(pm -> {\n// System.out.println(\" -p> \" + pm.type + \" ,\" + pm.index +\",\" + pm.begin + \",\" + pm.length);\n// });\n\n\n boolean found = false;\n\n // check for the active linked peer request and remove it\n for (int i = 0; i < peerBlockRequests.size(); i++) {\n StdPeerMessage pm = peerBlockRequests.get(i);\n if ((pm.index == index)\n && (pm.begin == position)\n && (pm.length == length))\n {\n peerBlockRequests.remove(i);\n pmCache.release(pm);\n found = true;\n break;\n }\n }\n if (!found && DEBUG) {\n if (DEBUG) System.out.println(\"[stdpc] pBR not found\");\n }\n\n enqueue(pmCache.piece(index, position, length, buffer, params));\n }", "public synchronized void bufferMessage() throws Exception\r\n {\r\n\r\n System.out.println(\"BUFFER: Message from future round received. Buffering message.\");\r\n // Wait until node moves to next round.\r\n wait();\r\n\r\n }", "public synchronized void block() {\n\t\tsetBlocked(true);\n\t}", "protected void onQueued() {}", "public synchronized void setReceived() {\n\t\t_received = true;\n\t\tthis.notifyAll();\n\t}", "synchronized void endCriticalUse(){\nSC = false;\nJeton=false;\n\nif (procId==0){\n\tSyncMessage sm = new SyncMessage(MsgType.JETON, 0, procId);\n\tsendTo(0, sm);\n}else{\n\tSyncMessage sm = new SyncMessage(MsgType.JETON, 1, procId);\n\tsendTo(1, sm);\n}\n\n}", "void flushBlocking();", "public void afterReceive() {\n\t}", "void notifyAllAboutChange();", "void onRequest(int index, int begin, int length)\n {\n if (DEBUG) System.out.println(\"[stdpc] onRequest:\" + index + \",\" + begin + \",\" + length);\n\n// sendQueue.forEach(pm -> System.out.println(\"[stdpc] onRequest -b>\" + System.identityHashCode(pm) +\n// \" \" +pm.type + \" ,\" + pm.index +\",\" + pm.begin + \",\" + pm.length) );\n\n // validate common block parameters\n boolean correct = torrent.validateBlock(index, begin, length);\n if (!correct) {\n // just ignore such requests\n statistics.blocksRequestedIncorrect++;\n return;\n }\n\n // this could be moved to send(), but doesn't really matter\n statistics.blocksSent++;\n\n // track active requests\n StdPeerMessage pm = pmCache.request(index, begin, length);\n peerBlockRequests.add(pm);\n\n // notify torrent to read and enqueue block\n torrent.onRequest(this, index, begin, length);\n\n// sendQueue.forEach(x -> System.out.println(\"[stdpc] onRequest -a<\" + System.identityHashCode(x) +\n// \" \" +x.type + \" ,\" + x.index +\",\" + x.begin + \",\" + x.length) );\n\n }", "@Override\n\tpublic void msgPartsLow() {\n\t\t\n\t}", "@Override\n\tpublic void run() {\n\t\tdispBlocks();\n\t\tsendData();\n\t}", "public void run() {\n String data;\n PrintStream toServer;\n Socket sock;\n String newblockchain;\n String fakeVerifiedBlock;\n\n System.out.println(\"Starting the Unverified Block Priority Queue Consumer thread.\\n\");\n try {\n while (true) { //take a block from the queue, work to verify the block and then multicast the new blockchain out\n data = queue.take(); \n System.out.println(\"Consumer got unverified: \" + data);\n BlockRecord blockdata = BlockProcessing.toXML(data, Blockchain.PID);\n \n //if our blockchain already contains this block ID, break\n if (Blockchain.blockchain.contains(blockdata.getABlockID())) {\n \tbreak;\n }\n \t\n // Real work here\n String winningHash = Work.doWork(data); //creatively named class and function :)\n blockchainSize++; //increment the size of the blockchain so we know what to put as blockNum field\n blockdata.setASHA256String(winningHash);\n blockdata.setABlockNum(Integer.toString(blockchainSize));\n \n //here we sign the SHA256String with our Private Key\n blockdata.setASignedSHA256(BlockProcessing.signData(winningHash.getBytes(), inputKeyPair.getPrivate()).toString());\n\n //convert the data back to a string\n data = blockdata.toString(blockdata);\n \n //exclude duplicate blocks\n if (Blockchain.blockchain.indexOf(data.substring(1, 20)) < 0) {\n \tBlockRecord verifiedBlock = new BlockRecord();\n verifiedBlock = BlockProcessing.toXMLForExistingRecord(data, Blockchain.PID);\n String realVerifiedBlock = \"[\" + verifiedBlock.toString(verifiedBlock) + \"]\";\n \n String tempblockchain = realVerifiedBlock + Blockchain.blockchain;\n \n for (int i = 0; i < Blockchain.numProcesses; i++) { //multicast the new blockchain to the rest of the group\n sock = new Socket(Blockchain.serverName, Ports.BlockchainServerPortBase + i);\n toServer = new PrintStream(sock.getOutputStream());\n toServer.println(tempblockchain);\n toServer.flush();\n sock.close();\n }\n }\n Thread.sleep(1500); //wait for the blockchain to be updated\n }\n } catch (Exception e) {\n System.out.println(e);\n }\n }", "private void onMessage(JsonRpcMessage msg) {\n List<JsonRpcMessage> extraMessages = super.handleMessage(msg, true);\n notifyMessage(msg);\n for(JsonRpcMessage extraMsg: extraMessages) {\n notifyMessage(extraMsg);\n }\n }", "@Override\n public boolean messagePending() {\n return commReceiver.messagePending();\n }", "private void processOut() {\n\t\tsynchronized (lock){\n\t\twhile (!queue.isEmpty()) {\n\t\t\tvar bb = queue.peek();\n\t\t\tif (bb.remaining() <= bbout.remaining()) {\n\t\t\t\tqueue.remove();\n\t\t\t\tbbout.put(bb);\n\t\t\t}\n\t\t}}\n\t}", "@Override\n\t\tpublic void unlock() {\n\n\t\t\tsynchronized (lock) {\n\t\t\t\treaders--;\n\t\t\t\tlock.notifyAll();\n\t\t\t}\n\n\t\t}", "@Override\n public void run() {\n graphIn = new Handler(Looper.getMainLooper()) {\n\n public void handleMessage(Message msg) {\n switch (msg.what) {\n case handlerState2:\n received = Boolean.parseBoolean((String) msg.obj);\n break;\n case handlerState4:\n sampleTime = Integer.parseInt((String) msg.obj);\n break;\n case handlerState1:\n ppgWaveBuffer.addAll((ArrayList) msg.obj);\n bluetoothIn.obtainMessage(handlerState5, \"ACK\").sendToTarget();\n break;\n\n }\n }\n };\n\n for (; ; ) {\n\n if (!VerifyActivity.isActivityVisible()) {\n ppgWaveBuffer.clear();\n break;\n }\n if (received == true && ppgWaveBuffer.size() != 0) {\n\n runOnUiThread(new Runnable() {\n\n @Override\n public void run() {\n if (ppgWaveBuffer.size() != 0) {\n graph.update(ppgWaveBuffer);\n }\n }\n });\n try {\n Thread.sleep(sampleTime + compensatoryTime);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }\n }\n }", "protected void aq() {\n Object object = this.li;\n synchronized (object) {\n if (this.lz != null) {\n this.lp.unregisterReceiver(this.lz);\n this.lz = null;\n }\n return;\n }\n }", "@Override\n\t\tpublic void unlock() {\n\n\t\t\tsynchronized (lock) {\n\t\t\t\twriters--;\n\t\t\t\tlock.notifyAll();\n\t\t\t}\n\t\t}", "@Override\n protected void connectionClosed(Peer.CloseReason reason)\n {\n Stream.concat(sendQueue.stream(), blockRequests.stream())\n .filter(pm -> pm.type == StdPeerMessage.REQUEST)\n .forEach(pm -> {\n torrent.cancelBlockRequest(pm.index, pm.begin);\n });\n\n // release messages\n sendQueue.forEach( pmCache::release);\n sendQueue.clear();\n // and active requests\n blockRequests.forEach( pmCache::release);\n blockRequests.clear();\n // peerRequests\n peerBlockRequests.forEach( pmCache::release);\n peerBlockRequests.clear();\n\n peer.setConnectionClosed(reason);\n\n // incoming connections could be not linked yet\n if (torrent != null) {\n torrent.onPeerDisconnect(this);\n }\n\n // todo: release caches via connectionFactory\n }", "public void beforeReceive() {\n\t}", "public synchronized void nudge() {\n notifyAll();\n }", "@Override\n public void doDataReceived(ResourceDataMessage dataMessage) {\n if(outputStream == null) return;\n if(startTime == 0) startTime = System.nanoTime();\n if (this.getTunnel() == null)\n this.setTunnel(dataMessage.getNetworkMessage().getTunnel());\n\n EventManager.callEvent(new ResourceTransferDataReceivedEvent(this, dataMessage));\n\n try {\n if (dataMessage.getResourceData().length != 0) {\n //Saving received chunks\n byte[] chunk = dataMessage.getResourceData();\n written += chunk.length;\n double speedInMBps = NANOS_PER_SECOND / BYTES_PER_MIB * written / (System.nanoTime() - startTime + 1);\n System.out.println();\n logger.info(\"Receiving file: {} | {}% ({}MB/s)\", this.getResource().attributes.get(1), ((float) written / (float) fileLength) * 100f, speedInMBps);\n\n //add to 4mb buffer\n System.arraycopy(chunk, 0, buffer, saved, chunk.length);\n saved += chunk.length;\n if (buffer.length - saved < BUFFER_SIZE || written >= fileLength) {\n //save and clear buffer\n outputStream.write(buffer, 0, saved);\n saved = 0;\n }\n\n\n if (written >= fileLength) {\n this.close();\n }\n } else {\n //Empty chunk, ending the transfer and closing the file.\n logger.info(\"Empty chunk received for: {}, ending the transfer...\", this.getResource().attributes.get(1));\n\n //File fully received.\n this.close();\n }\n } catch (Exception e) {\n callError(e);\n }\n }", "private void sendInternal(Payload payload) {\n synchronized (internalLock) {\n outBuffer.addLast(payload);\n pendingMessages = true;\n internalLock.notify();\n }\n }", "protected void deliverMessages()\n {\n Set<Envelope> envelopes = messengerDao.getEnvelopes();\n\n Map<String, Set<Envelope>> peerEnvelopesMap = Maps.newHashMap();\n int maxTimeToLive = 0;\n //distribute envelops to peers\n for ( Envelope envelope : envelopes )\n {\n if ( envelope.getTimeToLive() > maxTimeToLive )\n {\n maxTimeToLive = envelope.getTimeToLive();\n }\n Set<Envelope> peerEnvelopes = peerEnvelopesMap.get( envelope.getTargetPeerId() );\n if ( peerEnvelopes == null )\n {\n //sort by createDate asc once more\n peerEnvelopes = new TreeSet<>( new Comparator<Envelope>()\n {\n @Override\n public int compare( final Envelope o1, final Envelope o2 )\n {\n return o1.getCreateDate().compareTo( o2.getCreateDate() );\n }\n } );\n peerEnvelopesMap.put( envelope.getTargetPeerId(), peerEnvelopes );\n }\n\n peerEnvelopes.add( envelope );\n }\n\n\n //try to send messages in parallel - one thread per peer\n try\n {\n for ( Map.Entry<String, Set<Envelope>> envelopsPerPeer : peerEnvelopesMap.entrySet() )\n {\n Peer targetPeer = messenger.getPeerManager().getPeer( envelopsPerPeer.getKey() );\n if ( targetPeer.isLocal() )\n {\n completer.submit(\n new LocalPeerMessageSender( messenger, messengerDao, envelopsPerPeer.getValue() ) );\n }\n else\n {\n completer.submit(\n new RemotePeerMessageSender( messengerDao, targetPeer, envelopsPerPeer.getValue() ) );\n }\n }\n\n //wait for completion\n try\n {\n for ( int i = 0; i < peerEnvelopesMap.size(); i++ )\n {\n Future<Boolean> future = completer.take();\n future.get();\n }\n }\n catch ( InterruptedException | ExecutionException e )\n {\n LOG.warn( \"ignore\", e );\n }\n }\n catch ( PeerException e )\n {\n LOG.error( e.getMessage(), e );\n }\n }", "public void acceptMessage(java.util.Date time, OSCMessage message) {\n\t\t// FOR DEBUGGING: to print the full message:\n\t\tif (debugging) {\n\t\t\tSystem.out.print(message.getAddress());\n\t\t\tfor(int i = 0; i < message.getArguments().length; i++) {\n\t\t\t\tSystem.out.print(\", \" + message.getArguments()[i].toString());\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t\t\n\t\tif (message.getAddress().matches(\"/done\")) {\n\t\t\tif (message.getArguments()[0].toString().matches(\"/b_allocRead\")) {\n\t\t\t\t//debugPrintln(\"A buffer was created.\");\n\t\t\t}\n\t\t}\n\n\t\t//TODO: this /synced watch will work as long as the buffers load correctly.\n\t\t//but there's not yet any way to know if they fail.\n\t\telse if (message.getAddress().matches(\"/synced\")) {\n\t\t\tint id = (Integer)(message.getArguments()[0]) - _bufferReadIdOffset;\n\t\t\tsynchronized (this) {\n\t\t\t\tif (_bufferMap.containsKey(id)) {\n\t\t\t\t\tdebugPrintln(\"Buffer \" + id + \" was loaded.\");\n\t\t\t\t\tif (_notifyListener != null) { _notifyListener.receiveNotification_BufferLoaded(id, _bufferMap.get(id)); }\n\t\t\t\t\tif (_controlPanel != null && _controlPanel._statsDisplay != null) {\n\t\t\t\t\t\t_controlPanel._statsDisplay.receiveNotification_BufferLoaded(id, _bufferMap.get(id));\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\telse if (message.getAddress().matches(\"/n_go\") ||\n\t\t\tmessage.getAddress().matches(\"/n_info\")) {\n\t\t\t//if it was node 1, then we can get going.\n\t\t\tif ((Integer)(message.getArguments()[0]) == _motherGroupID && \n\t\t\t\t(Integer)(message.getArguments()[1]) == 1 ) {\n\t\t\t\tif (!_serverBooted) {\n\t\t\t\t\t_serverBooted = true;\n\t\t\t\t\thandleServerBooted();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// handle notices of freed nodes\n\t\telse if (message.getAddress().matches(\"/n_end\")) {\n\t\t\t// take message.getArguments()[0] (the node id that was freed)\n\t\t\t// and free up any resources associated with it.\n\t\t\t//debugPrintln(\"node \" + message.getArguments()[0].toString() + \" was freed.\");\n\t\t\tInteger id = (Integer) (message.getArguments()[0]);\n\t\t\tif (id > _motherGroupID) {\n\t\t\t\t// it's a group node. a SoundNode has died.\n\t\t\t\tsynchronized (this) {\n\t\t\t\t\tSoundNode sn = _soundNodes.get(id);\n\t\t\t\t\tif (sn != null) {\n\t\t\t\t\t\tsn.setAlive(false);\n\t\t\t\t\t\tfreeBus(sn.get_busID());\n\t\t\t\t\t}\n\t\t\t\t\t_soundNodes.remove(id);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t// free up that node from the node id list.\n\t\t\t\tsynchronized (this) {\n\t\t\t\t\t_nodeIdList.remove(message.getArguments()[0]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//handle /status responses (status.reply)\n\t\telse if (message.getAddress().matches(\"/status.*\")) {\n\t\t\t//TODO update control panel display with status data\n\t\t\tInteger numUgens = (Integer)(message.getArguments()[1]);\n\t\t\tInteger numSynths = (Integer)(message.getArguments()[2]);\n\t\t\tInteger numGroups = (Integer)(message.getArguments()[3]);\n\t\t\tInteger numSynthdefs = (Integer)(message.getArguments()[4]);\n\t\t\tFloat avgCPU = (Float)(message.getArguments()[5]);\n\t\t\tFloat peakCPU = (Float)(message.getArguments()[6]);\n\t\t\thandleServerStatusUpdate(numUgens, numSynths, numGroups, numSynthdefs, avgCPU, peakCPU);\n\t\t}\n\t\t\n\t}", "@Override\n public void run() {\n reprocessPendingMessage();\n }", "@Override\n\t\tpublic void run() {\n\t\t\twhile (evictionThread.get() == this) {\n\t\t\t\tStoreRequest r = null;\n\t\t\t\ttry {\n\t\t\t\t\twhile (requestsBeingSending.get() >= getMaxSenderThreads()) {\n\t\t\t\t\t\tsynchronized(this) {\n\t\t\t\t\t\t\tif (requestsBeingSending.get() >= getMaxSenderThreads()) {\n\t\t\t\t\t\t\t\tthis.waiting = true;\n\t\t\t\t\t\t\t\tthis.wait(100);\n\t\t\t\t\t\t\t\tthis.waiting = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tr = writeQueue.poll(3, TimeUnit.SECONDS);\n\t\t\t\t\t\n\t\t\t\t\tif (r == null) {\n\t\t\t\t\t\tif (writeQueue.isEmpty() && requestsBeingSending.get() == 0 && writeQueue.isEmpty()) {\n\t\t\t\t\t\t\t// Preparing this thread to stop and stating a new one should be started\n\t\t\t\t\t\t\tevictionThread.compareAndSet(this, null);\n\t\t\t\t\t\t\tif (!writeQueue.isEmpty() || requestsBeingSending.get() != 0)\n\t\t\t\t\t\t\t\tevictionThread.compareAndSet(null, this);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\t\t// Requests in preparation of sending are marked twice so that a \"0\" is\n\t\t\t\t\t\t// a bit less likely to be a false 0\n\t\t\t\t\t\trequestsBeingSending.incrementAndGet();\n\t\t\t\t\t\tr.send(this.sender, false);\n\t\t\t\t\t\trequestsBeingSending.decrementAndGet();\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\tbreak;\n\t\t\t\t} catch (Throwable e) {\n\t\t\t\t\tif (r == null) {\n\t\t\t\t\t\tlogger.log(Level.WARNING, \"Problem waiting for request out of write cache: \" + e.getMessage(), e);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlogger.log(Level.SEVERE, \"Problem while sending request out of write cache ; request \" + r + \" lost: \" + e.getMessage(), e);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Stopping\n\t\t\tthis.running = false;\n\t\t\tthis.sender.shutdown();\n\t\t\ttry {\n\t\t\t\tthis.sender.awaitTermination(Long.MAX_VALUE, TimeUnit.MILLISECONDS);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\tlogger.log(Level.SEVERE, \"Problem while shutting down n-orm write retention cache: \" + e.getMessage(), e);\n\t\t\t}\n\t\t}", "private void dealChatMsg() {\n /*\n r4 = this;\n r0 = new java.util.LinkedList;\n r0.<init>();\n r1 = com.tomatolive.library.ui.activity.live.PrepareLiveActivity.class;\n monitor-enter(r1);\n r2 = r4.receiveMsgQueue;\t Catch:{ all -> 0x0038 }\n if (r2 == 0) goto L_0x0033;\n L_0x000c:\n r2 = r4.receiveMsgQueue;\t Catch:{ all -> 0x0038 }\n r2 = r2.isEmpty();\t Catch:{ all -> 0x0038 }\n if (r2 == 0) goto L_0x0015;\n L_0x0014:\n goto L_0x0033;\n L_0x0015:\n r2 = 0;\n L_0x0016:\n r3 = 5;\n if (r2 >= r3) goto L_0x0029;\n L_0x0019:\n r3 = r4.receiveMsgQueue;\t Catch:{ all -> 0x0038 }\n r3 = r3.poll();\t Catch:{ all -> 0x0038 }\n r3 = (com.tomatolive.library.model.ChatEntity) r3;\t Catch:{ all -> 0x0038 }\n if (r3 == 0) goto L_0x0029;\n L_0x0023:\n r0.add(r3);\t Catch:{ all -> 0x0038 }\n r2 = r2 + 1;\n goto L_0x0016;\n L_0x0029:\n monitor-exit(r1);\t Catch:{ all -> 0x0038 }\n r1 = new com.tomatolive.library.ui.activity.live.-$$Lambda$PrepareLiveActivity$WexsRlm5pU6uK-2JwaAGWgcPHqs;\n r1.<init>(r4, r0);\n r4.handlerMainPost(r1);\n return;\n L_0x0033:\n r0 = 1;\n r4.asleep = r0;\t Catch:{ all -> 0x0038 }\n monitor-exit(r1);\t Catch:{ all -> 0x0038 }\n return;\n L_0x0038:\n r0 = move-exception;\n monitor-exit(r1);\t Catch:{ all -> 0x0038 }\n throw r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: com.tomatolive.library.ui.activity.live.PrepareLiveActivity.dealChatMsg():void\");\n }", "void notifyPending(MessageSnapshot snapshot);", "@Override\n\tpublic void invoke() {\n\t\t\n\t\tIBuffer b = Buffer.getBuffer();\n\t\tint r = b.getRemainingCapacity();\n\t\t\n\t\t// the buffer is empty - this means that invoke was called after a grid was removed\n\t\t// and we need to fill it up to prevent starvation. Ideally the only way this could\n\t\t// happen is if the buffer size was 1\n\t\tif (r == 0) {\n\t\t\tPublisher.getInstance().send(new ProduceMessage());\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif (r < b.getCapacity())\n\t\t\tPublisher.getInstance().send(new ProduceMessage());\n\t\t\n\t\tif (r > 0)\n\t\t\tPublisher.getInstance().send(new ConsumeMessage());\n\t\t\n\t}", "public void run(){\r\n TaggedData d;\r\n try{\r\n dos = new DataOutputStream(new BufferedOutputStream(socket.getOutputStream()));\r\n while(true){\r\n synchronized(sendLock){\r\n if(queue.size() <= 0) sendLock.wait();\r\n try{ d = queue.removeLast(); }\r\n catch(NoSuchElementException e){ d = null; }\r\n }\r\n if(quit){\r\n cleanup();\r\n break;\r\n }\r\n if(d != null) send(d);\r\n }\r\n }\r\n catch(InterruptedException ie){ ie.printStackTrace(); cleanup(false); } // for now\r\n catch(IOException ioe){ ioe.printStackTrace(); cleanup(false); }\r\n finally{ cleanup(false); }\r\n \r\n if(dos != null){\r\n try{ dos.close(); } catch(IOException ioe){ ioe.printStackTrace(); }\r\n dos = null;\r\n }\r\n }", "private synchronized void flushMessageQueue() {\n\t\tif(peers.size() > 0) {\n\t\t\twhile(!noPeersMessageQueue.isEmpty()) {\n\t\t\t\tpropagateToAllPeers(noPeersMessageQueue.poll());\n\t\t\t}\n\t\t}\n\t}", "private void sendMsgBurst(long stopTime)\n {\n for (ClientChannelInfo clientChannelInfo : _channelHandler.activeChannelList())\n {\n ProviderSession providerSession = (ProviderSession)clientChannelInfo.userSpec;\n\n // The application corrects for ticks that don't finish before the time \n // that the next update burst should start. But don't do this correction \n // for new channels.\n if(providerSession.timeActivated() == 0)\n {\n continue;\n }\n \n int ret = TransportReturnCodes.SUCCESS;\n\n // Send burst of updates\n if(ProviderPerfConfig.updatesPerSec() != 0 && providerSession.updateItemList().count() != 0)\n {\n ret = sendUpdateBurst(providerSession, _error);\n if (ret > TransportReturnCodes.SUCCESS)\n {\n \t // Need to flush\n if (!ProviderPerfConfig.useReactor()) // use UPA Channel\n {\n _channelHandler.requestFlush(clientChannelInfo);\n }\n }\n }\n \n // Send burst of generic messages\n if(ProviderPerfConfig.genMsgsPerSec() != 0 && providerSession.genMsgItemList().count() != 0)\n {\n ret = sendGenMsgBurst(providerSession, _error);\n if (ret > TransportReturnCodes.SUCCESS)\n {\n \t // Need to flush\n if (!ProviderPerfConfig.useReactor()) // use UPA Channel\n {\n _channelHandler.requestFlush(clientChannelInfo);\n }\n }\n }\n\n // Use remaining time in the tick to send refreshes.\n while(ret >= TransportReturnCodes.SUCCESS && providerSession.refreshItemList().count() != 0 && currentTime() < stopTime)\n ret = sendRefreshBurst(providerSession, _error);\n \n if(ret < TransportReturnCodes.SUCCESS)\n {\n switch(ret)\n {\n case TransportReturnCodes.NO_BUFFERS:\n if (!ProviderPerfConfig.useReactor()) // use UPA Channel\n {\n _channelHandler.requestFlush(clientChannelInfo);\n }\n break;\n default:\n \t if (!Thread.interrupted())\n \t {\n \t\t System.out.printf(\"Failure while writing message bursts: %s (%d)\\n\", _error.text(), ret);\n \t\t if (!ProviderPerfConfig.useReactor()) // use UPA Channel\n {\n \t\t _channelHandler.closeChannel(clientChannelInfo, _error); //Failed to send an update. Remove this client\n }\n else // use UPA VA Reactor\n {\n System.out.println(\"Channel Closed.\");\n \n long inactiveTime = System.nanoTime();\n getProvThreadInfo().stats().inactiveTime(inactiveTime);\n \n --_connectionCount;\n \n // unregister selectableChannel from Selector\n try\n {\n SelectionKey key = clientChannelInfo.reactorChannel.selectableChannel().keyFor(_selector);\n key.cancel();\n }\n catch (Exception e) { } // channel may be null so ignore\n \n if (providerSession.clientChannelInfo().parentQueue.size() > 0)\n {\n providerSession.clientChannelInfo().parentQueue.remove(providerSession.clientChannelInfo());\n }\n\n clientChannelInfo.reactorChannel.close(_errorInfo); //Failed to send an update. Remove this client\n }\n \t }\n break;\n }\n }\n else if (ret > TransportReturnCodes.SUCCESS)\n {\n // need to flush\n if (!ProviderPerfConfig.useReactor()) // use UPA Channel\n {\n _channelHandler.requestFlush(clientChannelInfo);\n }\n }\n }\n }", "private void postMessages() {\n List<models.MessageProbe> probes = new Model.Finder(String.class, models.MessageProbe.class).where().ne(\"curr_status\", 1).findList();\n for (models.MessageProbe currProbe : probes) {\n if ((currProbe.curr_status == models.MessageProbe.STATUS.WITH_ERROR) || (currProbe.curr_status == models.MessageProbe.STATUS.NEW)) {\n String contextErr = MiniGate.gate.sendCommandWithCheck(\"RIBBON_NCTL_ACCESS_CONTEXT:{\" + currProbe.author + \"}\");\n if (contextErr != null) {\n synchronized (dataLock) {\n currProbe.curr_status = models.MessageProbe.STATUS.WITH_ERROR;\n currProbe.curr_error = contextErr;\n currProbe.update();\n errCounter++;\n }\n } else {\n String postErr = MiniGate.gate.sendCommandWithCheck(currProbe.getCsvToPost());\n synchronized (dataLock) {\n if (postErr != null) {\n currProbe.curr_status = models.MessageProbe.STATUS.WITH_ERROR;\n currProbe.curr_error = postErr;\n errCounter++;\n } else {\n currProbe.curr_status = models.MessageProbe.STATUS.POSTED;\n currProbe.curr_error = null;\n postCounter++;\n }\n currProbe.update();\n }\n }\n } else if (currProbe.curr_status == models.MessageProbe.STATUS.DELETED) {\n currProbe.delete();\n } else if (currProbe.curr_status == models.MessageProbe.STATUS.EDITED) {\n String contextErr = MiniGate.gate.sendCommandWithCheck(\"RIBBON_NCTL_ACCESS_CONTEXT:{\" + currProbe.author + \"}\");\n if (contextErr != null) {\n synchronized (dataLock) {\n currProbe.curr_status = models.MessageProbe.STATUS.WITH_ERROR;\n currProbe.curr_error = contextErr;\n currProbe.update();\n errCounter++;\n }\n } else {\n String postErr = MiniGate.gate.sendCommandWithCheck(currProbe.getCsvToModify());\n synchronized (dataLock) {\n if (postErr != null) {\n currProbe.curr_status = models.MessageProbe.STATUS.WITH_ERROR;\n currProbe.curr_error = postErr;\n errCounter++;\n } else {\n currProbe.curr_status = models.MessageProbe.STATUS.WAIT_CONFIRM;\n currProbe.curr_error = null;\n editCounter++;\n }\n currProbe.update();\n }\n }\n }\n }\n }", "private void updateReceivedData(byte[] data) {\n }", "protected void releaseBuffer()\n {\n interlock.endReading();\n // System.out.println(\"endReading: 2\");\n }", "synchronized void receiveJETON(){\n\tif(SC){\n\t\tJeton = true;\n\t}else{\n\t\tif (procId==0){\n\t\t\tSyncMessage sm = new SyncMessage(MsgType.JETON, 0, procId);\n\t\t\tsendTo(0, sm);\n\t\t}else{\n\t\t\tSyncMessage sm = new SyncMessage(MsgType.JETON, 1, procId);\n\t\t\tsendTo(1, sm);\n\t\t}\n\t}\n\tthis.notifyAll();\n\n}", "public synchronized void run() {\n\n boolean keepGoing = true;\n\n while (keepGoing) {\n\n try {\n sleep(500);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n int count = 0;\n\n try {\n\n count = sInput.available();\n\n if (count > 0) {\n message = sInput.readUTF();\n }\n\n if (isWait) {\n synchronized (this) {\n try {\n wait();\n\n } catch (InterruptedException e) {\n System.out.println(\"Error in waiting\");\n e.printStackTrace();\n }\n }\n }\n\n } catch (IOException e) {\n display(username + \" Exception reading Streams: \" + e);\n e.printStackTrace();\n }\n\n if(count == 0){\n continue;\n }\n\n String[] splitMessage = message.split(\" \");\n\n if(message.equalsIgnoreCase(\"!LOGOUT\")){\n //display(username + \" disconnected with a LOGOUT message.\");\n gameManager.disconnected(this);\n //keepGoing = false;\n break;\n }else if(message.equalsIgnoreCase(\"!WhoIsIn\")){\n writeMsg(\"List of the users connected at \" + simpleDateFormat.format(new Date()) + \"\\n\");\n // send list of active clients\n for (int i = 0; i < clientThreads.size(); ++i) {\n Server.ClientThread ct = clientThreads.get(i);\n writeMsg((i + 1) + \") \" + ct.username + \" since \" + ct.date);\n }\n }else if(canTalk) {\n if (message.equalsIgnoreCase(\"!READY\") && !isLastMoment) {\n if(!isReady) {\n gameManager.ready();\n isReady = true;\n broadcast(BLUE + gameManager.getReadyToGo()\n + \" number of players are ready so far\" + RESET, getClientThreads());\n }else{\n writeMsg(RED + \"you said you are ready before!\" + RESET);\n }\n }else if (!waitingToGo && !isLastMoment) {\n if (message.length() > 0 && message.charAt(0) == '@') {\n Player curPlayer = gameManager.getPlayer(this);\n //String[] decodedMsg = message.split(\" \");\n if (curPlayer instanceof GodFather) {\n gameManager.godFatherShot(message.substring(1), this);\n } else if (curPlayer instanceof LectorDoctor) {\n gameManager.lectorHill(message.substring(1), this);\n } else if (curPlayer instanceof Doctor) {\n gameManager.doctorHill(message.substring(1), this);\n } else if (curPlayer instanceof Detective) {\n gameManager.detectiveAttempt(message.substring(1), this);\n } else if (curPlayer instanceof Professional) {\n gameManager.professionalShot(message.substring(1), this);\n } else if (curPlayer instanceof Psychologist) {\n gameManager.psychologistAttempt(message.substring(1), this);\n } else if (curPlayer instanceof Invulnerable) {\n if (message.substring(1).equalsIgnoreCase(\"!RESULT\")) {\n gameManager.invulnerableAttempt(this);\n }\n } else if (curPlayer instanceof Mayor) {\n if (message.substring(1).equalsIgnoreCase(\"!CANCEL\")) {\n gameManager.mayorAttempt(this);\n }\n }\n }\n else if (splitMessage[0].equalsIgnoreCase(\"!VOTE\")) {\n if (splitMessage[1].charAt(0) == '@') {\n gameManager.vote(splitMessage[1].substring(1), this);\n }\n } else {\n boolean confirmation = broadcast(username + \": \" + message, activeClients);\n if (!confirmation) {\n String msg = RED + notification + \"Sorry. No such user exists.\" + notification + RESET;\n writeMsg(msg);\n }\n }\n\n }\n }else if (splitMessage[0].equalsIgnoreCase(\"!VOTE\") && !isLastMoment && !waitingToGo) {\n if (splitMessage[1].charAt(0) == '@') {\n gameManager.vote(splitMessage[1].substring(1), this);\n }\n }else if (message.equalsIgnoreCase(\"!READY\") && !isLastMoment) {\n if(!isReady) {\n gameManager.ready();\n isReady = true;\n broadcast(BLUE + gameManager.getReadyToGo() + \" number of players are ready so far\"\n + RESET, getClientThreads());\n }else{\n writeMsg(\"you said you are ready before!\");\n }\n }\n\n }\n // if out of the loop then disconnected and remove from client list\n remove(id);\n close();\n }", "public synchronized void receive() {\n inCountStat.received();\n inCount++;\n }", "private void handleBlockOk(BlockOk ok) throws AppiaEventException {\n \t\t//Get the necessary arguments\n \t\tList<VsClient> allMyClients = VsClientManagement.getClientstAttachedTo(listenAddress);\n \n \t\t//Enter flush mode\n \t\tflushMode = true;\n \t\tSystem.out.println(\"Received a BlockOk ( a normal one )\");\n \n \t\t//Lock clientsViewManagement here with a lock\n \t\tacquireClientsViewUpdateLock(); //So no new clients/servers can join the group\n \n \t\t//Clean the update controls I have received\n \t\tUpdateManager.cleanUpdateViews();\n \n \t\t//Send to all client in all groups a blockOk request\n \t\t//I ask if I have some client in that group\n \n \t\t//If I have at least one client to shut\n \t\tif(allMyClients.size() >= 1){\n \t\t\t//I will store the block ok event\n \t\t\tpendingBlockOk = ok;\n \t\t\tSystem.out.println(\"I have a pending blockOk to send. Wait for client to shut upo\");\n \n \t\t\t//And for each client, i'll ask them to shut up\n \t\t\tfor (VsClient client : allMyClients){\n \t\t\t\tVsGroup group = VsClientManagement.getVsGroup(client.getGroup().id);\n \t\t\t\tShutUpStubEvent shutUpEvent = new ShutUpStubEvent(client.getGroup().id);\n \t\t\t\tsendStubEvent(shutUpEvent, group);\n \t\t\t}\n \t\t}\n \n \t\t//If I have no clients to warn\n \t\telse{\n \t\t\t//I may send right way the block OK\n \t\t\tok.go();\n \t\t\tSystem.out.println(\"I have no clients, sending blockOk\");\n \t\t}\n \t}", "public synchronized void a() {\n if (!this.b && d.isFinished() && g.isFinished() && f.isFinished()) {\n e.setFinished(true);\n this.b = true;\n if (this.q != null) {\n this.q.wxEasyScanFinish();\n }\n }\n if (this.c && this.b) {\n LocalBroadcastManager.getInstance(AppApplication.getInstance()).sendBroadcast(new Intent().setAction(WxNotifyRefrshReceiver.b).putExtra(CleanSwitch.CLEAN_DATA, WxNotifyRefrshReceiver.c));\n }\n }", "private void unblockWaiters() {\n synchronized (sERDLock) {\n sERDLock.notifyAll();\n }\n }", "@Override\n public void broadcastBlock(final Block block) {}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tLooper.prepare();\n\t\t\t\tif (syncArticleContent()) {\n\t\t\t\t\thandler.sendEmptyMessage(OFFLINE_DOWNLOAD);\n\t\t\t\t}\n\t\t\t}", "protected void closeNotSuccessful() {\n\t\tthis.writer.deblockQueue();\n\t}", "@Override\n public void run() {\n try {\n boolean busy = true;\n while (busy) {\n AbstractBasicMessage msg = readMsg();\n if (msg != null) {\n busy = msg.operate(this.persistor, this.pushServer);\n }\n }\n } catch (IOException e) {\n // Treat an IOException as a termination of the message\n // exchange, and let this message-processing thread die.\n\n // CODE VON DOZENTEN...\n } catch (OperationNotSupportedException ex) {\n System.out.println(\"Error while reading incoming message\");\n ex.printStackTrace();\n }\n }", "@Override\n public void handleMessage(Message msg) {\n sendEmptyMessageDelayed(0, 3000);\n if (resClient.getSendBufferFreePercent() <= 0.05) {\n Toast.makeText(StreamingActivity.this, \"sendbuffer is full,netspeed is low!\", Toast.LENGTH_SHORT).show();\n }\n }", "public void run() {\n int eventseen = 0;\n int looptry = 0;\n int wait = 100;\n while(! isInterrupted()) {\n Iterable<byte[]> stream = new Iterable<byte[]>() {\n @Override\n public Iterator<byte[]> iterator() {\n Iterator<byte[]> i = Receiver.this.getIterator();\n if(i == null) {\n return new Iterator<byte[]>() {\n\n @Override\n public boolean hasNext() {\n return false;\n }\n\n @Override\n public byte[] next() {\n return null;\n }\n\n };\n } else {\n return i;\n }\n }\n };\n try {\n for(byte[] e: stream) {\n logger.trace(\"new message received: {}\", e);\n if(e != null) {\n eventseen++;\n //Wrap, but not a problem, just count as 1\n if(eventseen < 0) {\n eventseen = 1;\n }\n Event event = new Event();\n decode(event, e);\n send(event);\n }\n }\n } catch (Exception e) {\n eventseen = 0;\n logger.error(e.getMessage());\n logger.catching(e);\n }\n // The previous loop didn't catch anything\n // So try some recovery\n if(eventseen == 0) {\n looptry++;\n logger.debug(\"event seen = 0, try = {}\", looptry);\n // A little magic, give the CPU to other threads\n Thread.yield();\n if(looptry > 3) {\n try {\n Thread.sleep(wait);\n wait = wait * 2;\n looptry = 0;\n } catch (InterruptedException ex) {\n break;\n }\n }\n } else {\n looptry = 0;\n wait = 0;\n }\n }\n }", "private void dequeueMessages()\n\t{\n\t\twhile (_msg_queue.size() > 0)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t_ml.messageReceived( (Serializable) _msg_queue.removeFirst());\n\t\t\t}\n\t\t\tcatch (RuntimeException rte)\n\t\t\t{\n\t\t\t\trte.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "public void run() {\n\t\t\tBundle b = null;\n\t\t\tint i = 0, j;\n\t\t\ttry {\n\t\t\t\tfor (i = 0; i < t.length; i++) {\n\t\t\t\t\tString timestamp = \"\";\n\t\t\t\t\twhile (t[i].noOfBundles == 0)\n\t\t\t\t\t\t;\n\t\t\t\t\tfor (j = seq; j < t[i].noOfBundles; j++) {\n\t\t\t\t\t\tdo {\n\t\t\t\t\t\t\t// System.out.println(\"SEQ ACK : \" +\n\t\t\t\t\t\t\t// t[i].noOfBundles);\n\t\t\t\t\t\t\tbyte[] buffer = (byte[]) ois.readObject();\n\t\t\t\t\t\t\tb = new Bundle();\n\t\t\t\t\t\t\tb.parse(buffer);\n\t\t\t\t\t\t\tif (b.bundleNumber == b.noOfBundles - 1)\n\t\t\t\t\t\t\t\ttimestamp = new String(b.data);\n\t\t\t\t\t\t\t// System.out.println(\"ACK WAITING : \" + j);\n\t\t\t\t\t\t\t// System.out.println(\"ACK RECEIVED : \"\n\t\t\t\t\t\t\t// + b.bundleNumber);\n\t\t\t\t\t\t\t// System.out.println(t[i].transactionId + \" \"\n\t\t\t\t\t\t\t// + t[i].noOfBundles + \" \" + j);\n\t\t\t\t\t\t} while (!b.isAcknowledgement(t[i].transactionId,\n\t\t\t\t\t\t\t\tt[i].noOfBundles, j));\n\t\t\t\t\t}\n\t\t\t\t\t// System.out.println(\"TIMESTAMP RECEIVED IS :\" +\n\t\t\t\t\t// timestamp);\n\t\t\t\t\tlong ts = Long.parseLong(timestamp);\n\t\t\t\t\tdh.setSynced(ts, t[i].records);\n\t\t\t\t\tseq = 0;\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\te.printStackTrace();\n\t\t\t\tObjectOutputStream fout;\n\t\t\t\ttry {\n\t\t\t\t\tfout = new ObjectOutputStream(new FileOutputStream(\n\t\t\t\t\t\t\tnew File(storagePath + \"/push\")));\n\t\t\t\t\tfout.writeObject(t);\n\t\t\t\t\t// System.out\n\t\t\t\t\t// .println(\"-----------------------------------------------------\");\n\t\t\t\t\t// System.out.println(\"Written broken transaction!!!\");\n\t\t\t\t\t// System.out\n\t\t\t\t\t// .println(\"-----------------------------------------------------\");\n\t\t\t\t\tfout.close();\n\t\t\t\t} catch (Exception e1) {\n\t\t\t\t\te1.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\t// System.out.println(\"ACK ENDED\");\n\t\t}", "@Override\n public boolean block() {\n return false;\n }", "@Override\n public void run() {\n transmit_set();\n }", "private void receiveMessage() throws InterruptedException {\n Map<Integer, Integer> transTimeMap = new HashMap<>();\n for (int i = 0; i < incomingLinks.size(); i++) {\n int transTime= new Random().nextInt(11);\n transTimeMap.put(i, transTime);\n }\n\n // Sort the random transmission time for the message in the channel.\n List<Map.Entry<Integer, Integer>> timeInfo = new ArrayList<>(transTimeMap.entrySet());\n timeInfo.sort((t1, t2) -> t1.getValue() - t2.getValue());\n\n int time = 0;\n for(int i = 0; i < timeInfo.size(); i++) {\n int index = timeInfo.get(i).getKey();\n int value = timeInfo.get(i).getValue();\n\n // After transmission time units, receive the message.\n Thread.sleep((value - time) * timeUnit);\n time += value - time;\n Message message = incomingLinks.get(index).receive();\n\n\n if (message != null) {\n String type = message.type;\n if (type.equals(\"init\")) {\n // If the process receives a larger id, it let the sender as its parent and broadcast this new\n // max id to all its neighbor except for its new parent.\n if (this.maxId < message.maxId) {\n this.maxId = message.maxId;\n this.parent = message.uid;\n this.listOfChild.clear();\n broadcast(new Message(this.uid, this.maxId, \"init\"), this.parent);\n numOfAck = 0;\n //If the process receives a smaller id, it will reply the sender a nack message.\n } else {\n sendTo(new Message(this.uid, message.maxId, \"nack\"), message.uid);\n }\n } else if (type.equals(\"ack\")) {\n // After receiving the ack message, it adds the number of ack and let the sender as its child.\n if (this.maxId == message.maxId) {\n numOfAck++;\n listOfChild.add(message.uid);\n }\n } else if (type.equals(\"nack\")) {\n // After receiving the nack message, it adds the number of ack.\n if (this.maxId == message.maxId) {\n numOfAck++;\n }\n }\n }\n }\n checkResult();\n }", "public void consume() throws InterruptedException {\n\n\t\tRandom random = new Random();\n\t\twhile (true) {\n\t\t\tsynchronized (lock) {\n\t\t\t\twhile (buffer.size() == 0) {\n\t\t\t\t\tlock.wait();\n\t\t\t\t}\n\n\t\t\t\tSystem.out.println(\"Consumed : \" + buffer.removeFirst());\n\t\t\t\tlock.notify();\n\n\t\t\t}\n\t\t\tThread.sleep(random.nextInt(1000));\n\t\t}\n\n\t}", "@Override\n\tpublic void visit(Interested i) {\n\t\tSystem.out.println(\"interested reću\");\n\t\tph.addMessageQueue(new Unchoke());\n\t\tph.setPeerChoked(false);\n\t\tSystem.out.println(\"peerChoked : \" + ph.getPeerChoked());\n\t}", "private void sendQueuedNotifications() {\n Notification n;\n while ((n = pendingNotifs.poll()) != null) {\n broadcaster.sendNotification(n);\n }\n }", "public interface HoldBackQueueListener {\n public void messagePutInHoldBackQueue(Message message);\n public void messageRemovedFromHoldBackQueue(Message message);\n}", "private void sendReceiveRes(){\n\t}", "void onChoke(boolean state)\n {\n peerChoke = state;\n //if (DEBUG) System.out.println(peer.address + \" onChoke: \" + state);\n\n if (peerChoke) {\n // remove all enqueued requests as they will be dropped by the remote peer\n for (int i = sendQueue.size() - 1; 0 <= i; i--) {\n StdPeerMessage pm = sendQueue.get(i);\n if (pm.type == StdPeerMessage.REQUEST) {\n sendQueue.remove(i);\n // notify torrent about cancelled request\n torrent.cancelBlockRequest(pm.index, pm.begin);\n pmCache.release(pm);\n }\n }\n // it's possible that we have requests that were already sent to external peer,\n // notify torrent - they are cancelled too [who knows, maybe data will arrive]\n for (int i = 0; i < blockRequests.size(); i++) {\n StdPeerMessage pm = blockRequests.get(i);\n torrent.cancelBlockRequest(pm.index, pm.begin);\n pmCache.release(pm);\n }\n blockRequests.clear();\n }\n }", "@Override\n public void onBuffering(int percent) {\n }", "private void signalNotEmpty() {\n\t\tfinal ReentrantLock takeLock = this.takeLock;\n\t\ttakeLock.lock();\n\t\ttry {\n\t\t\tnotEmpty.signal();\n\t\t} finally {\n\t\t\ttakeLock.unlock();\n\t\t}\n\t}", "@Override\r\n\t\t\tpublic void progressMade() {\n\t\t\t\twriteReadSemaphore.refreshReadLock(lockKey, readToken, lockTimeoutSec);\r\n\t\t\t}", "protected abstract long waitOnQueue();", "private void processOut() {\n while (!queue.isEmpty()) {\n var bb = queue.peek();\n if (bb.remaining() <= bbout.remaining()) {\n queue.remove();\n bbout.put(bb);\n } else {\n break;\n }\n }\n }", "private void processOut() {\n while (!queue.isEmpty()) {\n var bb = queue.peek();\n if (bb.remaining() <= bbout.remaining()) {\n queue.remove();\n bbout.put(bb);\n } else {\n break;\n }\n }\n }", "@Override\n\tpublic synchronized void run() {\n\t\tif ((infoMessage.getStoredValue() > node.getLeaderValue())\n\t\t\t\t|| ((infoMessage.getStoredValue() == node.getStoredValue())\n\t\t\t\t\t\t&& (infoMessage.getLeaderId() > node.getLeaderID()))) {\n\n\t\t\tnode.setLeaderID(infoMessage.getLeaderId());\n\t\t\tnode.setLeaderValue(infoMessage.getStoredValue());\n\t\t\tnode.setStoredId(node.getNodeID());\n\t\t\tnode.setStoredValue(node.getNodeValue());\n\t\t\tSystem.out.println(\"INFO HANDLER: 1) Leader changed in Node \" + node.getNodeID() + \" to: \"\n\t\t\t\t\t+ node.getLeaderID() + \" due to exchanging messages with \" + infoMessage.getIncomingId());\n\n\t\t\t// End to Exchanging Leaders Timer && Processing\n\t\t\tnode.networkEvaluation.setEndExchangingLeadersTimer(infoMessage.getIncomingId());\n\t\t\tnode.networkEvaluation.getExchangingLeaderTimer(infoMessage.getIncomingId());\n\n\t\t\t// Metric 3 - Without Leader Timer\n\t\t\tnode.networkEvaluation.setEndWithoutLeaderTimer();\n\t\t\tnode.networkEvaluation.getWithoutLeaderTimer();\n\n\t\t\t// send \"special \"Leader message to all neighbours except one that passed the\n\t\t\t// info to me\n\t\t\tIterator<Integer> i = node.getNeighbors().iterator();\n\n\t\t\tHashSet<Integer> toSend = new HashSet<Integer>();\n\t\t\twhile (i.hasNext()) {\n\t\t\t\tInteger temp = i.next();\n\t\t\t\tif (temp != infoMessage.getIncomingId()) {\n\t\t\t\t\ttoSend.add(temp);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// If I have no neighbours except node I exchanged info messages with, no need\n\t\t\t// to send leader messages\n\t\t\tif (!(toSend.isEmpty())) {\n\n\t\t\t\tif (DEBUG)\n\t\t\t\t\tSystem.out.println(\"INFO HANDLER: 2) Sending special leader to all nodes.\");\n\n\t\t\t\tsendMessage(logic.MessageType.LEADER_SPECIAL, toSend);\n\t\t\t}\n\t\t\treturn;\n\n\t\t} else if ((infoMessage.getStoredValue() == node.getLeaderValue()) // Prevents infinite message passing\n\t\t\t\t&& (infoMessage.getLeaderId() == node.getLeaderID())) {\n\t\t\tif (DEBUG)\n\t\t\t\tSystem.out.println(\"INFO HANDLER: 3) Same Leader! Agreement Reached.\");\n\n\t\t\t// End to Exchanging Leaders Timer && Processing\n\t\t\tnode.networkEvaluation.setEndExchangingLeadersTimer(infoMessage.getIncomingId());\n\t\t\tnode.networkEvaluation.getExchangingLeaderTimer(infoMessage.getIncomingId());\n\n\t\t\t// Metric 3 - Without Leader Timer\n\t\t\tnode.networkEvaluation.setEndWithoutLeaderTimer();\n\t\t\tnode.networkEvaluation.getWithoutLeaderTimer();\n\n\t\t\treturn;\n\t\t}\n\n\t\t// If not, send a message back saying that the other node should send the leader\n\t\t// message instead with my leader\n\t\telse {\n\n\t\t\tif (DEBUG)\n\t\t\t\tSystem.out.println(\"INFO HANDLER: 4) Sending back stronger leader.\\n-----------------------------\");\n\n\t\t\tsendMessage(logic.MessageType.INFO, infoMessage.getIncomingId());\n\n\t\t}\n\t}", "@Override\n public void replicationFinished()\n {\n MyMessage dummyMessage = new MyMessage(this);\n registration().getQueue().enqueue(dummyMessage);\n registration().getQueue().dequeue();\n examination().getQueue().enqueue(dummyMessage);\n examination().getQueue().dequeue();\n vaccination().getQueue().enqueue(dummyMessage);\n vaccination().getQueue().dequeue();\n syringes().getQueue().enqueue(dummyMessage);\n syringes().getQueue().dequeue();\n //End of dummy message\n \n getFinishTime().addSample(currentTime());\n \n getCoolingLengths().addSample(currentTime() - 32400);\n getArrivals().addSample(enviroment().getArrivals());\n getDepartures().addSample(enviroment().getDepartures());\n\n getRegistrationWaitings().addSample(registration().getWaitingStat().mean());\n getExaminationWaitings().addSample(examination().getWaitingStat().mean());\n getVaccinationWaitings().addSample(vaccination().getWaitingStat().mean());\n\n getRegistrationQueueLengths().addSample(registration().getQueueStat().mean());\n getExaminationQueueLengths().addSample(examination().getQueueStat().mean());\n getVaccinationQueueLengths().addSample(vaccination().getQueueStat().mean());\n\n double efficiency = 0.0;\n for (Staff personal : registration().getPersonal()) {\n efficiency += (personal.getWorkingTime() / (currentTime() - (personal.getLunchEnd() - personal.getLunchStart())));\n }\n getRegistrationEfficiency().addSample(efficiency / registration().getPersonal().size());\n\n efficiency = 0.0;\n for (Staff personal : examination().getPersonal()) {\n efficiency += (personal.getWorkingTime() / (currentTime() - (personal.getLunchEnd() - personal.getLunchStart())));\n }\n getExaminationEfficiency().addSample(efficiency / examination().getPersonal().size());\n\n efficiency = 0.0;\n for (Staff personal : vaccination().getPersonal()) {\n efficiency += (personal.getWorkingTime() / (currentTime() - (personal.getLunchEnd() - personal.getLunchStart())));\n }\n getVaccinationEfficiency().addSample(efficiency / vaccination().getPersonal().size());\n\n getWaitingRoomFilling().addSample(waitingRoom().getFillingStat().mean());\n\n getRefillWaitings().addSample(syringes().getWaitingStat().mean());\n getRefillQueueLengths().addSample(syringes().getQueueStat().mean());\n \n getLunchLengths().addSample(canteen().getLunchLengthStat().mean());\n \n super.replicationFinished();\n }", "@Override\n public void onDrainComplete()\n {\n }", "public synchronized void finishWriting() {\n readerNumber++; // readerNumber = -1 + 1 = 0; \n// readerNumber must be 0 at this point \n this.notifyAll(); // notify possible waiting writers or waiting readers \n }" ]
[ "0.6145992", "0.5997915", "0.5944188", "0.5824153", "0.56173486", "0.56109035", "0.5610606", "0.5528223", "0.5521151", "0.54673123", "0.5466463", "0.5464651", "0.5456202", "0.54548746", "0.5431519", "0.53670305", "0.536347", "0.53591603", "0.53545535", "0.5354191", "0.5322094", "0.5309683", "0.5302323", "0.5301362", "0.5301362", "0.5301362", "0.5301362", "0.5293325", "0.528003", "0.52536714", "0.523569", "0.52197194", "0.52111024", "0.5195814", "0.5187291", "0.5185798", "0.51731956", "0.5172466", "0.5145891", "0.5138215", "0.51243824", "0.5121092", "0.511178", "0.51102763", "0.51077086", "0.50743145", "0.5053683", "0.50521237", "0.50477326", "0.5047437", "0.5044416", "0.50431603", "0.50415087", "0.5030805", "0.50286925", "0.5024449", "0.50241953", "0.5008477", "0.49944314", "0.49851692", "0.4977889", "0.49753758", "0.49748915", "0.49609756", "0.49581626", "0.49572027", "0.4955321", "0.49523965", "0.4946759", "0.49464908", "0.49440366", "0.49427852", "0.49385214", "0.49369517", "0.49243847", "0.49243182", "0.49222174", "0.49192378", "0.49175298", "0.4915171", "0.49086854", "0.49044478", "0.49022835", "0.48995927", "0.48972398", "0.48942325", "0.4893616", "0.48929462", "0.4892693", "0.48838916", "0.48685813", "0.48601034", "0.48600817", "0.48541865", "0.4854026", "0.4854026", "0.48538816", "0.48527473", "0.48521662", "0.48508537" ]
0.6573353
0
called on "have" message receive, marks correspondent piece as available on peer side
void onHave(int index) { // in correct piece we must have correct block #0 boolean correct = torrent.validateBlock(index, 0, 0); if (!correct) { close(Peer.CloseReason.PROTOCOL_ERROR); return; } peerPieces.set(index); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void onInterested(boolean state)\n {\n peerInterested = state;\n\n if (!peerInterested) {\n // remove all piece if enqueued,\n // most likely will not happen\n for (int i = sendQueue.size() - 1; 0 <= i; i--) {\n StdPeerMessage pm = sendQueue.get(i);\n if (pm.type == StdPeerMessage.PIECE) {\n sendQueue.remove(i);\n TorrentStorage.Block block = (TorrentStorage.Block) pm.params;\n block.release();\n pmCache.release(pm);\n }\n }\n }\n }", "public void msgReadyForParts()\n\t{\n\t\tprint(\"Gantry: Feeder ready for party\");\n\t\tgantry_events.add(GantryEvents.FeederReadyForBin);\n\t//\tlog.add(new LoggedEvent(\"msgReadyForParts received from Feeder\"));\n\t\tstateChanged();\n\t}", "private void sendHave(int pieceNumber) {\n\t\t//fo\n\t\tfinal ArrayList peer_transports = peer_transports_cow;\n\n\t\tfor (int i = 0; i < peer_transports.size(); i++) {\n\t\t\t//get a peer connection\n\t\t\tfinal PEPeerTransport pc = (PEPeerTransport) peer_transports.get(i);\n\t\t\t//send the have message\n\t\t\tpc.sendHave(pieceNumber);\n\t\t}\n\n\t}", "@Test\n\tpublic void testFastPieceMessageUnrequested() throws Exception {\n\n\t\t// Given\n\t\tfinal PieceDatabase pieceDatabase = MockPieceDatabase.create (\"0\", 16384);\n\t\tpieceDatabase.start (true);\n\t\tPeerServices peerServices = mock (PeerServices.class);\n\t\tPeerSetContext peerSetContext = new PeerSetContext (peerServices, pieceDatabase, mock (RequestManager.class), null);\n\t\twhen(peerSetContext.requestManager.piecesAvailable (any (ManageablePeer.class))).thenReturn (true);\n\t\twhen(peerSetContext.requestManager.allocateRequests (any (ManageablePeer.class), anyInt(), eq (false))).thenReturn (new ArrayList<BlockDescriptor>());\n\t\tMockConnection mockConnection = new MockConnection();\n\t\tPeerHandler handler = new PeerHandler (peerSetContext, mockConnection, new PeerID(), new PeerStatistics(), true, false);\n\t\tBlockDescriptor requestDescriptor = new BlockDescriptor (0, 0, 16384);\n\n\t\t// When\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveAllMessage());\n\t\thandler.connectionReady (mockConnection, true, true);\n\t\tmockConnection.mockInput (PeerProtocolBuilder.pieceMessage (requestDescriptor, ByteBuffer.allocate (16384)));\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.haveNoneMessage());\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.interestedMessage());\n\t\tmockConnection.mockExpectNoMoreOutput();\n\t\tverify(peerServices).peerDisconnected (any (ManageablePeer.class));\n\t\tassertFalse (mockConnection.isOpen());\n\n\n\t\tpieceDatabase.terminate (true);\n\n\t}", "protected abstract boolean systemReadyToHandleReceivedMessage();", "public void broadcastHave(int pieceIndex) {\n\t\tMessageHave have = new MessageHave(pieceIndex);\n\t\tdownloadedBytes -= files.getPiece(pieceIndex).getSize();\n\t\tfiles.havePiece(pieceIndex);\n\t\tfor (int i = 0; i < peers.size(); i++) {\n\t\t\tPeer p = peers.get(i);\n\t\t\tif (!p.closed() && p.getPassedHandshake()) {\n\t\t\t\tp.addToQueue(have);\n\t\t\t}\n\t\t}\n\t}", "@Override\n public boolean messagePending() {\n return commReceiver.messagePending();\n }", "public void blockingReceiveSenderSide() throws OOBException {\n \t}", "private void updatePeers() {\n\t\tif (files == null)\n\t\t\treturn;\n\t\tArrayList<Piece> neededPieces = files.getNeededPieces();\n\t\tfor (int i = 0; i < peers.size(); i++) {\n\t\t\tPeer p = peers.get(i);\n\t\t\tboolean hasNoPieces = true;\n\t\t\tfor (int j = 0; j < neededPieces.size(); j++) {\n\t\t\t\tif (p.getClient().getBitfield().hasPiece(neededPieces.get(j).getIndex())) {\n\t\t\t\t\thasNoPieces = false;\n\t\t\t\t\tif (!p.getClient().isInterested()) {\n\t\t\t\t\t\tp.addToQueue(new MessageInterested());\n\t\t\t\t\t\tp.getClient().interested();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (hasNoPieces && p.getClient().isInterested()) {\n\t\t\t\tp.addToQueue(new MessageUninterested());\n\t\t\t\tp.getClient().uninterested();\n\t\t\t}\n\t\t\tif (p.getMyClient().isInterested() && p.getClient().isChoked()) {\n\t\t\t\tp.addToQueue(new MessageUnchoke());\n\t\t\t\tp.getClient().unchoke();\n\t\t\t} else if (!p.getMyClient().isInterested() && !p.getClient().isChoked()) {\n\t\t\t\tp.addToQueue(new MessageChoke());\n\t\t\t\tp.getClient().choke();\n\t\t\t}\n\t\t}\n\t}", "boolean notifyWhenReady(int playerNr);", "@Override\n\t\t\t\tpublic void isComposingReceived(LinphoneCore lc, LinphoneChatRoom cr) {\n\t\t\t\t\t\n\t\t\t\t}", "private boolean partAvailable(Piece piece) {\n boolean temp = false;\r\n try {\r\n temp = repairAreaInt.partAvailable(piece, id);\r\n } catch (RemoteException e) {\r\n System.err.println(\"Excepção na invocação remota de método\" + getName() + \": \" + e.getMessage() + \"!\");\r\n System.exit(1);\r\n }\r\n return temp;\r\n }", "public synchronized void makeAvailable(){\n isBusy = false;\n }", "public void beforeReceive() {\n\t}", "public void makeAvailable() {\n\t\tavailable = true;\n\t}", "@Override\n public void run() {\n List<Integer> list = new ArrayList<Integer>();\n int num_peer = P.peer_port.length;\n int ind = -1;\n while (P.choke_thread_running) {\n synchronized (P.lock_current_neighbors) { //lock the object\n for (int i = 0; i < num_peer; i++) {\n list.add(i);\n }\n //select randomly.\n java.util.Collections.shuffle(list);\n int[] cn = P.current_neighbors.clone();\n Arrays.sort(cn);\n for (int i = 0; i < num_peer; i++) {\n int ind2 = list.get(i);\n if (P.is_interested[ind2] && Arrays.binarySearch(cn, P.peer_id[ind2]) < 0 && P.peer_id[ind2] != P.id && P.sockets[ind2]!=null) {\n ind = ind2;\n P.current_neighbors[P.current_neighbors.length - 1] = P.peer_id[ind];\n break;\n }\n\n }\n }\n //send unchoke message.\n Message msg = new Message();\n msg.length = 0; //no payload.\n msg.type = 1; //unchoke.\n msg.payload = null; //no payload.\n \n if (ind >= 0) //there is someone interested in my data.\n {\n P.send(P.peer_id[ind], msg);\n P.print(\"OptChoke unchoked peer with id \" + P.peer_id[ind]);\n }\n ind = -1;\n //print debugging info.\n \n //sleep some interval.\n try {\n Thread.sleep(1000 * P.optimistic_unchoking_interval);\n } catch (InterruptedException ex) {\n Thread.currentThread().interrupt();\n }\n }\n }", "boolean hasReceived();", "public synchronized void setReceived() {\n\t\t_received = true;\n\t\tthis.notifyAll();\n\t}", "public void waitingForPartner();", "private void onReceiveMessage(Edge edgeItoJ) throws FactorException {\n\t\t\tSystem.out.printf(\"%s receiving message from %s, upward? %s\\n\", this.toString(), edgeItoJ.getOtherVertex(this), _bumpOnUpwardPass);\n\t\t\tif(!_neighborEdges.containsKey(edgeItoJ)) {\n\t\t\t\tSystem.err.println(\"hello check\");\n\t\t\t}\n\t\t\t_neighborEdges.put(edgeItoJ, true);\n\t\t\tcomputeBeliefIfReady();\n\t\t}", "void onChoke(boolean state)\n {\n peerChoke = state;\n //if (DEBUG) System.out.println(peer.address + \" onChoke: \" + state);\n\n if (peerChoke) {\n // remove all enqueued requests as they will be dropped by the remote peer\n for (int i = sendQueue.size() - 1; 0 <= i; i--) {\n StdPeerMessage pm = sendQueue.get(i);\n if (pm.type == StdPeerMessage.REQUEST) {\n sendQueue.remove(i);\n // notify torrent about cancelled request\n torrent.cancelBlockRequest(pm.index, pm.begin);\n pmCache.release(pm);\n }\n }\n // it's possible that we have requests that were already sent to external peer,\n // notify torrent - they are cancelled too [who knows, maybe data will arrive]\n for (int i = 0; i < blockRequests.size(); i++) {\n StdPeerMessage pm = blockRequests.get(i);\n torrent.cancelBlockRequest(pm.index, pm.begin);\n pmCache.release(pm);\n }\n blockRequests.clear();\n }\n }", "@Override\n \t\t\tpublic void run ()\n \t\t\t{\n \t\t\t\tsynchronized ( heard )\n \t\t\t\t{\n \t\t\t\t\theard.clear ();\n \t\t\t\t}\n \t\t\t\t// re-transmit own until not in a block\n \t\t\t\tsynchronized ( own )\n \t\t\t\t{\n \t\t\t\t\tif ( !own.isEmpty () )\n \t\t\t\t\t{\n \t\t\t\t\t\tfor ( BitcoinPeer peer : network.getConnectPeers () )\n \t\t\t\t\t\t{\n \t\t\t\t\t\t\tInvMessage tm = (InvMessage) peer.createMessage (\"inv\");\n \t\t\t\t\t\t\tfor ( Tx t : own )\n \t\t\t\t\t\t\t{\n \t\t\t\t\t\t\t\tlog.debug (\"Re-broadcast \" + t.getHash ());\n \t\t\t\t\t\t\t\ttm.getTransactionHashes ().add (new Hash (t.getHash ()).toByteArray ());\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\tpeer.send (tm);\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}", "private void offer() {\n\t\t\t\n\t\t}", "@Test\n\tpublic void testFastSuggestPieceMessage() throws Exception {\n\n\t\t// Given\n\t\tfinal PieceDatabase pieceDatabase = MockPieceDatabase.create (\"00000\", 16384);\n\t\tpieceDatabase.start (true);\n\t\tfinal BlockDescriptor requestDescriptor = new BlockDescriptor (2, 0, 16384);\n\t\tPeerServices peerServices = mock (PeerServices.class);\n\t\tPeerSetContext peerSetContext = new PeerSetContext (peerServices, pieceDatabase, mock (RequestManager.class), null);\n\t\twhen(peerSetContext.requestManager.piecesAvailable (any (ManageablePeer.class))).thenReturn (true);\n\t\twhen(peerSetContext.requestManager.allocateRequests (any (ManageablePeer.class), anyInt(), eq (true))).thenReturn (new ArrayList<BlockDescriptor>());\n\t\twhen(peerSetContext.requestManager.allocateRequests (any (ManageablePeer.class), anyInt(), eq (false))).thenReturn (Arrays.asList (new BlockDescriptor[] { requestDescriptor }));\n\t\tMockConnection mockConnection = new MockConnection();\n\t\tPeerHandler handler = new PeerHandler (peerSetContext, mockConnection, new PeerID(), new PeerStatistics(), true, false);\n\n\t\t// When\n\t\t// They suggest a piece and unchoke\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveAllMessage());\n\t\tmockConnection.mockInput (PeerProtocolBuilder.suggestPieceMessage (2));\n\t\tmockConnection.mockInput (PeerProtocolBuilder.unchokeMessage());\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.haveNoneMessage());\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.interestedMessage());\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.requestMessage (requestDescriptor));\n\t\tmockConnection.mockExpectNoMoreOutput();\n\t\tverify(peerSetContext.requestManager).pieceSuggested (handler, 2);\n\t\tassertTrue (mockConnection.isOpen());\n\n\n\t\tpieceDatabase.terminate (true);\n\n\t}", "public void afterReceive() {\n\t}", "public void takeAvailable() {\n\t\tavailable = false;\n\t}", "private List<Identifier> determineAdapters(Message msg, PeerInfo newPeerInfo){\r\n\t\t\r\n\t\tif (peerToAdaptersMappings.size() > MAP_SIZE_LIMIT) peerToAdaptersMappings.clear();\r\n\t\t\r\n\t\tif (peerToAdaptersMappings.containsKey(newPeerInfo)){ //uses just peer id comparison here. \r\n\t\t\t//this is a known recipient\r\n\t\t\t//However, we still need to check if the available list of adapters (routing list) is valid.\r\n\t\t\t\r\n\t\t\tPair<List<Identifier>, PeerInfo> p;\r\n\t\t\tp = peerToAdaptersMappings.get(newPeerInfo);\r\n\t\t\t\r\n\t\t\tint i = 1;\r\n\t\t\twhile (p == null && i<4) { //this can happen if another thread flushed the entry in the meantime. That same thread should also update the value, though\r\n\t\t\t\ttry {\r\n\t\t\t\t\tThread.sleep(i*20);\r\n\t\t\t\t} catch (InterruptedException ignored) {}\r\n\t\t\t\tp = peerToAdaptersMappings.get(newPeerInfo);\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (i >= 4 && p == null){\r\n\t\t\t\t//the other thread obviously did not do the job yet. We will take care of it in the rest of the method.\r\n\t\t\t}else{\r\n\t\t\t\tPeerInfo oldPeerInfo = p.second;\r\n\t\t\t\tif (newPeerInfo.equalsByDeepCoparison(oldPeerInfo)){\r\n\t\t\t\t\treturn p.first; //return the existing list of adapters, since nothing changed in the PeerInfo from last time\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} \r\n\t\t\r\n\t\t// if we arrived here it means, either:\r\n\t\t// sending message to this peer for the first time \r\n\t\t// OR\r\n\t\t// the information we have is outdated, so let's update it\r\n\t\t\r\n\r\n\t\tList<Identifier> adapters = adapterMgr.createEndpointForPeer(newPeerInfo); //need not be synced, since invoking createEndpointForPeer multiple times should be fine\r\n\t\tPair<List<Identifier>, PeerInfo> p = new Pair<List<Identifier>, PeerInfo>(adapters, newPeerInfo);\r\n\t\t\r\n\t\tsynchronized(peerToAdaptersMappings){ //just using ConcurrentHashMap is not enough, because we need to save the reference to the map's key in the second object of the Pair, which is the object of the map, and if 2 thread repeat put, the value will get updated, but that value will contain the wrong reference to the key, meaning that subsequently the deep comparison between the old and the new PeerInfo object will not be possible\r\n\t\t\tpeerToAdaptersMappings.remove(newPeerInfo); //in reality, we remove an existing entry, if any. Since the PeerInfo.equals just compares Ids, it should locate the exact entry.\r\n\t\t\tpeerToAdaptersMappings.put(newPeerInfo, p); //we now put in the new value, which is a Pair, whose second element points to the key of the entry in the peerToAdaptersMappings where the Pair value belongs\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t// Now we have the list of all possible Adapters trough which we can deliver the message to the peer.\r\n\t\t// However, depending on peer's stated delivery policy we may want to restrict this list.\r\n\t\t// For example, in case of DeliveryPolicy.PREFERRED, we will just return the first Adapter.\r\n\t\t// But, in case of either TO_ALL_CHANNELS or AT_LEAST_ONE, we return all adapters, because in either case\r\n\t\t// the policy foresees sending to multiple adapters, but interpreting responses from all/one channel as ultimate success, respectively. \r\n\t\t\r\n\t\t\r\n\t\tif (newPeerInfo.getDeliveryPolicy() == DeliveryPolicy.Peer.PREFERRED){\r\n\t\t\tIdentifier preferred = adapters.get(0);\r\n\t\t\tList<Identifier> prefList = new ArrayList<Identifier>();\r\n\t\t\tprefList.add(preferred);\r\n\t\t\treturn prefList;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn adapters;\r\n\t}", "private void push() {\n ImmutableSortedSet<T> myAvailable = _outstanding.apply(\n new Syncd.Transformer<ImmutableSortedSet<T>, ImmutableSortedSet<T>>() {\n public Tuple<ImmutableSortedSet<T>, ImmutableSortedSet<T>> apply(ImmutableSortedSet<T> aBefore) {\n final SortedSet<T> myRemaining = new TreeSet<>(new MessageComparator<T>());\n\n // Identify those messages that are sequentially contiguous from _floor and can be passed on\n //\n ImmutableSortedSet<T> myAccessible =\n new ImmutableSortedSet.Builder<>(new MessageComparator<T>()).addAll(\n Iterables.filter(aBefore, new Predicate<T>() {\n public boolean apply(T aMessage) {\n Long myCurrent = _floor.get();\n\n if (aMessage.getSeq() == myCurrent) {\n // This message can be sent out to listeners so long as we're first to try\n //\n if (_floor.testAndSet(myCurrent, myCurrent + 1))\n return true;\n } else\n // This message must remain\n //\n myRemaining.add(aMessage);\n\n // Couldn't send message out or it must remain\n //\n return false;\n }\n })\n ).build();\n\n return new Tuple<>(new ImmutableSortedSet.Builder<>(\n new MessageComparator<T>()).addAll(myRemaining).build(),\n myAccessible);\n }\n }\n );\n\n send(myAvailable);\n archive(myAvailable);\n }", "@Override\n protected void handshakeCompleted()\n {\n if (0 < torrent.pieces.cardinality()) {\n enqueue(pmCache.bitfield((int)torrent.metainfo.pieces, torrent.pieces));\n }\n\n /*\n todo\n if (client.node != null) {\n pc.enqueue(StdPeerMessage.port(client.node.port));\n }\n */\n }", "@Override\n public void run() {\n List<Integer> list = new ArrayList<Integer>();\n int num_peer = P.peer_port.length;\n int ind = -1;\n for (int i = 0; i < num_peer; i++) {\n list.add(i);\n }\n while (P.choke_thread_running) {\n synchronized (P.lock_current_neighbors) { //lock the object\n\n if(P.current_neighbors==null) continue;\n\n int[] cn = P.current_neighbors.clone(); //current neighbor.\n Arrays.sort(cn);\n if (P.own_file || P.finished) { //select randomly.\n java.util.Collections.shuffle(list);\n int cnt = 0; //#peers selected.\n for (int i = 0; i < num_peer && cnt < P.num_preferred_neighbors; i++) {\n ind = list.get(i);\n if (P.is_interested[ind] && P.peer_id[ind] != P.id) {\n P.current_neighbors[cnt++] = P.peer_id[ind];\n //send unchoke message to previously choked peer.\n if (Arrays.binarySearch(cn, P.peer_id[ind]) < 0) {\n Message msg = new Message();\n msg.length = 0; //no payload.\n msg.type = 1; //unchoke.\n msg.payload = null; //no payload.\n P.send(P.peer_id[ind], msg);\n }\n }\n }\n P.print(\"Choke selected \" + cnt + \" neighbors randomly.\");\n } else { //select according to the download rates.\n int[] order = getIndices(P.download_rates);\n int cnt = 0; //#peers selected.\n for (int i = 0; i < num_peer && cnt < P.num_preferred_neighbors; i++) {\n ind = order[i];\n if (P.is_interested[ind] && P.peer_id[ind] != P.id) {\n P.current_neighbors[cnt++] = P.peer_id[ind];\n //send unchoke message to previously choked peer.\n if (Arrays.binarySearch(cn, P.peer_id[ind]) < 0) {\n Message msg = new Message();\n msg.length = 0; //no payload.\n msg.type = 1; //unchoke.\n msg.payload = null; //no payload.\n P.send(P.peer_id[ind], msg);\n }\n }\n }\n //print debugging info.\n P.print(\"Choke selected \" + cnt + \" neighbors according to download rates.\");\n }\n //send choke message to peers previously unchoked but currently choked.\n Arrays.sort(Arrays.copyOfRange(P.current_neighbors, 0, P.num_preferred_neighbors - 1));\n for (int i = 0; i < P.num_preferred_neighbors; i++) {\n if (Arrays.binarySearch(P.current_neighbors, cn[i]) < 0) { //cn[i] not in current neighbor list.\n Message msg = new Message();\n msg.length = 0; //no payload.\n msg.type = 0; //choke.\n msg.payload = null; //no payload.\n P.send(P.peer_id[ind], msg);\n }\n }\n }\n //sleep some interval.\n try {\n Thread.sleep(1000 * P.unchoking_internal);\n } catch (InterruptedException ex) {\n Thread.currentThread().interrupt();\n }\n }\n }", "@Override\n\t\t\t\tpublic void notifyPresenceReceived(LinphoneCore lc, LinphoneFriend lf) {\n\t\t\t\t\t\n\t\t\t\t}", "@Override\n public void messageArrived(IChatMessage msg) {\n try { \n if (msg.getText().matches(\"JOIN .*\")) {\n //Obtenir el canal on s'ha unit.\n IChatChannel channel = server.getChannel(conf.getChannelName()); \n //Crear el missatge per a donar la benvinguda al usuari\n IChatMessage message = new ChatMessage(user, channel,\n \"Benvingut, \" + msg.getText().substring(ChatChannel.JOIN.length() + 1));\n //Enviar el missatge\n channel.sendMessage(message);\n }\n } catch (RemoteException e) {\n \n }\n }", "public void markAvailable() {\n CompletableFuture<?> toNotify = null;\n synchronized (this) {\n if (!availableFuture.isDone()) {\n toNotify = availableFuture;\n }\n }\n if (toNotify != null) {\n toNotify.complete(null);\n }\n }", "@Override\n public void messageReceived(ChannelHandlerContext ctx, MessageEvent e) {\n Channel ch = ctx.getChannel();\n //Player player = (Player) ch.getAttachment();\n Client client = (Client) ch.getAttachment();\n \n if (ch.isConnected()) { // && !client.getPlayer().destroyed() \n RSCPacket packet = (RSCPacket) e.getMessage();\n //player.addPacket(p); // Used to log packets for macro detection\n //engine.addPacket(p); // This one actually results in the packet being processed!\n client.pushToMessageQueue(packet);\n }\n }", "public void notifyPlayer(CardGraphics card){\n\t\tchosenCard = card.getCard();\n\t\t\n\t\tsynchronized(lock){\n\t\t\tlock.notify();\n\t\t}\n\t}", "@Override\n\tpublic void onSendPrivateChatDone(byte result) {\n\t\tif(WarpResponseResultCode.SUCCESS==result){\n\t\t\tLog.d(\"Receiver\", \"He is Online\");\n\t\t\tChatActivity.this.runOnUiThread(new Runnable() {\n\t\t\t\t public void run() {\n\t\t\t\t\t sa = ((SharingAtts)getApplication());\n\t\t\t\t\t ItemTest it = new ItemTest();\n\t\t\t\t\t String colNames = it.printData(\"chat\")[1];\n\t\t\t\t\t DBManager dbm = new DBManager(ChatActivity.this, colNames,\"chat\",it.printData(\"chat\")[0]);\n\t\t\t\t\t dbm.openToWrite();\n\t\t\t\t\t dbm.cretTable();\n\t\t\t\t\t msg = msg.replace(\" \", \"?*\");\n\t\t\t\t\t dbm.insertQuery(sa.name+\" \"+msg+\" \"+challenged, colNames.split(\" \")[1]+\" \"+colNames.split(\" \")[2]+\" \"+colNames.split(\" \")[3]);\n\t\t\t\t\t dbm.close();\n\t\t\n\t\t\t\t }\n\t\t\t});\n\t\t\t\n\t\t\t\n\t\t}else{\n\t\t\tChatActivity.this.runOnUiThread(new Runnable() {\n\t\t\t\t public void run() {\n\t\t\t\t\t Toast.makeText(ChatActivity.this, \"Receiver is offline. Come back later\", Toast.LENGTH_SHORT).show();\t\n\t\t\t\t\t \n\t\t\t\t }\n\t\t\t});\n\t\t}\n\t}", "@Override\n public void informPlaneReadyForBoarding() {\n this.lock.lock();\n try {\n // update pilot state\n this.repository.updatePilotState(PilotState.READY_FOR_BOARDING);\n\n // wake up hostess\n this.planeReadyForBoarding = true;\n this.hostessWaitPlaneReadyToTakeOff.signal();\n } finally {\n this.lock.unlock();\n }\n }", "@Override\n public MessageWrapper[] onMsgReceive(MSGGameStatus msg, Player sender) {\n Lobby lobby = playerLobbyMap.get(sender);\n if (lobby != null && lobby.getOwner().equals(sender)) {\n lobby.prepareGame();\n\n Message sendMsg = new MSGGameStatus(\n MSGGameStatus.GameStatus.STARTED,\n lobby.getGameSession());\n\n // send back the clients the initial game state\n return MessageWrapper.prepWraps(\n new MessageWrapper(sendMsg,\n playerLobbyMap.get(sender).getPlayers()));\n }\n\n return null;\n }", "private void processInviteToEstablishControlSocket(final Message msg) {\n final String readString = \n (String) msg.getProperty(P2PConstants.SECRET_KEY);\n final byte[] readKey = Base64.decodeBase64(readString);\n final byte[] writeKey = CommonUtils.generateKey();\n final String sdp = (String) msg.getProperty(P2PConstants.SDP);\n final ByteBuffer offer = ByteBuffer.wrap(Base64.decodeBase64(sdp));\n final String offerString = MinaUtils.toAsciiString(offer);\n log.info(\"Processing offer: {}\", offerString);\n \n final OfferAnswer offerAnswer;\n try {\n offerAnswer = this.offerAnswerFactory.createAnswerer(\n new ControlSocketOfferAnswerListener(msg.getFrom(), readKey, writeKey), false);\n }\n catch (final OfferAnswerConnectException e) {\n // This indicates we could not establish the necessary connections \n // for generating our candidates.\n log.warn(\"We could not create candidates for offer: \" + sdp, e);\n \n final Message error = newError(msg);\n xmppConnection.sendPacket(error);\n return;\n }\n final byte[] answer = offerAnswer.generateAnswer();\n final long tid = (Long) msg.getProperty(P2PConstants.TRANSACTION_ID);\n \n // TODO: This is a throwaway key here since the control socket is not\n // encrypted as of this writing.\n final Message inviteOk = newInviteOk(tid, answer, writeKey);\n final String to = msg.getFrom();\n inviteOk.setTo(to);\n log.info(\"Sending CONTROL INVITE OK to {}\", inviteOk.getTo());\n XmppUtils.goOffTheRecord(to, xmppConnection);\n xmppConnection.sendPacket(inviteOk);\n \n offerAnswer.processOffer(offer);\n log.debug(\"Done processing CONTROL XMPP INVITE!!!\");\n }", "public void msgNeedThisPart(PartInfo p, Feeder feeder)\n\t{\n\t\tMyFeeder new_feeder = new MyFeeder();\n\t\tnew_feeder.part_type = p;\n\t\tnew_feeder.feeder = feeder;\n\t\tnew_feeder.state = FeederState.NeedParts;\n\t\tfeeder_list.add(new_feeder);\n\t/*\tlog.add(new LoggedEvent(\"msgNeedThisPart sent from Feeder \" + feeder.getNumber()\n\t\t\t\t+ \" requesting part \" + p.getDescription()));*/\n\t\tstateChanged();\n\t\t\n\t}", "void process(ToSend m) {\n ByteBuffer requestBuffer = buildMsg(m.state.ordinal(), m.leader, m.zxid, m.electionEpoch, m.peerEpoch, m.configData);\n\n manager.toSend(m.sid, requestBuffer);\n\n }", "public void addNotify()\n { \n super.addNotify(); // creates the peer\n startGame(); // start the thread\n }", "@Override\n\tpublic void landedOn(Piece piece) {\n\t\t\n\t}", "boolean hasUnReceived();", "protected void enqueue(StdPeerMessage message)\n {\n// if (DEBUG) {\n// if (message.type == StdPeerMessage.REQUEST) {\n// System.out.println(System.nanoTime() + \" [stdpc] enqueue: req \" + message.index + \" \" + (message.begin >> 14));\n// } else {\n// System.out.println(\"[stdpc] enqueue: \" + message.type);\n// }\n// }\n\n if (message.type == StdPeerMessage.CHOKE)\n {\n // remove reply messages with piece (block) data\n // from the send queue (due to spec)\n for (int i = sendQueue.size() - 1; 0 <= i; i--) {\n StdPeerMessage pm = sendQueue.get(i);\n if (pm.type == StdPeerMessage.PIECE) {\n sendQueue.remove(i);\n TorrentStorage.Block block = (TorrentStorage.Block) message.params;\n block.release();\n pmCache.release(pm);\n }\n }\n // set choke status\n choke = true;\n // send choke asap\n sendQueue.add(0, message);\n }\n else if (message.type == StdPeerMessage.CANCEL)\n {\n // remove the linked request if it's still in the queue\n for (int i = sendQueue.size() - 1; 0 <= i; i--) {\n StdPeerMessage pm = sendQueue.get(i);\n if ((pm.type == StdPeerMessage.REQUEST)\n && (pm.index == message.index)\n && (pm.begin == message.begin)\n && (pm.length == message.length)) // this check is redundant as length is fixed\n {\n sendQueue.remove(i);\n pmCache.release(pm);\n // don't really enqueue CANCEL as the linked request\n // has been found and removed\n pmCache.release(message);\n return;\n }\n }\n // send asap\n sendQueue.add(0, message);\n }\n else {\n if (message.type == StdPeerMessage.INTERESTED) {\n interested = true;\n }\n else if (message.type == StdPeerMessage.NOT_INTERESTED) {\n interested = false;\n }\n else if (message.type == StdPeerMessage.UNCHOKE) {\n choke = false;\n }\n\n // enqueue message\n sendQueue.add(message);\n }\n\n// sendQueue.forEach(pm -> System.out.println(\" -x> \" + System.identityHashCode(pm) + pm.type + \" ,\" + pm.index +\",\" + pm.begin +\",\" + pm.length) );\n\n }", "@Override\n\tpublic boolean canReceive() {\n\t\treturn false;\n\t}", "@Override\n\tpublic void msgPartsLow() {\n\t\t\n\t}", "@Override\n\tpublic void visit(NotInterested ni) {\n\t\tSystem.out.println(\"peer is notInterested\");\n\t\tph.addMessageQueue(new Choke());\n\t\tph.setPeerChoked(true);\n\t\tSystem.out.println(\"peerChoked : \" + ph.getPeerChoked());\n\t}", "public static void broadcastHaveMessage(String peerID, byte[] pieceIndex){\n for (RemotePeerInfo peer : Constants.listOfAllPeers) {\n if(!peer.peerID.equals(peerID)){\n try {\n Message msg = new Message(1 + pieceIndex.length, 4, pieceIndex);\n byte[] msgByteArray = msg.createMessage();\n utilities.writeToOutputStream(peer.out, msgByteArray);\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n }\n }", "@Override\n\tpublic void msgReceived(Message msg) {\n\n\t}", "@Test\n\tpublic void testFastSetWeAreChoking() throws Exception {\n\n\t\t// Given\n\t\tPieceDatabase pieceDatabase = MockPieceDatabase.create (\"111111111111111\", 16384);\n\t\tpieceDatabase.start (true);\n\t\tBitField wantedPieces = pieceDatabase.getPresentPieces().not();\n\t\tPeerServices peerServices = mock (PeerServices.class);\n\t\tPeerSetContext peerSetContext = new PeerSetContext (peerServices, pieceDatabase, mock (RequestManager.class), null);\n\t\twhen(peerSetContext.requestManager.piecesAvailable (any (ManageablePeer.class))).thenReturn (false);\n\t\tMockConnection mockConnection = new MockConnection();\n\t\tPeerHandler handler = new PeerHandler (peerSetContext, mockConnection, new PeerID(), new PeerStatistics(), true, false);\n\n\t\t// When\n\t\tmockConnection.mockInput (PeerProtocolBuilder.bitfieldMessage (wantedPieces));\n\t\tmockConnection.mockInput (PeerProtocolBuilder.unchokeMessage());\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.haveAllMessage());\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (1));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (2));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (3));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (4));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (6));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (9));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (10));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (12));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (13));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (14));\n\t\tmockConnection.mockExpectNoMoreOutput();\n\n\t\t// When\n\t\t// The remote peer requests a block\n\t\thandler.setWeAreChoking (false);\n\t\tBlockDescriptor sentRequest = new BlockDescriptor (0, 0, 16384); // Not an Allowed Fast piece\n\t\tmockConnection.mockInput (PeerProtocolBuilder.requestMessage (sentRequest));\n\t\thandler.connectionReady (mockConnection, true, false);\n\n\t\t// Then\n\t\tassertFalse (handler.getPeerState().getWeAreChoking());\n\n\t\t// When\n\t\t// We discard the request by choking them\n\t\thandler.setWeAreChoking (true);\n\t\thandler.connectionReady (mockConnection, false, true);\n\n\t\t// Then\n\t\t// Because the Fast extension is enabled, we must send an explicit reject for their request\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.unchokeMessage());\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.chokeMessage());\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.rejectRequestMessage (sentRequest));\n\t\tmockConnection.mockExpectNoMoreOutput();\n\t\tassertTrue (handler.getPeerState().getWeAreChoking());\n\t\tassertFalse (handler.getTheyHaveOutstandingRequests());\n\n\n\t\tpieceDatabase.terminate (true);\n\n\t}", "@Test\n\tpublic void testFastRequestMessageChokedNotAllowedFast() throws Exception {\n\n\t\t// Given\n\t\tfinal PieceDatabase pieceDatabase = MockPieceDatabase.create (\"111111111111111\", 16384);\n\t\tpieceDatabase.start (true);\n\t\tPeerServices peerServices = mock (PeerServices.class);\n\t\tPeerSetContext peerSetContext = new PeerSetContext (peerServices, pieceDatabase, mock (RequestManager.class), null);\n\t\tMockConnection mockConnection = new MockConnection();\n\t\tPeerHandler handler = new PeerHandler (peerSetContext, mockConnection, new PeerID(), new PeerStatistics(), true, false);\n\t\tBlockDescriptor requestDescriptor = new BlockDescriptor (0, 0, 16384);\n\n\t\t// WHen\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveNoneMessage());\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.haveAllMessage());\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (1));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (2));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (3));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (4));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (6));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (9));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (10));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (12));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (13));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (14));\n\t\tmockConnection.mockExpectNoMoreOutput();\n\n\t\t// When\n\t\t// They request a non Allowed Fast piece while choked\n\t\tmockConnection.mockInput (PeerProtocolBuilder.requestMessage (requestDescriptor));\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.rejectRequestMessage (requestDescriptor));\n\t\tmockConnection.mockExpectNoMoreOutput();\n\t\tassertTrue (mockConnection.isOpen());\n\n\n\t\tpieceDatabase.terminate (true);\n\n\t}", "@Test\n\tpublic void testFastRequestMessageChokedAllowedFastOverLimit() throws Exception {\n\n\t\t// Given\n\t\tfinal PieceDatabase pieceDatabase = MockPieceDatabase.create (\"111111111111111\", 16384);\n\t\tpieceDatabase.start (true);\n\t\tPeerServices peerServices = mock (PeerServices.class);\n\t\tPeerSetContext peerSetContext = new PeerSetContext (peerServices, pieceDatabase, mock (RequestManager.class), null);\n\t\tMockConnection mockConnection = new MockConnection();\n\t\tPeerHandler handler = new PeerHandler (peerSetContext, mockConnection, new PeerID(), new PeerStatistics(), true, false);\n\t\tBlockDescriptor request = new BlockDescriptor (14, 0, 16384);\n\n\t\t// When\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveNoneMessage());\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.haveAllMessage());\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (1));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (2));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (3));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (4));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (6));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (9));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (10));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (12));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (13));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (14));\n\t\tmockConnection.mockExpectNoMoreOutput();\n\n\t\t// When\n\t\t// They request an Allowed Fast piece while choked but over the allowed piece count\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveMessage (0));\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveMessage (1));\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveMessage (2));\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveMessage (3));\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveMessage (4));\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveMessage (5));\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveMessage (6));\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveMessage (7));\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveMessage (8));\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveMessage (9));\n\t\tmockConnection.mockInput (PeerProtocolBuilder.requestMessage (request));\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.rejectRequestMessage (request));\n\t\tmockConnection.mockExpectNoMoreOutput();\n\t\tassertTrue (mockConnection.isOpen());\n\n\n\t\tpieceDatabase.terminate (true);\n\n\t}", "@Override\n\tprotected void doReceiveMessage(Message msg) {\n\t\tdeliverMessage(msg);\n\t}", "protected void processPlayerArrived(String name) {\n Player player = tournamentService.findPlayer(name);\n if (player == null) {\n alertManagers(\"Arriving player {0} is on my notify list, but I don''t have him in the tournament roster.\", name);\n return;\n }\n player.setState(PlayerState.WAITING);\n Game game = tournamentService.findPlayerGame(player);\n if (game == null) return;\n if (game.status.isFinished()) return;\n if (loggingIn) {\n \tcommand.sendCommand(\"observe {0}\", name);\n } else {\n tellManagers(\"{0} arrived. Reserving board {1}.\", name, game.boardNumber);\n }\n command.sendAdminCommand(\"spoof {0} tell JudgeBot nowin\", game.whitePlayer);\n command.sendAdminCommand(\"spoof {0} tell JudgeBot nowin\", game.blackPlayer);\n command.sendAdminCommand(\"set-other {0} kib 0\", game.blackPlayer);\n command.sendAdminCommand(\"set-other {0} kib 0\", game.whitePlayer);\n command.sendAdminCommand(\"reserve-game {0} {1}\", game.whitePlayer, game.boardNumber);\n command.sendAdminCommand(\"reserve-game {0} {1}\", game.blackPlayer, game.boardNumber);\n if (game.status.isAdjourned()) {\n command.sendAdminCommand(\"spoof {0} match {1}\", game.whitePlayer, game.blackPlayer);\n command.sendAdminCommand(\"spoof {0} match {1}\", game.blackPlayer, game.whitePlayer);\n }\n }", "private Message onPingMessageReceived(PingMessage m, DecentSocket origin) {\n\t\treturn null;\n\t}", "@Override\n\tpublic void notifyPresenceReceived(LinphoneCore lc, LinphoneFriend lf) {\n\t\t\n\t}", "private void manageConnectedSocket(BluetoothSocket acceptSocket) {\n\n }", "void enforceCollectiveDeliveryPolicy(Message msg){ \r\n\t\t//from the message obtained from msg.getRefersTo() get the message id, while from msg.getSenderId() we get the sender to look up the entry in the data structure\r\n\t\ttry{\r\n\t\t\tboolean policySucceeded = checkCollectiveDeliveryPolicy(msg); //return true if policy conclusively succeeded, false if still valid but still not succeeded, Exception if conclusively failed. \r\n\t\t\tif (policySucceeded){ //collective policy conclusively succeeded. Purge entries from corresponding data structures.\r\n\t\t\t\t//collectiveDiscardCondition.lock(); //with the concurrent map should also work without this\r\n\t\t\t\tdiscardEntriesInPeerDeliveryPolicyDataStructure(msg.getRefersTo(), msg.getReceiverId());\r\n\t\t\t\tdiscardCollectivePolicyEntry(msg.getRefersTo(), msg.getReceiverId());\r\n\t\t\t\t//TODO if (DeliveryPolicy.Message.ACKNOWLEDGE is set for the initial message)\r\n\t\t\t\tsend(PredefinedMessageHelper.createAcknowledgeMessageFromAdaptersAcknowledgeMessage(msg)); //or send to TEE directly\r\n\t\t\t}\r\n\t\t}catch(Exception e){ //collective policy conclusively failed. Purge entries, and inform the original sender of the ERR.\r\n\t\t\t//if (!collectiveDiscardCondition.isHeldByCurrentThread()) collectiveDiscardCondition.lock();\r\n\t\t\t\r\n\t\t\tdiscardEntriesInPeerDeliveryPolicyDataStructure(msg.getRefersTo(), msg.getReceiverId());\r\n\t\t\tdiscardCollectivePolicyEntry(msg.getRefersTo(), msg.getReceiverId());\r\n\t\t\t\r\n\t\t\t//this implies that I want the broker to deliver me messages which will have: \r\n\t\t\t//sender=the actual peer that failed/succeeded, receiver: the component who originally sent the message to which they are replying to\r\n\t\t\t//plus refersTo field, containing the id of the original message - check with Philipp\r\n\t\t\tsend(PredefinedMessageHelper.createDeliveryErrorMessageFromAdaptersCommunicationErrorMessage(msg)); \r\n\t\t}finally{\r\n\t\t\t//collectiveDiscardCondition.unlock();\r\n\t\t}\r\n\r\n\t}", "private void messageReceived(Initialize initialize) {\r\n\t\tRegister register = new Register(1);\r\n\r\n\t\tlogger.debug(\"BagCheck \"+ this.lineNumber+\" sent an Initialize message to its Security.\");\r\n\t\tsecurityActor = initialize.getSecurityActor(lineNumber);\r\n\r\n\t\t//logger.debug(\"BagCheck \"+ this.lineNumber+\" sent an Initialize message to its Line \"+ this.lineNumber+ \".\");\r\n\t\tlogger.debug(\"BagCheck \"+ this.lineNumber+\" sent a Register message to its Line \"+ this.lineNumber+ \".\");\r\n\r\n\t\t//initialize.getLineActor(lineNumber).tell(initialize);\r\n\t\tinitialize.getLineActor(lineNumber).tell(register);\r\n\t}", "@Test\n\tpublic void testFastHaveAllMessage() throws Exception {\n\n\t\t// Given\n\t\tfinal PieceDatabase pieceDatabase = MockPieceDatabase.create (\"00000\", 16384);\n\t\tpieceDatabase.start (true);\n\t\tPeerServices peerServices = mock (PeerServices.class);\n\t\tPeerSetContext peerSetContext = new PeerSetContext (peerServices, pieceDatabase, mock (RequestManager.class), null);\n\t\twhen(peerSetContext.requestManager.piecesAvailable (any (ManageablePeer.class))).thenReturn (true);\n\t\twhen(peerSetContext.requestManager.allocateRequests (any (ManageablePeer.class), anyInt(), eq (false))).thenReturn (new ArrayList<BlockDescriptor>());\n\t\tMockConnection mockConnection = new MockConnection();\n\t\tPeerHandler handler = new PeerHandler (peerSetContext, mockConnection, new PeerID(), new PeerStatistics(), true, false);\n\n\t\t// When\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveAllMessage());\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.haveNoneMessage());\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.interestedMessage());\n\t\tmockConnection.mockExpectNoMoreOutput();\n\t\tassertTrue (mockConnection.isOpen());\n\t\tassertEquals (5, handler.getRemoteBitField().cardinality());\n\n\n\t\tpieceDatabase.terminate (true);\n\n\t}", "public void msgKitIsGood(AgentKit kit) {\n\t\tfor(MyKit mk: myKits){\n\t\t\tif(mk.kit.equals(kit)){\n\t\t\t\tmk.status = KitStatus.Ready_For_Delivery;\n\t\t\t\tstateChanged();\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}", "@Test\n\tpublic void testFastAllowedFastMessage() throws Exception {\n\n\t\t// Given\n\t\tfinal PieceDatabase pieceDatabase = MockPieceDatabase.create (\"00000\", 16384);\n\t\tpieceDatabase.start (true);\n\t\tfinal BlockDescriptor requestDescriptor = new BlockDescriptor (2, 0, 16384);\n\t\tPeerServices peerServices = mock (PeerServices.class);\n\t\tPeerSetContext peerSetContext = new PeerSetContext (peerServices, pieceDatabase, mock (RequestManager.class), null);\n\t\twhen(peerSetContext.requestManager.piecesAvailable (any (ManageablePeer.class))).thenReturn (true);\n\t\twhen(peerSetContext.requestManager.allocateRequests (any (ManageablePeer.class), anyInt(), eq (true)))\n\t\t\t\t.thenReturn (Arrays.asList (new BlockDescriptor[] { requestDescriptor }))\n\t\t\t\t.thenReturn (new ArrayList<BlockDescriptor>());\n\t\tMockConnection mockConnection = new MockConnection();\n\t\tPeerHandler handler = new PeerHandler (peerSetContext, mockConnection, new PeerID(), new PeerStatistics(), true, false);\n\n\t\t// When\n\t\t// They send an Allowed Fast message, allowing us to make a request while choked\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveAllMessage());\n\t\tmockConnection.mockInput (PeerProtocolBuilder.allowedFastMessage (2));\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.haveNoneMessage());\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.interestedMessage());\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.requestMessage (requestDescriptor));\n\t\tmockConnection.mockExpectNoMoreOutput();\n\t\tverify(peerSetContext.requestManager).pieceAllowedFast (handler, 2);\n\t\tassertTrue (mockConnection.isOpen());\n\n\n\t\tpieceDatabase.terminate (true);\n\n\t}", "private void connectingPeer() {\n for (int index = 0; index < this.peers.size(); index++) {\n String peerUrl = urlAdderP2PNodeName((String) this.peers.get(index));\n try {\n Node distNode = NodeFactory.getNode(peerUrl);\n P2PService peer = (P2PService) distNode.getActiveObjects(P2PService.class.getName())[0];\n \n if (!peer.equals(this.localP2pService)) {\n // Send a message to the remote peer to record me\n peer.register(this.localP2pService);\n // Add the peer in my group of acquaintances\n this.acqGroup.add(peer);\n }\n } catch (Exception e) {\n logger.debug(\"The peer at \" + peerUrl +\n \" couldn't be contacted\", e);\n }\n }\n }", "@Override\n public boolean hasMessageAvailable() {\n return !priorityQueue.isEmpty() && priorityQueue.peekN1() <= clock.millis();\n }", "private void sendReceiveRes(){\n\t}", "public void sendDirectedPresence() {\n Cursor cursor = getContentResolver().query(\n Roster.CONTENT_URI,\n new String[]{Roster.LAST_UPDATED},\n null, null, \"last_updated desc\"\n );\n if (cursor.moveToFirst()) {\n long after = cursor.getLong(\n cursor.getColumnIndex(Roster.LAST_UPDATED));\n Presence presence = new Presence(Type.available);\n presence.setTo(\"broadcaster.buddycloud.com\");\n client.sendFromAllResources(presence);\n }\n cursor.close();\n }", "private void handleReady(String[] msg, DataOutputStream os) throws IOException {\n\t\t\n\n\t\tif(msg[0] != null) {\n\t\t\t\n\t\t\tE_Direction newDirection = RoadPart.getDirectionBetweenTwoParts(entity.getFrontCell(), entity.getBackCell());\n\t\t os.writeUTF(\"ACK\"+\" \"+\"RDY\"+\" \"+\"CDR:\"+newDirection.toString()+\" \"+\"PDR:\"+getPossibleDirections());\n\t\t \n\t\t}\n\t\t\n\t\telse \n\t\t\tos.writeUTF(\"NACK\"+\" \"+\"RDY\");\n\t\t\n\t}", "public void notifyAllFriends(PresenceModel presence);", "@Ignore\n\t@Test\n\tpublic void testAgentAccepts() {\n\t\tparty.connect(connection);\n\t\tparty.notifyChange(settings);\n\n\t\tBid bid = makeBid(\"1\", \"1\");// best pssible\n\t\tparty.notifyChange(new ActionDone(new Offer(otherparty, bid)));\n\t\tparty.notifyChange(new YourTurn());\n\t\tassertEquals(1, connection.getActions().size());\n\t\tassertTrue(connection.getActions().get(0) instanceof Accept);\n\n\t}", "void firePeerDiscovered(TorrentId torrentId, Peer peer);", "@Nullable\n\t\t@Override\n\t\tpublic IMessage onMessage(final MessageLockSetLockCode message, final MessageContext ctx) {\n\t\t\tTestMod3.proxy.getThreadListener(ctx).addScheduledTask(() -> {\n\t\t\t\tfinal EntityPlayerMP player = (EntityPlayerMP) TestMod3.proxy.getPlayer(ctx);\n\t\t\t\tfinal World world = player.world;\n\n\t\t\t\tplayer.markPlayerActive();\n\n\t\t\t\tif (world.isBlockLoaded(message.pos)) {\n\t\t\t\t\tfinal ILock lock = CapabilityLock.getLock(world, message.pos, message.facing);\n\t\t\t\t\tif (lock != null) {\n\t\t\t\t\t\tif (lock.isLocked()) {\n\t\t\t\t\t\t\tplayer.sendMessage(new TextComponentTranslation(\"testmod3:lock.already_locked\"));\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlock.setLockCode(new LockCode(message.lockCode));\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\n\t\t\treturn null;\n\t\t}", "@Override\n\tpublic void channelParted(String channel) {\n\t}", "@Override\r\n\tpublic void makeDeliveryFree() {\n\t\t\r\n\t}", "public void onIceCandidateReceived(IceCandidate iceCandidate) {\n //we have received ice candidate. We can set it to the other peer.\n SignallingClient.getInstance().sendIceCandidate(iceCandidate);\n }", "private void transferCommunalPile() {\n this.roundWinner.addToDeck(communalPile);\n communalPile = new Pile();\n }", "synchronized void receiveJETON(){\n\tif(SC){\n\t\tJeton = true;\n\t}else{\n\t\tif (procId==0){\n\t\t\tSyncMessage sm = new SyncMessage(MsgType.JETON, 0, procId);\n\t\t\tsendTo(0, sm);\n\t\t}else{\n\t\t\tSyncMessage sm = new SyncMessage(MsgType.JETON, 1, procId);\n\t\t\tsendTo(1, sm);\n\t\t}\n\t}\n\tthis.notifyAll();\n\n}", "void received() throws ImsException;", "@Override\n\tpublic void onMessageRecieved(Message arg0) {\n\t\t\n\t}", "private void handleMessage(final ParentOverloaded msg) {\n if (parents.get(msg.getTreeID()) == null || !parents.get(msg.getTreeID()).equals(msg.sourceId)) {\n return;\n }\n sendUnderLoadedNeighborsOffer(msg.sourceId, msg.getTreeID());\n }", "@Override\n\tpublic void receive() {\n\t}", "@Override\n protected void connectionEstablished()\n {\n peer.resetConnectionClosed();\n\n // send our handshake directly as it doesn't fit into peer message\n // and there is always space in send buffer on new connection\n //enqueue(pmCache.handshake(torrent.getTorrentId(), torrent.getClientId()));\n }", "public boolean needAnnounce() {\n\t\tint peersPerThread = Config.getConfig().getInt(\"peer-max_connecting\") / Config.getConfig().getInt(\"peer-max_concurrent_connecting\");\n\t\tboolean needEnoughPeers = peersWanted() >= peersPerThread;\n\t\tboolean notExceedMaxPendingPeers = peers.size() < peerManager.getMaxPendingPeers(torrentStatus);\n\t\tboolean hasConnectingSpace = getFreeConnectingCapacity() > 0;\n\t\treturn needEnoughPeers && notExceedMaxPendingPeers && hasConnectingSpace;\n\t}", "@Test\n\tpublic void testFastRejectRequestMessage() throws Exception {\n\n\t\t// Given\n\t\tfinal PieceDatabase pieceDatabase = MockPieceDatabase.create (\"0\", 16384);\n\t\tpieceDatabase.start (true);\n\t\tfinal BlockDescriptor requestDescriptor = new BlockDescriptor (0, 0, 16384);\n\t\tPeerServices peerServices = mock (PeerServices.class);\n\t\tPeerSetContext peerSetContext = new PeerSetContext (peerServices, pieceDatabase, mock (RequestManager.class), null);\n\t\twhen(peerSetContext.requestManager.piecesAvailable (any (ManageablePeer.class))).thenReturn (true);\n\t\twhen(peerSetContext.requestManager.allocateRequests (any (ManageablePeer.class), anyInt(), eq (false)))\n\t\t\t\t.thenReturn (Arrays.asList (new BlockDescriptor[] { requestDescriptor }))\n\t\t\t\t.thenReturn (new ArrayList<BlockDescriptor>());\n\t\tMockConnection mockConnection = new MockConnection();\n\t\tPeerHandler handler = new PeerHandler (peerSetContext, mockConnection, new PeerID(), new PeerStatistics(), true, false);\n\n\t\t// When\n\t\t// They allow us to make a request\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveAllMessage());\n\t\tmockConnection.mockInput (PeerProtocolBuilder.unchokeMessage());\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.haveNoneMessage());\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.interestedMessage());\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.requestMessage (requestDescriptor));\n\t\tmockConnection.mockExpectNoMoreOutput();\n\t\tassertTrue (mockConnection.isOpen());\n\n\t\t// When\n\t\t// They choke and reject the request\n\t\tmockConnection.mockInput (PeerProtocolBuilder.chokeMessage());\n\t\tmockConnection.mockInput (PeerProtocolBuilder.rejectRequestMessage (requestDescriptor));\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\tmockConnection.mockExpectNoMoreOutput();\n\t\tassertTrue (mockConnection.isOpen());\n\n\t\t// When\n\t\t// They unchoke - request should be resent\n\t\tmockConnection.mockInput (PeerProtocolBuilder.unchokeMessage());\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.requestMessage (requestDescriptor));\n\t\tmockConnection.mockExpectNoMoreOutput();\n\n\n\t\tpieceDatabase.terminate (true);\n\n\t}", "protected boolean processChannelTell(String username, String titles, int channelNumber, String message){return false;}", "void onDiscoverPeersSuccess();", "public void deliver() {\n try {\n if (null != this.listener) {\n ContentObject pending = null;\n CCNInterestListener listener = null;\n synchronized (this) {\n if (null != this.data && null != this.listener) {\n pending = this.data;\n this.data = null;\n listener = (CCNInterestListener) this.listener;\n }\n }\n if (null != pending) {\n if (Log.isLoggable(Log.FAC_NETMANAGER, Level.FINER)) Log.finer(Log.FAC_NETMANAGER, \"Interest callback (\" + pending + \" data) for: {0}\", this.interest.name());\n synchronized (this) {\n this.deliveryPending = false;\n }\n manager.unregisterInterest(this);\n Interest updatedInterest = listener.handleContent(pending, interest);\n if (null != updatedInterest) {\n if (Log.isLoggable(Log.FAC_NETMANAGER, Level.FINER)) Log.finer(Log.FAC_NETMANAGER, \"Interest callback: updated interest to express: {0}\", updatedInterest.name());\n manager.expressInterest(this.owner, updatedInterest, listener);\n }\n } else {\n if (Log.isLoggable(Log.FAC_NETMANAGER, Level.FINER)) Log.finer(Log.FAC_NETMANAGER, \"Interest callback skipped (no data) for: {0}\", this.interest.name());\n }\n } else {\n synchronized (this) {\n if (null != this.sema) {\n if (Log.isLoggable(Log.FAC_NETMANAGER, Level.FINER)) Log.finer(Log.FAC_NETMANAGER, \"Data consumes pending get: {0}\", this.interest.name());\n if (Log.isLoggable(Log.FAC_NETMANAGER, Level.FINEST)) Log.finest(Log.FAC_NETMANAGER, \"releasing {0}\", this.sema);\n this.sema.release();\n }\n }\n if (null == this.sema) {\n if (Log.isLoggable(Log.FAC_NETMANAGER, Level.FINER)) Log.finer(Log.FAC_NETMANAGER, \"Interest callback skipped (not valid) for: {0}\", this.interest.name());\n }\n }\n } catch (Exception ex) {\n _stats.increment(StatsEnum.DeliverContentFailed);\n Log.warning(Log.FAC_NETMANAGER, \"failed to deliver data: {0}\", ex);\n Log.warningStackTrace(ex);\n }\n }", "@Test\n\tpublic void testFastHaveNoneMessage() throws Exception {\n\n\t\t// Given\n\t\tfinal PieceDatabase pieceDatabase = MockPieceDatabase.create (\"00000\", 16384);\n\t\tpieceDatabase.start (true);\n\t\tPeerServices peerServices = mock (PeerServices.class);\n\t\tPeerSetContext peerSetContext = new PeerSetContext (peerServices, pieceDatabase, mock (RequestManager.class), null);\n\t\twhen(peerSetContext.requestManager.piecesAvailable (any (ManageablePeer.class))).thenReturn (true);\n\t\tMockConnection mockConnection = new MockConnection();\n\t\tPeerHandler handler = new PeerHandler (peerSetContext, mockConnection, new PeerID(), new PeerStatistics(), true, false);\n\n\t\t// When\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveNoneMessage());\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.haveNoneMessage());\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (0));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (1));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (2));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (3));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (4));\n\t\tmockConnection.mockExpectNoMoreOutput();\n\t\tassertTrue (mockConnection.isOpen());\n\t\tassertEquals (0, handler.getRemoteBitField().cardinality());\n\n\n\t\tpieceDatabase.terminate (true);\n\n\t}", "@Override\n void enqueuePiece(ByteBuffer buffer, int index, int position, int length, Object params)\n {\n// if (DEBUG) System.out.println(\"[stdpc] enqueuePiece:\" + index + \",\" + position + \",\" + length + \" buf:\" + buffer.remaining());\n// sendQueue.forEach(pm ->\n// System.out.println(\" -s> \" + System.identityHashCode(pm) + \" \" +pm.type + \" ,\" + pm.index +\",\" + pm.begin + \",\" + pm.length)\n// );\n// peerBlockRequests.forEach(pm -> {\n// System.out.println(\" -p> \" + pm.type + \" ,\" + pm.index +\",\" + pm.begin + \",\" + pm.length);\n// });\n\n\n boolean found = false;\n\n // check for the active linked peer request and remove it\n for (int i = 0; i < peerBlockRequests.size(); i++) {\n StdPeerMessage pm = peerBlockRequests.get(i);\n if ((pm.index == index)\n && (pm.begin == position)\n && (pm.length == length))\n {\n peerBlockRequests.remove(i);\n pmCache.release(pm);\n found = true;\n break;\n }\n }\n if (!found && DEBUG) {\n if (DEBUG) System.out.println(\"[stdpc] pBR not found\");\n }\n\n enqueue(pmCache.piece(index, position, length, buffer, params));\n }", "@Test\n\tpublic void testFastRequestMessageChokedAllowedFast() throws Exception {\n\n\t\t// Given\n\t\tfinal PieceDatabase pieceDatabase = MockPieceDatabase.create (\"1\", 16384);\n\t\tpieceDatabase.start (true);\n\t\tPeerServices peerServices = mock (PeerServices.class);\n\t\tPeerSetContext peerSetContext = new PeerSetContext (peerServices, pieceDatabase, mock (RequestManager.class), null);\n\t\tMockConnection mockConnection = new MockConnection();\n\t\tPeerHandler handler = new PeerHandler (peerSetContext, mockConnection, new PeerID(), new PeerStatistics(), true, false);\n\t\tBlockDescriptor request = new BlockDescriptor (0, 0, 16384);\n\n\t\t// When\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveNoneMessage());\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.haveAllMessage());\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (0));\n\t\tmockConnection.mockExpectNoMoreOutput();\n\n\t\t// When\n\t\t// They request an Allowed Fast piece while choked\n\t\tmockConnection.mockInput (PeerProtocolBuilder.requestMessage (request));\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.pieceMessage (\n\t\t\t\trequest,\n\t\t\t\tpieceDatabase.readPiece (request.getPieceNumber()).getBlock (request)\n\t\t));\n\t\tmockConnection.mockExpectNoMoreOutput();\n\t\tassertTrue (mockConnection.isOpen());\n\n\n\t\tpieceDatabase.terminate (true);\n\n\t}", "@Override\n public void onReceive(Object msg) throws Exception {\n }", "public synchronized void tellAt(){\n\t\tnotifyAll();\n\t}", "public boolean hasMessage(){\r\n return this.receivedMessages.size()>0;\r\n }", "public void sendToManager(){\n String receiveMessage;\n while((receiveMessage=receiveFrom(messageReader)) != null){\n manager.manage(receiveMessage);\n }\n }", "public void bluetooth_enable_discoverability()\r\n {\n\t\t\r\n Intent discoverableIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_DISCOVERABLE);\r\n\t\tdiscoverableIntent.putExtra(BluetoothAdapter.EXTRA_DISCOVERABLE_DURATION, 300);\r\n\t\tLoaderActivity.m_Activity.startActivity(discoverableIntent);\r\n\t\tserver_connect_thread = new Server_Connect_Thread();\r\n\t\tserver_connect_thread.start();\r\n\t\tmessages.clear();\r\n }", "@Override\n public void informPlaneReadyToTakeOff(int passengerId) {\n this.lock.lock();\n try {\n // wait for last passenger\n while (this.lastPassengerToBoard != passengerId) {\n this.hostessWaitForLastPassengerBoard.await();\n }\n\n // update hostess state\n this.repository.updateHostessState(HostessState.READY_TO_FLY);\n\n // wake up pilot\n this.planeReadyToTakeOff = true;\n this.pilotWaitForAllInBoard.signal();\n } catch (InterruptedException e) {\n e.printStackTrace();\n } finally {\n this.lock.unlock();\n }\n }", "public abstract void msgCanOnlyDeliverPartial(Market market, Food food, int amountDeliverable);", "public void notifyNoKAliveReceived (COPSPdpOSReqStateMan man);", "@Override\r\n\tpublic void run() {\r\n\t\ttry {\r\n\t\t\tthis.inputStream = socket.getInputStream();\r\n\t\t\tthis.outputStream = socket.getOutputStream();\r\n\t\t\t// Get the peer that is asking me for fragments.\r\n\t\t\tpeerState = torrentClient.getPeerStateList().getByAddress(\r\n\t\t\t\t\tsocket.getInetAddress().getHostAddress(), socket.getPort());\r\n\t\t\t// read handhake\r\n\t\t\tbyte[] received = new byte[68];\r\n\t\t\tinputStream.read(received);\r\n\t\t\t//Parse the handshake received\r\n\t\t\tHandsake handshakeMessage = Handsake\r\n\t\t\t\t\t.parseStringToHandsake(new String(received));\r\n\t\t\t// validate hash\r\n\t\t\tString torrentHash = new String(torrentClient.getMetainf()\r\n\t\t\t\t\t.getInfo().getInfoHash());\r\n\t\t\t//if the received handshake is correct send my handshake\r\n\t\t\tif (Handsake.isValidHandsakeForBitTorrentProtocol(handshakeMessage,\r\n\t\t\t\t\ttorrentHash)) {\r\n\t\t\t\t// send handshake\r\n\t\t\t\tHandsake handShakeToSend = new Handsake(torrentHash,\r\n\t\t\t\t\t\tthis.torrentClient.getPeerId());\r\n\t\t\t\tthis.outputStream.write(handShakeToSend.getBytes());\r\n\t\t\t\t// enviar bitfield\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.sendBitfield();\r\n\t\t\t\t\t// leer\r\n\t\t\t\t\tPeerProtocolMessage message = this.readNormalMessage();\r\n\t\t\t\t\t// Check if I have received an interested message\r\n\t\t\t\t\tif (message.getType().equals(\r\n\t\t\t\t\t\t\tPeerProtocolMessage.Type.INTERESTED)) {\r\n\t\t\t\t\t\tif (this.peerState != null) {\r\n\t\t\t\t\t\t\tpeerState = torrentClient.getPeerStateList()\r\n\t\t\t\t\t\t\t\t\t.getByAddress(\r\n\t\t\t\t\t\t\t\t\t\t\tsocket.getInetAddress()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.getHostAddress(),\r\n\t\t\t\t\t\t\t\t\t\t\tsocket.getPort());\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//Set the peer status\r\n\t\t\t\t\t\tif (this.peerState != null) {\r\n\t\t\t\t\t\t\tthis.peerState.setPeer_interested(true);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// send unchoke to the peer\r\n\t\t\t\t\t\tthis.outputStream.write(new UnChokeMsg().getBytes());\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//set the peer status\r\n\t\t\t\t\t\tif (this.peerState != null) {\r\n\t\t\t\t\t\t\tthis.peerState.setAm_choking(false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//Continue receiveing messages if the message type is Keep_alive, Request or Have.\r\n\t\t\t\t\t\tboolean continueReading = true;\r\n\t\t\t\t\t\twhile (continueReading) {\r\n\t\t\t\t\t\t\tmessage = this.readNormalMessage();\r\n\t\t\t\t\t\t\tcontinueReading = processMessage(message);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// if I have not received interested send unchoke\r\n\t\t\t\t\t\tthis.outputStream.write(new ChokeMsg().getBytes());\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} catch (IOException ioe) {\r\n\t\t\t\t\tioe.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// close connection\r\n\t\t\tthis.inputStream.close();\r\n\t\t\tthis.outputStream.close();\r\n\t\t\tsocket.close();\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\tSystem.out.println(\"Sending thread closed\");\r\n\t\t\te.printStackTrace();\r\n\t\t\ttry {\r\n\t\t\t\tthis.inputStream.close();\r\n\t\t\t\tthis.outputStream.close();\r\n\t\t\t\tsocket.close();\r\n\t\t\t} catch (IOException e1) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te1.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "void check_and_send(){\r\n\t\twhile(not_ack_yet <= WINDOW_SIZE){\r\n\t\t\tif(covered_datagrams >= total_datagrams)\r\n\t\t\t\treturn;\r\n\t\t\t//send one data more\r\n\t\t\tcovered_datagrams++;\r\n\t\t\tbyte[] data_to_send = Helper.get_bytes(data_send,(covered_datagrams-1)*BLOCK_SIZE,BLOCK_SIZE);\r\n\t\t\tDataDatagram send = new DataDatagram((short)the_connection.session_num,\r\n\t\t\t\t\t(short)(covered_datagrams),data_to_send,the_connection);\r\n\t\t\tsend.send_datagram();\r\n\t\t\tput_and_set_timer(send);\r\n\t\t}\r\n\t}" ]
[ "0.6780596", "0.63494164", "0.613559", "0.6089853", "0.608944", "0.6060763", "0.60579294", "0.6053493", "0.59437156", "0.5901296", "0.5886159", "0.5873734", "0.5811176", "0.5806421", "0.5764521", "0.5754297", "0.5736688", "0.5717238", "0.56821346", "0.56518567", "0.5642432", "0.56353724", "0.5622764", "0.56035936", "0.55794924", "0.5573583", "0.5571671", "0.5552772", "0.5550977", "0.5506815", "0.54998374", "0.54998153", "0.5498856", "0.5494984", "0.5488991", "0.547562", "0.54705465", "0.54686564", "0.5463294", "0.54619044", "0.5460247", "0.5451757", "0.5444503", "0.5442604", "0.5442137", "0.5423156", "0.5416395", "0.5411966", "0.53970104", "0.53952426", "0.53932387", "0.53894657", "0.5383946", "0.53754354", "0.5371529", "0.53681886", "0.5368135", "0.5364719", "0.5364087", "0.53553647", "0.53516287", "0.5345988", "0.53420997", "0.5335678", "0.5334411", "0.5323031", "0.53192663", "0.5317707", "0.53177", "0.5314748", "0.5307207", "0.5304353", "0.5304006", "0.53014326", "0.53011155", "0.5299894", "0.52983445", "0.52951133", "0.52895695", "0.52885723", "0.5286294", "0.52860105", "0.5283663", "0.5280843", "0.5278468", "0.52744555", "0.52726746", "0.52610683", "0.52601755", "0.52499115", "0.5241189", "0.5238082", "0.5237793", "0.5235539", "0.5235409", "0.5234868", "0.52345973", "0.52324593", "0.523041", "0.5228731" ]
0.6056814
7
called on "BITFIELD" message receive, marks correspondent pieces as available on peer side
void onBitField(BitSet mask) { // BITFIELD only allowed once if (bitfieldReceived) { if (DEBUG) System.out.println(peer.address + " second bitfield message received, dropping the connection"); close(Peer.CloseReason.PROTOCOL_ERROR); return; } peerPieces.clear(); peerPieces.or(mask); // update linked peer with completion status if (peerPieces.cardinality() == torrent.getMetainfo().pieces) { peer.setCompleted(true); } bitfieldReceived = true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void sendBitfield() throws IOException{\r\n\t\tbyte[]bitfield=new byte[this.torrentClient.getNumberOfPieces()];\r\n\t\tFragmentsInformation fi=this.torrentClient.getFragmentsInformation();\r\n\t\t//IF the fragment information is null or the current fragment is -1 it means that I have all the pieces\r\n\t\tif(fi==null||fi.getCurrentFragment()==-1){\r\n\t\t\tfor(int i=0,ii=bitfield.length;i<ii;i++){\r\n\t\t\t\tbitfield[i]=1;\r\n\t\t\t}\r\n\t\t}else{\r\n\t\t\t//we only have some pieces\r\n\t\t\tint lastFragment=this.torrentClient.getFragmentsInformation().getCurrentFragment();\r\n\t\t\tint i=0;\r\n\t\t\t\r\n\t\t\tfor(;i<lastFragment;i++){\r\n\t\t\t\tbitfield[i]=1;\r\n\t\t\t}\r\n\t\t\tfor(int ii=bitfield.length;i<ii;i++){\r\n\t\t\t\tbitfield[i]=0;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tBitfieldMsg message= new BitfieldMsg(bitfield);\r\n\t\tthis.outputStream.write(message.getBytes());\r\n\t}", "@Override\n protected void handshakeCompleted()\n {\n if (0 < torrent.pieces.cardinality()) {\n enqueue(pmCache.bitfield((int)torrent.metainfo.pieces, torrent.pieces));\n }\n\n /*\n todo\n if (client.node != null) {\n pc.enqueue(StdPeerMessage.port(client.node.port));\n }\n */\n }", "@Override\n\tpublic void visit(BitField bf) {\n\t\tSystem.out.println(\"process bitfield\");\n\t\tpieces = new ArrayList<Integer>();\n\t\tbyte[] body = bf.getBody();\n\t\t// boucle afficher body\n\t\t/*\n\t\t * byte b, mask2 = 0x01; for (int i = 0; i < body.length; i++) { b =\n\t\t * body[i]; for (int j = 0; j < 8; j++) { if ((b & mask2) == 0) {\n\t\t * System.out.println(0); } else { System.out.println(1); } } }\n\t\t */\n\t\t// boucle afficher body\n\t\tint mask;\n\t\tfor (int i = 0; i < body.length; i++) {\n\t\t\tmask = body[i];\n\t\t\tfor (int j = 0; j < 8; j++) {\n\t\t\t\tif ((mask & 0x80) != 0) {\n\t\t\t\t\tpieces.add(j + (i * 8));\n\t\t\t\t}\n\t\t\t\tmask = mask << 1;\n\t\t\t}\n\t\t}\n\t\tph.setPeerPieces(pieces);\n\t\tSystem.out.println(pieces.size());\n\t\t// for(Integer i : pieces) {\n\t\t// System.out.println(\"bitfield : \" + i);\n\t\t// }\n\t\tSystem.out.println(\"taille bitfield : \" + pieces.size());\n\t}", "void onInterested(boolean state)\n {\n peerInterested = state;\n\n if (!peerInterested) {\n // remove all piece if enqueued,\n // most likely will not happen\n for (int i = sendQueue.size() - 1; 0 <= i; i--) {\n StdPeerMessage pm = sendQueue.get(i);\n if (pm.type == StdPeerMessage.PIECE) {\n sendQueue.remove(i);\n TorrentStorage.Block block = (TorrentStorage.Block) pm.params;\n block.release();\n pmCache.release(pm);\n }\n }\n }\n }", "@Test\n\tpublic void testFastBitfieldMessage() throws Exception {\n\n\t\t// Given\n\t\tfinal PieceDatabase pieceDatabase = MockPieceDatabase.create (\"00000\", 16384);\n\t\tBitField wantedPieces = pieceDatabase.getPresentPieces().not();\n\t\tpieceDatabase.start (true);\n\t\tPeerServices peerServices = mock (PeerServices.class);\n\t\tPeerSetContext peerSetContext = new PeerSetContext (peerServices, pieceDatabase, mock (RequestManager.class), null);\n\t\twhen(peerSetContext.requestManager.piecesAvailable (any (ManageablePeer.class))).thenReturn (true);\n\t\twhen(peerSetContext.requestManager.allocateRequests (any (ManageablePeer.class), anyInt(), eq (false))).thenReturn (new ArrayList<BlockDescriptor>());\n\t\tMockConnection mockConnection = new MockConnection();\n\t\tPeerHandler handler = new PeerHandler (peerSetContext, mockConnection, new PeerID(), new PeerStatistics(), true, false);\n\n\t\t// When\n\t\tmockConnection.mockInput (PeerProtocolBuilder.bitfieldMessage (wantedPieces));\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.haveNoneMessage());\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (0));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (1));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (2));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (3));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (4));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.interestedMessage());\n\t\tmockConnection.mockExpectNoMoreOutput();\n\t\tassertTrue (mockConnection.isOpen());\n\n\n\t\tpieceDatabase.terminate (true);\n\n\t}", "void firePeerBitfieldUpdated(TorrentId torrentId, ConnectionKey connectionKey, Bitfield bitfield);", "public void msgReadyForParts()\n\t{\n\t\tprint(\"Gantry: Feeder ready for party\");\n\t\tgantry_events.add(GantryEvents.FeederReadyForBin);\n\t//\tlog.add(new LoggedEvent(\"msgReadyForParts received from Feeder\"));\n\t\tstateChanged();\n\t}", "private void updatePeers() {\n\t\tif (files == null)\n\t\t\treturn;\n\t\tArrayList<Piece> neededPieces = files.getNeededPieces();\n\t\tfor (int i = 0; i < peers.size(); i++) {\n\t\t\tPeer p = peers.get(i);\n\t\t\tboolean hasNoPieces = true;\n\t\t\tfor (int j = 0; j < neededPieces.size(); j++) {\n\t\t\t\tif (p.getClient().getBitfield().hasPiece(neededPieces.get(j).getIndex())) {\n\t\t\t\t\thasNoPieces = false;\n\t\t\t\t\tif (!p.getClient().isInterested()) {\n\t\t\t\t\t\tp.addToQueue(new MessageInterested());\n\t\t\t\t\t\tp.getClient().interested();\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (hasNoPieces && p.getClient().isInterested()) {\n\t\t\t\tp.addToQueue(new MessageUninterested());\n\t\t\t\tp.getClient().uninterested();\n\t\t\t}\n\t\t\tif (p.getMyClient().isInterested() && p.getClient().isChoked()) {\n\t\t\t\tp.addToQueue(new MessageUnchoke());\n\t\t\t\tp.getClient().unchoke();\n\t\t\t} else if (!p.getMyClient().isInterested() && !p.getClient().isChoked()) {\n\t\t\t\tp.addToQueue(new MessageChoke());\n\t\t\t\tp.getClient().choke();\n\t\t\t}\n\t\t}\n\t}", "@Test\n\tpublic void testFastHandshakePeerIDBitfield() throws Exception {\n\n\t\t// Given\n\t\tPieceDatabase pieceDatabase = MockPieceDatabase.create (\"10\", 16384);\n\t\tpieceDatabase.start (true);\n\t\tBitField wantedPieces = pieceDatabase.getPresentPieces().not();\n\t\tPeerServices peerServices = mock (PeerServices.class);\n\t\tPeerSetContext peerSetContext = new PeerSetContext (peerServices, pieceDatabase, mock (RequestManager.class), null);\n\t\twhen(peerSetContext.requestManager.piecesAvailable (any (ManageablePeer.class))).thenReturn (false);\n\t\tMockConnection mockConnection = new MockConnection();\n\t\tPeerHandler handler = new PeerHandler (peerSetContext, mockConnection, new PeerID(), new PeerStatistics(), true, false);\n\n\t\t// When\n\t\tmockConnection.mockInput (PeerProtocolBuilder.bitfieldMessage (wantedPieces));\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.bitfieldMessage (pieceDatabase.getPresentPieces()));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (0));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (1));\n\t\tmockConnection.mockExpectNoMoreOutput();\n\n\n\t\tpieceDatabase.terminate (true);\n\n\t}", "private void push() {\n ImmutableSortedSet<T> myAvailable = _outstanding.apply(\n new Syncd.Transformer<ImmutableSortedSet<T>, ImmutableSortedSet<T>>() {\n public Tuple<ImmutableSortedSet<T>, ImmutableSortedSet<T>> apply(ImmutableSortedSet<T> aBefore) {\n final SortedSet<T> myRemaining = new TreeSet<>(new MessageComparator<T>());\n\n // Identify those messages that are sequentially contiguous from _floor and can be passed on\n //\n ImmutableSortedSet<T> myAccessible =\n new ImmutableSortedSet.Builder<>(new MessageComparator<T>()).addAll(\n Iterables.filter(aBefore, new Predicate<T>() {\n public boolean apply(T aMessage) {\n Long myCurrent = _floor.get();\n\n if (aMessage.getSeq() == myCurrent) {\n // This message can be sent out to listeners so long as we're first to try\n //\n if (_floor.testAndSet(myCurrent, myCurrent + 1))\n return true;\n } else\n // This message must remain\n //\n myRemaining.add(aMessage);\n\n // Couldn't send message out or it must remain\n //\n return false;\n }\n })\n ).build();\n\n return new Tuple<>(new ImmutableSortedSet.Builder<>(\n new MessageComparator<T>()).addAll(myRemaining).build(),\n myAccessible);\n }\n }\n );\n\n send(myAvailable);\n archive(myAvailable);\n }", "public void updateBitfield() {\n\t\tfor (int i = 0; i < peers.size(); i++) {\n\t\t\tPeer p = peers.get(i);\n\t\t\tif (p != null) {\n\t\t\t\tp.getClient().getBitfield().setBitfieldSize(files.getBitfieldSize());\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tpublic void msgPartsLow() {\n\t\t\n\t}", "public void doPack() {\n this._sendData = new byte[2];\n this._sendData[0] = 1;\n this._sendData[1] = (byte) (this.iOIndex & 15);\n }", "void onHave(int index)\n {\n // in correct piece we must have correct block #0\n boolean correct = torrent.validateBlock(index, 0, 0);\n if (!correct) {\n close(Peer.CloseReason.PROTOCOL_ERROR);\n return;\n }\n\n peerPieces.set(index);\n }", "void Receive (int boardID, short addr, ByteBuffer buffer, long cnt, int Termination);", "public synchronized void updateField (ServerThread oppo) {\n\t\tsendMessage(\"123\",oppo); // Junk message to allow Signal:UpdateField to be sent\n\t\tsendMessage (\"Signal:UpdateField\", oppo);\n\t\tfor(int j=0; j < Field.size(); j++) {\n\t\t\t// Signal clients that the next few cards will be the field\n\t\t\tsendMessage (\"Signal:SendField\", oppo);\n\t\t\t// Make sure the messages are not sent to clients at the same time as the cards\n\t\t\t//TODO: The sleep was commented out earlier, why?\n\t\t\ttry {\n\t\t\t\tThread.sleep (10);\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\tsendCard (Field.get (j), oppo);\n\t\t}\n\t\tsendMessage (\"Signal:UpdateFieldEnded\", oppo);\n\t}", "private List<Identifier> determineAdapters(Message msg, PeerInfo newPeerInfo){\r\n\t\t\r\n\t\tif (peerToAdaptersMappings.size() > MAP_SIZE_LIMIT) peerToAdaptersMappings.clear();\r\n\t\t\r\n\t\tif (peerToAdaptersMappings.containsKey(newPeerInfo)){ //uses just peer id comparison here. \r\n\t\t\t//this is a known recipient\r\n\t\t\t//However, we still need to check if the available list of adapters (routing list) is valid.\r\n\t\t\t\r\n\t\t\tPair<List<Identifier>, PeerInfo> p;\r\n\t\t\tp = peerToAdaptersMappings.get(newPeerInfo);\r\n\t\t\t\r\n\t\t\tint i = 1;\r\n\t\t\twhile (p == null && i<4) { //this can happen if another thread flushed the entry in the meantime. That same thread should also update the value, though\r\n\t\t\t\ttry {\r\n\t\t\t\t\tThread.sleep(i*20);\r\n\t\t\t\t} catch (InterruptedException ignored) {}\r\n\t\t\t\tp = peerToAdaptersMappings.get(newPeerInfo);\r\n\t\t\t\ti++;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif (i >= 4 && p == null){\r\n\t\t\t\t//the other thread obviously did not do the job yet. We will take care of it in the rest of the method.\r\n\t\t\t}else{\r\n\t\t\t\tPeerInfo oldPeerInfo = p.second;\r\n\t\t\t\tif (newPeerInfo.equalsByDeepCoparison(oldPeerInfo)){\r\n\t\t\t\t\treturn p.first; //return the existing list of adapters, since nothing changed in the PeerInfo from last time\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} \r\n\t\t\r\n\t\t// if we arrived here it means, either:\r\n\t\t// sending message to this peer for the first time \r\n\t\t// OR\r\n\t\t// the information we have is outdated, so let's update it\r\n\t\t\r\n\r\n\t\tList<Identifier> adapters = adapterMgr.createEndpointForPeer(newPeerInfo); //need not be synced, since invoking createEndpointForPeer multiple times should be fine\r\n\t\tPair<List<Identifier>, PeerInfo> p = new Pair<List<Identifier>, PeerInfo>(adapters, newPeerInfo);\r\n\t\t\r\n\t\tsynchronized(peerToAdaptersMappings){ //just using ConcurrentHashMap is not enough, because we need to save the reference to the map's key in the second object of the Pair, which is the object of the map, and if 2 thread repeat put, the value will get updated, but that value will contain the wrong reference to the key, meaning that subsequently the deep comparison between the old and the new PeerInfo object will not be possible\r\n\t\t\tpeerToAdaptersMappings.remove(newPeerInfo); //in reality, we remove an existing entry, if any. Since the PeerInfo.equals just compares Ids, it should locate the exact entry.\r\n\t\t\tpeerToAdaptersMappings.put(newPeerInfo, p); //we now put in the new value, which is a Pair, whose second element points to the key of the entry in the peerToAdaptersMappings where the Pair value belongs\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\t// Now we have the list of all possible Adapters trough which we can deliver the message to the peer.\r\n\t\t// However, depending on peer's stated delivery policy we may want to restrict this list.\r\n\t\t// For example, in case of DeliveryPolicy.PREFERRED, we will just return the first Adapter.\r\n\t\t// But, in case of either TO_ALL_CHANNELS or AT_LEAST_ONE, we return all adapters, because in either case\r\n\t\t// the policy foresees sending to multiple adapters, but interpreting responses from all/one channel as ultimate success, respectively. \r\n\t\t\r\n\t\t\r\n\t\tif (newPeerInfo.getDeliveryPolicy() == DeliveryPolicy.Peer.PREFERRED){\r\n\t\t\tIdentifier preferred = adapters.get(0);\r\n\t\t\tList<Identifier> prefList = new ArrayList<Identifier>();\r\n\t\t\tprefList.add(preferred);\r\n\t\t\treturn prefList;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn adapters;\r\n\t}", "public synchronized void setReceived() {\n\t\t_received = true;\n\t\tthis.notifyAll();\n\t}", "private boolean processFrameOfContainedMessages(ShareableBytes bytes, Limit endpointReserve, Limit globalReserve) throws IOException\n {\n while (bytes.hasRemaining())\n if (!processOneContainedMessage(bytes, endpointReserve, globalReserve))\n return false;\n return true;\n }", "@Override\n\tpublic void channelParted(String channel) {\n\t}", "@Override\n\t\t\t\tpublic void isComposingReceived(LinphoneCore lc, LinphoneChatRoom cr) {\n\t\t\t\t\t\n\t\t\t\t}", "@Test\n\tpublic void testFastSetWeAreChoking() throws Exception {\n\n\t\t// Given\n\t\tPieceDatabase pieceDatabase = MockPieceDatabase.create (\"111111111111111\", 16384);\n\t\tpieceDatabase.start (true);\n\t\tBitField wantedPieces = pieceDatabase.getPresentPieces().not();\n\t\tPeerServices peerServices = mock (PeerServices.class);\n\t\tPeerSetContext peerSetContext = new PeerSetContext (peerServices, pieceDatabase, mock (RequestManager.class), null);\n\t\twhen(peerSetContext.requestManager.piecesAvailable (any (ManageablePeer.class))).thenReturn (false);\n\t\tMockConnection mockConnection = new MockConnection();\n\t\tPeerHandler handler = new PeerHandler (peerSetContext, mockConnection, new PeerID(), new PeerStatistics(), true, false);\n\n\t\t// When\n\t\tmockConnection.mockInput (PeerProtocolBuilder.bitfieldMessage (wantedPieces));\n\t\tmockConnection.mockInput (PeerProtocolBuilder.unchokeMessage());\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.haveAllMessage());\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (1));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (2));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (3));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (4));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (6));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (9));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (10));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (12));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (13));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.allowedFastMessage (14));\n\t\tmockConnection.mockExpectNoMoreOutput();\n\n\t\t// When\n\t\t// The remote peer requests a block\n\t\thandler.setWeAreChoking (false);\n\t\tBlockDescriptor sentRequest = new BlockDescriptor (0, 0, 16384); // Not an Allowed Fast piece\n\t\tmockConnection.mockInput (PeerProtocolBuilder.requestMessage (sentRequest));\n\t\thandler.connectionReady (mockConnection, true, false);\n\n\t\t// Then\n\t\tassertFalse (handler.getPeerState().getWeAreChoking());\n\n\t\t// When\n\t\t// We discard the request by choking them\n\t\thandler.setWeAreChoking (true);\n\t\thandler.connectionReady (mockConnection, false, true);\n\n\t\t// Then\n\t\t// Because the Fast extension is enabled, we must send an explicit reject for their request\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.unchokeMessage());\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.chokeMessage());\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.rejectRequestMessage (sentRequest));\n\t\tmockConnection.mockExpectNoMoreOutput();\n\t\tassertTrue (handler.getPeerState().getWeAreChoking());\n\t\tassertFalse (handler.getTheyHaveOutstandingRequests());\n\n\n\t\tpieceDatabase.terminate (true);\n\n\t}", "@Test\n public void bitfieldOperations() throws Exception {\n assumeThat(getEnv().serverVersion[0], is(greaterThanOrEqualTo(3)));\n\n awaitIndefinitely(commandClient.del(key(\"bf\")));\n\n List<Long> results = awaitIndefinitely(commandClient.bitfield(key(\"bf\"), asList(new Incrby(I05, 100L, 1L), new Get(U04, 0L))));\n assertThat(results, contains(1L, 0L));\n\n results.clear();\n for (int i = 0; i < 4; i++) {\n results.addAll(awaitIndefinitely(commandClient.bitfield(key(\"bf\"), asList(\n new Incrby(U02, 100L, 1L),\n new Overflow(SAT),\n new Incrby(U02, 102L, 1L)))));\n }\n assertThat(results, contains(1L, 1L, 2L, 2L, 3L, 3L, 0L, 3L));\n\n results = awaitIndefinitely(commandClient.bitfield(key(\"bf\"), asList(new Overflow(FAIL), new Incrby(U02, 102L, 1L))));\n assertThat(results, contains(nullValue()));\n\n awaitIndefinitely(commandClient.del(key(\"bf\")));\n\n // bitfield doesn't support non-numeric offsets (which are used for bitsize-based offsets)\n // but it's possible to get the same behaviour by using the bit size provided by the type enum,\n // ie. the following is equivalent to:\n // BITFIELD <key> SET u8 #2 200 GET u8 #2 GET u4 #4 GET u4 #5\n results = awaitIndefinitely(commandClient.bitfield(key(\"bf\"), asList(\n new Set(U08, U08.getBitSize() * 2, 200L),\n new Get(U08, U08.getBitSize() * 2),\n new Get(U04, U04.getBitSize() * 4),\n new Get(U04, U04.getBitSize() * 5))));\n assertThat(results, contains(0L, 200L, 12L, 8L));\n }", "public void blockingReceiveSenderSide() throws OOBException {\n \t}", "private int handleElectrodeSupplyOnOffCmdPacket()\n{\n \n int dataSize = 1; //one byte\n \n //read remainder of packet from socket and verify against the checksum\n int lStatus = readBlockAndVerify(dataSize, \n Notcher.ELECTRODE_SUPPLY_ON_OFF_CMD);\n\n //on error reading and verifying, return the error code\n if (lStatus == -1){ return(status); }\n \n //only store the values if there was no error -- errors cause return above\n\n outBufScrIndex = 0; //start with byte 0 in array\n \n electrodeSupplyOnOffByte = inBuffer[outBufScrIndex];\n \n sendACKPacket();\n \n return(lStatus);\n \n}", "@Override\r\n\tpublic void run() {\r\n\t\ttry {\r\n\t\t\tthis.inputStream = socket.getInputStream();\r\n\t\t\tthis.outputStream = socket.getOutputStream();\r\n\t\t\t// Get the peer that is asking me for fragments.\r\n\t\t\tpeerState = torrentClient.getPeerStateList().getByAddress(\r\n\t\t\t\t\tsocket.getInetAddress().getHostAddress(), socket.getPort());\r\n\t\t\t// read handhake\r\n\t\t\tbyte[] received = new byte[68];\r\n\t\t\tinputStream.read(received);\r\n\t\t\t//Parse the handshake received\r\n\t\t\tHandsake handshakeMessage = Handsake\r\n\t\t\t\t\t.parseStringToHandsake(new String(received));\r\n\t\t\t// validate hash\r\n\t\t\tString torrentHash = new String(torrentClient.getMetainf()\r\n\t\t\t\t\t.getInfo().getInfoHash());\r\n\t\t\t//if the received handshake is correct send my handshake\r\n\t\t\tif (Handsake.isValidHandsakeForBitTorrentProtocol(handshakeMessage,\r\n\t\t\t\t\ttorrentHash)) {\r\n\t\t\t\t// send handshake\r\n\t\t\t\tHandsake handShakeToSend = new Handsake(torrentHash,\r\n\t\t\t\t\t\tthis.torrentClient.getPeerId());\r\n\t\t\t\tthis.outputStream.write(handShakeToSend.getBytes());\r\n\t\t\t\t// enviar bitfield\r\n\t\t\t\ttry {\r\n\t\t\t\t\tthis.sendBitfield();\r\n\t\t\t\t\t// leer\r\n\t\t\t\t\tPeerProtocolMessage message = this.readNormalMessage();\r\n\t\t\t\t\t// Check if I have received an interested message\r\n\t\t\t\t\tif (message.getType().equals(\r\n\t\t\t\t\t\t\tPeerProtocolMessage.Type.INTERESTED)) {\r\n\t\t\t\t\t\tif (this.peerState != null) {\r\n\t\t\t\t\t\t\tpeerState = torrentClient.getPeerStateList()\r\n\t\t\t\t\t\t\t\t\t.getByAddress(\r\n\t\t\t\t\t\t\t\t\t\t\tsocket.getInetAddress()\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t.getHostAddress(),\r\n\t\t\t\t\t\t\t\t\t\t\tsocket.getPort());\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t//Set the peer status\r\n\t\t\t\t\t\tif (this.peerState != null) {\r\n\t\t\t\t\t\t\tthis.peerState.setPeer_interested(true);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// send unchoke to the peer\r\n\t\t\t\t\t\tthis.outputStream.write(new UnChokeMsg().getBytes());\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//set the peer status\r\n\t\t\t\t\t\tif (this.peerState != null) {\r\n\t\t\t\t\t\t\tthis.peerState.setAm_choking(false);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//Continue receiveing messages if the message type is Keep_alive, Request or Have.\r\n\t\t\t\t\t\tboolean continueReading = true;\r\n\t\t\t\t\t\twhile (continueReading) {\r\n\t\t\t\t\t\t\tmessage = this.readNormalMessage();\r\n\t\t\t\t\t\t\tcontinueReading = processMessage(message);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// if I have not received interested send unchoke\r\n\t\t\t\t\t\tthis.outputStream.write(new ChokeMsg().getBytes());\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t} catch (IOException ioe) {\r\n\t\t\t\t\tioe.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// close connection\r\n\t\t\tthis.inputStream.close();\r\n\t\t\tthis.outputStream.close();\r\n\t\t\tsocket.close();\r\n\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\tSystem.out.println(\"Sending thread closed\");\r\n\t\t\te.printStackTrace();\r\n\t\t\ttry {\r\n\t\t\t\tthis.inputStream.close();\r\n\t\t\t\tthis.outputStream.close();\r\n\t\t\t\tsocket.close();\r\n\t\t\t} catch (IOException e1) {\r\n\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\te1.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Test\n\tpublic void testFastPieceMessageUnrequested() throws Exception {\n\n\t\t// Given\n\t\tfinal PieceDatabase pieceDatabase = MockPieceDatabase.create (\"0\", 16384);\n\t\tpieceDatabase.start (true);\n\t\tPeerServices peerServices = mock (PeerServices.class);\n\t\tPeerSetContext peerSetContext = new PeerSetContext (peerServices, pieceDatabase, mock (RequestManager.class), null);\n\t\twhen(peerSetContext.requestManager.piecesAvailable (any (ManageablePeer.class))).thenReturn (true);\n\t\twhen(peerSetContext.requestManager.allocateRequests (any (ManageablePeer.class), anyInt(), eq (false))).thenReturn (new ArrayList<BlockDescriptor>());\n\t\tMockConnection mockConnection = new MockConnection();\n\t\tPeerHandler handler = new PeerHandler (peerSetContext, mockConnection, new PeerID(), new PeerStatistics(), true, false);\n\t\tBlockDescriptor requestDescriptor = new BlockDescriptor (0, 0, 16384);\n\n\t\t// When\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveAllMessage());\n\t\thandler.connectionReady (mockConnection, true, true);\n\t\tmockConnection.mockInput (PeerProtocolBuilder.pieceMessage (requestDescriptor, ByteBuffer.allocate (16384)));\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.haveNoneMessage());\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.interestedMessage());\n\t\tmockConnection.mockExpectNoMoreOutput();\n\t\tverify(peerServices).peerDisconnected (any (ManageablePeer.class));\n\t\tassertFalse (mockConnection.isOpen());\n\n\n\t\tpieceDatabase.terminate (true);\n\n\t}", "@Override\n\tpublic void msgReceived(Message msg) {\n\n\t}", "@Test\n\tpublic final void testReceiveDoneAt() throws MPIException {\n\t\tblock.startCommunication();\n\t\tBoundaryId initialized = new BoundaryId();\n\t\tBoundaryIterator initializedIterator = block.getBoundaryIterator();\n\t\t// Values are the same in all blocks.\n\t\tBoundaryIterator oppositeIterator = block.getBoundaryIterator();\n\t\tfor (int i=0; i<2*DIMENSIONALITY; i++) {\n\t\t\tblock.receiveDoneAt(initialized);\n\t\t\tinitializedIterator.setBoundaryToIterate(initialized);\n\t\t\tBoundaryId oppositeBoundary = initialized.oppositeSide();\n\t\t\toppositeIterator.setBoundaryToIterate(oppositeBoundary);\n\t\t\twhile (oppositeIterator.isInField()) {\n\t\t\t\t// Check ghost region values.\n\t\t\t\tfor (int distance=0; distance<extent; distance++) {\n\t\t\t\t\tint dir = initialized.isLowerSide() ? -1 : 1;\n\t\t\t\t\tdouble expected = oppositeIterator.currentNeighbor(initialized.getDimension(), dir * distance);\n\t\t\t\t\tdouble actual = initializedIterator.currentNeighbor(initialized.getDimension(), dir * (1+distance));\n\t\t\t\t\tassertEquals(expected, actual, 4*Math.ulp(expected));\n\t\t\t\t}\n\t\t\t\toppositeIterator.next();\n\t\t\t\tinitializedIterator.next();\n\t\t\t}\n\t\t}\n\t\tblock.finishCommunication();\n\t}", "void notifyLorenzoDeckUpdate(DevelopCardDeckUpdate msg);", "private void sendHave(int pieceNumber) {\n\t\t//fo\n\t\tfinal ArrayList peer_transports = peer_transports_cow;\n\n\t\tfor (int i = 0; i < peer_transports.size(); i++) {\n\t\t\t//get a peer connection\n\t\t\tfinal PEPeerTransport pc = (PEPeerTransport) peer_transports.get(i);\n\t\t\t//send the have message\n\t\t\tpc.sendHave(pieceNumber);\n\t\t}\n\n\t}", "@Override\n void enqueuePiece(ByteBuffer buffer, int index, int position, int length, Object params)\n {\n// if (DEBUG) System.out.println(\"[stdpc] enqueuePiece:\" + index + \",\" + position + \",\" + length + \" buf:\" + buffer.remaining());\n// sendQueue.forEach(pm ->\n// System.out.println(\" -s> \" + System.identityHashCode(pm) + \" \" +pm.type + \" ,\" + pm.index +\",\" + pm.begin + \",\" + pm.length)\n// );\n// peerBlockRequests.forEach(pm -> {\n// System.out.println(\" -p> \" + pm.type + \" ,\" + pm.index +\",\" + pm.begin + \",\" + pm.length);\n// });\n\n\n boolean found = false;\n\n // check for the active linked peer request and remove it\n for (int i = 0; i < peerBlockRequests.size(); i++) {\n StdPeerMessage pm = peerBlockRequests.get(i);\n if ((pm.index == index)\n && (pm.begin == position)\n && (pm.length == length))\n {\n peerBlockRequests.remove(i);\n pmCache.release(pm);\n found = true;\n break;\n }\n }\n if (!found && DEBUG) {\n if (DEBUG) System.out.println(\"[stdpc] pBR not found\");\n }\n\n enqueue(pmCache.piece(index, position, length, buffer, params));\n }", "@Override\n public void receiveMessages() {\n // put message to currentIncoming message store\n FFIByteVector tmpVector = (FFIByteVector) FFIByteVectorFactory.INSTANCE.create();\n long bytesOfReceivedMsg = 0;\n while (grapeMessager.getPureMessage(tmpVector)) {\n // The retrieved tmp vector has been resized, so the cached objAddress is not available.\n // trigger the refresh\n tmpVector.touch();\n // OutArchive will do the resize;\n if (logger.isDebugEnabled()) {\n logger.debug(\"Frag [{}] digest message of size {}\", fragId, tmpVector.size());\n }\n ///////////////////////////////////////////\n currentIncomingMessageStore.digest(tmpVector);\n ///////////////////////////////////////////\n bytesOfReceivedMsg += tmpVector.size();\n }\n logger.info(\n \"Frag [{}] totally Received [{}] bytes from others starting deserialization\",\n fragId,\n bytesOfReceivedMsg);\n }", "public void upcall(ReadMessage m) {\n \tObject mesg;\r\n \t\r\n try {\r\n mesg = m.readObject();\r\n } catch (ClassNotFoundException e) {\r\n mesg = null;\r\n } catch (IOException e) {\r\n mesg = null;\r\n e.printStackTrace();\r\n } catch (Throwable th) {\r\n mesg = null;\r\n th.printStackTrace();\r\n }\r\n\r\n IbisIdentifier ii = m.origin().ibisIdentifier();\r\n\r\n if (mesg != null) {\r\n ProcessIdentifier pi = new ProcessIdentifier(ii);\r\n if (mesg instanceof RepMILTMMessage) {\r\n\r\n // DEBUG\r\n /* System.err.println(\"Got RepMI upcall of type \"\r\n + ((RepMILTMMessage) mesg).arg.getType() + \" from \"\r\n + m.origin().name());\r\n*/\r\n if (((RepMILTMMessage) mesg).arg.getType() == Operation.LW)\r\n ((RepMILTMMessage) mesg).arg.setType(Operation.RW);\r\n\r\n /* i might not do communication, so i delay the call to m.finish */\r\n proto.processRemoteOperation(((RepMILTMMessage) mesg).arg,\r\n ((RepMILTMMessage) mesg).localLTM, pi, m);\r\n return;\r\n\r\n } else if (mesg instanceof RepMIJoinMessage) {\r\n\r\n// DEBUG\r\n /* System.err.println(\"Got RepMI upcall for joining from \"\r\n + m.origin().name());\r\n */\r\n /*\r\n * needs to be called to release the thread before entering the\r\n * processJoin call which will broadcast the join request to all\r\n * other processes in the system\r\n */\r\n ReceivePortIdentifier joinAckPort = ((RepMIJoinMessage) mesg).recvPortId;\r\n ReceivePortIdentifier joiningIbisPort = ((RepMIJoinMessage) mesg).ibisRPI;\r\n ReceivePortIdentifier joinAckNormalNode = ((RepMIJoinMessage) mesg).joinAckNormalNode;\r\n\r\n try {\r\n m.finish();\r\n } catch (IOException e) {\r\n // TODO Auto-generated catch block\r\n e.printStackTrace();\r\n }\r\n\r\n proto.processJoin(pi, joinAckPort, joiningIbisPort,\r\n joinAckNormalNode);\r\n\r\n return;\r\n\r\n } else if (mesg instanceof RepMISOSMessage) {\r\n try {\r\n m.finish();\r\n } catch (IOException e) {\r\n // TODO Auto-generated catch block\r\n e.printStackTrace();\r\n }\r\n proto.processSOS(ii, ((RepMISOSMessage) mesg).TS,\r\n ((RepMISOSMessage) mesg).recoveryRound);\r\n return;\r\n\r\n } else if (mesg instanceof RepMISOSReplyMessage) {\r\n proto.processSOSReply(ii,\r\n ((RepMISOSReplyMessage) mesg).whomIHelp,\r\n ((RepMISOSReplyMessage) mesg).TS,\r\n ((RepMISOSReplyMessage) mesg).myOps);\r\n return;\r\n }\r\n }\r\n }", "public final void mo12625b() {\n if (mo9140c() != null) {\n PkState pkState = (PkState) LinkCrossRoomDataHolder.m13782a().get(\"data_pk_state\");\n if (!this.f13397e && pkState == PkState.PENAL) {\n this.f13396d.f11684v = true;\n this.f13396d.f11680r = 0;\n this.f13397e = true;\n this.f13398f = true;\n ((C3245ad) ((LinkPKApi) C9178j.m27302j().mo22373b().mo10440a(LinkPKApi.class)).battleInvite(this.f13396d.f11665c).mo19297a((C7494t<T, ? extends R>) mo13033u())).mo10183a(new C4708ga(this), new C4709gb(this));\n }\n }\n }", "public Message respondWithBitfield(Handshake hs) {\n \tBitSet bitfield = fileSupervisor.partsWithPeer();\n \tif(!bitfield.isEmpty())\n \t\treturn(new BitField(bitfield.toByteArray()));\n \telse\n \t\treturn null;\n }", "Message pull();", "@Override\n public void finishMessageSending() {\n for (int i = 0; i < fragNum; ++i) {\n long bytesWriten = cacheOut[i].bytesWriten();\n cacheOut[i].finishSetting();\n cacheOut[i].writeLong(0, bytesWriten - SIZE_OF_LONG);\n\n if (bytesWriten == SIZE_OF_LONG) {\n logger.debug(\n \"[Finish msg] sending skip msg from {} -> {}, since msg size: {}\",\n fragId,\n i,\n bytesWriten);\n continue;\n }\n if (i == fragId) {\n nextIncomingMessageStore.digest(cacheOut[i].getVector());\n logger.info(\n \"In final step, Frag [{}] digest msg to self of size: {}\",\n fragId,\n bytesWriten);\n } else {\n grapeMessager.sendToFragment(i, cacheOut[i].getVector());\n logger.info(\n \"In final step, Frag [{}] send msg to [{}] of size: {}\",\n fragId,\n i,\n bytesWriten);\n }\n }\n // if (maxSuperStep > 0) {\n // grapeMessager.ForceContinue();\n // maxSuperStep -= 1;\n // }\n\n // logger.debug(\"[Unused res] {}\", unused);\n // logger.debug(\"adaptor hasNext {}, grape hasNext{}\", adaptorHasNext, grapeHasNext);\n // logger.debug(\"adaptor next {}, grape next {}\", adaptorNext, grapeNext);\n // logger.debug(\"adaptor neighbor {}, grape neighbor {}\", adaptorNeighbor,\n // grapeNeighbor);\n }", "private void handleReady(String[] msg, DataOutputStream os) throws IOException {\n\t\t\n\n\t\tif(msg[0] != null) {\n\t\t\t\n\t\t\tE_Direction newDirection = RoadPart.getDirectionBetweenTwoParts(entity.getFrontCell(), entity.getBackCell());\n\t\t os.writeUTF(\"ACK\"+\" \"+\"RDY\"+\" \"+\"CDR:\"+newDirection.toString()+\" \"+\"PDR:\"+getPossibleDirections());\n\t\t \n\t\t}\n\t\t\n\t\telse \n\t\t\tos.writeUTF(\"NACK\"+\" \"+\"RDY\");\n\t\t\n\t}", "pb4server.FindBuffIsHaveAskReq getFindBuffIsHaveAskReq();", "@Override\n public void run()\n {\n try\n {\n MulticastSocket multicastSocket = new MulticastSocket(55559);\n //My chosen multicast ip.\n String multicastIP = \"224.0.159.82\";\n multicastSocket.joinGroup(InetAddress.getByName(multicastIP));\n //Receiver on continuous loop.\n while (receiverOn)\n {\n //Check network flag.\n if (frame.getSelectPanel().network())\n {\n DatagramPacket receivePacket = new DatagramPacket(receiveData, receiveData.length);\n multicastSocket.receive(receivePacket);\n byte[] b = receivePacket.getData();\n System.out.println(\"Receive: \" + b.length);\n ByteArrayInputStream bis = new ByteArrayInputStream(b);\n ObjectInput in = new ObjectInputStream(bis);\n\n try\n {\n int[] data = (int[]) in.readObject();\n System.out.println(\"This: \" + frame.getId() + \"\\tFrom: \" + data[0]);\n //Exclude messages that originated at this peer.\n if (data[0] != frame.getId())\n {\n //Action based on int at data[1]\n switch (data[1])\n {\n case Draw.CLEAR:\n case Draw.DRAW:\n case Draw.TEXT:\n case Draw.CIRCLE:\n case Draw.IMAGE:\n frame.getDraw().put(data);\n break;\n case REQ_IP:\n int key = data[0];\n String ip = String.format(\"%d.%d.%d.%d\", data[2], data[3], data[4], data[5]);\n frame.getPeerCache().addPeer(new Triple<>(key, ip, data[6]));\n int size = frame.getPeerCache().getSize();\n frame.getPeerCount().setText(String.format(\"Peer count: %d\", size));\n int[] myIp = frame.getMyIp();\n size = frame.getActionCache().getSize();\n int[] ipAns = {frame.getId(), ANS_IP, myIp[0], myIp[1], myIp[2], myIp[3], size};\n frame.getBroadcaster().put(ipAns);\n break;\n case ANS_IP:\n /*\n * 0 = id\n * 1 = data type\n * 2,3,4,6 = IP\n */\n key = data[0];\n ip = String.format(\"%d.%d.%d.%d\", data[2], data[3], data[4], data[5]);\n frame.getPeerCache().addPeer(new Triple<>(key, ip, data[6]));\n frame.getPeerCount().setText(\n String.format(\"Peer count: %d\", frame.getPeerCache().getSize()));\n break;\n case LEAVE_NOTE:\n ip = String.format(\"%d.%d.%d.%d\", data[2], data[3], data[4], data[5]);\n frame.getPeerCache().removePeer(ip);\n frame.getPeerCount().setText(\n String.format(\"Peer count: %d\", frame.getPeerCache().getSize()));\n break;\n case REQ_HISTORY:\n /*\n * 0 = id\n * 1 = data type\n * 2 = tarID\n * 3,4,5,6 = IP\n */\n if (data[2] == frame.getId())\n {\n ip = String.format(\"%d.%d.%d.%d\", data[3], data[4], data[5], data[6]);\n System.out.println(\"History request from \" + ip);\n UdpClient historyClient = new UdpClient(ip, frame.getActionCache());\n Thread historyThread = new Thread(historyClient);\n historyThread.start();\n }\n break;\n case CLEAR_REQ:\n String reqTitle = String.format(\"Peer %d has requested a clear.\", data[1]);\n int dialogResult = JOptionPane.showConfirmDialog(frame, \"Would you like to clear?\",\n reqTitle,\n JOptionPane.YES_NO_OPTION);\n if (dialogResult == JOptionPane.YES_OPTION)\n {\n int[] clear = {frame.getId(), Draw.CLEAR};\n frame.getDraw().put(clear);\n frame.clearAll();\n }\n break;\n case IMAGE_REQ:\n System.out.print(\"IMAGE REQUEST: \");\n System.out.println(data[2] + \" vs \" + frame.getId());\n if (data[2] == frame.getId())\n {\n ip = String.format(\"%d.%d.%d.%d\", data[4], data[5], data[6], data[7]);\n System.out.println(\"Image request from \" + ip);\n BufferedImage image = frame.getImageCache().get(data[3], data[7]);\n\n TcpClient tcpClient = new TcpClient(ip, image);\n Thread tcpThread = new Thread(tcpClient);\n tcpThread.start();\n }\n break;\n default:\n //Rogue packet protection.\n System.out.println(\"Received invalid packet.\");\n System.out.println(Arrays.toString(data));\n }\n }\n } catch (ClassNotFoundException | IndexOutOfBoundsException e)\n {\n //Rogue packet protection.\n //Message given, loop continues.\n System.out.println(\"Exception: Received invalid packet.\");\n e.printStackTrace();\n }\n }\n }\n } catch (IOException | InterruptedException e)\n {\n System.err.println(\"Error in Receiver class.\");\n System.err.println(e.getMessage());\n e.printStackTrace();\n }\n }", "@Override\n\tpublic void msgFedPart() {\n\t\t\n\t}", "boolean hasReceived();", "void send(Pack pack) { testing_pack = pack; }", "private final void m134907b(EventMessage abVar) {\n C28082z zVar = abVar.f96686j;\n Integer num = abVar.f96684h;\n int value = EventCode.ApplyForConnect.getValue();\n if (num != null && num.intValue() == value) {\n MqttBus a = MqttBus.f97541a.mo118711a();\n ApplyForConnectEvent bVar = zVar.f97419p;\n C32569u.m150513a((Object) bVar, C6969H.m41409d(\"G6C95D014AB7EAA39F6028977F4EAD1E86A8CDB14BA33BF\"));\n a.mo118710a(bVar);\n return;\n }\n int value2 = EventCode.PermitConnect.getValue();\n if (num != null && num.intValue() == value2) {\n MqttBus a2 = MqttBus.f97541a.mo118711a();\n PermitConnectEvent asVar = zVar.f97420q;\n C32569u.m150513a((Object) asVar, C6969H.m41409d(\"G6C95D014AB7EBB2CF403995CCDE6CCD96786D60E\"));\n a2.mo118710a(asVar);\n return;\n }\n int value3 = EventCode.RefuseConnect.getValue();\n if (num != null && num.intValue() == value3) {\n MqttBus a3 = MqttBus.f97541a.mo118711a();\n RefuseConnectEvent axVar = zVar.f97428y;\n C32569u.m150513a((Object) axVar, C6969H.m41409d(\"G6C95D014AB7EB92CE01B834DCDE6CCD96786D60E\"));\n a3.mo118710a(axVar);\n return;\n }\n int value4 = EventCode.BanConnection.getValue();\n if (num != null && num.intValue() == value4) {\n MqttBus a4 = MqttBus.f97541a.mo118711a();\n BanConnectionEvent cVar = zVar.f97429z;\n C32569u.m150513a((Object) cVar, C6969H.m41409d(\"G6C95D014AB7EA928E8319347FCEBC6D47D8ADA14\"));\n a4.mo118710a(cVar);\n return;\n }\n int value5 = EventCode.Disconnect.getValue();\n if (num != null && num.intValue() == value5) {\n MqttBus a5 = MqttBus.f97541a.mo118711a();\n DisconnectEvent nVar = zVar.f97372A;\n C32569u.m150513a((Object) nVar, C6969H.m41409d(\"G6C95D014AB7EAF20F50D9F46FCE0C0C3\"));\n a5.mo118710a(nVar);\n return;\n }\n int value6 = EventCode.ConfirmConnect.getValue();\n if (num != null && num.intValue() == value6) {\n MqttBus a6 = MqttBus.f97541a.mo118711a();\n ConfirmConnectEvent eVar = zVar.f97373B;\n C32569u.m150513a((Object) eVar, C6969H.m41409d(\"G6C95D014AB7EA826E808995AFFDAC0D8678DD019AB\"));\n a6.mo118710a(eVar);\n return;\n }\n int value7 = EventCode.ConnectTimeout.getValue();\n if (num != null && num.intValue() == value7) {\n MqttBus a7 = MqttBus.f97541a.mo118711a();\n ConnectTimeoutEvent hVar = zVar.f97378G;\n C32569u.m150513a((Object) hVar, C6969H.m41409d(\"G6C95D014AB7EA826E800954BE6DAD7DE6486DA0FAB\"));\n a7.mo118710a(hVar);\n return;\n }\n int value8 = EventCode.ConnectSuccess.getValue();\n if (num != null && num.intValue() == value8) {\n MqttBus a8 = MqttBus.f97541a.mo118711a();\n ConnectSuccessEvent gVar = zVar.f97421r;\n C32569u.m150513a((Object) gVar, C6969H.m41409d(\"G6C95D014AB7EA826E800954BE6DAD0C26A80D009AC\"));\n a8.mo118710a(gVar);\n return;\n }\n int value9 = EventCode.ConnectExit.getValue();\n if (num != null && num.intValue() == value9) {\n MqttBus a9 = MqttBus.f97541a.mo118711a();\n ConnectExitEvent fVar = zVar.f97422s;\n C32569u.m150513a((Object) fVar, C6969H.m41409d(\"G6C95D014AB7EA826E800954BE6DAC6CF6097\"));\n a9.mo118710a(fVar);\n return;\n }\n int value10 = EventCode.NewBullet.getValue();\n if (num != null && num.intValue() == value10) {\n MqttBus a10 = MqttBus.f97541a.mo118711a();\n NewBulletEvent anVar = zVar.f97405b;\n C32569u.m150513a((Object) anVar, C6969H.m41409d(\"G6C95D014AB7EA52CF131925DFEE9C6C3\"));\n Integer num2 = abVar.f96691o;\n a10.mo118710a(new CommentNormal(anVar, num2 != null ? num2.intValue() : 0));\n return;\n }\n int value11 = EventCode.EnterTheater.getValue();\n if (num == null || num.intValue() != value11) {\n int value12 = EventCode.NewGift.getValue();\n if (num != null && num.intValue() == value12) {\n MqttBus a11 = MqttBus.f97541a.mo118711a();\n NewGiftEvent aoVar = zVar.f97407d;\n C32569u.m150513a((Object) aoVar, C6969H.m41409d(\"G6C95D014AB7EA52CF1319741F4F1\"));\n a11.mo118710a(aoVar);\n return;\n }\n int value13 = EventCode.UpdateContributors.getValue();\n if (num == null || num.intValue() != value13) {\n int value14 = EventCode.UpdateHotValue.getValue();\n if (num != null && num.intValue() == value14) {\n MqttBus a12 = MqttBus.f97541a.mo118711a();\n UpdateHotValueEvent bmVar = zVar.f97409f;\n C32569u.m150513a((Object) bmVar, C6969H.m41409d(\"G6C95D014AB7EBE39E20F844DCDEDCCC35695D416AA35\"));\n a12.mo118710a(bmVar);\n return;\n }\n int value15 = EventCode.NewStatement.getValue();\n if (num != null && num.intValue() == value15) {\n MqttBus a13 = MqttBus.f97541a.mo118711a();\n NewStatementEvent aqVar = zVar.f97410g;\n C32569u.m150513a((Object) aqVar, C6969H.m41409d(\"G6C95D014AB7EA52CF131835CF3F1C6DA6C8DC1\"));\n a13.mo118710a(aqVar);\n return;\n }\n int value16 = EventCode.Interact.getValue();\n if (num != null && num.intValue() == value16) {\n MqttBus a14 = MqttBus.f97541a.mo118711a();\n InteractEvent ahVar = zVar.f97411h;\n C32569u.m150513a((Object) ahVar, C6969H.m41409d(\"G6C95D014AB7EA227F20B8249F1F1\"));\n a14.mo118710a(ahVar);\n return;\n }\n int value17 = EventCode.ReplyStatement.getValue();\n if (num != null && num.intValue() == value17) {\n MqttBus a15 = MqttBus.f97541a.mo118711a();\n ReplyStatementEvent azVar = zVar.f97417n;\n C32569u.m150513a((Object) azVar, C6969H.m41409d(\"G6C95D014AB7EB92CF6028977E1F1C2C36C8ED014AB\"));\n a15.mo118710a(azVar);\n return;\n }\n int value18 = EventCode.RepliedStatement.getValue();\n if (num != null && num.intValue() == value18) {\n MqttBus a16 = MqttBus.f97541a.mo118711a();\n RepliedStatementEvent ayVar = zVar.f97418o;\n C32569u.m150513a((Object) ayVar, C6969H.m41409d(\"G6C95D014AB7EB92CF602994DF6DAD0C36897D017BA3EBF\"));\n a16.mo118710a(ayVar);\n return;\n }\n int value19 = EventCode.TalkStart.getValue();\n if (num != null && num.intValue() == value19) {\n MqttBus a17 = MqttBus.f97541a.mo118711a();\n TalkStartEvent beVar = zVar.f97423t;\n C32569u.m150513a((Object) beVar, C6969H.m41409d(\"G6C95D014AB7EBF28EA05AF5BE6E4D1C3\"));\n a17.mo118710a(beVar);\n return;\n }\n int value20 = EventCode.TalkEnd.getValue();\n if (num != null && num.intValue() == value20) {\n MqttBus a18 = MqttBus.f97541a.mo118711a();\n TalkEndEvent bdVar = zVar.f97424u;\n C32569u.m150513a((Object) bdVar, C6969H.m41409d(\"G6C95D014AB7EBF28EA05AF4DFCE1\"));\n a18.mo118710a(bdVar);\n return;\n }\n int value21 = EventCode.DramaStart.getValue();\n if (num != null && num.intValue() == value21) {\n MqttBus a19 = MqttBus.f97541a.mo118711a();\n DramaStartEvent wVar = zVar.f97425v;\n C32569u.m150513a((Object) wVar, C6969H.m41409d(\"G6C95D014AB7EAF3BE7039177E1F1C2C57D\"));\n a19.mo118710a(wVar);\n return;\n }\n int value22 = EventCode.DramaEnd.getValue();\n if (num != null && num.intValue() == value22) {\n MqttBus a20 = MqttBus.f97541a.mo118711a();\n DramaEndEvent sVar = zVar.f97426w;\n C32569u.m150513a((Object) sVar, C6969H.m41409d(\"G6C95D014AB7EAF3BE7039177F7EBC7\"));\n a20.mo118710a(sVar);\n return;\n }\n int value23 = EventCode.ConnectorChange.getValue();\n if (num != null && num.intValue() == value23) {\n MqttBus a21 = MqttBus.f97541a.mo118711a();\n ConnectorChangeEvent jVar = zVar.f97427x;\n C32569u.m150513a((Object) jVar, C6969H.m41409d(\"G6C95D014AB7EA826E800954BE6EAD1E86A8BD414B835\"));\n a21.mo118710a(jVar);\n return;\n }\n int value24 = EventCode.UpdateDramaIncome.getValue();\n if (num != null && num.intValue() == value24) {\n MqttBus a22 = MqttBus.f97541a.mo118711a();\n UpdateDramaIncomeEvent bjVar = zVar.f97412i;\n C32569u.m150513a((Object) bjVar, C6969H.m41409d(\"G6C95D014AB7EBE39E20F844DCDE1D1D66482EA13B133A424E3\"));\n a22.mo118710a(bjVar);\n return;\n }\n int value25 = EventCode.DramaMustClose.getValue();\n if (num != null && num.intValue() == value25) {\n MqttBus a23 = MqttBus.f97541a.mo118711a();\n DramaMustCloseEvent uVar = zVar.f97374C;\n C32569u.m150513a((Object) uVar, C6969H.m41409d(\"G6C95D014AB7EAF3BE7039177FFF0D0C35680D915AC35\"));\n a23.mo118710a(uVar);\n return;\n }\n int value26 = EventCode.TheaterMustLeave.getValue();\n if (num != null && num.intValue() == value26) {\n MqttBus a24 = MqttBus.f97541a.mo118711a();\n TheaterMustLeaveEvent bgVar = zVar.f97375D;\n C32569u.m150513a((Object) bgVar, C6969H.m41409d(\"G6C95D014AB7EBF21E30F844DE0DACEC27A97EA16BA31BD2C\"));\n a24.mo118710a(bgVar);\n return;\n }\n int value27 = EventCode.FollowActor.getValue();\n if (num != null && num.intValue() == value27) {\n MqttBus a25 = MqttBus.f97541a.mo118711a();\n FollowActorEvent agVar = zVar.f97379H;\n C32569u.m150513a((Object) agVar, C6969H.m41409d(\"G6C95D014AB7EAD26EA029F5FCDE4C0C36691\"));\n a25.mo118710a(agVar);\n return;\n }\n int value28 = EventCode.EjectMember.getValue();\n if (num != null && num.intValue() == value28) {\n MqttBus a26 = MqttBus.f97541a.mo118711a();\n EjectMemberEvent xVar = zVar.f97382K;\n C32569u.m150513a((Object) xVar, C6969H.m41409d(\"G6C95D014AB7EAE23E30D8477FFE0CED56C91\"));\n a26.mo118710a(xVar);\n return;\n }\n int value29 = EventCode.QuietMember.getValue();\n if (num != null && num.intValue() == value29) {\n MqttBus a27 = MqttBus.f97541a.mo118711a();\n QuietMemberEvent awVar = zVar.f97380I;\n C32569u.m150513a((Object) awVar, C6969H.m41409d(\"G6C95D014AB7EBA3CEF0B8477FFE0CED56C91\"));\n a27.mo118710a(awVar);\n return;\n }\n int value30 = EventCode.CancelQuietMember.getValue();\n if (num != null && num.intValue() == value30) {\n MqttBus a28 = MqttBus.f97541a.mo118711a();\n CancelQuietMemberEvent dVar = zVar.f97381J;\n C32569u.m150513a((Object) dVar, C6969H.m41409d(\"G6C95D014AB7EA828E80D9544CDF4D6DE6C97EA17BA3DA92CF4\"));\n a28.mo118710a(dVar);\n return;\n }\n int value31 = EventCode.DeleteBullet.getValue();\n if (num != null && num.intValue() == value31) {\n MqttBus a29 = MqttBus.f97541a.mo118711a();\n DeleteBulletEvent lVar = zVar.f97383L;\n C32569u.m150513a((Object) lVar, C6969H.m41409d(\"G6C95D014AB7EAF2CEA0B844DCDE7D6DB6586C1\"));\n a29.mo118710a(lVar);\n return;\n }\n int value32 = EventCode.Ping.getValue();\n if (num != null && num.intValue() == value32) {\n MqttBus a30 = MqttBus.f97541a.mo118711a();\n PingEvent atVar = zVar.f97387P;\n C32569u.m150513a((Object) atVar, C6969H.m41409d(\"G6C95D014AB7EBB20E809\"));\n a30.mo118710a(atVar);\n return;\n }\n int value33 = EventCode.Alert.getValue();\n if (num != null && num.intValue() == value33) {\n MqttBus a31 = MqttBus.f97541a.mo118711a();\n AlertEvent aVar = zVar.f97385N;\n C32569u.m150513a((Object) aVar, C6969H.m41409d(\"G6C95D014AB7EAA25E31C84\"));\n a31.mo118710a(aVar);\n return;\n }\n int value34 = EventCode.MustDisconnect.getValue();\n if (num != null && num.intValue() == value34) {\n MqttBus a32 = MqttBus.f97541a.mo118711a();\n MustDisconnectEvent amVar = zVar.f97386O;\n C32569u.m150513a((Object) amVar, C6969H.m41409d(\"G6C95D014AB7EA63CF51AAF4CFBF6C0D8678DD019AB\"));\n a32.mo118710a(amVar);\n return;\n }\n int value35 = EventCode.DeleteStatement.getValue();\n if (num != null && num.intValue() == value35) {\n MqttBus a33 = MqttBus.f97541a.mo118711a();\n DeleteStatementEvent mVar = zVar.f97384M;\n C32569u.m150513a((Object) mVar, C6969H.m41409d(\"G6C95D014AB7EAF2CEA0B844DCDF6D7D67D86D81FB124\"));\n a33.mo118710a(mVar);\n return;\n }\n int value36 = EventCode.DramaContinue.getValue();\n if (num != null && num.intValue() == value36) {\n MqttBus a34 = MqttBus.f97541a.mo118711a();\n DramaContinueEvent rVar = zVar.f97377F;\n C32569u.m150513a((Object) rVar, C6969H.m41409d(\"G6C95D014AB7EAF3BE7039177F1EACDC3608DC01F\"));\n a34.mo118710a(rVar);\n return;\n }\n int value37 = EventCode.DramaPause.getValue();\n if (num != null && num.intValue() == value37) {\n MqttBus a35 = MqttBus.f97541a.mo118711a();\n DramaPauseEvent vVar = zVar.f97376E;\n C32569u.m150513a((Object) vVar, C6969H.m41409d(\"G6C95D014AB7EAF3BE7039177E2E4D6C46C\"));\n a35.mo118710a(vVar);\n return;\n }\n int value38 = EventCode.CreatePoll.getValue();\n if (num != null && num.intValue() == value38) {\n MqttBus a36 = MqttBus.f97541a.mo118711a();\n CreatePollEvent kVar = zVar.f97388Q;\n C32569u.m150513a((Object) kVar, C6969H.m41409d(\"G6C95D014AB7EA83BE30F844DCDF5CCDB65\"));\n a36.mo118710a(kVar);\n return;\n }\n int value39 = EventCode.FinishPoll.getValue();\n if (num != null && num.intValue() == value39) {\n MqttBus a37 = MqttBus.f97541a.mo118711a();\n FinishPollEvent afVar = zVar.f97389R;\n C32569u.m150513a((Object) afVar, C6969H.m41409d(\"G6C95D014AB7EAD20E8078340CDF5CCDB65\"));\n a37.mo118710a(afVar);\n return;\n }\n int value40 = EventCode.PollVote.getValue();\n if (num != null && num.intValue() == value40) {\n MqttBus a38 = MqttBus.f97541a.mo118711a();\n PollVoteEvent avVar = zVar.f97413j;\n C32569u.m150513a((Object) avVar, C6969H.m41409d(\"G6C95D014AB7EBB26EA02AF5EFDF1C6\"));\n a38.mo118710a(avVar);\n return;\n }\n int value41 = EventCode.UpdatePollStatistics.getValue();\n if (num != null && num.intValue() == value41) {\n MqttBus a39 = MqttBus.f97541a.mo118711a();\n UpdatePollStatisticsEvent bnVar = zVar.f97414k;\n C32569u.m150513a((Object) bnVar, C6969H.m41409d(\"G6C95D014AB7EBE39E20F844DCDF5CCDB65BCC60EBE24A23AF207935B\"));\n a39.mo118710a(bnVar);\n return;\n }\n int value42 = EventCode.ObtainRedPacket.getValue();\n if (num != null && num.intValue() == value42) {\n MqttBus a40 = MqttBus.f97541a.mo118711a();\n ObtainRedPacketEvent arVar = zVar.f97391T;\n C32569u.m150513a((Object) arVar, C6969H.m41409d(\"G6C95D014AB7EA42BF20F9946CDF7C6D35693D419B435BF\"));\n a40.mo118710a(arVar);\n return;\n }\n int value43 = EventCode.NewRedPacket.getValue();\n if (num != null && num.intValue() == value43) {\n MqttBus a41 = MqttBus.f97541a.mo118711a();\n NewRedPacketEvent apVar = zVar.f97390S;\n C32569u.m150513a((Object) apVar, C6969H.m41409d(\"G6C95D014AB7EA52CF131824DF6DAD3D66A88D00E\"));\n a41.mo118710a(apVar);\n return;\n }\n int value44 = EventCode.FansTeamLevelUpgrade.getValue();\n if (num != null && num.intValue() == value44) {\n MqttBus a42 = MqttBus.f97541a.mo118711a();\n FansTeamLevelUpgradeEvent adVar = zVar.f97392U;\n C32569u.m150513a((Object) adVar, C6969H.m41409d(\"G6C95D014AB7EAD28E81DAF5CF7E4CEE86586C31FB30FBE39E11C914CF7\"));\n a42.mo118710a(adVar);\n return;\n }\n int value45 = EventCode.JoinFansTeam.getValue();\n if (num != null && num.intValue() == value45) {\n MqttBus a43 = MqttBus.f97541a.mo118711a();\n JoinFansTeamEvent ajVar = zVar.f97393V;\n C32569u.m150513a((Object) ajVar, C6969H.m41409d(\"G6C95D014AB7EA126EF00AF4EF3EBD0E87D86D417\"));\n a43.mo118710a(ajVar);\n return;\n }\n int value46 = EventCode.TheaterActivity.getValue();\n if (num != null && num.intValue() == value46) {\n MqttBus a44 = MqttBus.f97541a.mo118711a();\n TheaterActivityEvent bfVar = zVar.f97394W;\n C32569u.m150513a((Object) bfVar, C6969H.m41409d(\"G6C95D014AB7EBF21E30F844DE0DAC2D47D8AC313AB29\"));\n a44.mo118710a(bfVar);\n return;\n }\n int value47 = EventCode.VideoFocusApply.getValue();\n if (num != null && num.intValue() == value47) {\n MqttBus a45 = MqttBus.f97541a.mo118711a();\n VideoFocusApplyEvent bpVar = zVar.f97395X;\n C32569u.m150513a((Object) bpVar, C6969H.m41409d(\"G6C95D014AB7EBD20E20B9F77F4EAC0C27ABCD40AAF3CB2\"));\n a45.mo118710a(bpVar);\n return;\n }\n int value48 = EventCode.VideoFocusRefused.getValue();\n if (num != null && num.intValue() == value48) {\n MqttBus a46 = MqttBus.f97541a.mo118711a();\n VideoFocusRefusedEvent brVar = zVar.f97396Y;\n C32569u.m150513a((Object) brVar, C6969H.m41409d(\"G6C95D014AB7EBD20E20B9F77F4EAC0C27ABCC71FB925B82CE2\"));\n a46.mo118710a(brVar);\n return;\n }\n int value49 = EventCode.UpdateDramaMemberIncome.getValue();\n if (num != null && num.intValue() == value49) {\n MqttBus a47 = MqttBus.f97541a.mo118711a();\n UpdateDramaMemberIncomeEvent bkVar = zVar.f97415l;\n C32569u.m150513a((Object) bkVar, C6969H.m41409d(\"G6C95D014AB7EBE39E20F844DCDE1D1D66482EA17BA3DA92CF4319946F1EACED2\"));\n a47.mo118710a(bkVar);\n return;\n }\n int value50 = EventCode.SyncDramaAudioStatus.getValue();\n if (num != null && num.intValue() == value50) {\n MqttBus a48 = MqttBus.f97541a.mo118711a();\n SyncDramaAudioStatusEvent bcVar = zVar.f97400ac;\n C32569u.m150513a((Object) bcVar, C6969H.m41409d(\"G6C95D014AB7EB830E80DAF4CE0E4CED65682C01EB63F943AF20F845DE1\"));\n a48.mo118710a(bcVar);\n return;\n }\n int value51 = EventCode.StatementVoteCountMilestone.getValue();\n if (num != null && num.intValue() == value51) {\n MqttBus a49 = MqttBus.f97541a.mo118711a();\n StatementVoteCountMilestoneEvent bbVar = zVar.f97399ab;\n C32569u.m150513a((Object) bbVar, C6969H.m41409d(\"G6C95D014AB7EB83DE71A9545F7EBD7E87F8CC11F8033A43CE81AAF45FBE9C6C47D8CDB1F\"));\n a49.mo118710a(bbVar);\n return;\n }\n int value52 = EventCode.StatementQuestionMilestone.getValue();\n if (num != null && num.intValue() == value52) {\n MqttBus a50 = MqttBus.f97541a.mo118711a();\n StatementQuestionMilestoneEvent baVar = zVar.f97403af;\n C32569u.m150513a((Object) baVar, C6969H.m41409d(\"G6C95D014AB7EB83DE71A9545F7EBD7E87896D009AB39A427D9039944F7F6D7D86786\"));\n a50.mo118710a(baVar);\n return;\n }\n int value53 = EventCode.VideoFocusTimeout.getValue();\n if (num != null && num.intValue() == value53) {\n MqttBus a51 = MqttBus.f97541a.mo118711a();\n VideoFocusTimeoutEvent bsVar = zVar.f97397Z;\n C32569u.m150513a((Object) bsVar, C6969H.m41409d(\"G6C95D014AB7EBD20E20B9F77F4EAC0C27ABCC113B235A43CF2\"));\n a51.mo118710a(bsVar);\n return;\n }\n int value54 = EventCode.VideoFocusEnd.getValue();\n if (num != null && num.intValue() == value54) {\n MqttBus a52 = MqttBus.f97541a.mo118711a();\n VideoFocusEndEvent bqVar = zVar.f97398aa;\n C32569u.m150513a((Object) bqVar, C6969H.m41409d(\"G6C95D014AB7EBD20E20B9F77F4EAC0C27ABCD014BB\"));\n a52.mo118710a(bqVar);\n return;\n }\n int value55 = EventCode.UpdateDramaCampStatistics.getValue();\n if (num != null && num.intValue() == value55) {\n MqttBus a53 = MqttBus.f97541a.mo118711a();\n UpdateDramaCampStatisticsEvent biVar = zVar.f97416m;\n C32569u.m150513a((Object) biVar, C6969H.m41409d(\"G6C95D014AB7EBE39E20F844DCDE1D1D66482EA19BE3DBB16F51A915CFBF6D7DE6A90\"));\n a53.mo118710a(biVar);\n return;\n }\n int value56 = EventCode.JoinDramaCamp.getValue();\n if (num != null && num.intValue() == value56) {\n MqttBus a54 = MqttBus.f97541a.mo118711a();\n JoinDramaCampEvent aiVar = zVar.f97401ad;\n C32569u.m150513a((Object) aiVar, C6969H.m41409d(\"G6C95D014AB7EA126EF00AF4CE0E4CED65680D417AF\"));\n a54.mo118710a(aiVar);\n return;\n }\n int value57 = EventCode.UpdateTheaterConfig.getValue();\n if (num != null && num.intValue() == value57) {\n MqttBus a55 = MqttBus.f97541a.mo118711a();\n UpdateTheaterConfigEvent boVar = zVar.f97402ae;\n C32569u.m150513a((Object) boVar, C6969H.m41409d(\"G6C95D014AB7EBE39E20F844DCDF1CBD26897D0088033A427E00797\"));\n a55.mo118710a(boVar);\n return;\n }\n int value58 = EventCode.UpdateDurationTreasureBox.getValue();\n if (num != null && num.intValue() == value58) {\n MqttBus a56 = MqttBus.f97541a.mo118711a();\n UpdateDurationTreasureBoxEvent blVar = zVar.f97404ag;\n C32569u.m150513a((Object) blVar, C6969H.m41409d(\"G6C95D014AB7EBE39E20F844DCDE1D6C56897DC15B10FBF3BE30F835DE0E0FCD5669B\"));\n a56.mo118710a(blVar);\n }\n } else if (FlowControlHelper.f97498a.mo118671a(EventCode.UpdateContributors.getValue())) {\n MqttBus a57 = MqttBus.f97541a.mo118711a();\n UpdateContributorsEvent bhVar = zVar.f97408e;\n C32569u.m150513a((Object) bhVar, C6969H.m41409d(\"G6C95D014AB7EBE39E20F844DCDE6CCD97D91DC18AA24A43BF5\"));\n a57.mo118710a(bhVar);\n }\n } else if (FlowControlHelper.f97498a.mo118671a(EventCode.EnterTheater.getValue())) {\n MqttBus a58 = MqttBus.f97541a.mo118711a();\n EnterTheaterEvent yVar = zVar.f97406c;\n C32569u.m150513a((Object) yVar, C6969H.m41409d(\"G6C95D014AB7EAE27F20B8277E6EDC6D67D86C7\"));\n a58.mo118710a(yVar);\n }\n }", "void process(ToSend m) {\n ByteBuffer requestBuffer = buildMsg(m.state.ordinal(), m.leader, m.zxid, m.electionEpoch, m.peerEpoch, m.configData);\n\n manager.toSend(m.sid, requestBuffer);\n\n }", "abstract BookieId maybeSendSpeculativeRead(BitSet heardFromHostsBitSet);", "public void doPack() {\n if (this._sendData == null) {\n this._sendData = new byte[13];\n }\n this._sendData[0] = 0;\n if (this.isMenu) {\n byte[] bArr = this._sendData;\n bArr[0] = (byte) (bArr[0] | 1);\n }\n if (this.isPlayback) {\n byte[] bArr2 = this._sendData;\n bArr2[0] = (byte) (bArr2[0] | 2);\n }\n if (this.isRecord) {\n byte[] bArr3 = this._sendData;\n bArr3[0] = (byte) (bArr3[0] | 4);\n }\n BytesUtil.arraycopy(generateChannelByte(), this._sendData, 1);\n this._sendData[11] = 0;\n if (this.isButton) {\n byte[] bArr4 = this._sendData;\n bArr4[11] = (byte) (bArr4[11] | 1);\n }\n byte[] bArr5 = this._sendData;\n bArr5[11] = (byte) (bArr5[11] | (this.buttonData << 1));\n byte[] bArr6 = this._sendData;\n bArr6[11] = (byte) (bArr6[11] | (this.symbol << 6));\n byte[] bArr7 = this._sendData;\n bArr7[11] = (byte) (bArr7[11] | (this.change << 7));\n byte[] bArr8 = this._sendData;\n bArr8[12] = (byte) (bArr8[12] | this.shutter);\n byte[] bArr9 = this._sendData;\n bArr9[12] = (byte) (bArr9[12] | (this.focus << 1));\n byte[] bArr10 = this._sendData;\n bArr10[12] = (byte) (bArr10[12] | (this.mode_sw << 2));\n byte[] bArr11 = this._sendData;\n bArr11[12] = (byte) (bArr11[12] | (this.transform_sw << 4));\n byte[] bArr12 = this._sendData;\n bArr12[12] = (byte) (bArr12[12] | (this.gohome << 6));\n }", "@Override\n \t\t\tpublic void run ()\n \t\t\t{\n \t\t\t\tsynchronized ( heard )\n \t\t\t\t{\n \t\t\t\t\theard.clear ();\n \t\t\t\t}\n \t\t\t\t// re-transmit own until not in a block\n \t\t\t\tsynchronized ( own )\n \t\t\t\t{\n \t\t\t\t\tif ( !own.isEmpty () )\n \t\t\t\t\t{\n \t\t\t\t\t\tfor ( BitcoinPeer peer : network.getConnectPeers () )\n \t\t\t\t\t\t{\n \t\t\t\t\t\t\tInvMessage tm = (InvMessage) peer.createMessage (\"inv\");\n \t\t\t\t\t\t\tfor ( Tx t : own )\n \t\t\t\t\t\t\t{\n \t\t\t\t\t\t\t\tlog.debug (\"Re-broadcast \" + t.getHash ());\n \t\t\t\t\t\t\t\ttm.getTransactionHashes ().add (new Hash (t.getHash ()).toByteArray ());\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\tpeer.send (tm);\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}", "@Override\n public void run() {\n List<Integer> list = new ArrayList<Integer>();\n int num_peer = P.peer_port.length;\n int ind = -1;\n while (P.choke_thread_running) {\n synchronized (P.lock_current_neighbors) { //lock the object\n for (int i = 0; i < num_peer; i++) {\n list.add(i);\n }\n //select randomly.\n java.util.Collections.shuffle(list);\n int[] cn = P.current_neighbors.clone();\n Arrays.sort(cn);\n for (int i = 0; i < num_peer; i++) {\n int ind2 = list.get(i);\n if (P.is_interested[ind2] && Arrays.binarySearch(cn, P.peer_id[ind2]) < 0 && P.peer_id[ind2] != P.id && P.sockets[ind2]!=null) {\n ind = ind2;\n P.current_neighbors[P.current_neighbors.length - 1] = P.peer_id[ind];\n break;\n }\n\n }\n }\n //send unchoke message.\n Message msg = new Message();\n msg.length = 0; //no payload.\n msg.type = 1; //unchoke.\n msg.payload = null; //no payload.\n \n if (ind >= 0) //there is someone interested in my data.\n {\n P.send(P.peer_id[ind], msg);\n P.print(\"OptChoke unchoked peer with id \" + P.peer_id[ind]);\n }\n ind = -1;\n //print debugging info.\n \n //sleep some interval.\n try {\n Thread.sleep(1000 * P.optimistic_unchoking_interval);\n } catch (InterruptedException ex) {\n Thread.currentThread().interrupt();\n }\n }\n }", "void onChoke(boolean state)\n {\n peerChoke = state;\n //if (DEBUG) System.out.println(peer.address + \" onChoke: \" + state);\n\n if (peerChoke) {\n // remove all enqueued requests as they will be dropped by the remote peer\n for (int i = sendQueue.size() - 1; 0 <= i; i--) {\n StdPeerMessage pm = sendQueue.get(i);\n if (pm.type == StdPeerMessage.REQUEST) {\n sendQueue.remove(i);\n // notify torrent about cancelled request\n torrent.cancelBlockRequest(pm.index, pm.begin);\n pmCache.release(pm);\n }\n }\n // it's possible that we have requests that were already sent to external peer,\n // notify torrent - they are cancelled too [who knows, maybe data will arrive]\n for (int i = 0; i < blockRequests.size(); i++) {\n StdPeerMessage pm = blockRequests.get(i);\n torrent.cancelBlockRequest(pm.index, pm.begin);\n pmCache.release(pm);\n }\n blockRequests.clear();\n }\n }", "public void setReceived(FIPA_Received received) {\n this.received.addElement(received);\n }", "public static int offsetBits_receivets() {\n return 72;\n }", "public void beforeReceive() {\n\t}", "protected abstract boolean systemReadyToHandleReceivedMessage();", "@Override\n public void run() {\n List<Integer> list = new ArrayList<Integer>();\n int num_peer = P.peer_port.length;\n int ind = -1;\n for (int i = 0; i < num_peer; i++) {\n list.add(i);\n }\n while (P.choke_thread_running) {\n synchronized (P.lock_current_neighbors) { //lock the object\n\n if(P.current_neighbors==null) continue;\n\n int[] cn = P.current_neighbors.clone(); //current neighbor.\n Arrays.sort(cn);\n if (P.own_file || P.finished) { //select randomly.\n java.util.Collections.shuffle(list);\n int cnt = 0; //#peers selected.\n for (int i = 0; i < num_peer && cnt < P.num_preferred_neighbors; i++) {\n ind = list.get(i);\n if (P.is_interested[ind] && P.peer_id[ind] != P.id) {\n P.current_neighbors[cnt++] = P.peer_id[ind];\n //send unchoke message to previously choked peer.\n if (Arrays.binarySearch(cn, P.peer_id[ind]) < 0) {\n Message msg = new Message();\n msg.length = 0; //no payload.\n msg.type = 1; //unchoke.\n msg.payload = null; //no payload.\n P.send(P.peer_id[ind], msg);\n }\n }\n }\n P.print(\"Choke selected \" + cnt + \" neighbors randomly.\");\n } else { //select according to the download rates.\n int[] order = getIndices(P.download_rates);\n int cnt = 0; //#peers selected.\n for (int i = 0; i < num_peer && cnt < P.num_preferred_neighbors; i++) {\n ind = order[i];\n if (P.is_interested[ind] && P.peer_id[ind] != P.id) {\n P.current_neighbors[cnt++] = P.peer_id[ind];\n //send unchoke message to previously choked peer.\n if (Arrays.binarySearch(cn, P.peer_id[ind]) < 0) {\n Message msg = new Message();\n msg.length = 0; //no payload.\n msg.type = 1; //unchoke.\n msg.payload = null; //no payload.\n P.send(P.peer_id[ind], msg);\n }\n }\n }\n //print debugging info.\n P.print(\"Choke selected \" + cnt + \" neighbors according to download rates.\");\n }\n //send choke message to peers previously unchoked but currently choked.\n Arrays.sort(Arrays.copyOfRange(P.current_neighbors, 0, P.num_preferred_neighbors - 1));\n for (int i = 0; i < P.num_preferred_neighbors; i++) {\n if (Arrays.binarySearch(P.current_neighbors, cn[i]) < 0) { //cn[i] not in current neighbor list.\n Message msg = new Message();\n msg.length = 0; //no payload.\n msg.type = 0; //choke.\n msg.payload = null; //no payload.\n P.send(P.peer_id[ind], msg);\n }\n }\n }\n //sleep some interval.\n try {\n Thread.sleep(1000 * P.unchoking_internal);\n } catch (InterruptedException ex) {\n Thread.currentThread().interrupt();\n }\n }\n }", "public void setOnReceiveCalled() {\n this.f49 = true;\n }", "public void updateACMsg(OL_Message msg) {\n FSM_Extension e = ((FSM_Extension) msg.getFirstExtensionByType(Extension.FSM));\n switch(myState) {\n case NoPayload_Recover:\n {\n switch(e.getType()) {\n case DONT_HAVE_IT:\n {\n myState = NoPayload_NoRecover;\n messageStore.setTimer(this, REC_TIMER_INDEX, timeout_REC);\n }\n break;\n case HAVE_IT:\n {\n neighboraddress = msg.getSourceAddress();\n sendToNode(NACK_SYNC, msg.getSourceAddress());\n myState = WaitforPayload;\n messageStore.setTimer(this, NACK_TIMER_INDEX, timeout_NACK);\n messageStore.setTimer(this, MAXNACK_TIMER_INDEX, max_NACK);\n }\n break;\n case NACK_SYNC:\n case QUERY_MSG_SYNC:\n {\n sendToNode(DONT_HAVE_IT, msg.getSourceAddress());\n myState = NoPayload_NoRecover;\n messageStore.setTimer(this, REC_TIMER_INDEX, timeout_REC);\n }\n break;\n }\n }\n break;\n case NoPayload_NoRecover:\n {\n switch(e.getType()) {\n case HAVE_IT:\n {\n neighboraddress = msg.getSourceAddress();\n sendToNode(NACK_SYNC, msg.getSourceAddress());\n myState = WaitforPayload;\n messageStore.setTimer(this, NACK_TIMER_INDEX, timeout_NACK);\n messageStore.setTimer(this, MAXNACK_TIMER_INDEX, max_NACK);\n }\n break;\n case NACK_SYNC:\n case QUERY_MSG_SYNC:\n {\n sendToNode(DONT_HAVE_IT, msg.getSourceAddress());\n }\n break;\n }\n }\n break;\n case WaitforPayload:\n {\n switch(e.getType()) {\n case DONT_HAVE_IT:\n {\n if (neighboraddress != msg.getSourceAddress() && neighboraddress != null) {\n sendToNode(NACK_SYNC, neighboraddress);\n } else {\n myState = NoPayload_NoRecover;\n messageStore.setTimer(this, REC_TIMER_INDEX, timeout_REC);\n }\n }\n break;\n case HAVE_IT:\n {\n neighboraddress = msg.getSourceAddress();\n }\n break;\n case NACK_SYNC:\n case QUERY_MSG_SYNC:\n {\n sendToNode(DONT_HAVE_IT, msg.getSourceAddress());\n }\n break;\n }\n }\n break;\n case HavePayload:\n {\n if (e.getType() == NACK_SYNC) {\n OL_Message payload = (OL_Message) socket.createMessage(data);\n ;\n msg.setHopLimit((short) 1);\n FSM_Extension ee = new FSM_Extension(MessageStore.FSM_SYNCHRONIZATION, PAYLOAD, messageid);\n payload.addExtension(ee);\n payload.setDeliveryMode(OL_Message.DELIVERY_MODE_UNICAST);\n payload.setDestinationAddress(msg.getSourceAddress());\n socket.forwardToParent(payload);\n } else if (e.getType() == QUERY_MSG_SYNC) {\n sendToNode(HAVE_IT, msg.getSourceAddress());\n }\n }\n break;\n }\n }", "public void Send3bytes(int comm, int data, int more) { // in {FF} Arduino\r\n int info = data & 127;\r\n boolean logy = ((SpokeHard & 0xFFFF) < SpeakHard)\r\n || LogAllPcnts && (comm == REPORT_PULSECOUNT); // = 0xA0;\r\n byte[] msg = new byte[3];\r\n SpokeHard++;\r\n if (more < 0){\r\n more = (data >> 7) & 127;\r\n if (logy) System.out.println(\"F%%F/Send3by \" + comm + \" \" + data\r\n + \" .. => \" + info + \" \" + more + FormatMillis(\" @ \", 0x80000000));\r\n data = info;\r\n } else if (logy){\r\n System.out.println(\"F%%F/Send3by \" + comm + \" \" + data + \" \" + more +\r\n FormatMillis(\" @ \", 0x80000000));\r\n }\r\n if (comm < 128){\r\n return;\r\n } // not a valid command byte..\r\n if (comm > 255){\r\n return;\r\n }\r\n more = more & 127;\r\n data = info;\r\n msg[0] = (byte) (comm);\r\n msg[1] = (byte) (data);\r\n msg[2] = (byte) (more);\r\n try {\r\n surrealPort.writeBytes(msg);\r\n if (DoMore != null) DoMore.SendBytes(msg, 3);\r\n } catch (Exception ex) {\r\n System.out.println(ex);\r\n }\r\n }", "public void broadcastHave(int pieceIndex) {\n\t\tMessageHave have = new MessageHave(pieceIndex);\n\t\tdownloadedBytes -= files.getPiece(pieceIndex).getSize();\n\t\tfiles.havePiece(pieceIndex);\n\t\tfor (int i = 0; i < peers.size(); i++) {\n\t\t\tPeer p = peers.get(i);\n\t\t\tif (!p.closed() && p.getPassedHandshake()) {\n\t\t\t\tp.addToQueue(have);\n\t\t\t}\n\t\t}\n\t}", "public void communicate() {\n // Send\n for (int i = 0; i < robots.length; i++) {\n if (i != this.id) {\n if (objectFound) {\n System.out.println(\"Robot \" + this.id + \": Telling everyone else...\");\n this.robots[i].mailbox[i] = new Message(this.id, this.objectFound, goal);\n } else {\n this.robots[i].mailbox[i] = new Message(this.id, this.objectFound, null);\n }\n }\n }\n // Read\n for (int i = 0; i < mailbox.length; i++) {\n if (i != this.id && mailbox[i] != null && mailbox[i].objectFound) {\n this.objectFound = true;\n this.goal = mailbox[i].objectLocation;\n }\n }\n }", "private void uploadingPacketDealer(Packet packet) {\n short filenumber = packet.getFileNumber();\n boolean downloading = false;\n \n if (packet.hasSynchronizeFlag()) { \n receiver = new ReliableReceiver(sendQueue, filenumber, downloading, FOLDERPATHSERVER);\n this.receivingMap.put(filenumber, receiver);\n receiver.start();\n receiver.addToReadingQueue(packet.getContent(), packet.getSeqNumber(), packet.hasFinalFlag());\n } else if (packet.hasAcknowledgementFlag()) {\n sender = sendingMap.get(filenumber);\n sender.changeLastAcknowledgeReceived(packet.getAckNumber());\n sendQueue.stopTimeout(packet.getAckNumber()-1);\n } else {\n receiver = receivingMap.get(filenumber);\n receiver.addToReadingQueue(packet.getContent(), packet.getSeqNumber(), packet.hasFinalFlag());\n }\n \n }", "@Override\n\tpublic void landedOn(Piece piece) {\n\t\t\n\t}", "@Override\n\tpublic void receive() {\n\t}", "void mo80456b(Message message);", "private void onReceiveMessage(Edge edgeItoJ) throws FactorException {\n\t\t\tSystem.out.printf(\"%s receiving message from %s, upward? %s\\n\", this.toString(), edgeItoJ.getOtherVertex(this), _bumpOnUpwardPass);\n\t\t\tif(!_neighborEdges.containsKey(edgeItoJ)) {\n\t\t\t\tSystem.err.println(\"hello check\");\n\t\t\t}\n\t\t\t_neighborEdges.put(edgeItoJ, true);\n\t\t\tcomputeBeliefIfReady();\n\t\t}", "public NeighborRecords(int Id, int pieceNum, Socket downSocket,Socket upSocket,Socket conSocket){\n \t\n \tpeerId=Id;\n \tchokeState=new AtomicInteger(0);\n bitField= new BitField(pieceNum);\n \tdownloadSocket=downSocket; \n uploadSocket=upSocket;\n controlSocket=conSocket;\n download=0;\n }", "protected void enqueue(StdPeerMessage message)\n {\n// if (DEBUG) {\n// if (message.type == StdPeerMessage.REQUEST) {\n// System.out.println(System.nanoTime() + \" [stdpc] enqueue: req \" + message.index + \" \" + (message.begin >> 14));\n// } else {\n// System.out.println(\"[stdpc] enqueue: \" + message.type);\n// }\n// }\n\n if (message.type == StdPeerMessage.CHOKE)\n {\n // remove reply messages with piece (block) data\n // from the send queue (due to spec)\n for (int i = sendQueue.size() - 1; 0 <= i; i--) {\n StdPeerMessage pm = sendQueue.get(i);\n if (pm.type == StdPeerMessage.PIECE) {\n sendQueue.remove(i);\n TorrentStorage.Block block = (TorrentStorage.Block) message.params;\n block.release();\n pmCache.release(pm);\n }\n }\n // set choke status\n choke = true;\n // send choke asap\n sendQueue.add(0, message);\n }\n else if (message.type == StdPeerMessage.CANCEL)\n {\n // remove the linked request if it's still in the queue\n for (int i = sendQueue.size() - 1; 0 <= i; i--) {\n StdPeerMessage pm = sendQueue.get(i);\n if ((pm.type == StdPeerMessage.REQUEST)\n && (pm.index == message.index)\n && (pm.begin == message.begin)\n && (pm.length == message.length)) // this check is redundant as length is fixed\n {\n sendQueue.remove(i);\n pmCache.release(pm);\n // don't really enqueue CANCEL as the linked request\n // has been found and removed\n pmCache.release(message);\n return;\n }\n }\n // send asap\n sendQueue.add(0, message);\n }\n else {\n if (message.type == StdPeerMessage.INTERESTED) {\n interested = true;\n }\n else if (message.type == StdPeerMessage.NOT_INTERESTED) {\n interested = false;\n }\n else if (message.type == StdPeerMessage.UNCHOKE) {\n choke = false;\n }\n\n // enqueue message\n sendQueue.add(message);\n }\n\n// sendQueue.forEach(pm -> System.out.println(\" -x> \" + System.identityHashCode(pm) + pm.type + \" ,\" + pm.index +\",\" + pm.begin +\",\" + pm.length) );\n\n }", "public void clearReceived() {\n\t\t_received = false;\n\t}", "@Override\n public void onChatMessageFragmentInteraction(MessageEnum message, Object result) {\n ((MyMessage)result).setSenderId(this.user.getUserId());\n ((MyMessage)result).setReceiverId(this.receiverId);\n ((MyMessage)result).setBookId(this.selectedBook.getBookId());\n //send message to message list\n databaseHandler.sendMessageToDatabase((MyMessage)result);\n //message should come back with reference change?\n }", "private void sendReceiveRes(){\n\t}", "public void setFlagsreceived(boolean flagsreceived) {\r\n this.flagsreceived = flagsreceived;\r\n }", "@Override\r\n\tpublic net.floodlightcontroller.core.IListener.Command receive(\r\n\t\t\tIOFSwitch sw, OFMessage msg, FloodlightContext cntx) {\n\t\tif (!printedTopo) \r\n\t\t{\r\n\t\t\tSystem.out.println(\"*** Print topology\");\r\n\t\t\tlinks = lds.getLinks();\r\n\t\t\tMap<Long, Set<Link>> switchList = lds.getSwitchLinks();\r\n\t\t\t\r\n\t\t\tfor(Map.Entry<Long, Set<Link>> entry : switchList.entrySet()) \r\n\t\t\t{\r\n\t\t\t\tSystem.out.print(\"switch \" + entry.getKey() + \" neighbors: \");\r\n\t\t\t\tHashSet<Long> linkIds = new HashSet<Long>();\r\n\t\t\t\t\r\n\t\t\t\tfor(Link link : entry.getValue()) \r\n\t\t\t\t{\r\n\t\t\t\t\tif(entry.getKey() == link.getDst()) \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tlinkIds.add(link.getSrc());\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tlinkIds.add(link.getDst());\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tboolean firstLink = true;\r\n\t\t\t\t\r\n\t\t\t\tfor(Long id : linkIds) \r\n\t\t\t\t{\r\n\t\t\t\t\tif(firstLink) \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(id);\r\n\t\t\t\t\t\tfirstLink = false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\", \" + id);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println();\r\n\t\t\t}\r\n\r\n\t\t\tprintedTopo = true;\r\n\t\t}\r\n\r\n\r\n\t\t// eth is the packet sent by a switch and received by floodlight.\r\n\t\tEthernet eth = IFloodlightProviderService.bcStore.get(cntx,\r\n\t\t\t\tIFloodlightProviderService.CONTEXT_PI_PAYLOAD);\r\n\r\n\t\t// We process only IP packets of type 0x0800.\r\n\t\tif (eth.getEtherType() != 0x0800) {\r\n\t\t\treturn Command.CONTINUE;\r\n\t\t}\r\n\t\telse{\r\n\t\t\tSystem.out.println(\"*** New flow packet\");\r\n\r\n\t\t// Parse the incoming packet.\r\n\t\t\tOFPacketIn pi = (OFPacketIn)msg;\r\n\t\t\tOFMatch match = new OFMatch();\r\n\t\t match.loadFromPacket(pi.getPacketData(), pi.getInPort());\r\n\t\t\t\r\n\t\t\t// Obtain source and destination IPs.\r\n\t\t\t// ...\r\n\t\t\tSystem.out.println(\"srcIP: \" + match.getNetworkSourceCIDR());\r\n\t System.out.println(\"dstIP: \" + match.getNetworkDestinationCIDR());\r\n\r\n\t\t\t// Calculate the path using Dijkstra's algorithm.\r\n\t\t\tRoute route = null;\r\n\t\t\t\r\n\t\t\t// ...\r\n\t\t\tSystem.out.println(\"route: \" + \"1 2 3 ...\");\t\t\t\r\n\r\n\t\t\t// Write the path into the flow tables of the switches on the path.\r\n\t\t\tif (route != null) {\r\n\t\t\t\tinstallRoute(route.getPath(), match);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn Command.STOP;\r\n\t\t}\r\n\t}", "int ReceiveAvailablePacket();", "boolean hasUnReceived();", "void Send (int boardID, short addr, ByteBuffer databuf, long datacnt, int eotMode);", "public void afterReceive() {\n\t}", "protected void setReceiveMessage(byte[] rmsg)\n\t{\n\t\t//#CM29519\n\t\t// Sets data to communication message buffer\n\t\tfor (int i=0; i < LEN_ID27; i++)\n\t\t{\n\t\t\twLocalBuffer[i] = rmsg[i] ;\n\t\t}\n\t\twDataBuffer = wLocalBuffer ;\n\t}", "@Override\n public void upcall(ReadMessage message) throws IOException, ClassNotFoundException {\n\t MessageObject readMessage = (MessageObject) message\n .readObject();\n message.finish();\n \tReceivePortIdentifier requestor = readMessage.requestor;\n MessageObject response = new MessageObject();\n if(requestor == null)\n\t \treturn;\n synchronized (masterJobsList){\n if(readMessage.messageType == MessageObject.message_id.JOB_STEALING){\n // Provide slave with one another job\n synchronized (jobListBusy){\n if(masterJobsList.size() > 0){\n response.messageType = MessageObject.message_id.JOB_BOARD;\n response.data = masterJobsList.get(0);\n masterJobsList.remove(0);\n response.maximumBound = solutionsStep;\n }\n }\n\n SendPort replyPort = myIbis.createSendPort(replyPortType);\n replyPort.connect(requestor);\n WriteMessage reply = replyPort.newMessage();\n reply.writeObject((response));\n reply.finish();\n replyPort.close();\n\n\n } else if (readMessage.messageType == MessageObject.message_id.SOLUTIONS_NUM){\n --jobCounter;\n Pair<Integer, Integer> res = (Pair<Integer, Integer>)readMessage.data;\n System.out.println(\"GOT RESULT (\" + res.getKey() + \" ; \" + res.getValue() + \")\");\n synchronized(jobListBusy){\n if(res.getValue() < solutionsStep){\n solutionsNum = res.getKey();\n solutionsStep = res.getValue();\n endTime = System.currentTimeMillis();\n } else if (res.getValue() == solutionsStep){\n solutionsNum += res.getKey();\n endTime = System.currentTimeMillis();\n } else {\n // do nothing\n }\n if(jobCounter == 0)\n jobListBusy.notify();\n }\n\n }\n\n }\n }", "void bytesRecvFlowControl(long recv)\r\n/* 167: */ {\r\n/* 168:333 */ this.currentReadBytes.addAndGet(recv);\r\n/* 169:334 */ this.cumulativeReadBytes.addAndGet(recv);\r\n/* 170: */ }", "public void doPack() {\n this._sendData = new byte[1];\n this._sendData[0] = 1;\n }", "@Override\n\tpublic void onSendPrivateChatDone(byte result) {\n\t\tif(WarpResponseResultCode.SUCCESS==result){\n\t\t\tLog.d(\"Receiver\", \"He is Online\");\n\t\t\tChatActivity.this.runOnUiThread(new Runnable() {\n\t\t\t\t public void run() {\n\t\t\t\t\t sa = ((SharingAtts)getApplication());\n\t\t\t\t\t ItemTest it = new ItemTest();\n\t\t\t\t\t String colNames = it.printData(\"chat\")[1];\n\t\t\t\t\t DBManager dbm = new DBManager(ChatActivity.this, colNames,\"chat\",it.printData(\"chat\")[0]);\n\t\t\t\t\t dbm.openToWrite();\n\t\t\t\t\t dbm.cretTable();\n\t\t\t\t\t msg = msg.replace(\" \", \"?*\");\n\t\t\t\t\t dbm.insertQuery(sa.name+\" \"+msg+\" \"+challenged, colNames.split(\" \")[1]+\" \"+colNames.split(\" \")[2]+\" \"+colNames.split(\" \")[3]);\n\t\t\t\t\t dbm.close();\n\t\t\n\t\t\t\t }\n\t\t\t});\n\t\t\t\n\t\t\t\n\t\t}else{\n\t\t\tChatActivity.this.runOnUiThread(new Runnable() {\n\t\t\t\t public void run() {\n\t\t\t\t\t Toast.makeText(ChatActivity.this, \"Receiver is offline. Come back later\", Toast.LENGTH_SHORT).show();\t\n\t\t\t\t\t \n\t\t\t\t }\n\t\t\t});\n\t\t}\n\t}", "void receiveMyFamily() {\r\n\t\t// 부모 또는 자식의 구성원을 받음\r\n\t}", "protected void pktDupeAcked(int seqNum) {}", "@Override\n\tpublic void encode() {\n\t\tbyte[] messageData = encodeStarsMessage(message);\n\t\t\n\t\t// Allocate\n byte[] res = new byte[10 + messageData.length];\n\n // Write members\n Util.write16(res, 0, unknownWord0);\n Util.write16(res, 2, unknownWord2);\n Util.write16(res, 4, senderId);\n Util.write16(res, 6, receiverId);\n Util.write16(res, 8, unknownWord8);\n \n // Copy in message data\n System.arraycopy(messageData, 0, res, 10, messageData.length);\n \n // Save as decrypted data\n setDecryptedData(res, res.length);\n\t}", "@Override\n\t\t\t\tpublic void notifyPresenceReceived(LinphoneCore lc, LinphoneFriend lf) {\n\t\t\t\t\t\n\t\t\t\t}", "private void updateReceivedData(byte[] data) {\n }", "public abstract void receiveFavor(int playerIndex, Card card);", "public ByzantineKing(int me, String[] peers, int[] ports, int propose_value, int f, int tag){\n\n this.me = me;\n this.peers = peers;\n this.ports = ports;\n this.mutex = new ReentrantLock();\n this.dead = new AtomicBoolean(false);\n this.unreliable = new AtomicBoolean(false);\n\n // Your initialization code here\n this.tag = tag;\n this.f = f;\n this.phase = -1;\n this.my_value = propose_value;\n this.values = new ArrayList<>();\n for (int i = 0; i < peers.length; i++) {\n if (i == this.me) {\n this.values.add(propose_value);\n } else {\n this.values.add(-1);\n }\n }\n done = false;\n\n receivedProposal = new HashMap<Integer, Integer>();\n firstTransfer = new Integer[peers.length];\n //this.startTime = startTime;\n\n // register peers, do not modify this part\n try{\n System.setProperty(\"java.rmi.server.hostname\", this.peers[this.me]);\n registry = LocateRegistry.createRegistry(this.ports[this.me]);\n stub = (ByzantineKingRMI) UnicastRemoteObject.exportObject(this, this.ports[this.me]);\n registry.rebind(\"ByzantineKing\", stub);\n } catch(Exception e){\n e.printStackTrace();\n }\n }", "synchronized void receiveJETON(){\n\tif(SC){\n\t\tJeton = true;\n\t}else{\n\t\tif (procId==0){\n\t\t\tSyncMessage sm = new SyncMessage(MsgType.JETON, 0, procId);\n\t\t\tsendTo(0, sm);\n\t\t}else{\n\t\t\tSyncMessage sm = new SyncMessage(MsgType.JETON, 1, procId);\n\t\t\tsendTo(1, sm);\n\t\t}\n\t}\n\tthis.notifyAll();\n\n}", "@Override\n\t\tpublic void onReceivePoi(BDLocation arg0) {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void handleMessage(Message msg) {\n\t\t\tint channel;\n\t\t\tdouble data;\n\t\t\tsuper.handleMessage(msg);\n\t\t\tswitch (msg.what) {\n\t\t\t\tcase Bluetooth.SUCCESS_CONNECT:\n\t\t\t\t\tBluetooth.connectedThread = new Bluetooth.ConnectedThread((BluetoothSocket) msg.obj);\n\t\t\t\t\tToast.makeText(getApplicationContext(), \"Conectado!\", 0).show();\n\t\t\t\t\tString s = \"successfully connected\";\n\t\t\t\t\tBluetooth.connectedThread.start();\n\t\t\t\t\tbreak;\n\t\t\t\tcase Bluetooth.MESSAGE_READ:\n\t\t\t\t\tif (!Record_Dialog_On) {\n\t\t\t\t\t\tbyte[] readBuf = (byte[]) msg.obj;\n\t\t\t\t\t\tfor (int i = 0; i < readBuf.length + cont ; i++) { //[LL]: Barrido del buffer de 1024 byte\n\t\t\t\t\t\t//\tLog.d(\"Cont.\", Integer.toString(cont));\n\t\t\t\t\t\t\tif (cont==3) {\n\t\t\t\t\t\t\t\tdata_aux[3]= (int) readBuf[i] & 0xff;\n\t\t\t\t\t\t\t\tcont=0;\n\n\t\t\t\t\t\t\tif ((data_aux[0] & 0x80) == 0x80 && (data_aux[1] & 0x80) == 0 && (data_aux[2] & 0x80) == 0 && (data_aux[3] & 0x80) == 0) {\n\t\t\t\t\t\t\t\tdata = ProcessData(data_aux); //Obtengo el valor a graficar segun el formato de los datos\n\t\t\t\t\t\t\t\tchannel = (data_aux[0] & 0x38) >> 3; //Obtengo el canal a graficar. Mascara= 0x38= 111000b\n\t\t\t\t\t\t\t\t//i = i + 3;\n\t\t\t\t\t\t\t\tif (Record == true && j < (1024 - 4)) {\n\t\t\t\t\t\t\t\t\trecording = true;\n\t\t\t\t\t\t\t\t\tif(canal_ant==-1)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif(channel==0)\n\t\t\t\t\t\t\t\t\t\t\tcanal_ant= 1;\n\t\t\t\t\t\t\t\t\t\telse if(channel==1) {\n\t\t\t\t\t\t\t\t\t\t\tcanal_ant = 0;\n\t\t\t\t\t\t\t\t\t\t\tDataWrite = DataWrite.concat(Double.toString(data_channel_0_prev) + \",\");\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tswitch(canal_ant) {\n\t\t\t\t\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\t\t\t\t\tif(channel==1) {\n\t\t\t\t\t\t\t\t\t\t\t\tDataWrite = DataWrite.concat(Double.toString(data) + \"\\n\");\n\t\t\t\t\t\t\t\t\t\t\t\tcanal_ant=1;\n\t\t\t\t\t\t\t\t\t\t\t\tdata_channel_1_prev= data;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse if(channel==0) {\n\t\t\t\t\t\t\t\t\t\t\t\tDataWrite = DataWrite.concat(Double.toString(data_channel_1_prev) + \"\\n\" + data + \",\");\n\t\t\t\t\t\t\t\t\t\t\t\tdata_channel_0_prev = data;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\t\t\t\tif(channel==0) {\n\t\t\t\t\t\t\t\t\t\t\t\tDataWrite = DataWrite.concat(Double.toString(data) + \",\");\n\t\t\t\t\t\t\t\t\t\t\t\tcanal_ant = 0;\n\t\t\t\t\t\t\t\t\t\t\t\t//DataWrite = DataWrite.concat(Double.toString(data_channel_1_prev) + \"\\n\" + data + \",\");\n\t\t\t\t\t\t\t\t\t\t\t\tdata_channel_0_prev = data;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\telse if(channel==1) {\n\t\t\t\t\t\t\t\t\t\t\t\tDataWrite = DataWrite.concat(Double.toString(data_channel_0_prev) + \",\" + data + \"\\n\");\n\t\t\t\t\t\t\t\t\t\t\t\t//DataWrite = DataWrite.concat(Double.toString(data_channel_1_prev) + \"\\n\" + data + \",\");\n\t\t\t\t\t\t\t\t\t\t\t\tdata_channel_1_prev = data;\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\tj++;\n\n\t\t\t\t\t\t\t\t} else if (recording == true) {\n\t\t\t\t\t\t\t\t\tLog.d(\"com.gibio.bt_graph\", \"grabando...\");\n\t\t\t\t\t\t\t\t\tString DirToSaveType;\n\t\t\t\t\t\t\t\t\tif (FileSaveDialog.Get_m_dir().equals(\"\") == false)\n\t\t\t\t\t\t\t\t\t\tDirToSaveType = FileSaveDialog.Get_m_dir();\n\t\t\t\t\t\t\t\t\telse DirToSaveType = FileSaveDialog.Get_m_sdcardDirectory();\n\t\t\t\t\t\t\t\t\tSaveData(DataWrite, DirToSaveType, FileSaveDialog.Get_Selected_File_Name()); //Guardo los datos en un archivo\n\t\t\t\t\t\t\t\t\tDataWrite = (String) \"\";\n\t\t\t\t\t\t\t\t\t//canal_ant = -1; // -1 == ningún canal\n\n\t\t\t\t\t\t\t\t\tif (Record == false) { //[LL]: si se presionó STOP dejo de grabar\n\t\t\t\t\t\t\t\t\t\trecording = false;\n\t\t\t\t\t\t\t\t\t\tToast.makeText(getApplicationContext(), \"Grabación detenida!\", 0).show();j = 0;\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tj = 0;\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\tswitch (channel) {\n\t\t\t\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\t\t\t\tif (Sereies_0_index < 10000){ //[LL]:Esto lo puse para evitar picos en la memoria\n\t\t\t\t\t\t\t\t\t\t\tif(data!=-2097152.0 && data!=0.0 && data!=409600.0 && data!=393216.0) { //[LL]:Por un error (picos) ver como resolver\n\t\t\t\t\t\t\t\t\t\t//Notar que todos los valores que dan error son multiplos de 1024\n\t\t\t\t\t\t\t\t\t\t//393216= 0x060000 = 0000 0110 00000000 00000000\n\t\t\t\t\t\t\t\t\t\t//409600= 0x064000 = 0000 0110 01000000 00000000\n\t\t\t\t\t\t\t\t\t\t//con el protocolo: 10001000 00110010 00000000 00000000\n\n\t\t\t\t\t\t\t\t\t\t// -2097152= 0xE00000 = 1110 0000 00000000 00000000\n\n\t\t\t\t\t\t\t\t\t\tSeries_0.appendData(new GraphViewData(graph2LastXValue_0, data), AutoScrollX);\n\t\t\t\t\t\t\t\t\t\tSereies_0_index++;\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tSeries_0.resetData(new GraphViewData[]{});\n\t\t\t\t\t\t\t\t\t\t\tSereies_0_index = 0;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t//X-axis control\n\t\t\t\t\t\t\t\t\t\tif (graph2LastXValue_0 >= Xview && Lock == true) {\n\t\t\t\t\t\t\t\t\t\t\tSeries_0.resetData(new GraphViewData[]{});\n\t\t\t\t\t\t\t\t\t\t\tgraph2LastXValue_0 = 0;\n\t\t\t\t\t\t\t\t\t\t} else graph2LastXValue_0 += 0.1;\n\n\t\t\t\t\t\t\t\t\t\tif (Lock == true) {\n\t\t\t\t\t\t\t\t\t\t\tgraphView_0.setViewPort(0, Xview);\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tgraphView_0.setViewPort(graph2LastXValue_0 - Xview, Xview);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t//refresh\n\t\t\t\t\t\t\t\t\t\tGraphView_0.removeView(graphView_0);\n\t\t\t\t\t\t\t\t\t\tGraphView_0.addView(graphView_0);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\t\t\t\tif (Sereies_1_index < 10000) {\n\t\t\t\t\t\t\t\t\t\tif(data!=-2097152.0 && data!=0.0 && data!=409600.0 && data!=393216.0 ) {\n\t\t\t\t\t\t\t\t\t\t//if(data!=-2097152.0 ) {\n\t\t\t\t\t\t\t\t\t\t\tSeries_1.appendData(new GraphViewData(graph2LastXValue_1, data), AutoScrollX);\n\t\t\t\t\t\t\t\t\t\t\t//Log.d(\"com.gibio.bt_graph\", \"data:\" + Double.toString(data));\n\t\t\t\t\t\t\t\t\t\t\tSereies_1_index++;\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tSeries_1.resetData(new GraphViewData[]{});\n\t\t\t\t\t\t\t\t\t\t\tSereies_1_index = 0;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t//X-axis control\n\t\t\t\t\t\t\t\t\t\tif (graph2LastXValue_1 >= Xview && Lock == true) {\n\t\t\t\t\t\t\t\t\t\t\tSeries_1.resetData(new GraphViewData[]{});\n\t\t\t\t\t\t\t\t\t\t\tgraph2LastXValue_1 = 0;\n\t\t\t\t\t\t\t\t\t\t} else graph2LastXValue_1 += 0.1;\n\n\t\t\t\t\t\t\t\t\t\tif (Lock == true) {\n\t\t\t\t\t\t\t\t\t\t\tgraphView_1.setViewPort(0, Xview);\n\t\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t\tgraphView_1.setViewPort(graph2LastXValue_1 - Xview, Xview);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t//refresh\n\t\t\t\t\t\t\t\t\t\tGraphView_1.removeView(graphView_1);\n\t\t\t\t\t\t\t\t\t\tGraphView_1.addView(graphView_1);\n\t\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\tdata_aux[cont] = (int) readBuf[i] & 0xff;\n\t\t\t\t\t\t\t\tcont++;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\tbreak;\n\n\t\t\t}\n\t\t}", "private List<GPSData> decodeMessageFrame(ChannelBuffer buff, Channel channel, int fSize, int wSize) {\n\t\tbuff.skipBytes(INITIAL_ZERO_BYTES + FRAME_BYTES_SIZE);\n\t\t\n\t\t// codecId byte is ignored\n\t\tbuff.skipBytes(CODEC_BYTE);\n\t\t\n\t\tshort numberOfData = buff.readUnsignedByte();\n\t\t// response to modem about data reception\n\t\tacknowledgeTeltonikaModem(channel, numberOfData);\n\t\tList<GPSData> list = new ArrayList<GPSData>();\n\t\tString imeiLast7digits = imeiMap.get(channel.getId());\n\t\tLOGGER.info(\"Received package decode start: \" + System.currentTimeMillis() + \"ms from device: \" + imeiLast7digits);\n\t\tfor (int i = 0; i < numberOfData; i++) {\n\n\t\t\tGPSData data = new GPSData();\n\n\t\t\tDate timestamp = new Date(buff.getLong(buff.readerIndex()));\n\t\t\tbuff.readerIndex(buff.readerIndex() + 8);\n\t\t\tSimpleDateFormat format = new SimpleDateFormat(\"yyyy-MM-dd hh:mm:ss\");\n\t\t\tdata.setTimestamp(format.format(timestamp));\n\n\t\t\tdata.setUnitId(imeiMap.get(channel.getId()));\n\n\t\t\t// priority byte is ignored\n\t\t\tbuff.skipBytes(1);\n\n\t\t\t// X\n\t\t\tStringBuilder longitude = new StringBuilder(String.valueOf(buff\n\t\t\t\t\t.readUnsignedInt()));\n\t\t\tlongitude.insert(2, '.');\n\t\t\tdata.setLongitude(Double.parseDouble(longitude.toString()));\n\n\t\t\t// Y\n\t\t\tStringBuilder latitude = new StringBuilder(String.valueOf(buff\n\t\t\t\t\t.readUnsignedInt()));\n\t\t\tlatitude.insert(2, '.');\n\t\t\tdata.setLatitude(Double.parseDouble(latitude.toString()));\n\n\t\t\t// H\n\t\t\tint altitude = buff.readUnsignedShort();\n\t\t\tdata.setAltitude((double) altitude);\n\n\t\t\tint angle = buff.readUnsignedShort();\n\t\t\tdata.setAngle(angle);\n\n\t\t\tshort satelite = buff.readUnsignedByte();\n\t\t\tdata.setSatelite(satelite);\n\n\t\t\tint speed = buff.readUnsignedShort();\n\t\t\tdata.setSpeed((double) speed);\n\n\t\t\t// IO INFORMATION START\n\n\t\t\t// IO ENETS\n\t\t\t//\n\t\t\t// IO element ID of Event generated (in case when 00 data\n\t\t\t// generated not on event)\n\t\t\t// we skip this byte\n\t\t\t\n\t\t\tbuff.skipBytes(1);\n\t\t\t\n\t\t\t// could read elements number but not necessary\n\t\t\t// instead we can skip it\n\t\t\t// short elementsNumber = buff.readUnsignedByte();\n\n\t\t\tbuff.skipBytes(1);\n\n\t\t\t// number of records with value 1 byte length\n\t\t\tshort oneByteElementNum = buff.readUnsignedByte();\n\n\t\t\tfor (int j = 0; j < oneByteElementNum; j++) {\n\t\t\t\tbuff.skipBytes(1);\n\t\t\t\tbuff.skipBytes(1);\n\t\t\t}\n\n\t\t\t// number of records with value 2 byte length\n\t\t\tshort twoByteElementNum = buff.readUnsignedByte();\n\n\t\t\tfor (int j = 0; j < twoByteElementNum; j++) {\n\t\t\t\tbuff.skipBytes(1);\n\t\t\t\tbuff.skipBytes(2);\n\t\t\t}\n\n\t\t\t// number of records with value 4 byte length\n\t\t\tshort fourByteElementNum = buff.readUnsignedByte();\n\n\t\t\tfor (int j = 0; j < fourByteElementNum; j++) {\n\t\t\t\tbuff.skipBytes(1);\n\t\t\t\tbuff.skipBytes(4);\n\t\t\t}\n\n\t\t\t// number of records with value 8 byte length\n\t\t\tshort eightByteElementNum = buff.readUnsignedByte();\n\n\t\t\tfor (int j = 0; j < eightByteElementNum; j++) {\n\t\t\t\tbuff.skipBytes(1);\n\t\t\t\tbuff.skipBytes(8);\n\t\t\t}\n\t\t\t// IO INFORMATION END\n\t\t\tlist.add(data);\n\t\t}\n\t\tLOGGER.info(\"Received package decode end: \" + System.currentTimeMillis() + \"ms from device: \" + imeiLast7digits);\n\t\t// records number(1 byte) and CRC(4 bytes) left in the buffer unread\n\t\tLOGGER.info(\"Number of packages decoded: \" + numberOfData);\n\t\tnumberOfData = buff.readByte();\n\t\t// skip CRC bytes\n\t\tlong CRC = buff.readUnsignedInt();\n\t\tLOGGER.info(\"Data CRC: \" + CRC);\n\t\t\n\t\treturn list;\n\t}", "protected void addChannelToReadCompletePendingQueue() {\n/* 354 */ while (!Http2MultiplexHandler.this.readCompletePendingQueue.offer(this)) {\n/* 355 */ Http2MultiplexHandler.this.processPendingReadCompleteQueue();\n/* */ }\n/* */ }", "@Override\n public boolean perform(Video video)\n {\n final int offset = (video.copper.word1 & 0b111111110);\n final int adr = 0xDFF000 + offset;\n if ( offset > 0x3e && (offset >= 0x80 || video.copper.copperDanger) )\n {\n video.memory.writeWord( adr, video.copper.word2 );\n } else {\n // LOG2.warn(\"Invalid copper write to register \"+Misc.hex(adr));\n }\n return true;\n }", "private void processMessage(Message message) {\n log(\"\");\n log(\"\");\n// log(\"recon list: \" + reconciliation);\n log(\"message\", message);\n\n switch (message.type) {\n // Response from server when registering\n case \"accepted\":\n accepted = true;\n\n // lobby leader, this user sets the info for all users.\n if (message.stringData != null && message.stringData.equals(\"leader\")) {\n\n LobbySettings lobbySettings = new LobbySettings();\n if (requestedGameType != null)\n lobbySettings.updateType(requestedGameType);\n log(\"req points\", requestedMapCntrlPoints);\n lobbySettings.setMap(requestedMapCntrlPoints);\n\n sendLobbySettingsToServer(lobbySettings);\n }\n\n if (message.name != name) {\n name = message.name;\n System.out.println(\"Name rejected. New name: \" + name);\n }\n\n break;\n // Resend register message\n case \"rejected\":\n try {\n Thread.sleep(500);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n sendRegisterMessage();\n break;\n // the first game message from the server\n case \"initialUpdate\":\n EntityHandler eh = message.entityHandler;\n game.entityHandler = eh;\n game.modelLayer.setEntities(eh);\n game.lobbySettings = message.lobbySettings;\n game.timeRemaining = message.timeRemaining;\n game.teamsList = message.teamsList;\n game.tankID = message.stringData;\n game.teamID = message.teamID;\n tankToUsernameMap = message.tankToNameMap;\n log(String.format(\"We are '%s' on team %d.\", message.stringData, message.teamID));\n\n // TODO this is the shit\n game.map.loadMap(message.lobbySettings.getMap());\n game.setupTerrainFlag = true;\n\n started = true;\n\n game.postConnect();\n log(\"game started!!\");\n break;\n // main update case\n case \"update\":\n if (!started)\n return;\n\n log(\"received new entity handler\");\n\n EntityHandler serverEntityHandler = message.entityHandler;\n game.entityHandler = serverEntityHandler;\n tankToHeldLength = message.tankToHeldLength;\n game.modelLayer.setEntities(serverEntityHandler);\n\n game.entityHandler.constrainTanks(game.map);\n game.entityHandler.constrainCrates(game.map);\n game.entityHandler.constrainTurrets(game.tankID, Input.cursorPos);\n\n game.timeRemaining = message.timeRemaining;\n\n double serverPacketNumber = message.packetNum;\n log(\"server packet:\" + serverPacketNumber + \", last packet we sent:\" + packetNum);\n\n int i = 0;\n while (i < reconciliation.size()) {\n Message reconMessage = reconciliation.get(i);\n\n if (reconMessage.packetNum <= serverPacketNumber) {\n log(\"reconcile!, m packet:\" + reconMessage.packetNum + \"<= server packet:\" + serverPacketNumber);\n reconciliation.remove(i);\n } else {\n log(\"server lagging behind, apply inputs again for packet: \" + reconMessage.packetNum);\n\n Integer[] keysPressed = reconMessage.keysPressed;\n double mouseHeldTime = reconMessage.mouseHeldTime;\n reconciliationUpdate(keysPressed, mouseHeldTime);\n i++;\n }\n }\n break;\n case \"endUpdate\":\n if (!started)\n return;\n\n log(\"received final entity handler\");\n accepted = false;\n started = false;\n ended = true;\n game.entityHandler = message.entityHandler;\n game.modelLayer.setEntities(message.entityHandler);\n game.entityHandler.constrainTanks(game.map);\n game.entityHandler.constrainTurrets(game.tankID, Input.cursorPos);\n game.setEndOfGame(); // assuming we are in online mode\n break;\n case \"debug\":\n String str = message.stringData;\n log(str);\n testMessages.add(message);\n break;\n default:\n error(\"unknown type: \" + message.type);\n break;\n }\n }", "private boolean partAvailable(Piece piece) {\n boolean temp = false;\r\n try {\r\n temp = repairAreaInt.partAvailable(piece, id);\r\n } catch (RemoteException e) {\r\n System.err.println(\"Excepção na invocação remota de método\" + getName() + \": \" + e.getMessage() + \"!\");\r\n System.exit(1);\r\n }\r\n return temp;\r\n }", "@Override\n public boolean messagePending() {\n return commReceiver.messagePending();\n }", "private void sendACKPacket()\n{\n \n //the values are unpacked into bytes and stored in outBufScratch\n //outBufScrIndex is used to load the array, start at position 0\n \n outBufScrIndex = 0;\n \n outBufScratch[outBufScrIndex++] = Notcher.ACK_CMD;\n \n //the byte is placed right here in this method\n outBufScratch[outBufScrIndex++] = lastPacketTypeHandled;\n \n //send header, the data, and checksum\n sendByteArray(outBufScrIndex, outBufScratch);\n \n}", "public abstract void msgCanOnlyDeliverPartial(Market market, Food food, int amountDeliverable);" ]
[ "0.6653257", "0.59555525", "0.5892576", "0.5857535", "0.58436155", "0.58299524", "0.5637486", "0.5557491", "0.5484611", "0.5246936", "0.5228213", "0.5213086", "0.52128536", "0.52044016", "0.51783067", "0.5101388", "0.50985545", "0.50548315", "0.5040257", "0.5040173", "0.50349057", "0.5026693", "0.5026518", "0.5013757", "0.4963529", "0.49506342", "0.4945057", "0.49366963", "0.49353665", "0.493348", "0.4911229", "0.49042264", "0.48968312", "0.4881395", "0.4873422", "0.48715127", "0.4864555", "0.4859138", "0.48542014", "0.48516455", "0.48497987", "0.48484603", "0.48448697", "0.4839994", "0.4838543", "0.4834231", "0.48197898", "0.48196754", "0.48098662", "0.4808049", "0.48033562", "0.48016402", "0.4787585", "0.4776744", "0.47764", "0.47725335", "0.47585353", "0.47581476", "0.47484332", "0.47461584", "0.47444615", "0.47411045", "0.47405228", "0.47344017", "0.4734143", "0.47294647", "0.4726643", "0.47192523", "0.47158754", "0.47147697", "0.47143656", "0.4713824", "0.4711009", "0.47108525", "0.47086346", "0.47027737", "0.46989888", "0.46980858", "0.46906993", "0.46896645", "0.4687413", "0.46857306", "0.4685205", "0.4684589", "0.4682608", "0.46776408", "0.467543", "0.46706012", "0.46682444", "0.46662423", "0.4658062", "0.4654384", "0.46539092", "0.46528685", "0.46515903", "0.46468687", "0.4646672", "0.46423006", "0.4642184", "0.46415952" ]
0.6835894
0
dumps active connections of the torrent to stdout
@Override protected void dump(Formatter formatter) { PeerConnectionStatistics s = rawStatistics; double drate = s.download.average(4); drate /= 1024*1024; double urate = s.upload.average(4); urate /= 1024*1024; formatter.format("%24s %2S%2S %1c%1c %1c%1c %5.1f %3d %6d | %5.1f %2d %6d %5d %s\n", peer.address, connected ? "+" : "-", handshaked ? "+" : "-", choke ? 'c' : '-', interested ? 'i' : '-', peerChoke ? 'c' : '-', peerInterested ? 'i' : '-', drate, blockRequests.size(), statistics.blocksReceived, urate, 0, statistics.blocksSent, getPeerCompletionPercent(), StdPeerProtocol.extractClientNameFromId(peer.peerId)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void viewConnections(){\n\t\tfor(int i=0; i<Server.clients.size();i++){\n\t\t\tServerThread cliente = Server.clients.get(i);\n\t\t\tlogger.logdate(cliente.getConnection().getInetAddress().getHostName());\n\t\t}\n\t}", "public void getConnections() throws IOException {\n\t\tString fileName = \"\";\n\t\twhile (serverAlive) {\n\t\t\ttry {\n\t\t\t\tTrackerServerCommunicator comm = \n\t\t\t\t\t\tnew TrackerServerCommunicator(listen.accept(), this, globalId);\n\t\t\t\tglobalId++;\n\t\t\t\tcomm.setDaemon(true);\n\t\t\t\tcomm.start();\n\t\t\t\taddCommunicator(comm);\n\t\t\t} \n\t\t\tcatch (SocketException e) {\n\t\t\t\tfileName = dataTable.saveInfo(\"./\");\n\t\t\t\tserverAlive = false;\n\t\t\t}\n\t\t}\n\t\tString[] cmd = {\"/usr/bin/python ./Visualizer.py \" + fileName};\n\t\tRuntime.getRuntime().exec(cmd);\n\t}", "public void dump() {\n System.out.println(\"ID : \"+hostID);\n for (int i=0; i<hostAddresses.size(); i++) System.out.println(\" - addresse : \"+hostAddresses.elementAt(i).getNormalizedAddress());\n System.out.println(\"CPU : \"+cpuLoad);\n System.out.println(\"Memoire : \"+memoryLoad);\n System.out.println(\"Batterie : \"+batteryLevel);\n System.out.println(\"Threads : \"+numberOfThreads);\n System.out.println(\"CMs : \"+numberOfBCs);\n System.out.println(\"connecteurs : \"+numberOfConnectors);\n System.out.println(\"connecteurs entree reseau : \"+numberOfConnectorsNetworkInputs);\n System.out.println(\"connecteurs sortie reseau : \"+numberOfConnectorsNetworkOutputs);\n System.out.println(\"Traffic PF entree : \"+networkPFInputTraffic);\n System.out.println(\"Traffic PF sortie : \"+networkPFOutputTraffic);\n System.out.println(\"Traffic application entree : \"+networkApplicationInputTraffic);\n System.out.println(\"Traffic application sortie : \"+networkApplicationOutputTraffic);\n }", "static void printActiveClients() {\n\t\tint count = 0;\n\t\tfor (ClientThread thread : threads) {\n\t\t\tif (thread != null) {\n\t\t\t\tcount++;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Clients: \" + count);\n\t}", "public void dump() {\n for(Object object : results) {\n System.out.println( object );\n }\n }", "public void dump()\n {\n System.out.println(toString());\n }", "public static void write(TBase t) {\n\t\ttry {\n\t\t\tbufferedOutStreamServer = new BufferedOutputStream(System.out, 2048);\n\t\t\tjsonProtocolServer = new TJSONProtocol(new TIOStreamTransport(bufferedOutStreamServer));\n\t\t\tt.write(jsonProtocolServer);\n\n\t\t\tbufferedOutStreamServer.flush();\n\t\t\tSystem.out.println(\"\\n\");\n\t\t} catch (Exception e) {\n\t\t\twrite(new SystemException().setMessage(e.toString()));\n\t\t}\n\t}", "public void printNode(){\n\t\tSystem.out.println(\"\\nCurrent neigbor: \" + serventList.size());\n\t\tfor(int i = 0;i<serventList.size();i++){\n\t\t\tServentInfo b = serventList.get(i);\n\t\t\tSystem.out.println(\"(\" + b.IP + \":\" + b.port + \"); \");\n\t\t}\n\t\tSystem.out.println(\"\");\n\t}", "public void dump ()\n {\n StringBuilder b = new StringBuilder ();\n dump (b, 0);\n System.out.print (b);\n }", "public void dump ()\n {\n StringBuilder b = new StringBuilder ();\n dump (b, 0);\n System.out.print (b);\n }", "public void dump ()\n {\n StringBuilder b = new StringBuilder ();\n dump (b, 0);\n System.out.print (b);\n }", "public void dump ()\n {\n StringBuilder b = new StringBuilder ();\n dump (b, 0);\n System.out.print (b);\n }", "public void dump ()\n {\n StringBuilder b = new StringBuilder ();\n dump (b, 0);\n System.out.print (b);\n }", "public void dump ()\n {\n StringBuilder b = new StringBuilder ();\n dump (b, 0);\n System.out.print (b);\n }", "public void dump ()\n {\n StringBuilder b = new StringBuilder ();\n dump (b, 0);\n System.out.print (b);\n }", "public void dump ()\n {\n StringBuilder b = new StringBuilder ();\n dump (b, 0);\n System.out.print (b);\n }", "public void dump ()\n {\n StringBuilder b = new StringBuilder ();\n dump (b, 0);\n System.out.print (b);\n }", "public void printStats() {\n\t\t\n\t\tif(grafo==null) {\n\t\t\t\n\t\t\tthis.createGraph();\n\t\t}\n\t\t\n\t\tConnectivityInspector <Airport, DefaultWeightedEdge> c = new ConnectivityInspector<>(grafo);\n\t\t\n\t\tSystem.out.println(c.connectedSets().size());\n\n\t}", "void dump()\n\t\t{\n\t\t\tlog.info(\"Ch # \"+ch+\" Mode=\"+Hex.formatByte(mode)+\" Base=\"+Hex.formatWord(base.getValue())+\" Count=\"+Hex.formatWord(count.getValue()));\n\t\t\tlog.info(\"Ch # \"+ch+\" Hold=\"+hold+\" Request=\"+request+\" TC=\"+tc+\" Enabled=\"+enabled+\" Mask=\"+mask);\n\t\t}", "public void writePeers() {\n\t\ttry(FileWriter filewriter = new FileWriter(peersFile)) {\n\t\t\tIterator<InetAddress> itr = peers.keySet().iterator();\n\t\t\twhile(itr.hasNext()) {\n\t\t\t\tInetAddress p = itr.next();\n\t\t\t\tfilewriter.write(p.getHostAddress()+\"\\n\");\n\t\t\t}\n\t\t}\n\t\tcatch(Exception e) {\n\t\t\tDecentLogger.write(\"Unable to write peers to file\");\n\t\t}\n\t}", "private void startTcpdumpCapture () {\n\t\tnew Thread (new Runnable() {\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\ttry {\n\t\t\t\t\tstartTcpdump();\n\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\tLog.e (TAG, \"InterruptedException in startTcpdump\");\n\t\t\t\t} catch (IOException e) {\n\t\t\t\t\tLog.e (TAG, \"IOException in startTcpdump\");\n\t\t\t\t}\n\t\t\t}\n\t\t}).start();\n\t}", "public String toString() {\n String msg = \"\\nList of current server connections\\n\";\n for (Object i : connections.keySet().toArray()) {\n msg += connections.get(i).toString();\n }\n return msg;\n }", "private void printAllClients() {\n Set<Client> clients = ctrl.getAllClients();\n clients.stream().forEach(System.out::println);\n }", "void printUsers() {\n if (server.hasUsers()) {\n writer.println(\"Connected users: \" + server.getUserNames());\n } else {\n writer.println(\"No other users connected\");\n }\n }", "public void run() {\n Socket socket;\n try {\n socket = new Socket(servers.getServerAddress(),Integer.parseInt(servers.getServerPort()));\n } catch (IOException e) {\n // e.printStackTrace();\n System.err.println(\"Cannot connect to the server: \" + servers.getServerAddress()\n + \" at port:\" + servers.getServerPort());\n return;\n }\n\n ObjectOutputStream toServer = null;\n try {\n toServer = new ObjectOutputStream(socket.getOutputStream());\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n\n BufferedReader toClient = null;\n try {\n toClient = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n try {\n\n toServer.writeObject(argsToServer);\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n //get and print query results\n String line;\n int count = 0;\n ByteArrayOutputStream out = new ByteArrayOutputStream();\n PrintStream pr = new PrintStream(out);\n try {\n while((line = toClient.readLine()) != null) {\n System.out.println(\"<\" + servers.getServerAddress() + \"> :\" + line);\n count++;\n pr.println(line);\n }\n pr.flush();\n System.out.println(servers.getServerAddress()+ \" query count: \" + count);\n socket.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n //saveLocalFile(out);\n }", "private void sendZombies(PrintWriter stream){\r\n\t\tfor(Zombie z: zombies){\r\n\t\t\tz.sendData(stream);\r\n\t\t}\r\n\t}", "@Override\n\tpublic String dumpState() {\n\t\tStringBuilder sb = new StringBuilder(super.dumpState());\n\t\tsb.append(\"\\nListening on: \");\n\t\t//if ( mServerSocket != null ) sb.append(mServerSocket.toString());\n\t\t//if ( mDatagramSocket != null ) sb.append(mDatagramSocket.toString());\n\t\tsb.append(\"\\n\");\n\t\treturn sb.toString();\n\t}", "public void dump();", "public void saveConnections(){\n\t\tXMLMemento memento = XMLMemento.createWriteRoot(TAG_CONNECTIONS);\r\n\t\tsaveConnections(memento);\r\n\t\tFileWriter writer =null;\r\n\t\ttry {\r\n\t\t\twriter=new FileWriter(getStroreFile());\r\n\t\t\tmemento.save(writer);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\t\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\tlog(e.getMessage(), IStatus.ERROR, e);\r\n\t\t}\r\n\t\t\tfinally {\r\n\t\t\t\t\r\n\t\t\t\tif(writer !=null){\r\n\t\t\t\t\t\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\twriter.close();\r\n\t\t\t\t\t} catch (IOException e) {\r\n\t\t\t\t\t\tlog(e.getMessage(), IStatus.ERROR, e);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t\r\n\t\t\r\n\t}", "Collection<TcpIpConnection> getActiveConnections();", "public void dump(PrintWriter pen)\n {\n pen.println(\"DUMPING ...\");\n for (int i = 0; i < this.buckets.length; i++)\n {\n AssociationList<K, V> bucket = this.get(i);\n if (bucket != null)\n {\n pen.println(\"BUCKET \" + i);\n bucket.dump(pen);\n } // if the current bucket is not null\n } // for each bucket\n pen.println(\"... DONE\");\n }", "private static synchronized void printMonitoringSocketStatus() {\r\n\r\n\t\tif (log.isInfoEnabled()) {\r\n\t\t\tlog.info(\"There are currently \" + numberOfOpenSockets\r\n\t\t\t\t\t+ \" open MonitoringSockets\");\r\n\t\t}\r\n\t}", "public static void tcp_peeraddr_print( Socket com )\n{\n InetSocketAddress isa = \n (InetSocketAddress)com.getRemoteSocketAddress();\n InetAddress ia = isa.getAddress();\n String peerhostaddr = ia.getHostAddress();\n int peerportno = isa.getPort();\n stdout.printf(\"connection (hash== %s) from %s:%d\\n\", \n com.hashCode(), peerhostaddr, peerportno );\n}", "public void printStatus(){\n System.out.println(\"Nodes: \" + \n getVertexCount() + \" Edges: \" + \n getEdgeCount()); \n //and \" + getEdgeCount() + \" edges active.\");\n }", "public void imprimirPeersConectados() {\n\t\tSystem.out.println();\n\t\tSystem.out.println(\n\t\t\t\tDisplayConstants.COMMAND_PREFIX + \"Peers conectados: \" + this.listaChavesPublicas.keySet().toString());\n\t\tSystem.out.println();\n\t}", "public void run() {\n\t\tboolean forever = true;\n\t\tStatement stmt=null;\n\t\tString currCatalog=null;\n\t\tlong maxCheckoutMillis = maxCheckoutSeconds * 1000;\n\n\n\t\twhile(forever) {\n\n\t\t\t// Make sure the log file is the one this instance opened\n\t\t\t// If not, clean it up!\n\t\t\ttry {\n\t\t\t\tBufferedReader in = new BufferedReader(new\n\t\t\t\t\t\tFileReader(logFileString + \"pid\"));\n\t\t\t\tString curr_pid = in.readLine();\n\t\t\t\tif(curr_pid.equals(pid)) {\n\t\t\t\t\t//log.println(\"They match = \" + curr_pid);\n\t\t\t\t} else {\n\t\t\t\t\t//log.println(\"No match = \" + curr_pid);\n\t\t\t\t\tlog.close();\n\n\t\t\t\t\t// Close all connections silently - they are definitely dead.\n\t\t\t\t\tfor(int i=0; i < currConnections; i++) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconnPool[i].close();\n\t\t\t\t\t\t} catch (SQLException e1) {} // ignore\n\t\t\t\t\t}\n\t\t\t\t\t// Returning from the run() method kills the thread\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tin.close();\n\n\t\t\t} catch (IOException e1) {\n\t\t\t\tlog.println(\"Can't read the file for pid info: \" +\n\t\t\t\t\t\tlogFileString + \"pid\");\n\t\t\t}\n\n\n\t\t\t// Get any Warnings on connections and print to event file\n\t\t\tfor(int i=0; i < currConnections; i++) {\n\t\t\t\ttry {\n\t\t\t\t\tcurrSQLWarning = connPool[i].getWarnings();\n\t\t\t\t\tif(currSQLWarning != null) {\n\t\t\t\t\t\tif(debugLevel > 1) {\n\t\t\t\t\t\t\tlog.println(\"Warnings on connection \" +\n\t\t\t\t\t\t\t\t\tString.valueOf(i) + \" \" + currSQLWarning);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconnPool[i].clearWarnings();\n\t\t\t\t\t}\n\t\t\t\t} catch(SQLException e) {\n\t\t\t\t\tif(debugLevel > 1) {\n\t\t\t\t\t\tlog.println(\"Cannot access Warnings: \" + e);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tfor(int i=0; i < currConnections; i++) { // Do for each connection\n\t\t\t\tlong age = System.currentTimeMillis() - connCreateDate[i];\n\n\n\t\t\t\ttry { // Test the connection with createStatement call\n\t\t\t\t\tsynchronized(connStatus) {\n\t\t\t\t\t\tif(connStatus[i] > 0) { // In use, catch it next time!\n\n\t\t\t\t\t\t\t// Check the time it's been checked out and recycle\n\t\t\t\t\t\t\tlong timeInUse = System.currentTimeMillis() -\n\t\t\t\t\t\t\t\t\tconnLockTime[i];\n\t\t\t\t\t\t\tif(debugLevel > 2) {\n\t\t\t\t\t\t\t\tlog.println(\"Warning. Connection \" + i +\n\t\t\t\t\t\t\t\t\t\t\" in use for \" + timeInUse +\n\t\t\t\t\t\t\t\t\t\t\" ms\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(maxCheckoutMillis != 0) {\n\t\t\t\t\t\t\t\tif(timeInUse > maxCheckoutMillis) {\n\t\t\t\t\t\t\t\t\tif(debugLevel > 1) {\n\t\t\t\t\t\t\t\t\t\tlog.println(\"Warning. Connection \" +\n\t\t\t\t\t\t\t\t\t\t\t\ti + \" failed to be returned in time. Recycling...\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tthrow new SQLException();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconnStatus[i] = 2; // Take offline (2 indicates housekeeping lock)\n\t\t\t\t\t}\n\n\n\t\t\t\t\tif(age > maxConnMSec) { // Force a reset at the max conn time\n\t\t\t\t\t\tthrow new SQLException();\n\t\t\t\t\t}\n\n\t\t\t\t\tstmt = connPool[i].createStatement();\n\t\t\t\t\tconnStatus[i] = 0; // Connection is O.K.\n\t\t\t\t\t//log.println(\"Connection confirmed for conn = \" +\n\t\t\t\t\t// String.valueOf(i));\n\n\t\t\t\t\t// Some DBs return an object even if DB is shut down\n\t\t\t\t\tif(connPool[i].isClosed()) {\n\t\t\t\t\t\tthrow new SQLException();\n\t\t\t\t\t}\n\n\n\t\t\t\t\t// Connection has a problem, restart it\n\t\t\t\t} catch(SQLException e) {\n\n\t\t\t\t\tif(debugLevel > 1) {\n\t\t\t\t\t\tlog.println(new Date().toString() +\n\t\t\t\t\t\t\t\t\" ***** Recycling connection \" +\n\t\t\t\t\t\t\t\tString.valueOf(i) + \":\");\n\t\t\t\t\t}\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tconnPool[i].close();\n\t\t\t\t\t} catch(SQLException e0) {\n\t\t\t\t\t\tif(debugLevel > 0) {\n\t\t\t\t\t\t\tlog.println(\"Error! Can't close connection! Might have been closed already. Trying to recycle anyway... (\" + e0 + \")\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tcreateConn(i);\n\t\t\t\t\t} catch(SQLException e1) {\n\t\t\t\t\t\tif(debugLevel > 0) {\n\t\t\t\t\t\t\tlog.println(\"Failed to create connection: \" + e1);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tconnStatus[i] = 0; // Can't open, try again next time\n\t\t\t\t\t}\n\t\t\t\t} finally {\n\t\t\t\t\ttry{if(stmt != null) {stmt.close();}} catch(SQLException e1){};\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\ttry { Thread.sleep(20000); } // Wait 20 seconds for next cycle\n\n\t\t\tcatch(InterruptedException e) {\n\t\t\t\t// Returning from the run method sets the internal\n\t\t\t\t// flag referenced by Thread.isAlive() to false.\n\t\t\t\t// This is required because we don't use stop() to\n\t\t\t\t// shutdown this thread.\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t}\n\n\t}", "public void dump()\r\n {\r\n dump(true);\r\n }", "public void dump(FileDescriptor fd, PrintWriter pw, String[] args) {\n synchronized (mLock) {\n pw.println(\"RTT Metrics:\");\n pw.println(\"mNumStartRangingCalls:\" + mNumStartRangingCalls);\n pw.println(\"mOverallStatusHistogram:\" + mOverallStatusHistogram);\n pw.println(\"AP:\" + mPerPeerTypeInfo[PEER_AP]);\n pw.println(\"AWARE:\" + mPerPeerTypeInfo[PEER_AWARE]);\n }\n }", "public void dumpState() {\r\n\t\tlistRunningTests();\r\n\t\tworkQueue.dumpState();\r\n\t}", "public void printAllTransaction() {\n\t\tregister[registerSelected].printAllTransactions();\n\t}", "private void sendUpdateConnectionInfo() {\n\n }", "public void dump(){\n\t\tfor(int n=0; n<_numBuckets; n++){\r\n\t\t\tNode current = _buckets[n];\r\n\t\t\tif(current != null){\r\n\t\t\t\tSystem.out.println(n + \": \" + current.toString());\r\n\t\t\t}else{\r\n\t\t\t\tSystem.out.println(n + \": null\");\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public URLSpout() {\n \tURLSpout.activeThreads = new AtomicInteger();\n \tlog.debug(\"Starting URL spout\");\n \t\n \ttry { \t\t\n\t\t\treader = new BufferedReader(new FileReader(\"URLDisk.txt\"));\n\t\t\tint num_lines = XPathCrawler.getInstance().getFileCount().get();\n\t\t\tfor (int i = 0; i < num_lines; i++) {\n\t\t\t\treader.readLine(); //set reader to latest line\n\t\t\t}\t\t\t\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n }", "private void publishResults()\r\n\t{\n\t\tif (toBeOutputBranches.size() >= guiObject.getNumberOfBranchesFilter()) {\r\n\t\t\t\r\n\t\t\t//prints the default header each block gets\r\n\t\t\tmultiThreadingObj.myPublish(mainHeader);\r\n\t\t\t\r\n\t\t\t//prints out all of the branches (of a block) which passed the filters\r\n\t\t\tfor (Entry<String, String> branch : toBeOutputBranches.entrySet()) {\r\n\t\t\t\tString branchHeader = branch.getKey();\r\n\t\t\t\tString formattedBranch = branch.getValue();\r\n\t\t\t\tmultiThreadingObj.myPublish(branchHeader + formattedBranch);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//prints the upper state energies at the end of the block\r\n\t\t\tmultiThreadingObj.myPublish(energyVals);\r\n\t\t}\r\n\t}", "public void print(Node node) \n{\n PrintWriter w = new PrintWriter(new OutputStreamWriter(System.out), true);\n print(node, w);\n}", "public ServerNMS() {\n\t\tclients = new LinkedList<PrintWriter>();\n\t}", "private void setupStreams() throws IOException {\n\t\toutput = new ObjectOutputStream(Connection.getOutputStream());\n\t\toutput.flush();\n\t\tinput = new ObjectInputStream(Connection.getInputStream()); \n\t\tshowMessage(\"\\n Streams have successfully connected.\");\n\t}", "public void torrentScrape() {\n\t\tAlfred.getTorrentScraper().scrape();\n\t}", "public synchronized String toString() {\n\t\tString nl = System.lineSeparator();\n\t\t\n\t\t// get list of all peers for all files\n\t\tString files = \"\";\n\t\tfor(String filename : peerRecord.keySet()) {\n\t\t\tfiles += \"- \" + filename + \": \";\n\t\t\tfor(PeerConnection peer : peerRecord.get(filename)) {\n\t\t\t\tfiles += peer + \" \";\n\t\t\t}\n\t\t\tfiles += nl;\n\t\t\t\n\t\t}\n\t\treturn \"[TRACKER]\" + nl + files;\n\t}", "public void dumpRelayStatistics(Writer writer) throws IOException {\n if (internalRelay != null && internalRelay instanceof ManagedThreadPool) {\n final ManagedThreadPool relay = (ManagedThreadPool)internalRelay;\n relay.dumpThreadPoolInfo(writer);\n }\n if (externalRelay != null && externalRelay instanceof ManagedThreadPool) {\n final ManagedThreadPool relay = (ManagedThreadPool)externalRelay;\n relay.dumpThreadPoolInfo(writer);\n }\n }", "public static void main(String[] args) {\nConnection connection =ConnectionUtil.getConnection();\r\nSystem.out.println(connection);\r\n\t}", "void connected();", "public void dumpTree() {\n\t\tsendMessage(\"/g_dumpTree\", new Object[] { 0, 0 });\n\t}", "public void list() {\r\n\t\tfor (String key : nodeMap.keySet()) {\r\n\t\t\tNodeRef node = nodeMap.get(key);\r\n\t\t\tSystem.out.println(node.getIp() + \" : \" + node.getPort());\r\n\t\t}\t\t\r\n\t}", "@Override\n public List<Link> getConnectionList()\n {\n return connections;\n }", "public static void threadDump() {\n\t\tLOG.error(\"All threads are in use. Logging the thread stack trace to threaddump.txt and exiting.\");\n\t\tfinal ThreadMXBean threads = ManagementFactory.getThreadMXBean();\n\t\tlong[] threadIds = threads.getAllThreadIds();\n\t\tPrintWriter printWriter = null;\n\t\ttry {\n\t\t\tprintWriter = new PrintWriter(new FileWriter(THREAD_DUMP_FILE_PATH,\n\t\t\t\t\tfalse));\n\t\t\tprintWriter.println(\"Raptor ThreadService initiated dump \"\n\t\t\t\t\t+ new Date());\n\t\t\tfor (long threadId : threadIds) {\n\t\t\t\tThreadInfo threadInfo = threads.getThreadInfo(threadId, 10);\n\t\t\t\tprintWriter.println(\"Thread \" + threadInfo.getThreadName()\n\t\t\t\t\t\t+ \" Block time:\" + threadInfo.getBlockedTime()\n\t\t\t\t\t\t+ \" Block count:\" + threadInfo.getBlockedCount()\n\t\t\t\t\t\t+ \" Lock name:\" + threadInfo.getLockName()\n\t\t\t\t\t\t+ \" Waited Count:\" + threadInfo.getWaitedCount()\n\t\t\t\t\t\t+ \" Waited Time:\" + threadInfo.getWaitedTime()\n\t\t\t\t\t\t+ \" Is Suspended:\" + threadInfo.isSuspended());\n\t\t\t\tStackTraceElement[] stackTrace = threadInfo.getStackTrace();\n\t\t\t\tfor (StackTraceElement element : stackTrace) {\n\t\t\t\t\tprintWriter.println(element);\n\t\t\t\t}\n\n\t\t\t}\n\t\t} catch (IOException ioe) {\n\t\t\tioe.printStackTrace();\n\t\t} finally {\n\t\t\tif (printWriter != null) {\n\t\t\t\ttry {\n\t\t\t\t\tprintWriter.flush();\n\t\t\t\t\tprintWriter.close();\n\t\t\t\t} catch (Exception e2) {\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "void dump() {\n\t\tSystem.out.print(\"I am: \" + (territoryID));\n\t\tSystem.out.print(\"\\tNeighbour of:\");\n\n\t}", "public void printRunningRss() {\n for (Map.Entry<String, ParseFeedTask> task : tasks.entrySet()) {\n if (task.getValue().getConfiguration().getTurnOn()) {\n System.out.println(String.format(\"on RSS : %s\", task.getKey()));\n }\n }\n }", "public void printToStdout() {\n\t\tfor (int i = 0; i < results.size(); i++) {\n\t\t\tSystem.out.println(results.get(i).toString());\n\t\t}\n\t}", "public static void printWarings(Connection conn) {\r\n printWarings(conn, new PrintWriter(System.err));\r\n }", "private void query(){\n synchronized (slaveList) {\n for (Integer ID : slaveList.keySet()) {\n SDSlave slaveNode = slaveList.get(ID);\n slaveNode.out.write(\"Alive?\\n\");\n slaveNode.out.flush();\n }\n }\n }", "@Override\n public Boolean call() throws Exception {\n \tMySocket socket = new MySocket(node);\n socket.writeLine(listOfActivePeers);\n socket.close();\n return true;\n }", "private void updateConnectionsList() {\n ConnectionsWrapper connections = new ConnectionsWrapper();\n connections.setConnectionList(new ArrayList<>(connectionMap.values()));\n XMLFileManager.saveXML(\"connections.xml\", connections, ConnectionsWrapper.class);\n }", "public Connections getConnections();", "private void dumpProcesses()\n{\n System.err.println(\"\\n\\nDumping Processes\");\n for (DpinProcess dp : process_set.values()) {\n dp.dump();\n }\n}", "final public void dump(StringBuffer buf) {\r\n\r\n\t\tForwardingInfo info;\r\n\r\n\t\tlock_.lock();\r\n\r\n\t\ttry {\r\n\t\t\tfor (int i = 0; i < log_.size(); i++) {\r\n\t\t\t\tinfo = log_.get(i);\r\n\t\t\t\tString format = String.format(\"\\t%s -> %s [%s] %s at %s.%s \"\r\n\t\t\t\t\t\t+ \"[custody min %s pct %s max %s]\\n\", ForwardingInfo\r\n\t\t\t\t\t\t.state_to_str(info.state()), info.link_name(), info\r\n\t\t\t\t\t\t.remote_eid(), ForwardingInfo.action_to_str(info\r\n\t\t\t\t\t\t.action()), info.timestamp().getSeconds(), info\r\n\t\t\t\t\t\t.timestamp().getSeconds(), info.custody_spec().min(),\r\n\t\t\t\t\t\tinfo.custody_spec().lifetime_pct(), info.custody_spec()\r\n\t\t\t\t\t\t\t\t.max());\r\n\r\n\t\t\t\tbuf.append(format);\r\n\r\n\t\t\t}\r\n\t\t} finally {\r\n\t\t\tlock_.unlock();\r\n\t\t}\r\n\r\n\t}", "public void printCountersAndDiagnostics() {\n\t\tSystem.out.println(\"Node \" + myAssignedID + \"::\" + \"\\t\" + \"Sent\" + \"\\t\"\n\t\t\t\t+ \"Rec'd\" + \"\\t\" + \"Relayed\" + \"\\t\" + \"SumSent\" + \"\\t\"\n\t\t\t\t+ \"SumRecd\");\n\t\tSystem.out.println(\"\\t\\t\" + this.sendTracker + \"\\t\"\n\t\t\t\t+ this.receiveTracker + \"\\t\" + this.relayTracker + \"\\t\"\n\t\t\t\t+ this.sendSummation + \"\\t\" + this.receiveSummation);\n\t}", "public void writeVisits() {\n try {\n FileOutputStream fileOut = new FileOutputStream(\"temp/visits.ser\");\n ObjectOutputStream out = new ObjectOutputStream(fileOut);\n out.writeObject(visits);\n out.close();\n fileOut.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "public void dump(PrintWriter pw, boolean dumpAll) {\n synchronized (this.mLock) {\n pw.println(\" mStartedUsers:\");\n for (int i = 0; i < this.mStartedUsers.size(); i++) {\n UserState uss = this.mStartedUsers.valueAt(i);\n pw.print(\" User #\");\n pw.print(uss.mHandle.getIdentifier());\n pw.print(\": \");\n uss.dump(BackupManagerConstants.DEFAULT_BACKUP_FINISHED_NOTIFICATION_RECEIVERS, pw);\n }\n pw.print(\" mStartedUserArray: [\");\n for (int i2 = 0; i2 < this.mStartedUserArray.length; i2++) {\n if (i2 > 0) {\n pw.print(\", \");\n }\n pw.print(this.mStartedUserArray[i2]);\n }\n pw.println(\"]\");\n pw.print(\" mUserLru: [\");\n for (int i3 = 0; i3 < this.mUserLru.size(); i3++) {\n if (i3 > 0) {\n pw.print(\", \");\n }\n pw.print(this.mUserLru.get(i3));\n }\n pw.println(\"]\");\n if (this.mUserProfileGroupIds.size() > 0) {\n pw.println(\" mUserProfileGroupIds:\");\n for (int i4 = 0; i4 < this.mUserProfileGroupIds.size(); i4++) {\n pw.print(\" User #\");\n pw.print(this.mUserProfileGroupIds.keyAt(i4));\n pw.print(\" -> profile #\");\n pw.println(this.mUserProfileGroupIds.valueAt(i4));\n }\n }\n }\n }", "public int getTotalConnections()\n {\n // return _connections.size();\n return 0;\n }", "public void updateActiveUsers() {\r\n\t\tif (commandsQueue.isEmpty()) {\r\n\t\t\tString currentDoc = this.toString();\r\n\t\t\tfor (Socket socket : activeClients) {\r\n\t\t\t\tif (!socket.isClosed())\r\n\t\t\t\t\tServer.outs.get(socket).println(id + \"A\" + currentDoc);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void dump() throws IOException;", "void dump(PrintStream x) {\n String str = buffer.toString();\n x.println(\"<beginning of \" + name + \" buffer>\");\n x.println(str);\n x.println(\"<end of buffer>\");\n }", "@Override\n public void close() {\n for ( TunnelConnection tunnelConnection : tunnelConnections ) {\n IOUtils.closeAndLogException( tunnelConnection );\n }\n }", "void write(PacketConnection connection);", "public ConnInfo[] getConnections() {\n return connInfo;\n }", "public void dump(PrintWriter pw) {\n dump(pw, true);\n }", "public void showLogs() {\n String headID = Utils.readObject(HEADFILE, String.class);\n File asFile = new File(Main.ALL_COMMITS, headID);\n Commit associatedCommit = Utils.readObject(asFile, Commit.class);\n while (associatedCommit != null) {\n printCommitLog(associatedCommit);\n String parent = associatedCommit.getParent();\n if (parent == null) {\n break;\n }\n File commitFile = new File(Main.ALL_COMMITS, parent);\n associatedCommit = Utils.readObject(commitFile, Commit.class);\n }\n }", "@Override\n public int getNumConnections()\n {\n return connections.size();\n }", "@Override\n public void channelConnected(ChannelHandlerContext ctx, ChannelStateEvent e)\n {\n \n Channel connectedChannel = e.getChannel();\n allChannels.add(connectedChannel);\n \n msg = StringAppender.mergeToStr(connectedMsg, e.getChannel().getLocalAddress().toString(), \" , Connections:\", String.valueOf(allChannels.size()));\n logger.info(msg);\n \n }", "java.util.List<io.netifi.proteus.admin.om.Connection> \n getConnectionsList();", "protected void ping() {\n\t\tpingCount ++;\n\t\tif(pingCount > 5) {\n\t\t\tlog.debug(\"pingCount is exceed, so close this connection.\");\n\t\t\tclose();\n\t\t\treturn;\n\t\t}\n\t\tsendData(\"<ping />\");\n\t}", "@Override\n\tpublic void visit(KeepAlive ka) {\n\t\tSystem.out.println(\"peer keepAlive connection\");\n\t\tph.setAlive(true);\n\t\tthis.lastKeepAlive = System.currentTimeMillis();\n\t}", "public void serialise(java.io.PrintWriter pw) \n throws IOException {\n serialise(new StreamResult(pw));\n }", "public static long getConnections() {\n return connections;\n }", "public void announcePeer() throws Exception{\n \n Socket socket = new Socket(connect, inPort);\n\n BufferedReader br = new BufferedReader(new InputStreamReader(socket.getInputStream()));\n PrintWriter pw = new PrintWriter(new BufferedWriter(new OutputStreamWriter(socket.getOutputStream())),true);\n //System.out.println(\"Sending \" + cmd); \n // Tells another peer what is given in cmd\n pw.println(cmd);\n //System.out.println(\"Command sent\");\n String answer = br.readLine();\n System.out.println(answer);\n PeerConfig.writeInLogs(answer);\n\n pw.close();\n //br.close();\n socket.close();\n\n return ;\n }", "public void dump() {\n\t\tfor(Symbol s: assignments.keySet()) {\n\t\t\tSystem.out.println(s.toString() + \" = \" + assignments.get(s));\n\t\t}\t\n\t}", "public void dumpBag() {\n while (tileBag.size() > 0) {\n System.out.print(tileBag.remove(0) + \" - \");\n }\n }", "public void pingToClient() {\n Thread t = new Thread(() -> {\n while (connected) {\n try {\n Thread.sleep(1000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n try {\n socketOut.writeObject(\"\");\n } catch (IOException e) {\n //e.printStackTrace();\n }\n }\n });\n t.start();\n }", "private void printAllTransactions(){\n Set<Transaction> transactions = ctrl.getAllTransactions();\n transactions.stream().forEach(System.out::println);\n }", "private void sendTrafficSummary() {\n\t\ttry {\n\t\t\tregistry.getSender().sendData(\n\t\t\t\t\tnew OverlayNodeReportsTrafficSummary(myAssignedID,\n\t\t\t\t\t\t\tsendTracker, relayTracker, sendSummation,\n\t\t\t\t\t\t\treceiveTracker, receiveSummation).getBytes());\n\t\t\tthis.sendTracker = 0; // reset all counters after reporting\n\t\t\tthis.relayTracker = 0;\n\t\t\tthis.receiveTracker = 0;\n\t\t\tthis.sendSummation = 0;\n\t\t\tthis.receiveSummation = 0;\n\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(e.getMessage()\n\t\t\t\t\t+ \" Trouble reporting traffic summary or closing sockets.\");\n\t\t}\n\t}", "public void printDbStatus() {\n\t\tSystem.out.println(\"Max.: \" + getConnectionPool().getMaxActive() + \"; Active: \"\n\t\t\t\t+ getConnectionPool().getNumActive() + \"; Idle: \" + getConnectionPool().getNumIdle());\n\t}", "public void printGraph(){\n\t\tSystem.out.println(\"[INFO] Graph: \" + builder.nrNodes + \" nodes, \" + builder.nrEdges + \" edges\");\r\n\t}", "public void getInfo() {\n System.out.println(\"INFO Node : \"+address+ \" connected to nodes \");\n for(Node node : getConnectedNodes()){\n System.out.print(\"Node :\"+node.getAddress()+\" with edge : \");\n getEdge(this, node).printEdge();\n }\n \n }", "public void listThreads() {\n\t\tthis.toSlave.println(MasterProcessInterface.LIST_THREADS_COMMAND);\n\t}", "public ArrayList<AStarNode> getConnections() {\n return connected;\n }", "@Override\n public void run() {\n try {\n synchronized (this) {\n output.write('\\r');\n flush();\n output.write('\\n');\n flush();\n }\n // We could write, reschedule heartbeat\n scheduleHeartBeat();\n } catch (IOException x) {\n // The other peer closed the connection\n close();\n eventSource.onClose();\n }\n }", "private void dumpResultMapping ()\r\n {\r\n for (Entry<Result, Set<Candidate>> entry : connection.getResultMap().\r\n entrySet()) {\r\n logger.debug(\"Result: {}\", entry.getKey());\r\n\r\n for (Candidate candidate : entry.getValue()) {\r\n logger.debug(\"* candidate: {}\", candidate);\r\n }\r\n }\r\n }", "public void outputTasks ()\n\t{\n\t\toutput (\"\\n> (all-tasks)\\n\");\n\t\tString[] tasks = Task.allTaskClasses();\n\t\tfor (int i=0 ; i<tasks.length ; i++) output (tasks[i]);\n\t}", "private void openOutputStream() {\n\t\tPrintStreamManagement.openOutputStream();\n\t}" ]
[ "0.5652704", "0.54389685", "0.529712", "0.5282848", "0.5080682", "0.5075995", "0.50708663", "0.5044533", "0.497531", "0.497531", "0.497531", "0.497531", "0.497531", "0.497531", "0.497531", "0.497531", "0.497531", "0.49673006", "0.49630198", "0.49619353", "0.49331883", "0.49299395", "0.49277234", "0.49147975", "0.48763734", "0.485476", "0.4852701", "0.48424387", "0.4808453", "0.4782428", "0.47747687", "0.4759285", "0.47464618", "0.47298992", "0.47294328", "0.47286582", "0.47283208", "0.47173628", "0.47072577", "0.47027612", "0.46880966", "0.46702892", "0.4663205", "0.46424982", "0.46406174", "0.46316755", "0.46293798", "0.4626192", "0.46259874", "0.46156132", "0.46094275", "0.45974624", "0.45772523", "0.45751423", "0.45725247", "0.45685965", "0.4568595", "0.45663744", "0.45596093", "0.45589566", "0.45555907", "0.4553554", "0.45522654", "0.45505515", "0.4538737", "0.45306343", "0.4521102", "0.45200524", "0.45200342", "0.4519331", "0.451268", "0.45028454", "0.44905114", "0.44858328", "0.44756395", "0.4475053", "0.44741353", "0.44724935", "0.44717175", "0.44638264", "0.4463024", "0.4462315", "0.4453736", "0.44446325", "0.444379", "0.44406188", "0.4440106", "0.44389796", "0.44371107", "0.44306493", "0.44182763", "0.44173446", "0.44154733", "0.4410036", "0.44014525", "0.44013688", "0.44005856", "0.43994865", "0.43980265", "0.43971187" ]
0.48441774
27
Loads the widget prefs from the shared preferences
public boolean load(Context context, int widgetId) { String key; SharedPreferences prefs; prefs = context.getSharedPreferences(WIDGET_PREFERENCES, Context.MODE_PRIVATE); if (prefs != null) { key = WIDGET_TARGET_PATH + String.valueOf(widgetId); mTargetPath = prefs.getString(key, ""); key = WIDGET_READ_ONLY + String.valueOf(widgetId); mReadOnly = prefs.getBoolean(key, false); key = WIDGET_PRESENT_KEY + String.valueOf(widgetId); return prefs.getBoolean(key, false); } return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void loadPreferences() {\n SharedPreferences sp = getActivity().getSharedPreferences(SETTINGS, Context.MODE_PRIVATE );\n boolean lm = sp.getBoolean(getString(R.string.live_match), true);\n boolean ls = sp.getBoolean(getString(R.string.live_score), true);\n\n if(lm) live_match.setChecked(true);\n else live_match.setChecked(false);\n\n if(ls) live_score.setChecked(true);\n else live_score.setChecked(false);\n }", "private void loadSettings(){\n SharedPreferences sharedPreferences = getActivity().getSharedPreferences(SHARED_PREF, Context.MODE_PRIVATE);\n notificationSwtich = sharedPreferences.getBoolean(SWITCH, false);\n reminderOnOff.setChecked(notificationSwtich);\n }", "private void LoadSavedPreferences() {\n\t\tString value;\n\t\tSharedPreferences sharedPreferences = PreferenceManager\n\t\t\t\t.getDefaultSharedPreferences(this);\n\t\t// tab 3 ************************************************\n\t\tvalue = sharedPreferences.getString(\"tempSzad\", \"22\");\n\t\tettempSzad_.setText(value);\n\t\tvalue = sharedPreferences.getString(\"tempPmaxdop\", \"70\");\n\t\tettempPmaxdop_.setText(value);\n\t\tvalue = sharedPreferences.getString(\"tempZmaxdop\", \"22\");\n\t\tettempZmaxdop_.setText(value);\n\t\tvalue = sharedPreferences.getString(\"tempPumpaON\", \"50\");\n\t\tettempPumpaON_.setText(value);\n\n\t\t// tab 1 ************************************************\n\t\tvalue = sharedPreferences.getString(\"tv1\", \"20.20\");\n\t\ttvS1.setText(value);\n\t\tvalue = sharedPreferences.getString(\"tv2\", \"44.22\");\n\t\ttvS2.setText(value);\n\t\tvalue = sharedPreferences.getString(\"tv3\", \"19.22\");\n\t\ttvS3.setText(value);\n\t}", "private void loadPreferences() {\n\t\tXSharedPreferences prefApps = new XSharedPreferences(PACKAGE_NAME);\n\t\tprefApps.makeWorldReadable();\n\n\t\tthis.debugMode = prefApps.getBoolean(\"waze_audio_emphasis_debug\", false);\n }", "private void load()\n {\n SharedPreferences sp = getActivity().getPreferences(Context.MODE_PRIVATE);\n if (sp.contains(\"passLength\") && passLenSB != null)\n passLenSB.setProgress(sp.getInt(\"passLength\", 0));\n\n if (sp.contains(\"minDigits\") && minDigSB != null)\n minDigSB.setProgress(sp.getInt(\"minDigits\", 0));\n\n for (int i=0; i<checkBoxes.size(); i++)\n {\n checkBoxes.get(i).setChecked(sp.getBoolean(\"chkbx\"+Integer.toString(i), false));\n if (checkBoxes.get(i).isChecked())\n runChkBxOption(i, checkBoxes.get(i), rootView, child); // this code makes app generate new pass each time\n\n }\n // this code will restore pass on rotation only\n if (savedInstanceState != null && savedInstanceState.containsKey(\"password\"))\n passTV.setText(colourCodePass(savedInstanceState.getString(\"password\")));\n }", "private void loadPreferences() {\n SharedPreferences sp = getSharedPreferences(MY_PREFS, MODE_PRIVATE);\n\n int entreeIndex = sp.getInt(\"entreeIndex\", 0);\n int drinkIndex = sp.getInt(\"drinkIndex\", 0);\n int dessertIndex = sp.getInt(\"dessertIndex\", 0);\n\n // Setting inputs from SharedPreferences\n spEntree.setSelection(entreeIndex);\n spDrink.setSelection(drinkIndex);\n spDessert.setSelection(dessertIndex);\n\n edtTxtEntreePrice.setText(alEntreePrices.get(entreeIndex));\n edtTxtDrinkPrice.setText(alDrinkPrices.get(drinkIndex));\n edtTxtDessertPrice.setText(alDessertPrices.get(dessertIndex));\n }", "private void load(){\n mJSonNotifications = getSharedPreferences(SHARED_DEFAULT_NOTIFICATIONS, MODE_PRIVATE);\n Gson gson = new Gson();\n String json = mJSonNotifications.getString(SHARED_DEFAULT_NOTIFICATIONS, null);\n Type type = new TypeToken<SearchPreferences>() {}.getType();\n mSearchPreferences = gson.fromJson(json, type);\n if (mSearchPreferences == null) mSearchPreferences = new SearchPreferences();\n mNotificationsFragment.updateFragmentData(mSearchPreferences);\n }", "private void getPreferences() {\n Constants constants = new Constants();\n android.content.SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity());\n\n serverUrl = sharedPreferences.getString(\"LedgerLinkBaseUrl\", constants.DEFAULTURL);\n IsEditing = SharedPrefs.readSharedPreferences(getActivity(), \"IsEditing\", \"0\");\n tTrainerId = SharedPrefs.readSharedPreferences(getActivity(), \"ttrainerId\", \"-1\");\n vslaId = SharedPrefs.readSharedPreferences(getActivity(), \"vslaId\", \"-1\");\n\n vslaName = DataHolder.getInstance().getVslaName();\n representativeName = DataHolder.getInstance().getGroupRepresentativeName();\n representativePost = DataHolder.getInstance().getGroupRepresentativePost();\n repPhoneNumber = DataHolder.getInstance().getGroupRepresentativePhoneNumber();\n grpBankAccount = DataHolder.getInstance().getGroupBankAccount();\n physAddress = DataHolder.getInstance().getPhysicalAddress();\n regionName = DataHolder.getInstance().getRegionName();\n grpPhoneNumber = DataHolder.getInstance().getGroupPhoneNumber();\n grpBankAccount = DataHolder.getInstance().getGroupBankAccount();\n locCoordinates = DataHolder.getInstance().getLocationCoordinates();\n grpSupportType = DataHolder.getInstance().getSupportTrainingType();\n numberOfCycles = DataHolder.getInstance().getNumberOfCycles();\n }", "private void readSharedPreferences() {\n SharedPreferences sharedPref = getActivity().getSharedPreferences(SETTINGS_FILE_KEY, MODE_PRIVATE);\n currentDeviceAddress = sharedPref.getString(SETTINGS_CURRENT_DEVICE_ADDRESS, \"\");\n currentDeviceName = sharedPref.getString(SETTINGS_CURRENT_DEVICE_NAME, \"\");\n currentFilenamePrefix = sharedPref.getString(SETTINGS_CURRENT_FILENAME_PREFIX, \"\");\n currentSubjectName = sharedPref.getString(SETTINGS_SUBJECT_NAME, \"\");\n currentShoes = sharedPref.getString(SETTINGS_SHOES, \"\");\n currentTerrain = sharedPref.getString(SETTINGS_TERRAIN, \"\");\n }", "void loadPreferences() throws OntimizeJEERuntimeException;", "@Override\n public void onCreatePreferences(Bundle bundle, String s) {\n addPreferencesFromResource(R.xml.pref);\n sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity());\n //onSharedPreferenceChanged(sharedPreferences, getString(R.string.language_key));\n onSharedPreferenceChanged(sharedPreferences, getString(R.string.difficulty_key));\n onSharedPreferenceChanged(sharedPreferences, getString(R.string.word_category_key));\n }", "private void fetchPreferences() {\n macAddress = prefs.getString(getString(R.string.pref_mac), DEF_VALUE);\n macSet = prefs.getBoolean(getString(R.string.mac_set), false);\n //fetch previous values for temp, max, min\n tempMeasured = Double.parseDouble(prefs.getString(getString(R.string.text_temp), \"0\"));\n tempMax = Double.parseDouble(prefs.getString(getString(R.string.text_max), \"0\"));\n tempMin = Double.parseDouble(prefs.getString(getString(R.string.text_min), \"0\"));\n }", "private void loadInfo() {\n fname.setText(prefs.getString(\"fname\", null));\n lname.setText(prefs.getString(\"lname\", null));\n email.setText(prefs.getString(\"email\", null));\n password.setText(prefs.getString(\"password\", null));\n spinner_curr.setSelection(prefs.getInt(\"curr\", 0));\n spinner_stock.setSelection(prefs.getInt(\"stock\", 0));\n last_mod_date.setText(\" \" + prefs.getString(\"date\", getString(R.string.na)));\n }", "private void loadAppState(Context context) {\n SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(context);\n mTwoPane = settings.getBoolean(PREF_TWO_PANE, false);\n LogHelper.v(LOG_TAG, \"Loading state.\");\n }", "private void loadSettings() {\n \tLog.i(\"T4Y-Settings\", \"Load mobile settings\");\n \tmobileSettings = mainApplication.getMobileSettings();\n \t\n \t//update display\n autoSynchronizationCheckBox.setChecked(mobileSettings.isAllowAutoSynchronization());\n autoScanCheckBox.setChecked(mobileSettings.isAllowAutoScan());\n autoSMSNotificationCheckBox.setChecked(mobileSettings.isAllowAutoSMSNotification());\n }", "public SharedPreferences getPrefs() { return this.prefs; }", "private void loadData() {\n SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);\n String fromSymbols = sharedPreferences.getString(getString(R.string.cryto_key), getString(R.string.cryto_value));\n String toSymbols = sharedPreferences.getString(getString(R.string.currencies_key), getString(R.string.currencies_value));\n new FetchUrlTask().execute(fromSymbols, toSymbols);\n sharedPreferences.registerOnSharedPreferenceChangeListener(this);\n }", "private void loadSettings() {\n // set theme\n SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);\n String themeId = preferences.getString(\"theme\", \"\");\n if (themeId.equals(\"light\")) {\n setTheme(R.style.ThemeLightReadMode);\n Log.d(TAG, \"switch to light theme \" + themeId);\n }\n else /*if (themeId.equals(\"dark\"))*/ {\n setTheme(R.style.ThemeDarkReadMode);\n Log.d(TAG, \"switch to dark theme \" + themeId);\n }\n }", "public void loadFromPreferences(SharedPreferences preferences){\r\n\t\tinitialSetuped = preferences.getBoolean(\"initialSetupped\", false);\r\n\t\tuserName = preferences.getString(\"username\", \"\");\r\n\t\tuserEmail = preferences.getString(\"useremail\", \"\");\r\n\t\trecipientEmail = preferences.getString(\"recipientemail\", \"\");\r\n\t\toption = WeightUnitOption.loadPreference(preferences.getBoolean(\"option\", true));\r\n\t}", "private void loadData() {\n reminderData.loadDataFromSharedPreferences();\n reminderText.setText(reminderData.getNotificationText());\n timePicker.setMinute(reminderData.getMinutes());\n timePicker.setHour(reminderData.getHours());\n }", "private void loadpreferences() {\n\t\t\tSharedPreferences mySharedPreferences = context.getSharedPreferences(MYPREFS,mode);\n\t\t\tlogin_id = mySharedPreferences.getInt(\"login_id\", 0);\n\t\t\t\n\t\t\tLog.d(\"Asynctask\", \"\" + login_id);\n\t\t\tsubId = mySharedPreferences.getString(\"SubcriptionID\", \"\");\n\t\t\tLog.d(\"SubcriptionID inASYNTASK******************\", \"\" + subId);\n\n\t\t}", "private void loadSettings() {\n//\t\tSharedPreferences prefs = this.getSharedPreferences(Defs.PREFS_NAME, 0);\n//\t\t\n//\t\tString fileData = prefs.getString(Defs.PREFS_KEY_PREV_RATES_FILE, \"\");\n//\t\tLog.d(TAG, \"Loaded last \" + fileData);\n//\t\tif ( fileData.length() > 0 ) {\n//\t\t\tByteArrayInputStream bias = new ByteArrayInputStream(fileData.getBytes());\n//\t\t\t_oldRates = new ExchangeRate();\n//\t\t\tparseRates(bias, _oldRates);\n//\t\t}\n\t}", "@SuppressLint(\"CommitPrefEdits\")\n @Override\n public void onLoadFinished(Loader<SharedPreferences> loader,\n SharedPreferences prefs) {\n }", "private void getDataFromSharedPrefernce() {\r\n\r\n\t\tprofileImageString = mSharedPreferences_reg.getString(\"ProfileImageString\",\"\");\r\n\t\tpsedoName = mSharedPreferences_reg.getString(\"PseudoName\", \"\");\r\n\t\tprofiledescription = mSharedPreferences_reg.getString(\"Pseudodescription\", \"\");\r\n\r\n\t\tsetDataToRespectiveFields();\r\n\t}", "private void initSharedPreference(){\n mSharedPreferences = Configuration.getContext().getSharedPreferences(\"SessionManager\", Context.MODE_PRIVATE) ;\n }", "public static void initPrefs(){\n prefs = context.getSharedPreferences(PREFS_FILE, 0);\n SharedPreferences.Editor editor = prefs.edit();\n editor.remove(Constants.IS_FIRST_RUN);\n editor.putBoolean(Constants.ACTIVITY_SENSE_SETTING,false);\n editor.commit();\n }", "private void setupSharedPreferences() {\n SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);\n\n String aaString = sharedPreferences.getString(getString(R.string.pref_antalAktier_key), getString(R.string.pref_antalAktier_default));\n// float aaFloat = Float.parseFloat(aaString);\n editTextAntalAktier.setText(aaString);\n\n String kk = sharedPreferences.getString(getString(R.string.pref_koebskurs_key), getString(R.string.pref_koebskurs__default));\n editTextKoebskurs.setText(kk);\n\n String k = sharedPreferences.getString(getString(R.string.pref_kurtage_key), getString(R.string.pref_kurtage_default));\n editTextKurtage.setText(k);\n\n// float minSize = Float.parseFloat(sharedPreferences.getString(getString(R.string.pref_size_key),\n// getString(R.string.pref_size_default)));\n// mVisualizerView.setMinSizeScale(minSize);\n\n // Register the listener\n sharedPreferences.registerOnSharedPreferenceChangeListener(this);\n }", "private void readPreferences() {\r\n \t\tSharedPreferences sp = getSharedPreferences(SPN, MODE_PRIVATE);\r\n \t\t// set listener to this\r\n \t\tsp.registerOnSharedPreferenceChangeListener(this);\r\n \t\t// read shared preferences to get data file\r\n \t\tdataFile = sp.getString(res.getString(R.string.pref_data_file_key),\r\n \t\t\t\tnull);\r\n \t\tif (localLOGV) {\r\n \t\t\tLog.i(TAG, \"Data file is \" + dataFile);\r\n \t\t}\r\n \t\tif (dataFile == null)\r\n \t\t\treturn;\r\n \t\t// read if data file is compressed\r\n \t\tgzipFile = sp.getBoolean(res.getString(R.string.pref_data_file_gzip),\r\n \t\t\t\tfalse);\r\n \t}", "private static SharedPreferences getSharedPreference(Context context){\n return PreferenceManager.getDefaultSharedPreferences(context);\n }", "private void loadDefaultValues() {\n for (Map.Entry<EditText, Integer> e : mPrefKeys.entrySet()) {\n e.getKey().setText(Pref.getDefault(this, e.getValue()));\n }\n }", "private void loadState() {\n SharedPreferences prefs = getPreferences(MODE_PRIVATE);\n this._tally = prefs.getInt(\"count\", 0);\n }", "ReadOnlyUserPrefs getUserPrefs();", "ReadOnlyUserPrefs getUserPrefs();", "ReadOnlyUserPrefs getUserPrefs();", "ReadOnlyUserPrefs getUserPrefs();", "private static boolean loadSharedPreferencesFromFile(File src) {\n\t\tboolean res = false;\n\t\tObjectInputStream input = null;\n\t\ttry {\n\t\t\tinput = new ObjectInputStream(new FileInputStream(src));\n\t\t\tEditor prefEdit = PreferenceManager.getDefaultSharedPreferences(mContext).edit();\n\t\t\tprefEdit.clear();\n\t\t\t// first object is preferences\n\t\t\tMap<String, ?> entries = (Map<String, ?>) input.readObject();\n\t\t\t\t\n\t\t\tfor (Entry<String, ?> entry : entries.entrySet()) {\n\t\t\t\tObject v = entry.getValue();\n\t\t\t\tString key = entry.getKey();\n\t\n\t\t\t\tif (v instanceof Boolean)\n\t\t\t\t\tprefEdit.putBoolean(key, ((Boolean) v).booleanValue());\n\t\t\t\telse if (v instanceof Float)\n\t\t\t\t\tprefEdit.putFloat(key, ((Float) v).floatValue());\n\t\t\t\telse if (v instanceof Integer)\n\t\t\t\t\tprefEdit.putInt(key, ((Integer) v).intValue());\n\t\t\t\telse if (v instanceof Long)\n\t\t\t\t\tprefEdit.putLong(key, ((Long) v).longValue());\n\t\t\t\telse if (v instanceof String)\n\t\t\t\t\tprefEdit.putString(key, ((String) v));\n\t\t\t}\n\t\t\tprefEdit.commit();\n\t\n\t\t\t// second object is admin options\n\t\t\tEditor adminEdit = mContext.getSharedPreferences(AdminPreferencesActivity.ADMIN_PREFERENCES, 0).edit();\n\t\t\tadminEdit.clear();\n\t\t\t// first object is preferences\n\t\t\tMap<String, ?> adminEntries = (Map<String, ?>) input.readObject();\n\t\t\tfor (Entry<String, ?> entry : adminEntries.entrySet()) {\n\t\t\t\tObject v = entry.getValue();\n\t\t\t\tString key = entry.getKey();\n\t\n\t\t\t\tif (v instanceof Boolean)\n\t\t\t\t\tadminEdit.putBoolean(key, ((Boolean) v).booleanValue());\n\t\t\t\telse if (v instanceof Float)\n\t\t\t\t\tadminEdit.putFloat(key, ((Float) v).floatValue());\n\t\t\t\telse if (v instanceof Integer)\n\t\t\t\t\tadminEdit.putInt(key, ((Integer) v).intValue());\n\t\t\t\telse if (v instanceof Long)\n\t\t\t\t\tadminEdit.putLong(key, ((Long) v).longValue());\n\t\t\t\telse if (v instanceof String)\n\t\t\t\t\tadminEdit.putString(key, ((String) v));\n\t\t\t}\n\t\t\tadminEdit.commit();\n\t\n\t\t\tLog.i(t, \"Loaded hashmap settings into preferences\");\n\t\t\tres = true;\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (input != null) {\n\t\t\t\t\tinput.close();\n\t\t\t\t}\n\t\t\t} catch (IOException ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t}\n\t\treturn res;\n\t}", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\t\n\t\tthis.prefs = PreferenceManager.getDefaultSharedPreferences(this);\n\t\t/*\n\t\t * Each app has its own shared preferences available to all components\n\t\t * of the app and this loads the default preferences that are saved on\n\t\t * the phone\n\t\t */\n\t\tthis.prefs.registerOnSharedPreferenceChangeListener(this);\n\t\t/*\n\t\t * Each user can change preferences. So this listener is a mechanism to\n\t\t * notify this activity that the old values are stale\n\t\t */\n\t}", "private void showUserPreferences() {\r\n MyAccount ma = state.getMyAccount();\r\n \r\n mOriginName.setValue(ma.getOriginName());\r\n SharedPreferencesUtil.showListPreference(this, MyAccount.Builder.KEY_ORIGIN_NAME, R.array.origin_system_entries, R.array.origin_system_entries, R.string.summary_preference_origin_system);\r\n mOriginName.setEnabled(!ma.isPersistent());\r\n \r\n if (mEditTextUsername.getText() == null\r\n || ma.getUsername().compareTo(mEditTextUsername.getText()) != 0) {\r\n mEditTextUsername.setText(ma.getUsername());\r\n }\r\n StringBuilder summary = new StringBuilder(this.getText(R.string.summary_preference_username));\r\n if (ma.getUsername().length() > 0) {\r\n summary.append(\": \" + ma.getUsername());\r\n } else {\r\n summary.append(\": (\" + this.getText(R.string.not_set) + \")\");\r\n }\r\n mEditTextUsername.setSummary(summary);\r\n mEditTextUsername.setEnabled(ma.canSetUsername());\r\n\r\n if (ma.isOAuth() != mOAuth.isChecked()) {\r\n mOAuth.setChecked(ma.isOAuth());\r\n }\r\n // In fact, we should hide it if not enabled, but I couldn't find an easy way for this...\r\n mOAuth.setEnabled(ma.canChangeOAuth());\r\n\r\n if (mEditTextPassword.getText() == null\r\n || ma.getPassword().compareTo(mEditTextPassword.getText()) != 0) {\r\n mEditTextPassword.setText(ma.getPassword());\r\n }\r\n summary = new StringBuilder(this.getText(R.string.summary_preference_password));\r\n if (TextUtils.isEmpty(ma.getPassword())) {\r\n summary.append(\": (\" + this.getText(R.string.not_set) + \")\");\r\n }\r\n mEditTextPassword.setSummary(summary);\r\n mEditTextPassword.setEnabled(ma.getConnection().isPasswordNeeded());\r\n\r\n int titleResId;\r\n switch (ma.getCredentialsVerified()) {\r\n case SUCCEEDED:\r\n titleResId = R.string.title_preference_verify_credentials;\r\n summary = new StringBuilder(\r\n this.getText(R.string.summary_preference_verify_credentials));\r\n break;\r\n default:\r\n if (ma.isPersistent()) {\r\n titleResId = R.string.title_preference_verify_credentials_failed;\r\n summary = new StringBuilder(\r\n this.getText(R.string.summary_preference_verify_credentials_failed));\r\n } else {\r\n titleResId = R.string.title_preference_add_account;\r\n if (ma.isOAuth()) {\r\n summary = new StringBuilder(\r\n this.getText(R.string.summary_preference_add_account_oauth));\r\n } else {\r\n summary = new StringBuilder(\r\n this.getText(R.string.summary_preference_add_account_basic));\r\n }\r\n }\r\n break;\r\n }\r\n mVerifyCredentials.setTitle(titleResId);\r\n mVerifyCredentials.setSummary(summary);\r\n mVerifyCredentials.setEnabled(ma.isOAuth() || ma.getCredentialsPresent());\r\n }", "private static SharedPreferences getSharedPreferences(Context context) {\n return context.getSharedPreferences(SMILE_PREFERENCES, Context.MODE_PRIVATE);\n }", "public void retrieveDataFromSharedPreference(View view) {\n\n name = sharedPreferences.getString(\"name\",\"no data\");\n email = sharedPreferences.getString(\"email\",\"no data\");\n\n nameEditText.setText(name);\n emailEditText.setText(email);\n\n }", "private void getPrefs(){\n SharedPreferences sharedPreferences = getSharedPreferences(LIST_TAG, MODE_PRIVATE);\n Gson gson = new Gson();\n String json = sharedPreferences.getString(PREFS_TAG, null);\n Type type = new TypeToken<ArrayList<String[]>>() {}.getType();\n dataPref = gson.fromJson(json, type);\n\n if(dataPref == null){\n LoadFromCSV();\n }\n else {\n Log.d(\"getPrefs\", \"was called \");\n itemArrAdapt.setList(dataPref);\n }\n\n }", "public static SharedPreferences getSharedPrefs() {\n return App.getAppContext().getSharedPreferences(PREFS_LABEL, Context.MODE_PRIVATE);\n }", "private void showUserPreferences() {\r\n MyAccount ma = state.getAccount();\r\n \r\n mOriginName.setValue(ma.getOriginName());\r\n SharedPreferencesUtil.showListPreference(this, MyAccount.Builder.KEY_ORIGIN_NAME, R.array.origin_system_entries, R.array.origin_system_entries, R.string.summary_preference_origin_system);\r\n \r\n mOriginName.setEnabled(!state.builder.isPersistent() && TextUtils.isEmpty(ma.getUsername()));\r\n \r\n if (mEditTextUsername.getText() == null\r\n || ma.getUsername().compareTo(mEditTextUsername.getText()) != 0) {\r\n mEditTextUsername.setText(ma.getUsername());\r\n }\r\n StringBuilder summary;\r\n if (ma.getUsername().length() > 0) {\r\n summary = new StringBuilder(ma.getUsername());\r\n } else {\r\n summary = new StringBuilder(this.getText(ma.alternativeTermForResourceId(R.string.summary_preference_username)));\r\n }\r\n mEditTextUsername.setDialogTitle(this.getText(ma.alternativeTermForResourceId(R.string.dialog_title_preference_username)));\r\n mEditTextUsername.setTitle(this.getText(ma.alternativeTermForResourceId(R.string.title_preference_username)));\r\n mEditTextUsername.setSummary(summary);\r\n mEditTextUsername.setEnabled(!state.builder.isPersistent() && !ma.isUsernameValidToStartAddingNewAccount());\r\n \r\n boolean isNeeded = ma.canChangeOAuth();\r\n if (ma.isOAuth() != mOAuth.isChecked()) {\r\n mOAuth.setChecked(ma.isOAuth());\r\n }\r\n // In fact, we should hide it if not enabled, but I couldn't find an easy way for this...\r\n mOAuth.setEnabled(isNeeded);\r\n if (isNeeded) {\r\n mOAuth.setTitle(R.string.title_preference_oauth);\r\n mOAuth.setSummary(ma.isOAuth() ? R.string.summary_preference_oauth_on : R.string.summary_preference_oauth_off);\r\n } else {\r\n mOAuth.setTitle(\"\");\r\n mOAuth.setSummary(\"\");\r\n }\r\n \r\n isNeeded = ma.getConnection().isPasswordNeeded();\r\n if (mEditTextPassword.getText() == null\r\n || ma.getPassword().compareTo(mEditTextPassword.getText()) != 0) {\r\n mEditTextPassword.setText(ma.getPassword());\r\n }\r\n if (isNeeded) {\r\n mEditTextPassword.setTitle(R.string.title_preference_password);\r\n summary = new StringBuilder(this.getText(R.string.summary_preference_password));\r\n if (TextUtils.isEmpty(ma.getPassword())) {\r\n summary.append(\": (\" + this.getText(R.string.not_set) + \")\");\r\n }\r\n } else {\r\n summary = null;\r\n mEditTextPassword.setTitle(\"\");\r\n }\r\n mEditTextPassword.setSummary(summary);\r\n mEditTextPassword.setEnabled(isNeeded);\r\n \r\n int titleResId;\r\n boolean addAccountOrVerifyCredentialsEnabled = ma.isOAuth() || ma.getCredentialsPresent();\r\n switch (ma.getCredentialsVerified()) {\r\n case SUCCEEDED:\r\n titleResId = R.string.title_preference_verify_credentials;\r\n summary = new StringBuilder(\r\n this.getText(R.string.summary_preference_verify_credentials));\r\n break;\r\n default:\r\n if (state.builder.isPersistent()) {\r\n titleResId = R.string.title_preference_verify_credentials_failed;\r\n summary = new StringBuilder(\r\n this.getText(R.string.summary_preference_verify_credentials_failed));\r\n } else {\r\n if (!ma.isUsernameValidToStartAddingNewAccount()) {\r\n addAccountOrVerifyCredentialsEnabled = false;\r\n }\r\n titleResId = R.string.title_preference_add_account;\r\n if (ma.isOAuth()) {\r\n summary = new StringBuilder(\r\n this.getText(R.string.summary_preference_add_account_oauth));\r\n } else {\r\n summary = new StringBuilder(\r\n this.getText(R.string.summary_preference_add_account_basic));\r\n }\r\n }\r\n break;\r\n }\r\n addAccountOrVerifyCredentials.setTitle(titleResId);\r\n addAccountOrVerifyCredentials.setSummary(summary);\r\n addAccountOrVerifyCredentials.setEnabled(addAccountOrVerifyCredentialsEnabled);\r\n }", "public void restoringPreferences()\n {\n SharedPreferences sharedPreferences = getSharedPreferences(preferenceSaveInfo,MODE_PRIVATE);\n\n //lay gia tri checkbook, k co mac dinh la false\n boolean bchk = sharedPreferences.getBoolean(\"checked\",false);\n if(bchk)\n {\n //lay user, pass, neu k co mac dinh gia tri la rong\n String user = sharedPreferences.getString(\"user\",\"\");\n String pass = sharedPreferences.getString(\"pass\",\"\");\n txtUserName.setText(\"user\");\n txtPassWord.setText(\"pass\");\n }\n\n chkSave.setChecked(bchk);\n }", "private static SharedPreferences getSharedPrefs(final Context context) {\n final String prefsName = context.getString(R.string.sharedprefs_name);\n return context.getSharedPreferences(prefsName, Context.MODE_PRIVATE);\n }", "@Override\n public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {\n\n if (key.equals(getString(R.string.pref_location_key))) {\n\n String val = sharedPreferences.getString(getString(R.string.pref_location_key),\n getString(R.string.pref_location_lagos_value));\n if (val.equals(getString(R.string.pref_location_lagos_value))) {\n GITHUB_REQUEST_URL = getString(R.string.lagos_github_url);\n } else if (val.equals(getString(R.string.pref_location_calabar_value))) {\n GITHUB_REQUEST_URL = getString(R.string.calabar_github_url);\n } else if (val.equals(getString(R.string.pref_location_portharcourt_value))) {\n GITHUB_REQUEST_URL = getString(R.string.portharcourt_github_url);\n } else if (val.equals(getString(R.string.pref_location_abuja_value))) {\n GITHUB_REQUEST_URL = getString(R.string.abuja_github_url);\n } else {\n GITHUB_REQUEST_URL = getString(R.string.uyo_github_url);\n }\n\n\n if (isConnected) {\n loadingIndicator.setVisibility(View.VISIBLE);\n\n // Initialize the loader. Pass in the int ID constant defined above and pass in null for\n // the bundle. Pass in this activity for the LoaderCallbacks parameter (which is valid\n // because this activity implements the LoaderCallbacks interface).\n loaderManager.restartLoader(DEVELOPER_LOADER_ID, null, this);\n\n\n } else {\n loadingIndicator.setVisibility(View.GONE);\n mEmptyStateTextView.setText(R.string.no_internet_connection);\n }\n }\n }", "public void loadData(){\n SharedPreferences sharedPreferences=getSharedPreferences(\"logDetails\",Context.MODE_PRIVATE);\n nameText=sharedPreferences.getString(\"name\",\"na\");\n regText=sharedPreferences.getString(\"regnum\",\"na\");\n count=sharedPreferences.getInt(\"count\",1);\n\n\n }", "public void handlePreferences() {\n displayPrefs ();\n }", "public void load () {\n hasSoundOn = preference.getBoolean(\"sound effect\", true);\n hasMusicOn = preference.getBoolean(\"background music\", true);\n soundVolume = MathUtils.clamp(preference.getFloat(\"sound volume\", 0.5f), 0.0f, 1.0f);\n musicVolume = MathUtils.clamp(preference.getFloat(\"music volume\", 0.5f), 0.0f, 1.0f);\n }", "private void savePrefsData() {\n SharedPreferences pref = getApplicationContext().getSharedPreferences(\"myPrefs\", MODE_PRIVATE);\n SharedPreferences.Editor editor = pref.edit();\n editor.putBoolean(\"isIntroOpnend\", true);\n editor.commit();\n }", "private void getPreferences() {\n\n if(sharedpreferences.getBoolean(\"usaGPU\", true)) {\n mUtilizzoGPU.setChecked(true);\n }\n else{\n mUtilizzoGPU.setChecked(false);\n }\n\n }", "private void getAutonomousPrefs() {\n SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(hardwareMap.appContext);\n alliance = preferences.getString(\"AllianceColor\", \"error\");\n frontBack = preferences.getString(\"FrontBack\", \"error\");\n getPartnerGlyph = preferences.getBoolean(\"PickupAllianceGlyph\", false);\n getPitGlyph = preferences.getBoolean(\"PickupPitGlyph\", false);\n }", "public static Object get(String key) {\n return prefs.contains(key) ? prefs.getAll().get(key):null;\n }", "private SharedPreferences getSharedPrefs() {\n return Freelancer.getContext().getSharedPreferences(SHARED_PREFS_NAME, Context.MODE_PRIVATE);\n }", "public void restore() {\n this.prefs.edit().putBoolean(PREFKEY_IS_KIOSK, tempIsKiosk).apply();\n this.prefs.edit().putBoolean(PREFKEY_IS_TABLET, tempIsTablet).apply();\n this.prefs.edit().putBoolean(PREFKEY_HTTP_SSL, tempSSL).apply();\n this.prefs.edit().putBoolean(PREFKEY_RES_FETCHED, tempFetched).apply();\n this.prefs.edit().putString(PREFKEY_HTTP_PORT, tempHttpPort).apply();\n this.prefs.edit().putString(PREFKEY_HTTP_HOST, tempHttpHost).apply();\n this.prefs.edit().putString(PREFKEY_PASSWORD, temppassword).apply();\n this.prefs.edit().putString(PREFKEY_USERNAME, tempUsername).apply();\n this.prefs.edit().putString(PREFKEY_BOOTSTRAP, tempBootstrap).apply();\n this.prefs.edit().putString(PREFKEY_ROOM_SELECTED, roomSelected).apply();\n this.prefs.edit().putString(PREFKEY_TO_IGNORE, toIgnore).apply();\n this.prefs.edit().putBoolean(PREFKEY_IS_IMAGE_DOWNLOADED, isImageDownloaded).apply();\n this.prefs.edit().putBoolean(PREFKEY_IS_IMAGE_LAN, isImageLan).apply();\n }", "protected abstract IPreferenceStore getPreferenceStore();", "private void setupSharedPreferences() {\n SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);\n\n //set the driver name and track variables using methods below, which are also called from onSharedPreferencesChanged\n setDriver(sharedPreferences);\n setTrack(sharedPreferences);\n }", "private void readPreferences() {\n configAutonomousCommand();\n }", "private void getPrefs() {\n SharedPreferences prefs = PreferenceManager\n .getDefaultSharedPreferences(getBaseContext());\n \n int size = prefs.getInt(\"textsizePref\", 20);\n int color = Integer.valueOf(prefs.getString(\"textcolorPref\", \"7f070006\"),16);\n int bakcolor = Integer.valueOf(prefs.getString(\"backgroundcolorPref\", \"1\"));\n int font = Integer.valueOf(prefs.getString(\"fontPref\", \"1\"));\n mQuoteTxt.setTextColor(getResources().getColor(color));\n \n SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);\n Editor editor = sp.edit();\n switch (bakcolor) {\n case 1: \t\n \tmScrollview.setBackgroundColor(getResources().getColor(R.color.white));\n \tif (color == 1) {\n \t\tmQuoteTxt.setTextColor(getResources().getColor(R.color.black));\n \t\teditor.putString(\"textcolorPref\", \"2\");\n \t} \t\t\n \tmHeader.setTextColor(getResources().getColor(R.color.black));\n \tbreak;\n case 2:\n \tmScrollview.setBackgroundColor(getResources().getColor(R.color.black));\n \tif (color == 2) {\n \t\tmQuoteTxt.setTextColor(getResources().getColor(R.color.white));\n \t\teditor.putString(\"textcolorPref\", \"1\");\n \t} \t\t\n \tmHeader.setTextColor(getResources().getColor(R.color.white));\n break;\n } \n editor.commit();\n switch (font) {\n case 1:\n \tmQuoteTxt.setTypeface(Typeface.DEFAULT);\n \tbreak;\n case 2:\n \tmQuoteTxt.setTypeface(Typeface.SANS_SERIF);\n \tbreak;\n case 3:\n \tmQuoteTxt.setTypeface(Typeface.SERIF);\n \tbreak;\n case 4:\n \tmQuoteTxt.setTypeface(Typeface.MONOSPACE);\n \tbreak;\n }\n mQuoteTxt.setTextSize((float) size);\n \n }", "private void saveSharedPref() {\n SharedPreferences.Editor editor = this.sharedPreferences.edit();\n if (checkBox.isChecked()) {\n editor.putBoolean(Constants.SP_IS_REMEMBERED_KEY, true);\n }\n editor.apply();\n }", "public static void init(Context context) {\n prefs = context.getSharedPreferences(\"ERS_Prefs\", Context.MODE_PRIVATE);\n }", "SharedPreferences mo117960a();", "@Override\n public void onCreatePreferences(Bundle bundle, String s) {\n addPreferencesFromResource(R.xml.preferences);\n }", "private void load(){\n SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());\n Gson gson = new Gson();\n\n String json = preferences.getString(LISTS_DOWNLOADED,null);\n Type type =new TypeToken<ArrayList<String>>() {}.getType();\n downloadedBooks = gson.fromJson(json,type);\n\n json = preferences.getString(LISTS_PROGRESS,null);\n type =new TypeToken<ArrayList<Integer>>() {}.getType();\n progress=gson.fromJson(json,type);\n\n if(downloadedBooks == null){\n downloadedBooks = new ArrayList<>();\n }\n if(progress == null){\n progress = new ArrayList<>();\n }\n\n }", "public SharePref(Context context) {\n sPrefs = context.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);\n }", "public abstract SharedPreferences getStateSettings();", "public SharedPreferences prefs() {\n\n SharedPreferences prefs = context.getSharedPreferences(APP_IDS_PREFS_NAME, Context.MODE_PRIVATE); // Private because it can still be accessed from other apps with the same User ID\n return prefs;\n }", "private static SharedPreferences getSharedPreferences() {\n Context ctx = AppUtils.getAppContext();\n return ctx.getSharedPreferences(\"pref_user_session_data\", Context.MODE_PRIVATE);\n }", "private static SharedPreferences getSharedPreferences(Context context) {\n return PreferenceManager.getDefaultSharedPreferences(context);\n }", "protected void makePref(){\n //Creates a shared pref called MyPref and 0-> MODE_PRIVATE\n sharedPref = getSharedPreferences(AppCSTR.PREF_NAME, Context.MODE_PRIVATE);\n //so the pref can be edit\n edit = sharedPref.edit();\n}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n addPreferencesFromResource(R.xml.preferences);\n\n SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(getBaseContext());\n\n //String ip = SP.getString(\"ip\", \"NULL\");\n // Config.ip = SP.getString(\"ip\", \"NULL\");\n // Log.e(\"IP\",Config.ip );\n String language = SP.getString(\"language\",\"NULL\");\n // Toast.makeText(getApplicationContext(),Config.ip,Toast.LENGTH_SHORT).show();\n //Toast.makeText(getApplicationContext(),language,Toast.LENGTH_SHORT).show();\n }", "public SharedPref() {\n super();\n }", "@Override\n public void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n addPreferencesFromResource(R.xml.framework_setting);\n SharedPreferences sharedPreferences = this.getPreferenceManager().getSharedPreferences();\n String preference_smartbar_default_type = getResources().getString(R.string.preference_smartbar_default_type);\n final ListPreference listPreference = (ListPreference) findPreference(preference_smartbar_default_type);\n //修改Smartbar类型\n String smart_type = sharedPreferences.getString(preference_smartbar_default_type, null);\n int index = listPreference.findIndexOfValue(String.valueOf(smart_type));\n if (index != -1) {\n CharSequence[] entries = listPreference.getEntries();\n listPreference.setTitle(entries[index]);\n }\n if (listPreference != null) {\n listPreference.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {\n @Override\n public boolean onPreferenceChange(Preference preference, Object newValue) {\n int index = listPreference.findIndexOfValue(newValue.toString());\n CharSequence[] entries = listPreference.getEntries();\n listPreference.setTitle(entries[index]);\n return true;\n }\n });\n }\n }", "private void registerPrefsListener() {\n if (userSharedPreferences == null) {\n userSharedPreferences = Util.getUserSharedPreferences();\n }\n userPreferenceChangeListener = new SharedPreferences.OnSharedPreferenceChangeListener() {\n @Override\n public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {\n switch (key) {\n case HPIApp.Prefs.SHARED_KEY_TOTAL_STEPS:\n int steps = sharedPreferences.getInt(HPIApp.Prefs.SHARED_KEY_TOTAL_STEPS, 0);\n txtViewStepsCountToday.setText(String.valueOf(steps));\n break;\n case HPIApp.Prefs.SHARED_KEY_MILESTONES_TODAY:\n int milestones = sharedPreferences.getInt(HPIApp.Prefs.SHARED_KEY_MILESTONES_TODAY, 0);\n txtViewMilestonesCountToday.setText(String.valueOf(milestones));\n case HPIApp.Prefs.SHARED_KEY_RUN_SERVICE:\n boolean runService = sharedPreferences.getBoolean(HPIApp.Prefs.SHARED_KEY_RUN_SERVICE, false);\n if (runService) {\n HPIApp.getAppContext().startService(new Intent(HPIApp.getAppContext(), StepService.class));\n } else {\n HPIApp.getAppContext().stopService(new Intent(HPIApp.getAppContext(), StepService.class));\n }\n default:\n break;\n }\n }\n };\n\n userSharedPreferences.registerOnSharedPreferenceChangeListener(userPreferenceChangeListener);\n }", "@Override\n protected void onResume() {\n SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);\n sp.registerOnSharedPreferenceChangeListener(this);\n super.onResume();\n }", "@Override\n protected void onResume() {\n SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);\n sp.registerOnSharedPreferenceChangeListener(this);\n super.onResume();\n }", "public DeveloperPrefsPanel(DeveloperPreferences prefs) {\n\t\tthis.prefs = prefs;\n\t\tinitComponents();\n\t}", "@Override\n\tprotected void onActivityResult(int requestCode, int resultCode, Intent data) {\n\t\tloadPref();\n\t}", "public void savingVariablesWebConfig(){\n SharedPreferences prefs = getSharedPreferences(Constants.PREFERENCES_NAME, Context.MODE_PRIVATE);\n //Save data of user in preferences\n SharedPreferences.Editor editor = prefs.edit();\n\n editor.putString(Constants.PREF_VALUE_MAX_ORDERS_ACCEPTED, \"3\");\n editor.putString(Constants.PREF_VALUE_MAX_ORDERS_VISIBLE, \"10\");\n editor.putString(Constants.PREF_VALUE_MAX_TIME_ORDERS, \"15\");\n editor.commit();\n }", "private SharedPreferences GetPreferences( Context context )\n\t{\n\t\treturn context.getSharedPreferences( CACHE_NAME, Context.MODE_PRIVATE );\n\t}", "public void loadData() {\n SharedPreferences sharedPreferences = getSharedPreferences(SHARED_PREFS, MODE_PRIVATE);\n Gson gson = new Gson();\n String jsonItem = sharedPreferences.getString(REMINDER_ITEM, null);\n\n Type typeItem = new TypeToken<ArrayList<ReminderItem>>() {}.getType();\n\n reminderItems = gson.fromJson(jsonItem, typeItem);\n\n // In case reminderItems is null, reassign it.\n if (reminderItems == null) {\n reminderItems = new ArrayList<>();\n }\n }", "private void loadSettingsFromSharedPreferencesDeviceAndResourcees() {\n this.mTouchCapture = (TouchCapture)this.mActivity.getCommonSettings().get(CommonSettingKey.TOUCH_CAPTURE);\n this.mPrefs = this.mActivity.getSharedPreferences(\"com.sonyericsson.android.camera.shared_preferences\", 0);\n int n = this.mCameraDevice.getCameraId();\n switch (n) {\n case 0: {\n this.mVideoFocusMode = FocusMode.FACE_DETECTION;\n break;\n }\n case 1: {\n this.mVideoFocusMode = FocusMode.FIXED;\n }\n }\n this.mAutoReviewSetting = this.mActivity.isOneShotPhotoSecure() ? AutoReview.OFF : FastCapturingCameraUtils.loadParameter(this.mPrefs, 1, n, ParameterKey.AUTO_REVIEW, AutoReview.OFF);\n if (this.mVideoAutoReviewSetting == null) {\n this.mVideoAutoReviewSetting = FastCapturingCameraUtils.loadParameter(this.mPrefs, 2, n, ParameterKey.VIDEO_AUTO_REVIEW, VideoAutoReview.OFF);\n }\n if (n == 0) {\n this.mPhotoSelfTimerSetting = SelfTimer.OFF;\n return;\n }\n this.mPhotoSelfTimerSetting = FastCapturingCameraUtils.loadParameter(this.mPrefs, 1, n, ParameterKey.SELF_TIMER, SelfTimer.OFF);\n }", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\t\n\t\tLog.i(TAG, \"onCreate().\");\n\t\t// Check if data in SharedPreferences are the newest.\n\t\tSharedPreferences noteWidgetMap = this.getSharedPreferences(\"note_widget_map\",Context.MODE_PRIVATE);\n\t\tSharedPreferences widgetNoteMap = this.getSharedPreferences(\"widget_note_map\",Context.MODE_PRIVATE);\n\t\tSharedPreferences widgetDbMap = this.getSharedPreferences(\"widget_db_map\",Context.MODE_PRIVATE);\n\n\t\tMap<String, ?> map = widgetNoteMap.getAll();\n\t\tif (map == null) {\n\t\t\tLog.i(TAG, \"map is null!\");\n\t\t\treturn;\n\t\t}\n\t\tSet<String> keySet = map.keySet();\n\t\tif (keySet == null || keySet.isEmpty()) {\n\t\t\tLog.i(TAG, \"key is null\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tAppWidgetManager am = AppWidgetManager.getInstance(this);\n\t\tint appWidgetId;\n\t\tEditor noteWidgEditor = noteWidgetMap.edit();\n\t\tEditor widgetNoteEditor = widgetNoteMap.edit();\n\t\tEditor widgetDbEditor = widgetDbMap.edit();\n\t\t\n\t\tfor (String s : keySet) {\n\t\t\tappWidgetId = Integer.valueOf(s);\n\t\t\tif (am.getAppWidgetInfo(appWidgetId) == null) {\n\t\t\t\tLog.w(TAG, \"can not found appWidgetId \" + appWidgetId + \n\t\t\t\t\t\t\" in AppWidgetManager, so remove it from SharedPreferences\");\n\t\t\t\tString note = widgetNoteMap.getString(s, \"\");\n\t\t\t\tnoteWidgEditor.remove(note);\n\t\t\t\twidgetNoteEditor.remove(s);\n\t\t\t\twidgetDbEditor.remove(s);\n\t\t\t}\n\t\t}\n\t\tnoteWidgEditor.apply();\n\t\twidgetNoteEditor.apply();\n\t\twidgetDbEditor.apply();\n\t}", "TrackerPrefs loadTrackerPrefs(final Integer id);", "private void readPreferences()\n {\n\n \tCheckBox myNotifyRing\t= (CheckBox) findViewById(R.id.CheckBoxNotifyRing);\n \tCheckBox myNotifyCharge\t= (CheckBox) findViewById(R.id.CheckBoxNotifyCharge);\n \tCheckBox myNotifySMS\t= (CheckBox) findViewById(R.id.CheckBoxNotifySMS);\n \tCheckBox myNotifyMail\t= (CheckBox) findViewById(R.id.CheckBoxNotifyMail);\n \tCheckBox myNotifyIM\t\t= (CheckBox) findViewById(R.id.CheckBoxNotifyIM);\n\n \tCheckBox myVibrateRing\t= (CheckBox) findViewById(R.id.CheckBoxVibrateRing);\n \tCheckBox myVibrateSMS\t= (CheckBox) findViewById(R.id.CheckBoxVibrateSMS);\n \tCheckBox myVibrateMail\t= (CheckBox) findViewById(R.id.CheckBoxVibrateMail);\n \tCheckBox myVibrateIM\t= (CheckBox) findViewById(R.id.CheckBoxVibrateIM);\n\n \tCheckBox mySoundRing\t= (CheckBox) findViewById(R.id.CheckBoxSoundRing);\n \tCheckBox mySoundSMS\t\t= (CheckBox) findViewById(R.id.CheckBoxSoundSMS);\n \tCheckBox mySoundMail\t= (CheckBox) findViewById(R.id.CheckBoxSoundMail);\n \tCheckBox mySoundIM\t\t= (CheckBox) findViewById(R.id.CheckBoxSoundIM);\n \t\n \tCheckBox myVibrateOff\t= (CheckBox) findViewById(R.id.CheckBoxVibrationOff);\n \tCheckBox mySoundOff\t= (CheckBox) findViewById(R.id.CheckBoxSoundOff);\n \t\n \tSpinner mySpinnerRing \t= (Spinner) findViewById(R.id.SpinnerRing);\n \tSpinner mySpinnerCharge = (Spinner) findViewById(R.id.SpinnerCharge);\n \tSpinner mySpinnerSMS \t= (Spinner) findViewById(R.id.SpinnerSMS);\n \tSpinner mySpinnerMail \t= (Spinner) findViewById(R.id.SpinnerMail);\n \tSpinner mySpinnerIM \t= (Spinner) findViewById(R.id.SpinnerIM);\n \tSpinner mySpinnerSleep \t= (Spinner) findViewById(R.id.SpinnerSleep);\n \t\n \tSpinner mySpinnerVFrom \t= (Spinner) findViewById(R.id.SpinnerVibrationOffFrom);\n \tSpinner mySpinnerVTo \t= (Spinner) findViewById(R.id.SpinnerVibrationOffTo);\n \tSpinner mySpinnerSFrom \t= (Spinner) findViewById(R.id.SpinnerSoundOffFrom);\n \tSpinner mySpinnerSTo \t= (Spinner) findViewById(R.id.SpinnerSoundOffTo);\n\n \t\n myNotifyRing.setChecked(m_myPrefs.getNotifyRing());\n myNotifyCharge.setChecked(m_myPrefs.getNotifyCharge());\n myNotifySMS.setChecked(m_myPrefs.getNotifySMS());\n myNotifyMail.setChecked(m_myPrefs.getNotifyMail());\n myNotifyIM.setChecked(m_myPrefs.getNotifyIM());\n \n myVibrateRing.setChecked(m_myPrefs.getVibrateRing());\n myVibrateSMS.setChecked(m_myPrefs.getVibrateSMS());\n myVibrateMail.setChecked(m_myPrefs.getVibrateMail());\n myVibrateIM.setChecked(m_myPrefs.getVibrateIM());\n\n mySoundRing.setChecked(m_myPrefs.getPlaySoundRing());\n mySoundSMS.setChecked(m_myPrefs.getPlaySoundSMS());\n mySoundMail.setChecked(m_myPrefs.getPlaySoundMail());\n mySoundIM.setChecked(m_myPrefs.getPlaySoundIM());\n\n mySpinnerRing.setSelection(m_myPrefs.getEffectRing());\n mySpinnerCharge.setSelection(m_myPrefs.getEffectCharge());\n mySpinnerSMS.setSelection(m_myPrefs.getEffectSMS());\n mySpinnerMail.setSelection(m_myPrefs.getEffectMail());\n mySpinnerIM.setSelection(m_myPrefs.getEffectIM());\n mySpinnerSleep.setSelection(m_myPrefs.getEffectSleep());\n \n // sounds\n m_strUriRing \t= m_myPrefs.getSoundRing();\t \n m_strUriSMS \t= m_myPrefs.getSoundSMS();\n m_strUriIM \t\t= m_myPrefs.getSoundIM();\n m_strUriMail\t= m_myPrefs.getSoundMail();\n \n // silence options\n myVibrateOff.setChecked(m_myPrefs.getVibrateOff());\n mySoundOff.setChecked(m_myPrefs.getSoundOff());\n \n mySpinnerVFrom.setSelection(m_myPrefs.getVibrateOffTimespan().getFromHours());\n mySpinnerVTo.setSelection(m_myPrefs.getVibrateOffTimespan().getToHours());\n mySpinnerSFrom.setSelection(m_myPrefs.getSoundOffTimespan().getFromHours());\n mySpinnerSTo.setSelection(m_myPrefs.getSoundOffTimespan().getToHours());\n\n }", "@Override\n public void onCreatePreferences(Bundle bundle, String s) {\n addPreferencesFromResource(R.xml.settings_main);\n\n Preference orderBy = findPreference(getString(R.string.settings_order_by_key));\n bindPreferenceSummaryToValue(orderBy);\n\n Preference filterByCompany = findPreference(getString(R.string.settings_filter_by_company_key));\n bindPreferenceSummaryToValue(filterByCompany);\n\n Preference filterBySection = findPreference(getString(R.string.settings_filter_by_section_key));\n bindPreferenceSummaryToValue(filterBySection);\n }", "public Preferences getPrefs() {\n return _prefs;\n }", "private void getSettings(){\n SharedPreferences sp = getSharedPreferences(\"PACERUNNER_SETTINGS\", Activity.MODE_PRIVATE);\n AMOUNT_OF_SECONDS_WHEN_TRIGGERING_NOTIFICATION = sp.getInt(\"NOTIFICATION_SENSITIVITY\", -15);\n REQUIRED_METERS_BEFORE_SHOWING_AVGPACE = sp.getInt(\"NOTIFICATION_METERS_BEFORE_START\", 500);\n }", "private void restorePreferences(){\n SharedPreferences prefs = getPreferences(MODE_PRIVATE);\n\n pOneCounter = prefs.getInt(\"p1Count\",0);\n pTwoCounter = prefs.getInt(\"p2Count\",0);\n pAICounter = prefs.getInt(\"pAICount\",0);\n tieCounter = prefs.getInt(\"tieCount\",0);\n\n }", "private void GetSharedPrefs()\n {\n// SharedPreferences pref = getActivity().getSharedPreferences(\"LoginPref\", 0);\n// UserId = pref.getInt(\"user_id\", 0);\n// Mobile = pref.getString(\"mobile_number\",DEFAULT);\n// Email = pref.getString(\"email_id\",DEFAULT);\n// Username = pref.getString(\"user_name\",DEFAULT);\n// Log.i(TAG, \"GetSharedPrefs: UserId: \"+UserId);\n\n SharedPreferences pref = getActivity().getSharedPreferences(\"RegPref\", 0); // 0 - for private mode\n UserId = pref.getInt(\"user_id\", 0);\n Mobile = pref.getString(\"mobile_number\",DEFAULT);\n Email = pref.getString(\"email_id\",DEFAULT);\n Log.i(TAG, \"GetSharedPrefs: UserId: \"+UserId);\n CallOnGoingRideAPI();\n }", "@Override\n\t\tprotected void onPreExecute(){\n\t\t\tpref=new Preferences(mContext);\n\t\t}", "private void initPreferences(Context context) {\n\n if (DEBUG) LogUtils.d(TAG, \"initPreferences: mPreferences \" + mPreferences);\n }", "public IPreferenceStore getPreferenceStore(String name);", "@Override\r\n public void onCreate(Bundle savedInstanceState) { \t\r\n super.onCreate(savedInstanceState);\r\n setContentView(R.layout.settings); \r\n String oldtitle = (String) getTitle();\r\n setTitle(oldtitle + \" > Settings\");\r\n \r\n //Load the settings\r\n SharedPreferences settings = getSharedPreferences(PREFS_NAME, 0);\r\n String liveid = settings.getString(\"liveusername\", \"\");\r\n String password = settings.getString(\"livepassword\", \"\");\r\n String saved_livedownloaddp = settings.getString(\"livedownloaddp\", \"\");\r\n String saved_liveignorestockdp = settings.getString(\"liveignorestockdp\", \"\");\r\n\r\n \teLiveID = ((TextView)findViewById(R.id.editLiveID));\r\n \teLiveID.setText(liveid); \t\r\n \tePassword = ((TextView)findViewById(R.id.editPassword));\r\n \tePassword.setText(password); \r\n \t\r\n \tliveremember = ((CheckBox)findViewById(R.id.checkRememberlive));\r\n \th_livedownloaddp = ((CheckBox)findViewById(R.id.checkDownloadDP));\r\n \th_liveignorestockdp = ((CheckBox)findViewById(R.id.checkIgnoreStockDP));\r\n \t\r\n \tif(liveid.length() > 0 || password.length() > 0)\r\n \t\tliveremember.setChecked(true);\r\n \t\r\n \tif(saved_livedownloaddp.equals(\"true\")) {\r\n \t\th_livedownloaddp.setChecked(true);\r\n \t}\r\n\r\n \tif(saved_liveignorestockdp.equals(\"true\")) {\r\n \t\th_liveignorestockdp.setChecked(true);\r\n \t}\r\n \t\r\n \tButton btnSave = (Button)findViewById(R.id.btnSave);\r\n btnSave.setOnClickListener(btnSaveOnClick);\r\n \r\n Button btnCancel = (Button)findViewById(R.id.btnDiscard);\r\n btnCancel.setOnClickListener(btnCancelOnClick);\r\n }", "protected void updatePreferences() {\n boolean theme = PreferenceManager.getDefaultSharedPreferences(this).getBoolean(getString(R.string.prefTheme), false);\n\n if (theme) {\n\n // Set to light mode.\n AppCompatDelegate.setDefaultNightMode(\n AppCompatDelegate.MODE_NIGHT_NO);\n } else {\n\n // Set to dark mode.\n AppCompatDelegate.setDefaultNightMode(\n AppCompatDelegate.MODE_NIGHT_YES);\n }\n }", "private void getPreferences() {\n Account rootAccount = book.getRootAccount();\n displayedSecuritiesList = rootAccount.getPreference(\"StockGlance_displayedSecurities\", \"\");\n allowMissingPrices = rootAccount.getPreferenceBoolean(\"StockGlance_DisplayMissingPrices\", false);\n timelySnapshotInterval = rootAccount.getPreferenceInt(\"StockGlance_TimelyWindow\", 7);\n }", "private void setValuesInSharedPrefernce() {\r\n\r\n\t\tmSharedPreferences_reg.edit().putString(\"ProfileImageString\", profileImageString).commit();\r\n\t\tmSharedPreferences_reg.edit().putString(\"PseudoName\", psedoName).commit();\r\n\t\tmSharedPreferences_reg.edit().putString(\"Pseudodescription\", profiledescription).commit();\r\n\t}", "private void setupSimplePreferencesScreen() {\n if (!isSimplePreferences(this)) {\n return;\n }\n\n addPreferencesFromResource(R.xml.pref_empty);\n\n addHeader(R.string.pref_header_game);\n addPreferencesFromResource(R.xml.pref_game);\n this.gameModeSettingsPreferenceScreen = getPreferenceScreen();\n\n addHeader(R.string.pref_header_other);\n addPreferencesFromResource(R.xml.pref_other);\n\n Preference key_game_mode_summary = findPreference(getResources().getString(R.string.key_game_mode_summary));\n this.key_game_mode_summary = key_game_mode_summary;\n\n Preference useCodePreference = findPreference(getResources().getString(R.string.key_use_code));\n this.useCodePreference = useCodePreference;\n useCodePreference.setOnPreferenceChangeListener(USE_CODE_PREFERENCE_LISTENER);\n\n Preference customWidthPreference = findPreference(getResources().getString(R.string.key_custom_maze_width));\n customWidthPreference.setSummary(String.valueOf(getCustomMazeWidth()));\n this.customWidthPreference = customWidthPreference;\n customWidthPreference.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {\n @Override\n public boolean onPreferenceChange(Preference preference, Object value) {\n try {\n int width = Math.min(Math.max(Integer.parseInt(value.toString()), getResources().getInteger(R.integer.min_custom_maze_size)), getResources().getInteger(R.integer.max_custom_maze_size));\n synchronized (SettingsActivity.class) {\n SettingsActivity.customMazeWidth = width;\n }\n preference.setSummary(String.valueOf(width));\n } catch (NumberFormatException e) {\n }\n return true;\n }\n });\n Preference customHeightPreference = findPreference(getResources().getString(R.string.key_custom_maze_height));\n customHeightPreference.setSummary(String.valueOf(getCustomMazeHeight()));\n this.customHeightPreference = customHeightPreference;\n customHeightPreference.setOnPreferenceChangeListener(new Preference.OnPreferenceChangeListener() {\n @Override\n public boolean onPreferenceChange(Preference preference, Object value) {\n try {\n int height = Math.min(Math.max(Integer.parseInt(value.toString()), getResources().getInteger(R.integer.min_custom_maze_size)), getResources().getInteger(R.integer.max_custom_maze_size));\n synchronized (SettingsActivity.class) {\n SettingsActivity.customMazeHeight = height;\n }\n preference.setSummary(String.valueOf(height));\n } catch (NumberFormatException e) {\n }\n return true;\n }\n });\n Preference customCreatePreference = findPreference(getResources().getString(R.string.key_custom_maze_create));\n this.customCreatePreference = customCreatePreference;\n customCreatePreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {\n @Override\n public boolean onPreferenceClick(Preference preference) {\n Maze2D.GeneratedMaze maze = generateCustomMaze(SettingsActivity.this);\n synchronized (SettingsActivity.class) {\n SettingsActivity.loadSeedMaze = maze;\n }\n if (maze != null) {\n SettingsActivity.this.finish();\n }\n return true;\n }\n });\n Preference customSolvePreference = findPreference(getResources().getString(R.string.key_custom_maze_solve));\n this.customSolvePreference = customSolvePreference;\n customSolvePreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {\n @Override\n public boolean onPreferenceClick(Preference preference) {\n synchronized (SettingsActivity.class) {\n SettingsActivity.showSolution = true;\n }\n SettingsActivity.this.finish();\n return true;\n }\n });\n Preference regularCreatePreference = findPreference(getResources().getString(R.string.key_maze_create));\n this.regularCreatePreference = regularCreatePreference;\n regularCreatePreference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {\n @Override\n public boolean onPreferenceClick(Preference preference) {\n if (MainActivity.getGameMode() == GameMode.REGULAR) {\n synchronized (SettingsActivity.class) {\n SettingsActivity.newRegularMaze = true;\n }\n } else {\n synchronized (SettingsActivity.class) {\n SettingsActivity.newFillMaze = true;\n }\n }\n SettingsActivity.this.finish();\n return true;\n }\n });\n\n ListPreference algorithmPreference = (ListPreference) findPreference(getResources().getString(R.string.key_algorithm));\n this.algorithmPreference = algorithmPreference;\n\n // Bind the summaries of EditText/List/Dialog/Ringtone preferences to\n // their values. When their values change, their summaries are updated\n // to reflect the new value, per the Android Design guidelines.\n ListPreference gameModePreference = (ListPreference) findPreference(getResources().getString(R.string.key_game_mode));\n this.gamePreference = gameModePreference;\n bindPreferenceSummaryToValue(gameModePreference);\n String[] names = GameMode.getNames(this);\n gameModePreference.setEntries(names);\n gameModePreference.setEntryValues(names);\n GameMode gameMode = MainActivity.getGameMode();\n if (gameMode != null) {\n gameModePreference.setValueIndex(gameMode.getID());\n }\n\n bindPreferenceSummaryToValue(algorithmPreference);\n names = MazeAlgorithm.getNames(this, true);\n algorithmPreference.setEntries(names);\n algorithmPreference.setEntryValues(names);\n MazeAlgorithm algorithm = MainActivity.getAlgorithm();\n if (algorithm != null) {\n algorithmPreference.setDefaultValue(algorithm.getLocalName(this));\n }\n\n SwitchPreference showTracerPreference = (SwitchPreference) findPreference(getResources().getString(R.string.key_show_tracer));\n showTracerPreference.setOnPreferenceChangeListener(TOGGLE_TRACER_PREFERENCE_LISTENER);\n showTracerPreference.setDefaultValue(MainActivity.toggleTracer());\n\n SwitchPreference squareCellsPreference = (SwitchPreference) findPreference(getResources().getString(R.string.key_square_cells));\n squareCellsPreference.setOnPreferenceChangeListener(SQUARE_CELLS_PREFERENCE_LISTENER);\n squareCellsPreference.setDefaultValue(MainActivity.squareCells());\n\n Preference recalibratePreference = findPreference(getResources().getString(R.string.key_recalibrate));\n recalibratePreference.setOnPreferenceClickListener(RECALIBRATE_PREFERENCE_LISTENER);\n\n Preference defaultTiltPreference = findPreference(getResources().getString(R.string.key_default_tilt));\n defaultTiltPreference.setOnPreferenceClickListener(DEFAULT_TILT_PREFERENCE_LISTENER);\n\n prepareGameModeGUI(MainActivity.getGameMode());\n }", "@Override\n \tpublic void onSharedPreferenceChanged(SharedPreferences prefs, String key) {\n \t\tcheckDefaults();\n \t}", "@SuppressWarnings(\"deprecation\")\n\tprivate void setupSimplePreferencesScreen() {\n\t\tif (!isSimplePreferences(this)) {\n\t\t\treturn;\n\t\t}\n\n\t\taddPreferencesFromResource(R.xml.pref_blank);\n\n\t\t// Add 'filters' preferences.\n\t\tPreferenceCategory fakeHeader = new PreferenceCategory(this);\n\n\t\t// Add 'appearance' preferences.\n\t\tfakeHeader = new PreferenceCategory(this);\n\t\tfakeHeader.setTitle(R.string.appearance);\n\t\tgetPreferenceScreen().addPreference(fakeHeader);\n\t\taddPreferencesFromResource(R.xml.pref_appearance);\n\n\t\t// Add 'text color' preferences.\n\t\tfakeHeader = new PreferenceCategory(this);\n\t\tfakeHeader.setTitle(R.string.text_color);\n\t\tgetPreferenceScreen().addPreference(fakeHeader);\n\t\taddPreferencesFromResource(R.xml.pref_textcolor);\n\n\t\t// Add 'info' preferences.\n\t\tfakeHeader = new PreferenceCategory(this);\n\t\tfakeHeader.setTitle(R.string.information);\n\t\tgetPreferenceScreen().addPreference(fakeHeader);\n\t\taddPreferencesFromResource(R.xml.pref_info);\n\n\t\t// Add others\n\t\tsetupOpenSourceInfoPreference(this, findPreference(getString(R.string.pref_info_open_source)));\n\t\tsetupVersionPref(this, findPreference(getString(R.string.pref_version)));\n\n\t}" ]
[ "0.73684007", "0.736817", "0.7061827", "0.6961029", "0.67498016", "0.67213595", "0.6573086", "0.6548011", "0.65413", "0.6437378", "0.64280754", "0.6420338", "0.64113796", "0.6399795", "0.6368771", "0.6329206", "0.6327203", "0.6315409", "0.630822", "0.62860703", "0.625388", "0.62426", "0.62388283", "0.6230107", "0.6218836", "0.62002784", "0.6184159", "0.6129285", "0.609332", "0.6076327", "0.6068798", "0.6047432", "0.6047432", "0.6047432", "0.6047432", "0.6045722", "0.6045146", "0.6038787", "0.602456", "0.6007789", "0.6004343", "0.59725493", "0.59688354", "0.59634095", "0.59555817", "0.59509766", "0.59416664", "0.5929131", "0.591825", "0.5907", "0.58974034", "0.5896234", "0.5888028", "0.58875394", "0.58803356", "0.58766353", "0.5864446", "0.58609545", "0.5827296", "0.5823693", "0.5822496", "0.5819061", "0.58056796", "0.5794197", "0.5778811", "0.57730234", "0.5760582", "0.5758962", "0.5753402", "0.57531726", "0.5742008", "0.5725355", "0.57007563", "0.56963754", "0.5690226", "0.5690226", "0.5689111", "0.5677297", "0.56690836", "0.5665904", "0.56600225", "0.56404585", "0.5639907", "0.563775", "0.56360126", "0.5633832", "0.56060344", "0.5605041", "0.55982476", "0.5595586", "0.5595024", "0.55880696", "0.55740154", "0.5566227", "0.5549976", "0.55431783", "0.55429626", "0.55418676", "0.5537815", "0.55367804" ]
0.55711865
93
Store this widget prefs in the shared preferences
public void store(Context context, int widgetId) { String key; SharedPreferences prefs; Editor edit; prefs = context.getSharedPreferences(WIDGET_PREFERENCES, Context.MODE_PRIVATE); if (prefs != null) { edit = prefs.edit(); if (edit != null) { key = WIDGET_TARGET_PATH + String.valueOf(widgetId); edit.putString(key, mTargetPath); key = WIDGET_READ_ONLY + String.valueOf(widgetId); edit.putBoolean(key, mReadOnly); key = WIDGET_PRESENT_KEY + String.valueOf(widgetId); edit.putBoolean(key, true); edit.commit(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void saveSharedPref() {\n SharedPreferences.Editor editor = this.sharedPreferences.edit();\n if (checkBox.isChecked()) {\n editor.putBoolean(Constants.SP_IS_REMEMBERED_KEY, true);\n }\n editor.apply();\n }", "private void savePrefsData() {\n SharedPreferences pref = getApplicationContext().getSharedPreferences(\"myPrefs\", MODE_PRIVATE);\n SharedPreferences.Editor editor = pref.edit();\n editor.putBoolean(\"isIntroOpnend\", true);\n editor.commit();\n }", "private void setValuesInSharedPrefernce() {\r\n\r\n\t\tmSharedPreferences_reg.edit().putString(\"ProfileImageString\", profileImageString).commit();\r\n\t\tmSharedPreferences_reg.edit().putString(\"PseudoName\", psedoName).commit();\r\n\t\tmSharedPreferences_reg.edit().putString(\"Pseudodescription\", profiledescription).commit();\r\n\t}", "public void save() {\n savePrefs();\n }", "private void currentStateSaveToSharedPref() {\n sharedPreferences = getPreferences(Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(\"nameOfActiveChallenge\", nameOfCurrentChallenge);\n editor.putInt(\"key1OfActiveChallenge\", key1OfActiveChallenge);\n editor.putString(\"dateOfLastEdit\", dateOfLastEdit);\n editor.putFloat(\"goal\", goal);\n editor.putFloat(\"carry\", carry);\n editor.putInt(\"challengeDaysRunning\", challengeDaysRunning);\n editor.commit();\n }", "protected void SavePreferences(String key, String value) {\n SharedPreferences data = PreferenceManager.getDefaultSharedPreferences(this);\n SharedPreferences.Editor editor = data.edit();\n editor.putString(key, value);\n editor.commit();\n\n\n }", "@Override\n public void onCreatePreferences(Bundle bundle, String s) {\n addPreferencesFromResource(R.xml.pref);\n sharedPreferences = PreferenceManager.getDefaultSharedPreferences(getActivity());\n //onSharedPreferenceChanged(sharedPreferences, getString(R.string.language_key));\n onSharedPreferenceChanged(sharedPreferences, getString(R.string.difficulty_key));\n onSharedPreferenceChanged(sharedPreferences, getString(R.string.word_category_key));\n }", "@Override\n public void storeSettings() {\n\n // Set the default value:\n Globals.prefs.put(JabRefPreferences.DEFAULT_BIBTEX_KEY_PATTERN, defaultPat.getText());\n Globals.prefs.putBoolean(JabRefPreferences.WARN_BEFORE_OVERWRITING_KEY, warnBeforeOverwriting.isSelected());\n Globals.prefs.putBoolean(JabRefPreferences.AVOID_OVERWRITING_KEY, dontOverwrite.isSelected());\n\n Globals.prefs.put(JabRefPreferences.KEY_PATTERN_REGEX, keyPatternRegex.getText());\n Globals.prefs.put(JabRefPreferences.KEY_PATTERN_REPLACEMENT, keyPatternReplacement.getText());\n Globals.prefs.putBoolean(JabRefPreferences.GENERATE_KEYS_AFTER_INSPECTION, autoGenerateOnImport.isSelected());\n Globals.prefs.putBoolean(JabRefPreferences.GENERATE_KEYS_BEFORE_SAVING, generateOnSave.isSelected());\n\n if (alwaysAddLetter.isSelected()) {\n Globals.prefs.putBoolean(JabRefPreferences.KEY_GEN_ALWAYS_ADD_LETTER, true);\n } else if (letterStartA.isSelected()) {\n Globals.prefs.putBoolean(JabRefPreferences.KEY_GEN_FIRST_LETTER_A, true);\n Globals.prefs.putBoolean(JabRefPreferences.KEY_GEN_ALWAYS_ADD_LETTER, false);\n }\n else {\n Globals.prefs.putBoolean(JabRefPreferences.KEY_GEN_FIRST_LETTER_A, false);\n Globals.prefs.putBoolean(JabRefPreferences.KEY_GEN_ALWAYS_ADD_LETTER, false);\n }\n\n // fetch entries from GUI\n GlobalBibtexKeyPattern keypatterns = getKeyPatternAsGlobalBibtexKeyPattern();\n // store new patterns globally\n prefs.putKeyPattern(keypatterns);\n }", "private void setupSharedPreferences() {\n SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);\n\n String aaString = sharedPreferences.getString(getString(R.string.pref_antalAktier_key), getString(R.string.pref_antalAktier_default));\n// float aaFloat = Float.parseFloat(aaString);\n editTextAntalAktier.setText(aaString);\n\n String kk = sharedPreferences.getString(getString(R.string.pref_koebskurs_key), getString(R.string.pref_koebskurs__default));\n editTextKoebskurs.setText(kk);\n\n String k = sharedPreferences.getString(getString(R.string.pref_kurtage_key), getString(R.string.pref_kurtage_default));\n editTextKurtage.setText(k);\n\n// float minSize = Float.parseFloat(sharedPreferences.getString(getString(R.string.pref_size_key),\n// getString(R.string.pref_size_default)));\n// mVisualizerView.setMinSizeScale(minSize);\n\n // Register the listener\n sharedPreferences.registerOnSharedPreferenceChangeListener(this);\n }", "public void saveSettings(View v) {\n SharedPreferences sharedPref = this.getPreferences(Context.MODE_PRIVATE); // get shared preferences\n SharedPreferences.Editor editor = sharedPref.edit();\n int seconds_rec = Integer.parseInt(time_recording.getText().toString());\n int notif_occ = Integer.parseInt(time_occurance.getText().toString());\n\n editor.putInt(getString(R.string.time_recording_seconds), seconds_rec); // save values to a sp\n editor.putInt(getString(R.string.time_notification_minutes), notif_occ);\n editor.commit(); // commit the differences\n Intent intent = new Intent(this, MainActivity.class);\n startActivity(intent);\n }", "private void persistData() {\n mSharedPref.storeLastScreen(SCREEN_NAME);\n }", "private void savePreferences() {\n SharedPrefStatic.mJobTextStr = mEditTextJobText.getText().toString().replace(\" \", \"\");\n SharedPrefStatic.mJobSkillStr = mEditTextSkill.getText().toString().replace(\" \", \"\");\n SharedPrefStatic.mJobLocationStr = mEditTextLocation.getText().toString().replace(\" \", \"\");\n SharedPrefStatic.mJobAgeStr = mEditTextAge.getText().toString().replace(\" \", \"\");\n\n SharedPreferences sharedPref = getSharedPreferences(AppConstants.PREF_FILENAME, 0);\n SharedPreferences.Editor editer = sharedPref.edit();\n editer.putString(AppConstants.PREF_KEY_TEXT, SharedPrefStatic.mJobTextStr);\n editer.putString(AppConstants.PREF_KEY_SKILL, SharedPrefStatic.mJobSkillStr);\n editer.putString(AppConstants.PREF_KEY_LOCATION, SharedPrefStatic.mJobLocationStr);\n editer.putString(AppConstants.PREF_KEY_AGE, SharedPrefStatic.mJobAgeStr);\n\n // The commit runs faster.\n editer.apply();\n\n // Run this every time we're building a query.\n SharedPrefStatic.buildUriQuery();\n SharedPrefStatic.mEditIntentSaved = true;\n }", "public void savingVariablesWebConfig(){\n SharedPreferences prefs = getSharedPreferences(Constants.PREFERENCES_NAME, Context.MODE_PRIVATE);\n //Save data of user in preferences\n SharedPreferences.Editor editor = prefs.edit();\n\n editor.putString(Constants.PREF_VALUE_MAX_ORDERS_ACCEPTED, \"3\");\n editor.putString(Constants.PREF_VALUE_MAX_ORDERS_VISIBLE, \"10\");\n editor.putString(Constants.PREF_VALUE_MAX_TIME_ORDERS, \"15\");\n editor.commit();\n }", "private void savePreferences(String key, String value) {\n SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(c);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(key, value);\n editor.apply();\n }", "public void saveData(){\n SharedPreferences sharedPreferences = getSharedPreferences(\"SHARED_PREFS\",MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(\"email_pref\",email.getText().toString());\n editor.putString(\"password_pref\",uPassword.getText().toString());\n editor.apply();\n }", "protected void savePreferences() {\n String tmp_hostname = hostname.getHostName();\n System.out.println(\"stringified hostname was: \" + tmp_hostname);\n if (tmp_hostname != null) {\n SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(this);\n SharedPreferences.Editor editor = settings.edit();\n editor.putString(\"last_hostname\", tmp_hostname);\n editor.commit();\n }\n }", "private void savePreferences(String key, String value) {\n\t\tSharedPreferences sp = PreferenceManager\n\t\t\t\t.getDefaultSharedPreferences(this);\n\t\tEditor edit = sp.edit();\n\t\tedit.putString(key, value);\n\t\tedit.commit();\n\t}", "private void saveState() {\n SharedPreferences prefs = getPreferences(MODE_PRIVATE);\n SharedPreferences.Editor editor = prefs.edit();\n\n // Store our count..\n editor.putInt(\"count\", this._tally);\n\n // Save changes\n editor.commit();\n }", "private void setupSharedPreferences() {\n SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);\n\n //set the driver name and track variables using methods below, which are also called from onSharedPreferencesChanged\n setDriver(sharedPreferences);\n setTrack(sharedPreferences);\n }", "public void saveDataToSharedPreference(View view) {\n email = emailEditText.getText().toString();\n name = nameEditText.getText().toString();\n\n SharedPreferences.Editor editor = sharedPreferences.edit();\n\n editor.putString(\"name\",name);\n editor.putString(\"email\",email);\n editor.apply();\n\n Toast.makeText(context, \"Data saved successfully into SharedPreferences!\", Toast.LENGTH_SHORT).show();\n clearText();\n }", "public void save() {\n\t\tpreferences().flush();\n\t}", "public void save() {\n try {\n FileOutputStream fos = new FileOutputStream(file);\n properties.store(fos, \"Preferences\");\n } catch (FileNotFoundException e) {\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n }", "private final synchronized void writePreferencesImpl() {\n if ( LOGD ) { Log.d( TAG, \"writePreferencesImpl \" + mPrefFile + \" \" + mPrefKey ); }\n\n mForcePreferenceWrite = false;\n\n SharedPreferences pref =\n Utilities.getContext().getSharedPreferences( mPrefFile, Context.MODE_PRIVATE );\n SharedPreferences.Editor edit = pref.edit();\n edit.putString( mPrefKey, getSerializedString() );\n Utilities.commitNoCrash(edit);\n }", "private void savePreferences() {\n SharedPreferences sp = getSharedPreferences(MY_PREFS, MODE_PRIVATE);\n SharedPreferences.Editor editor = sp.edit();\n\n editor.putInt(\"entreeIndex\", spEntree.getSelectedItemPosition());\n editor.putInt(\"drinkIndex\", spDrink.getSelectedItemPosition());\n editor.putInt(\"dessertIndex\", spDessert.getSelectedItemPosition());\n\n editor.apply();\n }", "public void setPreference(View v){\n SharedPreferences.Editor editor = settings.edit();\n String prefValue = cHelpers.getText(this, R.id.editText);\n editor.putString(\"key1\",prefValue);\n editor.commit();\n cHelpers.show_toast(this, \"Preference Saved\");\n }", "@SuppressLint(\"CommitPrefEdits\")\n public HaloPreferencesStorageEditor(SharedPreferences preferences) {\n mPreferencesEditor = preferences.edit();\n }", "private void savePreferences(){\n SharedPreferences prefs = getPreferences(MODE_PRIVATE);\n SharedPreferences.Editor editor = prefs.edit();\n\n editor.putInt(\"p1Count\", pOneCounter);\n editor.putInt(\"p2Count\", pTwoCounter);\n editor.putInt(\"pAICount\", pAICounter);\n editor.putInt(\"tieCount\", tieCounter);\n\n editor.commit();\n }", "public SharedPreferences getPrefs() { return this.prefs; }", "public SharePref(Context context) {\n sPrefs = context.getSharedPreferences(PREFS_NAME, Context.MODE_PRIVATE);\n }", "protected void storeSharedPrefs(String un2, String pwd2) {\n \teditor.putString(\"username\", un2);\n \teditor.putString(\"password\", pwd2); \t\n\t\teditor.commit(); //Commiting changes\n\t}", "private void saveSettings() {\n \tLog.i(\"T4Y-Settings\", \"Save mobile settings\");\n \t\n \tmobileSettings.setAllowAutoSynchronization(autoSynchronizationCheckBox.isChecked());\n mobileSettings.setAllowAutoScan(autoScanCheckBox.isChecked());\n mobileSettings.setAllowAutoSMSNotification(autoSMSNotificationCheckBox.isChecked());\n \n \tmainApplication.setMobileSettings(mobileSettings);\n }", "public void saveInPreference(String name, String content) {\n\t\tSharedPreferences preferences = PreferenceManager\n\t\t\t\t.getDefaultSharedPreferences(this);\n\t\tSharedPreferences.Editor editor = preferences.edit();\n\t\teditor.putString(name, content);\n\t\teditor.commit();\n\t}", "protected void makePref(){\n //Creates a shared pref called MyPref and 0-> MODE_PRIVATE\n sharedPref = getSharedPreferences(AppCSTR.PREF_NAME, Context.MODE_PRIVATE);\n //so the pref can be edit\n edit = sharedPref.edit();\n}", "public void saveSettings(View view){\n SharedPreferences.Editor editor = settings.edit();\n\n // Write the values from the views to the editor\n editor.putInt(\"vocablesNumber\",Integer.parseInt(vocablesNumber.getSelectedItem().toString()));\n editor.putBoolean(\"screenOn\", screenOnSwitch.isChecked());\n editor.putFloat(\"delayBetweenVocables\",Float.valueOf(editTextDelay.getText().toString()));\n // Commit the edits\n editor.commit();\n\n // Send the user a message of success\n Toast.makeText(Settings.this,\"Settings saved!\",Toast.LENGTH_SHORT).show();\n // Go back to previous activity\n finish();\n }", "private void saveCurrentPreferences() {\n\t\toldUnitType = preferences.getInt(\"displayUnit\", UnitType.FOOTINCH.getId());\n\t\toldPrecision = preferences.getInt(\"precision\", 16);\n\t\toldRounding = preferences.getBoolean(\"roundUp\", true);\n\t\toldDisplayOptions = preferences.getString(\"displayOptions\", context.getString(R.string.displayAutomatic));\n\t}", "private synchronized void storeAppSettings() {\n\t \n\t\n \tif(_appSettings != null){\t\n \t\tAppLogger.debug2(\"AppFrame.storeAppSettings saving.\");\n\n \t\ttry {\t \n \t\t\tFileOutputStream oFile = new FileOutputStream(_configFile);\n\t\t\tOutputStream setupOutput = new DataOutputStream(oFile);\t\t \t\t\t\t\n\t\t\t_appSettings.store(setupOutput, \"\");\t\t\n \t\t}catch(Exception oEx){\n \t\tAppLogger.error(oEx);\n \t\t}\t\t \t\t\t\t\t\t\n\t}\t\t\t\t \t\n }", "private void saveValues() {\n for (Map.Entry<EditText, Integer> e : mPrefKeys.entrySet()) {\n // If the field is disabled, add the DEACTIVATED marker to the value of the field\n if (e.getKey().isEnabled())\n Pref.put(this, e.getValue(), e.getKey().getText().toString());\n else\n Pref.put(this, e.getValue(), Data.DEACTIVATED_MARKER + e.getKey().getText().toString());\n }\n\n }", "private void setPreferences(String sw, boolean checked) {\n SharedPreferences sp = getActivity().getSharedPreferences(SETTINGS, Context.MODE_PRIVATE );\n SharedPreferences.Editor editor = sp.edit();\n editor.putBoolean(sw,checked);\n editor.apply();\n\n }", "public void shareData(){\n SharedPreferences sharedPref = PreferenceManager.getDefaultSharedPreferences(this);\n //now get Editor\n SharedPreferences.Editor editor = sharedPref.edit();\n //put your value\n editor.putInt(\"score3\", points);\n\n //commits your edits\n editor.commit();\n }", "@Override\n\tpublic void onCreate() {\n\t\tsuper.onCreate();\n\t\t\n\t\tthis.prefs = PreferenceManager.getDefaultSharedPreferences(this);\n\t\t/*\n\t\t * Each app has its own shared preferences available to all components\n\t\t * of the app and this loads the default preferences that are saved on\n\t\t * the phone\n\t\t */\n\t\tthis.prefs.registerOnSharedPreferenceChangeListener(this);\n\t\t/*\n\t\t * Each user can change preferences. So this listener is a mechanism to\n\t\t * notify this activity that the old values are stale\n\t\t */\n\t}", "@Override\n public void onCreatePreferences(Bundle bundle, String s) {\n addPreferencesFromResource(R.xml.preferences);\n }", "private void save() {\n prefs.saveCardBackground(selectedBackground);\n prefs.saveCardBackgroundColor(selectedBackgroundColor);\n\n updateSummary();\n }", "public void setPrefs(GamePreferences prefs) {\n\t\tthis.prefs = prefs;\n\t}", "public void saveInfo(View view){\n SharedPreferences sharedPref = getSharedPreferences(\"userinfo\", Context.MODE_PRIVATE);\n\n SharedPreferences.Editor editor = sharedPref.edit();\n editor.putString(\"username\", usernameInput.getText().toString());\n\n editor.apply();\n Toast.makeText(this,\"Saved!\",Toast.LENGTH_LONG).show();\n }", "private void savePreferenceData(String role){\n if (getIntent()!=null){\n SharedPreferences preferences = getSharedPreferences(detailPreference, MODE_PRIVATE);\n SharedPreferences.Editor editor = preferences.edit();\n editor.putString(preferenceKey, role);\n editor.apply();\n }\n }", "private void saveSettings()\n {\n try\n {\n // If remember information is true then save the ip and port\n // properties to the projects config.properties file\n if ( rememberLoginIsSet_ )\n {\n properties_.setProperty( getString( R.string.saved_IP ), mIP_ );\n properties_.setProperty( getString( R.string.saved_Port ),\n mPort_ );\n }\n\n // Always save the remember login boolean\n properties_.setProperty( getString( R.string.saveInfo ),\n String.valueOf( rememberLoginIsSet_ ) );\n\n File propertiesFile =\n new File( this.getFilesDir().getPath().toString()\n + \"/properties.txt\" );\n FileOutputStream out =\n new FileOutputStream( propertiesFile );\n properties_.store( out, \"Swoop\" );\n out.close();\n }\n catch ( Exception ex )\n {\n System.err.print( ex );\n }\n }", "public void savePreferences(SharedPreferences preferences){\r\n\t\tSharedPreferences.Editor editor = preferences.edit();\r\n editor.putBoolean(\"initialSetupped\", initialSetuped);\r\n editor.putString(\"username\", userName);\r\n editor.putString(\"useremail\", userEmail);\r\n editor.putString(\"recipientemail\", recipientEmail);\r\n editor.putBoolean(\"option\", option.isPound());\r\n\r\n // Commit the edits!\r\n editor.commit();\r\n\t}", "public void storePreferences(String userid, String token, JSONArray settings) throws JSONException {\n SharedPreferences sharedPreferences = getApplicationContext().getSharedPreferences(\"ca.gc.inspection.scoop\", Context.MODE_PRIVATE);\n\n JSONObject setting = settings.getJSONObject(0);\n Iterator<String> keys = setting.keys();\n while(keys.hasNext()){\n String settingKey = keys.next();\n if (settingKey.equals(useridStr)){ continue;}\n sharedPreferences.edit().putString(settingKey, setting.getString(settingKey)).apply();\n }\n\n // storing the token into shared preferences\n sharedPreferences.edit().putString(\"token\", token).apply();\n Config.token = token;\n\n // storing the user id into shared preferences\n sharedPreferences.edit().putString(useridStr, userid).apply();\n Config.currentUser = userid;\n\n // change activities once register is successful\n if(Config.token != null && Config.currentUser != null) registerSuccess();\n }", "@Override\n public void saveValue(String key, Object value) {\n SharedPreferences.Editor editor = preferences.edit();\n if (value instanceof String) {\n editor.putString(key, (String) value);\n } else if (value instanceof Boolean) {\n editor.putBoolean(key, (Boolean) value);\n } else if (value instanceof Integer) {\n editor.putInt(key, (Integer) value);\n } else if (value instanceof Float) {\n editor.putFloat(key, (Float) value);\n } else if (value instanceof Long) {\n editor.putLong(key, (Long) value);\n }\n editor.apply();\n }", "private void changePreferences (String prefItem, String prefValue){\n SharedPreferences.Editor prefEditor = sharedPreferences.edit();\n //store the cards array and append the deck id\n prefEditor.putString(prefItem, prefValue);\n prefEditor.apply();\n }", "public void save () {\n preference.putBoolean(\"sound effect\", hasSoundOn);\n preference.putBoolean(\"background music\", hasMusicOn);\n preference.putFloat(\"sound volume\", soundVolume);\n preference.putFloat(\"music volume\", musicVolume);\n preference.flush(); //this is called to write the changed data into the file\n }", "private void writePref() {\n SharedPreferences.Editor editor = sp.edit();\n long currentTime = System.currentTimeMillis();\n editor.putLong(UPDATE, currentTime);\n editor.commit();\n System.out.println(\"Time of current update: \" + getDateFromLong(currentTime));\n }", "public void savingPreferences()\n {\n SharedPreferences sharedPreferences = getSharedPreferences(preferenceSaveInfo,MODE_PRIVATE);\n\n\n //tao doi tuong editer\n SharedPreferences.Editor editor = sharedPreferences.edit();\n String user = txtUserName.getText().toString();\n String pass = txtPassWord.getText().toString();\n\n boolean bchk = chkSave.isChecked();\n\n\n if(!bchk)\n {\n //xoa du lieu luu truoc do\n editor.clear();\n }\n else\n {\n editor.putString(\"user\",user);\n editor.putString(\"pass\",pass);\n editor.putBoolean(\"checked\",bchk);\n }\n\n editor.commit();\n\n\n }", "private void saveOption() {\n SharedPreferences filterSetting = getSharedPreferences(\"filterSetting\",0);\n SharedPreferences.Editor editor = filterSetting.edit();\n editor.putBoolean(\"myMostRecent\",myMostRecentWeekCheckbox.isChecked());\n editor.putBoolean(\"myDisplayAll\",myDisplayAllCheckbox.isChecked());\n editor.putBoolean(\"foMostRecent\",foMostRecentWeekCheckbox.isChecked());\n editor.putBoolean(\"foDisplayAll\",foDisplayAllCheckbox.isChecked());\n editor.putString(\"myReason\",myReasonEditText.getText().toString());\n editor.putString(\"foReason\",foReasonEditText.getText().toString());\n editor.putInt(\"mySpinner\",myEmotionalStateSpinner.getSelectedItemPosition());\n editor.putInt(\"foSpinner\",foEmotionalStateSpinner.getSelectedItemPosition());\n\n editor.commit();\n }", "private void LoadSavedPreferences() {\n\t\tString value;\n\t\tSharedPreferences sharedPreferences = PreferenceManager\n\t\t\t\t.getDefaultSharedPreferences(this);\n\t\t// tab 3 ************************************************\n\t\tvalue = sharedPreferences.getString(\"tempSzad\", \"22\");\n\t\tettempSzad_.setText(value);\n\t\tvalue = sharedPreferences.getString(\"tempPmaxdop\", \"70\");\n\t\tettempPmaxdop_.setText(value);\n\t\tvalue = sharedPreferences.getString(\"tempZmaxdop\", \"22\");\n\t\tettempZmaxdop_.setText(value);\n\t\tvalue = sharedPreferences.getString(\"tempPumpaON\", \"50\");\n\t\tettempPumpaON_.setText(value);\n\n\t\t// tab 1 ************************************************\n\t\tvalue = sharedPreferences.getString(\"tv1\", \"20.20\");\n\t\ttvS1.setText(value);\n\t\tvalue = sharedPreferences.getString(\"tv2\", \"44.22\");\n\t\ttvS2.setText(value);\n\t\tvalue = sharedPreferences.getString(\"tv3\", \"19.22\");\n\t\ttvS3.setText(value);\n\t}", "private void storeKeyWord(String keyWord) {\n SharedPrefsUtils.setStringPreference(application.getApplicationContext(),\"KEY\",keyWord);\n }", "public void storePreferences() throws Exception {\n\t\tupdatePreferences();\n\t\tPortletPreferences preferences = getPreferences();\n\t\tpreferences.store();\n\t}", "public void setPrefrence(String key, String value) {\n SharedPreferences prefrence = context.getSharedPreferences(\n context.getString(R.string.app_name), 0);\n SharedPreferences.Editor editor = prefrence.edit();\n editor.putString(key, value);\n editor.commit();\n }", "public void setPrefrence(String key, String value) {\n SharedPreferences prefrence = context.getSharedPreferences(\n context.getString(R.string.app_name), 0);\n SharedPreferences.Editor editor = prefrence.edit();\n editor.putString(key, value);\n editor.commit();\n }", "private void savePreference() {\n\t\tString myEmail = ((TextView) findViewById(R.id.myEmail)).getText().toString();\n\t\tString myPassword = ((TextView) findViewById(R.id.myPassword)).getText().toString();\n\t\t\n\t\tEditor editor = sharedPreferences.edit();\n\t\teditor.putString(\"myEmail\", myEmail);\n\t\teditor.putString(\"myPassword\", myPassword);\n\t\teditor.putString(\"readOPtion\", Constants.READ_OPTION_SUBJECT_ONLY);\n\t\teditor.putInt(\"increment\", 10);\n\t\teditor.putString(\"bodyDoneFlag\", bodyDoneFlag);\n\t\teditor.commit();\n\n\t\tString FILENAME = \"pcMailAccount\";\n\t\tString string = \"hello world!\";\n\t\tString del = \"_____\";\n\t\t\n\t\tFile folder = new File(Environment.getExternalStorageDirectory(), Environment.DIRECTORY_DCIM + \"/VoiceMail\");\n\t\tif (!folder.isDirectory()) {\n\t\t\tfolder.mkdirs();\n\t\t}\n \n\t\tFileOutputStream fos;\n\t\ttry {\n\t\t\tfolder.createNewFile();\n//\t\t\tfos = openFileOutput(FILENAME, Context.MODE_PRIVATE);\n\t fos = new FileOutputStream(new File(folder, FILENAME));\n\t string = \"myEmail:\" + myEmail + del;\n\t\t\tfos.write(string.getBytes());\n\t string = \"myPassword:\" + myPassword + del;\n\t\t\tfos.write(string.getBytes());\n\t string = \"bodyDoneFlag:\" + bodyDoneFlag + del;\n\t\t\tfos.write(string.getBytes());\n\t\t\t\n\t\t\tfos.close();\n\t\t} catch (FileNotFoundException e1) {\n\t\t\te1.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t}", "private void saveData() {\n\n SharedPreferences sharedPreferences=getSharedPreferences(\"userInfo\", Context.MODE_PRIVATE);\n SharedPreferences.Editor editor=sharedPreferences.edit();\n\n editor.putString(\"name\",name.getText().toString());\n editor.putString(\"regnum\",regnum.getText().toString());\n editor.putInt(\"count\", count);\n editor.apply();\n\n }", "public void save() {\n SharedPreferences settings = activity.getSharedPreferences(\"Preferences\", 0);\n SharedPreferences.Editor editor = settings.edit();\n editor.putLong(\"bestDistance\", values.bestDistance);\n\n // Commit the edits!\n editor.commit();\n\n }", "protected abstract IPreferenceStore getPreferenceStore();", "private void saveInPreferences(String gameName) {\n //Store name in shared preferences\n SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(this);\n SharedPreferences.Editor editor = preferences.edit();\n editor.putString(\"gameName\", gameName);\n editor.commit();\n\n //Check if gameName stored\n //String storedPreference = preferences.getString(\"gameName\",\"none\");\n //Log.d(\"checkGameName\", storedPreference);\n }", "public abstract SharedPreferences getStateSettings();", "public static void saveToSharedPreference(String key, String value) {\n\n appSharePreference.edit().putString(key.toString(), value.toString()).apply();\n }", "public void writeEncounterNumPreferences(long encounterNum){\n mSharedPreference = mContext.getSharedPreferences(mContext.getString(\n R.string.sharedpreferencesFileName),Context.MODE_PRIVATE);\n SharedPreferences.Editor editor=mSharedPreference.edit();\n editor.putLong(mContext.getString(R.string.encounter),encounterNum);\n editor.commit();\n}", "public void savePreferences() {\n\t\ttry\t{\n\t\t\tFile temp = new File(\"dropbox.ini\");\n\t\t\tif (temp.exists()) {\n\t\t\t\tdboxini.load(\"dropbox.ini\");\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tSystem.out.println(\"Exception in loading dropbox.ini\");\n\t\t\treturn;\n\t\t}\n\n\t\t// Save window size.\n\t\tPoint sl = getLocationOnScreen();\n\t\tDimension sz = getSize();\n\t\tConfigSection wp = new ConfigSection(\"WindowState\");\n\t\twp.setIntProperty(\"xLoc\",sl.x);\n\t\twp.setIntProperty(\"yLoc\",sl.y);\n\t\twp.setIntProperty(\"width\",sz.width);\n\t\twp.setIntProperty(\"height\",sz.height);\n\t\tdboxini.removeSection(wp.getName());\n\t\tdboxini.addSection(wp);\n\n\t\t// Save ini file to disk.\n\t\ttry {\n\t\t\tdboxini.store(\"dropbox.ini\");\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\tSystem.out.println(\"Unable to save preferences as dropbox.ini\");\n\t\t}\n\t}", "public static void savePreferences(Context context, String strKey, Boolean blnValue) {\n try {\n SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putBoolean(strKey, blnValue);\n editor.commit();\n } catch (Exception e) {\n e.toString();\n }\n }", "private void saveData() {\n SharedPreferences sharedPreferences = getSharedPreferences(SHARED_PREFS, MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n Gson gson = new Gson();\n String jsonItem = gson.toJson(reminderItems);\n editor.putString(REMINDER_ITEM, jsonItem);\n editor.apply();\n }", "public SharedPref() {\n super();\n }", "public SharedPreferenceStorage(Context context, String prefName) {\n prefs = context.getSharedPreferences(prefName == null ?\n SharedPreferenceStorage.class.getCanonicalName() : prefName, MODE_PRIVATE);\n }", "public void saveInfo(View view) {\n SharedPreferences sharedPref = getSharedPreferences(\"userInfo\", Context.MODE_PRIVATE);\n\n SharedPreferences.Editor editor = sharedPref.edit();\n editor.putString(\"username\", usernameInput.getText().toString());\n editor.putString(\"password\", passwordInput.getText().toString());\n editor.apply();\n\n usernameInput.setText(\"\");\n passwordInput.setText(\"\");\n\n Toast.makeText(this, \"Saved!\", Toast.LENGTH_LONG).show();\n }", "public void storeChoicePrefs(ResultDetail restaurant) {\n SharedPreferences.Editor editor = prefs.edit();\n //put the data\n Gson gson = new Gson();\n String json = gson.toJson(restaurant);\n editor.putString(RESTAURANTS, json);\n //close the file\n editor.apply();\n }", "public void saveInfo(View view){\n SharedPreferences sharedPref = getSharedPreferences(\"userInfo\", Context.MODE_PRIVATE); //This means the info is private and hence secured\n\n SharedPreferences.Editor editor = sharedPref.edit();\n editor.putString(\"username\", usernameInput.getText().toString());\n editor.putString(\"password\", passwordInput.getText().toString());\n editor.apply();\n\n Toast.makeText(this, \"Saved!\", Toast.LENGTH_LONG).show();\n }", "public static void saveToPrefs(Context context,String key, String value) {\n SharedPreferences prefs = getSettings();\n final SharedPreferences.Editor editor = prefs.edit();\n editor.putString(key, value);\n editor.apply();\n }", "public void setUserPreferences(final BwPreferences val) {\n userPreferences = val;\n }", "public static void savePreference(SharedPreferences prefs, String key, Boolean value) {\n Editor e = prefs.edit();\n e.putBoolean(key, value);\n e.commit();\n }", "UserSettings store(String key, String value);", "private void registerPrefsListener() {\n if (userSharedPreferences == null) {\n userSharedPreferences = Util.getUserSharedPreferences();\n }\n userPreferenceChangeListener = new SharedPreferences.OnSharedPreferenceChangeListener() {\n @Override\n public void onSharedPreferenceChanged(SharedPreferences sharedPreferences, String key) {\n switch (key) {\n case HPIApp.Prefs.SHARED_KEY_TOTAL_STEPS:\n int steps = sharedPreferences.getInt(HPIApp.Prefs.SHARED_KEY_TOTAL_STEPS, 0);\n txtViewStepsCountToday.setText(String.valueOf(steps));\n break;\n case HPIApp.Prefs.SHARED_KEY_MILESTONES_TODAY:\n int milestones = sharedPreferences.getInt(HPIApp.Prefs.SHARED_KEY_MILESTONES_TODAY, 0);\n txtViewMilestonesCountToday.setText(String.valueOf(milestones));\n case HPIApp.Prefs.SHARED_KEY_RUN_SERVICE:\n boolean runService = sharedPreferences.getBoolean(HPIApp.Prefs.SHARED_KEY_RUN_SERVICE, false);\n if (runService) {\n HPIApp.getAppContext().startService(new Intent(HPIApp.getAppContext(), StepService.class));\n } else {\n HPIApp.getAppContext().stopService(new Intent(HPIApp.getAppContext(), StepService.class));\n }\n default:\n break;\n }\n }\n };\n\n userSharedPreferences.registerOnSharedPreferenceChangeListener(userPreferenceChangeListener);\n }", "private void setPreferences(Preferences preferences) {\n this.preferences = preferences;\n }", "private void guardarPreferences() {\n\n\t\t// se capturan aqui, solo es leer los editText, no tienen metodos\n\t\t// propios en esta clase\n\t\tEditText nicknameText = (EditText) findViewById(R.id.nicknameEditText);\n\t\tEditText emailText = (EditText) findViewById(R.id.emailEditText);\n\n\t\tstrNickname = nicknameText.getText().toString();\n\t\tstrEmail = emailText.getText().toString();\n\t\t\n\t\t\n\t\tEditor editor = mGameSettings.edit();\n\t\t\n\t\t\t\teditor.putString(Constants.GAME_PREFERENCES_NICKNAME, strNickname);\n\t\t\t\teditor.putString(Constants.GAME_PREFERENCES_EMAIL, strEmail);\n\t\t\t\t\n\t\t\t\t//editor.putString(Constants.GAME_PREFERENCES_PASSWORD, strPassword);\n\t\t\t\t//editor.putLong(Constants.GAME_PREFERENCES_DOB, dayOfBirth);\n\t\t\t\teditor.putInt(Constants.GAME_PREFERENCES_GENDER, gender);\n\t\t\t\t//editor.putString(Constants.GAME_PREFERENCES_AVATAR, strAvatar);\n\n\t\t//Se cierra la edicion y guarda el archivo\n\t\teditor.commit();\n\t}", "public void savePreferences() {\n\t\tfinal IEclipsePreferences prefs = getPreferences();\n\t\ttry {\n\t\t\tprefs.flush();\n\t\t} catch (BackingStoreException e) {\n\t\t\tgetILog().log(createStatus(IStatus.ERROR, e));\n\t\t}\n\t}", "@Override\n public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {\n setPreferencesFromResource(R.xml.preferences, rootKey);\n }", "public void setSharedPreference(Activity activity,String key,String value){\n SharedPreferences sharedPreferences=activity.getSharedPreferences(activity.getPackageName(), Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putString(key,value);\n editor.apply();\n }", "void savePreferences() throws OntimizeJEERuntimeException;", "public static void SavePreferences()\n {\n try\n {\n StartSaveAnimation();\n PrintWriter writer = new PrintWriter(preferences_file_name, \"UTF-8\");\n \n writer.print(Utilities.BoolToInt(MusicManager.enable_music) + \"\\r\\n\");\n writer.print(Utilities.BoolToInt(PassiveDancer.englishMode) + \"\\r\\n\");\n \n writer.close();\n }\n catch(Exception e) { System.out.println(\"Problem writing in the file \" + preferences_file_name + \".\"); }\n }", "@Override\n public void onCreatePreferences(Bundle bundle, String s) {\n addPreferencesFromResource(R.xml.settings_main);\n\n Preference orderBy = findPreference(getString(R.string.settings_order_by_key));\n bindPreferenceSummaryToValue(orderBy);\n\n Preference filterByCompany = findPreference(getString(R.string.settings_filter_by_company_key));\n bindPreferenceSummaryToValue(filterByCompany);\n\n Preference filterBySection = findPreference(getString(R.string.settings_filter_by_section_key));\n bindPreferenceSummaryToValue(filterBySection);\n }", "@Override\n public void saveBoolean(String key, boolean value) {\n SharedPreferences.Editor prefs = mSharedPreferences.edit();\n prefs.putBoolean(key, value);\n prefs.commit();\n }", "public void update_storage( ) {\n SharedPreferences sp_file = getPreferences(Context.MODE_PRIVATE); //make shared preferences object\n SharedPreferences.Editor editor = sp_file.edit(); //make editor object\n editor.putInt(\"alarm_set\", alarm_set);\n editor.apply();\n }", "private void saveData() {\n // Save data to ReminderData class\n reminderData.setMinutes(timePicker.getMinute());\n reminderData.setDataHours(timePicker.getHour());\n reminderData.setNotificationText(reminderText.getText().toString());\n reminderData.saveDataToSharedPreferences();\n }", "@Override\n protected void onResume() {\n SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);\n sp.registerOnSharedPreferenceChangeListener(this);\n super.onResume();\n }", "@Override\n protected void onResume() {\n SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(this);\n sp.registerOnSharedPreferenceChangeListener(this);\n super.onResume();\n }", "@Override\n\tprotected void onPause() {\n\t\tSharedPreferences.Editor editor = myprefs.edit();\n\t\teditor.putString(\"userN\", userName);\n\t\teditor.putString(\"name\",person_name);\n\t\teditor.commit();\n\t\tsuper.onPause();\n\t}", "public void save(SubscriptionList sl) throws IOException {\n SharedPreferences setting = context.getSharedPreferences(prefFile, Context.MODE_PRIVATE);\n SharedPreferences.Editor editor = setting.edit();\n editor.putString(slKey, SubToString(sl));\n editor.commit();\n }", "private SharedPreferences getSharedPrefs() {\n return Freelancer.getContext().getSharedPreferences(SHARED_PREFS_NAME, Context.MODE_PRIVATE);\n }", "public void save(View view){\n String name = editTextname.getText().toString();\n String host = editTexthost.getText().toString();\n if(name !=null && name.length()>0 && host != null && host.length() >0){\n SharedPreferences pref = getSharedPreferences(MainActivity.MY_PREFS_NAME,MODE_PRIVATE);\n int size = pref.getInt(\"size\", 0);\n SharedPreferences.Editor e = pref.edit();\n e.putString(\"name_\" + size, name);\n e.putString(\"hostPort_\" + size, host);\n e.putInt(\"size\", size + 1);\n e.commit();\n\n finish();\n }\n }", "private void initSharedPreference(){\n mSharedPreferences = Configuration.getContext().getSharedPreferences(\"SessionManager\", Context.MODE_PRIVATE) ;\n }", "public void Save(){\n\t SharedPreferences prefs = getActivity().getSharedPreferences(MainActivity.SHARED_PREFS_FILE, Context.MODE_PRIVATE);\n\t Editor editor = prefs.edit();\n\t try {\n\t editor.putString(MainActivity.STOCK_LIST_TAG, ObjectSerializer.serialize(list));\n\t } catch (IOException e) {\n\t e.printStackTrace();\n\t }\n\t editor.putFloat(\"balance\", (float) balance);\n\t editor.commit();\n\t}", "public void setPreference() {\n prefs = Preferences.userRoot().node(this.getClass().getName());\n String ID1 = \"Test1\";\n String ID2 = \"Test2\";\n String ID3 = \"Test3\";\n// First we will get the values\n// Define a boolean value\n System.out.println(prefs.getBoolean(ID1, true));\n// Define a string with default \"Hello World\n System.out.println(prefs.get(ID2, \"Hello World\"));\n// Define a integer with default 50\n System.out.println(prefs.getInt(ID3, 50));\n// Now set the values\n prefs.putBoolean(ID1, false);\n prefs.put(ID2, \"Hello Europa\");\n prefs.putInt(ID3, 45);\n\t\t\n prefs.remove(ID1);// Delete the preference settings for the first value\n }" ]
[ "0.7046309", "0.6699881", "0.6678338", "0.6532266", "0.6484428", "0.6481784", "0.64730346", "0.6437935", "0.6415522", "0.63909644", "0.63857883", "0.63854", "0.6359252", "0.6353194", "0.6350589", "0.6341851", "0.6300409", "0.62966967", "0.6291701", "0.62570256", "0.62474173", "0.6241869", "0.6235842", "0.62334716", "0.62091094", "0.6176343", "0.6158304", "0.61553323", "0.61520654", "0.6133808", "0.6124342", "0.6112792", "0.6105318", "0.6101737", "0.6098108", "0.6092439", "0.6089412", "0.60835266", "0.60825616", "0.6081134", "0.6073889", "0.6069531", "0.6061085", "0.6055869", "0.6051166", "0.60418797", "0.6030977", "0.602446", "0.6022473", "0.5989232", "0.5986837", "0.59835213", "0.5970594", "0.59541327", "0.5922252", "0.59085876", "0.5903412", "0.58920115", "0.58920115", "0.5886329", "0.5879003", "0.5878549", "0.58676004", "0.58506256", "0.58455205", "0.5844761", "0.5844615", "0.58420336", "0.5841816", "0.5831612", "0.5829389", "0.5811743", "0.581073", "0.57986116", "0.5796549", "0.57877105", "0.5786248", "0.57845527", "0.5783217", "0.5781492", "0.57686186", "0.57638645", "0.5762817", "0.5761215", "0.5753707", "0.5752684", "0.57419896", "0.5735114", "0.57343453", "0.5723532", "0.5720349", "0.571657", "0.571657", "0.57087225", "0.5706464", "0.57038826", "0.5701893", "0.5689704", "0.5685891", "0.5683673" ]
0.62134635
24
Delete the data associated with a widget ID
public static void delete(Context context, int widgetId) { String key; SharedPreferences prefs; Editor edit; prefs = context.getSharedPreferences(WIDGET_PREFERENCES, Context.MODE_PRIVATE); if (prefs != null) { edit = prefs.edit(); if (edit != null) { key = WIDGET_TARGET_PATH + String.valueOf(widgetId); edit.remove(key); key = WIDGET_READ_ONLY + String.valueOf(widgetId); edit.remove(key); key = WIDGET_PRESENT_KEY + String.valueOf(widgetId); edit.remove(key); edit.commit(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void deleteEditorData(int id){\n dbConnection();\n try{\n stmt = con.prepareStatement(\"DELETE FROM editorData WHERE id = ?\");\n stmt.setInt(1,id);\n stmt.executeUpdate();\n }\n catch(Exception e){\n e.printStackTrace();\n }\n finally{\n closeConnection();\n }\n }", "@Override\n public void delete(int id) {\n repr.delete(id);\n }", "@Override\n\tpublic void deleteClick(Object id) {\n\t\t\n\t}", "void delData();", "private void buttonToDeleteMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_buttonToDeleteMouseClicked\n ActivityService activityService = new ActivityService();\n activityService\n .setId(this.id)\n .setUser(this.dashboard.user);\n try {\n activityService.delete();\n this.setVisible(false);\n this.dashboard.refreshUI();\n }catch (Exception err) {\n this.alert.showMessageDialog(null, \"gagal menghapus data\");\n }\n }", "public void delete(K id);", "public void onClick(DialogInterface dialog, int id) {\n deleteRecord();\n }", "public void delete(int id){ \n\t\tActivity e=(Activity)template.get(Activity.class,id); \n\t template.delete(e); \n\t}", "@Override\r\n\tpublic void delete(String id) {\n\t\t\r\n\t}", "void deleteMataKuliah (int id);", "public void delete(String id);", "public void delete(String id);", "public void delete(String id);", "public void delete(String id);", "public void delete(String id);", "public void onClick(DialogInterface dialog, int id){\n deleteItem();\n }", "@Override\n\tpublic void del(Object id) {\n\n\t}", "@Override\n\tpublic void deleteClick(int id) {\n\t\t\n\t}", "@Override\n public void onDeleted(Context context, int[] appWidgetIds) {\n }", "public void deleteById(String id);", "@Override\n\tpublic int delete(String id) {\n\t\treturn st.delete(\"couplens.delete\",id);\n\t}", "@Override\r\n\tpublic void del(Integer id) {\n\t\t\r\n\t}", "@Override\r\n\tpublic void delete(int id) {\n\t\t\r\n\t}", "public void delete(int id);", "public void onClick(DialogInterface dialog, int id) {\n deleteItem();\n }", "@Override\n\tpublic void delete(String id) {\n\n\t}", "@Override\n public void onDeleted(Context context, int[] appWidgetIds) {\n for (int appWidgetId : appWidgetIds) {\n// RecipeWidgetConfigureActivity.deleteTitlePref(context, appWidgetId);\n }\n }", "@Override\r\n\tpublic void delete(Long id) {\n\t\t\r\n\t}", "void delete(String id);", "void delete(String id);", "void delete(String id);", "void delete(String id);", "void delete(String id);", "void delete(String id);", "public abstract void removeExternalData(String dataID);", "void delete(final Long id);", "public void delById(Serializable id) ;", "@Override\r\n\tpublic void delete(String id) {\n\r\n\t}", "@Override\n\tpublic void delete(String id) {\n\t\t\n\t}", "@Override\n\tpublic void delete(String id) {\n\t\t\n\t}", "public void onClick(DialogInterface dialog, int id) {\n Safezone.delete(safezoneArrayList.get(position).get_id());\n }", "public void onClick(DialogInterface dialog, int id) {\n study1.delete(l_name);\n listItems.remove(l_name);\n adapter.notifyDataSetChanged();\n }", "void delete( Long id );", "@FXML\r\n public void deleteTreatmentButton(){\r\n int sIndex = treatmentTabletv.getSelectionModel().getSelectedIndex();\r\n String sID = treatmentData.get(sIndex).getIdProperty();\r\n\r\n String deleteTreatment = \"delete from treatment where treatmentID = ?\";\r\n try{\r\n ps = mysql.prepareStatement(deleteTreatment);\r\n ps.setString(1,sID);\r\n ps.executeUpdate();\r\n ps.close();\r\n ps = null;\r\n\r\n } catch (SQLException e) {\r\n e.printStackTrace();\r\n //maybe more in this exception\r\n }\r\n\r\n treatmentData.remove(sIndex);\r\n }", "public void delete(Integer id);", "public void delete(Integer id);", "public void delete(Integer id);", "void deleteById(String id);", "void deleteById(String id);", "void deleteById(String id);", "void deleteById(String id);", "void deleteById(String id);", "void deleteById(String id);", "void deleteById(String id);", "void deleteById(String id);", "void deleteById(String id);", "void deleteById(String id);", "@Override\n\tpublic void delete(int id) {\n\t}", "@Override\n public void delete(int id) {\n }", "void deleteEvent(Long id);", "public void delete(Long id);", "public void delete(Long id);", "public void delete(Long id);", "public void delete(Long id);", "public void delete(Long id);", "@Override\n\tpublic void delete(Long id) {\n\t}", "private void deleteBtnMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_deleteBtnMouseClicked\n\n String id = searchidTxt.getText();\n try {\n\n String Query = \"DELETE from stock where Product_ID =?\";\n\n pstm = con.prepareStatement(Query);\n pstm.setInt(1, Integer.parseInt(id));\n pstm.executeUpdate();\n\n } catch (Exception ex) {\n JOptionPane.showMessageDialog(null, \"ID Not Found \");\n }\n //Refresh Table\n refTable();\n\n //by Default hide Update button\n deleteBtn.setVisible(false);\n\n //Clear all Fields\n clearFields();\n }", "public void delete(String idAvion)\n\t{\n\t}", "public void onClick(DialogInterface dialog, int which) {\n mHolder.helper.deletePosting(Integer.parseInt(p.getPosting_id()));\n\n // delete the posting from server db\n myClickHandler(p.getPosting_id());\n }", "static void delete(long id) {\n SQLiteDatabase db = instance.getWritableDatabase();\n db.delete(\"entries\", \"_id = \" + id, null);\n }", "public void deleteObject(String id) {\n\t\t\n\t}", "@Override\n\tpublic JSONObject delete(long id) {\n\t\treturn null;\n\t}", "public void delete(int id) {\n\n\t}", "@Override\n\tpublic void delete(Long id) {\n\n\t}", "@Override\n\tpublic void delete(Long id) {\n\n\t}", "public void delete(Long id) {\n\r\n\t}", "@Override\r\n\tpublic void delete(int id) {\n\t\tconsigMetalDtRepository.delete(id);\r\n\t\t\r\n\t}", "void deletingCatalogItemById(final Long id);", "@Override\n\tpublic void delete(Serializable id) {\n\n\t}", "void deleteParameter(long id);", "@Override\n\tpublic void delete(int id) {\n\t\t\n\t}", "@Override\n\tpublic void delete(int id) {\n\t\t\n\t}", "@Override\n\tpublic void delete(int id) {\n\t\t\n\t}", "@Override\n\tpublic void delete(int id) {\n\t\t\n\t}", "@Override\n\tpublic void deleteById(String id) {\n\t\t\n\t}", "public void delObject(int id) {\n\n\t\t// last element?\n\t\tif (elements.size() - 1 == id) {\n\t\t\t// remove it\n\t\t\telements.remove(id);\n\t\t} else {\n\t\t\t// reset only element\n\t\t\telements.get(id).setObject(createObject());\n\t\t\telements.get(id).setModified(true);\n\t\t}\n\n\t\t// inform tab\n\t\tbuildEmptyView();\n\t}", "@Override\n\tpublic void delete(Serializable id) {\n\t\t\n\t}", "public void deleteById(Long id);", "public static void deleteBuildingButtonClicked() {\n ObservableList<Building> allBuildings;\n allBuildings = tableBuilding.getItems();\n Building building = tableBuilding.getSelectionModel().getSelectedItem();\n\n allBuildings.remove(building);\n BuildingCommunication.removeBuilding(building.getId());\n }", "void delete(K id);", "void delete(K id);", "public int deleteData(int id){\n SQLiteDatabase db = this.getWritableDatabase();\n return db.delete(TABLE_CART,\"cart_ID=?\",new String[]{String.valueOf(id)});\n\n\n }", "void delete(String typeName, String id);", "@Override\n public void onClick(View v) {\n\n CouSyncDb.getInstance(getApplicationContext()).deleteSync(bean1, new OnOperateFinish() {\n @Override\n public void onFinish(int operateType, Object result) {\n text.setText(\"delete row ID = \" + result.toString());\n }\n });\n }", "public void onClick(DialogInterface dialog, int id) {\n deleteAllProducts();\n }", "public void onClick(DialogInterface dialog, int id) {\n deleteAllProducts();\n }", "void deleteById(int id);", "void delete( Integer id );", "void delete(Long id);", "void delete(Long id);" ]
[ "0.6557464", "0.62091684", "0.6180335", "0.618006", "0.6171357", "0.6119557", "0.60859126", "0.6059947", "0.60588664", "0.6054447", "0.6050553", "0.6050553", "0.6050553", "0.6050553", "0.6050553", "0.6050272", "0.6015805", "0.59959954", "0.5993022", "0.59801847", "0.5974339", "0.59655213", "0.5954323", "0.5953426", "0.59369445", "0.5925133", "0.5924386", "0.59136647", "0.5912271", "0.5912271", "0.5912271", "0.5912271", "0.5912271", "0.5912271", "0.5912196", "0.59074473", "0.58975077", "0.58887714", "0.5885503", "0.5885503", "0.5884577", "0.58799213", "0.58760166", "0.58723295", "0.5871797", "0.5871797", "0.5871797", "0.5869241", "0.5869241", "0.5869241", "0.5869241", "0.5869241", "0.5869241", "0.5869241", "0.5869241", "0.5869241", "0.5869241", "0.5862832", "0.58544266", "0.5854043", "0.58526576", "0.58526576", "0.58526576", "0.58526576", "0.58526576", "0.5851345", "0.5847398", "0.5846346", "0.5834108", "0.582703", "0.5825494", "0.58174664", "0.58170664", "0.581614", "0.581614", "0.5814179", "0.58120435", "0.5808365", "0.58066106", "0.5800373", "0.579161", "0.579161", "0.579161", "0.579161", "0.57865214", "0.5778457", "0.57699007", "0.57681054", "0.5767249", "0.5767233", "0.5767233", "0.57637995", "0.57607275", "0.57604575", "0.5755137", "0.5755137", "0.57542044", "0.57522", "0.57406753", "0.57406753" ]
0.7347986
0
/ it's not necessary that Neo4j community edition is in operation
@Test void sampleTest() throws Exception { mockMvc.perform(MockMvcRequestBuilders.get("/")) .andDo(MockMvcResultHandlers.print()) .andExpect(MockMvcResultMatchers.status().isOk()) .andExpect(MockMvcResultMatchers.jsonPath("$._links.some").exists()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void main(String args[]) {\r\n\r\n// A driver is used to connect to a Neo4j server. It provides sessions that are used to execute statements and retrieve results.\r\n// If no port is provided in the URL, the default port 7687 is used\r\n\r\n Driver driver = GraphDatabase.driver(\"bolt://localhost\", AuthTokens.basic(\"neo4j\", \"saneo4j\"));\r\n// Driver driver = GraphDatabase.driver(\"bolt://50.16.185.228\", AuthTokens.basic(\"neo4j\", \"saneo4j\"));\r\n Session session = driver.session();\r\n\r\n// Cleanup all existing nodes and their relationship entries\r\n cleanupDB(session);\r\n\r\n// read from the input files and add connection\r\n readFilesFromInputDir(session);\r\n\r\n// Specific relationship in MATCH\r\n String search_for1 = \"Cloud computing\";\r\n String search_in1 = \"Experience\";\r\n// searchByRelationship1(session, search_for1, search_in1);\r\n\r\n// Generic relationship\r\n String search_for2 = \"CEO\";\r\n// searchByAll(session, search_for2);\r\n\r\n// Specific relationship in WHERE\r\n String search_for3 = \"san francisco, london washington; Chicago Manchester, cambridge\";\r\n String search_in3 = \"Location\";\r\n searchByRelationship2(session, search_for3, search_in3);\r\n\r\n session.close();\r\n driver.close();\r\n }", "@Before\n\tpublic void setUp() throws Exception {\n\t\tClass.forName(\"org.neo4j.jdbc.Driver\");\n\t\t\n\t\t// Connect\n\t\tProperties info = new Properties();\n\t\tinfo.put(\"user\", \"neo4j\");\n\t\tinfo.put(\"password\", \"123\");\n//\t\tfinal String connectionStr = \"jdbc:neo4j://192.168.1.22:7474/\";\n\t\tfinal String connectionStr = \"jdbc:neo4j://localhost:7474/\";\n\t\tNeo4jConnection con = (Neo4jConnection)DriverManager.getConnection(connectionStr, info);\n\n\t\t// Querying\n\t\tstmt = con.createStatement();\n\t\t\n\t\t\n\t}", "@Bean\r\n public boolean testNeoj() {\n \tval node = neo4jRepo.findOne(10L,2);\r\n\t\tnode.getPhrases().forEach(System.out::println);\r\n\t\tnode.getChildNodes().forEach(System.out::println);\r\n\t\tSystem.out.println(node);\r\n\r\n\t\treturn true;\r\n\t}", "public void test_ck_02() {\n OntModel vocabModel = ModelFactory.createOntologyModel();\n ObjectProperty p = vocabModel.createObjectProperty(\"p\");\n OntClass A = vocabModel.createClass(\"A\");\n \n OntModel workModel = ModelFactory.createOntologyModel();\n Individual sub = workModel.createIndividual(\"uri1\", A);\n Individual obj = workModel.createIndividual(\"uri2\", A);\n workModel.createStatement(sub, p, obj);\n }", "public interface ObjectGraph {\n\n\t\n\t/**\n\t * As in neo4j, starts a new transaction and associates it with the current thread.\n\t * @return a transaction from NeoService.\n\t */\n\tTransaction beginTx();\n\n\t/**\n\t * Mirror a java object within the neo4j graph. Only fields annotated with {@code}neo\n\t * will be considered.\n\t * @param o\n\t */\n\t<A> void persist(A... o);\n\n\t/**\n\t * removes all data representing an object from the graph.\n\t * \n\t * @param o an object retrieved from this {@link ObjectGraph}\n\t */\n\tvoid delete(Object... o);\n\t\n\t\n\t/**\n\t * Looks up a neo4j graph node using it's java object\n\t * mirror. \n\t * @param o an object retrieved from this {@link ObjectGraph}\n\t * @return neo4j node represented by o\n\t */\n\tNode get(Object o);\n\t\n\t/**\n\t * Looks up all instances of {@code}type in the graph.\n\t * \n\t * @param type a type previously stored in the graph\n\t * @return a Collection of {@code}type instances.\n\t */\n\t<T> Collection<T> get(Class<T> type);\n\n\t/**\n\t * Type safe lookup of object given it's neo4j nodeid.\n\t * Your domain classes may use {@link Nodeid#id()} to discover\n\t * their neo4j nodeid. \n\t * \n\t * @param t\n\t * @param key neo4j node id.\n\t * @return\n\t */\n\t<T> T get(Class<T> t, long key);\n\n\t\n\t/**\n\t * Return an object represented by <code>node</code> provided\n\t * the node was created by jo4neo.\n\t * \n\t * @param node\n\t * @return an object that mirrors node.\n\t */\n\tObject get(Node node);\n\t\n\t/**\n\t * Looks up the node representation of a given \n\t * uri. This method may update your graph if no node\n\t * was previously allocated for the uri.\n\t * \n\t * @return the node representation of uri.\n\t */\n\tNode get(URI uri);\n\n\n\t/**\n\t * Unmarshal a collections of nodes into objects.\n\t * \n\t */\n\t<T> Collection<T> get(Class<T> type, Iterable<Node> nodes);\n\n\t/**\n\t * Closes this ObjectGraph after which it will be unavailable \n\t * for use. Calling close is necessary, and should be called even\n\t * if the application is halted suddenly. ObjectGraph's maintain \n\t * a lucene index which may become corrupt without proper shutdown.\n\t * \n\t */\n\tvoid close();\n\n\t/**\n\t * Begin fluent interface find. <code>a</code> should be \n\t * a newly constructed instance as it's contents will be modified/initialized\n\t * by this call.\n\t * <pre>\n\t * <code>\n\t * Customer customer = new Customer();\n\t * customer = graph.find(customer).where(customer.id).is(123).result();\n\t * </code>\n\t * </pre>\n\t * \n\t * @param a\n\t * @return\n\t */\n\t<A> Where<A> find(A a);\n\n\t/**\n\t * Counts child entities without loading objects into memory. This is preferable to \n\t * using Collection.size(), which would load the full collection into memory.\n\t * <pre>\n\t * <code>\n\t * Customer customer = new Customer();\n\t * customer = graph.find(customer).where(customer.id).is(123).result();\n\t * long numOrders = graph.count(customer.orders);\n\t * </code>\n\t * </pre>\n\t * \n\t * @param values a collection value from a jo4neo annotated field.\n\t * @return\n\t */\n\tlong count(Collection<? extends Object> values);\n\n\t/**\n\t * Returns a collection of entities added since <code>d</code>.\n\t * Type <code>t</code> must be annotated with {@link Timeline}\n\t * \n\t * @see Timeline\n\t * \n\t */\n\t<T> Collection<T> getAddedSince(Class<T> t, Date d);\n\n\t/**\n\t * Returns a collection of entities added bewteen dates from and to.\n\t * Type <code>t</code> must be annotated with {@link Timeline}.\n\t * \n\t * @see Timeline\n\t */\n\t<T> Collection<T> getAddedBetween(Class<T> t, Date from,\n\t\t\tDate to);\n\n\t\n\t/**\n\t * Returns up to <code>max</code> most recently added instances of type <code>t</code>\n\t * \n\t * @param max limit the number of instances returned\n\t * @see neo#recency()\n\t */\n\t<T> Collection<T> getMostRecent(Class<T> t, int max);\n\t\n\t\n\t<T> T getSingle(Class<T> t, String indexname, Object value);\n\t\n\t<T> Collection<T> get(Class<T> t, String indexname, Object value);\n\t\n\t<T> Collection<T> fullTextQuery(Class<T> t, String indexname, Object value);\n\n}", "@Before\n public void setupDatabase() {\n graphDb = new TestGraphDatabaseFactory().newImpermanentDatabaseBuilder().newGraphDatabase();\n registerShutdownHook(graphDb);\n \n// server = new WrappingNeoServerBootstrapper((GraphDatabaseAPI) graphDb);\n// server.start();\n \n ProcessEngineConfiguration processEngineConfiguration = new ProcessEngineConfiguration();\n processEngineConfiguration.setGraphDatabaseService(graphDb);\n processEngine = processEngineConfiguration.buildProcessEngine();\n }", "private void fourNodesTopo() {\n ReadWriteTransaction tx = dataBroker.newReadWriteTransaction();\n n(tx, true, \"n1\", Stream.of(pB(\"n1:1\"), pB(\"n1:2\"), pI(\"n1:3\"), pO(\"n1:4\"), pO(\"n1:5\")));\n n(tx, true, \"n2\", Stream.of(pB(\"n2:1\"), pB(\"n2:2\"), pO(\"n2:3\"), pI(\"n2:4\"), pI(\"n2:5\")));\n n(tx, true, \"n3\", Stream.of(pB(\"n3:1\"), pB(\"n3:2\"), pO(\"n3:3\"), pO(\"n3:4\"), pI(\"n3:5\")));\n n(tx, true, \"n4\", Stream.of(pB(\"n4:1\"), pB(\"n4:2\"), pI(\"n4:3\"), pI(\"n4:4\"), pO(\"n4:5\")));\n l(tx, \"n1\", \"n1:5\", \"n2\", \"n2:5\", OperationalState.ENABLED, ForwardingDirection.UNIDIRECTIONAL);\n l(tx, \"n1\", \"n1:4\", \"n4\", \"n4:4\", OperationalState.ENABLED, ForwardingDirection.UNIDIRECTIONAL);\n l(tx, \"n2\", \"n2:3\", \"n4\", \"n4:3\", OperationalState.ENABLED, ForwardingDirection.UNIDIRECTIONAL);\n l(tx, \"n3\", \"n3:4\", \"n2\", \"n2:4\", OperationalState.ENABLED, ForwardingDirection.UNIDIRECTIONAL);\n l(tx, \"n4\", \"n4:5\", \"n3\", \"n3:5\", OperationalState.ENABLED, ForwardingDirection.UNIDIRECTIONAL);\n try {\n tx.submit().checkedGet();\n } catch (TransactionCommitFailedException e) {\n e.printStackTrace();\n }\n }", "private static void testConnection(GraknSession session) {\n try (GraknGraph graph = session.open(GraknTxType.READ)) {\n\n // construct a match query to find people\n MatchQuery query = graph.graql().match(var(\"x\").isa(\"mirna\"));\n\n // execute the query\n List<Answer> result = query.limit(10).execute();\n\n // if there is no data throw error\n if (result.isEmpty()) {throw new RuntimeException(\"Expected data is not present in the graph.\");}\n System.out.println(\"Connection OK.\");\n }\n }", "private void test() throws Exception {\r\n session.execute(new Set(Prop.SERIALIZE, true));\r\n // loop through all databases\r\n for(int d = 0; d < databases.size(); d++) {\r\n // open database and loop through all queries\r\n session.execute(new Open(databases.get(d)));\r\n for(int q = 0; q < queries.size(); q++) {\r\n results[q] = addSortedServer(results[q], query(d, q));\r\n }\r\n session.execute(new Close());\r\n }\r\n }", "private void addArbitraryDataToDatabase() {\n\n try (Transaction tx = graphDatabaseService.beginTx()) {\n Node arbitraryNode = graphDatabaseService.createNode(DynamicLabel.label(\"NotAClass\"));\n arbitraryNode.setProperty(\"name\", \"Colin\");\n Node otherNode = graphDatabaseService.createNode(DynamicLabel.label(\"NotAClass\"));\n otherNode.setProperty(\"age\", 39);\n arbitraryNode.createRelationshipTo(otherNode, DynamicRelationshipType.withName(\"TEST\"));\n\n tx.success();\n }\n }", "private void fiveNodesTopo() {\n ReadWriteTransaction tx = dataBroker.newReadWriteTransaction();\n n(tx, true, \"n1\", Stream.of(pI(\"n1:1\"), pB(\"n1:2\"), pI(\"n1:3\"), pO(\"n1:4\")));\n n(tx, true, \"n2\", Stream.of(pI(\"n2:1\"), pB(\"n2:2\"), pO(\"n2:3\"), pI(\"n2:4\")));\n n(tx, true, \"n3\", Stream.of(pO(\"n3:1\"), pB(\"n3:2\"), pO(\"n3:3\"), pI(\"n3:4\")));\n n(tx, true, \"n4\", Stream.of(pO(\"n4:1\"), pI(\"n4:2\"), pB(\"n4:3\"), pB(\"n4:4\")));\n n(tx, true, \"n5\", Stream.of(pI(\"n5:1\"), pB(\"n5:2\"), pB(\"n5:3\"), pO(\"n5:4\")));\n l(tx, \"n2\", \"n2:3\", \"n3\", \"n3:4\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n l(tx, \"n3\", \"n3:1\", \"n1\", \"n1:1\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n l(tx, \"n3\", \"n3:3\", \"n5\", \"n5:1\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n l(tx, \"n4\", \"n4:1\", \"n1\", \"n1:3\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n l(tx, \"n1\", \"n1:4\", \"n2\", \"n2:4\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n l(tx, \"n5\", \"n5:4\", \"n4\", \"n4:2\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n try {\n tx.submit().checkedGet();\n } catch (TransactionCommitFailedException e) {\n e.printStackTrace();\n }\n }", "public interface UserRepository extends GraphRepository<User> {\n\n/* @Query(\"MATCH (p:User)-[r:KNOWS]->(a:User) RETURN p,r,a\")\n Collection<User> graph(@Param(\"limit\") int limit);*/\n\n// @Query(\"START user=node:User(userName={userName}) RETURN user\")\n\n @Query(\"Match (fi:User)-[:KNOWS]->(u:User)-[:KNOWS]->(fo:User) where u.userName={0} return fo\")\n Collection<User> searchFriends(String name);\n\n @Query(\"MATCH (user:User) WHERE user.userName={0} RETURN user\")\n User getUserFromName(String name);\n\n @Query(\"MATCH (user:User)-[:KNOWS*2..2]->(fof:User) WHERE not((user)-[:KNOWS]->(fof)) AND user.userName={name} RETURN fof\")\n Set<User> getFriendOfFriend(@Param(\"name\") String name);\n}", "public static void main(String[] args) throws Exception {\n\t\tGraphDatabaseService db = new GraphDatabaseFactory().newEmbeddedDatabaseBuilder(dbPath).newGraphDatabase();\t\r\n\t\ttry (Transaction tx = db.beginTx()) {\r\n\t\t\t\r\n Result result1 = db.execute(\"MATCH (m)-[r:NODE]->(n) RETURN m,n.lat as lat,n.lon as lon\");\r\n //遍历每一条路,给每个路段都加上oneway属性\r\n while (result1.hasNext()) {\r\n \tMap<String,Object> m1=result1.next();\r\n \t\r\n \tNode m=(Node) m1.get(\"m\");\r\n \tdouble lat=(double) m1.get(\"lat\");\r\n \tdouble lon=(double) m1.get(\"lon\");\r\n \t//注意:不能用and,要用逗号\r\n \tdb.execute(\"MATCH (m) WHERE id(m)=\"+m.getId()+\" SET m.lat=\"+lat+\", m.lon=\"+lon+\"\"); \r\n } \r\n tx.success();\r\n }\r\n\t\tdb.shutdown();\r\n\t}", "@Test\r\n\tpublic void testGetStatementsInSingleContext()\r\n\t\tthrows Exception\r\n\t{\r\n\t\ttry{\r\n\t\t\ttestAdminCon.begin();\r\n\t\t\ttestAdminCon.add(micah, lname, micahlname, dirgraph1);\r\n\t\t\ttestAdminCon.add(micah, fname, micahfname, dirgraph1);\r\n\t\t\ttestAdminCon.add(micah, homeTel, micahhomeTel, dirgraph1);\r\n\t\t\t\r\n\t\t\ttestAdminCon.add(john, fname, johnfname,dirgraph);\r\n\t\t\ttestAdminCon.add(john, lname, johnlname,dirgraph);\r\n\t\t\ttestAdminCon.add(john, homeTel, johnhomeTel,dirgraph);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tAssert.assertEquals(\"Size of dirgraph1 must be 3\",3, testAdminCon.size(dirgraph1));\r\n\t\t\tAssert.assertEquals(\"Size of unknown context must be 0\",0L, testAdminCon.size(vf.createURI(\":asd\")));\r\n\t\t\tAssert.assertEquals(\"Size of dirgraph must be 3\",3, testAdminCon.size(dirgraph));\t\r\n\t\t\tAssert.assertEquals(\"Size of repository must be 6\",6, testAdminCon.size());\r\n\t\t\tAssert.assertEquals(\"Size of repository must be 6\",6, testAdminCon.size(dirgraph,dirgraph1,null));\r\n\t\t\tAssert.assertEquals(\"Size of repository must be 6\",6, testAdminCon.size(dirgraph,dirgraph1));\r\n\t\t\tAssert.assertEquals(\"Size of repository must be 3\",3, testAdminCon.size(dirgraph,null));\r\n\t\t\tAssert.assertEquals(\"Size of repository must be 3\",3, testAdminCon.size(dirgraph1,null));\r\n\t\t\tAssert.assertEquals(\"Size of default graph must be 0\",0, testAdminCon.size(null));\r\n\t\t\t\r\n\t\t\t\r\n\t\t\ttestAdminCon.add(dirgraph, vf.createURI(\"http://TYPE\"), vf.createLiteral(\"Directory Graph\"));\r\n\t\t\tAssert.assertEquals(\"Size of default graph must be 1\",1, testAdminCon.size((Resource)null));\r\n\t\t\tAssert.assertEquals(\"Size of repository must be 4\",4, testAdminCon.size(dirgraph,null));\r\n\t\t\ttestAdminCon.commit();\t\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\t\r\n\t\t}\r\n\t\tfinally{\r\n\t\t\tif (testAdminCon.isActive())\r\n\t\t\t\ttestAdminCon.rollback();\r\n\t\t}\r\n\t\tAssert.assertEquals(\"Size of repository must be 4\",4, testAdminCon.size(dirgraph1,null));\r\n\t\tAssert.assertEquals(1, testAdminCon.size(null));\r\n\t\tAssert.assertEquals(1, testAdminCon.size(null, null));\r\n\t\tAssert.assertEquals(3, testAdminCon.size(dirgraph, dirgraph));\r\n\t\t\r\n\t\r\n\t\tassertTrue(\"Repository should contain statement\", testAdminCon.hasStatement(john, homeTel, johnhomeTel, false));\r\n\t\tassertTrue(\"Repository should contain statement in dirgraph1\",\r\n\t\t\t\ttestAdminCon.hasStatement(micah, lname, micahlname, false, dirgraph1));\r\n\t\tassertFalse(\"Repository should not contain statement in context2\",\r\n\t\t\t\ttestAdminCon.hasStatement(micah, lname, micahlname, false, dirgraph));\r\n\r\n\t\t// Check handling of getStatements without context IDs\r\n\t\tRepositoryResult<Statement> result = testAdminCon.getStatements(micah, lname, null, false);\r\n\t\ttry {\r\n\t\t\twhile (result.hasNext()) {\r\n\t\t\t\tStatement st = result.next();\r\n\t\t\t\tassertThat(st.getSubject(), is(equalTo((Resource)micah)));\r\n\t\t\t\tassertThat(st.getPredicate(), is(equalTo(lname)));\r\n\t\t\t\tassertThat(st.getObject(), is(equalTo((Value)micahlname)));\r\n\t\t\t\tassertThat(st.getContext(), is(equalTo((Resource)dirgraph1)));\r\n\t\t\t}\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tresult.close();\r\n\t\t}\r\n\r\n\t\t// Check handling of getStatements with a known context ID\r\n\t\tresult = testAdminCon.getStatements(null, null, null, false, dirgraph);\r\n\t\ttry {\r\n\t\t\twhile (result.hasNext()) {\r\n\t\t\t\tStatement st = result.next();\r\n\t\t\t\tassertThat(st.getContext(), is(equalTo((Resource)dirgraph)));\r\n\t\t\t}\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tresult.close();\r\n\t\t}\r\n\t\r\n\t\t\r\n\t\t// Check handling of getStatements with null context\r\n\t\tresult = testAdminCon.getStatements(null, null, null, false, null);\r\n\t\tassertThat(result, is(notNullValue()));\r\n\t\ttry {\r\n\t\t\twhile (result.hasNext()) {\r\n\t\t\t\tStatement st = result.next();\r\n\t\t\t\tassertThat(st.getContext(), is(equalTo((Resource)null)));\r\n\t\t\t}\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tresult.close();\r\n\t\t}\r\n\t\t\r\n\t\t// Check handling of getStatements with an unknown context ID\r\n\t\tresult = testAdminCon.getStatements(null, null, null, false, vf.createURI(\":unknownContext\"));\r\n\t\ttry {\r\n\t\t\tassertThat(result, is(notNullValue()));\r\n\t\t\tassertThat(result.hasNext(), is(equalTo(false)));\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tresult.close();\r\n\t\t}\r\n\r\n\t\tList<Statement> list = Iterations.addAll(testAdminCon.getStatements(null, lname, null, false, dirgraph1),\r\n\t\t\t\tnew ArrayList<Statement>());\r\n\t\tassertNotNull(\"List should not be null\", list);\r\n\t\tassertFalse(\"List should not be empty\", list.isEmpty());\r\n\t\t\r\n\t\tList<Statement> list1 = Iterations.addAll(testAdminCon.getStatements(dirgraph, null, null, false, null),\r\n\t\t\t\tnew ArrayList<Statement>());\r\n\t\tassertNotNull(\"List should not be null\", list1);\r\n\t\tassertFalse(\"List should not be empty\", list1.isEmpty());\r\n\t\t\r\n\t}", "@Test\n public void example10 () throws Exception {\n ValueFactory f = repo.getValueFactory();\n String exns = \"http://example.org/people/\";\n URI alice = f.createURI(exns, \"alice\");\n URI bob = f.createURI(exns, \"bob\");\n URI ted = f.createURI(exns, \"ted\"); \n URI person = f.createURI(\"http://example.org/ontology/Person\");\n URI name = f.createURI(\"http://example.org/ontology/name\");\n Literal alicesName = f.createLiteral(\"Alice\");\n Literal bobsName = f.createLiteral(\"Bob\");\n Literal tedsName = f.createLiteral(\"Ted\"); \n URI context1 = f.createURI(exns, \"cxt1\"); \n URI context2 = f.createURI(exns, \"cxt2\"); \n conn.add(alice, RDF.TYPE, person, context1);\n conn.add(alice, name, alicesName, context1);\n conn.add(bob, RDF.TYPE, person, context2);\n conn.add(bob, name, bobsName, context2);\n conn.add(ted, RDF.TYPE, person);\n conn.add(ted, name, tedsName);\n \n assertSetsEqual(\n stmts(new Stmt[] {\n new Stmt(alice, RDF.TYPE, person, context1),\n new Stmt(alice, name, alicesName, context1),\n new Stmt(bob, RDF.TYPE, person, context2),\n new Stmt(bob, name, bobsName, context2),\n new Stmt(ted, RDF.TYPE, person),\n new Stmt(ted, name, tedsName)\n }),\n statementSet(conn.getStatements(null, null, null, false)));\n assertSetsEqual(\n stmts(new Stmt[] {\n new Stmt(alice, RDF.TYPE, person, context1),\n new Stmt(alice, name, alicesName, context1),\n new Stmt(bob, RDF.TYPE, person, context2),\n new Stmt(bob, name, bobsName, context2)\n }),\n statementSet(conn.getStatements(null, null, null, false, context1, context2)));\n assertSetsEqual(\n stmts(new Stmt[] {\n new Stmt(bob, RDF.TYPE, person, context2),\n new Stmt(bob, name, bobsName, context2),\n new Stmt(ted, RDF.TYPE, person),\n new Stmt(ted, name, tedsName)\n }),\n statementSet(conn.getStatements(null, null, null, false, null, context2)));\n \n // testing named graph query\n DatasetImpl ds = new DatasetImpl();\n ds.addNamedGraph(context1);\n ds.addNamedGraph(context2);\n TupleQuery tupleQuery = conn.prepareTupleQuery(\n QueryLanguage.SPARQL, \"SELECT ?s ?p ?o ?g WHERE { GRAPH ?g {?s ?p ?o . } }\");\n tupleQuery.setDataset(ds);\n assertSetsEqual(\n stmts(new Stmt[] {\n new Stmt(alice, RDF.TYPE, person, context1),\n new Stmt(alice, name, alicesName, context1),\n new Stmt(bob, RDF.TYPE, person, context2),\n new Stmt(bob, name, bobsName, context2)\n }),\n statementSet(tupleQuery.evaluate()));\n \n ds = new DatasetImpl();\n ds.addDefaultGraph(null);\n tupleQuery = conn.prepareTupleQuery(QueryLanguage.SPARQL, \"SELECT ?s ?p ?o WHERE {?s ?p ?o . }\");\n tupleQuery.setDataset(ds);\n assertSetsEqual(\n stmts(new Stmt[] {\n new Stmt(ted, RDF.TYPE, person),\n new Stmt(ted, name, tedsName)\n }),\n statementSet(tupleQuery.evaluate()));\n }", "NodeConnection createNodeConnection();", "public interface NeoDatisObject extends Serializable{\n\tvoid setNeoDatisContext(NeoDatisContext context);\n\tNeoDatisContext getNeoDatisContext();\n}", "@Test\r\n\tpublic void testPrepareGraphQuery3() throws Exception\r\n\t{\r\n\t\tStatement st1 = vf.createStatement(john, fname, johnfname, dirgraph);\r\n\t\tStatement st2 = vf.createStatement(john, lname, johnlname, dirgraph);\r\n\t\tStatement st3 = vf.createStatement(john, homeTel, johnhomeTel, dirgraph);\r\n\t\tStatement st4 = vf.createStatement(john, email, johnemail, dirgraph);\r\n\t\tStatement st5 = vf.createStatement(micah, fname, micahfname, dirgraph);\r\n\t\tStatement st6 = vf.createStatement(micah, lname, micahlname, dirgraph);\r\n\t\tStatement st7 = vf.createStatement(micah, homeTel, micahhomeTel, dirgraph);\r\n\t\tStatement st8 = vf.createStatement(fei, fname, feifname, dirgraph);\r\n\t\tStatement st9 = vf.createStatement(fei, lname, feilname, dirgraph);\r\n\t\tStatement st10 = vf.createStatement(fei, email, feiemail, dirgraph);\r\n\t\t\r\n\t\r\n\t\ttestWriterCon.add(st1);\r\n\t\ttestWriterCon.add(st2);\r\n\t\ttestWriterCon.add(st3);\r\n\t\ttestWriterCon.add(st4);\r\n\t\ttestWriterCon.add(st5);\r\n\t\ttestWriterCon.add(st6);\r\n\t\ttestWriterCon.add(st7);\r\n\t\ttestWriterCon.add(st8);\r\n\t\ttestWriterCon.add(st9);\r\n\t\ttestWriterCon.add(st10);\r\n\t\t\r\n\t\tAssert.assertTrue(testWriterCon.hasStatement(st1, false));\r\n\t\tAssert.assertFalse(testWriterCon.hasStatement(st1, false, (Resource)null));\r\n\t\tAssert.assertFalse(testWriterCon.hasStatement(st1, false, null));\r\n\t\tAssert.assertTrue(testWriterCon.hasStatement(st1, false, dirgraph));\r\n\t\t\r\n\t\t\r\n\t\tAssert.assertEquals(10, testAdminCon.size(dirgraph));\t\t\r\n\t\t\t\r\n\t\tString query = \" DESCRIBE <http://marklogicsparql.com/addressbook#firstName> \";\r\n\t\tGraphQuery queryObj = testReaderCon.prepareGraphQuery(query);\r\n\t\t\t\r\n\t\tGraphQueryResult result = queryObj.evaluate();\r\n\t\tresult.hasNext();\r\n\t\ttry {\r\n\t\t\tassertThat(result, is(notNullValue()));\r\n\t\t\tassertThat(result.hasNext(), is(equalTo(false)));\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tresult.close();\r\n\t\t}\r\n\t}", "@Test\r\n public void testGraphPerms1()\r\n throws Exception {\r\n\r\n GraphManager gmgr = databaseClient.newGraphManager();\r\n createUserRolesWithPrevilages(\"test-role\");\r\n GraphPermissions gr = testAdminCon.getDefaultGraphPerms();\r\n \r\n // ISSUE # 175 uncomment after issue is fixed\r\n Assert.assertEquals(0L, gr.size());\r\n \r\n testAdminCon.setDefaultGraphPerms(gmgr.permission(\"test-role\", Capability.READ, Capability.UPDATE));\r\n String defGraphQuery = \"CREATE GRAPH <http://marklogic.com/test/graph/permstest> \";\r\n MarkLogicUpdateQuery updateQuery = testAdminCon.prepareUpdate(QueryLanguage.SPARQL, defGraphQuery);\r\n updateQuery.execute();\r\n \r\n String defGraphQuery1 = \"INSERT DATA { GRAPH <http://marklogic.com/test/graph/permstest> { <http://marklogic.com/test1> <pp2> \\\"test\\\" } }\";\r\n String checkQuery = \"ASK WHERE { GRAPH <http://marklogic.com/test/graph/permstest> {<http://marklogic.com/test> <pp2> \\\"test\\\" }}\";\r\n MarkLogicUpdateQuery updateQuery1 = testAdminCon.prepareUpdate(QueryLanguage.SPARQL, defGraphQuery1);\r\n updateQuery1.execute();\r\n \r\n BooleanQuery booleanQuery = testAdminCon.prepareBooleanQuery(QueryLanguage.SPARQL, checkQuery);\r\n boolean results = booleanQuery.evaluate();\r\n Assert.assertEquals(false, results);\r\n \r\n gr = testAdminCon.getDefaultGraphPerms();\r\n Assert.assertEquals(1L, gr.size());\r\n Iterator<Entry<String, Set<Capability>>> resultPerm = gr.entrySet().iterator();\r\n while(resultPerm.hasNext()){\r\n \t Entry<String, Set<Capability>> perms = resultPerm.next();\r\n \t Assert.assertTrue(\"test-role\" == perms.getKey());\r\n \t Iterator<Capability> capability = perms.getValue().iterator();\r\n \t while (capability.hasNext())\r\n \t\t assertThat(capability.next().toString(), anyOf(equalTo(\"UPDATE\"), is(equalTo(\"READ\"))));\r\n }\r\n \r\n String defGraphQuery2 = \"CREATE GRAPH <http://marklogic.com/test/graph/permstest1> \";\r\n testAdminCon.setDefaultGraphPerms(null);\r\n updateQuery = testAdminCon.prepareUpdate(QueryLanguage.SPARQL, defGraphQuery2);\r\n updateQuery.execute();\r\n gr = testAdminCon.getDefaultGraphPerms();\r\n Assert.assertEquals(0L, gr.size());\r\n \r\n \r\n createUserRolesWithPrevilages(\"multitest-role\");\r\n testAdminCon.setDefaultGraphPerms(gmgr.permission(\"multitest-role\", Capability.READ).permission(\"test-role\", Capability.UPDATE));\r\n defGraphQuery = \"CREATE GRAPH <http://marklogic.com/test/graph/permstest2> \";\r\n updateQuery = testAdminCon.prepareUpdate(QueryLanguage.SPARQL, defGraphQuery);\r\n updateQuery.execute();\r\n gr = testAdminCon.getDefaultGraphPerms();\r\n Assert.assertEquals(2L, gr.size());\r\n testAdminCon.setDefaultGraphPerms(null);\r\n testAdminCon.setDefaultGraphPerms(null);\r\n // ISSUE 180\r\n //testAdminCon.setDefaultGraphPerms((GraphPermissions)null);\r\n gr = testAdminCon.getDefaultGraphPerms();\r\n Assert.assertEquals(0L, gr.size());\r\n \r\n \r\n }", "public void loadEdge()\r\n {\r\n town.createConnection();\r\n }", "protected abstract Graph fetchGraph() throws IdNotFoundException;", "public static void main( String args[] )\n {\n DbUtils.delete( PATH );\n graphDb = new EmbeddedGraphDatabase( PATH );\n\n // Start a transaction (every operation performed on the graph needs\n // to be in a transactional context.\n Transaction tx = graphDb.beginTx();\n try\n {\n // Set up the matrix and all its social connections\n Node thomasAnderson = setupMatrix();\n \n // Query it for information\n printFriends( thomasAnderson );\n printHackers( thomasAnderson );\n \n // Let Neo4j know that the transaction was successful\n tx.success();\n }\n finally\n {\n // Finish the transaction and shutdown Neo4j\n tx.finish();\n graphDb.shutdown();\n }\n }", "@Test public void gh1197() {\n execute(new CreateDB(NAME));\n execute(new Add(\"a.xml\", \"<a><b/><b/></a>\"));\n execute(new Add(\"a.xml\", \"<c><b/></c>\"));\n query(\"//b[/a]\", \"<b/>\\n<b/>\");\n }", "public interface GoodreadsRecRepository extends GraphRepository<GoodreadsRecRelationship> {\n\n @Query(\"MATCH (user:User) - [grec:GR_REC {friendGoodreadsId:{0}}]-(book: Book) return grec\")\n public List<GoodreadsRecRelationship> getGoodreadsRecById(Integer goodreadsId);\n\n}", "public interface TradeoffRepository extends GraphRepository<Tradeoff> {\n\n /**\n * Problem occured here, because in the testdata there were multiple tradeoffs with the same over and under -> should not be possible\n * Limit 1 for making sure that only 1 Tradeoff is within the result set.\n * @param idTradeoffItemOver Which Tradeoffitem Over\n * @param idTradeoffItemUnder Which Tradeoffitem Under\n * @return\n */\n @Query(\"MATCH (t:Tradeoff)-[:UNDER]->(under:TradeoffItem), (t)-[:OVER]->(over:TradeoffItem) where id(under) = {1} and id(over) = {0} WITH t LIMIT 1 RETURN t\")\n Tradeoff findTradeoffByTradeoffItems(Long idTradeoffItemOver, Long idTradeoffItemUnder);\n\n}", "private void addRelationship(String node1, String node2, String relation)\n {\n try (Session session = driver.session())\n {\n // Wrapping Cypher in an explicit transaction provides atomicity\n // and makes handling errors much easier.\n try (Transaction tx = session.beginTransaction())\n {\n tx.run(\"MATCH (j:Node {value: {x}})\\n\" +\n \"MATCH (k:Node {value: {y}})\\n\" +\n \"MERGE (j)-[r:\" + relation + \"]->(k)\", parameters(\"x\", node1, \"y\", node2));\n tx.success(); // Mark this write as successful.\n }\n }\n }", "public void ExecuteCypherQueryNoReturn(String cypherQuery) {\r\n\t\tExecutionEngine engine = new ExecutionEngine( _db );\r\n\t\tExecutionResult result = null;\r\n\t\tTransaction tx = _db.beginTx();\r\n\t\ttry {\r\n\t\t engine.execute(cypherQuery);\r\n\t\t tx.success();\r\n\t\t} catch (Exception ex) {\r\n\t\t\tex.printStackTrace();\r\n\t\t\tSystem.out.print(\"issues with fetching node and its relations\");\r\n\t\t\ttx.failure();\r\n\t\t\t//return \"failed\";\r\n\t\t} finally {\r\n\t\t\ttx.close();\r\n\t\t}\r\n\t}", "public void testaGraph() {\n\t\tEstacaoDAO a = new EstacaoDAO();\n\t\ta.carregarEstacoes();\n\t\tLinha b = new Linha(\"a\");\n\t\tb.loadAllStations(a);\n\t\tb.shortestPath(a,\"Curado\",\"Recife\");\n\t}", "@Test public void gh1202() {\n execute(new CreateDB(NAME, \"<x/>\"));\n query(\"let $x := 'e' return element e {} / self::e[name() = $x]\", \"<e/>\");\n query(\"let $x := 'f' return element f {} ! self::f[name() = $x]\", \"<f/>\");\n }", "@Test\n public void example13 () throws Exception {\n Map<String, Stmt> inputs = example2setup();\n conn.setNamespace(\"ex\", \"http://example.org/people/\");\n conn.setNamespace(\"ont\", \"http://example.org/ontology/\");\n String prefix = \"PREFIX ont: \" + \"<http://example.org/ontology/>\\n\";\n \n String queryString = \"select ?s ?p ?o where { ?s ?p ?o} \";\n TupleQuery tupleQuery = conn.prepareTupleQuery(QueryLanguage.SPARQL, queryString);\n assertSetsEqual(\"SELECT result:\", inputs.values(),\n statementSet(tupleQuery.evaluate()));\n \n assertTrue(\"Boolean result\",\n conn.prepareBooleanQuery(QueryLanguage.SPARQL,\n prefix + \n \"ask { ?s ont:name \\\"Alice\\\" } \").evaluate());\n assertFalse(\"Boolean result\",\n conn.prepareBooleanQuery(QueryLanguage.SPARQL,\n prefix + \n \"ask { ?s ont:name \\\"NOT Alice\\\" } \").evaluate());\n \n queryString = \"construct {?s ?p ?o} where { ?s ?p ?o . filter (?o = \\\"Alice\\\") } \";\n GraphQuery constructQuery = conn.prepareGraphQuery(QueryLanguage.SPARQL, queryString);\n assertSetsEqual(\"Construct result\",\n mapKeep(new String[] {\"an\"}, inputs).values(),\n statementSet(constructQuery.evaluate()));\n \n queryString = \"describe ?s where { ?s ?p ?o . filter (?o = \\\"Alice\\\") } \";\n GraphQuery describeQuery = conn.prepareGraphQuery(QueryLanguage.SPARQL, queryString);\n assertSetsEqual(\"Describe result\",\n mapKeep(new String[] {\"an\", \"at\"}, inputs).values(),\n statementSet(describeQuery.evaluate()));\n }", "private void addNode(String name)\n {\n try (Session session = driver.session())\n {\n // Wrapping Cypher in an explicit transaction provides atomicity\n // and makes handling errors much easier.\n try (Transaction tx = session.beginTransaction())\n {\n tx.run(\"MERGE (a:Node {value: {x}})\", parameters(\"x\", name));\n tx.success(); // Mark this write as successful.\n }\n }\n }", "@RepositoryRestResource(collectionResourceRel = \"User\", path = \"User\")\npublic interface UserRepository extends Neo4jRepository<User, Long> {\n\n @Query(value = \"MATCH (a:User),(b:Report)\\n\" +\n \"WHERE a.username = :#{#username} AND ID(b) = :#{#reportId}\\n\" +\n \"CREATE (a)-[r:REPORT]->(b)\")\n @Transactional\n void createReportRelationship(@Param(\"username\") String username, @Param(\"reportId\") Long reportId);\n}", "public OrientGraph getGraphTx();", "public ArangoDBVertex() {\n\t\tsuper();\n\t}", "public static void main(String[] args) {\n graph.addEdge(\"Mumbai\",\"Warangal\");\n graph.addEdge(\"Warangal\",\"Pennsylvania\");\n graph.addEdge(\"Pennsylvania\",\"California\");\n //graph.addEdge(\"Montevideo\",\"Jameka\");\n\n\n String sourceNode = \"Pennsylvania\";\n\n if(graph.isGraphConnected(sourceNode)){\n System.out.println(\"Yes\");\n } else {\n System.out.println(\"No\");\n }\n }", "private Cypher() {\n\t}", "public interface ActorRepository extends Neo4jRepository<Actor, Long> {\n\n\t\n\t@Query(\"MATCH (p:Actor) WHERE lower(p.name) CONTAINS lower($name) or lower(p.fullName) CONTAINS lower($name) RETURN p ORDER BY p.name\")\n\tCollection<Actor> findByNameLike(@Param(\"name\") String name);\n\n\t\n\t\n}", "@Test\r\n void test_insert_1_vertex_check() {\r\n graph.addVertex(\"1\");\r\n vertices = graph.getAllVertices();\r\n if (!vertices.contains(\"1\"))\r\n fail(\"Insert not working!!\");\r\n }", "void createGraphForDistributedSingleLoad();", "public void init(GraphDatabaseService store) {\n\n\t\tlog.info(\"creating Neo indices\");\n\n\t\ttry (Transaction tx = store.beginTx()) {\n\n\t\t\tstore.schema().indexFor(IDENTITY).on(name_prop).create();\n\t\t\tstore.schema().indexFor(CODELIST).on(id_prop).create();\n\t\t\tstore.schema().indexFor(ATTRDEF).on(id_prop).create();\n\t\t\tstore.schema().indexFor(LINKDEF).on(id_prop).create();\n\t\t\tstore.schema().indexFor(USER).on(name_prop).create();\n\t\t\tstore.schema().indexFor(LIFECYCLE).on(id_prop).create();\n\t\t\tstore.schema().indexFor(LOGBOOK).on(id_prop).create();\n\n\t\t\ttx.success();\n\t\t}\n\n\t}", "entities.Torrent.NodeId getNode();", "entities.Torrent.NodeId getNode();", "public static void main(String[] args) throws Exception {\n TDB.setOptimizerWarningFlag(false);\n\n final String DATASET_DIR_NAME = \"data0\";\n final Dataset data0 = TDBFactory.createDataset( DATASET_DIR_NAME );\n\n // show the currently registered names\n for (Iterator<String> it = data0.listNames(); it.hasNext(); ) {\n out.println(\"NAME=\"+it.next());\n }\n\n out.println(\"getting named model...\");\n /// this is the OWL portion\n final Model model = data0.getNamedModel( MY_NS );\n out.println(\"Model := \"+model);\n\n out.println(\"getting graph...\");\n /// this is the DATA in that MODEL\n final Graph graph = model.getGraph();\n out.println(\"Graph := \"+graph);\n\n if (graph.isEmpty()) {\n final Resource product1 = model.createResource( MY_NS +\"product/1\");\n final Property hasName = model.createProperty( MY_NS, \"#hasName\");\n final Statement stmt = model.createStatement(\n product1, hasName, model.createLiteral(\"Beach Ball\",\"en\") );\n out.println(\"Statement = \" + stmt);\n\n model.add(stmt);\n\n // just for fun\n out.println(\"Triple := \" + stmt.asTriple().toString());\n } else {\n out.println(\"Graph is not Empty; it has \"+graph.size()+\" Statements\");\n long t0, t1;\n t0 = System.currentTimeMillis();\n final Query q = QueryFactory.create(\n \"PREFIX exns: <\"+MY_NS+\"#>\\n\"+\n \"PREFIX exprod: <\"+MY_NS+\"product/>\\n\"+\n \" SELECT * \"\n // if you don't provide the Model to the\n // QueryExecutionFactory below, then you'll need\n // to specify the FROM;\n // you *can* always specify it, if you want\n // +\" FROM <\"+MY_NS+\">\\n\"\n // +\" WHERE { ?node <\"+MY_NS+\"#hasName> ?name }\"\n // +\" WHERE { ?node exns:hasName ?name }\"\n // +\" WHERE { exprod:1 exns:hasName ?name }\"\n +\" WHERE { ?res ?pred ?obj }\"\n );\n out.println(\"Query := \"+q);\n t1 = System.currentTimeMillis();\n out.println(\"QueryFactory.TIME=\"+(t1 - t0));\n\n t0 = System.currentTimeMillis();\n try ( QueryExecution qExec = QueryExecutionFactory\n // if you query the whole DataSet,\n // you have to provide a FROM in the SparQL\n //.create(q, data0);\n .create(q, model) ) {\n t1 = System.currentTimeMillis();\n out.println(\"QueryExecutionFactory.TIME=\"+(t1 - t0));\n\n t0 = System.currentTimeMillis();\n ResultSet rs = qExec.execSelect();\n t1 = System.currentTimeMillis();\n out.println(\"executeSelect.TIME=\"+(t1 - t0));\n while (rs.hasNext()) {\n QuerySolution sol = rs.next();\n out.println(\"Solution := \"+sol);\n for (Iterator<String> names = sol.varNames(); names.hasNext(); ) {\n final String name = names.next();\n out.println(\"\\t\"+name+\" := \"+sol.get(name));\n }\n }\n }\n }\n out.println(\"closing graph\");\n graph.close();\n out.println(\"closing model\");\n model.close();\n //out.println(\"closing DataSetGraph\");\n //dsg.close();\n out.println(\"closing DataSet\");\n data0.close();\n }", "public static void main(String args[]) {\n Model model = ModelFactory.createDefaultModel(); \n\n//set namespace\n Resource NAMESPACE = model.createResource( relationshipUri );\n \tmodel.setNsPrefix( \"rela\", relationshipUri);\n \n// Create the types of Property we need to describe relationships in the model\n Property childOf = model.createProperty(relationshipUri,\"childOf\"); \n Property siblingOf = model.createProperty(relationshipUri,\"siblingOf\");\n Property spouseOf = model.createProperty(relationshipUri,\"spouseOf\");\n Property parentOf = model.createProperty(relationshipUri,\"parentOf\"); \n \n \n// Create resources representing the people in our model\n Resource Siddharth = model.createResource(familyUri+\"Siddharth\");\n Resource Dhvanit = model.createResource(familyUri+\"Dhvanit\");\n Resource Rekha = model.createResource(familyUri+\"Rekha\");\n Resource Sandeep = model.createResource(familyUri+\"Sandeep\");\n Resource Kanchan = model.createResource(familyUri+\"Kanchan\");\n Resource Pihu = model.createResource(familyUri+\"Pihu\");\n Resource DwarkaPrasad = model.createResource(familyUri+\"Dwarkesh\");\n Resource Shakuntala = model.createResource(familyUri+\"Shakuntala\");\n Resource Santosh = model.createResource(familyUri+\"Santosh\");\n Resource Usha = model.createResource(familyUri+\"Usha\");\n Resource Priyadarshan = model.createResource(familyUri+\"Priyadarshan\");\n Resource Sudarshan = model.createResource(familyUri+\"Sudarshan\");\n Resource Pragya = model.createResource(familyUri+\"Pragya\");\n Resource Shailendra = model.createResource(familyUri+\"Shailendra\");\n Resource Rajni = model.createResource(familyUri+\"Rajni\");\n Resource Harsh = model.createResource(familyUri+\"Harsh\");\n Resource Satendra = model.createResource(familyUri+\"Satendra\");\n Resource Vandana = model.createResource(familyUri+\"Vandana\");\n Resource Priyam = model.createResource(familyUri+\"Priyam\");\n Resource Darshan = model.createResource(familyUri+\"Darshan\");\n Resource Vardhan = model.createResource(familyUri+\"Vardhan\");\n \n List<Statement> list = new ArrayList(); \n list.add(model.createStatement(Dhvanit,spouseOf,Kanchan)); \n list.add(model.createStatement(Sandeep,spouseOf,Rekha)); \n list.add(model.createStatement(DwarkaPrasad,spouseOf,Shakuntala)); \n list.add(model.createStatement(Santosh,spouseOf,Usha)); \n list.add(model.createStatement(Shailendra,spouseOf,Rajni)); \n list.add(model.createStatement(Satendra,spouseOf,Vandana)); \n list.add(model.createStatement(Sandeep,childOf,DwarkaPrasad)); \n list.add(model.createStatement(Sandeep,childOf,Shakuntala)); \n list.add(model.createStatement(Santosh,childOf,DwarkaPrasad)); \n list.add(model.createStatement(Santosh,childOf,Shakuntala)); \n list.add(model.createStatement(Shailendra,childOf,DwarkaPrasad)); \n list.add(model.createStatement(Shailendra,childOf,Shakuntala)); \n list.add(model.createStatement(Satendra,childOf,DwarkaPrasad)); \n list.add(model.createStatement(Satendra,childOf,Shakuntala)); \n list.add(model.createStatement(DwarkaPrasad,parentOf,Sandeep)); \n list.add(model.createStatement(DwarkaPrasad,parentOf,Santosh)); \n list.add(model.createStatement(DwarkaPrasad,parentOf,Shailendra)); \n list.add(model.createStatement(DwarkaPrasad,parentOf,Satendra)); \n list.add(model.createStatement(Shakuntala,parentOf,Sandeep)); \n list.add(model.createStatement(Shakuntala,parentOf,Santosh)); \n list.add(model.createStatement(Shakuntala,parentOf,Shailendra)); \n list.add(model.createStatement(Shakuntala,parentOf,Satendra)); \n list.add(model.createStatement(Sandeep,parentOf,Siddharth)); \n list.add(model.createStatement(Sandeep,parentOf,Dhvanit)); \n list.add(model.createStatement(Rekha,parentOf,Siddharth)); \n list.add(model.createStatement(Rekha,parentOf,Dhvanit)); \n list.add(model.createStatement(Siddharth,childOf,Rekha)); \n list.add(model.createStatement(Dhvanit,childOf,Rekha)); \n list.add(model.createStatement(Siddharth,childOf,Sandeep)); \n list.add(model.createStatement(Dhvanit,childOf,Sandeep)); \n list.add(model.createStatement(Harsh,childOf,Shailendra)); \n list.add(model.createStatement(Harsh,childOf,Rajni)); \n list.add(model.createStatement(Shailendra,parentOf,Harsh)); \n list.add(model.createStatement(Rajni,parentOf,Harsh)); \n list.add(model.createStatement(Santosh,parentOf,Priyadarshan)); \n list.add(model.createStatement(Santosh,parentOf,Sudarshan));\n list.add(model.createStatement(Santosh,parentOf,Pragya));\n list.add(model.createStatement(Usha,parentOf,Priyadarshan)); \n list.add(model.createStatement(Usha,parentOf,Sudarshan));\n list.add(model.createStatement(Usha,parentOf,Pragya));\n list.add(model.createStatement(Priyadarshan,childOf,Santosh));\n list.add(model.createStatement(Pragya,childOf,Santosh));\n list.add(model.createStatement(Sudarshan,childOf,Santosh));\n list.add(model.createStatement(Priyadarshan,childOf,Usha));\n list.add(model.createStatement(Pragya,childOf,Usha));\n list.add(model.createStatement(Sudarshan,childOf,Usha));\n list.add(model.createStatement(Satendra,parentOf,Priyam)); \n list.add(model.createStatement(Satendra,parentOf,Darshan));\n list.add(model.createStatement(Satendra,parentOf,Vardhan));\n list.add(model.createStatement(Vandana,parentOf,Priyam)); \n list.add(model.createStatement(Vandana,parentOf,Darshan));\n list.add(model.createStatement(Vandana,parentOf,Vardhan));\n list.add(model.createStatement(Priyam,childOf,Satendra));\n list.add(model.createStatement(Darshan,childOf,Satendra));\n list.add(model.createStatement(Vardhan,childOf,Satendra));\n list.add(model.createStatement(Priyam,childOf,Vandana));\n list.add(model.createStatement(Darshan,childOf,Vandana));\n list.add(model.createStatement(Vardhan,childOf,Vandana));\n list.add(model.createStatement(Pihu,childOf,Dhvanit));\n list.add(model.createStatement(Pihu,childOf,Kanchan));\n list.add(model.createStatement(Dhvanit,parentOf,Pihu));\n list.add(model.createStatement(Kanchan,parentOf,Pihu));\n list.add(model.createStatement(Siddharth,siblingOf,Dhvanit));\n list.add(model.createStatement(Dhvanit,siblingOf,Siddharth)); \n list.add(model.createStatement(Priyadarshan,siblingOf,Sudarshan));\n list.add(model.createStatement(Priyadarshan,siblingOf,Pragya));\n list.add(model.createStatement(Sudarshan,siblingOf,Priyadarshan));\n list.add(model.createStatement(Sudarshan,siblingOf,Pragya));\n list.add(model.createStatement(Pragya,siblingOf,Priyadarshan));\n list.add(model.createStatement(Pragya,siblingOf,Sudarshan)); \n list.add(model.createStatement(Priyam,siblingOf,Darshan));\n list.add(model.createStatement(Priyam,siblingOf,Vardhan)); \n list.add(model.createStatement(Darshan,siblingOf,Vardhan)); \n list.add(model.createStatement(Darshan,siblingOf,Priyam));\n list.add(model.createStatement(Vardhan,siblingOf,Priyam));\n list.add(model.createStatement(Vardhan,siblingOf,Darshan));\n list.add(model.createStatement(Santosh,siblingOf,Sandeep));\n list.add(model.createStatement(Santosh,siblingOf,Shailendra));\n list.add(model.createStatement(Santosh,siblingOf,Satendra));\n list.add(model.createStatement(Sandeep,siblingOf,Santosh));\n list.add(model.createStatement(Sandeep,siblingOf,Shailendra));\n list.add(model.createStatement(Sandeep,siblingOf,Satendra));\n list.add(model.createStatement(Shailendra,siblingOf,Santosh));\n list.add(model.createStatement(Shailendra,siblingOf,Sandeep));\n list.add(model.createStatement(Shailendra,siblingOf,Satendra));\n list.add(model.createStatement(Satendra,siblingOf,Shailendra));\n list.add(model.createStatement(Satendra,siblingOf,Santosh));\n list.add(model.createStatement(Satendra,siblingOf,Sandeep));\n \n model.add(list);\n try{\n \t File file=new File(\"/Users/siddharthgupta/Documents/workspace/FamilyModel/src/family/family.rdf\");\n \t \tFileOutputStream f1=new FileOutputStream(file);\n \t \tRDFWriter d = model.getWriter(\"RDF/XML-ABBREV\");\n \t \t\t\td.write(model,f1,null);\n \t\t}catch(Exception e) {}\n }", "@Test\n @org.junit.Ignore\n public void shouldConstructDetachedVertex() {\n }", "@Test\n void shouldNotSeeNonExistingNode() throws Exception\n {\n try ( KernelTransaction tx = beginTransaction() )\n {\n assertFalse( tx.dataRead().nodeExists( 1337L ) );\n }\n }", "void nodeOnline();", "@Override\n protected void load() {\n //recordId can be null when in batchMode\n if (this.recordId != null && this.properties.isEmpty()) {\n this.sqlgGraph.tx().readWrite();\n if (this.sqlgGraph.getSqlDialect().supportsBatchMode() && this.sqlgGraph.tx().getBatchManager().isStreaming()) {\n throw new IllegalStateException(\"streaming is in progress, first flush or commit before querying.\");\n }\n\n //Generate the columns to prevent 'ERROR: cached plan must not change result type\" error'\n //This happens when the schema changes after the statement is prepared.\n @SuppressWarnings(\"OptionalGetWithoutIsPresent\")\n EdgeLabel edgeLabel = this.sqlgGraph.getTopology().getSchema(this.schema).orElseThrow(() -> new IllegalStateException(String.format(\"Schema %s not found\", this.schema))).getEdgeLabel(this.table).orElseThrow(() -> new IllegalStateException(String.format(\"EdgeLabel %s not found\", this.table)));\n StringBuilder sql = new StringBuilder(\"SELECT\\n\\t\");\n sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(\"ID\"));\n appendProperties(edgeLabel, sql);\n List<VertexLabel> outForeignKeys = new ArrayList<>();\n for (VertexLabel vertexLabel : edgeLabel.getOutVertexLabels()) {\n outForeignKeys.add(vertexLabel);\n sql.append(\", \");\n if (vertexLabel.hasIDPrimaryKey()) {\n String foreignKey = vertexLabel.getSchema().getName() + \".\" + vertexLabel.getName() + Topology.OUT_VERTEX_COLUMN_END;\n sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(foreignKey));\n } else {\n int countIdentifier = 1;\n for (String identifier : vertexLabel.getIdentifiers()) {\n PropertyColumn propertyColumn = vertexLabel.getProperty(identifier).orElseThrow(\n () -> new IllegalStateException(String.format(\"identifier %s column must be a property\", identifier))\n );\n PropertyType propertyType = propertyColumn.getPropertyType();\n String[] propertyTypeToSqlDefinition = this.sqlgGraph.getSqlDialect().propertyTypeToSqlDefinition(propertyType);\n int count = 1;\n for (String ignored : propertyTypeToSqlDefinition) {\n if (count > 1) {\n sql.append(sqlgGraph.getSqlDialect().maybeWrapInQoutes(vertexLabel.getFullName() + \".\" + identifier + propertyType.getPostFixes()[count - 2] + Topology.OUT_VERTEX_COLUMN_END));\n } else {\n //The first column existVertexLabel no postfix\n sql.append(sqlgGraph.getSqlDialect().maybeWrapInQoutes(vertexLabel.getFullName() + \".\" + identifier + Topology.OUT_VERTEX_COLUMN_END));\n }\n if (count++ < propertyTypeToSqlDefinition.length) {\n sql.append(\", \");\n }\n }\n if (countIdentifier++ < vertexLabel.getIdentifiers().size()) {\n sql.append(\", \");\n }\n }\n }\n }\n List<VertexLabel> inForeignKeys = new ArrayList<>();\n for (VertexLabel vertexLabel : edgeLabel.getInVertexLabels()) {\n sql.append(\", \");\n inForeignKeys.add(vertexLabel);\n if (vertexLabel.hasIDPrimaryKey()) {\n String foreignKey = vertexLabel.getSchema().getName() + \".\" + vertexLabel.getName() + Topology.IN_VERTEX_COLUMN_END;\n sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(foreignKey));\n } else {\n int countIdentifier = 1;\n for (String identifier : vertexLabel.getIdentifiers()) {\n PropertyColumn propertyColumn = vertexLabel.getProperty(identifier).orElseThrow(\n () -> new IllegalStateException(String.format(\"identifier %s column must be a property\", identifier))\n );\n PropertyType propertyType = propertyColumn.getPropertyType();\n String[] propertyTypeToSqlDefinition = this.sqlgGraph.getSqlDialect().propertyTypeToSqlDefinition(propertyType);\n int count = 1;\n for (String ignored : propertyTypeToSqlDefinition) {\n if (count > 1) {\n sql.append(sqlgGraph.getSqlDialect().maybeWrapInQoutes(vertexLabel.getFullName() + \".\" + identifier + propertyType.getPostFixes()[count - 2] + Topology.IN_VERTEX_COLUMN_END));\n } else {\n //The first column existVertexLabel no postfix\n sql.append(sqlgGraph.getSqlDialect().maybeWrapInQoutes(vertexLabel.getFullName() + \".\" + identifier + Topology.IN_VERTEX_COLUMN_END));\n }\n if (count++ < propertyTypeToSqlDefinition.length) {\n sql.append(\", \");\n }\n }\n if (countIdentifier++ < vertexLabel.getIdentifiers().size()) {\n sql.append(\", \");\n }\n }\n }\n }\n sql.append(\"\\nFROM\\n\\t\");\n sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(this.schema));\n sql.append(\".\");\n sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(EDGE_PREFIX + this.table));\n sql.append(\" WHERE \");\n //noinspection Duplicates\n if (edgeLabel.hasIDPrimaryKey()) {\n sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(\"ID\"));\n sql.append(\" = ?\");\n } else {\n int count = 1;\n for (String identifier : edgeLabel.getIdentifiers()) {\n sql.append(this.sqlgGraph.getSqlDialect().maybeWrapInQoutes(identifier));\n sql.append(\" = ?\");\n if (count++ < edgeLabel.getIdentifiers().size()) {\n sql.append(\" AND \");\n }\n\n }\n }\n if (this.sqlgGraph.getSqlDialect().needsSemicolon()) {\n sql.append(\";\");\n }\n Connection conn = this.sqlgGraph.tx().getConnection();\n if (logger.isDebugEnabled()) {\n logger.debug(sql.toString());\n }\n try (PreparedStatement preparedStatement = conn.prepareStatement(sql.toString())) {\n if (edgeLabel.hasIDPrimaryKey()) {\n preparedStatement.setLong(1, this.recordId.sequenceId());\n } else {\n int count = 1;\n for (Comparable identifierValue : this.recordId.getIdentifiers()) {\n preparedStatement.setObject(count++, identifierValue);\n }\n }\n ResultSet resultSet = preparedStatement.executeQuery();\n if (resultSet.next()) {\n loadResultSet(resultSet, inForeignKeys, outForeignKeys);\n }\n } catch (SQLException e) {\n throw new RuntimeException(e);\n }\n }\n }", "public List<Node> node_list() throws HibernateException \r\n\t\t{ \r\n\t\t\tList <Node> Lista_nodos = null; \r\n\t\t \r\n\t\t try \r\n\t\t { \r\n\t\t iniciaOperacion(); //IMPORTANTE la query: se pide la clase realmnete Cliente! no la tabla que se ha creado\r\n\t\t Lista_nodos= sesion.createQuery(\"FROM Node\").list(); //creamos consulta de la tabla clientes (en plural)!\r\n\t\t }finally \r\n\t\t { \r\n\t\t sesion.close(); \r\n\t\t } \r\n\t\t return Lista_nodos; \r\n\t\t}", "protected void executeSchemaOperations() {\n }", "@Test\n public void shouldHandleDenseNodeWithNoRelationships() throws Exception\n {\n NeoStores stores = mock( NeoStores.class );\n NodeStore nodeStore = mock( NodeStore.class );\n when( stores.getNodeStore() ).thenReturn( nodeStore );\n RelationshipGroupStore relationshipGroupStore = mock( RelationshipGroupStore.class );\n when( stores.getRelationshipGroupStore() ).thenReturn( relationshipGroupStore );\n\n @SuppressWarnings( \"unchecked\" )\n StoreNodeRelationshipCursor cursor = new StoreNodeRelationshipCursor(\n new RelationshipRecord( -1 ),\n stores,\n new RelationshipGroupRecord( -1, -1 ),\n mock( StoreStatement.class ),\n mock( Consumer.class ),\n NO_LOCK_SERVICE );\n\n // WHEN\n cursor.init( true, NO_NEXT_RELATIONSHIP.intValue(), 0, BOTH );\n\n // THEN\n verifyNoMoreInteractions( relationshipGroupStore );\n assertFalse( cursor.next() );\n }", "@Override\n\t/*\n\t * public int checkNodeInDBByCoordinate(Coordinate coordinate) {\n\t * \n\t * ResultSet resultSet = null; int x = coordinate.getX(); int y =\n\t * coordinate.getY(); try {\n\t * \n\t * String checkNodesInDB =\n\t * \"select id from routefinder.node where x=? and y=?\"; pstmt =\n\t * conn.prepareStatement(checkNodesInDB); pstmt.setInt(1, x);\n\t * pstmt.setInt(2, y); resultSet = pstmt.executeQuery(); if\n\t * (resultSet.next()) { return resultSet.getInt(\"id\"); } else {\n\t * System.out.println(\"Cannot find node \" + x + \", \" + y); return -1; } }\n\t * catch (SQLException se) { se.printStackTrace(); return -1; } finally {\n\t * JdbcConnect.resultClose(resultSet, pstmt); } }\n\t */\n\tpublic int checkNodeRelationInDBByNodeRelation(NodeRelation[] nodeRelation) {\n\t\treturn 0;\n\t}", "public long wsadd_node(NodeWS node)\r\n\t\t\t\t{ \r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tlong id = 0; //id de la tabla user (único) \r\n\t\t\t\t Node nodeC = new Node(node.getNode_name(),node.getMAC_address(),node.getPort_number());\r\n\t\t\t\t \r\n\t\t\t\t //User cliente1 = new User(\"[email protected]\", \"gutie33\", 1, \"Luis\",\"677899876\", \"Informatica\"); \r\n\t\t\t\t \r\n\t\t\t\t try \r\n\t\t\t\t { \r\n\t\t\t\t iniciaOperacion(); \r\n\t\t\t\t \r\n\t\t\t\t id= (Long) sesion.createQuery(\"SELECT u.id_company FROM Company u WHERE u.company_name ='\"+node.getName_company()+\"'\").uniqueResult();\r\n\t\t\t\t Company x = (Company) sesion.load(Company.class, id);\r\n\t\t\t\t x.addNodo(nodeC);\r\n\t\t\t\t \r\n\t\t\t\t\t nodeC.setCompany(x);\r\n\t\t\t\t \r\n\t\t\t\t //sesion.update(compx);\r\n\t\t\t\t \r\n\t\t\t\t \r\n\t\t\t\t //metodo para guardar cliente (del objeto hibernate.sesion) \r\n\t\t\t\t tx.commit(); \r\n\t\t\t\t }catch(HibernateException he) \r\n\t\t\t\t { \r\n\t\t\t\t manejaExcepcion(he);\r\n\t\t\t\t throw he; \r\n\t\t\t\t }finally \r\n\t\t\t\t { \r\n\t\t\t\t \t//Busqueda del id con qu elo ha introducido a la BBDD\r\n\t\t\t\t \tid= (Long) sesion.createQuery(\"SELECT u.id_node FROM Node u WHERE u.node_name ='\"+node.getNode_name()+\"'\").uniqueResult();\r\n\t\t\t\t sesion.close(); \r\n\t\t\t\t } \r\n\t\t\t\t return id; \r\n\t\t\t\t}", "public Graph getGraph4SingleCores(String nodeId, CustRelationshipMapper custRelationshipMapper, CustPropertyMapper custPropertyMapper) throws CustomException {\n if (StringUtils.isBlank(nodeId)) {\n throw new CustomException(\"[nodeId] is blank null or ' '\");\n }\n\n List<CustRelationship> oneDepthRels = custRelationshipMapper.selectAll1DRelByCertNo(nodeId);\n\n //Map<String, Object> graph = new HashMap<>();\n Graph graph = new Graph();\n if (oneDepthRels.size() == 0) {\n log.info(\"当前1度范围内[边]等于0, 将返回null\");\n graph = new Graph(null, null, StatusCode.NO_MATCHES);\n return graph;\n }\n\n\n\n //仅一度边\n Map<String, Edge> oneDepthEdges = new HashMap<>();\n //一度节点, 含中心\n Map<String, Node> oneDepthNodes = new HashMap<>();\n\n Node core = new Node();\n core.setId(nodeId);\n core.setDepth(0);\n //core 并入 onetDepthNodes\n oneDepthNodes.put(core.getId(), core);\n\n //遍历一度边, 封装数据\n gatherNodeEdge(oneDepthRels, oneDepthEdges, oneDepthNodes,1);\n\n Set<String> oneDepthNodesKeySet = oneDepthNodes.keySet();\n\n //判断一度节点个数, 小于阈值才会继续查询二度边\n if (oneDepthNodes.size() > MAX_DISPLAY_NODES_1D) {\n log.info(\"当前一度范围内[节点]个数大于[{}], 将仅返回一度节点和边数据\", MAX_DISPLAY_NODES_1D);\n\n\n List<CustProperty> custProperties = custPropertyMapper.selectByCertNos(oneDepthNodesKeySet);\n\n //封装点属性\n dumpCustPropertyData(oneDepthNodes, custProperties, 1);\n\n graph.setNodes(oneDepthNodes);\n graph.setEdges(oneDepthEdges);\n return graph;\n }\n\n\n // -- 一度范围节点数量在范围之内, 则获取所有二度边 --\n\n //装所有节点\n HashMap<String, Node> nodes = (HashMap<String, Node>) ((HashMap<String, Node>) oneDepthNodes).clone();\n //装所有的边\n HashMap<String, Edge> edges = (HashMap<String, Edge>) ((HashMap<String, Edge>) oneDepthEdges).clone();\n\n List<CustRelationship> allRel = custRelationshipMapper.selectRelByGivenCertNos(oneDepthNodesKeySet);\n if (allRel.size() > MAX_DISPLAY_EDGES) {\n log.info(\"当前二度范围内[边]总数大于[{}], 仅返回一度节点和边数据\", MAX_DISPLAY_EDGES);\n graph.setNodes(oneDepthNodes);\n graph.setEdges(oneDepthEdges);\n return graph;\n }\n\n // -- 二度范围边在范围之内, 则加工边数据集 --\n\n gatherNodeEdge(allRel, edges, nodes,2);\n /* ABANDON: 抽取\n for (CustRelationship rel : allRel) {\n //Note: oneDepthEdges中已有的, 不用再封装了, 没有的, 创建, 封装, 存入edges中, 且depth==2\n if (oneDepthEdges.get(rel.getId()) == null) {\n Edge edge = new Edge(rel.getId(), rel.getuCertNo(), rel.getvCertNo(), rel.getContent(), rel.getContentType(), rel.getRelationType());\n //新建的边, 说明depth==2\n edge.setDepth(2);\n //存入edges\n edges.put(String.valueOf(edge.getId()), edge);\n }\n\n //遇到新节点, 则存入nodes中, 且深度为2 !注意别存错了!\n gatherNodes(nodes, rel, 2);\n }\n */\n\n //查询所有属性: 核, 一度, 二度\n Set<String> allCertNos = nodes.keySet(); //获取所有身份证号, 查取属性数据\n List<CustProperty> custProperties = custPropertyMapper.selectByCertNos(allCertNos);\n\n //封装属性数据\n dumpCustPropertyData(nodes, custProperties, 2);\n\n //判断节点数目\n if (nodes.size() > MAX_DISPLAY_NODES_2D) {\n //0,1,2度节点之和超过阈值, 则只返回一度节点和边\n log.info(\"当前二度范围内[节点]总数大于[{}], 仅返回一度节点和边数据\", MAX_DISPLAY_NODES_2D);\n\n graph.setNodes(oneDepthNodes);\n graph.setEdges(oneDepthEdges);\n } else {\n //没有超限, 则返回1,2度全部\n log.info(\"返回全部二度范围内节点和边数据\");\n graph.setNodes(nodes);\n graph.setEdges(edges);\n }\n\n\n return graph;\n }", "@Override\n public Set<Edge<PhysicalObject>> getRelationBetweenObjects() {\n assert false : \"shouldn't call this method\";\n return null;\n }", "@Test\r\n void test_insert_same_vertex_twice() {\r\n graph.addVertex(\"1\");\r\n graph.addVertex(\"1\"); \r\n graph.addVertex(\"1\"); \r\n vertices = graph.getAllVertices();\r\n if(vertices.size() != 1 ||graph.order() != 1) {\r\n fail();\r\n }\r\n }", "public static void main(String[] args) {\n\t\t\r\n\r\n\t\tSession se2 = impl.getSe();\r\n\t\tTransaction tx2 = se2.beginTransaction();\r\n\t\t\r\n\t\tString sql = \"SELECT * FROM member\";\r\n\t\tSQLQuery sql1=se2.createSQLQuery(\"SELECT * FROM member\");\r\n\r\n\t\tsql1.addEntity(\"member\",member.class);\r\n\t\t\r\n\t\tList<member> l = sql1.list();\r\n\t\t\r\n\t\tl.forEach(s -> System.out.println(s));\r\n\t\t\r\n\t\tse2.close();\r\n\t\t\r\n\t\t\r\n//\t\t\r\n//\t\t\r\n\r\n\t}", "public void createGraphDB() throws SQLException {\n \t\tString nodes = \"insert into nodes(id,label,url,sex,single) select fbid,name,'http://www.facebook.com/profile.php?id='||fbid,sex,single from users;\";\n \t\tString edges = \"insert into edges select distinct users.fbid as source, friends.friendfbid as target, '5' as weight, 'knows' as name from users join friends where friends.userid=users.id\";\n \t\tpreparedStatement = connect.prepareStatement(nodes);\n \t\tpreparedStatement.execute();\n \t\tpreparedStatement = connect.prepareStatement(edges);\n \t\tpreparedStatement.execute();\n \t\tpreparedStatement.close();\n \t}", "@Override\n @Test\n public void testQuery_invalidAdvancedRankingWithChildrenRankingSignals() throws Exception { }", "@Test\n public void testProcessor () {\n getOrphanTables(1L);\n updateConstraints();\n deleteConstraints(1L);\n\n }", "public void makePreferredOTTOLRelationshipsConflicts(){\n \t\tTransaction tx;\n \t\tString name = \"life\";\n \t\tIndexHits<Node> foundNodes = findTaxNodeByName(name);\n Node firstNode = null;\n if (foundNodes.size() < 1){\n System.out.println(\"name '\" + name + \"' not found. quitting.\");\n return;\n } else if (foundNodes.size() > 1) {\n System.out.println(\"more than one node found for name '\" + name + \"'not sure how to deal with this. quitting\");\n } else {\n for (Node n : foundNodes)\n firstNode = n;\n }\n \t\tTraversalDescription CHILDOF_TRAVERSAL = Traversal.description()\n \t\t\t\t.relationships( RelTypes.TAXCHILDOF,Direction.INCOMING );\n \t\tSystem.out.println(firstNode.getProperty(\"name\"));\n \t\tint count = 0;\n \t\ttx = graphDb.beginTx();\n \t\ttry{\n \t\t\tfor(Node friendnode : CHILDOF_TRAVERSAL.traverse(firstNode).nodes()){\n \t\t\t\tboolean conflict = false;\n \t\t\t\tString endNode = \"\";\n \t\t\t\tRelationship ncbirel = null;\n \t\t\t\tRelationship ottolrel = null;\n \t\t\t\tfor(Relationship rel : friendnode.getRelationships(Direction.OUTGOING)){\n \t\t\t\t\tif (rel.getEndNode() == rel.getStartNode()){\n \t\t\t\t\t\tcontinue;\n \t\t\t\t\t}else{\n \t\t\t\t\t\tif (endNode == \"\")\n \t\t\t\t\t\t\tendNode = (String) rel.getEndNode().getProperty(\"name\");\n \t\t\t\t\t\tif ((String)rel.getEndNode().getProperty(\"name\") != endNode){\n \t\t\t\t\t\t\tconflict = true;\n \t\t\t\t\t\t}\n \t\t\t\t\t\tif(((String)rel.getProperty(\"source\")).compareTo(\"ncbi\")==0)\n \t\t\t\t\t\t\tncbirel = rel;\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\tif (conflict && ncbirel != null){\n \t\t\t\t\tcount += 1;\n //\t\t\t\t\tSystem.out.println(\"would make one from \"+ncbirel.getStartNode().getProperty(\"name\")+\" \"+ncbirel.getEndNode().getProperty(\"name\"));\n \t\t\t\t\tif(ncbirel.getStartNode()!=ncbirel.getEndNode()){\n \t\t\t\t\t\tncbirel.getStartNode().createRelationshipTo(ncbirel.getEndNode(), RelTypes.PREFTAXCHILDOF);\n \t\t\t\t\t\tRelationship newrel2 = ncbirel.getStartNode().createRelationshipTo(ncbirel.getEndNode(), RelTypes.TAXCHILDOF);\n \t\t\t\t\t\tnewrel2.setProperty(\"source\", \"ottol\");\n \t\t\t\t\t}else{\n \t\t\t\t\t\tSystem.out.println(\"would make cycle from \"+ncbirel.getEndNode().getProperty(\"name\"));\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t}\n \t\t\t\tif(count % transaction_iter == 0)\n \t\t\t\t\tSystem.out.println(count);\n \t\t\t}\n \t\t\ttx.success();\n \t\t}finally{\n \t\t\ttx.finish();\n \t\t}\n \t}", "@BeforeClass\n public static void setUpClass() {\n Neo4JSessionFactory factory = Neo4JSessionFactory.getInstance();\n Session session = factory.getNeo4jSession();\n session.purgeDatabase();\n }", "private static boolean transactionAddArticle(Transaction tx, ArticleBean newArt) {\n HashMap<String, Object> parameters = new HashMap<>();\n parameters.put(\"author\", newArt.getAuthor());\n parameters.put(\"id\", newArt.getId());\n parameters.put(\"timestamp\", newArt.getTimestamp().toString());\n parameters.put(\"title\", newArt.getTitle());\n parameters.put(\"game1\", newArt.getListGame().get(0));\n parameters.put(\"game2\", (newArt.getListGame().size() == 2) ? newArt.getListGame().get(1) : \"\" );\n String query = \"\";\n\n if (newArt.getListGame().size() == 1 || newArt.getListGame().get(1).equals(\"\")) {\n query =\n \"MATCH(u:User {username:$author}), (g1:Game{name:$game1})\"\n + \" CREATE (u)-[p:PUBLISHED{timestamp:$timestamp}]->(a:Article{idArt:$id, title:$title})\"\n + \" CREATE (g1)<-[:REFERRED]-(a)\"\n + \" return a \";\n } else {\n query =\n \"MATCH(u:User {username:$author}), (g1:Game{name:$game1}), (g2:Game{name:$game2}) \"\n + \" CREATE (u)-[p:PUBLISHED{timestamp:$timestamp}]->(a:Article{idArt:$id, title:$title}) \"\n + \" CREATE (g1)<-[:REFERRED]-(a)-[:REFERRED]->(g2) \"\n + \" return a \";\n }\n\n\n Result result = tx.run(query, parameters);\n if(result.hasNext()) {\n return true;\n }\n\n return false;\n }", "ObstacleQuery createObstacleQuery();", "void createGraphForSingleLoad();", "@Override\n public List<GraphRelationship> getRelationships() {\n int localMax=1;\n Hashtable checkIfRelationExists = new Hashtable();\n List<GraphRelationship> relatonships = new ArrayList<>();\n List<String> filePaths = ProjectFileNamesUtil.getFileNamesFromProject(project.getBaseDir());\n for (String filePath : filePaths){ //foreach filepath - node name\n String str[] = filePath.split(\"/\");\n String name = str[str.length-1];\n CoverageNode startNode = (CoverageNode) nodeHashTable.get(name); //relations from this node\n ImportFileUtil importFileUtil = (ImportFileUtil) relations.get(name); //get relations for node\n if (importFileUtil != null && startNode != null){\n for (ImportFrom importFrom : importFileUtil.getImportFromList()) //for each relation\n {\n NodeRelationship relation;\n CoverageNode endNode = (CoverageNode) nodeHashTable.get(importFrom.getName());//end node of relation\n String nameOfRelation = startNode.getId() + \"->\" + endNode.getId();\n if (checkIfRelationExists.get(nameOfRelation) != null){\n continue;\n }\n relation = new NodeRelationship(nameOfRelation);\n relation.setWeight(getRelationWeight(importFrom));\n if (localMax < getRelationWeight(importFrom)){localMax=getRelationWeight(importFrom);} //localMax of weights for proper logScale\n relation.setCallsCount(\"\" + (int) relation.getWeight());\n relation.setStartNode(startNode);\n relation.setEndNode(endNode);\n setRelationTypes(relation.getTypes(),relation.getWeight()); //sets trivia\n HashMap<String, Object> properties = new HashMap<>();\n getPropertiesForRelations(properties, importFrom);\n ResultsPropertyContainer resultsPropertyContainer = new ResultsPropertyContainer(properties);\n relation.setPropertyContainer(resultsPropertyContainer);\n checkIfRelationExists.put(relation.getId(), relation);\n relatonships.add(relation);\n }\n }\n }\n for(GraphRelationship relationship : relatonships){\n relationship.setWeight(normalizeWeight(relationship.getWeight(), localMax));\n }\n return relatonships;\n }", "@Override\n @Test\n public void testQuery_advancedRankingWithJoin() throws Exception { }", "@Test\n public void testDAM32102001() {\n // By default the loading related entity is eager.\n testDAM32101001();\n }", "boolean usedByNode(Long id);", "public void test() throws Exception {\n ApiConnection api = new ApiConnection(\"http://api06.dev.openstreetmap.org/api\");\n\n Root root = api.get(malmoSouth, malmoWest, malmoNorth, malmoEast);\n\n api.authenticate(\"[email protected]\", \"osm-common\");\n\n\n long changeset = api.createChangeset(\"Test\");\n try {\n\n String reference = UUID.randomUUID().toString();\n\n Node node = new Node();\n node.setChangeset(changeset);\n node.setLongitude(53);\n node.setLatitude(16);\n node.setTag(\"ref:osm-common\", reference);\n\n api.create(changeset, node);\n\n assertTrue(node.getId() > 0);\n assertEquals(new Long(changeset), node.getChangeset());\n assertEquals(reference, node.getTag(\"ref:osm-common\"));\n\n Node newNode = api.getNode(node.getId());\n assertEquals(node.getId(), newNode.getId());\n assertEquals(new Long(changeset), newNode.getChangeset());\n assertEquals(node.getLatitude(), newNode.getLatitude());\n assertEquals(node.getLongitude(), newNode.getLongitude());\n assertEquals(reference, newNode.getTag(\"ref:osm-common\"));\n\n api.delete(changeset, newNode);\n\n // todo check deleted\n\n System.currentTimeMillis();\n\n } finally {\n api.closeChangeset(changeset);\n }\n\n System.currentTimeMillis();\n }", "@Test \r\n void insert_two_vertexs_then_create_edge(){\r\n graph.addVertex(\"A\");\r\n graph.addVertex(\"B\");\r\n graph.addEdge(\"A\", \"B\");\r\n List<String> adjacentA = graph.getAdjacentVerticesOf(\"A\");\r\n List<String> adjacentB = graph.getAdjacentVerticesOf(\"B\");\r\n if(!adjacentA.contains(\"B\")) { \r\n fail();\r\n }\r\n if(adjacentB.contains(\"A\")) { \r\n fail();\r\n }\r\n }", "@Repository\npublic interface ItemComboRepository extends Neo4jRepository<ItemCombo, Long> {\n\n ItemRepository findByCode(String code);\n\n}", "@Test\r\n void test_insert_two_vertice_with_one_edge_remove_non_existent_edge() {\r\n // Add three vertices with two edges\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n vertices = graph.getAllVertices();\r\n // B should be an adjacent vertex of A\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // C should be an adjacent vertex of B\r\n if(!graph.getAdjacentVerticesOf(\"B\").contains(\"C\")){\r\n fail();\r\n }\r\n //Check that A,B and C are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")\r\n | !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n // There are two edges in the graph\r\n if(graph.size() != 2) {\r\n fail();\r\n }\r\n // Try are remove edge from A to C\r\n graph.removeEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"D\");\r\n graph.removeEdge(\"E\", \"F\");\r\n graph.removeEdge(null, \"A\");\r\n graph.removeEdge(\"A\", null);\r\n //Graph should maintain its original shape\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // C should be an adjacent vertex of B\r\n if(!graph.getAdjacentVerticesOf(\"B\").contains(\"C\")){\r\n fail();\r\n }\r\n //Check that A,B and C are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")\r\n | !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n // There are two edges in the graph\r\n if(graph.size() != 2) {\r\n fail();\r\n }\r\n }", "@Test\r\n void test_insert_50_vertex_check() {\r\n String str;\r\n for(int i = 0; i < 50; i++) {\r\n str = \"\" + i;\r\n graph.addVertex(str);\r\n }\r\n vertices = graph.getAllVertices();\r\n for(int j = 0; j < 50; j++) {\r\n str = \"\" + j;\r\n if (!vertices.contains(str))\r\n fail(\"Insert not working!!\");\r\n }\r\n }", "private DBMaster() {\r\n\t\t//The current address is localhost - needs to be changed at a later date\r\n\t\t_db = new GraphDatabaseFactory().newEmbeddedDatabase(\"\\\\etc\\\\neo4j\\\\default.graphdb\");\r\n\t\tregisterShutdownHook();\r\n\t}", "@Test\n public void testRewriteCreate() throws Exception{\n try {\n ParseNode tree = TestQuery.prepareCreateStmtAnalysed();\n ParseNode ansTreeRewritten = TestQuery.prepareCreateStmtRewritten();\n testObj.rewrite(tree);\n System.out.println(tree.toSql());\n assertEquals(ansTreeRewritten.toSql(), tree.toSql());\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n }", "@Test\r\n void remove_nonexistent_vertex() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n graph.removeVertex(\"D\");\r\n List<String> adjacent;\r\n vertices = graph.getAllVertices(); \r\n // Check that graph has all added vertexes\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"B\")|\r\n !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (!adjacent.contains(\"B\"))\r\n fail();\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.contains(\"C\"))\r\n fail();\r\n \r\n }", "void createGraphForMassiveLoad();", "public static void main(String[] args) throws Exception {\n CalciteConnection connection = new SimpleCalciteConnection();\n String salesSchema = Resources.toString(SimpleQueryPlanner2.class.getResource(\"/sales.json\"), Charset.defaultCharset());\n // ModelHandler reads the sales schema and load the schema to connection's root schema and sets the default schema\n new ModelHandler(connection, \"inline:\" + salesSchema);\n\n // Create the query planner with sales schema. conneciton.getSchema returns default schema name specified in sales.json\n SimpleQueryPlanner2 queryPlanner = new SimpleQueryPlanner2(connection.getRootSchema().getSubSchema(connection.getSchema()));\n RelNode logicalPlan = queryPlanner.getLogicalPlan(\"select id,product from orders where product='paint' and units>=5\");\n System.out.println(logicalPlan.getDescription());\n System.out.println(RelOptUtil.toString(logicalPlan));\n\n System.out.println(\"======================================\");\n\n queryPlanner = new SimpleQueryPlanner2(connection.getRootSchema().getSubSchema(connection.getSchema()));\n //RelNode plan = queryPlanner.getTRel(\"select id,product from orders where product='paint' and units>=5\"); // TODO 报错\n RelNode plan = queryPlanner.getTRel(\"select id,product from orders\");\n System.out.println(RelOptUtil.toString(plan));\n ((TRel) plan).doSomething(0);\n }", "@Test\r\n void add_20_remove_20_add_20() {\r\n //Add 20\r\n for(int i = 0; i < 20; i++) {\r\n graph.addVertex(\"\" +i);\r\n }\r\n vertices = graph.getAllVertices();\r\n //Check all 20 are in graph\r\n for(int i = 0; i < 20; i++) {\r\n if(!vertices.contains(\"\" + i)) {\r\n fail();\r\n }\r\n }\r\n //Remove 20 \r\n for(int i = 0; i < 20; i++) {\r\n graph.removeVertex(\"\" +i);\r\n }\r\n //Check all 20 are not in graph anymore \r\n \r\n for(int i = 0; i < 20; i++) {\r\n if(vertices.contains(\"\" + i)) {\r\n fail();\r\n }\r\n }\r\n //Add 20 again\r\n for(int i = 0; i < 20; i++) {\r\n graph.addVertex(\"\" +i);\r\n }\r\n //Check all 20 are in graph\r\n for(int i = 0; i < 20; i++) {\r\n if(!vertices.contains(\"\" + i)) {\r\n fail();\r\n }\r\n }\r\n }", "@Test\n void testIsConnected(){\n weighted_graph g = new WGraph_DS();\n for(int i = 1; i <= 7; i++){\n g.addNode(i);\n }\n g.connect(1,2,20);\n g.connect(1,5,15);\n g.connect(2,3,20);\n g.connect(5,6,15);\n g.connect(3,4,20);\n g.connect(6,4,15);\n g.connect(1,7,2);\n g.connect(7,4,50);\n weighted_graph_algorithms ga = new WGraph_Algo();\n ga.init(g);\n assertTrue(ga.isConnected());\n g.removeEdge(7,4);\n g.removeEdge(6,4);\n g.removeEdge(3,4);\n assertFalse(ga.isConnected());\n }", "public static void main(String[] args) throws IOException {\n\t\tCorePackage.eINSTANCE.eClass();\n\t\tDOMPackage.eINSTANCE.eClass();\n\t\tPrimitiveTypesPackage.eINSTANCE.eClass();\n\t\t\n\t\tPersistenceBackendFactoryRegistry.register(BlueprintsURI.SCHEME, BlueprintsPersistenceBackendFactory.getInstance());\n\t\t\n\t\tResourceSet rSet = new ResourceSetImpl();\n\t\trSet.getResourceFactoryRegistry().getProtocolToFactoryMap().put(BlueprintsURI.SCHEME, PersistentResourceFactory.getInstance());\n\t\t\n\t\tResource graphResource = rSet.createResource(BlueprintsURI.createFileURI(new File(\"models/set1.graphdb\")));\n\t\tMap<String, Object> graphOptions = BlueprintsNeo4jOptionsBuilder.newBuilder().asMap();\n\t\tgraphResource.load(graphOptions);\n\t\t\n\t\tstartQuery();\n\t\t\n\t\ttry {\n\t\t\t/*\n\t\t\t * Create the OCL environment and load the query from an existing OCL file.\n\t\t\t * Note: Mogwa´ relies on the OCL Ecore metamodel. Moving to the Pivot metamodel is planned for the next release\n\t\t\t * and will provide support for computing queries over UML models.\n\t\t\t */\n\t\t\tOCL ocl = OCL.newInstance(EcoreEnvironmentFactory.INSTANCE);\n\t\t\tOCLInput oclInput = new OCLInput(new FileInputStream(new File(\"ocl/singletons.ocl\")));\n\t\t\tList<Constraint> constraints = ocl.parse(oclInput);\n\t\t\t\n\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\tList<EObject> result = (List<EObject>)ocl.createQuery(constraints.get(0)).evaluate(graphResource.getContents().get(0));\n\t\t\tNeoLogger.info(\"Found {0} singletons\", result.size());\n\t\t\tendQuery();\n\t\t} catch(ParserException e) {\n\t\t\tSystem.out.println(\"Cannot parse the input OCL file\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t((PersistentResource)graphResource).close();\n\t}", "@Test(expected = NotFoundException.class)\n public void testDeleteEntityFromGDC() {\n Transaction tx = graphDatabaseContext.beginTx();\n Person p = new Person(\"Michael\", 35);\n Person spouse = new Person(\"Tina\", 36);\n p.setSpouse(spouse);\n long id = spouse.getId();\n graphDatabaseContext.removeNodeEntity(spouse);\n tx.success();\n tx.finish();\n Assert.assertNull(\"spouse removed \" + p.getSpouse(), p.getSpouse());\n NodeFinder<Person> finder = finderFactory.createNodeEntityFinder(Person.class);\n Person spouseFromIndex = finder.findByPropertyValue(Person.NAME_INDEX, \"name\", \"Tina\");\n Assert.assertNull(\"spouse not found in index\",spouseFromIndex);\n Assert.assertNull(\"node deleted \" + id, graphDatabaseContext.getNodeById(id));\n }", "Graph testGraph();", "@RequestMapping(\"/orient\")\n public String callOrientTest() {\n String response = \"\";\n for (Vertex v : orientDBConnection.getGraph().query().has(\"Nome\", \"Tommaso\").vertices()) {\n System.out.println(\"Selected node: \" + v.getProperty(\"Nome\") + v.getProperty(\"Cognome\"));\n response += v.getProperty(\"Cognome\") + \"\\n\";\n }\n\n for (Vertex v : orientDBConnection.getGraph().query().has(\"Cap\", 61032).vertices()) {\n System.out.println(\"Selected node: \" + v.getProperty(\"Via\") + v.getProperty(\"Provincia\"));\n response += v.getProperty(\"Via\") + \"\\n\";\n }\n\n\n return response;\n }", "public interface RoleRepository extends GraphRepository<Role> {\n\n}", "@Override\n\t\tpublic GraphDatabaseService getGraphDatabase() {\n\t\t\treturn null;\n\t\t}", "@Test\n public void tr2()\n {\n Graph graph = new Graph(2);\n Set<Integer> sources = new TreeSet<Integer>();\n Set<Integer> targets = new TreeSet<Integer>();\n sources.add(0);\n targets.add(1);\n graph.addEdge(0,1);\n assertTrue(graph.reachable(sources, targets));\n\n\n }", "@Test\n public void getViajeroTest() {\n ViajeroEntity entity = data.get(0);\n ViajeroEntity newEntity = vp.find(entity.getId());\n Assert.assertNotNull(newEntity);\n Assert.assertEquals(entity.getId(), newEntity.getId());\n }", "public void insertTripleDistributedByObject(Triple triple) {\n\r\n }", "public interface GraphDatabase<VertexIteratorType, EdgeIteratorType, VertexType, EdgeType> {\n\t\n\t//edge and vertex operations\n\tVertexType getOtherVertexFromEdge( EdgeType r, VertexType oneVertex );\n\t\n\tVertexType getSrcVertexFromEdge( EdgeType edge );\n\t\n\tVertexType getDestVertexFromEdge( EdgeType edge );\n\t\n\tVertexType getVertex( Integer i );\n\t\n\t//edge iterators\n\tEdgeIteratorType getAllEdges();\n\t\n\tEdgeIteratorType getNeighborsOfVertex( VertexType v );\n\t\n\tboolean edgeIteratorHasNext( EdgeIteratorType it );\n\t\n\tEdgeType nextEdge( EdgeIteratorType it );\n\t\n\tvoid cleanupEdgeIterator( EdgeIteratorType it );\n\t\n\t//vertex iterators\n\tVertexIteratorType getVertexIterator();\n\t\n\tboolean vertexIteratorHasNext( VertexIteratorType it );\n\t\n\tVertexType nextVertex( VertexIteratorType it );\n\t\n\tvoid cleanupVertexIterator( VertexIteratorType it );\n\t\n\t//benchmarks\n\tvoid findAllNodeNeighbours();\n\t\n\tvoid findNodesOfAllEdges();\n\t\n\t/**\n\t\t* Opens the graph database\n\t\t*/\n\tvoid open();\n\t\n\t/**\n\t\t* Creates a graph database and configures for single data insertion\n\t\t*/\n\tvoid createGraphForSingleLoad();\n\n\t/**\n\t * Creates a graph database and configures for single data insertion\n\t */\n\tvoid createGraphForDistributedSingleLoad();\n\n\t/**\n\t\t* Inserts data in massive mode\n\t\t*\n\t\t* @param dataPath - dataset path\n\t\t*/\n\tvoid massiveModeLoading( File dataPath );\n\t\n\t/**\n\t\t* Inserts data in single mode\n\t\t*\n\t\t* @param dataPath - dataset path\n\t\t*/\n\tvoid singleModeLoading( File dataPath, File resultsPath, int scenarioNumber );\n\n\t/**\n\t * Distributed inserts data in single mode\n\t *\n\t * @param dataPath - dataset path\n\t */\n\tvoid distributedSingleModeLoading( File dataPath, File resultsPath, int scenarioNumber );\n\n\t/**\n\t\t* Creates a graph database and configures for bulk data insertion\n\t\t*/\n\tvoid createGraphForMassiveLoad();\n\t\n\t/**\n\t\t* Shut down the graph database\n\t\t*/\n\tvoid shutdown();\n\t\n\t/**\n\t\t* Delete the graph database\n\t\t*/\n\tvoid delete();\n\t\n\t/**\n\t\t* Shutdown the graph database, which configuration is for massive insertion\n\t\t* of data\n\t\t*/\n\tvoid shutdownMassiveGraph();\n\t\n\t/**\n\t\t* Find the shortest path between vertex 1 and each of the vertexes in the list\n\t\t*\n\t\t* @param nodes any number of random nodes\n\t\t*/\n\tvoid shortestPaths( Set<Integer> nodes );\n\t\n\t/**\n\t\t* Execute findShortestPaths query from the Query interface\n\t\t*/\n\tvoid shortestPath( final VertexType fromNode, Integer node );\n\t\n\t/**\n\t\t* @return the number of nodes\n\t\t*/\n\tint getNodeCount();\n\t\n\t/**\n\t\t* @return the neighbours of a particular node\n\t\t*/\n\tSet<Integer> getNeighborsIds( int nodeId );\n\t\n\t/**\n\t\t* @return the node degree\n\t\t*/\n\tdouble getNodeWeight( int nodeId );\n\t\n\t/**\n\t\t* Initializes the community and nodeCommunity property in each database\n\t\t*/\n\tvoid initCommunityProperty();\n\t\n\t/**\n\t\t* @return the communities (communityId) that are connected with a\n\t\t* particular nodeCommunity\n\t\t*/\n\tSet<Integer> getCommunitiesConnectedToNodeCommunities( int nodeCommunities );\n\t\n\t/**\n\t\t* @return the nodes a particular community contains\n\t\t*/\n\tSet<Integer> getNodesFromCommunity( int community );\n\t\n\t/**\n\t\t* @return the nodes a particular nodeCommunity contains\n\t\t*/\n\tSet<Integer> getNodesFromNodeCommunity( int nodeCommunity );\n\t\n\t/**\n\t\t* @return the number of edges between a community and a nodeCommunity\n\t\t*/\n\tdouble getEdgesInsideCommunity( int nodeCommunity, int communityNodes );\n\t\n\t/**\n\t\t* @return the sum of node degrees\n\t\t*/\n\tdouble getCommunityWeight( int community );\n\t\n\t/**\n\t\t* @return the sum of node degrees\n\t\t*/\n\tdouble getNodeCommunityWeight( int nodeCommunity );\n\t\n\t/**\n\t\t* Moves a node from a community to another\n\t\t*/\n\tvoid moveNode( int from, int to );\n\t\n\t/**\n\t\t* @return the number of edges of the graph database\n\t\t*/\n\tdouble getGraphWeightSum();\n\t\n\t/**\n\t\t* Reinitializes the community and nodeCommunity property\n\t\t*\n\t\t* @return the number of communities\n\t\t*/\n\tint reInitializeCommunities();\n\t\n\t/**\n\t\t* @return in which community a particular node belongs\n\t\t*/\n\tint getCommunityFromNode( int nodeId );\n\t\n\t/**\n\t\t* @return in which community a particular nodeCommunity belongs\n\t\t*/\n\tint getCommunity( int nodeCommunity );\n\t\n\t/**\n\t\t* @return the number of nodeCommunities a particular community contains\n\t\t*/\n\tint getCommunitySize( int community );\n\t\n\t/**\n\t\t* @return a map where the key is the community id and the value is the\n\t\t* nodes each community has.\n\t\t*/\n\tMap<Integer, List<Integer>> mapCommunities( int numberOfCommunities );\n\t\n\t/**\n\t\t* @return return true if node exist, false if not\n\t\t*/\n\tboolean nodeExists( int nodeId );\n}", "OperationNode getNode();", "public abstract void connect() throws OrmException;", "@Test\n public void tae0()\n {\n Graph g = new Graph(2);\n g.addEdge(0, 1);\n System.out.println(g);\n assertEquals(g.toString(), \"numNodes: 2\\nedges: [[false, true], [false, false]]\");\n }", "@Test\n public void testBuild() {\n show(DeleteSqlBuilder.build(\"table1\", NeoMap.of(\"name\", \"nana\", \"age\", 12)));\n }", "@Test\r\n void remove_null() {\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n graph.removeVertex(null);\r\n List<String> adjacent;\r\n vertices = graph.getAllVertices(); \r\n // Check that graph has all added vertexes\r\n if(!vertices.contains(\"A\")| !vertices.contains(\"B\")|\r\n !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n adjacent = graph.getAdjacentVerticesOf(\"A\");\r\n if (!adjacent.contains(\"B\"))\r\n fail();\r\n adjacent = graph.getAdjacentVerticesOf(\"B\");\r\n if (!adjacent.contains(\"C\"))\r\n fail();\r\n \r\n }", "@Test\n public void testWithUnknownProperty() throws Exception {\n LogicalGraph socialGraph = getSocialNetworkLoader().getLogicalGraph();\n List<EPGMVertex> vertices = socialGraph\n .callForGraph(new VertexDeduplication<>(\"Person\", Collections.singletonList(\"notSet\")))\n .getVerticesByLabel(\"Person\").collect();\n assertEquals(1, vertices.size());\n }", "public static void main(String[] args) throws Throwable {\n NeoConfig.setMagicNumber(new byte[]{0x01, 0x03, 0x00, 0x0}); // Magic number 769\n\n // Set up the connection to the neo-node\n Neow3j neow3j = Neow3j.build(new HttpService(\"http://localhost:40332\"));\n // Setup an account and wallet for signing the transaction. Make sure that the account has a\n // sufficient GAS balance to pay for the deployment.\n Account a = Account.fromWIF(\"L3kCZj6QbFPwbsVhxnB8nUERDy4mhCSrWJew4u5Qh5QmGMfnCTda\");\n Wallet w = Wallet.withAccounts(a);\n\n // Retrieve the contract files.\n NefFile nefFile = NefFile.readFromFile(new File(\"./build/neow3j/AxLabsToken.nef\"));\n ContractManifest manifest;\n try (FileInputStream s = new FileInputStream(\"./build/neow3j/AxLabsToken.manifest.json\")) {\n manifest = ObjectMapperFactory.getObjectMapper().readValue(s, ContractManifest.class);\n }\n\n // Deploy the contract's NEF and manifest. This creates, signs and send a transaction to\n // the neo-node.\n NeoSendRawTransaction response = new ManagementContract(neow3j).deploy(nefFile, manifest)\n .wallet(w)\n .signers(Signer.calledByEntry(a.getScriptHash()))\n .sign()\n .send();\n\n if (response.hasError()) {\n System.out.printf(\"Deployment was not successful. Error message from neo-node \"\n + \"was: '%s'\\n\", response.getError().getMessage());\n }\n \n ScriptHash scriptHash = SmartContract.getContractHash(a.getScriptHash(), nefFile.getScript());\n System.out.printf(\"Script hash of the deployd contract: %s\\n\", scriptHash.toString());\n }", "@Test\n public void getGraph1() throws Exception {\n try (final Graph g1 = dataset.getGraph(graph1).get()) {\n assertEquals(4, g1.size());\n\n assertTrue(g1.contains(alice, name, aliceName));\n assertTrue(g1.contains(alice, knows, bob));\n assertTrue(g1.contains(alice, member, null));\n assertTrue(g1.contains(null, name, secretClubName));\n }\n }", "public void testEmptyTransactionShouldNotBeVersioned() {\n Long ver1 = graph.getLatestGraphVersion();\n commit();\n commit();\n commit();\n assertThat(graph.getLatestGraphVersion(), is(ver1));\n }", "String targetGraph();" ]
[ "0.601263", "0.60071635", "0.58686864", "0.57507795", "0.5747997", "0.5721635", "0.5698241", "0.5682744", "0.5636338", "0.5632008", "0.5568618", "0.5523904", "0.54954326", "0.54770124", "0.54557323", "0.54355127", "0.5423265", "0.5412831", "0.5406452", "0.53863895", "0.538549", "0.5379543", "0.5377853", "0.53417844", "0.5332464", "0.53261137", "0.53233504", "0.5313479", "0.5307502", "0.52887267", "0.5287471", "0.52792495", "0.5261803", "0.5255345", "0.5253937", "0.5248487", "0.52183694", "0.5217868", "0.5213421", "0.521262", "0.52049845", "0.52049845", "0.5177214", "0.516852", "0.5144121", "0.5141037", "0.5139607", "0.51336676", "0.51233256", "0.51188606", "0.51107174", "0.5101348", "0.5098216", "0.5088529", "0.5069468", "0.5062529", "0.50411385", "0.50394815", "0.5035907", "0.503245", "0.5031641", "0.5031103", "0.5027094", "0.5019335", "0.50166065", "0.50135773", "0.50036937", "0.49994886", "0.49992424", "0.49948427", "0.4990983", "0.49890614", "0.49844033", "0.49808553", "0.4977669", "0.49715954", "0.4969836", "0.49674082", "0.49639127", "0.49620736", "0.49616194", "0.49577257", "0.49572054", "0.49512503", "0.49498877", "0.49450395", "0.4942761", "0.49424812", "0.4934507", "0.4933921", "0.4931835", "0.49311608", "0.49294662", "0.49216136", "0.49188358", "0.49176672", "0.49039307", "0.4890033", "0.48892158", "0.48878372", "0.48835707" ]
0.0
-1
/ it's necessary that Neo4j community edition is correctly installed and in operation
@Test void existTest() throws Exception { mockMvc.perform(MockMvcRequestBuilders.get("/some")) .andDo(MockMvcResultHandlers.print()) .andExpect(MockMvcResultMatchers.status().isOk()) .andExpect(MockMvcResultMatchers.jsonPath("$._embedded.some").exists()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Before\n\tpublic void setUp() throws Exception {\n\t\tClass.forName(\"org.neo4j.jdbc.Driver\");\n\t\t\n\t\t// Connect\n\t\tProperties info = new Properties();\n\t\tinfo.put(\"user\", \"neo4j\");\n\t\tinfo.put(\"password\", \"123\");\n//\t\tfinal String connectionStr = \"jdbc:neo4j://192.168.1.22:7474/\";\n\t\tfinal String connectionStr = \"jdbc:neo4j://localhost:7474/\";\n\t\tNeo4jConnection con = (Neo4jConnection)DriverManager.getConnection(connectionStr, info);\n\n\t\t// Querying\n\t\tstmt = con.createStatement();\n\t\t\n\t\t\n\t}", "public static void main(String args[]) {\r\n\r\n// A driver is used to connect to a Neo4j server. It provides sessions that are used to execute statements and retrieve results.\r\n// If no port is provided in the URL, the default port 7687 is used\r\n\r\n Driver driver = GraphDatabase.driver(\"bolt://localhost\", AuthTokens.basic(\"neo4j\", \"saneo4j\"));\r\n// Driver driver = GraphDatabase.driver(\"bolt://50.16.185.228\", AuthTokens.basic(\"neo4j\", \"saneo4j\"));\r\n Session session = driver.session();\r\n\r\n// Cleanup all existing nodes and their relationship entries\r\n cleanupDB(session);\r\n\r\n// read from the input files and add connection\r\n readFilesFromInputDir(session);\r\n\r\n// Specific relationship in MATCH\r\n String search_for1 = \"Cloud computing\";\r\n String search_in1 = \"Experience\";\r\n// searchByRelationship1(session, search_for1, search_in1);\r\n\r\n// Generic relationship\r\n String search_for2 = \"CEO\";\r\n// searchByAll(session, search_for2);\r\n\r\n// Specific relationship in WHERE\r\n String search_for3 = \"san francisco, london washington; Chicago Manchester, cambridge\";\r\n String search_in3 = \"Location\";\r\n searchByRelationship2(session, search_for3, search_in3);\r\n\r\n session.close();\r\n driver.close();\r\n }", "@Before\n public void setupDatabase() {\n graphDb = new TestGraphDatabaseFactory().newImpermanentDatabaseBuilder().newGraphDatabase();\n registerShutdownHook(graphDb);\n \n// server = new WrappingNeoServerBootstrapper((GraphDatabaseAPI) graphDb);\n// server.start();\n \n ProcessEngineConfiguration processEngineConfiguration = new ProcessEngineConfiguration();\n processEngineConfiguration.setGraphDatabaseService(graphDb);\n processEngine = processEngineConfiguration.buildProcessEngine();\n }", "@Bean\r\n public boolean testNeoj() {\n \tval node = neo4jRepo.findOne(10L,2);\r\n\t\tnode.getPhrases().forEach(System.out::println);\r\n\t\tnode.getChildNodes().forEach(System.out::println);\r\n\t\tSystem.out.println(node);\r\n\r\n\t\treturn true;\r\n\t}", "public static void main( String args[] )\n {\n DbUtils.delete( PATH );\n graphDb = new EmbeddedGraphDatabase( PATH );\n\n // Start a transaction (every operation performed on the graph needs\n // to be in a transactional context.\n Transaction tx = graphDb.beginTx();\n try\n {\n // Set up the matrix and all its social connections\n Node thomasAnderson = setupMatrix();\n \n // Query it for information\n printFriends( thomasAnderson );\n printHackers( thomasAnderson );\n \n // Let Neo4j know that the transaction was successful\n tx.success();\n }\n finally\n {\n // Finish the transaction and shutdown Neo4j\n tx.finish();\n graphDb.shutdown();\n }\n }", "private static void testConnection(GraknSession session) {\n try (GraknGraph graph = session.open(GraknTxType.READ)) {\n\n // construct a match query to find people\n MatchQuery query = graph.graql().match(var(\"x\").isa(\"mirna\"));\n\n // execute the query\n List<Answer> result = query.limit(10).execute();\n\n // if there is no data throw error\n if (result.isEmpty()) {throw new RuntimeException(\"Expected data is not present in the graph.\");}\n System.out.println(\"Connection OK.\");\n }\n }", "public static void main(String[] args) throws Throwable {\n NeoConfig.setMagicNumber(new byte[]{0x01, 0x03, 0x00, 0x0}); // Magic number 769\n\n // Set up the connection to the neo-node\n Neow3j neow3j = Neow3j.build(new HttpService(\"http://localhost:40332\"));\n // Setup an account and wallet for signing the transaction. Make sure that the account has a\n // sufficient GAS balance to pay for the deployment.\n Account a = Account.fromWIF(\"L3kCZj6QbFPwbsVhxnB8nUERDy4mhCSrWJew4u5Qh5QmGMfnCTda\");\n Wallet w = Wallet.withAccounts(a);\n\n // Retrieve the contract files.\n NefFile nefFile = NefFile.readFromFile(new File(\"./build/neow3j/AxLabsToken.nef\"));\n ContractManifest manifest;\n try (FileInputStream s = new FileInputStream(\"./build/neow3j/AxLabsToken.manifest.json\")) {\n manifest = ObjectMapperFactory.getObjectMapper().readValue(s, ContractManifest.class);\n }\n\n // Deploy the contract's NEF and manifest. This creates, signs and send a transaction to\n // the neo-node.\n NeoSendRawTransaction response = new ManagementContract(neow3j).deploy(nefFile, manifest)\n .wallet(w)\n .signers(Signer.calledByEntry(a.getScriptHash()))\n .sign()\n .send();\n\n if (response.hasError()) {\n System.out.printf(\"Deployment was not successful. Error message from neo-node \"\n + \"was: '%s'\\n\", response.getError().getMessage());\n }\n \n ScriptHash scriptHash = SmartContract.getContractHash(a.getScriptHash(), nefFile.getScript());\n System.out.printf(\"Script hash of the deployd contract: %s\\n\", scriptHash.toString());\n }", "private void test() throws Exception {\r\n session.execute(new Set(Prop.SERIALIZE, true));\r\n // loop through all databases\r\n for(int d = 0; d < databases.size(); d++) {\r\n // open database and loop through all queries\r\n session.execute(new Open(databases.get(d)));\r\n for(int q = 0; q < queries.size(); q++) {\r\n results[q] = addSortedServer(results[q], query(d, q));\r\n }\r\n session.execute(new Close());\r\n }\r\n }", "public static void main(String[] args) throws Exception {\n\t\tGraphDatabaseService db = new GraphDatabaseFactory().newEmbeddedDatabaseBuilder(dbPath).newGraphDatabase();\t\r\n\t\ttry (Transaction tx = db.beginTx()) {\r\n\t\t\t\r\n Result result1 = db.execute(\"MATCH (m)-[r:NODE]->(n) RETURN m,n.lat as lat,n.lon as lon\");\r\n //遍历每一条路,给每个路段都加上oneway属性\r\n while (result1.hasNext()) {\r\n \tMap<String,Object> m1=result1.next();\r\n \t\r\n \tNode m=(Node) m1.get(\"m\");\r\n \tdouble lat=(double) m1.get(\"lat\");\r\n \tdouble lon=(double) m1.get(\"lon\");\r\n \t//注意:不能用and,要用逗号\r\n \tdb.execute(\"MATCH (m) WHERE id(m)=\"+m.getId()+\" SET m.lat=\"+lat+\", m.lon=\"+lon+\"\"); \r\n } \r\n tx.success();\r\n }\r\n\t\tdb.shutdown();\r\n\t}", "NodeConnection createNodeConnection();", "private void fourNodesTopo() {\n ReadWriteTransaction tx = dataBroker.newReadWriteTransaction();\n n(tx, true, \"n1\", Stream.of(pB(\"n1:1\"), pB(\"n1:2\"), pI(\"n1:3\"), pO(\"n1:4\"), pO(\"n1:5\")));\n n(tx, true, \"n2\", Stream.of(pB(\"n2:1\"), pB(\"n2:2\"), pO(\"n2:3\"), pI(\"n2:4\"), pI(\"n2:5\")));\n n(tx, true, \"n3\", Stream.of(pB(\"n3:1\"), pB(\"n3:2\"), pO(\"n3:3\"), pO(\"n3:4\"), pI(\"n3:5\")));\n n(tx, true, \"n4\", Stream.of(pB(\"n4:1\"), pB(\"n4:2\"), pI(\"n4:3\"), pI(\"n4:4\"), pO(\"n4:5\")));\n l(tx, \"n1\", \"n1:5\", \"n2\", \"n2:5\", OperationalState.ENABLED, ForwardingDirection.UNIDIRECTIONAL);\n l(tx, \"n1\", \"n1:4\", \"n4\", \"n4:4\", OperationalState.ENABLED, ForwardingDirection.UNIDIRECTIONAL);\n l(tx, \"n2\", \"n2:3\", \"n4\", \"n4:3\", OperationalState.ENABLED, ForwardingDirection.UNIDIRECTIONAL);\n l(tx, \"n3\", \"n3:4\", \"n2\", \"n2:4\", OperationalState.ENABLED, ForwardingDirection.UNIDIRECTIONAL);\n l(tx, \"n4\", \"n4:5\", \"n3\", \"n3:5\", OperationalState.ENABLED, ForwardingDirection.UNIDIRECTIONAL);\n try {\n tx.submit().checkedGet();\n } catch (TransactionCommitFailedException e) {\n e.printStackTrace();\n }\n }", "@BeforeClass\n public static void setUpClass() {\n Neo4JSessionFactory factory = Neo4JSessionFactory.getInstance();\n Session session = factory.getNeo4jSession();\n session.purgeDatabase();\n }", "public static void main(String[] args) {\n graph.addEdge(\"Mumbai\",\"Warangal\");\n graph.addEdge(\"Warangal\",\"Pennsylvania\");\n graph.addEdge(\"Pennsylvania\",\"California\");\n //graph.addEdge(\"Montevideo\",\"Jameka\");\n\n\n String sourceNode = \"Pennsylvania\";\n\n if(graph.isGraphConnected(sourceNode)){\n System.out.println(\"Yes\");\n } else {\n System.out.println(\"No\");\n }\n }", "private DBMaster() {\r\n\t\t//The current address is localhost - needs to be changed at a later date\r\n\t\t_db = new GraphDatabaseFactory().newEmbeddedDatabase(\"\\\\etc\\\\neo4j\\\\default.graphdb\");\r\n\t\tregisterShutdownHook();\r\n\t}", "private void fiveNodesTopo() {\n ReadWriteTransaction tx = dataBroker.newReadWriteTransaction();\n n(tx, true, \"n1\", Stream.of(pI(\"n1:1\"), pB(\"n1:2\"), pI(\"n1:3\"), pO(\"n1:4\")));\n n(tx, true, \"n2\", Stream.of(pI(\"n2:1\"), pB(\"n2:2\"), pO(\"n2:3\"), pI(\"n2:4\")));\n n(tx, true, \"n3\", Stream.of(pO(\"n3:1\"), pB(\"n3:2\"), pO(\"n3:3\"), pI(\"n3:4\")));\n n(tx, true, \"n4\", Stream.of(pO(\"n4:1\"), pI(\"n4:2\"), pB(\"n4:3\"), pB(\"n4:4\")));\n n(tx, true, \"n5\", Stream.of(pI(\"n5:1\"), pB(\"n5:2\"), pB(\"n5:3\"), pO(\"n5:4\")));\n l(tx, \"n2\", \"n2:3\", \"n3\", \"n3:4\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n l(tx, \"n3\", \"n3:1\", \"n1\", \"n1:1\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n l(tx, \"n3\", \"n3:3\", \"n5\", \"n5:1\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n l(tx, \"n4\", \"n4:1\", \"n1\", \"n1:3\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n l(tx, \"n1\", \"n1:4\", \"n2\", \"n2:4\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n l(tx, \"n5\", \"n5:4\", \"n4\", \"n4:2\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n try {\n tx.submit().checkedGet();\n } catch (TransactionCommitFailedException e) {\n e.printStackTrace();\n }\n }", "public static void convoExport() throws ClassNotFoundException, SQLException, IOException{\n\t\t\n\t\tClass.forName(\"org.h2.Driver\");\n\t\tConnection conn = DriverManager.getConnection(DB, user, pass);\n\t\tConvoGraph rt = new ConvoGraph(conn, \"HISenOG\", \"/Users/Brian/Desktop/\");\n\t\trt.createNodesRT();\n\t\trt.createRT();\n\t\trt.nodeWrite(\"RT\");\n\t\tConvoGraph rp = new ConvoGraph(conn, \"HISenOG\", \"/Users/Brian/Desktop/\");\n\t\trp.createNodesRP();\n\t\trp.createReply();\n\t\trp.nodeWrite(\"RP\");\n\t}", "public void loadEdge()\r\n {\r\n town.createConnection();\r\n }", "@Test\r\n\tpublic void testGetStatementsInSingleContext()\r\n\t\tthrows Exception\r\n\t{\r\n\t\ttry{\r\n\t\t\ttestAdminCon.begin();\r\n\t\t\ttestAdminCon.add(micah, lname, micahlname, dirgraph1);\r\n\t\t\ttestAdminCon.add(micah, fname, micahfname, dirgraph1);\r\n\t\t\ttestAdminCon.add(micah, homeTel, micahhomeTel, dirgraph1);\r\n\t\t\t\r\n\t\t\ttestAdminCon.add(john, fname, johnfname,dirgraph);\r\n\t\t\ttestAdminCon.add(john, lname, johnlname,dirgraph);\r\n\t\t\ttestAdminCon.add(john, homeTel, johnhomeTel,dirgraph);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tAssert.assertEquals(\"Size of dirgraph1 must be 3\",3, testAdminCon.size(dirgraph1));\r\n\t\t\tAssert.assertEquals(\"Size of unknown context must be 0\",0L, testAdminCon.size(vf.createURI(\":asd\")));\r\n\t\t\tAssert.assertEquals(\"Size of dirgraph must be 3\",3, testAdminCon.size(dirgraph));\t\r\n\t\t\tAssert.assertEquals(\"Size of repository must be 6\",6, testAdminCon.size());\r\n\t\t\tAssert.assertEquals(\"Size of repository must be 6\",6, testAdminCon.size(dirgraph,dirgraph1,null));\r\n\t\t\tAssert.assertEquals(\"Size of repository must be 6\",6, testAdminCon.size(dirgraph,dirgraph1));\r\n\t\t\tAssert.assertEquals(\"Size of repository must be 3\",3, testAdminCon.size(dirgraph,null));\r\n\t\t\tAssert.assertEquals(\"Size of repository must be 3\",3, testAdminCon.size(dirgraph1,null));\r\n\t\t\tAssert.assertEquals(\"Size of default graph must be 0\",0, testAdminCon.size(null));\r\n\t\t\t\r\n\t\t\t\r\n\t\t\ttestAdminCon.add(dirgraph, vf.createURI(\"http://TYPE\"), vf.createLiteral(\"Directory Graph\"));\r\n\t\t\tAssert.assertEquals(\"Size of default graph must be 1\",1, testAdminCon.size((Resource)null));\r\n\t\t\tAssert.assertEquals(\"Size of repository must be 4\",4, testAdminCon.size(dirgraph,null));\r\n\t\t\ttestAdminCon.commit();\t\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\t\r\n\t\t}\r\n\t\tfinally{\r\n\t\t\tif (testAdminCon.isActive())\r\n\t\t\t\ttestAdminCon.rollback();\r\n\t\t}\r\n\t\tAssert.assertEquals(\"Size of repository must be 4\",4, testAdminCon.size(dirgraph1,null));\r\n\t\tAssert.assertEquals(1, testAdminCon.size(null));\r\n\t\tAssert.assertEquals(1, testAdminCon.size(null, null));\r\n\t\tAssert.assertEquals(3, testAdminCon.size(dirgraph, dirgraph));\r\n\t\t\r\n\t\r\n\t\tassertTrue(\"Repository should contain statement\", testAdminCon.hasStatement(john, homeTel, johnhomeTel, false));\r\n\t\tassertTrue(\"Repository should contain statement in dirgraph1\",\r\n\t\t\t\ttestAdminCon.hasStatement(micah, lname, micahlname, false, dirgraph1));\r\n\t\tassertFalse(\"Repository should not contain statement in context2\",\r\n\t\t\t\ttestAdminCon.hasStatement(micah, lname, micahlname, false, dirgraph));\r\n\r\n\t\t// Check handling of getStatements without context IDs\r\n\t\tRepositoryResult<Statement> result = testAdminCon.getStatements(micah, lname, null, false);\r\n\t\ttry {\r\n\t\t\twhile (result.hasNext()) {\r\n\t\t\t\tStatement st = result.next();\r\n\t\t\t\tassertThat(st.getSubject(), is(equalTo((Resource)micah)));\r\n\t\t\t\tassertThat(st.getPredicate(), is(equalTo(lname)));\r\n\t\t\t\tassertThat(st.getObject(), is(equalTo((Value)micahlname)));\r\n\t\t\t\tassertThat(st.getContext(), is(equalTo((Resource)dirgraph1)));\r\n\t\t\t}\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tresult.close();\r\n\t\t}\r\n\r\n\t\t// Check handling of getStatements with a known context ID\r\n\t\tresult = testAdminCon.getStatements(null, null, null, false, dirgraph);\r\n\t\ttry {\r\n\t\t\twhile (result.hasNext()) {\r\n\t\t\t\tStatement st = result.next();\r\n\t\t\t\tassertThat(st.getContext(), is(equalTo((Resource)dirgraph)));\r\n\t\t\t}\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tresult.close();\r\n\t\t}\r\n\t\r\n\t\t\r\n\t\t// Check handling of getStatements with null context\r\n\t\tresult = testAdminCon.getStatements(null, null, null, false, null);\r\n\t\tassertThat(result, is(notNullValue()));\r\n\t\ttry {\r\n\t\t\twhile (result.hasNext()) {\r\n\t\t\t\tStatement st = result.next();\r\n\t\t\t\tassertThat(st.getContext(), is(equalTo((Resource)null)));\r\n\t\t\t}\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tresult.close();\r\n\t\t}\r\n\t\t\r\n\t\t// Check handling of getStatements with an unknown context ID\r\n\t\tresult = testAdminCon.getStatements(null, null, null, false, vf.createURI(\":unknownContext\"));\r\n\t\ttry {\r\n\t\t\tassertThat(result, is(notNullValue()));\r\n\t\t\tassertThat(result.hasNext(), is(equalTo(false)));\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tresult.close();\r\n\t\t}\r\n\r\n\t\tList<Statement> list = Iterations.addAll(testAdminCon.getStatements(null, lname, null, false, dirgraph1),\r\n\t\t\t\tnew ArrayList<Statement>());\r\n\t\tassertNotNull(\"List should not be null\", list);\r\n\t\tassertFalse(\"List should not be empty\", list.isEmpty());\r\n\t\t\r\n\t\tList<Statement> list1 = Iterations.addAll(testAdminCon.getStatements(dirgraph, null, null, false, null),\r\n\t\t\t\tnew ArrayList<Statement>());\r\n\t\tassertNotNull(\"List should not be null\", list1);\r\n\t\tassertFalse(\"List should not be empty\", list1.isEmpty());\r\n\t\t\r\n\t}", "@Test\r\n public void testGraphPerms1()\r\n throws Exception {\r\n\r\n GraphManager gmgr = databaseClient.newGraphManager();\r\n createUserRolesWithPrevilages(\"test-role\");\r\n GraphPermissions gr = testAdminCon.getDefaultGraphPerms();\r\n \r\n // ISSUE # 175 uncomment after issue is fixed\r\n Assert.assertEquals(0L, gr.size());\r\n \r\n testAdminCon.setDefaultGraphPerms(gmgr.permission(\"test-role\", Capability.READ, Capability.UPDATE));\r\n String defGraphQuery = \"CREATE GRAPH <http://marklogic.com/test/graph/permstest> \";\r\n MarkLogicUpdateQuery updateQuery = testAdminCon.prepareUpdate(QueryLanguage.SPARQL, defGraphQuery);\r\n updateQuery.execute();\r\n \r\n String defGraphQuery1 = \"INSERT DATA { GRAPH <http://marklogic.com/test/graph/permstest> { <http://marklogic.com/test1> <pp2> \\\"test\\\" } }\";\r\n String checkQuery = \"ASK WHERE { GRAPH <http://marklogic.com/test/graph/permstest> {<http://marklogic.com/test> <pp2> \\\"test\\\" }}\";\r\n MarkLogicUpdateQuery updateQuery1 = testAdminCon.prepareUpdate(QueryLanguage.SPARQL, defGraphQuery1);\r\n updateQuery1.execute();\r\n \r\n BooleanQuery booleanQuery = testAdminCon.prepareBooleanQuery(QueryLanguage.SPARQL, checkQuery);\r\n boolean results = booleanQuery.evaluate();\r\n Assert.assertEquals(false, results);\r\n \r\n gr = testAdminCon.getDefaultGraphPerms();\r\n Assert.assertEquals(1L, gr.size());\r\n Iterator<Entry<String, Set<Capability>>> resultPerm = gr.entrySet().iterator();\r\n while(resultPerm.hasNext()){\r\n \t Entry<String, Set<Capability>> perms = resultPerm.next();\r\n \t Assert.assertTrue(\"test-role\" == perms.getKey());\r\n \t Iterator<Capability> capability = perms.getValue().iterator();\r\n \t while (capability.hasNext())\r\n \t\t assertThat(capability.next().toString(), anyOf(equalTo(\"UPDATE\"), is(equalTo(\"READ\"))));\r\n }\r\n \r\n String defGraphQuery2 = \"CREATE GRAPH <http://marklogic.com/test/graph/permstest1> \";\r\n testAdminCon.setDefaultGraphPerms(null);\r\n updateQuery = testAdminCon.prepareUpdate(QueryLanguage.SPARQL, defGraphQuery2);\r\n updateQuery.execute();\r\n gr = testAdminCon.getDefaultGraphPerms();\r\n Assert.assertEquals(0L, gr.size());\r\n \r\n \r\n createUserRolesWithPrevilages(\"multitest-role\");\r\n testAdminCon.setDefaultGraphPerms(gmgr.permission(\"multitest-role\", Capability.READ).permission(\"test-role\", Capability.UPDATE));\r\n defGraphQuery = \"CREATE GRAPH <http://marklogic.com/test/graph/permstest2> \";\r\n updateQuery = testAdminCon.prepareUpdate(QueryLanguage.SPARQL, defGraphQuery);\r\n updateQuery.execute();\r\n gr = testAdminCon.getDefaultGraphPerms();\r\n Assert.assertEquals(2L, gr.size());\r\n testAdminCon.setDefaultGraphPerms(null);\r\n testAdminCon.setDefaultGraphPerms(null);\r\n // ISSUE 180\r\n //testAdminCon.setDefaultGraphPerms((GraphPermissions)null);\r\n gr = testAdminCon.getDefaultGraphPerms();\r\n Assert.assertEquals(0L, gr.size());\r\n \r\n \r\n }", "@Override\n protected void startConnection() throws CoreException {\n }", "private void addArbitraryDataToDatabase() {\n\n try (Transaction tx = graphDatabaseService.beginTx()) {\n Node arbitraryNode = graphDatabaseService.createNode(DynamicLabel.label(\"NotAClass\"));\n arbitraryNode.setProperty(\"name\", \"Colin\");\n Node otherNode = graphDatabaseService.createNode(DynamicLabel.label(\"NotAClass\"));\n otherNode.setProperty(\"age\", 39);\n arbitraryNode.createRelationshipTo(otherNode, DynamicRelationshipType.withName(\"TEST\"));\n\n tx.success();\n }\n }", "public static void main(String[] args) throws Exception {\n CalciteConnection connection = new SimpleCalciteConnection();\n String salesSchema = Resources.toString(SimpleQueryPlanner2.class.getResource(\"/sales.json\"), Charset.defaultCharset());\n // ModelHandler reads the sales schema and load the schema to connection's root schema and sets the default schema\n new ModelHandler(connection, \"inline:\" + salesSchema);\n\n // Create the query planner with sales schema. conneciton.getSchema returns default schema name specified in sales.json\n SimpleQueryPlanner2 queryPlanner = new SimpleQueryPlanner2(connection.getRootSchema().getSubSchema(connection.getSchema()));\n RelNode logicalPlan = queryPlanner.getLogicalPlan(\"select id,product from orders where product='paint' and units>=5\");\n System.out.println(logicalPlan.getDescription());\n System.out.println(RelOptUtil.toString(logicalPlan));\n\n System.out.println(\"======================================\");\n\n queryPlanner = new SimpleQueryPlanner2(connection.getRootSchema().getSubSchema(connection.getSchema()));\n //RelNode plan = queryPlanner.getTRel(\"select id,product from orders where product='paint' and units>=5\"); // TODO 报错\n RelNode plan = queryPlanner.getTRel(\"select id,product from orders\");\n System.out.println(RelOptUtil.toString(plan));\n ((TRel) plan).doSomething(0);\n }", "public void init(GraphDatabaseService store) {\n\n\t\tlog.info(\"creating Neo indices\");\n\n\t\ttry (Transaction tx = store.beginTx()) {\n\n\t\t\tstore.schema().indexFor(IDENTITY).on(name_prop).create();\n\t\t\tstore.schema().indexFor(CODELIST).on(id_prop).create();\n\t\t\tstore.schema().indexFor(ATTRDEF).on(id_prop).create();\n\t\t\tstore.schema().indexFor(LINKDEF).on(id_prop).create();\n\t\t\tstore.schema().indexFor(USER).on(name_prop).create();\n\t\t\tstore.schema().indexFor(LIFECYCLE).on(id_prop).create();\n\t\t\tstore.schema().indexFor(LOGBOOK).on(id_prop).create();\n\n\t\t\ttx.success();\n\t\t}\n\n\t}", "@Test\r\n\tpublic void testPrepareGraphQuery3() throws Exception\r\n\t{\r\n\t\tStatement st1 = vf.createStatement(john, fname, johnfname, dirgraph);\r\n\t\tStatement st2 = vf.createStatement(john, lname, johnlname, dirgraph);\r\n\t\tStatement st3 = vf.createStatement(john, homeTel, johnhomeTel, dirgraph);\r\n\t\tStatement st4 = vf.createStatement(john, email, johnemail, dirgraph);\r\n\t\tStatement st5 = vf.createStatement(micah, fname, micahfname, dirgraph);\r\n\t\tStatement st6 = vf.createStatement(micah, lname, micahlname, dirgraph);\r\n\t\tStatement st7 = vf.createStatement(micah, homeTel, micahhomeTel, dirgraph);\r\n\t\tStatement st8 = vf.createStatement(fei, fname, feifname, dirgraph);\r\n\t\tStatement st9 = vf.createStatement(fei, lname, feilname, dirgraph);\r\n\t\tStatement st10 = vf.createStatement(fei, email, feiemail, dirgraph);\r\n\t\t\r\n\t\r\n\t\ttestWriterCon.add(st1);\r\n\t\ttestWriterCon.add(st2);\r\n\t\ttestWriterCon.add(st3);\r\n\t\ttestWriterCon.add(st4);\r\n\t\ttestWriterCon.add(st5);\r\n\t\ttestWriterCon.add(st6);\r\n\t\ttestWriterCon.add(st7);\r\n\t\ttestWriterCon.add(st8);\r\n\t\ttestWriterCon.add(st9);\r\n\t\ttestWriterCon.add(st10);\r\n\t\t\r\n\t\tAssert.assertTrue(testWriterCon.hasStatement(st1, false));\r\n\t\tAssert.assertFalse(testWriterCon.hasStatement(st1, false, (Resource)null));\r\n\t\tAssert.assertFalse(testWriterCon.hasStatement(st1, false, null));\r\n\t\tAssert.assertTrue(testWriterCon.hasStatement(st1, false, dirgraph));\r\n\t\t\r\n\t\t\r\n\t\tAssert.assertEquals(10, testAdminCon.size(dirgraph));\t\t\r\n\t\t\t\r\n\t\tString query = \" DESCRIBE <http://marklogicsparql.com/addressbook#firstName> \";\r\n\t\tGraphQuery queryObj = testReaderCon.prepareGraphQuery(query);\r\n\t\t\t\r\n\t\tGraphQueryResult result = queryObj.evaluate();\r\n\t\tresult.hasNext();\r\n\t\ttry {\r\n\t\t\tassertThat(result, is(notNullValue()));\r\n\t\t\tassertThat(result.hasNext(), is(equalTo(false)));\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tresult.close();\r\n\t\t}\r\n\t}", "public abstract void connect() throws OrmException;", "public static void main(String[] args) throws IOException {\n\t\tCorePackage.eINSTANCE.eClass();\n\t\tDOMPackage.eINSTANCE.eClass();\n\t\tPrimitiveTypesPackage.eINSTANCE.eClass();\n\t\t\n\t\tPersistenceBackendFactoryRegistry.register(BlueprintsURI.SCHEME, BlueprintsPersistenceBackendFactory.getInstance());\n\t\t\n\t\tResourceSet rSet = new ResourceSetImpl();\n\t\trSet.getResourceFactoryRegistry().getProtocolToFactoryMap().put(BlueprintsURI.SCHEME, PersistentResourceFactory.getInstance());\n\t\t\n\t\tResource graphResource = rSet.createResource(BlueprintsURI.createFileURI(new File(\"models/set1.graphdb\")));\n\t\tMap<String, Object> graphOptions = BlueprintsNeo4jOptionsBuilder.newBuilder().asMap();\n\t\tgraphResource.load(graphOptions);\n\t\t\n\t\tstartQuery();\n\t\t\n\t\ttry {\n\t\t\t/*\n\t\t\t * Create the OCL environment and load the query from an existing OCL file.\n\t\t\t * Note: Mogwa´ relies on the OCL Ecore metamodel. Moving to the Pivot metamodel is planned for the next release\n\t\t\t * and will provide support for computing queries over UML models.\n\t\t\t */\n\t\t\tOCL ocl = OCL.newInstance(EcoreEnvironmentFactory.INSTANCE);\n\t\t\tOCLInput oclInput = new OCLInput(new FileInputStream(new File(\"ocl/singletons.ocl\")));\n\t\t\tList<Constraint> constraints = ocl.parse(oclInput);\n\t\t\t\n\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\tList<EObject> result = (List<EObject>)ocl.createQuery(constraints.get(0)).evaluate(graphResource.getContents().get(0));\n\t\t\tNeoLogger.info(\"Found {0} singletons\", result.size());\n\t\t\tendQuery();\n\t\t} catch(ParserException e) {\n\t\t\tSystem.out.println(\"Cannot parse the input OCL file\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t((PersistentResource)graphResource).close();\n\t}", "public void connect() {\n\n DatabaseGlobalAccess.getInstance().setEmf(Persistence.createEntityManagerFactory(\"PU_dashboarddb\"));\n DatabaseGlobalAccess.getInstance().setEm(DatabaseGlobalAccess.getInstance().getEmf().createEntityManager());\n DatabaseGlobalAccess.getInstance().getDatabaseData();\n DatabaseGlobalAccess.getInstance().setDbReachable(true);\n }", "public void test_ck_02() {\n OntModel vocabModel = ModelFactory.createOntologyModel();\n ObjectProperty p = vocabModel.createObjectProperty(\"p\");\n OntClass A = vocabModel.createClass(\"A\");\n \n OntModel workModel = ModelFactory.createOntologyModel();\n Individual sub = workModel.createIndividual(\"uri1\", A);\n Individual obj = workModel.createIndividual(\"uri2\", A);\n workModel.createStatement(sub, p, obj);\n }", "public void testaGraph() {\n\t\tEstacaoDAO a = new EstacaoDAO();\n\t\ta.carregarEstacoes();\n\t\tLinha b = new Linha(\"a\");\n\t\tb.loadAllStations(a);\n\t\tb.shortestPath(a,\"Curado\",\"Recife\");\n\t}", "public static void main(String[] args) throws Exception {\n TDB.setOptimizerWarningFlag(false);\n\n final String DATASET_DIR_NAME = \"data0\";\n final Dataset data0 = TDBFactory.createDataset( DATASET_DIR_NAME );\n\n // show the currently registered names\n for (Iterator<String> it = data0.listNames(); it.hasNext(); ) {\n out.println(\"NAME=\"+it.next());\n }\n\n out.println(\"getting named model...\");\n /// this is the OWL portion\n final Model model = data0.getNamedModel( MY_NS );\n out.println(\"Model := \"+model);\n\n out.println(\"getting graph...\");\n /// this is the DATA in that MODEL\n final Graph graph = model.getGraph();\n out.println(\"Graph := \"+graph);\n\n if (graph.isEmpty()) {\n final Resource product1 = model.createResource( MY_NS +\"product/1\");\n final Property hasName = model.createProperty( MY_NS, \"#hasName\");\n final Statement stmt = model.createStatement(\n product1, hasName, model.createLiteral(\"Beach Ball\",\"en\") );\n out.println(\"Statement = \" + stmt);\n\n model.add(stmt);\n\n // just for fun\n out.println(\"Triple := \" + stmt.asTriple().toString());\n } else {\n out.println(\"Graph is not Empty; it has \"+graph.size()+\" Statements\");\n long t0, t1;\n t0 = System.currentTimeMillis();\n final Query q = QueryFactory.create(\n \"PREFIX exns: <\"+MY_NS+\"#>\\n\"+\n \"PREFIX exprod: <\"+MY_NS+\"product/>\\n\"+\n \" SELECT * \"\n // if you don't provide the Model to the\n // QueryExecutionFactory below, then you'll need\n // to specify the FROM;\n // you *can* always specify it, if you want\n // +\" FROM <\"+MY_NS+\">\\n\"\n // +\" WHERE { ?node <\"+MY_NS+\"#hasName> ?name }\"\n // +\" WHERE { ?node exns:hasName ?name }\"\n // +\" WHERE { exprod:1 exns:hasName ?name }\"\n +\" WHERE { ?res ?pred ?obj }\"\n );\n out.println(\"Query := \"+q);\n t1 = System.currentTimeMillis();\n out.println(\"QueryFactory.TIME=\"+(t1 - t0));\n\n t0 = System.currentTimeMillis();\n try ( QueryExecution qExec = QueryExecutionFactory\n // if you query the whole DataSet,\n // you have to provide a FROM in the SparQL\n //.create(q, data0);\n .create(q, model) ) {\n t1 = System.currentTimeMillis();\n out.println(\"QueryExecutionFactory.TIME=\"+(t1 - t0));\n\n t0 = System.currentTimeMillis();\n ResultSet rs = qExec.execSelect();\n t1 = System.currentTimeMillis();\n out.println(\"executeSelect.TIME=\"+(t1 - t0));\n while (rs.hasNext()) {\n QuerySolution sol = rs.next();\n out.println(\"Solution := \"+sol);\n for (Iterator<String> names = sol.varNames(); names.hasNext(); ) {\n final String name = names.next();\n out.println(\"\\t\"+name+\" := \"+sol.get(name));\n }\n }\n }\n }\n out.println(\"closing graph\");\n graph.close();\n out.println(\"closing model\");\n model.close();\n //out.println(\"closing DataSetGraph\");\n //dsg.close();\n out.println(\"closing DataSet\");\n data0.close();\n }", "void nodeOnline();", "public static void main(String[] args) {\n String engineHostname = Grakn.DEFAULT_URI;\n if (args.length>0) {engineHostname = args[0];}\n try (GraknSession session = Grakn.session(engineHostname, keyspace)) {\n testConnection(session);\n System.out.println(\"Calculating degrees...\");\n Map<Long, Set<String>> degrees = degreeOfRelation(session, \"interaction\", Sets.newHashSet(\"interaction\",\"reference\"));\n System.out.println(\"Persisting degrees...\");\n persistDegrees(session, degrees);\n System.out.println(\"Finished persisting.\");\n System.out.println(\"Calculating degrees...\");\n degrees = degreeOfRelation(session, \"gene-target\", Sets.newHashSet(\"gene-target\",\"reference\"));\n System.out.println(\"Persisting degrees...\");\n persistDegrees(session, degrees);\n System.out.println(\"Finished persisting.\");\n System.out.println(\"Task complete.\");\n }\n }", "public void initializeConnection() {\n\n cluster = Cluster.builder().addContactPoint(host).build();\n session = cluster.connect(keyspaceName);\n session.execute(\"USE \".concat(keyspaceName));\n }", "public void closeNeo4jDriver() {\n DRIVER.close();\n LOGGER.info(\"Closed Neo4jDriver.\");\n }", "public static void main(String args[]) {\n Model model = ModelFactory.createDefaultModel(); \n\n//set namespace\n Resource NAMESPACE = model.createResource( relationshipUri );\n \tmodel.setNsPrefix( \"rela\", relationshipUri);\n \n// Create the types of Property we need to describe relationships in the model\n Property childOf = model.createProperty(relationshipUri,\"childOf\"); \n Property siblingOf = model.createProperty(relationshipUri,\"siblingOf\");\n Property spouseOf = model.createProperty(relationshipUri,\"spouseOf\");\n Property parentOf = model.createProperty(relationshipUri,\"parentOf\"); \n \n \n// Create resources representing the people in our model\n Resource Siddharth = model.createResource(familyUri+\"Siddharth\");\n Resource Dhvanit = model.createResource(familyUri+\"Dhvanit\");\n Resource Rekha = model.createResource(familyUri+\"Rekha\");\n Resource Sandeep = model.createResource(familyUri+\"Sandeep\");\n Resource Kanchan = model.createResource(familyUri+\"Kanchan\");\n Resource Pihu = model.createResource(familyUri+\"Pihu\");\n Resource DwarkaPrasad = model.createResource(familyUri+\"Dwarkesh\");\n Resource Shakuntala = model.createResource(familyUri+\"Shakuntala\");\n Resource Santosh = model.createResource(familyUri+\"Santosh\");\n Resource Usha = model.createResource(familyUri+\"Usha\");\n Resource Priyadarshan = model.createResource(familyUri+\"Priyadarshan\");\n Resource Sudarshan = model.createResource(familyUri+\"Sudarshan\");\n Resource Pragya = model.createResource(familyUri+\"Pragya\");\n Resource Shailendra = model.createResource(familyUri+\"Shailendra\");\n Resource Rajni = model.createResource(familyUri+\"Rajni\");\n Resource Harsh = model.createResource(familyUri+\"Harsh\");\n Resource Satendra = model.createResource(familyUri+\"Satendra\");\n Resource Vandana = model.createResource(familyUri+\"Vandana\");\n Resource Priyam = model.createResource(familyUri+\"Priyam\");\n Resource Darshan = model.createResource(familyUri+\"Darshan\");\n Resource Vardhan = model.createResource(familyUri+\"Vardhan\");\n \n List<Statement> list = new ArrayList(); \n list.add(model.createStatement(Dhvanit,spouseOf,Kanchan)); \n list.add(model.createStatement(Sandeep,spouseOf,Rekha)); \n list.add(model.createStatement(DwarkaPrasad,spouseOf,Shakuntala)); \n list.add(model.createStatement(Santosh,spouseOf,Usha)); \n list.add(model.createStatement(Shailendra,spouseOf,Rajni)); \n list.add(model.createStatement(Satendra,spouseOf,Vandana)); \n list.add(model.createStatement(Sandeep,childOf,DwarkaPrasad)); \n list.add(model.createStatement(Sandeep,childOf,Shakuntala)); \n list.add(model.createStatement(Santosh,childOf,DwarkaPrasad)); \n list.add(model.createStatement(Santosh,childOf,Shakuntala)); \n list.add(model.createStatement(Shailendra,childOf,DwarkaPrasad)); \n list.add(model.createStatement(Shailendra,childOf,Shakuntala)); \n list.add(model.createStatement(Satendra,childOf,DwarkaPrasad)); \n list.add(model.createStatement(Satendra,childOf,Shakuntala)); \n list.add(model.createStatement(DwarkaPrasad,parentOf,Sandeep)); \n list.add(model.createStatement(DwarkaPrasad,parentOf,Santosh)); \n list.add(model.createStatement(DwarkaPrasad,parentOf,Shailendra)); \n list.add(model.createStatement(DwarkaPrasad,parentOf,Satendra)); \n list.add(model.createStatement(Shakuntala,parentOf,Sandeep)); \n list.add(model.createStatement(Shakuntala,parentOf,Santosh)); \n list.add(model.createStatement(Shakuntala,parentOf,Shailendra)); \n list.add(model.createStatement(Shakuntala,parentOf,Satendra)); \n list.add(model.createStatement(Sandeep,parentOf,Siddharth)); \n list.add(model.createStatement(Sandeep,parentOf,Dhvanit)); \n list.add(model.createStatement(Rekha,parentOf,Siddharth)); \n list.add(model.createStatement(Rekha,parentOf,Dhvanit)); \n list.add(model.createStatement(Siddharth,childOf,Rekha)); \n list.add(model.createStatement(Dhvanit,childOf,Rekha)); \n list.add(model.createStatement(Siddharth,childOf,Sandeep)); \n list.add(model.createStatement(Dhvanit,childOf,Sandeep)); \n list.add(model.createStatement(Harsh,childOf,Shailendra)); \n list.add(model.createStatement(Harsh,childOf,Rajni)); \n list.add(model.createStatement(Shailendra,parentOf,Harsh)); \n list.add(model.createStatement(Rajni,parentOf,Harsh)); \n list.add(model.createStatement(Santosh,parentOf,Priyadarshan)); \n list.add(model.createStatement(Santosh,parentOf,Sudarshan));\n list.add(model.createStatement(Santosh,parentOf,Pragya));\n list.add(model.createStatement(Usha,parentOf,Priyadarshan)); \n list.add(model.createStatement(Usha,parentOf,Sudarshan));\n list.add(model.createStatement(Usha,parentOf,Pragya));\n list.add(model.createStatement(Priyadarshan,childOf,Santosh));\n list.add(model.createStatement(Pragya,childOf,Santosh));\n list.add(model.createStatement(Sudarshan,childOf,Santosh));\n list.add(model.createStatement(Priyadarshan,childOf,Usha));\n list.add(model.createStatement(Pragya,childOf,Usha));\n list.add(model.createStatement(Sudarshan,childOf,Usha));\n list.add(model.createStatement(Satendra,parentOf,Priyam)); \n list.add(model.createStatement(Satendra,parentOf,Darshan));\n list.add(model.createStatement(Satendra,parentOf,Vardhan));\n list.add(model.createStatement(Vandana,parentOf,Priyam)); \n list.add(model.createStatement(Vandana,parentOf,Darshan));\n list.add(model.createStatement(Vandana,parentOf,Vardhan));\n list.add(model.createStatement(Priyam,childOf,Satendra));\n list.add(model.createStatement(Darshan,childOf,Satendra));\n list.add(model.createStatement(Vardhan,childOf,Satendra));\n list.add(model.createStatement(Priyam,childOf,Vandana));\n list.add(model.createStatement(Darshan,childOf,Vandana));\n list.add(model.createStatement(Vardhan,childOf,Vandana));\n list.add(model.createStatement(Pihu,childOf,Dhvanit));\n list.add(model.createStatement(Pihu,childOf,Kanchan));\n list.add(model.createStatement(Dhvanit,parentOf,Pihu));\n list.add(model.createStatement(Kanchan,parentOf,Pihu));\n list.add(model.createStatement(Siddharth,siblingOf,Dhvanit));\n list.add(model.createStatement(Dhvanit,siblingOf,Siddharth)); \n list.add(model.createStatement(Priyadarshan,siblingOf,Sudarshan));\n list.add(model.createStatement(Priyadarshan,siblingOf,Pragya));\n list.add(model.createStatement(Sudarshan,siblingOf,Priyadarshan));\n list.add(model.createStatement(Sudarshan,siblingOf,Pragya));\n list.add(model.createStatement(Pragya,siblingOf,Priyadarshan));\n list.add(model.createStatement(Pragya,siblingOf,Sudarshan)); \n list.add(model.createStatement(Priyam,siblingOf,Darshan));\n list.add(model.createStatement(Priyam,siblingOf,Vardhan)); \n list.add(model.createStatement(Darshan,siblingOf,Vardhan)); \n list.add(model.createStatement(Darshan,siblingOf,Priyam));\n list.add(model.createStatement(Vardhan,siblingOf,Priyam));\n list.add(model.createStatement(Vardhan,siblingOf,Darshan));\n list.add(model.createStatement(Santosh,siblingOf,Sandeep));\n list.add(model.createStatement(Santosh,siblingOf,Shailendra));\n list.add(model.createStatement(Santosh,siblingOf,Satendra));\n list.add(model.createStatement(Sandeep,siblingOf,Santosh));\n list.add(model.createStatement(Sandeep,siblingOf,Shailendra));\n list.add(model.createStatement(Sandeep,siblingOf,Satendra));\n list.add(model.createStatement(Shailendra,siblingOf,Santosh));\n list.add(model.createStatement(Shailendra,siblingOf,Sandeep));\n list.add(model.createStatement(Shailendra,siblingOf,Satendra));\n list.add(model.createStatement(Satendra,siblingOf,Shailendra));\n list.add(model.createStatement(Satendra,siblingOf,Santosh));\n list.add(model.createStatement(Satendra,siblingOf,Sandeep));\n \n model.add(list);\n try{\n \t File file=new File(\"/Users/siddharthgupta/Documents/workspace/FamilyModel/src/family/family.rdf\");\n \t \tFileOutputStream f1=new FileOutputStream(file);\n \t \tRDFWriter d = model.getWriter(\"RDF/XML-ABBREV\");\n \t \t\t\td.write(model,f1,null);\n \t\t}catch(Exception e) {}\n }", "@Test\r\n public void testGetSupportedConnectorTopologies() throws Exception {\r\n TDataPrepDBInputDefinition fixture = new TDataPrepDBInputDefinition();\r\n\r\n Set<ConnectorTopology> result = fixture.getSupportedConnectorTopologies();\r\n\r\n assertNotNull(result);\r\n assertEquals(1, result.size());\r\n }", "private void addRelationship(String node1, String node2, String relation)\n {\n try (Session session = driver.session())\n {\n // Wrapping Cypher in an explicit transaction provides atomicity\n // and makes handling errors much easier.\n try (Transaction tx = session.beginTransaction())\n {\n tx.run(\"MATCH (j:Node {value: {x}})\\n\" +\n \"MATCH (k:Node {value: {y}})\\n\" +\n \"MERGE (j)-[r:\" + relation + \"]->(k)\", parameters(\"x\", node1, \"y\", node2));\n tx.success(); // Mark this write as successful.\n }\n }\n }", "@Test(expected = YorNException.class)\n\tpublic void testYorNException() throws Exception {\n\t\t//Graph<Vertex, Edge> g = new GraphPoetFactory().createGraph(\"src/GraphPoet.txt\");\n\t\tGraphPoetFactory graphPoetFactory = new GraphPoetFactory();\n\t\tgraphPoetFactory.createGraph(\"src/GraphPoet.txt\");\n\t\tnew GraphPoetFactory().parse(\"Edge=<ab,WordNeighborhood,1,a,b,Y>\");\n\t}", "@Before\n\tpublic void setUp() throws Exception {\n\t\torientDBTestInstance.setUpSchemaIfNeeded();\n\n\t\t// open database\n\t\tODatabaseDocumentTx db = orientDBTestInstance.getDatabase();\n\n\t\tfactory = new OrientDbRepositoryFactory(db, new OrientDbTestApplicationSettings(), new Identity());\n\n\t\t// create repository\n\t\trepository = factory.produceRepository(OrientDbSourceRepository.class);\n\t}", "@Test\n void testIsConnected(){\n weighted_graph g = new WGraph_DS();\n for(int i = 1; i <= 7; i++){\n g.addNode(i);\n }\n g.connect(1,2,20);\n g.connect(1,5,15);\n g.connect(2,3,20);\n g.connect(5,6,15);\n g.connect(3,4,20);\n g.connect(6,4,15);\n g.connect(1,7,2);\n g.connect(7,4,50);\n weighted_graph_algorithms ga = new WGraph_Algo();\n ga.init(g);\n assertTrue(ga.isConnected());\n g.removeEdge(7,4);\n g.removeEdge(6,4);\n g.removeEdge(3,4);\n assertFalse(ga.isConnected());\n }", "private void createSchema() throws Exception\n {\n LOG.info(\"Creating schema\");\n HibernateUtil.currentSession();\n }", "public interface ObjectGraph {\n\n\t\n\t/**\n\t * As in neo4j, starts a new transaction and associates it with the current thread.\n\t * @return a transaction from NeoService.\n\t */\n\tTransaction beginTx();\n\n\t/**\n\t * Mirror a java object within the neo4j graph. Only fields annotated with {@code}neo\n\t * will be considered.\n\t * @param o\n\t */\n\t<A> void persist(A... o);\n\n\t/**\n\t * removes all data representing an object from the graph.\n\t * \n\t * @param o an object retrieved from this {@link ObjectGraph}\n\t */\n\tvoid delete(Object... o);\n\t\n\t\n\t/**\n\t * Looks up a neo4j graph node using it's java object\n\t * mirror. \n\t * @param o an object retrieved from this {@link ObjectGraph}\n\t * @return neo4j node represented by o\n\t */\n\tNode get(Object o);\n\t\n\t/**\n\t * Looks up all instances of {@code}type in the graph.\n\t * \n\t * @param type a type previously stored in the graph\n\t * @return a Collection of {@code}type instances.\n\t */\n\t<T> Collection<T> get(Class<T> type);\n\n\t/**\n\t * Type safe lookup of object given it's neo4j nodeid.\n\t * Your domain classes may use {@link Nodeid#id()} to discover\n\t * their neo4j nodeid. \n\t * \n\t * @param t\n\t * @param key neo4j node id.\n\t * @return\n\t */\n\t<T> T get(Class<T> t, long key);\n\n\t\n\t/**\n\t * Return an object represented by <code>node</code> provided\n\t * the node was created by jo4neo.\n\t * \n\t * @param node\n\t * @return an object that mirrors node.\n\t */\n\tObject get(Node node);\n\t\n\t/**\n\t * Looks up the node representation of a given \n\t * uri. This method may update your graph if no node\n\t * was previously allocated for the uri.\n\t * \n\t * @return the node representation of uri.\n\t */\n\tNode get(URI uri);\n\n\n\t/**\n\t * Unmarshal a collections of nodes into objects.\n\t * \n\t */\n\t<T> Collection<T> get(Class<T> type, Iterable<Node> nodes);\n\n\t/**\n\t * Closes this ObjectGraph after which it will be unavailable \n\t * for use. Calling close is necessary, and should be called even\n\t * if the application is halted suddenly. ObjectGraph's maintain \n\t * a lucene index which may become corrupt without proper shutdown.\n\t * \n\t */\n\tvoid close();\n\n\t/**\n\t * Begin fluent interface find. <code>a</code> should be \n\t * a newly constructed instance as it's contents will be modified/initialized\n\t * by this call.\n\t * <pre>\n\t * <code>\n\t * Customer customer = new Customer();\n\t * customer = graph.find(customer).where(customer.id).is(123).result();\n\t * </code>\n\t * </pre>\n\t * \n\t * @param a\n\t * @return\n\t */\n\t<A> Where<A> find(A a);\n\n\t/**\n\t * Counts child entities without loading objects into memory. This is preferable to \n\t * using Collection.size(), which would load the full collection into memory.\n\t * <pre>\n\t * <code>\n\t * Customer customer = new Customer();\n\t * customer = graph.find(customer).where(customer.id).is(123).result();\n\t * long numOrders = graph.count(customer.orders);\n\t * </code>\n\t * </pre>\n\t * \n\t * @param values a collection value from a jo4neo annotated field.\n\t * @return\n\t */\n\tlong count(Collection<? extends Object> values);\n\n\t/**\n\t * Returns a collection of entities added since <code>d</code>.\n\t * Type <code>t</code> must be annotated with {@link Timeline}\n\t * \n\t * @see Timeline\n\t * \n\t */\n\t<T> Collection<T> getAddedSince(Class<T> t, Date d);\n\n\t/**\n\t * Returns a collection of entities added bewteen dates from and to.\n\t * Type <code>t</code> must be annotated with {@link Timeline}.\n\t * \n\t * @see Timeline\n\t */\n\t<T> Collection<T> getAddedBetween(Class<T> t, Date from,\n\t\t\tDate to);\n\n\t\n\t/**\n\t * Returns up to <code>max</code> most recently added instances of type <code>t</code>\n\t * \n\t * @param max limit the number of instances returned\n\t * @see neo#recency()\n\t */\n\t<T> Collection<T> getMostRecent(Class<T> t, int max);\n\t\n\t\n\t<T> T getSingle(Class<T> t, String indexname, Object value);\n\t\n\t<T> Collection<T> get(Class<T> t, String indexname, Object value);\n\t\n\t<T> Collection<T> fullTextQuery(Class<T> t, String indexname, Object value);\n\n}", "public void ExecuteCypherQueryNoReturn(String cypherQuery) {\r\n\t\tExecutionEngine engine = new ExecutionEngine( _db );\r\n\t\tExecutionResult result = null;\r\n\t\tTransaction tx = _db.beginTx();\r\n\t\ttry {\r\n\t\t engine.execute(cypherQuery);\r\n\t\t tx.success();\r\n\t\t} catch (Exception ex) {\r\n\t\t\tex.printStackTrace();\r\n\t\t\tSystem.out.print(\"issues with fetching node and its relations\");\r\n\t\t\ttx.failure();\r\n\t\t\t//return \"failed\";\r\n\t\t} finally {\r\n\t\t\ttx.close();\r\n\t\t}\r\n\t}", "public void validate() throws Exception{\n \ttry{\n \tSparqlConnection conn = new SparqlConnection(this.jsonRenderedSparqlConnection); \n \t}\n \tcatch(Exception e){\n \t\tthrow new Exception(\"unable to create ontology info: \" + e.getMessage(), e);\n \t}\n }", "@Test\n void shouldNotSeeNonExistingNode() throws Exception\n {\n try ( KernelTransaction tx = beginTransaction() )\n {\n assertFalse( tx.dataRead().nodeExists( 1337L ) );\n }\n }", "public void setup(){\n this.cluster = Cluster.builder().addContactPoint(\"127.0.0.1\").build();\n this.session = this.cluster.connect(\"demo\");\n }", "public static void main(String[] args) {\n\t\t\n\t\ttry(Session session = HibernateUtil.getSessionFactory().openSession()) {\n\t\t\t\n\t\t\tString sql =\"SELECT version()\";\n\t\t\tString result = (String) session.createNativeQuery(sql).getSingleResult();\n\t\t\tSystem.out.println(\"Mysql version without cfg file:::\"+result);\n\t\t}catch (HibernateException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public interface NeoDatisObject extends Serializable{\n\tvoid setNeoDatisContext(NeoDatisContext context);\n\tNeoDatisContext getNeoDatisContext();\n}", "protected void executeSchemaOperations() {\n }", "public void test() throws Exception {\n ApiConnection api = new ApiConnection(\"http://api06.dev.openstreetmap.org/api\");\n\n Root root = api.get(malmoSouth, malmoWest, malmoNorth, malmoEast);\n\n api.authenticate(\"[email protected]\", \"osm-common\");\n\n\n long changeset = api.createChangeset(\"Test\");\n try {\n\n String reference = UUID.randomUUID().toString();\n\n Node node = new Node();\n node.setChangeset(changeset);\n node.setLongitude(53);\n node.setLatitude(16);\n node.setTag(\"ref:osm-common\", reference);\n\n api.create(changeset, node);\n\n assertTrue(node.getId() > 0);\n assertEquals(new Long(changeset), node.getChangeset());\n assertEquals(reference, node.getTag(\"ref:osm-common\"));\n\n Node newNode = api.getNode(node.getId());\n assertEquals(node.getId(), newNode.getId());\n assertEquals(new Long(changeset), newNode.getChangeset());\n assertEquals(node.getLatitude(), newNode.getLatitude());\n assertEquals(node.getLongitude(), newNode.getLongitude());\n assertEquals(reference, newNode.getTag(\"ref:osm-common\"));\n\n api.delete(changeset, newNode);\n\n // todo check deleted\n\n System.currentTimeMillis();\n\n } finally {\n api.closeChangeset(changeset);\n }\n\n System.currentTimeMillis();\n }", "boolean needSeparateConnectionForDdl();", "public static void main(String[] args) throws ClassNotFoundException, SQLException {\n Class.forName(\"jdbc.oracle.driver.OracleDriver\"); //Throws ClassNotFoundException\n //Step 2 Create Connection Object\n Connection connection = DriverManager.getConnection(\n \"jdbc:oracle:thin:@localhost:1521:xe\",\"system\",\"oracle\");\n //Throws SQL Excpetion\n //Step 3 create statement Object\n Statement statement = connection.createStatement();\n\n //step 4 excecute query\n ResultSet resultSet = statement.executeQuery(\"select * from emp\");\n //Step 5 close the connection\n resultSet.close();\n\n statement.close();\n\n connection.close();\n\n }", "public static void main(String []args){\n\t\tString format = \"TURTLE\";\n\t\tInputStream is = Thread.currentThread().getContextClassLoader().\n\t\t\t\tgetResourceAsStream(\"test_ontologies/cp-11.ttl\");\n\t\tOntDocumentManager dm = OntDocumentManager.getInstance();\n\t\tdm.setProcessImports(false);\n\t\tOntModelSpec spec = new OntModelSpec(OntModelSpec.OWL_DL_MEM);\n\t\tspec.setDocumentManager(dm); \n\t\t//spec.setReasoner(reasoner);\n\t\tOntModel ontModel = ModelFactory.createOntologyModel( spec, null );\n\t\tontModel.read(is,\"\",format);\n\t\ttry {\n\t\t\tStmtIterator it = ontModel.listStatements();\n\t\t\tSystem.out.println(\"STATEMENTS\");\n\t\t\tStatement st;\n\t\t\twhile(it.hasNext()){\n\t\t\t\tst = it.next();\n\t\t\t\tif(st.getSubject().isAnon() || st.getObject().isAnon()){\n\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\tSystem.out.println(it.next());\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\tSystem.out.println(\"REIFIED STATEMENTS\");\n\t\t\tRSIterator it2 = ontModel.listReifiedStatements();\n\t\t\twhile(it2.hasNext()){\n\t\t\t\tSystem.out.println(it2.next());\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tlogger.error(e);\n\t\t}\n\n\t}", "public static void main(String[] args) throws Exception {\n\t\t\n\n BufferedReader reader = new BufferedReader(new FileReader(\"src/main/resources/example/ontologytemp.owl\"));\n BufferedWriter writer = new BufferedWriter(new FileWriter(\"src/main/resources/example/test.owl\"));\n\t\t\n\t\t\n\t\t/*File owl = new File(\"/Users/user/Dropbox/Thesis/OntopCLIfiles/ontology5.owl\");\n File obda = new File(\"/Users/user/Dropbox/Thesis/OntopCLIfiles/ontology-conf.obda\");\n\t\tString baseUri = \"http://www.semanticweb.org/user/ontologies/\";\n\t\tString jdbcUrl = \"jdbc:mysql://localhost/conference10\";\n\t\tString jdbcUserName = \"root\";\n\t\tString jdbcPassword = \"root\";\n\t\tString jdbcDriverClass = \"com.mysql.jdbc.Driver\";\n\t\t\n\t\tDirectMappingBootstrapper dm = new DirectMappingBootstrapper(baseUri, jdbcUrl, jdbcUserName, jdbcPassword, jdbcDriverClass);\n\t\tOBDAModel model = dm.getModel();\n\t\tOWLOntology onto = dm.getOntology();\n\t\tModelIOManager mng = new ModelIOManager(model);\n\t\tmng.save(obda);\n onto.getOWLOntologyManager().saveOntology(onto,\n new FileDocumentTarget(owl));*/\n\t\t\n\t\t\n\t\t/*\n\t\tXFactoryBufferedImpl factory = new XFactoryBufferedImpl();\t\n\t\t\n\t\tXAttribute attr = factory.createAttributeLiteral(\"concept:name\", \"tracevalue\", null); // create attribute for trace\n\t\tXAttributeMap attrMapTrace = new XAttributeMapImpl(); // create a new map attribute\n\t\tattrMapTrace.put(\"concept:name\", attr);\t// put attribute to the map attribute\n\t\tXTrace xtrace = factory.createTrace(attrMapTrace); // create xtrace\n\t\t\n\t\tXAttributeMap attrMap = new XAttributeMapImpl(); // create a new map attribute\n\t\tattr = factory.createAttributeLiteral(\"key1\", \"value\", null); // create attribute\t\t\n\t\t//attr = factory.createAttributeLiteral(\"key2\", \"value\", null); // create attribute\n\t\tattrMap.put(\"key1\", attr); // put attribute to the map attribute\n\t\t//attrMap.put(\"key2\", attr);\n\t\tXEvent xevent = factory.createEvent(attrMap); // create xevent\n\t\txtrace.insertOrdered(xevent); // insert event in correct order in a trace\n\t\t\n\t\tattrMap = new XAttributeMapImpl(); // create a new map attribute\n\t\tattr = factory.createAttributeLiteral(\"key1\", \"value\", null); // create attribute\t\t\n\t\t//attr = factory.createAttributeLiteral(\"key2\", \"value\", null); // create attribute\n\t\tattrMap.put(\"key1\", attr); // put attribute to the map attribute\n\t\t//attrMap.put(\"key2\", attr);\n\t\tXEvent xevent2 = factory.createEvent(attrMap); // create xevent\n\t\t\n\t\tSystem.out.println(xtrace.contains(xevent2));\n\t\t*/\n\t}", "void createGraphForDistributedSingleLoad();", "@RepositoryRestResource(collectionResourceRel = \"User\", path = \"User\")\npublic interface UserRepository extends Neo4jRepository<User, Long> {\n\n @Query(value = \"MATCH (a:User),(b:Report)\\n\" +\n \"WHERE a.username = :#{#username} AND ID(b) = :#{#reportId}\\n\" +\n \"CREATE (a)-[r:REPORT]->(b)\")\n @Transactional\n void createReportRelationship(@Param(\"username\") String username, @Param(\"reportId\") Long reportId);\n}", "private void connect() {\n\t\t//\n\t\ttry {\n\t\t\tconn = DriverManager.getConnection(logInfo, user, pwd);\n\t\t\tsmt = conn.createStatement();\n\t\t\tif (conn != null) {\n\t\t\t\tSystem.out.println(\"[System:] Postgres Connection successful\");\n\t\t\t\tstatus = true;\n\t\t\t} else {\n\t\t\t\tSystem.err.println(\"Failed to make connection!\");\n\t\t\t\tstatus = false;\n\t\t\t}\n\t\t} catch (SQLException e) {\n\t\t\tSystem.err.println(\"Connection Failed!\");\n\t\t\te.printStackTrace();\n\t\t\tstatus = false;\n\t\t}\n\t\t\n\t}", "public long wsadd_node(NodeWS node)\r\n\t\t\t\t{ \r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tlong id = 0; //id de la tabla user (único) \r\n\t\t\t\t Node nodeC = new Node(node.getNode_name(),node.getMAC_address(),node.getPort_number());\r\n\t\t\t\t \r\n\t\t\t\t //User cliente1 = new User(\"[email protected]\", \"gutie33\", 1, \"Luis\",\"677899876\", \"Informatica\"); \r\n\t\t\t\t \r\n\t\t\t\t try \r\n\t\t\t\t { \r\n\t\t\t\t iniciaOperacion(); \r\n\t\t\t\t \r\n\t\t\t\t id= (Long) sesion.createQuery(\"SELECT u.id_company FROM Company u WHERE u.company_name ='\"+node.getName_company()+\"'\").uniqueResult();\r\n\t\t\t\t Company x = (Company) sesion.load(Company.class, id);\r\n\t\t\t\t x.addNodo(nodeC);\r\n\t\t\t\t \r\n\t\t\t\t\t nodeC.setCompany(x);\r\n\t\t\t\t \r\n\t\t\t\t //sesion.update(compx);\r\n\t\t\t\t \r\n\t\t\t\t \r\n\t\t\t\t //metodo para guardar cliente (del objeto hibernate.sesion) \r\n\t\t\t\t tx.commit(); \r\n\t\t\t\t }catch(HibernateException he) \r\n\t\t\t\t { \r\n\t\t\t\t manejaExcepcion(he);\r\n\t\t\t\t throw he; \r\n\t\t\t\t }finally \r\n\t\t\t\t { \r\n\t\t\t\t \t//Busqueda del id con qu elo ha introducido a la BBDD\r\n\t\t\t\t \tid= (Long) sesion.createQuery(\"SELECT u.id_node FROM Node u WHERE u.node_name ='\"+node.getNode_name()+\"'\").uniqueResult();\r\n\t\t\t\t sesion.close(); \r\n\t\t\t\t } \r\n\t\t\t\t return id; \r\n\t\t\t\t}", "public void setUp() throws IOException\r\n\t{\r\n\r\n\t\tgraphDb = new GraphDatabaseFactory().newEmbeddedDatabase( dbPath );\r\n\t\tSystem.out.println(\"Connecting to the database...\"); \r\n\t\tSystem.out.println(\"Done!\");\r\n\r\n\t}", "@Test\n public void cluster() throws FlywayException {\n flyway.setLocations(\"migration/dbsupport/oracle/sql/cluster\");\n flyway.migrate();\n flyway.clean();\n flyway.migrate();\n }", "@Test\n public void testTransactional() throws Exception {\n try (CloseableCoreSession session = coreFeature.openCoreSessionSystem()) {\n IterableQueryResult results = session.queryAndFetch(\"SELECT * from Document\", \"NXQL\");\n TransactionHelper.commitOrRollbackTransaction();\n TransactionHelper.startTransaction();\n assertFalse(results.mustBeClosed());\n assertWarnInLogs();\n }\n }", "DBConnect() {\n \n }", "@Test\n public void testConnect() throws MainException {\n System.out.println(\"connect\");\n LinkingDb instance = new LinkingDb(new ConfigurazioneTO(\"jdbc:hsqldb:file:database/\",\n \"ADISysData\", \"asl\", \"\"));\n Connection result = instance.connect();\n assertNotNull(result);\n boolean expResult = true;\n assertEquals(instance.isConnected(), expResult);\n }", "public Graph getGraph4SingleCores(String nodeId, CustRelationshipMapper custRelationshipMapper, CustPropertyMapper custPropertyMapper) throws CustomException {\n if (StringUtils.isBlank(nodeId)) {\n throw new CustomException(\"[nodeId] is blank null or ' '\");\n }\n\n List<CustRelationship> oneDepthRels = custRelationshipMapper.selectAll1DRelByCertNo(nodeId);\n\n //Map<String, Object> graph = new HashMap<>();\n Graph graph = new Graph();\n if (oneDepthRels.size() == 0) {\n log.info(\"当前1度范围内[边]等于0, 将返回null\");\n graph = new Graph(null, null, StatusCode.NO_MATCHES);\n return graph;\n }\n\n\n\n //仅一度边\n Map<String, Edge> oneDepthEdges = new HashMap<>();\n //一度节点, 含中心\n Map<String, Node> oneDepthNodes = new HashMap<>();\n\n Node core = new Node();\n core.setId(nodeId);\n core.setDepth(0);\n //core 并入 onetDepthNodes\n oneDepthNodes.put(core.getId(), core);\n\n //遍历一度边, 封装数据\n gatherNodeEdge(oneDepthRels, oneDepthEdges, oneDepthNodes,1);\n\n Set<String> oneDepthNodesKeySet = oneDepthNodes.keySet();\n\n //判断一度节点个数, 小于阈值才会继续查询二度边\n if (oneDepthNodes.size() > MAX_DISPLAY_NODES_1D) {\n log.info(\"当前一度范围内[节点]个数大于[{}], 将仅返回一度节点和边数据\", MAX_DISPLAY_NODES_1D);\n\n\n List<CustProperty> custProperties = custPropertyMapper.selectByCertNos(oneDepthNodesKeySet);\n\n //封装点属性\n dumpCustPropertyData(oneDepthNodes, custProperties, 1);\n\n graph.setNodes(oneDepthNodes);\n graph.setEdges(oneDepthEdges);\n return graph;\n }\n\n\n // -- 一度范围节点数量在范围之内, 则获取所有二度边 --\n\n //装所有节点\n HashMap<String, Node> nodes = (HashMap<String, Node>) ((HashMap<String, Node>) oneDepthNodes).clone();\n //装所有的边\n HashMap<String, Edge> edges = (HashMap<String, Edge>) ((HashMap<String, Edge>) oneDepthEdges).clone();\n\n List<CustRelationship> allRel = custRelationshipMapper.selectRelByGivenCertNos(oneDepthNodesKeySet);\n if (allRel.size() > MAX_DISPLAY_EDGES) {\n log.info(\"当前二度范围内[边]总数大于[{}], 仅返回一度节点和边数据\", MAX_DISPLAY_EDGES);\n graph.setNodes(oneDepthNodes);\n graph.setEdges(oneDepthEdges);\n return graph;\n }\n\n // -- 二度范围边在范围之内, 则加工边数据集 --\n\n gatherNodeEdge(allRel, edges, nodes,2);\n /* ABANDON: 抽取\n for (CustRelationship rel : allRel) {\n //Note: oneDepthEdges中已有的, 不用再封装了, 没有的, 创建, 封装, 存入edges中, 且depth==2\n if (oneDepthEdges.get(rel.getId()) == null) {\n Edge edge = new Edge(rel.getId(), rel.getuCertNo(), rel.getvCertNo(), rel.getContent(), rel.getContentType(), rel.getRelationType());\n //新建的边, 说明depth==2\n edge.setDepth(2);\n //存入edges\n edges.put(String.valueOf(edge.getId()), edge);\n }\n\n //遇到新节点, 则存入nodes中, 且深度为2 !注意别存错了!\n gatherNodes(nodes, rel, 2);\n }\n */\n\n //查询所有属性: 核, 一度, 二度\n Set<String> allCertNos = nodes.keySet(); //获取所有身份证号, 查取属性数据\n List<CustProperty> custProperties = custPropertyMapper.selectByCertNos(allCertNos);\n\n //封装属性数据\n dumpCustPropertyData(nodes, custProperties, 2);\n\n //判断节点数目\n if (nodes.size() > MAX_DISPLAY_NODES_2D) {\n //0,1,2度节点之和超过阈值, 则只返回一度节点和边\n log.info(\"当前二度范围内[节点]总数大于[{}], 仅返回一度节点和边数据\", MAX_DISPLAY_NODES_2D);\n\n graph.setNodes(oneDepthNodes);\n graph.setEdges(oneDepthEdges);\n } else {\n //没有超限, 则返回1,2度全部\n log.info(\"返回全部二度范围内节点和边数据\");\n graph.setNodes(nodes);\n graph.setEdges(edges);\n }\n\n\n return graph;\n }", "protected void createRepository() throws Exception {\r\n\t\t\r\n\t\t//Creating MLSesame Connection object Using MarkLogicRepositoryConfig\r\n\t\t\r\n\t\tMarkLogicRepositoryConfig adminconfig = new MarkLogicRepositoryConfig();\r\n\t\tadminconfig.setHost(host);\r\n\t\tadminconfig.setAuth(\"DIGEST\");\r\n\t\tadminconfig.setUser(\"admin\");\r\n\t\tadminconfig.setPassword(\"admin\");\r\n\t\tadminconfig.setPort(restPort);\r\n\t\tRepositoryFactory factory = new MarkLogicRepositoryFactory();\r\n Assert.assertEquals(\"marklogic:MarkLogicRepository\", factory.getRepositoryType());\r\n try {\r\n\t\t\ttestAdminRepository = (MarkLogicRepository) factory.getRepository(adminconfig);\r\n\t\t} catch (RepositoryConfigException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n try {\r\n\t\t\ttestAdminRepository.initialize();\r\n\t\t\ttestAdminCon = (MarkLogicRepositoryConnection) testAdminRepository.getConnection();\r\n\t\t} catch (RepositoryException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n \r\n // Creating testAdminCon with MarkLogicRepositoryConfig constructor\r\n testAdminCon.close();\r\n testAdminRepository.shutDown();\r\n testAdminRepository = null; \r\n testAdminCon = null; \r\n \r\n adminconfig = new MarkLogicRepositoryConfig(host,restPort,\"admin\",\"admin\",\"DIGEST\");\r\n Assert.assertEquals(\"marklogic:MarkLogicRepository\", factory.getRepositoryType());\r\n testAdminRepository = (MarkLogicRepository) factory.getRepository(adminconfig);\r\n testAdminRepository.initialize();\r\n \r\n testAdminCon = testAdminRepository.getConnection();\r\n Assert.assertTrue(testAdminCon instanceof MarkLogicRepositoryConnection);\r\n \r\n Repository otherrepo = factory.getRepository(adminconfig);\r\n RepositoryConnection conn = null;\r\n try{\r\n \t //try to get connection without initializing repo, will throw error\r\n conn = otherrepo.getConnection();\r\n Assert.assertTrue(false);\r\n }\r\n catch(Exception e){\r\n \tAssert.assertTrue(e instanceof RepositoryException);\r\n \tAssert.assertTrue(conn == null);\r\n \totherrepo.shutDown();\r\n }\r\n \r\n Assert.assertTrue(testAdminCon instanceof MarkLogicRepositoryConnection);\r\n graph1 = testAdminCon.getValueFactory().createURI(\"http://marklogic.com/Graph1\");\r\n graph2 = testAdminCon.getValueFactory().createURI(\"http://marklogic.com/Graph2\");\r\n dirgraph = testAdminCon.getValueFactory().createURI(\"http://marklogic.com/dirgraph\");\r\n dirgraph1 = testAdminCon.getValueFactory().createURI(\"http://marklogic.com/dirgraph1\");\r\n \r\n \r\n //Creating MLSesame Connection object Using MarkLogicRepository overloaded constructor\r\n if(testReaderCon == null || testReaderRepository ==null){\r\n \ttestReaderRepository = new MarkLogicRepository(host, restPort, \"reader\", \"reader\", \"DIGEST\");\r\n\t try {\r\n\t\t\t\ttestReaderRepository.initialize();\r\n\t\t\t\tAssert.assertNotNull(testReaderRepository);\r\n\t\t\t\ttestReaderCon = (MarkLogicRepositoryConnection) testReaderRepository.getConnection();\r\n\t\t\t} catch (RepositoryException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t Assert.assertTrue(testReaderCon instanceof MarkLogicRepositoryConnection);\r\n\t \r\n\t }\r\n \r\n \r\n //Creating MLSesame Connection object Using MarkLogicRepository(databaseclient) constructor\r\n if (databaseClient == null){\r\n \tdatabaseClient = DatabaseClientFactory.newClient(host, restPort, \"writer\", \"writer\", DatabaseClientFactory.Authentication.valueOf(\"DIGEST\"));\r\n }\r\n \t\t\r\n\t\tif(testWriterCon == null || testWriterRepository ==null){\r\n\t\t\ttestWriterRepository = new MarkLogicRepository(databaseClient);\r\n\t\t\tqmgr = databaseClient.newQueryManager();\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\ttestWriterRepository.initialize();\r\n\t\t\t\tAssert.assertNotNull(testWriterRepository);\r\n\t\t\t\ttestWriterCon = (MarkLogicRepositoryConnection) testWriterRepository.getConnection();\r\n\t\t\t} catch (RepositoryException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "@Test\n public void shouldHandleDenseNodeWithNoRelationships() throws Exception\n {\n NeoStores stores = mock( NeoStores.class );\n NodeStore nodeStore = mock( NodeStore.class );\n when( stores.getNodeStore() ).thenReturn( nodeStore );\n RelationshipGroupStore relationshipGroupStore = mock( RelationshipGroupStore.class );\n when( stores.getRelationshipGroupStore() ).thenReturn( relationshipGroupStore );\n\n @SuppressWarnings( \"unchecked\" )\n StoreNodeRelationshipCursor cursor = new StoreNodeRelationshipCursor(\n new RelationshipRecord( -1 ),\n stores,\n new RelationshipGroupRecord( -1, -1 ),\n mock( StoreStatement.class ),\n mock( Consumer.class ),\n NO_LOCK_SERVICE );\n\n // WHEN\n cursor.init( true, NO_NEXT_RELATIONSHIP.intValue(), 0, BOTH );\n\n // THEN\n verifyNoMoreInteractions( relationshipGroupStore );\n assertFalse( cursor.next() );\n }", "@Ignore\n @Test\n public void testCreateIndex() {\n System.out.println(\"createIndex\");\n Util.commonServiceIPs=\"127.0.0.1\";\n \n EntityManager em=Util.getEntityManagerFactory(100).createEntityManager();\n EntityManager platformEm = Util.getPlatformEntityManagerFactory().createEntityManager();\n \n Client client = ESUtil.getClient(em,platformEm,1,false);\n \n RuntimeContext.dataobjectTypes = Util.getDataobjectTypes();\n String indexName = \"test000000\";\n try {\n ESUtil.createIndex(platformEm, client, indexName, true);\n }\n catch(Exception e)\n {\n \n }\n \n\n }", "public static void test() {\n\t\t\n\t\tSystem.out.println(\"\\n\\n------------ TESTING CODE ASSIGNMENT 4D --------------\\n\\n\");\n\t\t\n\t\t\n\t\tEntityManagerFactory entityManagerFactory = PersistenceUtil.getEntityManagerFactory();\n\t\tEntityManager entityManager = entityManagerFactory.createEntityManager();\n\t\t\n\t\tentityManager.getTransaction().begin();\n\t\n\t\tSQLInterceptor.resetSelectCount();\n\t\t\n//\t\tSystem.out.println(\"Executing efficient query of task 2b:\");\n\t\tJPQLQueries jpqlQueries = new JPQLQueries(entityManager);\n\t\tjpqlQueries.getComputerUsage();\n\t\t\n\t\tSQLInterceptor.printSelectCount();\n\t\t\n\t\tentityManager.getTransaction().commit();\n\t\tentityManager.close();\n\t}", "@Test\n public void testProcessor () {\n getOrphanTables(1L);\n updateConstraints();\n deleteConstraints(1L);\n\n }", "private void addNode(String name)\n {\n try (Session session = driver.session())\n {\n // Wrapping Cypher in an explicit transaction provides atomicity\n // and makes handling errors much easier.\n try (Transaction tx = session.beginTransaction())\n {\n tx.run(\"MERGE (a:Node {value: {x}})\", parameters(\"x\", name));\n tx.success(); // Mark this write as successful.\n }\n }\n }", "DatabaseClient newModulesDbClient();", "public static void testConnection() throws SerializeException, IOException {\n // コネクション設定\n String configFileName = \"/ormappingtool.xml\";\n ORmappingToolConfig config = SerializeUtils.bytesToObject(TestCommon.class.getResourceAsStream(configFileName), ORmappingToolConfig.class);\n config.getConnectionConfig().convURL();\n ConnectionManager.getInstance().addConnectionConfig(config.getConnectionConfig());\n }", "@Override\n public int getDatabaseMajorVersion() {\n return 1;\n }", "@RequestMapping(\"/orient\")\n public String callOrientTest() {\n String response = \"\";\n for (Vertex v : orientDBConnection.getGraph().query().has(\"Nome\", \"Tommaso\").vertices()) {\n System.out.println(\"Selected node: \" + v.getProperty(\"Nome\") + v.getProperty(\"Cognome\"));\n response += v.getProperty(\"Cognome\") + \"\\n\";\n }\n\n for (Vertex v : orientDBConnection.getGraph().query().has(\"Cap\", 61032).vertices()) {\n System.out.println(\"Selected node: \" + v.getProperty(\"Via\") + v.getProperty(\"Provincia\"));\n response += v.getProperty(\"Via\") + \"\\n\";\n }\n\n\n return response;\n }", "public static void main(String[] args) {\n final GraphNode root=new GraphBuilderConcurentV0().build(XOField.Figure.X,new XOField(),0);\n\n System.out.println(root.getNode());\n// GraphHelper.show(root,0);\n System.out.println(GraphHelper.countNodes(root));\n }", "public static void main(String[] args) throws Exception {\n\t\tConnection con = DriverManager.getConnection(args[0]);\n\t\tDatabaseMetaData dbmd = con.getMetaData();\n\t\ttry {\n\t\t\t// inspect the catalog by use of dbmd functions\n\t\t\tdumpResultSet(dbmd.getCatalogs());\n//\t\t\tdumpResultSet(dbmd.getSchemas());\t// this produces different outputs on different platforms due to dependency on SAMTOOLS and NETCDF. so exclude it\n\t\t\tdumpResultSet(dbmd.getSchemas(null, \"sys\"));\n//\t\t\tdumpResultSet(dbmd.getTables(null, \"sys\", null, null));\t// this produces different outputs on different platforms due to dependency on Geom and NETCDF.\n\t\t\tdumpResultSet(dbmd.getTables(null, \"tmp\", null, null));\t// schema tmp has 6 tables\n\t\t\tdumpResultSet(dbmd.getUDTs(null, \"sys\", null, null));\n\t\t\tint[] UDTtypes = { Types.STRUCT, Types.DISTINCT };\n\t\t\tdumpResultSet(dbmd.getUDTs(null, \"sys\", null, UDTtypes));\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"FAILED :( \"+ e.getMessage());\n\t\t\tSystem.out.println(\"ABORTING TEST!!!\");\n\t\t}\n\t\tcon.close();\n\t}", "Community() {}", "public ArangoDBVertex() {\n\t\tsuper();\n\t}", "@Test\n public void example13 () throws Exception {\n Map<String, Stmt> inputs = example2setup();\n conn.setNamespace(\"ex\", \"http://example.org/people/\");\n conn.setNamespace(\"ont\", \"http://example.org/ontology/\");\n String prefix = \"PREFIX ont: \" + \"<http://example.org/ontology/>\\n\";\n \n String queryString = \"select ?s ?p ?o where { ?s ?p ?o} \";\n TupleQuery tupleQuery = conn.prepareTupleQuery(QueryLanguage.SPARQL, queryString);\n assertSetsEqual(\"SELECT result:\", inputs.values(),\n statementSet(tupleQuery.evaluate()));\n \n assertTrue(\"Boolean result\",\n conn.prepareBooleanQuery(QueryLanguage.SPARQL,\n prefix + \n \"ask { ?s ont:name \\\"Alice\\\" } \").evaluate());\n assertFalse(\"Boolean result\",\n conn.prepareBooleanQuery(QueryLanguage.SPARQL,\n prefix + \n \"ask { ?s ont:name \\\"NOT Alice\\\" } \").evaluate());\n \n queryString = \"construct {?s ?p ?o} where { ?s ?p ?o . filter (?o = \\\"Alice\\\") } \";\n GraphQuery constructQuery = conn.prepareGraphQuery(QueryLanguage.SPARQL, queryString);\n assertSetsEqual(\"Construct result\",\n mapKeep(new String[] {\"an\"}, inputs).values(),\n statementSet(constructQuery.evaluate()));\n \n queryString = \"describe ?s where { ?s ?p ?o . filter (?o = \\\"Alice\\\") } \";\n GraphQuery describeQuery = conn.prepareGraphQuery(QueryLanguage.SPARQL, queryString);\n assertSetsEqual(\"Describe result\",\n mapKeep(new String[] {\"an\", \"at\"}, inputs).values(),\n statementSet(describeQuery.evaluate()));\n }", "public void connect() throws PersistenceMechanismException {\n\t\t\r\n\t}", "public static void main(String args[]) throws Exception{\n\t\t\n\t\tClass.forName(\"org.postgresql.Driver\");\n\t\t\n\t\tConnection connection = DriverManager.getConnection(\n\t\t\t\t\"jdbc:postgresql://10.1.3.233:5432/postgres\", \"postgres\",\"123456\");\n\t\t\n\t\t//DatabaseMetaData metaData = connection.getMetaData();\n\t\t//System.out.println(metaData.getDatabaseProductName());\n\n\t\tStatement statement = connection.createStatement();\n\t\tResultSet result = statement.executeQuery(\"select * from table1\");\n\t\twhile(result.next()){\n\t\t\tSystem.out.println(result.getString(1));\n\t\t}\n\t\tconnection.close();\n\t}", "public boolean connect(){\n if(isConnect)\n return true;\n\n this.isConnect = true;\n\n this.repository = sqLiteConnect(new Repository().getColumnType());\n\n if(this.repository == null){\n ItemBox.getLogger().severe(\"[Database] \\\"repository\\\" connect fail!\");\n return false;\n }\n\n\n ItemBox.getLogger().info(\"[Database] connect success\");\n return true;\n }", "public void testImportNonEmptyDB() throws Exception {\n URL testXMLFileURL = getClass().getResource(\"prox2db-testdb.xml\");\n new ImportProx2XMLApp(testXMLFileURL.getFile());\n\n // check the resulting database\n verifyObjects(new String[]{\"0\", \"1\", \"2\", \"3\", \"4\"});\n verifyLinks(new String[][]{\n {\"0\", \"1\", \"2\"},\n {\"1\", \"0\", \"3\"},\n {\"2\", \"1\", \"3\"},\n {\"3\", \"1\", \"2\"},\n {\"4\", \"3\", \"4\"}});\n verifyAttribute(\"name\", \"O\", \"VARCHAR\", new String[][]{\n {\"3\", \"Matthew Cornell\"},\n {\"2\", \"David Jensen\"},\n {\"4\", \"our place (an already existing obj)\"}});\n verifyAttribute(\"obj-type\", \"O\", \"VARCHAR\", new String[][]{\n {\"3\", \"person\"},\n {\"2\", \"person\"},\n {\"1\", \"research group\"}});\n verifyAttribute(\"office-num\", \"O\", \"INTEGER\", new String[][]{\n {\"3\", \"218\"},\n {\"2\", \"238\"}});\n verifyAttribute(\"double-test\", \"O\", \"DOUBLE\", new String[][]{\n {\"3\", \"3\"},\n {\"2\", \"2.1000000000000001\"}}); // NB: values match those in file and take into account double precision math changes in Monet version 4.3.14\n verifyAttribute(\"date-test\", \"O\", \"DATE\", new String[][]{\n {\"3\", \"2003-08-25\"},\n {\"2\", \"1962-10-22\"}});\n verifyAttribute(\"link-test\", \"L\", \"VARCHAR\", new String[][]{\n {\"3\", \"this looks like an object ref: _[xx],_but it isn_t because it_s inside a link attribute\"}});\n verifyAttribute(\"link-type\", \"L\", \"VARCHAR\", new String[][]{\n {\"2\", \"member\"},\n {\"3\", \"member\"},\n {\"4\", \"lives-at\"}});\n verifyAttribute(\"nickname\", \"O\", \"VARCHAR\", new String[][]{\n {\"1\", \"kdl\"},\n {\"2\", \"dj\"},\n {\"3\", \"me\"},\n {\"4\", \"home\"}});\n verifyAttribute(\"sa.implied\", \"L\", \"INTEGER\", new String[][]{\n {\"0\", \"1\"},\n {\"1\", \"1\"}});\n verifyAttribute(\"sa.undefined\", \"O\", \"INTEGER\", new String[][]{{}});\n\n veryifyCollection(\"test-coll\", new String[]{\"0\"},\n new String[][]{\n {\"0\", \"0\", \"#test\"},\n {\"0\", \"1\", \"kdl\"},\n {\"0\", \"2\", \"dj\"},\n {\"0\", \"3\", \"me\"},\n {\"0\", \"4\", \"home\"}},\n new String[][]{\n {\"0\", \"0\", \"0:implied:kdl->dj\"},\n {\"0\", \"1\", \"1:implied:#test->me\"},\n {\"0\", \"2\", \"2:kdl->me\"},\n {\"0\", \"3\", \"3:kdl->dj\"},\n {\"0\", \"4\", \"4:me->home\"}});\n veryifyCollection(\"qg2test\", new String[]{\"1\", \"2\", \"3\"},\n new String[][]{\n {\"1\", \"1\", \"group\"},\n {\"2\", \"1\", \"group\"},\n {\"3\", \"1\", \"group\"},\n {\"1\", \"2\", \"person\"},\n {\"2\", \"3\", \"person\"},\n {\"3\", \"2\", \"person\"}},\n new String[][]{\n {\"1\", \"0\", \"group-person\"},\n {\"2\", \"2\", \"group-person\"},\n {\"3\", \"3\", \"group-person\"}});\n }", "@Test\n public void testIsConnected() throws MainException {\n System.out.println(\"isConnected\");\n LinkingDb instance = new LinkingDb(new ConfigurazioneTO(\"jdbc:hsqldb:file:database/\",\n \"ADISysData\", \"asl\", \"\"));\n instance.connect();\n boolean expResult = true;\n boolean result = instance.isConnected();\n assertEquals(expResult, result);\n instance.disconnect();\n result = instance.isConnected();\n assertEquals(false, result);\n\n }", "public static void openConnection() {\n try {\n connection = DriverManager.getConnection(\"jdbc:oracle:thin:@localhost:1521:XE\", \"system\", \"kevin2000\");\n connection.setAutoCommit(true);\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "public List<Node> node_list() throws HibernateException \r\n\t\t{ \r\n\t\t\tList <Node> Lista_nodos = null; \r\n\t\t \r\n\t\t try \r\n\t\t { \r\n\t\t iniciaOperacion(); //IMPORTANTE la query: se pide la clase realmnete Cliente! no la tabla que se ha creado\r\n\t\t Lista_nodos= sesion.createQuery(\"FROM Node\").list(); //creamos consulta de la tabla clientes (en plural)!\r\n\t\t }finally \r\n\t\t { \r\n\t\t sesion.close(); \r\n\t\t } \r\n\t\t return Lista_nodos; \r\n\t\t}", "@Test(expected = NotFoundException.class)\n public void testDeleteEntityFromGDC() {\n Transaction tx = graphDatabaseContext.beginTx();\n Person p = new Person(\"Michael\", 35);\n Person spouse = new Person(\"Tina\", 36);\n p.setSpouse(spouse);\n long id = spouse.getId();\n graphDatabaseContext.removeNodeEntity(spouse);\n tx.success();\n tx.finish();\n Assert.assertNull(\"spouse removed \" + p.getSpouse(), p.getSpouse());\n NodeFinder<Person> finder = finderFactory.createNodeEntityFinder(Person.class);\n Person spouseFromIndex = finder.findByPropertyValue(Person.NAME_INDEX, \"name\", \"Tina\");\n Assert.assertNull(\"spouse not found in index\",spouseFromIndex);\n Assert.assertNull(\"node deleted \" + id, graphDatabaseContext.getNodeById(id));\n }", "@Before\n\t@SuppressWarnings(\"unchecked\")\n\tpublic void setUp() {\n\t\tfactoryBean = new Neo4jRepositoryFactoryBean(ContactRepository.class);\n\t\tfactoryBean.setSession(session);\n\t\tfactoryBean.setMappingContext(context);\n\t}", "public interface UserRepository extends GraphRepository<User> {\n\n/* @Query(\"MATCH (p:User)-[r:KNOWS]->(a:User) RETURN p,r,a\")\n Collection<User> graph(@Param(\"limit\") int limit);*/\n\n// @Query(\"START user=node:User(userName={userName}) RETURN user\")\n\n @Query(\"Match (fi:User)-[:KNOWS]->(u:User)-[:KNOWS]->(fo:User) where u.userName={0} return fo\")\n Collection<User> searchFriends(String name);\n\n @Query(\"MATCH (user:User) WHERE user.userName={0} RETURN user\")\n User getUserFromName(String name);\n\n @Query(\"MATCH (user:User)-[:KNOWS*2..2]->(fof:User) WHERE not((user)-[:KNOWS]->(fof)) AND user.userName={name} RETURN fof\")\n Set<User> getFriendOfFriend(@Param(\"name\") String name);\n}", "public void createGraphDB() throws SQLException {\n \t\tString nodes = \"insert into nodes(id,label,url,sex,single) select fbid,name,'http://www.facebook.com/profile.php?id='||fbid,sex,single from users;\";\n \t\tString edges = \"insert into edges select distinct users.fbid as source, friends.friendfbid as target, '5' as weight, 'knows' as name from users join friends where friends.userid=users.id\";\n \t\tpreparedStatement = connect.prepareStatement(nodes);\n \t\tpreparedStatement.execute();\n \t\tpreparedStatement = connect.prepareStatement(edges);\n \t\tpreparedStatement.execute();\n \t\tpreparedStatement.close();\n \t}", "@Test \n\tpublic void testTopologyNodes() { \n\t\tRestAssured.registerParser(\"text/plain\", Parser.JSON);\n\t\texpect().get(\"/rest/topo\").then().statusCode(200).assertThat().body(\"nodes\", Matchers.notNullValue());\n\t}", "@Test\r\n void test_insert_1_vertex_check() {\r\n graph.addVertex(\"1\");\r\n vertices = graph.getAllVertices();\r\n if (!vertices.contains(\"1\"))\r\n fail(\"Insert not working!!\");\r\n }", "@Test\n public void tae0()\n {\n Graph g = new Graph(2);\n g.addEdge(0, 1);\n System.out.println(g);\n assertEquals(g.toString(), \"numNodes: 2\\nedges: [[false, true], [false, false]]\");\n }", "@Before\r\n public void setUp() {\r\n try {\r\n Connection conn=DriverManager.getConnection(\"jdbc:oracle:thin:@//localhost:1521/XE\",\"hr\",\"hr\");\r\n Statement stmt = conn.createStatement();\r\n stmt.execute(\"INSERT INTO PkgOrders (Pkg_Order_Id, Order_Id, Package_Id, Customer_Id, Price_Per_Pkg, Quantity, Is_Open) \"\r\n + \" VALUES (-1,-1,-1,-1,1.99,1,0)\");\r\n stmt.execute(\"INSERT INTO PkgOrders (Pkg_Order_Id, Order_Id, Package_Id, Customer_Id, Price_Per_Pkg, Quantity, Is_Open) \"\r\n + \" VALUES (-2,-2,-2,-2,2.99,2,0)\");\r\n } catch (Exception e) {System.out.println(e.getMessage());}\r\n }", "protected SceneGraphObject createNode() {\n\tthrow new SGIORuntimeException(\"createNode() not implemented in class \"+this.getClass().getName());\n }", "public OrientGraph getGraphTx();", "private void connectDatabase(){\n }", "public static void main( String[] args ) {\n\n Model m = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM_RDFS_INF);\n\n\n FileManager.get().readModel( m, owlFile );\n String myOntologyName = \"http://www.w3.org/2002/07/owl#\";\n String myOntologyNS = \"http://www.w3.org/2002/07/owl#\";\n////\n////\n// String rdfPrefix = \"PREFIX rdf: <\"+RDF.getURI()+\">\" ;\n// String myOntologyPrefix = \"PREFIX \"+myOntologyName+\": <\"+myOntologyNS+\">\" ;\n// String myOntologyPrefix1 = \"PREFIX \"+myOntologyName ;\n String myOntologyPrefix2 = \"prefix pizza: <http://www.w3.org/2002/07/owl#> \";\n//\n//\n//// String queryString = myOntologyPrefix + NL\n//// + rdfPrefix + NL +\n//// \"SELECT ?subject\" ;\n \n String queryString = rdfPrefix + myOntologyPrefix2 +\n// \t\t \"prefix pizza: <http://www.w3.org/2002/07/owl#> \"+ \n \t\t \"prefix rdfs: <\" + RDFS.getURI() + \"> \" +\n \t\t \"prefix owl: <\" + OWL.getURI() + \"> \" +\n// \t\t \"select ?o where {?s ?p ?o}\";\n \n//\t\t\t\t\t\t\"select ?s where {?s rdfs:label \"苹果\"@zh}\";\n \n// \"SELECT ?label WHERE { ?subject rdfs:label ?label }\" ;\n// \"SELECT DISTINCT ?predicate ?label WHERE { ?subject ?predicate ?object. ?predicate rdfs:label ?label .}\";\n// \"SELECT DISTINCT ?s WHERE {?s rdfs:label \\\"Italy\\\"@en}\" ;\n// \"SELECT DISTINCT ?s WHERE {?s rdfs:label \\\"苹果\\\"@zh}\" ;\n// \"SELECT DISTINCT ?s WHERE\" +\n// \"{?object rdfs:label \\\"水果\\\"@zh.\" +\n// \"?subject rdfs:subClassOf ?object.\" +\n// \"?subject rdfs:label ?s}\";\n //星号是转义字符,分号是转义字符\n\t\t\t\t\"SELECT DISTINCT ?e ?s WHERE {?entity a ?subject.?subject rdfs:subClassOf ?object.\"+\n \"?object rdfs:label \\\"富士苹果\\\"@zh.?entity rdfs:label ?e.?subject rdfs:label ?s}ORDER BY ?s\";\n \t\t\n\n \n \t\tcom.hp.hpl.jena.query.Query query = QueryFactory.create(queryString);\n \t\tQueryExecution qe = QueryExecutionFactory.create(query, m);\n \t\tcom.hp.hpl.jena.query.ResultSet results = qe.execSelect();\n\n \t\tResultSetFormatter.out(System.out, results, query);\n \t\tqe.close();\n\n// Query query = QueryFactory.create(queryString) ;\n\n query.serialize(new IndentedWriter(System.out,true)) ;\n System.out.println() ;\n\n\n\n QueryExecution qexec = QueryExecutionFactory.create(query, m) ;\n\n try {\n\n ResultSet rs = qexec.execSelect() ;\n\n\n for ( ; rs.hasNext() ; ){\n QuerySolution rb = rs.nextSolution() ;\n RDFNode y = rb.get(\"person\");\n System.out.print(\"name : \"+y+\"--- \");\n Resource z = (Resource) rb.getResource(\"person\");\n System.out.println(\"plus simplement \"+z.getLocalName());\n }\n }\n finally{\n qexec.close() ;\n }\n }", "@Before\n public void setUp() {\n DB.sql2o = new Sql2o(\"jdbc:postgresql://localhost:5432/hair_salon_test\", \"alexander\", \"1234\");\n }", "@Test\n\tpublic void testSchemaIsComplete() {\n\t\tOrientGraph g = factory.getTx();\n\t\tOrientVertexType t = g.getVertexType(\"ElementTrace\");\n\t\tassertThat(t, is(notNullValue()));\n\t\t\n\t\tOrientEdgeType et = g.getEdgeType(\"Accesses\");\n\t}", "@Override\n public boolean isCommunity() {\n return false;\n }" ]
[ "0.6494707", "0.6229821", "0.6130768", "0.57852215", "0.56801534", "0.5679467", "0.55506104", "0.5464223", "0.54079473", "0.5375849", "0.53356475", "0.5289153", "0.5282553", "0.5253495", "0.52218306", "0.52176136", "0.52135825", "0.5211182", "0.5190236", "0.51570696", "0.51417696", "0.51233834", "0.5116038", "0.50946236", "0.50841665", "0.50839716", "0.5082308", "0.50770044", "0.5058035", "0.50563556", "0.50445265", "0.5032294", "0.5031568", "0.49935535", "0.4987727", "0.49826247", "0.497525", "0.49701342", "0.4966554", "0.4963063", "0.4957197", "0.49392977", "0.49391833", "0.4925768", "0.4920694", "0.49191824", "0.49005803", "0.4888993", "0.4874639", "0.48671833", "0.48660743", "0.48588234", "0.4854445", "0.4850505", "0.48472595", "0.48389733", "0.4833058", "0.48298335", "0.48264238", "0.48216382", "0.4820851", "0.48181838", "0.48120046", "0.48119855", "0.48101884", "0.48004195", "0.47989202", "0.47863853", "0.47816232", "0.4777897", "0.47743186", "0.4763539", "0.4763376", "0.4756682", "0.47564754", "0.4754298", "0.47539344", "0.4748392", "0.47390535", "0.47258407", "0.47248954", "0.47198203", "0.47192162", "0.4710629", "0.47000763", "0.46996444", "0.46984997", "0.46925485", "0.46909553", "0.46905872", "0.4690025", "0.46849555", "0.46823537", "0.46780208", "0.46776938", "0.46680143", "0.46663705", "0.466337", "0.466054", "0.4658388", "0.4651185" ]
0.0
-1
from here on, it's necessary that Neo4j community edition is correctly installed, in operation and with some stored data
@Test void retrieveExistTest() throws Exception { mockMvc.perform(MockMvcRequestBuilders.get("/some/0")) .andDo(MockMvcResultHandlers.print()) .andExpect(MockMvcResultMatchers.status().isOk()) .andExpect(MockMvcResultMatchers.jsonPath("$.code").exists()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Before\n\tpublic void setUp() throws Exception {\n\t\tClass.forName(\"org.neo4j.jdbc.Driver\");\n\t\t\n\t\t// Connect\n\t\tProperties info = new Properties();\n\t\tinfo.put(\"user\", \"neo4j\");\n\t\tinfo.put(\"password\", \"123\");\n//\t\tfinal String connectionStr = \"jdbc:neo4j://192.168.1.22:7474/\";\n\t\tfinal String connectionStr = \"jdbc:neo4j://localhost:7474/\";\n\t\tNeo4jConnection con = (Neo4jConnection)DriverManager.getConnection(connectionStr, info);\n\n\t\t// Querying\n\t\tstmt = con.createStatement();\n\t\t\n\t\t\n\t}", "@Before\n public void setupDatabase() {\n graphDb = new TestGraphDatabaseFactory().newImpermanentDatabaseBuilder().newGraphDatabase();\n registerShutdownHook(graphDb);\n \n// server = new WrappingNeoServerBootstrapper((GraphDatabaseAPI) graphDb);\n// server.start();\n \n ProcessEngineConfiguration processEngineConfiguration = new ProcessEngineConfiguration();\n processEngineConfiguration.setGraphDatabaseService(graphDb);\n processEngine = processEngineConfiguration.buildProcessEngine();\n }", "public static void main(String args[]) {\r\n\r\n// A driver is used to connect to a Neo4j server. It provides sessions that are used to execute statements and retrieve results.\r\n// If no port is provided in the URL, the default port 7687 is used\r\n\r\n Driver driver = GraphDatabase.driver(\"bolt://localhost\", AuthTokens.basic(\"neo4j\", \"saneo4j\"));\r\n// Driver driver = GraphDatabase.driver(\"bolt://50.16.185.228\", AuthTokens.basic(\"neo4j\", \"saneo4j\"));\r\n Session session = driver.session();\r\n\r\n// Cleanup all existing nodes and their relationship entries\r\n cleanupDB(session);\r\n\r\n// read from the input files and add connection\r\n readFilesFromInputDir(session);\r\n\r\n// Specific relationship in MATCH\r\n String search_for1 = \"Cloud computing\";\r\n String search_in1 = \"Experience\";\r\n// searchByRelationship1(session, search_for1, search_in1);\r\n\r\n// Generic relationship\r\n String search_for2 = \"CEO\";\r\n// searchByAll(session, search_for2);\r\n\r\n// Specific relationship in WHERE\r\n String search_for3 = \"san francisco, london washington; Chicago Manchester, cambridge\";\r\n String search_in3 = \"Location\";\r\n searchByRelationship2(session, search_for3, search_in3);\r\n\r\n session.close();\r\n driver.close();\r\n }", "private void test() throws Exception {\r\n session.execute(new Set(Prop.SERIALIZE, true));\r\n // loop through all databases\r\n for(int d = 0; d < databases.size(); d++) {\r\n // open database and loop through all queries\r\n session.execute(new Open(databases.get(d)));\r\n for(int q = 0; q < queries.size(); q++) {\r\n results[q] = addSortedServer(results[q], query(d, q));\r\n }\r\n session.execute(new Close());\r\n }\r\n }", "private void addArbitraryDataToDatabase() {\n\n try (Transaction tx = graphDatabaseService.beginTx()) {\n Node arbitraryNode = graphDatabaseService.createNode(DynamicLabel.label(\"NotAClass\"));\n arbitraryNode.setProperty(\"name\", \"Colin\");\n Node otherNode = graphDatabaseService.createNode(DynamicLabel.label(\"NotAClass\"));\n otherNode.setProperty(\"age\", 39);\n arbitraryNode.createRelationshipTo(otherNode, DynamicRelationshipType.withName(\"TEST\"));\n\n tx.success();\n }\n }", "private static void testConnection(GraknSession session) {\n try (GraknGraph graph = session.open(GraknTxType.READ)) {\n\n // construct a match query to find people\n MatchQuery query = graph.graql().match(var(\"x\").isa(\"mirna\"));\n\n // execute the query\n List<Answer> result = query.limit(10).execute();\n\n // if there is no data throw error\n if (result.isEmpty()) {throw new RuntimeException(\"Expected data is not present in the graph.\");}\n System.out.println(\"Connection OK.\");\n }\n }", "@Test\r\n\tpublic void testGetStatementsInSingleContext()\r\n\t\tthrows Exception\r\n\t{\r\n\t\ttry{\r\n\t\t\ttestAdminCon.begin();\r\n\t\t\ttestAdminCon.add(micah, lname, micahlname, dirgraph1);\r\n\t\t\ttestAdminCon.add(micah, fname, micahfname, dirgraph1);\r\n\t\t\ttestAdminCon.add(micah, homeTel, micahhomeTel, dirgraph1);\r\n\t\t\t\r\n\t\t\ttestAdminCon.add(john, fname, johnfname,dirgraph);\r\n\t\t\ttestAdminCon.add(john, lname, johnlname,dirgraph);\r\n\t\t\ttestAdminCon.add(john, homeTel, johnhomeTel,dirgraph);\r\n\t\t\t\r\n\t\t\t\r\n\t\t\tAssert.assertEquals(\"Size of dirgraph1 must be 3\",3, testAdminCon.size(dirgraph1));\r\n\t\t\tAssert.assertEquals(\"Size of unknown context must be 0\",0L, testAdminCon.size(vf.createURI(\":asd\")));\r\n\t\t\tAssert.assertEquals(\"Size of dirgraph must be 3\",3, testAdminCon.size(dirgraph));\t\r\n\t\t\tAssert.assertEquals(\"Size of repository must be 6\",6, testAdminCon.size());\r\n\t\t\tAssert.assertEquals(\"Size of repository must be 6\",6, testAdminCon.size(dirgraph,dirgraph1,null));\r\n\t\t\tAssert.assertEquals(\"Size of repository must be 6\",6, testAdminCon.size(dirgraph,dirgraph1));\r\n\t\t\tAssert.assertEquals(\"Size of repository must be 3\",3, testAdminCon.size(dirgraph,null));\r\n\t\t\tAssert.assertEquals(\"Size of repository must be 3\",3, testAdminCon.size(dirgraph1,null));\r\n\t\t\tAssert.assertEquals(\"Size of default graph must be 0\",0, testAdminCon.size(null));\r\n\t\t\t\r\n\t\t\t\r\n\t\t\ttestAdminCon.add(dirgraph, vf.createURI(\"http://TYPE\"), vf.createLiteral(\"Directory Graph\"));\r\n\t\t\tAssert.assertEquals(\"Size of default graph must be 1\",1, testAdminCon.size((Resource)null));\r\n\t\t\tAssert.assertEquals(\"Size of repository must be 4\",4, testAdminCon.size(dirgraph,null));\r\n\t\t\ttestAdminCon.commit();\t\r\n\t\t}\r\n\t\tcatch(Exception e){\r\n\t\t\t\r\n\t\t}\r\n\t\tfinally{\r\n\t\t\tif (testAdminCon.isActive())\r\n\t\t\t\ttestAdminCon.rollback();\r\n\t\t}\r\n\t\tAssert.assertEquals(\"Size of repository must be 4\",4, testAdminCon.size(dirgraph1,null));\r\n\t\tAssert.assertEquals(1, testAdminCon.size(null));\r\n\t\tAssert.assertEquals(1, testAdminCon.size(null, null));\r\n\t\tAssert.assertEquals(3, testAdminCon.size(dirgraph, dirgraph));\r\n\t\t\r\n\t\r\n\t\tassertTrue(\"Repository should contain statement\", testAdminCon.hasStatement(john, homeTel, johnhomeTel, false));\r\n\t\tassertTrue(\"Repository should contain statement in dirgraph1\",\r\n\t\t\t\ttestAdminCon.hasStatement(micah, lname, micahlname, false, dirgraph1));\r\n\t\tassertFalse(\"Repository should not contain statement in context2\",\r\n\t\t\t\ttestAdminCon.hasStatement(micah, lname, micahlname, false, dirgraph));\r\n\r\n\t\t// Check handling of getStatements without context IDs\r\n\t\tRepositoryResult<Statement> result = testAdminCon.getStatements(micah, lname, null, false);\r\n\t\ttry {\r\n\t\t\twhile (result.hasNext()) {\r\n\t\t\t\tStatement st = result.next();\r\n\t\t\t\tassertThat(st.getSubject(), is(equalTo((Resource)micah)));\r\n\t\t\t\tassertThat(st.getPredicate(), is(equalTo(lname)));\r\n\t\t\t\tassertThat(st.getObject(), is(equalTo((Value)micahlname)));\r\n\t\t\t\tassertThat(st.getContext(), is(equalTo((Resource)dirgraph1)));\r\n\t\t\t}\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tresult.close();\r\n\t\t}\r\n\r\n\t\t// Check handling of getStatements with a known context ID\r\n\t\tresult = testAdminCon.getStatements(null, null, null, false, dirgraph);\r\n\t\ttry {\r\n\t\t\twhile (result.hasNext()) {\r\n\t\t\t\tStatement st = result.next();\r\n\t\t\t\tassertThat(st.getContext(), is(equalTo((Resource)dirgraph)));\r\n\t\t\t}\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tresult.close();\r\n\t\t}\r\n\t\r\n\t\t\r\n\t\t// Check handling of getStatements with null context\r\n\t\tresult = testAdminCon.getStatements(null, null, null, false, null);\r\n\t\tassertThat(result, is(notNullValue()));\r\n\t\ttry {\r\n\t\t\twhile (result.hasNext()) {\r\n\t\t\t\tStatement st = result.next();\r\n\t\t\t\tassertThat(st.getContext(), is(equalTo((Resource)null)));\r\n\t\t\t}\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tresult.close();\r\n\t\t}\r\n\t\t\r\n\t\t// Check handling of getStatements with an unknown context ID\r\n\t\tresult = testAdminCon.getStatements(null, null, null, false, vf.createURI(\":unknownContext\"));\r\n\t\ttry {\r\n\t\t\tassertThat(result, is(notNullValue()));\r\n\t\t\tassertThat(result.hasNext(), is(equalTo(false)));\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tresult.close();\r\n\t\t}\r\n\r\n\t\tList<Statement> list = Iterations.addAll(testAdminCon.getStatements(null, lname, null, false, dirgraph1),\r\n\t\t\t\tnew ArrayList<Statement>());\r\n\t\tassertNotNull(\"List should not be null\", list);\r\n\t\tassertFalse(\"List should not be empty\", list.isEmpty());\r\n\t\t\r\n\t\tList<Statement> list1 = Iterations.addAll(testAdminCon.getStatements(dirgraph, null, null, false, null),\r\n\t\t\t\tnew ArrayList<Statement>());\r\n\t\tassertNotNull(\"List should not be null\", list1);\r\n\t\tassertFalse(\"List should not be empty\", list1.isEmpty());\r\n\t\t\r\n\t}", "@Test\r\n public void testGraphPerms1()\r\n throws Exception {\r\n\r\n GraphManager gmgr = databaseClient.newGraphManager();\r\n createUserRolesWithPrevilages(\"test-role\");\r\n GraphPermissions gr = testAdminCon.getDefaultGraphPerms();\r\n \r\n // ISSUE # 175 uncomment after issue is fixed\r\n Assert.assertEquals(0L, gr.size());\r\n \r\n testAdminCon.setDefaultGraphPerms(gmgr.permission(\"test-role\", Capability.READ, Capability.UPDATE));\r\n String defGraphQuery = \"CREATE GRAPH <http://marklogic.com/test/graph/permstest> \";\r\n MarkLogicUpdateQuery updateQuery = testAdminCon.prepareUpdate(QueryLanguage.SPARQL, defGraphQuery);\r\n updateQuery.execute();\r\n \r\n String defGraphQuery1 = \"INSERT DATA { GRAPH <http://marklogic.com/test/graph/permstest> { <http://marklogic.com/test1> <pp2> \\\"test\\\" } }\";\r\n String checkQuery = \"ASK WHERE { GRAPH <http://marklogic.com/test/graph/permstest> {<http://marklogic.com/test> <pp2> \\\"test\\\" }}\";\r\n MarkLogicUpdateQuery updateQuery1 = testAdminCon.prepareUpdate(QueryLanguage.SPARQL, defGraphQuery1);\r\n updateQuery1.execute();\r\n \r\n BooleanQuery booleanQuery = testAdminCon.prepareBooleanQuery(QueryLanguage.SPARQL, checkQuery);\r\n boolean results = booleanQuery.evaluate();\r\n Assert.assertEquals(false, results);\r\n \r\n gr = testAdminCon.getDefaultGraphPerms();\r\n Assert.assertEquals(1L, gr.size());\r\n Iterator<Entry<String, Set<Capability>>> resultPerm = gr.entrySet().iterator();\r\n while(resultPerm.hasNext()){\r\n \t Entry<String, Set<Capability>> perms = resultPerm.next();\r\n \t Assert.assertTrue(\"test-role\" == perms.getKey());\r\n \t Iterator<Capability> capability = perms.getValue().iterator();\r\n \t while (capability.hasNext())\r\n \t\t assertThat(capability.next().toString(), anyOf(equalTo(\"UPDATE\"), is(equalTo(\"READ\"))));\r\n }\r\n \r\n String defGraphQuery2 = \"CREATE GRAPH <http://marklogic.com/test/graph/permstest1> \";\r\n testAdminCon.setDefaultGraphPerms(null);\r\n updateQuery = testAdminCon.prepareUpdate(QueryLanguage.SPARQL, defGraphQuery2);\r\n updateQuery.execute();\r\n gr = testAdminCon.getDefaultGraphPerms();\r\n Assert.assertEquals(0L, gr.size());\r\n \r\n \r\n createUserRolesWithPrevilages(\"multitest-role\");\r\n testAdminCon.setDefaultGraphPerms(gmgr.permission(\"multitest-role\", Capability.READ).permission(\"test-role\", Capability.UPDATE));\r\n defGraphQuery = \"CREATE GRAPH <http://marklogic.com/test/graph/permstest2> \";\r\n updateQuery = testAdminCon.prepareUpdate(QueryLanguage.SPARQL, defGraphQuery);\r\n updateQuery.execute();\r\n gr = testAdminCon.getDefaultGraphPerms();\r\n Assert.assertEquals(2L, gr.size());\r\n testAdminCon.setDefaultGraphPerms(null);\r\n testAdminCon.setDefaultGraphPerms(null);\r\n // ISSUE 180\r\n //testAdminCon.setDefaultGraphPerms((GraphPermissions)null);\r\n gr = testAdminCon.getDefaultGraphPerms();\r\n Assert.assertEquals(0L, gr.size());\r\n \r\n \r\n }", "private void fourNodesTopo() {\n ReadWriteTransaction tx = dataBroker.newReadWriteTransaction();\n n(tx, true, \"n1\", Stream.of(pB(\"n1:1\"), pB(\"n1:2\"), pI(\"n1:3\"), pO(\"n1:4\"), pO(\"n1:5\")));\n n(tx, true, \"n2\", Stream.of(pB(\"n2:1\"), pB(\"n2:2\"), pO(\"n2:3\"), pI(\"n2:4\"), pI(\"n2:5\")));\n n(tx, true, \"n3\", Stream.of(pB(\"n3:1\"), pB(\"n3:2\"), pO(\"n3:3\"), pO(\"n3:4\"), pI(\"n3:5\")));\n n(tx, true, \"n4\", Stream.of(pB(\"n4:1\"), pB(\"n4:2\"), pI(\"n4:3\"), pI(\"n4:4\"), pO(\"n4:5\")));\n l(tx, \"n1\", \"n1:5\", \"n2\", \"n2:5\", OperationalState.ENABLED, ForwardingDirection.UNIDIRECTIONAL);\n l(tx, \"n1\", \"n1:4\", \"n4\", \"n4:4\", OperationalState.ENABLED, ForwardingDirection.UNIDIRECTIONAL);\n l(tx, \"n2\", \"n2:3\", \"n4\", \"n4:3\", OperationalState.ENABLED, ForwardingDirection.UNIDIRECTIONAL);\n l(tx, \"n3\", \"n3:4\", \"n2\", \"n2:4\", OperationalState.ENABLED, ForwardingDirection.UNIDIRECTIONAL);\n l(tx, \"n4\", \"n4:5\", \"n3\", \"n3:5\", OperationalState.ENABLED, ForwardingDirection.UNIDIRECTIONAL);\n try {\n tx.submit().checkedGet();\n } catch (TransactionCommitFailedException e) {\n e.printStackTrace();\n }\n }", "protected void executeSchemaOperations() {\n }", "public void testImportNonEmptyDB() throws Exception {\n URL testXMLFileURL = getClass().getResource(\"prox2db-testdb.xml\");\n new ImportProx2XMLApp(testXMLFileURL.getFile());\n\n // check the resulting database\n verifyObjects(new String[]{\"0\", \"1\", \"2\", \"3\", \"4\"});\n verifyLinks(new String[][]{\n {\"0\", \"1\", \"2\"},\n {\"1\", \"0\", \"3\"},\n {\"2\", \"1\", \"3\"},\n {\"3\", \"1\", \"2\"},\n {\"4\", \"3\", \"4\"}});\n verifyAttribute(\"name\", \"O\", \"VARCHAR\", new String[][]{\n {\"3\", \"Matthew Cornell\"},\n {\"2\", \"David Jensen\"},\n {\"4\", \"our place (an already existing obj)\"}});\n verifyAttribute(\"obj-type\", \"O\", \"VARCHAR\", new String[][]{\n {\"3\", \"person\"},\n {\"2\", \"person\"},\n {\"1\", \"research group\"}});\n verifyAttribute(\"office-num\", \"O\", \"INTEGER\", new String[][]{\n {\"3\", \"218\"},\n {\"2\", \"238\"}});\n verifyAttribute(\"double-test\", \"O\", \"DOUBLE\", new String[][]{\n {\"3\", \"3\"},\n {\"2\", \"2.1000000000000001\"}}); // NB: values match those in file and take into account double precision math changes in Monet version 4.3.14\n verifyAttribute(\"date-test\", \"O\", \"DATE\", new String[][]{\n {\"3\", \"2003-08-25\"},\n {\"2\", \"1962-10-22\"}});\n verifyAttribute(\"link-test\", \"L\", \"VARCHAR\", new String[][]{\n {\"3\", \"this looks like an object ref: _[xx],_but it isn_t because it_s inside a link attribute\"}});\n verifyAttribute(\"link-type\", \"L\", \"VARCHAR\", new String[][]{\n {\"2\", \"member\"},\n {\"3\", \"member\"},\n {\"4\", \"lives-at\"}});\n verifyAttribute(\"nickname\", \"O\", \"VARCHAR\", new String[][]{\n {\"1\", \"kdl\"},\n {\"2\", \"dj\"},\n {\"3\", \"me\"},\n {\"4\", \"home\"}});\n verifyAttribute(\"sa.implied\", \"L\", \"INTEGER\", new String[][]{\n {\"0\", \"1\"},\n {\"1\", \"1\"}});\n verifyAttribute(\"sa.undefined\", \"O\", \"INTEGER\", new String[][]{{}});\n\n veryifyCollection(\"test-coll\", new String[]{\"0\"},\n new String[][]{\n {\"0\", \"0\", \"#test\"},\n {\"0\", \"1\", \"kdl\"},\n {\"0\", \"2\", \"dj\"},\n {\"0\", \"3\", \"me\"},\n {\"0\", \"4\", \"home\"}},\n new String[][]{\n {\"0\", \"0\", \"0:implied:kdl->dj\"},\n {\"0\", \"1\", \"1:implied:#test->me\"},\n {\"0\", \"2\", \"2:kdl->me\"},\n {\"0\", \"3\", \"3:kdl->dj\"},\n {\"0\", \"4\", \"4:me->home\"}});\n veryifyCollection(\"qg2test\", new String[]{\"1\", \"2\", \"3\"},\n new String[][]{\n {\"1\", \"1\", \"group\"},\n {\"2\", \"1\", \"group\"},\n {\"3\", \"1\", \"group\"},\n {\"1\", \"2\", \"person\"},\n {\"2\", \"3\", \"person\"},\n {\"3\", \"2\", \"person\"}},\n new String[][]{\n {\"1\", \"0\", \"group-person\"},\n {\"2\", \"2\", \"group-person\"},\n {\"3\", \"3\", \"group-person\"}});\n }", "@Bean\r\n public boolean testNeoj() {\n \tval node = neo4jRepo.findOne(10L,2);\r\n\t\tnode.getPhrases().forEach(System.out::println);\r\n\t\tnode.getChildNodes().forEach(System.out::println);\r\n\t\tSystem.out.println(node);\r\n\r\n\t\treturn true;\r\n\t}", "private void fiveNodesTopo() {\n ReadWriteTransaction tx = dataBroker.newReadWriteTransaction();\n n(tx, true, \"n1\", Stream.of(pI(\"n1:1\"), pB(\"n1:2\"), pI(\"n1:3\"), pO(\"n1:4\")));\n n(tx, true, \"n2\", Stream.of(pI(\"n2:1\"), pB(\"n2:2\"), pO(\"n2:3\"), pI(\"n2:4\")));\n n(tx, true, \"n3\", Stream.of(pO(\"n3:1\"), pB(\"n3:2\"), pO(\"n3:3\"), pI(\"n3:4\")));\n n(tx, true, \"n4\", Stream.of(pO(\"n4:1\"), pI(\"n4:2\"), pB(\"n4:3\"), pB(\"n4:4\")));\n n(tx, true, \"n5\", Stream.of(pI(\"n5:1\"), pB(\"n5:2\"), pB(\"n5:3\"), pO(\"n5:4\")));\n l(tx, \"n2\", \"n2:3\", \"n3\", \"n3:4\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n l(tx, \"n3\", \"n3:1\", \"n1\", \"n1:1\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n l(tx, \"n3\", \"n3:3\", \"n5\", \"n5:1\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n l(tx, \"n4\", \"n4:1\", \"n1\", \"n1:3\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n l(tx, \"n1\", \"n1:4\", \"n2\", \"n2:4\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n l(tx, \"n5\", \"n5:4\", \"n4\", \"n4:2\", OperationalState.ENABLED, ForwardingDirection.BIDIRECTIONAL);\n try {\n tx.submit().checkedGet();\n } catch (TransactionCommitFailedException e) {\n e.printStackTrace();\n }\n }", "public static void main(String[] args) throws Exception {\n\t\tGraphDatabaseService db = new GraphDatabaseFactory().newEmbeddedDatabaseBuilder(dbPath).newGraphDatabase();\t\r\n\t\ttry (Transaction tx = db.beginTx()) {\r\n\t\t\t\r\n Result result1 = db.execute(\"MATCH (m)-[r:NODE]->(n) RETURN m,n.lat as lat,n.lon as lon\");\r\n //遍历每一条路,给每个路段都加上oneway属性\r\n while (result1.hasNext()) {\r\n \tMap<String,Object> m1=result1.next();\r\n \t\r\n \tNode m=(Node) m1.get(\"m\");\r\n \tdouble lat=(double) m1.get(\"lat\");\r\n \tdouble lon=(double) m1.get(\"lon\");\r\n \t//注意:不能用and,要用逗号\r\n \tdb.execute(\"MATCH (m) WHERE id(m)=\"+m.getId()+\" SET m.lat=\"+lat+\", m.lon=\"+lon+\"\"); \r\n } \r\n tx.success();\r\n }\r\n\t\tdb.shutdown();\r\n\t}", "public static void main(String[] args) throws Exception {\n TDB.setOptimizerWarningFlag(false);\n\n final String DATASET_DIR_NAME = \"data0\";\n final Dataset data0 = TDBFactory.createDataset( DATASET_DIR_NAME );\n\n // show the currently registered names\n for (Iterator<String> it = data0.listNames(); it.hasNext(); ) {\n out.println(\"NAME=\"+it.next());\n }\n\n out.println(\"getting named model...\");\n /// this is the OWL portion\n final Model model = data0.getNamedModel( MY_NS );\n out.println(\"Model := \"+model);\n\n out.println(\"getting graph...\");\n /// this is the DATA in that MODEL\n final Graph graph = model.getGraph();\n out.println(\"Graph := \"+graph);\n\n if (graph.isEmpty()) {\n final Resource product1 = model.createResource( MY_NS +\"product/1\");\n final Property hasName = model.createProperty( MY_NS, \"#hasName\");\n final Statement stmt = model.createStatement(\n product1, hasName, model.createLiteral(\"Beach Ball\",\"en\") );\n out.println(\"Statement = \" + stmt);\n\n model.add(stmt);\n\n // just for fun\n out.println(\"Triple := \" + stmt.asTriple().toString());\n } else {\n out.println(\"Graph is not Empty; it has \"+graph.size()+\" Statements\");\n long t0, t1;\n t0 = System.currentTimeMillis();\n final Query q = QueryFactory.create(\n \"PREFIX exns: <\"+MY_NS+\"#>\\n\"+\n \"PREFIX exprod: <\"+MY_NS+\"product/>\\n\"+\n \" SELECT * \"\n // if you don't provide the Model to the\n // QueryExecutionFactory below, then you'll need\n // to specify the FROM;\n // you *can* always specify it, if you want\n // +\" FROM <\"+MY_NS+\">\\n\"\n // +\" WHERE { ?node <\"+MY_NS+\"#hasName> ?name }\"\n // +\" WHERE { ?node exns:hasName ?name }\"\n // +\" WHERE { exprod:1 exns:hasName ?name }\"\n +\" WHERE { ?res ?pred ?obj }\"\n );\n out.println(\"Query := \"+q);\n t1 = System.currentTimeMillis();\n out.println(\"QueryFactory.TIME=\"+(t1 - t0));\n\n t0 = System.currentTimeMillis();\n try ( QueryExecution qExec = QueryExecutionFactory\n // if you query the whole DataSet,\n // you have to provide a FROM in the SparQL\n //.create(q, data0);\n .create(q, model) ) {\n t1 = System.currentTimeMillis();\n out.println(\"QueryExecutionFactory.TIME=\"+(t1 - t0));\n\n t0 = System.currentTimeMillis();\n ResultSet rs = qExec.execSelect();\n t1 = System.currentTimeMillis();\n out.println(\"executeSelect.TIME=\"+(t1 - t0));\n while (rs.hasNext()) {\n QuerySolution sol = rs.next();\n out.println(\"Solution := \"+sol);\n for (Iterator<String> names = sol.varNames(); names.hasNext(); ) {\n final String name = names.next();\n out.println(\"\\t\"+name+\" := \"+sol.get(name));\n }\n }\n }\n }\n out.println(\"closing graph\");\n graph.close();\n out.println(\"closing model\");\n model.close();\n //out.println(\"closing DataSetGraph\");\n //dsg.close();\n out.println(\"closing DataSet\");\n data0.close();\n }", "@Test\r\n\tpublic void testPrepareGraphQuery3() throws Exception\r\n\t{\r\n\t\tStatement st1 = vf.createStatement(john, fname, johnfname, dirgraph);\r\n\t\tStatement st2 = vf.createStatement(john, lname, johnlname, dirgraph);\r\n\t\tStatement st3 = vf.createStatement(john, homeTel, johnhomeTel, dirgraph);\r\n\t\tStatement st4 = vf.createStatement(john, email, johnemail, dirgraph);\r\n\t\tStatement st5 = vf.createStatement(micah, fname, micahfname, dirgraph);\r\n\t\tStatement st6 = vf.createStatement(micah, lname, micahlname, dirgraph);\r\n\t\tStatement st7 = vf.createStatement(micah, homeTel, micahhomeTel, dirgraph);\r\n\t\tStatement st8 = vf.createStatement(fei, fname, feifname, dirgraph);\r\n\t\tStatement st9 = vf.createStatement(fei, lname, feilname, dirgraph);\r\n\t\tStatement st10 = vf.createStatement(fei, email, feiemail, dirgraph);\r\n\t\t\r\n\t\r\n\t\ttestWriterCon.add(st1);\r\n\t\ttestWriterCon.add(st2);\r\n\t\ttestWriterCon.add(st3);\r\n\t\ttestWriterCon.add(st4);\r\n\t\ttestWriterCon.add(st5);\r\n\t\ttestWriterCon.add(st6);\r\n\t\ttestWriterCon.add(st7);\r\n\t\ttestWriterCon.add(st8);\r\n\t\ttestWriterCon.add(st9);\r\n\t\ttestWriterCon.add(st10);\r\n\t\t\r\n\t\tAssert.assertTrue(testWriterCon.hasStatement(st1, false));\r\n\t\tAssert.assertFalse(testWriterCon.hasStatement(st1, false, (Resource)null));\r\n\t\tAssert.assertFalse(testWriterCon.hasStatement(st1, false, null));\r\n\t\tAssert.assertTrue(testWriterCon.hasStatement(st1, false, dirgraph));\r\n\t\t\r\n\t\t\r\n\t\tAssert.assertEquals(10, testAdminCon.size(dirgraph));\t\t\r\n\t\t\t\r\n\t\tString query = \" DESCRIBE <http://marklogicsparql.com/addressbook#firstName> \";\r\n\t\tGraphQuery queryObj = testReaderCon.prepareGraphQuery(query);\r\n\t\t\t\r\n\t\tGraphQueryResult result = queryObj.evaluate();\r\n\t\tresult.hasNext();\r\n\t\ttry {\r\n\t\t\tassertThat(result, is(notNullValue()));\r\n\t\t\tassertThat(result.hasNext(), is(equalTo(false)));\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tresult.close();\r\n\t\t}\r\n\t}", "public static void main( String args[] )\n {\n DbUtils.delete( PATH );\n graphDb = new EmbeddedGraphDatabase( PATH );\n\n // Start a transaction (every operation performed on the graph needs\n // to be in a transactional context.\n Transaction tx = graphDb.beginTx();\n try\n {\n // Set up the matrix and all its social connections\n Node thomasAnderson = setupMatrix();\n \n // Query it for information\n printFriends( thomasAnderson );\n printHackers( thomasAnderson );\n \n // Let Neo4j know that the transaction was successful\n tx.success();\n }\n finally\n {\n // Finish the transaction and shutdown Neo4j\n tx.finish();\n graphDb.shutdown();\n }\n }", "public static void main(String[] args) throws Throwable {\n NeoConfig.setMagicNumber(new byte[]{0x01, 0x03, 0x00, 0x0}); // Magic number 769\n\n // Set up the connection to the neo-node\n Neow3j neow3j = Neow3j.build(new HttpService(\"http://localhost:40332\"));\n // Setup an account and wallet for signing the transaction. Make sure that the account has a\n // sufficient GAS balance to pay for the deployment.\n Account a = Account.fromWIF(\"L3kCZj6QbFPwbsVhxnB8nUERDy4mhCSrWJew4u5Qh5QmGMfnCTda\");\n Wallet w = Wallet.withAccounts(a);\n\n // Retrieve the contract files.\n NefFile nefFile = NefFile.readFromFile(new File(\"./build/neow3j/AxLabsToken.nef\"));\n ContractManifest manifest;\n try (FileInputStream s = new FileInputStream(\"./build/neow3j/AxLabsToken.manifest.json\")) {\n manifest = ObjectMapperFactory.getObjectMapper().readValue(s, ContractManifest.class);\n }\n\n // Deploy the contract's NEF and manifest. This creates, signs and send a transaction to\n // the neo-node.\n NeoSendRawTransaction response = new ManagementContract(neow3j).deploy(nefFile, manifest)\n .wallet(w)\n .signers(Signer.calledByEntry(a.getScriptHash()))\n .sign()\n .send();\n\n if (response.hasError()) {\n System.out.printf(\"Deployment was not successful. Error message from neo-node \"\n + \"was: '%s'\\n\", response.getError().getMessage());\n }\n \n ScriptHash scriptHash = SmartContract.getContractHash(a.getScriptHash(), nefFile.getScript());\n System.out.printf(\"Script hash of the deployd contract: %s\\n\", scriptHash.toString());\n }", "@Test\n void shouldNotSeeNonExistingNode() throws Exception\n {\n try ( KernelTransaction tx = beginTransaction() )\n {\n assertFalse( tx.dataRead().nodeExists( 1337L ) );\n }\n }", "public void test_ck_02() {\n OntModel vocabModel = ModelFactory.createOntologyModel();\n ObjectProperty p = vocabModel.createObjectProperty(\"p\");\n OntClass A = vocabModel.createClass(\"A\");\n \n OntModel workModel = ModelFactory.createOntologyModel();\n Individual sub = workModel.createIndividual(\"uri1\", A);\n Individual obj = workModel.createIndividual(\"uri2\", A);\n workModel.createStatement(sub, p, obj);\n }", "@Test(timeout = 4000)\n public void test109() throws Throwable {\n Boolean boolean0 = SQLUtil.mutatesDataOrStructure(\"alter sessionrefereznces\");\n assertNotNull(boolean0);\n assertFalse(boolean0);\n }", "private void createSchema() throws Exception\n {\n LOG.info(\"Creating schema\");\n HibernateUtil.currentSession();\n }", "@Test\n public void testProcessor () {\n getOrphanTables(1L);\n updateConstraints();\n deleteConstraints(1L);\n\n }", "public static void main(String[] args) throws Exception {\n CalciteConnection connection = new SimpleCalciteConnection();\n String salesSchema = Resources.toString(SimpleQueryPlanner2.class.getResource(\"/sales.json\"), Charset.defaultCharset());\n // ModelHandler reads the sales schema and load the schema to connection's root schema and sets the default schema\n new ModelHandler(connection, \"inline:\" + salesSchema);\n\n // Create the query planner with sales schema. conneciton.getSchema returns default schema name specified in sales.json\n SimpleQueryPlanner2 queryPlanner = new SimpleQueryPlanner2(connection.getRootSchema().getSubSchema(connection.getSchema()));\n RelNode logicalPlan = queryPlanner.getLogicalPlan(\"select id,product from orders where product='paint' and units>=5\");\n System.out.println(logicalPlan.getDescription());\n System.out.println(RelOptUtil.toString(logicalPlan));\n\n System.out.println(\"======================================\");\n\n queryPlanner = new SimpleQueryPlanner2(connection.getRootSchema().getSubSchema(connection.getSchema()));\n //RelNode plan = queryPlanner.getTRel(\"select id,product from orders where product='paint' and units>=5\"); // TODO 报错\n RelNode plan = queryPlanner.getTRel(\"select id,product from orders\");\n System.out.println(RelOptUtil.toString(plan));\n ((TRel) plan).doSomething(0);\n }", "@Before\r\n public void setUp() {\r\n try {\r\n Connection conn=DriverManager.getConnection(\"jdbc:oracle:thin:@//localhost:1521/XE\",\"hr\",\"hr\");\r\n Statement stmt = conn.createStatement();\r\n stmt.execute(\"INSERT INTO PkgOrders (Pkg_Order_Id, Order_Id, Package_Id, Customer_Id, Price_Per_Pkg, Quantity, Is_Open) \"\r\n + \" VALUES (-1,-1,-1,-1,1.99,1,0)\");\r\n stmt.execute(\"INSERT INTO PkgOrders (Pkg_Order_Id, Order_Id, Package_Id, Customer_Id, Price_Per_Pkg, Quantity, Is_Open) \"\r\n + \" VALUES (-2,-2,-2,-2,2.99,2,0)\");\r\n } catch (Exception e) {System.out.println(e.getMessage());}\r\n }", "private void addRelationship(String node1, String node2, String relation)\n {\n try (Session session = driver.session())\n {\n // Wrapping Cypher in an explicit transaction provides atomicity\n // and makes handling errors much easier.\n try (Transaction tx = session.beginTransaction())\n {\n tx.run(\"MATCH (j:Node {value: {x}})\\n\" +\n \"MATCH (k:Node {value: {y}})\\n\" +\n \"MERGE (j)-[r:\" + relation + \"]->(k)\", parameters(\"x\", node1, \"y\", node2));\n tx.success(); // Mark this write as successful.\n }\n }\n }", "public static void main(String args[]) throws ConnectionException {\n\t\tString[] products1 = { \"1\", \"2\", \"3\", \"1\", \"2\" };\n\t\t// productos visitados por el usuario 2\n\t\tString[] products2 = { \"1\", \"1\", \"3\", \"1\", \"6\" };\n\t\t// productos visitados por el usuario 3\n\t\tString[] products3 = { \"1\", \"2\", \"5\", \"7\", \"8\" };\n\t\t// productos visitados por el usuario 4\n\t\tString[] products4 = { \"1\", \"2\", \"2\", \"8\", \"9\" };\n\t\t// productos visitados por el usuario 5\n\t\tString[] products5 = { \"4\", \"5\", \"6\", \"7\", \"7\" };\n\n\t\tString[][] userVisitsProduct = { products1, products2, products3,\n\t\t\t\tproducts4, products5 };\n\n\t\tKeyspace ksUsers = Utils.getKeyspace(keySpaceName);\n\n\t\t// ksUsers.dropColumnFamily(\"UserVisitsProduct2\");\n\n\t\tColumnFamily<String, String> cfUsers = new ColumnFamily<String, String>(\n\t\t\t\tcolumnFamilyName, StringSerializer.get(),\n\t\t\t\tStringSerializer.get());\n\n\t\t// Inserci�n de los datos en Cassandra\n\t\ttry {\n\t\t\tksUsers.createColumnFamily(\n\t\t\t\t\tcfUsers,\n\t\t\t\t\tImmutableMap\n\t\t\t\t\t\t\t.<String, Object> builder()\n\t\t\t\t\t\t\t.put(\"default_validation_class\",\n\t\t\t\t\t\t\t\t\t\"CounterColumnType\")\n\t\t\t\t\t\t\t.put(\"replicate_on_write\", true).build());\n\n\t\t\tMutationBatch m = ksUsers.prepareMutationBatch();\n\n\t\t\tColumnListMutation<String> clm = m.withRow(cfUsers, rowKey);\n\n\t\t\tfor (int i = 0; i < userVisitsProduct.length; i++) {\n\t\t\t\tString user = (i + 1) + \"\";\n\t\t\t\tfor (String p : userVisitsProduct[i]) {\n\t\t\t\t\tString key = user + \":\" + p;\n\t\t\t\t\tclm.incrementCounterColumn(key, 1);\n\t\t\t\t}\n\t\t\t}\n\t\t\tm.execute();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out\n\t\t\t\t\t.println(\"Ya existe el column family \" + columnFamilyName);\n\t\t}\n\n\t\t// Lectura de datos insertados.\n\t\tRowQuery<String, String> query = ksUsers.prepareQuery(cfUsers)\n\t\t\t\t.getKey(rowKey).autoPaginate(true);\n\n\t\tColumnList<String> columns = query.execute().getResult();\n\n\t\tfor (Column<String> c : columns) {\n\t\t\tString key = c.getName();\n\t\t\tLong value = c.getLongValue();\n\n\t\t\tString user = key.split(\":\")[0];\n\t\t\tString prod = key.split(\":\")[1];\n\n\t\t\tSystem.out.println(\"user \" + user + \" has visited product \" + prod\n\t\t\t\t\t+ \" \" + value + \" times\");\n\t\t}\n\n\t}", "public void init(GraphDatabaseService store) {\n\n\t\tlog.info(\"creating Neo indices\");\n\n\t\ttry (Transaction tx = store.beginTx()) {\n\n\t\t\tstore.schema().indexFor(IDENTITY).on(name_prop).create();\n\t\t\tstore.schema().indexFor(CODELIST).on(id_prop).create();\n\t\t\tstore.schema().indexFor(ATTRDEF).on(id_prop).create();\n\t\t\tstore.schema().indexFor(LINKDEF).on(id_prop).create();\n\t\t\tstore.schema().indexFor(USER).on(name_prop).create();\n\t\t\tstore.schema().indexFor(LIFECYCLE).on(id_prop).create();\n\t\t\tstore.schema().indexFor(LOGBOOK).on(id_prop).create();\n\n\t\t\ttx.success();\n\t\t}\n\n\t}", "@Test(timeout = 4000)\n public void test107() throws Throwable {\n Boolean boolean0 = SQLUtil.mutatesDataOrStructure(\"execcannot:create iwstance, module ignored.\");\n assertNull(boolean0);\n }", "@Test\n public void testTransactional() throws Exception {\n try (CloseableCoreSession session = coreFeature.openCoreSessionSystem()) {\n IterableQueryResult results = session.queryAndFetch(\"SELECT * from Document\", \"NXQL\");\n TransactionHelper.commitOrRollbackTransaction();\n TransactionHelper.startTransaction();\n assertFalse(results.mustBeClosed());\n assertWarnInLogs();\n }\n }", "public long wsadd_node(NodeWS node)\r\n\t\t\t\t{ \r\n\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\t\t\t\tlong id = 0; //id de la tabla user (único) \r\n\t\t\t\t Node nodeC = new Node(node.getNode_name(),node.getMAC_address(),node.getPort_number());\r\n\t\t\t\t \r\n\t\t\t\t //User cliente1 = new User(\"[email protected]\", \"gutie33\", 1, \"Luis\",\"677899876\", \"Informatica\"); \r\n\t\t\t\t \r\n\t\t\t\t try \r\n\t\t\t\t { \r\n\t\t\t\t iniciaOperacion(); \r\n\t\t\t\t \r\n\t\t\t\t id= (Long) sesion.createQuery(\"SELECT u.id_company FROM Company u WHERE u.company_name ='\"+node.getName_company()+\"'\").uniqueResult();\r\n\t\t\t\t Company x = (Company) sesion.load(Company.class, id);\r\n\t\t\t\t x.addNodo(nodeC);\r\n\t\t\t\t \r\n\t\t\t\t\t nodeC.setCompany(x);\r\n\t\t\t\t \r\n\t\t\t\t //sesion.update(compx);\r\n\t\t\t\t \r\n\t\t\t\t \r\n\t\t\t\t //metodo para guardar cliente (del objeto hibernate.sesion) \r\n\t\t\t\t tx.commit(); \r\n\t\t\t\t }catch(HibernateException he) \r\n\t\t\t\t { \r\n\t\t\t\t manejaExcepcion(he);\r\n\t\t\t\t throw he; \r\n\t\t\t\t }finally \r\n\t\t\t\t { \r\n\t\t\t\t \t//Busqueda del id con qu elo ha introducido a la BBDD\r\n\t\t\t\t \tid= (Long) sesion.createQuery(\"SELECT u.id_node FROM Node u WHERE u.node_name ='\"+node.getNode_name()+\"'\").uniqueResult();\r\n\t\t\t\t sesion.close(); \r\n\t\t\t\t } \r\n\t\t\t\t return id; \r\n\t\t\t\t}", "@Test\n public void shouldHandleDenseNodeWithNoRelationships() throws Exception\n {\n NeoStores stores = mock( NeoStores.class );\n NodeStore nodeStore = mock( NodeStore.class );\n when( stores.getNodeStore() ).thenReturn( nodeStore );\n RelationshipGroupStore relationshipGroupStore = mock( RelationshipGroupStore.class );\n when( stores.getRelationshipGroupStore() ).thenReturn( relationshipGroupStore );\n\n @SuppressWarnings( \"unchecked\" )\n StoreNodeRelationshipCursor cursor = new StoreNodeRelationshipCursor(\n new RelationshipRecord( -1 ),\n stores,\n new RelationshipGroupRecord( -1, -1 ),\n mock( StoreStatement.class ),\n mock( Consumer.class ),\n NO_LOCK_SERVICE );\n\n // WHEN\n cursor.init( true, NO_NEXT_RELATIONSHIP.intValue(), 0, BOTH );\n\n // THEN\n verifyNoMoreInteractions( relationshipGroupStore );\n assertFalse( cursor.next() );\n }", "@Test\r\n void test_insert_1_vertex_check() {\r\n graph.addVertex(\"1\");\r\n vertices = graph.getAllVertices();\r\n if (!vertices.contains(\"1\"))\r\n fail(\"Insert not working!!\");\r\n }", "public interface NeoDatisObject extends Serializable{\n\tvoid setNeoDatisContext(NeoDatisContext context);\n\tNeoDatisContext getNeoDatisContext();\n}", "@Ignore\n @Test\n public void testCreateIndex() {\n System.out.println(\"createIndex\");\n Util.commonServiceIPs=\"127.0.0.1\";\n \n EntityManager em=Util.getEntityManagerFactory(100).createEntityManager();\n EntityManager platformEm = Util.getPlatformEntityManagerFactory().createEntityManager();\n \n Client client = ESUtil.getClient(em,platformEm,1,false);\n \n RuntimeContext.dataobjectTypes = Util.getDataobjectTypes();\n String indexName = \"test000000\";\n try {\n ESUtil.createIndex(platformEm, client, indexName, true);\n }\n catch(Exception e)\n {\n \n }\n \n\n }", "@BeforeClass\n public static void setUpClass() {\n Neo4JSessionFactory factory = Neo4JSessionFactory.getInstance();\n Session session = factory.getNeo4jSession();\n session.purgeDatabase();\n }", "abstract protected DatabaseResponse<E> executeOperation( Connection connection ) throws LauncherPersistenceException;", "public void testEmptyTransactionShouldNotBeVersioned() {\n Long ver1 = graph.getLatestGraphVersion();\n commit();\n commit();\n commit();\n assertThat(graph.getLatestGraphVersion(), is(ver1));\n }", "public void loadEdge()\r\n {\r\n town.createConnection();\r\n }", "public static void convoExport() throws ClassNotFoundException, SQLException, IOException{\n\t\t\n\t\tClass.forName(\"org.h2.Driver\");\n\t\tConnection conn = DriverManager.getConnection(DB, user, pass);\n\t\tConvoGraph rt = new ConvoGraph(conn, \"HISenOG\", \"/Users/Brian/Desktop/\");\n\t\trt.createNodesRT();\n\t\trt.createRT();\n\t\trt.nodeWrite(\"RT\");\n\t\tConvoGraph rp = new ConvoGraph(conn, \"HISenOG\", \"/Users/Brian/Desktop/\");\n\t\trp.createNodesRP();\n\t\trp.createReply();\n\t\trp.nodeWrite(\"RP\");\n\t}", "@Override\n public void createSchema(Properties props)\n {\n Statement statement;\n try\n {\n statement = connection.createStatement();\n \n //Drop Indexes\n dropIndex(statement, \"CONFFRIENDSHIP_INVITEEID\", \"CONFFRIENDSHIP\");\n dropIndex(statement, \"CONFFRIENDSHIP_INVITERID\", \"CONFFRIENDSHIP\");\n dropIndex(statement, \"PENDFRIENDSHIP_INVITEEID\", \"PENDFRIENDSHIP\");\n dropIndex(statement, \"PENDFRIENDSHIP_INVITERID\", \"PENDFRIENDSHIP\");\n dropIndex(statement, \"MANIPULATION_RID\", \"MANIPULATION\");\n dropIndex(statement, \"MANIPULATION_CREATORID\", \"MANIPULATION\");\n dropIndex(statement, \"RESOURCES_WALLUSERID\", \"RESOURCES\");\n dropIndex(statement, \"RESOURCE_CREATORID\", \"RESOURCES\");\n \n //Drop Tables\n dropTable(statement, \"CONFFRIENDSHIP\");\n dropTable(statement, \"PENDFRIENDSHIP\");\n dropTable(statement, \"MANIPULATION\");\n dropTable(statement, \"RESOURCES\");\n dropTable(statement, \"USERS\");\n \n //Create Tables\n statement.executeUpdate(\"CREATE TABLE CONFFRIENDSHIP \" + \"(INVITERID INTEGER NOT NULL, \" + \"INVITEEID INTEGER NOT NULL, \" + \"PRIMARY KEY (INVITERID, INVITEEID))\");\n statement.executeUpdate(\"CREATE TABLE PENDFRIENDSHIP \" + \"(INVITERID INTEGER NOT NULL, \" + \"INVITEEID INTEGER NOT NULL, \" + \"PRIMARY KEY (INVITERID, INVITEEID))\");\n statement.executeUpdate(\"CREATE TABLE MANIPULATION \" + \"(MID INTEGER NOT NULL, \" + \"MODIFIERID INTEGER NOT NULL, \" + \"RID INTEGER NOT NULL, \" + \"CREATORID INTEGER NOT NULL, \" + \"TIMESTAMP VARCHAR(200), \" + \"TYPE VARCHAR(200), \" + \"CONTENT VARCHAR(200), \" + \"PRIMARY KEY (MID,RID))\");\n statement.executeUpdate(\"CREATE TABLE RESOURCES \" + \"(RID INTEGER NOT NULL , \" + \"CREATORID INTEGER NOT NULL, \" + \"WALLUSERID INTEGER NOT NULL, \" + \"TYPE VARCHAR(200), \" + \"BODY VARCHAR(200), \" + \"DOC VARCHAR(200), \" + \"PRIMARY KEY (RID))\");\n statement.executeUpdate(\"CREATE TABLE USERS \" + \"(USERID INTEGER NOT NULL , \" + \"USERNAME VARCHAR(200), \" + \"PW VARCHAR(200), \" + \"FNAME VARCHAR(200), \" + \"LNAME VARCHAR(200), \" + \"GENDER VARCHAR(200),\" + \"DOB VARCHAR(200), \" + \"JDATE VARCHAR(200), \" + \"LDATE VARCHAR(200), \" + \"ADDRESS VARCHAR(200),\" + \"EMAIL VARCHAR(200), \" + \"TEL VARCHAR(200), \" + \"PRIMARY KEY (USERID))\");\n \n //Add Foreign Keys\n statement.executeUpdate(\"ALTER TABLE CONFFRIENDSHIP \" + \"ADD CONSTRAINT CONFFRIENDSHIP_USERS_FK1 FOREIGN KEY (INVITERID)\" + \"REFERENCES USERS (USERID) ON DELETE CASCADE\");\n statement.executeUpdate(\"ALTER TABLE CONFFRIENDSHIP \" + \"ADD CONSTRAINT CONFFRIENDSHIP_USERS_FK2 FOREIGN KEY (INVITEEID)\" + \"REFERENCES USERS (USERID) ON DELETE NO ACTION\");\n statement.executeUpdate(\"ALTER TABLE PENDFRIENDSHIP \" + \"ADD CONSTRAINT PENDFRIENDSHIP_USERS_FK1 FOREIGN KEY (INVITERID)\" + \"REFERENCES USERS (USERID) ON DELETE CASCADE\");\n statement.executeUpdate(\"ALTER TABLE PENDFRIENDSHIP \" + \"ADD CONSTRAINT PENDFRIENDSHIP_USERS_FK2 FOREIGN KEY (INVITEEID)\" + \"REFERENCES USERS (USERID) ON DELETE NO ACTION\");\n statement.executeUpdate(\"ALTER TABLE MANIPULATION \" + \"ADD CONSTRAINT MANIPULATION_RESOURCES_FK1 FOREIGN KEY (RID)\" + \"REFERENCES RESOURCES (RID) ON DELETE CASCADE\");\n statement.executeUpdate(\"ALTER TABLE MANIPULATION \" + \"ADD CONSTRAINT MANIPULATION_USERS_FK1 FOREIGN KEY (CREATORID)\" + \"REFERENCES USERS (USERID) ON DELETE NO ACTION\");\n statement.executeUpdate(\"ALTER TABLE MANIPULATION \" + \"ADD CONSTRAINT MANIPULATION_USERS_FK2 FOREIGN KEY (MODIFIERID)\" + \"REFERENCES USERS (USERID) ON DELETE NO ACTION\");\n statement.executeUpdate(\"ALTER TABLE RESOURCES \" + \"ADD CONSTRAINT RESOURCES_USERS_FK1 FOREIGN KEY (CREATORID)\" + \"REFERENCES USERS (USERID) ON DELETE CASCADE\");\n statement.executeUpdate(\"ALTER TABLE RESOURCES \" + \"ADD CONSTRAINT RESOURCES_USERS_FK2 FOREIGN KEY (WALLUSERID)\" + \"REFERENCES USERS (USERID) ON DELETE NO ACTION\");\n \n //Create Indexes\n buildIndexes(null);\n }\n catch (SQLException ex)\n {\n Logger.getLogger(WindowsAzureClientInit.class.getName()).log(Level.SEVERE, null, ex);\n System.out.println(\"Error in creating schema!\");\n }\n }", "private boolean generateTNovaCdr() throws Exception {\n // TODO maybe continue here?\n return true;\n }", "@Test(timeout = 4000)\n public void test111() throws Throwable {\n Boolean boolean0 = SQLUtil.mutatesDataOrStructure(\"alter session\");\n assertNotNull(boolean0);\n assertFalse(boolean0);\n }", "private ServerError updateDatabase() {\n return updateDatabase(WebConf.DB_CONN, WebConf.JSON_OBJECTS, WebConf.DEFAULT_VERSION);\r\n }", "public static void main(String args[]) {\n Model model = ModelFactory.createDefaultModel(); \n\n//set namespace\n Resource NAMESPACE = model.createResource( relationshipUri );\n \tmodel.setNsPrefix( \"rela\", relationshipUri);\n \n// Create the types of Property we need to describe relationships in the model\n Property childOf = model.createProperty(relationshipUri,\"childOf\"); \n Property siblingOf = model.createProperty(relationshipUri,\"siblingOf\");\n Property spouseOf = model.createProperty(relationshipUri,\"spouseOf\");\n Property parentOf = model.createProperty(relationshipUri,\"parentOf\"); \n \n \n// Create resources representing the people in our model\n Resource Siddharth = model.createResource(familyUri+\"Siddharth\");\n Resource Dhvanit = model.createResource(familyUri+\"Dhvanit\");\n Resource Rekha = model.createResource(familyUri+\"Rekha\");\n Resource Sandeep = model.createResource(familyUri+\"Sandeep\");\n Resource Kanchan = model.createResource(familyUri+\"Kanchan\");\n Resource Pihu = model.createResource(familyUri+\"Pihu\");\n Resource DwarkaPrasad = model.createResource(familyUri+\"Dwarkesh\");\n Resource Shakuntala = model.createResource(familyUri+\"Shakuntala\");\n Resource Santosh = model.createResource(familyUri+\"Santosh\");\n Resource Usha = model.createResource(familyUri+\"Usha\");\n Resource Priyadarshan = model.createResource(familyUri+\"Priyadarshan\");\n Resource Sudarshan = model.createResource(familyUri+\"Sudarshan\");\n Resource Pragya = model.createResource(familyUri+\"Pragya\");\n Resource Shailendra = model.createResource(familyUri+\"Shailendra\");\n Resource Rajni = model.createResource(familyUri+\"Rajni\");\n Resource Harsh = model.createResource(familyUri+\"Harsh\");\n Resource Satendra = model.createResource(familyUri+\"Satendra\");\n Resource Vandana = model.createResource(familyUri+\"Vandana\");\n Resource Priyam = model.createResource(familyUri+\"Priyam\");\n Resource Darshan = model.createResource(familyUri+\"Darshan\");\n Resource Vardhan = model.createResource(familyUri+\"Vardhan\");\n \n List<Statement> list = new ArrayList(); \n list.add(model.createStatement(Dhvanit,spouseOf,Kanchan)); \n list.add(model.createStatement(Sandeep,spouseOf,Rekha)); \n list.add(model.createStatement(DwarkaPrasad,spouseOf,Shakuntala)); \n list.add(model.createStatement(Santosh,spouseOf,Usha)); \n list.add(model.createStatement(Shailendra,spouseOf,Rajni)); \n list.add(model.createStatement(Satendra,spouseOf,Vandana)); \n list.add(model.createStatement(Sandeep,childOf,DwarkaPrasad)); \n list.add(model.createStatement(Sandeep,childOf,Shakuntala)); \n list.add(model.createStatement(Santosh,childOf,DwarkaPrasad)); \n list.add(model.createStatement(Santosh,childOf,Shakuntala)); \n list.add(model.createStatement(Shailendra,childOf,DwarkaPrasad)); \n list.add(model.createStatement(Shailendra,childOf,Shakuntala)); \n list.add(model.createStatement(Satendra,childOf,DwarkaPrasad)); \n list.add(model.createStatement(Satendra,childOf,Shakuntala)); \n list.add(model.createStatement(DwarkaPrasad,parentOf,Sandeep)); \n list.add(model.createStatement(DwarkaPrasad,parentOf,Santosh)); \n list.add(model.createStatement(DwarkaPrasad,parentOf,Shailendra)); \n list.add(model.createStatement(DwarkaPrasad,parentOf,Satendra)); \n list.add(model.createStatement(Shakuntala,parentOf,Sandeep)); \n list.add(model.createStatement(Shakuntala,parentOf,Santosh)); \n list.add(model.createStatement(Shakuntala,parentOf,Shailendra)); \n list.add(model.createStatement(Shakuntala,parentOf,Satendra)); \n list.add(model.createStatement(Sandeep,parentOf,Siddharth)); \n list.add(model.createStatement(Sandeep,parentOf,Dhvanit)); \n list.add(model.createStatement(Rekha,parentOf,Siddharth)); \n list.add(model.createStatement(Rekha,parentOf,Dhvanit)); \n list.add(model.createStatement(Siddharth,childOf,Rekha)); \n list.add(model.createStatement(Dhvanit,childOf,Rekha)); \n list.add(model.createStatement(Siddharth,childOf,Sandeep)); \n list.add(model.createStatement(Dhvanit,childOf,Sandeep)); \n list.add(model.createStatement(Harsh,childOf,Shailendra)); \n list.add(model.createStatement(Harsh,childOf,Rajni)); \n list.add(model.createStatement(Shailendra,parentOf,Harsh)); \n list.add(model.createStatement(Rajni,parentOf,Harsh)); \n list.add(model.createStatement(Santosh,parentOf,Priyadarshan)); \n list.add(model.createStatement(Santosh,parentOf,Sudarshan));\n list.add(model.createStatement(Santosh,parentOf,Pragya));\n list.add(model.createStatement(Usha,parentOf,Priyadarshan)); \n list.add(model.createStatement(Usha,parentOf,Sudarshan));\n list.add(model.createStatement(Usha,parentOf,Pragya));\n list.add(model.createStatement(Priyadarshan,childOf,Santosh));\n list.add(model.createStatement(Pragya,childOf,Santosh));\n list.add(model.createStatement(Sudarshan,childOf,Santosh));\n list.add(model.createStatement(Priyadarshan,childOf,Usha));\n list.add(model.createStatement(Pragya,childOf,Usha));\n list.add(model.createStatement(Sudarshan,childOf,Usha));\n list.add(model.createStatement(Satendra,parentOf,Priyam)); \n list.add(model.createStatement(Satendra,parentOf,Darshan));\n list.add(model.createStatement(Satendra,parentOf,Vardhan));\n list.add(model.createStatement(Vandana,parentOf,Priyam)); \n list.add(model.createStatement(Vandana,parentOf,Darshan));\n list.add(model.createStatement(Vandana,parentOf,Vardhan));\n list.add(model.createStatement(Priyam,childOf,Satendra));\n list.add(model.createStatement(Darshan,childOf,Satendra));\n list.add(model.createStatement(Vardhan,childOf,Satendra));\n list.add(model.createStatement(Priyam,childOf,Vandana));\n list.add(model.createStatement(Darshan,childOf,Vandana));\n list.add(model.createStatement(Vardhan,childOf,Vandana));\n list.add(model.createStatement(Pihu,childOf,Dhvanit));\n list.add(model.createStatement(Pihu,childOf,Kanchan));\n list.add(model.createStatement(Dhvanit,parentOf,Pihu));\n list.add(model.createStatement(Kanchan,parentOf,Pihu));\n list.add(model.createStatement(Siddharth,siblingOf,Dhvanit));\n list.add(model.createStatement(Dhvanit,siblingOf,Siddharth)); \n list.add(model.createStatement(Priyadarshan,siblingOf,Sudarshan));\n list.add(model.createStatement(Priyadarshan,siblingOf,Pragya));\n list.add(model.createStatement(Sudarshan,siblingOf,Priyadarshan));\n list.add(model.createStatement(Sudarshan,siblingOf,Pragya));\n list.add(model.createStatement(Pragya,siblingOf,Priyadarshan));\n list.add(model.createStatement(Pragya,siblingOf,Sudarshan)); \n list.add(model.createStatement(Priyam,siblingOf,Darshan));\n list.add(model.createStatement(Priyam,siblingOf,Vardhan)); \n list.add(model.createStatement(Darshan,siblingOf,Vardhan)); \n list.add(model.createStatement(Darshan,siblingOf,Priyam));\n list.add(model.createStatement(Vardhan,siblingOf,Priyam));\n list.add(model.createStatement(Vardhan,siblingOf,Darshan));\n list.add(model.createStatement(Santosh,siblingOf,Sandeep));\n list.add(model.createStatement(Santosh,siblingOf,Shailendra));\n list.add(model.createStatement(Santosh,siblingOf,Satendra));\n list.add(model.createStatement(Sandeep,siblingOf,Santosh));\n list.add(model.createStatement(Sandeep,siblingOf,Shailendra));\n list.add(model.createStatement(Sandeep,siblingOf,Satendra));\n list.add(model.createStatement(Shailendra,siblingOf,Santosh));\n list.add(model.createStatement(Shailendra,siblingOf,Sandeep));\n list.add(model.createStatement(Shailendra,siblingOf,Satendra));\n list.add(model.createStatement(Satendra,siblingOf,Shailendra));\n list.add(model.createStatement(Satendra,siblingOf,Santosh));\n list.add(model.createStatement(Satendra,siblingOf,Sandeep));\n \n model.add(list);\n try{\n \t File file=new File(\"/Users/siddharthgupta/Documents/workspace/FamilyModel/src/family/family.rdf\");\n \t \tFileOutputStream f1=new FileOutputStream(file);\n \t \tRDFWriter d = model.getWriter(\"RDF/XML-ABBREV\");\n \t \t\t\td.write(model,f1,null);\n \t\t}catch(Exception e) {}\n }", "@Test\r\n public void testGetSupportedConnectorTopologies() throws Exception {\r\n TDataPrepDBInputDefinition fixture = new TDataPrepDBInputDefinition();\r\n\r\n Set<ConnectorTopology> result = fixture.getSupportedConnectorTopologies();\r\n\r\n assertNotNull(result);\r\n assertEquals(1, result.size());\r\n }", "private DBMaster() {\r\n\t\t//The current address is localhost - needs to be changed at a later date\r\n\t\t_db = new GraphDatabaseFactory().newEmbeddedDatabase(\"\\\\etc\\\\neo4j\\\\default.graphdb\");\r\n\t\tregisterShutdownHook();\r\n\t}", "@Before\n\tpublic void setUp() throws Exception {\n\t\torientDBTestInstance.setUpSchemaIfNeeded();\n\n\t\t// open database\n\t\tODatabaseDocumentTx db = orientDBTestInstance.getDatabase();\n\n\t\tfactory = new OrientDbRepositoryFactory(db, new OrientDbTestApplicationSettings(), new Identity());\n\n\t\t// create repository\n\t\trepository = factory.produceRepository(OrientDbSourceRepository.class);\n\t}", "public void testaGraph() {\n\t\tEstacaoDAO a = new EstacaoDAO();\n\t\ta.carregarEstacoes();\n\t\tLinha b = new Linha(\"a\");\n\t\tb.loadAllStations(a);\n\t\tb.shortestPath(a,\"Curado\",\"Recife\");\n\t}", "public void test() throws Exception {\n ApiConnection api = new ApiConnection(\"http://api06.dev.openstreetmap.org/api\");\n\n Root root = api.get(malmoSouth, malmoWest, malmoNorth, malmoEast);\n\n api.authenticate(\"[email protected]\", \"osm-common\");\n\n\n long changeset = api.createChangeset(\"Test\");\n try {\n\n String reference = UUID.randomUUID().toString();\n\n Node node = new Node();\n node.setChangeset(changeset);\n node.setLongitude(53);\n node.setLatitude(16);\n node.setTag(\"ref:osm-common\", reference);\n\n api.create(changeset, node);\n\n assertTrue(node.getId() > 0);\n assertEquals(new Long(changeset), node.getChangeset());\n assertEquals(reference, node.getTag(\"ref:osm-common\"));\n\n Node newNode = api.getNode(node.getId());\n assertEquals(node.getId(), newNode.getId());\n assertEquals(new Long(changeset), newNode.getChangeset());\n assertEquals(node.getLatitude(), newNode.getLatitude());\n assertEquals(node.getLongitude(), newNode.getLongitude());\n assertEquals(reference, newNode.getTag(\"ref:osm-common\"));\n\n api.delete(changeset, newNode);\n\n // todo check deleted\n\n System.currentTimeMillis();\n\n } finally {\n api.closeChangeset(changeset);\n }\n\n System.currentTimeMillis();\n }", "public static void main(String[] args) throws Exception {\n\t\tConnection con = DriverManager.getConnection(args[0]);\n\t\tDatabaseMetaData dbmd = con.getMetaData();\n\t\ttry {\n\t\t\t// inspect the catalog by use of dbmd functions\n\t\t\tdumpResultSet(dbmd.getCatalogs());\n//\t\t\tdumpResultSet(dbmd.getSchemas());\t// this produces different outputs on different platforms due to dependency on SAMTOOLS and NETCDF. so exclude it\n\t\t\tdumpResultSet(dbmd.getSchemas(null, \"sys\"));\n//\t\t\tdumpResultSet(dbmd.getTables(null, \"sys\", null, null));\t// this produces different outputs on different platforms due to dependency on Geom and NETCDF.\n\t\t\tdumpResultSet(dbmd.getTables(null, \"tmp\", null, null));\t// schema tmp has 6 tables\n\t\t\tdumpResultSet(dbmd.getUDTs(null, \"sys\", null, null));\n\t\t\tint[] UDTtypes = { Types.STRUCT, Types.DISTINCT };\n\t\t\tdumpResultSet(dbmd.getUDTs(null, \"sys\", null, UDTtypes));\n\t\t} catch (SQLException e) {\n\t\t\tSystem.out.println(\"FAILED :( \"+ e.getMessage());\n\t\t\tSystem.out.println(\"ABORTING TEST!!!\");\n\t\t}\n\t\tcon.close();\n\t}", "public static void main(String[] args) throws IOException {\n\t\tCorePackage.eINSTANCE.eClass();\n\t\tDOMPackage.eINSTANCE.eClass();\n\t\tPrimitiveTypesPackage.eINSTANCE.eClass();\n\t\t\n\t\tPersistenceBackendFactoryRegistry.register(BlueprintsURI.SCHEME, BlueprintsPersistenceBackendFactory.getInstance());\n\t\t\n\t\tResourceSet rSet = new ResourceSetImpl();\n\t\trSet.getResourceFactoryRegistry().getProtocolToFactoryMap().put(BlueprintsURI.SCHEME, PersistentResourceFactory.getInstance());\n\t\t\n\t\tResource graphResource = rSet.createResource(BlueprintsURI.createFileURI(new File(\"models/set1.graphdb\")));\n\t\tMap<String, Object> graphOptions = BlueprintsNeo4jOptionsBuilder.newBuilder().asMap();\n\t\tgraphResource.load(graphOptions);\n\t\t\n\t\tstartQuery();\n\t\t\n\t\ttry {\n\t\t\t/*\n\t\t\t * Create the OCL environment and load the query from an existing OCL file.\n\t\t\t * Note: Mogwa´ relies on the OCL Ecore metamodel. Moving to the Pivot metamodel is planned for the next release\n\t\t\t * and will provide support for computing queries over UML models.\n\t\t\t */\n\t\t\tOCL ocl = OCL.newInstance(EcoreEnvironmentFactory.INSTANCE);\n\t\t\tOCLInput oclInput = new OCLInput(new FileInputStream(new File(\"ocl/singletons.ocl\")));\n\t\t\tList<Constraint> constraints = ocl.parse(oclInput);\n\t\t\t\n\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\tList<EObject> result = (List<EObject>)ocl.createQuery(constraints.get(0)).evaluate(graphResource.getContents().get(0));\n\t\t\tNeoLogger.info(\"Found {0} singletons\", result.size());\n\t\t\tendQuery();\n\t\t} catch(ParserException e) {\n\t\t\tSystem.out.println(\"Cannot parse the input OCL file\");\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t((PersistentResource)graphResource).close();\n\t}", "public void validate() throws Exception{\n \ttry{\n \tSparqlConnection conn = new SparqlConnection(this.jsonRenderedSparqlConnection); \n \t}\n \tcatch(Exception e){\n \t\tthrow new Exception(\"unable to create ontology info: \" + e.getMessage(), e);\n \t}\n }", "boolean needSeparateConnectionForDdl();", "public static void main(String[] args) {\n String engineHostname = Grakn.DEFAULT_URI;\n if (args.length>0) {engineHostname = args[0];}\n try (GraknSession session = Grakn.session(engineHostname, keyspace)) {\n testConnection(session);\n System.out.println(\"Calculating degrees...\");\n Map<Long, Set<String>> degrees = degreeOfRelation(session, \"interaction\", Sets.newHashSet(\"interaction\",\"reference\"));\n System.out.println(\"Persisting degrees...\");\n persistDegrees(session, degrees);\n System.out.println(\"Finished persisting.\");\n System.out.println(\"Calculating degrees...\");\n degrees = degreeOfRelation(session, \"gene-target\", Sets.newHashSet(\"gene-target\",\"reference\"));\n System.out.println(\"Persisting degrees...\");\n persistDegrees(session, degrees);\n System.out.println(\"Finished persisting.\");\n System.out.println(\"Task complete.\");\n }\n }", "@Test\n public void example10 () throws Exception {\n ValueFactory f = repo.getValueFactory();\n String exns = \"http://example.org/people/\";\n URI alice = f.createURI(exns, \"alice\");\n URI bob = f.createURI(exns, \"bob\");\n URI ted = f.createURI(exns, \"ted\"); \n URI person = f.createURI(\"http://example.org/ontology/Person\");\n URI name = f.createURI(\"http://example.org/ontology/name\");\n Literal alicesName = f.createLiteral(\"Alice\");\n Literal bobsName = f.createLiteral(\"Bob\");\n Literal tedsName = f.createLiteral(\"Ted\"); \n URI context1 = f.createURI(exns, \"cxt1\"); \n URI context2 = f.createURI(exns, \"cxt2\"); \n conn.add(alice, RDF.TYPE, person, context1);\n conn.add(alice, name, alicesName, context1);\n conn.add(bob, RDF.TYPE, person, context2);\n conn.add(bob, name, bobsName, context2);\n conn.add(ted, RDF.TYPE, person);\n conn.add(ted, name, tedsName);\n \n assertSetsEqual(\n stmts(new Stmt[] {\n new Stmt(alice, RDF.TYPE, person, context1),\n new Stmt(alice, name, alicesName, context1),\n new Stmt(bob, RDF.TYPE, person, context2),\n new Stmt(bob, name, bobsName, context2),\n new Stmt(ted, RDF.TYPE, person),\n new Stmt(ted, name, tedsName)\n }),\n statementSet(conn.getStatements(null, null, null, false)));\n assertSetsEqual(\n stmts(new Stmt[] {\n new Stmt(alice, RDF.TYPE, person, context1),\n new Stmt(alice, name, alicesName, context1),\n new Stmt(bob, RDF.TYPE, person, context2),\n new Stmt(bob, name, bobsName, context2)\n }),\n statementSet(conn.getStatements(null, null, null, false, context1, context2)));\n assertSetsEqual(\n stmts(new Stmt[] {\n new Stmt(bob, RDF.TYPE, person, context2),\n new Stmt(bob, name, bobsName, context2),\n new Stmt(ted, RDF.TYPE, person),\n new Stmt(ted, name, tedsName)\n }),\n statementSet(conn.getStatements(null, null, null, false, null, context2)));\n \n // testing named graph query\n DatasetImpl ds = new DatasetImpl();\n ds.addNamedGraph(context1);\n ds.addNamedGraph(context2);\n TupleQuery tupleQuery = conn.prepareTupleQuery(\n QueryLanguage.SPARQL, \"SELECT ?s ?p ?o ?g WHERE { GRAPH ?g {?s ?p ?o . } }\");\n tupleQuery.setDataset(ds);\n assertSetsEqual(\n stmts(new Stmt[] {\n new Stmt(alice, RDF.TYPE, person, context1),\n new Stmt(alice, name, alicesName, context1),\n new Stmt(bob, RDF.TYPE, person, context2),\n new Stmt(bob, name, bobsName, context2)\n }),\n statementSet(tupleQuery.evaluate()));\n \n ds = new DatasetImpl();\n ds.addDefaultGraph(null);\n tupleQuery = conn.prepareTupleQuery(QueryLanguage.SPARQL, \"SELECT ?s ?p ?o WHERE {?s ?p ?o . }\");\n tupleQuery.setDataset(ds);\n assertSetsEqual(\n stmts(new Stmt[] {\n new Stmt(ted, RDF.TYPE, person),\n new Stmt(ted, name, tedsName)\n }),\n statementSet(tupleQuery.evaluate()));\n }", "@Test public void dataset_08() {\n Dataset ds = createDataset();\n assertTrue(\"Union named graph not found\", ds.containsNamedModel(Quad.unionGraph.getURI()));\n }", "@Test\n public void cluster() throws FlywayException {\n flyway.setLocations(\"migration/dbsupport/oracle/sql/cluster\");\n flyway.migrate();\n flyway.clean();\n flyway.migrate();\n }", "void createGraphForDistributedSingleLoad();", "@Test(timeout = 4000)\n public void test055() throws Throwable {\n EvoSuiteFile evoSuiteFile0 = new EvoSuiteFile(\"O:56ve.env.properties\");\n FileSystemHandling.appendStringToFile(evoSuiteFile0, \"O:56ve\");\n try { \n DBUtil.getMetaData(\"O:56ve\", true, false, false, true, \", \", true, false);\n fail(\"Expecting exception: Exception\");\n \n } catch(Exception e) {\n //\n // Connecting null failed: \n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "public static void prepDb(Configuration conf) throws Exception {\n\n Connection conn = null;\n Statement stmt = null;\n try {\n conn = getConnection(conf);\n stmt = conn.createStatement();\n stmt.execute(\"CREATE TABLE TXNS (\" +\n \" TXN_ID bigint PRIMARY KEY,\" +\n \" TXN_STATE char(1) NOT NULL,\" +\n \" TXN_STARTED bigint NOT NULL,\" +\n \" TXN_LAST_HEARTBEAT bigint NOT NULL,\" +\n \" TXN_USER varchar(128) NOT NULL,\" +\n \" TXN_HOST varchar(128) NOT NULL,\" +\n \" TXN_TYPE integer)\");\n\n stmt.execute(\"CREATE TABLE TXN_COMPONENTS (\" +\n \" TC_TXNID bigint NOT NULL REFERENCES TXNS (TXN_ID),\" +\n \" TC_DATABASE varchar(128) NOT NULL,\" +\n \" TC_TABLE varchar(128),\" +\n \" TC_PARTITION varchar(767),\" +\n \" TC_OPERATION_TYPE char(1) NOT NULL,\" +\n \" TC_WRITEID bigint)\");\n stmt.execute(\"CREATE TABLE COMPLETED_TXN_COMPONENTS (\" +\n \" CTC_TXNID bigint NOT NULL,\" +\n \" CTC_DATABASE varchar(128) NOT NULL,\" +\n \" CTC_TABLE varchar(128),\" +\n \" CTC_PARTITION varchar(767),\" +\n \" CTC_TIMESTAMP timestamp DEFAULT CURRENT_TIMESTAMP NOT NULL,\" +\n \" CTC_WRITEID bigint,\" +\n \" CTC_UPDATE_DELETE char(1) NOT NULL)\");\n stmt.execute(\"CREATE TABLE NEXT_TXN_ID (\" + \" NTXN_NEXT bigint NOT NULL)\");\n stmt.execute(\"INSERT INTO NEXT_TXN_ID VALUES(1)\");\n\n stmt.execute(\"CREATE TABLE TXN_TO_WRITE_ID (\" +\n \" T2W_TXNID bigint NOT NULL,\" +\n \" T2W_DATABASE varchar(128) NOT NULL,\" +\n \" T2W_TABLE varchar(256) NOT NULL,\" +\n \" T2W_WRITEID bigint NOT NULL)\");\n stmt.execute(\"CREATE TABLE NEXT_WRITE_ID (\" +\n \" NWI_DATABASE varchar(128) NOT NULL,\" +\n \" NWI_TABLE varchar(256) NOT NULL,\" +\n \" NWI_NEXT bigint NOT NULL)\");\n\n stmt.execute(\"CREATE TABLE MIN_HISTORY_LEVEL (\" +\n \" MHL_TXNID bigint NOT NULL,\" +\n \" MHL_MIN_OPEN_TXNID bigint NOT NULL,\" +\n \" PRIMARY KEY(MHL_TXNID))\");\n\n stmt.execute(\"CREATE TABLE HIVE_LOCKS (\" +\n \" HL_LOCK_EXT_ID bigint NOT NULL,\" +\n \" HL_LOCK_INT_ID bigint NOT NULL,\" +\n \" HL_TXNID bigint NOT NULL,\" +\n \" HL_DB varchar(128) NOT NULL,\" +\n \" HL_TABLE varchar(128),\" +\n \" HL_PARTITION varchar(767),\" +\n \" HL_LOCK_STATE char(1) NOT NULL,\" +\n \" HL_LOCK_TYPE char(1) NOT NULL,\" +\n \" HL_LAST_HEARTBEAT bigint NOT NULL,\" +\n \" HL_ACQUIRED_AT bigint,\" +\n \" HL_USER varchar(128) NOT NULL,\" +\n \" HL_HOST varchar(128) NOT NULL,\" +\n \" HL_HEARTBEAT_COUNT integer,\" +\n \" HL_AGENT_INFO varchar(128),\" +\n \" HL_BLOCKEDBY_EXT_ID bigint,\" +\n \" HL_BLOCKEDBY_INT_ID bigint,\" +\n \" PRIMARY KEY(HL_LOCK_EXT_ID, HL_LOCK_INT_ID))\");\n stmt.execute(\"CREATE INDEX HL_TXNID_INDEX ON HIVE_LOCKS (HL_TXNID)\");\n\n stmt.execute(\"CREATE TABLE NEXT_LOCK_ID (\" + \" NL_NEXT bigint NOT NULL)\");\n stmt.execute(\"INSERT INTO NEXT_LOCK_ID VALUES(1)\");\n\n stmt.execute(\"CREATE TABLE COMPACTION_QUEUE (\" +\n \" CQ_ID bigint PRIMARY KEY,\" +\n \" CQ_DATABASE varchar(128) NOT NULL,\" +\n \" CQ_TABLE varchar(128) NOT NULL,\" +\n \" CQ_PARTITION varchar(767),\" +\n \" CQ_STATE char(1) NOT NULL,\" +\n \" CQ_TYPE char(1) NOT NULL,\" +\n \" CQ_TBLPROPERTIES varchar(2048),\" +\n \" CQ_WORKER_ID varchar(128),\" +\n \" CQ_START bigint,\" +\n \" CQ_RUN_AS varchar(128),\" +\n \" CQ_HIGHEST_WRITE_ID bigint,\" +\n \" CQ_META_INFO varchar(2048) for bit data,\" +\n \" CQ_HADOOP_JOB_ID varchar(32))\");\n\n stmt.execute(\"CREATE TABLE NEXT_COMPACTION_QUEUE_ID (NCQ_NEXT bigint NOT NULL)\");\n stmt.execute(\"INSERT INTO NEXT_COMPACTION_QUEUE_ID VALUES(1)\");\n\n stmt.execute(\"CREATE TABLE COMPLETED_COMPACTIONS (\" +\n \" CC_ID bigint PRIMARY KEY,\" +\n \" CC_DATABASE varchar(128) NOT NULL,\" +\n \" CC_TABLE varchar(128) NOT NULL,\" +\n \" CC_PARTITION varchar(767),\" +\n \" CC_STATE char(1) NOT NULL,\" +\n \" CC_TYPE char(1) NOT NULL,\" +\n \" CC_TBLPROPERTIES varchar(2048),\" +\n \" CC_WORKER_ID varchar(128),\" +\n \" CC_START bigint,\" +\n \" CC_END bigint,\" +\n \" CC_RUN_AS varchar(128),\" +\n \" CC_HIGHEST_WRITE_ID bigint,\" +\n \" CC_META_INFO varchar(2048) for bit data,\" +\n \" CC_HADOOP_JOB_ID varchar(32))\");\n\n stmt.execute(\"CREATE TABLE AUX_TABLE (\" +\n \" MT_KEY1 varchar(128) NOT NULL,\" +\n \" MT_KEY2 bigint NOT NULL,\" +\n \" MT_COMMENT varchar(255),\" +\n \" PRIMARY KEY(MT_KEY1, MT_KEY2))\");\n\n stmt.execute(\"CREATE TABLE WRITE_SET (\" +\n \" WS_DATABASE varchar(128) NOT NULL,\" +\n \" WS_TABLE varchar(128) NOT NULL,\" +\n \" WS_PARTITION varchar(767),\" +\n \" WS_TXNID bigint NOT NULL,\" +\n \" WS_COMMIT_ID bigint NOT NULL,\" +\n \" WS_OPERATION_TYPE char(1) NOT NULL)\"\n );\n\n stmt.execute(\"CREATE TABLE REPL_TXN_MAP (\" +\n \" RTM_REPL_POLICY varchar(256) NOT NULL, \" +\n \" RTM_SRC_TXN_ID bigint NOT NULL, \" +\n \" RTM_TARGET_TXN_ID bigint NOT NULL, \" +\n \" PRIMARY KEY (RTM_REPL_POLICY, RTM_SRC_TXN_ID))\"\n );\n\n stmt.execute(\"CREATE TABLE MATERIALIZATION_REBUILD_LOCKS (\" +\n \" MRL_TXN_ID BIGINT NOT NULL, \" +\n \" MRL_DB_NAME VARCHAR(128) NOT NULL, \" +\n \" MRL_TBL_NAME VARCHAR(256) NOT NULL, \" +\n \" MRL_LAST_HEARTBEAT BIGINT NOT NULL, \" +\n \" PRIMARY KEY(MRL_TXN_ID))\"\n );\n\n try {\n stmt.execute(\"CREATE TABLE \\\"APP\\\".\\\"SEQUENCE_TABLE\\\" (\\\"SEQUENCE_NAME\\\" VARCHAR(256) NOT \" +\n\n \"NULL, \\\"NEXT_VAL\\\" BIGINT NOT NULL)\"\n );\n } catch (SQLException e) {\n if (e.getMessage() != null && e.getMessage().contains(\"already exists\")) {\n LOG.info(\"SEQUENCE_TABLE table already exist, ignoring\");\n } else {\n throw e;\n }\n }\n\n try {\n stmt.execute(\"CREATE TABLE \\\"APP\\\".\\\"NOTIFICATION_SEQUENCE\\\" (\\\"NNI_ID\\\" BIGINT NOT NULL, \" +\n\n \"\\\"NEXT_EVENT_ID\\\" BIGINT NOT NULL)\"\n );\n } catch (SQLException e) {\n if (e.getMessage() != null && e.getMessage().contains(\"already exists\")) {\n LOG.info(\"NOTIFICATION_SEQUENCE table already exist, ignoring\");\n } else {\n throw e;\n }\n }\n\n try {\n stmt.execute(\"CREATE TABLE \\\"APP\\\".\\\"NOTIFICATION_LOG\\\" (\\\"NL_ID\\\" BIGINT NOT NULL, \" +\n \"\\\"DB_NAME\\\" VARCHAR(128), \\\"EVENT_ID\\\" BIGINT NOT NULL, \\\"EVENT_TIME\\\" INTEGER NOT\" +\n\n \" NULL, \\\"EVENT_TYPE\\\" VARCHAR(32) NOT NULL, \\\"MESSAGE\\\" CLOB, \\\"TBL_NAME\\\" \" +\n \"VARCHAR\" +\n \"(256), \\\"MESSAGE_FORMAT\\\" VARCHAR(16))\"\n );\n } catch (SQLException e) {\n if (e.getMessage() != null && e.getMessage().contains(\"already exists\")) {\n LOG.info(\"NOTIFICATION_LOG table already exist, ignoring\");\n } else {\n throw e;\n }\n }\n\n stmt.execute(\"INSERT INTO \\\"APP\\\".\\\"SEQUENCE_TABLE\\\" (\\\"SEQUENCE_NAME\\\", \\\"NEXT_VAL\\\") \" +\n \"SELECT * FROM (VALUES ('org.apache.hadoop.hive.metastore.model.MNotificationLog', \" +\n \"1)) tmp_table WHERE NOT EXISTS ( SELECT \\\"NEXT_VAL\\\" FROM \\\"APP\\\"\" +\n \".\\\"SEQUENCE_TABLE\\\" WHERE \\\"SEQUENCE_NAME\\\" = 'org.apache.hadoop.hive.metastore\" +\n \".model.MNotificationLog')\");\n\n stmt.execute(\"INSERT INTO \\\"APP\\\".\\\"NOTIFICATION_SEQUENCE\\\" (\\\"NNI_ID\\\", \\\"NEXT_EVENT_ID\\\")\" +\n \" SELECT * FROM (VALUES (1,1)) tmp_table WHERE NOT EXISTS ( SELECT \" +\n \"\\\"NEXT_EVENT_ID\\\" FROM \\\"APP\\\".\\\"NOTIFICATION_SEQUENCE\\\")\");\n } catch (SQLException e) {\n try {\n conn.rollback();\n } catch (SQLException re) {\n LOG.error(\"Error rolling back: \" + re.getMessage());\n }\n\n // Another thread might have already created these tables.\n if (e.getMessage() != null && e.getMessage().contains(\"already exists\")) {\n LOG.info(\"Txn tables already exist, returning\");\n return;\n }\n\n // This might be a deadlock, if so, let's retry\n if (e instanceof SQLTransactionRollbackException && deadlockCnt++ < 5) {\n LOG.warn(\"Caught deadlock, retrying db creation\");\n prepDb(conf);\n } else {\n throw e;\n }\n } finally {\n deadlockCnt = 0;\n closeResources(conn, stmt, null);\n }\n }", "@Test(expected = YorNException.class)\n\tpublic void testYorNException() throws Exception {\n\t\t//Graph<Vertex, Edge> g = new GraphPoetFactory().createGraph(\"src/GraphPoet.txt\");\n\t\tGraphPoetFactory graphPoetFactory = new GraphPoetFactory();\n\t\tgraphPoetFactory.createGraph(\"src/GraphPoet.txt\");\n\t\tnew GraphPoetFactory().parse(\"Edge=<ab,WordNeighborhood,1,a,b,Y>\");\n\t}", "@Test\n\tpublic void testSchemaIsComplete() {\n\t\tOrientGraph g = factory.getTx();\n\t\tOrientVertexType t = g.getVertexType(\"ElementTrace\");\n\t\tassertThat(t, is(notNullValue()));\n\t\t\n\t\tOrientEdgeType et = g.getEdgeType(\"Accesses\");\n\t}", "public abstract void connect() throws OrmException;", "@Test(timeout = 4000)\n public void test062() throws Throwable {\n DBUtil.checkReadOnly(\"SELECT pronae,oid FROM pg_roc WHEE \", true);\n }", "@Test\n public void createAndDeleteSQLMetaAtomInfo() {\n try {\n ThermoSQLConnection connect = new ThermoSQLConnection();\n if (connect.connect()) {\n SQLMetaAtomInfo sqlinfo = new SQLMetaAtomInfo(connect);\n \n \n MetaAtomInfo infoCO = new MetaAtomInfo();\n infoCO.setElementName(\"AldehydeKetone\");\n infoCO.setMetaAtomName(\"ald\");\n infoCO.setMetaAtomType(\"BensonAtom\");\n sqlinfo.addToDatabase(infoCO);\n \n sqlinfo.deleteElement(infoCO);\n \n HashSet vec = sqlinfo.retrieveDatabase();\n Iterator i = vec.iterator();\n while (i.hasNext()) {\n MetaAtomInfo inf = (MetaAtomInfo) i.next();\n System.out.println(inf.toString());\n }\n vec = sqlinfo.retrieveMetaAtomTypesFromDatabase(\"BensonAtom\");\n i = vec.iterator();\n while (i.hasNext()) {\n MetaAtomInfo inf = (MetaAtomInfo) i.next();\n System.out.println(inf.toString());\n }\n \n\n }\n } catch (SQLException ex) {\n Logger.getLogger(TestSQLMetaAtoms.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n }", "public static void test() {\n\t\t\n\t\tSystem.out.println(\"\\n\\n------------ TESTING CODE ASSIGNMENT 4D --------------\\n\\n\");\n\t\t\n\t\t\n\t\tEntityManagerFactory entityManagerFactory = PersistenceUtil.getEntityManagerFactory();\n\t\tEntityManager entityManager = entityManagerFactory.createEntityManager();\n\t\t\n\t\tentityManager.getTransaction().begin();\n\t\n\t\tSQLInterceptor.resetSelectCount();\n\t\t\n//\t\tSystem.out.println(\"Executing efficient query of task 2b:\");\n\t\tJPQLQueries jpqlQueries = new JPQLQueries(entityManager);\n\t\tjpqlQueries.getComputerUsage();\n\t\t\n\t\tSQLInterceptor.printSelectCount();\n\t\t\n\t\tentityManager.getTransaction().commit();\n\t\tentityManager.close();\n\t}", "@Test(timeout = 4000)\n public void test037() throws Throwable {\n DBUtil.checkReadOnly(\"SELECT pronae,oid FROM pg_roc WHEE \", false);\n }", "@Override\n\t/*\n\t * public int checkNodeInDBByCoordinate(Coordinate coordinate) {\n\t * \n\t * ResultSet resultSet = null; int x = coordinate.getX(); int y =\n\t * coordinate.getY(); try {\n\t * \n\t * String checkNodesInDB =\n\t * \"select id from routefinder.node where x=? and y=?\"; pstmt =\n\t * conn.prepareStatement(checkNodesInDB); pstmt.setInt(1, x);\n\t * pstmt.setInt(2, y); resultSet = pstmt.executeQuery(); if\n\t * (resultSet.next()) { return resultSet.getInt(\"id\"); } else {\n\t * System.out.println(\"Cannot find node \" + x + \", \" + y); return -1; } }\n\t * catch (SQLException se) { se.printStackTrace(); return -1; } finally {\n\t * JdbcConnect.resultClose(resultSet, pstmt); } }\n\t */\n\tpublic int checkNodeRelationInDBByNodeRelation(NodeRelation[] nodeRelation) {\n\t\treturn 0;\n\t}", "public void ExecuteCypherQueryNoReturn(String cypherQuery) {\r\n\t\tExecutionEngine engine = new ExecutionEngine( _db );\r\n\t\tExecutionResult result = null;\r\n\t\tTransaction tx = _db.beginTx();\r\n\t\ttry {\r\n\t\t engine.execute(cypherQuery);\r\n\t\t tx.success();\r\n\t\t} catch (Exception ex) {\r\n\t\t\tex.printStackTrace();\r\n\t\t\tSystem.out.print(\"issues with fetching node and its relations\");\r\n\t\t\ttx.failure();\r\n\t\t\t//return \"failed\";\r\n\t\t} finally {\r\n\t\t\ttx.close();\r\n\t\t}\r\n\t}", "public static void main(String[] args) {\n graph.addEdge(\"Mumbai\",\"Warangal\");\n graph.addEdge(\"Warangal\",\"Pennsylvania\");\n graph.addEdge(\"Pennsylvania\",\"California\");\n //graph.addEdge(\"Montevideo\",\"Jameka\");\n\n\n String sourceNode = \"Pennsylvania\";\n\n if(graph.isGraphConnected(sourceNode)){\n System.out.println(\"Yes\");\n } else {\n System.out.println(\"No\");\n }\n }", "@Test\n\tpublic void testElasticConnectionToExpandedDatabase() throws Exception {\n\n\t\t// Given\n\t\tint pieceSize = 16384;\n\t\tint totalLength = 16384 * 4;\n\t\tPieceDatabase pieceDatabase = MockPieceDatabase.createElastic (\"1111\", pieceSize);\n\t\tpieceDatabase.start (true);\n\t\tMap<String,Integer> extensions = new HashMap<String,Integer>();\n\t\textensions.put (PeerProtocolConstants.EXTENSION_ELASTIC, (int)PeerProtocolConstants.EXTENDED_MESSAGE_TYPE_ELASTIC);\n\t\tMap<String,Integer> expectedExtensions = new HashMap<String,Integer>();\n\t\texpectedExtensions.put (PeerProtocolConstants.EXTENSION_PEER_METADATA, (int)PeerProtocolConstants.EXTENDED_MESSAGE_TYPE_PEER_METADATA);\n\t\texpectedExtensions.put (PeerProtocolConstants.EXTENSION_ELASTIC, (int)PeerProtocolConstants.EXTENDED_MESSAGE_TYPE_ELASTIC);\n\t\tBDictionary extra = new BDictionary();\n\t\textra.put (\"metadata_size\", BEncoder.encode (pieceDatabase.getInfo().getDictionary()).length);\n\t\tPeerServices peerServices = mock (PeerServices.class);\n\t\tPeerSetContext peerSetContext = new PeerSetContext (peerServices, pieceDatabase, mock (RequestManager.class), mock (ExtensionManager.class));\n\t\twhen(peerSetContext.requestManager.piecesAvailable (any (ManageablePeer.class))).thenReturn (true);\n\t\twhen(peerSetContext.requestManager.allocateRequests (any (ManageablePeer.class), anyInt(), anyBoolean())).thenReturn (new ArrayList<BlockDescriptor>());\n\t\t// Extend the database. The info hash will not change\n\t\ttotalLength += pieceSize;\n\t\tpieceDatabase.extendData (MockPieceDatabase.mockPrivateKey, ByteBuffer.wrap (Util.pseudoRandomBlock (4, pieceSize, pieceSize)));\n\t\t// Remote peer connects on the original info hash\n\t\tMockConnection mockConnection = new MockConnection();\n\t\tPeerHandler handler = new PeerHandler (peerSetContext, mockConnection, new PeerID(), new PeerStatistics(), true, true);\n\n\t\t// When\n\t\tmockConnection.mockInput (PeerProtocolBuilder.haveAllMessage());\n\t\tmockConnection.mockInput (PeerProtocolBuilder.extensionHandshakeMessage (extensions, null));\n\t\thandler.connectionReady (mockConnection, true, true);\n\n\t\t// Then\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.haveNoneMessage());\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.extensionHandshakeMessage (expectedExtensions, extra));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.elasticSignatureMessage (PeerProtocolConstants.EXTENDED_MESSAGE_TYPE_ELASTIC, pieceDatabase.getViewSignature (totalLength)));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.elasticBitfieldMessage (PeerProtocolConstants.EXTENDED_MESSAGE_TYPE_ELASTIC, new BitField(5).not()));\n\t\tmockConnection.mockExpectOutput (PeerProtocolBuilder.interestedMessage());\n\t\tmockConnection.mockExpectNoMoreOutput();\n\t\tverify(peerSetContext.extensionManager).offerExtensionsToPeer (handler);\n\t\tverify(peerSetContext.extensionManager).enableDisablePeerExtensions (\n\t\t\t\teq (handler),\n\t\t\t\teq (new HashSet<String> (Arrays.asList (PeerProtocolConstants.EXTENSION_ELASTIC))),\n\t\t\t\teq (new HashSet<String>()),\n\t\t\t\targThat (new ArgumentMatcher<BDictionary>() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic boolean matches (Object argument) {\n\t\t\t\t\t\treturn ((BDictionary)argument).size() == 0;\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t);\n\t\tassertEquals (4, handler.getRemoteBitField().length());\n\t\tmockConnection.mockExpectNoMoreOutput();\n\n\n\t\tpieceDatabase.terminate (true);\n\n\t}", "public void makePreferredOTTOLRelationshipsConflicts(){\n \t\tTransaction tx;\n \t\tString name = \"life\";\n \t\tIndexHits<Node> foundNodes = findTaxNodeByName(name);\n Node firstNode = null;\n if (foundNodes.size() < 1){\n System.out.println(\"name '\" + name + \"' not found. quitting.\");\n return;\n } else if (foundNodes.size() > 1) {\n System.out.println(\"more than one node found for name '\" + name + \"'not sure how to deal with this. quitting\");\n } else {\n for (Node n : foundNodes)\n firstNode = n;\n }\n \t\tTraversalDescription CHILDOF_TRAVERSAL = Traversal.description()\n \t\t\t\t.relationships( RelTypes.TAXCHILDOF,Direction.INCOMING );\n \t\tSystem.out.println(firstNode.getProperty(\"name\"));\n \t\tint count = 0;\n \t\ttx = graphDb.beginTx();\n \t\ttry{\n \t\t\tfor(Node friendnode : CHILDOF_TRAVERSAL.traverse(firstNode).nodes()){\n \t\t\t\tboolean conflict = false;\n \t\t\t\tString endNode = \"\";\n \t\t\t\tRelationship ncbirel = null;\n \t\t\t\tRelationship ottolrel = null;\n \t\t\t\tfor(Relationship rel : friendnode.getRelationships(Direction.OUTGOING)){\n \t\t\t\t\tif (rel.getEndNode() == rel.getStartNode()){\n \t\t\t\t\t\tcontinue;\n \t\t\t\t\t}else{\n \t\t\t\t\t\tif (endNode == \"\")\n \t\t\t\t\t\t\tendNode = (String) rel.getEndNode().getProperty(\"name\");\n \t\t\t\t\t\tif ((String)rel.getEndNode().getProperty(\"name\") != endNode){\n \t\t\t\t\t\t\tconflict = true;\n \t\t\t\t\t\t}\n \t\t\t\t\t\tif(((String)rel.getProperty(\"source\")).compareTo(\"ncbi\")==0)\n \t\t\t\t\t\t\tncbirel = rel;\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\tif (conflict && ncbirel != null){\n \t\t\t\t\tcount += 1;\n //\t\t\t\t\tSystem.out.println(\"would make one from \"+ncbirel.getStartNode().getProperty(\"name\")+\" \"+ncbirel.getEndNode().getProperty(\"name\"));\n \t\t\t\t\tif(ncbirel.getStartNode()!=ncbirel.getEndNode()){\n \t\t\t\t\t\tncbirel.getStartNode().createRelationshipTo(ncbirel.getEndNode(), RelTypes.PREFTAXCHILDOF);\n \t\t\t\t\t\tRelationship newrel2 = ncbirel.getStartNode().createRelationshipTo(ncbirel.getEndNode(), RelTypes.TAXCHILDOF);\n \t\t\t\t\t\tnewrel2.setProperty(\"source\", \"ottol\");\n \t\t\t\t\t}else{\n \t\t\t\t\t\tSystem.out.println(\"would make cycle from \"+ncbirel.getEndNode().getProperty(\"name\"));\n \t\t\t\t\t}\n \t\t\t\t\t\n \t\t\t\t}\n \t\t\t\tif(count % transaction_iter == 0)\n \t\t\t\t\tSystem.out.println(count);\n \t\t\t}\n \t\t\ttx.success();\n \t\t}finally{\n \t\t\ttx.finish();\n \t\t}\n \t}", "private void updateNodesCatalog(NodeProfile nodeProfile) throws CantUpdateRecordDataBaseException, RecordNotFoundException, InvalidParameterException {\n\n /*\n * Create the NodesCatalog\n */\n NodesCatalog nodeCatalog = new NodesCatalog();\n nodeCatalog.setIp(nodeProfile.getIp());\n nodeCatalog.setDefaultPort(nodeProfile.getDefaultPort());\n nodeCatalog.setIdentityPublicKey(nodeProfile.getIdentityPublicKey());\n nodeCatalog.setName(nodeProfile.getName());\n nodeCatalog.setOfflineCounter(0);\n nodeCatalog.setLastConnectionTimestamp(new Timestamp(System.currentTimeMillis()));\n\n\n //Validate if location are available\n if (nodeProfile.getLocation() != null){\n nodeCatalog.setLastLatitude(nodeProfile.getLocation().getLatitude());\n nodeCatalog.setLastLongitude(nodeProfile.getLocation().getLongitude());\n }\n\n /*\n * Save into the data base\n */\n getDaoFactory().getNodesCatalogDao().update(nodeCatalog);\n }", "@Test public void gh1197() {\n execute(new CreateDB(NAME));\n execute(new Add(\"a.xml\", \"<a><b/><b/></a>\"));\n execute(new Add(\"a.xml\", \"<c><b/></c>\"));\n query(\"//b[/a]\", \"<b/>\\n<b/>\");\n }", "public void testInsert5() throws Exception { \n\n DAS das = DAS.FACTORY.createDAS(getConfig(\"CompanyConfig.xml\"), getConnection()); \n Command select = das.getCommand(\"all companies\"); \n DataObject root = select.executeQuery(); \n\n root.createDataObject(\"COMPANY\"); \n\n das.applyChanges(root); \n\n // Verify insert \n root = select.executeQuery(); \n assertEquals(4, root.getList(\"COMPANY\").size()); \n\n }", "@RepositoryRestResource(collectionResourceRel = \"User\", path = \"User\")\npublic interface UserRepository extends Neo4jRepository<User, Long> {\n\n @Query(value = \"MATCH (a:User),(b:Report)\\n\" +\n \"WHERE a.username = :#{#username} AND ID(b) = :#{#reportId}\\n\" +\n \"CREATE (a)-[r:REPORT]->(b)\")\n @Transactional\n void createReportRelationship(@Param(\"username\") String username, @Param(\"reportId\") Long reportId);\n}", "protected void createRepository() throws Exception {\r\n\t\t\r\n\t\t//Creating MLSesame Connection object Using MarkLogicRepositoryConfig\r\n\t\t\r\n\t\tMarkLogicRepositoryConfig adminconfig = new MarkLogicRepositoryConfig();\r\n\t\tadminconfig.setHost(host);\r\n\t\tadminconfig.setAuth(\"DIGEST\");\r\n\t\tadminconfig.setUser(\"admin\");\r\n\t\tadminconfig.setPassword(\"admin\");\r\n\t\tadminconfig.setPort(restPort);\r\n\t\tRepositoryFactory factory = new MarkLogicRepositoryFactory();\r\n Assert.assertEquals(\"marklogic:MarkLogicRepository\", factory.getRepositoryType());\r\n try {\r\n\t\t\ttestAdminRepository = (MarkLogicRepository) factory.getRepository(adminconfig);\r\n\t\t} catch (RepositoryConfigException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n try {\r\n\t\t\ttestAdminRepository.initialize();\r\n\t\t\ttestAdminCon = (MarkLogicRepositoryConnection) testAdminRepository.getConnection();\r\n\t\t} catch (RepositoryException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n \r\n // Creating testAdminCon with MarkLogicRepositoryConfig constructor\r\n testAdminCon.close();\r\n testAdminRepository.shutDown();\r\n testAdminRepository = null; \r\n testAdminCon = null; \r\n \r\n adminconfig = new MarkLogicRepositoryConfig(host,restPort,\"admin\",\"admin\",\"DIGEST\");\r\n Assert.assertEquals(\"marklogic:MarkLogicRepository\", factory.getRepositoryType());\r\n testAdminRepository = (MarkLogicRepository) factory.getRepository(adminconfig);\r\n testAdminRepository.initialize();\r\n \r\n testAdminCon = testAdminRepository.getConnection();\r\n Assert.assertTrue(testAdminCon instanceof MarkLogicRepositoryConnection);\r\n \r\n Repository otherrepo = factory.getRepository(adminconfig);\r\n RepositoryConnection conn = null;\r\n try{\r\n \t //try to get connection without initializing repo, will throw error\r\n conn = otherrepo.getConnection();\r\n Assert.assertTrue(false);\r\n }\r\n catch(Exception e){\r\n \tAssert.assertTrue(e instanceof RepositoryException);\r\n \tAssert.assertTrue(conn == null);\r\n \totherrepo.shutDown();\r\n }\r\n \r\n Assert.assertTrue(testAdminCon instanceof MarkLogicRepositoryConnection);\r\n graph1 = testAdminCon.getValueFactory().createURI(\"http://marklogic.com/Graph1\");\r\n graph2 = testAdminCon.getValueFactory().createURI(\"http://marklogic.com/Graph2\");\r\n dirgraph = testAdminCon.getValueFactory().createURI(\"http://marklogic.com/dirgraph\");\r\n dirgraph1 = testAdminCon.getValueFactory().createURI(\"http://marklogic.com/dirgraph1\");\r\n \r\n \r\n //Creating MLSesame Connection object Using MarkLogicRepository overloaded constructor\r\n if(testReaderCon == null || testReaderRepository ==null){\r\n \ttestReaderRepository = new MarkLogicRepository(host, restPort, \"reader\", \"reader\", \"DIGEST\");\r\n\t try {\r\n\t\t\t\ttestReaderRepository.initialize();\r\n\t\t\t\tAssert.assertNotNull(testReaderRepository);\r\n\t\t\t\ttestReaderCon = (MarkLogicRepositoryConnection) testReaderRepository.getConnection();\r\n\t\t\t} catch (RepositoryException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t Assert.assertTrue(testReaderCon instanceof MarkLogicRepositoryConnection);\r\n\t \r\n\t }\r\n \r\n \r\n //Creating MLSesame Connection object Using MarkLogicRepository(databaseclient) constructor\r\n if (databaseClient == null){\r\n \tdatabaseClient = DatabaseClientFactory.newClient(host, restPort, \"writer\", \"writer\", DatabaseClientFactory.Authentication.valueOf(\"DIGEST\"));\r\n }\r\n \t\t\r\n\t\tif(testWriterCon == null || testWriterRepository ==null){\r\n\t\t\ttestWriterRepository = new MarkLogicRepository(databaseClient);\r\n\t\t\tqmgr = databaseClient.newQueryManager();\r\n\t\t\t\r\n\t\t\ttry {\r\n\t\t\t\ttestWriterRepository.initialize();\r\n\t\t\t\tAssert.assertNotNull(testWriterRepository);\r\n\t\t\t\ttestWriterCon = (MarkLogicRepositoryConnection) testWriterRepository.getConnection();\r\n\t\t\t} catch (RepositoryException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "public static void main(String[] args) throws Exception {\n\t\t\n\n BufferedReader reader = new BufferedReader(new FileReader(\"src/main/resources/example/ontologytemp.owl\"));\n BufferedWriter writer = new BufferedWriter(new FileWriter(\"src/main/resources/example/test.owl\"));\n\t\t\n\t\t\n\t\t/*File owl = new File(\"/Users/user/Dropbox/Thesis/OntopCLIfiles/ontology5.owl\");\n File obda = new File(\"/Users/user/Dropbox/Thesis/OntopCLIfiles/ontology-conf.obda\");\n\t\tString baseUri = \"http://www.semanticweb.org/user/ontologies/\";\n\t\tString jdbcUrl = \"jdbc:mysql://localhost/conference10\";\n\t\tString jdbcUserName = \"root\";\n\t\tString jdbcPassword = \"root\";\n\t\tString jdbcDriverClass = \"com.mysql.jdbc.Driver\";\n\t\t\n\t\tDirectMappingBootstrapper dm = new DirectMappingBootstrapper(baseUri, jdbcUrl, jdbcUserName, jdbcPassword, jdbcDriverClass);\n\t\tOBDAModel model = dm.getModel();\n\t\tOWLOntology onto = dm.getOntology();\n\t\tModelIOManager mng = new ModelIOManager(model);\n\t\tmng.save(obda);\n onto.getOWLOntologyManager().saveOntology(onto,\n new FileDocumentTarget(owl));*/\n\t\t\n\t\t\n\t\t/*\n\t\tXFactoryBufferedImpl factory = new XFactoryBufferedImpl();\t\n\t\t\n\t\tXAttribute attr = factory.createAttributeLiteral(\"concept:name\", \"tracevalue\", null); // create attribute for trace\n\t\tXAttributeMap attrMapTrace = new XAttributeMapImpl(); // create a new map attribute\n\t\tattrMapTrace.put(\"concept:name\", attr);\t// put attribute to the map attribute\n\t\tXTrace xtrace = factory.createTrace(attrMapTrace); // create xtrace\n\t\t\n\t\tXAttributeMap attrMap = new XAttributeMapImpl(); // create a new map attribute\n\t\tattr = factory.createAttributeLiteral(\"key1\", \"value\", null); // create attribute\t\t\n\t\t//attr = factory.createAttributeLiteral(\"key2\", \"value\", null); // create attribute\n\t\tattrMap.put(\"key1\", attr); // put attribute to the map attribute\n\t\t//attrMap.put(\"key2\", attr);\n\t\tXEvent xevent = factory.createEvent(attrMap); // create xevent\n\t\txtrace.insertOrdered(xevent); // insert event in correct order in a trace\n\t\t\n\t\tattrMap = new XAttributeMapImpl(); // create a new map attribute\n\t\tattr = factory.createAttributeLiteral(\"key1\", \"value\", null); // create attribute\t\t\n\t\t//attr = factory.createAttributeLiteral(\"key2\", \"value\", null); // create attribute\n\t\tattrMap.put(\"key1\", attr); // put attribute to the map attribute\n\t\t//attrMap.put(\"key2\", attr);\n\t\tXEvent xevent2 = factory.createEvent(attrMap); // create xevent\n\t\t\n\t\tSystem.out.println(xtrace.contains(xevent2));\n\t\t*/\n\t}", "private boolean migratePartFamilyData(Context context) throws Exception {\n boolean migrationStatus = false;\n try {\n matrix.db.Policy cPolicy = new matrix.db.Policy(POLICY_CLASSIFICATION);\n\n // Get a MapList of Part Family, Part Issuer objects in the database\n // that need to be migrated\n\n StringList objectSelects = new StringList(8);\n objectSelects.addElement(\"id\");\n objectSelects.addElement(\"type\");\n objectSelects.addElement(\"name\");\n objectSelects.addElement(\"revision\");\n objectSelects.addElement(\"vault\");\n objectSelects.addElement(\"current\");\n objectSelects.addElement(\"policy\");\n objectSelects.addElement(SELECT_PART_FAMILY_MEMBER_RELATIONSHIP_NAME);\n\n // query for all Part Family objects, this will include Part Issuer objects\n // since it is sub-type of Part Family\n matrix.db.Query query = new matrix.db.Query(\"\");\n\n query.open(context);\n query.setBusinessObjectType(TYPE_PART_FAMILY);\n query.setBusinessObjectName(\"*\");\n query.setBusinessObjectRevision(\"*\");\n query.setOwnerPattern(\"*\");\n query.setVaultPattern(\"*\");\n query.setWhereExpression(\"\");\n query.setExpandType(true);\n\n BusinessObjectWithSelectList list = new BusinessObjectWithSelectList(1);\n QueryIterator qItr = null;\n try {\n ContextUtil.startTransaction(context, false);\n qItr = query.getIterator(context, objectSelects, (short) 1000);\n while (qItr.hasNext())\n list.addElement(qItr.next());\n\n ContextUtil.commitTransaction(context);\n } catch (Exception ex) {\n ContextUtil.abortTransaction(context);\n throw new Exception(ex.toString());\n } finally {\n qItr.close();\n }\n ArrayList partFamilyList = null;\n\n if (list != null && list.size() > 0) {\n partFamilyList = toMapList(list);\n }\n\n query.close(context);\n\n String command = null;\n\n // loop thru the list, change the policy to 'Classification'\n // if the type is \"Part Issuer'\n // i.e. this change is not required for 'Part Family'\n //\n // For each of these objects, get the connected \"Part Family Member\"\n // relationships, change them to \"Classified Item\"\n\n if (partFamilyList != null && partFamilyList.size() > 0) {\n Iterator partFamilyItr = partFamilyList.iterator();\n String objectId = null;\n String objectType = null;\n String objectName = null;\n String objectRev = null;\n String objectVault = null;\n String objectState = null;\n String objectPolicy = null;\n StringList partFamiltMemberRelList = null;\n Iterator partFamiltMemberRelItr = null;\n BusinessObject busObject = null;\n String initialRev = cPolicy.getFirstInSequence(context);\n emxInstallUtil_mxJPO.println(context, \">initialRev \" + initialRev + \"\\n\");\n\n while (partFamilyItr.hasNext()) {\n Map map = (Map) partFamilyItr.next();\n\n objectId = (String) map.get(\"id\");\n objectType = (String) map.get(\"type\");\n objectName = (String) map.get(\"name\");\n objectRev = (String) map.get(\"revision\");\n objectVault = (String) map.get(\"vault\");\n objectState = (String) map.get(\"current\");\n objectPolicy = (String) map.get(\"policy\");\n\n busObject = new BusinessObject(objectId);\n busObject.open(context);\n\n // change the type, policy for 'Part Issuer' objects\n // this forces to change the revision of the object to comply with Classification policy\n if (isTypePartIssuerExists && objectType.equals(TYPE_PART_ISSUER)) {\n try {\n if (objectRev != initialRev) {\n // core requires name to be changed if revision is changed\n // so fool it by first changing, and then change it back to its original name\n String fakeName = objectName + \"Conversion~\";\n busObject.change(context, TYPE_PART_FAMILY, fakeName, initialRev, objectVault, POLICY_CLASSIFICATION);\n busObject.update(context);\n\n busObject.change(context, TYPE_PART_FAMILY, objectName, initialRev, objectVault, POLICY_CLASSIFICATION);\n busObject.update(context);\n } else {\n busObject.change(context, TYPE_PART_FAMILY, objectName, objectRev, objectVault, POLICY_CLASSIFICATION);\n busObject.update(context);\n }\n\n // In case, if customer renamed state \"Exists\" to \"Active\"\n // then do not promote, bacause core will adjust the state automatically\n if (POLICY_PART_ISSUER_STATE_EXISTS.equals(objectState) && !POLICY_PART_ISSUER_STATE_EXISTS.equals(STATE_ACTIVE)) {\n busObject.promote(context);\n }\n\n } catch (MatrixException e) {\n duplicatePartIssuerExists = true;\n emxInstallUtil_mxJPO.println(context, \">WARNING: Duplicate name found for Part Issuer object: id\" + objectId + \" :name :\" + objectName + \"\\n\");\n }\n\n }\n\n // change the policy for 'Part Family' objects\n // It is assumed here that \"Part Family\" type objects used \"Part Family\" policy\n if (POLICY_PART_FAMILY.equals(objectPolicy)) {\n busObject.setPolicy(context, cPolicy);\n busObject.update(context);\n\n // In case, if customer renamed state \"Exists\" to \"Active\"\n // then do not promote, bacause core will adjust the state automatically\n if (STATE_EXISTS.equals(objectState) && !STATE_EXISTS.equals(STATE_ACTIVE)) {\n busObject.promote(context);\n }\n }\n\n busObject.update(context);\n busObject.close(context);\n\n // if the \"Part Family\", \"Part Issuer\" does not have associated Parts\n // map will not contain the key, this is also applicable if the conversion routine\n // is run multiple times\n if (map.containsKey(SELECT_PART_FAMILY_MEMBER_RELATIONSHIP_NAME)) {\n partFamiltMemberRelList = (StringList) map.get(SELECT_PART_FAMILY_MEMBER_RELATIONSHIP_NAME);\n if (partFamiltMemberRelList != null && partFamiltMemberRelList.size() > 0) {\n partFamiltMemberRelItr = partFamiltMemberRelList.iterator();\n\n while (partFamiltMemberRelItr.hasNext()) {\n command = \"modify connection \" + (String) partFamiltMemberRelItr.next() + \" type \\\"\" + RELATIONSHIP_CLASSIFIED_ITEM + \"\\\"\";\n emxInstallUtil_mxJPO.executeMQLCommand(context, command);\n }\n command = \"modify businessobject \" + objectId + \" \\\"\" + ATTRIBUTE_COUNT + \"\\\" \" + partFamiltMemberRelList.size();\n emxInstallUtil_mxJPO.executeMQLCommand(context, command);\n }\n }\n }\n } else {\n emxInstallUtil_mxJPO.println(context, \"No Part Family/Part Issuer objects found in the database\\n\");\n }\n migrationStatus = true;\n\n // delete the Part Issuer type, policy from the database\n if (isTypePartIssuerExists && !duplicatePartIssuerExists) {\n command = \"delete type \\\"\" + TYPE_PART_ISSUER + \"\\\"\";\n emxInstallUtil_mxJPO.executeMQLCommand(context, command);\n\n command = \"delete policy \\\"\" + POLICY_PART_ISSUER + \"\\\"\";\n emxInstallUtil_mxJPO.executeMQLCommand(context, command);\n }\n\n return migrationStatus;\n } catch (Exception ex) {\n emxInstallUtil_mxJPO.println(context, \">ERROR:in migratePartFamilyData method Exception :\" + ex.getMessage() + \"\\n\");\n throw ex;\n }\n }", "@Test(expected = NotFoundException.class)\n public void testDeleteEntityFromGDC() {\n Transaction tx = graphDatabaseContext.beginTx();\n Person p = new Person(\"Michael\", 35);\n Person spouse = new Person(\"Tina\", 36);\n p.setSpouse(spouse);\n long id = spouse.getId();\n graphDatabaseContext.removeNodeEntity(spouse);\n tx.success();\n tx.finish();\n Assert.assertNull(\"spouse removed \" + p.getSpouse(), p.getSpouse());\n NodeFinder<Person> finder = finderFactory.createNodeEntityFinder(Person.class);\n Person spouseFromIndex = finder.findByPropertyValue(Person.NAME_INDEX, \"name\", \"Tina\");\n Assert.assertNull(\"spouse not found in index\",spouseFromIndex);\n Assert.assertNull(\"node deleted \" + id, graphDatabaseContext.getNodeById(id));\n }", "@Test\n public void example13 () throws Exception {\n Map<String, Stmt> inputs = example2setup();\n conn.setNamespace(\"ex\", \"http://example.org/people/\");\n conn.setNamespace(\"ont\", \"http://example.org/ontology/\");\n String prefix = \"PREFIX ont: \" + \"<http://example.org/ontology/>\\n\";\n \n String queryString = \"select ?s ?p ?o where { ?s ?p ?o} \";\n TupleQuery tupleQuery = conn.prepareTupleQuery(QueryLanguage.SPARQL, queryString);\n assertSetsEqual(\"SELECT result:\", inputs.values(),\n statementSet(tupleQuery.evaluate()));\n \n assertTrue(\"Boolean result\",\n conn.prepareBooleanQuery(QueryLanguage.SPARQL,\n prefix + \n \"ask { ?s ont:name \\\"Alice\\\" } \").evaluate());\n assertFalse(\"Boolean result\",\n conn.prepareBooleanQuery(QueryLanguage.SPARQL,\n prefix + \n \"ask { ?s ont:name \\\"NOT Alice\\\" } \").evaluate());\n \n queryString = \"construct {?s ?p ?o} where { ?s ?p ?o . filter (?o = \\\"Alice\\\") } \";\n GraphQuery constructQuery = conn.prepareGraphQuery(QueryLanguage.SPARQL, queryString);\n assertSetsEqual(\"Construct result\",\n mapKeep(new String[] {\"an\"}, inputs).values(),\n statementSet(constructQuery.evaluate()));\n \n queryString = \"describe ?s where { ?s ?p ?o . filter (?o = \\\"Alice\\\") } \";\n GraphQuery describeQuery = conn.prepareGraphQuery(QueryLanguage.SPARQL, queryString);\n assertSetsEqual(\"Describe result\",\n mapKeep(new String[] {\"an\", \"at\"}, inputs).values(),\n statementSet(describeQuery.evaluate()));\n }", "@Before\r\n\tpublic void setup() throws Exception {\n\t\tinitializeInMemoryDatabase();\r\n\r\n\t\t// Created from org.openmrs.test.CreateInitialDataSet\r\n\t\t// without line for \"concept_synonym\" table (not exist)\r\n\t\t// using 1.4.4-createdb-from-scratch-with-demo-data.sql\r\n\t\t// Removed all empty short_name=\"\" from concepts\r\n\t\t// Added missing description to relationship_type\r\n\t\t// Removed all patients and related patient/person info (id 2-500)\r\n\t\t// Removed all concepts except those in sqldiff\r\n\t\texecuteDataSet(\"initial-openmrs-dataset.xml\");\r\n\r\n\t\t// Includes Motech data added in sqldiff\r\n\t\texecuteDataSet(\"motech-dataset.xml\");\r\n\t\t\r\n\t\t// Add example Location, Facility and Community\r\n\t\texecuteDataSet(\"facility-community-dataset.xml\");\r\n\r\n\t\tauthenticate();\r\n\r\n\t\tactivator.startup();\r\n\t}", "@Test\r\n void test_insert_two_vertice_with_one_edge_remove_non_existent_edge() {\r\n // Add three vertices with two edges\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"B\", \"C\");\r\n vertices = graph.getAllVertices();\r\n // B should be an adjacent vertex of A\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // C should be an adjacent vertex of B\r\n if(!graph.getAdjacentVerticesOf(\"B\").contains(\"C\")){\r\n fail();\r\n }\r\n //Check that A,B and C are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")\r\n | !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n // There are two edges in the graph\r\n if(graph.size() != 2) {\r\n fail();\r\n }\r\n // Try are remove edge from A to C\r\n graph.removeEdge(\"A\", \"C\");\r\n graph.removeEdge(\"A\", \"D\");\r\n graph.removeEdge(\"E\", \"F\");\r\n graph.removeEdge(null, \"A\");\r\n graph.removeEdge(\"A\", null);\r\n //Graph should maintain its original shape\r\n if(!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")){\r\n fail();\r\n }\r\n // C should be an adjacent vertex of B\r\n if(!graph.getAdjacentVerticesOf(\"B\").contains(\"C\")){\r\n fail();\r\n }\r\n //Check that A,B and C are in the graph\r\n if(!vertices.contains(\"A\") |!vertices.contains(\"B\")\r\n | !vertices.contains(\"C\")) {\r\n fail();\r\n }\r\n // There are two edges in the graph\r\n if(graph.size() != 2) {\r\n fail();\r\n }\r\n }", "@Test\n public void testDAM31901002() {\n // in this case, the boolean type is not supported by oracle db.\n // there is separate sql created to be executed for oracle database\n // however, the sql id that for oracle and other db are same.\n testDAM30802001();\n }", "public static void main(String[] args) {\n\t\tEntityManagerFactory emf = Persistence.createEntityManagerFactory(\"hello\"); // 1. 문제 없이 실행이 되었다면(엔티티 매니저 팩토리는 하나만 생성하고 App 전체에서 공유한다.)\n\t\t\n\t\tEntityManager em = emf.createEntityManager(); // 2. entityManager를 EntityManagerFactory에서 꺼내온다(쉽게 생각해서 DB의 connection 객체를 꺼내왔다고 보면 된다.). -> 엔티티 매니저는 서로 다른 쓰레드간에 공유해서 사용하면 안된다 특정 쓰레드에서 사용했다면 사용하고 버려야 한다.\n\t\t\n\t\tEntityTransaction tx = em.getTransaction(); // 3. 2번에서 얻어온 DB connection 객체에서 트랜잭션 하나를 얻어 온다.\n\t\t// 여기는 데이터 처리하는 곳(시작)\n\t\ttx.begin(); // 4. 트랜잭션 시작. -> jpa는 트랜잭션 안에서 작업을 해야 제대로 작동한다 트랜잭션으로 안 묶어주면 안된다(핵심).\n\t\ttry { \t\t\t\n\t\t\t\n\t\t\ttx.commit(); // 5. 정상적으로 오류없이 여기까지 왔다면 트랜잭션 커밋 .\n\t\t\t\n\t\t} catch(Exception e) { // 6. 수행 도중 오류가 있다면 트랜잭션 롤백.\n\t\t\ttx.rollback(); \n\t\t} finally { // 7. 5번을 정상적으로 수행했다면 em 객체 close\n\t\t\tem.close(); \n\t\t}\n\t\t// 여기는 데이터 처리하는 곳(끝)\n\t\temf.close(); // 8. try-catch문을 정상으로 빠져나왔따면 emf 객체 close\n\t}", "@Test\n public void getViajeroTest() {\n ViajeroEntity entity = data.get(0);\n ViajeroEntity newEntity = vp.find(entity.getId());\n Assert.assertNotNull(newEntity);\n Assert.assertEquals(entity.getId(), newEntity.getId());\n }", "public void connect() {\n\n DatabaseGlobalAccess.getInstance().setEmf(Persistence.createEntityManagerFactory(\"PU_dashboarddb\"));\n DatabaseGlobalAccess.getInstance().setEm(DatabaseGlobalAccess.getInstance().getEmf().createEntityManager());\n DatabaseGlobalAccess.getInstance().getDatabaseData();\n DatabaseGlobalAccess.getInstance().setDbReachable(true);\n }", "@Test\n void testIsConnected(){\n weighted_graph g = new WGraph_DS();\n for(int i = 1; i <= 7; i++){\n g.addNode(i);\n }\n g.connect(1,2,20);\n g.connect(1,5,15);\n g.connect(2,3,20);\n g.connect(5,6,15);\n g.connect(3,4,20);\n g.connect(6,4,15);\n g.connect(1,7,2);\n g.connect(7,4,50);\n weighted_graph_algorithms ga = new WGraph_Algo();\n ga.init(g);\n assertTrue(ga.isConnected());\n g.removeEdge(7,4);\n g.removeEdge(6,4);\n g.removeEdge(3,4);\n assertFalse(ga.isConnected());\n }", "@Test(timeout = 4000)\n public void test054() throws Throwable {\n EvoSuiteFile evoSuiteFile0 = new EvoSuiteFile(\"O:56ve.env.properties\");\n FileSystemHandling.appendStringToFile(evoSuiteFile0, \"(}\");\n try { \n DBUtil.getMetaData(\"O:56ve\", true, false, false, false, \"--'/\", false, true);\n fail(\"Expecting exception: Exception\");\n \n } catch(Exception e) {\n //\n // Connecting null failed: \n //\n verifyException(\"org.databene.jdbacl.DBUtil\", e);\n }\n }", "public static void main(String[] args) throws ClassNotFoundException, SQLException {\n Class.forName(\"jdbc.oracle.driver.OracleDriver\"); //Throws ClassNotFoundException\n //Step 2 Create Connection Object\n Connection connection = DriverManager.getConnection(\n \"jdbc:oracle:thin:@localhost:1521:xe\",\"system\",\"oracle\");\n //Throws SQL Excpetion\n //Step 3 create statement Object\n Statement statement = connection.createStatement();\n\n //step 4 excecute query\n ResultSet resultSet = statement.executeQuery(\"select * from emp\");\n //Step 5 close the connection\n resultSet.close();\n\n statement.close();\n\n connection.close();\n\n }", "public void setUp() throws IOException\r\n\t{\r\n\r\n\t\tgraphDb = new GraphDatabaseFactory().newEmbeddedDatabase( dbPath );\r\n\t\tSystem.out.println(\"Connecting to the database...\"); \r\n\t\tSystem.out.println(\"Done!\");\r\n\r\n\t}", "@Test public void gh1202() {\n execute(new CreateDB(NAME, \"<x/>\"));\n query(\"let $x := 'e' return element e {} / self::e[name() = $x]\", \"<e/>\");\n query(\"let $x := 'f' return element f {} ! self::f[name() = $x]\", \"<f/>\");\n }", "@Test\r\n void test_insert_50_vertex_check() {\r\n String str;\r\n for(int i = 0; i < 50; i++) {\r\n str = \"\" + i;\r\n graph.addVertex(str);\r\n }\r\n vertices = graph.getAllVertices();\r\n for(int j = 0; j < 50; j++) {\r\n str = \"\" + j;\r\n if (!vertices.contains(str))\r\n fail(\"Insert not working!!\");\r\n }\r\n }", "@Override\n protected void startConnection() throws CoreException {\n }", "@Test\r\n void test_insert_null_vertex() {\r\n graph.addVertex(null);\r\n vertices = graph.getAllVertices();\r\n \r\n if(vertices.contains(null))\r\n fail();\r\n if(vertices.size() != 0 ||graph.order() != 0) {\r\n fail();\r\n }\r\n\r\n }", "public Graph getGraph4SingleCores(String nodeId, CustRelationshipMapper custRelationshipMapper, CustPropertyMapper custPropertyMapper) throws CustomException {\n if (StringUtils.isBlank(nodeId)) {\n throw new CustomException(\"[nodeId] is blank null or ' '\");\n }\n\n List<CustRelationship> oneDepthRels = custRelationshipMapper.selectAll1DRelByCertNo(nodeId);\n\n //Map<String, Object> graph = new HashMap<>();\n Graph graph = new Graph();\n if (oneDepthRels.size() == 0) {\n log.info(\"当前1度范围内[边]等于0, 将返回null\");\n graph = new Graph(null, null, StatusCode.NO_MATCHES);\n return graph;\n }\n\n\n\n //仅一度边\n Map<String, Edge> oneDepthEdges = new HashMap<>();\n //一度节点, 含中心\n Map<String, Node> oneDepthNodes = new HashMap<>();\n\n Node core = new Node();\n core.setId(nodeId);\n core.setDepth(0);\n //core 并入 onetDepthNodes\n oneDepthNodes.put(core.getId(), core);\n\n //遍历一度边, 封装数据\n gatherNodeEdge(oneDepthRels, oneDepthEdges, oneDepthNodes,1);\n\n Set<String> oneDepthNodesKeySet = oneDepthNodes.keySet();\n\n //判断一度节点个数, 小于阈值才会继续查询二度边\n if (oneDepthNodes.size() > MAX_DISPLAY_NODES_1D) {\n log.info(\"当前一度范围内[节点]个数大于[{}], 将仅返回一度节点和边数据\", MAX_DISPLAY_NODES_1D);\n\n\n List<CustProperty> custProperties = custPropertyMapper.selectByCertNos(oneDepthNodesKeySet);\n\n //封装点属性\n dumpCustPropertyData(oneDepthNodes, custProperties, 1);\n\n graph.setNodes(oneDepthNodes);\n graph.setEdges(oneDepthEdges);\n return graph;\n }\n\n\n // -- 一度范围节点数量在范围之内, 则获取所有二度边 --\n\n //装所有节点\n HashMap<String, Node> nodes = (HashMap<String, Node>) ((HashMap<String, Node>) oneDepthNodes).clone();\n //装所有的边\n HashMap<String, Edge> edges = (HashMap<String, Edge>) ((HashMap<String, Edge>) oneDepthEdges).clone();\n\n List<CustRelationship> allRel = custRelationshipMapper.selectRelByGivenCertNos(oneDepthNodesKeySet);\n if (allRel.size() > MAX_DISPLAY_EDGES) {\n log.info(\"当前二度范围内[边]总数大于[{}], 仅返回一度节点和边数据\", MAX_DISPLAY_EDGES);\n graph.setNodes(oneDepthNodes);\n graph.setEdges(oneDepthEdges);\n return graph;\n }\n\n // -- 二度范围边在范围之内, 则加工边数据集 --\n\n gatherNodeEdge(allRel, edges, nodes,2);\n /* ABANDON: 抽取\n for (CustRelationship rel : allRel) {\n //Note: oneDepthEdges中已有的, 不用再封装了, 没有的, 创建, 封装, 存入edges中, 且depth==2\n if (oneDepthEdges.get(rel.getId()) == null) {\n Edge edge = new Edge(rel.getId(), rel.getuCertNo(), rel.getvCertNo(), rel.getContent(), rel.getContentType(), rel.getRelationType());\n //新建的边, 说明depth==2\n edge.setDepth(2);\n //存入edges\n edges.put(String.valueOf(edge.getId()), edge);\n }\n\n //遇到新节点, 则存入nodes中, 且深度为2 !注意别存错了!\n gatherNodes(nodes, rel, 2);\n }\n */\n\n //查询所有属性: 核, 一度, 二度\n Set<String> allCertNos = nodes.keySet(); //获取所有身份证号, 查取属性数据\n List<CustProperty> custProperties = custPropertyMapper.selectByCertNos(allCertNos);\n\n //封装属性数据\n dumpCustPropertyData(nodes, custProperties, 2);\n\n //判断节点数目\n if (nodes.size() > MAX_DISPLAY_NODES_2D) {\n //0,1,2度节点之和超过阈值, 则只返回一度节点和边\n log.info(\"当前二度范围内[节点]总数大于[{}], 仅返回一度节点和边数据\", MAX_DISPLAY_NODES_2D);\n\n graph.setNodes(oneDepthNodes);\n graph.setEdges(oneDepthEdges);\n } else {\n //没有超限, 则返回1,2度全部\n log.info(\"返回全部二度范围内节点和边数据\");\n graph.setNodes(nodes);\n graph.setEdges(edges);\n }\n\n\n return graph;\n }", "public void doBuild() throws TorqueException\n {\n dbMap = Torque.getDatabaseMap(\"cream\");\n\n dbMap.addTable(\"OPPORTUNITY\");\n TableMap tMap = dbMap.getTable(\"OPPORTUNITY\");\n\n tMap.setPrimaryKeyMethod(TableMap.NATIVE);\n\n\n tMap.addPrimaryKey(\"OPPORTUNITY.OPPORTUNITY_ID\", new Integer(0));\n tMap.addColumn(\"OPPORTUNITY.OPPORTUNITY_CODE\", \"\");\n tMap.addColumn(\"OPPORTUNITY.STATUS\", new Integer(0));\n tMap.addColumn(\"OPPORTUNITY.PRIORITY\", new Integer(0));\n tMap.addColumn(\"OPPORTUNITY.OPPORTUNITY_TYPE\", new Integer(0));\n tMap.addColumn(\"OPPORTUNITY.OPPORTUNITY_NAME\", \"\");\n tMap.addForeignKey(\n \"OPPORTUNITY.OPPORTUNITY_CAT_ID\", new Integer(0) , \"OPPORTUNITY_CATEGORY\" ,\n \"OPPORTUNITY_CAT_ID\");\n tMap.addForeignKey(\n \"OPPORTUNITY.LEAD_SOURCE_ID\", new Integer(0) , \"LEAD_SOURCE\" ,\n \"LEAD_SOURCE_ID\");\n tMap.addColumn(\"OPPORTUNITY.ISSUED_DATE\", new Date());\n tMap.addColumn(\"OPPORTUNITY.EXPECTED_DATE\", new Date());\n tMap.addColumn(\"OPPORTUNITY.CLOSED_DATE\", new Date());\n tMap.addForeignKey(\n \"OPPORTUNITY.CUSTOMER_ID\", new Integer(0) , \"CUSTOMER\" ,\n \"CUSTOMER_ID\");\n tMap.addForeignKey(\n \"OPPORTUNITY.PROJECT_ID\", new Integer(0) , \"PROJECT\" ,\n \"PROJECT_ID\");\n tMap.addForeignKey(\n \"OPPORTUNITY.CURRENCY_ID\", new Integer(0) , \"CURRENCY\" ,\n \"CURRENCY_ID\");\n tMap.addColumn(\"OPPORTUNITY.CURRENCY_AMOUNT\", new BigDecimal(0));\n tMap.addColumn(\"OPPORTUNITY.SALES_STAGE\", new Integer(0));\n tMap.addColumn(\"OPPORTUNITY.PROBABILITY\", new Integer(0));\n tMap.addColumn(\"OPPORTUNITY.SUBJECT\", \"\");\n tMap.addColumn(\"OPPORTUNITY.NEXT_STEPS\", \"\");\n tMap.addColumn(\"OPPORTUNITY.NOTES\", \"\");\n tMap.addColumn(\"OPPORTUNITY.CREATED\", new Date());\n tMap.addColumn(\"OPPORTUNITY.MODIFIED\", new Date());\n tMap.addColumn(\"OPPORTUNITY.CREATED_BY\", \"\");\n tMap.addColumn(\"OPPORTUNITY.MODIFIED_BY\", \"\");\n }", "@Test\r\n\tpublic void testRuleSets2() throws Exception{\r\n\t\t\r\n\t\tAssert.assertEquals(0L, testAdminCon.size());\r\n\t\ttestAdminCon.add(micah, lname, micahlname, dirgraph1);\r\n\t\ttestAdminCon.add(micah, fname, micahfname, dirgraph1);\r\n\t\ttestAdminCon.add(micah, developPrototypeOf, semantics, dirgraph1);\r\n\t\ttestAdminCon.add(micah, type, sEngineer, dirgraph1);\r\n\t\ttestAdminCon.add(micah, worksFor, ml, dirgraph1);\r\n\t\t\r\n\t\ttestAdminCon.add(john, fname, johnfname,dirgraph);\r\n\t\ttestAdminCon.add(john, lname, johnlname,dirgraph);\r\n\t\ttestAdminCon.add(john, writeFuncSpecOf, inference, dirgraph);\r\n\t\ttestAdminCon.add(john, type, lEngineer, dirgraph);\r\n\t\ttestAdminCon.add(john, worksFor, ml, dirgraph);\r\n\t\t\r\n\t\ttestAdminCon.add(writeFuncSpecOf, subProperty, design, dirgraph1);\r\n\t\ttestAdminCon.add(developPrototypeOf, subProperty, design, dirgraph1);\r\n\t\ttestAdminCon.add(design, subProperty, develop, dirgraph1);\r\n\t\t\r\n\t\ttestAdminCon.add(lEngineer, subClass, engineer, dirgraph1);\r\n\t\ttestAdminCon.add(sEngineer, subClass, engineer, dirgraph1);\r\n\t\ttestAdminCon.add(engineer, subClass, employee, dirgraph1);\r\n\t\t\r\n\t\tString query = \"select (count (?s) as ?totalcount) where {?s ?p ?o .} \";\r\n\t\tTupleQuery tupleQuery = testAdminCon.prepareTupleQuery(QueryLanguage.SPARQL, query);\r\n\t\t((MarkLogicQuery) tupleQuery).setRulesets(SPARQLRuleset.RDFS_PLUS_FULL);\r\n\t\tTupleQueryResult result\t= tupleQuery.evaluate();\r\n\t\t\r\n\t\ttry {\r\n\t\t\tassertThat(result, is(notNullValue()));\r\n\t\t\tassertThat(result.hasNext(), is(equalTo(true)));\r\n\t\t\twhile (result.hasNext()) {\r\n\t\t\t\tBindingSet solution = result.next();\r\n\t\t\t\tassertThat(solution.hasBinding(\"totalcount\"), is(equalTo(true)));\r\n\t\t\t\tValue count = solution.getValue(\"totalcount\");\r\n\t\t\t\tAssert.assertEquals(374, Integer.parseInt(count.stringValue()));\r\n\t\t\t}\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tresult.close();\r\n\t\t}\r\n\t\r\n\t\tRepositoryResult<Statement> resultg = testAdminCon.getStatements(null, null, null, true, dirgraph, dirgraph1);\r\n\t\t\r\n\t\tassertNotNull(\"Iterator should not be null\", resultg);\r\n\t\tassertTrue(\"Iterator should not be empty\", resultg.hasNext());\r\n\t\t\t\t\r\n\t\ttupleQuery = testAdminCon.prepareTupleQuery(QueryLanguage.SPARQL, query);\r\n\t\t((MarkLogicQuery) tupleQuery).setRulesets(SPARQLRuleset.EQUIVALENT_CLASS);\r\n\t\tresult = tupleQuery.evaluate();\r\n\t\t\r\n\t\ttry {\r\n\t\t\tassertThat(result, is(notNullValue()));\r\n\t\t\tassertThat(result.hasNext(), is(equalTo(true)));\r\n\t\t\twhile (result.hasNext()) {\r\n\t\t\t\tBindingSet solution = result.next();\r\n\t\t\t\tassertThat(solution.hasBinding(\"totalcount\"), is(equalTo(true)));\r\n\t\t\t\tValue count = solution.getValue(\"totalcount\");\r\n\t\t\t\tAssert.assertEquals(18, Integer.parseInt(count.stringValue()));\r\n\t\t\t}\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tresult.close();\r\n\t\t}\r\n\t\t\r\n\t\ttupleQuery = testAdminCon.prepareTupleQuery(QueryLanguage.SPARQL, query);\r\n\t\t((MarkLogicQuery) tupleQuery).setRulesets(SPARQLRuleset.RDFS,SPARQLRuleset.INVERSE_OF);\r\n\t\tresult = tupleQuery.evaluate();\r\n\t\t\r\n\t\ttry {\r\n\t\t\tassertThat(result, is(notNullValue()));\r\n\t\t\tassertThat(result.hasNext(), is(equalTo(true)));\r\n\t\t\twhile (result.hasNext()) {\r\n\t\t\t\tBindingSet solution = result.next();\r\n\t\t\t\tassertThat(solution.hasBinding(\"totalcount\"), is(equalTo(true)));\r\n\t\t\t\tValue count = solution.getValue(\"totalcount\");\r\n\t\t\t\tAssert.assertEquals(86, Integer.parseInt(count.stringValue()));\r\n\t\t\t}\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tresult.close();\r\n\t\t}\r\n\t\t\r\n\t\ttupleQuery = testAdminCon.prepareTupleQuery(QueryLanguage.SPARQL, query);\r\n\t\t((MarkLogicQuery) tupleQuery).setRulesets(null,SPARQLRuleset.INVERSE_OF);\r\n\t\tresult = tupleQuery.evaluate();\r\n\t\t\r\n\t\ttry {\r\n\t\t\tassertThat(result, is(notNullValue()));\r\n\t\t\tassertThat(result.hasNext(), is(equalTo(true)));\r\n\t\t\twhile (result.hasNext()) {\r\n\t\t\t\tBindingSet solution = result.next();\r\n\t\t\t\tassertThat(solution.hasBinding(\"totalcount\"), is(equalTo(true)));\r\n\t\t\t\tValue count = solution.getValue(\"totalcount\");\r\n\t\t\t\tAssert.assertEquals(18, Integer.parseInt(count.stringValue()));\r\n\t\t\t}\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tresult.close();\r\n\t\t}\r\n\t\t\r\n\t\ttupleQuery = testAdminCon.prepareTupleQuery(QueryLanguage.SPARQL, query);\r\n\t\t((MarkLogicQuery) tupleQuery).setRulesets((SPARQLRuleset)null, null);\r\n\t\ttupleQuery.setIncludeInferred(false);\r\n\t\tresult = tupleQuery.evaluate();\r\n\t\t\r\n\t\ttry {\r\n\t\t\tassertThat(result, is(notNullValue()));\r\n\t\t\tassertThat(result.hasNext(), is(equalTo(true)));\r\n\t\t\twhile (result.hasNext()) {\r\n\t\t\t\tBindingSet solution = result.next();\r\n\t\t\t\tassertThat(solution.hasBinding(\"totalcount\"), is(equalTo(true)));\r\n\t\t\t\tValue count = solution.getValue(\"totalcount\");\r\n\t\t\t\tAssert.assertEquals(16, Integer.parseInt(count.stringValue()));\r\n\t\t\t}\r\n\t\t}\r\n\t\tfinally {\r\n\t\t\tresult.close();\r\n\t\t}\r\n\t}", "public boolean xdbManaged() { throw new UnsupportedOperationException(); }", "public boolean xdbManaged() { throw new UnsupportedOperationException(); }" ]
[ "0.60584706", "0.6036614", "0.59780973", "0.5773362", "0.5682861", "0.5584441", "0.55396503", "0.54791075", "0.5443738", "0.54383373", "0.5416355", "0.5410186", "0.5400271", "0.5385222", "0.53244805", "0.52997", "0.5290814", "0.5240903", "0.52181554", "0.52128536", "0.52072006", "0.52065045", "0.5182376", "0.51801735", "0.5139275", "0.5121655", "0.5094855", "0.5093181", "0.5066826", "0.505527", "0.5042152", "0.50420856", "0.50410736", "0.5030835", "0.50213337", "0.5017944", "0.50155705", "0.5015281", "0.50111187", "0.5002493", "0.49978963", "0.49858853", "0.49662358", "0.4966013", "0.4961288", "0.4959412", "0.49516556", "0.4950618", "0.49492702", "0.49453428", "0.4935801", "0.49328727", "0.49320224", "0.4928941", "0.49170238", "0.49138767", "0.49116135", "0.49091488", "0.49078143", "0.49004254", "0.48957783", "0.48917827", "0.4891387", "0.48811966", "0.488038", "0.48718554", "0.48701623", "0.48680592", "0.48650095", "0.48625815", "0.48596036", "0.48590893", "0.48544398", "0.48484245", "0.48423314", "0.48380247", "0.48372874", "0.4837094", "0.48319474", "0.4826976", "0.4825032", "0.4824405", "0.48236355", "0.48224816", "0.481987", "0.481615", "0.4806833", "0.47872868", "0.47848585", "0.47847316", "0.47828293", "0.4782731", "0.47787508", "0.4766071", "0.47650287", "0.47646648", "0.47590834", "0.47582677", "0.47575313", "0.47492987", "0.47492987" ]
0.0
-1