query
stringlengths
74
6.1k
positive
listlengths
1
1
negative
listlengths
9
9
public String translatePath(String path) { String translated; // special character: ~ maps to the user's home directory if (path.startsWith("~" + File.separator)) { translated = System.getProperty("user.home") + path.substring(1); } else if (path.startsWith("~")) { String userName = path.substring(1); translated = new File(new File(System.getProperty("user.home")).getParent(), userName).getAbsolutePath(); // Keep the path separator in translated or add one if no user home specified translated = userName.isEmpty() || path.endsWith(File.separator) ? translated + File.separator : translated; } else if (!new File(path).isAbsolute()) { translated = ctx.getCurrentDir().getAbsolutePath() + File.separator + path; } else { translated = path; } return translated; }
[ "Translate a path that has previously been unescaped and unquoted.\nThat is called at command execution when the calue is retrieved prior to be\nused as ModelNode value.\n@param path The unquoted, unescaped path.\n@return A path with ~ and default dir expanded." ]
[ "Add an additional binary type", "Returns a new color that has the hue adjusted by the specified\namount.", "Helper method to split a string by a given character, with empty parts omitted.", "Use this API to enable clusterinstance resources of given names.", "Sets the number of views for this Photo. For un-...
protected void eciProcess() { EciMode eci = EciMode.of(content, "ISO8859_1", 3) .or(content, "ISO8859_2", 4) .or(content, "ISO8859_3", 5) .or(content, "ISO8859_4", 6) .or(content, "ISO8859_5", 7) .or(content, "ISO8859_6", 8) .or(content, "ISO8859_7", 9) .or(content, "ISO8859_8", 10) .or(content, "ISO8859_9", 11) .or(content, "ISO8859_10", 12) .or(content, "ISO8859_11", 13) .or(content, "ISO8859_13", 15) .or(content, "ISO8859_14", 16) .or(content, "ISO8859_15", 17) .or(content, "ISO8859_16", 18) .or(content, "Windows_1250", 21) .or(content, "Windows_1251", 22) .or(content, "Windows_1252", 23) .or(content, "Windows_1256", 24) .or(content, "SJIS", 20) .or(content, "UTF8", 26); if (EciMode.NONE.equals(eci)) { throw new OkapiException("Unable to determine ECI mode."); } eciMode = eci.mode; inputData = toBytes(content, eci.charset); encodeInfo += "ECI Mode: " + eci.mode + "\n"; encodeInfo += "ECI Charset: " + eci.charset.name() + "\n"; }
[ "Chooses the ECI mode most suitable for the content of this symbol." ]
[ "Use this API to unset the properties of gslbservice resources.\nProperties that need to be unset are specified in args array.", "Returns the rendered element content for all the given containers.\n\n@param element the element to render\n@param containers the containers the element appears in\n\n@return a map fro...
private void countPropertyMain(UsageStatistics usageStatistics, PropertyIdValue property, int count) { addPropertyCounters(usageStatistics, property); usageStatistics.propertyCountsMain.put(property, usageStatistics.propertyCountsMain.get(property) + count); }
[ "Counts additional occurrences of a property as the main property of\nstatements.\n\n@param usageStatistics\nstatistics object where count is stored\n@param property\nthe property to count\n@param count\nthe number of times to count the property" ]
[ "Log a warning for the given operation at the provided address for the given attributes, using the provided detail\nmessage.\n\n@param address where warning occurred\n@param operation where which problem occurred\n@param message custom error message to append\n@param attributes attributes we that have proble...
static Resource getOrCreateSubDeployment(final String deploymentName, final DeploymentUnit parent) { final Resource root = parent.getAttachment(DEPLOYMENT_RESOURCE); return getOrCreate(root, PathElement.pathElement(SUBDEPLOYMENT, deploymentName)); }
[ "Gets or creates the a resource for the sub-deployment on the parent deployments resource.\n\n@param deploymentName the name of the deployment\n@param parent the parent deployment used to find the parent resource\n\n@return the already registered resource or a newly created resource" ]
[ "Creates a new capsule\n\n@param mode the capsule mode, or {@code null} for the default mode\n@param wrappedJar a path to a capsule JAR that will be launched (wrapped) by the empty capsule in {@code jarFile}\nor {@code null} if no wrapped capsule is wanted\n@return the capsule.", "Tells you if an expression...
private ServerSetup[] createServerSetup() { List<ServerSetup> setups = new ArrayList<>(); if (smtpProtocol) { smtpServerSetup = createTestServerSetup(ServerSetup.SMTP); setups.add(smtpServerSetup); } if (smtpsProtocol) { smtpsServerSetup = createTestServerSetup(ServerSetup.SMTPS); setups.add(smtpsServerSetup); } if (pop3Protocol) { setups.add(createTestServerSetup(ServerSetup.POP3)); } if (pop3sProtocol) { setups.add(createTestServerSetup(ServerSetup.POP3S)); } if (imapProtocol) { setups.add(createTestServerSetup(ServerSetup.IMAP)); } if (imapsProtocol) { setups.add(createTestServerSetup(ServerSetup.IMAPS)); } return setups.toArray(new ServerSetup[setups.size()]); }
[ "Creates the server setup, depending on the protocol flags.\n\n@return the configured server setups." ]
[ "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", "Get the Avro Schema of the input path, assuming the path contains just one\nschema version in all files under that path.", ...
public static Class<?> loadClass(String className, ClassLoader cl) { try { return Class.forName(className, false, cl); } catch(ClassNotFoundException e) { throw new IllegalArgumentException(e); } }
[ "Load the given class using a specific class loader.\n\n@param className The name of the class\n@param cl The Class Loader to be used for finding the class.\n@return The class object" ]
[ "Checks that all the qualifiers in the set requiredQualifiers are in the set of qualifiers. Qualifier equality rules for\nannotation members are followed.\n\n@param requiredQualifiers The required qualifiers\n@param qualifiers The set of qualifiers to check\n@return True if all matches, false otherwise", "Adds a ...
public static String getParameter(DbConn cnx, String key, String defaultValue) { try { return cnx.runSelectSingle("globalprm_select_by_key", 3, String.class, key); } catch (NoResultException e) { return defaultValue; } }
[ "Retrieve the value of a single-valued parameter.\n\n@param key\n@param defaultValue\n@param cnx" ]
[ "Handles Multi Instance Report message. Handles Report on\nthe number of instances for the command class.\n@param serialMessage the serial message to process.\n@param offset the offset at which to start procesing.", "Read project data from a database.\n\n@return ProjectFile instance\n@throws MPXJException", "Sp...
@Override public String upload(byte[] data, UploadMetaData metaData) throws FlickrException { Payload payload = new Payload(data); return sendUploadRequest(metaData, payload); }
[ "Upload a photo from a byte-array.\n\n@param data\nThe photo data as a byte array\n@param metaData\nThe meta data\n@return photoId or ticketId\n@throws FlickrException" ]
[ "Execute a slave process. Pump events to the given event bus.", "Compress a directory into a zip file\n\n@param dir Directory\n@param zipFile ZIP file to create\n@throws IOException I/O Error", "Microsoft Project bases the order of tasks displayed on their ID\nvalue. This method takes the hierarchical structure...
@Override public boolean postBuild(MavenBuildProxy build, MavenProject pom, BuildListener listener) throws InterruptedException, IOException { build.executeAsync(new BuildCallable<Void, IOException>() { // record is transient, so needs to make a copy first private final Set<MavenDependency> d = dependencies; public Void call(MavenBuild build) throws IOException, InterruptedException { // add the action //TODO: [by yl] These actions are persisted into the build.xml of each build run - we need another //context to store these actions build.getActions().add(new MavenDependenciesRecord(build, d)); return null; } }); return true; }
[ "Sends the collected dependencies over to the master and record them." ]
[ "If the status of a print job is not checked for a while, we assume that the user is no longer\ninterested in the report, and we cancel the job.\n\n@param printJob\n@return is the abandoned timeout exceeded?", "Adds a data source to the configuration. If in deduplication mode\ngroupno == 0, otherwise it gives the...
public boolean isWorkingDate(Date date) { Calendar cal = DateHelper.popCalendar(date); Day day = Day.getInstance(cal.get(Calendar.DAY_OF_WEEK)); DateHelper.pushCalendar(cal); return isWorkingDate(date, day); }
[ "This method allows the caller to determine if a given date is a\nworking day. This method takes account of calendar exceptions.\n\n@param date Date to be tested\n@return boolean value" ]
[ "Returns all the deployment runtime names associated with an overlay accross all server groups.\n\n@param context the current OperationContext.\n@param overlay the name of the overlay.\n@return all the deployment runtime names associated with an overlay accross all server groups.", "Returns the JMX connector addr...
public List<GetLocationResult> search(String q, int maxRows, Locale locale) throws Exception { List<GetLocationResult> searchResult = new ArrayList<GetLocationResult>(); String url = URLEncoder.encode(q, "UTF8"); url = "q=select%20*%20from%20geo.placefinder%20where%20text%3D%22" + url + "%22"; if (maxRows > 0) { url = url + "&count=" + maxRows; } url = url + "&flags=GX"; if (null != locale) { url = url + "&locale=" + locale; } if (appId != null) { url = url + "&appid=" + appId; } InputStream inputStream = connect(url); if (null != inputStream) { SAXBuilder parser = new SAXBuilder(); Document doc = parser.build(inputStream); Element root = doc.getRootElement(); // check code for exception String message = root.getChildText("Error"); // Integer errorCode = Integer.parseInt(message); if (message != null && Integer.parseInt(message) != 0) { throw new Exception(root.getChildText("ErrorMessage")); } Element results = root.getChild("results"); for (Object obj : results.getChildren("Result")) { Element toponymElement = (Element) obj; GetLocationResult location = getLocationFromElement(toponymElement); searchResult.add(location); } } return searchResult; }
[ "Call the Yahoo! PlaceFinder service for a result.\n\n@param q\nsearch string\n@param maxRows\nmax number of rows in result, or 0 for all\n@param locale\nlocale for strings\n@return list of found results\n@throws Exception\noops\n@see <a\nhref=\"http://developer.yahoo.com/boss/geo/docs/free_YQL.html#table_pf\">Yaho...
[ "Release transaction that was acquired in a thread with specified permits.", "Remove all existing subscriptions", "host.xml", "checks if the triangle is not re-entrant", "Checks whether the compilation has been canceled and reports the given work increment to the compiler progress.", "Rethrows OperationCa...
public static DMatrixRMaj diagonal(int numRows , int numCols , double min , double max , Random rand ) { if( max < min ) throw new IllegalArgumentException("The max must be >= the min"); DMatrixRMaj ret = new DMatrixRMaj(numRows,numCols); int N = Math.min(numRows,numCols); double r = max-min; for( int i = 0; i < N; i++ ) { ret.set(i,i, rand.nextDouble()*r+min); } return ret; }
[ "Creates a random matrix where all elements are zero but diagonal elements. Diagonal elements\nrandomly drawn from a uniform distribution from min to max, inclusive.\n\n@param numRows Number of rows in the returned matrix..\n@param numCols Number of columns in the returned matrix.\n@param min Minimum value of a di...
[ "Returns the command to run by the shell to normally run the checkin script.\n@return the command to run by the shell to normally run the checkin script.", "Get the element at the index as a float.\n\n@param i the index of the element to access", "Set the view frustum to pick against from the minimum and maximu...
private List<TaskField> getAllTaskExtendedAttributes() { ArrayList<TaskField> result = new ArrayList<TaskField>(); result.addAll(Arrays.asList(TaskFieldLists.CUSTOM_TEXT)); result.addAll(Arrays.asList(TaskFieldLists.CUSTOM_START)); result.addAll(Arrays.asList(TaskFieldLists.CUSTOM_FINISH)); result.addAll(Arrays.asList(TaskFieldLists.CUSTOM_COST)); result.addAll(Arrays.asList(TaskFieldLists.CUSTOM_DATE)); result.addAll(Arrays.asList(TaskFieldLists.CUSTOM_FLAG)); result.addAll(Arrays.asList(TaskFieldLists.CUSTOM_NUMBER)); result.addAll(Arrays.asList(TaskFieldLists.CUSTOM_DURATION)); result.addAll(Arrays.asList(TaskFieldLists.CUSTOM_OUTLINE_CODE)); result.addAll(Arrays.asList(TaskFieldLists.ENTERPRISE_COST)); result.addAll(Arrays.asList(TaskFieldLists.ENTERPRISE_DATE)); result.addAll(Arrays.asList(TaskFieldLists.ENTERPRISE_DURATION)); result.addAll(Arrays.asList(TaskFieldLists.ENTERPRISE_FLAG)); result.addAll(Arrays.asList(TaskFieldLists.ENTERPRISE_NUMBER)); result.addAll(Arrays.asList(TaskFieldLists.ENTERPRISE_TEXT)); return result; }
[ "Retrieve list of task extended attributes.\n\n@return list of extended attributes" ]
[ "Log an audit record of this operation.", "Checks that index is valid an throw an exception if not.\n\n@param type the type\n@param index the index to check", "SetLoop will either set the GVRNodeAnimation's Repeat Mode to REPEATED if loop is true.\nor it will set the GVRNodeAnimation's Repeat Mode to ONCE if lo...
public void setEditedFilePath(final String editedFilePath) { m_filePathField.setReadOnly(false); m_filePathField.setValue(editedFilePath); m_filePathField.setReadOnly(true); }
[ "Sets the path of the edited file in the corresponding display.\n@param editedFilePath path of the edited file to set." ]
[ "Update the descriptor content with values from the editor.\n@throws CmsXmlException thrown if update fails due to a wrong XML structure (should never happen)", "Use this API to fetch a appfwglobal_auditsyslogpolicy_binding resources.", "Add tables to the tree.\n\n@param parentNode parent tree node\n@param file...
public static synchronized Class< ? > locate(final String serviceName) { if ( serviceName == null ) { throw new IllegalArgumentException( "serviceName cannot be null" ); } if ( factories != null ) { List<Callable<Class< ? >>> l = factories.get( serviceName ); if ( l != null && !l.isEmpty() ) { Callable<Class< ? >> c = l.get( l.size() - 1 ); try { return c.call(); } catch ( Exception e ) { } } } return null; }
[ "Finds the preferred provider for the given service. The preferred\nprovider is the last one added to the set of providers.\n\n@param serviceName\nThe fully qualified name of the service interface.\n@return\nThe last provider added for the service if any exists.\nOtherwise, it returns <tt>null</tt>.\n@throws Illega...
[ "Add the given person to the photo. Optionally, send in co-ordinates\n\n@param photoId\n@param userId\n@param bounds\n@throws FlickrException", "Returns the list of module dependencies regarding the provided filters\n\n@param moduleId String\n@param filters FiltersHolder\n@return List<Dependency>", "Returns the...
public static gslbldnsentries[] get(nitro_service service) throws Exception{ gslbldnsentries obj = new gslbldnsentries(); gslbldnsentries[] response = (gslbldnsentries[])obj.get_resources(service); return response; }
[ "Use this API to fetch all the gslbldnsentries resources that are configured on netscaler." ]
[ "Formats a double value.\n\n@param number numeric value\n@return Double instance", "Writes the results of the processing to a CSV file.", "Used to load a classifier stored as a resource inside a jar file. THIS\nFUNCTION WILL ONLY WORK IF THE CODE WAS LOADED FROM A JAR FILE WHICH HAS A\nSERIALIZED CLASSIFIER STO...
protected List<I_CmsSearchConfigurationSortOption> getSortOptions() { List<I_CmsSearchConfigurationSortOption> options = new LinkedList<I_CmsSearchConfigurationSortOption>(); try { JSONArray sortOptions = m_configObject.getJSONArray(JSON_KEY_SORTOPTIONS); for (int i = 0; i < sortOptions.length(); i++) { I_CmsSearchConfigurationSortOption option = parseSortOption(sortOptions.getJSONObject(i)); if (option != null) { options.add(option); } } } catch (JSONException e) { if (null == m_baseConfig) { if (LOG.isInfoEnabled()) { LOG.info(Messages.get().getBundle().key(Messages.LOG_NO_SORT_CONFIG_0), e); } } else { options = m_baseConfig.getSortConfig().getSortOptions(); } } return options; }
[ "Returns the list of the configured sort options, or the empty list if no sort options are configured.\n@return The list of the configured sort options, or the empty list if no sort options are configured." ]
[ "Unlocks a file.", "Sets top and bottom padding for all cells in the row.\n@param padding new padding for top and bottom, ignored if smaller than 0\n@return this to allow chaining", "Set the individual dates.\n@param dates the dates to set.", "Returns all the dependencies taken into account the artifact of th...
private CmsSpellcheckingRequest parseJsonRequest(JSONObject jsonRequest) { final String id = jsonRequest.optString(JSON_ID); final JSONObject params = jsonRequest.optJSONObject(JSON_PARAMS); if (null == params) { LOG.debug("Invalid JSON request: No field \"params\" defined. "); return null; } final JSONArray words = params.optJSONArray(JSON_WORDS); final String lang = params.optString(JSON_LANG, LANG_DEFAULT); if (null == words) { LOG.debug("Invalid JSON request: No field \"words\" defined. "); return null; } // Convert JSON array to array of type String final List<String> wordsToCheck = new LinkedList<String>(); for (int i = 0; i < words.length(); i++) { final String word = words.opt(i).toString(); wordsToCheck.add(word); if (Character.isUpperCase(word.codePointAt(0))) { wordsToCheck.add(word.toLowerCase()); } } return new CmsSpellcheckingRequest(wordsToCheck.toArray(new String[wordsToCheck.size()]), lang, id); }
[ "Parse JSON parameters from this request.\n\n@param jsonRequest The request in the JSON format.\n@return CmsSpellcheckingRequest object that contains parsed parameters or null, if JSON input is not well\ndefined." ]
[ "Parse request parameters and files.\n@param request\n@param response", "Gets axis dimension\n@param axis Axis. It might be either {@link Layout.Axis#X X} or\n{@link Layout.Axis#Y Y} or {@link Layout.Axis#Z Z}\n@return axis dimension", "Sets the SCXML model with an InputStream\n\n@param inputFileStream the mode...
public synchronized int put(byte[] src, int off, int len) { if (available == capacity) { return 0; } // limit is last index to put + 1 int limit = idxPut < idxGet ? idxGet : capacity; int count = Math.min(limit - idxPut, len); System.arraycopy(src, off, buffer, idxPut, count); idxPut += count; if (idxPut == capacity) { // Array end reached, check if we have more int count2 = Math.min(len - count, idxGet); if (count2 > 0) { System.arraycopy(src, off + count, buffer, 0, count2); idxPut = count2; count += count2; } else { idxPut = 0; } } available += count; return count; }
[ "Puts as many of the given bytes as possible into this buffer.\n\n@return number of bytes actually put into this buffer (0 if the buffer is full)" ]
[ "Use this API to unset the properties of Interface resource.\nProperties that need to be unset are specified in args array.", "Starts all streams.", "Determines the number of elements that the query would return. Override this\nmethod if the size shall be determined in a specific way.\n\n@return The number of e...
public void scale(double v){ for(int i = 0; i < this.size(); i++){ this.get(i).scale(v);; } }
[ "Multiplies all positions with a factor v\n@param v Multiplication factor" ]
[ "Returns an identity matrix", "Encodes the given source into an encoded String using the rules specified\nby the given component and with the given options.\n@param source the source string\n@param encoding the encoding of the source string\n@param type the URI component for the source\n@return the encoded URI\n@...
public boolean getWorkModified(List<TimephasedWork> list) { boolean result = false; for (TimephasedWork assignment : list) { result = assignment.getModified(); if (result) { break; } } return result; }
[ "Test the list of TimephasedWork instances to see\nif any of them have been modified.\n\n@param list list of TimephasedWork instances\n@return boolean flag" ]
[ "Append the bounding volume particle positions, times and velocities to the existing mesh\nbefore creating a new scene object with this mesh attached to it.\nAlso, append every created scene object and its creation time to corresponding array lists.\n\n@param particlePositions\n@param particleVelocities\n@param par...
public ResourceTransformerEntry resolveResourceTransformer(final PathAddress address, final PlaceholderResolver placeholderResolver) { return resolveResourceTransformer(address.iterator(), null, placeholderResolver); }
[ "Resolve a resource transformer for a given address.\n\n@param address the address\n@param placeholderResolver a placeholder resolver used to resolve children of a placeholder registration\n@return the resource transformer" ]
[ "Makes a CRFDatum by producing features and a label from input data at a\nspecific position, using the provided factory.\n\n@param info\nThe input data\n@param loc\nThe position to build a datum at\n@param featureFactory\nThe FeatureFactory to use to extract features\n@return The constructed CRFDatum", "Log a war...
@Override public EditMode editMode() { if(readInputrc) { try { return EditModeBuilder.builder().parseInputrc(new FileInputStream(inputrc())).create(); } catch(FileNotFoundException e) { return EditModeBuilder.builder(mode()).create(); } } else return EditModeBuilder.builder(mode()).create(); }
[ "Get EditMode based on os and mode\n\n@return edit mode" ]
[ "Return the numeric distance value in degrees.\n\n@return the degrees", "Handle interval change.\n@param event the change event.", "Set the value of one or more fields based on the contents of a database row.\n\n@param map column to field map\n@param row database row\n@param container field container", "Try t...
public List<Dependency> getModuleDependencies(final String moduleName, final String moduleVersion, final Boolean fullRecursive, final Boolean corporate, final Boolean thirdParty) throws GrapesCommunicationException { final Client client = getClient(); final WebResource resource = client.resource(serverURL).path(RequestUtils.getArtifactDependencies(moduleName, moduleVersion)); final ClientResponse response = resource.queryParam(ServerAPI.SCOPE_COMPILE_PARAM, "true") .queryParam(ServerAPI.SCOPE_PROVIDED_PARAM, "true") .queryParam(ServerAPI.SCOPE_RUNTIME_PARAM, "true") .queryParam(ServerAPI.SCOPE_TEST_PARAM, "true") .queryParam(ServerAPI.RECURSIVE_PARAM, fullRecursive.toString()) .queryParam(ServerAPI.SHOW_CORPORATE_PARAM, corporate.toString()) .queryParam(ServerAPI.SHOW_THIRPARTY_PARAM, thirdParty.toString()) .accept(MediaType.APPLICATION_JSON).get(ClientResponse.class); client.destroy(); if(ClientResponse.Status.OK.getStatusCode() != response.getStatus()){ final String message = String.format(FAILED_TO_GET_MODULE, "get module ancestors ", moduleName, moduleVersion); if(LOG.isErrorEnabled()) { LOG.error(String.format(HTTP_STATUS_TEMPLATE_MSG, message, response.getStatus())); } throw new GrapesCommunicationException(message, response.getStatus()); } return response.getEntity(new GenericType<List<Dependency>>(){}); }
[ "Return the list of module dependencies\n\n@param moduleName\n@param moduleVersion\n@param fullRecursive\n@param corporate\n@param thirdParty\n@return List<Dependency>\n@throws GrapesCommunicationException" ]
[ "Calculate the duration percent complete.\n\n@param row task data\n@return percent complete", "Returns all the retention policies.\n@param api the API connection to be used by the resource.\n@param fields the fields to retrieve.\n@return an iterable with all the retention policies.", "Returns the rank of the de...
@Override public boolean isPrefixBlock() { Integer networkPrefixLength = getNetworkPrefixLength(); if(networkPrefixLength == null) { return false; } if(getNetwork().getPrefixConfiguration().allPrefixedAddressesAreSubnets()) { return true; } return containsPrefixBlock(networkPrefixLength); }
[ "Returns whether this address section represents a subnet block of addresses associated its prefix length.\n\nReturns false if it has no prefix length, if it is a single address with a prefix length (ie not a subnet), or if it is a range of addresses that does not include\nthe entire subnet block for its prefix len...
[ "Converts Observable of list to Observable of Inner.\n@param innerList list to be converted.\n@param <InnerT> type of inner.\n@return Observable for list of inner.", "Adds a new role to the list of defined roles.\n\n@param roleName - The name of the role being added.", "Returns all categories that are direct ch...
public static void cleanIneligibleKeys(Map<ByteArray, Map<Value, Set<ClusterNode>>> keyVersionNodeSetMap, int requiredWrite) { Set<ByteArray> keysToDelete = new HashSet<ByteArray>(); for (Map.Entry<ByteArray, Map<Value, Set<ClusterNode>>> entry : keyVersionNodeSetMap.entrySet()) { Set<Value> valuesToDelete = new HashSet<Value>(); ByteArray key = entry.getKey(); Map<Value, Set<ClusterNode>> valueNodeSetMap = entry.getValue(); // mark version for deletion if not enough writes for (Map.Entry<Value, Set<ClusterNode>> versionNodeSetEntry : valueNodeSetMap.entrySet()) { Set<ClusterNode> nodeSet = versionNodeSetEntry.getValue(); if (nodeSet.size() < requiredWrite) { valuesToDelete.add(versionNodeSetEntry.getKey()); } } // delete versions for (Value v : valuesToDelete) { valueNodeSetMap.remove(v); } // mark key for deletion if no versions left if (valueNodeSetMap.size() == 0) { keysToDelete.add(key); } } // delete keys for (ByteArray k : keysToDelete) { keyVersionNodeSetMap.remove(k); } }
[ "Determine if a key version is invalid by comparing the version's\nexistence and required writes configuration\n\n@param keyVersionNodeSetMap A map that contains keys mapping to a map\nthat maps versions to set of PrefixNodes\n@param requiredWrite Required Write configuration" ]
[ "Gets the file from which boot operations should be parsed.\n@return the file. Will not be {@code null}", "Tells you if the expression is a null safe dereference.\n@param expression\nexpression\n@return\ntrue if is null safe dereference.", "Checks if class package match provided list of action packages\n\n@par...
@GwtIncompatible("Class.getDeclaredFields") public ToStringBuilder addDeclaredFields() { Field[] fields = instance.getClass().getDeclaredFields(); for(Field field : fields) { addField(field); } return this; }
[ "Adds all fields declared directly in the object's class to the output\n@return this" ]
[ "Parses a single query facet item with query and label.\n@param prefix path to the query facet item (with trailing '/').\n@return the query facet item.", "Picks out a File from `thriftFiles` corresponding to a given artifact ID\nand file name. Returns null if `artifactId` and `fileName` do not map to a\nthrift fi...
public static Node addPartitionsToNode(final Node node, final Set<Integer> donatedPartitions) { List<Integer> deepCopy = new ArrayList<Integer>(node.getPartitionIds()); deepCopy.addAll(donatedPartitions); Collections.sort(deepCopy); return updateNode(node, deepCopy); }
[ "Add the set of partitions to the node provided\n\n@param node The node to which we'll add the partitions\n@param donatedPartitions The list of partitions to add\n@return The new node with the new partitions" ]
[ "Retrieve a Double from an input stream.\n\n@param is input stream\n@return Double instance", "Creates a color item that represents a color field found for a track based on a dbserver message.\n\n@param menuItem the rendered menu item containing the color metadata field\n\n@return the color metadata field", "Co...
public int getPrivacy() throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_GET_PRIVACY); Response response = transportAPI.get(transportAPI.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } Element personElement = response.getPayload(); return Integer.parseInt(personElement.getAttribute("privacy")); }
[ "Returns the default privacy level preference for the user.\n\n@see com.flickr4java.flickr.Flickr#PRIVACY_LEVEL_NO_FILTER\n@see com.flickr4java.flickr.Flickr#PRIVACY_LEVEL_PUBLIC\n@see com.flickr4java.flickr.Flickr#PRIVACY_LEVEL_FRIENDS\n@see com.flickr4java.flickr.Flickr#PRIVACY_LEVEL_FRIENDS_FAMILY\n@see com.flic...
[ "Returns the probability that the records v1 and v2 came from\nrepresent the same entity, based on high and low probability\nsettings etc.", "Sets the left padding character for all cells in the row.\n@param paddingLeftChar new padding character, ignored if null\n@return this to allow chaining", "Use this API t...
public static filterpolicy_csvserver_binding[] get(nitro_service service, String name) throws Exception{ filterpolicy_csvserver_binding obj = new filterpolicy_csvserver_binding(); obj.set_name(name); filterpolicy_csvserver_binding response[] = (filterpolicy_csvserver_binding[]) obj.get_resources(service); return response; }
[ "Use this API to fetch filterpolicy_csvserver_binding resources of given name ." ]
[ "Arbitrarily resolve the inconsistency by choosing the first object if\nthere is one.\n\n@param values The list of objects\n@return A single value, if one exists, taken from the input list.", "open a readable or writeable FileChannel\n\n@param file file object\n@param mutable writeable\n@return open the FileCh...
public Module getModule(final String name, final String version) throws GrapesCommunicationException { final Client client = getClient(); final WebResource resource = client.resource(serverURL).path(RequestUtils.getModulePath(name, version)); final ClientResponse response = resource.accept(MediaType.APPLICATION_JSON).get(ClientResponse.class); client.destroy(); if(ClientResponse.Status.OK.getStatusCode() != response.getStatus()){ final String message = String.format(FAILED_TO_GET_MODULE, "get module details", name, version); if(LOG.isErrorEnabled()) { LOG.error(String.format(HTTP_STATUS_TEMPLATE_MSG, message, response.getStatus())); } throw new GrapesCommunicationException(message, response.getStatus()); } return response.getEntity(Module.class); }
[ "Send a get module request\n\n@param name\n@param version\n@return the targeted module\n@throws GrapesCommunicationException" ]
[ "Create users for the given array of addresses. The passwords will be set to the email addresses.\n\n@param greenMail Greenmail instance to create users for\n@param addresses Addresses", "Use this API to fetch statistics of scpolicy_stats resource of given name .", "Use this API to fetch dnsview resources of gi...
public static String escapeDoubleQuotesForJson(String text) { if ( text == null ) { return null; } StringBuilder builder = new StringBuilder( text.length() ); for ( int i = 0; i < text.length(); i++ ) { char c = text.charAt( i ); switch ( c ) { case '"': case '\\': builder.append( "\\" ); default: builder.append( c ); } } return builder.toString(); }
[ "If a text contains double quotes, escape them.\n\n@param text the text to escape\n@return Escaped text or {@code null} if the text is null" ]
[ "Sets the upper limits for the \"moving\" body translation relative to joint point.\n\n@param limitX the X upper lower translation limit\n@param limitY the Y upper lower translation limit\n@param limitZ the Z upper lower translation limit", "Release the rebalancing permit for a particular node id\n\n@param nodeId...
public void cleanup() { managers.clear(); for (BeanManagerImpl beanManager : beanDeploymentArchives.values()) { beanManager.cleanup(); } beanDeploymentArchives.clear(); deploymentServices.cleanup(); deploymentManager.cleanup(); instance.clear(contextId); }
[ "Cause the container to be cleaned up, including all registered bean\nmanagers, and all deployment services" ]
[ "Function to perform forward softmax", "Checks the preconditions for creating a new Truncate processor.\n\n@param maxSize\nthe maximum size of the String\n@param suffix\nthe String to append if the input is truncated (e.g. \"...\")\n@throws IllegalArgumentException\nif {@code maxSize <= 0}\n@throws NullPointerExc...
protected void processStop(Endpoint endpoint, EventTypeEnum eventType) { if (!sendLifecycleEvent) { return; } Event event = createEvent(endpoint, eventType); monitoringServiceClient.putEvents(Collections.singletonList(event)); if (LOG.isLoggable(Level.INFO)) { LOG.info("Send " + eventType + " event to SAM Server successful!"); } }
[ "Process stop.\n\n@param endpoint the endpoint\n@param eventType the event type" ]
[ "Create the function. Be sure to handle all possible input types and combinations correctly and provide\nmeaningful error messages. The output matrix should be resized to fit the inputs.", "Delete all backups asynchronously", "Removes all children", "END ODO CHANGES", "Gets the global and adds it ot the B...
public InsertIntoTable set(String name, Object value) { builder.set(name, value); return this; }
[ "Set the given column name to the given value.\n\n@param name The column name to set.\n@param value the value to set.\n@return {@code this}\n@throws IllegalArgumentException if a column name does not exist in the table." ]
[ "Checks that the modified features exist.\n\n@param classDef The class descriptor\n@param checkLevel The current check level (this constraint is checked in basic and strict)\n@exception ConstraintException If the constraint has been violated", "Find Flickr Places information by Place URL.\n\n<p>\nThis method do...
public Photo getInfo(String photoId, String secret) throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_GET_INFO); parameters.put("photo_id", photoId); if (secret != null) { parameters.put("secret", secret); } Response response = transport.get(transport.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } Element photoElement = response.getPayload(); return PhotoUtils.createPhoto(photoElement); }
[ "Get all info for the specified photo.\n\nThe calling user must have permission to view the photo.\n\nThis method does not require authentication.\n\n@param photoId\nThe photo Id\n@param secret\nThe optional secret String\n@return The Photo\n@throws FlickrException" ]
[ "Create an element that represents a horizntal or vertical line.\n@param x1\n@param y1\n@param x2\n@param y2\n@return the created DOM element", "Process an MPP file to make it anonymous.\n\n@param input input file name\n@param output output file name\n@throws Exception", "This method is called to alert project ...
public static <T> void setBeanInstance(String contextId, T proxy, BeanInstance beanInstance, Bean<?> bean) { if (proxy instanceof ProxyObject) { ProxyObject proxyView = (ProxyObject) proxy; proxyView.weld_setHandler(new ProxyMethodHandler(contextId, beanInstance, bean)); } }
[ "Convenience method to set the underlying bean instance for a proxy.\n\n@param proxy the proxy instance\n@param beanInstance the instance of the bean" ]
[ "Calculates all dates of the series.\n@return all dates of the series in milliseconds.", "Use this API to fetch all the auditmessages resources that are configured on netscaler.", "Join the Collection of Strings using the specified delimiter.\n\n@param s\nThe String collection\n@param delimiter\nThe delimiter S...
public static List<Versioned<byte[]>> pruneNonReplicaEntries(List<Versioned<byte[]>> vals, List<Integer> keyReplicas, MutableBoolean didPrune) { List<Versioned<byte[]>> prunedVals = new ArrayList<Versioned<byte[]>>(vals.size()); for(Versioned<byte[]> val: vals) { VectorClock clock = (VectorClock) val.getVersion(); List<ClockEntry> clockEntries = new ArrayList<ClockEntry>(); for(ClockEntry clockEntry: clock.getEntries()) { if(keyReplicas.contains((int) clockEntry.getNodeId())) { clockEntries.add(clockEntry); } else { didPrune.setValue(true); } } prunedVals.add(new Versioned<byte[]>(val.getValue(), new VectorClock(clockEntries, clock.getTimestamp()))); } return prunedVals; }
[ "Remove all non replica clock entries from the list of versioned values\nprovided\n\n@param vals list of versioned values to prune replicas from\n@param keyReplicas list of current replicas for the given key\n@param didPrune flag to mark if we did actually prune something\n@return pruned list" ]
[ "Extracts the service name from a Server.\n@param server\n@return", "Return fallback if first string is null or empty", "Returns the context the view is running in, through which it can\naccess the current theme, resources, etc.\n\n@return The view's Context.", "Use this API to create sslfipskey.", "Obtains...
protected boolean isMultimedia(File file) { //noinspection SimplifiableIfStatement if (isDir(file)) { return false; } String path = file.getPath().toLowerCase(); for (String ext : MULTIMEDIA_EXTENSIONS) { if (path.endsWith(ext)) { return true; } } return false; }
[ "An extremely simple method for identifying multimedia. This\ncould be improved, but it's good enough for this example.\n\n@param file which could be an image or a video\n@return true if the file can be previewed, false otherwise" ]
[ "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 the target label for each datum, meaning that for a particular document,\nthe number of labels will be windowSize-1 greater than the number of\ndatums.\n\n@par...
private void performScriptedStep() { double scale = computeBulgeScale(); if( steps > giveUpOnKnown ) { // give up on the script followScript = false; } else { // use previous singular value to step double s = values[x2]/scale; performImplicitSingleStep(scale,s*s,false); } }
[ "Shifts are performed based upon singular values computed previously. If it does not converge\nusing one of those singular values it uses a Wilkinson shift instead." ]
[ "Returns the single abstract method of a class node, if it is a SAM type, or null otherwise.\n@param type a type for which to search for a single abstract method\n@return the method node if type is a SAM type, null otherwise", "Init the licenses cache\n\n@param licenses", "Use this API to update cmpparameter.",...
private List<String> parseRssFeedForeCast(String feed) { String[] result = feed.split("<br />"); List<String> returnList = new ArrayList<String>(); String[] result2 = result[2].split("<BR />"); returnList.add(result2[3] + "\n"); returnList.add(result[3] + "\n"); returnList.add(result[4] + "\n"); returnList.add(result[5] + "\n"); returnList.add(result[6] + "\n"); return returnList; }
[ "Parser for forecast\n\n@param feed\n@return" ]
[ "Determine the consistency level of a key\n\n@param versionNodeSetMap A map that maps version to set of PrefixNodes\n@param replicationFactor Total replication factor for the set of clusters\n@return ConsistencyLevel Enum", "Map custom info.\n\n@param ciType the custom info type\n@return the map", "Use this API...
public void callFunction( final String name, final List<?> args, final @Nullable Long requestTimeout) { this.functionService.callFunction(name, args, requestTimeout); }
[ "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 the Stitch function.\n@param requestTimeout the number of milliseconds the client should wait for a response from the\nserver before failing with an error." ]
[ "Convert an MPXJ Duration instance into an integer duration in minutes\nready to be written to an MPX file.\n\n@param properties project properties, used for duration units conversion\n@param duration Duration instance\n@return integer duration in minutes", "Adds api doc roots from a link. The folder reffered by ...
protected int getRequestTypeFromString(String requestType) { if ("GET".equals(requestType)) { return REQUEST_TYPE_GET; } if ("POST".equals(requestType)) { return REQUEST_TYPE_POST; } if ("PUT".equals(requestType)) { return REQUEST_TYPE_PUT; } if ("DELETE".equals(requestType)) { return REQUEST_TYPE_DELETE; } return REQUEST_TYPE_ALL; }
[ "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" ]
[ "Checks the given collection descriptor.\n\n@param collDef The collection descriptor\n@param checkLevel The amount of checks to perform\n@exception ConstraintException If a constraint has been violated", "Reset a timer of the given string name for the given thread. If no such\ntimer exists yet, then it will be...
static String tokenize(PageMetadata<?, ?> pageMetadata) { try { Gson g = getGsonWithKeyAdapter(pageMetadata.pageRequestParameters); return new String(Base64.encodeBase64URLSafe(g.toJson(new PaginationToken (pageMetadata)).getBytes("UTF-8")), Charset.forName("UTF-8")); } catch (UnsupportedEncodingException e) { //all JVMs should support UTF-8 throw new RuntimeException(e); } }
[ "Generate an opaque pagination token from the supplied PageMetadata.\n\n@param pageMetadata page metadata of the page for which the token should be generated\n@return opaque pagination token" ]
[ "Sends a normal HTTP response containing the serialization information in\na XML format", "Checks the component type of the given array against the expected component type.\n\n@param array\nthe array to be checked. May not be <code>null</code>.\n@param expectedComponentType\nthe expected component type of the arr...
@Override @SuppressWarnings("unchecked") public ChronoZonedDateTime<DiscordianDate> zonedDateTime(TemporalAccessor temporal) { return (ChronoZonedDateTime<DiscordianDate>) super.zonedDateTime(temporal); }
[ "Obtains a Discordian zoned date-time from another date-time object.\n\n@param temporal the date-time object to convert, not null\n@return the Discordian zoned date-time, not null\n@throws DateTimeException if unable to create the date-time" ]
[ "Creates a metadata cache archive file of all tracks in the specified slot on the specified player. Any\nprevious contents of the specified file will be replaced.\n\n@param slot the slot in which the media to be cached can be found\n@param playlistId the id of playlist to be cached, or 0 of all tracks should be cac...
public static base_response unset(nitro_service client, nstimeout resource, String[] args) throws Exception{ nstimeout unsetresource = new nstimeout(); return unsetresource.unset_resource(client,args); }
[ "Use this API to unset the properties of nstimeout resource.\nProperties that need to be unset are specified in args array." ]
[ "Get the column name from the indirection table.\n@param mnAlias\n@param path", "Returns the artifact available versions\n\n@param gavc String\n@return List<String>", "Harvest any values that may have been returned during the execution\nof a procedure.\n\n@param proc the procedure descriptor that provides info ...
public final void draw() { AffineTransform transform = new AffineTransform(this.transform); transform.concatenate(getAlignmentTransform()); // draw the background box this.graphics2d.setTransform(transform); this.graphics2d.setColor(this.params.getBackgroundColor()); this.graphics2d.fillRect(0, 0, this.settings.getSize().width, this.settings.getSize().height); //draw the labels this.graphics2d.setColor(this.params.getFontColor()); drawLabels(transform, this.params.getOrientation(), this.params.getLabelRotation()); //sets the transformation for drawing the bar and do it final AffineTransform lineTransform = new AffineTransform(transform); setLineTranslate(lineTransform); if (this.params.getOrientation() == Orientation.VERTICAL_LABELS_LEFT || this.params.getOrientation() == Orientation.VERTICAL_LABELS_RIGHT) { final AffineTransform rotate = AffineTransform.getQuadrantRotateInstance(1); lineTransform.concatenate(rotate); } this.graphics2d.setTransform(lineTransform); this.graphics2d.setStroke(new BasicStroke(this.settings.getLineWidth())); this.graphics2d.setColor(this.params.getColor()); drawBar(); }
[ "Start the rendering of the scalebar." ]
[ "Obtain newline-delimited headers from response\n\n@param response HttpServletResponse to scan\n@return newline-delimited headers", "Retrieve a duration in the form required by Phoenix.\n\n@param duration Duration instance\n@return formatted duration", "Construct a Libor index for a given curve and schedule.\n\...
public boolean merge(AbstractTransition another) { if (!isCompatible(another)) { return false; } if (another.mId != null) { if (mId == null) { mId = another.mId; } else { StringBuilder sb = new StringBuilder(mId.length() + another.mId.length()); sb.append(mId); sb.append("_MERGED_"); sb.append(another.mId); mId = sb.toString(); } } mUpdateStateAfterUpdateProgress |= another.mUpdateStateAfterUpdateProgress; mSetupList.addAll(another.mSetupList); Collections.sort(mSetupList, new Comparator<S>() { @Override public int compare(S lhs, S rhs) { if (lhs instanceof AbstractTransitionBuilder && rhs instanceof AbstractTransitionBuilder) { AbstractTransitionBuilder left = (AbstractTransitionBuilder) lhs; AbstractTransitionBuilder right = (AbstractTransitionBuilder) rhs; float startLeft = left.mReverse ? left.mEnd : left.mStart; float startRight = right.mReverse ? right.mEnd : right.mStart; return (int) ((startRight - startLeft) * 1000); } return 0; } }); return true; }
[ "Merge another AbstractTransition's states into this object, such that the other AbstractTransition\ncan be discarded.\n\n@param another\n@return true if the merge is successful." ]
[ "Add a 'IS NULL' clause so the column must be null. '=' NULL does not work.", "Returns the total count of the specified event\n@param event The event for which you want to get the total count\n@return Total count in int", "Gets the default options to be passed when no custom properties are given.\n\n@return pro...
public static Set<String> listLinks(OperationContext context, PathAddress overlayAddress) { Resource overlayResource = context.readResourceFromRoot(overlayAddress); if (overlayResource.hasChildren(DEPLOYMENT)) { return overlayResource.getChildrenNames(DEPLOYMENT); } return Collections.emptySet(); }
[ "Returns all the deployment runtime names associated with an overlay.\n\n@param context the current OperationContext.\n@param overlayAddress the address for the averlay.\n@return all the deployment runtime names associated with an overlay." ]
[ "Get the list of all nodes and the list of active nodes in the cluster.\n\n@return Membership object encapsulating lists of all nodes and the cluster nodes\n@see <a\nhref=\"https://console.bluemix.net/docs/services/Cloudant/api/advanced.html#-get-_membership-\">\n_membership</a>", "Utility function that fetches u...
public static <T> List<T> flatten(Collection<List<T>> nestedList) { List<T> result = new ArrayList<T>(); for (List<T> list : nestedList) { result.addAll(list); } return result; }
[ "combines all the lists in a collection to a single list" ]
[ "Return the entity of a resource\n\n@param resource the resource\n@param <T> the type of the resource's entity\n@param <R> the resource type\n@return the resource's entity", "Sets the ProjectCalendar instance from which this calendar is derived.\n\n@param calendar base calendar instance", "Adds a user...
public List<BoxTaskAssignment.Info> getAssignments() { URL url = GET_ASSIGNMENTS_URL_TEMPLATE.build(this.getAPI().getBaseURL(), this.getID()); BoxAPIRequest request = new BoxAPIRequest(this.getAPI(), url, "GET"); BoxJSONResponse response = (BoxJSONResponse) request.send(); JsonObject responseJSON = JsonObject.readFrom(response.getJSON()); int totalCount = responseJSON.get("total_count").asInt(); List<BoxTaskAssignment.Info> assignments = new ArrayList<BoxTaskAssignment.Info>(totalCount); JsonArray entries = responseJSON.get("entries").asArray(); for (JsonValue value : entries) { JsonObject assignmentJSON = value.asObject(); BoxTaskAssignment assignment = new BoxTaskAssignment(this.getAPI(), assignmentJSON.get("id").asString()); BoxTaskAssignment.Info info = assignment.new Info(assignmentJSON); assignments.add(info); } return assignments; }
[ "Gets any assignments for this task.\n@return a list of assignments for this task." ]
[ "This method extracts data for a normal working day from an MSPDI file.\n\n@param calendar Calendar data\n@param weekDay Day data", "Indicates that all of the packages within an archive are \"known\" by the package mapper. Generally\nthis indicates that the archive does not contain customer code.", "The token w...
public PromotionEvaluationReport getModulePromotionReport(final String name, final String version) throws GrapesCommunicationException { return getModulePromotionReportRaw(name, version, false, PromotionEvaluationReport.class); }
[ "Check if a module can be promoted in the Grapes server\n\n@param name\n@param version\n@return a boolean which is true only if the module can be promoted\n@throws GrapesCommunicationException" ]
[ "Unlinks a set of dependents from this task.\n\n@param task The task to remove dependents from.\n@return Request object", "Gets a list of any comments on this file.\n\n@return a list of comments on this file.", "binds the Identities Primary key values to the statement", "Adds the parent package to the java.p...
public static nstrafficdomain_bridgegroup_binding[] get(nitro_service service, Long td) throws Exception{ nstrafficdomain_bridgegroup_binding obj = new nstrafficdomain_bridgegroup_binding(); obj.set_td(td); nstrafficdomain_bridgegroup_binding response[] = (nstrafficdomain_bridgegroup_binding[]) obj.get_resources(service); return response; }
[ "Use this API to fetch nstrafficdomain_bridgegroup_binding resources of given name ." ]
[ "Delete an object from the database.", "Internal function that uses recursion to create the list", "Gets the Symmetric Kullback-Leibler distance.\nThis metric is valid only for real and positive P and Q.\n\n@param p P vector.\n@param q Q vector.\n@return The Symmetric Kullback Leibler distance between p and q."...
public static long wrapped(DMatrixRMaj a , DMatrixRMaj b , DMatrixRMaj c ) { long timeBefore = System.currentTimeMillis(); double valA; int indexCbase= 0; int endOfKLoop = b.numRows*b.numCols; for( int i = 0; i < a.numRows; i++ ) { int indexA = i*a.numCols; // need to assign dataC to a value initially int indexB = 0; int indexC = indexCbase; int end = indexB + b.numCols; valA = a.get(indexA++); while( indexB < end ) { c.set( indexC++ , valA*b.get(indexB++)); } // now add to it while( indexB != endOfKLoop ) { // k loop indexC = indexCbase; end = indexB + b.numCols; valA = a.get(indexA++); while( indexB < end ) { // j loop c.plus( indexC++ , valA*b.get(indexB++)); } } indexCbase += c.numCols; } return System.currentTimeMillis() - timeBefore; }
[ "Wrapper functions with no bounds checking are used to access matrix internals" ]
[ "Read a text stream into a single string.\n\n@param inputStream\nStream containing text. Will be closed on exit.\n@return The contents, or null on error.", "Helper function to return the minimum size of the index space to be passed to the reduction given the input and\noutput tensors", "Retains only beans which...
public void addSource(GVRAudioSource audioSource) { synchronized (mAudioSources) { if (!mAudioSources.contains(audioSource)) { audioSource.setListener(this); mAudioSources.add(audioSource); } } }
[ "Adds an audio source to the audio manager.\nAn audio source cannot be played unless it is\nadded to the audio manager. A source cannot be\nadded twice.\n@param audioSource audio source to add" ]
[ "Converts a string representation of an integer into an Integer object.\nSilently ignores any parse exceptions and returns null.\n\n@param value String representation of an integer\n@return Integer instance", "Process a single criteria block.\n\n@param list parent criteria list\n@param block current block", "Me...
public History[] refreshHistory(int limit, int offset) throws Exception { BasicNameValuePair[] params = { new BasicNameValuePair("limit", String.valueOf(limit)), new BasicNameValuePair("offset", String.valueOf(offset)) }; return constructHistory(params); }
[ "refresh the most recent history entries\n\n@param limit number of entries to populate\n@param offset number of most recent entries to skip\n@return populated history entries\n@throws Exception exception" ]
[ "Generates the cache key for Online links.\n@param cms the current CmsObject\n@param targetSiteRoot the target site root\n@param detailPagePart the detail page part\n@param absoluteLink the absolute (site-relative) link to the resource\n@return the cache key", "Returns PatternParser used to parse the conversion s...
public void appointTempoMaster(int deviceNumber) throws IOException { final DeviceUpdate update = getLatestStatusFor(deviceNumber); if (update == null) { throw new IllegalArgumentException("Device " + deviceNumber + " not found on network."); } appointTempoMaster(update); }
[ "Tell a device to become tempo master.\n\n@param deviceNumber the device we want to take over the role of tempo master\n\n@throws IOException if there is a problem sending the command to the device\n@throws IllegalStateException if the {@code VirtualCdj} is not active\n@throws IllegalArgumentException if {@code dev...
[ "Adds a basic LHS OPERATOR RHS block.\n\n@param list parent criteria list\n@param block current block", "Delivers the correct JSON Object for outgoings\n\n@param outgoings\n@throws org.json.JSONException", "Utility function that fetches quota types.", "Compares the two comma-separated lists.\n\n@param list1 T...
public InsertIntoTable addRowsFromDelimited(File file, String delimiter, Object nullValue) { builder.addRowsFromDelimited(file, delimiter, nullValue); return this; }
[ "Adds all rows from the TSV file specified, using the provided delimiter and null value.\n\n@param file The file to read the data from.\n@param delimiter A column delimiter.\n@param nullValue Value to be treated as null in the source data.\n@return {@code this}" ]
[ "Returns an ArrayList of String URLs of the Carousel Images\n@return ArrayList of Strings", "Invoke to find all services for given service type using specified class loader\n\n@param classLoader specified class loader\n@param serviceType given service type\n@return List of found services", "Read a single resour...
public void setAlias(UserAlias userAlias) { m_alias = userAlias.getName(); // propagate to SelectionCriteria,not to Criteria for (int i = 0; i < m_criteria.size(); i++) { if (!(m_criteria.elementAt(i) instanceof Criteria)) { ((SelectionCriteria) m_criteria.elementAt(i)).setAlias(userAlias); } } }
[ "Sets the alias using a userAlias object.\n@param userAlias The alias to set" ]
[ "Get the value of a primitive type from the request data.\n\n@param fieldName the name of the attribute to get from the request data.\n@param pAtt the primitive attribute.\n@param requestData the data to retrieve the value from.", "Get the Json Schema of the input path, assuming the path contains just one\nschema...
public static String strMapToStr(Map<String, String> map) { StringBuilder sb = new StringBuilder(); if (map == null || map.isEmpty()) return sb.toString(); for (Entry<String, String> entry : map.entrySet()) { sb.append("< " + entry.getKey() + ", " + entry.getValue() + "> "); } return sb.toString(); }
[ "Str map to str.\n\n@param map\nthe map\n@return the string" ]
[ "Obtains a Julian zoned date-time from another date-time object.\n\n@param temporal the date-time object to convert, not null\n@return the Julian zoned date-time, not null\n@throws DateTimeException if unable to create the date-time", "Uses current variable assignments and info in an NWiseActionTag to expand on ...
private String validatePattern() { String error = null; switch (getPatternType()) { case DAILY: error = isEveryWorkingDay() ? null : validateInterval(); break; case WEEKLY: error = validateInterval(); if (null == error) { error = validateWeekDaySet(); } break; case MONTHLY: error = validateInterval(); if (null == error) { error = validateMonthSet(); if (null == error) { error = isWeekDaySet() ? validateWeekOfMonthSet() : validateDayOfMonth(); } } break; case YEARLY: error = isWeekDaySet() ? validateWeekOfMonthSet() : validateDayOfMonth(); break; case INDIVIDUAL: case NONE: default: } return error; }
[ "Check, if all values used for calculating the series for a specific pattern are valid.\n@return <code>null</code> if the pattern is valid, a suitable error message otherwise." ]
[ "Creates a statement with parameters that should work with most RDBMS.", "Modifies the specified mode and length arrays to combine adjacent modes of the same type, returning the updated index point.", "Use this API to fetch all the pqbinding resources that are configured on netscaler.\nThis uses pqbinding_args ...
@Override public Scenario<GIVEN, WHEN, THEN> startScenario( String description ) { super.startScenario( description ); return this; }
[ "Describes the scenario. Must be called before any step invocation.\n@param description the description\n@return this for a fluent interface" ]
[ "Checks if a given number is in the range of a float.\n\n@param number\na number which should be in the range of a float (positive or negative)\n\n@see java.lang.Float#MIN_VALUE\n@see java.lang.Float#MAX_VALUE\n\n@return number as a float", "Create and return a new Violation for this rule and the specified import...
public static sslservice get(nitro_service service, String servicename) throws Exception{ sslservice obj = new sslservice(); obj.set_servicename(servicename); sslservice response = (sslservice) obj.get_resource(service); return response; }
[ "Use this API to fetch sslservice resource of given name ." ]
[ "Add a new PropertyChangeListener to this node for a specific property.\nThis functionality has\nbeen borrowed from the java.beans package, though this class has\nnothing to do with a bean", "Returns a list of bindings where provided queue is the destination.\n\n@param vhost vhost of the exchange\n@param queue...
private boolean isNullOrEmpty(Object paramValue) { boolean isNullOrEmpty = false; if (paramValue == null) { isNullOrEmpty = true; } if (paramValue instanceof String) { if (((String) paramValue).trim().equalsIgnoreCase("")) { isNullOrEmpty = true; } } else if (paramValue instanceof List) { return ((List) paramValue).isEmpty(); } return isNullOrEmpty; }
[ "Checks String to see if the parameter is null.\n@param paramValue Object that will be checked if null.\n@return this.true if the parameter that is being checked is not null" ]
[ "Get list of replies\n\n@param topicId\nUnique identifier of a topic for a given group {@link Topic}.\n@return A reply object\n@throws FlickrException\n@see <a href=\"http://www.flickr.com/services/api/flickr.groups.discuss.replies.getList.html\">API Documentation</a>", "The conditional expectation is calculated ...
@Override public void process(Step context) { Iterator<Attachment> iterator = context.getAttachments().listIterator(); while (iterator.hasNext()) { Attachment attachment = iterator.next(); if (pattern.matcher(attachment.getSource()).matches()) { deleteAttachment(attachment); iterator.remove(); } } for (Step step : context.getSteps()) { process(step); } }
[ "Remove attachments matches pattern from step and all step substeps\n\n@param context from which attachments will be removed" ]
[ "Registers a new site for specific data collection. If null is used as a\nsite key, then all data is collected.\n\n@param siteKey\nthe site to collect geo data for", "Lookup the username for the specified User URL.\n\n@param url\nThe user profile URL\n@return The username\n@throws FlickrException", "Checks the ...
public ServerGroup getServerGroup(int id, int profileId) throws Exception { PreparedStatement queryStatement = null; ResultSet results = null; if (id == 0) { return new ServerGroup(0, "Default", profileId); } try (Connection sqlConnection = sqlService.getConnection()) { queryStatement = sqlConnection.prepareStatement( "SELECT * FROM " + Constants.DB_TABLE_SERVER_GROUPS + " WHERE " + Constants.GENERIC_ID + " = ?" ); queryStatement.setInt(1, id); results = queryStatement.executeQuery(); if (results.next()) { ServerGroup curGroup = new ServerGroup(results.getInt(Constants.GENERIC_ID), results.getString(Constants.GENERIC_NAME), results.getInt(Constants.GENERIC_PROFILE_ID)); return curGroup; } logger.info("Did not find the ID: {}", id); } catch (SQLException e) { throw e; } finally { try { if (results != null) { results.close(); } } catch (Exception e) { } try { if (queryStatement != null) { queryStatement.close(); } } catch (Exception e) { } } return null; }
[ "Returns server group by ID\n\n@param id ID of server group\n@return ServerGroup\n@throws Exception exception" ]
[ "Returns true if the provided matrix is has a value of 1 along the diagonal\nelements and zero along all the other elements.\n\n@param a Matrix being inspected.\n@param tol How close to zero or one each element needs to be.\n@return If it is within tolerance to an identity matrix.", "Remove a handler from the lis...
public static wisite_binding get(nitro_service service, String sitepath) throws Exception{ wisite_binding obj = new wisite_binding(); obj.set_sitepath(sitepath); wisite_binding response = (wisite_binding) obj.get_resource(service); return response; }
[ "Use this API to fetch wisite_binding resource of given name ." ]
[ "Returns a representation of the date from the value attributes as ISO\n8601 encoding.\n\n@param value\n@return ISO 8601 value (String)", "Require that the namespace of the current element matches the required namespace.\n\n@param reader the reader\n@param requiredNs the namespace required\n@throws XMLStreamExcep...
public DynamicReportBuilder setTemplateFile(String path, boolean importFields, boolean importVariables, boolean importParameters, boolean importDatasets) { report.setTemplateFileName(path); report.setTemplateImportFields(importFields); report.setTemplateImportParameters(importParameters); report.setTemplateImportVariables(importVariables); report.setTemplateImportDatasets(importDatasets); return this; }
[ "The full path of a jrxml file, or the path in the classpath of a jrxml\nresource.\n\n@param path\n@return" ]
[ "Sets the appropriate OpenCms context.\n@param cms The OpenCms instance object.", "Organises the data from Asta into a hierarchy and converts this into tasks.\n\n@param bars bar data\n@param expandedTasks expanded task data\n@param tasks task data\n@param milestones milestone data", "Set the current playback po...
public void viewDocument(DocumentEntry entry) { InputStream is = null; try { is = new DocumentInputStream(entry); byte[] data = new byte[is.available()]; is.read(data); m_model.setData(data); updateTables(); } catch (IOException ex) { throw new RuntimeException(ex); } finally { StreamHelper.closeQuietly(is); } }
[ "Command to select a document from the POIFS for viewing.\n\n@param entry document to view" ]
[ "Use this API to fetch appfwwsdl resource of given name .", "Remove a named object", "The normalized string returned by this method is consistent with java.net.Inet6address.\nIPs are not compressed nor mixed in this representation.", "Issue the database statements to drop the table associated with a dao.\n\n@...
private ProjectFile readFile(String inputFile) throws MPXJException { ProjectReader reader = new UniversalProjectReader(); ProjectFile projectFile = reader.read(inputFile); if (projectFile == null) { throw new IllegalArgumentException("Unsupported file type"); } return projectFile; }
[ "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" ]
[ "Checks if a Zip is valid navigating through the entries\n\n@param file File to validate\n@throws IOException I/O Error", "Start a managed server.\n\n@param factory the boot command factory", "Log a message with a throwable at the provided level.", "Unregister the mgmt channel.\n\n@param old the proxy control...
public Set<String> getTags() { Set<String> tags = new HashSet<String>(classIndex.objectsList()); tags.remove(flags.backgroundSymbol); return tags; }
[ "Returns the Set of entities recognized by this Classifier.\n\n@return The Set of entities recognized by this Classifier." ]
[ "Returns a string representation of the receiver, containing\nthe String representation of each key-value pair, sorted ascending by value.", "Tells you if the expression is the false expression, either literal or constant.\n@param expression\nexpression\n@return\nas described", "Updates LetsEncrypt configuratio...
@Override public boolean decompose(DMatrixRMaj orig) { if( orig.numCols != orig.numRows ) throw new IllegalArgumentException("Matrix must be square."); if( orig.numCols <= 0 ) return false; int N = orig.numRows; // compute a similar tridiagonal matrix if( !decomp.decompose(orig) ) return false; if( diag == null || diag.length < N) { diag = new double[N]; off = new double[N-1]; } decomp.getDiagonal(diag,off); // Tell the helper to work with this matrix helper.init(diag,off,N); if( computeVectors ) { if( computeVectorsWithValues ) { return extractTogether(); } else { return extractSeparate(N); } } else { return computeEigenValues(); } }
[ "Decomposes the matrix using the QR algorithm. Care was taken to minimize unnecessary memory copying\nand cache skipping.\n\n@param orig The matrix which is being decomposed. Not modified.\n@return true if it decomposed the matrix or false if an error was detected. This will not catch all errors." ]
[ "Checks if two claims are equivalent in the sense that they have the same\nmain snak and the same qualifiers, but possibly in a different order.\n\n@param claim1\n@param claim2\n@return true if claims are equivalent", "Use this API to fetch all the spilloverpolicy resources that are configured on netscaler.", "...
private static JSONArray parseStencilSetExtensions(ArrayList<String> extensions) { if (extensions != null) { JSONArray extensionsArray = new JSONArray(); for (String extension : extensions) { extensionsArray.put(extension.toString()); } return extensionsArray; } return new JSONArray(); }
[ "Delivers the correct JSON Object for the Stencilset Extensions\n\n@param extensions" ]
[ "Return the number of days between startDate and endDate given the\nspecific daycount convention.\n\n@param startDate The start date given as a {@link org.threeten.bp.LocalDate}.\n@param endDate The end date given as a {@link org.threeten.bp.LocalDate}.\n@param convention A convention string.\n@return The number of...
public static ResourceKey key(Enum<?> enumValue, String key) { return new ResourceKey(enumValue.getClass().getName(), enumValue.name()).child(key); }
[ "Creates a resource key defined as a child of key defined by enumeration value.\n@see #key(Enum)\n@see #child(String)\n@param enumValue the enumeration value defining the parent key\n@param key the child id\n@return the resource key" ]
[ "Delete rows that match the prepared statement.", "calls _initMH on the method handler and then stores the result in the\nmethodHandler field as then new methodHandler", "Creates an encryptor for queryable text strings that uses standard password-based encryption. Uses a shared, or\nconstant 16 byte initializat...
public Table createTable(ProjectFile file, byte[] data, VarMeta varMeta, Var2Data varData) { Table table = new Table(); table.setID(MPPUtility.getInt(data, 0)); table.setResourceFlag(MPPUtility.getShort(data, 108) == 1); table.setName(MPPUtility.removeAmpersands(MPPUtility.getUnicodeString(data, 4))); byte[] columnData = null; Integer tableID = Integer.valueOf(table.getID()); if (m_tableColumnDataBaseline != null) { columnData = varData.getByteArray(varMeta.getOffset(tableID, m_tableColumnDataBaseline)); } if (columnData == null) { columnData = varData.getByteArray(varMeta.getOffset(tableID, m_tableColumnDataEnterprise)); if (columnData == null) { columnData = varData.getByteArray(varMeta.getOffset(tableID, m_tableColumnDataStandard)); } } processColumnData(file, table, columnData); //System.out.println(table); return (table); }
[ "Creates a new Table instance from data extracted from an MPP file.\n\n@param file parent project file\n@param data fixed data\n@param varMeta var meta\n@param varData var data\n@return Table instance" ]
[ "A simple convinience function that decomposes the matrix but automatically checks the input ti make\nsure is not being modified.\n\n@param decomp Decomposition which is being wrapped\n@param M THe matrix being decomposed.\n@param <T> Matrix type.\n@return If the decomposition was successful or not.", "Clears all...
private void executeBatch(int batchId, final RebalanceBatchPlan batchPlan) { final Cluster batchCurrentCluster = batchPlan.getCurrentCluster(); final List<StoreDefinition> batchCurrentStoreDefs = batchPlan.getCurrentStoreDefs(); final Cluster batchFinalCluster = batchPlan.getFinalCluster(); final List<StoreDefinition> batchFinalStoreDefs = batchPlan.getFinalStoreDefs(); try { final List<RebalanceTaskInfo> rebalanceTaskInfoList = batchPlan.getBatchPlan(); if(rebalanceTaskInfoList.isEmpty()) { RebalanceUtils.printBatchLog(batchId, logger, "Skipping batch " + batchId + " since it is empty."); // Even though there is no rebalancing work to do, cluster // metadata must be updated so that the server is aware of the // new cluster xml. adminClient.rebalanceOps.rebalanceStateChange(batchCurrentCluster, batchFinalCluster, batchCurrentStoreDefs, batchFinalStoreDefs, rebalanceTaskInfoList, false, true, false, false, true); return; } RebalanceUtils.printBatchLog(batchId, logger, "Starting batch " + batchId + "."); // Split the store definitions List<StoreDefinition> readOnlyStoreDefs = StoreDefinitionUtils.filterStores(batchFinalStoreDefs, true); List<StoreDefinition> readWriteStoreDefs = StoreDefinitionUtils.filterStores(batchFinalStoreDefs, false); boolean hasReadOnlyStores = readOnlyStoreDefs != null && readOnlyStoreDefs.size() > 0; boolean hasReadWriteStores = readWriteStoreDefs != null && readWriteStoreDefs.size() > 0; // STEP 1 - Cluster state change boolean finishedReadOnlyPhase = false; List<RebalanceTaskInfo> filteredRebalancePartitionPlanList = RebalanceUtils.filterTaskPlanWithStores(rebalanceTaskInfoList, readOnlyStoreDefs); rebalanceStateChange(batchId, batchCurrentCluster, batchCurrentStoreDefs, batchFinalCluster, batchFinalStoreDefs, filteredRebalancePartitionPlanList, hasReadOnlyStores, hasReadWriteStores, finishedReadOnlyPhase); // STEP 2 - Move RO data if(hasReadOnlyStores) { RebalanceBatchPlanProgressBar progressBar = batchPlan.getProgressBar(batchId); executeSubBatch(batchId, progressBar, batchCurrentCluster, batchCurrentStoreDefs, filteredRebalancePartitionPlanList, hasReadOnlyStores, hasReadWriteStores, finishedReadOnlyPhase); } // STEP 3 - Cluster change state finishedReadOnlyPhase = true; filteredRebalancePartitionPlanList = RebalanceUtils.filterTaskPlanWithStores(rebalanceTaskInfoList, readWriteStoreDefs); rebalanceStateChange(batchId, batchCurrentCluster, batchCurrentStoreDefs, batchFinalCluster, batchFinalStoreDefs, filteredRebalancePartitionPlanList, hasReadOnlyStores, hasReadWriteStores, finishedReadOnlyPhase); // STEP 4 - Move RW data if(hasReadWriteStores) { proxyPause(); RebalanceBatchPlanProgressBar progressBar = batchPlan.getProgressBar(batchId); executeSubBatch(batchId, progressBar, batchCurrentCluster, batchCurrentStoreDefs, filteredRebalancePartitionPlanList, hasReadOnlyStores, hasReadWriteStores, finishedReadOnlyPhase); } RebalanceUtils.printBatchLog(batchId, logger, "Successfully terminated batch " + batchId + "."); } catch(Exception e) { RebalanceUtils.printErrorLog(batchId, logger, "Error in batch " + batchId + " - " + e.getMessage(), e); throw new VoldemortException("Rebalance failed on batch " + batchId, e); } }
[ "Executes a batch plan.\n\n@param batchId Used as the ID of the batch plan. This allows related\ntasks on client- & server-side to pretty print messages in a\nmanner that debugging can track specific batch plans across the\ncluster.\n@param batchPlan The batch plan..." ]
[ "Converts a byte array to a hexadecimal string representation\n@param bb the byte array to convert\n@return string the string representation", "Check type.\n\n@param type the type\n@return the boolean", "Return all scripts of a given type\n\n@param type integer value of type\n@return Array of scripts of the giv...
public int[] next() { boolean hasNewPerm = false; escape:while( level >= 0) { // boolean foundZero = false; for( int i = iter[level]; i < data.length; i = iter[level] ) { iter[level]++; if( data[i] == -1 ) { level++; data[i] = level-1; if( level >= data.length ) { // a new permutation has been created return the results. hasNewPerm = true; System.arraycopy(data,0,ret,0,ret.length); level = level-1; data[i] = -1; break escape; } else { valk[level] = i; } } } data[valk[level]] = -1; iter[level] = 0; level = level-1; } if( hasNewPerm ) return ret; return null; }
[ "Creates the next permutation in the sequence.\n\n@return An array containing the permutation. The returned array is modified each time this function is called." ]
[ "Set the week of month.\n@param weekOfMonthStr the week of month to set.", "Returns an array of the enabled endpoints as Integer IDs\n\n@param pathId ID of path\n@param clientUUID UUID of client\n@param filters If supplied, only endpoints ending with values in filters are returned\n@return Collection of endpoints...
public static <T extends HasWord> TokenizerFactory<T> factory(LexedTokenFactory<T> factory, String options) { return new PTBTokenizerFactory<T>(factory, options); }
[ "Get a TokenizerFactory that does Penn Treebank tokenization.\nThis is now the recommended factory method to use.\n\n@param factory A TokenFactory that determines what form of token is returned by the Tokenizer\n@param options A String specifying options (see the class javadoc for details)\n@param <T> The type of t...
[ "Gets the value of a global editor configuration parameter.\n\n@param cms the CMS context\n@param editor the editor name\n@param param the name of the parameter\n\n@return the editor parameter value", "On key down we assume the key will go at the end. It's the most\ncommon case and not that distracting if that's ...
public static ProjectWriter getProjectWriter(String name) throws InstantiationException, IllegalAccessException { int index = name.lastIndexOf('.'); if (index == -1) { throw new IllegalArgumentException("Filename has no extension: " + name); } String extension = name.substring(index + 1).toUpperCase(); Class<? extends ProjectWriter> fileClass = WRITER_MAP.get(extension); if (fileClass == null) { throw new IllegalArgumentException("Cannot write files of type: " + name); } ProjectWriter file = fileClass.newInstance(); return (file); }
[ "Retrieves a ProjectWriter instance which can write a file of the\ntype specified by the supplied file name.\n\n@param name file name\n@return ProjectWriter instance" ]
[ "Given a list of keys and a number of splits find the keys to split on.\n\n@param keys the list of keys.\n@param numSplits the number of splits.", "Adds all items from the iterable to the Collection.\n\n@param self the collection\n@param items the items to add\n@return true if the collection changed", "Get the ...
public static void setLocale(ProjectProperties properties, Locale locale) { properties.setMpxDelimiter(LocaleData.getChar(locale, LocaleData.FILE_DELIMITER)); properties.setMpxProgramName(LocaleData.getString(locale, LocaleData.PROGRAM_NAME)); properties.setMpxCodePage((CodePage) LocaleData.getObject(locale, LocaleData.CODE_PAGE)); properties.setCurrencySymbol(LocaleData.getString(locale, LocaleData.CURRENCY_SYMBOL)); properties.setSymbolPosition((CurrencySymbolPosition) LocaleData.getObject(locale, LocaleData.CURRENCY_SYMBOL_POSITION)); properties.setCurrencyDigits(LocaleData.getInteger(locale, LocaleData.CURRENCY_DIGITS)); properties.setThousandsSeparator(LocaleData.getChar(locale, LocaleData.CURRENCY_THOUSANDS_SEPARATOR)); properties.setDecimalSeparator(LocaleData.getChar(locale, LocaleData.CURRENCY_DECIMAL_SEPARATOR)); properties.setDateOrder((DateOrder) LocaleData.getObject(locale, LocaleData.DATE_ORDER)); properties.setTimeFormat((ProjectTimeFormat) LocaleData.getObject(locale, LocaleData.TIME_FORMAT)); properties.setDefaultStartTime(DateHelper.getTimeFromMinutesPastMidnight(LocaleData.getInteger(locale, LocaleData.DEFAULT_START_TIME))); properties.setDateSeparator(LocaleData.getChar(locale, LocaleData.DATE_SEPARATOR)); properties.setTimeSeparator(LocaleData.getChar(locale, LocaleData.TIME_SEPARATOR)); properties.setAMText(LocaleData.getString(locale, LocaleData.AM_TEXT)); properties.setPMText(LocaleData.getString(locale, LocaleData.PM_TEXT)); properties.setDateFormat((ProjectDateFormat) LocaleData.getObject(locale, LocaleData.DATE_FORMAT)); properties.setBarTextDateFormat((ProjectDateFormat) LocaleData.getObject(locale, LocaleData.DATE_FORMAT)); }
[ "This method is called when the locale of the parent file is updated.\nIt resets the locale specific currency attributes to the default values\nfor the new locale.\n\n@param properties project properties\n@param locale new locale" ]
[ "Returns the adapter position of the Parent associated with this ParentViewHolder\n\n@return The adapter position of the Parent if it still exists in the adapter.\nRecyclerView.NO_POSITION if item has been removed from the adapter,\nRecyclerView.Adapter.notifyDataSetChanged() has been called after the last\nlayout ...
public PhotoList<Photo> getRecent(Set<String> extras, int perPage, int page) throws FlickrException { Map<String, Object> parameters = new HashMap<String, Object>(); parameters.put("method", METHOD_GET_RECENT); if (extras != null && !extras.isEmpty()) { parameters.put(Extras.KEY_EXTRAS, StringUtilities.join(extras, ",")); } if (perPage > 0) { parameters.put("per_page", Integer.toString(perPage)); } if (page > 0) { parameters.put("page", Integer.toString(page)); } Response response = transport.get(transport.getPath(), parameters, apiKey, sharedSecret); if (response.isError()) { throw new FlickrException(response.getErrorCode(), response.getErrorMessage()); } Element photosElement = response.getPayload(); PhotoList<Photo> photos = PhotoUtils.createPhotoList(photosElement); return photos; }
[ "Get a collection of recent photos.\n\nThis method does not require authentication.\n\n@see com.flickr4java.flickr.photos.Extras\n@param extras\nSet of extra-fields\n@param perPage\nThe number of photos per page\n@param page\nThe page offset\n@return A collection of Photo objects\n@throws FlickrException" ]
[ "Retrieve the default number of minutes per month.\n\n@return minutes per month", "Logs an error by sending an error event to all listeners.\n\nError events can be generated by any part of GearVRF,\nfrom any thread. They are always sent to the event receiver\nof the GVRContext.\n\n@param message error message\n@p...
@Override public void close() throws IOException { long skippedLast = 0; if (m_remaining > 0) { skippedLast = skip(m_remaining); while (m_remaining > 0 && skippedLast > 0) { skippedLast = skip(m_remaining); } } }
[ "Closing will only skip to the end of this fixed length input stream and\nnot call the parent's close method.\n@throws IOException if an I/O error occurs while closing stream" ]
[ "if you have a default, it's automatically optional", "Gets a property from system, environment or an external map.\nThe lookup order is system > env > map > defaultValue.\n\n@param name\nThe name of the property.\n@param map\nThe external map.\n@param defaultValue\nThe value that should be used if property is no...
private void readVersion(InputStream is) throws IOException { BytesReadInputStream bytesReadStream = new BytesReadInputStream(is); String version = DatatypeConverter.getString(bytesReadStream); m_offset += bytesReadStream.getBytesRead(); SynchroLogger.log("VERSION", version); String[] versionArray = version.split("\\."); m_majorVersion = Integer.parseInt(versionArray[0]); }
[ "Read the version number.\n\n@param is input stream" ]
[ "Tells you if the ASTNode is a method node for the given name, arity, and return type.\n@param node\nthe node to inspect\n@param methodNamePattern\nthe expected name of the method\n@param numArguments\nthe expected number of arguments, optional\n@param returnType\nthe expected return type, optional\n@return\ntrue i...
@Override public final PObject getObject(final String key) { PObject result = optObject(key); if (result == null) { throw new ObjectMissingException(this, key); } return result; }
[ "Get a property as a object or throw exception.\n\n@param key the property name" ]
[ "Alias accessor provided for JSON serialization only", "Pretty print a progress update after each batch complete.\n\n@param batchCount current batch\n@param numBatches total number of batches\n@param partitionStoreCount partition stores migrated\n@param numPartitionStores total number of partition stores to migra...
public static ServiceName deploymentUnitName(String name, Phase phase) { return JBOSS_DEPLOYMENT_UNIT.append(name, phase.name()); }
[ "Get the service name of a top-level deployment unit.\n\n@param name the simple name of the deployment\n@param phase the deployment phase\n@return the service name" ]
[ "Validates that we only have allowable filters.\n\n<p>Note that equality and ancestor filters are allowed, however they may result in\ninefficient sharding.", "Initial random seed used for shuffling test suites and other sources\nof pseudo-randomness. If not set, any random value is set.\n\n<p>The seed's format i...
public VideoCollection generate(final int videoCount) { List<Video> videos = new LinkedList<Video>(); for (int i = 0; i < videoCount; i++) { Video video = generateRandomVideo(); videos.add(video); } return new VideoCollection(videos); }
[ "Generate a VideoCollection with random data obtained form VIDEO_INFO map. You don't need o\ncreate your own AdapteeCollections. Review ListAdapteeCollection if needed.\n\n@param videoCount size of the collection.\n@return VideoCollection generated." ]
[ "For the DC to check whether an operation should be ignored on the slave, if the slave is set up to ignore config not relevant to it\n\n@param domainResource the domain root resource\n@param serverConfigs the server configs the slave is known to have\n@param pathAddress the address of the operation to check if shou...
CapabilityRegistry createShadowCopy() { CapabilityRegistry result = new CapabilityRegistry(forServer, this); readLock.lock(); try { try { result.writeLock.lock(); copy(this, result); } finally { result.writeLock.unlock(); } } finally { readLock.unlock(); } return result; }
[ "Creates updateable version of capability registry that on publish pushes all changes to main registry\nthis is used to create context local registry that only on completion commits changes to main registry\n\n@return writable registry" ]
[ "Use this API to delete route6.", "Creates a new immutable set that consists of given elements.\n\n@param elements the given elements\n@return a new immutable set that consists of given elements", "Records the list of backedup files into a text file\n\n@param filesInEnv\n@param backupDir", "Creates a Bytes ob...
public static List<Integer> getAllNodeIds(AdminClient adminClient) { List<Integer> nodeIds = Lists.newArrayList(); for(Integer nodeId: adminClient.getAdminClientCluster().getNodeIds()) { nodeIds.add(nodeId); } return nodeIds; }
[ "Utility function that fetches node ids.\n\n@param adminClient An instance of AdminClient points to given cluster\n@return Node ids in cluster" ]
[ "Check whether vector addition works. This is pure Java code and should work.", "Attemps to delete all provided segments from a log and returns how many it was able to", "Join N sets.", "When all the elements in a sorted set are inserted with the same score, in order to force lexicographical\nordering, this c...
@Override public synchronized void start() { if (!started.getAndSet(true)) { finished.set(false); thread.start(); } }
[ "Starts processor thread." ]
[ "Returns the configured fields of the current field configuration.\n\n@return the configured fields of the current field configuration", "Use this API to fetch authorizationpolicylabel_binding resource of given name .", "Requests the beat grid for a specific track ID, given a connection to a player that has alr...
public static Class<?> resolvePrimitiveIfNecessary(Class<?> clazz) { Assert.notNull(clazz, "Class must not be null"); return (clazz.isPrimitive() && clazz != void.class? primitiveTypeToWrapperMap.get(clazz) : clazz); }
[ "Resolve the given class if it is a primitive class,\nreturning the corresponding primitive wrapper type instead.\n@param clazz the class to check\n@return the original class, or a primitive wrapper for the original primitive type" ]
[ "This creates a new audit log file with default permissions.\n\n@param file File to create", "Obtain collection of profiles\n\n@param model\n@return\n@throws Exception", "Gets the SerialMessage as a byte array.\n@return the message", "1.5 and on, 2.0 and on, 3.0 and on.", "Allocates a database connection.\n...
@SuppressWarnings("unchecked") public static <E> void serialize(E object, ParameterizedType<E> parameterizedType, OutputStream os) throws IOException { mapperFor(parameterizedType).serialize(object, os); }
[ "Serialize a parameterized object to an OutputStream.\n\n@param object The object to serialize.\n@param parameterizedType The ParameterizedType describing the object. Ex: LoganSquare.serialize(object, new ParameterizedType&lt;MyModel&lt;OtherModel&gt;&gt;() { }, os);\n@param os The OutputStream being written to." ...
[ "Sets the currency code, or the regular expression to select codes.\n\n@param codes the currency codes or code expressions, not null.\n@return the query for chaining.", "Get an extent aware RsIterator based on the Query\n\n@param query\n@param cld\n@param factory the Factory for the RsIterator\n@return OJBIterato...
private void logOriginalRequestHistory(String requestType, HttpServletRequest request, History history) { logger.info("Storing original request history"); history.setRequestType(requestType); history.setOriginalRequestHeaders(HttpUtilities.getHeaders(request)); history.setOriginalRequestURL(request.getRequestURL().toString()); history.setOriginalRequestParams(request.getQueryString() == null ? "" : request.getQueryString()); logger.info("Done storing"); }
[ "Log original incoming request\n\n@param requestType\n@param request\n@param history" ]
[ "For internal use! This method creates real new PB instances", "Orders first by word, then by tag.\n\n@param wordTag object to compare to\n@return result (positive if <code>this</code> is greater than\n<code>obj</code>, 0 if equal, negative otherwise)", "Checks if this has the passed prefix\n\n@param prefix is ...
private int getCostRateTableEntryIndex(Date date) { int result = -1; CostRateTable table = getCostRateTable(); if (table != null) { if (table.size() == 1) { result = 0; } else { result = table.getIndexByDate(date); } } return result; }
[ "Retrieves the index of a cost rate table entry active on a given date.\n\n@param date target date\n@return cost rate table entry index" ]
[ "Handle unbind service event.\n@param service Service instance\n@param props Service reference properties", "Probe the existing cluster to retrieve the current cluster xml and stores\nxml.\n\n@return Pair of Cluster and List<StoreDefinition> from current cluster.", "Returns a compact representation of all of th...
public Bundler put(String key, Bundle value) { delegate.putBundle(key, value); return this; }
[ "Inserts a Bundle value into the mapping of the underlying Bundle, replacing any existing value\nfor the given key. Either key or value may be null.\n\n@param key a String, or null\n@param value a Bundle object, or null\n@return this bundler instance to chain method calls" ]
[ "Makes object obj persistent in the underlying persistence system.\nE.G. by INSERT INTO ... or UPDATE ... in an RDBMS.\nThe ObjectModification parameter can be used to determine whether INSERT or update is to be used.\nThis functionality is typically called from transaction managers, that\ntrack which objects have...
public <T extends Widget & Checkable> List<T> getCheckableChildren() { List<Widget> children = getChildren(); ArrayList<T> result = new ArrayList<>(); for (Widget c : children) { if (c instanceof Checkable) { result.add((T) c); } } return result; }
[ "Gets all Checkable widgets in the group\n@return list of Checkable widgets" ]
[ "Delete a license from the repository\n\n@param licName The name of the license to remove", "If the burst mode is on, emit the particles only once.\n\n@param particlePositions\n@param particleVelocities\n@param particleTimeStamps", "Count the number of queued resource requests for a specific pool.\n\n@param key...
public CodePage getCodePage(int field) { CodePage result; if ((field < m_fields.length) && (m_fields[field].length() != 0)) { result = CodePage.getInstance(m_fields[field]); } else { result = CodePage.getInstance(null); } return (result); }
[ "Retrieves a CodePage instance. Defaults to ANSI.\n\n@param field the index number of the field to be retrieved\n@return the value of the required field" ]
[ "Create and return a new Violation for this rule and the specified import\n@param sourceCode - the SourceCode\n@param importNode - the ImportNode for the import triggering the violation\n@return a new Violation object", "Add a listener to be invoked when the checked button changes in this group.\n@param listener\...
protected void writeEntries(final StorageAwareResource resource, final ZipOutputStream zipOut) throws IOException { final BufferedOutputStream bufferedOutput = new BufferedOutputStream(zipOut); ZipEntry _zipEntry = new ZipEntry("emf-contents"); zipOut.putNextEntry(_zipEntry); try { this.writeContents(resource, bufferedOutput); } finally { bufferedOutput.flush(); zipOut.closeEntry(); } ZipEntry _zipEntry_1 = new ZipEntry("resource-description"); zipOut.putNextEntry(_zipEntry_1); try { this.writeResourceDescription(resource, bufferedOutput); } finally { bufferedOutput.flush(); zipOut.closeEntry(); } if (this.storeNodeModel) { ZipEntry _zipEntry_2 = new ZipEntry("node-model"); zipOut.putNextEntry(_zipEntry_2); try { this.writeNodeModel(resource, bufferedOutput); } finally { bufferedOutput.flush(); zipOut.closeEntry(); } } }
[ "Write entries into the storage.\nOverriding methods should first delegate to super before adding their own entries." ]
[ "Updates the story and returns the full record for the updated story.\nOnly comment stories can have their text updated, and only comment stories and\nattachment stories can be pinned. Only one of `text` and `html_text` can be specified.\n\n@param story Globally unique identifier for the story.\n@return Request ob...
public static String getTokenText(INode node) { if (node instanceof ILeafNode) return ((ILeafNode) node).getText(); else { StringBuilder builder = new StringBuilder(Math.max(node.getTotalLength(), 1)); boolean hiddenSeen = false; for (ILeafNode leaf : node.getLeafNodes()) { if (!leaf.isHidden()) { if (hiddenSeen && builder.length() > 0) builder.append(' '); builder.append(leaf.getText()); hiddenSeen = false; } else { hiddenSeen = true; } } return builder.toString(); } }
[ "This method converts a node to text.\n\nLeading and trailing text from hidden tokens (whitespace/comments) is removed. Text from hidden tokens that is\nsurrounded by text from non-hidden tokens is summarized to a single whitespace.\n\nThe preferred use case of this method is to convert the {@link ICompositeNode} t...
[ "Add parameter to testCase\n\n@param context which can be changed", "Checks all data sets in a given record for constraint violations.\n\n@param record\nIIM record (1,2,3, ...) to check\n\n@return list of constraint violations, empty set if IIM file is valid", "Evaluates the animation with the given index at th...
protected void generateRoutes() { try { // Optional<io.sinistral.proteus.annotations.Chain> typeLevelWrapAnnotation = Optional.ofNullable(controllerClass.getAnnotation(io.sinistral.proteus.annotations.Chain.class)); // // typeLevelWrapAnnotation.ifPresent( a -> { // // io.sinistral.proteus.annotations.Chain w = typeLevelWrapAnnotation.get(); // // Class<? extends HandlerWrapper> wrapperClasses[] = w.value(); // // for (int i = 0; i < wrapperClasses.length; i++) // { // Class<? extends HandlerWrapper> wrapperClass = wrapperClasses[i]; // // String wrapperName = generateFieldName(wrapperClass.getCanonicalName()); // // handlerWrapperMap.put(wrapperClass, wrapperName); // } // // }); // // for(Method m : this.controllerClass.getDeclaredMethods()) // { // // Optional<io.sinistral.proteus.annotations.Chain> methodLevelWrapAnnotation = Optional.ofNullable(m.getAnnotation(io.sinistral.proteus.annotations.Chain.class)); // // methodLevelWrapAnnotation.ifPresent( a -> { // // io.sinistral.proteus.annotations.Chain w = methodLevelWrapAnnotation.get(); // // Class<? extends HandlerWrapper> wrapperClasses[] = w.value(); // // for (int i = 0; i < wrapperClasses.length; i++) // { // Class<? extends HandlerWrapper> wrapperClass = wrapperClasses[i]; // // String wrapperName = generateFieldName(wrapperClass.getCanonicalName()); // // handlerWrapperMap.put(wrapperClass, wrapperName); // } // // }); // // } // // log.info("handlerWrapperMap: " + handlerWrapperMap); TypeSpec.Builder typeBuilder = TypeSpec.classBuilder(className).addModifiers(Modifier.PUBLIC) .addSuperinterface(ParameterizedTypeName.get(Supplier.class, RoutingHandler.class)); ClassName extractorClass = ClassName.get("io.sinistral.proteus.server", "Extractors"); ClassName injectClass = ClassName.get("com.google.inject", "Inject"); MethodSpec.Builder constructor = MethodSpec.constructorBuilder().addModifiers(Modifier.PUBLIC).addAnnotation(injectClass); String className = this.controllerClass.getSimpleName().toLowerCase() + "Controller"; typeBuilder.addField(this.controllerClass, className, Modifier.PROTECTED, Modifier.FINAL); ClassName wrapperClass = ClassName.get("io.undertow.server", "HandlerWrapper"); ClassName stringClass = ClassName.get("java.lang", "String"); ClassName mapClass = ClassName.get("java.util", "Map"); TypeName mapOfWrappers = ParameterizedTypeName.get(mapClass, stringClass, wrapperClass); TypeName annotatedMapOfWrappers = mapOfWrappers .annotated(AnnotationSpec.builder(com.google.inject.name.Named.class).addMember("value", "$S", "registeredHandlerWrappers").build()); typeBuilder.addField(mapOfWrappers, "registeredHandlerWrappers", Modifier.PROTECTED, Modifier.FINAL); constructor.addParameter(this.controllerClass, className); constructor.addParameter(annotatedMapOfWrappers, "registeredHandlerWrappers"); constructor.addStatement("this.$N = $N", className, className); constructor.addStatement("this.$N = $N", "registeredHandlerWrappers", "registeredHandlerWrappers"); addClassMethodHandlers(typeBuilder, this.controllerClass); typeBuilder.addMethod(constructor.build()); JavaFile javaFile = JavaFile.builder(packageName, typeBuilder.build()).addStaticImport(extractorClass, "*").build(); StringBuilder sb = new StringBuilder(); javaFile.writeTo(sb); this.sourceString = sb.toString(); } catch (Exception e) { log.error(e.getMessage(), e); } }
[ "Generates the routing Java source code" ]
[ "Updates value of entity in the table.", "To read an object in a quick & dirty way. Prepare to handle failures when object serialization changes!", "Check if the print has not been asked to stop taking new jobs.\n\n@return true if it's OK to take new jobs.", "Parses the field facet configurations.\n@param fie...
private void deliverTempoChangedAnnouncement(final double tempo) { for (final MasterListener listener : getMasterListeners()) { try { listener.tempoChanged(tempo); } catch (Throwable t) { logger.warn("Problem delivering tempo changed announcement to listener", t); } } }
[ "Send a tempo changed announcement to all registered master listeners.\n\n@param tempo the new master tempo" ]
[ "select a use case.", "Gets JmsDestinationType from java class name\n\nReturns null for unrecognized class", "Determine whether all references are available locally.\n\n@param domain the domain model\n@param hostElement the host path element\n@return whether to a sync with the master is required", ...