repository_name stringlengths 7 58 | func_path_in_repository stringlengths 18 188 | func_name stringlengths 7 127 | whole_func_string stringlengths 77 3.91k | language stringclasses 1
value | func_code_string stringlengths 77 3.91k | func_code_tokens listlengths 20 745 | func_documentation_string stringlengths 61 1.98k | func_documentation_tokens listlengths 1 477 | split_name stringclasses 1
value | func_code_url stringlengths 111 288 |
|---|---|---|---|---|---|---|---|---|---|---|
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionValuePersistenceImpl.java | CPOptionValuePersistenceImpl.findByGroupId | @Override
public List<CPOptionValue> findByGroupId(long groupId) {
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CPOptionValue> findByGroupId(long groupId) {
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPOptionValue",
">",
"findByGroupId",
"(",
"long",
"groupId",
")",
"{",
"return",
"findByGroupId",
"(",
"groupId",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the cp option values where groupId = ?.
@param groupId the group ID
@return the matching cp option values | [
"Returns",
"all",
"the",
"cp",
"option",
"values",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPOptionValuePersistenceImpl.java#L1511-L1514 |
SpartaTech/sparta-spring-web-utils | src/main/java/org/sparta/springwebutils/util/ExternalEntryPointHelper.java | ExternalEntryPointHelper.getInternalEntryPointParametersRecursively | public static List<EntryPointParameter> getInternalEntryPointParametersRecursively(Class<?> parameterType, Set<Class<?>> typeBlacklist, Set<String> nameBlacklist, int maxDeepLevel) {
return getInternalEntryPointParametersRecursively(parameterType, typeBlacklist, nameBlacklist, null, 1, maxDeepLevel);
} | java | public static List<EntryPointParameter> getInternalEntryPointParametersRecursively(Class<?> parameterType, Set<Class<?>> typeBlacklist, Set<String> nameBlacklist, int maxDeepLevel) {
return getInternalEntryPointParametersRecursively(parameterType, typeBlacklist, nameBlacklist, null, 1, maxDeepLevel);
} | [
"public",
"static",
"List",
"<",
"EntryPointParameter",
">",
"getInternalEntryPointParametersRecursively",
"(",
"Class",
"<",
"?",
">",
"parameterType",
",",
"Set",
"<",
"Class",
"<",
"?",
">",
">",
"typeBlacklist",
",",
"Set",
"<",
"String",
">",
"nameBlacklist... | Deeply finds all the attributes of the supplied class
@param parameterType Type of parameter
@param typeBlacklist blackList by type
@param nameBlacklist blackList by name
@param maxDeepLevel How deep should algorithm go in the object
@return List | [
"Deeply",
"finds",
"all",
"the",
"attributes",
"of",
"the",
"supplied",
"class"
] | train | https://github.com/SpartaTech/sparta-spring-web-utils/blob/f5382474d46a6048d58707fc64e7936277e8b2ce/src/main/java/org/sparta/springwebutils/util/ExternalEntryPointHelper.java#L53-L55 |
leadware/jpersistence-tools | jpersistence-tools-api/src/main/java/net/leadware/persistence/tools/api/validator/jsr303ext/engine/JSR303ValidatorEngine.java | JSR303ValidatorEngine.validate | public <T> void validate(T entity) {
// Obtention de l'ensemble des violations
Set<ConstraintViolation<T>> constraintViolations = validator.validate(entity);
// Si l'ensemble est vide
if(constraintViolations == null || constraintViolations.size() == 0) return;
// Obtention de la première violation
ConstraintViolation<T> first = constraintViolations.iterator().next();
// Obtention du descripteur de la contrainte
ConstraintDescriptor<?> constraintDescriptor = first.getConstraintDescriptor();
// Nom du bean en echec
String entityName = first.getRootBeanClass().getSimpleName();
// Nom de la propriété en echec
String propertyName = first.getPropertyPath().toString();
// Message de violation
String message = first.getMessage();
// Obtention de l'annotation en cours
String[] parameters = buildAnnotationConstraintParameters(constraintDescriptor.getAnnotation());
// On leve une Exception
throw new InvalidEntityInstanceStateException(entityName, propertyName, message, parameters);
} | java | public <T> void validate(T entity) {
// Obtention de l'ensemble des violations
Set<ConstraintViolation<T>> constraintViolations = validator.validate(entity);
// Si l'ensemble est vide
if(constraintViolations == null || constraintViolations.size() == 0) return;
// Obtention de la première violation
ConstraintViolation<T> first = constraintViolations.iterator().next();
// Obtention du descripteur de la contrainte
ConstraintDescriptor<?> constraintDescriptor = first.getConstraintDescriptor();
// Nom du bean en echec
String entityName = first.getRootBeanClass().getSimpleName();
// Nom de la propriété en echec
String propertyName = first.getPropertyPath().toString();
// Message de violation
String message = first.getMessage();
// Obtention de l'annotation en cours
String[] parameters = buildAnnotationConstraintParameters(constraintDescriptor.getAnnotation());
// On leve une Exception
throw new InvalidEntityInstanceStateException(entityName, propertyName, message, parameters);
} | [
"public",
"<",
"T",
">",
"void",
"validate",
"(",
"T",
"entity",
")",
"{",
"// Obtention de l'ensemble des violations\r",
"Set",
"<",
"ConstraintViolation",
"<",
"T",
">>",
"constraintViolations",
"=",
"validator",
".",
"validate",
"(",
"entity",
")",
";",
"// S... | Methode permettant de valider un onjet
@param entity Entité valider
@param <T> Type de l'entite | [
"Methode",
"permettant",
"de",
"valider",
"un",
"onjet"
] | train | https://github.com/leadware/jpersistence-tools/blob/4c15372993584579d7dbb9b23dd4c0c0fdc9e789/jpersistence-tools-api/src/main/java/net/leadware/persistence/tools/api/validator/jsr303ext/engine/JSR303ValidatorEngine.java#L115-L143 |
liferay/com-liferay-commerce | commerce-user-segment-api/src/main/java/com/liferay/commerce/user/segment/service/persistence/CommerceUserSegmentEntryUtil.java | CommerceUserSegmentEntryUtil.removeByG_K | public static CommerceUserSegmentEntry removeByG_K(long groupId, String key)
throws com.liferay.commerce.user.segment.exception.NoSuchUserSegmentEntryException {
return getPersistence().removeByG_K(groupId, key);
} | java | public static CommerceUserSegmentEntry removeByG_K(long groupId, String key)
throws com.liferay.commerce.user.segment.exception.NoSuchUserSegmentEntryException {
return getPersistence().removeByG_K(groupId, key);
} | [
"public",
"static",
"CommerceUserSegmentEntry",
"removeByG_K",
"(",
"long",
"groupId",
",",
"String",
"key",
")",
"throws",
"com",
".",
"liferay",
".",
"commerce",
".",
"user",
".",
"segment",
".",
"exception",
".",
"NoSuchUserSegmentEntryException",
"{",
"return"... | Removes the commerce user segment entry where groupId = ? and key = ? from the database.
@param groupId the group ID
@param key the key
@return the commerce user segment entry that was removed | [
"Removes",
"the",
"commerce",
"user",
"segment",
"entry",
"where",
"groupId",
"=",
"?",
";",
"and",
"key",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-user-segment-api/src/main/java/com/liferay/commerce/user/segment/service/persistence/CommerceUserSegmentEntryUtil.java#L397-L400 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/interproc/ParameterProperty.java | ParameterProperty.setParamWithProperty | public void setParamWithProperty(int param, boolean hasProperty) {
if (param < 0 || param > 31) {
return;
}
if (hasProperty) {
bits |= (1 << param);
} else {
bits &= ~(1 << param);
}
} | java | public void setParamWithProperty(int param, boolean hasProperty) {
if (param < 0 || param > 31) {
return;
}
if (hasProperty) {
bits |= (1 << param);
} else {
bits &= ~(1 << param);
}
} | [
"public",
"void",
"setParamWithProperty",
"(",
"int",
"param",
",",
"boolean",
"hasProperty",
")",
"{",
"if",
"(",
"param",
"<",
"0",
"||",
"param",
">",
"31",
")",
"{",
"return",
";",
"}",
"if",
"(",
"hasProperty",
")",
"{",
"bits",
"|=",
"(",
"1",
... | Set whether or not a parameter might be non-null.
@param param
the parameter index
@param hasProperty
true if the parameter might be non-null, false otherwise | [
"Set",
"whether",
"or",
"not",
"a",
"parameter",
"might",
"be",
"non",
"-",
"null",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/interproc/ParameterProperty.java#L129-L138 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/persist/Logger.java | Logger.writeToLog | public synchronized void writeToLog(Session session, String statement) {
if (logStatements && log != null) {
log.writeStatement(session, statement);
}
} | java | public synchronized void writeToLog(Session session, String statement) {
if (logStatements && log != null) {
log.writeStatement(session, statement);
}
} | [
"public",
"synchronized",
"void",
"writeToLog",
"(",
"Session",
"session",
",",
"String",
"statement",
")",
"{",
"if",
"(",
"logStatements",
"&&",
"log",
"!=",
"null",
")",
"{",
"log",
".",
"writeStatement",
"(",
"session",
",",
"statement",
")",
";",
"}",... | Records a Log entry for the specified SQL statement, on behalf of
the specified Session object.
@param session the Session object for which to record the Log
entry
@param statement the SQL statement to Log
@throws HsqlException if there is a problem recording the entry | [
"Records",
"a",
"Log",
"entry",
"for",
"the",
"specified",
"SQL",
"statement",
"on",
"behalf",
"of",
"the",
"specified",
"Session",
"object",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/persist/Logger.java#L264-L269 |
fedups/com.obdobion.argument | src/main/java/com/obdobion/argument/variables/VariableAssigner.java | VariableAssigner.assignList | private static void assignList(final Field field, final ICmdLineArg<?> arg, final Object target)
throws IllegalAccessException
{
@SuppressWarnings("unchecked")
Collection<Object> alist = (Collection<Object>) field.get(target);
if (alist == null)
{
alist = new ArrayList<>();
field.set(target, alist);
}
for (int v = 0; v < arg.size(); v++)
alist.add(arg.getDelegateOrValue(v));
} | java | private static void assignList(final Field field, final ICmdLineArg<?> arg, final Object target)
throws IllegalAccessException
{
@SuppressWarnings("unchecked")
Collection<Object> alist = (Collection<Object>) field.get(target);
if (alist == null)
{
alist = new ArrayList<>();
field.set(target, alist);
}
for (int v = 0; v < arg.size(); v++)
alist.add(arg.getDelegateOrValue(v));
} | [
"private",
"static",
"void",
"assignList",
"(",
"final",
"Field",
"field",
",",
"final",
"ICmdLineArg",
"<",
"?",
">",
"arg",
",",
"final",
"Object",
"target",
")",
"throws",
"IllegalAccessException",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"C... | This value may not be appropriate for the list. But since this is at
runtime we can't make use of the generics definition they may have
provided on the field. If the value is not what they expect then they
need to provide a --factory set of methods. | [
"This",
"value",
"may",
"not",
"be",
"appropriate",
"for",
"the",
"list",
".",
"But",
"since",
"this",
"is",
"at",
"runtime",
"we",
"can",
"t",
"make",
"use",
"of",
"the",
"generics",
"definition",
"they",
"may",
"have",
"provided",
"on",
"the",
"field",... | train | https://github.com/fedups/com.obdobion.argument/blob/9679aebbeedaef4e592227842fa0e91410708a67/src/main/java/com/obdobion/argument/variables/VariableAssigner.java#L54-L67 |
alkacon/opencms-core | src/org/opencms/util/CmsDataTypeUtil.java | CmsDataTypeUtil.dataImport | public static Object dataImport(String value, String type) throws ClassNotFoundException, IOException {
Class<?> clazz = Class.forName(type);
if (CmsDataTypeUtil.isParseable(clazz)) {
return CmsDataTypeUtil.parse(value, clazz);
}
byte[] data = Base64.decodeBase64(value.getBytes());
return dataDeserialize(data, type);
} | java | public static Object dataImport(String value, String type) throws ClassNotFoundException, IOException {
Class<?> clazz = Class.forName(type);
if (CmsDataTypeUtil.isParseable(clazz)) {
return CmsDataTypeUtil.parse(value, clazz);
}
byte[] data = Base64.decodeBase64(value.getBytes());
return dataDeserialize(data, type);
} | [
"public",
"static",
"Object",
"dataImport",
"(",
"String",
"value",
",",
"String",
"type",
")",
"throws",
"ClassNotFoundException",
",",
"IOException",
"{",
"Class",
"<",
"?",
">",
"clazz",
"=",
"Class",
".",
"forName",
"(",
"type",
")",
";",
"if",
"(",
... | Returns the import data object.<p>
@param value the exported value
@param type the expected data type
@return the import data object
@throws ClassNotFoundException if something goes wrong
@throws IOException if something goes wrong | [
"Returns",
"the",
"import",
"data",
"object",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsDataTypeUtil.java#L120-L128 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/ScientificNumberFormatter.java | ScientificNumberFormatter.getMarkupInstance | public static ScientificNumberFormatter getMarkupInstance(
DecimalFormat df,
String beginMarkup,
String endMarkup) {
return getInstance(
df, new MarkupStyle(beginMarkup, endMarkup));
} | java | public static ScientificNumberFormatter getMarkupInstance(
DecimalFormat df,
String beginMarkup,
String endMarkup) {
return getInstance(
df, new MarkupStyle(beginMarkup, endMarkup));
} | [
"public",
"static",
"ScientificNumberFormatter",
"getMarkupInstance",
"(",
"DecimalFormat",
"df",
",",
"String",
"beginMarkup",
",",
"String",
"endMarkup",
")",
"{",
"return",
"getInstance",
"(",
"df",
",",
"new",
"MarkupStyle",
"(",
"beginMarkup",
",",
"endMarkup",... | Gets a ScientificNumberFormatter instance that uses
markup for exponents.
@param df The DecimalFormat must be configured for scientific
notation. Caller may safely change df after this call as this method
clones it when creating the ScientificNumberFormatter.
@param beginMarkup the markup to start superscript e.g {@code <sup>}
@param endMarkup the markup to end superscript e.g {@code </sup>}
@return The ScientificNumberFormatter instance. | [
"Gets",
"a",
"ScientificNumberFormatter",
"instance",
"that",
"uses",
"markup",
"for",
"exponents",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/ScientificNumberFormatter.java#L92-L98 |
SonarSource/sonarqube | server/sonar-db-dao/src/main/java/org/sonar/db/permission/UserPermissionDao.java | UserPermissionDao.countUsersByProjectPermission | public List<CountPerProjectPermission> countUsersByProjectPermission(DbSession dbSession, Collection<Long> projectIds) {
return executeLargeInputs(projectIds, mapper(dbSession)::countUsersByProjectPermission);
} | java | public List<CountPerProjectPermission> countUsersByProjectPermission(DbSession dbSession, Collection<Long> projectIds) {
return executeLargeInputs(projectIds, mapper(dbSession)::countUsersByProjectPermission);
} | [
"public",
"List",
"<",
"CountPerProjectPermission",
">",
"countUsersByProjectPermission",
"(",
"DbSession",
"dbSession",
",",
"Collection",
"<",
"Long",
">",
"projectIds",
")",
"{",
"return",
"executeLargeInputs",
"(",
"projectIds",
",",
"mapper",
"(",
"dbSession",
... | Count the number of users per permission for a given list of projects
@param projectIds a non-null list of project ids to filter on. If empty then an empty list is returned. | [
"Count",
"the",
"number",
"of",
"users",
"per",
"permission",
"for",
"a",
"given",
"list",
"of",
"projects"
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-db-dao/src/main/java/org/sonar/db/permission/UserPermissionDao.java#L71-L73 |
VoltDB/voltdb | third_party/java/src/org/apache/zookeeper_voltpatches/ZooKeeper.java | ZooKeeper.getChildren | public List<String> getChildren(String path, boolean watch)
throws KeeperException, InterruptedException {
return getChildren(path, watch ? watchManager.defaultWatcher : null);
} | java | public List<String> getChildren(String path, boolean watch)
throws KeeperException, InterruptedException {
return getChildren(path, watch ? watchManager.defaultWatcher : null);
} | [
"public",
"List",
"<",
"String",
">",
"getChildren",
"(",
"String",
"path",
",",
"boolean",
"watch",
")",
"throws",
"KeeperException",
",",
"InterruptedException",
"{",
"return",
"getChildren",
"(",
"path",
",",
"watch",
"?",
"watchManager",
".",
"defaultWatcher... | Return the list of the children of the node of the given path.
<p>
If the watch is true and the call is successful (no exception is thrown),
a watch will be left on the node with the given path. The watch willbe
triggered by a successful operation that deletes the node of the given
path or creates/delete a child under the node.
<p>
The list of children returned is not sorted and no guarantee is provided
as to its natural or lexical order.
<p>
A KeeperException with error code KeeperException.NoNode will be thrown
if no node with the given path exists.
@param path
@param watch
@return an unordered array of children of the node with the given path
@throws InterruptedException
If the server transaction is interrupted.
@throws KeeperException
If the server signals an error with a non-zero error code. | [
"Return",
"the",
"list",
"of",
"the",
"children",
"of",
"the",
"node",
"of",
"the",
"given",
"path",
".",
"<p",
">",
"If",
"the",
"watch",
"is",
"true",
"and",
"the",
"call",
"is",
"successful",
"(",
"no",
"exception",
"is",
"thrown",
")",
"a",
"watc... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/ZooKeeper.java#L1334-L1337 |
gallandarakhneorg/afc | core/vmutils/src/main/java/org/arakhne/afc/vmutil/FileSystem.java | FileSystem.convertStringToURL | @Pure
public static URL convertStringToURL(String urlDescription, boolean allowResourceSearch) {
return convertStringToURL(urlDescription, allowResourceSearch, true, true);
} | java | @Pure
public static URL convertStringToURL(String urlDescription, boolean allowResourceSearch) {
return convertStringToURL(urlDescription, allowResourceSearch, true, true);
} | [
"@",
"Pure",
"public",
"static",
"URL",
"convertStringToURL",
"(",
"String",
"urlDescription",
",",
"boolean",
"allowResourceSearch",
")",
"{",
"return",
"convertStringToURL",
"(",
"urlDescription",
",",
"allowResourceSearch",
",",
"true",
",",
"true",
")",
";",
"... | Convert a string to an URL according to several rules.
<p>The rules are (the first succeeded is replied):
<ul>
<li>if {@code urlDescription} is <code>null</code> or empty, return <code>null</code>;</li>
<li>try to build an {@link URL} with {@code urlDescription} as parameter;</li>
<li>if {@code allowResourceSearch} is <code>true</code> and
{@code urlDescription} starts with {@code "resource:"}, call
{@link Resources#getResource(String)} with the rest of the string as parameter;</li>
<li>if {@code allowResourceSearch} is <code>true</code>, call
{@link Resources#getResource(String)} with the {@code urlDescription} as
parameter;</li>
<li>assuming that the {@code urlDescription} is
a filename, call {@link File#toURI()} to retreive an URI and then
{@link URI#toURL()};</li>
<li>If everything else failed, return <code>null</code>.</li>
</ul>
@param urlDescription is a string which is describing an URL.
@param allowResourceSearch indicates if the convertion must take into account the Java resources.
@return the URL.
@throws IllegalArgumentException is the string could not be formatted to URL.
@see Resources#getResource(String) | [
"Convert",
"a",
"string",
"to",
"an",
"URL",
"according",
"to",
"several",
"rules",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/vmutils/src/main/java/org/arakhne/afc/vmutil/FileSystem.java#L1977-L1980 |
googleads/googleads-java-lib | modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/utils/v201809/shopping/ProductPartitionNode.java | ProductPartitionNode.appendDetailedString | private void appendDetailedString(int level, StringBuilder stringBuilder) {
String pad = Strings.repeat("--", level);
stringBuilder.append(pad).append(this).append(SystemUtils.LINE_SEPARATOR);
for (ProductPartitionNode childNode : getChildren()) {
childNode.appendDetailedString(level + 1, stringBuilder);
}
} | java | private void appendDetailedString(int level, StringBuilder stringBuilder) {
String pad = Strings.repeat("--", level);
stringBuilder.append(pad).append(this).append(SystemUtils.LINE_SEPARATOR);
for (ProductPartitionNode childNode : getChildren()) {
childNode.appendDetailedString(level + 1, stringBuilder);
}
} | [
"private",
"void",
"appendDetailedString",
"(",
"int",
"level",
",",
"StringBuilder",
"stringBuilder",
")",
"{",
"String",
"pad",
"=",
"Strings",
".",
"repeat",
"(",
"\"--\"",
",",
"level",
")",
";",
"stringBuilder",
".",
"append",
"(",
"pad",
")",
".",
"a... | Appends to {@code stringBuidler} a String representation of this node and all of its children.
@param level the level of this node
@param stringBuilder the StringBuilder to append to | [
"Appends",
"to",
"{",
"@code",
"stringBuidler",
"}",
"a",
"String",
"representation",
"of",
"this",
"node",
"and",
"all",
"of",
"its",
"children",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/utils/v201809/shopping/ProductPartitionNode.java#L257-L263 |
GwtMaterialDesign/gwt-material | gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java | MaterialListValueBox.insertItem | public void insertItem(T value, int index, boolean reload) {
index += getIndexOffset();
insertItemInternal(value, index, reload);
} | java | public void insertItem(T value, int index, boolean reload) {
index += getIndexOffset();
insertItemInternal(value, index, reload);
} | [
"public",
"void",
"insertItem",
"(",
"T",
"value",
",",
"int",
"index",
",",
"boolean",
"reload",
")",
"{",
"index",
"+=",
"getIndexOffset",
"(",
")",
";",
"insertItemInternal",
"(",
"value",
",",
"index",
",",
"reload",
")",
";",
"}"
] | Inserts an item into the list box. Has the same effect as
<pre>insertItem(value, item, index)</pre>
@param value the item's value, to be submitted if it is part of a
{@link FormPanel}.
@param index the index at which to insert it
@param reload perform a 'material select' reload to update the DOM. | [
"Inserts",
"an",
"item",
"into",
"the",
"list",
"box",
".",
"Has",
"the",
"same",
"effect",
"as",
"<pre",
">",
"insertItem",
"(",
"value",
"item",
"index",
")",
"<",
"/",
"pre",
">"
] | train | https://github.com/GwtMaterialDesign/gwt-material/blob/86feefb282b007c0a44784c09e651a50f257138e/gwt-material/src/main/java/gwt/material/design/client/ui/MaterialListValueBox.java#L320-L323 |
Twitter4J/Twitter4J | twitter4j-core/src/internal-json/java/twitter4j/JSONImplFactory.java | JSONImplFactory.createHashtagEntity | public static HashtagEntity createHashtagEntity(int start, int end, String text) {
return new HashtagEntityJSONImpl(start, end, text);
} | java | public static HashtagEntity createHashtagEntity(int start, int end, String text) {
return new HashtagEntityJSONImpl(start, end, text);
} | [
"public",
"static",
"HashtagEntity",
"createHashtagEntity",
"(",
"int",
"start",
",",
"int",
"end",
",",
"String",
"text",
")",
"{",
"return",
"new",
"HashtagEntityJSONImpl",
"(",
"start",
",",
"end",
",",
"text",
")",
";",
"}"
] | static factory method for twitter-text-java
@return hashtag entity
@since Twitter4J 2.2.6 | [
"static",
"factory",
"method",
"for",
"twitter",
"-",
"text",
"-",
"java"
] | train | https://github.com/Twitter4J/Twitter4J/blob/8376fade8d557896bb9319fb46e39a55b134b166/twitter4j-core/src/internal-json/java/twitter4j/JSONImplFactory.java#L274-L276 |
sawano/java-commons | src/main/java/se/sawano/java/commons/lang/validate/Validate.java | Validate.exclusiveBetween | public static double exclusiveBetween(double start, double end, double value, String message) {
return INSTANCE.exclusiveBetween(start, end, value, message);
} | java | public static double exclusiveBetween(double start, double end, double value, String message) {
return INSTANCE.exclusiveBetween(start, end, value, message);
} | [
"public",
"static",
"double",
"exclusiveBetween",
"(",
"double",
"start",
",",
"double",
"end",
",",
"double",
"value",
",",
"String",
"message",
")",
"{",
"return",
"INSTANCE",
".",
"exclusiveBetween",
"(",
"start",
",",
"end",
",",
"value",
",",
"message",... | Validate that the specified primitive value falls between the two exclusive values specified; otherwise, throws an exception with the specified message.
<pre>Validate.exclusiveBetween(0.1, 2.1, 1.1, "Not in range");</pre>
@param start
the exclusive start value
@param end
the exclusive end value
@param value
the value to validate
@param message
the exception message if invalid, not null
@return the value
@throws IllegalArgumentValidationException
if the value falls outside the boundaries | [
"Validate",
"that",
"the",
"specified",
"primitive",
"value",
"falls",
"between",
"the",
"two",
"exclusive",
"values",
"specified",
";",
"otherwise",
"throws",
"an",
"exception",
"with",
"the",
"specified",
"message",
".",
"<pre",
">",
"Validate",
".",
"exclusiv... | train | https://github.com/sawano/java-commons/blob/6f219c9e8dec4401dbe528d17ae6ec1ef9c0d284/src/main/java/se/sawano/java/commons/lang/validate/Validate.java#L1685-L1687 |
graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/util/AbstractFlagEncoder.java | AbstractFlagEncoder.createEncodedValues | public void createEncodedValues(List<EncodedValue> registerNewEncodedValue, String prefix, int index) {
// define the first 2 speedBits in flags for routing
registerNewEncodedValue.add(accessEnc = new SimpleBooleanEncodedValue(prefix + "access", true));
roundaboutEnc = getBooleanEncodedValue(EncodingManager.ROUNDABOUT);
encoderBit = 1L << index;
} | java | public void createEncodedValues(List<EncodedValue> registerNewEncodedValue, String prefix, int index) {
// define the first 2 speedBits in flags for routing
registerNewEncodedValue.add(accessEnc = new SimpleBooleanEncodedValue(prefix + "access", true));
roundaboutEnc = getBooleanEncodedValue(EncodingManager.ROUNDABOUT);
encoderBit = 1L << index;
} | [
"public",
"void",
"createEncodedValues",
"(",
"List",
"<",
"EncodedValue",
">",
"registerNewEncodedValue",
",",
"String",
"prefix",
",",
"int",
"index",
")",
"{",
"// define the first 2 speedBits in flags for routing",
"registerNewEncodedValue",
".",
"add",
"(",
"accessEn... | Defines bits used for edge flags used for access, speed etc.
@return incremented shift value pointing behind the last used bit | [
"Defines",
"bits",
"used",
"for",
"edge",
"flags",
"used",
"for",
"access",
"speed",
"etc",
"."
] | train | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/util/AbstractFlagEncoder.java#L168-L173 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java | AppServiceEnvironmentsInner.updateMultiRolePool | public WorkerPoolResourceInner updateMultiRolePool(String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope) {
return updateMultiRolePoolWithServiceResponseAsync(resourceGroupName, name, multiRolePoolEnvelope).toBlocking().single().body();
} | java | public WorkerPoolResourceInner updateMultiRolePool(String resourceGroupName, String name, WorkerPoolResourceInner multiRolePoolEnvelope) {
return updateMultiRolePoolWithServiceResponseAsync(resourceGroupName, name, multiRolePoolEnvelope).toBlocking().single().body();
} | [
"public",
"WorkerPoolResourceInner",
"updateMultiRolePool",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
",",
"WorkerPoolResourceInner",
"multiRolePoolEnvelope",
")",
"{",
"return",
"updateMultiRolePoolWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"nam... | Create or update a multi-role pool.
Create or update a multi-role pool.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service Environment.
@param multiRolePoolEnvelope Properties of the multi-role pool.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by server
@throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
@return the WorkerPoolResourceInner object if successful. | [
"Create",
"or",
"update",
"a",
"multi",
"-",
"role",
"pool",
".",
"Create",
"or",
"update",
"a",
"multi",
"-",
"role",
"pool",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java#L2456-L2458 |
hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/SystemUtil.java | SystemUtil.createTempDirectory | public static File createTempDirectory(String _path, String _prefix, int _length, boolean _timestamp, boolean _deleteOnExit) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd_HHmmss-SSS");
String randomStr = StringUtil.randomString(_length);
StringBuilder fileName = new StringBuilder();
if (_prefix != null) {
fileName.append(_prefix);
}
fileName.append(randomStr);
if (_timestamp) {
fileName.append("_").append(formatter.format(new Date()));
}
File result = createTempDirectory(_path, fileName.toString(), _deleteOnExit);
while (result == null) {
result = createTempDirectory(_path, _prefix, _length, _timestamp, _deleteOnExit);
}
return result;
} | java | public static File createTempDirectory(String _path, String _prefix, int _length, boolean _timestamp, boolean _deleteOnExit) {
SimpleDateFormat formatter = new SimpleDateFormat("yyyyMMdd_HHmmss-SSS");
String randomStr = StringUtil.randomString(_length);
StringBuilder fileName = new StringBuilder();
if (_prefix != null) {
fileName.append(_prefix);
}
fileName.append(randomStr);
if (_timestamp) {
fileName.append("_").append(formatter.format(new Date()));
}
File result = createTempDirectory(_path, fileName.toString(), _deleteOnExit);
while (result == null) {
result = createTempDirectory(_path, _prefix, _length, _timestamp, _deleteOnExit);
}
return result;
} | [
"public",
"static",
"File",
"createTempDirectory",
"(",
"String",
"_path",
",",
"String",
"_prefix",
",",
"int",
"_length",
",",
"boolean",
"_timestamp",
",",
"boolean",
"_deleteOnExit",
")",
"{",
"SimpleDateFormat",
"formatter",
"=",
"new",
"SimpleDateFormat",
"(... | Creates a temporary directory in the given path.
You can specify certain files to get a random unique name.
@param _path where to place the temp folder
@param _prefix prefix of the folder
@param _length length of random chars
@param _timestamp add timestamp (yyyyMMdd_HHmmss-SSS) to directory name
@param _deleteOnExit mark directory for deletion on jvm termination
@return file | [
"Creates",
"a",
"temporary",
"directory",
"in",
"the",
"given",
"path",
".",
"You",
"can",
"specify",
"certain",
"files",
"to",
"get",
"a",
"random",
"unique",
"name",
"."
] | train | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/SystemUtil.java#L228-L247 |
op4j/op4j | src/main/java/org/op4j/Op.java | Op.onArrayFor | public static <T> Level0ArrayOperator<BigDecimal[],BigDecimal> onArrayFor(final BigDecimal... elements) {
return onArrayOf(Types.BIG_DECIMAL, VarArgsUtil.asRequiredObjectArray(elements));
} | java | public static <T> Level0ArrayOperator<BigDecimal[],BigDecimal> onArrayFor(final BigDecimal... elements) {
return onArrayOf(Types.BIG_DECIMAL, VarArgsUtil.asRequiredObjectArray(elements));
} | [
"public",
"static",
"<",
"T",
">",
"Level0ArrayOperator",
"<",
"BigDecimal",
"[",
"]",
",",
"BigDecimal",
">",
"onArrayFor",
"(",
"final",
"BigDecimal",
"...",
"elements",
")",
"{",
"return",
"onArrayOf",
"(",
"Types",
".",
"BIG_DECIMAL",
",",
"VarArgsUtil",
... | <p>
Creates an array with the specified elements and an <i>operation expression</i> on it.
</p>
@param elements the elements of the array being created
@return an operator, ready for chaining | [
"<p",
">",
"Creates",
"an",
"array",
"with",
"the",
"specified",
"elements",
"and",
"an",
"<i",
">",
"operation",
"expression<",
"/",
"i",
">",
"on",
"it",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/Op.java#L1010-L1012 |
stephanenicolas/robospice | robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/SpiceManager.java | SpiceManager.addListenerIfPending | public <T> void addListenerIfPending(final Class<T> clazz, final Object requestCacheKey, final PendingRequestListener<T> requestListener) {
addListenerIfPending(clazz, requestCacheKey, (RequestListener<T>) requestListener);
} | java | public <T> void addListenerIfPending(final Class<T> clazz, final Object requestCacheKey, final PendingRequestListener<T> requestListener) {
addListenerIfPending(clazz, requestCacheKey, (RequestListener<T>) requestListener);
} | [
"public",
"<",
"T",
">",
"void",
"addListenerIfPending",
"(",
"final",
"Class",
"<",
"T",
">",
"clazz",
",",
"final",
"Object",
"requestCacheKey",
",",
"final",
"PendingRequestListener",
"<",
"T",
">",
"requestListener",
")",
"{",
"addListenerIfPending",
"(",
... | Add listener to a pending request if it exists. If no such request
exists, this method calls onRequestNotFound on the listener. If a request
identified by clazz and requestCacheKey, it will receive an additional
listener.
@param clazz
the class of the result of the pending request to look for.
@param requestCacheKey
the key used to store and retrieve the result of the request
in the cache
@param requestListener
the listener to notify when the request will finish. | [
"Add",
"listener",
"to",
"a",
"pending",
"request",
"if",
"it",
"exists",
".",
"If",
"no",
"such",
"request",
"exists",
"this",
"method",
"calls",
"onRequestNotFound",
"on",
"the",
"listener",
".",
"If",
"a",
"request",
"identified",
"by",
"clazz",
"and",
... | train | https://github.com/stephanenicolas/robospice/blob/8bffde88b3534a961a13cab72a8f07a755f0a0fe/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/SpiceManager.java#L429-L431 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionPersistenceImpl.java | CPDefinitionPersistenceImpl.findByCPTaxCategoryId | @Override
public List<CPDefinition> findByCPTaxCategoryId(long CPTaxCategoryId,
int start, int end) {
return findByCPTaxCategoryId(CPTaxCategoryId, start, end, null);
} | java | @Override
public List<CPDefinition> findByCPTaxCategoryId(long CPTaxCategoryId,
int start, int end) {
return findByCPTaxCategoryId(CPTaxCategoryId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPDefinition",
">",
"findByCPTaxCategoryId",
"(",
"long",
"CPTaxCategoryId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByCPTaxCategoryId",
"(",
"CPTaxCategoryId",
",",
"start",
",",
"end",
",",
"n... | Returns a range of all the cp definitions where CPTaxCategoryId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link CPDefinitionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
</p>
@param CPTaxCategoryId the cp tax category ID
@param start the lower bound of the range of cp definitions
@param end the upper bound of the range of cp definitions (not inclusive)
@return the range of matching cp definitions | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"cp",
"definitions",
"where",
"CPTaxCategoryId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionPersistenceImpl.java#L2537-L2541 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java | ApiOvhIp.ip_firewall_POST | public OvhFirewallIp ip_firewall_POST(String ip, String ipOnFirewall) throws IOException {
String qPath = "/ip/{ip}/firewall";
StringBuilder sb = path(qPath, ip);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "ipOnFirewall", ipOnFirewall);
String resp = exec(qPath, "POST", sb.toString(), o);
return convertTo(resp, OvhFirewallIp.class);
} | java | public OvhFirewallIp ip_firewall_POST(String ip, String ipOnFirewall) throws IOException {
String qPath = "/ip/{ip}/firewall";
StringBuilder sb = path(qPath, ip);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "ipOnFirewall", ipOnFirewall);
String resp = exec(qPath, "POST", sb.toString(), o);
return convertTo(resp, OvhFirewallIp.class);
} | [
"public",
"OvhFirewallIp",
"ip_firewall_POST",
"(",
"String",
"ip",
",",
"String",
"ipOnFirewall",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ip/{ip}/firewall\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"ip",
")",
";",
"... | AntiDDOS option. Add new IP on firewall
REST: POST /ip/{ip}/firewall
@param ipOnFirewall [required]
@param ip [required] | [
"AntiDDOS",
"option",
".",
"Add",
"new",
"IP",
"on",
"firewall"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L989-L996 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpx/TaskModel.java | TaskModel.isFieldPopulated | @SuppressWarnings("unchecked") private boolean isFieldPopulated(Task task, TaskField field)
{
boolean result = false;
if (field != null)
{
Object value = task.getCachedValue(field);
switch (field)
{
case PREDECESSORS:
case SUCCESSORS:
{
result = value != null && !((List<Relation>) value).isEmpty();
break;
}
default:
{
result = value != null;
break;
}
}
}
return result;
} | java | @SuppressWarnings("unchecked") private boolean isFieldPopulated(Task task, TaskField field)
{
boolean result = false;
if (field != null)
{
Object value = task.getCachedValue(field);
switch (field)
{
case PREDECESSORS:
case SUCCESSORS:
{
result = value != null && !((List<Relation>) value).isEmpty();
break;
}
default:
{
result = value != null;
break;
}
}
}
return result;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"boolean",
"isFieldPopulated",
"(",
"Task",
"task",
",",
"TaskField",
"field",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"if",
"(",
"field",
"!=",
"null",
")",
"{",
"Object",
"value",
"... | Determine if a task field contains data.
@param task task instance
@param field target field
@return true if the field contains data | [
"Determine",
"if",
"a",
"task",
"field",
"contains",
"data",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpx/TaskModel.java#L175-L198 |
alkacon/opencms-core | src/org/opencms/main/OpenCmsSolrHandler.java | OpenCmsSolrHandler.doGet | @Override
public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException {
handle(req, res, HANDLER_NAMES.SolrSelect.toString());
} | java | @Override
public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException {
handle(req, res, HANDLER_NAMES.SolrSelect.toString());
} | [
"@",
"Override",
"public",
"void",
"doGet",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
")",
"throws",
"IOException",
"{",
"handle",
"(",
"req",
",",
"res",
",",
"HANDLER_NAMES",
".",
"SolrSelect",
".",
"toString",
"(",
")",
")",
";"... | OpenCms servlet main request handling method.<p>
@see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) | [
"OpenCms",
"servlet",
"main",
"request",
"handling",
"method",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/main/OpenCmsSolrHandler.java#L124-L128 |
alkacon/opencms-core | src/org/opencms/ugc/CmsUgcSession.java | CmsUgcSession.updateUploadResource | private void updateUploadResource(String fieldName, CmsResource upload) {
CmsResource prevUploadResource = m_uploadResourcesByField.get(fieldName);
if (prevUploadResource != null) {
try {
m_cms.deleteResource(m_cms.getSitePath(prevUploadResource), CmsResource.DELETE_PRESERVE_SIBLINGS);
} catch (Exception e) {
LOG.error("Couldn't delete previous upload resource: " + e.getLocalizedMessage(), e);
}
}
m_uploadResourcesByField.put(fieldName, upload);
} | java | private void updateUploadResource(String fieldName, CmsResource upload) {
CmsResource prevUploadResource = m_uploadResourcesByField.get(fieldName);
if (prevUploadResource != null) {
try {
m_cms.deleteResource(m_cms.getSitePath(prevUploadResource), CmsResource.DELETE_PRESERVE_SIBLINGS);
} catch (Exception e) {
LOG.error("Couldn't delete previous upload resource: " + e.getLocalizedMessage(), e);
}
}
m_uploadResourcesByField.put(fieldName, upload);
} | [
"private",
"void",
"updateUploadResource",
"(",
"String",
"fieldName",
",",
"CmsResource",
"upload",
")",
"{",
"CmsResource",
"prevUploadResource",
"=",
"m_uploadResourcesByField",
".",
"get",
"(",
"fieldName",
")",
";",
"if",
"(",
"prevUploadResource",
"!=",
"null"... | Stores the upload resource and deletes previously uploaded resources for the same form field.<p>
@param fieldName the field name
@param upload the uploaded resource | [
"Stores",
"the",
"upload",
"resource",
"and",
"deletes",
"previously",
"uploaded",
"resources",
"for",
"the",
"same",
"form",
"field",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ugc/CmsUgcSession.java#L843-L854 |
hap-java/HAP-Java | src/main/java/io/github/hapjava/HomekitServer.java | HomekitServer.createStandaloneAccessory | public HomekitStandaloneAccessoryServer createStandaloneAccessory(
HomekitAuthInfo authInfo, HomekitAccessory accessory) throws IOException {
return new HomekitStandaloneAccessoryServer(accessory, http, localAddress, authInfo);
} | java | public HomekitStandaloneAccessoryServer createStandaloneAccessory(
HomekitAuthInfo authInfo, HomekitAccessory accessory) throws IOException {
return new HomekitStandaloneAccessoryServer(accessory, http, localAddress, authInfo);
} | [
"public",
"HomekitStandaloneAccessoryServer",
"createStandaloneAccessory",
"(",
"HomekitAuthInfo",
"authInfo",
",",
"HomekitAccessory",
"accessory",
")",
"throws",
"IOException",
"{",
"return",
"new",
"HomekitStandaloneAccessoryServer",
"(",
"accessory",
",",
"http",
",",
"... | Creates a single (non-bridge) accessory
@param authInfo authentication information for this accessory. These values should be persisted
and re-supplied on re-start of your application.
@param accessory accessory implementation. This will usually be an implementation of an
interface in {#link io.github.hapjava.accessories io.github.hapjava.accessories}.
@return the newly created server. Call {@link HomekitStandaloneAccessoryServer#start start} on
this to begin.
@throws IOException when mDNS cannot connect to the network | [
"Creates",
"a",
"single",
"(",
"non",
"-",
"bridge",
")",
"accessory"
] | train | https://github.com/hap-java/HAP-Java/blob/d2b2f4f1579580a2b5958af3a192128345843db9/src/main/java/io/github/hapjava/HomekitServer.java#L83-L86 |
avarabyeu/jashing | extensions/jashing-cvs/src/main/java/com/github/avarabyeu/jashing/integration/vcs/AbstractVcsModule.java | AbstractVcsModule.loadConfiguration | @Provides
public VCSConfiguration loadConfiguration(Gson gson) {
try {
URL resource = ResourceUtils.getResourceAsURL(VCS_CONFIG_JSON);
if (null == resource) {
throw new IncorrectConfigurationException("Unable to find VCS configuration");
}
return gson.fromJson(Resources.asCharSource(resource, Charsets.UTF_8).openStream(),
VCSConfiguration.class);
} catch (IOException e) {
throw new IncorrectConfigurationException("Unable to read VCS configuration", e);
}
} | java | @Provides
public VCSConfiguration loadConfiguration(Gson gson) {
try {
URL resource = ResourceUtils.getResourceAsURL(VCS_CONFIG_JSON);
if (null == resource) {
throw new IncorrectConfigurationException("Unable to find VCS configuration");
}
return gson.fromJson(Resources.asCharSource(resource, Charsets.UTF_8).openStream(),
VCSConfiguration.class);
} catch (IOException e) {
throw new IncorrectConfigurationException("Unable to read VCS configuration", e);
}
} | [
"@",
"Provides",
"public",
"VCSConfiguration",
"loadConfiguration",
"(",
"Gson",
"gson",
")",
"{",
"try",
"{",
"URL",
"resource",
"=",
"ResourceUtils",
".",
"getResourceAsURL",
"(",
"VCS_CONFIG_JSON",
")",
";",
"if",
"(",
"null",
"==",
"resource",
")",
"{",
... | Loads VCS configuration
@param gson GSON for deserialization
@return Loaded configuration | [
"Loads",
"VCS",
"configuration"
] | train | https://github.com/avarabyeu/jashing/blob/fcc6ec67e2663eb1dde8cbacff5e660ca717cbc8/extensions/jashing-cvs/src/main/java/com/github/avarabyeu/jashing/integration/vcs/AbstractVcsModule.java#L52-L64 |
OpenTSDB/opentsdb | src/tools/ArgP.java | ArgP.get | public String get(final String name, final String defaultv) {
final String value = get(name);
return value == null ? defaultv : value;
} | java | public String get(final String name, final String defaultv) {
final String value = get(name);
return value == null ? defaultv : value;
} | [
"public",
"String",
"get",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"defaultv",
")",
"{",
"final",
"String",
"value",
"=",
"get",
"(",
"name",
")",
";",
"return",
"value",
"==",
"null",
"?",
"defaultv",
":",
"value",
";",
"}"
] | Returns the value of the given option, or a default value.
@param name The name of the option to recognize (e.g. {@code --foo}).
@param defaultv The default value to return if the option wasn't given.
@throws IllegalArgumentException if this option wasn't registered with
{@link #addOption}.
@throws IllegalStateException if {@link #parse} wasn't called. | [
"Returns",
"the",
"value",
"of",
"the",
"given",
"option",
"or",
"a",
"default",
"value",
"."
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/ArgP.java#L199-L202 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jaxrs.2.0.common/src/org/apache/cxf/common/logging/LogUtils.java | LogUtils.getLogger | public static Logger getLogger(Class<?> cls, String resourcename) {
//Liberty Change for CXF Begin
return createLogger(cls, resourcename, cls.getName() + cls.getClassLoader());
//Liberty Change for CXF End
} | java | public static Logger getLogger(Class<?> cls, String resourcename) {
//Liberty Change for CXF Begin
return createLogger(cls, resourcename, cls.getName() + cls.getClassLoader());
//Liberty Change for CXF End
} | [
"public",
"static",
"Logger",
"getLogger",
"(",
"Class",
"<",
"?",
">",
"cls",
",",
"String",
"resourcename",
")",
"{",
"//Liberty Change for CXF Begin",
"return",
"createLogger",
"(",
"cls",
",",
"resourcename",
",",
"cls",
".",
"getName",
"(",
")",
"+",
"c... | Get a Logger with an associated resource bundle.
@param cls the Class to contain the Logger
@param resourcename the resource name
@return an appropriate Logger | [
"Get",
"a",
"Logger",
"with",
"an",
"associated",
"resource",
"bundle",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxrs.2.0.common/src/org/apache/cxf/common/logging/LogUtils.java#L175-L179 |
alkacon/opencms-core | src/org/opencms/workflow/CmsExtendedWorkflowManager.java | CmsExtendedWorkflowManager.generateProjectName | protected String generateProjectName(CmsObject userCms, boolean shortTime) {
CmsUser user = userCms.getRequestContext().getCurrentUser();
long time = System.currentTimeMillis();
Date date = new Date(time);
OpenCms.getLocaleManager();
Locale locale = CmsLocaleManager.getDefaultLocale();
DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.SHORT, locale);
DateFormat timeFormat = DateFormat.getTimeInstance(shortTime ? DateFormat.SHORT : DateFormat.MEDIUM, locale);
String dateStr = dateFormat.format(date) + " " + timeFormat.format(date);
String username = user.getName();
String result = Messages.get().getBundle(locale).key(Messages.GUI_WORKFLOW_PROJECT_NAME_2, username, dateStr);
result = result.replaceAll("/", "|");
return result;
} | java | protected String generateProjectName(CmsObject userCms, boolean shortTime) {
CmsUser user = userCms.getRequestContext().getCurrentUser();
long time = System.currentTimeMillis();
Date date = new Date(time);
OpenCms.getLocaleManager();
Locale locale = CmsLocaleManager.getDefaultLocale();
DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.SHORT, locale);
DateFormat timeFormat = DateFormat.getTimeInstance(shortTime ? DateFormat.SHORT : DateFormat.MEDIUM, locale);
String dateStr = dateFormat.format(date) + " " + timeFormat.format(date);
String username = user.getName();
String result = Messages.get().getBundle(locale).key(Messages.GUI_WORKFLOW_PROJECT_NAME_2, username, dateStr);
result = result.replaceAll("/", "|");
return result;
} | [
"protected",
"String",
"generateProjectName",
"(",
"CmsObject",
"userCms",
",",
"boolean",
"shortTime",
")",
"{",
"CmsUser",
"user",
"=",
"userCms",
".",
"getRequestContext",
"(",
")",
".",
"getCurrentUser",
"(",
")",
";",
"long",
"time",
"=",
"System",
".",
... | Generates the name for a new workflow project based on the user for whom it is created.<p>
@param userCms the user's current CMS context
@param shortTime if true, the short time format will be used, else the medium time format
@return the workflow project name | [
"Generates",
"the",
"name",
"for",
"a",
"new",
"workflow",
"project",
"based",
"on",
"the",
"user",
"for",
"whom",
"it",
"is",
"created",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workflow/CmsExtendedWorkflowManager.java#L521-L536 |
alexa/alexa-skills-kit-sdk-for-java | ask-sdk-runtime/src/com/amazon/ask/response/template/impl/BaseTemplateFactory.java | BaseTemplateFactory.processTemplate | @Override
public Output processTemplate(String responseTemplateName, Map<String, Object> dataMap, Input input) throws TemplateFactoryException {
if (templateLoaders == null || templateLoaders.isEmpty() || templateRenderer == null) {
String message = "Template Loader list is null or empty, or Template Renderer is null.";
LOGGER.error(message);
throw new TemplateFactoryException(message);
}
TemplateContentData templateContentData = loadTemplate(responseTemplateName, input);
Output response = renderResponse(templateContentData, dataMap);
return response;
} | java | @Override
public Output processTemplate(String responseTemplateName, Map<String, Object> dataMap, Input input) throws TemplateFactoryException {
if (templateLoaders == null || templateLoaders.isEmpty() || templateRenderer == null) {
String message = "Template Loader list is null or empty, or Template Renderer is null.";
LOGGER.error(message);
throw new TemplateFactoryException(message);
}
TemplateContentData templateContentData = loadTemplate(responseTemplateName, input);
Output response = renderResponse(templateContentData, dataMap);
return response;
} | [
"@",
"Override",
"public",
"Output",
"processTemplate",
"(",
"String",
"responseTemplateName",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"dataMap",
",",
"Input",
"input",
")",
"throws",
"TemplateFactoryException",
"{",
"if",
"(",
"templateLoaders",
"==",
"n... | Process template and data using provided {@link TemplateLoader} and {@link TemplateRenderer} to generate skill response output.
@param responseTemplateName name of response template
@param dataMap map contains injecting data
@param input skill input
@return Output skill response output if loading and rendering successfully
@throws TemplateFactoryException if fail to load or render template | [
"Process",
"template",
"and",
"data",
"using",
"provided",
"{",
"@link",
"TemplateLoader",
"}",
"and",
"{",
"@link",
"TemplateRenderer",
"}",
"to",
"generate",
"skill",
"response",
"output",
"."
] | train | https://github.com/alexa/alexa-skills-kit-sdk-for-java/blob/c49194da0693898c70f3f2c4a372f5a12da04e3e/ask-sdk-runtime/src/com/amazon/ask/response/template/impl/BaseTemplateFactory.java#L64-L74 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dbaasqueue/src/main/java/net/minidev/ovh/api/ApiOvhDbaasqueue.java | ApiOvhDbaasqueue.serviceName_topic_topicId_DELETE | public void serviceName_topic_topicId_DELETE(String serviceName, String topicId) throws IOException {
String qPath = "/dbaas/queue/{serviceName}/topic/{topicId}";
StringBuilder sb = path(qPath, serviceName, topicId);
exec(qPath, "DELETE", sb.toString(), null);
} | java | public void serviceName_topic_topicId_DELETE(String serviceName, String topicId) throws IOException {
String qPath = "/dbaas/queue/{serviceName}/topic/{topicId}";
StringBuilder sb = path(qPath, serviceName, topicId);
exec(qPath, "DELETE", sb.toString(), null);
} | [
"public",
"void",
"serviceName_topic_topicId_DELETE",
"(",
"String",
"serviceName",
",",
"String",
"topicId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dbaas/queue/{serviceName}/topic/{topicId}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPat... | Delete a topic
REST: DELETE /dbaas/queue/{serviceName}/topic/{topicId}
@param serviceName [required] Application ID
@param topicId [required] Topic ID
API beta | [
"Delete",
"a",
"topic"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dbaasqueue/src/main/java/net/minidev/ovh/api/ApiOvhDbaasqueue.java#L258-L262 |
OpenLiberty/open-liberty | dev/com.ibm.ws.artifact.url/src/com/ibm/ws/artifact/url/internal/WSJarURLStreamHandler.java | WSJarURLStreamHandler.constructUNCTolerantURL | protected static URL constructUNCTolerantURL(String protocolPrefix, String urlString) throws IOException {
int protocolDelimiterIndex = urlString.indexOf(':');
String urlProtocol, urlPath;
if (protocolDelimiterIndex < 0 || !(urlProtocol = urlString.substring(0, protocolDelimiterIndex)).equalsIgnoreCase(protocolPrefix)) {
throw new IOException("invalid protocol prefix: the passed urlString: " + urlString + " is not of the specified protocol: " + protocolPrefix);
}
urlPath = urlString.substring(protocolDelimiterIndex + 1);
// By using this constructor we make sure the JDK does not attempt to interpret leading characters
// as a host name. This assures that any embedded UNC encoded string prefixes are ignored and
// subsequent calls to getPath on this URL will always return the full path string (including the
// UNC host prefix).
URL jarURL = Utils.newURL(urlProtocol, "", -1, urlPath);
return jarURL;
} | java | protected static URL constructUNCTolerantURL(String protocolPrefix, String urlString) throws IOException {
int protocolDelimiterIndex = urlString.indexOf(':');
String urlProtocol, urlPath;
if (protocolDelimiterIndex < 0 || !(urlProtocol = urlString.substring(0, protocolDelimiterIndex)).equalsIgnoreCase(protocolPrefix)) {
throw new IOException("invalid protocol prefix: the passed urlString: " + urlString + " is not of the specified protocol: " + protocolPrefix);
}
urlPath = urlString.substring(protocolDelimiterIndex + 1);
// By using this constructor we make sure the JDK does not attempt to interpret leading characters
// as a host name. This assures that any embedded UNC encoded string prefixes are ignored and
// subsequent calls to getPath on this URL will always return the full path string (including the
// UNC host prefix).
URL jarURL = Utils.newURL(urlProtocol, "", -1, urlPath);
return jarURL;
} | [
"protected",
"static",
"URL",
"constructUNCTolerantURL",
"(",
"String",
"protocolPrefix",
",",
"String",
"urlString",
")",
"throws",
"IOException",
"{",
"int",
"protocolDelimiterIndex",
"=",
"urlString",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"String",
"urlProto... | <liberty> brought across from ClassLoaderUtils from /SERV1/ws/code/classloader/src/com/ibm/ws/classloader/</liberty>
A method for constructing a purely path based URL from an input string that may
optionally contain UNC compliant host names. Examples of properly formatted urlString inputs
are as follows:
Remote file system (UNC convention)
protocolPrefix://host/path
protocolPrefix:////host/path
Local file system
protocolPrefix:/path
protocolPrefix:/C:/path
The input urlString is validated such that it must begin with the protocolPrefix.
Note: UNC paths are used by several OS platforms to map remote file systems. Using this
method guarantees that even if the pathComponent contains a UNC based host, the host
prefix of the path will be treated as path information and not interpreted as a host
component part of the URL returned by this method.
@param protocolPrefix The String which is used verify the presence of the urlString protocol before it is removed.
@param urlString A string which will be processed, parsed and used to construct a Hostless URL.
@return A URL that is constructed consisting of only path information (no implicit host information).
@throws IOException is Thrown if the input urlString does not begin with the specified protocolPrefix. | [
"<liberty",
">",
"brought",
"across",
"from",
"ClassLoaderUtils",
"from",
"/",
"SERV1",
"/",
"ws",
"/",
"code",
"/",
"classloader",
"/",
"src",
"/",
"com",
"/",
"ibm",
"/",
"ws",
"/",
"classloader",
"/",
"<",
"/",
"liberty",
">",
"A",
"method",
"for",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.artifact.url/src/com/ibm/ws/artifact/url/internal/WSJarURLStreamHandler.java#L426-L440 |
xiancloud/xian | xian-core/src/main/java/info/xiancloud/core/support/cos/CloudFile.java | CloudFile.save | @SuppressWarnings("unused")
public static Completable save(String path, String data) {
Map<String, Object> map = new HashMap<String, Object>() {{
put("path", path);
put("data", data);
}};
return SingleRxXian.call("cosService", "cosWrite", map).toCompletable();
} | java | @SuppressWarnings("unused")
public static Completable save(String path, String data) {
Map<String, Object> map = new HashMap<String, Object>() {{
put("path", path);
put("data", data);
}};
return SingleRxXian.call("cosService", "cosWrite", map).toCompletable();
} | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"public",
"static",
"Completable",
"save",
"(",
"String",
"path",
",",
"String",
"data",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",... | 保存文件到云上,阻塞直到保存成功返回
@param path 文件相对路径
@param data 文件内容
@return successful/unsuccessful unit response | [
"保存文件到云上,阻塞直到保存成功返回"
] | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-core/src/main/java/info/xiancloud/core/support/cos/CloudFile.java#L26-L33 |
Azure/azure-sdk-for-java | compute/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/compute/v2018_04_01/implementation/SnapshotsInner.java | SnapshotsInner.createOrUpdateAsync | public Observable<SnapshotInner> createOrUpdateAsync(String resourceGroupName, String snapshotName, SnapshotInner snapshot) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, snapshotName, snapshot).map(new Func1<ServiceResponse<SnapshotInner>, SnapshotInner>() {
@Override
public SnapshotInner call(ServiceResponse<SnapshotInner> response) {
return response.body();
}
});
} | java | public Observable<SnapshotInner> createOrUpdateAsync(String resourceGroupName, String snapshotName, SnapshotInner snapshot) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, snapshotName, snapshot).map(new Func1<ServiceResponse<SnapshotInner>, SnapshotInner>() {
@Override
public SnapshotInner call(ServiceResponse<SnapshotInner> response) {
return response.body();
}
});
} | [
"public",
"Observable",
"<",
"SnapshotInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"snapshotName",
",",
"SnapshotInner",
"snapshot",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"sna... | Creates or updates a snapshot.
@param resourceGroupName The name of the resource group.
@param snapshotName The name of the snapshot that is being created. The name can't be changed after the snapshot is created. Supported characters for the name are a-z, A-Z, 0-9 and _. The max name length is 80 characters.
@param snapshot Snapshot object supplied in the body of the Put disk operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable for the request | [
"Creates",
"or",
"updates",
"a",
"snapshot",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/compute/v2018_04_01/implementation/SnapshotsInner.java#L171-L178 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java | ScopedServletUtils.removeScopedSessionAttr | public static void removeScopedSessionAttr( String attrName, HttpServletRequest request )
{
HttpSession session = request.getSession( false );
if ( session != null )
{
session.removeAttribute( getScopedSessionAttrName( attrName, request ) );
}
} | java | public static void removeScopedSessionAttr( String attrName, HttpServletRequest request )
{
HttpSession session = request.getSession( false );
if ( session != null )
{
session.removeAttribute( getScopedSessionAttrName( attrName, request ) );
}
} | [
"public",
"static",
"void",
"removeScopedSessionAttr",
"(",
"String",
"attrName",
",",
"HttpServletRequest",
"request",
")",
"{",
"HttpSession",
"session",
"=",
"request",
".",
"getSession",
"(",
"false",
")",
";",
"if",
"(",
"session",
"!=",
"null",
")",
"{",... | If the request is a ScopedRequest, this removes an attribute whose name is scoped to that request's scope-ID;
otherwise, it is a straight passthrough to {@link HttpSession#removeAttribute}.
@exclude | [
"If",
"the",
"request",
"is",
"a",
"ScopedRequest",
"this",
"removes",
"an",
"attribute",
"whose",
"name",
"is",
"scoped",
"to",
"that",
"request",
"s",
"scope",
"-",
"ID",
";",
"otherwise",
"it",
"is",
"a",
"straight",
"passthrough",
"to",
"{",
"@link",
... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/scoping/ScopedServletUtils.java#L341-L349 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleUtils.java | StyleUtils.createPolylineOptions | public static PolylineOptions createPolylineOptions(FeatureStyle featureStyle, float density) {
PolylineOptions polylineOptions = new PolylineOptions();
setFeatureStyle(polylineOptions, featureStyle, density);
return polylineOptions;
} | java | public static PolylineOptions createPolylineOptions(FeatureStyle featureStyle, float density) {
PolylineOptions polylineOptions = new PolylineOptions();
setFeatureStyle(polylineOptions, featureStyle, density);
return polylineOptions;
} | [
"public",
"static",
"PolylineOptions",
"createPolylineOptions",
"(",
"FeatureStyle",
"featureStyle",
",",
"float",
"density",
")",
"{",
"PolylineOptions",
"polylineOptions",
"=",
"new",
"PolylineOptions",
"(",
")",
";",
"setFeatureStyle",
"(",
"polylineOptions",
",",
... | Create new polyline options populated with the feature style
@param featureStyle feature style
@param density display density: {@link android.util.DisplayMetrics#density}
@return polyline options populated with the feature style | [
"Create",
"new",
"polyline",
"options",
"populated",
"with",
"the",
"feature",
"style"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleUtils.java#L413-L419 |
gosu-lang/gosu-lang | gosu-core-api/src/main/java/gw/util/StreamUtil.java | StreamUtil.getInputStreamReader | public static Reader getInputStreamReader(InputStream in, String charset) {
try {
return new InputStreamReader(in, charset);
}
catch (UnsupportedEncodingException ex) {
throw new RuntimeException(ex); // shouldn't happen since UTF-8 is supported by all JVMs per spec
}
} | java | public static Reader getInputStreamReader(InputStream in, String charset) {
try {
return new InputStreamReader(in, charset);
}
catch (UnsupportedEncodingException ex) {
throw new RuntimeException(ex); // shouldn't happen since UTF-8 is supported by all JVMs per spec
}
} | [
"public",
"static",
"Reader",
"getInputStreamReader",
"(",
"InputStream",
"in",
",",
"String",
"charset",
")",
"{",
"try",
"{",
"return",
"new",
"InputStreamReader",
"(",
"in",
",",
"charset",
")",
";",
"}",
"catch",
"(",
"UnsupportedEncodingException",
"ex",
... | Returns a reader for the specified input stream, using specified encoding.
@param in the input stream to wrap
@param charset the input stream to wrap
@return a reader for this input stream | [
"Returns",
"a",
"reader",
"for",
"the",
"specified",
"input",
"stream",
"using",
"specified",
"encoding",
"."
] | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core-api/src/main/java/gw/util/StreamUtil.java#L119-L126 |
alkacon/opencms-core | src/org/opencms/ade/configuration/CmsADEConfigData.java | CmsADEConfigData.getDetailInfos | public List<DetailInfo> getDetailInfos(CmsObject cms) {
List<DetailInfo> result = Lists.newArrayList();
List<CmsDetailPageInfo> detailPages = getAllDetailPages(true);
Collections.reverse(detailPages); // make sure primary detail pages come later in the list and override other detail pages for the same type
Map<String, CmsDetailPageInfo> primaryDetailPageMapByType = Maps.newHashMap();
for (CmsDetailPageInfo pageInfo : detailPages) {
primaryDetailPageMapByType.put(pageInfo.getType(), pageInfo);
}
for (CmsResourceTypeConfig typeConfig : getResourceTypes()) {
String typeName = typeConfig.getTypeName();
if (((typeConfig.getFolderOrName() == null) || !typeConfig.getFolderOrName().isPageRelative())
&& primaryDetailPageMapByType.containsKey(typeName)) {
String folderPath = typeConfig.getFolderPath(cms, null);
CmsDetailPageInfo pageInfo = primaryDetailPageMapByType.get(typeName);
result.add(new DetailInfo(folderPath, pageInfo, typeName, getBasePath()));
}
}
return result;
} | java | public List<DetailInfo> getDetailInfos(CmsObject cms) {
List<DetailInfo> result = Lists.newArrayList();
List<CmsDetailPageInfo> detailPages = getAllDetailPages(true);
Collections.reverse(detailPages); // make sure primary detail pages come later in the list and override other detail pages for the same type
Map<String, CmsDetailPageInfo> primaryDetailPageMapByType = Maps.newHashMap();
for (CmsDetailPageInfo pageInfo : detailPages) {
primaryDetailPageMapByType.put(pageInfo.getType(), pageInfo);
}
for (CmsResourceTypeConfig typeConfig : getResourceTypes()) {
String typeName = typeConfig.getTypeName();
if (((typeConfig.getFolderOrName() == null) || !typeConfig.getFolderOrName().isPageRelative())
&& primaryDetailPageMapByType.containsKey(typeName)) {
String folderPath = typeConfig.getFolderPath(cms, null);
CmsDetailPageInfo pageInfo = primaryDetailPageMapByType.get(typeName);
result.add(new DetailInfo(folderPath, pageInfo, typeName, getBasePath()));
}
}
return result;
} | [
"public",
"List",
"<",
"DetailInfo",
">",
"getDetailInfos",
"(",
"CmsObject",
"cms",
")",
"{",
"List",
"<",
"DetailInfo",
">",
"result",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"List",
"<",
"CmsDetailPageInfo",
">",
"detailPages",
"=",
"getAllDetai... | Gets the detail information for this sitemap config data object.<p>
@param cms the CMS context
@return the list of detail information | [
"Gets",
"the",
"detail",
"information",
"for",
"this",
"sitemap",
"config",
"data",
"object",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/configuration/CmsADEConfigData.java#L452-L471 |
mgm-tp/jfunk | jfunk-core/src/main/java/com/mgmtp/jfunk/core/mail/MailService.java | MailService.findMessages | public List<MailMessage> findMessages(final MailAccount mailAccount, final Predicate<MailMessage> condition) {
return findMessages(mailAccount, condition, defaultTimeoutSeconds);
} | java | public List<MailMessage> findMessages(final MailAccount mailAccount, final Predicate<MailMessage> condition) {
return findMessages(mailAccount, condition, defaultTimeoutSeconds);
} | [
"public",
"List",
"<",
"MailMessage",
">",
"findMessages",
"(",
"final",
"MailAccount",
"mailAccount",
",",
"final",
"Predicate",
"<",
"MailMessage",
">",
"condition",
")",
"{",
"return",
"findMessages",
"(",
"mailAccount",
",",
"condition",
",",
"defaultTimeoutSe... | <p>
Tries to find messages for the specified mail account applying the specified
{@code condition} until it times out using the default timeout (
{@link EmailConstants#MAIL_TIMEOUT_SECONDS} and {@link EmailConstants#MAIL_SLEEP_MILLIS}).
</p>
<b>Note:</b><br />
This method uses the specified mail account independently without reservation. If, however,
the specified mail account has been reserved by any thread (including the current one), an
{@link IllegalStateException} is thrown. </p>
@param mailAccount
the mail account
@param condition
the condition a message must meet
@return an immutable list of mail messagess | [
"<p",
">",
"Tries",
"to",
"find",
"messages",
"for",
"the",
"specified",
"mail",
"account",
"applying",
"the",
"specified",
"{",
"@code",
"condition",
"}",
"until",
"it",
"times",
"out",
"using",
"the",
"default",
"timeout",
"(",
"{",
"@link",
"EmailConstant... | train | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-core/src/main/java/com/mgmtp/jfunk/core/mail/MailService.java#L261-L263 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java | FileUtil.getReader | public static BufferedReader getReader(Path path, Charset charset) throws IORuntimeException {
return IoUtil.getReader(getInputStream(path), charset);
} | java | public static BufferedReader getReader(Path path, Charset charset) throws IORuntimeException {
return IoUtil.getReader(getInputStream(path), charset);
} | [
"public",
"static",
"BufferedReader",
"getReader",
"(",
"Path",
"path",
",",
"Charset",
"charset",
")",
"throws",
"IORuntimeException",
"{",
"return",
"IoUtil",
".",
"getReader",
"(",
"getInputStream",
"(",
"path",
")",
",",
"charset",
")",
";",
"}"
] | 获得一个文件读取器
@param path 文件Path
@param charset 字符集
@return BufferedReader对象
@throws IORuntimeException IO异常
@since 4.0.0 | [
"获得一个文件读取器"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/FileUtil.java#L1981-L1983 |
Azure/azure-sdk-for-java | datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/AccountsInner.java | AccountsInner.listStorageContainersAsync | public Observable<Page<BlobContainerInner>> listStorageContainersAsync(final String resourceGroupName, final String accountName, final String storageAccountName) {
return listStorageContainersWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName)
.map(new Func1<ServiceResponse<Page<BlobContainerInner>>, Page<BlobContainerInner>>() {
@Override
public Page<BlobContainerInner> call(ServiceResponse<Page<BlobContainerInner>> response) {
return response.body();
}
});
} | java | public Observable<Page<BlobContainerInner>> listStorageContainersAsync(final String resourceGroupName, final String accountName, final String storageAccountName) {
return listStorageContainersWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName)
.map(new Func1<ServiceResponse<Page<BlobContainerInner>>, Page<BlobContainerInner>>() {
@Override
public Page<BlobContainerInner> call(ServiceResponse<Page<BlobContainerInner>> response) {
return response.body();
}
});
} | [
"public",
"Observable",
"<",
"Page",
"<",
"BlobContainerInner",
">",
">",
"listStorageContainersAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"accountName",
",",
"final",
"String",
"storageAccountName",
")",
"{",
"return",
"listStorageCo... | Lists the Azure Storage containers, if any, associated with the specified Data Lake Analytics and Azure Storage account combination. The response includes a link to the next page of results, if any.
@param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account.
@param accountName The name of the Data Lake Analytics account for which to list Azure Storage blob containers.
@param storageAccountName The name of the Azure storage account from which to list blob containers.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<BlobContainerInner> object | [
"Lists",
"the",
"Azure",
"Storage",
"containers",
"if",
"any",
"associated",
"with",
"the",
"specified",
"Data",
"Lake",
"Analytics",
"and",
"Azure",
"Storage",
"account",
"combination",
".",
"The",
"response",
"includes",
"a",
"link",
"to",
"the",
"next",
"pa... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/AccountsInner.java#L718-L726 |
UrielCh/ovh-java-sdk | ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java | ApiOvhDomain.zone_zoneName_reset_POST | public void zone_zoneName_reset_POST(String zoneName, OvhResetRecord[] DnsRecords, Boolean minimized) throws IOException {
String qPath = "/domain/zone/{zoneName}/reset";
StringBuilder sb = path(qPath, zoneName);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "DnsRecords", DnsRecords);
addBody(o, "minimized", minimized);
exec(qPath, "POST", sb.toString(), o);
} | java | public void zone_zoneName_reset_POST(String zoneName, OvhResetRecord[] DnsRecords, Boolean minimized) throws IOException {
String qPath = "/domain/zone/{zoneName}/reset";
StringBuilder sb = path(qPath, zoneName);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "DnsRecords", DnsRecords);
addBody(o, "minimized", minimized);
exec(qPath, "POST", sb.toString(), o);
} | [
"public",
"void",
"zone_zoneName_reset_POST",
"(",
"String",
"zoneName",
",",
"OvhResetRecord",
"[",
"]",
"DnsRecords",
",",
"Boolean",
"minimized",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/domain/zone/{zoneName}/reset\"",
";",
"StringBuilder",
"... | Reset the DNS zone
REST: POST /domain/zone/{zoneName}/reset
@param minimized [required] Create only mandatory records
@param DnsRecords [required] Records that will be set after reset
@param zoneName [required] The internal name of your zone | [
"Reset",
"the",
"DNS",
"zone"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java#L790-L797 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/storefront/PriceListUrl.java | PriceListUrl.getPriceListUrl | public static MozuUrl getPriceListUrl(String priceListCode, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/storefront/pricelists/{priceListCode}?responseFields={responseFields}");
formatter.formatUrl("priceListCode", priceListCode);
formatter.formatUrl("responseFields", responseFields);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | java | public static MozuUrl getPriceListUrl(String priceListCode, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/storefront/pricelists/{priceListCode}?responseFields={responseFields}");
formatter.formatUrl("priceListCode", priceListCode);
formatter.formatUrl("responseFields", responseFields);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | [
"public",
"static",
"MozuUrl",
"getPriceListUrl",
"(",
"String",
"priceListCode",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/catalog/storefront/pricelists/{priceListCode}?responseFields={responseFields... | Get Resource Url for GetPriceList
@param priceListCode The unique code of the price list for which you want to retrieve the details.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause data loss.
@return String Resource Url | [
"Get",
"Resource",
"Url",
"for",
"GetPriceList"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/storefront/PriceListUrl.java#L22-L28 |
lucee/Lucee | core/src/main/java/lucee/runtime/schedule/StorageUtil.java | StorageUtil.loadFile | public void loadFile(File file, String resourcePath) throws IOException {
loadFile(ResourceUtil.toResource(file), resourcePath);
} | java | public void loadFile(File file, String resourcePath) throws IOException {
loadFile(ResourceUtil.toResource(file), resourcePath);
} | [
"public",
"void",
"loadFile",
"(",
"File",
"file",
",",
"String",
"resourcePath",
")",
"throws",
"IOException",
"{",
"loadFile",
"(",
"ResourceUtil",
".",
"toResource",
"(",
"file",
")",
",",
"resourcePath",
")",
";",
"}"
] | create xml file from a resource definition
@param file
@param resourcePath
@throws IOException | [
"create",
"xml",
"file",
"from",
"a",
"resource",
"definition"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/schedule/StorageUtil.java#L63-L65 |
sporniket/core | sporniket-core-ml/src/main/java/com/sporniket/libre/lang/xml/XmlStringTools.java | XmlStringTools.doAppendOpeningTag | private static StringBuffer doAppendOpeningTag(StringBuffer buffer, String tag, Map<String, String> attributes)
{
buffer.append(SEQUENCE__TAG__BEGIN_OPENING_TAG).append(tag);
for (String _attributeName : attributes.keySet())
{
String _attributeValue = attributes.get(_attributeName);
_attributeValue = encodeAttributeValue(_attributeValue);
buffer.append(SEQUENCE__ATTRIBUTE__BEGIN).append(_attributeName).append(SEQUENCE__ATTRIBUTE__EQUALS)
.append(_attributeValue).append(SEQUENCE__ATTRIBUTE__END);
}
buffer.append(SEQUENCE__TAG__END_OF_TAG);
return buffer;
} | java | private static StringBuffer doAppendOpeningTag(StringBuffer buffer, String tag, Map<String, String> attributes)
{
buffer.append(SEQUENCE__TAG__BEGIN_OPENING_TAG).append(tag);
for (String _attributeName : attributes.keySet())
{
String _attributeValue = attributes.get(_attributeName);
_attributeValue = encodeAttributeValue(_attributeValue);
buffer.append(SEQUENCE__ATTRIBUTE__BEGIN).append(_attributeName).append(SEQUENCE__ATTRIBUTE__EQUALS)
.append(_attributeValue).append(SEQUENCE__ATTRIBUTE__END);
}
buffer.append(SEQUENCE__TAG__END_OF_TAG);
return buffer;
} | [
"private",
"static",
"StringBuffer",
"doAppendOpeningTag",
"(",
"StringBuffer",
"buffer",
",",
"String",
"tag",
",",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
")",
"{",
"buffer",
".",
"append",
"(",
"SEQUENCE__TAG__BEGIN_OPENING_TAG",
")",
".",
"ap... | Add an opening tag with attributes to a StringBuffer.
@param buffer
StringBuffer to fill
@param tag
the tag to open
@param attributes
the attribute map
@return the buffer | [
"Add",
"an",
"opening",
"tag",
"with",
"attributes",
"to",
"a",
"StringBuffer",
"."
] | train | https://github.com/sporniket/core/blob/3480ebd72a07422fcc09971be2607ee25efb2c26/sporniket-core-ml/src/main/java/com/sporniket/libre/lang/xml/XmlStringTools.java#L487-L499 |
sahan/ZombieLink | zombielink/src/main/java/com/lonepulse/zombielink/response/ResponseProcessorChain.java | ResponseProcessorChain.onTraverse | @Override
protected Object onTraverse(Object result, ProcessorChainLink<Object, ResponseProcessorException> successor, Object... args) {
return successor.getProcessor().run(args[0], args[1], result); //allow any exceptions to elevate to a chain-wide failure
} | java | @Override
protected Object onTraverse(Object result, ProcessorChainLink<Object, ResponseProcessorException> successor, Object... args) {
return successor.getProcessor().run(args[0], args[1], result); //allow any exceptions to elevate to a chain-wide failure
} | [
"@",
"Override",
"protected",
"Object",
"onTraverse",
"(",
"Object",
"result",
",",
"ProcessorChainLink",
"<",
"Object",
",",
"ResponseProcessorException",
">",
"successor",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"successor",
".",
"getProcessor",
"(",
... | <p>Executed for each "link-crossing" from the root {@link HeaderProcessor} onwards. Takes the
<b>successor</b> and invokes it with the argument array which was provided in {@link #run(Object...)}
and returns the deserialized response content (if any).</p>
<p>See {@link AbstractResponseProcessor}.</p>
{@inheritDoc} | [
"<p",
">",
"Executed",
"for",
"each",
"link",
"-",
"crossing",
"from",
"the",
"root",
"{",
"@link",
"HeaderProcessor",
"}",
"onwards",
".",
"Takes",
"the",
"<b",
">",
"successor<",
"/",
"b",
">",
"and",
"invokes",
"it",
"with",
"the",
"argument",
"array"... | train | https://github.com/sahan/ZombieLink/blob/a9971add56d4f6919a4a5e84c78e9220011d8982/zombielink/src/main/java/com/lonepulse/zombielink/response/ResponseProcessorChain.java#L101-L105 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATMainConsumer.java | CATMainConsumer.unlockSet | public void unlockSet(int requestNumber, SIMessageHandle[] msgHandles, boolean reply) // f199593, F219476.2
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "unlockSet",
new Object[]
{
requestNumber,
msgHandles,
reply
});
checkNotBrowserSession(); // F171893
if (subConsumer != null)
{
subConsumer.unlockSet(requestNumber, msgHandles, reply); // f199593, F219476.2
}
else
{
super.unlockSet(requestNumber, msgHandles, reply); // f199593, F219476.2
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "unlockSet");
} | java | public void unlockSet(int requestNumber, SIMessageHandle[] msgHandles, boolean reply) // f199593, F219476.2
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "unlockSet",
new Object[]
{
requestNumber,
msgHandles,
reply
});
checkNotBrowserSession(); // F171893
if (subConsumer != null)
{
subConsumer.unlockSet(requestNumber, msgHandles, reply); // f199593, F219476.2
}
else
{
super.unlockSet(requestNumber, msgHandles, reply); // f199593, F219476.2
}
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(this, tc, "unlockSet");
} | [
"public",
"void",
"unlockSet",
"(",
"int",
"requestNumber",
",",
"SIMessageHandle",
"[",
"]",
"msgHandles",
",",
"boolean",
"reply",
")",
"// f199593, F219476.2",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEn... | Unlocks a set of messages locked by this consumer. This call
is delegated to the sub consumer if one exists or the
<code>CATConsumer</code> version is used.
@param requestNumber The request number which replies should be sent to.
@param msgHandles
@param reply | [
"Unlocks",
"a",
"set",
"of",
"messages",
"locked",
"by",
"this",
"consumer",
".",
"This",
"call",
"is",
"delegated",
"to",
"the",
"sub",
"consumer",
"if",
"one",
"exists",
"or",
"the",
"<code",
">",
"CATConsumer<",
"/",
"code",
">",
"version",
"is",
"use... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATMainConsumer.java#L824-L846 |
apache/flink | flink-core/src/main/java/org/apache/flink/util/NetUtils.java | NetUtils.unresolvedHostAndPortToNormalizedString | public static String unresolvedHostAndPortToNormalizedString(String host, int port) {
Preconditions.checkArgument(port >= 0 && port < 65536,
"Port is not within the valid range,");
return unresolvedHostToNormalizedString(host) + ":" + port;
} | java | public static String unresolvedHostAndPortToNormalizedString(String host, int port) {
Preconditions.checkArgument(port >= 0 && port < 65536,
"Port is not within the valid range,");
return unresolvedHostToNormalizedString(host) + ":" + port;
} | [
"public",
"static",
"String",
"unresolvedHostAndPortToNormalizedString",
"(",
"String",
"host",
",",
"int",
"port",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"port",
">=",
"0",
"&&",
"port",
"<",
"65536",
",",
"\"Port is not within the valid range,\"",
"... | Returns a valid address for Akka. It returns a String of format 'host:port'.
When an IPv6 address is specified, it normalizes the IPv6 address to avoid
complications with the exact URL match policy of Akka.
@param host The hostname, IPv4 or IPv6 address
@param port The port
@return host:port where host will be normalized if it is an IPv6 address | [
"Returns",
"a",
"valid",
"address",
"for",
"Akka",
".",
"It",
"returns",
"a",
"String",
"of",
"format",
"host",
":",
"port",
".",
"When",
"an",
"IPv6",
"address",
"is",
"specified",
"it",
"normalizes",
"the",
"IPv6",
"address",
"to",
"avoid",
"complication... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/NetUtils.java#L165-L169 |
paypal/SeLion | server/src/main/java/com/paypal/selion/grid/matchers/MobileCapabilityMatcher.java | MobileCapabilityMatcher.verifyAppiumCapabilities | private boolean verifyAppiumCapabilities(Map<String, Object> nodeCapability, Map<String, Object> requestedCapability) {
for (String capabilityName : toConsider) {
Object capabilityValueObject = requestedCapability.get(capabilityName);
Object nodeValueObject = nodeCapability.get(capabilityName);
if (capabilityValueObject != null && nodeValueObject != null) {
String capabilityValue = capabilityValueObject.toString();
String nodeValue = nodeValueObject.toString();
if (StringUtils.isBlank(nodeValue) ||
StringUtils.isBlank(capabilityValue) ||
IGNORED_CAPABILITY_VALUE_1.equalsIgnoreCase(capabilityValue) ||
IGNORED_CAPABILITY_VALUE_2.equalsIgnoreCase(capabilityValue)) {
continue;
}
if (!nodeValue.equalsIgnoreCase(capabilityValue)) {
return false;
}
}
}
return true;
} | java | private boolean verifyAppiumCapabilities(Map<String, Object> nodeCapability, Map<String, Object> requestedCapability) {
for (String capabilityName : toConsider) {
Object capabilityValueObject = requestedCapability.get(capabilityName);
Object nodeValueObject = nodeCapability.get(capabilityName);
if (capabilityValueObject != null && nodeValueObject != null) {
String capabilityValue = capabilityValueObject.toString();
String nodeValue = nodeValueObject.toString();
if (StringUtils.isBlank(nodeValue) ||
StringUtils.isBlank(capabilityValue) ||
IGNORED_CAPABILITY_VALUE_1.equalsIgnoreCase(capabilityValue) ||
IGNORED_CAPABILITY_VALUE_2.equalsIgnoreCase(capabilityValue)) {
continue;
}
if (!nodeValue.equalsIgnoreCase(capabilityValue)) {
return false;
}
}
}
return true;
} | [
"private",
"boolean",
"verifyAppiumCapabilities",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"nodeCapability",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"requestedCapability",
")",
"{",
"for",
"(",
"String",
"capabilityName",
":",
"toConsider",
")",
"... | Requested capabilities compared with node capabilities when both capabilities are not blank. If requested
capability have "ANY" or "*" then matcher bypassed to next capability without comparison.
@param nodeCapability capabilities from node
@param requestedCapability capabilities requested for
@return <code>true/false</code> | [
"Requested",
"capabilities",
"compared",
"with",
"node",
"capabilities",
"when",
"both",
"capabilities",
"are",
"not",
"blank",
".",
"If",
"requested",
"capability",
"have",
"ANY",
"or",
"*",
"then",
"matcher",
"bypassed",
"to",
"next",
"capability",
"without",
... | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/server/src/main/java/com/paypal/selion/grid/matchers/MobileCapabilityMatcher.java#L93-L112 |
drinkjava2/jBeanBox | jbeanbox/src/main/java/com/github/drinkjava2/asm5_0_3/util/CheckClassAdapter.java | CheckClassAdapter.checkTypeVariableSignature | private static int checkTypeVariableSignature(final String signature,
int pos) {
// TypeVariableSignature:
// T Identifier ;
pos = checkChar('T', signature, pos);
pos = checkIdentifier(signature, pos);
return checkChar(';', signature, pos);
} | java | private static int checkTypeVariableSignature(final String signature,
int pos) {
// TypeVariableSignature:
// T Identifier ;
pos = checkChar('T', signature, pos);
pos = checkIdentifier(signature, pos);
return checkChar(';', signature, pos);
} | [
"private",
"static",
"int",
"checkTypeVariableSignature",
"(",
"final",
"String",
"signature",
",",
"int",
"pos",
")",
"{",
"// TypeVariableSignature:",
"// T Identifier ;",
"pos",
"=",
"checkChar",
"(",
"'",
"'",
",",
"signature",
",",
"pos",
")",
";",
"pos",
... | Checks a type variable signature.
@param signature
a string containing the signature that must be checked.
@param pos
index of first character to be checked.
@return the index of the first character after the checked part. | [
"Checks",
"a",
"type",
"variable",
"signature",
"."
] | train | https://github.com/drinkjava2/jBeanBox/blob/01c216599ffa2e5f2d9c01df2adaad0f45567c04/jbeanbox/src/main/java/com/github/drinkjava2/asm5_0_3/util/CheckClassAdapter.java#L920-L928 |
rythmengine/rythmengine | src/main/java/org/rythmengine/utils/IO.java | IO.readContentAsString | public static String readContentAsString(File file, String encoding) {
try {
return readContentAsString(new FileInputStream(file), encoding);
} catch (FileNotFoundException e) {
throw new RuntimeException(e);
}
} | java | public static String readContentAsString(File file, String encoding) {
try {
return readContentAsString(new FileInputStream(file), encoding);
} catch (FileNotFoundException e) {
throw new RuntimeException(e);
}
} | [
"public",
"static",
"String",
"readContentAsString",
"(",
"File",
"file",
",",
"String",
"encoding",
")",
"{",
"try",
"{",
"return",
"readContentAsString",
"(",
"new",
"FileInputStream",
"(",
"file",
")",
",",
"encoding",
")",
";",
"}",
"catch",
"(",
"FileNo... | Read file content to a String
@param file The file to read
@return The String content | [
"Read",
"file",
"content",
"to",
"a",
"String"
] | train | https://github.com/rythmengine/rythmengine/blob/064b565f08d9da07378bf77a9dd856ea5831cc92/src/main/java/org/rythmengine/utils/IO.java#L60-L66 |
sebastiangraf/treetank | interfacemodules/xml/src/main/java/org/treetank/service/xml/xpath/parser/XPathParser.java | XPathParser.parseSingleType | private SingleType parseSingleType() throws TTXPathException {
final String atomicType = parseAtomicType();
final boolean intero = is(TokenType.INTERROGATION, true);
return new SingleType(atomicType, intero);
} | java | private SingleType parseSingleType() throws TTXPathException {
final String atomicType = parseAtomicType();
final boolean intero = is(TokenType.INTERROGATION, true);
return new SingleType(atomicType, intero);
} | [
"private",
"SingleType",
"parseSingleType",
"(",
")",
"throws",
"TTXPathException",
"{",
"final",
"String",
"atomicType",
"=",
"parseAtomicType",
"(",
")",
";",
"final",
"boolean",
"intero",
"=",
"is",
"(",
"TokenType",
".",
"INTERROGATION",
",",
"true",
")",
... | Parses the the rule SingleType according to the following production
rule:
<p>
[48] SingleType ::= AtomicType "?"? .
</p>
@return SingleType
@throws TTXPathException | [
"Parses",
"the",
"the",
"rule",
"SingleType",
"according",
"to",
"the",
"following",
"production",
"rule",
":",
"<p",
">",
"[",
"48",
"]",
"SingleType",
"::",
"=",
"AtomicType",
"?",
"?",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/xml/src/main/java/org/treetank/service/xml/xpath/parser/XPathParser.java#L1322-L1327 |
pwall567/jsonutil | src/main/java/net/pwall/json/JSON.java | JSON.parseArray | public static JSONArray parseArray(File f, String csName) throws IOException {
return (JSONArray)parse(f, csName);
} | java | public static JSONArray parseArray(File f, String csName) throws IOException {
return (JSONArray)parse(f, csName);
} | [
"public",
"static",
"JSONArray",
"parseArray",
"(",
"File",
"f",
",",
"String",
"csName",
")",
"throws",
"IOException",
"{",
"return",
"(",
"JSONArray",
")",
"parse",
"(",
"f",
",",
"csName",
")",
";",
"}"
] | Parse the contents of a {@link File} as a JSON array, specifying the character set by
name.
@param f the {@link File}
@param csName the character set name
@return the JSON array
@throws JSONException if the file does not contain a valid JSON value
@throws IOException on any I/O errors
@throws ClassCastException if the value is not an array | [
"Parse",
"the",
"contents",
"of",
"a",
"{",
"@link",
"File",
"}",
"as",
"a",
"JSON",
"array",
"specifying",
"the",
"character",
"set",
"by",
"name",
"."
] | train | https://github.com/pwall567/jsonutil/blob/dd5960b9b0bcc9acfe6c52b884fffd9ee5f422fe/src/main/java/net/pwall/json/JSON.java#L291-L293 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/BasePropertyTaglet.java | BasePropertyTaglet.getTagletOutput | public Content getTagletOutput(Element element, DocTree tag, TagletWriter tagletWriter) {
return tagletWriter.propertyTagOutput(element, tag, getText(tagletWriter));
} | java | public Content getTagletOutput(Element element, DocTree tag, TagletWriter tagletWriter) {
return tagletWriter.propertyTagOutput(element, tag, getText(tagletWriter));
} | [
"public",
"Content",
"getTagletOutput",
"(",
"Element",
"element",
",",
"DocTree",
"tag",
",",
"TagletWriter",
"tagletWriter",
")",
"{",
"return",
"tagletWriter",
".",
"propertyTagOutput",
"(",
"element",
",",
"tag",
",",
"getText",
"(",
"tagletWriter",
")",
")"... | Given the <code>Tag</code> representation of this custom
tag, return its string representation, which is output
to the generated page.
@param element
@param tag the <code>Tag</code> representation of this custom tag.
@param tagletWriter the taglet writer for output.
@return the TagletOutput representation of this <code>Tag</code>. | [
"Given",
"the",
"<code",
">",
"Tag<",
"/",
"code",
">",
"representation",
"of",
"this",
"custom",
"tag",
"return",
"its",
"string",
"representation",
"which",
"is",
"output",
"to",
"the",
"generated",
"page",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/taglets/BasePropertyTaglet.java#L66-L68 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/mime/MimeType.java | MimeType.addParameter | @Nonnull
public MimeType addParameter (@Nonnull @Nonempty final String sAttribute, @Nonnull @Nonempty final String sValue)
{
return addParameter (new MimeTypeParameter (sAttribute, sValue));
} | java | @Nonnull
public MimeType addParameter (@Nonnull @Nonempty final String sAttribute, @Nonnull @Nonempty final String sValue)
{
return addParameter (new MimeTypeParameter (sAttribute, sValue));
} | [
"@",
"Nonnull",
"public",
"MimeType",
"addParameter",
"(",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sAttribute",
",",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sValue",
")",
"{",
"return",
"addParameter",
"(",
"new",
"MimeTypeParameter",
... | Add a parameter.
@param sAttribute
Parameter name. Must neither be <code>null</code> nor empty and must
match {@link MimeTypeParser#isToken(String)}.
@param sValue
The value to use. May neither be <code>null</code> nor empty. Must
not be a valid MIME token.
@return this | [
"Add",
"a",
"parameter",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/mime/MimeType.java#L184-L188 |
paypal/SeLion | dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/JsonDataProviderImpl.java | JsonDataProviderImpl.getDataByIndex | @Override
public Object[][] getDataByIndex(int[] indexes) {
validateResourceParams(resource);
Preconditions.checkArgument((indexes.length != 0), "Indexes cannot be empty");
logger.entering(indexes);
Object[][] requestedData = null;
Class<?> arrayType;
JsonReader reader = null;
try {
requestedData = new Object[indexes.length][1];
reader = new JsonReader(getReader(resource));
arrayType = Array.newInstance(resource.getCls(), 0).getClass();
logger.log(Level.FINE, "The Json Data is mapped as", arrayType);
Object[][] mappedData = mapJsonData(reader, arrayType);
int i = 0;
for (int indexVal : indexes) {
indexVal--;
requestedData[i] = mappedData[indexVal];
i++;
}
} catch (IOException e) {
throw new DataProviderException("Error while getting the data by index from Json file", e);
} finally {
IOUtils.closeQuietly(reader);
}
logger.exiting((Object[]) requestedData);
return requestedData;
} | java | @Override
public Object[][] getDataByIndex(int[] indexes) {
validateResourceParams(resource);
Preconditions.checkArgument((indexes.length != 0), "Indexes cannot be empty");
logger.entering(indexes);
Object[][] requestedData = null;
Class<?> arrayType;
JsonReader reader = null;
try {
requestedData = new Object[indexes.length][1];
reader = new JsonReader(getReader(resource));
arrayType = Array.newInstance(resource.getCls(), 0).getClass();
logger.log(Level.FINE, "The Json Data is mapped as", arrayType);
Object[][] mappedData = mapJsonData(reader, arrayType);
int i = 0;
for (int indexVal : indexes) {
indexVal--;
requestedData[i] = mappedData[indexVal];
i++;
}
} catch (IOException e) {
throw new DataProviderException("Error while getting the data by index from Json file", e);
} finally {
IOUtils.closeQuietly(reader);
}
logger.exiting((Object[]) requestedData);
return requestedData;
} | [
"@",
"Override",
"public",
"Object",
"[",
"]",
"[",
"]",
"getDataByIndex",
"(",
"int",
"[",
"]",
"indexes",
")",
"{",
"validateResourceParams",
"(",
"resource",
")",
";",
"Preconditions",
".",
"checkArgument",
"(",
"(",
"indexes",
".",
"length",
"!=",
"0",... | Gets JSON data from a resource for the specified indexes.
@param indexes
The set of indexes to be fetched from the JSON file. | [
"Gets",
"JSON",
"data",
"from",
"a",
"resource",
"for",
"the",
"specified",
"indexes",
"."
] | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/JsonDataProviderImpl.java#L148-L176 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/io/AbstractMappedClassFieldObserver.java | AbstractMappedClassFieldObserver.onFieldCustom | protected void onFieldCustom(final Object obj, final Field field, final Bin annotation, final Object customFieldProcessor, final Object value) {
} | java | protected void onFieldCustom(final Object obj, final Field field, final Bin annotation, final Object customFieldProcessor, final Object value) {
} | [
"protected",
"void",
"onFieldCustom",
"(",
"final",
"Object",
"obj",
",",
"final",
"Field",
"field",
",",
"final",
"Bin",
"annotation",
",",
"final",
"Object",
"customFieldProcessor",
",",
"final",
"Object",
"value",
")",
"{",
"}"
] | Notification about custom field.
@param obj the object instance, must not be null
@param field the custom field, must not be null
@param annotation the annotation for the field, must not be null
@param customFieldProcessor processor for custom fields, must not be null
@param value the value of the custom field | [
"Notification",
"about",
"custom",
"field",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/io/AbstractMappedClassFieldObserver.java#L527-L529 |
SonarSource/sonarqube | server/sonar-server-common/src/main/java/org/sonar/server/user/index/UserIndexer.java | UserIndexer.postCommit | private void postCommit(DbSession dbSession, Collection<String> logins, Collection<EsQueueDto> items) {
index(dbSession, items);
} | java | private void postCommit(DbSession dbSession, Collection<String> logins, Collection<EsQueueDto> items) {
index(dbSession, items);
} | [
"private",
"void",
"postCommit",
"(",
"DbSession",
"dbSession",
",",
"Collection",
"<",
"String",
">",
"logins",
",",
"Collection",
"<",
"EsQueueDto",
">",
"items",
")",
"{",
"index",
"(",
"dbSession",
",",
"items",
")",
";",
"}"
] | Entry point for Byteman tests. See directory tests/resilience.
The parameter "logins" is used only by the Byteman script. | [
"Entry",
"point",
"for",
"Byteman",
"tests",
".",
"See",
"directory",
"tests",
"/",
"resilience",
".",
"The",
"parameter",
"logins",
"is",
"used",
"only",
"by",
"the",
"Byteman",
"script",
"."
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-server-common/src/main/java/org/sonar/server/user/index/UserIndexer.java#L99-L101 |
asterisk-java/asterisk-java | src/main/java/org/asteriskjava/manager/action/OriginateAction.java | OriginateAction.setVariables | public void setVariables(Map<String, String> variables)
{
if (this.variables != null)
{
this.variables.putAll(variables);
}
else
{
this.variables = variables;
}
} | java | public void setVariables(Map<String, String> variables)
{
if (this.variables != null)
{
this.variables.putAll(variables);
}
else
{
this.variables = variables;
}
} | [
"public",
"void",
"setVariables",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"variables",
")",
"{",
"if",
"(",
"this",
".",
"variables",
"!=",
"null",
")",
"{",
"this",
".",
"variables",
".",
"putAll",
"(",
"variables",
")",
";",
"}",
"else",
"{"... | Sets the variables to set on the originated call.
@param variables a Map containing the variable names as key and their
values as value.
@since 0.2 | [
"Sets",
"the",
"variables",
"to",
"set",
"on",
"the",
"originated",
"call",
"."
] | train | https://github.com/asterisk-java/asterisk-java/blob/cdc9849270d97ef75afa447a02c5194ed29121eb/src/main/java/org/asteriskjava/manager/action/OriginateAction.java#L458-L468 |
UrielCh/ovh-java-sdk | ovh-java-sdk-store/src/main/java/net/minidev/ovh/api/ApiOvhStore.java | ApiOvhStore.partner_partnerId_product_POST | public OvhEditResponse partner_partnerId_product_POST(String partnerId, String category, String description, String name, String otherDetails) throws IOException {
String qPath = "/store/partner/{partnerId}/product";
StringBuilder sb = path(qPath, partnerId);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "category", category);
addBody(o, "description", description);
addBody(o, "name", name);
addBody(o, "otherDetails", otherDetails);
String resp = exec(qPath, "POST", sb.toString(), o);
return convertTo(resp, OvhEditResponse.class);
} | java | public OvhEditResponse partner_partnerId_product_POST(String partnerId, String category, String description, String name, String otherDetails) throws IOException {
String qPath = "/store/partner/{partnerId}/product";
StringBuilder sb = path(qPath, partnerId);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "category", category);
addBody(o, "description", description);
addBody(o, "name", name);
addBody(o, "otherDetails", otherDetails);
String resp = exec(qPath, "POST", sb.toString(), o);
return convertTo(resp, OvhEditResponse.class);
} | [
"public",
"OvhEditResponse",
"partner_partnerId_product_POST",
"(",
"String",
"partnerId",
",",
"String",
"category",
",",
"String",
"description",
",",
"String",
"name",
",",
"String",
"otherDetails",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/s... | Create a new product for partner
REST: POST /store/partner/{partnerId}/product
@param partnerId [required] Id of the partner
@param description [required] Description of product
@param name [required] Name of product
@param otherDetails [required] Additional information
@param category [required] Name of product category
API beta | [
"Create",
"a",
"new",
"product",
"for",
"partner"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-store/src/main/java/net/minidev/ovh/api/ApiOvhStore.java#L548-L558 |
camunda/camunda-spin | dataformat-xml-dom/src/main/java/org/camunda/spin/impl/xml/dom/util/DomXmlEnsure.java | DomXmlEnsure.ensureXPathNotEmpty | public static void ensureXPathNotEmpty(NodeList nodeList, String expression) {
if (nodeList == null || nodeList.getLength() == 0) {
throw LOG.unableToFindXPathExpression(expression);
}
} | java | public static void ensureXPathNotEmpty(NodeList nodeList, String expression) {
if (nodeList == null || nodeList.getLength() == 0) {
throw LOG.unableToFindXPathExpression(expression);
}
} | [
"public",
"static",
"void",
"ensureXPathNotEmpty",
"(",
"NodeList",
"nodeList",
",",
"String",
"expression",
")",
"{",
"if",
"(",
"nodeList",
"==",
"null",
"||",
"nodeList",
".",
"getLength",
"(",
")",
"==",
"0",
")",
"{",
"throw",
"LOG",
".",
"unableToFin... | Ensure that the nodeList is either null or empty.
@param nodeList the nodeList to ensure to be either null or empty
@param expression the expression was used to fine the nodeList
@throws SpinXPathException if the nodeList is either null or empty | [
"Ensure",
"that",
"the",
"nodeList",
"is",
"either",
"null",
"or",
"empty",
"."
] | train | https://github.com/camunda/camunda-spin/blob/cfe65161eb97fd5023a945cb97c47fbfe69e9fdd/dataformat-xml-dom/src/main/java/org/camunda/spin/impl/xml/dom/util/DomXmlEnsure.java#L85-L89 |
deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/transform/ui/HtmlAnalysis.java | HtmlAnalysis.createHtmlAnalysisFile | public static void createHtmlAnalysisFile(DataAnalysis dataAnalysis, File output) throws Exception {
String str = createHtmlAnalysisString(dataAnalysis);
FileUtils.writeStringToFile(output, str, StandardCharsets.UTF_8);
} | java | public static void createHtmlAnalysisFile(DataAnalysis dataAnalysis, File output) throws Exception {
String str = createHtmlAnalysisString(dataAnalysis);
FileUtils.writeStringToFile(output, str, StandardCharsets.UTF_8);
} | [
"public",
"static",
"void",
"createHtmlAnalysisFile",
"(",
"DataAnalysis",
"dataAnalysis",
",",
"File",
"output",
")",
"throws",
"Exception",
"{",
"String",
"str",
"=",
"createHtmlAnalysisString",
"(",
"dataAnalysis",
")",
";",
"FileUtils",
".",
"writeStringToFile",
... | Render a data analysis object as a HTML file. This will produce a summary table, along charts for
numerical columns
@param dataAnalysis Data analysis object to render
@param output Output file (should have extension .html) | [
"Render",
"a",
"data",
"analysis",
"object",
"as",
"a",
"HTML",
"file",
".",
"This",
"will",
"produce",
"a",
"summary",
"table",
"along",
"charts",
"for",
"numerical",
"columns"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/transform/ui/HtmlAnalysis.java#L234-L239 |
agmip/agmip-common-functions | src/main/java/org/agmip/translators/soil/WaterReserveCriteria.java | WaterReserveCriteria.shouldAggregateSoils | public boolean shouldAggregateSoils(HashMap<String, String> currentSoil, HashMap<String, String> previousSoil) {
float ruCurrent;
float ruPrevious;
float resultFirstRule;
float resultSecRule;
boolean firstRule;
boolean secRule;
// ru in mm/m
ruCurrent = (parseFloat(currentSoil.get(SLDUL)) - parseFloat(currentSoil.get(SLLL))) * 1000.0f;
ruPrevious = (parseFloat(previousSoil.get(SLDUL)) - parseFloat(previousSoil.get(SLLL))) * 1000f;
resultFirstRule = round(Math.abs(ruCurrent - ruPrevious));
firstRule = resultFirstRule <= FIRST_THRESHOLD_DEFAULT;
/**
* First rule : (currentRu - previousRu) <= 5 mm/m Second rule :
* (currentBdm - previousBdm) <= 0.05 g/cm3 Soil layers are aggregated
* if the rules below are both true
* */
resultSecRule = round(Math.abs(parseFloat(currentSoil.get(SLBDM)) - parseFloat(previousSoil.get(SLBDM))));
secRule = (round(resultSecRule) <= SECOND_THRESHOLD_DEFAULT);
log.debug("*********************");
log.debug("Ru current : "+ruCurrent);
log.debug("Ru previous : "+ruPrevious);
log.debug("First rule : " + resultFirstRule + " <= " + FIRST_THRESHOLD_DEFAULT + " ? " + firstRule);
log.debug("Sec rule : " + resultSecRule + " <= " + SECOND_THRESHOLD_DEFAULT + " ? " + secRule);
log.debug("*********************");
return firstRule && secRule;
} | java | public boolean shouldAggregateSoils(HashMap<String, String> currentSoil, HashMap<String, String> previousSoil) {
float ruCurrent;
float ruPrevious;
float resultFirstRule;
float resultSecRule;
boolean firstRule;
boolean secRule;
// ru in mm/m
ruCurrent = (parseFloat(currentSoil.get(SLDUL)) - parseFloat(currentSoil.get(SLLL))) * 1000.0f;
ruPrevious = (parseFloat(previousSoil.get(SLDUL)) - parseFloat(previousSoil.get(SLLL))) * 1000f;
resultFirstRule = round(Math.abs(ruCurrent - ruPrevious));
firstRule = resultFirstRule <= FIRST_THRESHOLD_DEFAULT;
/**
* First rule : (currentRu - previousRu) <= 5 mm/m Second rule :
* (currentBdm - previousBdm) <= 0.05 g/cm3 Soil layers are aggregated
* if the rules below are both true
* */
resultSecRule = round(Math.abs(parseFloat(currentSoil.get(SLBDM)) - parseFloat(previousSoil.get(SLBDM))));
secRule = (round(resultSecRule) <= SECOND_THRESHOLD_DEFAULT);
log.debug("*********************");
log.debug("Ru current : "+ruCurrent);
log.debug("Ru previous : "+ruPrevious);
log.debug("First rule : " + resultFirstRule + " <= " + FIRST_THRESHOLD_DEFAULT + " ? " + firstRule);
log.debug("Sec rule : " + resultSecRule + " <= " + SECOND_THRESHOLD_DEFAULT + " ? " + secRule);
log.debug("*********************");
return firstRule && secRule;
} | [
"public",
"boolean",
"shouldAggregateSoils",
"(",
"HashMap",
"<",
"String",
",",
"String",
">",
"currentSoil",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"previousSoil",
")",
"{",
"float",
"ruCurrent",
";",
"float",
"ruPrevious",
";",
"float",
"resultF... | Criteria for merging soils ru is the maximum available water reserve
(reserve utile) sdul is the field capacity slll is the wilting point
(point de fletrissement permanent) slbdm is the bulk density
@param currentSoil
@param previousSoil
@return | [
"Criteria",
"for",
"merging",
"soils",
"ru",
"is",
"the",
"maximum",
"available",
"water",
"reserve",
"(",
"reserve",
"utile",
")",
"sdul",
"is",
"the",
"field",
"capacity",
"slll",
"is",
"the",
"wilting",
"point",
"(",
"point",
"de",
"fletrissement",
"perma... | train | https://github.com/agmip/agmip-common-functions/blob/4efa3042178841b026ca6fba9c96da02fbfb9a8e/src/main/java/org/agmip/translators/soil/WaterReserveCriteria.java#L62-L92 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/CheckSumUtils.java | CheckSumUtils.getChecksum | public static String getChecksum(InputStream is, String algorithm) throws IOException {
if (algorithm.equals(JawrConstant.CRC32_ALGORITHM)) {
return getCRC32Checksum(is);
} else if (algorithm.equals(JawrConstant.MD5_ALGORITHM)) {
return getMD5Checksum(is);
} else {
throw new BundlingProcessException("The checksum algorithm '" + algorithm + "' is not supported.\n"
+ "The only supported algorithm are 'CRC32' or 'MD5'.");
}
} | java | public static String getChecksum(InputStream is, String algorithm) throws IOException {
if (algorithm.equals(JawrConstant.CRC32_ALGORITHM)) {
return getCRC32Checksum(is);
} else if (algorithm.equals(JawrConstant.MD5_ALGORITHM)) {
return getMD5Checksum(is);
} else {
throw new BundlingProcessException("The checksum algorithm '" + algorithm + "' is not supported.\n"
+ "The only supported algorithm are 'CRC32' or 'MD5'.");
}
} | [
"public",
"static",
"String",
"getChecksum",
"(",
"InputStream",
"is",
",",
"String",
"algorithm",
")",
"throws",
"IOException",
"{",
"if",
"(",
"algorithm",
".",
"equals",
"(",
"JawrConstant",
".",
"CRC32_ALGORITHM",
")",
")",
"{",
"return",
"getCRC32Checksum",... | Returns the checksum value of the input stream taking in count the
algorithm passed in parameter
@param is
the input stream
@param algorithm
the checksum algorithm
@return the checksum value
@throws IOException
if an exception occurs. | [
"Returns",
"the",
"checksum",
"value",
"of",
"the",
"input",
"stream",
"taking",
"in",
"count",
"the",
"algorithm",
"passed",
"in",
"parameter"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/CheckSumUtils.java#L140-L150 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java | ArrayUtil.setOrAppend | public static <T> T[] setOrAppend(T[] buffer, int index, T value) {
if(index < buffer.length) {
Array.set(buffer, index, value);
return buffer;
}else {
return append(buffer, value);
}
} | java | public static <T> T[] setOrAppend(T[] buffer, int index, T value) {
if(index < buffer.length) {
Array.set(buffer, index, value);
return buffer;
}else {
return append(buffer, value);
}
} | [
"public",
"static",
"<",
"T",
">",
"T",
"[",
"]",
"setOrAppend",
"(",
"T",
"[",
"]",
"buffer",
",",
"int",
"index",
",",
"T",
"value",
")",
"{",
"if",
"(",
"index",
"<",
"buffer",
".",
"length",
")",
"{",
"Array",
".",
"set",
"(",
"buffer",
","... | 将元素值设置为数组的某个位置,当给定的index大于数组长度,则追加
@param <T> 数组元素类型
@param buffer 已有数组
@param index 位置,大于长度追加,否则替换
@param value 新值
@return 新数组或原有数组
@since 4.1.2 | [
"将元素值设置为数组的某个位置,当给定的index大于数组长度,则追加"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ArrayUtil.java#L417-L424 |
RoaringBitmap/RoaringBitmap | roaringbitmap/src/main/java/org/roaringbitmap/buffer/MutableRoaringBitmap.java | MutableRoaringBitmap.flip | @Deprecated
public static MutableRoaringBitmap flip(MutableRoaringBitmap rb,
final int rangeStart, final int rangeEnd) {
if (rangeStart >= 0) {
return flip(rb, (long) rangeStart, (long) rangeEnd);
}
// rangeStart being -ve and rangeEnd being positive is not expected)
// so assume both -ve
return flip(rb, rangeStart & 0xFFFFFFFFL, rangeEnd & 0xFFFFFFFFL);
} | java | @Deprecated
public static MutableRoaringBitmap flip(MutableRoaringBitmap rb,
final int rangeStart, final int rangeEnd) {
if (rangeStart >= 0) {
return flip(rb, (long) rangeStart, (long) rangeEnd);
}
// rangeStart being -ve and rangeEnd being positive is not expected)
// so assume both -ve
return flip(rb, rangeStart & 0xFFFFFFFFL, rangeEnd & 0xFFFFFFFFL);
} | [
"@",
"Deprecated",
"public",
"static",
"MutableRoaringBitmap",
"flip",
"(",
"MutableRoaringBitmap",
"rb",
",",
"final",
"int",
"rangeStart",
",",
"final",
"int",
"rangeEnd",
")",
"{",
"if",
"(",
"rangeStart",
">=",
"0",
")",
"{",
"return",
"flip",
"(",
"rb",... | Complements the bits in the given range, from rangeStart (inclusive) rangeEnd (exclusive). The
given bitmap is unchanged.
@param rb bitmap being negated
@param rangeStart inclusive beginning of range
@param rangeEnd exclusive ending of range
@return a new Bitmap
@deprecated use the version where longs specify the range | [
"Complements",
"the",
"bits",
"in",
"the",
"given",
"range",
"from",
"rangeStart",
"(",
"inclusive",
")",
"rangeEnd",
"(",
"exclusive",
")",
".",
"The",
"given",
"bitmap",
"is",
"unchanged",
"."
] | train | https://github.com/RoaringBitmap/RoaringBitmap/blob/b26fd0a1330fd4d2877f4d74feb69ceb812e9efa/roaringbitmap/src/main/java/org/roaringbitmap/buffer/MutableRoaringBitmap.java#L458-L467 |
CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/CleverTapAPI.java | CleverTapAPI.removeMultiValuesForKey | @SuppressWarnings({"unused", "WeakerAccess"})
public void removeMultiValuesForKey(final String key, final ArrayList<String> values) {
postAsyncSafely("removeMultiValuesForKey", new Runnable() {
@Override
public void run() {
_handleMultiValues(values, key, Constants.COMMAND_REMOVE);
}
});
} | java | @SuppressWarnings({"unused", "WeakerAccess"})
public void removeMultiValuesForKey(final String key, final ArrayList<String> values) {
postAsyncSafely("removeMultiValuesForKey", new Runnable() {
@Override
public void run() {
_handleMultiValues(values, key, Constants.COMMAND_REMOVE);
}
});
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unused\"",
",",
"\"WeakerAccess\"",
"}",
")",
"public",
"void",
"removeMultiValuesForKey",
"(",
"final",
"String",
"key",
",",
"final",
"ArrayList",
"<",
"String",
">",
"values",
")",
"{",
"postAsyncSafely",
"(",
"\"removeMu... | Remove a collection of unique values from a multi-value user profile property
<p/>
If the key currently contains a scalar value, prior to performing the remove operation
the key will be promoted to a multi-value property with the current value cast to a string.
<p/>
If the multi-value property is empty after the remove operation, the key will be removed.
@param key String
@param values {@link ArrayList} with String values | [
"Remove",
"a",
"collection",
"of",
"unique",
"values",
"from",
"a",
"multi",
"-",
"value",
"user",
"profile",
"property",
"<p",
"/",
">",
"If",
"the",
"key",
"currently",
"contains",
"a",
"scalar",
"value",
"prior",
"to",
"performing",
"the",
"remove",
"op... | train | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/CleverTapAPI.java#L3463-L3471 |
protegeproject/jpaul | src/main/java/jpaul/Graphs/BinTreeUtil.java | BinTreeUtil.inOrder | public static <T> void inOrder(T root, BinTreeNavigator<T> binTreeNav, Action<T> action) {
for(Iterator<T> it = inOrder(root, binTreeNav); it.hasNext(); ) {
T treeVertex = it.next();
action.action(treeVertex);
}
} | java | public static <T> void inOrder(T root, BinTreeNavigator<T> binTreeNav, Action<T> action) {
for(Iterator<T> it = inOrder(root, binTreeNav); it.hasNext(); ) {
T treeVertex = it.next();
action.action(treeVertex);
}
} | [
"public",
"static",
"<",
"T",
">",
"void",
"inOrder",
"(",
"T",
"root",
",",
"BinTreeNavigator",
"<",
"T",
">",
"binTreeNav",
",",
"Action",
"<",
"T",
">",
"action",
")",
"{",
"for",
"(",
"Iterator",
"<",
"T",
">",
"it",
"=",
"inOrder",
"(",
"root"... | Executes an action on all nodes from a tree, in inorder. For
trees with sharing, the same tree node object will be visited
multiple times.
@param root Binary tree root.
@param binTreeNav Binary tree navigator.
@param action Action to execute on each tree node. | [
"Executes",
"an",
"action",
"on",
"all",
"nodes",
"from",
"a",
"tree",
"in",
"inorder",
".",
"For",
"trees",
"with",
"sharing",
"the",
"same",
"tree",
"node",
"object",
"will",
"be",
"visited",
"multiple",
"times",
"."
] | train | https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/Graphs/BinTreeUtil.java#L35-L40 |
btrplace/scheduler | choco/src/main/java/org/btrplace/scheduler/choco/constraint/mttr/WorstFit.java | WorstFit.canStay | private boolean canStay(VM vm) {
Mapping m = rp.getSourceModel().getMapping();
if (m.isRunning(vm)) {
int curPos = rp.getNode(m.getVMLocation(vm));
if (!rp.getVMAction(vm).getDSlice().getHoster().contains(curPos)) {
return false;
}
IStateInt[] loads = load(curPos);
return loadWith(curPos, loads, vm) <= 1.0;
}
return false;
} | java | private boolean canStay(VM vm) {
Mapping m = rp.getSourceModel().getMapping();
if (m.isRunning(vm)) {
int curPos = rp.getNode(m.getVMLocation(vm));
if (!rp.getVMAction(vm).getDSlice().getHoster().contains(curPos)) {
return false;
}
IStateInt[] loads = load(curPos);
return loadWith(curPos, loads, vm) <= 1.0;
}
return false;
} | [
"private",
"boolean",
"canStay",
"(",
"VM",
"vm",
")",
"{",
"Mapping",
"m",
"=",
"rp",
".",
"getSourceModel",
"(",
")",
".",
"getMapping",
"(",
")",
";",
"if",
"(",
"m",
".",
"isRunning",
"(",
"vm",
")",
")",
"{",
"int",
"curPos",
"=",
"rp",
".",... | Check if a VM can stay on its current node.
@param vm the VM
@return {@code true} iff the VM can stay | [
"Check",
"if",
"a",
"VM",
"can",
"stay",
"on",
"its",
"current",
"node",
"."
] | train | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/choco/src/main/java/org/btrplace/scheduler/choco/constraint/mttr/WorstFit.java#L170-L181 |
looly/hutool | hutool-http/src/main/java/cn/hutool/http/webservice/SoapClient.java | SoapClient.setHeader | public SoapClient setHeader(QName name, String actorURI, String roleUri, Boolean mustUnderstand, Boolean relay) {
SOAPHeader header;
SOAPHeaderElement ele;
try {
header = this.message.getSOAPHeader();
ele = header.addHeaderElement(name);
if (StrUtil.isNotBlank(roleUri)) {
ele.setRole(roleUri);
}
if (null != relay) {
ele.setRelay(relay);
}
} catch (SOAPException e) {
throw new SoapRuntimeException(e);
}
if (StrUtil.isNotBlank(actorURI)) {
ele.setActor(actorURI);
}
if (null != mustUnderstand) {
ele.setMustUnderstand(mustUnderstand);
}
return this;
} | java | public SoapClient setHeader(QName name, String actorURI, String roleUri, Boolean mustUnderstand, Boolean relay) {
SOAPHeader header;
SOAPHeaderElement ele;
try {
header = this.message.getSOAPHeader();
ele = header.addHeaderElement(name);
if (StrUtil.isNotBlank(roleUri)) {
ele.setRole(roleUri);
}
if (null != relay) {
ele.setRelay(relay);
}
} catch (SOAPException e) {
throw new SoapRuntimeException(e);
}
if (StrUtil.isNotBlank(actorURI)) {
ele.setActor(actorURI);
}
if (null != mustUnderstand) {
ele.setMustUnderstand(mustUnderstand);
}
return this;
} | [
"public",
"SoapClient",
"setHeader",
"(",
"QName",
"name",
",",
"String",
"actorURI",
",",
"String",
"roleUri",
",",
"Boolean",
"mustUnderstand",
",",
"Boolean",
"relay",
")",
"{",
"SOAPHeader",
"header",
";",
"SOAPHeaderElement",
"ele",
";",
"try",
"{",
"head... | 设置头信息
@param name 头信息标签名
@param actorURI 中间的消息接收者
@param roleUri Role的URI
@param mustUnderstand 标题项对于要对其进行处理的接收者来说是强制的还是可选的
@param relay relay属性
@return this | [
"设置头信息"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-http/src/main/java/cn/hutool/http/webservice/SoapClient.java#L190-L214 |
demidenko05/beigesoft-bcommon | src/main/java/org/beigesoft/holder/HldGets.java | HldGets.getFor | @Override
public final Method getFor(final Class<?> pClass, final String pFieldName) {
Method rz = null;
try {
rz = getUtlReflection().retrieveGetterForField(pClass, pFieldName);
} catch (Exception e) {
e.printStackTrace();
}
return rz;
} | java | @Override
public final Method getFor(final Class<?> pClass, final String pFieldName) {
Method rz = null;
try {
rz = getUtlReflection().retrieveGetterForField(pClass, pFieldName);
} catch (Exception e) {
e.printStackTrace();
}
return rz;
} | [
"@",
"Override",
"public",
"final",
"Method",
"getFor",
"(",
"final",
"Class",
"<",
"?",
">",
"pClass",
",",
"final",
"String",
"pFieldName",
")",
"{",
"Method",
"rz",
"=",
"null",
";",
"try",
"{",
"rz",
"=",
"getUtlReflection",
"(",
")",
".",
"retriev... | <p>Get thing for given class and thing name.</p>
@param pClass a Class
@param pFieldName Thing Name
@return a thing | [
"<p",
">",
"Get",
"thing",
"for",
"given",
"class",
"and",
"thing",
"name",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/demidenko05/beigesoft-bcommon/blob/bb446822b4fc9b5a6a8cd3cc98d0b3d83d718daf/src/main/java/org/beigesoft/holder/HldGets.java#L40-L49 |
rapidpro/expressions | java/src/main/java/io/rapidpro/expressions/evaluator/Evaluator.java | Evaluator.resolveExpressionBlock | protected String resolveExpressionBlock(String expression, EvaluationContext context, boolean urlEncode, EvaluationStrategy strategy, List<String> errors) {
try {
String body = expression.substring(1); // strip prefix
// if expression doesn't start with ( then check it's an allowed top level context reference
if (!body.startsWith("(")) {
String topLevel = StringUtils.split(body, '.')[0].toLowerCase();
if (!m_allowedTopLevels.contains(topLevel)) {
return expression;
}
}
Object evaluated = evaluateExpression(body, context, strategy);
String rendered = Conversions.toString(evaluated, context); // render result as string
return urlEncode ? ExpressionUtils.urlquote(rendered) : rendered;
}
catch (EvaluationError ex) {
logger.debug("Unable to evaluate expression", ex);
errors.add(ex.getMessage());
return expression; // if we can't evaluate expression, include it as is in the output
}
} | java | protected String resolveExpressionBlock(String expression, EvaluationContext context, boolean urlEncode, EvaluationStrategy strategy, List<String> errors) {
try {
String body = expression.substring(1); // strip prefix
// if expression doesn't start with ( then check it's an allowed top level context reference
if (!body.startsWith("(")) {
String topLevel = StringUtils.split(body, '.')[0].toLowerCase();
if (!m_allowedTopLevels.contains(topLevel)) {
return expression;
}
}
Object evaluated = evaluateExpression(body, context, strategy);
String rendered = Conversions.toString(evaluated, context); // render result as string
return urlEncode ? ExpressionUtils.urlquote(rendered) : rendered;
}
catch (EvaluationError ex) {
logger.debug("Unable to evaluate expression", ex);
errors.add(ex.getMessage());
return expression; // if we can't evaluate expression, include it as is in the output
}
} | [
"protected",
"String",
"resolveExpressionBlock",
"(",
"String",
"expression",
",",
"EvaluationContext",
"context",
",",
"boolean",
"urlEncode",
",",
"EvaluationStrategy",
"strategy",
",",
"List",
"<",
"String",
">",
"errors",
")",
"{",
"try",
"{",
"String",
"body"... | Resolves an expression block found in the template, e.g. @(...). If an evaluation error occurs, expression is
returned as is. | [
"Resolves",
"an",
"expression",
"block",
"found",
"in",
"the",
"template",
"e",
".",
"g",
"."
] | train | https://github.com/rapidpro/expressions/blob/b03d91ec58fc328960bce90ecb5fa49dcf467627/java/src/main/java/io/rapidpro/expressions/evaluator/Evaluator.java#L198-L221 |
kazocsaba/imageviewer | src/main/java/hu/kazocsaba/imageviewer/PixelInfoStatusBar.java | PixelInfoStatusBar.updateLabel | protected void updateLabel(BufferedImage image, int x, int y, int availableWidth) {
if (image.getRaster().getNumBands()==1) {
label.setText(String.format("%d, %d; intensity %d", x, y,
image.getRaster().getSample(x, y, 0)));
} else if (image.getRaster().getNumBands()==4) {
int rgb = image.getRGB(x, y);
Color c = new Color(rgb, true);
label.setText(String.format("%d, %d; color %d,%d,%d, alpha %d", x, y,
c.getRed(), c.getGreen(), c.getBlue(), c.getAlpha()));
} else {
int rgb = image.getRGB(x, y);
Color c = new Color(rgb);
label.setText(String.format("%d, %d; color %d,%d,%d", x, y,
c.getRed(), c.getGreen(), c.getBlue()));
}
if (availableWidth<label.getPreferredSize().width) {
// not enough space, shorter version is required
if (image.getRaster().getNumBands()==1) {
label.setText(String.format("%d, %d; %d", x, y,
image.getRaster().getSample(x, y, 0)));
} else if (image.getRaster().getNumBands()==4) {
int rgb = image.getRGB(x, y);
Color c = new Color(rgb, true);
label.setText(String.format("%d, %d; (%d,%d,%d,%d)", x, y,
c.getRed(), c.getGreen(), c.getBlue(), c.getAlpha()));
} else {
int rgb = image.getRGB(x, y);
Color c = new Color(rgb);
label.setText(String.format("%d, %d; (%d,%d,%d)", x, y,
c.getRed(), c.getGreen(), c.getBlue()));
}
}
} | java | protected void updateLabel(BufferedImage image, int x, int y, int availableWidth) {
if (image.getRaster().getNumBands()==1) {
label.setText(String.format("%d, %d; intensity %d", x, y,
image.getRaster().getSample(x, y, 0)));
} else if (image.getRaster().getNumBands()==4) {
int rgb = image.getRGB(x, y);
Color c = new Color(rgb, true);
label.setText(String.format("%d, %d; color %d,%d,%d, alpha %d", x, y,
c.getRed(), c.getGreen(), c.getBlue(), c.getAlpha()));
} else {
int rgb = image.getRGB(x, y);
Color c = new Color(rgb);
label.setText(String.format("%d, %d; color %d,%d,%d", x, y,
c.getRed(), c.getGreen(), c.getBlue()));
}
if (availableWidth<label.getPreferredSize().width) {
// not enough space, shorter version is required
if (image.getRaster().getNumBands()==1) {
label.setText(String.format("%d, %d; %d", x, y,
image.getRaster().getSample(x, y, 0)));
} else if (image.getRaster().getNumBands()==4) {
int rgb = image.getRGB(x, y);
Color c = new Color(rgb, true);
label.setText(String.format("%d, %d; (%d,%d,%d,%d)", x, y,
c.getRed(), c.getGreen(), c.getBlue(), c.getAlpha()));
} else {
int rgb = image.getRGB(x, y);
Color c = new Color(rgb);
label.setText(String.format("%d, %d; (%d,%d,%d)", x, y,
c.getRed(), c.getGreen(), c.getBlue()));
}
}
} | [
"protected",
"void",
"updateLabel",
"(",
"BufferedImage",
"image",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"availableWidth",
")",
"{",
"if",
"(",
"image",
".",
"getRaster",
"(",
")",
".",
"getNumBands",
"(",
")",
"==",
"1",
")",
"{",
"label",
"... | This function updates the contents of the {@link #label}. It is called when the highlighted pixel or the image changes,
and only when the image is not {@code null} and the pixel is within the bounds of the image. If either of these
conditions aren't true, the {@code update} function calls {@link #updateLabelNoData()} instead.
Override it to provide a custom message.
@param image the current image displayed in the viewer
@param x the x coordinate of the pixel that should be displayed
@param y the y coordinate of the pixel that should be displayed
@param availableWidth the maximum label width that can be displayed; you can use this parameter to specify a shorter
message if there is not enough room | [
"This",
"function",
"updates",
"the",
"contents",
"of",
"the",
"{"
] | train | https://github.com/kazocsaba/imageviewer/blob/59b8834c9dbf87bd9ca0898da3458ae592e3851e/src/main/java/hu/kazocsaba/imageviewer/PixelInfoStatusBar.java#L135-L168 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/dynamic/support/MethodParameter.java | MethodParameter.forMethodOrConstructor | public static MethodParameter forMethodOrConstructor(Object methodOrConstructor, int parameterIndex) {
if (methodOrConstructor instanceof Method) {
return new MethodParameter((Method) methodOrConstructor, parameterIndex);
} else if (methodOrConstructor instanceof Constructor) {
return new MethodParameter((Constructor<?>) methodOrConstructor, parameterIndex);
} else {
throw new IllegalArgumentException(
"Given object [" + methodOrConstructor + "] is neither a Method nor a Constructor");
}
} | java | public static MethodParameter forMethodOrConstructor(Object methodOrConstructor, int parameterIndex) {
if (methodOrConstructor instanceof Method) {
return new MethodParameter((Method) methodOrConstructor, parameterIndex);
} else if (methodOrConstructor instanceof Constructor) {
return new MethodParameter((Constructor<?>) methodOrConstructor, parameterIndex);
} else {
throw new IllegalArgumentException(
"Given object [" + methodOrConstructor + "] is neither a Method nor a Constructor");
}
} | [
"public",
"static",
"MethodParameter",
"forMethodOrConstructor",
"(",
"Object",
"methodOrConstructor",
",",
"int",
"parameterIndex",
")",
"{",
"if",
"(",
"methodOrConstructor",
"instanceof",
"Method",
")",
"{",
"return",
"new",
"MethodParameter",
"(",
"(",
"Method",
... | Create a new MethodParameter for the given method or constructor.
<p>
This is a convenience constructor for scenarios where a Method or Constructor reference is treated in a generic fashion.
@param methodOrConstructor the Method or Constructor to specify a parameter for
@param parameterIndex the index of the parameter
@return the corresponding MethodParameter instance | [
"Create",
"a",
"new",
"MethodParameter",
"for",
"the",
"given",
"method",
"or",
"constructor",
".",
"<p",
">",
"This",
"is",
"a",
"convenience",
"constructor",
"for",
"scenarios",
"where",
"a",
"Method",
"or",
"Constructor",
"reference",
"is",
"treated",
"in",... | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/dynamic/support/MethodParameter.java#L515-L524 |
stripe/stripe-java | src/main/java/com/stripe/model/File.java | File.create | public static File create(Map<String, Object> params, RequestOptions options)
throws StripeException {
return multipartRequest(RequestMethod.POST, classUrl(File.class, Stripe.getUploadBase()),
params, File.class, options);
} | java | public static File create(Map<String, Object> params, RequestOptions options)
throws StripeException {
return multipartRequest(RequestMethod.POST, classUrl(File.class, Stripe.getUploadBase()),
params, File.class, options);
} | [
"public",
"static",
"File",
"create",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"params",
",",
"RequestOptions",
"options",
")",
"throws",
"StripeException",
"{",
"return",
"multipartRequest",
"(",
"RequestMethod",
".",
"POST",
",",
"classUrl",
"(",
"File... | To upload a file to Stripe, you’ll need to send a request of type {@code multipart/form-data}.
The request should contain the file you would like to upload, as well as the parameters for
creating a file. | [
"To",
"upload",
"a",
"file",
"to",
"Stripe",
"you’ll",
"need",
"to",
"send",
"a",
"request",
"of",
"type",
"{"
] | train | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/File.java#L104-L108 |
Netflix/netflix-graph | src/main/java/com/netflix/nfgraph/NFGraph.java | NFGraph.getConnectionIterator | public OrdinalIterator getConnectionIterator(String connectionModel, String nodeType, int ordinal, String propertyName) {
int connectionModelIndex = modelHolder.getModelIndex(connectionModel);
return getConnectionIterator(connectionModelIndex, nodeType, ordinal, propertyName);
} | java | public OrdinalIterator getConnectionIterator(String connectionModel, String nodeType, int ordinal, String propertyName) {
int connectionModelIndex = modelHolder.getModelIndex(connectionModel);
return getConnectionIterator(connectionModelIndex, nodeType, ordinal, propertyName);
} | [
"public",
"OrdinalIterator",
"getConnectionIterator",
"(",
"String",
"connectionModel",
",",
"String",
"nodeType",
",",
"int",
"ordinal",
",",
"String",
"propertyName",
")",
"{",
"int",
"connectionModelIndex",
"=",
"modelHolder",
".",
"getModelIndex",
"(",
"connection... | Retrieve an {@link OrdinalIterator} over all connected ordinals in a given connection model, given the type and ordinal of the originating node, and the property by which this node is connected.
@return an {@link OrdinalIterator} over all connected ordinals | [
"Retrieve",
"an",
"{",
"@link",
"OrdinalIterator",
"}",
"over",
"all",
"connected",
"ordinals",
"in",
"a",
"given",
"connection",
"model",
"given",
"the",
"type",
"and",
"ordinal",
"of",
"the",
"originating",
"node",
"and",
"the",
"property",
"by",
"which",
... | train | https://github.com/Netflix/netflix-graph/blob/ee129252a08a9f51dd296d6fca2f0b28b7be284e/src/main/java/com/netflix/nfgraph/NFGraph.java#L134-L137 |
JetBrains/xodus | vfs/src/main/java/jetbrains/exodus/vfs/VirtualFileSystem.java | VirtualFileSystem.createFile | @NotNull
public File createFile(@NotNull final Transaction txn, final long fileDescriptor, @NotNull final String path) {
while (true) {
long current = fileDescriptorSequence.get();
long next = Math.max(fileDescriptor + 1, current);
if (fileDescriptorSequence.compareAndSet(current, next))
break;
}
return doCreateFile(txn, fileDescriptor, path);
} | java | @NotNull
public File createFile(@NotNull final Transaction txn, final long fileDescriptor, @NotNull final String path) {
while (true) {
long current = fileDescriptorSequence.get();
long next = Math.max(fileDescriptor + 1, current);
if (fileDescriptorSequence.compareAndSet(current, next))
break;
}
return doCreateFile(txn, fileDescriptor, path);
} | [
"@",
"NotNull",
"public",
"File",
"createFile",
"(",
"@",
"NotNull",
"final",
"Transaction",
"txn",
",",
"final",
"long",
"fileDescriptor",
",",
"@",
"NotNull",
"final",
"String",
"path",
")",
"{",
"while",
"(",
"true",
")",
"{",
"long",
"current",
"=",
... | Creates new file inside specified {@linkplain Transaction} with specified file descriptor and path and returns
the {@linkplain File} instance.
@param txn {@linkplain Transaction} instance
@param fileDescriptor file descriptor
@param path file path
@return new {@linkplain File}
@throws FileExistsException if a {@linkplain File} with specified path already exists
@see #createFile(Transaction, String)
@see File
@see File#getDescriptor() | [
"Creates",
"new",
"file",
"inside",
"specified",
"{",
"@linkplain",
"Transaction",
"}",
"with",
"specified",
"file",
"descriptor",
"and",
"path",
"and",
"returns",
"the",
"{",
"@linkplain",
"File",
"}",
"instance",
"."
] | train | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/vfs/src/main/java/jetbrains/exodus/vfs/VirtualFileSystem.java#L225-L234 |
lucee/Lucee | core/src/main/java/lucee/runtime/net/ntp/NtpMessage.java | NtpMessage.decodeTimestamp | public static double decodeTimestamp(byte[] array, int pointer) {
double r = 0.0;
for (int i = 0; i < 8; i++) {
r += unsignedByteToShort(array[pointer + i]) * Math.pow(2, (3 - i) * 8);
}
return r;
} | java | public static double decodeTimestamp(byte[] array, int pointer) {
double r = 0.0;
for (int i = 0; i < 8; i++) {
r += unsignedByteToShort(array[pointer + i]) * Math.pow(2, (3 - i) * 8);
}
return r;
} | [
"public",
"static",
"double",
"decodeTimestamp",
"(",
"byte",
"[",
"]",
"array",
",",
"int",
"pointer",
")",
"{",
"double",
"r",
"=",
"0.0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"8",
";",
"i",
"++",
")",
"{",
"r",
"+=",
"unsign... | Will read 8 bytes of a message beginning at <code>pointer</code> and return it as a double,
according to the NTP 64-bit timestamp format.
@param array
@param pointer
@return | [
"Will",
"read",
"8",
"bytes",
"of",
"a",
"message",
"beginning",
"at",
"<code",
">",
"pointer<",
"/",
"code",
">",
"and",
"return",
"it",
"as",
"a",
"double",
"according",
"to",
"the",
"NTP",
"64",
"-",
"bit",
"timestamp",
"format",
"."
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/net/ntp/NtpMessage.java#L289-L297 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.license_windows_new_duration_GET | public OvhOrder license_windows_new_duration_GET(String duration, String ip, OvhLicenseTypeEnum serviceType, OvhWindowsSqlVersionEnum sqlVersion, OvhWindowsOsVersionEnum version) throws IOException {
String qPath = "/order/license/windows/new/{duration}";
StringBuilder sb = path(qPath, duration);
query(sb, "ip", ip);
query(sb, "serviceType", serviceType);
query(sb, "sqlVersion", sqlVersion);
query(sb, "version", version);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhOrder.class);
} | java | public OvhOrder license_windows_new_duration_GET(String duration, String ip, OvhLicenseTypeEnum serviceType, OvhWindowsSqlVersionEnum sqlVersion, OvhWindowsOsVersionEnum version) throws IOException {
String qPath = "/order/license/windows/new/{duration}";
StringBuilder sb = path(qPath, duration);
query(sb, "ip", ip);
query(sb, "serviceType", serviceType);
query(sb, "sqlVersion", sqlVersion);
query(sb, "version", version);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhOrder.class);
} | [
"public",
"OvhOrder",
"license_windows_new_duration_GET",
"(",
"String",
"duration",
",",
"String",
"ip",
",",
"OvhLicenseTypeEnum",
"serviceType",
",",
"OvhWindowsSqlVersionEnum",
"sqlVersion",
",",
"OvhWindowsOsVersionEnum",
"version",
")",
"throws",
"IOException",
"{",
... | Get prices and contracts information
REST: GET /order/license/windows/new/{duration}
@param serviceType [required] # DEPRECATED # The kind of service on which this license will be used # Will not be used, keeped only for compatibility #
@param sqlVersion [required] The SQL Server version to enable on this license Windows license
@param version [required] This license version
@param ip [required] Ip on which this license would be installed (for dedicated your main server Ip)
@param duration [required] Duration | [
"Get",
"prices",
"and",
"contracts",
"information"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L1259-L1268 |
alkacon/opencms-core | src/org/opencms/main/CmsShellCommands.java | CmsShellCommands.createDefaultProject | public void createDefaultProject(String name, String description) throws Exception {
String storedSiteRoot = m_cms.getRequestContext().getSiteRoot();
try {
m_cms.getRequestContext().setSiteRoot("/");
CmsProject project = m_cms.createProject(
name,
description,
OpenCms.getDefaultUsers().getGroupUsers(),
OpenCms.getDefaultUsers().getGroupUsers(),
CmsProject.PROJECT_TYPE_NORMAL);
m_cms.getRequestContext().setCurrentProject(project);
m_cms.copyResourceToProject("/");
} finally {
m_cms.getRequestContext().setSiteRoot(storedSiteRoot);
}
if (OpenCms.getRoleManager().hasRole(m_cms, CmsRole.WORKPLACE_MANAGER)) {
// re-initialize the search indexes after default project generation
OpenCms.getSearchManager().initialize(m_cms);
}
} | java | public void createDefaultProject(String name, String description) throws Exception {
String storedSiteRoot = m_cms.getRequestContext().getSiteRoot();
try {
m_cms.getRequestContext().setSiteRoot("/");
CmsProject project = m_cms.createProject(
name,
description,
OpenCms.getDefaultUsers().getGroupUsers(),
OpenCms.getDefaultUsers().getGroupUsers(),
CmsProject.PROJECT_TYPE_NORMAL);
m_cms.getRequestContext().setCurrentProject(project);
m_cms.copyResourceToProject("/");
} finally {
m_cms.getRequestContext().setSiteRoot(storedSiteRoot);
}
if (OpenCms.getRoleManager().hasRole(m_cms, CmsRole.WORKPLACE_MANAGER)) {
// re-initialize the search indexes after default project generation
OpenCms.getSearchManager().initialize(m_cms);
}
} | [
"public",
"void",
"createDefaultProject",
"(",
"String",
"name",
",",
"String",
"description",
")",
"throws",
"Exception",
"{",
"String",
"storedSiteRoot",
"=",
"m_cms",
".",
"getRequestContext",
"(",
")",
".",
"getSiteRoot",
"(",
")",
";",
"try",
"{",
"m_cms"... | Creates a default project.<p>
This created project has the following properties:<ul>
<li>The users group is the default user group
<li>The users group is also the default project manager group
<li>All resources are contained in the project
<li>The project will remain after publishing</ul>
@param name the name of the project to create
@param description the description for the new project
@throws Exception if something goes wrong | [
"Creates",
"a",
"default",
"project",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/main/CmsShellCommands.java#L302-L322 |
NoraUi/NoraUi | src/main/java/com/github/noraui/browser/steps/BrowserSteps.java | BrowserSteps.closeWindowAndSwitchTo | public void closeWindowAndSwitchTo(String key, String backTo) throws TechnicalException, FailureException {
closeWindowAndSwitchTo(key);
goToUrl(backTo);
} | java | public void closeWindowAndSwitchTo(String key, String backTo) throws TechnicalException, FailureException {
closeWindowAndSwitchTo(key);
goToUrl(backTo);
} | [
"public",
"void",
"closeWindowAndSwitchTo",
"(",
"String",
"key",
",",
"String",
"backTo",
")",
"throws",
"TechnicalException",
",",
"FailureException",
"{",
"closeWindowAndSwitchTo",
"(",
"key",
")",
";",
"goToUrl",
"(",
"backTo",
")",
";",
"}"
] | Closes a specific window and go to the given url.
This method is called by reflexion from @see exceptions.ExceptionCallback#getCallBack(String).
@param key
window key to close
@param backTo
url to go back to
@throws TechnicalException
is thrown if you have a technical error (format, configuration, datas, ...) in NoraUi.
Exception with {@value com.github.noraui.utils.Messages#FAIL_MESSAGE_UNABLE_TO_CLOSE_APP} message (with screenshot, with exception)
or {@value com.github.noraui.utils.Messages#FAIL_MESSAGE_UNABLE_TO_OPEN_APPLICATION} message (with screenshot, with exception)
@throws FailureException
if the scenario encounters a functional error | [
"Closes",
"a",
"specific",
"window",
"and",
"go",
"to",
"the",
"given",
"url",
".",
"This",
"method",
"is",
"called",
"by",
"reflexion",
"from",
"@see",
"exceptions",
".",
"ExceptionCallback#getCallBack",
"(",
"String",
")",
"."
] | train | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/browser/steps/BrowserSteps.java#L188-L191 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/core/DumpedPrivateKey.java | DumpedPrivateKey.fromBase58 | public static DumpedPrivateKey fromBase58(@Nullable NetworkParameters params, String base58)
throws AddressFormatException, AddressFormatException.WrongNetwork {
byte[] versionAndDataBytes = Base58.decodeChecked(base58);
int version = versionAndDataBytes[0] & 0xFF;
byte[] bytes = Arrays.copyOfRange(versionAndDataBytes, 1, versionAndDataBytes.length);
if (params == null) {
for (NetworkParameters p : Networks.get())
if (version == p.getDumpedPrivateKeyHeader())
return new DumpedPrivateKey(p, bytes);
throw new AddressFormatException.InvalidPrefix("No network found for version " + version);
} else {
if (version == params.getDumpedPrivateKeyHeader())
return new DumpedPrivateKey(params, bytes);
throw new AddressFormatException.WrongNetwork(version);
}
} | java | public static DumpedPrivateKey fromBase58(@Nullable NetworkParameters params, String base58)
throws AddressFormatException, AddressFormatException.WrongNetwork {
byte[] versionAndDataBytes = Base58.decodeChecked(base58);
int version = versionAndDataBytes[0] & 0xFF;
byte[] bytes = Arrays.copyOfRange(versionAndDataBytes, 1, versionAndDataBytes.length);
if (params == null) {
for (NetworkParameters p : Networks.get())
if (version == p.getDumpedPrivateKeyHeader())
return new DumpedPrivateKey(p, bytes);
throw new AddressFormatException.InvalidPrefix("No network found for version " + version);
} else {
if (version == params.getDumpedPrivateKeyHeader())
return new DumpedPrivateKey(params, bytes);
throw new AddressFormatException.WrongNetwork(version);
}
} | [
"public",
"static",
"DumpedPrivateKey",
"fromBase58",
"(",
"@",
"Nullable",
"NetworkParameters",
"params",
",",
"String",
"base58",
")",
"throws",
"AddressFormatException",
",",
"AddressFormatException",
".",
"WrongNetwork",
"{",
"byte",
"[",
"]",
"versionAndDataBytes",... | Construct a private key from its Base58 representation.
@param params
The expected NetworkParameters or null if you don't want validation.
@param base58
The textual form of the private key.
@throws AddressFormatException
if the given base58 doesn't parse or the checksum is invalid
@throws AddressFormatException.WrongNetwork
if the given private key is valid but for a different chain (eg testnet vs mainnet) | [
"Construct",
"a",
"private",
"key",
"from",
"its",
"Base58",
"representation",
"."
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/core/DumpedPrivateKey.java#L46-L61 |
landawn/AbacusUtil | src/com/landawn/abacus/util/BooleanList.java | BooleanList.reduce | public <E extends Exception> boolean reduce(final boolean identity, final Try.BooleanBinaryOperator<E> accumulator) throws E {
if (isEmpty()) {
return identity;
}
boolean result = identity;
for (int i = 0; i < size; i++) {
result = accumulator.applyAsBoolean(result, elementData[i]);
}
return result;
} | java | public <E extends Exception> boolean reduce(final boolean identity, final Try.BooleanBinaryOperator<E> accumulator) throws E {
if (isEmpty()) {
return identity;
}
boolean result = identity;
for (int i = 0; i < size; i++) {
result = accumulator.applyAsBoolean(result, elementData[i]);
}
return result;
} | [
"public",
"<",
"E",
"extends",
"Exception",
">",
"boolean",
"reduce",
"(",
"final",
"boolean",
"identity",
",",
"final",
"Try",
".",
"BooleanBinaryOperator",
"<",
"E",
">",
"accumulator",
")",
"throws",
"E",
"{",
"if",
"(",
"isEmpty",
"(",
")",
")",
"{",... | This is equivalent to:
<pre>
<code>
if (isEmpty()) {
return identity;
}
boolean result = identity;
for (int i = 0; i < size; i++) {
result = accumulator.applyAsBoolean(result, elementData[i]);
}
return result;
</code>
</pre>
@param identity
@param accumulator
@return | [
"This",
"is",
"equivalent",
"to",
":",
"<pre",
">",
"<code",
">",
"if",
"(",
"isEmpty",
"()",
")",
"{",
"return",
"identity",
";",
"}"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/BooleanList.java#L1041-L1053 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java | SearchIndex.updateNodes | @Override
public void updateNodes(final Iterator<String> remove, final Iterator<NodeData> add) throws RepositoryException,
IOException
{
checkOpen();
apply(getChanges(remove, add));
} | java | @Override
public void updateNodes(final Iterator<String> remove, final Iterator<NodeData> add) throws RepositoryException,
IOException
{
checkOpen();
apply(getChanges(remove, add));
} | [
"@",
"Override",
"public",
"void",
"updateNodes",
"(",
"final",
"Iterator",
"<",
"String",
">",
"remove",
",",
"final",
"Iterator",
"<",
"NodeData",
">",
"add",
")",
"throws",
"RepositoryException",
",",
"IOException",
"{",
"checkOpen",
"(",
")",
";",
"apply... | This implementation forwards the call to
{@link MultiIndex#update(Collection, Collection)} and transforms the two
iterators to the required types.
@param remove
uuids of nodes to remove.
@param add
NodeStates to add. Calls to <code>next()</code> on this
iterator may return <code>null</code>, to indicate that a node
could not be indexed successfully.
@throws RepositoryException
if an error occurs while indexing a node.
@throws IOException
if an error occurs while updating the index. | [
"This",
"implementation",
"forwards",
"the",
"call",
"to",
"{",
"@link",
"MultiIndex#update",
"(",
"Collection",
"Collection",
")",
"}",
"and",
"transforms",
"the",
"two",
"iterators",
"to",
"the",
"required",
"types",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/SearchIndex.java#L1270-L1276 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/NodeSet.java | NodeSet.addNodesInDocOrder | public void addNodesInDocOrder(NodeIterator iterator, XPathContext support)
{
if (!m_mutable)
throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
Node node;
while (null != (node = iterator.nextNode()))
{
addNodeInDocOrder(node, support);
}
} | java | public void addNodesInDocOrder(NodeIterator iterator, XPathContext support)
{
if (!m_mutable)
throw new RuntimeException(XSLMessages.createXPATHMessage(XPATHErrorResources.ER_NODESET_NOT_MUTABLE, null)); //"This NodeSet is not mutable!");
Node node;
while (null != (node = iterator.nextNode()))
{
addNodeInDocOrder(node, support);
}
} | [
"public",
"void",
"addNodesInDocOrder",
"(",
"NodeIterator",
"iterator",
",",
"XPathContext",
"support",
")",
"{",
"if",
"(",
"!",
"m_mutable",
")",
"throw",
"new",
"RuntimeException",
"(",
"XSLMessages",
".",
"createXPATHMessage",
"(",
"XPATHErrorResources",
".",
... | Copy NodeList members into this nodelist, adding in
document order. If a node is null, don't add it.
@param iterator NodeIterator which yields the nodes to be added.
@param support The XPath runtime context.
@throws RuntimeException thrown if this NodeSet is not of
a mutable type. | [
"Copy",
"NodeList",
"members",
"into",
"this",
"nodelist",
"adding",
"in",
"document",
"order",
".",
"If",
"a",
"node",
"is",
"null",
"don",
"t",
"add",
"it",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/NodeSet.java#L544-L556 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/paragraphvectors/ParagraphVectors.java | ParagraphVectors.inferVector | public INDArray inferVector(@NonNull List<VocabWord> document, double learningRate, double minLearningRate,
int iterations) {
if (this.vocab == null || this.vocab.numWords() == 0)
reassignExistingModel();
SequenceLearningAlgorithm<VocabWord> learner = sequenceLearningAlgorithm;
if (learner == null) {
synchronized (this) {
if (sequenceLearningAlgorithm == null) {
log.info("Creating new PV-DM learner...");
learner = new DM<>();
learner.configure(vocab, lookupTable, configuration);
sequenceLearningAlgorithm = learner;
} else {
learner = sequenceLearningAlgorithm;
}
}
}
learner = sequenceLearningAlgorithm;
if (document.isEmpty())
throw new ND4JIllegalStateException("Impossible to apply inference to empty list of words");
Sequence<VocabWord> sequence = new Sequence<>();
sequence.addElements(document);
sequence.setSequenceLabel(new VocabWord(1.0, String.valueOf(new Random().nextInt())));
initLearners();
INDArray inf = learner.inferSequence(sequence, seed, learningRate, minLearningRate, iterations);
return inf;
} | java | public INDArray inferVector(@NonNull List<VocabWord> document, double learningRate, double minLearningRate,
int iterations) {
if (this.vocab == null || this.vocab.numWords() == 0)
reassignExistingModel();
SequenceLearningAlgorithm<VocabWord> learner = sequenceLearningAlgorithm;
if (learner == null) {
synchronized (this) {
if (sequenceLearningAlgorithm == null) {
log.info("Creating new PV-DM learner...");
learner = new DM<>();
learner.configure(vocab, lookupTable, configuration);
sequenceLearningAlgorithm = learner;
} else {
learner = sequenceLearningAlgorithm;
}
}
}
learner = sequenceLearningAlgorithm;
if (document.isEmpty())
throw new ND4JIllegalStateException("Impossible to apply inference to empty list of words");
Sequence<VocabWord> sequence = new Sequence<>();
sequence.addElements(document);
sequence.setSequenceLabel(new VocabWord(1.0, String.valueOf(new Random().nextInt())));
initLearners();
INDArray inf = learner.inferSequence(sequence, seed, learningRate, minLearningRate, iterations);
return inf;
} | [
"public",
"INDArray",
"inferVector",
"(",
"@",
"NonNull",
"List",
"<",
"VocabWord",
">",
"document",
",",
"double",
"learningRate",
",",
"double",
"minLearningRate",
",",
"int",
"iterations",
")",
"{",
"if",
"(",
"this",
".",
"vocab",
"==",
"null",
"||",
"... | This method calculates inferred vector for given document
@param document
@return | [
"This",
"method",
"calculates",
"inferred",
"vector",
"for",
"given",
"document"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/paragraphvectors/ParagraphVectors.java#L246-L284 |
Red5/red5-server-common | src/main/java/org/red5/server/messaging/AbstractPipe.java | AbstractPipe.fireProviderConnectionEvent | protected void fireProviderConnectionEvent(IProvider provider, PipeConnectionEvent.EventType type, Map<String, Object> paramMap) {
firePipeConnectionEvent(PipeConnectionEvent.build(this, type, provider, paramMap));
} | java | protected void fireProviderConnectionEvent(IProvider provider, PipeConnectionEvent.EventType type, Map<String, Object> paramMap) {
firePipeConnectionEvent(PipeConnectionEvent.build(this, type, provider, paramMap));
} | [
"protected",
"void",
"fireProviderConnectionEvent",
"(",
"IProvider",
"provider",
",",
"PipeConnectionEvent",
".",
"EventType",
"type",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"paramMap",
")",
"{",
"firePipeConnectionEvent",
"(",
"PipeConnectionEvent",
".",
"... | Broadcast provider connection event
@param provider
Provider that has connected
@param type
Event type
@param paramMap
Parameters passed with connection | [
"Broadcast",
"provider",
"connection",
"event"
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/messaging/AbstractPipe.java#L253-L255 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/protocols/payments/PaymentSession.java | PaymentSession.getSendRequest | public SendRequest getSendRequest() {
Transaction tx = new Transaction(params);
for (Protos.Output output : paymentDetails.getOutputsList())
tx.addOutput(new TransactionOutput(params, tx, Coin.valueOf(output.getAmount()), output.getScript().toByteArray()));
return SendRequest.forTx(tx).fromPaymentDetails(paymentDetails);
} | java | public SendRequest getSendRequest() {
Transaction tx = new Transaction(params);
for (Protos.Output output : paymentDetails.getOutputsList())
tx.addOutput(new TransactionOutput(params, tx, Coin.valueOf(output.getAmount()), output.getScript().toByteArray()));
return SendRequest.forTx(tx).fromPaymentDetails(paymentDetails);
} | [
"public",
"SendRequest",
"getSendRequest",
"(",
")",
"{",
"Transaction",
"tx",
"=",
"new",
"Transaction",
"(",
"params",
")",
";",
"for",
"(",
"Protos",
".",
"Output",
"output",
":",
"paymentDetails",
".",
"getOutputsList",
"(",
")",
")",
"tx",
".",
"addOu... | Returns a {@link SendRequest} suitable for broadcasting to the network. | [
"Returns",
"a",
"{"
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/protocols/payments/PaymentSession.java#L300-L305 |
ReactiveX/RxJavaAsyncUtil | src/main/java/rx/util/async/Async.java | Async.toAsync | public static <T1, R> Func1<T1, Observable<R>> toAsync(Func1<? super T1, ? extends R> func) {
return toAsync(func, Schedulers.computation());
} | java | public static <T1, R> Func1<T1, Observable<R>> toAsync(Func1<? super T1, ? extends R> func) {
return toAsync(func, Schedulers.computation());
} | [
"public",
"static",
"<",
"T1",
",",
"R",
">",
"Func1",
"<",
"T1",
",",
"Observable",
"<",
"R",
">",
">",
"toAsync",
"(",
"Func1",
"<",
"?",
"super",
"T1",
",",
"?",
"extends",
"R",
">",
"func",
")",
"{",
"return",
"toAsync",
"(",
"func",
",",
"... | Convert a synchronous function call into an asynchronous function call through an Observable.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toAsync.png" alt="">
@param <T1> first parameter type of the action
@param <R> the result type
@param func the function to convert
@return a function that returns an Observable that executes the {@code func} and emits its returned value
@see <a href="https://github.com/ReactiveX/RxJava/wiki/Async-Operators#wiki-toasync-or-asyncaction-or-asyncfunc">RxJava Wiki: toAsync()</a>
@see <a href="http://msdn.microsoft.com/en-us/library/hh229755.aspx">MSDN: Observable.ToAsync</a> | [
"Convert",
"a",
"synchronous",
"function",
"call",
"into",
"an",
"asynchronous",
"function",
"call",
"through",
"an",
"Observable",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"src",
"=",
"https",
":",
"//",
"raw",
".",
"github",
".",
"com",
"/",
"wiki"... | train | https://github.com/ReactiveX/RxJavaAsyncUtil/blob/6294e1da30e639df79f76399906229314c14e74d/src/main/java/rx/util/async/Async.java#L207-L209 |
Netflix/karyon | karyon2-governator/src/main/java/netflix/karyon/Karyon.java | Karyon.forRequestHandler | public static KaryonServer forRequestHandler(int port, final RequestHandler<ByteBuf, ByteBuf> handler,
BootstrapModule... bootstrapModules) {
HttpServer<ByteBuf, ByteBuf> httpServer =
KaryonTransport.newHttpServer(port, new RequestHandler<ByteBuf, ByteBuf>() {
@Override
public Observable<Void> handle(HttpServerRequest<ByteBuf> request,
HttpServerResponse<ByteBuf> response) {
return handler.handle(request, response);
}
});
return new RxNettyServerBackedServer(httpServer, bootstrapModules);
} | java | public static KaryonServer forRequestHandler(int port, final RequestHandler<ByteBuf, ByteBuf> handler,
BootstrapModule... bootstrapModules) {
HttpServer<ByteBuf, ByteBuf> httpServer =
KaryonTransport.newHttpServer(port, new RequestHandler<ByteBuf, ByteBuf>() {
@Override
public Observable<Void> handle(HttpServerRequest<ByteBuf> request,
HttpServerResponse<ByteBuf> response) {
return handler.handle(request, response);
}
});
return new RxNettyServerBackedServer(httpServer, bootstrapModules);
} | [
"public",
"static",
"KaryonServer",
"forRequestHandler",
"(",
"int",
"port",
",",
"final",
"RequestHandler",
"<",
"ByteBuf",
",",
"ByteBuf",
">",
"handler",
",",
"BootstrapModule",
"...",
"bootstrapModules",
")",
"{",
"HttpServer",
"<",
"ByteBuf",
",",
"ByteBuf",
... | Creates a new {@link KaryonServer} that has a single HTTP server instance which delegates all request
handling to {@link RequestHandler}.
The {@link HttpServer} is created using {@link KaryonTransport#newHttpServer(int, HttpRequestHandler)}
@param port Port for the server.
@param handler Request Handler
@param bootstrapModules Additional bootstrapModules if any.
@return {@link KaryonServer} which is to be used to start the created server. | [
"Creates",
"a",
"new",
"{",
"@link",
"KaryonServer",
"}",
"that",
"has",
"a",
"single",
"HTTP",
"server",
"instance",
"which",
"delegates",
"all",
"request",
"handling",
"to",
"{",
"@link",
"RequestHandler",
"}",
".",
"The",
"{",
"@link",
"HttpServer",
"}",
... | train | https://github.com/Netflix/karyon/blob/d50bc0ff37693ef3fbda373e90a109d1f92e0b9a/karyon2-governator/src/main/java/netflix/karyon/Karyon.java#L63-L74 |
tempodb/tempodb-java | src/main/java/com/tempodb/Client.java | Client.deleteAllSeries | public Result<DeleteSummary> deleteAllSeries() {
URI uri = null;
try {
URIBuilder builder = new URIBuilder(String.format("/%s/series/", API_VERSION));
builder.addParameter("allow_truncation", "true");
uri = builder.build();
} catch (URISyntaxException e) {
String message = "Could not build URI";
throw new IllegalArgumentException(message, e);
}
HttpRequest request = buildRequest(uri.toString(), HttpMethod.DELETE);
Result<DeleteSummary> result = execute(request, DeleteSummary.class);
return result;
} | java | public Result<DeleteSummary> deleteAllSeries() {
URI uri = null;
try {
URIBuilder builder = new URIBuilder(String.format("/%s/series/", API_VERSION));
builder.addParameter("allow_truncation", "true");
uri = builder.build();
} catch (URISyntaxException e) {
String message = "Could not build URI";
throw new IllegalArgumentException(message, e);
}
HttpRequest request = buildRequest(uri.toString(), HttpMethod.DELETE);
Result<DeleteSummary> result = execute(request, DeleteSummary.class);
return result;
} | [
"public",
"Result",
"<",
"DeleteSummary",
">",
"deleteAllSeries",
"(",
")",
"{",
"URI",
"uri",
"=",
"null",
";",
"try",
"{",
"URIBuilder",
"builder",
"=",
"new",
"URIBuilder",
"(",
"String",
".",
"format",
"(",
"\"/%s/series/\"",
",",
"API_VERSION",
")",
"... | Deletes all Series in a database.
@return A DeleteSummary providing information about the series deleted.
@see DeleteSummary
@since 1.0.0 | [
"Deletes",
"all",
"Series",
"in",
"a",
"database",
"."
] | train | https://github.com/tempodb/tempodb-java/blob/5733f204fe4c8dda48916ba1f67cf44f5a3f9c69/src/main/java/com/tempodb/Client.java#L272-L286 |
carrotsearch/hppc | hppc/src/main/templates/com/carrotsearch/hppc/KTypeVTypeHashMap.java | KTypeVTypeHashMap.addTo | @Override
public VType addTo(KType key, VType incrementValue)
{
return putOrAdd(key, incrementValue, incrementValue);
} | java | @Override
public VType addTo(KType key, VType incrementValue)
{
return putOrAdd(key, incrementValue, incrementValue);
} | [
"@",
"Override",
"public",
"VType",
"addTo",
"(",
"KType",
"key",
",",
"VType",
"incrementValue",
")",
"{",
"return",
"putOrAdd",
"(",
"key",
",",
"incrementValue",
",",
"incrementValue",
")",
";",
"}"
] | Adds <code>incrementValue</code> to any existing value for the given <code>key</code>
or inserts <code>incrementValue</code> if <code>key</code> did not previously exist.
@param key The key of the value to adjust.
@param incrementValue The value to put or add to the existing value if <code>key</code> exists.
@return Returns the current value associated with <code>key</code> (after changes). | [
"Adds",
"<code",
">",
"incrementValue<",
"/",
"code",
">",
"to",
"any",
"existing",
"value",
"for",
"the",
"given",
"<code",
">",
"key<",
"/",
"code",
">",
"or",
"inserts",
"<code",
">",
"incrementValue<",
"/",
"code",
">",
"if",
"<code",
">",
"key<",
... | train | https://github.com/carrotsearch/hppc/blob/e359e9da358e846fcbffc64a765611df954ba3f6/hppc/src/main/templates/com/carrotsearch/hppc/KTypeVTypeHashMap.java#L275-L279 |
ralscha/extdirectspring | src/main/java/ch/ralscha/extdirectspring/bean/ExtDirectFormPostResult.java | ExtDirectFormPostResult.addErrors | @SuppressWarnings("unchecked")
public void addErrors(String field, List<String> errors) {
Assert.notNull(field, "field must not be null");
Assert.notNull(errors, "field must not be null");
// do not overwrite existing errors
Map<String, List<String>> errorMap = (Map<String, List<String>>) this.result
.get(ERRORS_PROPERTY);
if (errorMap == null) {
errorMap = new HashMap<>();
addResultProperty(ERRORS_PROPERTY, errorMap);
}
List<String> fieldErrors = errorMap.get(field);
if (fieldErrors == null) {
fieldErrors = new ArrayList<>();
errorMap.put(field, fieldErrors);
}
fieldErrors.addAll(errors);
addResultProperty(SUCCESS_PROPERTY, Boolean.FALSE);
} | java | @SuppressWarnings("unchecked")
public void addErrors(String field, List<String> errors) {
Assert.notNull(field, "field must not be null");
Assert.notNull(errors, "field must not be null");
// do not overwrite existing errors
Map<String, List<String>> errorMap = (Map<String, List<String>>) this.result
.get(ERRORS_PROPERTY);
if (errorMap == null) {
errorMap = new HashMap<>();
addResultProperty(ERRORS_PROPERTY, errorMap);
}
List<String> fieldErrors = errorMap.get(field);
if (fieldErrors == null) {
fieldErrors = new ArrayList<>();
errorMap.put(field, fieldErrors);
}
fieldErrors.addAll(errors);
addResultProperty(SUCCESS_PROPERTY, Boolean.FALSE);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"void",
"addErrors",
"(",
"String",
"field",
",",
"List",
"<",
"String",
">",
"errors",
")",
"{",
"Assert",
".",
"notNull",
"(",
"field",
",",
"\"field must not be null\"",
")",
";",
"Assert",
"."... | Adds multiple error messages to a specific field. Does not overwrite already
existing errors.
@param field the name of the field
@param errors a collection of error messages | [
"Adds",
"multiple",
"error",
"messages",
"to",
"a",
"specific",
"field",
".",
"Does",
"not",
"overwrite",
"already",
"existing",
"errors",
"."
] | train | https://github.com/ralscha/extdirectspring/blob/4b018497c4e7503033f91d0491b4e74bf8291d2c/src/main/java/ch/ralscha/extdirectspring/bean/ExtDirectFormPostResult.java#L197-L218 |
aoindustries/aoweb-framework | src/main/java/com/aoindustries/website/framework/TextOnlyLayout.java | TextOnlyLayout.printContentVerticalDivider | @Override
public void printContentVerticalDivider(ChainWriter out, WebSiteRequest req, HttpServletResponse resp, int direction, int colspan, int rowspan, String align, String width) {
out.print(" </td>\n");
switch(direction) {
case UP_AND_DOWN:
out.print(" <td> </td>\n");
break;
case NONE:
break;
default: throw new IllegalArgumentException("Unknown direction: "+direction);
}
out.print(" <td");
if(width!=null && width.length()>0) {
out.append(" style='width:");
out.append(width);
out.append('\'');
}
out.print(" valign='top'");
if(colspan!=1) out.print(" colspan='").print(colspan).print('\'');
if(rowspan!=1) out.print(" rowspan='").print(rowspan).print('\'');
if(align!=null && !align.equals("left")) out.print(" align='").print(align).print('\'');
out.print('>');
} | java | @Override
public void printContentVerticalDivider(ChainWriter out, WebSiteRequest req, HttpServletResponse resp, int direction, int colspan, int rowspan, String align, String width) {
out.print(" </td>\n");
switch(direction) {
case UP_AND_DOWN:
out.print(" <td> </td>\n");
break;
case NONE:
break;
default: throw new IllegalArgumentException("Unknown direction: "+direction);
}
out.print(" <td");
if(width!=null && width.length()>0) {
out.append(" style='width:");
out.append(width);
out.append('\'');
}
out.print(" valign='top'");
if(colspan!=1) out.print(" colspan='").print(colspan).print('\'');
if(rowspan!=1) out.print(" rowspan='").print(rowspan).print('\'');
if(align!=null && !align.equals("left")) out.print(" align='").print(align).print('\'');
out.print('>');
} | [
"@",
"Override",
"public",
"void",
"printContentVerticalDivider",
"(",
"ChainWriter",
"out",
",",
"WebSiteRequest",
"req",
",",
"HttpServletResponse",
"resp",
",",
"int",
"direction",
",",
"int",
"colspan",
",",
"int",
"rowspan",
",",
"String",
"align",
",",
"St... | Starts one line of content with the initial colspan set to the provided colspan. | [
"Starts",
"one",
"line",
"of",
"content",
"with",
"the",
"initial",
"colspan",
"set",
"to",
"the",
"provided",
"colspan",
"."
] | train | https://github.com/aoindustries/aoweb-framework/blob/8e58af4f5dd898cd2fdb855ffa810a1ca6973ae0/src/main/java/com/aoindustries/website/framework/TextOnlyLayout.java#L401-L423 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java | StreamSegmentReadIndex.createDataNotAvailableRead | private ReadResultEntryBase createDataNotAvailableRead(long streamSegmentOffset, int maxLength) {
maxLength = getLengthUntilNextEntry(streamSegmentOffset, maxLength);
long storageLength = this.metadata.getStorageLength();
if (streamSegmentOffset < storageLength) {
// Requested data exists in Storage.
// Determine actual read length (until Storage Length) and make sure it does not exceed maxLength.
long actualReadLength = storageLength - streamSegmentOffset;
if (actualReadLength > maxLength) {
actualReadLength = maxLength;
}
return createStorageRead(streamSegmentOffset, (int) actualReadLength);
} else {
// Note that Future Reads are not necessarily tail reads. They mean that we cannot return a result given
// the current state of the metadata. An example of when we might return a Future Read that is not a tail read
// is when we receive a read request immediately after recovery, but before the StorageWriter has had a chance
// to refresh the Storage state (the metadata may be a bit out of date). In that case, we record a Future Read
// which will be completed when the StorageWriter invokes triggerFutureReads() upon refreshing the info.
return createFutureRead(streamSegmentOffset, maxLength);
}
} | java | private ReadResultEntryBase createDataNotAvailableRead(long streamSegmentOffset, int maxLength) {
maxLength = getLengthUntilNextEntry(streamSegmentOffset, maxLength);
long storageLength = this.metadata.getStorageLength();
if (streamSegmentOffset < storageLength) {
// Requested data exists in Storage.
// Determine actual read length (until Storage Length) and make sure it does not exceed maxLength.
long actualReadLength = storageLength - streamSegmentOffset;
if (actualReadLength > maxLength) {
actualReadLength = maxLength;
}
return createStorageRead(streamSegmentOffset, (int) actualReadLength);
} else {
// Note that Future Reads are not necessarily tail reads. They mean that we cannot return a result given
// the current state of the metadata. An example of when we might return a Future Read that is not a tail read
// is when we receive a read request immediately after recovery, but before the StorageWriter has had a chance
// to refresh the Storage state (the metadata may be a bit out of date). In that case, we record a Future Read
// which will be completed when the StorageWriter invokes triggerFutureReads() upon refreshing the info.
return createFutureRead(streamSegmentOffset, maxLength);
}
} | [
"private",
"ReadResultEntryBase",
"createDataNotAvailableRead",
"(",
"long",
"streamSegmentOffset",
",",
"int",
"maxLength",
")",
"{",
"maxLength",
"=",
"getLengthUntilNextEntry",
"(",
"streamSegmentOffset",
",",
"maxLength",
")",
";",
"long",
"storageLength",
"=",
"thi... | Creates a ReadResultEntry that is a placeholder for data that is not currently available in memory.
@param streamSegmentOffset The Offset in the StreamSegment where to the ReadResultEntry starts at.
@param maxLength The maximum length of the Read, from the Offset of this ReadResultEntry. | [
"Creates",
"a",
"ReadResultEntry",
"that",
"is",
"a",
"placeholder",
"for",
"data",
"that",
"is",
"not",
"currently",
"available",
"in",
"memory",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java#L922-L942 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/config/ConfigValidator.java | ConfigValidator.ensurePropertyNotConfigured | public static void ensurePropertyNotConfigured(HazelcastProperties properties, HazelcastProperty hazelcastProperty)
throws ConfigurationException {
if (properties.containsKey(hazelcastProperty)) {
throw new ConfigurationException("Service start failed. The legacy property " + hazelcastProperty.getName()
+ " is provided together with new Config object. "
+ "Remove the property from your configuration to fix this issue.");
}
} | java | public static void ensurePropertyNotConfigured(HazelcastProperties properties, HazelcastProperty hazelcastProperty)
throws ConfigurationException {
if (properties.containsKey(hazelcastProperty)) {
throw new ConfigurationException("Service start failed. The legacy property " + hazelcastProperty.getName()
+ " is provided together with new Config object. "
+ "Remove the property from your configuration to fix this issue.");
}
} | [
"public",
"static",
"void",
"ensurePropertyNotConfigured",
"(",
"HazelcastProperties",
"properties",
",",
"HazelcastProperty",
"hazelcastProperty",
")",
"throws",
"ConfigurationException",
"{",
"if",
"(",
"properties",
".",
"containsKey",
"(",
"hazelcastProperty",
")",
")... | Throws {@link ConfigurationException} if given group property is defined within Hazelcast properties.
@param properties Group properties
@param hazelcastProperty property to be checked
@throws ConfigurationException | [
"Throws",
"{",
"@link",
"ConfigurationException",
"}",
"if",
"given",
"group",
"property",
"is",
"defined",
"within",
"Hazelcast",
"properties",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/config/ConfigValidator.java#L497-L504 |
aol/cyclops | cyclops-futurestream/src/main/java/cyclops/futurestream/LazyReact.java | LazyReact.fromAdapter | public <U> FutureStream<U> fromAdapter(final Adapter<U> adapter) {
final Subscription sub = new Subscription();
return new FutureStreamImpl(this,()->adapter.stream(sub)){
@Override
public ReactiveSeq<U> stream() {
return (ReactiveSeq<U>)adapter.stream(sub);
}
};
} | java | public <U> FutureStream<U> fromAdapter(final Adapter<U> adapter) {
final Subscription sub = new Subscription();
return new FutureStreamImpl(this,()->adapter.stream(sub)){
@Override
public ReactiveSeq<U> stream() {
return (ReactiveSeq<U>)adapter.stream(sub);
}
};
} | [
"public",
"<",
"U",
">",
"FutureStream",
"<",
"U",
">",
"fromAdapter",
"(",
"final",
"Adapter",
"<",
"U",
">",
"adapter",
")",
"{",
"final",
"Subscription",
"sub",
"=",
"new",
"Subscription",
"(",
")",
";",
"return",
"new",
"FutureStreamImpl",
"(",
"this... | Generate a FutureStream from the data flowing into the prodiced Adapter
<pre>
{@code
Topic<Integer> topic = new Topic<>();
new LazyReact(10,10).fromAdapter(topic)
.forEach(this::process);
//on anther thread
topic.offer(100);
topic.offer(200);
}
</pre>
@param adapter Adapter to construct FutureStream from
@return FutureStream | [
"Generate",
"a",
"FutureStream",
"from",
"the",
"data",
"flowing",
"into",
"the",
"prodiced",
"Adapter",
"<pre",
">",
"{",
"@code"
] | train | https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops-futurestream/src/main/java/cyclops/futurestream/LazyReact.java#L848-L858 |
op4j/op4j | src/main/java/org/op4j/Op.java | Op.onArrayFor | public static <T> Level0ArrayOperator<Float[],Float> onArrayFor(final Float... elements) {
return onArrayOf(Types.FLOAT, VarArgsUtil.asRequiredObjectArray(elements));
} | java | public static <T> Level0ArrayOperator<Float[],Float> onArrayFor(final Float... elements) {
return onArrayOf(Types.FLOAT, VarArgsUtil.asRequiredObjectArray(elements));
} | [
"public",
"static",
"<",
"T",
">",
"Level0ArrayOperator",
"<",
"Float",
"[",
"]",
",",
"Float",
">",
"onArrayFor",
"(",
"final",
"Float",
"...",
"elements",
")",
"{",
"return",
"onArrayOf",
"(",
"Types",
".",
"FLOAT",
",",
"VarArgsUtil",
".",
"asRequiredOb... | <p>
Creates an array with the specified elements and an <i>operation expression</i> on it.
</p>
@param elements the elements of the array being created
@return an operator, ready for chaining | [
"<p",
">",
"Creates",
"an",
"array",
"with",
"the",
"specified",
"elements",
"and",
"an",
"<i",
">",
"operation",
"expression<",
"/",
"i",
">",
"on",
"it",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/Op.java#L932-L934 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.