repository_name stringlengths 7 58 | func_path_in_repository stringlengths 18 194 | func_name stringlengths 6 111 | whole_func_string stringlengths 80 3.8k | language stringclasses 1
value | func_code_string stringlengths 80 3.8k | func_code_tokens listlengths 20 697 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 434 | split_name stringclasses 1
value | func_code_url stringlengths 111 308 |
|---|---|---|---|---|---|---|---|---|---|---|
ModeShape/modeshape | web/modeshape-web-jcr-rest/src/main/java/org/modeshape/web/jcr/rest/handler/RestItemHandler.java | RestItemHandler.addItems | public Response addItems( HttpServletRequest request,
String repositoryName,
String workspaceName,
String requestContent ) throws JSONException, RepositoryException {
JSONObject requestBody = stringToJSONObject(requestContent);
if (requestBody.length() == 0) {
return Response.ok().build();
}
Session session = getSession(request, repositoryName, workspaceName);
TreeMap<String, JSONObject> nodesByPath = createNodesByPathMap(requestBody);
return addMultipleNodes(request, nodesByPath, session);
} | java | public Response addItems( HttpServletRequest request,
String repositoryName,
String workspaceName,
String requestContent ) throws JSONException, RepositoryException {
JSONObject requestBody = stringToJSONObject(requestContent);
if (requestBody.length() == 0) {
return Response.ok().build();
}
Session session = getSession(request, repositoryName, workspaceName);
TreeMap<String, JSONObject> nodesByPath = createNodesByPathMap(requestBody);
return addMultipleNodes(request, nodesByPath, session);
} | [
"public",
"Response",
"addItems",
"(",
"HttpServletRequest",
"request",
",",
"String",
"repositoryName",
",",
"String",
"workspaceName",
",",
"String",
"requestContent",
")",
"throws",
"JSONException",
",",
"RepositoryException",
"{",
"JSONObject",
"requestBody",
"=",
... | Performs a bulk creation of items, using a single {@link Session}. If any of the items cannot be created for whatever
reason, the entire operation fails.
@param request the servlet request; may not be null or unauthenticated
@param repositoryName the URL-encoded repository name
@param workspaceName the URL-encoded workspace name
@param requestContent the JSON-encoded representation of the nodes and, possibly, properties to be added
@return a {@code non-null} {@link Response}
@throws JSONException if the body of the request is not a valid JSON object
@throws RepositoryException if any of the JCR operations fail
@see RestItemHandler#addItem(javax.servlet.http.HttpServletRequest, String, String, String, String) | [
"Performs",
"a",
"bulk",
"creation",
"of",
"items",
"using",
"a",
"single",
"{",
"@link",
"Session",
"}",
".",
"If",
"any",
"of",
"the",
"items",
"cannot",
"be",
"created",
"for",
"whatever",
"reason",
"the",
"entire",
"operation",
"fails",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/web/modeshape-web-jcr-rest/src/main/java/org/modeshape/web/jcr/rest/handler/RestItemHandler.java#L179-L190 |
io7m/jaffirm | com.io7m.jaffirm.core/src/main/java/com/io7m/jaffirm/core/Postconditions.java | Postconditions.checkPostconditionD | public static double checkPostconditionD(
final double value,
final DoublePredicate predicate,
final DoubleFunction<String> describer)
{
final boolean ok;
try {
ok = predicate.test(value);
} catch (final Throwable e) {
throw failed(
e,
Double.valueOf(value),
singleViolation(failedPredicate(e)));
}
return innerCheckD(value, ok, describer);
} | java | public static double checkPostconditionD(
final double value,
final DoublePredicate predicate,
final DoubleFunction<String> describer)
{
final boolean ok;
try {
ok = predicate.test(value);
} catch (final Throwable e) {
throw failed(
e,
Double.valueOf(value),
singleViolation(failedPredicate(e)));
}
return innerCheckD(value, ok, describer);
} | [
"public",
"static",
"double",
"checkPostconditionD",
"(",
"final",
"double",
"value",
",",
"final",
"DoublePredicate",
"predicate",
",",
"final",
"DoubleFunction",
"<",
"String",
">",
"describer",
")",
"{",
"final",
"boolean",
"ok",
";",
"try",
"{",
"ok",
"=",... | A {@code double} specialized version of {@link #checkPostcondition(Object,
Predicate, Function)}
@param value The value
@param predicate The predicate
@param describer The describer of the predicate
@return value
@throws PostconditionViolationException If the predicate is false | [
"A",
"{",
"@code",
"double",
"}",
"specialized",
"version",
"of",
"{",
"@link",
"#checkPostcondition",
"(",
"Object",
"Predicate",
"Function",
")",
"}"
] | train | https://github.com/io7m/jaffirm/blob/c97d246242d381e48832838737418cfe4cb57b4d/com.io7m.jaffirm.core/src/main/java/com/io7m/jaffirm/core/Postconditions.java#L518-L534 |
mapsforge/mapsforge | sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteQueryBuilder.java | SQLiteQueryBuilder.buildUnionQuery | public String buildUnionQuery(String[] subQueries, String sortOrder, String limit) {
StringBuilder query = new StringBuilder(128);
int subQueryCount = subQueries.length;
String unionOperator = mDistinct ? " UNION " : " UNION ALL ";
for (int i = 0; i < subQueryCount; i++) {
if (i > 0) {
query.append(unionOperator);
}
query.append(subQueries[i]);
}
appendClause(query, " ORDER BY ", sortOrder);
appendClause(query, " LIMIT ", limit);
return query.toString();
} | java | public String buildUnionQuery(String[] subQueries, String sortOrder, String limit) {
StringBuilder query = new StringBuilder(128);
int subQueryCount = subQueries.length;
String unionOperator = mDistinct ? " UNION " : " UNION ALL ";
for (int i = 0; i < subQueryCount; i++) {
if (i > 0) {
query.append(unionOperator);
}
query.append(subQueries[i]);
}
appendClause(query, " ORDER BY ", sortOrder);
appendClause(query, " LIMIT ", limit);
return query.toString();
} | [
"public",
"String",
"buildUnionQuery",
"(",
"String",
"[",
"]",
"subQueries",
",",
"String",
"sortOrder",
",",
"String",
"limit",
")",
"{",
"StringBuilder",
"query",
"=",
"new",
"StringBuilder",
"(",
"128",
")",
";",
"int",
"subQueryCount",
"=",
"subQueries",
... | Given a set of subqueries, all of which are SELECT statements,
construct a query that returns the union of what those
subqueries return.
@param subQueries an array of SQL SELECT statements, all of
which must have the same columns as the same positions in
their results
@param sortOrder How to order the rows, formatted as an SQL
ORDER BY clause (excluding the ORDER BY itself). Passing
null will use the default sort order, which may be unordered.
@param limit The limit clause, which applies to the entire union result set
@return the resulting SQL SELECT statement | [
"Given",
"a",
"set",
"of",
"subqueries",
"all",
"of",
"which",
"are",
"SELECT",
"statements",
"construct",
"a",
"query",
"that",
"returns",
"the",
"union",
"of",
"what",
"those",
"subqueries",
"return",
".",
"@param",
"subQueries",
"an",
"array",
"of",
"SQL"... | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/sqlite-android/src/main/java/org/sqlite/database/sqlite/SQLiteQueryBuilder.java#L587-L601 |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/xpath/MapBasedXPathVariableResolver.java | MapBasedXPathVariableResolver.addUniqueVariable | @Nonnull
public EChange addUniqueVariable (@Nonnull final String sName, @Nonnull final Object aValue)
{
ValueEnforcer.notNull (sName, "Name");
ValueEnforcer.notNull (aValue, "Value");
if (m_aMap.containsKey (sName))
return EChange.UNCHANGED;
m_aMap.put (sName, aValue);
return EChange.CHANGED;
} | java | @Nonnull
public EChange addUniqueVariable (@Nonnull final String sName, @Nonnull final Object aValue)
{
ValueEnforcer.notNull (sName, "Name");
ValueEnforcer.notNull (aValue, "Value");
if (m_aMap.containsKey (sName))
return EChange.UNCHANGED;
m_aMap.put (sName, aValue);
return EChange.CHANGED;
} | [
"@",
"Nonnull",
"public",
"EChange",
"addUniqueVariable",
"(",
"@",
"Nonnull",
"final",
"String",
"sName",
",",
"@",
"Nonnull",
"final",
"Object",
"aValue",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"sName",
",",
"\"Name\"",
")",
";",
"ValueEnforcer",
... | Add a new variable.
@param sName
The name (=local part) of the variable
@param aValue
The value to be used.
@return {@link EChange} | [
"Add",
"a",
"new",
"variable",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/xpath/MapBasedXPathVariableResolver.java#L92-L102 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpntrafficpolicy_binding.java | vpntrafficpolicy_binding.get | public static vpntrafficpolicy_binding get(nitro_service service, String name) throws Exception{
vpntrafficpolicy_binding obj = new vpntrafficpolicy_binding();
obj.set_name(name);
vpntrafficpolicy_binding response = (vpntrafficpolicy_binding) obj.get_resource(service);
return response;
} | java | public static vpntrafficpolicy_binding get(nitro_service service, String name) throws Exception{
vpntrafficpolicy_binding obj = new vpntrafficpolicy_binding();
obj.set_name(name);
vpntrafficpolicy_binding response = (vpntrafficpolicy_binding) obj.get_resource(service);
return response;
} | [
"public",
"static",
"vpntrafficpolicy_binding",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"vpntrafficpolicy_binding",
"obj",
"=",
"new",
"vpntrafficpolicy_binding",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"... | Use this API to fetch vpntrafficpolicy_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"vpntrafficpolicy_binding",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpntrafficpolicy_binding.java#L136-L141 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexChangeAdapters.java | IndexChangeAdapters.forTextProperty | public static IndexChangeAdapter forTextProperty( ExecutionContext context,
NodeTypePredicate matcher,
String workspaceName,
Name propertyName,
ValueFactory<String> factory,
ProvidedIndex<?> index ) {
return new TextPropertyChangeAdapter(context, matcher, workspaceName, propertyName, factory,index);
} | java | public static IndexChangeAdapter forTextProperty( ExecutionContext context,
NodeTypePredicate matcher,
String workspaceName,
Name propertyName,
ValueFactory<String> factory,
ProvidedIndex<?> index ) {
return new TextPropertyChangeAdapter(context, matcher, workspaceName, propertyName, factory,index);
} | [
"public",
"static",
"IndexChangeAdapter",
"forTextProperty",
"(",
"ExecutionContext",
"context",
",",
"NodeTypePredicate",
"matcher",
",",
"String",
"workspaceName",
",",
"Name",
"propertyName",
",",
"ValueFactory",
"<",
"String",
">",
"factory",
",",
"ProvidedIndex",
... | Create an {@link IndexChangeAdapter} implementation that handles full text information.
@param context the execution context; may not be null
@param matcher the node type matcher used to determine which nodes should be included in the index; may not be null
@param workspaceName the name of the workspace; may not be null
@param propertyName the name of the property; may not be null
@param factory the value factory for the property's value type; may not be null
@param index the local index that should be used; may not be null
@return the new {@link IndexChangeAdapter}; never null | [
"Create",
"an",
"{",
"@link",
"IndexChangeAdapter",
"}",
"implementation",
"that",
"handles",
"full",
"text",
"information",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/spi/index/provider/IndexChangeAdapters.java#L256-L263 |
dashbuilder/dashbuilder | dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/AbstractDisplayer.java | AbstractDisplayer.filterInterval | public Interval filterInterval(String columnId, int idx) {
List<Interval> selected = columnSelectionMap.get(columnId);
if (selected != null && !selected.isEmpty()) {
for (Interval interval : selected) {
if (interval.getIndex() == idx) {
return interval;
}
}
}
return null;
} | java | public Interval filterInterval(String columnId, int idx) {
List<Interval> selected = columnSelectionMap.get(columnId);
if (selected != null && !selected.isEmpty()) {
for (Interval interval : selected) {
if (interval.getIndex() == idx) {
return interval;
}
}
}
return null;
} | [
"public",
"Interval",
"filterInterval",
"(",
"String",
"columnId",
",",
"int",
"idx",
")",
"{",
"List",
"<",
"Interval",
">",
"selected",
"=",
"columnSelectionMap",
".",
"get",
"(",
"columnId",
")",
";",
"if",
"(",
"selected",
"!=",
"null",
"&&",
"!",
"s... | Get the current filter interval matching the specified index
@param columnId The column identifier.
@param idx The index of the interval
@return The target interval matching the specified parameters or null if it does not exist. | [
"Get",
"the",
"current",
"filter",
"interval",
"matching",
"the",
"specified",
"index"
] | train | https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/AbstractDisplayer.java#L553-L563 |
UrielCh/ovh-java-sdk | ovh-java-sdk-caascontainers/src/main/java/net/minidev/ovh/api/ApiOvhCaascontainers.java | ApiOvhCaascontainers.serviceName_frameworks_frameworkId_GET | public OvhFramework serviceName_frameworks_frameworkId_GET(String serviceName, String frameworkId) throws IOException {
String qPath = "/caas/containers/{serviceName}/frameworks/{frameworkId}";
StringBuilder sb = path(qPath, serviceName, frameworkId);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhFramework.class);
} | java | public OvhFramework serviceName_frameworks_frameworkId_GET(String serviceName, String frameworkId) throws IOException {
String qPath = "/caas/containers/{serviceName}/frameworks/{frameworkId}";
StringBuilder sb = path(qPath, serviceName, frameworkId);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhFramework.class);
} | [
"public",
"OvhFramework",
"serviceName_frameworks_frameworkId_GET",
"(",
"String",
"serviceName",
",",
"String",
"frameworkId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/caas/containers/{serviceName}/frameworks/{frameworkId}\"",
";",
"StringBuilder",
"sb",
... | Inspect the stack framework
REST: GET /caas/containers/{serviceName}/frameworks/{frameworkId}
@param frameworkId [required] framework id
@param serviceName [required] service name
API beta | [
"Inspect",
"the",
"stack",
"framework"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-caascontainers/src/main/java/net/minidev/ovh/api/ApiOvhCaascontainers.java#L231-L236 |
xvik/dropwizard-guicey | src/main/java/ru/vyarus/dropwizard/guice/module/installer/feature/jersey/AbstractJerseyInstaller.java | AbstractJerseyInstaller.hasScopeAnnotation | private boolean hasScopeAnnotation(final Class<?> type, final boolean hkManaged) {
boolean found = false;
for (Annotation ann : type.getAnnotations()) {
final Class<? extends Annotation> annType = ann.annotationType();
if (annType.isAnnotationPresent(Scope.class)) {
found = true;
break;
}
// guice has special marker annotation
if (!hkManaged && annType.isAnnotationPresent(ScopeAnnotation.class)) {
found = true;
break;
}
}
return found;
} | java | private boolean hasScopeAnnotation(final Class<?> type, final boolean hkManaged) {
boolean found = false;
for (Annotation ann : type.getAnnotations()) {
final Class<? extends Annotation> annType = ann.annotationType();
if (annType.isAnnotationPresent(Scope.class)) {
found = true;
break;
}
// guice has special marker annotation
if (!hkManaged && annType.isAnnotationPresent(ScopeAnnotation.class)) {
found = true;
break;
}
}
return found;
} | [
"private",
"boolean",
"hasScopeAnnotation",
"(",
"final",
"Class",
"<",
"?",
">",
"type",
",",
"final",
"boolean",
"hkManaged",
")",
"{",
"boolean",
"found",
"=",
"false",
";",
"for",
"(",
"Annotation",
"ann",
":",
"type",
".",
"getAnnotations",
"(",
")",
... | Checks scope annotation presence directly on bean. Base classes are not checked as scope is not
inheritable.
@param type bean type
@param hkManaged true if bean is going to be managed by hk, false for guice management
@return true if scope annotation found, false otherwise | [
"Checks",
"scope",
"annotation",
"presence",
"directly",
"on",
"bean",
".",
"Base",
"classes",
"are",
"not",
"checked",
"as",
"scope",
"is",
"not",
"inheritable",
"."
] | train | https://github.com/xvik/dropwizard-guicey/blob/dd39ad77283555be21f606d5ebf0f11207a733d4/src/main/java/ru/vyarus/dropwizard/guice/module/installer/feature/jersey/AbstractJerseyInstaller.java#L92-L107 |
alkacon/opencms-core | src/org/opencms/db/CmsDbContext.java | CmsDbContext.setAttribute | public void setAttribute(String key, Object value) {
if (m_attributes == null) {
m_attributes = new HashMap<String, Object>(4);
}
m_attributes.put(key, value);
} | java | public void setAttribute(String key, Object value) {
if (m_attributes == null) {
m_attributes = new HashMap<String, Object>(4);
}
m_attributes.put(key, value);
} | [
"public",
"void",
"setAttribute",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"m_attributes",
"==",
"null",
")",
"{",
"m_attributes",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
"4",
")",
";",
"}",
"m_attribute... | Sets an attribute in the DB context.<p>
@param key the attribute key
@param value the attribute value | [
"Sets",
"an",
"attribute",
"in",
"the",
"DB",
"context",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDbContext.java#L304-L310 |
msgpack/msgpack-java | msgpack-core/src/main/java/org/msgpack/core/MessageUnpacker.java | MessageUnpacker.readPayload | public void readPayload(MessageBuffer dst, int off, int len)
throws IOException
{
while (true) {
int bufferRemaining = buffer.size() - position;
if (bufferRemaining >= len) {
dst.putMessageBuffer(off, buffer, position, len);
position += len;
return;
}
dst.putMessageBuffer(off, buffer, position, bufferRemaining);
off += bufferRemaining;
len -= bufferRemaining;
position += bufferRemaining;
nextBuffer();
}
} | java | public void readPayload(MessageBuffer dst, int off, int len)
throws IOException
{
while (true) {
int bufferRemaining = buffer.size() - position;
if (bufferRemaining >= len) {
dst.putMessageBuffer(off, buffer, position, len);
position += len;
return;
}
dst.putMessageBuffer(off, buffer, position, bufferRemaining);
off += bufferRemaining;
len -= bufferRemaining;
position += bufferRemaining;
nextBuffer();
}
} | [
"public",
"void",
"readPayload",
"(",
"MessageBuffer",
"dst",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"while",
"(",
"true",
")",
"{",
"int",
"bufferRemaining",
"=",
"buffer",
".",
"size",
"(",
")",
"-",
"position",
";",
... | Reads payload bytes of binary, extension, or raw string types.
<p>
This consumes bytes, copies them to the specified buffer
This is usually faster than readPayload(ByteBuffer) by using unsafe.copyMemory
@param dst the Message buffer into which the data is read
@param off the offset in the Message buffer
@param len the number of bytes to read
@throws IOException when underlying input throws IOException | [
"Reads",
"payload",
"bytes",
"of",
"binary",
"extension",
"or",
"raw",
"string",
"types",
"."
] | train | https://github.com/msgpack/msgpack-java/blob/16e370e348215a72a14c210b42d448d513aee015/msgpack-core/src/main/java/org/msgpack/core/MessageUnpacker.java#L1531-L1548 |
datumbox/datumbox-framework | datumbox-framework-common/src/main/java/com/datumbox/framework/common/dataobjects/AssociativeArray2D.java | AssociativeArray2D.get2d | public final Object get2d(Object key1, Object key2) {
AssociativeArray tmp = internalData.get(key1);
if(tmp == null) {
return null;
}
return tmp.internalData.get(key2);
} | java | public final Object get2d(Object key1, Object key2) {
AssociativeArray tmp = internalData.get(key1);
if(tmp == null) {
return null;
}
return tmp.internalData.get(key2);
} | [
"public",
"final",
"Object",
"get2d",
"(",
"Object",
"key1",
",",
"Object",
"key2",
")",
"{",
"AssociativeArray",
"tmp",
"=",
"internalData",
".",
"get",
"(",
"key1",
")",
";",
"if",
"(",
"tmp",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"re... | Convenience function to get the value by using both keys.
@param key1
@param key2
@return | [
"Convenience",
"function",
"to",
"get",
"the",
"value",
"by",
"using",
"both",
"keys",
"."
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-common/src/main/java/com/datumbox/framework/common/dataobjects/AssociativeArray2D.java#L127-L134 |
Impetus/Kundera | src/kundera-couchdb/src/main/java/com/impetus/client/couchdb/CouchDBSchemaManager.java | CouchDBSchemaManager.createView | private void createView(Map<String, MapReduce> views, String columnName)
{
MapReduce mapr = new MapReduce();
mapr.setMap("function(doc){if(doc." + columnName + "){emit(doc." + columnName + ", doc);}}");
views.put(columnName, mapr);
} | java | private void createView(Map<String, MapReduce> views, String columnName)
{
MapReduce mapr = new MapReduce();
mapr.setMap("function(doc){if(doc." + columnName + "){emit(doc." + columnName + ", doc);}}");
views.put(columnName, mapr);
} | [
"private",
"void",
"createView",
"(",
"Map",
"<",
"String",
",",
"MapReduce",
">",
"views",
",",
"String",
"columnName",
")",
"{",
"MapReduce",
"mapr",
"=",
"new",
"MapReduce",
"(",
")",
";",
"mapr",
".",
"setMap",
"(",
"\"function(doc){if(doc.\"",
"+",
"c... | Creates the view.
@param views
the views
@param columnName
the column name | [
"Creates",
"the",
"view",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-couchdb/src/main/java/com/impetus/client/couchdb/CouchDBSchemaManager.java#L627-L632 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java | ApiOvhEmailexchange.organizationName_service_exchangeService_publicFolder_POST | public OvhTask organizationName_service_exchangeService_publicFolder_POST(String organizationName, String exchangeService, OvhPublicFolderRightTypeEnum anonymousPermission, OvhPublicFolderRightTypeEnum defaultPermission, String path, Long quota, OvhPublicFolderTypeEnum type) throws IOException {
String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/publicFolder";
StringBuilder sb = path(qPath, organizationName, exchangeService);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "anonymousPermission", anonymousPermission);
addBody(o, "defaultPermission", defaultPermission);
addBody(o, "path", path);
addBody(o, "quota", quota);
addBody(o, "type", type);
String resp = exec(qPath, "POST", sb.toString(), o);
return convertTo(resp, OvhTask.class);
} | java | public OvhTask organizationName_service_exchangeService_publicFolder_POST(String organizationName, String exchangeService, OvhPublicFolderRightTypeEnum anonymousPermission, OvhPublicFolderRightTypeEnum defaultPermission, String path, Long quota, OvhPublicFolderTypeEnum type) throws IOException {
String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/publicFolder";
StringBuilder sb = path(qPath, organizationName, exchangeService);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "anonymousPermission", anonymousPermission);
addBody(o, "defaultPermission", defaultPermission);
addBody(o, "path", path);
addBody(o, "quota", quota);
addBody(o, "type", type);
String resp = exec(qPath, "POST", sb.toString(), o);
return convertTo(resp, OvhTask.class);
} | [
"public",
"OvhTask",
"organizationName_service_exchangeService_publicFolder_POST",
"(",
"String",
"organizationName",
",",
"String",
"exchangeService",
",",
"OvhPublicFolderRightTypeEnum",
"anonymousPermission",
",",
"OvhPublicFolderRightTypeEnum",
"defaultPermission",
",",
"String",... | Create organization public folder
REST: POST /email/exchange/{organizationName}/service/{exchangeService}/publicFolder
@param anonymousPermission [required] [default=none] Access right for the guest users
@param type [required] Type for public folder
@param quota [required] Quota for public folder in MB
@param defaultPermission [required] [default=none] Default access right
@param path [required] Path for public folder
@param organizationName [required] The internal name of your exchange organization
@param exchangeService [required] The internal name of your exchange service | [
"Create",
"organization",
"public",
"folder"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java#L145-L156 |
spring-projects/spring-android | spring-android-rest-template/src/main/java/org/springframework/web/util/UriComponentsBuilder.java | UriComponentsBuilder.replaceQueryParam | public UriComponentsBuilder replaceQueryParam(String name, Object... values) {
Assert.notNull(name, "'name' must not be null");
this.queryParams.remove(name);
if (!ObjectUtils.isEmpty(values)) {
queryParam(name, values);
}
resetSchemeSpecificPart();
return this;
} | java | public UriComponentsBuilder replaceQueryParam(String name, Object... values) {
Assert.notNull(name, "'name' must not be null");
this.queryParams.remove(name);
if (!ObjectUtils.isEmpty(values)) {
queryParam(name, values);
}
resetSchemeSpecificPart();
return this;
} | [
"public",
"UriComponentsBuilder",
"replaceQueryParam",
"(",
"String",
"name",
",",
"Object",
"...",
"values",
")",
"{",
"Assert",
".",
"notNull",
"(",
"name",
",",
"\"'name' must not be null\"",
")",
";",
"this",
".",
"queryParams",
".",
"remove",
"(",
"name",
... | Set the query parameter values overriding all existing query values for
the same parameter. If no values are given, the query parameter is removed.
@param name the query parameter name
@param values the query parameter values
@return this UriComponentsBuilder | [
"Set",
"the",
"query",
"parameter",
"values",
"overriding",
"all",
"existing",
"query",
"values",
"for",
"the",
"same",
"parameter",
".",
"If",
"no",
"values",
"are",
"given",
"the",
"query",
"parameter",
"is",
"removed",
"."
] | train | https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-rest-template/src/main/java/org/springframework/web/util/UriComponentsBuilder.java#L603-L611 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/color/ColorXyz.java | ColorXyz.srgbToXyz | public static void srgbToXyz( double r , double g , double b , double xyz[] ) {
xyz[0] = 0.412453*r + 0.35758*g + 0.180423*b;
xyz[1] = 0.212671*r + 0.71516*g + 0.072169*b;
xyz[2] = 0.019334*r + 0.119193*g + 0.950227*b;
} | java | public static void srgbToXyz( double r , double g , double b , double xyz[] ) {
xyz[0] = 0.412453*r + 0.35758*g + 0.180423*b;
xyz[1] = 0.212671*r + 0.71516*g + 0.072169*b;
xyz[2] = 0.019334*r + 0.119193*g + 0.950227*b;
} | [
"public",
"static",
"void",
"srgbToXyz",
"(",
"double",
"r",
",",
"double",
"g",
",",
"double",
"b",
",",
"double",
"xyz",
"[",
"]",
")",
"{",
"xyz",
"[",
"0",
"]",
"=",
"0.412453",
"*",
"r",
"+",
"0.35758",
"*",
"g",
"+",
"0.180423",
"*",
"b",
... | Conversion from normalized RGB into XYZ. Normalized RGB values have a range of 0:1 | [
"Conversion",
"from",
"normalized",
"RGB",
"into",
"XYZ",
".",
"Normalized",
"RGB",
"values",
"have",
"a",
"range",
"of",
"0",
":",
"1"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/color/ColorXyz.java#L70-L74 |
BioPAX/Paxtools | pattern/src/main/java/org/biopax/paxtools/pattern/constraint/PathConstraint.java | PathConstraint.satisfies | @Override
public boolean satisfies(Match match, int... ind)
{
BioPAXElement ele0 = match.get(ind[0]);
BioPAXElement ele1 = match.get(ind[1]);
if (ele1 == null) return false;
Set vals = pa.getValueFromBean(ele0);
return vals.contains(ele1);
} | java | @Override
public boolean satisfies(Match match, int... ind)
{
BioPAXElement ele0 = match.get(ind[0]);
BioPAXElement ele1 = match.get(ind[1]);
if (ele1 == null) return false;
Set vals = pa.getValueFromBean(ele0);
return vals.contains(ele1);
} | [
"@",
"Override",
"public",
"boolean",
"satisfies",
"(",
"Match",
"match",
",",
"int",
"...",
"ind",
")",
"{",
"BioPAXElement",
"ele0",
"=",
"match",
".",
"get",
"(",
"ind",
"[",
"0",
"]",
")",
";",
"BioPAXElement",
"ele1",
"=",
"match",
".",
"get",
"... | Checks if the PathAccessor is generating the second mapped element.
@param match current pattern match
@param ind mapped indices
@return true if second element is generated by PathAccessor | [
"Checks",
"if",
"the",
"PathAccessor",
"is",
"generating",
"the",
"second",
"mapped",
"element",
"."
] | train | https://github.com/BioPAX/Paxtools/blob/2f93afa94426bf8b5afc2e0e61cd4b269a83288d/pattern/src/main/java/org/biopax/paxtools/pattern/constraint/PathConstraint.java#L41-L51 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/vod/VodClient.java | VodClient.createNotification | public CreateNotificationResponse createNotification(CreateNotificationRequest request) {
checkStringNotEmpty(request.getName(),
"The parameter name should NOT be null or empty string.");
checkStringNotEmpty(request.getEndpoint(),
"The parameter endpoint should NOT be null or empty string.");
InternalRequest internalRequest = createRequest(HttpMethodName.POST, request, PATH_NOTIFICATION);
String strJson = JsonUtils.toJsonString(request);
byte[] requestJson = null;
try {
requestJson = strJson.getBytes(DEFAULT_ENCODING);
} catch (UnsupportedEncodingException e) {
throw new BceClientException("Unsupported encode.", e);
}
internalRequest.addHeader(Headers.CONTENT_LENGTH, String.valueOf(requestJson.length));
internalRequest.addHeader(Headers.CONTENT_TYPE, DEFAULT_CONTENT_TYPE);
internalRequest.setContent(RestartableInputStream.wrap(requestJson));
return invokeHttpClient(internalRequest, CreateNotificationResponse.class);
} | java | public CreateNotificationResponse createNotification(CreateNotificationRequest request) {
checkStringNotEmpty(request.getName(),
"The parameter name should NOT be null or empty string.");
checkStringNotEmpty(request.getEndpoint(),
"The parameter endpoint should NOT be null or empty string.");
InternalRequest internalRequest = createRequest(HttpMethodName.POST, request, PATH_NOTIFICATION);
String strJson = JsonUtils.toJsonString(request);
byte[] requestJson = null;
try {
requestJson = strJson.getBytes(DEFAULT_ENCODING);
} catch (UnsupportedEncodingException e) {
throw new BceClientException("Unsupported encode.", e);
}
internalRequest.addHeader(Headers.CONTENT_LENGTH, String.valueOf(requestJson.length));
internalRequest.addHeader(Headers.CONTENT_TYPE, DEFAULT_CONTENT_TYPE);
internalRequest.setContent(RestartableInputStream.wrap(requestJson));
return invokeHttpClient(internalRequest, CreateNotificationResponse.class);
} | [
"public",
"CreateNotificationResponse",
"createNotification",
"(",
"CreateNotificationRequest",
"request",
")",
"{",
"checkStringNotEmpty",
"(",
"request",
".",
"getName",
"(",
")",
",",
"\"The parameter name should NOT be null or empty string.\"",
")",
";",
"checkStringNotEmpt... | Create a doc notification in the doc stream service.
@param request The request object containing all options for creating doc notification. | [
"Create",
"a",
"doc",
"notification",
"in",
"the",
"doc",
"stream",
"service",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/vod/VodClient.java#L1011-L1031 |
jglobus/JGlobus | gridftp/src/main/java/org/globus/ftp/FTPClient.java | FTPClient.get | public void get(String remoteFileName,
DataSink sink,
MarkerListener mListener)
throws IOException, ClientException, ServerException {
checkTransferParamsGet();
localServer.store(sink);
controlChannel.write(new Command("RETR", remoteFileName));
transferRunSingleThread(localServer.getControlChannel(), mListener);
} | java | public void get(String remoteFileName,
DataSink sink,
MarkerListener mListener)
throws IOException, ClientException, ServerException {
checkTransferParamsGet();
localServer.store(sink);
controlChannel.write(new Command("RETR", remoteFileName));
transferRunSingleThread(localServer.getControlChannel(), mListener);
} | [
"public",
"void",
"get",
"(",
"String",
"remoteFileName",
",",
"DataSink",
"sink",
",",
"MarkerListener",
"mListener",
")",
"throws",
"IOException",
",",
"ClientException",
",",
"ServerException",
"{",
"checkTransferParamsGet",
"(",
")",
";",
"localServer",
".",
"... | Retrieves the file from the remote server.
@param remoteFileName remote file name
@param sink sink to which the data will be written
@param mListener restart marker listener (currently not used) | [
"Retrieves",
"the",
"file",
"from",
"the",
"remote",
"server",
"."
] | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gridftp/src/main/java/org/globus/ftp/FTPClient.java#L1244-L1254 |
elki-project/elki | elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/rdknn/RdKNNTree.java | RdKNNTree.doReverseKNN | private void doReverseKNN(RdKNNNode node, DBID oid, ModifiableDoubleDBIDList result) {
if(node.isLeaf()) {
for(int i = 0; i < node.getNumEntries(); i++) {
RdKNNLeafEntry entry = (RdKNNLeafEntry) node.getEntry(i);
double distance = distanceQuery.distance(entry.getDBID(), oid);
if(distance <= entry.getKnnDistance()) {
result.add(distance, entry.getDBID());
}
}
}
// node is a inner node
else {
for(int i = 0; i < node.getNumEntries(); i++) {
RdKNNDirectoryEntry entry = (RdKNNDirectoryEntry) node.getEntry(i);
double minDist = distanceQuery.minDist(entry, oid);
if(minDist <= entry.getKnnDistance()) {
doReverseKNN(getNode(entry), oid, result);
}
}
}
} | java | private void doReverseKNN(RdKNNNode node, DBID oid, ModifiableDoubleDBIDList result) {
if(node.isLeaf()) {
for(int i = 0; i < node.getNumEntries(); i++) {
RdKNNLeafEntry entry = (RdKNNLeafEntry) node.getEntry(i);
double distance = distanceQuery.distance(entry.getDBID(), oid);
if(distance <= entry.getKnnDistance()) {
result.add(distance, entry.getDBID());
}
}
}
// node is a inner node
else {
for(int i = 0; i < node.getNumEntries(); i++) {
RdKNNDirectoryEntry entry = (RdKNNDirectoryEntry) node.getEntry(i);
double minDist = distanceQuery.minDist(entry, oid);
if(minDist <= entry.getKnnDistance()) {
doReverseKNN(getNode(entry), oid, result);
}
}
}
} | [
"private",
"void",
"doReverseKNN",
"(",
"RdKNNNode",
"node",
",",
"DBID",
"oid",
",",
"ModifiableDoubleDBIDList",
"result",
")",
"{",
"if",
"(",
"node",
".",
"isLeaf",
"(",
")",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"node",
".",
... | Performs a reverse knn query in the specified subtree.
@param node the root node of the current subtree
@param oid the id of the object for which the rknn query is performed
@param result the list containing the query results | [
"Performs",
"a",
"reverse",
"knn",
"query",
"in",
"the",
"specified",
"subtree",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-rtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/spatial/rstarvariants/rdknn/RdKNNTree.java#L399-L419 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/CommandGroup.java | CommandGroup.createButtonStack | public JComponent createButtonStack(final Size minimumButtonSize) {
return createButtonStack(minimumButtonSize, GuiStandardUtils.createLeftAndRightBorder(UIConstants.TWO_SPACES));
} | java | public JComponent createButtonStack(final Size minimumButtonSize) {
return createButtonStack(minimumButtonSize, GuiStandardUtils.createLeftAndRightBorder(UIConstants.TWO_SPACES));
} | [
"public",
"JComponent",
"createButtonStack",
"(",
"final",
"Size",
"minimumButtonSize",
")",
"{",
"return",
"createButtonStack",
"(",
"minimumButtonSize",
",",
"GuiStandardUtils",
".",
"createLeftAndRightBorder",
"(",
"UIConstants",
".",
"TWO_SPACES",
")",
")",
";",
"... | Create a button stack with buttons for all the commands. Adds a border
left and right of 2 spaces.
@param minimumButtonSize Minimum size of the buttons (can be null)
@return never null | [
"Create",
"a",
"button",
"stack",
"with",
"buttons",
"for",
"all",
"the",
"commands",
".",
"Adds",
"a",
"border",
"left",
"and",
"right",
"of",
"2",
"spaces",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/command/support/CommandGroup.java#L496-L498 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/CriteriaReader.java | CriteriaReader.getPromptValue | private GenericCriteriaPrompt getPromptValue(FieldType field, byte[] block)
{
int textOffset = getPromptOffset(block);
String value = MPPUtility.getUnicodeString(m_criteriaData, m_criteriaTextStart + textOffset);
GenericCriteriaPrompt prompt = new GenericCriteriaPrompt(field.getDataType(), value);
if (m_prompts != null)
{
m_prompts.add(prompt);
}
return prompt;
} | java | private GenericCriteriaPrompt getPromptValue(FieldType field, byte[] block)
{
int textOffset = getPromptOffset(block);
String value = MPPUtility.getUnicodeString(m_criteriaData, m_criteriaTextStart + textOffset);
GenericCriteriaPrompt prompt = new GenericCriteriaPrompt(field.getDataType(), value);
if (m_prompts != null)
{
m_prompts.add(prompt);
}
return prompt;
} | [
"private",
"GenericCriteriaPrompt",
"getPromptValue",
"(",
"FieldType",
"field",
",",
"byte",
"[",
"]",
"block",
")",
"{",
"int",
"textOffset",
"=",
"getPromptOffset",
"(",
"block",
")",
";",
"String",
"value",
"=",
"MPPUtility",
".",
"getUnicodeString",
"(",
... | Retrieves a prompt value.
@param field field type
@param block criteria data block
@return prompt value | [
"Retrieves",
"a",
"prompt",
"value",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/CriteriaReader.java#L415-L425 |
Alluxio/alluxio | core/common/src/main/java/alluxio/util/UnderFileSystemUtils.java | UnderFileSystemUtils.mkdirIfNotExists | public static void mkdirIfNotExists(UnderFileSystem ufs, String path) throws IOException {
if (!ufs.isDirectory(path)) {
if (!ufs.mkdirs(path)) {
throw new IOException("Failed to make folder: " + path);
}
}
} | java | public static void mkdirIfNotExists(UnderFileSystem ufs, String path) throws IOException {
if (!ufs.isDirectory(path)) {
if (!ufs.mkdirs(path)) {
throw new IOException("Failed to make folder: " + path);
}
}
} | [
"public",
"static",
"void",
"mkdirIfNotExists",
"(",
"UnderFileSystem",
"ufs",
",",
"String",
"path",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"ufs",
".",
"isDirectory",
"(",
"path",
")",
")",
"{",
"if",
"(",
"!",
"ufs",
".",
"mkdirs",
"(",
"... | Attempts to create the directory if it does not already exist.
@param ufs instance of {@link UnderFileSystem}
@param path path to the directory | [
"Attempts",
"to",
"create",
"the",
"directory",
"if",
"it",
"does",
"not",
"already",
"exist",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/UnderFileSystemUtils.java#L49-L55 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.unsubscribeAllResourcesFor | public void unsubscribeAllResourcesFor(CmsDbContext dbc, String poolName, CmsPrincipal principal)
throws CmsException {
getSubscriptionDriver().unsubscribeAllResourcesFor(dbc, poolName, principal);
} | java | public void unsubscribeAllResourcesFor(CmsDbContext dbc, String poolName, CmsPrincipal principal)
throws CmsException {
getSubscriptionDriver().unsubscribeAllResourcesFor(dbc, poolName, principal);
} | [
"public",
"void",
"unsubscribeAllResourcesFor",
"(",
"CmsDbContext",
"dbc",
",",
"String",
"poolName",
",",
"CmsPrincipal",
"principal",
")",
"throws",
"CmsException",
"{",
"getSubscriptionDriver",
"(",
")",
".",
"unsubscribeAllResourcesFor",
"(",
"dbc",
",",
"poolNam... | Unsubscribes the principal from all resources.<p>
@param dbc the database context
@param poolName the name of the database pool to use
@param principal the principal that unsubscribes from all resources
@throws CmsException if something goes wrong | [
"Unsubscribes",
"the",
"principal",
"from",
"all",
"resources",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L9262-L9267 |
apache/flink | flink-core/src/main/java/org/apache/flink/api/common/typeutils/NestedSerializersSnapshotDelegate.java | NestedSerializersSnapshotDelegate.readNestedSerializerSnapshots | public static NestedSerializersSnapshotDelegate readNestedSerializerSnapshots(DataInputView in, ClassLoader cl) throws IOException {
final int magicNumber = in.readInt();
if (magicNumber != MAGIC_NUMBER) {
throw new IOException(String.format("Corrupt data, magic number mismatch. Expected %8x, found %8x",
MAGIC_NUMBER, magicNumber));
}
final int version = in.readInt();
if (version != VERSION) {
throw new IOException("Unrecognized version: " + version);
}
final int numSnapshots = in.readInt();
final TypeSerializerSnapshot<?>[] nestedSnapshots = new TypeSerializerSnapshot<?>[numSnapshots];
for (int i = 0; i < numSnapshots; i++) {
nestedSnapshots[i] = TypeSerializerSnapshot.readVersionedSnapshot(in, cl);
}
return new NestedSerializersSnapshotDelegate(nestedSnapshots);
} | java | public static NestedSerializersSnapshotDelegate readNestedSerializerSnapshots(DataInputView in, ClassLoader cl) throws IOException {
final int magicNumber = in.readInt();
if (magicNumber != MAGIC_NUMBER) {
throw new IOException(String.format("Corrupt data, magic number mismatch. Expected %8x, found %8x",
MAGIC_NUMBER, magicNumber));
}
final int version = in.readInt();
if (version != VERSION) {
throw new IOException("Unrecognized version: " + version);
}
final int numSnapshots = in.readInt();
final TypeSerializerSnapshot<?>[] nestedSnapshots = new TypeSerializerSnapshot<?>[numSnapshots];
for (int i = 0; i < numSnapshots; i++) {
nestedSnapshots[i] = TypeSerializerSnapshot.readVersionedSnapshot(in, cl);
}
return new NestedSerializersSnapshotDelegate(nestedSnapshots);
} | [
"public",
"static",
"NestedSerializersSnapshotDelegate",
"readNestedSerializerSnapshots",
"(",
"DataInputView",
"in",
",",
"ClassLoader",
"cl",
")",
"throws",
"IOException",
"{",
"final",
"int",
"magicNumber",
"=",
"in",
".",
"readInt",
"(",
")",
";",
"if",
"(",
"... | Reads the composite snapshot of all the contained serializers. | [
"Reads",
"the",
"composite",
"snapshot",
"of",
"all",
"the",
"contained",
"serializers",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/typeutils/NestedSerializersSnapshotDelegate.java#L166-L186 |
albfernandez/itext2 | src/main/java/com/lowagie/text/Table.java | Table.placeCell | private void placeCell(ArrayList<Row> someRows, Cell aCell, Point aPosition) {
int i;
Row row = null;
int rowCount = aPosition.x + aCell.getRowspan() - someRows.size();
assumeTableDefaults(aCell);
if ( (aPosition.x + aCell.getRowspan()) > someRows.size() ) {
for (i = 0; i < rowCount; i++) {
row = new Row(columns);
someRows.add(row);
}
}
// reserve cell in rows below
for (i = aPosition.x + 1; i < (aPosition.x + aCell.getRowspan()); i++) {
if ( !someRows.get(i).reserve(aPosition.y, aCell.getColspan())) {
// should be impossible to come here :-)
throw new RuntimeException("addCell - error in reserve");
}
}
row = someRows.get(aPosition.x);
row.addElement(aCell, aPosition.y);
} | java | private void placeCell(ArrayList<Row> someRows, Cell aCell, Point aPosition) {
int i;
Row row = null;
int rowCount = aPosition.x + aCell.getRowspan() - someRows.size();
assumeTableDefaults(aCell);
if ( (aPosition.x + aCell.getRowspan()) > someRows.size() ) {
for (i = 0; i < rowCount; i++) {
row = new Row(columns);
someRows.add(row);
}
}
// reserve cell in rows below
for (i = aPosition.x + 1; i < (aPosition.x + aCell.getRowspan()); i++) {
if ( !someRows.get(i).reserve(aPosition.y, aCell.getColspan())) {
// should be impossible to come here :-)
throw new RuntimeException("addCell - error in reserve");
}
}
row = someRows.get(aPosition.x);
row.addElement(aCell, aPosition.y);
} | [
"private",
"void",
"placeCell",
"(",
"ArrayList",
"<",
"Row",
">",
"someRows",
",",
"Cell",
"aCell",
",",
"Point",
"aPosition",
")",
"{",
"int",
"i",
";",
"Row",
"row",
"=",
"null",
";",
"int",
"rowCount",
"=",
"aPosition",
".",
"x",
"+",
"aCell",
".... | Inserts a Cell in a cell-array and reserves cells defined by row-/colspan.
@param someRows some rows
@param aCell the cell that has to be inserted
@param aPosition the position where the cell has to be placed | [
"Inserts",
"a",
"Cell",
"in",
"a",
"cell",
"-",
"array",
"and",
"reserves",
"cells",
"defined",
"by",
"row",
"-",
"/",
"colspan",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/Table.java#L1265-L1288 |
elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/parameters/ClassParameter.java | ClassParameter.instantiateClass | public C instantiateClass(Parameterization config) {
if(getValue() == null /* && !optionalParameter */) {
config.reportError(new UnspecifiedParameterException(this));
return null;
}
try {
config = config.descend(this);
return ClassGenericsUtil.tryInstantiate(restrictionClass, getValue(), config);
}
catch(ClassInstantiationException e) {
config.reportError(new WrongParameterValueException(this, getValue().getCanonicalName(), "Error instantiating class.", e));
return null;
}
} | java | public C instantiateClass(Parameterization config) {
if(getValue() == null /* && !optionalParameter */) {
config.reportError(new UnspecifiedParameterException(this));
return null;
}
try {
config = config.descend(this);
return ClassGenericsUtil.tryInstantiate(restrictionClass, getValue(), config);
}
catch(ClassInstantiationException e) {
config.reportError(new WrongParameterValueException(this, getValue().getCanonicalName(), "Error instantiating class.", e));
return null;
}
} | [
"public",
"C",
"instantiateClass",
"(",
"Parameterization",
"config",
")",
"{",
"if",
"(",
"getValue",
"(",
")",
"==",
"null",
"/* && !optionalParameter */",
")",
"{",
"config",
".",
"reportError",
"(",
"new",
"UnspecifiedParameterException",
"(",
"this",
")",
"... | Returns a new instance for the value (i.e., the class name) of this class
parameter. The instance has the type of the restriction class of this class
parameter.
<p>
If the Class for the class name is not found, the instantiation is tried
using the package of the restriction class as package of the class name.
@param config Parameterization to use (if Parameterizable))
@return a new instance for the value of this class parameter | [
"Returns",
"a",
"new",
"instance",
"for",
"the",
"value",
"(",
"i",
".",
"e",
".",
"the",
"class",
"name",
")",
"of",
"this",
"class",
"parameter",
".",
"The",
"instance",
"has",
"the",
"type",
"of",
"the",
"restriction",
"class",
"of",
"this",
"class"... | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/parameters/ClassParameter.java#L234-L247 |
aNNiMON/Lightweight-Stream-API | stream/src/main/java/com/annimon/stream/IntStream.java | IntStream.dropWhile | @NotNull
public IntStream dropWhile(@NotNull final IntPredicate predicate) {
return new IntStream(params, new IntDropWhile(iterator, predicate));
} | java | @NotNull
public IntStream dropWhile(@NotNull final IntPredicate predicate) {
return new IntStream(params, new IntDropWhile(iterator, predicate));
} | [
"@",
"NotNull",
"public",
"IntStream",
"dropWhile",
"(",
"@",
"NotNull",
"final",
"IntPredicate",
"predicate",
")",
"{",
"return",
"new",
"IntStream",
"(",
"params",
",",
"new",
"IntDropWhile",
"(",
"iterator",
",",
"predicate",
")",
")",
";",
"}"
] | Drops elements while the predicate is true and returns the rest.
<p>This is an intermediate operation.
<p>Example:
<pre>
predicate: (a) -> a < 3
stream: [1, 2, 3, 4, 1, 2, 3, 4]
result: [3, 4, 1, 2, 3, 4]
</pre>
@param predicate the predicate used to drop elements
@return the new {@code IntStream} | [
"Drops",
"elements",
"while",
"the",
"predicate",
"is",
"true",
"and",
"returns",
"the",
"rest",
"."
] | train | https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/IntStream.java#L798-L801 |
javactic/javactic | src/main/java/com/github/javactic/futures/ExecutionContext.java | ExecutionContext.zip3 | public <A, B, C, ERR> OrFuture<Tuple3<A, B, C>, Every<ERR>>
zip3(OrFuture<? extends A, ? extends Every<? extends ERR>> a,
OrFuture<? extends B, ? extends Every<? extends ERR>> b,
OrFuture<? extends C, ? extends Every<? extends ERR>> c) {
return withGood(a, b, c, Tuple::of);
} | java | public <A, B, C, ERR> OrFuture<Tuple3<A, B, C>, Every<ERR>>
zip3(OrFuture<? extends A, ? extends Every<? extends ERR>> a,
OrFuture<? extends B, ? extends Every<? extends ERR>> b,
OrFuture<? extends C, ? extends Every<? extends ERR>> c) {
return withGood(a, b, c, Tuple::of);
} | [
"public",
"<",
"A",
",",
"B",
",",
"C",
",",
"ERR",
">",
"OrFuture",
"<",
"Tuple3",
"<",
"A",
",",
"B",
",",
"C",
">",
",",
"Every",
"<",
"ERR",
">",
">",
"zip3",
"(",
"OrFuture",
"<",
"?",
"extends",
"A",
",",
"?",
"extends",
"Every",
"<",
... | Zips three accumulating OrFutures together. If all complete with Goods, returns an OrFuture
that completes with a Good tuple containing all original Good values. Otherwise returns an
OrFuture that completes with a Bad containing every error message.
@param <A> the success type
@param <B> the success type
@param <C> the success type
@param <ERR> the error type of the accumulating OrFutures
@param a the first OrFuture to zip
@param b the second OrFuture to zip
@param c the third OrFuture to zip
@return an OrFuture that completes with a Good of type Tuple3 if all OrFutures completed
with Goods, otherwise returns an OrFuture that completes with a Bad containing every error. | [
"Zips",
"three",
"accumulating",
"OrFutures",
"together",
".",
"If",
"all",
"complete",
"with",
"Goods",
"returns",
"an",
"OrFuture",
"that",
"completes",
"with",
"a",
"Good",
"tuple",
"containing",
"all",
"original",
"Good",
"values",
".",
"Otherwise",
"returns... | train | https://github.com/javactic/javactic/blob/dfa040062178c259c3067fd9b59cb4498022d8bc/src/main/java/com/github/javactic/futures/ExecutionContext.java#L536-L541 |
jfinal/jfinal | src/main/java/com/jfinal/core/Controller.java | Controller.getParaToBoolean | public Boolean getParaToBoolean(String name, Boolean defaultValue) {
return toBoolean(request.getParameter(name), defaultValue);
} | java | public Boolean getParaToBoolean(String name, Boolean defaultValue) {
return toBoolean(request.getParameter(name), defaultValue);
} | [
"public",
"Boolean",
"getParaToBoolean",
"(",
"String",
"name",
",",
"Boolean",
"defaultValue",
")",
"{",
"return",
"toBoolean",
"(",
"request",
".",
"getParameter",
"(",
"name",
")",
",",
"defaultValue",
")",
";",
"}"
] | Returns the value of a request parameter and convert to Boolean with a default value if it is null.
@param name a String specifying the name of the parameter
@return true if the value of the parameter is "true" or "1", false if it is "false" or "0", default value if it is null | [
"Returns",
"the",
"value",
"of",
"a",
"request",
"parameter",
"and",
"convert",
"to",
"Boolean",
"with",
"a",
"default",
"value",
"if",
"it",
"is",
"null",
"."
] | train | https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/core/Controller.java#L380-L382 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDatatypeDefinitionAxiomImpl_CustomFieldSerializer.java | OWLDatatypeDefinitionAxiomImpl_CustomFieldSerializer.deserializeInstance | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLDatatypeDefinitionAxiomImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} | java | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLDatatypeDefinitionAxiomImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} | [
"@",
"Override",
"public",
"void",
"deserializeInstance",
"(",
"SerializationStreamReader",
"streamReader",
",",
"OWLDatatypeDefinitionAxiomImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"deserialize",
"(",
"streamReader",
",",
"instance",
")",
";",
"}"
... | Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google.gwt.user.client.rpc.SerializationStreamReader} to read the
object's content from
@param instance the object instance to deserialize
@throws com.google.gwt.user.client.rpc.SerializationException
if the deserialization operation is not
successful | [
"Deserializes",
"the",
"content",
"of",
"the",
"object",
"from",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamReader",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDatatypeDefinitionAxiomImpl_CustomFieldSerializer.java#L98-L101 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/rules/Rules.java | Rules.conditionsRule | public static Rule conditionsRule(final Condition condition, String key, String value) {
return conditionsRule(condition, States.state(key, value));
} | java | public static Rule conditionsRule(final Condition condition, String key, String value) {
return conditionsRule(condition, States.state(key, value));
} | [
"public",
"static",
"Rule",
"conditionsRule",
"(",
"final",
"Condition",
"condition",
",",
"String",
"key",
",",
"String",
"value",
")",
"{",
"return",
"conditionsRule",
"(",
"condition",
",",
"States",
".",
"state",
"(",
"key",
",",
"value",
")",
")",
";"... | Create a rule: predicate(conditions) => new state(results)
@param condition single condition
@param key key
@param value value
@return rule | [
"Create",
"a",
"rule",
":",
"predicate",
"(",
"conditions",
")",
"=",
">",
"new",
"state",
"(",
"results",
")"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/rules/Rules.java#L98-L100 |
phax/ph-web | ph-web/src/main/java/com/helger/web/scope/mgr/WebScopeManager.java | WebScopeManager.internalGetSessionScope | @Nullable
@DevelopersNote ("This is only for project-internal use!")
public static ISessionWebScope internalGetSessionScope (@Nullable final IRequestWebScope aRequestScope,
final boolean bCreateIfNotExisting,
final boolean bItsOkayToCreateANewSession)
{
// Try to to resolve the current request scope
if (aRequestScope != null)
{
// Check if we have an HTTP session object
final HttpSession aHttpSession = aRequestScope.getSession (bCreateIfNotExisting);
if (aHttpSession != null)
return internalGetOrCreateSessionScope (aHttpSession, bCreateIfNotExisting, bItsOkayToCreateANewSession);
}
else
{
// If we want a session scope, we expect the return value to be non-null!
if (bCreateIfNotExisting)
throw new IllegalStateException ("No request scope is present, so no session scope can be retrieved!");
}
return null;
} | java | @Nullable
@DevelopersNote ("This is only for project-internal use!")
public static ISessionWebScope internalGetSessionScope (@Nullable final IRequestWebScope aRequestScope,
final boolean bCreateIfNotExisting,
final boolean bItsOkayToCreateANewSession)
{
// Try to to resolve the current request scope
if (aRequestScope != null)
{
// Check if we have an HTTP session object
final HttpSession aHttpSession = aRequestScope.getSession (bCreateIfNotExisting);
if (aHttpSession != null)
return internalGetOrCreateSessionScope (aHttpSession, bCreateIfNotExisting, bItsOkayToCreateANewSession);
}
else
{
// If we want a session scope, we expect the return value to be non-null!
if (bCreateIfNotExisting)
throw new IllegalStateException ("No request scope is present, so no session scope can be retrieved!");
}
return null;
} | [
"@",
"Nullable",
"@",
"DevelopersNote",
"(",
"\"This is only for project-internal use!\"",
")",
"public",
"static",
"ISessionWebScope",
"internalGetSessionScope",
"(",
"@",
"Nullable",
"final",
"IRequestWebScope",
"aRequestScope",
",",
"final",
"boolean",
"bCreateIfNotExistin... | Get the session scope of the provided request scope.
@param aRequestScope
The request scope it is about. May be <code>null</code>.
@param bCreateIfNotExisting
if <code>true</code> a new session scope (and a new HTTP session if
required) is created if none is existing so far.
@param bItsOkayToCreateANewSession
if <code>true</code> no warning is emitted, if a new session scope
must be created. This is e.g. used when renewing a session.
@return <code>null</code> if no session scope is present, and none should
be created. | [
"Get",
"the",
"session",
"scope",
"of",
"the",
"provided",
"request",
"scope",
"."
] | train | https://github.com/phax/ph-web/blob/d445fd25184605b62682c93c9782409acf0ae813/ph-web/src/main/java/com/helger/web/scope/mgr/WebScopeManager.java#L355-L376 |
bmwcarit/joynr | java/messaging/messaging-common/src/main/java/io/joynr/common/ExpiryDate.java | ExpiryDate.fromAbsolute | public static ExpiryDate fromAbsolute(long expiryDate) {
long creationTime = System.currentTimeMillis();
long relativeTtl;
try {
relativeTtl = Math.subtractExact(expiryDate, creationTime);
} catch (ArithmeticException exception) {
relativeTtl = Long.MIN_VALUE;
}
return new ExpiryDate(relativeTtl, expiryDate, creationTime);
} | java | public static ExpiryDate fromAbsolute(long expiryDate) {
long creationTime = System.currentTimeMillis();
long relativeTtl;
try {
relativeTtl = Math.subtractExact(expiryDate, creationTime);
} catch (ArithmeticException exception) {
relativeTtl = Long.MIN_VALUE;
}
return new ExpiryDate(relativeTtl, expiryDate, creationTime);
} | [
"public",
"static",
"ExpiryDate",
"fromAbsolute",
"(",
"long",
"expiryDate",
")",
"{",
"long",
"creationTime",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"long",
"relativeTtl",
";",
"try",
"{",
"relativeTtl",
"=",
"Math",
".",
"subtractExact",
"("... | NOTE: relative Ttl can be negative if the ExpiryDate passed in was in the past
@param expiryDate time measured in milliseconds, between the current time and midnight, January 1, 1970 UTC
@return an ExpiryDate object with creationTime = current time, and relativeTtl = ExpiryDate - creationTime; | [
"NOTE",
":",
"relative",
"Ttl",
"can",
"be",
"negative",
"if",
"the",
"ExpiryDate",
"passed",
"in",
"was",
"in",
"the",
"past"
] | train | https://github.com/bmwcarit/joynr/blob/b7a92bad1cf2f093de080facd2c803560f4c6c26/java/messaging/messaging-common/src/main/java/io/joynr/common/ExpiryDate.java#L60-L69 |
google/closure-compiler | src/com/google/javascript/jscomp/TypeValidator.java | TypeValidator.expectNumberOrSymbol | void expectNumberOrSymbol(Node n, JSType type, String msg) {
if (!type.matchesNumberContext() && !type.matchesSymbolContext()) {
mismatch(n, msg, type, NUMBER_SYMBOL);
}
} | java | void expectNumberOrSymbol(Node n, JSType type, String msg) {
if (!type.matchesNumberContext() && !type.matchesSymbolContext()) {
mismatch(n, msg, type, NUMBER_SYMBOL);
}
} | [
"void",
"expectNumberOrSymbol",
"(",
"Node",
"n",
",",
"JSType",
"type",
",",
"String",
"msg",
")",
"{",
"if",
"(",
"!",
"type",
".",
"matchesNumberContext",
"(",
")",
"&&",
"!",
"type",
".",
"matchesSymbolContext",
"(",
")",
")",
"{",
"mismatch",
"(",
... | Expect the type to be a number or string, or a type convertible to a number or symbol. If the
expectation is not met, issue a warning at the provided node's source code position. | [
"Expect",
"the",
"type",
"to",
"be",
"a",
"number",
"or",
"string",
"or",
"a",
"type",
"convertible",
"to",
"a",
"number",
"or",
"symbol",
".",
"If",
"the",
"expectation",
"is",
"not",
"met",
"issue",
"a",
"warning",
"at",
"the",
"provided",
"node",
"s... | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeValidator.java#L413-L417 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/query/QueryByCriteria.java | QueryByCriteria.addOrderBy | public void addOrderBy(String fieldName, boolean sortAscending)
{
if (fieldName != null)
{
m_orderby.add(new FieldHelper(fieldName, sortAscending));
}
} | java | public void addOrderBy(String fieldName, boolean sortAscending)
{
if (fieldName != null)
{
m_orderby.add(new FieldHelper(fieldName, sortAscending));
}
} | [
"public",
"void",
"addOrderBy",
"(",
"String",
"fieldName",
",",
"boolean",
"sortAscending",
")",
"{",
"if",
"(",
"fieldName",
"!=",
"null",
")",
"{",
"m_orderby",
".",
"add",
"(",
"new",
"FieldHelper",
"(",
"fieldName",
",",
"sortAscending",
")",
")",
";"... | Adds a field for orderBy
@param fieldName The field name to be used
@param sortAscending true for ASCENDING, false for DESCENDING | [
"Adds",
"a",
"field",
"for",
"orderBy"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/query/QueryByCriteria.java#L403-L409 |
jenkinsci/jenkins | core/src/main/java/hudson/FilePath.java | FilePath.getParent | public FilePath getParent() {
int i = remote.length() - 2;
for (; i >= 0; i--) {
char ch = remote.charAt(i);
if(ch=='\\' || ch=='/')
break;
}
return i >= 0 ? new FilePath( channel, remote.substring(0,i+1) ) : null;
} | java | public FilePath getParent() {
int i = remote.length() - 2;
for (; i >= 0; i--) {
char ch = remote.charAt(i);
if(ch=='\\' || ch=='/')
break;
}
return i >= 0 ? new FilePath( channel, remote.substring(0,i+1) ) : null;
} | [
"public",
"FilePath",
"getParent",
"(",
")",
"{",
"int",
"i",
"=",
"remote",
".",
"length",
"(",
")",
"-",
"2",
";",
"for",
"(",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"char",
"ch",
"=",
"remote",
".",
"charAt",
"(",
"i",
")",
";",
... | Gets the parent file.
@return parent FilePath or null if there is no parent | [
"Gets",
"the",
"parent",
"file",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/FilePath.java#L1350-L1359 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.mixin | public static void mixin(Class self, Class[] categoryClass) {
mixin(getMetaClass(self), Arrays.asList(categoryClass));
} | java | public static void mixin(Class self, Class[] categoryClass) {
mixin(getMetaClass(self), Arrays.asList(categoryClass));
} | [
"public",
"static",
"void",
"mixin",
"(",
"Class",
"self",
",",
"Class",
"[",
"]",
"categoryClass",
")",
"{",
"mixin",
"(",
"getMetaClass",
"(",
"self",
")",
",",
"Arrays",
".",
"asList",
"(",
"categoryClass",
")",
")",
";",
"}"
] | Extend class globally with category methods.
@param self any Class
@param categoryClass a category class to use
@since 1.6.0 | [
"Extend",
"class",
"globally",
"with",
"category",
"methods",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L600-L602 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/RuntimeExceptionsFactory.java | RuntimeExceptionsFactory.newIllegalStateException | public static IllegalStateException newIllegalStateException(Throwable cause, String message, Object... args) {
return new IllegalStateException(format(message, args), cause);
} | java | public static IllegalStateException newIllegalStateException(Throwable cause, String message, Object... args) {
return new IllegalStateException(format(message, args), cause);
} | [
"public",
"static",
"IllegalStateException",
"newIllegalStateException",
"(",
"Throwable",
"cause",
",",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"new",
"IllegalStateException",
"(",
"format",
"(",
"message",
",",
"args",
")",
",",
... | Constructs and initializes a new {@link IllegalStateException} with the given {@link Throwable cause}
and {@link String message} formatted with the given {@link Object[] arguments}.
@param cause {@link Throwable} identified as the reason this {@link IllegalStateException} was thrown.
@param message {@link String} describing the {@link IllegalStateException exception}.
@param args {@link Object[] arguments} used to replace format placeholders in the {@link String message}.
@return a new {@link IllegalStateException} with the given {@link Throwable cause} and {@link String message}.
@see java.lang.IllegalStateException | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"IllegalStateException",
"}",
"with",
"the",
"given",
"{",
"@link",
"Throwable",
"cause",
"}",
"and",
"{",
"@link",
"String",
"message",
"}",
"formatted",
"with",
"the",
"given",
"{",
"@link",
"Ob... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/RuntimeExceptionsFactory.java#L90-L92 |
killme2008/Metamorphosis | metamorphosis-server-wrapper/src/main/java/com/taobao/metamorphosis/http/processor/MetamorphosisOnJettyProcessor.java | MetamorphosisOnJettyProcessor.doResponseHeaders | protected void doResponseHeaders(final HttpServletResponse response, final String mimeType) {
if (mimeType != null) {
response.setContentType(mimeType);
}
} | java | protected void doResponseHeaders(final HttpServletResponse response, final String mimeType) {
if (mimeType != null) {
response.setContentType(mimeType);
}
} | [
"protected",
"void",
"doResponseHeaders",
"(",
"final",
"HttpServletResponse",
"response",
",",
"final",
"String",
"mimeType",
")",
"{",
"if",
"(",
"mimeType",
"!=",
"null",
")",
"{",
"response",
".",
"setContentType",
"(",
"mimeType",
")",
";",
"}",
"}"
] | Set the response headers. This method is called to set the response
headers such as content type and content length. May be extended to add
additional headers.
@param response
@param resource
@param mimeType | [
"Set",
"the",
"response",
"headers",
".",
"This",
"method",
"is",
"called",
"to",
"set",
"the",
"response",
"headers",
"such",
"as",
"content",
"type",
"and",
"content",
"length",
".",
"May",
"be",
"extended",
"to",
"add",
"additional",
"headers",
"."
] | train | https://github.com/killme2008/Metamorphosis/blob/1884b10620dbd640aaf85102243ca295703fbb4a/metamorphosis-server-wrapper/src/main/java/com/taobao/metamorphosis/http/processor/MetamorphosisOnJettyProcessor.java#L204-L208 |
alipay/sofa-rpc | extension-impl/registry-mesh/src/main/java/com/alipay/sofa/rpc/registry/mesh/MeshRegistry.java | MeshRegistry.doRegister | protected void doRegister(String appName, String serviceName, ProviderInfo providerInfo) {
registerAppInfoOnce(appName);
if (LOGGER.isInfoEnabled(appName)) {
LOGGER.infoWithApp(appName, LogCodes.getLog(LogCodes.INFO_ROUTE_REGISTRY_PUB, serviceName));
}
PublishServiceRequest publishServiceRequest = new PublishServiceRequest();
publishServiceRequest.setServiceName(serviceName);
ProviderMetaInfo providerMetaInfo = new ProviderMetaInfo();
providerMetaInfo.setProtocol(providerInfo.getProtocolType());
providerMetaInfo.setSerializeType(providerInfo.getSerializationType());
providerMetaInfo.setAppName(appName);
providerMetaInfo.setVersion(VERSION);
publishServiceRequest.setProviderMetaInfo(providerMetaInfo);
client.publishService(publishServiceRequest);
} | java | protected void doRegister(String appName, String serviceName, ProviderInfo providerInfo) {
registerAppInfoOnce(appName);
if (LOGGER.isInfoEnabled(appName)) {
LOGGER.infoWithApp(appName, LogCodes.getLog(LogCodes.INFO_ROUTE_REGISTRY_PUB, serviceName));
}
PublishServiceRequest publishServiceRequest = new PublishServiceRequest();
publishServiceRequest.setServiceName(serviceName);
ProviderMetaInfo providerMetaInfo = new ProviderMetaInfo();
providerMetaInfo.setProtocol(providerInfo.getProtocolType());
providerMetaInfo.setSerializeType(providerInfo.getSerializationType());
providerMetaInfo.setAppName(appName);
providerMetaInfo.setVersion(VERSION);
publishServiceRequest.setProviderMetaInfo(providerMetaInfo);
client.publishService(publishServiceRequest);
} | [
"protected",
"void",
"doRegister",
"(",
"String",
"appName",
",",
"String",
"serviceName",
",",
"ProviderInfo",
"providerInfo",
")",
"{",
"registerAppInfoOnce",
"(",
"appName",
")",
";",
"if",
"(",
"LOGGER",
".",
"isInfoEnabled",
"(",
"appName",
")",
")",
"{",... | 注册单条服务信息
@param appName 应用名
@param serviceName 服务关键字
@param providerInfo 服务提供者数据 | [
"注册单条服务信息"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/registry-mesh/src/main/java/com/alipay/sofa/rpc/registry/mesh/MeshRegistry.java#L137-L155 |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/TenantDefinition.java | TenantDefinition.setOption | public void setOption(String optName, Object optValue) {
if (optValue == null) {
m_options.remove(optName);
} else {
m_options.put(optName, optValue);
}
} | java | public void setOption(String optName, Object optValue) {
if (optValue == null) {
m_options.remove(optName);
} else {
m_options.put(optName, optValue);
}
} | [
"public",
"void",
"setOption",
"(",
"String",
"optName",
",",
"Object",
"optValue",
")",
"{",
"if",
"(",
"optValue",
"==",
"null",
")",
"{",
"m_options",
".",
"remove",
"(",
"optName",
")",
";",
"}",
"else",
"{",
"m_options",
".",
"put",
"(",
"optName"... | Set the given option. If the option was previously defined, the value is
overwritten. If the given value is null, the existing option is removed.
@param optName Option name.
@param optValue Option value, which may be a String or Map<String,Object>. | [
"Set",
"the",
"given",
"option",
".",
"If",
"the",
"option",
"was",
"previously",
"defined",
"the",
"value",
"is",
"overwritten",
".",
"If",
"the",
"given",
"value",
"is",
"null",
"the",
"existing",
"option",
"is",
"removed",
"."
] | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/TenantDefinition.java#L253-L259 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/graphic/drawable/Drawable.java | Drawable.getClosestDpi | private static Media getClosestDpi(DpiType current, Media media)
{
final Media mediaDpi = Medias.getWithSuffix(media, current.name().toLowerCase(Locale.ENGLISH));
final Media closest;
if (mediaDpi.exists())
{
closest = mediaDpi;
}
else if (current.ordinal() > 0)
{
closest = getClosestDpi(DpiType.values()[current.ordinal() - 1], media);
}
else
{
closest = media;
}
return closest;
} | java | private static Media getClosestDpi(DpiType current, Media media)
{
final Media mediaDpi = Medias.getWithSuffix(media, current.name().toLowerCase(Locale.ENGLISH));
final Media closest;
if (mediaDpi.exists())
{
closest = mediaDpi;
}
else if (current.ordinal() > 0)
{
closest = getClosestDpi(DpiType.values()[current.ordinal() - 1], media);
}
else
{
closest = media;
}
return closest;
} | [
"private",
"static",
"Media",
"getClosestDpi",
"(",
"DpiType",
"current",
",",
"Media",
"media",
")",
"{",
"final",
"Media",
"mediaDpi",
"=",
"Medias",
".",
"getWithSuffix",
"(",
"media",
",",
"current",
".",
"name",
"(",
")",
".",
"toLowerCase",
"(",
"Loc... | Get the associated DPI media closest to required DPI.
@param current The current DPI to use.
@param media The original media.
@return The DPI media, or the original media if no associated DPI found. | [
"Get",
"the",
"associated",
"DPI",
"media",
"closest",
"to",
"required",
"DPI",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/graphic/drawable/Drawable.java#L299-L316 |
roboconf/roboconf-platform | core/roboconf-core/src/main/java/net/roboconf/core/model/helpers/ImportHelpers.java | ImportHelpers.hasAllRequiredImports | public static boolean hasAllRequiredImports( Instance instance, Logger logger ) {
boolean haveAllImports = true;
for( String facetOrComponentName : VariableHelpers.findPrefixesForMandatoryImportedVariables( instance )) {
Collection<Import> imports = instance.getImports().get( facetOrComponentName );
if( imports != null && ! imports.isEmpty())
continue;
haveAllImports = false;
if( logger != null )
logger.fine( InstanceHelpers.computeInstancePath( instance ) + " is still missing dependencies '" + facetOrComponentName + ".*'." );
break;
}
return haveAllImports;
} | java | public static boolean hasAllRequiredImports( Instance instance, Logger logger ) {
boolean haveAllImports = true;
for( String facetOrComponentName : VariableHelpers.findPrefixesForMandatoryImportedVariables( instance )) {
Collection<Import> imports = instance.getImports().get( facetOrComponentName );
if( imports != null && ! imports.isEmpty())
continue;
haveAllImports = false;
if( logger != null )
logger.fine( InstanceHelpers.computeInstancePath( instance ) + " is still missing dependencies '" + facetOrComponentName + ".*'." );
break;
}
return haveAllImports;
} | [
"public",
"static",
"boolean",
"hasAllRequiredImports",
"(",
"Instance",
"instance",
",",
"Logger",
"logger",
")",
"{",
"boolean",
"haveAllImports",
"=",
"true",
";",
"for",
"(",
"String",
"facetOrComponentName",
":",
"VariableHelpers",
".",
"findPrefixesForMandatoryI... | Determines whether an instance has all the imports it needs.
<p>
Master of Obvious said:<br>
By definition, optional imports are not considered to be required.
</p>
@param instance a non-null instance
@param logger a logger (can be null)
@return true if all its (mandatory) imports are resolved, false otherwise | [
"Determines",
"whether",
"an",
"instance",
"has",
"all",
"the",
"imports",
"it",
"needs",
".",
"<p",
">",
"Master",
"of",
"Obvious",
"said",
":",
"<br",
">",
"By",
"definition",
"optional",
"imports",
"are",
"not",
"considered",
"to",
"be",
"required",
"."... | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-core/src/main/java/net/roboconf/core/model/helpers/ImportHelpers.java#L65-L81 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java | HttpChannelConfig.parseWriteTimeout | private void parseWriteTimeout(Map<Object, Object> props) {
Object value = props.get(HttpConfigConstants.PROPNAME_WRITE_TIMEOUT);
if (null != value) {
try {
this.writeTimeout = TIMEOUT_MODIFIER * minLimit(convertInteger(value), HttpConfigConstants.MIN_TIMEOUT);
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "Config: Write timeout is " + getWriteTimeout());
}
} catch (NumberFormatException nfe) {
FFDCFilter.processException(nfe, getClass().getName() + ".parseWriteTimeout", "1");
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "Config: Invalid write timeout; " + value);
}
}
}
} | java | private void parseWriteTimeout(Map<Object, Object> props) {
Object value = props.get(HttpConfigConstants.PROPNAME_WRITE_TIMEOUT);
if (null != value) {
try {
this.writeTimeout = TIMEOUT_MODIFIER * minLimit(convertInteger(value), HttpConfigConstants.MIN_TIMEOUT);
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "Config: Write timeout is " + getWriteTimeout());
}
} catch (NumberFormatException nfe) {
FFDCFilter.processException(nfe, getClass().getName() + ".parseWriteTimeout", "1");
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
Tr.event(tc, "Config: Invalid write timeout; " + value);
}
}
}
} | [
"private",
"void",
"parseWriteTimeout",
"(",
"Map",
"<",
"Object",
",",
"Object",
">",
"props",
")",
"{",
"Object",
"value",
"=",
"props",
".",
"get",
"(",
"HttpConfigConstants",
".",
"PROPNAME_WRITE_TIMEOUT",
")",
";",
"if",
"(",
"null",
"!=",
"value",
")... | Check the input configuration for the timeout to use when writing data
during the connection.
@param props | [
"Check",
"the",
"input",
"configuration",
"for",
"the",
"timeout",
"to",
"use",
"when",
"writing",
"data",
"during",
"the",
"connection",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java#L681-L696 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/LevelRipConverter.java | LevelRipConverter.checkTile | private static Tile checkTile(MapTile map, ImageBuffer tileSprite, Integer sheet, int x, int y)
{
final int tw = map.getTileWidth();
final int th = map.getTileHeight();
final SpriteTiled tileSheet = map.getSheet(sheet);
final ImageBuffer sheetImage = tileSheet.getSurface();
final int tilesInX = tileSheet.getWidth() / tw;
final int tilesInY = tileSheet.getHeight() / th;
for (int surfaceCurrentTileY = 0; surfaceCurrentTileY < tilesInY; surfaceCurrentTileY++)
{
for (int surfaceCurrentTileX = 0; surfaceCurrentTileX < tilesInX; surfaceCurrentTileX++)
{
// Tile number on tile sheet
final int number = surfaceCurrentTileX + surfaceCurrentTileY * tilesInX;
// Compare tiles between sheet and image map
final int xa = x * tw;
final int ya = y * th;
final int xb = surfaceCurrentTileX * tw;
final int yb = surfaceCurrentTileY * th;
if (TilesExtractor.compareTile(tw, th, tileSprite, xa, ya, sheetImage, xb, yb))
{
return map.createTile(sheet, number, xa, (map.getInTileHeight() - 1.0 - y) * th);
}
}
}
return null;
} | java | private static Tile checkTile(MapTile map, ImageBuffer tileSprite, Integer sheet, int x, int y)
{
final int tw = map.getTileWidth();
final int th = map.getTileHeight();
final SpriteTiled tileSheet = map.getSheet(sheet);
final ImageBuffer sheetImage = tileSheet.getSurface();
final int tilesInX = tileSheet.getWidth() / tw;
final int tilesInY = tileSheet.getHeight() / th;
for (int surfaceCurrentTileY = 0; surfaceCurrentTileY < tilesInY; surfaceCurrentTileY++)
{
for (int surfaceCurrentTileX = 0; surfaceCurrentTileX < tilesInX; surfaceCurrentTileX++)
{
// Tile number on tile sheet
final int number = surfaceCurrentTileX + surfaceCurrentTileY * tilesInX;
// Compare tiles between sheet and image map
final int xa = x * tw;
final int ya = y * th;
final int xb = surfaceCurrentTileX * tw;
final int yb = surfaceCurrentTileY * th;
if (TilesExtractor.compareTile(tw, th, tileSprite, xa, ya, sheetImage, xb, yb))
{
return map.createTile(sheet, number, xa, (map.getInTileHeight() - 1.0 - y) * th);
}
}
}
return null;
} | [
"private",
"static",
"Tile",
"checkTile",
"(",
"MapTile",
"map",
",",
"ImageBuffer",
"tileSprite",
",",
"Integer",
"sheet",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"final",
"int",
"tw",
"=",
"map",
".",
"getTileWidth",
"(",
")",
";",
"final",
"int"... | Check tile of sheet.
@param map The destination map reference.
@param tileSprite The tiled sprite
@param sheet The sheet number.
@param x The location x.
@param y The location y.
@return The tile found. | [
"Check",
"tile",
"of",
"sheet",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/LevelRipConverter.java#L182-L211 |
mikepenz/FastAdapter | library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/ActionModeHelper.java | ActionModeHelper.checkActionMode | public ActionMode checkActionMode(AppCompatActivity act) {
int selected = mSelectExtension.getSelectedItems().size();
return checkActionMode(act, selected);
} | java | public ActionMode checkActionMode(AppCompatActivity act) {
int selected = mSelectExtension.getSelectedItems().size();
return checkActionMode(act, selected);
} | [
"public",
"ActionMode",
"checkActionMode",
"(",
"AppCompatActivity",
"act",
")",
"{",
"int",
"selected",
"=",
"mSelectExtension",
".",
"getSelectedItems",
"(",
")",
".",
"size",
"(",
")",
";",
"return",
"checkActionMode",
"(",
"act",
",",
"selected",
")",
";",... | check if the ActionMode should be shown or not depending on the currently selected items
Additionally, it will also update the title in the CAB for you
@param act the current Activity
@return the initialized ActionMode or null if no ActionMode is active after calling this function | [
"check",
"if",
"the",
"ActionMode",
"should",
"be",
"shown",
"or",
"not",
"depending",
"on",
"the",
"currently",
"selected",
"items",
"Additionally",
"it",
"will",
"also",
"update",
"the",
"title",
"in",
"the",
"CAB",
"for",
"you"
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-extensions/src/main/java/com/mikepenz/fastadapter_extensions/ActionModeHelper.java#L167-L170 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ImageModerationsImpl.java | ImageModerationsImpl.oCRMethod | public OCR oCRMethod(String language, OCRMethodOptionalParameter oCRMethodOptionalParameter) {
return oCRMethodWithServiceResponseAsync(language, oCRMethodOptionalParameter).toBlocking().single().body();
} | java | public OCR oCRMethod(String language, OCRMethodOptionalParameter oCRMethodOptionalParameter) {
return oCRMethodWithServiceResponseAsync(language, oCRMethodOptionalParameter).toBlocking().single().body();
} | [
"public",
"OCR",
"oCRMethod",
"(",
"String",
"language",
",",
"OCRMethodOptionalParameter",
"oCRMethodOptionalParameter",
")",
"{",
"return",
"oCRMethodWithServiceResponseAsync",
"(",
"language",
",",
"oCRMethodOptionalParameter",
")",
".",
"toBlocking",
"(",
")",
".",
... | Returns any text found in the image for the language specified. If no language is specified in input then the detection defaults to English.
@param language Language of the terms.
@param oCRMethodOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the validation
@throws APIErrorException thrown if the request is rejected by server
@throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
@return the OCR object if successful. | [
"Returns",
"any",
"text",
"found",
"in",
"the",
"image",
"for",
"the",
"language",
"specified",
".",
"If",
"no",
"language",
"is",
"specified",
"in",
"input",
"then",
"the",
"detection",
"defaults",
"to",
"English",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ImageModerationsImpl.java#L270-L272 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/paramavg/util/ExportSupport.java | ExportSupport.exportSupported | public static boolean exportSupported(@NonNull String sparkMaster, @NonNull FileSystem fs) {
// Anything is supported with a local master. Regex matches 'local', 'local[DIGITS]' or 'local[*]'
if (sparkMaster.matches("^local(\\[(\\d+|\\*)])?$")) {
return true;
}
// Clustered mode is supported as long as the file system is not a local one
return !fs.getUri().getScheme().equals("file");
} | java | public static boolean exportSupported(@NonNull String sparkMaster, @NonNull FileSystem fs) {
// Anything is supported with a local master. Regex matches 'local', 'local[DIGITS]' or 'local[*]'
if (sparkMaster.matches("^local(\\[(\\d+|\\*)])?$")) {
return true;
}
// Clustered mode is supported as long as the file system is not a local one
return !fs.getUri().getScheme().equals("file");
} | [
"public",
"static",
"boolean",
"exportSupported",
"(",
"@",
"NonNull",
"String",
"sparkMaster",
",",
"@",
"NonNull",
"FileSystem",
"fs",
")",
"{",
"// Anything is supported with a local master. Regex matches 'local', 'local[DIGITS]' or 'local[*]'",
"if",
"(",
"sparkMaster",
"... | Check if exporting data is supported in the current environment. Exporting is possible in two cases:
- The master is set to local. In this case any file system, including local FS, will work for exporting.
- The file system is not local. Local file systems do not work in cluster modes.
@param sparkMaster the Spark master
@param fs the Hadoop file system
@return if export is supported | [
"Check",
"if",
"exporting",
"data",
"is",
"supported",
"in",
"the",
"current",
"environment",
".",
"Exporting",
"is",
"possible",
"in",
"two",
"cases",
":",
"-",
"The",
"master",
"is",
"set",
"to",
"local",
".",
"In",
"this",
"case",
"any",
"file",
"syst... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-scaleout/spark/dl4j-spark/src/main/java/org/deeplearning4j/spark/impl/paramavg/util/ExportSupport.java#L74-L81 |
lessthanoptimal/ejml | main/ejml-dsparse/src/org/ejml/sparse/csc/CommonOps_DSCC.java | CommonOps_DSCC.extractDiag | public static void extractDiag(DMatrixSparseCSC src, DMatrixSparseCSC dst ) {
int N = Math.min(src.numRows, src.numCols);
if( !MatrixFeatures_DSCC.isVector(dst) ) {
dst.reshape(N, 1, N);
} else if( dst.numRows*dst.numCols != N ) {
dst.reshape(N,1,N);
} else {
dst.growMaxLength(N,false);
}
dst.nz_length = N;
dst.indicesSorted = true;
if( dst.numRows != 1 ) {
dst.col_idx[0] = 0;
dst.col_idx[1] = N;
for (int i = 0; i < N; i++) {
dst.nz_values[i] = src.unsafe_get(i, i);
dst.nz_rows[i] = i;
}
} else {
dst.col_idx[0] = 0;
for (int i = 0; i < N; i++) {
dst.nz_values[i] = src.unsafe_get(i, i);
dst.nz_rows[i] = 0;
dst.col_idx[i+1] = i+1;
}
}
} | java | public static void extractDiag(DMatrixSparseCSC src, DMatrixSparseCSC dst ) {
int N = Math.min(src.numRows, src.numCols);
if( !MatrixFeatures_DSCC.isVector(dst) ) {
dst.reshape(N, 1, N);
} else if( dst.numRows*dst.numCols != N ) {
dst.reshape(N,1,N);
} else {
dst.growMaxLength(N,false);
}
dst.nz_length = N;
dst.indicesSorted = true;
if( dst.numRows != 1 ) {
dst.col_idx[0] = 0;
dst.col_idx[1] = N;
for (int i = 0; i < N; i++) {
dst.nz_values[i] = src.unsafe_get(i, i);
dst.nz_rows[i] = i;
}
} else {
dst.col_idx[0] = 0;
for (int i = 0; i < N; i++) {
dst.nz_values[i] = src.unsafe_get(i, i);
dst.nz_rows[i] = 0;
dst.col_idx[i+1] = i+1;
}
}
} | [
"public",
"static",
"void",
"extractDiag",
"(",
"DMatrixSparseCSC",
"src",
",",
"DMatrixSparseCSC",
"dst",
")",
"{",
"int",
"N",
"=",
"Math",
".",
"min",
"(",
"src",
".",
"numRows",
",",
"src",
".",
"numCols",
")",
";",
"if",
"(",
"!",
"MatrixFeatures_DS... | <p>
Extracts the diagonal elements 'src' write it to the 'dst' vector. 'dst'
can either be a row or column vector.
<p>
@param src Matrix whose diagonal elements are being extracted. Not modified.
@param dst A vector the results will be written into. Modified. | [
"<p",
">",
"Extracts",
"the",
"diagonal",
"elements",
"src",
"write",
"it",
"to",
"the",
"dst",
"vector",
".",
"dst",
"can",
"either",
"be",
"a",
"row",
"or",
"column",
"vector",
".",
"<p",
">"
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-dsparse/src/org/ejml/sparse/csc/CommonOps_DSCC.java#L751-L781 |
playn/playn | html/src/playn/html/HtmlGraphics.java | HtmlGraphics.registerFontMetrics | public void registerFontMetrics(String name, Font font, float lineHeight) {
HtmlFontMetrics metrics = getFontMetrics(font); // get emwidth via default measurement
fontMetrics.put(font, new HtmlFontMetrics(font, lineHeight, metrics.emwidth));
} | java | public void registerFontMetrics(String name, Font font, float lineHeight) {
HtmlFontMetrics metrics = getFontMetrics(font); // get emwidth via default measurement
fontMetrics.put(font, new HtmlFontMetrics(font, lineHeight, metrics.emwidth));
} | [
"public",
"void",
"registerFontMetrics",
"(",
"String",
"name",
",",
"Font",
"font",
",",
"float",
"lineHeight",
")",
"{",
"HtmlFontMetrics",
"metrics",
"=",
"getFontMetrics",
"(",
"font",
")",
";",
"// get emwidth via default measurement",
"fontMetrics",
".",
"put"... | Registers metrics for the specified font in the specified style and size. This overrides the
default font metrics calculation (which is hacky and inaccurate). If you want to ensure
somewhat consistent font layout across browsers, you should register font metrics for every
combination of font, style and size that you use in your app.
@param lineHeight the height of a line of text in the specified font (in pixels). | [
"Registers",
"metrics",
"for",
"the",
"specified",
"font",
"in",
"the",
"specified",
"style",
"and",
"size",
".",
"This",
"overrides",
"the",
"default",
"font",
"metrics",
"calculation",
"(",
"which",
"is",
"hacky",
"and",
"inaccurate",
")",
".",
"If",
"you"... | train | https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/html/src/playn/html/HtmlGraphics.java#L168-L171 |
liuyukuai/commons | commons-core/src/main/java/com/itxiaoer/commons/core/date/LocalDateTimeUtil.java | LocalDateTimeUtil.parse | public static LocalDateTime parse(String localDate, String pattern) {
return LocalDateTime.from(DateTimeFormatter.ofPattern(pattern).parse(localDate));
} | java | public static LocalDateTime parse(String localDate, String pattern) {
return LocalDateTime.from(DateTimeFormatter.ofPattern(pattern).parse(localDate));
} | [
"public",
"static",
"LocalDateTime",
"parse",
"(",
"String",
"localDate",
",",
"String",
"pattern",
")",
"{",
"return",
"LocalDateTime",
".",
"from",
"(",
"DateTimeFormatter",
".",
"ofPattern",
"(",
"pattern",
")",
".",
"parse",
"(",
"localDate",
")",
")",
"... | 格式化时间
@param localDate 时间
@param pattern 时间格式
@return 时间字符串 | [
"格式化时间"
] | train | https://github.com/liuyukuai/commons/blob/ba67eddb542446b12f419f1866dbaa82e47fbf35/commons-core/src/main/java/com/itxiaoer/commons/core/date/LocalDateTimeUtil.java#L116-L118 |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/massindex/impl/Helper.java | Helper.getTransactionAndMarkForJoin | public static Transaction getTransactionAndMarkForJoin(Session session, ServiceManager serviceManager) throws ClassNotFoundException,
NoSuchMethodException, IllegalAccessException, InvocationTargetException {
Transaction transaction = session.getTransaction();
doMarkforJoined( serviceManager, transaction );
return transaction;
} | java | public static Transaction getTransactionAndMarkForJoin(Session session, ServiceManager serviceManager) throws ClassNotFoundException,
NoSuchMethodException, IllegalAccessException, InvocationTargetException {
Transaction transaction = session.getTransaction();
doMarkforJoined( serviceManager, transaction );
return transaction;
} | [
"public",
"static",
"Transaction",
"getTransactionAndMarkForJoin",
"(",
"Session",
"session",
",",
"ServiceManager",
"serviceManager",
")",
"throws",
"ClassNotFoundException",
",",
"NoSuchMethodException",
",",
"IllegalAccessException",
",",
"InvocationTargetException",
"{",
... | if the transaction object is a JoinableCMTTransaction, call markForJoined()
This must be done prior to starting the transaction
@param serviceManager | [
"if",
"the",
"transaction",
"object",
"is",
"a",
"JoinableCMTTransaction",
"call",
"markForJoined",
"()",
"This",
"must",
"be",
"done",
"prior",
"to",
"starting",
"the",
"transaction"
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/massindex/impl/Helper.java#L27-L32 |
jbundle/jbundle | main/msg.wsdl/src/main/java/org/jbundle/main/msg/wsdl/DWsdlAccessScreen.java | DWsdlAccessScreen.sendData | public void sendData(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
{
res.setContentType("text/xml");
PrintWriter out = res.getWriter();
this.printXML(req, out);
out.flush();
} | java | public void sendData(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException
{
res.setContentType("text/xml");
PrintWriter out = res.getWriter();
this.printXML(req, out);
out.flush();
} | [
"public",
"void",
"sendData",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"res",
".",
"setContentType",
"(",
"\"text/xml\"",
")",
";",
"PrintWriter",
"out",
"=",
"res",
".",
"ge... | Process an HTML get or post.
You must override this method.
@param req The servlet request.
@param res The servlet response object.
@exception ServletException From inherited class.
@exception IOException From inherited class. | [
"Process",
"an",
"HTML",
"get",
"or",
"post",
".",
"You",
"must",
"override",
"this",
"method",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/main/msg.wsdl/src/main/java/org/jbundle/main/msg/wsdl/DWsdlAccessScreen.java#L67-L73 |
GistLabs/mechanize | src/main/java/com/gistlabs/mechanize/util/Util.java | Util.findHeader | public static Header findHeader(HttpResponse response, String headerName) {
Header[] headers = response.getHeaders(headerName);
return headers.length > 0 ? headers[0] : null;
} | java | public static Header findHeader(HttpResponse response, String headerName) {
Header[] headers = response.getHeaders(headerName);
return headers.length > 0 ? headers[0] : null;
} | [
"public",
"static",
"Header",
"findHeader",
"(",
"HttpResponse",
"response",
",",
"String",
"headerName",
")",
"{",
"Header",
"[",
"]",
"headers",
"=",
"response",
".",
"getHeaders",
"(",
"headerName",
")",
";",
"return",
"headers",
".",
"length",
">",
"0",
... | Returns the first header with the given name (case-insensitive) or null. | [
"Returns",
"the",
"first",
"header",
"with",
"the",
"given",
"name",
"(",
"case",
"-",
"insensitive",
")",
"or",
"null",
"."
] | train | https://github.com/GistLabs/mechanize/blob/32ddd0774439a4c08513c05d7ac7416a3899efed/src/main/java/com/gistlabs/mechanize/util/Util.java#L33-L36 |
JOML-CI/JOML | src/org/joml/Intersectiond.java | Intersectiond.findClosestPointOnTriangle | public static int findClosestPointOnTriangle(Vector3dc v0, Vector3dc v1, Vector3dc v2, Vector3dc p, Vector3d result) {
return findClosestPointOnTriangle(v0.x(), v0.y(), v0.z(), v1.x(), v1.y(), v1.z(), v2.x(), v2.y(), v2.z(), p.x(), p.y(), p.z(), result);
} | java | public static int findClosestPointOnTriangle(Vector3dc v0, Vector3dc v1, Vector3dc v2, Vector3dc p, Vector3d result) {
return findClosestPointOnTriangle(v0.x(), v0.y(), v0.z(), v1.x(), v1.y(), v1.z(), v2.x(), v2.y(), v2.z(), p.x(), p.y(), p.z(), result);
} | [
"public",
"static",
"int",
"findClosestPointOnTriangle",
"(",
"Vector3dc",
"v0",
",",
"Vector3dc",
"v1",
",",
"Vector3dc",
"v2",
",",
"Vector3dc",
"p",
",",
"Vector3d",
"result",
")",
"{",
"return",
"findClosestPointOnTriangle",
"(",
"v0",
".",
"x",
"(",
")",
... | Determine the closest point on the triangle with the vertices <code>v0</code>, <code>v1</code>, <code>v2</code>
between that triangle and the given point <code>p</code> and store that point into the given <code>result</code>.
<p>
Additionally, this method returns whether the closest point is a vertex ({@link #POINT_ON_TRIANGLE_VERTEX_0}, {@link #POINT_ON_TRIANGLE_VERTEX_1}, {@link #POINT_ON_TRIANGLE_VERTEX_2})
of the triangle, lies on an edge ({@link #POINT_ON_TRIANGLE_EDGE_01}, {@link #POINT_ON_TRIANGLE_EDGE_12}, {@link #POINT_ON_TRIANGLE_EDGE_20})
or on the {@link #POINT_ON_TRIANGLE_FACE face} of the triangle.
<p>
Reference: Book "Real-Time Collision Detection" chapter 5.1.5 "Closest Point on Triangle to Point"
@param v0
the first vertex of the triangle
@param v1
the second vertex of the triangle
@param v2
the third vertex of the triangle
@param p
the point
@param result
will hold the closest point
@return one of {@link #POINT_ON_TRIANGLE_VERTEX_0}, {@link #POINT_ON_TRIANGLE_VERTEX_1}, {@link #POINT_ON_TRIANGLE_VERTEX_2},
{@link #POINT_ON_TRIANGLE_EDGE_01}, {@link #POINT_ON_TRIANGLE_EDGE_12}, {@link #POINT_ON_TRIANGLE_EDGE_20} or
{@link #POINT_ON_TRIANGLE_FACE} | [
"Determine",
"the",
"closest",
"point",
"on",
"the",
"triangle",
"with",
"the",
"vertices",
"<code",
">",
"v0<",
"/",
"code",
">",
"<code",
">",
"v1<",
"/",
"code",
">",
"<code",
">",
"v2<",
"/",
"code",
">",
"between",
"that",
"triangle",
"and",
"the"... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Intersectiond.java#L1668-L1670 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/color/ColorYuv.java | ColorYuv.yuvToRgb | public static void yuvToRgb( double y , double u , double v , double rgb[] ) {
rgb[0] = y + 1.13983*v;
rgb[1] = y - 0.39465*u - 0.58060*v;
rgb[2] = y + 2.032*u;
} | java | public static void yuvToRgb( double y , double u , double v , double rgb[] ) {
rgb[0] = y + 1.13983*v;
rgb[1] = y - 0.39465*u - 0.58060*v;
rgb[2] = y + 2.032*u;
} | [
"public",
"static",
"void",
"yuvToRgb",
"(",
"double",
"y",
",",
"double",
"u",
",",
"double",
"v",
",",
"double",
"rgb",
"[",
"]",
")",
"{",
"rgb",
"[",
"0",
"]",
"=",
"y",
"+",
"1.13983",
"*",
"v",
";",
"rgb",
"[",
"1",
"]",
"=",
"y",
"-",
... | Conversion from YUV to RGB using same equations as Intel IPP. | [
"Conversion",
"from",
"YUV",
"to",
"RGB",
"using",
"same",
"equations",
"as",
"Intel",
"IPP",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/color/ColorYuv.java#L82-L86 |
seancfoley/IPAddress | IPAddress/src/inet.ipaddr/inet/ipaddr/IPAddress.java | IPAddress.getMatchesSQLClause | public void getMatchesSQLClause(StringBuilder builder, String sqlExpression, IPAddressSQLTranslator translator) {
getSection().getStartsWithSQLClause(builder, sqlExpression, translator);
} | java | public void getMatchesSQLClause(StringBuilder builder, String sqlExpression, IPAddressSQLTranslator translator) {
getSection().getStartsWithSQLClause(builder, sqlExpression, translator);
} | [
"public",
"void",
"getMatchesSQLClause",
"(",
"StringBuilder",
"builder",
",",
"String",
"sqlExpression",
",",
"IPAddressSQLTranslator",
"translator",
")",
"{",
"getSection",
"(",
")",
".",
"getStartsWithSQLClause",
"(",
"builder",
",",
"sqlExpression",
",",
"translat... | Returns a clause for matching this address.
<p>
Similar to getMatchesSQLClause(StringBuilder builder, String sqlExpression) but allows you to tailor the SQL produced.
@param builder
@param sqlExpression
@param translator | [
"Returns",
"a",
"clause",
"for",
"matching",
"this",
"address",
".",
"<p",
">",
"Similar",
"to",
"getMatchesSQLClause",
"(",
"StringBuilder",
"builder",
"String",
"sqlExpression",
")",
"but",
"allows",
"you",
"to",
"tailor",
"the",
"SQL",
"produced",
"."
] | train | https://github.com/seancfoley/IPAddress/blob/90493d0673511d673100c36d020dd93dd870111a/IPAddress/src/inet.ipaddr/inet/ipaddr/IPAddress.java#L1605-L1607 |
krummas/DrizzleJDBC | src/main/java/org/drizzle/jdbc/DrizzleConnection.java | DrizzleConnection.createStatement | public Statement createStatement(final int resultSetType, final int resultSetConcurrency, final int resultSetHoldability)
throws SQLException {
if (resultSetConcurrency != ResultSet.CONCUR_READ_ONLY) {
throw SQLExceptionMapper.getFeatureNotSupportedException("Only read-only result sets allowed");
}
if (resultSetHoldability != ResultSet.HOLD_CURSORS_OVER_COMMIT) {
throw SQLExceptionMapper.getFeatureNotSupportedException(
"Cursors are always kept when sending commit (they are only client-side)");
}
return createStatement();
} | java | public Statement createStatement(final int resultSetType, final int resultSetConcurrency, final int resultSetHoldability)
throws SQLException {
if (resultSetConcurrency != ResultSet.CONCUR_READ_ONLY) {
throw SQLExceptionMapper.getFeatureNotSupportedException("Only read-only result sets allowed");
}
if (resultSetHoldability != ResultSet.HOLD_CURSORS_OVER_COMMIT) {
throw SQLExceptionMapper.getFeatureNotSupportedException(
"Cursors are always kept when sending commit (they are only client-side)");
}
return createStatement();
} | [
"public",
"Statement",
"createStatement",
"(",
"final",
"int",
"resultSetType",
",",
"final",
"int",
"resultSetConcurrency",
",",
"final",
"int",
"resultSetHoldability",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"resultSetConcurrency",
"!=",
"ResultSet",
".",
"... | Creates a <code>Statement</code> object that will generate <code>ResultSet</code> objects with the given type,
concurrency, and holdability. This method is the same as the <code>createStatement</code> method above, but it
allows the default result set type, concurrency, and holdability to be overridden.
@param resultSetType one of the following <code>ResultSet</code> constants: <code>ResultSet.TYPE_FORWARD_ONLY</code>,
<code>ResultSet.TYPE_SCROLL_INSENSITIVE</code>, or <code>ResultSet.TYPE_SCROLL_SENSITIVE</code>
@param resultSetConcurrency one of the following <code>ResultSet</code> constants: <code>ResultSet.CONCUR_READ_ONLY</code>
or <code>ResultSet.CONCUR_UPDATABLE</code>
@param resultSetHoldability one of the following <code>ResultSet</code> constants: <code>ResultSet.HOLD_CURSORS_OVER_COMMIT</code>
or <code>ResultSet.CLOSE_CURSORS_AT_COMMIT</code>
@return a new <code>Statement</code> object that will generate <code>ResultSet</code> objects with the given
type, concurrency, and holdability
@throws java.sql.SQLException if a database access error occurs, this method is called on a closed connection or
the given parameters are not <code>ResultSet</code> constants indicating type,
concurrency, and holdability
@throws java.sql.SQLFeatureNotSupportedException
if the JDBC driver does not support this method or this method is not supported for
the specified result set type, result set holdability and result set concurrency.
@see java.sql.ResultSet
@since 1.4 | [
"Creates",
"a",
"<code",
">",
"Statement<",
"/",
"code",
">",
"object",
"that",
"will",
"generate",
"<code",
">",
"ResultSet<",
"/",
"code",
">",
"objects",
"with",
"the",
"given",
"type",
"concurrency",
"and",
"holdability",
".",
"This",
"method",
"is",
"... | train | https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/DrizzleConnection.java#L694-L704 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/EventSubscriptionManager.java | EventSubscriptionManager.findMessageStartEventSubscriptionByNameAndTenantId | public EventSubscriptionEntity findMessageStartEventSubscriptionByNameAndTenantId(String messageName, String tenantId) {
Map<String, String> parameters = new HashMap<String, String>();
parameters.put("messageName", messageName);
parameters.put("tenantId", tenantId);
return (EventSubscriptionEntity) getDbEntityManager().selectOne("selectMessageStartEventSubscriptionByNameAndTenantId", parameters);
} | java | public EventSubscriptionEntity findMessageStartEventSubscriptionByNameAndTenantId(String messageName, String tenantId) {
Map<String, String> parameters = new HashMap<String, String>();
parameters.put("messageName", messageName);
parameters.put("tenantId", tenantId);
return (EventSubscriptionEntity) getDbEntityManager().selectOne("selectMessageStartEventSubscriptionByNameAndTenantId", parameters);
} | [
"public",
"EventSubscriptionEntity",
"findMessageStartEventSubscriptionByNameAndTenantId",
"(",
"String",
"messageName",
",",
"String",
"tenantId",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
... | @return the message start event subscription with the given message name and tenant id
@see #findMessageStartEventSubscriptionByName(String) | [
"@return",
"the",
"message",
"start",
"event",
"subscription",
"with",
"the",
"given",
"message",
"name",
"and",
"tenant",
"id"
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/EventSubscriptionManager.java#L279-L285 |
classgraph/classgraph | src/main/java/io/github/classgraph/ClassInfo.java | ClassInfo.addRelatedClass | boolean addRelatedClass(final RelType relType, final ClassInfo classInfo) {
Set<ClassInfo> classInfoSet = relatedClasses.get(relType);
if (classInfoSet == null) {
relatedClasses.put(relType, classInfoSet = new LinkedHashSet<>(4));
}
return classInfoSet.add(classInfo);
} | java | boolean addRelatedClass(final RelType relType, final ClassInfo classInfo) {
Set<ClassInfo> classInfoSet = relatedClasses.get(relType);
if (classInfoSet == null) {
relatedClasses.put(relType, classInfoSet = new LinkedHashSet<>(4));
}
return classInfoSet.add(classInfo);
} | [
"boolean",
"addRelatedClass",
"(",
"final",
"RelType",
"relType",
",",
"final",
"ClassInfo",
"classInfo",
")",
"{",
"Set",
"<",
"ClassInfo",
">",
"classInfoSet",
"=",
"relatedClasses",
".",
"get",
"(",
"relType",
")",
";",
"if",
"(",
"classInfoSet",
"==",
"n... | Add a class with a given relationship type. Return whether the collection changed as a result of the call.
@param relType
the {@link RelType}
@param classInfo
the {@link ClassInfo}
@return true, if successful | [
"Add",
"a",
"class",
"with",
"a",
"given",
"relationship",
"type",
".",
"Return",
"whether",
"the",
"collection",
"changed",
"as",
"a",
"result",
"of",
"the",
"call",
"."
] | train | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/ClassInfo.java#L287-L293 |
census-instrumentation/opencensus-java | contrib/dropwizard/src/main/java/io/opencensus/contrib/dropwizard/DropWizardMetrics.java | DropWizardMetrics.collectCounter | private Metric collectCounter(String dropwizardName, Counter counter) {
String metricName = DropWizardUtils.generateFullMetricName(dropwizardName, "counter");
String metricDescription =
DropWizardUtils.generateFullMetricDescription(dropwizardName, counter);
MetricDescriptor metricDescriptor =
MetricDescriptor.create(
metricName,
metricDescription,
DEFAULT_UNIT,
Type.GAUGE_INT64,
Collections.<LabelKey>emptyList());
TimeSeries timeSeries =
TimeSeries.createWithOnePoint(
Collections.<LabelValue>emptyList(),
Point.create(Value.longValue(counter.getCount()), clock.now()),
null);
return Metric.createWithOneTimeSeries(metricDescriptor, timeSeries);
} | java | private Metric collectCounter(String dropwizardName, Counter counter) {
String metricName = DropWizardUtils.generateFullMetricName(dropwizardName, "counter");
String metricDescription =
DropWizardUtils.generateFullMetricDescription(dropwizardName, counter);
MetricDescriptor metricDescriptor =
MetricDescriptor.create(
metricName,
metricDescription,
DEFAULT_UNIT,
Type.GAUGE_INT64,
Collections.<LabelKey>emptyList());
TimeSeries timeSeries =
TimeSeries.createWithOnePoint(
Collections.<LabelValue>emptyList(),
Point.create(Value.longValue(counter.getCount()), clock.now()),
null);
return Metric.createWithOneTimeSeries(metricDescriptor, timeSeries);
} | [
"private",
"Metric",
"collectCounter",
"(",
"String",
"dropwizardName",
",",
"Counter",
"counter",
")",
"{",
"String",
"metricName",
"=",
"DropWizardUtils",
".",
"generateFullMetricName",
"(",
"dropwizardName",
",",
"\"counter\"",
")",
";",
"String",
"metricDescriptio... | Returns a {@code Metric} collected from {@link Counter}.
@param dropwizardName the metric name.
@param counter the counter object to collect.
@return a {@code Metric}. | [
"Returns",
"a",
"{",
"@code",
"Metric",
"}",
"collected",
"from",
"{",
"@link",
"Counter",
"}",
"."
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/contrib/dropwizard/src/main/java/io/opencensus/contrib/dropwizard/DropWizardMetrics.java#L141-L159 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getAllContinentFloorID | public void getAllContinentFloorID(int continentID, Callback<List<Integer>> callback) throws NullPointerException {
gw2API.getAllContinentFloorIDs(Integer.toString(continentID)).enqueue(callback);
} | java | public void getAllContinentFloorID(int continentID, Callback<List<Integer>> callback) throws NullPointerException {
gw2API.getAllContinentFloorIDs(Integer.toString(continentID)).enqueue(callback);
} | [
"public",
"void",
"getAllContinentFloorID",
"(",
"int",
"continentID",
",",
"Callback",
"<",
"List",
"<",
"Integer",
">",
">",
"callback",
")",
"throws",
"NullPointerException",
"{",
"gw2API",
".",
"getAllContinentFloorIDs",
"(",
"Integer",
".",
"toString",
"(",
... | For more info on continents API go <a href="https://wiki.guildwars2.com/wiki/API:2/continents">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
@param continentID {@link Continent#id}
@param callback callback that is going to be used for {@link Call#enqueue(Callback)}
@throws NullPointerException if given {@link Callback} is empty
@see ContinentFloor continents floor info | [
"For",
"more",
"info",
"on",
"continents",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"continents",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">",
"Give",
"use... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L1046-L1048 |
wildfly/wildfly-core | server/src/main/java/org/jboss/as/server/deployment/DeploymentResourceSupport.java | DeploymentResourceSupport.getDeploymentSubModel | public ModelNode getDeploymentSubModel(final String subsystemName, final PathElement address) {
assert subsystemName != null : "The subsystemName cannot be null";
return getDeploymentSubModel(subsystemName, address, deploymentUnit);
} | java | public ModelNode getDeploymentSubModel(final String subsystemName, final PathElement address) {
assert subsystemName != null : "The subsystemName cannot be null";
return getDeploymentSubModel(subsystemName, address, deploymentUnit);
} | [
"public",
"ModelNode",
"getDeploymentSubModel",
"(",
"final",
"String",
"subsystemName",
",",
"final",
"PathElement",
"address",
")",
"{",
"assert",
"subsystemName",
"!=",
"null",
":",
"\"The subsystemName cannot be null\"",
";",
"return",
"getDeploymentSubModel",
"(",
... | Gets the sub-model for a components from the deployment itself. Operations, metrics and descriptions have to be
registered as part of the subsystem registration {@link org.jboss.as.controller.ExtensionContext} and
{@link org.jboss.as.controller.SubsystemRegistration#registerDeploymentModel(org.jboss.as.controller.ResourceDefinition)}.
<p>
If the subsystem resource does not exist it will be created. If no resource exists for the address parameter on
the resource it also be created.
</p>
@param subsystemName the name of the subsystem
@param address the path address this sub-model should return the model for
@return the model for the resource | [
"Gets",
"the",
"sub",
"-",
"model",
"for",
"a",
"components",
"from",
"the",
"deployment",
"itself",
".",
"Operations",
"metrics",
"and",
"descriptions",
"have",
"to",
"be",
"registered",
"as",
"part",
"of",
"the",
"subsystem",
"registration",
"{",
"@link",
... | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/server/src/main/java/org/jboss/as/server/deployment/DeploymentResourceSupport.java#L156-L159 |
knightliao/disconf | disconf-core/src/main/java/com/baidu/disconf/core/common/restful/impl/RestfulMgrImpl.java | RestfulMgrImpl.retry4ConfDownload | private Object retry4ConfDownload(RemoteUrl remoteUrl, File localTmpFile, int retryTimes, int sleepSeconds)
throws Exception {
Exception ex = null;
for (URL url : remoteUrl.getUrls()) {
// 可重试的下载
UnreliableInterface unreliableImpl = new FetchConfFile(url, localTmpFile);
try {
return retryStrategy.retry(unreliableImpl, retryTimes, sleepSeconds);
} catch (Exception e) {
ex = e;
try {
Thread.sleep(1000);
} catch (InterruptedException e1) {
LOGGER.info("pass");
}
}
}
throw new Exception("download failed.", ex);
} | java | private Object retry4ConfDownload(RemoteUrl remoteUrl, File localTmpFile, int retryTimes, int sleepSeconds)
throws Exception {
Exception ex = null;
for (URL url : remoteUrl.getUrls()) {
// 可重试的下载
UnreliableInterface unreliableImpl = new FetchConfFile(url, localTmpFile);
try {
return retryStrategy.retry(unreliableImpl, retryTimes, sleepSeconds);
} catch (Exception e) {
ex = e;
try {
Thread.sleep(1000);
} catch (InterruptedException e1) {
LOGGER.info("pass");
}
}
}
throw new Exception("download failed.", ex);
} | [
"private",
"Object",
"retry4ConfDownload",
"(",
"RemoteUrl",
"remoteUrl",
",",
"File",
"localTmpFile",
",",
"int",
"retryTimes",
",",
"int",
"sleepSeconds",
")",
"throws",
"Exception",
"{",
"Exception",
"ex",
"=",
"null",
";",
"for",
"(",
"URL",
"url",
":",
... | Retry封装 RemoteUrl 支持多Server的下载
@param remoteUrl
@param localTmpFile
@param retryTimes
@param sleepSeconds
@return | [
"Retry封装",
"RemoteUrl",
"支持多Server的下载"
] | train | https://github.com/knightliao/disconf/blob/d413cbce9334fe38a5a24982ce4db3a6ed8e98ea/disconf-core/src/main/java/com/baidu/disconf/core/common/restful/impl/RestfulMgrImpl.java#L217-L240 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/xml/xpath/XPathUtils.java | XPathUtils.evaluateAsBoolean | public static Boolean evaluateAsBoolean(Node node, String xPathExpression, NamespaceContext nsContext) {
return (Boolean) evaluateExpression(node, xPathExpression, nsContext, XPathConstants.BOOLEAN);
} | java | public static Boolean evaluateAsBoolean(Node node, String xPathExpression, NamespaceContext nsContext) {
return (Boolean) evaluateExpression(node, xPathExpression, nsContext, XPathConstants.BOOLEAN);
} | [
"public",
"static",
"Boolean",
"evaluateAsBoolean",
"(",
"Node",
"node",
",",
"String",
"xPathExpression",
",",
"NamespaceContext",
"nsContext",
")",
"{",
"return",
"(",
"Boolean",
")",
"evaluateExpression",
"(",
"node",
",",
"xPathExpression",
",",
"nsContext",
"... | Evaluate XPath expression with result type Boolean value.
@param node
@param xPathExpression
@param nsContext
@return | [
"Evaluate",
"XPath",
"expression",
"with",
"result",
"type",
"Boolean",
"value",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/xml/xpath/XPathUtils.java#L234-L236 |
googleads/googleads-java-lib | modules/dfp_appengine/src/main/java/com/google/api/ads/admanager/jaxws/AdManagerJaxWsHeaderHandler.java | AdManagerJaxWsHeaderHandler.constructSoapHeader | private SOAPElement constructSoapHeader(
Map<String, Object> headerData, AdManagerServiceDescriptor adManagerServiceDescriptor) {
String requestHeaderNamespace =
adManagerApiConfiguration.getNamespacePrefix()
+ "/"
+ adManagerServiceDescriptor.getVersion();
try {
SOAPFactory soapFactory = SOAPFactory.newInstance();
SOAPElement requestHeader =
soapFactory.createElement(REQUEST_HEADER_LOCAL_PART, "ns1", requestHeaderNamespace);
for (String headerElementName : headerData.keySet()) {
if (headerData.get(headerElementName) != null) {
SOAPElement newElement =
requestHeader.addChildElement(headerElementName, "ns1", requestHeaderNamespace);
newElement.addTextNode(headerData.get(headerElementName).toString());
}
}
return requestHeader;
} catch (SOAPException e) {
throw new ServiceException("Unexpected exception.", e);
}
} | java | private SOAPElement constructSoapHeader(
Map<String, Object> headerData, AdManagerServiceDescriptor adManagerServiceDescriptor) {
String requestHeaderNamespace =
adManagerApiConfiguration.getNamespacePrefix()
+ "/"
+ adManagerServiceDescriptor.getVersion();
try {
SOAPFactory soapFactory = SOAPFactory.newInstance();
SOAPElement requestHeader =
soapFactory.createElement(REQUEST_HEADER_LOCAL_PART, "ns1", requestHeaderNamespace);
for (String headerElementName : headerData.keySet()) {
if (headerData.get(headerElementName) != null) {
SOAPElement newElement =
requestHeader.addChildElement(headerElementName, "ns1", requestHeaderNamespace);
newElement.addTextNode(headerData.get(headerElementName).toString());
}
}
return requestHeader;
} catch (SOAPException e) {
throw new ServiceException("Unexpected exception.", e);
}
} | [
"private",
"SOAPElement",
"constructSoapHeader",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"headerData",
",",
"AdManagerServiceDescriptor",
"adManagerServiceDescriptor",
")",
"{",
"String",
"requestHeaderNamespace",
"=",
"adManagerApiConfiguration",
".",
"getNamespaceP... | Constructs a SOAP header object ready to be attached to a JAX-WS client.
@param headerData a map of SOAP header element names to values
@param adManagerServiceDescriptor the descriptor of which service's headers are being created
@return a SOAP header object | [
"Constructs",
"a",
"SOAP",
"header",
"object",
"ready",
"to",
"be",
"attached",
"to",
"a",
"JAX",
"-",
"WS",
"client",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/dfp_appengine/src/main/java/com/google/api/ads/admanager/jaxws/AdManagerJaxWsHeaderHandler.java#L136-L158 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/CheckedExceptionsFactory.java | CheckedExceptionsFactory.newIOException | public static IOException newIOException(String message, Object... args) {
return newIOException(null, message, args);
} | java | public static IOException newIOException(String message, Object... args) {
return newIOException(null, message, args);
} | [
"public",
"static",
"IOException",
"newIOException",
"(",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"newIOException",
"(",
"null",
",",
"message",
",",
"args",
")",
";",
"}"
] | Constructs and initializes a new {@link IOException} with the given {@link String message}
formatted with the given {@link Object[] arguments}.
@param message {@link String} describing the {@link IOException exception}.
@param args {@link Object[] arguments} used to replace format placeholders in the {@link String message}.
@return a new {@link IOException} with the given {@link String message}.
@see #newIOException(Throwable, String, Object...)
@see java.io.IOException | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"IOException",
"}",
"with",
"the",
"given",
"{",
"@link",
"String",
"message",
"}",
"formatted",
"with",
"the",
"given",
"{",
"@link",
"Object",
"[]",
"arguments",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/CheckedExceptionsFactory.java#L75-L77 |
inkstand-io/scribble | scribble-http/src/main/java/io/inkstand/scribble/http/rules/HttpServerBuilder.java | HttpServerBuilder.contentFrom | public HttpServerBuilder contentFrom(final String contextRoot, final TemporaryFolder folder) {
resources.put(contextRoot, folder);
return this;
} | java | public HttpServerBuilder contentFrom(final String contextRoot, final TemporaryFolder folder) {
resources.put(contextRoot, folder);
return this;
} | [
"public",
"HttpServerBuilder",
"contentFrom",
"(",
"final",
"String",
"contextRoot",
",",
"final",
"TemporaryFolder",
"folder",
")",
"{",
"resources",
".",
"put",
"(",
"contextRoot",
",",
"folder",
")",
";",
"return",
"this",
";",
"}"
] | Defines a folder resource whose content fill be hosted
rule.
@param contextRoot
the root path to the content
@param folder
the rule that creates the temporary folder that should be hosted by the http server.
@return
this builder | [
"Defines",
"a",
"folder",
"resource",
"whose",
"content",
"fill",
"be",
"hosted",
"rule",
"."
] | train | https://github.com/inkstand-io/scribble/blob/66e67553bad4b1ff817e1715fd1d3dd833406744/scribble-http/src/main/java/io/inkstand/scribble/http/rules/HttpServerBuilder.java#L119-L122 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceRegionPersistenceImpl.java | CommerceRegionPersistenceImpl.countByC_C | @Override
public int countByC_C(long commerceCountryId, String code) {
FinderPath finderPath = FINDER_PATH_COUNT_BY_C_C;
Object[] finderArgs = new Object[] { commerceCountryId, code };
Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);
if (count == null) {
StringBundler query = new StringBundler(3);
query.append(_SQL_COUNT_COMMERCEREGION_WHERE);
query.append(_FINDER_COLUMN_C_C_COMMERCECOUNTRYID_2);
boolean bindCode = false;
if (code == null) {
query.append(_FINDER_COLUMN_C_C_CODE_1);
}
else if (code.equals("")) {
query.append(_FINDER_COLUMN_C_C_CODE_3);
}
else {
bindCode = true;
query.append(_FINDER_COLUMN_C_C_CODE_2);
}
String sql = query.toString();
Session session = null;
try {
session = openSession();
Query q = session.createQuery(sql);
QueryPos qPos = QueryPos.getInstance(q);
qPos.add(commerceCountryId);
if (bindCode) {
qPos.add(code);
}
count = (Long)q.uniqueResult();
finderCache.putResult(finderPath, finderArgs, count);
}
catch (Exception e) {
finderCache.removeResult(finderPath, finderArgs);
throw processException(e);
}
finally {
closeSession(session);
}
}
return count.intValue();
} | java | @Override
public int countByC_C(long commerceCountryId, String code) {
FinderPath finderPath = FINDER_PATH_COUNT_BY_C_C;
Object[] finderArgs = new Object[] { commerceCountryId, code };
Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);
if (count == null) {
StringBundler query = new StringBundler(3);
query.append(_SQL_COUNT_COMMERCEREGION_WHERE);
query.append(_FINDER_COLUMN_C_C_COMMERCECOUNTRYID_2);
boolean bindCode = false;
if (code == null) {
query.append(_FINDER_COLUMN_C_C_CODE_1);
}
else if (code.equals("")) {
query.append(_FINDER_COLUMN_C_C_CODE_3);
}
else {
bindCode = true;
query.append(_FINDER_COLUMN_C_C_CODE_2);
}
String sql = query.toString();
Session session = null;
try {
session = openSession();
Query q = session.createQuery(sql);
QueryPos qPos = QueryPos.getInstance(q);
qPos.add(commerceCountryId);
if (bindCode) {
qPos.add(code);
}
count = (Long)q.uniqueResult();
finderCache.putResult(finderPath, finderArgs, count);
}
catch (Exception e) {
finderCache.removeResult(finderPath, finderArgs);
throw processException(e);
}
finally {
closeSession(session);
}
}
return count.intValue();
} | [
"@",
"Override",
"public",
"int",
"countByC_C",
"(",
"long",
"commerceCountryId",
",",
"String",
"code",
")",
"{",
"FinderPath",
"finderPath",
"=",
"FINDER_PATH_COUNT_BY_C_C",
";",
"Object",
"[",
"]",
"finderArgs",
"=",
"new",
"Object",
"[",
"]",
"{",
"commerc... | Returns the number of commerce regions where commerceCountryId = ? and code = ?.
@param commerceCountryId the commerce country ID
@param code the code
@return the number of matching commerce regions | [
"Returns",
"the",
"number",
"of",
"commerce",
"regions",
"where",
"commerceCountryId",
"=",
"?",
";",
"and",
"code",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceRegionPersistenceImpl.java#L2184-L2245 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_abbreviatedNumber_abbreviatedNumber_PUT | public void billingAccount_abbreviatedNumber_abbreviatedNumber_PUT(String billingAccount, Long abbreviatedNumber, OvhAbbreviatedNumberGroup body) throws IOException {
String qPath = "/telephony/{billingAccount}/abbreviatedNumber/{abbreviatedNumber}";
StringBuilder sb = path(qPath, billingAccount, abbreviatedNumber);
exec(qPath, "PUT", sb.toString(), body);
} | java | public void billingAccount_abbreviatedNumber_abbreviatedNumber_PUT(String billingAccount, Long abbreviatedNumber, OvhAbbreviatedNumberGroup body) throws IOException {
String qPath = "/telephony/{billingAccount}/abbreviatedNumber/{abbreviatedNumber}";
StringBuilder sb = path(qPath, billingAccount, abbreviatedNumber);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"billingAccount_abbreviatedNumber_abbreviatedNumber_PUT",
"(",
"String",
"billingAccount",
",",
"Long",
"abbreviatedNumber",
",",
"OvhAbbreviatedNumberGroup",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/abb... | Alter this object properties
REST: PUT /telephony/{billingAccount}/abbreviatedNumber/{abbreviatedNumber}
@param body [required] New object properties
@param billingAccount [required] The name of your billingAccount
@param abbreviatedNumber [required] The abbreviated number which must start with "7" and must have a length of 3 or 4 digits | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L4560-L4564 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.getAt | @SuppressWarnings("unchecked")
public static List<Boolean> getAt(boolean[] array, Range range) {
return primitiveArrayGet(array, range);
} | java | @SuppressWarnings("unchecked")
public static List<Boolean> getAt(boolean[] array, Range range) {
return primitiveArrayGet(array, range);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"List",
"<",
"Boolean",
">",
"getAt",
"(",
"boolean",
"[",
"]",
"array",
",",
"Range",
"range",
")",
"{",
"return",
"primitiveArrayGet",
"(",
"array",
",",
"range",
")",
";",
"}"
] | Support the subscript operator with a range for a boolean array
@param array a boolean array
@param range a range indicating the indices for the items to retrieve
@return list of the retrieved booleans
@since 1.0 | [
"Support",
"the",
"subscript",
"operator",
"with",
"a",
"range",
"for",
"a",
"boolean",
"array"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L13701-L13704 |
airbnb/lottie-android | lottie/src/main/java/com/airbnb/lottie/LottieAnimationView.java | LottieAnimationView.addValueCallback | public <T> void addValueCallback(KeyPath keyPath, T property, LottieValueCallback<T> callback) {
lottieDrawable.addValueCallback(keyPath, property, callback);
} | java | public <T> void addValueCallback(KeyPath keyPath, T property, LottieValueCallback<T> callback) {
lottieDrawable.addValueCallback(keyPath, property, callback);
} | [
"public",
"<",
"T",
">",
"void",
"addValueCallback",
"(",
"KeyPath",
"keyPath",
",",
"T",
"property",
",",
"LottieValueCallback",
"<",
"T",
">",
"callback",
")",
"{",
"lottieDrawable",
".",
"addValueCallback",
"(",
"keyPath",
",",
"property",
",",
"callback",
... | Add a property callback for the specified {@link KeyPath}. This {@link KeyPath} can resolve
to multiple contents. In that case, the callback's value will apply to all of them.
Internally, this will check if the {@link KeyPath} has already been resolved with
{@link #resolveKeyPath(KeyPath)} and will resolve it if it hasn't. | [
"Add",
"a",
"property",
"callback",
"for",
"the",
"specified",
"{",
"@link",
"KeyPath",
"}",
".",
"This",
"{",
"@link",
"KeyPath",
"}",
"can",
"resolve",
"to",
"multiple",
"contents",
".",
"In",
"that",
"case",
"the",
"callback",
"s",
"value",
"will",
"a... | train | https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/LottieAnimationView.java#L714-L716 |
trellis-ldp/trellis | core/http/src/main/java/org/trellisldp/http/impl/PatchHandler.java | PatchHandler.updateResource | public CompletionStage<ResponseBuilder> updateResource(final ResponseBuilder builder) {
LOGGER.debug("Updating {} via PATCH", getIdentifier());
// Add the LDP link types
if (ACL.equals(getRequest().getExt())) {
getLinkTypes(LDP.RDFSource).forEach(type -> builder.link(type, "type"));
} else {
getLinkTypes(getResource().getInteractionModel()).forEach(type -> builder.link(type, "type"));
}
final TrellisDataset mutable = TrellisDataset.createDataset();
final TrellisDataset immutable = TrellisDataset.createDataset();
return assembleResponse(mutable, immutable, builder)
.whenComplete((a, b) -> mutable.close())
.whenComplete((a, b) -> immutable.close());
} | java | public CompletionStage<ResponseBuilder> updateResource(final ResponseBuilder builder) {
LOGGER.debug("Updating {} via PATCH", getIdentifier());
// Add the LDP link types
if (ACL.equals(getRequest().getExt())) {
getLinkTypes(LDP.RDFSource).forEach(type -> builder.link(type, "type"));
} else {
getLinkTypes(getResource().getInteractionModel()).forEach(type -> builder.link(type, "type"));
}
final TrellisDataset mutable = TrellisDataset.createDataset();
final TrellisDataset immutable = TrellisDataset.createDataset();
return assembleResponse(mutable, immutable, builder)
.whenComplete((a, b) -> mutable.close())
.whenComplete((a, b) -> immutable.close());
} | [
"public",
"CompletionStage",
"<",
"ResponseBuilder",
">",
"updateResource",
"(",
"final",
"ResponseBuilder",
"builder",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Updating {} via PATCH\"",
",",
"getIdentifier",
"(",
")",
")",
";",
"// Add the LDP link types",
"if",
"... | Update the resource in the persistence layer.
@param builder the Trellis response builder
@return a response builder promise | [
"Update",
"the",
"resource",
"in",
"the",
"persistence",
"layer",
"."
] | train | https://github.com/trellis-ldp/trellis/blob/789fd7a3df86cab7ebba63e72bf4e58397e5f42d/core/http/src/main/java/org/trellisldp/http/impl/PatchHandler.java#L154-L170 |
elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/projection/NearestNeighborAffinityMatrixBuilder.java | NearestNeighborAffinityMatrixBuilder.computeSigma | protected static double computeSigma(int i, DoubleArray pij_row, double perplexity, double log_perp, double[] pij_i) {
double max = pij_row.get((int) FastMath.ceil(perplexity)) / Math.E;
double beta = 1 / max; // beta = 1. / (2*sigma*sigma)
double diff = computeH(pij_row, pij_i, -beta) - log_perp;
double betaMin = 0.;
double betaMax = Double.POSITIVE_INFINITY;
for(int tries = 0; tries < PERPLEXITY_MAXITER && Math.abs(diff) > PERPLEXITY_ERROR; ++tries) {
if(diff > 0) {
betaMin = beta;
beta += (betaMax == Double.POSITIVE_INFINITY) ? beta : ((betaMax - beta) * .5);
}
else {
betaMax = beta;
beta -= (beta - betaMin) * .5;
}
diff = computeH(pij_row, pij_i, -beta) - log_perp;
}
return beta;
} | java | protected static double computeSigma(int i, DoubleArray pij_row, double perplexity, double log_perp, double[] pij_i) {
double max = pij_row.get((int) FastMath.ceil(perplexity)) / Math.E;
double beta = 1 / max; // beta = 1. / (2*sigma*sigma)
double diff = computeH(pij_row, pij_i, -beta) - log_perp;
double betaMin = 0.;
double betaMax = Double.POSITIVE_INFINITY;
for(int tries = 0; tries < PERPLEXITY_MAXITER && Math.abs(diff) > PERPLEXITY_ERROR; ++tries) {
if(diff > 0) {
betaMin = beta;
beta += (betaMax == Double.POSITIVE_INFINITY) ? beta : ((betaMax - beta) * .5);
}
else {
betaMax = beta;
beta -= (beta - betaMin) * .5;
}
diff = computeH(pij_row, pij_i, -beta) - log_perp;
}
return beta;
} | [
"protected",
"static",
"double",
"computeSigma",
"(",
"int",
"i",
",",
"DoubleArray",
"pij_row",
",",
"double",
"perplexity",
",",
"double",
"log_perp",
",",
"double",
"[",
"]",
"pij_i",
")",
"{",
"double",
"max",
"=",
"pij_row",
".",
"get",
"(",
"(",
"i... | Compute row pij[i], using binary search on the kernel bandwidth sigma to
obtain the desired perplexity.
@param i Current point
@param pij_row Distance matrix row pij[i]
@param perplexity Desired perplexity
@param log_perp Log of desired perplexity
@param pij_i Output row
@return beta | [
"Compute",
"row",
"pij",
"[",
"i",
"]",
"using",
"binary",
"search",
"on",
"the",
"kernel",
"bandwidth",
"sigma",
"to",
"obtain",
"the",
"desired",
"perplexity",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/projection/NearestNeighborAffinityMatrixBuilder.java#L230-L248 |
base2Services/kagura | shared/reporting-core/src/main/java/com/base2/kagura/core/report/configmodel/ReportConfig.java | ReportConfig.prepareParameters | public void prepareParameters(Map<String, Object> extra) {
if (paramConfig == null) return;
for (ParamConfig param : paramConfig)
{
param.prepareParameter(extra);
}
} | java | public void prepareParameters(Map<String, Object> extra) {
if (paramConfig == null) return;
for (ParamConfig param : paramConfig)
{
param.prepareParameter(extra);
}
} | [
"public",
"void",
"prepareParameters",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"extra",
")",
"{",
"if",
"(",
"paramConfig",
"==",
"null",
")",
"return",
";",
"for",
"(",
"ParamConfig",
"param",
":",
"paramConfig",
")",
"{",
"param",
".",
"prepareP... | Prepares the parameters for the report. This populates the Combo and ManyCombo box options if there is a groovy
or report backing the data.
@param extra Extra options from the middleware, this is passed down to the report or groovy execution. | [
"Prepares",
"the",
"parameters",
"for",
"the",
"report",
".",
"This",
"populates",
"the",
"Combo",
"and",
"ManyCombo",
"box",
"options",
"if",
"there",
"is",
"a",
"groovy",
"or",
"report",
"backing",
"the",
"data",
"."
] | train | https://github.com/base2Services/kagura/blob/5564aa71bfa2cb3baaae2eb098c6c673dd4e82ee/shared/reporting-core/src/main/java/com/base2/kagura/core/report/configmodel/ReportConfig.java#L143-L149 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_fax_serviceName_screenLists_PUT | public void billingAccount_fax_serviceName_screenLists_PUT(String billingAccount, String serviceName, OvhFaxScreen body) throws IOException {
String qPath = "/telephony/{billingAccount}/fax/{serviceName}/screenLists";
StringBuilder sb = path(qPath, billingAccount, serviceName);
exec(qPath, "PUT", sb.toString(), body);
} | java | public void billingAccount_fax_serviceName_screenLists_PUT(String billingAccount, String serviceName, OvhFaxScreen body) throws IOException {
String qPath = "/telephony/{billingAccount}/fax/{serviceName}/screenLists";
StringBuilder sb = path(qPath, billingAccount, serviceName);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"billingAccount_fax_serviceName_screenLists_PUT",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"OvhFaxScreen",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/fax/{serviceName}/screenList... | Alter this object properties
REST: PUT /telephony/{billingAccount}/fax/{serviceName}/screenLists
@param body [required] New object properties
@param billingAccount [required] The name of your billingAccount
@param serviceName [required] | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L4444-L4448 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java | Symbol.isMemberOf | public boolean isMemberOf(TypeSymbol clazz, Types types) {
return
owner == clazz ||
clazz.isSubClass(owner, types) &&
isInheritedIn(clazz, types) &&
!hiddenIn((ClassSymbol)clazz, types);
} | java | public boolean isMemberOf(TypeSymbol clazz, Types types) {
return
owner == clazz ||
clazz.isSubClass(owner, types) &&
isInheritedIn(clazz, types) &&
!hiddenIn((ClassSymbol)clazz, types);
} | [
"public",
"boolean",
"isMemberOf",
"(",
"TypeSymbol",
"clazz",
",",
"Types",
"types",
")",
"{",
"return",
"owner",
"==",
"clazz",
"||",
"clazz",
".",
"isSubClass",
"(",
"owner",
",",
"types",
")",
"&&",
"isInheritedIn",
"(",
"clazz",
",",
"types",
")",
"... | Fully check membership: hierarchy, protection, and hiding.
Does not exclude methods not inherited due to overriding. | [
"Fully",
"check",
"membership",
":",
"hierarchy",
"protection",
"and",
"hiding",
".",
"Does",
"not",
"exclude",
"methods",
"not",
"inherited",
"due",
"to",
"overriding",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Symbol.java#L514-L520 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/MapTileCollisionRendererModel.java | MapTileCollisionRendererModel.renderCollision | private static void renderCollision(Graphic g, CollisionFormula formula, int th, int x, int y)
{
final CollisionFunction function = formula.getFunction();
final CollisionRange range = formula.getRange();
switch (range.getOutput())
{
case X:
renderX(g, function, range, th, y);
break;
case Y:
renderY(g, function, range, th, x);
break;
default:
throw new LionEngineException(range.getOutput());
}
} | java | private static void renderCollision(Graphic g, CollisionFormula formula, int th, int x, int y)
{
final CollisionFunction function = formula.getFunction();
final CollisionRange range = formula.getRange();
switch (range.getOutput())
{
case X:
renderX(g, function, range, th, y);
break;
case Y:
renderY(g, function, range, th, x);
break;
default:
throw new LionEngineException(range.getOutput());
}
} | [
"private",
"static",
"void",
"renderCollision",
"(",
"Graphic",
"g",
",",
"CollisionFormula",
"formula",
",",
"int",
"th",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"final",
"CollisionFunction",
"function",
"=",
"formula",
".",
"getFunction",
"(",
")",
"... | Render collision from current vector.
@param g The graphic buffer.
@param formula The collision formula.
@param th The tile height.
@param x The current horizontal location.
@param y The current vertical location. | [
"Render",
"collision",
"from",
"current",
"vector",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/MapTileCollisionRendererModel.java#L88-L103 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java | TypeAnnotationPosition.classExtends | public static TypeAnnotationPosition
classExtends(final List<TypePathEntry> location,
final int type_index) {
return classExtends(location, null, type_index, -1);
} | java | public static TypeAnnotationPosition
classExtends(final List<TypePathEntry> location,
final int type_index) {
return classExtends(location, null, type_index, -1);
} | [
"public",
"static",
"TypeAnnotationPosition",
"classExtends",
"(",
"final",
"List",
"<",
"TypePathEntry",
">",
"location",
",",
"final",
"int",
"type_index",
")",
"{",
"return",
"classExtends",
"(",
"location",
",",
"null",
",",
"type_index",
",",
"-",
"1",
")... | Create a {@code TypeAnnotationPosition} for a class extension.
@param location The type path.
@param type_index The index of the interface. | [
"Create",
"a",
"{",
"@code",
"TypeAnnotationPosition",
"}",
"for",
"a",
"class",
"extension",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java#L801-L805 |
Azure/azure-sdk-for-java | privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/PrivateZonesInner.java | PrivateZonesInner.getByResourceGroup | public PrivateZoneInner getByResourceGroup(String resourceGroupName, String privateZoneName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, privateZoneName).toBlocking().single().body();
} | java | public PrivateZoneInner getByResourceGroup(String resourceGroupName, String privateZoneName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, privateZoneName).toBlocking().single().body();
} | [
"public",
"PrivateZoneInner",
"getByResourceGroup",
"(",
"String",
"resourceGroupName",
",",
"String",
"privateZoneName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"privateZoneName",
")",
".",
"toBlocking",
"(",
")",
... | Gets a Private DNS zone. Retrieves the zone properties, but not the virtual networks links or the record sets within the zone.
@param resourceGroupName The name of the resource group.
@param privateZoneName The name of the Private DNS zone (without a terminating dot).
@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 PrivateZoneInner object if successful. | [
"Gets",
"a",
"Private",
"DNS",
"zone",
".",
"Retrieves",
"the",
"zone",
"properties",
"but",
"not",
"the",
"virtual",
"networks",
"links",
"or",
"the",
"record",
"sets",
"within",
"the",
"zone",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/privatedns/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/privatedns/v2018_09_01/implementation/PrivateZonesInner.java#L1135-L1137 |
Impetus/Kundera | src/kundera-mongo/src/main/java/com/impetus/client/mongodb/MongoDBClient.java | MongoDBClient.findGFSEntity | private Object findGFSEntity(EntityMetadata entityMetadata, Class entityClass, Object key)
{
GridFSDBFile outputFile = findGridFSDBFile(entityMetadata, key);
return outputFile != null ? handler.getEntityFromGFSDBFile(entityMetadata.getEntityClazz(),
instantiateEntity(entityClass, null), entityMetadata, outputFile, kunderaMetadata) : null;
} | java | private Object findGFSEntity(EntityMetadata entityMetadata, Class entityClass, Object key)
{
GridFSDBFile outputFile = findGridFSDBFile(entityMetadata, key);
return outputFile != null ? handler.getEntityFromGFSDBFile(entityMetadata.getEntityClazz(),
instantiateEntity(entityClass, null), entityMetadata, outputFile, kunderaMetadata) : null;
} | [
"private",
"Object",
"findGFSEntity",
"(",
"EntityMetadata",
"entityMetadata",
",",
"Class",
"entityClass",
",",
"Object",
"key",
")",
"{",
"GridFSDBFile",
"outputFile",
"=",
"findGridFSDBFile",
"(",
"entityMetadata",
",",
"key",
")",
";",
"return",
"outputFile",
... | Find GFS entity.
@param entityMetadata
the entity metadata
@param entityClass
the entity class
@param key
the key
@return the object | [
"Find",
"GFS",
"entity",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-mongo/src/main/java/com/impetus/client/mongodb/MongoDBClient.java#L410-L415 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_timeCondition_serviceName_condition_POST | public OvhTimeCondition billingAccount_timeCondition_serviceName_condition_POST(String billingAccount, String serviceName, OvhTimeConditionsDayEnum day, String hourBegin, String hourEnd, OvhTimeConditionsPolicyEnum policy) throws IOException {
String qPath = "/telephony/{billingAccount}/timeCondition/{serviceName}/condition";
StringBuilder sb = path(qPath, billingAccount, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "day", day);
addBody(o, "hourBegin", hourBegin);
addBody(o, "hourEnd", hourEnd);
addBody(o, "policy", policy);
String resp = exec(qPath, "POST", sb.toString(), o);
return convertTo(resp, OvhTimeCondition.class);
} | java | public OvhTimeCondition billingAccount_timeCondition_serviceName_condition_POST(String billingAccount, String serviceName, OvhTimeConditionsDayEnum day, String hourBegin, String hourEnd, OvhTimeConditionsPolicyEnum policy) throws IOException {
String qPath = "/telephony/{billingAccount}/timeCondition/{serviceName}/condition";
StringBuilder sb = path(qPath, billingAccount, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "day", day);
addBody(o, "hourBegin", hourBegin);
addBody(o, "hourEnd", hourEnd);
addBody(o, "policy", policy);
String resp = exec(qPath, "POST", sb.toString(), o);
return convertTo(resp, OvhTimeCondition.class);
} | [
"public",
"OvhTimeCondition",
"billingAccount_timeCondition_serviceName_condition_POST",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"OvhTimeConditionsDayEnum",
"day",
",",
"String",
"hourBegin",
",",
"String",
"hourEnd",
",",
"OvhTimeConditionsPolicyEnu... | Create a new time condition rule
REST: POST /telephony/{billingAccount}/timeCondition/{serviceName}/condition
@param day [required] The day of the time condition
@param policy [required] The policy
@param hourBegin [required] The hour where the time condition begins (format : hhmm)
@param hourEnd [required] The hour where the time condition ends (format : hhmm)
@param billingAccount [required] The name of your billingAccount
@param serviceName [required] | [
"Create",
"a",
"new",
"time",
"condition",
"rule"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L5805-L5815 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/Utility.java | Utility.appendToRule | public static void appendToRule(StringBuffer rule,
String text,
boolean isLiteral,
boolean escapeUnprintable,
StringBuffer quoteBuf) {
for (int i=0; i<text.length(); ++i) {
// Okay to process in 16-bit code units here
appendToRule(rule, text.charAt(i), isLiteral, escapeUnprintable, quoteBuf);
}
} | java | public static void appendToRule(StringBuffer rule,
String text,
boolean isLiteral,
boolean escapeUnprintable,
StringBuffer quoteBuf) {
for (int i=0; i<text.length(); ++i) {
// Okay to process in 16-bit code units here
appendToRule(rule, text.charAt(i), isLiteral, escapeUnprintable, quoteBuf);
}
} | [
"public",
"static",
"void",
"appendToRule",
"(",
"StringBuffer",
"rule",
",",
"String",
"text",
",",
"boolean",
"isLiteral",
",",
"boolean",
"escapeUnprintable",
",",
"StringBuffer",
"quoteBuf",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"t... | Append the given string to the rule. Calls the single-character
version of appendToRule for each character. | [
"Append",
"the",
"given",
"string",
"to",
"the",
"rule",
".",
"Calls",
"the",
"single",
"-",
"character",
"version",
"of",
"appendToRule",
"for",
"each",
"character",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/Utility.java#L1655-L1664 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java | PlanNode.isNotOneOf | public boolean isNotOneOf( Type first,
Type... rest ) {
return isNotOneOf(EnumSet.of(first, rest));
} | java | public boolean isNotOneOf( Type first,
Type... rest ) {
return isNotOneOf(EnumSet.of(first, rest));
} | [
"public",
"boolean",
"isNotOneOf",
"(",
"Type",
"first",
",",
"Type",
"...",
"rest",
")",
"{",
"return",
"isNotOneOf",
"(",
"EnumSet",
".",
"of",
"(",
"first",
",",
"rest",
")",
")",
";",
"}"
] | Return true if this node's type does not match any of the supplied types
@param first the type to compare
@param rest the additional types to compare
@return true if this node's type is different than all of those supplied, or false if matches one of the supplied types | [
"Return",
"true",
"if",
"this",
"node",
"s",
"type",
"does",
"not",
"match",
"any",
"of",
"the",
"supplied",
"types"
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/plan/PlanNode.java#L343-L346 |
diffplug/durian | src/com/diffplug/common/base/FieldsAndGetters.java | FieldsAndGetters.dumpIf | public static void dumpIf(String name, Object obj, Predicate<String> evalPredicate, Predicate<Map.Entry<String, Object>> dumpPredicate, StringPrinter printer) {
printer.println(name + ": " + obj.getClass().getName());
fieldsAndGetters(obj, evalPredicate).filter(dumpPredicate).forEach(entry -> {
printer.println("\t" + entry.getKey() + " = " + entry.getValue());
});
} | java | public static void dumpIf(String name, Object obj, Predicate<String> evalPredicate, Predicate<Map.Entry<String, Object>> dumpPredicate, StringPrinter printer) {
printer.println(name + ": " + obj.getClass().getName());
fieldsAndGetters(obj, evalPredicate).filter(dumpPredicate).forEach(entry -> {
printer.println("\t" + entry.getKey() + " = " + entry.getValue());
});
} | [
"public",
"static",
"void",
"dumpIf",
"(",
"String",
"name",
",",
"Object",
"obj",
",",
"Predicate",
"<",
"String",
">",
"evalPredicate",
",",
"Predicate",
"<",
"Map",
".",
"Entry",
"<",
"String",
",",
"Object",
">",
">",
"dumpPredicate",
",",
"StringPrint... | Passes each field and getter of {@code obj} to {@code evalPredicate}, grabs its value if it passes, and if the value passes {@code dumpPredicate} then it is dumped to {@code printer}.
@see #fieldsAndGetters(Object, Predicate) | [
"Passes",
"each",
"field",
"and",
"getter",
"of",
"{"
] | train | https://github.com/diffplug/durian/blob/10631a3480e5491eb6eb6ee06e752d8596914232/src/com/diffplug/common/base/FieldsAndGetters.java#L158-L163 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/appservice/v2016_03_01/implementation/ResourceHealthMetadatasInner.java | ResourceHealthMetadatasInner.getBySite | public ResourceHealthMetadataInner getBySite(String resourceGroupName, String name) {
return getBySiteWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().body();
} | java | public ResourceHealthMetadataInner getBySite(String resourceGroupName, String name) {
return getBySiteWithServiceResponseAsync(resourceGroupName, name).toBlocking().single().body();
} | [
"public",
"ResourceHealthMetadataInner",
"getBySite",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
")",
"{",
"return",
"getBySiteWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"name",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
")"... | Gets the category of ResourceHealthMetadata to use for the given site.
Gets the category of ResourceHealthMetadata to use for the given site.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of web app
@throws IllegalArgumentException thrown if parameters fail the validation
@throws DefaultErrorResponseException thrown if the request is rejected by server
@throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
@return the ResourceHealthMetadataInner object if successful. | [
"Gets",
"the",
"category",
"of",
"ResourceHealthMetadata",
"to",
"use",
"for",
"the",
"given",
"site",
".",
"Gets",
"the",
"category",
"of",
"ResourceHealthMetadata",
"to",
"use",
"for",
"the",
"given",
"site",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/appservice/v2016_03_01/implementation/ResourceHealthMetadatasInner.java#L474-L476 |
joniles/mpxj | src/main/java/net/sf/mpxj/planner/PlannerReader.java | PlannerReader.getDateTime | private Date getDateTime(String value) throws MPXJException
{
try
{
Number year = m_fourDigitFormat.parse(value.substring(0, 4));
Number month = m_twoDigitFormat.parse(value.substring(4, 6));
Number day = m_twoDigitFormat.parse(value.substring(6, 8));
Number hours = m_twoDigitFormat.parse(value.substring(9, 11));
Number minutes = m_twoDigitFormat.parse(value.substring(11, 13));
Calendar cal = DateHelper.popCalendar();
cal.set(Calendar.YEAR, year.intValue());
cal.set(Calendar.MONTH, month.intValue() - 1);
cal.set(Calendar.DAY_OF_MONTH, day.intValue());
cal.set(Calendar.HOUR_OF_DAY, hours.intValue());
cal.set(Calendar.MINUTE, minutes.intValue());
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
Date result = cal.getTime();
DateHelper.pushCalendar(cal);
return result;
}
catch (ParseException ex)
{
throw new MPXJException("Failed to parse date-time " + value, ex);
}
} | java | private Date getDateTime(String value) throws MPXJException
{
try
{
Number year = m_fourDigitFormat.parse(value.substring(0, 4));
Number month = m_twoDigitFormat.parse(value.substring(4, 6));
Number day = m_twoDigitFormat.parse(value.substring(6, 8));
Number hours = m_twoDigitFormat.parse(value.substring(9, 11));
Number minutes = m_twoDigitFormat.parse(value.substring(11, 13));
Calendar cal = DateHelper.popCalendar();
cal.set(Calendar.YEAR, year.intValue());
cal.set(Calendar.MONTH, month.intValue() - 1);
cal.set(Calendar.DAY_OF_MONTH, day.intValue());
cal.set(Calendar.HOUR_OF_DAY, hours.intValue());
cal.set(Calendar.MINUTE, minutes.intValue());
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
Date result = cal.getTime();
DateHelper.pushCalendar(cal);
return result;
}
catch (ParseException ex)
{
throw new MPXJException("Failed to parse date-time " + value, ex);
}
} | [
"private",
"Date",
"getDateTime",
"(",
"String",
"value",
")",
"throws",
"MPXJException",
"{",
"try",
"{",
"Number",
"year",
"=",
"m_fourDigitFormat",
".",
"parse",
"(",
"value",
".",
"substring",
"(",
"0",
",",
"4",
")",
")",
";",
"Number",
"month",
"="... | Convert a Planner date-time value into a Java date.
20070222T080000Z
@param value Planner date-time
@return Java Date instance | [
"Convert",
"a",
"Planner",
"date",
"-",
"time",
"value",
"into",
"a",
"Java",
"date",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/planner/PlannerReader.java#L791-L822 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/partition/impl/PartitionEventManager.java | PartitionEventManager.sendMigrationEvent | void sendMigrationEvent(final MigrationInfo migrationInfo, final MigrationEvent.MigrationStatus status) {
if (migrationInfo.getSourceCurrentReplicaIndex() != 0
&& migrationInfo.getDestinationNewReplicaIndex() != 0) {
// only fire events for 0th replica migrations
return;
}
ClusterServiceImpl clusterService = node.getClusterService();
MemberImpl current = clusterService.getMember(migrationInfo.getSourceAddress());
MemberImpl newOwner = clusterService.getMember(migrationInfo.getDestinationAddress());
MigrationEvent event = new MigrationEvent(migrationInfo.getPartitionId(), current, newOwner, status);
EventService eventService = nodeEngine.getEventService();
Collection<EventRegistration> registrations = eventService.getRegistrations(SERVICE_NAME, MIGRATION_EVENT_TOPIC);
eventService.publishEvent(SERVICE_NAME, registrations, event, event.getPartitionId());
} | java | void sendMigrationEvent(final MigrationInfo migrationInfo, final MigrationEvent.MigrationStatus status) {
if (migrationInfo.getSourceCurrentReplicaIndex() != 0
&& migrationInfo.getDestinationNewReplicaIndex() != 0) {
// only fire events for 0th replica migrations
return;
}
ClusterServiceImpl clusterService = node.getClusterService();
MemberImpl current = clusterService.getMember(migrationInfo.getSourceAddress());
MemberImpl newOwner = clusterService.getMember(migrationInfo.getDestinationAddress());
MigrationEvent event = new MigrationEvent(migrationInfo.getPartitionId(), current, newOwner, status);
EventService eventService = nodeEngine.getEventService();
Collection<EventRegistration> registrations = eventService.getRegistrations(SERVICE_NAME, MIGRATION_EVENT_TOPIC);
eventService.publishEvent(SERVICE_NAME, registrations, event, event.getPartitionId());
} | [
"void",
"sendMigrationEvent",
"(",
"final",
"MigrationInfo",
"migrationInfo",
",",
"final",
"MigrationEvent",
".",
"MigrationStatus",
"status",
")",
"{",
"if",
"(",
"migrationInfo",
".",
"getSourceCurrentReplicaIndex",
"(",
")",
"!=",
"0",
"&&",
"migrationInfo",
"."... | Sends a {@link MigrationEvent} to the registered event listeners. | [
"Sends",
"a",
"{"
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/partition/impl/PartitionEventManager.java#L55-L69 |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/doc/Documents.java | Documents.db5Sim | public static void db5Sim(File file, Class comp, CSProperties params, String title) throws FileNotFoundException {
db5Sim(file, comp, params, title, Locale.getDefault());
} | java | public static void db5Sim(File file, Class comp, CSProperties params, String title) throws FileNotFoundException {
db5Sim(file, comp, params, title, Locale.getDefault());
} | [
"public",
"static",
"void",
"db5Sim",
"(",
"File",
"file",
",",
"Class",
"comp",
",",
"CSProperties",
"params",
",",
"String",
"title",
")",
"throws",
"FileNotFoundException",
"{",
"db5Sim",
"(",
"file",
",",
"comp",
",",
"params",
",",
"title",
",",
"Loca... | Document
@param file the xml outputfile.
@param comp the component to document
@param params the model parameter
@param title the title
@throws FileNotFoundException | [
"Document"
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/doc/Documents.java#L46-L48 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/AccountsApi.java | AccountsApi.deleteCustomField | public void deleteCustomField(String accountId, String customFieldId, AccountsApi.DeleteCustomFieldOptions options) throws ApiException {
Object localVarPostBody = "{}";
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException(400, "Missing the required parameter 'accountId' when calling deleteCustomField");
}
// verify the required parameter 'customFieldId' is set
if (customFieldId == null) {
throw new ApiException(400, "Missing the required parameter 'customFieldId' when calling deleteCustomField");
}
// create path and map variables
String localVarPath = "/v2/accounts/{accountId}/custom_fields/{customFieldId}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "accountId" + "\\}", apiClient.escapeString(accountId.toString()))
.replaceAll("\\{" + "customFieldId" + "\\}", apiClient.escapeString(customFieldId.toString()));
// query params
java.util.List<Pair> localVarQueryParams = new java.util.ArrayList<Pair>();
java.util.Map<String, String> localVarHeaderParams = new java.util.HashMap<String, String>();
java.util.Map<String, Object> localVarFormParams = new java.util.HashMap<String, Object>();
if (options != null) {
localVarQueryParams.addAll(apiClient.parameterToPairs("", "apply_to_templates", options.applyToTemplates));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "docusignAccessCode" }; //{ };
apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
} | java | public void deleteCustomField(String accountId, String customFieldId, AccountsApi.DeleteCustomFieldOptions options) throws ApiException {
Object localVarPostBody = "{}";
// verify the required parameter 'accountId' is set
if (accountId == null) {
throw new ApiException(400, "Missing the required parameter 'accountId' when calling deleteCustomField");
}
// verify the required parameter 'customFieldId' is set
if (customFieldId == null) {
throw new ApiException(400, "Missing the required parameter 'customFieldId' when calling deleteCustomField");
}
// create path and map variables
String localVarPath = "/v2/accounts/{accountId}/custom_fields/{customFieldId}".replaceAll("\\{format\\}","json")
.replaceAll("\\{" + "accountId" + "\\}", apiClient.escapeString(accountId.toString()))
.replaceAll("\\{" + "customFieldId" + "\\}", apiClient.escapeString(customFieldId.toString()));
// query params
java.util.List<Pair> localVarQueryParams = new java.util.ArrayList<Pair>();
java.util.Map<String, String> localVarHeaderParams = new java.util.HashMap<String, String>();
java.util.Map<String, Object> localVarFormParams = new java.util.HashMap<String, Object>();
if (options != null) {
localVarQueryParams.addAll(apiClient.parameterToPairs("", "apply_to_templates", options.applyToTemplates));
}
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "docusignAccessCode" }; //{ };
apiClient.invokeAPI(localVarPath, "DELETE", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, null);
} | [
"public",
"void",
"deleteCustomField",
"(",
"String",
"accountId",
",",
"String",
"customFieldId",
",",
"AccountsApi",
".",
"DeleteCustomFieldOptions",
"options",
")",
"throws",
"ApiException",
"{",
"Object",
"localVarPostBody",
"=",
"\"{}\"",
";",
"// verify the requir... | Delete an existing account custom field.
@param accountId The external account number (int) or account ID Guid. (required)
@param customFieldId (required)
@param options for modifying the method behavior.
@throws ApiException if fails to make API call | [
"Delete",
"an",
"existing",
"account",
"custom",
"field",
"."
] | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/AccountsApi.java#L603-L645 |
stephanenicolas/robospice | robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/SpiceManager.java | SpiceManager.removeDataFromCache | public <T> Future<?> removeDataFromCache(final Class<T> clazz) {
if (clazz == null) {
throw new IllegalArgumentException("Clazz must be non null.");
}
return executeCommand(new RemoveDataClassFromCacheCommand(this, clazz));
} | java | public <T> Future<?> removeDataFromCache(final Class<T> clazz) {
if (clazz == null) {
throw new IllegalArgumentException("Clazz must be non null.");
}
return executeCommand(new RemoveDataClassFromCacheCommand(this, clazz));
} | [
"public",
"<",
"T",
">",
"Future",
"<",
"?",
">",
"removeDataFromCache",
"(",
"final",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"if",
"(",
"clazz",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Clazz must be non null.\"",
")... | Remove some specific content from cache
@param clazz
the type of data you want to remove from cache. | [
"Remove",
"some",
"specific",
"content",
"from",
"cache"
] | train | https://github.com/stephanenicolas/robospice/blob/8bffde88b3534a961a13cab72a8f07a755f0a0fe/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/SpiceManager.java#L989-L994 |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/builder/FindBugsWorker.java | FindBugsWorker.updateBugCollection | private void updateBugCollection(Project findBugsProject, Reporter bugReporter, boolean incremental) {
SortedBugCollection newBugCollection = bugReporter.getBugCollection();
try {
st.newPoint("getBugCollection");
SortedBugCollection oldBugCollection = FindbugsPlugin.getBugCollection(project, monitor);
st.newPoint("mergeBugCollections");
SortedBugCollection resultCollection = mergeBugCollections(oldBugCollection, newBugCollection, incremental);
resultCollection.getProject().setGuiCallback(new EclipseGuiCallback(project));
resultCollection.setTimestamp(System.currentTimeMillis());
// will store bugs in the default FB file + Eclipse project session
// props
st.newPoint("storeBugCollection");
FindbugsPlugin.storeBugCollection(project, resultCollection, monitor);
} catch (IOException e) {
FindbugsPlugin.getDefault().logException(e, "Error performing SpotBugs results update");
} catch (CoreException e) {
FindbugsPlugin.getDefault().logException(e, "Error performing SpotBugs results update");
}
// will store bugs as markers in Eclipse workspace
st.newPoint("createMarkers");
MarkerUtil.createMarkers(javaProject, newBugCollection, resource, monitor);
} | java | private void updateBugCollection(Project findBugsProject, Reporter bugReporter, boolean incremental) {
SortedBugCollection newBugCollection = bugReporter.getBugCollection();
try {
st.newPoint("getBugCollection");
SortedBugCollection oldBugCollection = FindbugsPlugin.getBugCollection(project, monitor);
st.newPoint("mergeBugCollections");
SortedBugCollection resultCollection = mergeBugCollections(oldBugCollection, newBugCollection, incremental);
resultCollection.getProject().setGuiCallback(new EclipseGuiCallback(project));
resultCollection.setTimestamp(System.currentTimeMillis());
// will store bugs in the default FB file + Eclipse project session
// props
st.newPoint("storeBugCollection");
FindbugsPlugin.storeBugCollection(project, resultCollection, monitor);
} catch (IOException e) {
FindbugsPlugin.getDefault().logException(e, "Error performing SpotBugs results update");
} catch (CoreException e) {
FindbugsPlugin.getDefault().logException(e, "Error performing SpotBugs results update");
}
// will store bugs as markers in Eclipse workspace
st.newPoint("createMarkers");
MarkerUtil.createMarkers(javaProject, newBugCollection, resource, monitor);
} | [
"private",
"void",
"updateBugCollection",
"(",
"Project",
"findBugsProject",
",",
"Reporter",
"bugReporter",
",",
"boolean",
"incremental",
")",
"{",
"SortedBugCollection",
"newBugCollection",
"=",
"bugReporter",
".",
"getBugCollection",
"(",
")",
";",
"try",
"{",
"... | Update the BugCollection for the project.
@param findBugsProject
FindBugs project representing analyzed classes
@param bugReporter
Reporter used to collect the new warnings | [
"Update",
"the",
"BugCollection",
"for",
"the",
"project",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/builder/FindBugsWorker.java#L334-L358 |
google/closure-compiler | src/com/google/debugging/sourcemap/SourceMapConsumerV3.java | SourceMapConsumerV3.compareEntry | private static int compareEntry(ArrayList<Entry> entries, int entry, int target) {
return entries.get(entry).getGeneratedColumn() - target;
} | java | private static int compareEntry(ArrayList<Entry> entries, int entry, int target) {
return entries.get(entry).getGeneratedColumn() - target;
} | [
"private",
"static",
"int",
"compareEntry",
"(",
"ArrayList",
"<",
"Entry",
">",
"entries",
",",
"int",
"entry",
",",
"int",
"target",
")",
"{",
"return",
"entries",
".",
"get",
"(",
"entry",
")",
".",
"getGeneratedColumn",
"(",
")",
"-",
"target",
";",
... | Compare an array entry's column value to the target column value. | [
"Compare",
"an",
"array",
"entry",
"s",
"column",
"value",
"to",
"the",
"target",
"column",
"value",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/debugging/sourcemap/SourceMapConsumerV3.java#L421-L423 |
citrusframework/citrus | modules/citrus-arquillian/src/main/java/com/consol/citrus/arquillian/configuration/CitrusConfiguration.java | CitrusConfiguration.getProperty | private static String getProperty(Properties extensionProperties, String propertyName) {
if (extensionProperties.containsKey(propertyName)) {
Object value = extensionProperties.get(propertyName);
if (value != null) {
return value.toString();
}
}
return null;
} | java | private static String getProperty(Properties extensionProperties, String propertyName) {
if (extensionProperties.containsKey(propertyName)) {
Object value = extensionProperties.get(propertyName);
if (value != null) {
return value.toString();
}
}
return null;
} | [
"private",
"static",
"String",
"getProperty",
"(",
"Properties",
"extensionProperties",
",",
"String",
"propertyName",
")",
"{",
"if",
"(",
"extensionProperties",
".",
"containsKey",
"(",
"propertyName",
")",
")",
"{",
"Object",
"value",
"=",
"extensionProperties",
... | Try to read property from property set. When not set or null value return null else
return String representation of value object.
@param extensionProperties
@param propertyName
@return | [
"Try",
"to",
"read",
"property",
"from",
"property",
"set",
".",
"When",
"not",
"set",
"or",
"null",
"value",
"return",
"null",
"else",
"return",
"String",
"representation",
"of",
"value",
"object",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-arquillian/src/main/java/com/consol/citrus/arquillian/configuration/CitrusConfiguration.java#L114-L123 |
sangupta/jerry-services | src/main/java/com/sangupta/jerry/quartz/service/impl/DefaultQuartzServiceImpl.java | DefaultQuartzServiceImpl.pauseQuartzJob | public boolean pauseQuartzJob(String jobName, String jobGroupName) {
try {
this.scheduler.pauseJob(new JobKey(jobName, jobGroupName));
return true;
} catch (SchedulerException e) {
logger.error("error pausing job: " + jobName + " in group: " + jobGroupName, e);
}
return false;
} | java | public boolean pauseQuartzJob(String jobName, String jobGroupName) {
try {
this.scheduler.pauseJob(new JobKey(jobName, jobGroupName));
return true;
} catch (SchedulerException e) {
logger.error("error pausing job: " + jobName + " in group: " + jobGroupName, e);
}
return false;
} | [
"public",
"boolean",
"pauseQuartzJob",
"(",
"String",
"jobName",
",",
"String",
"jobGroupName",
")",
"{",
"try",
"{",
"this",
".",
"scheduler",
".",
"pauseJob",
"(",
"new",
"JobKey",
"(",
"jobName",
",",
"jobGroupName",
")",
")",
";",
"return",
"true",
";"... | Pause the job with given name in given group
@param jobName
the job name
@param jobGroupName
the job group name
@return <code>true</code> if job was paused, <code>false</code> otherwise
@see QuartzService#pauseQuartzJob(String, String) | [
"Pause",
"the",
"job",
"with",
"given",
"name",
"in",
"given",
"group"
] | train | https://github.com/sangupta/jerry-services/blob/25ff6577445850916425c72068d654c08eba9bcc/src/main/java/com/sangupta/jerry/quartz/service/impl/DefaultQuartzServiceImpl.java#L129-L137 |
cdapio/tephra | tephra-core/src/main/java/co/cask/tephra/TransactionManager.java | TransactionManager.createTransaction | private Transaction createTransaction(long writePointer, TransactionType type) {
// For holding the first in progress short transaction Id (with timeout >= 0).
long firstShortTx = Transaction.NO_TX_IN_PROGRESS;
LongArrayList inProgressIds = new LongArrayList(inProgress.size());
for (Map.Entry<Long, InProgressTx> entry : inProgress.entrySet()) {
long txId = entry.getKey();
inProgressIds.add(txId);
// add any checkpointed write pointers to the in-progress list
LongArrayList childIds = entry.getValue().getCheckpointWritePointers();
if (childIds != null) {
for (int i = 0; i < childIds.size(); i++) {
inProgressIds.add(childIds.get(i));
}
}
if (firstShortTx == Transaction.NO_TX_IN_PROGRESS && !entry.getValue().isLongRunning()) {
firstShortTx = txId;
}
}
return new Transaction(readPointer, writePointer, invalidArray, inProgressIds.toLongArray(), firstShortTx, type);
} | java | private Transaction createTransaction(long writePointer, TransactionType type) {
// For holding the first in progress short transaction Id (with timeout >= 0).
long firstShortTx = Transaction.NO_TX_IN_PROGRESS;
LongArrayList inProgressIds = new LongArrayList(inProgress.size());
for (Map.Entry<Long, InProgressTx> entry : inProgress.entrySet()) {
long txId = entry.getKey();
inProgressIds.add(txId);
// add any checkpointed write pointers to the in-progress list
LongArrayList childIds = entry.getValue().getCheckpointWritePointers();
if (childIds != null) {
for (int i = 0; i < childIds.size(); i++) {
inProgressIds.add(childIds.get(i));
}
}
if (firstShortTx == Transaction.NO_TX_IN_PROGRESS && !entry.getValue().isLongRunning()) {
firstShortTx = txId;
}
}
return new Transaction(readPointer, writePointer, invalidArray, inProgressIds.toLongArray(), firstShortTx, type);
} | [
"private",
"Transaction",
"createTransaction",
"(",
"long",
"writePointer",
",",
"TransactionType",
"type",
")",
"{",
"// For holding the first in progress short transaction Id (with timeout >= 0).",
"long",
"firstShortTx",
"=",
"Transaction",
".",
"NO_TX_IN_PROGRESS",
";",
"Lo... | Creates a new Transaction. This method only get called from start transaction, which is already
synchronized. | [
"Creates",
"a",
"new",
"Transaction",
".",
"This",
"method",
"only",
"get",
"called",
"from",
"start",
"transaction",
"which",
"is",
"already",
"synchronized",
"."
] | train | https://github.com/cdapio/tephra/blob/082c56c15c6ece15002631ff6f89206a00d8915c/tephra-core/src/main/java/co/cask/tephra/TransactionManager.java#L1210-L1230 |
biojava/biojava | biojava-aa-prop/src/main/java/org/biojava/nbio/aaproperties/Utils.java | Utils.getNumberOfInvalidChar | public final static int getNumberOfInvalidChar(String sequence, Set<Character> cSet, boolean ignoreCase){
int total = 0;
char[] cArray;
if(ignoreCase) cArray = sequence.toUpperCase().toCharArray();
else cArray = sequence.toCharArray();
if(cSet == null) cSet = PeptideProperties.standardAASet;
for(char c:cArray){
if(!cSet.contains(c)) total++;
}
return total;
} | java | public final static int getNumberOfInvalidChar(String sequence, Set<Character> cSet, boolean ignoreCase){
int total = 0;
char[] cArray;
if(ignoreCase) cArray = sequence.toUpperCase().toCharArray();
else cArray = sequence.toCharArray();
if(cSet == null) cSet = PeptideProperties.standardAASet;
for(char c:cArray){
if(!cSet.contains(c)) total++;
}
return total;
} | [
"public",
"final",
"static",
"int",
"getNumberOfInvalidChar",
"(",
"String",
"sequence",
",",
"Set",
"<",
"Character",
">",
"cSet",
",",
"boolean",
"ignoreCase",
")",
"{",
"int",
"total",
"=",
"0",
";",
"char",
"[",
"]",
"cArray",
";",
"if",
"(",
"ignore... | Return the number of invalid characters in sequence.
@param sequence
protein sequence to count for invalid characters.
@param cSet
the set of characters that are deemed valid.
@param ignoreCase
indicates if cases should be ignored
@return
the number of invalid characters in sequence. | [
"Return",
"the",
"number",
"of",
"invalid",
"characters",
"in",
"sequence",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-aa-prop/src/main/java/org/biojava/nbio/aaproperties/Utils.java#L89-L99 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/config/Config.java | Config.setAtomicReferenceConfigs | public Config setAtomicReferenceConfigs(Map<String, AtomicReferenceConfig> atomicReferenceConfigs) {
this.atomicReferenceConfigs.clear();
this.atomicReferenceConfigs.putAll(atomicReferenceConfigs);
for (Entry<String, AtomicReferenceConfig> entry : atomicReferenceConfigs.entrySet()) {
entry.getValue().setName(entry.getKey());
}
return this;
} | java | public Config setAtomicReferenceConfigs(Map<String, AtomicReferenceConfig> atomicReferenceConfigs) {
this.atomicReferenceConfigs.clear();
this.atomicReferenceConfigs.putAll(atomicReferenceConfigs);
for (Entry<String, AtomicReferenceConfig> entry : atomicReferenceConfigs.entrySet()) {
entry.getValue().setName(entry.getKey());
}
return this;
} | [
"public",
"Config",
"setAtomicReferenceConfigs",
"(",
"Map",
"<",
"String",
",",
"AtomicReferenceConfig",
">",
"atomicReferenceConfigs",
")",
"{",
"this",
".",
"atomicReferenceConfigs",
".",
"clear",
"(",
")",
";",
"this",
".",
"atomicReferenceConfigs",
".",
"putAll... | Sets the map of AtomicReference configurations, mapped by config name.
The config name may be a pattern with which the configuration will be obtained in the future.
@param atomicReferenceConfigs the AtomicReference configuration map to set
@return this config instance | [
"Sets",
"the",
"map",
"of",
"AtomicReference",
"configurations",
"mapped",
"by",
"config",
"name",
".",
"The",
"config",
"name",
"may",
"be",
"a",
"pattern",
"with",
"which",
"the",
"configuration",
"will",
"be",
"obtained",
"in",
"the",
"future",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/config/Config.java#L1484-L1491 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/collidable/ComponentCollision.java | ComponentCollision.checkPoint | private void checkPoint(Collidable objectA, Map<Point, Set<Collidable>> acceptedElements, Point point)
{
final Set<Collidable> others = acceptedElements.get(point);
for (final Collidable objectB : others)
{
if (objectA != objectB)
{
final List<Collision> collisions = objectA.collide(objectB);
for (final Collision collision : collisions)
{
toNotify.add(new Collided(objectA, objectB, collision));
}
}
}
} | java | private void checkPoint(Collidable objectA, Map<Point, Set<Collidable>> acceptedElements, Point point)
{
final Set<Collidable> others = acceptedElements.get(point);
for (final Collidable objectB : others)
{
if (objectA != objectB)
{
final List<Collision> collisions = objectA.collide(objectB);
for (final Collision collision : collisions)
{
toNotify.add(new Collided(objectA, objectB, collision));
}
}
}
} | [
"private",
"void",
"checkPoint",
"(",
"Collidable",
"objectA",
",",
"Map",
"<",
"Point",
",",
"Set",
"<",
"Collidable",
">",
">",
"acceptedElements",
",",
"Point",
"point",
")",
"{",
"final",
"Set",
"<",
"Collidable",
">",
"others",
"=",
"acceptedElements",
... | Check others element at specified point.
@param objectA The collidable reference.
@param acceptedElements The current elements to check.
@param point The point to check. | [
"Check",
"others",
"element",
"at",
"specified",
"point",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/collidable/ComponentCollision.java#L200-L214 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.