query
stringlengths
74
6.1k
positive
listlengths
1
1
negative
listlengths
9
9
public void setCastShadow(boolean enableFlag) { GVRSceneObject owner = getOwnerObject(); if (owner != null) { GVRShadowMap shadowMap = (GVRShadowMap) getComponent(GVRRenderTarget.getComponentType()); if (enableFlag) { if (shadowMap != null) { shadowMap.setEnable(true); } else { float angle = (float) Math.acos(getFloat("outer_cone_angle")) * 2.0f; GVRCamera shadowCam = GVRShadowMap.makePerspShadowCamera(getGVRContext().getMainScene().getMainCameraRig().getCenterCamera(), angle); shadowMap = new GVRShadowMap(getGVRContext(), shadowCam); owner.attachComponent(shadowMap); } mChanged.set(true); } else if (shadowMap != null) { shadowMap.setEnable(false); } } mCastShadow = enableFlag; }
[ "Enables or disabled shadow casting for a spot light.\nEnabling shadows attaches a GVRShadowMap component to the\nGVRSceneObject which owns the light and provides the\ncomponent with an perspective camera for shadow casting.\n@param enableFlag true to enable shadow casting, false to disable" ]
[ "Return the first header value for the given header name, if any.\n@param headerName the header name\n@return the first header value, or {@code null} if none", "Returns this bar code's pattern, converted into a set of corresponding codewords.\nUseful for bar codes that encode their content as a pattern.\n\n@param...
protected void processAssignmentBaseline(Row row) { Integer id = row.getInteger("ASSN_UID"); ResourceAssignment assignment = m_assignmentMap.get(id); if (assignment != null) { int index = row.getInt("AB_BASE_NUM"); assignment.setBaselineStart(index, row.getDate("AB_BASE_START")); assignment.setBaselineFinish(index, row.getDate("AB_BASE_FINISH")); assignment.setBaselineWork(index, row.getDuration("AB_BASE_WORK")); assignment.setBaselineCost(index, row.getCurrency("AB_BASE_COST")); } }
[ "Read resource assignment baseline values.\n\n@param row result set row" ]
[ "If this node represents a bean property this method returns all annotations of its getter.\n\n@return A set of annotations of this nodes property getter or an empty set.", "Use this API to add cachepolicylabel.", "Set work connection.\n\n@param db the db setup bean", "Draw text in the center of the specified...
private void writeResourceBaselines(Project.Resources.Resource xmlResource, Resource mpxjResource) { Project.Resources.Resource.Baseline baseline = m_factory.createProjectResourcesResourceBaseline(); boolean populated = false; Number cost = mpxjResource.getBaselineCost(); if (cost != null && cost.intValue() != 0) { populated = true; baseline.setCost(DatatypeConverter.printCurrency(cost)); } Duration work = mpxjResource.getBaselineWork(); if (work != null && work.getDuration() != 0) { populated = true; baseline.setWork(DatatypeConverter.printDuration(this, work)); } if (populated) { xmlResource.getBaseline().add(baseline); baseline.setNumber(BigInteger.ZERO); } for (int loop = 1; loop <= 10; loop++) { baseline = m_factory.createProjectResourcesResourceBaseline(); populated = false; cost = mpxjResource.getBaselineCost(loop); if (cost != null && cost.intValue() != 0) { populated = true; baseline.setCost(DatatypeConverter.printCurrency(cost)); } work = mpxjResource.getBaselineWork(loop); if (work != null && work.getDuration() != 0) { populated = true; baseline.setWork(DatatypeConverter.printDuration(this, work)); } if (populated) { xmlResource.getBaseline().add(baseline); baseline.setNumber(BigInteger.valueOf(loop)); } } }
[ "Writes resource baseline data.\n\n@param xmlResource MSPDI resource\n@param mpxjResource MPXJ resource" ]
[ "Print all relations for a given's class's tag\n@param tagname the tag containing the given relation\n@param from the source class\n@param edgetype the dot edge specification", "Get all Groups\n\n@return\n@throws Exception", "given the groupName, it returns the groupId\n\n@param groupName name of group\n@return...
public void promote() { URL url = VERSION_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.fileID, "current"); JsonObject jsonObject = new JsonObject(); jsonObject.add("type", "file_version"); jsonObject.add("id", this.getID()); BoxJSONRequest request = new BoxJSONRequest(this.getAPI(), url, "POST"); request.setBody(jsonObject.toString()); BoxJSONResponse response = (BoxJSONResponse) request.send(); this.parseJSON(JsonObject.readFrom(response.getJSON())); }
[ "Promotes this version of the file to be the latest version." ]
[ "Complete timing the operation with the given identifier. If you had not previously started a timing operation with this identifier, then this\nwill effectively be a noop.", "Convert a key-version-nodeSet information to string\n\n@param key The key\n@param versionMap mapping versions to set of PrefixNodes\n@param...
public static <T> T get(String key, Class<T> clz) { return (T)m().get(key); }
[ "Generic version of getting value by key from the JobContext of current thread\n@param key the key\n@param clz the val class\n@param <T> the val type\n@return the value" ]
[ "Returns the specified range of elements in the sorted set.\nThe elements are considered to be ordered from the lowest to the highest score.\nLexicographical order is used for elements with equal score.\nBoth start and stop are zero-based inclusive indexes. They can also be negative numbers indicating offsets from\...
protected void setResults(GraphRewrite event, String variable, Iterable<? extends WindupVertexFrame> results) { Variables variables = Variables.instance(event); Iterable<? extends WindupVertexFrame> existingVariables = variables.findVariable(variable, 1); if (existingVariables != null) { variables.setVariable(variable, Iterables.concat(existingVariables, results)); } else { variables.setVariable(variable, results); } }
[ "This sets the variable with the given name to the given value. If there is already a variable with the same name in the top-most stack frame,\nwe will combine them here.\n\nThis helps in the case of multiple conditions tied together with \"or\" or \"and\"." ]
[ "Entry point for processing filter definitions.\n\n@param properties project properties\n@param filters project filters\n@param fixedData filter fixed data\n@param varData filter var data", "Get container for principal.\n\n@param cms cmsobject\n@param list of principals\n@param captionID caption id\n@param descID...
private static final int getUnicodeStringLengthInBytes(byte[] data, int offset) { int result; if (data == null || offset >= data.length) { result = 0; } else { result = data.length - offset; for (int loop = offset; loop < (data.length - 1); loop += 2) { if (data[loop] == 0 && data[loop + 1] == 0) { result = loop - offset; break; } } } return result; }
[ "Determine the length of a nul terminated UTF16LE string in bytes.\n\n@param data string data\n@param offset offset into string data\n@return length in bytes" ]
[ "Get the raw bytes of the beat grid as it was read over the network. This can be used to analyze fields\nthat have not yet been reliably understood, and is also used for storing the beat grid in a cache file.\nThis is not available when the beat grid was loaded by Crate Digger.\n\n@return the bytes that make up the...
public synchronized void abortTransaction() throws TransactionNotInProgressException { if(isInTransaction()) { fireBrokerEvent(BEFORE_ROLLBACK_EVENT); setInTransaction(false); clearRegistrationLists(); referencesBroker.removePrefetchingListeners(); /* arminw: check if we in local tx, before do local rollback Necessary, because ConnectionManager may do a rollback by itself or in managed environments the used connection is already be closed */ if(connectionManager.isInLocalTransaction()) this.connectionManager.localRollback(); fireBrokerEvent(AFTER_ROLLBACK_EVENT); } }
[ "Abort and close the transaction.\nCalling abort abandons all persistent object modifications and releases the\nassociated locks.\nIf transaction is not in progress a TransactionNotInProgressException is thrown" ]
[ "Classify stdin by documents seperated by 3 blank line\n@param readerWriter\n@return boolean reached end of IO\n@throws IOException", "Adds the index input to list.\n\n@param name the name\n@param in the in\n@param postingsFormatName the postings format name\n@return the string\n@throws IOException Signals that a...
public boolean contains(Color color) { return exists(p -> p.toInt() == color.toPixel().toInt()); }
[ "Returns true if a pixel with the given color exists\n\n@param color the pixel colour to look for.\n@return true if there exists at least one pixel that has the given pixels color" ]
[ "Append Join for SQL92 Syntax without parentheses", "Print a a basic type t", "Print the method parameter p", "Add a 'IS NOT NULL' clause so the column must not be null. '&lt;&gt;' NULL does not work.", "Use this API to fetch csvserver_appflowpolicy_binding resources of given name .", "Convenience extensi...
public void addArtifact(final Artifact artifact) { if (!artifacts.contains(artifact)) { if (promoted) { artifact.setPromoted(promoted); } artifacts.add(artifact); } }
[ "Adds an artifact to the module.\n\n<P>\nINFO: If the module is promoted, all added artifacts will be promoted.\n\n@param artifact Artifact" ]
[ "Visits a method instruction. A method instruction is an instruction that\ninvokes a method.\n\n@param opcode\nthe opcode of the type instruction to be visited. This opcode\nis either INVOKEVIRTUAL, INVOKESPECIAL, INVOKESTATIC or\nINVOKEINTERFACE.\n@param owner\nthe internal name of the method's owner class (see\n{...
private Auth constructAuth(String authToken, String tokenSecret, String username) throws IOException { Auth auth = new Auth(); auth.setToken(authToken); auth.setTokenSecret(tokenSecret); // Prompt to ask what permission is needed: read, update or delete. auth.setPermission(Permission.fromString("delete")); User user = new User(); // Later change the following 3. Either ask user to pass on command line or read // from saved file. user.setId(nsid); user.setUsername((username)); user.setRealName(""); auth.setUser(user); this.authStore.store(auth); return auth; }
[ "If the Authtoken was already created in a separate program but not saved to file.\n\n@param authToken\n@param tokenSecret\n@param username\n@return\n@throws IOException" ]
[ "Use this API to unset the properties of inatparam resource.\nProperties that need to be unset are specified in args array.", "Add a variable to the scripting context.\n\n@param varName The variable name.\n@param value The variable value.", "get the real data without message header\n@return message data(without...
protected void updateStyle(BoxStyle bstyle, TextPosition text) { String font = text.getFont().getName(); String family = null; String weight = null; String fstyle = null; bstyle.setFontSize(text.getFontSizeInPt()); bstyle.setLineHeight(text.getHeight()); if (font != null) { //font style and weight for (int i = 0; i < pdFontType.length; i++) { if (font.toLowerCase().lastIndexOf(pdFontType[i]) >= 0) { weight = cssFontWeight[i]; fstyle = cssFontStyle[i]; break; } } if (weight != null) bstyle.setFontWeight(weight); else bstyle.setFontWeight(cssFontWeight[0]); if (fstyle != null) bstyle.setFontStyle(fstyle); else bstyle.setFontStyle(cssFontStyle[0]); //font family //If it's a known common font don't embed in html output to save space String knownFontFamily = findKnownFontFamily(font); if (!knownFontFamily.equals("")) family = knownFontFamily; else { family = fontTable.getUsedName(text.getFont()); if (family == null) family = font; } if (family != null) bstyle.setFontFamily(family); } updateStyleForRenderingMode(); }
[ "Updates the text style according to a new text position\n@param bstyle the style to be updated\n@param text the text position" ]
[ "Adds format information to eval.", "Gets the automaton by id.\n\n@param id the id\n@return the automaton by id\n@throws IOException Signals that an I/O exception has occurred.", "Test for convergence by seeing if the element with the largest change\nis smaller than the tolerance. In some test cases it alterna...
public boolean isDockerMachineInstalled(String cliPathExec) { try { commandLineExecutor.execCommand(createDockerMachineCommand(cliPathExec)); return true; } catch (Exception e) { return false; } }
[ "Checks if Docker Machine is installed by running docker-machine and inspect the result.\n\n@param cliPathExec\nlocation of docker-machine or null if it is on PATH.\n\n@return true if it is installed, false otherwise." ]
[ "Unicast addresses allocated for private use\n\n@see java.net.InetAddress#isSiteLocalAddress()", "Appends the indentation string at the current position of the parent and adds a new composite node, indicating the same indentation for\nsubsequent lines.\n\n@return an indentation node, using the given indentString,...
private void populateMilestone(Row row, Task task) { task.setMilestone(true); //PROJID task.setUniqueID(row.getInteger("MILESTONEID")); task.setStart(row.getDate("GIVEN_DATE_TIME")); task.setFinish(row.getDate("GIVEN_DATE_TIME")); //PROGREST_PERIOD //SYMBOL_APPEARANCE //MILESTONE_TYPE //PLACEMENU task.setPercentageComplete(row.getBoolean("COMPLETED") ? COMPLETE : INCOMPLETE); //INTERRUPTIBLE_X //ACTUAL_DURATIONTYPF //ACTUAL_DURATIONELA_MONTHS //ACTUAL_DURATIONHOURS task.setEarlyStart(row.getDate("EARLY_START_DATE")); task.setLateStart(row.getDate("LATE_START_DATE")); //FREE_START_DATE //START_CONSTRAINT_DATE //END_CONSTRAINT_DATE //EFFORT_BUDGET //NATURAO_ORDER //LOGICAL_PRECEDENCE //SPAVE_INTEGER //SWIM_LANE //USER_PERCENT_COMPLETE //OVERALL_PERCENV_COMPLETE //OVERALL_PERCENT_COMPL_WEIGHT task.setName(row.getString("NARE")); //NOTET task.setText(1, row.getString("UNIQUE_TASK_ID")); task.setCalendar(m_project.getCalendarByUniqueID(row.getInteger("CALENDAU"))); //EFFORT_TIMI_UNIT //WORL_UNIT //LATEST_ALLOC_PROGRESS_PERIOD //WORN //CONSTRAINU //PRIORITB //CRITICAM //USE_PARENU_CALENDAR //BUFFER_TASK //MARK_FOS_HIDING //OWNED_BY_TIMESHEEV_X //START_ON_NEX_DAY //LONGEST_PATH //DURATIOTTYPF //DURATIOTELA_MONTHS //DURATIOTHOURS //STARZ //ENJ //DURATION_TIMJ_UNIT //UNSCHEDULABLG //SUBPROJECT_ID //ALT_ID //LAST_EDITED_DATE //LAST_EDITED_BY task.setDuration(Duration.getInstance(0, TimeUnit.HOURS)); }
[ "Populate a milestone from a Row instance.\n\n@param row Row instance\n@param task Task instance" ]
[ "returns null if no device is found.", "Adds OPT_U | OPT_URL option to OptionParser, with multiple arguments.\n\n@param parser OptionParser to be modified\n@param required Tells if this option is required or optional", "Use this API to fetch all the snmpuser resources that are configured on netscaler.", "Retu...
private void setWorkingDays(ProjectCalendar mpxjCalendar, Calendars gpCalendar) { DayTypes dayTypes = gpCalendar.getDayTypes(); DefaultWeek defaultWeek = dayTypes.getDefaultWeek(); if (defaultWeek == null) { mpxjCalendar.setWorkingDay(Day.SUNDAY, false); mpxjCalendar.setWorkingDay(Day.MONDAY, true); mpxjCalendar.setWorkingDay(Day.TUESDAY, true); mpxjCalendar.setWorkingDay(Day.WEDNESDAY, true); mpxjCalendar.setWorkingDay(Day.THURSDAY, true); mpxjCalendar.setWorkingDay(Day.FRIDAY, true); mpxjCalendar.setWorkingDay(Day.SATURDAY, false); } else { mpxjCalendar.setWorkingDay(Day.MONDAY, isWorkingDay(defaultWeek.getMon())); mpxjCalendar.setWorkingDay(Day.TUESDAY, isWorkingDay(defaultWeek.getTue())); mpxjCalendar.setWorkingDay(Day.WEDNESDAY, isWorkingDay(defaultWeek.getWed())); mpxjCalendar.setWorkingDay(Day.THURSDAY, isWorkingDay(defaultWeek.getThu())); mpxjCalendar.setWorkingDay(Day.FRIDAY, isWorkingDay(defaultWeek.getFri())); mpxjCalendar.setWorkingDay(Day.SATURDAY, isWorkingDay(defaultWeek.getSat())); mpxjCalendar.setWorkingDay(Day.SUNDAY, isWorkingDay(defaultWeek.getSun())); } for (Day day : Day.values()) { if (mpxjCalendar.isWorkingDay(day)) { ProjectCalendarHours hours = mpxjCalendar.addCalendarHours(day); hours.addRange(ProjectCalendarWeek.DEFAULT_WORKING_MORNING); hours.addRange(ProjectCalendarWeek.DEFAULT_WORKING_AFTERNOON); } } }
[ "Add working days and working time to a calendar.\n\n@param mpxjCalendar MPXJ calendar\n@param gpCalendar GanttProject calendar" ]
[ "Check the given URI to see if it matches.\n\n@param matchInfo the matchInfo to validate.\n@return True if it matches.", "Delete a file ignoring failures.\n\n@param file file to delete", "Reads a string of single byte characters from the input array.\nThis method assumes that the string finishes either at the\n...
public JsonNode apply(final JsonNode node) { requireNonNull(node, "node"); JsonNode ret = node.deepCopy(); for (final JsonPatchOperation operation : operations) { ret = operation.apply(ret); } return ret; }
[ "Applies this patch to a JSON value.\n\n@param node the value to apply the patch to\n@return the patched JSON value\n@throws JsonPatchException failed to apply patch\n@throws NullPointerException input is null" ]
[ "Will auto format the given string to provide support for pickadate.js formats.", "Set the attributes for the associated object.\n\n@param attributes attributes for associated objects\n@deprecated replaced by {@link #setAllAttributes(Map)} after introduction of nested associations", "Retrieve from the parent po...
public String getRealm() { if (UNDEFINED.equals(realm)) { Principal principal = securityIdentity.getPrincipal(); String realm = null; if (principal instanceof RealmPrincipal) { realm = ((RealmPrincipal)principal).getRealm(); } this.realm = realm; } return this.realm; }
[ "Obtain the realm used for authentication.\n\nThis realm name applies to both the user and the groups.\n\n@return The name of the realm used for authentication." ]
[ "simple echo implementation", "Get a collection of all of the user's groups.\n\n@return A Collection of Group objects\n@throws FlickrException", "Closes the transactor node by removing its node in Zookeeper", "Calculates the legend bounds for a custom list of legends.", "A convenience method for creating an...
public static boolean isRegularQueue(final Jedis jedis, final String key) { return LIST.equalsIgnoreCase(jedis.type(key)); }
[ "Determines if the queue identified by the given key is a regular queue.\n\n@param jedis\nconnection to Redis\n@param key\nthe key that identifies a queue\n@return true if the key identifies a regular queue, false otherwise" ]
[ "Called on mouse down in the caption area, begins the dragging loop by\nturning on event capture.\n\n@see DOM#setCapture\n@see #continueDragging\n@param event the mouse down event that triggered dragging", "Returns the name of the current member which is the name in the case of a field, or the property name for a...
protected final MapfishMapContext getLayerTransformer(final MapfishMapContext transformer) { MapfishMapContext layerTransformer = transformer; if (!FloatingPointUtil.equals(transformer.getRotation(), 0.0) && !this.supportsNativeRotation()) { // if a rotation is set and the rotation can not be handled natively // by the layer, we have to adjust the bounds and map size layerTransformer = new MapfishMapContext( transformer, transformer.getRotatedBoundsAdjustedForPreciseRotatedMapSize(), transformer.getRotatedMapSize(), 0, transformer.getDPI(), transformer.isForceLongitudeFirst(), transformer.isDpiSensitiveStyle()); } return layerTransformer; }
[ "If the layer transformer has not been prepared yet, do it.\n\n@param transformer the transformer" ]
[ "Sign in a group of connections to the registry by key\n\n@param key\nthe key\n@param connections\na collection of websocket connections", "Returns a new intern odmg-transaction for the current database.", "performs a DELETE operation against RDBMS.\n@param cld ClassDescriptor providing mapping information.\n@p...
public List<Tag> getPrimeTags() { return this.definedTags.values().stream() .filter(Tag::isPrime) .collect(Collectors.toList()); }
[ "Gets all tags that are \"prime\" tags." ]
[ "Is portlet env supported.\n\n@return true if portlet env is supported, false otherwise", "Apply modifications to a content task definition.\n\n@param patchId the patch id\n@param modifications the modifications\n@param definitions the task definitions\n@param filter the content item filter", "Re...
private void adjustOptionsColumn( CmsMessageBundleEditorTypes.EditMode oldMode, CmsMessageBundleEditorTypes.EditMode newMode) { if (m_model.isShowOptionsColumn(oldMode) != m_model.isShowOptionsColumn(newMode)) { m_table.removeGeneratedColumn(TableProperty.OPTIONS); if (m_model.isShowOptionsColumn(newMode)) { // Don't know why exactly setting the filter field invisible is necessary here, // it should be already set invisible - but apparently not setting it invisible again // will result in the field being visible. m_table.setFilterFieldVisible(TableProperty.OPTIONS, false); m_table.addGeneratedColumn(TableProperty.OPTIONS, m_optionsColumn); } } }
[ "Show or hide the options column dependent on the provided edit mode.\n@param oldMode the old edit mode\n@param newMode the edit mode for which the options column's visibility should be adjusted." ]
[ "Connects to a child JVM process\n\n@param p the process to which to connect\n@param startAgent whether to installed the JMX agent in the target process if not already in place\n@return an {@link MBeanServerConnection} to the process's MBean server", "Return the content from an URL in byte array\n\n@para...
private void readAssignments(Project plannerProject) { Allocations allocations = plannerProject.getAllocations(); List<Allocation> allocationList = allocations.getAllocation(); Set<Task> tasksWithAssignments = new HashSet<Task>(); for (Allocation allocation : allocationList) { Integer taskID = getInteger(allocation.getTaskId()); Integer resourceID = getInteger(allocation.getResourceId()); Integer units = getInteger(allocation.getUnits()); Task task = m_projectFile.getTaskByUniqueID(taskID); Resource resource = m_projectFile.getResourceByUniqueID(resourceID); if (task != null && resource != null) { Duration work = task.getWork(); int percentComplete = NumberHelper.getInt(task.getPercentageComplete()); ResourceAssignment assignment = task.addResourceAssignment(resource); assignment.setUnits(units); assignment.setWork(work); if (percentComplete != 0) { Duration actualWork = Duration.getInstance((work.getDuration() * percentComplete) / 100, work.getUnits()); assignment.setActualWork(actualWork); assignment.setRemainingWork(Duration.getInstance(work.getDuration() - actualWork.getDuration(), work.getUnits())); } else { assignment.setRemainingWork(work); } assignment.setStart(task.getStart()); assignment.setFinish(task.getFinish()); tasksWithAssignments.add(task); m_eventManager.fireAssignmentReadEvent(assignment); } } // // Adjust work per assignment for tasks with multiple assignments // for (Task task : tasksWithAssignments) { List<ResourceAssignment> assignments = task.getResourceAssignments(); if (assignments.size() > 1) { double maxUnits = 0; for (ResourceAssignment assignment : assignments) { maxUnits += assignment.getUnits().doubleValue(); } for (ResourceAssignment assignment : assignments) { Duration work = assignment.getWork(); double factor = assignment.getUnits().doubleValue() / maxUnits; work = Duration.getInstance(work.getDuration() * factor, work.getUnits()); assignment.setWork(work); Duration actualWork = assignment.getActualWork(); if (actualWork != null) { actualWork = Duration.getInstance(actualWork.getDuration() * factor, actualWork.getUnits()); assignment.setActualWork(actualWork); } Duration remainingWork = assignment.getRemainingWork(); if (remainingWork != null) { remainingWork = Duration.getInstance(remainingWork.getDuration() * factor, remainingWork.getUnits()); assignment.setRemainingWork(remainingWork); } } } } }
[ "This method extracts assignment data from a Planner file.\n\n@param plannerProject Root node of the Planner file" ]
[ "Ensure that all logs are replayed, any other logs can not be added before end of this function.", "Apply modifications to a content task definition.\n\n@param patchId the patch id\n@param modifications the modifications\n@param definitions the task definitions\n@param filter the content item filte...
public static ObjectModelResolver get(String resolverId) { List<ObjectModelResolver> resolvers = getResolvers(); for (ObjectModelResolver resolver : resolvers) { if (resolver.accept(resolverId)) { return resolver; } } return null; }
[ "Returns first resolver that accepts the given resolverId.\nIn case none is found null is returned.\n@param resolverId identifier of the resolver\n@return found resolver or null otherwise" ]
[ "Use this API to fetch transformpolicylabel resource of given name .", "Returns a reference definition of the given name if it exists.\n\n@param name The name of the reference\n@return The reference def or <code>null</code> if there is no such reference", "we have only one implementation on classpath.", ...
public EventBus emit(String event, Object... args) { return _emitWithOnceBus(eventContext(event, args)); }
[ "Emit a string event with parameters.\n\nThis will invoke all {@link SimpleEventListener} bound to the specified\nstring value given the listeners has the matching argument list.\n\nFor example, suppose we have the following simple event listener methods:\n\n```java\n{@literal @}On(\"USER-LOGIN\")\npublic void logU...
[ "Creates a pattern choice radio button and adds it where necessary.\n@param pattern the pattern that should be chosen by the button.\n@param messageKey the message key for the button's label.", "Returns the next power of 2 after the input value x.\n\n@param x Input value x.\n@return Returns the next power of 2 af...
public static base_response update(nitro_service client, inatparam resource) throws Exception { inatparam updateresource = new inatparam(); updateresource.nat46v6prefix = resource.nat46v6prefix; updateresource.nat46ignoretos = resource.nat46ignoretos; updateresource.nat46zerochecksum = resource.nat46zerochecksum; updateresource.nat46v6mtu = resource.nat46v6mtu; updateresource.nat46fragheader = resource.nat46fragheader; return updateresource.update_resource(client); }
[ "Use this API to update inatparam." ]
[ "Prepare the baseURL to make a request.\n\n@param matrixId matrixId\n@param row row\n@param col cold\n@param layerParam layerParam", "Overridden to ensure that our timestamp handling is as expected", "Disconnects from the serial interface and stops\nsend and receive threads.", "Returns the union of sets s1 an...
public void pushDryRun() throws Exception { if (releaseAction.isCreateVcsTag()) { if (scmManager.isTagExists(scmManager.getRemoteConfig(releaseAction.getTargetRemoteName()), releaseAction.getTagUrl())) { throw new Exception(String.format("Tag with name '%s' already exists", releaseAction.getTagUrl())); } } String testTagName = releaseAction.getTagUrl() + "_test"; try { scmManager.testPush(scmManager.getRemoteConfig(releaseAction.getTargetRemoteName()), testTagName); } catch (Exception e) { throw new Exception(String.format("Failed while attempting push dry-run: %s", e.getMessage()), e); } finally { if (scmManager.isTagExists(scmManager.getRemoteConfig(releaseAction.getTargetRemoteName()), testTagName)) { scmManager.deleteLocalTag(testTagName); } } }
[ "This method uses the configured git credentials and repo, to test its validity.\nIn addition, in case the user requested creation of a new tag, it checks that\nanother tag with the same name doesn't exist" ]
[ "Get a setted section knowing his title\n\nN.B. this search only into section list and bottom section list.\n@param title is the title of the section\n@return the section with title or null if the section is not founded", "Enables a custom response\n\n@param model\n@param custom\n@param path_id\n@param clientUUID...
private static void addRedeployOperationStep(final CompositeOperationBuilder builder, final DeploymentDescription deployment) { final String deploymentName = deployment.getName(); final Set<String> serverGroups = deployment.getServerGroups(); if (serverGroups.isEmpty()) { builder.addStep(createOperation(DEPLOYMENT_REDEPLOY_OPERATION, createAddress(DEPLOYMENT, deploymentName))); } else { for (String serverGroup : serverGroups) { builder.addStep(createOperation(DEPLOYMENT_REDEPLOY_OPERATION, createAddress(SERVER_GROUP, serverGroup, DEPLOYMENT, deploymentName))); } } }
[ "Adds a redeploy step to the composite operation.\n\n@param builder the builder to add the step to\n@param deployment the deployment being redeployed" ]
[ "Add a console pipeline to the Redwood handler tree,\nprinting to stdout.\nCalling this multiple times will result in messages being printed\nmultiple times.\n@return this", "Use this API to fetch vpath resource of given name .", "Returns an integer array that contains the default values for all the\ntexture pa...
private void createFrameset(File outputDirectory) throws Exception { VelocityContext context = createContext(); generateFile(new File(outputDirectory, INDEX_FILE), INDEX_FILE + TEMPLATE_EXTENSION, context); }
[ "Create the index file that sets up the frameset.\n@param outputDirectory The target directory for the generated file(s)." ]
[ "Extract the field types from the fieldConfigs if they have not already been configured.", "Starts the HTTP service.\n\n@throws Exception if the service failed to started", "Sort by time bucket, then backup count, and by compression state.", "The amount of time to keep an idle client thread alive\n\n@param th...
public static base_responses add(nitro_service client, dnstxtrec resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { dnstxtrec addresources[] = new dnstxtrec[resources.length]; for (int i=0;i<resources.length;i++){ addresources[i] = new dnstxtrec(); addresources[i].domain = resources[i].domain; addresources[i].String = resources[i].String; addresources[i].ttl = resources[i].ttl; } result = add_bulk_request(client, addresources); } return result; }
[ "Use this API to add dnstxtrec resources." ]
[ "If the String argument defaultLocatorSelectionStrategy is as key in the map representing the locatorSelectionStrategies, the\ncorresponding strategy is selected and set as default strategy, else both the selected strategy and the default strategy remain\nunchanged.\n@param defaultLocatorSelectionStrategy", "Calc...
private List<TimephasedCost> getTimephasedActualCostFixedAmount() { List<TimephasedCost> result = new LinkedList<TimephasedCost>(); double actualCost = getActualCost().doubleValue(); if (actualCost > 0) { AccrueType accrueAt = getResource().getAccrueAt(); if (accrueAt == AccrueType.START) { result.add(splitCostStart(getCalendar(), actualCost, getActualStart())); } else if (accrueAt == AccrueType.END) { result.add(splitCostEnd(getCalendar(), actualCost, getActualFinish())); } else { //for prorated, we have to deal with it differently; have to 'fill up' each //day with the standard amount before going to the next one double numWorkingDays = getCalendar().getWork(getStart(), getFinish(), TimeUnit.DAYS).getDuration(); double standardAmountPerDay = getCost().doubleValue() / numWorkingDays; result.addAll(splitCostProrated(getCalendar(), actualCost, standardAmountPerDay, getActualStart())); } } return result; }
[ "Generates timephased actual costs from the assignment's cost value. Used for Cost type Resources.\n\n@return timephased cost" ]
[ "Checks whether two internet addresses are on the same subnet.\n\n@param prefixLength the number of bits within an address that identify the network\n@param address1 the first address to be compared\n@param address2 the second address to be compared\n\n@return true if both addresses share the same network bits", ...
public MtasCQLParserSentenceCondition createFullSentence() throws ParseException { if (fullCondition == null) { if (secondSentencePart == null) { if (firstBasicSentence != null) { fullCondition = new MtasCQLParserSentenceCondition(firstBasicSentence, ignoreClause, maximumIgnoreLength); } else { fullCondition = firstSentence; } fullCondition.setOccurence(firstMinimumOccurence, firstMaximumOccurence); if (firstOptional) { fullCondition.setOptional(firstOptional); } return fullCondition; } else { if (!orOperator) { if (firstBasicSentence != null) { firstBasicSentence.setOccurence(firstMinimumOccurence, firstMaximumOccurence); firstBasicSentence.setOptional(firstOptional); fullCondition = new MtasCQLParserSentenceCondition( firstBasicSentence, ignoreClause, maximumIgnoreLength); } else { firstSentence.setOccurence(firstMinimumOccurence, firstMaximumOccurence); firstSentence.setOptional(firstOptional); fullCondition = new MtasCQLParserSentenceCondition(firstSentence, ignoreClause, maximumIgnoreLength); } fullCondition.addSentenceToEndLatestSequence( secondSentencePart.createFullSentence()); } else { MtasCQLParserSentenceCondition sentence = secondSentencePart .createFullSentence(); if (firstBasicSentence != null) { sentence.addSentenceAsFirstOption( new MtasCQLParserSentenceCondition(firstBasicSentence, ignoreClause, maximumIgnoreLength)); } else { sentence.addSentenceAsFirstOption(firstSentence); } fullCondition = sentence; } return fullCondition; } } else { return fullCondition; } }
[ "Creates the full sentence.\n\n@return the mtas CQL parser sentence condition\n@throws ParseException the parse exception" ]
[ "Use this API to fetch authenticationvserver_authenticationcertpolicy_binding resources of given name .", "Computes the decomposition of the provided matrix. If no errors are detected then true is returned,\nfalse otherwise.\n@param A The matrix that is being decomposed. Not modified.\n@return If it detects an...
public void setPropertyDestinationType(Class<?> clazz, String propertyName, TypeReference<?> destinationType) { propertiesDestinationTypes.put(new ClassProperty(clazz, propertyName), destinationType); }
[ "set the property destination type for given property\n\n@param propertyName\n@param destinationType" ]
[ "Get the TagsInterface for working with Flickr Tags.\n\n@return The TagsInterface", "Starts the one and only job instance in a separate Thread. Should be called exactly one time before\nthe operation is stopped.\n\n@param arguments {@inheritDoc}", "TestNG returns a compound thread ID that includes the thread na...
public Path getParent() { if (!isAbsolute()) throw new IllegalStateException("path is not absolute: " + toString()); if (segments.isEmpty()) return null; return new Path(segments.subList(0, segments.size()-1), true); }
[ "Returns the parent of this path or null if this path is the root path.\n\n@return the parent of this path or null if this path is the root path." ]
[ "Get all registration points associated with this registration.\n\n@return all registration points. Will not be {@code null} but may be empty", "Used to create a new indefinite retention policy.\n@param api the API connection to be used by the created user.\n@param name the name of the retention policy.\n@return ...
public String getCanonicalTypeName(Object object) { ensureNotNull("object", object); for (TypeDetector typeDetector : typeDetectors) { if (typeDetector.canHandle(object)) { return typeDetector.detectType(object); } } throw LOG.unableToDetectCanonicalType(object); }
[ "Identifies the canonical type of an object heuristically.\n\n@return the canonical type identifier of the object's class\naccording to Jackson's type format (see {@link TypeFactory#constructFromCanonical(String)})" ]
[ "Returns the shared prefix of these columns. Null otherwise.\n\n@param associationKeyColumns the columns sharing a prefix\n@return the shared prefix of these columns. {@code null} otherwise.", "build the Join-Information if a super reference exists\n\n@param left\n@param cld\n@param name", "Write resource assig...
public T withLabel(String text, String languageCode) { withLabel(factory.getMonolingualTextValue(text, languageCode)); return getThis(); }
[ "Adds an additional label to the constructed document.\n\n@param text\nthe text of the label\n@param languageCode\nthe language code of the label\n@return builder object to continue construction" ]
[ "Finishes the process of attaching a metadata cache file once it has been opened and validated.\n\n@param slot the slot to which the cache should be attached\n@param cache the opened, validated metadata cache file", "Get a setted section knowing his title\n\nN.B. this search only into section list and bottom sect...
private void writeTask(Task task) { if (!task.getNull()) { if (extractAndConvertTaskType(task) == null || task.getSummary()) { writeWBS(task); } else { writeActivity(task); } } }
[ "Given a Task instance, this task determines if it should be written to the\nPM XML file as an activity or as a WBS item, and calls the appropriate\nmethod.\n\n@param task Task instance" ]
[ "Returns the user records for all users in the specified workspace or\norganization.\n\n@param workspace The workspace in which to get users.\n@return Request object", "Converts the string of given content to an input stream.\n\n@param content the string content.\n@param charset the charset for conversion.\n@ret...
public static final BigInteger printPriority(Priority priority) { int result = Priority.MEDIUM; if (priority != null) { result = priority.getValue(); } return (BigInteger.valueOf(result)); }
[ "Print priority.\n\n@param priority Priority instance\n@return priority value" ]
[ "Hide keyboard from phoneEdit field", "Handles the response of the getVersion request.\n@param incomingMessage the response message to process.", "Determines the accessor method name based on a field name.\n\n@param fieldName\na field name\n@return the resulting method name", "Extent aware Delete by Query\n@p...
public static int readInt(byte[] bytes, int offset) { return (((bytes[offset + 0] & 0xff) << 24) | ((bytes[offset + 1] & 0xff) << 16) | ((bytes[offset + 2] & 0xff) << 8) | (bytes[offset + 3] & 0xff)); }
[ "Read an int from the byte array starting at the given offset\n\n@param bytes The byte array to read from\n@param offset The offset to start reading at\n@return The int read" ]
[ "Retrieves a vertex attribute as a float array.\nThe attribute name must be one of the\nattributes named in the descriptor passed to the constructor.\n@param attributeName name of the attribute to update\n@throws IllegalArgumentException if attribute name not in descriptor vertex attribute is not <i>float</i>\n@see...
public static Cluster dropZone(Cluster intermediateCluster, int dropZoneId) { // Filter out nodes that don't belong to the zone being dropped Set<Node> survivingNodes = new HashSet<Node>(); for(int nodeId: intermediateCluster.getNodeIds()) { if(intermediateCluster.getNodeById(nodeId).getZoneId() != dropZoneId) { survivingNodes.add(intermediateCluster.getNodeById(nodeId)); } } // Filter out dropZoneId from all zones Set<Zone> zones = new HashSet<Zone>(); for(int zoneId: intermediateCluster.getZoneIds()) { if(zoneId == dropZoneId) { continue; } List<Integer> proximityList = intermediateCluster.getZoneById(zoneId) .getProximityList(); proximityList.remove(new Integer(dropZoneId)); zones.add(new Zone(zoneId, proximityList)); } return new Cluster(intermediateCluster.getName(), Utils.asSortedList(survivingNodes), Utils.asSortedList(zones)); }
[ "Given a interim cluster with a previously vacated zone, constructs a new\ncluster object with the drop zone completely removed\n\n@param intermediateCluster\n@param dropZoneId\n@return adjusted cluster with the zone dropped" ]
[ "Given a list of store definitions return a set of store names\n\n@param storeDefList The list of store definitions\n@return Returns a set of store names", "Adds the List of Lists of CRFDatums to the data and labels arrays, treating\neach datum as if it were its own document. Adds context labels in addition\nto t...
static PathAddress toPathAddress(String domain, ImmutableManagementResourceRegistration registry, ObjectName name) { if (!name.getDomain().equals(domain)) { return PathAddress.EMPTY_ADDRESS; } if (name.equals(ModelControllerMBeanHelper.createRootObjectName(domain))) { return PathAddress.EMPTY_ADDRESS; } final Hashtable<String, String> properties = name.getKeyPropertyList(); return searchPathAddress(PathAddress.EMPTY_ADDRESS, registry, properties); }
[ "Straight conversion from an ObjectName to a PathAddress.\n\nThere may not necessarily be a Resource at this path address (if that correspond to a pattern) but it must\nmatch a model in the registry.\n\n@param domain the name of the caller's JMX domain\n@param registry the root resource for the management model\n@p...
[ "Returns an entry with the given proposal and prefix, or null if the proposal is not valid.\nIf it is valid, the initializer function is applied to it.", "Creates a decorator bean\n\n@param <T> The type\n@param clazz The class\n@param beanManager the current manager\n@return a Bean", "Use this API...
public Where<T, ID> idEq(ID id) throws SQLException { if (idColumnName == null) { throw new SQLException("Object has no id column specified"); } addClause(new SimpleComparison(idColumnName, idFieldType, id, SimpleComparison.EQUAL_TO_OPERATION)); return this; }
[ "Add a clause where the ID is equal to the argument." ]
[ "Retrieve a UUID field.\n\n@param type field type\n@return UUID instance", "Get the collection of contacts for the calling user.\n\n@return The Collection of Contact objects", "Load a table configuration in from a text-file reader.\n\n@return A config if any of the fields were set otherwise null if we reach EOF...
public void getElevationAlongPath(PathElevationRequest req, ElevationServiceCallback callback) { this.callback = callback; JSObject doc = (JSObject) getJSObject().eval("document"); doc.setMember(getVariableName(), this); StringBuilder r = new StringBuilder(getVariableName()) .append(".") .append("getElevationAlongPath(") .append(req.getVariableName()) .append(", ") .append("function(results, status) {document.") .append(getVariableName()) .append(".processResponse(results, status);});"); getJSObject().eval(r.toString()); }
[ "Create a request for elevations for samples along a path.\n\n@param req\n@param callback" ]
[ "Gets value of this function at the current point, computed on the given batch of examples.\n@param batch A set of indices indicating the examples over which the gradient should be computed.\n@return The value of the function at the point.", "Installs a remoting stream server for a domain instance\n@param service...
private static void updateJar(final File file, final byte[] searchPattern, final int[] badSkipBytes, final int newSig, final int endSig) throws IOException { final RandomAccessFile raf = new RandomAccessFile(file, "rw"); try { final FileChannel channel = raf.getChannel(); try { long pos = channel.size() - ENDLEN; final ScanContext context; if (newSig == CRIPPLED_ENDSIG) { context = new ScanContext(GOOD_ENDSIG_PATTERN, CRIPPLED_ENDSIG_PATTERN); } else if (newSig == GOOD_ENDSIG) { context = new ScanContext(CRIPPLED_ENDSIG_PATTERN, GOOD_ENDSIG_PATTERN); } else { context = null; } if (!validateEndRecord(file, channel, pos, endSig)) { pos = scanForEndSig(file, channel, context); } if (pos == -1) { if (context.state == State.NOT_FOUND) { // Don't fail patching if we cannot validate a valid zip PatchLogger.ROOT_LOGGER.cannotInvalidateZip(file.getAbsolutePath()); } return; } // Update the central directory record channel.position(pos); final ByteBuffer buffer = ByteBuffer.allocate(4); buffer.order(ByteOrder.LITTLE_ENDIAN); buffer.putInt(newSig); buffer.flip(); while (buffer.hasRemaining()) { channel.write(buffer); } } finally { safeClose(channel); } } finally { safeClose(raf); } }
[ "Update the central directory signature of a .jar.\n\n@param file the file to process\n@param searchPattern the search patter to use\n@param badSkipBytes the bad bytes skip table\n@param newSig the new signature\n@param endSig the expected signature\n@throws IOException" ]
[ "Convert a request type string to value\n\n@param requestType String value of request type GET/POST/PUT/DELETE\n@return Matching REQUEST_TYPE. Defaults to ALL", "Set default values for annotations.\nInitial annotation take precedence over the default annotation when both annotation types are present\n\n@param def...
public void download(OutputStream output, ProgressListener listener) { URL url = CONTENT_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.fileID, this.getID()); BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "GET"); BoxAPIResponse response = request.send(); InputStream input = response.getBody(listener); long totalRead = 0; byte[] buffer = new byte[BUFFER_SIZE]; try { int n = input.read(buffer); totalRead += n; while (n != -1) { output.write(buffer, 0, n); n = input.read(buffer); totalRead += n; } } catch (IOException e) { throw new BoxAPIException("Couldn't connect to the Box API due to a network error.", e); } response.disconnect(); }
[ "Downloads this version of the file to a given OutputStream while reporting the progress to a ProgressListener.\n@param output the stream to where the file will be written.\n@param listener a listener for monitoring the download's progress." ]
[ "Use this API to update sslocspresponder resources.", "Use this API to fetch cacheselector resource of given name .", "Determine if a CharSequence can be parsed as a Long.\n\n@param self a CharSequence\n@return true if the CharSequence can be parsed\n@see #isLong(String)\n@since 1.8.2", "Retrieve the currentl...
private double[] formatTargetValuesForOptimizer() { //Put all values in an array for the optimizer. int numberOfMaturities = surface.getMaturities().length; double mats[] = surface.getMaturities(); ArrayList<Double> vals = new ArrayList<Double>(); for(int t = 0; t<numberOfMaturities; t++) { double mat = mats[t]; double[] myStrikes = surface.getSurface().get(mat).getStrikes(); OptionSmileData smileOfInterest = surface.getSurface().get(mat); for(int k = 0; k < myStrikes.length; k++) { vals.add(smileOfInterest.getSmile().get(myStrikes[k]).getValue()); } } Double[] targetVals = new Double[vals.size()]; return ArrayUtils.toPrimitive(vals.toArray(targetVals)); }
[ "This is a service method that takes care of putting al the target values in a single array.\n@return" ]
[ "Unlocks a file.", "Used to finish up pushing the bulge off the matrix.", "Create a new AwsServiceClient instance with a different codec registry.\n\n@param codecRegistry the new {@link CodecRegistry} for the client.\n@return a new AwsServiceClient instance with the different codec registry", "Create dummy gr...
public static snmpalarm get(nitro_service service, String trapname) throws Exception{ snmpalarm obj = new snmpalarm(); obj.set_trapname(trapname); snmpalarm response = (snmpalarm) obj.get_resource(service); return response; }
[ "Use this API to fetch snmpalarm resource of given name ." ]
[ "Sets the max.\n\n@param n the new max", "Retrieve the request History based on the specified filters.\nIf no filter is specified, return the default size history.\n\n@param filters filters to be applied\n@return array of History items\n@throws Exception exception", "Serialize the object JSON. When an error occ...
private static XMLStreamException unexpectedElement(final XMLStreamReader reader) { return SecurityManagerLogger.ROOT_LOGGER.unexpectedElement(reader.getName(), reader.getLocation()); }
[ "Gets an exception reporting an unexpected XML element.\n\n@param reader a reference to the stream reader.\n@return the constructed {@link javax.xml.stream.XMLStreamException}." ]
[ "Concatenates of list of Bytes objects to create a byte array\n\n@param listOfBytes Bytes objects to concatenate\n@return Bytes", "Print priority.\n\n@param priority Priority instance\n@return priority value", "Recurses the given folder and adds references to these files to the graph as FileModels.\n\nWe don't ...
public static cachecontentgroup get(nitro_service service, String name) throws Exception{ cachecontentgroup obj = new cachecontentgroup(); obj.set_name(name); cachecontentgroup response = (cachecontentgroup) obj.get_resource(service); return response; }
[ "Use this API to fetch cachecontentgroup resource of given name ." ]
[ "Use this API to unset the properties of snmpoption resource.\nProperties that need to be unset are specified in args array.", "The context returned by this method may be later reused for other interception types.\n\n@param interceptionModel\n@param ctx\n@param manager\n@param type\n@return the interception conte...
public ReferenceBuilder withPropertyValue(PropertyIdValue propertyIdValue, Value value) { getSnakList(propertyIdValue).add( factory.getValueSnak(propertyIdValue, value)); return getThis(); }
[ "Adds the given property and value to the constructed reference.\n\n@param propertyIdValue\nthe property to add\n@param value\nthe value to add\n@return builder object to continue construction" ]
[ "Checks the existence of the directory. If it does not exist, the method creates it.\n\n@param dir the directory to check.\n@throws IOException if fails.", "Clears all checked widgets in the group", "Summarizes balance for the given nodeId to PartitionCount.\n\n@param nodeIdToPartitionCount\n@param title for us...
public static CmsGalleryTabConfiguration resolve(String configStr) { CmsGalleryTabConfiguration tabConfig; if (CmsStringUtil.isEmptyOrWhitespaceOnly(configStr)) { configStr = "*sitemap,types,galleries,categories,vfstree,search,results"; } if (DEFAULT_CONFIGURATIONS != null) { tabConfig = DEFAULT_CONFIGURATIONS.get(configStr); if (tabConfig != null) { return tabConfig; } } return parse(configStr); }
[ "Given a string which is either the name of a predefined tab configuration or a configuration string, returns\nthe corresponding tab configuration.\n\n@param configStr a configuration string or predefined configuration name\n\n@return the gallery tab configuration" ]
[ "Check if we still need more nodes from the given zone and reduce the\nzoneReplicationFactor count accordingly.\n\n@param requiredRepFactor\n@param zoneId\n@return", "Scan all the class path and look for all classes that have the Format\nAnnotations.", "Parse an extended attribute value.\n\n@param file parent f...
public String getHiveExecutionEngine() { String executionEngine = hiveConfSystemOverride.get(HiveConf.ConfVars.HIVE_EXECUTION_ENGINE.varname); return executionEngine == null ? HiveConf.ConfVars.HIVE_EXECUTION_ENGINE.getDefaultValue() : executionEngine; }
[ "Get the configured hive.execution.engine. If not set it will default to the default value of HiveConf" ]
[ "Expects a height mat as input\n\n@param input - A grayscale height map\n@return edges", "Use this API to fetch auditsyslogpolicy_aaauser_binding resources of given name .", "Converts this file into a resource name on the classpath by cutting of the file path\nto the classpath root.\n\n@param classPathRootOnDis...
public static boolean canUseAsDelayedQueue(final Jedis jedis, final String key) { final String type = jedis.type(key); return (ZSET.equalsIgnoreCase(type) || NONE.equalsIgnoreCase(type)); }
[ "Determines if the queue identified by the given key can be used as a delayed queue.\n\n@param jedis\nconnection to Redis\n@param key\nthe key that identifies a queue\n@return true if the key already is a delayed queue or is not currently used, false otherwise" ]
[ "try to find a field in class c, recurse through class hierarchy if necessary\n\n@throws NoSuchFieldException if no Field was found into the class hierarchy", "Sets the character translator for all cells in the row.\nIt will also remove any other translator set.\nNothing will happen if the argument is null.\n@par...
static public String bb2hex(byte[] bb) { String result = ""; for (int i=0; i<bb.length; i++) { result = result + String.format("%02X ", bb[i]); } return result; }
[ "Converts a byte array to a hexadecimal string representation\n@param bb the byte array to convert\n@return string the string representation" ]
[ "Get an Iterator based on the ReportQuery\n\n@param query\n@return Iterator", "Writes image files for all data that was collected and the statistics\nfile for all sites.", "Process the layers.conf file.\n\n@param repoRoot the root\n@return the layers conf\n@throws java.io.IOException", "Returns a copy of this...
public Optional<ServerPort> activePort() { final Server server = this.server; return server != null ? server.activePort() : Optional.empty(); }
[ "Returns the primary port of the server.\n\n@return the primary {@link ServerPort} if the server is started. {@link Optional#empty()} otherwise." ]
[ "Retrieve a map of custom document properties.\n\n@return the Document Summary Information Map", "This method is called to format a currency value.\n\n@param value numeric value\n@return currency value", "Use this API to fetch all the nsacl6 resources that are configured on netscaler.", "Use this API to add a...
public static void checkFolderForFile(String fileName) throws IOException { if (fileName.lastIndexOf(File.separator) > 0) { String folder = fileName.substring(0, fileName.lastIndexOf(File.separator)); directoryCheck(folder); } }
[ "Checks whether the folder exists for fileName, and creates it if necessary.\n\n@param fileName folder name.\n@throws IOException an IO exception." ]
[ "In the 2.0 xsd the vault is in an external file, which has no namespace, using the output of the vault tool.\n\n@param f the file containing the external vault configuration as generated by the vault tool\n@return the vault config", "returns true if there are still more rows in the underlying ResultSet.\nReturns...
public void setHeader(String header, String value) { StringValidator.throwIfEmptyOrNull("header", header); StringValidator.throwIfEmptyOrNull("value", value); if (headers == null) { headers = new HashMap<String, String>(); } headers.put(header, value); }
[ "Sets a request header with the given name and value. If a header with the\nspecified name has already been set then the new value overwrites the\ncurrent value.\n\n@param header the name of the header\n@param value the value of the header\n\n@throws NullPointerException if header or value are null\n@throws Illegal...
[ "Returns all resources that belong to the bundle\nThis includes the descriptor if one exists.\n\n@return List of the bundle resources, including the descriptor.", "Calculate start dates for a yearly absolute recurrence.\n\n@param calendar current date\n@param dates array of start dates", "Extracts a flat set of...
public boolean absolute(int row) throws PersistenceBrokerException { // 1. handle the special cases first. if (row == 0) { return true; } if (row == 1) { m_activeIteratorIndex = 0; m_activeIterator = (OJBIterator) m_rsIterators.get(m_activeIteratorIndex); m_activeIterator.absolute(1); return true; } if (row == -1) { m_activeIteratorIndex = m_rsIterators.size(); m_activeIterator = (OJBIterator) m_rsIterators.get(m_activeIteratorIndex); m_activeIterator.absolute(-1); return true; } // now do the real work. boolean movedToAbsolute = false; boolean retval = false; setNextIterator(); // row is positive, so index from beginning. if (row > 0) { int sizeCount = 0; Iterator it = m_rsIterators.iterator(); OJBIterator temp = null; while (it.hasNext() && !movedToAbsolute) { temp = (OJBIterator) it.next(); if (temp.size() < row) { sizeCount += temp.size(); } else { // move to the offset - sizecount m_currentCursorPosition = row - sizeCount; retval = temp.absolute(m_currentCursorPosition); movedToAbsolute = true; } } } // row is negative, so index from end else if (row < 0) { int sizeCount = 0; OJBIterator temp = null; for (int i = m_rsIterators.size(); ((i >= 0) && !movedToAbsolute); i--) { temp = (OJBIterator) m_rsIterators.get(i); if (temp.size() < row) { sizeCount += temp.size(); } else { // move to the offset - sizecount m_currentCursorPosition = row + sizeCount; retval = temp.absolute(m_currentCursorPosition); movedToAbsolute = true; } } } return retval; }
[ "the absolute and relative calls are the trickiest parts. We have to\nmove across cursor boundaries potentially.\n\na + row value indexes from beginning of resultset\na - row value indexes from the end of th resulset.\n\nCalling absolute(1) is the same as calling first().\nCalling absolute(-1) is the same as callin...
[ "Establish a new master tempo, and if it is a change from the existing one, report it to the listeners.\n\n@param newTempo the newly reported master tempo.", "Add another store destination to an existing streaming session\n\n\n@param store the name of the store to stream to", "Heat Equation Boundary Conditions"...
public String objectToString(T object) { StringBuilder sb = new StringBuilder(64); sb.append(object.getClass().getSimpleName()); for (FieldType fieldType : fieldTypes) { sb.append(' ').append(fieldType.getColumnName()).append('='); try { sb.append(fieldType.extractJavaFieldValue(object)); } catch (Exception e) { throw new IllegalStateException("Could not generate toString of field " + fieldType, e); } } return sb.toString(); }
[ "Return a string representation of the object." ]
[ "Returns a new color that has the alpha adjusted by the\nspecified amount.", "Decode a content Type header line into types and parameters pairs", "Provides a collection of all the nodes in the tree\nusing a depth first traversal.\n\n@return the list of (depth-first) ordered nodes", "Validates the deployment.\...
private static void embedSvgGraphic( final SVGElement svgRoot, final SVGElement newSvgRoot, final Document newDocument, final Dimension targetSize, final Double rotation) { final String originalWidth = svgRoot.getAttributeNS(null, "width"); final String originalHeight = svgRoot.getAttributeNS(null, "height"); /* * To scale the SVG graphic and to apply the rotation, we distinguish two * cases: width and height is set on the original SVG or not. * * Case 1: Width and height is set * If width and height is set, we wrap the original SVG into 2 new SVG elements * and a container element. * * Example: * Original SVG: * <svg width="100" height="100"></svg> * * New SVG (scaled to 300x300 and rotated by 90 degree): * <svg width="300" height="300"> * <g transform="rotate(90.0 150 150)"> * <svg width="100%" height="100%" viewBox="0 0 100 100"> * <svg width="100" height="100"></svg> * </svg> * </g> * </svg> * * The requested size is set on the outermost <svg>. Then, the rotation is applied to the * <g> container and the scaling is achieved with the viewBox parameter on the 2nd <svg>. * * * Case 2: Width and height is not set * In this case the original SVG is wrapped into just one container and one new SVG element. * The rotation is set on the container, and the scaling happens automatically. * * Example: * Original SVG: * <svg viewBox="0 0 61.06 91.83"></svg> * * New SVG (scaled to 300x300 and rotated by 90 degree): * <svg width="300" height="300"> * <g transform="rotate(90.0 150 150)"> * <svg viewBox="0 0 61.06 91.83"></svg> * </g> * </svg> */ if (!StringUtils.isEmpty(originalWidth) && !StringUtils.isEmpty(originalHeight)) { Element wrapperContainer = newDocument.createElementNS(SVG_NS, "g"); wrapperContainer.setAttributeNS( null, SVGConstants.SVG_TRANSFORM_ATTRIBUTE, getRotateTransformation(targetSize, rotation)); newSvgRoot.appendChild(wrapperContainer); Element wrapperSvg = newDocument.createElementNS(SVG_NS, "svg"); wrapperSvg.setAttributeNS(null, "width", "100%"); wrapperSvg.setAttributeNS(null, "height", "100%"); wrapperSvg.setAttributeNS(null, "viewBox", "0 0 " + originalWidth + " " + originalHeight); wrapperContainer.appendChild(wrapperSvg); Node svgRootImported = newDocument.importNode(svgRoot, true); wrapperSvg.appendChild(svgRootImported); } else if (StringUtils.isEmpty(originalWidth) && StringUtils.isEmpty(originalHeight)) { Element wrapperContainer = newDocument.createElementNS(SVG_NS, "g"); wrapperContainer.setAttributeNS( null, SVGConstants.SVG_TRANSFORM_ATTRIBUTE, getRotateTransformation(targetSize, rotation)); newSvgRoot.appendChild(wrapperContainer); Node svgRootImported = newDocument.importNode(svgRoot, true); wrapperContainer.appendChild(svgRootImported); } else { throw new IllegalArgumentException( "Unsupported or invalid north-arrow SVG graphic: The same unit (px, em, %, ...) must be" + " " + "used for `width` and `height`."); } }
[ "Embeds the given SVG element into a new SVG element scaling the graphic to the given dimension and\napplying the given rotation." ]
[ "Computes the final list of versions to be stored, on top of what is\ncurrently being stored. Final list is valuesInStorage modified in place\n\n\n@param valuesInStorage list of versions currently in storage\n@param multiPutValues list of new versions being written to storage\n@return list of versions from multiPut...
public void set_protocol(String protocol) throws nitro_exception { if (protocol == null || !(protocol.equalsIgnoreCase("http") ||protocol.equalsIgnoreCase("https"))) { throw new nitro_exception("error: protocol value " + protocol + " is not supported"); } this.protocol = protocol; }
[ "Sets the protocol.\n@param protocol The protocol to be set." ]
[ "Convert an Object to a Date, without an Exception", "Closes the server socket. No new clients are accepted afterwards.", "Sets the scale value in pixel per map unit.\n\n@param pixelPerUnit\nthe scale value (pix/map unit)", "Gets the string describing the uniforms used by shaders of this type.\n@param ctx GVF...
public SqlStatement getPreparedDeleteStatement(ClassDescriptor cld) { SqlForClass sfc = getSqlForClass(cld); SqlStatement sql = sfc.getDeleteSql(); if(sql == null) { ProcedureDescriptor pd = cld.getDeleteProcedure(); if(pd == null) { sql = new SqlDeleteByPkStatement(cld, logger); } else { sql = new SqlProcedureStatement(pd, logger); } // set the sql string sfc.setDeleteSql(sql); if(logger.isDebugEnabled()) { logger.debug("SQL:" + sql.getStatement()); } } return sql; }
[ "generate a prepared DELETE-Statement for the Class\ndescribed by cld.\n@param cld the ClassDescriptor" ]
[ "Returns the key value in the given array.\n\n@param keyIndex the index of the scale key", "Returns the complete definition of a custom field's metadata.\n\n@param customField Globally unique identifier for the custom field.\n@return Request object", "Static main.\n\n@param args\nProgram arguments.\n@throws IO...
List<List<Word>> getDifferentArguments( List<List<Word>> argumentWords ) { List<List<Word>> result = Lists.newArrayList(); for( int i = 0; i < argumentWords.size(); i++ ) { result.add( Lists.<Word>newArrayList() ); } int nWords = argumentWords.get( 0 ).size(); for( int iWord = 0; iWord < nWords; iWord++ ) { Word wordOfFirstCase = argumentWords.get( 0 ).get( iWord ); // data tables have equal here, otherwise // the cases would be structurally different if( wordOfFirstCase.isDataTable() ) { continue; } boolean different = false; for( int iCase = 1; iCase < argumentWords.size(); iCase++ ) { Word wordOfCase = argumentWords.get( iCase ).get( iWord ); if( !wordOfCase.getFormattedValue().equals( wordOfFirstCase.getFormattedValue() ) ) { different = true; break; } } if( different ) { for( int iCase = 0; iCase < argumentWords.size(); iCase++ ) { result.get( iCase ).add( argumentWords.get( iCase ).get( iWord ) ); } } } return result; }
[ "Returns a list with argument words that are not equal in all cases" ]
[ "Parse a boolean.\n\n@param value boolean\n@return Boolean value", "Checks the preconditions for creating a new LMinMax processor.\n\n@param min\nthe minimum value (inclusive)\n@param max\nthe maximum value (inclusive)\n@throws IllegalArgumentException\nif {@code max < min}", "Sets the Calendar used. 'Standard'...
public void addModuleDir(final String moduleDir) { if (moduleDir == null) { throw LauncherMessages.MESSAGES.nullParam("moduleDir"); } // Validate the path final Path path = Paths.get(moduleDir).normalize(); modulesDirs.add(path.toString()); }
[ "Adds a directory to the collection of module paths.\n\n@param moduleDir the module directory to add\n\n@throws java.lang.IllegalArgumentException if the path is {@code null}" ]
[ "Computes the power of a complex number in polar notation\n\n@param a Complex number\n@param N Power it is to be multiplied by\n@param result Result", "Returns with an iterable of URIs that points to all elements that are\nreferenced by the argument or vice-versa.\n\n@return an iterable of URIs that are reference...
public void classifyAndWriteViterbiSearchGraph(String testFile, String searchGraphPrefix, DocumentReaderAndWriter<IN> readerAndWriter) throws IOException { Timing timer = new Timing(); ObjectBank<List<IN>> documents = makeObjectBankFromFile(testFile, readerAndWriter); int numWords = 0; int numSentences = 0; for (List<IN> doc : documents) { DFSA<String, Integer> tagLattice = getViterbiSearchGraph(doc, AnswerAnnotation.class); numWords += doc.size(); PrintWriter latticeWriter = new PrintWriter(new FileOutputStream(searchGraphPrefix + '.' + numSentences + ".wlattice")); PrintWriter vsgWriter = new PrintWriter(new FileOutputStream(searchGraphPrefix + '.' + numSentences + ".lattice")); if (readerAndWriter instanceof LatticeWriter) ((LatticeWriter) readerAndWriter).printLattice(tagLattice, doc, latticeWriter); tagLattice.printAttFsmFormat(vsgWriter); latticeWriter.close(); vsgWriter.close(); numSentences++; } long millis = timer.stop(); double wordspersec = numWords / (((double) millis) / 1000); NumberFormat nf = new DecimalFormat("0.00"); // easier way! System.err.println(this.getClass().getName() + " tagged " + numWords + " words in " + numSentences + " documents at " + nf.format(wordspersec) + " words per second."); }
[ "Load a test file, run the classifier on it, and then write a Viterbi search\ngraph for each sequence.\n\n@param testFile\nThe file to test on." ]
[ "Lift a Java Func0 to a Scala Function0\n\n@param f the function to lift\n\n@returns the Scala function", "URLDecode a string\n@param s\n@return", "Guess whether given file is binary. Just checks for anything under 0x09.", "Returns true if templates are to be instantiated synchronously and false if\nasynchron...
public static void main(String[] args) { try { TreeFactory tf = new LabeledScoredTreeFactory(); Reader r = new BufferedReader(new InputStreamReader(new FileInputStream(args[0]), "UTF-8")); TreeReader tr = new PennTreeReader(r, tf); Tree t = tr.readTree(); while (t != null) { System.out.println(t); System.out.println(); t = tr.readTree(); } r.close(); } catch (IOException ioe) { ioe.printStackTrace(); } }
[ "Loads treebank data from first argument and prints it.\n\n@param args Array of command-line arguments: specifies a filename" ]
[ "Add an event to the queue. It will be processed in the order received.\n\n@param event Event", "Appends the accumulated words to the resulting words. Trailing whitespace is removed because of the\npostprocessing that inserts custom whitespace\n\n@param currentWords is the {@link StringBuilder} of the accumulated...
public Conditionals addIfMatch(Tag tag) { Preconditions.checkArgument(!modifiedSince.isPresent(), String.format(ERROR_MESSAGE, HeaderConstants.IF_MATCH, HeaderConstants.IF_MODIFIED_SINCE)); Preconditions.checkArgument(noneMatch.isEmpty(), String.format(ERROR_MESSAGE, HeaderConstants.IF_MATCH, HeaderConstants.IF_NONE_MATCH)); List<Tag> match = new ArrayList<>(this.match); if (tag == null) { tag = Tag.ALL; } if (Tag.ALL.equals(tag)) { match.clear(); } if (!match.contains(Tag.ALL)) { if (!match.contains(tag)) { match.add(tag); } } else { throw new IllegalArgumentException("Tag ALL already in the list"); } return new Conditionals(Collections.unmodifiableList(match), empty(), Optional.empty(), unModifiedSince); }
[ "Adds tags to the If-Match header.\n\n@param tag the tag to add, may be null. This means the same as adding {@link Tag#ALL}\n@throws IllegalArgumentException if ALL is supplied more than once, or you add a null tag more than once.\n@return a new Conditionals object with the If-Match tag added." ]
[ "obtains the internal JDO lifecycle state of the input StatemanagerInternal.\nThis Method is helpful to display persistent objects internal state.\n@param sm the StateManager to be inspected\n@return the LifeCycleState of a StateManager instance", "get the bean property type\n\n@param clazz\n@param propertyName\n...
public void terminateAllConnections(){ this.terminationLock.lock(); try{ // close off all connections. for (int i=0; i < this.pool.partitionCount; i++) { this.pool.partitions[i].setUnableToCreateMoreTransactions(false); // we can create new ones now, this is an optimization List<ConnectionHandle> clist = new LinkedList<ConnectionHandle>(); this.pool.partitions[i].getFreeConnections().drainTo(clist); for (ConnectionHandle c: clist){ this.pool.destroyConnection(c); } } } finally { this.terminationLock.unlock(); } }
[ "Closes off all connections in all partitions." ]
[ "Unmark a PersistenceBroker as preferred choice for current Thread\n\n@param key The PBKey the broker is associated to\n@param broker The PersistenceBroker to unmark", "Get a TokenizerFactory that does Penn Treebank tokenization.\nThis is now the recommended factory method to use.\n\n@param factory A TokenFact...
private static BundleCapability getExportedPackage(BundleContext context, String packageName) { List<BundleCapability> packages = new ArrayList<BundleCapability>(); for (Bundle bundle : context.getBundles()) { BundleRevision bundleRevision = bundle.adapt(BundleRevision.class); for (BundleCapability packageCapability : bundleRevision.getDeclaredCapabilities(BundleRevision.PACKAGE_NAMESPACE)) { String pName = (String) packageCapability.getAttributes().get(BundleRevision.PACKAGE_NAMESPACE); if (pName.equalsIgnoreCase(packageName)) { packages.add(packageCapability); } } } Version max = Version.emptyVersion; BundleCapability maxVersion = null; for (BundleCapability aPackage : packages) { Version version = (Version) aPackage.getAttributes().get("version"); if (max.compareTo(version) <= 0) { max = version; maxVersion = aPackage; } } return maxVersion; }
[ "Return the BundleCapability of a bundle exporting the package packageName.\n\n@param context The BundleContext\n@param packageName The package name\n@return the BundleCapability of a bundle exporting the package packageName" ]
[ "Start and configure GreenMail using given properties.\n\n@param properties the properties such as System.getProperties()", "Create a JMX ObjectName\n\n@param domain The domain of the object\n@param type The type of the object\n@return An ObjectName representing the name", "Gets id of a property and creates the...
public static base_response update(nitro_service client, tmtrafficaction resource) throws Exception { tmtrafficaction updateresource = new tmtrafficaction(); updateresource.name = resource.name; updateresource.apptimeout = resource.apptimeout; updateresource.sso = resource.sso; updateresource.formssoaction = resource.formssoaction; updateresource.persistentcookie = resource.persistentcookie; updateresource.initiatelogout = resource.initiatelogout; updateresource.kcdaccount = resource.kcdaccount; updateresource.samlssoprofile = resource.samlssoprofile; return updateresource.update_resource(client); }
[ "Use this API to update tmtrafficaction." ]
[ "Deserialize a javascript design document file to a DesignDocument object.\n\n@param file the design document javascript file (UTF-8 encoded)\n@return {@link DesignDocument}\n@throws FileNotFoundException if the file does not exist or cannot be read", "Returns the value of the identified field as a Boolean.\n@par...
private void addEntriesFromTag(List<Entry> entries, RekordboxAnlz.CueTag tag) { for (RekordboxAnlz.CueEntry cueEntry : tag.cues()) { // TODO: Need to figure out how to identify deleted entries to ignore. if (cueEntry.type() == RekordboxAnlz.CueEntryType.LOOP) { entries.add(new Entry((int)cueEntry.hotCue(), Util.timeToHalfFrame(cueEntry.time()), Util.timeToHalfFrame(cueEntry.loopTime()))); } else { entries.add(new Entry((int)cueEntry.hotCue(), Util.timeToHalfFrame(cueEntry.time()))); } } }
[ "Helper method to add cue list entries from a parsed ANLZ cue tag\n\n@param entries the list of entries being accumulated\n@param tag the tag whose entries are to be added" ]
[ "End building the prepared script, adding a return value statement\n@param value the value to return\n@param config the configuration for the script to build\n@return the new {@link LuaPreparedScript} instance", "Use this API to disable vserver of given name.", "Convert an Integer value into a String.\n\n@param...
public static @Nullable CleverTapAPI getInstance(Context context) throws CleverTapMetaDataNotFoundException, CleverTapPermissionsNotSatisfied { // For Google Play Store/Android Studio tracking sdkVersion = BuildConfig.SDK_VERSION_STRING; return getDefaultInstance(context); }
[ "Returns an instance of the CleverTap SDK.\n\n@param context The Android context\n@return The {@link CleverTapAPI} object\n@deprecated use {@link CleverTapAPI#getDefaultInstance(Context context)}" ]
[ "Converts a duration to duration time units.\n\n@param value duration value\n@return duration time units", "Set the dates for the specified photo.\n\nThis method requires authentication with 'write' permission.\n\n@param photoId\nThe photo ID\n@param datePosted\nThe date the photo was posted or null\n@param dateT...
public static long crc32(byte[] bytes, int offset, int size) { CRC32 crc = new CRC32(); crc.update(bytes, offset, size); return crc.getValue(); }
[ "Compute the CRC32 of the segment of the byte array given by the\nspecificed size and offset\n\n@param bytes The bytes to checksum\n@param offset the offset at which to begin checksumming\n@param size the number of bytes to checksum\n@return The CRC32" ]
[ "Executes the API action \"wbsetclaim\" for the given parameters.\n\n@param statement\nthe JSON serialization of claim to add or delete.\n@param bot\nif true, edits will be flagged as \"bot edits\" provided that\nthe logged in user is in the bot group; for regular users, the\nflag will just be ignored\n@param baser...
public static Variable deserialize(String s, VariableType variableType, List<String> dataTypes) { Variable var = new Variable(variableType); String[] varParts = s.split(":"); if (varParts.length > 0) { String name = varParts[0]; if (!name.isEmpty()) { var.setName(name); if (varParts.length == 2) { String dataType = varParts[1]; if (!dataType.isEmpty()) { if (dataTypes != null && dataTypes.contains(dataType)) { var.setDataType(dataType); } else { var.setCustomDataType(dataType); } } } } } return var; }
[ "Deserializes a variable, checking whether the datatype is custom or not\n@param s\n@param variableType\n@param dataTypes\n@return" ]
[ "Publish finish events for each of the specified query labels\n\n<pre>\n{@code\nLabelledEvents.start(\"get\", 1l, bus, \"typeA\", \"custom\");\ntry {\nreturn \"ok\";\n} finally {\nRequestEvents.finish(\"get\", 1l, bus, \"typeA\", \"custom\");\n}\n\n}\n</pre>\n\n\n@param query Completed query\n@param correlationId I...
public void close() { Closer.closeQuietly(acceptor); for (Processor processor : processors) { Closer.closeQuietly(processor); } }
[ "Shutdown the socket server" ]
[ "Set dates where the event should not take place, even if they are part of the series.\n@param dates dates to set.", "Read the top level tasks from GanttProject.\n\n@param gpProject GanttProject project", "Processes an anonymous field definition specified at the class level.\n\n@param attributes The ...
public static String getVcsUrl(Map<String, String> env) { String url = env.get("SVN_URL"); if (StringUtils.isBlank(url)) { url = publicGitUrl(env.get("GIT_URL")); } if (StringUtils.isBlank(url)) { url = env.get("P4PORT"); } return url; }
[ "Get the VCS url from the Jenkins build environment. The search will one of \"SVN_REVISION\", \"GIT_COMMIT\",\n\"P4_CHANGELIST\" in the environment.\n\n@param env Th Jenkins build environment.\n@return The vcs url for supported VCS" ]
[ "Use this API to disable clusterinstance of given name.", "Process the hours and exceptions for an individual calendar.\n\n@param calendar project calendar\n@param calendarData hours and exception rows for this calendar", "Called after creating the first connection. The adapter should create its caches and do a...
public static long stopNamedTimer(String timerName, int todoFlags) { return stopNamedTimer(timerName, todoFlags, Thread.currentThread() .getId()); }
[ "Stop a timer of the given string name for the current thread. If no such\ntimer exists, -1 will be returned. Otherwise the return value is the CPU\ntime that was measured.\n\n@param timerName\nthe name of the timer\n@param todoFlags\n@return CPU time if timer existed and was running, and -1 otherwise" ]
[ "Register an active operation with a specific operation id.\n\n@param id the operation id\n@param attachment the shared attachment\n@param callback the completed callback\n@return the created active operation\n\n@throws java.lang.IllegalStateException if an operation with the same id is already registered", "Chec...
@GuardedBy("elementsLock") @Override public boolean markChecked(CandidateElement element) { String generalString = element.getGeneralString(); String uniqueString = element.getUniqueString(); synchronized (elementsLock) { if (elements.contains(uniqueString)) { return false; } else { elements.add(generalString); elements.add(uniqueString); return true; } } }
[ "Mark a given element as checked to prevent duplicate work. A elements is only added when it\nis not already in the set of checked elements.\n\n@param element the element that is checked\n@return true if !contains(element.uniqueString)" ]
[ "Use this API to update systemuser.", "Set the specific device class of the node.\n@param specificDeviceClass the specificDeviceClass to set\n@exception IllegalArgumentException thrown when the specific device class does not match\nthe generic device class.", "A henson navigator is a class that helps a consumer...
private void verifyOrAddStore(String clusterURL, String keySchema, String valueSchema) { String newStoreDefXml = VoldemortUtils.getStoreDefXml( storeName, props.getInt(BUILD_REPLICATION_FACTOR, 2), props.getInt(BUILD_REQUIRED_READS, 1), props.getInt(BUILD_REQUIRED_WRITES, 1), props.getNullableInt(BUILD_PREFERRED_READS), props.getNullableInt(BUILD_PREFERRED_WRITES), props.getString(PUSH_FORCE_SCHEMA_KEY, keySchema), props.getString(PUSH_FORCE_SCHEMA_VALUE, valueSchema), description, owners); log.info("Verifying store against cluster URL: " + clusterURL + "\n" + newStoreDefXml.toString()); StoreDefinition newStoreDef = VoldemortUtils.getStoreDef(newStoreDefXml); try { adminClientPerCluster.get(clusterURL).storeMgmtOps.verifyOrAddStore(newStoreDef, "BnP config/data", enableStoreCreation, this.storeVerificationExecutorService); } catch (UnreachableStoreException e) { log.info("verifyOrAddStore() failed on some nodes for clusterURL: " + clusterURL + " (this is harmless).", e); // When we can't reach some node, we just skip it and won't create the store on it. // Next time BnP is run while the node is up, it will get the store created. } // Other exceptions need to bubble up! storeDef = newStoreDef; }
[ "For each node, checks if the store exists and then verifies that the remote schema\nmatches the new one. If the remote store doesn't exist, it creates it." ]
[ "This is needed when running on slaves.", "Accessor method used to retrieve a char representing the\ncontents of an individual field. If the field does not exist in the\nrecord, the default character is returned.\n\n@param field the index number of the field to be retrieved\n@return the value of the required fiel...
public static responderglobal_responderpolicy_binding[] get(nitro_service service) throws Exception{ responderglobal_responderpolicy_binding obj = new responderglobal_responderpolicy_binding(); responderglobal_responderpolicy_binding response[] = (responderglobal_responderpolicy_binding[]) obj.get_resources(service); return response; }
[ "Use this API to fetch a responderglobal_responderpolicy_binding resources." ]
[ "Checks to see if the matrix is symmetric to within tolerance.\n\n@param A Matrix being tested. Not modified.\n@param tol Tolerance that defines how similar two values must be to be considered identical\n@return true if symmetric or false if not", "Retrieves a list of Terms of Service that belong to your Enterpr...
protected static void checkChannels(final Iterable<String> channels) { if (channels == null) { throw new IllegalArgumentException("channels must not be null"); } for (final String channel : channels) { if (channel == null || "".equals(channel)) { throw new IllegalArgumentException("channels' members must not be null: " + channels); } } }
[ "Verify that the given channels are all valid.\n\n@param channels\nthe given channels" ]
[ "Create button message key.\n\n@param gallery name\n@return Button message key as String", "set the textColor of the ColorHolder to an drawable\n\n@param ctx\n@param drawable", "Calculates the delta of a digital option under a Black-Scholes model\n\n@param initialStockValue The initial value of the underlying,...
private void processWorkPattern(ProjectCalendarWeek week, Integer workPatternID, Map<Integer, Row> workPatternMap, Map<Integer, List<Row>> timeEntryMap, Map<Integer, DayType> exceptionTypeMap) { Row workPatternRow = workPatternMap.get(workPatternID); if (workPatternRow != null) { week.setName(workPatternRow.getString("NAMN")); List<Row> timeEntryRows = timeEntryMap.get(workPatternID); if (timeEntryRows != null) { long lastEndTime = Long.MIN_VALUE; Day currentDay = Day.SUNDAY; ProjectCalendarHours hours = week.addCalendarHours(currentDay); Arrays.fill(week.getDays(), DayType.NON_WORKING); for (Row row : timeEntryRows) { Date startTime = row.getDate("START_TIME"); Date endTime = row.getDate("END_TIME"); if (startTime == null) { startTime = DateHelper.getDayStartDate(new Date(0)); } if (endTime == null) { endTime = DateHelper.getDayEndDate(new Date(0)); } if (startTime.getTime() > endTime.getTime()) { endTime = DateHelper.addDays(endTime, 1); } if (startTime.getTime() < lastEndTime) { currentDay = currentDay.getNextDay(); hours = week.addCalendarHours(currentDay); } DayType type = exceptionTypeMap.get(row.getInteger("EXCEPTIOP")); if (type == DayType.WORKING) { hours.addRange(new DateRange(startTime, endTime)); week.setWorkingDay(currentDay, DayType.WORKING); } lastEndTime = endTime.getTime(); } } } }
[ "Populates a ProjectCalendarWeek instance from Asta work pattern data.\n\n@param week target ProjectCalendarWeek instance\n@param workPatternID target work pattern ID\n@param workPatternMap work pattern data\n@param timeEntryMap time entry map\n@param exceptionTypeMap exception type map" ]
[ "Release transaction that was acquired in a thread with specified permits.", "Use this API to fetch service_dospolicy_binding resources of given name .", "Removes all pending broadcasts\n\n@param sessionIds to remove broadcast for (or null for all sessions)", "Creates updateable version of capability registry...
public void newLineIfNotEmpty() { for (int i = segments.size() - 1; i >= 0; i--) { String segment = segments.get(i); if (lineDelimiter.equals(segment)) { segments.subList(i + 1, segments.size()).clear(); cachedToString = null; return; } for (int j = 0; j < segment.length(); j++) { if (!WhitespaceMatcher.isWhitespace(segment.charAt(j))) { newLine(); return; } } } segments.clear(); cachedToString = null; }
[ "Add a newline to this sequence according to the configured lineDelimiter if the last line contains\nsomething besides whitespace." ]
[ "Set the timeout for idle connections. Voldemort client caches all\nconnections to the Voldemort server. This setting allows the a connection\nto be dropped, if it is idle for more than this time.\n\nThis could be useful in the following cases 1) Voldemort client is not\ndirectly connected to the server and is conn...
static boolean uninstall() { boolean uninstalled = false; synchronized (lock) { if (locationCollectionClient != null) { locationCollectionClient.locationEngineController.onDestroy(); locationCollectionClient.settingsChangeHandlerThread.quit(); locationCollectionClient.sharedPreferences.unregisterOnSharedPreferenceChangeListener(locationCollectionClient); locationCollectionClient = null; uninstalled = true; } } return uninstalled; }
[ "Uninstall current location collection client.\n\n@return true if uninstall was successful" ]
[ "Writes no-value restriction.\n\n@param rdfWriter\nthe writer to write the restrictions to\n@param propertyUri\nURI of the property to which the restriction applies\n@param rangeUri\nURI of the class or datatype to which the restriction applies\n@param subject\nnode representing the restriction\n@throws RDFHandlerE...
private void updateRemoveQ( int rowIndex ) { Qm.set(Q); Q.reshape(m_m,m_m, false); for( int i = 0; i < rowIndex; i++ ) { for( int j = 1; j < m; j++ ) { double sum = 0; for( int k = 0; k < m; k++ ) { sum += Qm.data[i*m+k]* U_tran.data[j*m+k]; } Q.data[i*m_m+j-1] = sum; } } for( int i = rowIndex+1; i < m; i++ ) { for( int j = 1; j < m; j++ ) { double sum = 0; for( int k = 0; k < m; k++ ) { sum += Qm.data[i*m+k]* U_tran.data[j*m+k]; } Q.data[(i-1)*m_m+j-1] = sum; } } }
[ "Updates the Q matrix to take inaccount the row that was removed by only multiplying e\nlements that need to be. There is still some room for improvement here...\n@param rowIndex" ]
[ "Returns an java object read from the specified ResultSet column.", "Complete the current operation and persist the current state to the disk. This will also trigger the invalidation\nof outdated modules.\n\n@param modification the current modification\n@param callback the completion callback", "User-initia...
public static base_responses export(nitro_service client, appfwlearningdata resources[]) throws Exception { base_responses result = null; if (resources != null && resources.length > 0) { appfwlearningdata exportresources[] = new appfwlearningdata[resources.length]; for (int i=0;i<resources.length;i++){ exportresources[i] = new appfwlearningdata(); exportresources[i].profilename = resources[i].profilename; exportresources[i].securitycheck = resources[i].securitycheck; exportresources[i].target = resources[i].target; } result = perform_operation_bulk_request(client, exportresources,"export"); } return result; }
[ "Use this API to export appfwlearningdata resources." ]
[ "Set whether the player holding the waveform is playing, which changes the indicator color to white from red.\nThis method can only be used in situations where the component is tied to a single player, and therefore has\na single playback position.\n\n@param playing if {@code true}, draw the position marker in whit...
private int findYOffsetForGroupLabel(JRDesignBand band) { int offset = 0; for (JRChild jrChild : band.getChildren()) { JRDesignElement elem = (JRDesignElement) jrChild; if (elem.getKey() != null && elem.getKey().startsWith("variable_for_column_")) { offset = elem.getY(); break; } } return offset; }
[ "Used to ensure that the general footer label will be at the same Y position as the variables in the band.\n@param band\n@return" ]
[ "Deregister shutdown hook and execute it immediately", "A slop is dead if the destination node or the store does not exist\nanymore on the cluster.\n\n@param slop\n@return", "Creates a quad consisting of two triangles, with the specified width and\nheight.\n\n@param gvrContext current {@link GVRContext}\n\n@par...
@Override public void clear() { values.clear(); listBox.clear(); clearStatusText(); if (emptyPlaceHolder != null) { insertEmptyPlaceHolder(emptyPlaceHolder); } reload(); if (isAllowBlank()) { addBlankItemIfNeeded(); } }
[ "Removes all items from the list box." ]
[ "Implements the instanceof operator.\n\n@param instance The value that appeared on the LHS of the instanceof\noperator\n@return true if \"this\" appears in value's prototype chain", "Calls the specified Stitch function.\n\n@param name the name of the Stitch function to call.\n@param args the arguments to pass to ...
public URI withEmptyAuthority(final URI uri) { URI _xifexpression = null; if ((uri.isFile() && (uri.authority() == null))) { _xifexpression = URI.createHierarchicalURI(uri.scheme(), "", uri.device(), uri.segments(), uri.query(), uri.fragment()); } else { _xifexpression = uri; } return _xifexpression; }
[ "converts the file URIs with an absent authority to one with an empty" ]
[ "Extract definition records from the table and divide into groups.", "Return a list of unique values for a namespace and predicate.\n\nThis method does not require authentication.\n\n@param namespace\nThe namespace that all values should be restricted to.\n@param predicate\nThe predicate that all values should be...
private void openBrowser(URI url) throws IOException { if (Desktop.isDesktopSupported()) { Desktop.getDesktop().browse(url); } else { LOGGER.error("Can not open browser because this capability is not supported on " + "your platform. You can use the link below to open the report manually."); } }
[ "Open the given url in default system browser." ]
[ "Reads a quoted string value from the request.", "Assigns retention policy with givenID to the folder.\n@param api the API connection to be used by the created assignment.\n@param policyID id of the assigned retention policy.\n@param folderID id of the folder to assign policy to.\n@return info about created assig...
public static tunnelip_stats[] get(nitro_service service) throws Exception{ tunnelip_stats obj = new tunnelip_stats(); tunnelip_stats[] response = (tunnelip_stats[])obj.stat_resources(service); return response; }
[ "Use this API to fetch the statistics of all tunnelip_stats resources that are configured on netscaler." ]
[ "Returns the intersection of sets s1 and s2.", "Use the universal project reader to open the file.\nThrow an exception if we can't determine the file type.\n\n@param inputFile file name\n@return ProjectFile instance", "Split string of comma-delimited ints into an a int array\n\n@param str\n@return\n@throws Ille...
public long addAll(final Map<String, Double> scoredMember) { return doWithJedis(new JedisCallable<Long>() { @Override public Long call(Jedis jedis) { return jedis.zadd(getKey(), scoredMember); } }); }
[ "Adds to this set all of the elements in the specified map of members and their score.\n@param scoredMember the members to add together with their scores\n@return the number of members actually added" ]
[ "Runs the record linkage process.", "Used to NOT the argument clause specified.", "Performs any needed operation on subreports after they are built like ensuring proper subreport with\nif \"fitToParentPrintableArea\" flag is set to true\n\n@param dr\n@param _parameters\n@throws JRException", "Try to build an ...
private int[] getCompressIndexAndCount(CompressOptions options, boolean createMixed) { if(options != null) { CompressionChoiceOptions rangeSelection = options.rangeSelection; RangeList compressibleSegs = rangeSelection.compressHost() ? getZeroRangeSegments() : getZeroSegments(); int maxIndex = -1, maxCount = 0; int segmentCount = getSegmentCount(); boolean compressMixed = createMixed && options.compressMixedOptions.compressMixed(this); boolean preferHost = (rangeSelection == CompressOptions.CompressionChoiceOptions.HOST_PREFERRED); boolean preferMixed = createMixed && (rangeSelection == CompressOptions.CompressionChoiceOptions.MIXED_PREFERRED); for(int i = compressibleSegs.size() - 1; i >= 0 ; i--) { Range range = compressibleSegs.getRange(i); int index = range.index; int count = range.length; if(createMixed) { //so here we shorten the range to exclude the mixed part if necessary int mixedIndex = IPv6Address.MIXED_ORIGINAL_SEGMENT_COUNT - addressSegmentIndex; if(!compressMixed || index > mixedIndex || index + count < segmentCount) { //range does not include entire mixed part. We never compress only part of a mixed part. //the compressible range must stop at the mixed part count = Math.min(count, mixedIndex - index); } } //select this range if is the longest if(count > 0 && count >= maxCount && (options.compressSingle || count > 1)) { maxIndex = index; maxCount = count; } if(preferHost && isPrefixed() && ((index + count) * IPv6Address.BITS_PER_SEGMENT) > getNetworkPrefixLength()) { //this range contains the host //Since we are going backwards, this means we select as the maximum any zero segment that includes the host break; } if(preferMixed && index + count >= segmentCount) { //this range contains the mixed section //Since we are going backwards, this means we select to compress the mixed segment break; } } if(maxIndex >= 0) { return new int[] {maxIndex, maxCount}; } } return null; }
[ "Chooses a single segment to be compressed, or null if no segment could be chosen.\n@param options\n@param createMixed\n@return" ]
[ "Return the index associated to the Renderer.\n\n@param renderer used to search in the prototypes collection.\n@return the prototype index associated to the renderer passed as argument.", "The conditional expectation is calculated using a Monte-Carlo regression technique.\n\n@param exerciseTime The exercise time\...
@SuppressWarnings("unchecked") public static Map<String, Properties> readMultipleClientConfigAvro(String configAvro) { Map<String, Properties> mapStoreToProps = Maps.newHashMap(); try { JsonDecoder decoder = new JsonDecoder(CLIENT_CONFIGS_AVRO_SCHEMA, configAvro); GenericDatumReader<Object> datumReader = new GenericDatumReader<Object>(CLIENT_CONFIGS_AVRO_SCHEMA); Map<Utf8, Map<Utf8, Utf8>> storeConfigs = (Map<Utf8, Map<Utf8, Utf8>>) datumReader.read(null, decoder); // Store config props to return back for(Utf8 storeName: storeConfigs.keySet()) { Properties props = new Properties(); Map<Utf8, Utf8> singleConfig = storeConfigs.get(storeName); for(Utf8 key: singleConfig.keySet()) { props.put(key.toString(), singleConfig.get(key).toString()); } if(storeName == null || storeName.length() == 0) { throw new Exception("Invalid store name found!"); } mapStoreToProps.put(storeName.toString(), props); } } catch(Exception e) { e.printStackTrace(); } return mapStoreToProps; }
[ "Parses a string that contains multiple fat client configs in avro format\n\n@param configAvro Input string of avro format, that contains config for\nmultiple stores\n@return Map of store names to store config properties" ]
[ "Returns a map of URIs to package name, as specified by the packageNames\nparameter.", "Sets a single element of this vector. Elements 0, 1, and 2 correspond to\nx, y, and z.\n\n@param i\nelement index\n@param value\nelement value\n@return element value throws ArrayIndexOutOfBoundsException if i is not\nin the ra...
public static ModelNode createListDeploymentsOperation() { final ModelNode op = createOperation(READ_CHILDREN_NAMES); op.get(CHILD_TYPE).set(DEPLOYMENT); return op; }
[ "Creates an operation to list the deployments.\n\n@return the operation" ]
[ "Utility method to retrieve the next working date start time, given\na date and time as a starting point.\n\n@param date date and time start point\n@return date and time of next work start", "Returns the u component of a coordinate from a texture coordinate set.\n\n@param vertex the vertex index\n@param coords th...
public static systemcore get(nitro_service service) throws Exception{ systemcore obj = new systemcore(); systemcore[] response = (systemcore[])obj.get_resources(service); return response[0]; }
[ "Use this API to fetch all the systemcore resources that are configured on netscaler." ]
[ "Returns whether the division grouping range matches the block of values for its prefix length.\nIn other words, returns true if and only if it has a prefix length and it has just a single prefix.", "This method is called if the data set has been changed. Subclasses might want to override\nthis method to add some...
public int getCostRateTableIndex() { Integer value = (Integer) getCachedValue(AssignmentField.COST_RATE_TABLE); return value == null ? 0 : value.intValue(); }
[ "Returns the cost rate table index for this assignment.\n\n@return cost rate table index" ]
[ "Use this API to fetch the statistics of all gslbservice_stats resources that are configured on netscaler.", "Inserts the currently contained data objects into the database.\n\n@param platform The (connected) database platform for inserting data\n@param model The database model\n@param batchSize The batch si...
private int synchroizeTaskIDToHierarchy(Task parentTask, int currentID) { for (Task task : parentTask.getChildTasks()) { task.setID(Integer.valueOf(currentID++)); add(task); currentID = synchroizeTaskIDToHierarchy(task, currentID); } return currentID; }
[ "Called recursively to renumber child task IDs.\n\n@param parentTask parent task instance\n@param currentID current task ID\n@return updated current task ID" ]
[ "Create a set out of the items in the Iterable.\n\n@param <T>\nThe type of items in the Iterable.\n@param items\nThe items to be made into a set.\n@return A set consisting of the items from the Iterable.", "Use this API to flush cacheobject resources.", "If you want to stop recorded events from being sent to th...
private void processQueue() { CacheEntry sv; while((sv = (CacheEntry) queue.poll()) != null) { sessionCache.remove(sv.oid); } }
[ "Make sure that the Identity objects of garbage collected cached\nobjects are removed too." ]
[ "Generate a schedule for the given start and end date.\n\n@param referenceDate The reference date (corresponds to \\( t = 0 \\).\n@param startDate The start date.\n@param endDate The end date.\n@return The schedule", "Cancel request and workers.", "Handles Multi Instance Report message. Handles Report on\nthe n...
private List<T> computePagedList(List<T> result, HeaderAndBody httpResponse, JSONObject where, Pipe<T> requestingPipe) { ReadFilter previousRead = null; ReadFilter nextRead = null; if (PageConfig.MetadataLocations.WEB_LINKING.equals(pageConfig.getMetadataLocation())) { String webLinksRaw = ""; final String relHeader = "rel"; final String nextIdentifier = pageConfig.getNextIdentifier(); final String prevIdentifier = pageConfig.getPreviousIdentifier(); try { webLinksRaw = getWebLinkHeader(httpResponse); if (webLinksRaw == null) { // no paging, return result return result; } List<WebLink> webLinksParsed = WebLinkParser.parse(webLinksRaw); for (WebLink link : webLinksParsed) { if (nextIdentifier.equals(link.getParameters().get(relHeader))) { nextRead = new ReadFilter(); nextRead.setLinkUri(new URI(link.getUri())); } else if (prevIdentifier.equals(link.getParameters().get(relHeader))) { previousRead = new ReadFilter(); previousRead.setLinkUri(new URI(link.getUri())); } } } catch (URISyntaxException ex) { Log.e(TAG, webLinksRaw + " did not contain a valid context URI", ex); throw new RuntimeException(ex); } catch (ParseException ex) { Log.e(TAG, webLinksRaw + " could not be parsed as a web link header", ex); throw new RuntimeException(ex); } } else if (pageConfig.getMetadataLocation().equals(PageConfig.MetadataLocations.HEADERS)) { nextRead = pageConfig.getPageParameterExtractor().getNextFilter(httpResponse, RestAdapter.this.pageConfig); previousRead = pageConfig.getPageParameterExtractor().getPreviousFilter(httpResponse, RestAdapter.this.pageConfig); } else if (pageConfig.getMetadataLocation().equals(PageConfig.MetadataLocations.BODY)) { nextRead = pageConfig.getPageParameterExtractor().getNextFilter(httpResponse, RestAdapter.this.pageConfig); previousRead = pageConfig.getPageParameterExtractor().getPreviousFilter(httpResponse, RestAdapter.this.pageConfig); } else { throw new IllegalStateException("Not supported"); } if (nextRead != null) { nextRead.setWhere(where); } if (previousRead != null) { previousRead.setWhere(where); } return new WrappingPagedList<T>(requestingPipe, result, nextRead, previousRead); }
[ "This method checks for paging information and returns the appropriate\ndata\n\n@param result\n@param httpResponse\n@param where\n@return a {@link WrappingPagedList} if there is paging, result if not." ]
[ "Build copyright map once.", "Extract note text.\n\n@param row task data\n@return note text", "Enable a host\n\n@param hostName\n@throws Exception", "Log the values for the provided template.\n\n@param templateName the name of the template the values came from\n@param template the template object\n@param valu...
protected Tree determineNonTrivialHead(Tree t, Tree parent) { Tree theHead = null; String motherCat = tlp.basicCategory(t.label().value()); if (DEBUG) { System.err.println("Looking for head of " + t.label() + "; value is |" + t.label().value() + "|, " + " baseCat is |" + motherCat + '|'); } // We know we have nonterminals underneath // (a bit of a Penn Treebank assumption, but). // Look at label. // a total special case.... // first look for POS tag at end // this appears to be redundant in the Collins case since the rule already would do that // Tree lastDtr = t.lastChild(); // if (tlp.basicCategory(lastDtr.label().value()).equals("POS")) { // theHead = lastDtr; // } else { String[][] how = nonTerminalInfo.get(motherCat); if (how == null) { if (DEBUG) { System.err.println("Warning: No rule found for " + motherCat + " (first char: " + motherCat.charAt(0) + ')'); System.err.println("Known nonterms are: " + nonTerminalInfo.keySet()); } if (defaultRule != null) { if (DEBUG) { System.err.println(" Using defaultRule"); } return traverseLocate(t.children(), defaultRule, true); } else { return null; } } for (int i = 0; i < how.length; i++) { boolean lastResort = (i == how.length - 1); theHead = traverseLocate(t.children(), how[i], lastResort); if (theHead != null) { break; } } if (DEBUG) { System.err.println(" Chose " + theHead.label()); } return theHead; }
[ "Called by determineHead and may be overridden in subclasses\nif special treatment is necessary for particular categories." ]
[ "Ping route Ping the ESI routers\n\n@return ApiResponse&lt;String&gt;\n@throws ApiException\nIf fail to call the API, e.g. server error or cannot\ndeserialize the response body", "Decompiles the given .class file and creates the specified output source file.\n\n@param classFilePath the .class file to be decompile...