repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
threerings/nenya | core/src/main/java/com/threerings/miso/util/MisoUtil.java | MisoUtil.getMultiTilePolygon | public static Polygon getMultiTilePolygon (MisoSceneMetrics metrics,
Point sp1, Point sp2) {
"""
Return a screen-coordinates polygon framing the two specified
tile-coordinate points.
"""
int x = Math.min(sp1.x, sp2.x), y = Math.min(sp1.y, sp2.y);
... | java | public static Polygon getMultiTilePolygon (MisoSceneMetrics metrics,
Point sp1, Point sp2)
{
int x = Math.min(sp1.x, sp2.x), y = Math.min(sp1.y, sp2.y);
int width = Math.abs(sp1.x-sp2.x)+1, height = Math.abs(sp1.y-sp2.y)+1;
return getFootprintPo... | [
"public",
"static",
"Polygon",
"getMultiTilePolygon",
"(",
"MisoSceneMetrics",
"metrics",
",",
"Point",
"sp1",
",",
"Point",
"sp2",
")",
"{",
"int",
"x",
"=",
"Math",
".",
"min",
"(",
"sp1",
".",
"x",
",",
"sp2",
".",
"x",
")",
",",
"y",
"=",
"Math",... | Return a screen-coordinates polygon framing the two specified
tile-coordinate points. | [
"Return",
"a",
"screen",
"-",
"coordinates",
"polygon",
"framing",
"the",
"two",
"specified",
"tile",
"-",
"coordinate",
"points",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/miso/util/MisoUtil.java#L417-L423 |
jbundle/jbundle | base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/HBaseGridScreen.java | HBaseGridScreen.printStartRecordGridData | public void printStartRecordGridData(PrintWriter out, int iPrintOptions) {
"""
Display the start grid in input format.
@return true if default params were found for this form.
@param out The http output stream.
@exception DBException File exception.
"""
if ((iPrintOptions & HtmlConstants.DETAIL_SCRE... | java | public void printStartRecordGridData(PrintWriter out, int iPrintOptions)
{
if ((iPrintOptions & HtmlConstants.DETAIL_SCREEN) == HtmlConstants.DETAIL_SCREEN)
{
out.println("<tr>\n<td colspan=\"20\">");
}
out.println("<table border=\"1\">");
} | [
"public",
"void",
"printStartRecordGridData",
"(",
"PrintWriter",
"out",
",",
"int",
"iPrintOptions",
")",
"{",
"if",
"(",
"(",
"iPrintOptions",
"&",
"HtmlConstants",
".",
"DETAIL_SCREEN",
")",
"==",
"HtmlConstants",
".",
"DETAIL_SCREEN",
")",
"{",
"out",
".",
... | Display the start grid in input format.
@return true if default params were found for this form.
@param out The http output stream.
@exception DBException File exception. | [
"Display",
"the",
"start",
"grid",
"in",
"input",
"format",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/HBaseGridScreen.java#L161-L168 |
eFaps/eFaps-Kernel | src/main/java/org/efaps/update/version/Application.java | Application.getApplicationFromJarFile | public static Application getApplicationFromJarFile(final File _jarFile,
final List<String> _classpath)
throws InstallationException {
"""
Returns the application read from given JAR file <code>_jarFile</code>.
@param _jarFile JAR file with the app... | java | public static Application getApplicationFromJarFile(final File _jarFile,
final List<String> _classpath)
throws InstallationException
{
try {
final URL url = new URL("jar", null, 0, _jarFile.toURI().toURL().toString() + "!/");
... | [
"public",
"static",
"Application",
"getApplicationFromJarFile",
"(",
"final",
"File",
"_jarFile",
",",
"final",
"List",
"<",
"String",
">",
"_classpath",
")",
"throws",
"InstallationException",
"{",
"try",
"{",
"final",
"URL",
"url",
"=",
"new",
"URL",
"(",
"\... | Returns the application read from given JAR file <code>_jarFile</code>.
@param _jarFile JAR file with the application to install
@param _classpath class path (required to compile)
@return application instance
@throws InstallationException if application could not be fetched from
the JAR file or the version XML file co... | [
"Returns",
"the",
"application",
"read",
"from",
"given",
"JAR",
"file",
"<code",
">",
"_jarFile<",
"/",
"code",
">",
"."
] | train | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/update/version/Application.java#L421-L432 |
Bandwidth/java-bandwidth | src/main/java/com/bandwidth/sdk/model/Call.java | Call.get | public static Call get(final String callId) throws Exception {
"""
Factory method for Call, returns information about an active or completed call.
@param callId call id
@return the call
@throws IOException unexpected error.
"""
final BandwidthClient client = BandwidthClient.getInstance();
... | java | public static Call get(final String callId) throws Exception {
final BandwidthClient client = BandwidthClient.getInstance();
return get(client, callId);
} | [
"public",
"static",
"Call",
"get",
"(",
"final",
"String",
"callId",
")",
"throws",
"Exception",
"{",
"final",
"BandwidthClient",
"client",
"=",
"BandwidthClient",
".",
"getInstance",
"(",
")",
";",
"return",
"get",
"(",
"client",
",",
"callId",
")",
";",
... | Factory method for Call, returns information about an active or completed call.
@param callId call id
@return the call
@throws IOException unexpected error. | [
"Factory",
"method",
"for",
"Call",
"returns",
"information",
"about",
"an",
"active",
"or",
"completed",
"call",
"."
] | train | https://github.com/Bandwidth/java-bandwidth/blob/2124c85148ad6a54d2f2949cb952eb3985830e2a/src/main/java/com/bandwidth/sdk/model/Call.java#L30-L35 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/system/SystemProperties.java | SystemProperties.setPropertyValue | @Nonnull
public static EChange setPropertyValue (@Nonnull final String sKey, final int nValue) {
"""
Set a system property value under consideration of an eventually present
{@link SecurityManager}.
@param sKey
The key of the system property. May not be <code>null</code>.
@param nValue
The value of the sy... | java | @Nonnull
public static EChange setPropertyValue (@Nonnull final String sKey, final int nValue)
{
return setPropertyValue (sKey, Integer.toString (nValue));
} | [
"@",
"Nonnull",
"public",
"static",
"EChange",
"setPropertyValue",
"(",
"@",
"Nonnull",
"final",
"String",
"sKey",
",",
"final",
"int",
"nValue",
")",
"{",
"return",
"setPropertyValue",
"(",
"sKey",
",",
"Integer",
".",
"toString",
"(",
"nValue",
")",
")",
... | Set a system property value under consideration of an eventually present
{@link SecurityManager}.
@param sKey
The key of the system property. May not be <code>null</code>.
@param nValue
The value of the system property.
@since 8.5.7
@return {@link EChange} | [
"Set",
"a",
"system",
"property",
"value",
"under",
"consideration",
"of",
"an",
"eventually",
"present",
"{",
"@link",
"SecurityManager",
"}",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/system/SystemProperties.java#L162-L166 |
logic-ng/LogicNG | src/main/java/org/logicng/collections/LNGVector.java | LNGVector.selectionSort | private void selectionSort(final T[] array, int start, int end, Comparator<T> lt) {
"""
Selection sort implementation for a given array.
@param array the array
@param start the start index for sorting
@param end the end index for sorting
@param lt the comparator for elements of the array
"""
int i... | java | private void selectionSort(final T[] array, int start, int end, Comparator<T> lt) {
int i;
int j;
int bestI;
T tmp;
for (i = start; i < end; i++) {
bestI = i;
for (j = i + 1; j < end; j++) {
if (lt.compare(array[j], array[bestI]) < 0)
bestI = j;
}
tmp = arra... | [
"private",
"void",
"selectionSort",
"(",
"final",
"T",
"[",
"]",
"array",
",",
"int",
"start",
",",
"int",
"end",
",",
"Comparator",
"<",
"T",
">",
"lt",
")",
"{",
"int",
"i",
";",
"int",
"j",
";",
"int",
"bestI",
";",
"T",
"tmp",
";",
"for",
"... | Selection sort implementation for a given array.
@param array the array
@param start the start index for sorting
@param end the end index for sorting
@param lt the comparator for elements of the array | [
"Selection",
"sort",
"implementation",
"for",
"a",
"given",
"array",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/collections/LNGVector.java#L288-L303 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/util/WebConfigParamUtils.java | WebConfigParamUtils.getLongInitParameter | public static long getLongInitParameter(ExternalContext context, String name, long defaultValue) {
"""
Gets the long init parameter value from the specified context. If the parameter was not specified, the default
value is used instead.
@param context
the application's external context
@param name
the init ... | java | public static long getLongInitParameter(ExternalContext context, String name, long defaultValue)
{
if (name == null)
{
throw new NullPointerException();
}
String param = getStringInitParameter(context, name);
if (param == null)
{
return defaul... | [
"public",
"static",
"long",
"getLongInitParameter",
"(",
"ExternalContext",
"context",
",",
"String",
"name",
",",
"long",
"defaultValue",
")",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"}",
"Strin... | Gets the long init parameter value from the specified context. If the parameter was not specified, the default
value is used instead.
@param context
the application's external context
@param name
the init parameter's name
@param deprecatedName
the init parameter's deprecated name.
@param defaultValue
the default value... | [
"Gets",
"the",
"long",
"init",
"parameter",
"value",
"from",
"the",
"specified",
"context",
".",
"If",
"the",
"parameter",
"was",
"not",
"specified",
"the",
"default",
"value",
"is",
"used",
"instead",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/util/WebConfigParamUtils.java#L583-L599 |
arquillian/arquillian-cube | core/src/main/java/org/arquillian/cube/impl/util/ConfigUtil.java | ConfigUtil.getStringProperty | public static String getStringProperty(String name, String alternativeName, Map<String, String> map,
String defaultValue) {
"""
Gets a property from system, environment or an external map. This method supports also passing an alternative
name.
The reason for supporting multiple names, is to support multi... | java | public static String getStringProperty(String name, String alternativeName, Map<String, String> map,
String defaultValue) {
return getStringProperty(name, map, getStringProperty(alternativeName, map, defaultValue));
} | [
"public",
"static",
"String",
"getStringProperty",
"(",
"String",
"name",
",",
"String",
"alternativeName",
",",
"Map",
"<",
"String",
",",
"String",
">",
"map",
",",
"String",
"defaultValue",
")",
"{",
"return",
"getStringProperty",
"(",
"name",
",",
"map",
... | Gets a property from system, environment or an external map. This method supports also passing an alternative
name.
The reason for supporting multiple names, is to support multiple keys for the same property (e.g. adding a new and
deprecating the old).
The lookup order is system[name] > env[name] > map[name] > system[a... | [
"Gets",
"a",
"property",
"from",
"system",
"environment",
"or",
"an",
"external",
"map",
".",
"This",
"method",
"supports",
"also",
"passing",
"an",
"alternative",
"name",
".",
"The",
"reason",
"for",
"supporting",
"multiple",
"names",
"is",
"to",
"support",
... | train | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/core/src/main/java/org/arquillian/cube/impl/util/ConfigUtil.java#L49-L52 |
lessthanoptimal/BoofCV | main/boofcv-types/src/main/java/boofcv/concurrency/BoofConcurrency.java | BoofConcurrency.loopBlocks | public static void loopBlocks(int start , int endExclusive , IntRangeConsumer consumer ) {
"""
Splits the range of values up into blocks. It's assumed the cost to process a block is small so
more can be created.
@param start First index, inclusive
@param endExclusive Last index, exclusive
@param consumer The c... | java | public static void loopBlocks(int start , int endExclusive , IntRangeConsumer consumer ) {
final ForkJoinPool pool = BoofConcurrency.pool;
int numThreads = pool.getParallelism();
int range = endExclusive-start;
if( range == 0 ) // nothing to do here!
return;
if( range < 0 )
throw new IllegalArgumentExc... | [
"public",
"static",
"void",
"loopBlocks",
"(",
"int",
"start",
",",
"int",
"endExclusive",
",",
"IntRangeConsumer",
"consumer",
")",
"{",
"final",
"ForkJoinPool",
"pool",
"=",
"BoofConcurrency",
".",
"pool",
";",
"int",
"numThreads",
"=",
"pool",
".",
"getPara... | Splits the range of values up into blocks. It's assumed the cost to process a block is small so
more can be created.
@param start First index, inclusive
@param endExclusive Last index, exclusive
@param consumer The consumer | [
"Splits",
"the",
"range",
"of",
"values",
"up",
"into",
"blocks",
".",
"It",
"s",
"assumed",
"the",
"cost",
"to",
"process",
"a",
"block",
"is",
"small",
"so",
"more",
"can",
"be",
"created",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-types/src/main/java/boofcv/concurrency/BoofConcurrency.java#L136-L155 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/GroupApi.java | GroupApi.addMember | public Member addMember(Object groupIdOrPath, Integer userId, Integer accessLevel, Date expiresAt) throws GitLabApiException {
"""
Adds a user to the list of group members.
<pre><code>GitLab Endpoint: POST /groups/:id/members</code></pre>
@param groupIdOrPath the group ID, path of the group, or a Group insta... | java | public Member addMember(Object groupIdOrPath, Integer userId, Integer accessLevel, Date expiresAt) throws GitLabApiException {
GitLabApiForm formData = new GitLabApiForm()
.withParam("user_id", userId, true)
.withParam("access_level", accessLevel, true)
.withPara... | [
"public",
"Member",
"addMember",
"(",
"Object",
"groupIdOrPath",
",",
"Integer",
"userId",
",",
"Integer",
"accessLevel",
",",
"Date",
"expiresAt",
")",
"throws",
"GitLabApiException",
"{",
"GitLabApiForm",
"formData",
"=",
"new",
"GitLabApiForm",
"(",
")",
".",
... | Adds a user to the list of group members.
<pre><code>GitLab Endpoint: POST /groups/:id/members</code></pre>
@param groupIdOrPath the group ID, path of the group, or a Group instance holding the group ID or path, required
@param userId the user ID of the member to add, required
@param accessLevel the access level for ... | [
"Adds",
"a",
"user",
"to",
"the",
"list",
"of",
"group",
"members",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GroupApi.java#L811-L819 |
lucee/Lucee | core/src/main/java/lucee/runtime/converter/JSONConverter.java | JSONConverter._serializeDateTime | private void _serializeDateTime(DateTime dateTime, StringBuilder sb) {
"""
serialize a DateTime
@param dateTime DateTime to serialize
@param sb
@throws ConverterException
"""
sb.append(StringUtil.escapeJS(JSONDateFormat.format(dateTime, null), '"', charsetEncoder));
/*
* try { sb.append(goIn()); sb.... | java | private void _serializeDateTime(DateTime dateTime, StringBuilder sb) {
sb.append(StringUtil.escapeJS(JSONDateFormat.format(dateTime, null), '"', charsetEncoder));
/*
* try { sb.append(goIn()); sb.append("createDateTime(");
* sb.append(DateFormat.call(null,dateTime,"yyyy,m,d")); sb.append(' ');
* sb.append(Tim... | [
"private",
"void",
"_serializeDateTime",
"(",
"DateTime",
"dateTime",
",",
"StringBuilder",
"sb",
")",
"{",
"sb",
".",
"append",
"(",
"StringUtil",
".",
"escapeJS",
"(",
"JSONDateFormat",
".",
"format",
"(",
"dateTime",
",",
"null",
")",
",",
"'",
"'",
","... | serialize a DateTime
@param dateTime DateTime to serialize
@param sb
@throws ConverterException | [
"serialize",
"a",
"DateTime"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/converter/JSONConverter.java#L179-L190 |
spring-projects/spring-data-solr | src/main/java/org/springframework/data/solr/core/query/StatsOptions.java | StatsOptions.addField | public FieldStatsOptions addField(Field field) {
"""
Adds a field to the statistics to be requested.
@param field
@return
"""
Assert.notNull(field, "Field for statistics must not be 'null'.");
state.fields.add(field);
return new FieldStatsOptions(field, state);
} | java | public FieldStatsOptions addField(Field field) {
Assert.notNull(field, "Field for statistics must not be 'null'.");
state.fields.add(field);
return new FieldStatsOptions(field, state);
} | [
"public",
"FieldStatsOptions",
"addField",
"(",
"Field",
"field",
")",
"{",
"Assert",
".",
"notNull",
"(",
"field",
",",
"\"Field for statistics must not be 'null'.\"",
")",
";",
"state",
".",
"fields",
".",
"add",
"(",
"field",
")",
";",
"return",
"new",
"Fie... | Adds a field to the statistics to be requested.
@param field
@return | [
"Adds",
"a",
"field",
"to",
"the",
"statistics",
"to",
"be",
"requested",
"."
] | train | https://github.com/spring-projects/spring-data-solr/blob/20be5cb82498b70134dfda6c1a91ad21f8e657e0/src/main/java/org/springframework/data/solr/core/query/StatsOptions.java#L53-L59 |
wildfly-extras/wildfly-camel | subsystem/core/src/main/java/org/wildfly/extension/camel/service/CamelEndpointDeployerService.java | CamelEndpointDeployerService.deploy | public void deploy(URI uri, EndpointHttpHandler endpointHttpHandler) {
"""
Exposes an HTTP endpoint defined by the given {@link EndpointHttpHandler} under the given {@link URI}'s path.
@param uri determines the path and protocol under which the HTTP endpoint should be exposed
@param endpointHttpHandler an {@li... | java | public void deploy(URI uri, EndpointHttpHandler endpointHttpHandler) {
doDeploy(
uri,
servletInstance -> servletInstance.setEndpointHttpHandler(endpointHttpHandler), // plug the endpointHttpHandler into the servlet
deploymentInfo -> {}, // no need to customize the... | [
"public",
"void",
"deploy",
"(",
"URI",
"uri",
",",
"EndpointHttpHandler",
"endpointHttpHandler",
")",
"{",
"doDeploy",
"(",
"uri",
",",
"servletInstance",
"->",
"servletInstance",
".",
"setEndpointHttpHandler",
"(",
"endpointHttpHandler",
")",
",",
"// plug the endpo... | Exposes an HTTP endpoint defined by the given {@link EndpointHttpHandler} under the given {@link URI}'s path.
@param uri determines the path and protocol under which the HTTP endpoint should be exposed
@param endpointHttpHandler an {@link EndpointHttpHandler} to use for handling HTTP requests sent to the given
{@link ... | [
"Exposes",
"an",
"HTTP",
"endpoint",
"defined",
"by",
"the",
"given",
"{",
"@link",
"EndpointHttpHandler",
"}",
"under",
"the",
"given",
"{",
"@link",
"URI",
"}",
"s",
"path",
"."
] | train | https://github.com/wildfly-extras/wildfly-camel/blob/9ebd7e28574f277a6d5b583e8a4c357e1538c370/subsystem/core/src/main/java/org/wildfly/extension/camel/service/CamelEndpointDeployerService.java#L424-L431 |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/nosql/mongo/MongoDS.java | MongoDS.createCredentail | private MongoCredential createCredentail(String userName, String database, String password) {
"""
创建{@link MongoCredential},用于服务端验证
@param userName 用户名
@param database 数据库名
@param password 密码
@return {@link MongoCredential}
@since 4.1.20
"""
if (StrUtil.hasEmpty(userName, database, database)) {
r... | java | private MongoCredential createCredentail(String userName, String database, String password) {
if (StrUtil.hasEmpty(userName, database, database)) {
return null;
}
return MongoCredential.createCredential(userName, database, password.toCharArray());
} | [
"private",
"MongoCredential",
"createCredentail",
"(",
"String",
"userName",
",",
"String",
"database",
",",
"String",
"password",
")",
"{",
"if",
"(",
"StrUtil",
".",
"hasEmpty",
"(",
"userName",
",",
"database",
",",
"database",
")",
")",
"{",
"return",
"n... | 创建{@link MongoCredential},用于服务端验证
@param userName 用户名
@param database 数据库名
@param password 密码
@return {@link MongoCredential}
@since 4.1.20 | [
"创建",
"{",
"@link",
"MongoCredential",
"}",
",用于服务端验证"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/nosql/mongo/MongoDS.java#L315-L320 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailpro/src/main/java/net/minidev/ovh/api/ApiOvhEmailpro.java | ApiOvhEmailpro.service_PUT | public void service_PUT(String service, OvhService body) throws IOException {
"""
Alter this object properties
REST: PUT /email/pro/{service}
@param body [required] New object properties
@param service [required] The internal name of your pro organization
API beta
"""
String qPath = "/email/pro/{serv... | java | public void service_PUT(String service, OvhService body) throws IOException {
String qPath = "/email/pro/{service}";
StringBuilder sb = path(qPath, service);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"service_PUT",
"(",
"String",
"service",
",",
"OvhService",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/pro/{service}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"service",
")",
";",
"exec"... | Alter this object properties
REST: PUT /email/pro/{service}
@param body [required] New object properties
@param service [required] The internal name of your pro organization
API beta | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailpro/src/main/java/net/minidev/ovh/api/ApiOvhEmailpro.java#L222-L226 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/users/ExtensionUserManagement.java | ExtensionUserManagement.addSharedContextUser | public void addSharedContextUser(Context sharedContext, User user) {
"""
Add a new user shown in the UI (for the Users context panel) that corresponds
to a particular shared Context.
@param sharedContext the shared context
@param user the user
"""
this.getContextPanel(sharedContext.getIndex()).getUsersT... | java | public void addSharedContextUser(Context sharedContext, User user) {
this.getContextPanel(sharedContext.getIndex()).getUsersTableModel().addUser(user);
} | [
"public",
"void",
"addSharedContextUser",
"(",
"Context",
"sharedContext",
",",
"User",
"user",
")",
"{",
"this",
".",
"getContextPanel",
"(",
"sharedContext",
".",
"getIndex",
"(",
")",
")",
".",
"getUsersTableModel",
"(",
")",
".",
"addUser",
"(",
"user",
... | Add a new user shown in the UI (for the Users context panel) that corresponds
to a particular shared Context.
@param sharedContext the shared context
@param user the user | [
"Add",
"a",
"new",
"user",
"shown",
"in",
"the",
"UI",
"(",
"for",
"the",
"Users",
"context",
"panel",
")",
"that",
"corresponds",
"to",
"a",
"particular",
"shared",
"Context",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/users/ExtensionUserManagement.java#L296-L298 |
cdapio/tigon | tigon-api/src/main/java/co/cask/tigon/internal/specification/PropertyFieldExtractor.java | PropertyFieldExtractor.getStringValue | private String getStringValue(Object instance, Field field) throws IllegalAccessException {
"""
Gets the value of the field in the given instance as String.
Currently only allows primitive types, boxed types, String and Enum.
"""
Class<?> fieldType = field.getType();
// Only support primitive type, b... | java | private String getStringValue(Object instance, Field field) throws IllegalAccessException {
Class<?> fieldType = field.getType();
// Only support primitive type, boxed type, String and Enum
Preconditions.checkArgument(
fieldType.isPrimitive() || Primitives.isWrapperType(fieldType) ||
String.c... | [
"private",
"String",
"getStringValue",
"(",
"Object",
"instance",
",",
"Field",
"field",
")",
"throws",
"IllegalAccessException",
"{",
"Class",
"<",
"?",
">",
"fieldType",
"=",
"field",
".",
"getType",
"(",
")",
";",
"// Only support primitive type, boxed type, Stri... | Gets the value of the field in the given instance as String.
Currently only allows primitive types, boxed types, String and Enum. | [
"Gets",
"the",
"value",
"of",
"the",
"field",
"in",
"the",
"given",
"instance",
"as",
"String",
".",
"Currently",
"only",
"allows",
"primitive",
"types",
"boxed",
"types",
"String",
"and",
"Enum",
"."
] | train | https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-api/src/main/java/co/cask/tigon/internal/specification/PropertyFieldExtractor.java#L64-L85 |
nicoulaj/commons-dbcp-jmx | jdbc4/src/main/java/org/apache/commons/dbcp/ManagedBasicDataSourceFactory.java | ManagedBasicDataSourceFactory.getProperties | private static Properties getProperties(String propText) throws Exception {
"""
Parse properties from the string. Format of the string must be [propertyName=property;]*
@param propText
@return Properties
@throws Exception
"""
Properties p = new Properties();
if (propText != null) {
... | java | private static Properties getProperties(String propText) throws Exception {
Properties p = new Properties();
if (propText != null) {
p.load(new ByteArrayInputStream(propText.replace(';', '\n').getBytes()));
}
return p;
} | [
"private",
"static",
"Properties",
"getProperties",
"(",
"String",
"propText",
")",
"throws",
"Exception",
"{",
"Properties",
"p",
"=",
"new",
"Properties",
"(",
")",
";",
"if",
"(",
"propText",
"!=",
"null",
")",
"{",
"p",
".",
"load",
"(",
"new",
"Byte... | Parse properties from the string. Format of the string must be [propertyName=property;]*
@param propText
@return Properties
@throws Exception | [
"Parse",
"properties",
"from",
"the",
"string",
".",
"Format",
"of",
"the",
"string",
"must",
"be",
"[",
"propertyName",
"=",
"property",
";",
"]",
"*"
] | train | https://github.com/nicoulaj/commons-dbcp-jmx/blob/be8716526698da2f6dac817c95343b539ac5e3d9/jdbc4/src/main/java/org/apache/commons/dbcp/ManagedBasicDataSourceFactory.java#L469-L475 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/SeaGlassStyle.java | SeaGlassStyle.getPainter | private SeaGlassPainter getPainter(TreeMap<String, Object> defaults, String key) {
"""
Determine the painter given the defaults and a key.
@param defaults the defaults.
@param key the key.
@return the painter, if any can be found, {@code null} otherwise.
"""
Object p = defaults.get(key);
... | java | private SeaGlassPainter getPainter(TreeMap<String, Object> defaults, String key) {
Object p = defaults.get(key);
if (p instanceof UIDefaults.LazyValue) {
p = ((UIDefaults.LazyValue) p).createValue(UIManager.getDefaults());
}
return (p instanceof SeaGlassPainter ? (SeaGlassP... | [
"private",
"SeaGlassPainter",
"getPainter",
"(",
"TreeMap",
"<",
"String",
",",
"Object",
">",
"defaults",
",",
"String",
"key",
")",
"{",
"Object",
"p",
"=",
"defaults",
".",
"get",
"(",
"key",
")",
";",
"if",
"(",
"p",
"instanceof",
"UIDefaults",
".",
... | Determine the painter given the defaults and a key.
@param defaults the defaults.
@param key the key.
@return the painter, if any can be found, {@code null} otherwise. | [
"Determine",
"the",
"painter",
"given",
"the",
"defaults",
"and",
"a",
"key",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/SeaGlassStyle.java#L755-L763 |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/app/DialogFragmentUtils.java | DialogFragmentUtils.dismissOnLoaderCallback | @TargetApi(Build.VERSION_CODES.HONEYCOMB)
public static void dismissOnLoaderCallback(final android.app.FragmentManager manager, final String tag) {
"""
Dismiss {@link android.app.DialogFragment} for the tag on the loader callbacks.
@param manager the manager.
@param tag the tag string that is related to the ... | java | @TargetApi(Build.VERSION_CODES.HONEYCOMB)
public static void dismissOnLoaderCallback(final android.app.FragmentManager manager, final String tag) {
dismissOnLoaderCallback(HandlerUtils.getMainHandler(), manager, tag);
} | [
"@",
"TargetApi",
"(",
"Build",
".",
"VERSION_CODES",
".",
"HONEYCOMB",
")",
"public",
"static",
"void",
"dismissOnLoaderCallback",
"(",
"final",
"android",
".",
"app",
".",
"FragmentManager",
"manager",
",",
"final",
"String",
"tag",
")",
"{",
"dismissOnLoaderC... | Dismiss {@link android.app.DialogFragment} for the tag on the loader callbacks.
@param manager the manager.
@param tag the tag string that is related to the {@link android.app.DialogFragment}. | [
"Dismiss",
"{"
] | train | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/app/DialogFragmentUtils.java#L64-L67 |
beihaifeiwu/dolphin | dolphin-common/src/main/java/com/freetmp/common/util/BridgeMethodResolver.java | BridgeMethodResolver.searchForMatch | private static Method searchForMatch(Class<?> type, Method bridgeMethod) {
"""
If the supplied {@link Class} has a declared {@link Method} whose signature matches
that of the supplied {@link Method}, then this matching {@link Method} is returned,
otherwise {@code null} is returned.
"""
return ReflectionUti... | java | private static Method searchForMatch(Class<?> type, Method bridgeMethod) {
return ReflectionUtils.findMethod(type, bridgeMethod.getName(), bridgeMethod.getParameterTypes());
} | [
"private",
"static",
"Method",
"searchForMatch",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"Method",
"bridgeMethod",
")",
"{",
"return",
"ReflectionUtils",
".",
"findMethod",
"(",
"type",
",",
"bridgeMethod",
".",
"getName",
"(",
")",
",",
"bridgeMethod",
".... | If the supplied {@link Class} has a declared {@link Method} whose signature matches
that of the supplied {@link Method}, then this matching {@link Method} is returned,
otherwise {@code null} is returned. | [
"If",
"the",
"supplied",
"{"
] | train | https://github.com/beihaifeiwu/dolphin/blob/b100579cc6986dce5eba5593ebb5fbae7bad9d1a/dolphin-common/src/main/java/com/freetmp/common/util/BridgeMethodResolver.java#L198-L200 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/GitLabApiForm.java | GitLabApiForm.withParam | public GitLabApiForm withParam(String name, Map<String, ?> variables, boolean required) throws IllegalArgumentException {
"""
Fluent method for adding an array of hash type query and form parameters to a get() or post() call.
@param name the name of the field/attribute to add
@param variables a Map containing ... | java | public GitLabApiForm withParam(String name, Map<String, ?> variables, boolean required) throws IllegalArgumentException {
if (variables == null || variables.isEmpty()) {
if (required) {
throw new IllegalArgumentException(name + " cannot be empty or null");
}
... | [
"public",
"GitLabApiForm",
"withParam",
"(",
"String",
"name",
",",
"Map",
"<",
"String",
",",
"?",
">",
"variables",
",",
"boolean",
"required",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"variables",
"==",
"null",
"||",
"variables",
".",
"i... | Fluent method for adding an array of hash type query and form parameters to a get() or post() call.
@param name the name of the field/attribute to add
@param variables a Map containing array of hashes
@param required the field is required flag
@return this GitLabAPiForm instance
@throws IllegalArgumentException if a r... | [
"Fluent",
"method",
"for",
"adding",
"an",
"array",
"of",
"hash",
"type",
"query",
"and",
"form",
"parameters",
"to",
"a",
"get",
"()",
"or",
"post",
"()",
"call",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/GitLabApiForm.java#L148-L167 |
davidmarquis/fluent-interface-proxy | src/main/java/com/fluentinterface/beans/reflect/Property.java | Property.findAccessorField | private static Field findAccessorField(Class<?> type, String name, Class<?> requiredType) {
"""
Internal: Gets a {@link Field} with any valid modifier, evaluating its hierarchy.
@param type the class from where to search, cannot be null
@param name the name of the field to search, cannot be nul... | java | private static Field findAccessorField(Class<?> type, String name, Class<?> requiredType) {
Class<?> current = type;
while (current != null) {
for (Field field : current.getDeclaredFields()) {
if (field.getName().equals(name)
&& field.getType().equals... | [
"private",
"static",
"Field",
"findAccessorField",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"String",
"name",
",",
"Class",
"<",
"?",
">",
"requiredType",
")",
"{",
"Class",
"<",
"?",
">",
"current",
"=",
"type",
";",
"while",
"(",
"current",
"!=",
... | Internal: Gets a {@link Field} with any valid modifier, evaluating its hierarchy.
@param type the class from where to search, cannot be null
@param name the name of the field to search, cannot be null
@param requiredType the required type to match, cannot be null
@return the field, if found, else {@cod... | [
"Internal",
":",
"Gets",
"a",
"{",
"@link",
"Field",
"}",
"with",
"any",
"valid",
"modifier",
"evaluating",
"its",
"hierarchy",
"."
] | train | https://github.com/davidmarquis/fluent-interface-proxy/blob/8e72fff6cd1f496c76a01773269caead994fea65/src/main/java/com/fluentinterface/beans/reflect/Property.java#L488-L506 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/AttributeDefinition.java | AttributeDefinition.getAttributeDeprecatedDescription | public String getAttributeDeprecatedDescription(final ResourceBundle bundle, final String prefix) {
"""
Gets localized deprecation text from the given {@link java.util.ResourceBundle} for the attribute.
@param bundle the resource bundle. Cannot be {@code null}
@param prefix a prefix to dot-prepend to the attri... | java | public String getAttributeDeprecatedDescription(final ResourceBundle bundle, final String prefix) {
String bundleKey = prefix == null ? name : (prefix + "." + name);
bundleKey += "." + ModelDescriptionConstants.DEPRECATED;
return bundle.getString(bundleKey);
} | [
"public",
"String",
"getAttributeDeprecatedDescription",
"(",
"final",
"ResourceBundle",
"bundle",
",",
"final",
"String",
"prefix",
")",
"{",
"String",
"bundleKey",
"=",
"prefix",
"==",
"null",
"?",
"name",
":",
"(",
"prefix",
"+",
"\".\"",
"+",
"name",
")",
... | Gets localized deprecation text from the given {@link java.util.ResourceBundle} for the attribute.
@param bundle the resource bundle. Cannot be {@code null}
@param prefix a prefix to dot-prepend to the attribute name to form a key to resolve in the bundle
@return the resolved text | [
"Gets",
"localized",
"deprecation",
"text",
"from",
"the",
"given",
"{",
"@link",
"java",
".",
"util",
".",
"ResourceBundle",
"}",
"for",
"the",
"attribute",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/AttributeDefinition.java#L924-L928 |
apigee/usergrid-java-sdk | src/main/java/org/usergrid/java/client/Client.java | Client.postUserActivity | public ApiResponse postUserActivity(String userId, Activity activity) {
"""
Posts an activity to a user. Activity must already be created.
@param userId
@param activity
@return
"""
return apiRequest(HttpMethod.POST, null, activity, organizationId, applicationId, "users",
userId, "... | java | public ApiResponse postUserActivity(String userId, Activity activity) {
return apiRequest(HttpMethod.POST, null, activity, organizationId, applicationId, "users",
userId, "activities");
} | [
"public",
"ApiResponse",
"postUserActivity",
"(",
"String",
"userId",
",",
"Activity",
"activity",
")",
"{",
"return",
"apiRequest",
"(",
"HttpMethod",
".",
"POST",
",",
"null",
",",
"activity",
",",
"organizationId",
",",
"applicationId",
",",
"\"users\"",
",",... | Posts an activity to a user. Activity must already be created.
@param userId
@param activity
@return | [
"Posts",
"an",
"activity",
"to",
"a",
"user",
".",
"Activity",
"must",
"already",
"be",
"created",
"."
] | train | https://github.com/apigee/usergrid-java-sdk/blob/6202745f184754defff13962dfc3d830bc7d8c63/src/main/java/org/usergrid/java/client/Client.java#L674-L677 |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/quotes/OrderItemUrl.java | OrderItemUrl.updateQuoteItemUrl | public static MozuUrl updateQuoteItemUrl(String quoteId, String quoteItemId, String responseFields) {
"""
Get Resource Url for UpdateQuoteItem
@param quoteId
@param quoteItemId
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object... | java | public static MozuUrl updateQuoteItemUrl(String quoteId, String quoteItemId, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/quotes/{quoteId}/items/{quoteItemId}?responseFields={responseFields}");
formatter.formatUrl("quoteId", quoteId);
formatter.formatUrl("quoteItemId", quoteI... | [
"public",
"static",
"MozuUrl",
"updateQuoteItemUrl",
"(",
"String",
"quoteId",
",",
"String",
"quoteItemId",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/quotes/{quoteId}/items/{quoteItemId}?respon... | Get Resource Url for UpdateQuoteItem
@param quoteId
@param quoteItemId
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may cause da... | [
"Get",
"Resource",
"Url",
"for",
"UpdateQuoteItem"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/quotes/OrderItemUrl.java#L99-L106 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRBitmapImage.java | GVRBitmapImage.setBuffer | public void setBuffer(final int width, final int height, final int format, final int type, final Buffer pixels) {
"""
Copy a new texture from a {@link Buffer} to the GPU texture. This one is also safe even
in a non-GL thread. An updateGPU request on a non-GL thread will
be forwarded to the GL thread and be execu... | java | public void setBuffer(final int width, final int height, final int format, final int type, final Buffer pixels)
{
NativeBitmapImage.updateFromBuffer(getNative(), 0, 0, width, height, format, type, pixels);
} | [
"public",
"void",
"setBuffer",
"(",
"final",
"int",
"width",
",",
"final",
"int",
"height",
",",
"final",
"int",
"format",
",",
"final",
"int",
"type",
",",
"final",
"Buffer",
"pixels",
")",
"{",
"NativeBitmapImage",
".",
"updateFromBuffer",
"(",
"getNative"... | Copy a new texture from a {@link Buffer} to the GPU texture. This one is also safe even
in a non-GL thread. An updateGPU request on a non-GL thread will
be forwarded to the GL thread and be executed before main rendering happens.
Creating a new {@link GVRImage} is pretty cheap, but it's still not a
totally trivial ope... | [
"Copy",
"a",
"new",
"texture",
"from",
"a",
"{",
"@link",
"Buffer",
"}",
"to",
"the",
"GPU",
"texture",
".",
"This",
"one",
"is",
"also",
"safe",
"even",
"in",
"a",
"non",
"-",
"GL",
"thread",
".",
"An",
"updateGPU",
"request",
"on",
"a",
"non",
"-... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRBitmapImage.java#L176-L179 |
alkacon/opencms-core | src-gwt/org/opencms/ade/containerpage/client/ui/groupeditor/A_CmsGroupEditor.java | A_CmsGroupEditor.updateBackupElements | public void updateBackupElements(Map<String, CmsContainerElementData> updateElements) {
"""
Updates the backup elements.<p>
@param updateElements the updated element data
"""
ArrayList<CmsContainerPageElementPanel> updatedList = new ArrayList<CmsContainerPageElementPanel>();
String containe... | java | public void updateBackupElements(Map<String, CmsContainerElementData> updateElements) {
ArrayList<CmsContainerPageElementPanel> updatedList = new ArrayList<CmsContainerPageElementPanel>();
String containerId = m_groupContainer.getContainerId();
for (CmsContainerPageElementPanel element : m_back... | [
"public",
"void",
"updateBackupElements",
"(",
"Map",
"<",
"String",
",",
"CmsContainerElementData",
">",
"updateElements",
")",
"{",
"ArrayList",
"<",
"CmsContainerPageElementPanel",
">",
"updatedList",
"=",
"new",
"ArrayList",
"<",
"CmsContainerPageElementPanel",
">",... | Updates the backup elements.<p>
@param updateElements the updated element data | [
"Updates",
"the",
"backup",
"elements",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/containerpage/client/ui/groupeditor/A_CmsGroupEditor.java#L268-L297 |
vanilladb/vanillacore | src/main/java/org/vanilladb/core/sql/Schema.java | Schema.addField | public void addField(String fldName, Type type) {
"""
Adds a field to this schema having a specified name and type.
@param fldName
the name of the field
@param type
the type of the field, according to the constants in
{@link Type}
"""
fields.put(fldName, type);
if (myFieldSet != null)
myFieldS... | java | public void addField(String fldName, Type type) {
fields.put(fldName, type);
if (myFieldSet != null)
myFieldSet.add(fldName);
} | [
"public",
"void",
"addField",
"(",
"String",
"fldName",
",",
"Type",
"type",
")",
"{",
"fields",
".",
"put",
"(",
"fldName",
",",
"type",
")",
";",
"if",
"(",
"myFieldSet",
"!=",
"null",
")",
"myFieldSet",
".",
"add",
"(",
"fldName",
")",
";",
"}"
] | Adds a field to this schema having a specified name and type.
@param fldName
the name of the field
@param type
the type of the field, according to the constants in
{@link Type} | [
"Adds",
"a",
"field",
"to",
"this",
"schema",
"having",
"a",
"specified",
"name",
"and",
"type",
"."
] | train | https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/sql/Schema.java#L55-L59 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java | TheMovieDbApi.removeItemFromList | public StatusCode removeItemFromList(String sessionId, String listId, Integer mediaId) throws MovieDbException {
"""
This method lets users remove items from a list that they created.
A valid session id is required.
@param sessionId sessionId
@param listId listId
@param mediaId mediaId
@return true if the... | java | public StatusCode removeItemFromList(String sessionId, String listId, Integer mediaId) throws MovieDbException {
return tmdbList.removeItem(sessionId, listId, mediaId);
} | [
"public",
"StatusCode",
"removeItemFromList",
"(",
"String",
"sessionId",
",",
"String",
"listId",
",",
"Integer",
"mediaId",
")",
"throws",
"MovieDbException",
"{",
"return",
"tmdbList",
".",
"removeItem",
"(",
"sessionId",
",",
"listId",
",",
"mediaId",
")",
"... | This method lets users remove items from a list that they created.
A valid session id is required.
@param sessionId sessionId
@param listId listId
@param mediaId mediaId
@return true if the movie is on the list
@throws MovieDbException exception | [
"This",
"method",
"lets",
"users",
"remove",
"items",
"from",
"a",
"list",
"that",
"they",
"created",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java#L830-L832 |
alkacon/opencms-core | src/org/opencms/i18n/CmsEncoder.java | CmsEncoder.lookupEncoding | public static String lookupEncoding(String encoding, String fallback) {
"""
Checks if a given encoding name is actually supported, and if so
resolves it to it's canonical name, if not it returns the given fallback
value.<p>
Charsets have a set of aliases. For example, valid aliases for "UTF-8"
are "UTF8", "u... | java | public static String lookupEncoding(String encoding, String fallback) {
String result = m_encodingCache.get(encoding);
if (result != null) {
return result;
}
try {
result = Charset.forName(encoding).name();
m_encodingCache.put(encoding, result);
... | [
"public",
"static",
"String",
"lookupEncoding",
"(",
"String",
"encoding",
",",
"String",
"fallback",
")",
"{",
"String",
"result",
"=",
"m_encodingCache",
".",
"get",
"(",
"encoding",
")",
";",
"if",
"(",
"result",
"!=",
"null",
")",
"{",
"return",
"resul... | Checks if a given encoding name is actually supported, and if so
resolves it to it's canonical name, if not it returns the given fallback
value.<p>
Charsets have a set of aliases. For example, valid aliases for "UTF-8"
are "UTF8", "utf-8" or "utf8". This method resolves any given valid charset name
to it's "canonical"... | [
"Checks",
"if",
"a",
"given",
"encoding",
"name",
"is",
"actually",
"supported",
"and",
"if",
"so",
"resolves",
"it",
"to",
"it",
"s",
"canonical",
"name",
"if",
"not",
"it",
"returns",
"the",
"given",
"fallback",
"value",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/i18n/CmsEncoder.java#L821-L837 |
landawn/AbacusUtil | src/com/landawn/abacus/util/Primitives.java | Primitives.box | @SafeVarargs
public static Boolean[] box(final boolean... a) {
"""
<p>
Converts an array of primitive booleans to objects.
</p>
<p>
This method returns {@code null} for a {@code null} input array.
</p>
@param a
a {@code boolean} array
@return a {@code Boolean} array, {@code null} if null array inp... | java | @SafeVarargs
public static Boolean[] box(final boolean... a) {
if (a == null) {
return null;
}
return box(a, 0, a.length);
} | [
"@",
"SafeVarargs",
"public",
"static",
"Boolean",
"[",
"]",
"box",
"(",
"final",
"boolean",
"...",
"a",
")",
"{",
"if",
"(",
"a",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"box",
"(",
"a",
",",
"0",
",",
"a",
".",
"length",
... | <p>
Converts an array of primitive booleans to objects.
</p>
<p>
This method returns {@code null} for a {@code null} input array.
</p>
@param a
a {@code boolean} array
@return a {@code Boolean} array, {@code null} if null array input | [
"<p",
">",
"Converts",
"an",
"array",
"of",
"primitive",
"booleans",
"to",
"objects",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Primitives.java#L123-L130 |
codelibs/fess | src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java | FessMessages.addErrorsFailedToUpgradeFrom | public FessMessages addErrorsFailedToUpgradeFrom(String property, String arg0, String arg1) {
"""
Add the created action message for the key 'errors.failed_to_upgrade_from' with parameters.
<pre>
message: Failed to upgrade from {0}: {1}
</pre>
@param property The property name for the message. (NotNull)
@para... | java | public FessMessages addErrorsFailedToUpgradeFrom(String property, String arg0, String arg1) {
assertPropertyNotNull(property);
add(property, new UserMessage(ERRORS_failed_to_upgrade_from, arg0, arg1));
return this;
} | [
"public",
"FessMessages",
"addErrorsFailedToUpgradeFrom",
"(",
"String",
"property",
",",
"String",
"arg0",
",",
"String",
"arg1",
")",
"{",
"assertPropertyNotNull",
"(",
"property",
")",
";",
"add",
"(",
"property",
",",
"new",
"UserMessage",
"(",
"ERRORS_failed_... | Add the created action message for the key 'errors.failed_to_upgrade_from' with parameters.
<pre>
message: Failed to upgrade from {0}: {1}
</pre>
@param property The property name for the message. (NotNull)
@param arg0 The parameter arg0 for message. (NotNull)
@param arg1 The parameter arg1 for message. (NotNull)
@retu... | [
"Add",
"the",
"created",
"action",
"message",
"for",
"the",
"key",
"errors",
".",
"failed_to_upgrade_from",
"with",
"parameters",
".",
"<pre",
">",
"message",
":",
"Failed",
"to",
"upgrade",
"from",
"{",
"0",
"}",
":",
"{",
"1",
"}",
"<",
"/",
"pre",
"... | train | https://github.com/codelibs/fess/blob/e5e4b722549d32a4958dfd94965b21937bfe64cf/src/main/java/org/codelibs/fess/mylasta/action/FessMessages.java#L1919-L1923 |
micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/context/DefaultBeanContext.java | DefaultBeanContext.getBeansOfType | protected @Nonnull <T> Collection<T> getBeansOfType(@Nullable BeanResolutionContext resolutionContext, @Nonnull Class<T> beanType) {
"""
Get all beans of the given type.
@param resolutionContext The bean resolution context
@param beanType The bean type
@param <T> The bean type parameter... | java | protected @Nonnull <T> Collection<T> getBeansOfType(@Nullable BeanResolutionContext resolutionContext, @Nonnull Class<T> beanType) {
return getBeansOfTypeInternal(resolutionContext, beanType, null);
} | [
"protected",
"@",
"Nonnull",
"<",
"T",
">",
"Collection",
"<",
"T",
">",
"getBeansOfType",
"(",
"@",
"Nullable",
"BeanResolutionContext",
"resolutionContext",
",",
"@",
"Nonnull",
"Class",
"<",
"T",
">",
"beanType",
")",
"{",
"return",
"getBeansOfTypeInternal",
... | Get all beans of the given type.
@param resolutionContext The bean resolution context
@param beanType The bean type
@param <T> The bean type parameter
@return The found beans | [
"Get",
"all",
"beans",
"of",
"the",
"given",
"type",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/DefaultBeanContext.java#L853-L855 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnSitesInner.java | VpnSitesInner.getByResourceGroupAsync | public Observable<VpnSiteInner> getByResourceGroupAsync(String resourceGroupName, String vpnSiteName) {
"""
Retrieves the details of a VPNsite.
@param resourceGroupName The resource group name of the VpnSite.
@param vpnSiteName The name of the VpnSite being retrieved.
@throws IllegalArgumentException thrown i... | java | public Observable<VpnSiteInner> getByResourceGroupAsync(String resourceGroupName, String vpnSiteName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, vpnSiteName).map(new Func1<ServiceResponse<VpnSiteInner>, VpnSiteInner>() {
@Override
public VpnSiteInner call(Serv... | [
"public",
"Observable",
"<",
"VpnSiteInner",
">",
"getByResourceGroupAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"vpnSiteName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vpnSiteName",
")",
".",
"map",
... | Retrieves the details of a VPNsite.
@param resourceGroupName The resource group name of the VpnSite.
@param vpnSiteName The name of the VpnSite being retrieved.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the VpnSiteInner object | [
"Retrieves",
"the",
"details",
"of",
"a",
"VPNsite",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VpnSitesInner.java#L151-L158 |
svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/routing/bindings/Validator.java | Validator.validateNull | public void validateNull(Object object, String name) {
"""
Validates a given object to be null
@param object The object to check
@param name The name of the field to display the error message
"""
validateNull(object, name, messages.get(Validation.NULL_KEY.name(), name));
} | java | public void validateNull(Object object, String name) {
validateNull(object, name, messages.get(Validation.NULL_KEY.name(), name));
} | [
"public",
"void",
"validateNull",
"(",
"Object",
"object",
",",
"String",
"name",
")",
"{",
"validateNull",
"(",
"object",
",",
"name",
",",
"messages",
".",
"get",
"(",
"Validation",
".",
"NULL_KEY",
".",
"name",
"(",
")",
",",
"name",
")",
")",
";",
... | Validates a given object to be null
@param object The object to check
@param name The name of the field to display the error message | [
"Validates",
"a",
"given",
"object",
"to",
"be",
"null"
] | train | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/routing/bindings/Validator.java#L511-L513 |
grails/gorm-hibernate5 | grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsDomainBinder.java | GrailsDomainBinder.linkBidirectionalOneToMany | protected void linkBidirectionalOneToMany(Collection collection, PersistentClass associatedClass, DependantValue key, PersistentProperty otherSide) {
"""
Links a bidirectional one-to-many, configuring the inverse side and using a column copy to perform the link
@param collection The collection one-to-many
... | java | protected void linkBidirectionalOneToMany(Collection collection, PersistentClass associatedClass, DependantValue key, PersistentProperty otherSide) {
collection.setInverse(true);
// Iterator mappedByColumns = associatedClass.getProperty(otherSide.getName()).getValue().getColumnIterator();
Itera... | [
"protected",
"void",
"linkBidirectionalOneToMany",
"(",
"Collection",
"collection",
",",
"PersistentClass",
"associatedClass",
",",
"DependantValue",
"key",
",",
"PersistentProperty",
"otherSide",
")",
"{",
"collection",
".",
"setInverse",
"(",
"true",
")",
";",
"// I... | Links a bidirectional one-to-many, configuring the inverse side and using a column copy to perform the link
@param collection The collection one-to-many
@param associatedClass The associated class
@param key The key
@param otherSide The other side of the relationship | [
"Links",
"a",
"bidirectional",
"one",
"-",
"to",
"-",
"many",
"configuring",
"the",
"inverse",
"side",
"and",
"using",
"a",
"column",
"copy",
"to",
"perform",
"the",
"link"
] | train | https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsDomainBinder.java#L964-L973 |
VoltDB/voltdb | src/frontend/org/voltdb/OpsAgent.java | OpsAgent.sendOpsResponse | private void sendOpsResponse(VoltTable[] results, JSONObject obj, byte payloadType) throws Exception {
"""
Return the results of distributed work to the original requesting agent.
Used by subclasses to respond after they've done their local work.
"""
long requestId = obj.getLong("requestId");
... | java | private void sendOpsResponse(VoltTable[] results, JSONObject obj, byte payloadType) throws Exception
{
long requestId = obj.getLong("requestId");
long returnAddress = obj.getLong("returnAddress");
// Send a response with no data since the stats is not supported or not yet available
i... | [
"private",
"void",
"sendOpsResponse",
"(",
"VoltTable",
"[",
"]",
"results",
",",
"JSONObject",
"obj",
",",
"byte",
"payloadType",
")",
"throws",
"Exception",
"{",
"long",
"requestId",
"=",
"obj",
".",
"getLong",
"(",
"\"requestId\"",
")",
";",
"long",
"retu... | Return the results of distributed work to the original requesting agent.
Used by subclasses to respond after they've done their local work. | [
"Return",
"the",
"results",
"of",
"distributed",
"work",
"to",
"the",
"original",
"requesting",
"agent",
".",
"Used",
"by",
"subclasses",
"to",
"respond",
"after",
"they",
"ve",
"done",
"their",
"local",
"work",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/OpsAgent.java#L414-L449 |
tvesalainen/util | util/src/main/java/d3/env/TSAGeoMag.java | TSAGeoMag.getHorizontalIntensity | public double getHorizontalIntensity( double dlat, double dlong, double year, double altitude ) {
"""
Returns the horizontal magnetic field intensity from the
Department of Defense geomagnetic model and data
in nano Tesla.
@param dlat Latitude in decimal degrees.
@param dlong Longitude in decimal degrees... | java | public double getHorizontalIntensity( double dlat, double dlong, double year, double altitude )
{
calcGeoMag( dlat, dlong, year, altitude );
return bh;
} | [
"public",
"double",
"getHorizontalIntensity",
"(",
"double",
"dlat",
",",
"double",
"dlong",
",",
"double",
"year",
",",
"double",
"altitude",
")",
"{",
"calcGeoMag",
"(",
"dlat",
",",
"dlong",
",",
"year",
",",
"altitude",
")",
";",
"return",
"bh",
";",
... | Returns the horizontal magnetic field intensity from the
Department of Defense geomagnetic model and data
in nano Tesla.
@param dlat Latitude in decimal degrees.
@param dlong Longitude in decimal degrees.
@param year Date of the calculation in decimal years.
@param altitude Altitude of the calculation in kilomete... | [
"Returns",
"the",
"horizontal",
"magnetic",
"field",
"intensity",
"from",
"the",
"Department",
"of",
"Defense",
"geomagnetic",
"model",
"and",
"data",
"in",
"nano",
"Tesla",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/d3/env/TSAGeoMag.java#L1003-L1007 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/vod/VodClient.java | VodClient.listMediaResourcesByMarker | public ListMediaResourceByMarkerResponse listMediaResourcesByMarker(ListMediaResourceByMarkerRequest request) {
"""
List the properties of all media resource managed by VOD service.
<p>
The caller <i>must</i> authenticate with a valid BCE Access Key / Private Key pair.
@param request The request wrapper obj... | java | public ListMediaResourceByMarkerResponse listMediaResourcesByMarker(ListMediaResourceByMarkerRequest request) {
InternalRequest internalRequest =
createRequest(HttpMethodName.GET, request, PATH_MEDIA);
internalRequest.addParameter(PARAM_MAX_SIZE, String.valueOf(request.getMaxSize()));
... | [
"public",
"ListMediaResourceByMarkerResponse",
"listMediaResourcesByMarker",
"(",
"ListMediaResourceByMarkerRequest",
"request",
")",
"{",
"InternalRequest",
"internalRequest",
"=",
"createRequest",
"(",
"HttpMethodName",
".",
"GET",
",",
"request",
",",
"PATH_MEDIA",
")",
... | List the properties of all media resource managed by VOD service.
<p>
The caller <i>must</i> authenticate with a valid BCE Access Key / Private Key pair.
@param request The request wrapper object containing all options.
@return The properties of all specific media resources | [
"List",
"the",
"properties",
"of",
"all",
"media",
"resource",
"managed",
"by",
"VOD",
"service",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/vod/VodClient.java#L598-L619 |
geomajas/geomajas-project-client-gwt2 | common-gwt/common-gwt/src/main/java/org/geomajas/gwt/client/util/Dom.java | Dom.createElement | public static Element createElement(String tagName, String id) {
"""
Creates an HTML element with the given id.
@param tagName the HTML tag of the element to be created
@return the newly-created element
"""
return IMPL.createElement(tagName, id);
} | java | public static Element createElement(String tagName, String id) {
return IMPL.createElement(tagName, id);
} | [
"public",
"static",
"Element",
"createElement",
"(",
"String",
"tagName",
",",
"String",
"id",
")",
"{",
"return",
"IMPL",
".",
"createElement",
"(",
"tagName",
",",
"id",
")",
";",
"}"
] | Creates an HTML element with the given id.
@param tagName the HTML tag of the element to be created
@return the newly-created element | [
"Creates",
"an",
"HTML",
"element",
"with",
"the",
"given",
"id",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/common-gwt/src/main/java/org/geomajas/gwt/client/util/Dom.java#L126-L128 |
PeachTech/peachweb-peachproxy-java | src/main/java/com/peachfuzzer/web/api/PeachProxy.java | PeachProxy.sessionTeardown | public void sessionTeardown() throws PeachApiException {
"""
Stop testing job and destroy proxy.
This will stop the current testing job and
destroy the proxy.
@throws PeachApiException
"""
stashUnirestProxy();
if(_debug)
System.out.println(">>sessionTeardown");
... | java | public void sessionTeardown() throws PeachApiException
{
stashUnirestProxy();
if(_debug)
System.out.println(">>sessionTeardown");
try
{
HttpResponse<String> ret = null;
try {
ret = Unirest
... | [
"public",
"void",
"sessionTeardown",
"(",
")",
"throws",
"PeachApiException",
"{",
"stashUnirestProxy",
"(",
")",
";",
"if",
"(",
"_debug",
")",
"System",
".",
"out",
".",
"println",
"(",
"\">>sessionTeardown\"",
")",
";",
"try",
"{",
"HttpResponse",
"<",
"S... | Stop testing job and destroy proxy.
This will stop the current testing job and
destroy the proxy.
@throws PeachApiException | [
"Stop",
"testing",
"job",
"and",
"destroy",
"proxy",
"."
] | train | https://github.com/PeachTech/peachweb-peachproxy-java/blob/0ca274b0d1668fb4be0fed7e247394438374de58/src/main/java/com/peachfuzzer/web/api/PeachProxy.java#L373-L411 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/AppGameContainer.java | AppGameContainer.setFullscreen | public void setFullscreen(boolean fullscreen) throws SlickException {
"""
Indicate whether we want to be in fullscreen mode. Note that the current
display mode must be valid as a fullscreen mode for this to work
@param fullscreen True if we want to be in fullscreen mode
@throws SlickException Indicates we fai... | java | public void setFullscreen(boolean fullscreen) throws SlickException {
if (isFullscreen() == fullscreen) {
return;
}
if (!fullscreen) {
try {
Display.setFullscreen(fullscreen);
} catch (LWJGLException e) {
throw new SlickException("Unable to set fullscreen="+fullscreen, e);
}
} ... | [
"public",
"void",
"setFullscreen",
"(",
"boolean",
"fullscreen",
")",
"throws",
"SlickException",
"{",
"if",
"(",
"isFullscreen",
"(",
")",
"==",
"fullscreen",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"fullscreen",
")",
"{",
"try",
"{",
"Display",
"... | Indicate whether we want to be in fullscreen mode. Note that the current
display mode must be valid as a fullscreen mode for this to work
@param fullscreen True if we want to be in fullscreen mode
@throws SlickException Indicates we failed to change the display mode | [
"Indicate",
"whether",
"we",
"want",
"to",
"be",
"in",
"fullscreen",
"mode",
".",
"Note",
"that",
"the",
"current",
"display",
"mode",
"must",
"be",
"valid",
"as",
"a",
"fullscreen",
"mode",
"for",
"this",
"to",
"work"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/AppGameContainer.java#L186-L201 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java | ApiOvhDedicatedCloud.serviceName_federation_activeDirectory_activeDirectoryId_GET | public OvhFederationAccessNetwork serviceName_federation_activeDirectory_activeDirectoryId_GET(String serviceName, Long activeDirectoryId) throws IOException {
"""
Get this object properties
REST: GET /dedicatedCloud/{serviceName}/federation/activeDirectory/{activeDirectoryId}
@param serviceName [required] Dom... | java | public OvhFederationAccessNetwork serviceName_federation_activeDirectory_activeDirectoryId_GET(String serviceName, Long activeDirectoryId) throws IOException {
String qPath = "/dedicatedCloud/{serviceName}/federation/activeDirectory/{activeDirectoryId}";
StringBuilder sb = path(qPath, serviceName, activeDirectoryId... | [
"public",
"OvhFederationAccessNetwork",
"serviceName_federation_activeDirectory_activeDirectoryId_GET",
"(",
"String",
"serviceName",
",",
"Long",
"activeDirectoryId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicatedCloud/{serviceName}/federation/activeDirecto... | Get this object properties
REST: GET /dedicatedCloud/{serviceName}/federation/activeDirectory/{activeDirectoryId}
@param serviceName [required] Domain of the service
@param activeDirectoryId [required] Id of the Active Directory | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java#L1136-L1141 |
michael-rapp/AndroidUtil | library/src/main/java/de/mrapp/android/util/BitmapUtil.java | BitmapUtil.splitVertically | public static Pair<Bitmap, Bitmap> splitVertically(@NonNull final Bitmap bitmap) {
"""
Splits a specific bitmap vertically at half.
@param bitmap
The bitmap, which should be split, as an instance of the class {@link Bitmap}. The
bitmap may not be null
@return A pair, which contains the two bitmaps, the origi... | java | public static Pair<Bitmap, Bitmap> splitVertically(@NonNull final Bitmap bitmap) {
return splitVertically(bitmap, bitmap.getWidth() / 2);
} | [
"public",
"static",
"Pair",
"<",
"Bitmap",
",",
"Bitmap",
">",
"splitVertically",
"(",
"@",
"NonNull",
"final",
"Bitmap",
"bitmap",
")",
"{",
"return",
"splitVertically",
"(",
"bitmap",
",",
"bitmap",
".",
"getWidth",
"(",
")",
"/",
"2",
")",
";",
"}"
] | Splits a specific bitmap vertically at half.
@param bitmap
The bitmap, which should be split, as an instance of the class {@link Bitmap}. The
bitmap may not be null
@return A pair, which contains the two bitmaps, the original bitmap has been split into, as
an instance of the class Pair | [
"Splits",
"a",
"specific",
"bitmap",
"vertically",
"at",
"half",
"."
] | train | https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/BitmapUtil.java#L407-L409 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X500Name.java | X500Name.getRFC2253Name | public String getRFC2253Name(Map<String, String> oidMap) {
"""
Returns a string form of the X.500 distinguished name
using the algorithm defined in RFC 2253. Attribute type
keywords defined in RFC 2253 are emitted, as well as additional
keywords contained in the OID/keyword map.
"""
/* check for and... | java | public String getRFC2253Name(Map<String, String> oidMap) {
/* check for and return cached name */
if (oidMap.isEmpty()) {
if (rfc2253Dn != null) {
return rfc2253Dn;
} else {
rfc2253Dn = generateRFC2253DN(oidMap);
return rfc2253Dn;
... | [
"public",
"String",
"getRFC2253Name",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"oidMap",
")",
"{",
"/* check for and return cached name */",
"if",
"(",
"oidMap",
".",
"isEmpty",
"(",
")",
")",
"{",
"if",
"(",
"rfc2253Dn",
"!=",
"null",
")",
"{",
"ret... | Returns a string form of the X.500 distinguished name
using the algorithm defined in RFC 2253. Attribute type
keywords defined in RFC 2253 are emitted, as well as additional
keywords contained in the OID/keyword map. | [
"Returns",
"a",
"string",
"form",
"of",
"the",
"X",
".",
"500",
"distinguished",
"name",
"using",
"the",
"algorithm",
"defined",
"in",
"RFC",
"2253",
".",
"Attribute",
"type",
"keywords",
"defined",
"in",
"RFC",
"2253",
"are",
"emitted",
"as",
"well",
"as"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/x509/X500Name.java#L665-L676 |
landawn/AbacusUtil | src/com/landawn/abacus/util/Sheet.java | Sheet.swapColumns | public void swapColumns(Object columnKeyA, Object columnKeyB) {
"""
Swap the positions of the two specified columns.
@param columnKeyA
@param columnKeyB
"""
checkFrozen();
final int columnIndexA = this.getColumnIndex(columnKeyA);
final int columnIndexB = this.getColumnIndex(col... | java | public void swapColumns(Object columnKeyA, Object columnKeyB) {
checkFrozen();
final int columnIndexA = this.getColumnIndex(columnKeyA);
final int columnIndexB = this.getColumnIndex(columnKeyB);
final List<C> tmp = new ArrayList<>(rowLength());
tmp.addAll(_columnKeySet);... | [
"public",
"void",
"swapColumns",
"(",
"Object",
"columnKeyA",
",",
"Object",
"columnKeyB",
")",
"{",
"checkFrozen",
"(",
")",
";",
"final",
"int",
"columnIndexA",
"=",
"this",
".",
"getColumnIndex",
"(",
"columnKeyA",
")",
";",
"final",
"int",
"columnIndexB",
... | Swap the positions of the two specified columns.
@param columnKeyA
@param columnKeyB | [
"Swap",
"the",
"positions",
"of",
"the",
"two",
"specified",
"columns",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Sheet.java#L849-L873 |
phax/ph-schedule | ph-mini-quartz/src/main/java/com/helger/quartz/impl/StdScheduler.java | StdScheduler.scheduleJob | public Date scheduleJob (final IJobDetail jobDetail, final ITrigger trigger) throws SchedulerException {
"""
<p>
Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
</p>
"""
return m_aSched.scheduleJob (jobDetail, trigger);
} | java | public Date scheduleJob (final IJobDetail jobDetail, final ITrigger trigger) throws SchedulerException
{
return m_aSched.scheduleJob (jobDetail, trigger);
} | [
"public",
"Date",
"scheduleJob",
"(",
"final",
"IJobDetail",
"jobDetail",
",",
"final",
"ITrigger",
"trigger",
")",
"throws",
"SchedulerException",
"{",
"return",
"m_aSched",
".",
"scheduleJob",
"(",
"jobDetail",
",",
"trigger",
")",
";",
"}"
] | <p>
Calls the equivalent method on the 'proxied' <code>QuartzScheduler</code>.
</p> | [
"<p",
">",
"Calls",
"the",
"equivalent",
"method",
"on",
"the",
"proxied",
"<code",
">",
"QuartzScheduler<",
"/",
"code",
">",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/impl/StdScheduler.java#L249-L252 |
DataArt/CalculationEngine | calculation-engine/engine-converters/src/main/java/com/dataart/spreadsheetanalytics/engine/DependencyExtractors.java | DependencyExtractors.createDataModelFromCell | static IDataModel createDataModelFromCell(Sheet sheet, FormulaParsingWorkbook workbook, IA1Address address) {
"""
Based on given cell address creates new {@link IDataModel} with all parsed cell dependencies.
"""
IDataModel dm = new DataModel(randomUUID().toString());
resolveCellDependencies(a... | java | static IDataModel createDataModelFromCell(Sheet sheet, FormulaParsingWorkbook workbook, IA1Address address) {
IDataModel dm = new DataModel(randomUUID().toString());
resolveCellDependencies(address, sheet, workbook).forEach(cell -> ConverterUtils.copyCell(new CellAddress(dm.getDataModelId(), cell), sh... | [
"static",
"IDataModel",
"createDataModelFromCell",
"(",
"Sheet",
"sheet",
",",
"FormulaParsingWorkbook",
"workbook",
",",
"IA1Address",
"address",
")",
"{",
"IDataModel",
"dm",
"=",
"new",
"DataModel",
"(",
"randomUUID",
"(",
")",
".",
"toString",
"(",
")",
")",... | Based on given cell address creates new {@link IDataModel} with all parsed cell dependencies. | [
"Based",
"on",
"given",
"cell",
"address",
"creates",
"new",
"{"
] | train | https://github.com/DataArt/CalculationEngine/blob/34ce1d9c1f9b57a502906b274311d28580b134e5/calculation-engine/engine-converters/src/main/java/com/dataart/spreadsheetanalytics/engine/DependencyExtractors.java#L169-L173 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/opengl/CursorLoader.java | CursorLoader.getCursor | public Cursor getCursor(ByteBuffer buf,int x,int y,int width,int height) throws IOException, LWJGLException {
"""
Get a cursor based on a set of image data
@param buf The image data (stored in RGBA) to load the cursor from
@param x The x-coordinate of the cursor hotspot (left -> right)
@param y The y-coordina... | java | public Cursor getCursor(ByteBuffer buf,int x,int y,int width,int height) throws IOException, LWJGLException {
for (int i=0;i<buf.limit();i+=4) {
byte red = buf.get(i);
byte green = buf.get(i+1);
byte blue = buf.get(i+2);
byte alpha = buf.get(i+3);
buf.put(i+2, red);
buf.put(i+1, green);
... | [
"public",
"Cursor",
"getCursor",
"(",
"ByteBuffer",
"buf",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"width",
",",
"int",
"height",
")",
"throws",
"IOException",
",",
"LWJGLException",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"buf",
... | Get a cursor based on a set of image data
@param buf The image data (stored in RGBA) to load the cursor from
@param x The x-coordinate of the cursor hotspot (left -> right)
@param y The y-coordinate of the cursor hotspot (bottom -> top)
@param width The width of the image data provided
@param height The height of the ... | [
"Get",
"a",
"cursor",
"based",
"on",
"a",
"set",
"of",
"image",
"data"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/opengl/CursorLoader.java#L94-L117 |
jeremiehuchet/nominatim-java-api | src/main/java/fr/dudie/nominatim/client/request/NominatimSearchRequest.java | NominatimSearchRequest.setViewBox | public void setViewBox(final int westE6, final int northE6, final int eastE6, final int southE6) {
"""
Sets the preferred area to find search results;
@param westE6
the west bound
@param northE6
the north bound
@param eastE6
the east bound
@param southE6
the south bound
"""
this.viewBox = new... | java | public void setViewBox(final int westE6, final int northE6, final int eastE6, final int southE6) {
this.viewBox = new BoundingBox();
this.viewBox.setWestE6(westE6);
this.viewBox.setNorthE6(northE6);
this.viewBox.setEastE6(eastE6);
this.viewBox.setSouthE6(southE6);
} | [
"public",
"void",
"setViewBox",
"(",
"final",
"int",
"westE6",
",",
"final",
"int",
"northE6",
",",
"final",
"int",
"eastE6",
",",
"final",
"int",
"southE6",
")",
"{",
"this",
".",
"viewBox",
"=",
"new",
"BoundingBox",
"(",
")",
";",
"this",
".",
"view... | Sets the preferred area to find search results;
@param westE6
the west bound
@param northE6
the north bound
@param eastE6
the east bound
@param southE6
the south bound | [
"Sets",
"the",
"preferred",
"area",
"to",
"find",
"search",
"results",
";"
] | train | https://github.com/jeremiehuchet/nominatim-java-api/blob/faf3ff1003a9989eb5cc48f449b3a22c567843bf/src/main/java/fr/dudie/nominatim/client/request/NominatimSearchRequest.java#L235-L241 |
google/closure-compiler | src/com/google/javascript/jscomp/DevirtualizePrototypeMethods.java | DevirtualizePrototypeMethods.isEligibleDefinitionSite | private boolean isEligibleDefinitionSite(String name, Node definitionSite) {
"""
Determines if a method definition site is eligible for rewrite as a global.
<p>In order to be eligible for rewrite, the definition site must:
<ul>
<li>Not be exported
<li>Be for a prototype method
</ul>
"""
switch (de... | java | private boolean isEligibleDefinitionSite(String name, Node definitionSite) {
switch (definitionSite.getToken()) {
case GETPROP:
case MEMBER_FUNCTION_DEF:
case STRING_KEY:
break;
default:
// No other node types are supported.
throw new IllegalArgumentException(definit... | [
"private",
"boolean",
"isEligibleDefinitionSite",
"(",
"String",
"name",
",",
"Node",
"definitionSite",
")",
"{",
"switch",
"(",
"definitionSite",
".",
"getToken",
"(",
")",
")",
"{",
"case",
"GETPROP",
":",
"case",
"MEMBER_FUNCTION_DEF",
":",
"case",
"STRING_KE... | Determines if a method definition site is eligible for rewrite as a global.
<p>In order to be eligible for rewrite, the definition site must:
<ul>
<li>Not be exported
<li>Be for a prototype method
</ul> | [
"Determines",
"if",
"a",
"method",
"definition",
"site",
"is",
"eligible",
"for",
"rewrite",
"as",
"a",
"global",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/DevirtualizePrototypeMethods.java#L215-L238 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/render/R.java | R.addClass2FacetComponent | public static void addClass2FacetComponent(UIComponent f, String cname, String aclass) {
"""
Adds a CSS class to a component within a facet.
@param f
the facet
@param cname
the class name of the component to be manipulated.
@param aclass
the CSS class to be added
"""
// If the facet contains only one... | java | public static void addClass2FacetComponent(UIComponent f, String cname, String aclass) {
// If the facet contains only one component, getChildCount()=0 and the
// Facet is the UIComponent
if (f.getClass().getName().endsWith(cname)) {
addClass2Component(f, aclass);
} else {
if (f.getChildCount() > 0) {
... | [
"public",
"static",
"void",
"addClass2FacetComponent",
"(",
"UIComponent",
"f",
",",
"String",
"cname",
",",
"String",
"aclass",
")",
"{",
"// If the facet contains only one component, getChildCount()=0 and the",
"// Facet is the UIComponent",
"if",
"(",
"f",
".",
"getClass... | Adds a CSS class to a component within a facet.
@param f
the facet
@param cname
the class name of the component to be manipulated.
@param aclass
the CSS class to be added | [
"Adds",
"a",
"CSS",
"class",
"to",
"a",
"component",
"within",
"a",
"facet",
"."
] | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/render/R.java#L171-L185 |
lucee/Lucee | core/src/main/java/lucee/runtime/registry/RegistryQuery.java | RegistryQuery.getValue | public static RegistryEntry getValue(String branch, String entry, short type) throws RegistryException, IOException, InterruptedException {
"""
gets a single value form the registry
@param branch brach to get value from
@param entry entry to get
@param type type of the registry entry to get
@return registry ... | java | public static RegistryEntry getValue(String branch, String entry, short type) throws RegistryException, IOException, InterruptedException {
String[] cmd = new String[] { "reg", "query", cleanBrunch(branch), "/v", entry };
RegistryEntry[] rst = filter(executeQuery(cmd), branch, type);
if (rst.length == 1) {
retu... | [
"public",
"static",
"RegistryEntry",
"getValue",
"(",
"String",
"branch",
",",
"String",
"entry",
",",
"short",
"type",
")",
"throws",
"RegistryException",
",",
"IOException",
",",
"InterruptedException",
"{",
"String",
"[",
"]",
"cmd",
"=",
"new",
"String",
"... | gets a single value form the registry
@param branch brach to get value from
@param entry entry to get
@param type type of the registry entry to get
@return registry entry or null of not exist
@throws RegistryException
@throws IOException
@throws InterruptedException | [
"gets",
"a",
"single",
"value",
"form",
"the",
"registry"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/registry/RegistryQuery.java#L65-L73 |
lucee/Lucee | core/src/main/java/lucee/runtime/type/util/ArrayUtil.java | ArrayUtil.indexOfIgnoreCase | public static int indexOfIgnoreCase(String[] arr, String value) {
"""
return index of given value in Array or -1
@param arr
@param value
@return index of position in array
"""
for (int i = 0; i < arr.length; i++) {
if (arr[i].equalsIgnoreCase(value)) return i;
}
return -1;
} | java | public static int indexOfIgnoreCase(String[] arr, String value) {
for (int i = 0; i < arr.length; i++) {
if (arr[i].equalsIgnoreCase(value)) return i;
}
return -1;
} | [
"public",
"static",
"int",
"indexOfIgnoreCase",
"(",
"String",
"[",
"]",
"arr",
",",
"String",
"value",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"arr",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"arr",
"[",
"i",
"]",
... | return index of given value in Array or -1
@param arr
@param value
@return index of position in array | [
"return",
"index",
"of",
"given",
"value",
"in",
"Array",
"or",
"-",
"1"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/util/ArrayUtil.java#L320-L325 |
lessthanoptimal/ejml | main/ejml-simple/src/org/ejml/simple/SimpleMatrix.java | SimpleMatrix.randomNormal | public static SimpleMatrix randomNormal( SimpleMatrix covariance , Random random ) {
"""
<p>
Creates a new vector which is drawn from a multivariate normal distribution with zero mean
and the provided covariance.
</p>
@see CovarianceRandomDraw_DDRM
@param covariance Covariance of the multivariate normal d... | java | public static SimpleMatrix randomNormal( SimpleMatrix covariance , Random random ) {
SimpleMatrix found = new SimpleMatrix(covariance.numRows(), 1,covariance.getType());
switch( found.getType() ) {
case DDRM:{
CovarianceRandomDraw_DDRM draw = new CovarianceRandomDraw_DDRM(r... | [
"public",
"static",
"SimpleMatrix",
"randomNormal",
"(",
"SimpleMatrix",
"covariance",
",",
"Random",
"random",
")",
"{",
"SimpleMatrix",
"found",
"=",
"new",
"SimpleMatrix",
"(",
"covariance",
".",
"numRows",
"(",
")",
",",
"1",
",",
"covariance",
".",
"getTy... | <p>
Creates a new vector which is drawn from a multivariate normal distribution with zero mean
and the provided covariance.
</p>
@see CovarianceRandomDraw_DDRM
@param covariance Covariance of the multivariate normal distribution
@return Vector randomly drawn from the distribution | [
"<p",
">",
"Creates",
"a",
"new",
"vector",
"which",
"is",
"drawn",
"from",
"a",
"multivariate",
"normal",
"distribution",
"with",
"zero",
"mean",
"and",
"the",
"provided",
"covariance",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-simple/src/org/ejml/simple/SimpleMatrix.java#L313-L335 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRAssetLoader.java | GVRAssetLoader.loadModel | public void loadModel(final GVRSceneObject model, final GVRResourceVolume volume, final EnumSet<GVRImportSettings> settings, final GVRScene scene) {
"""
Loads a hierarchy of scene objects {@link GVRSceneObject} asymchronously from a 3D model
on the volume provided and adds it to the specified scene.
<p>
and wil... | java | public void loadModel(final GVRSceneObject model, final GVRResourceVolume volume, final EnumSet<GVRImportSettings> settings, final GVRScene scene)
{
Threads.spawn(new Runnable()
{
public void run()
{
String filePath = volume.getFileName();
Asse... | [
"public",
"void",
"loadModel",
"(",
"final",
"GVRSceneObject",
"model",
",",
"final",
"GVRResourceVolume",
"volume",
",",
"final",
"EnumSet",
"<",
"GVRImportSettings",
">",
"settings",
",",
"final",
"GVRScene",
"scene",
")",
"{",
"Threads",
".",
"spawn",
"(",
... | Loads a hierarchy of scene objects {@link GVRSceneObject} asymchronously from a 3D model
on the volume provided and adds it to the specified scene.
<p>
and will return before the model is loaded.
IAssetEvents are emitted to event listeners attached to the context.
The resource volume may reference res/raw in which case... | [
"Loads",
"a",
"hierarchy",
"of",
"scene",
"objects",
"{",
"@link",
"GVRSceneObject",
"}",
"asymchronously",
"from",
"a",
"3D",
"model",
"on",
"the",
"volume",
"provided",
"and",
"adds",
"it",
"to",
"the",
"specified",
"scene",
".",
"<p",
">",
"and",
"will"... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRAssetLoader.java#L1343-L1372 |
Azure/azure-sdk-for-java | keyvault/resource-manager/v2016_10_01/src/main/java/com/microsoft/azure/management/keyvault/v2016_10_01/implementation/VaultsInner.java | VaultsInner.createOrUpdate | public VaultInner createOrUpdate(String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters) {
"""
Create or update a key vault in the specified subscription.
@param resourceGroupName The name of the Resource Group to which the server belongs.
@param vaultName Name of the vault
@para... | java | public VaultInner createOrUpdate(String resourceGroupName, String vaultName, VaultCreateOrUpdateParameters parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, vaultName, parameters).toBlocking().single().body();
} | [
"public",
"VaultInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"vaultName",
",",
"VaultCreateOrUpdateParameters",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vaultName",
",",
"para... | Create or update a key vault in the specified subscription.
@param resourceGroupName The name of the Resource Group to which the server belongs.
@param vaultName Name of the vault
@param parameters Parameters to create or update the vault
@throws IllegalArgumentException thrown if parameters fail the validation
@throw... | [
"Create",
"or",
"update",
"a",
"key",
"vault",
"in",
"the",
"specified",
"subscription",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/resource-manager/v2016_10_01/src/main/java/com/microsoft/azure/management/keyvault/v2016_10_01/implementation/VaultsInner.java#L155-L157 |
alkacon/opencms-core | src/org/opencms/gwt/CmsBrokenLinkRenderer.java | CmsBrokenLinkRenderer.renderBrokenLink | public List<CmsBrokenLinkBean> renderBrokenLink(CmsResource target, CmsResource source) throws CmsException {
"""
Renders the source of a broken link as a list of CmsBrokenLinkBean instances.<p>
@param target the broken link target
@param source the broken link source
@return the list of broken link beans to ... | java | public List<CmsBrokenLinkBean> renderBrokenLink(CmsResource target, CmsResource source) throws CmsException {
I_CmsResourceType resType = OpenCms.getResourceManager().getResourceType(source);
String typeName = resType.getTypeName();
if (typeName.equals(CmsResourceTypeXmlContainerPage.INHERI... | [
"public",
"List",
"<",
"CmsBrokenLinkBean",
">",
"renderBrokenLink",
"(",
"CmsResource",
"target",
",",
"CmsResource",
"source",
")",
"throws",
"CmsException",
"{",
"I_CmsResourceType",
"resType",
"=",
"OpenCms",
".",
"getResourceManager",
"(",
")",
".",
"getResourc... | Renders the source of a broken link as a list of CmsBrokenLinkBean instances.<p>
@param target the broken link target
@param source the broken link source
@return the list of broken link beans to display to the user
@throws CmsException if something goes wrong | [
"Renders",
"the",
"source",
"of",
"a",
"broken",
"link",
"as",
"a",
"list",
"of",
"CmsBrokenLinkBean",
"instances",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/gwt/CmsBrokenLinkRenderer.java#L84-L95 |
groovy/groovy-core | src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java | StringGroovyMethods.unexpandLine | public static String unexpandLine(CharSequence self, int tabStop) {
"""
Replaces sequences of whitespaces with tabs within a line.
@param self A line to unexpand
@param tabStop The number of spaces a tab represents
@return an unexpanded String
@since 1.8.2
"""
StringBuilder builder = new StringBu... | java | public static String unexpandLine(CharSequence self, int tabStop) {
StringBuilder builder = new StringBuilder(self.toString());
int index = 0;
while (index + tabStop < builder.length()) {
// cut original string in tabstop-length pieces
String piece = builder.substring(ind... | [
"public",
"static",
"String",
"unexpandLine",
"(",
"CharSequence",
"self",
",",
"int",
"tabStop",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
"self",
".",
"toString",
"(",
")",
")",
";",
"int",
"index",
"=",
"0",
";",
"while",
... | Replaces sequences of whitespaces with tabs within a line.
@param self A line to unexpand
@param tabStop The number of spaces a tab represents
@return an unexpanded String
@since 1.8.2 | [
"Replaces",
"sequences",
"of",
"whitespaces",
"with",
"tabs",
"within",
"a",
"line",
"."
] | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/StringGroovyMethods.java#L3626-L3645 |
mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/Main.java | Main.mainEmbedded | public static Main mainEmbedded(ContextFactory factory,
ScopeProvider scopeProvider,
String title) {
"""
Entry point for embedded applications. This method attaches
to the given {@link ContextFactory} with the given scope. No
I/O redirecti... | java | public static Main mainEmbedded(ContextFactory factory,
ScopeProvider scopeProvider,
String title) {
return mainEmbeddedImpl(factory, scopeProvider, title);
} | [
"public",
"static",
"Main",
"mainEmbedded",
"(",
"ContextFactory",
"factory",
",",
"ScopeProvider",
"scopeProvider",
",",
"String",
"title",
")",
"{",
"return",
"mainEmbeddedImpl",
"(",
"factory",
",",
"scopeProvider",
",",
"title",
")",
";",
"}"
] | Entry point for embedded applications. This method attaches
to the given {@link ContextFactory} with the given scope. No
I/O redirection is performed as with {@link #main(String[])}. | [
"Entry",
"point",
"for",
"embedded",
"applications",
".",
"This",
"method",
"attaches",
"to",
"the",
"given",
"{"
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/Main.java#L262-L266 |
jmrozanec/cron-utils | src/main/java/com/cronutils/model/time/SingleExecutionTime.java | SingleExecutionTime.nextClosestMatch | private ZonedDateTime nextClosestMatch(final ZonedDateTime date) throws NoSuchValueException {
"""
If date is not match, will return next closest match.
If date is match, will return this date.
@param date - reference ZonedDateTime instance - never null;
@return ZonedDateTime instance, never null. Value obeys... | java | private ZonedDateTime nextClosestMatch(final ZonedDateTime date) throws NoSuchValueException {
ExecutionTimeResult result = new ExecutionTimeResult(date, false);
for (int i = 0; i < MAX_ITERATIONS; i++) {
result = potentialNextClosestMatch(result.getTime());
if (result.isMatch())... | [
"private",
"ZonedDateTime",
"nextClosestMatch",
"(",
"final",
"ZonedDateTime",
"date",
")",
"throws",
"NoSuchValueException",
"{",
"ExecutionTimeResult",
"result",
"=",
"new",
"ExecutionTimeResult",
"(",
"date",
",",
"false",
")",
";",
"for",
"(",
"int",
"i",
"=",... | If date is not match, will return next closest match.
If date is match, will return this date.
@param date - reference ZonedDateTime instance - never null;
@return ZonedDateTime instance, never null. Value obeys logic specified above.
@throws NoSuchValueException if there is no potential next year | [
"If",
"date",
"is",
"not",
"match",
"will",
"return",
"next",
"closest",
"match",
".",
"If",
"date",
"is",
"match",
"will",
"return",
"this",
"date",
"."
] | train | https://github.com/jmrozanec/cron-utils/blob/adac5ec8fd9160b082f9762a6eedea0715731170/src/main/java/com/cronutils/model/time/SingleExecutionTime.java#L122-L135 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/ResidueRange.java | ResidueRange.multiIterator | public static Iterator<ResidueNumber> multiIterator(AtomPositionMap map, List<? extends ResidueRange> rrs) {
"""
Returns a new Iterator over every {@link ResidueNumber} in the list of ResidueRanges.
Stores the contents of {@code map} until the iterator is finished, so calling code should set the iterator to {@cod... | java | public static Iterator<ResidueNumber> multiIterator(AtomPositionMap map, List<? extends ResidueRange> rrs) {
ResidueRange[] ranges = new ResidueRange[rrs.size()];
for (int i = 0; i < rrs.size(); i++) {
ranges[i] = rrs.get(i);
}
return multiIterator(map, ranges);
} | [
"public",
"static",
"Iterator",
"<",
"ResidueNumber",
">",
"multiIterator",
"(",
"AtomPositionMap",
"map",
",",
"List",
"<",
"?",
"extends",
"ResidueRange",
">",
"rrs",
")",
"{",
"ResidueRange",
"[",
"]",
"ranges",
"=",
"new",
"ResidueRange",
"[",
"rrs",
"."... | Returns a new Iterator over every {@link ResidueNumber} in the list of ResidueRanges.
Stores the contents of {@code map} until the iterator is finished, so calling code should set the iterator to {@code null} if it did not finish. | [
"Returns",
"a",
"new",
"Iterator",
"over",
"every",
"{"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/ResidueRange.java#L346-L352 |
classgraph/classgraph | src/main/java/io/github/classgraph/Classfile.java | Classfile.constantPoolStringEquals | private boolean constantPoolStringEquals(final int cpIdx, final String asciiString)
throws ClassfileFormatException, IOException {
"""
Compare a string in the constant pool with a given ASCII string, without constructing the constant pool
String object.
@param cpIdx
the constant pool index
@param... | java | private boolean constantPoolStringEquals(final int cpIdx, final String asciiString)
throws ClassfileFormatException, IOException {
final int strOffset = getConstantPoolStringOffset(cpIdx, /* subFieldIdx = */ 0);
if (strOffset == 0) {
return asciiString == null;
} else if ... | [
"private",
"boolean",
"constantPoolStringEquals",
"(",
"final",
"int",
"cpIdx",
",",
"final",
"String",
"asciiString",
")",
"throws",
"ClassfileFormatException",
",",
"IOException",
"{",
"final",
"int",
"strOffset",
"=",
"getConstantPoolStringOffset",
"(",
"cpIdx",
",... | Compare a string in the constant pool with a given ASCII string, without constructing the constant pool
String object.
@param cpIdx
the constant pool index
@param asciiString
the ASCII string to compare to
@return true, if successful
@throws ClassfileFormatException
If a problem occurs.
@throws IOException
If an IO ex... | [
"Compare",
"a",
"string",
"in",
"the",
"constant",
"pool",
"with",
"a",
"given",
"ASCII",
"string",
"without",
"constructing",
"the",
"constant",
"pool",
"String",
"object",
"."
] | train | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/Classfile.java#L661-L681 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/util/MethodUtils.java | MethodUtils.invokeMethod | public static Object invokeMethod(Object object, String methodName, Object[] args)
throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
"""
<p>Invoke a named method whose parameter type matches the object type.</p>
<p>The behaviour of this method is less deterministic
t... | java | public static Object invokeMethod(Object object, String methodName, Object[] args)
throws NoSuchMethodException, IllegalAccessException, InvocationTargetException {
Class<?>[] paramTypes;
if (args == null) {
args = EMPTY_OBJECT_ARRAY;
paramTypes = EMPTY_CLASS_PARAMET... | [
"public",
"static",
"Object",
"invokeMethod",
"(",
"Object",
"object",
",",
"String",
"methodName",
",",
"Object",
"[",
"]",
"args",
")",
"throws",
"NoSuchMethodException",
",",
"IllegalAccessException",
",",
"InvocationTargetException",
"{",
"Class",
"<",
"?",
">... | <p>Invoke a named method whose parameter type matches the object type.</p>
<p>The behaviour of this method is less deterministic
than {@link #invokeExactMethod(Object object,String methodName,Object[] args)}.
It loops through all methods with names that match
and then executes the first it finds with compatible parame... | [
"<p",
">",
"Invoke",
"a",
"named",
"method",
"whose",
"parameter",
"type",
"matches",
"the",
"object",
"type",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/util/MethodUtils.java#L211-L233 |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapred/SimulatedTaskRunner.java | SimulatedTaskRunner.addTipToFinish | protected void addTipToFinish(TaskInProgress tip,
TaskUmbilicalProtocol umbilicalProtocol) {
"""
Add the specified TaskInProgress to the priority queue of tasks to finish.
@param tip
@param umbilicalProtocol
"""
long currentTime = System.currentTimeMillis();
long finis... | java | protected void addTipToFinish(TaskInProgress tip,
TaskUmbilicalProtocol umbilicalProtocol) {
long currentTime = System.currentTimeMillis();
long finishTime = currentTime + Math.abs(rand.nextLong()) %
timeToFinishTask;
LOG.info("Adding TIP " + tip.getTask().getTaskID()... | [
"protected",
"void",
"addTipToFinish",
"(",
"TaskInProgress",
"tip",
",",
"TaskUmbilicalProtocol",
"umbilicalProtocol",
")",
"{",
"long",
"currentTime",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"long",
"finishTime",
"=",
"currentTime",
"+",
"Math",
... | Add the specified TaskInProgress to the priority queue of tasks to finish.
@param tip
@param umbilicalProtocol | [
"Add",
"the",
"specified",
"TaskInProgress",
"to",
"the",
"priority",
"queue",
"of",
"tasks",
"to",
"finish",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapred/SimulatedTaskRunner.java#L169-L184 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java | StringBuilders.appendDqValue | public static StringBuilder appendDqValue(final StringBuilder sb, final Object value) {
"""
Appends in the following format: double quoted value.
@param sb a string builder
@param value a value
@return {@code "value"}
"""
return sb.append(Chars.DQUOTE).append(value).append(Chars.DQUOTE);
} | java | public static StringBuilder appendDqValue(final StringBuilder sb, final Object value) {
return sb.append(Chars.DQUOTE).append(value).append(Chars.DQUOTE);
} | [
"public",
"static",
"StringBuilder",
"appendDqValue",
"(",
"final",
"StringBuilder",
"sb",
",",
"final",
"Object",
"value",
")",
"{",
"return",
"sb",
".",
"append",
"(",
"Chars",
".",
"DQUOTE",
")",
".",
"append",
"(",
"value",
")",
".",
"append",
"(",
"... | Appends in the following format: double quoted value.
@param sb a string builder
@param value a value
@return {@code "value"} | [
"Appends",
"in",
"the",
"following",
"format",
":",
"double",
"quoted",
"value",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/util/StringBuilders.java#L37-L39 |
mapsforge/mapsforge | mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/util/GeoUtils.java | GeoUtils.deltaLat | private static double deltaLat(double deltaPixel, double lat, byte zoom, int tileSize) {
"""
Computes the amount of latitude degrees for a given distance in pixel at a given zoom level.
"""
long mapSize = MercatorProjection.getMapSize(zoom, tileSize);
double pixelY = MercatorProjection.latitude... | java | private static double deltaLat(double deltaPixel, double lat, byte zoom, int tileSize) {
long mapSize = MercatorProjection.getMapSize(zoom, tileSize);
double pixelY = MercatorProjection.latitudeToPixelY(lat, mapSize);
double lat2 = MercatorProjection.pixelYToLatitude(pixelY + deltaPixel, mapSize... | [
"private",
"static",
"double",
"deltaLat",
"(",
"double",
"deltaPixel",
",",
"double",
"lat",
",",
"byte",
"zoom",
",",
"int",
"tileSize",
")",
"{",
"long",
"mapSize",
"=",
"MercatorProjection",
".",
"getMapSize",
"(",
"zoom",
",",
"tileSize",
")",
";",
"d... | Computes the amount of latitude degrees for a given distance in pixel at a given zoom level. | [
"Computes",
"the",
"amount",
"of",
"latitude",
"degrees",
"for",
"a",
"given",
"distance",
"in",
"pixel",
"at",
"a",
"given",
"zoom",
"level",
"."
] | train | https://github.com/mapsforge/mapsforge/blob/c49c83f7f727552f793dff15cefa532ade030842/mapsforge-map-writer/src/main/java/org/mapsforge/map/writer/util/GeoUtils.java#L437-L443 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLLiteralImplFloat_CustomFieldSerializer.java | OWLLiteralImplFloat_CustomFieldSerializer.deserializeInstance | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLLiteralImplFloat instance) throws SerializationException {
"""
Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google.gwt.u... | java | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLLiteralImplFloat instance) throws SerializationException {
deserialize(streamReader, instance);
} | [
"@",
"Override",
"public",
"void",
"deserializeInstance",
"(",
"SerializationStreamReader",
"streamReader",
",",
"OWLLiteralImplFloat",
"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.clie... | [
"Deserializes",
"the",
"content",
"of",
"the",
"object",
"from",
"the",
"{"
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLLiteralImplFloat_CustomFieldSerializer.java#L86-L89 |
alkacon/opencms-core | src/org/opencms/main/CmsShellCommands.java | CmsShellCommands.exportAllResources | public void exportAllResources(String exportFile, boolean isReducedExportMode) throws Exception {
"""
Exports all resources from the current site root to a ZIP file.<p>
@param exportFile the name (absolute path) of the ZIP file to export to
@param isReducedExportMode flag, indicating if the reduced export mode... | java | public void exportAllResources(String exportFile, boolean isReducedExportMode) throws Exception {
List<String> exportPaths = new ArrayList<String>(1);
exportPaths.add("/");
CmsVfsImportExportHandler vfsExportHandler = new CmsVfsImportExportHandler();
CmsExportParameters params = new Cm... | [
"public",
"void",
"exportAllResources",
"(",
"String",
"exportFile",
",",
"boolean",
"isReducedExportMode",
")",
"throws",
"Exception",
"{",
"List",
"<",
"String",
">",
"exportPaths",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
"1",
")",
";",
"exportPath... | Exports all resources from the current site root to a ZIP file.<p>
@param exportFile the name (absolute path) of the ZIP file to export to
@param isReducedExportMode flag, indicating if the reduced export mode should be used
@throws Exception if something goes wrong | [
"Exports",
"all",
"resources",
"from",
"the",
"current",
"site",
"root",
"to",
"a",
"ZIP",
"file",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/main/CmsShellCommands.java#L585-L610 |
ttddyy/datasource-proxy | src/main/java/net/ttddyy/dsproxy/support/ProxyDataSourceBuilder.java | ProxyDataSourceBuilder.logSlowQueryByJUL | public ProxyDataSourceBuilder logSlowQueryByJUL(long thresholdTime, TimeUnit timeUnit, String loggerName) {
"""
Register {@link JULSlowQueryListener}.
@param thresholdTime slow query threshold time
@param timeUnit slow query threshold time unit
@param loggerName JUL logger name
@return builder
@sinc... | java | public ProxyDataSourceBuilder logSlowQueryByJUL(long thresholdTime, TimeUnit timeUnit, String loggerName) {
return logSlowQueryByJUL(thresholdTime, timeUnit, null, loggerName);
} | [
"public",
"ProxyDataSourceBuilder",
"logSlowQueryByJUL",
"(",
"long",
"thresholdTime",
",",
"TimeUnit",
"timeUnit",
",",
"String",
"loggerName",
")",
"{",
"return",
"logSlowQueryByJUL",
"(",
"thresholdTime",
",",
"timeUnit",
",",
"null",
",",
"loggerName",
")",
";",... | Register {@link JULSlowQueryListener}.
@param thresholdTime slow query threshold time
@param timeUnit slow query threshold time unit
@param loggerName JUL logger name
@return builder
@since 1.4.1 | [
"Register",
"{",
"@link",
"JULSlowQueryListener",
"}",
"."
] | train | https://github.com/ttddyy/datasource-proxy/blob/62163ccf9a569a99aa3ad9f9151a32567447a62e/src/main/java/net/ttddyy/dsproxy/support/ProxyDataSourceBuilder.java#L465-L467 |
ThreeTen/threetenbp | src/main/java/org/threeten/bp/zone/ZoneOffsetTransitionRule.java | ZoneOffsetTransitionRule.createTransition | public ZoneOffsetTransition createTransition(int year) {
"""
Creates a transition instance for the specified year.
<p>
Calculations are performed using the ISO-8601 chronology.
@param year the year to create a transition for, not null
@return the transition instance, not null
"""
LocalDate date;... | java | public ZoneOffsetTransition createTransition(int year) {
LocalDate date;
if (dom < 0) {
date = LocalDate.of(year, month, month.length(IsoChronology.INSTANCE.isLeapYear(year)) + 1 + dom);
if (dow != null) {
date = date.with(previousOrSame(dow));
}
... | [
"public",
"ZoneOffsetTransition",
"createTransition",
"(",
"int",
"year",
")",
"{",
"LocalDate",
"date",
";",
"if",
"(",
"dom",
"<",
"0",
")",
"{",
"date",
"=",
"LocalDate",
".",
"of",
"(",
"year",
",",
"month",
",",
"month",
".",
"length",
"(",
"IsoCh... | Creates a transition instance for the specified year.
<p>
Calculations are performed using the ISO-8601 chronology.
@param year the year to create a transition for, not null
@return the transition instance, not null | [
"Creates",
"a",
"transition",
"instance",
"for",
"the",
"specified",
"year",
".",
"<p",
">",
"Calculations",
"are",
"performed",
"using",
"the",
"ISO",
"-",
"8601",
"chronology",
"."
] | train | https://github.com/ThreeTen/threetenbp/blob/5f05b649f89f205aabd96b2f83c36796ec616fe6/src/main/java/org/threeten/bp/zone/ZoneOffsetTransitionRule.java#L410-L426 |
jnr/jnr-x86asm | src/main/java/jnr/x86asm/Asm.java | Asm.tword_ptr_abs | public static final Mem tword_ptr_abs(long target, long disp, SEGMENT segmentPrefix) {
"""
Create tword (10 Bytes) pointer operand (used for 80 bit floating points).
"""
return _ptr_build_abs(target, disp, segmentPrefix, SIZE_TWORD);
} | java | public static final Mem tword_ptr_abs(long target, long disp, SEGMENT segmentPrefix) {
return _ptr_build_abs(target, disp, segmentPrefix, SIZE_TWORD);
} | [
"public",
"static",
"final",
"Mem",
"tword_ptr_abs",
"(",
"long",
"target",
",",
"long",
"disp",
",",
"SEGMENT",
"segmentPrefix",
")",
"{",
"return",
"_ptr_build_abs",
"(",
"target",
",",
"disp",
",",
"segmentPrefix",
",",
"SIZE_TWORD",
")",
";",
"}"
] | Create tword (10 Bytes) pointer operand (used for 80 bit floating points). | [
"Create",
"tword",
"(",
"10",
"Bytes",
")",
"pointer",
"operand",
"(",
"used",
"for",
"80",
"bit",
"floating",
"points",
")",
"."
] | train | https://github.com/jnr/jnr-x86asm/blob/fdcf68fb3dae49e607a49e33399e3dad1ada5536/src/main/java/jnr/x86asm/Asm.java#L421-L423 |
threerings/gwt-utils | src/main/java/com/threerings/gwt/ui/Popups.java | Popups.infoOn | public static InfoPopup infoOn (String message, Widget target) {
"""
Displays an info message centered horizontally on the page and centered vertically on the
specified target widget.
"""
return centerOn(new InfoPopup(message), target);
} | java | public static InfoPopup infoOn (String message, Widget target)
{
return centerOn(new InfoPopup(message), target);
} | [
"public",
"static",
"InfoPopup",
"infoOn",
"(",
"String",
"message",
",",
"Widget",
"target",
")",
"{",
"return",
"centerOn",
"(",
"new",
"InfoPopup",
"(",
"message",
")",
",",
"target",
")",
";",
"}"
] | Displays an info message centered horizontally on the page and centered vertically on the
specified target widget. | [
"Displays",
"an",
"info",
"message",
"centered",
"horizontally",
"on",
"the",
"page",
"and",
"centered",
"vertically",
"on",
"the",
"specified",
"target",
"widget",
"."
] | train | https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Popups.java#L93-L96 |
gosu-lang/gosu-lang | gosu-core/src/main/java/gw/internal/gosu/ir/transform/expression/AbstractMemberExpansionTransformer.java | AbstractMemberExpansionTransformer.compileExpansionDirectlyToArray | protected IRExpression compileExpansionDirectlyToArray( IType rootType, IType rootComponentType, IType resultType, IType resultCompType ) {
"""
If this method is being called, it means we're expanding a one-dimensional array or collection, with a right hand side
that evaluates to a property that's not an array or... | java | protected IRExpression compileExpansionDirectlyToArray( IType rootType, IType rootComponentType, IType resultType, IType resultCompType ) {
// Evaluate the root and assign it to a temp variable
IRSymbol tempRoot = _cc().makeAndIndexTempSymbol( getDescriptor( rootType ) );
IRStatement tempRootAssignment = bu... | [
"protected",
"IRExpression",
"compileExpansionDirectlyToArray",
"(",
"IType",
"rootType",
",",
"IType",
"rootComponentType",
",",
"IType",
"resultType",
",",
"IType",
"resultCompType",
")",
"{",
"// Evaluate the root and assign it to a temp variable",
"IRSymbol",
"tempRoot",
... | If this method is being called, it means we're expanding a one-dimensional array or collection, with a right hand side
that evaluates to a property that's not an array or collection. In that case, we build up an array and simply store
values directly into it. We also null-short-circuit in the event that the root is n... | [
"If",
"this",
"method",
"is",
"being",
"called",
"it",
"means",
"we",
"re",
"expanding",
"a",
"one",
"-",
"dimensional",
"array",
"or",
"collection",
"with",
"a",
"right",
"hand",
"side",
"that",
"evaluates",
"to",
"a",
"property",
"that",
"s",
"not",
"a... | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core/src/main/java/gw/internal/gosu/ir/transform/expression/AbstractMemberExpansionTransformer.java#L135-L163 |
geomajas/geomajas-project-client-gwt2 | impl/src/main/java/org/geomajas/gwt2/client/service/JsonService.java | JsonService.getChildArray | public static JSONArray getChildArray(JSONObject jsonObject, String key) throws JSONException {
"""
Get a child JSON array from a parent JSON object.
@param jsonObject The parent JSON object.
@param key The name of the child object.
@return Returns the child JSON array if it could be found, or null if the val... | java | public static JSONArray getChildArray(JSONObject jsonObject, String key) throws JSONException {
checkArguments(jsonObject, key);
JSONValue value = jsonObject.get(key);
if (value != null) {
if (value.isArray() != null) {
return value.isArray();
} else if (value.isNull() != null) {
return null;
}
... | [
"public",
"static",
"JSONArray",
"getChildArray",
"(",
"JSONObject",
"jsonObject",
",",
"String",
"key",
")",
"throws",
"JSONException",
"{",
"checkArguments",
"(",
"jsonObject",
",",
"key",
")",
";",
"JSONValue",
"value",
"=",
"jsonObject",
".",
"get",
"(",
"... | Get a child JSON array from a parent JSON object.
@param jsonObject The parent JSON object.
@param key The name of the child object.
@return Returns the child JSON array if it could be found, or null if the value was null.
@throws JSONException In case something went wrong while searching for the child. | [
"Get",
"a",
"child",
"JSON",
"array",
"from",
"a",
"parent",
"JSON",
"object",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/impl/src/main/java/org/geomajas/gwt2/client/service/JsonService.java#L116-L128 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/DOMHelper.java | DOMHelper.isNodeTheSame | public static boolean isNodeTheSame(Node node1, Node node2) {
"""
Use DTMNodeProxy to determine whether two nodes are the same.
@param node1 The first DOM node to compare.
@param node2 The second DOM node to compare.
@return true if the two nodes are the same.
"""
if (node1 instanceof DTMNodeProxy && ... | java | public static boolean isNodeTheSame(Node node1, Node node2)
{
if (node1 instanceof DTMNodeProxy && node2 instanceof DTMNodeProxy)
return ((DTMNodeProxy)node1).equals((DTMNodeProxy)node2);
else
return (node1 == node2);
} | [
"public",
"static",
"boolean",
"isNodeTheSame",
"(",
"Node",
"node1",
",",
"Node",
"node2",
")",
"{",
"if",
"(",
"node1",
"instanceof",
"DTMNodeProxy",
"&&",
"node2",
"instanceof",
"DTMNodeProxy",
")",
"return",
"(",
"(",
"DTMNodeProxy",
")",
"node1",
")",
"... | Use DTMNodeProxy to determine whether two nodes are the same.
@param node1 The first DOM node to compare.
@param node2 The second DOM node to compare.
@return true if the two nodes are the same. | [
"Use",
"DTMNodeProxy",
"to",
"determine",
"whether",
"two",
"nodes",
"are",
"the",
"same",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/utils/DOMHelper.java#L339-L345 |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/services/DefaultMetadataService.java | DefaultMetadataService.createType | @Override
public JSONObject createType(String typeDefinition) throws AtlasException {
"""
Creates a new type based on the type system to enable adding
entities (instances for types).
@param typeDefinition definition as json
@return a unique id for this type
"""
return createOrUpdateTypes(Opera... | java | @Override
public JSONObject createType(String typeDefinition) throws AtlasException {
return createOrUpdateTypes(OperationType.CREATE, typeDefinition, false);
} | [
"@",
"Override",
"public",
"JSONObject",
"createType",
"(",
"String",
"typeDefinition",
")",
"throws",
"AtlasException",
"{",
"return",
"createOrUpdateTypes",
"(",
"OperationType",
".",
"CREATE",
",",
"typeDefinition",
",",
"false",
")",
";",
"}"
] | Creates a new type based on the type system to enable adding
entities (instances for types).
@param typeDefinition definition as json
@return a unique id for this type | [
"Creates",
"a",
"new",
"type",
"based",
"on",
"the",
"type",
"system",
"to",
"enable",
"adding",
"entities",
"(",
"instances",
"for",
"types",
")",
"."
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/services/DefaultMetadataService.java#L166-L169 |
elki-project/elki | elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/normalization/columnwise/AttributeWiseCDFNormalization.java | AttributeWiseCDFNormalization.constantZero | protected boolean constantZero(List<V> column, Adapter adapter) {
"""
Test if an attribute is constant zero.
@param column Column
@param adapter Data accessor.
@return {@code true} if all values are zero
"""
for(int i = 0, s = adapter.size(column); i < s; i++) {
if(adapter.get(column, i) != 0.) ... | java | protected boolean constantZero(List<V> column, Adapter adapter) {
for(int i = 0, s = adapter.size(column); i < s; i++) {
if(adapter.get(column, i) != 0.) {
return false;
}
}
return true;
} | [
"protected",
"boolean",
"constantZero",
"(",
"List",
"<",
"V",
">",
"column",
",",
"Adapter",
"adapter",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"s",
"=",
"adapter",
".",
"size",
"(",
"column",
")",
";",
"i",
"<",
"s",
";",
"i",
"++",
... | Test if an attribute is constant zero.
@param column Column
@param adapter Data accessor.
@return {@code true} if all values are zero | [
"Test",
"if",
"an",
"attribute",
"is",
"constant",
"zero",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-input/src/main/java/de/lmu/ifi/dbs/elki/datasource/filter/normalization/columnwise/AttributeWiseCDFNormalization.java#L210-L217 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/FacesImpl.java | FacesImpl.detectWithUrlWithServiceResponseAsync | public Observable<ServiceResponse<List<DetectedFace>>> detectWithUrlWithServiceResponseAsync(String url, DetectWithUrlOptionalParameter detectWithUrlOptionalParameter) {
"""
Detect human faces in an image and returns face locations, and optionally with faceIds, landmarks, and attributes.
@param url Publicly rea... | java | public Observable<ServiceResponse<List<DetectedFace>>> detectWithUrlWithServiceResponseAsync(String url, DetectWithUrlOptionalParameter detectWithUrlOptionalParameter) {
if (this.client.azureRegion() == null) {
throw new IllegalArgumentException("Parameter this.client.azureRegion() is required and c... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"List",
"<",
"DetectedFace",
">",
">",
">",
"detectWithUrlWithServiceResponseAsync",
"(",
"String",
"url",
",",
"DetectWithUrlOptionalParameter",
"detectWithUrlOptionalParameter",
")",
"{",
"if",
"(",
"this",
".",
"... | Detect human faces in an image and returns face locations, and optionally with faceIds, landmarks, and attributes.
@param url Publicly reachable URL of an image
@param detectWithUrlOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException throw... | [
"Detect",
"human",
"faces",
"in",
"an",
"image",
"and",
"returns",
"face",
"locations",
"and",
"optionally",
"with",
"faceIds",
"landmarks",
"and",
"attributes",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/FacesImpl.java#L699-L711 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateTimePatternGenerator.java | DateTimePatternGenerator.getCanonicalChar | private static char getCanonicalChar(int field, char reference) {
"""
Gets the canonical character associated with the specified field (ERA, YEAR, etc).
"""
// Special case: distinguish between 12-hour and 24-hour
if (reference == 'h' || reference == 'K') {
return 'h';
}
... | java | private static char getCanonicalChar(int field, char reference) {
// Special case: distinguish between 12-hour and 24-hour
if (reference == 'h' || reference == 'K') {
return 'h';
}
// Linear search over types (return the top entry for each field)
for (int i = 0; i < ... | [
"private",
"static",
"char",
"getCanonicalChar",
"(",
"int",
"field",
",",
"char",
"reference",
")",
"{",
"// Special case: distinguish between 12-hour and 24-hour",
"if",
"(",
"reference",
"==",
"'",
"'",
"||",
"reference",
"==",
"'",
"'",
")",
"{",
"return",
"... | Gets the canonical character associated with the specified field (ERA, YEAR, etc). | [
"Gets",
"the",
"canonical",
"character",
"associated",
"with",
"the",
"specified",
"field",
"(",
"ERA",
"YEAR",
"etc",
")",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateTimePatternGenerator.java#L2112-L2126 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/sequencevectors/listeners/SerializingListener.java | SerializingListener.processEvent | @Override
public void processEvent(ListenerEvent event, SequenceVectors<T> sequenceVectors, long argument) {
"""
This method is called at each epoch end
@param event
@param sequenceVectors
@param argument
"""
try {
locker.acquire();
SimpleDateFormat sdf = new SimpleDat... | java | @Override
public void processEvent(ListenerEvent event, SequenceVectors<T> sequenceVectors, long argument) {
try {
locker.acquire();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");
StringBuilder builder = new StringBuilder(targetFolder.getAbsolut... | [
"@",
"Override",
"public",
"void",
"processEvent",
"(",
"ListenerEvent",
"event",
",",
"SequenceVectors",
"<",
"T",
">",
"sequenceVectors",
",",
"long",
"argument",
")",
"{",
"try",
"{",
"locker",
".",
"acquire",
"(",
")",
";",
"SimpleDateFormat",
"sdf",
"="... | This method is called at each epoch end
@param event
@param sequenceVectors
@param argument | [
"This",
"method",
"is",
"called",
"at",
"each",
"epoch",
"end"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/sequencevectors/listeners/SerializingListener.java#L81-L103 |
SeleniumHQ/selenium | java/server/src/org/openqa/grid/internal/utils/configuration/StandaloneConfiguration.java | StandaloneConfiguration.loadJsonFromResourceOrFile | protected static JsonInput loadJsonFromResourceOrFile(String resource) {
"""
load a JSON file from the resource or file system. As a fallback, treats {@code resource} as a
JSON string to be parsed.
@param resource file or jar resource location
@return A JsonObject representing the passed resource argument.
... | java | protected static JsonInput loadJsonFromResourceOrFile(String resource) {
try {
return new Json().newInput(readFileOrResource(resource));
} catch (RuntimeException e) {
throw new GridConfigurationException("Unable to read input", e);
}
} | [
"protected",
"static",
"JsonInput",
"loadJsonFromResourceOrFile",
"(",
"String",
"resource",
")",
"{",
"try",
"{",
"return",
"new",
"Json",
"(",
")",
".",
"newInput",
"(",
"readFileOrResource",
"(",
"resource",
")",
")",
";",
"}",
"catch",
"(",
"RuntimeExcepti... | load a JSON file from the resource or file system. As a fallback, treats {@code resource} as a
JSON string to be parsed.
@param resource file or jar resource location
@return A JsonObject representing the passed resource argument. | [
"load",
"a",
"JSON",
"file",
"from",
"the",
"resource",
"or",
"file",
"system",
".",
"As",
"a",
"fallback",
"treats",
"{",
"@code",
"resource",
"}",
"as",
"a",
"JSON",
"string",
"to",
"be",
"parsed",
"."
] | train | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/server/src/org/openqa/grid/internal/utils/configuration/StandaloneConfiguration.java#L304-L310 |
landawn/AbacusUtil | src/com/landawn/abacus/util/LongMultiset.java | LongMultiset.getAndSet | public long getAndSet(final T e, final long occurrences) {
"""
The element will be removed if the specified count is 0.
@param e
@param occurrences
@return
"""
checkOccurrences(occurrences);
final MutableLong count = valueMap.get(e);
long result = count == null ? 0 : count.val... | java | public long getAndSet(final T e, final long occurrences) {
checkOccurrences(occurrences);
final MutableLong count = valueMap.get(e);
long result = count == null ? 0 : count.value();
if (occurrences == 0) {
if (count != null) {
valueMap.remove(e);
... | [
"public",
"long",
"getAndSet",
"(",
"final",
"T",
"e",
",",
"final",
"long",
"occurrences",
")",
"{",
"checkOccurrences",
"(",
"occurrences",
")",
";",
"final",
"MutableLong",
"count",
"=",
"valueMap",
".",
"get",
"(",
"e",
")",
";",
"long",
"result",
"=... | The element will be removed if the specified count is 0.
@param e
@param occurrences
@return | [
"The",
"element",
"will",
"be",
"removed",
"if",
"the",
"specified",
"count",
"is",
"0",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/LongMultiset.java#L201-L220 |
Impetus/Kundera | src/jpa-engine/fallback-impl/src/main/java/com/impetus/kundera/index/DocumentIndexer.java | DocumentIndexer.addSuperColumnNameToDocument | private void addSuperColumnNameToDocument(String superColumnName, Document currentDoc) {
"""
Index super column name.
@param superColumnName
the super column name
@param currentDoc
the current doc
"""
Field luceneField = new Field(SUPERCOLUMN_INDEX, superColumnName, Store.YES, Field.Index.NO);
... | java | private void addSuperColumnNameToDocument(String superColumnName, Document currentDoc) {
Field luceneField = new Field(SUPERCOLUMN_INDEX, superColumnName, Store.YES, Field.Index.NO);
currentDoc.add(luceneField);
} | [
"private",
"void",
"addSuperColumnNameToDocument",
"(",
"String",
"superColumnName",
",",
"Document",
"currentDoc",
")",
"{",
"Field",
"luceneField",
"=",
"new",
"Field",
"(",
"SUPERCOLUMN_INDEX",
",",
"superColumnName",
",",
"Store",
".",
"YES",
",",
"Field",
"."... | Index super column name.
@param superColumnName
the super column name
@param currentDoc
the current doc | [
"Index",
"super",
"column",
"name",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/fallback-impl/src/main/java/com/impetus/kundera/index/DocumentIndexer.java#L232-L235 |
Erudika/para | para-client/src/main/java/com/erudika/para/client/ParaClient.java | ParaClient.findSimilar | public <P extends ParaObject> List<P> findSimilar(String type, String filterKey, String[] fields, String liketext,
Pager... pager) {
"""
Searches for objects that have similar property values to a given text. A "find like this" query.
@param <P> type of the object
@param type the type of object to search for.... | java | public <P extends ParaObject> List<P> findSimilar(String type, String filterKey, String[] fields, String liketext,
Pager... pager) {
MultivaluedMap<String, String> params = new MultivaluedHashMap<>();
params.put("fields", fields == null ? null : Arrays.asList(fields));
params.putSingle("filterid", filterKey);
... | [
"public",
"<",
"P",
"extends",
"ParaObject",
">",
"List",
"<",
"P",
">",
"findSimilar",
"(",
"String",
"type",
",",
"String",
"filterKey",
",",
"String",
"[",
"]",
"fields",
",",
"String",
"liketext",
",",
"Pager",
"...",
"pager",
")",
"{",
"MultivaluedM... | Searches for objects that have similar property values to a given text. A "find like this" query.
@param <P> type of the object
@param type the type of object to search for. See {@link com.erudika.para.core.ParaObject#getType()}
@param filterKey exclude an object with this key from the results (optional)
@param fields ... | [
"Searches",
"for",
"objects",
"that",
"have",
"similar",
"property",
"values",
"to",
"a",
"given",
"text",
".",
"A",
"find",
"like",
"this",
"query",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-client/src/main/java/com/erudika/para/client/ParaClient.java#L761-L770 |
atomix/atomix | utils/src/main/java/io/atomix/utils/concurrent/AbstractAccumulator.java | AbstractAccumulator.rescheduleTask | private void rescheduleTask(AtomicReference<TimerTask> taskRef, long millis) {
"""
Reschedules the specified task, cancelling existing one if applicable.
@param taskRef task reference
@param millis delay in milliseconds
"""
ProcessorTask newTask = new ProcessorTask();
timer.schedule(newTask, milli... | java | private void rescheduleTask(AtomicReference<TimerTask> taskRef, long millis) {
ProcessorTask newTask = new ProcessorTask();
timer.schedule(newTask, millis);
swapAndCancelTask(taskRef, newTask);
} | [
"private",
"void",
"rescheduleTask",
"(",
"AtomicReference",
"<",
"TimerTask",
">",
"taskRef",
",",
"long",
"millis",
")",
"{",
"ProcessorTask",
"newTask",
"=",
"new",
"ProcessorTask",
"(",
")",
";",
"timer",
".",
"schedule",
"(",
"newTask",
",",
"millis",
"... | Reschedules the specified task, cancelling existing one if applicable.
@param taskRef task reference
@param millis delay in milliseconds | [
"Reschedules",
"the",
"specified",
"task",
"cancelling",
"existing",
"one",
"if",
"applicable",
"."
] | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/utils/src/main/java/io/atomix/utils/concurrent/AbstractAccumulator.java#L124-L128 |
derari/cthul | objects/src/main/java/org/cthul/objects/reflection/Signatures.java | Signatures.candidateConstructors | public static <T> Constructor<T>[] candidateConstructors(Constructor<T>[] constructors, Object[] args) {
"""
Selects the best equally-matching constructors for the given arguments.
@param <T>
@param constructors
@param args
@return constructors
"""
return candidateConstructors(constructors, collec... | java | public static <T> Constructor<T>[] candidateConstructors(Constructor<T>[] constructors, Object[] args) {
return candidateConstructors(constructors, collectArgTypes(args));
} | [
"public",
"static",
"<",
"T",
">",
"Constructor",
"<",
"T",
">",
"[",
"]",
"candidateConstructors",
"(",
"Constructor",
"<",
"T",
">",
"[",
"]",
"constructors",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"return",
"candidateConstructors",
"(",
"constructor... | Selects the best equally-matching constructors for the given arguments.
@param <T>
@param constructors
@param args
@return constructors | [
"Selects",
"the",
"best",
"equally",
"-",
"matching",
"constructors",
"for",
"the",
"given",
"arguments",
"."
] | train | https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/reflection/Signatures.java#L104-L106 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/URLConnectionTools.java | URLConnectionTools.doPOST | public static InputStream doPOST(URL url, String data) throws IOException {
"""
Do a POST to a URL and return the response stream for further processing elsewhere.
<p>
The caller is responsible to close the returned InputStream not to cause
resource leaks.
@param url the input URL to be read
@param data the ... | java | public static InputStream doPOST(URL url, String data) throws IOException
{
return doPOST(url,data,DEFAULT_CONNECTION_TIMEOUT);
} | [
"public",
"static",
"InputStream",
"doPOST",
"(",
"URL",
"url",
",",
"String",
"data",
")",
"throws",
"IOException",
"{",
"return",
"doPOST",
"(",
"url",
",",
"data",
",",
"DEFAULT_CONNECTION_TIMEOUT",
")",
";",
"}"
] | Do a POST to a URL and return the response stream for further processing elsewhere.
<p>
The caller is responsible to close the returned InputStream not to cause
resource leaks.
@param url the input URL to be read
@param data the post data
@return an {@link InputStream} of response
@throws IOException due to an error o... | [
"Do",
"a",
"POST",
"to",
"a",
"URL",
"and",
"return",
"the",
"response",
"stream",
"for",
"further",
"processing",
"elsewhere",
".",
"<p",
">",
"The",
"caller",
"is",
"responsible",
"to",
"close",
"the",
"returned",
"InputStream",
"not",
"to",
"cause",
"re... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/URLConnectionTools.java#L155-L158 |
esigate/esigate | esigate-server/src/main/java/org/esigate/server/EsigateServer.java | EsigateServer.getProperty | private static int getProperty(String prefix, String name, int defaultValue) {
"""
Get an integer from System properties
@param prefix
@param name
@param defaultValue
@return
"""
int result = defaultValue;
try {
result = Integer.parseInt(System.getProperty(prefix + name));
... | java | private static int getProperty(String prefix, String name, int defaultValue) {
int result = defaultValue;
try {
result = Integer.parseInt(System.getProperty(prefix + name));
} catch (NumberFormatException e) {
LOG.warn("Value for " + prefix + name + " must be an integer.... | [
"private",
"static",
"int",
"getProperty",
"(",
"String",
"prefix",
",",
"String",
"name",
",",
"int",
"defaultValue",
")",
"{",
"int",
"result",
"=",
"defaultValue",
";",
"try",
"{",
"result",
"=",
"Integer",
".",
"parseInt",
"(",
"System",
".",
"getPrope... | Get an integer from System properties
@param prefix
@param name
@param defaultValue
@return | [
"Get",
"an",
"integer",
"from",
"System",
"properties"
] | train | https://github.com/esigate/esigate/blob/50421fb224f16e1ec42715425109a72b3b55527b/esigate-server/src/main/java/org/esigate/server/EsigateServer.java#L87-L96 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/DwgUtil.java | DwgUtil.getDefaultDouble | public static Vector getDefaultDouble(int[] data, int offset, double defVal) throws Exception {
"""
Read a double value from a group of unsigned bytes and a default double
@param data Array of unsigned bytes obtained from the DWG binary file
@param offset The current bit offset where the value begins
@param d... | java | public static Vector getDefaultDouble(int[] data, int offset, double defVal) throws Exception {
int flags = ((Integer)getBits(data, 2, offset)).intValue();
int read = 2;
double val;
if (flags==0x0) {
val = defVal;
} else {
int _offset = offset + 2;
String dstr;
if (flags... | [
"public",
"static",
"Vector",
"getDefaultDouble",
"(",
"int",
"[",
"]",
"data",
",",
"int",
"offset",
",",
"double",
"defVal",
")",
"throws",
"Exception",
"{",
"int",
"flags",
"=",
"(",
"(",
"Integer",
")",
"getBits",
"(",
"data",
",",
"2",
",",
"offse... | Read a double value from a group of unsigned bytes and a default double
@param data Array of unsigned bytes obtained from the DWG binary file
@param offset The current bit offset where the value begins
@param defVal Default double value
@throws Exception If an unexpected bit value is found in the DWG file. Occurs
when... | [
"Read",
"a",
"double",
"value",
"from",
"a",
"group",
"of",
"unsigned",
"bytes",
"and",
"a",
"default",
"double"
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/DwgUtil.java#L177-L239 |
ops4j/org.ops4j.base | ops4j-base-lang/src/main/java/org/ops4j/lang/PostConditionException.java | PostConditionException.validateGreaterThan | public static void validateGreaterThan( Number value, Number limit, String identifier )
throws PostConditionException {
"""
Validates that the value is greater than a limit.
This method ensures that <code>value > limit</code>.
@param identifier The name of the object.
@param limit The limit tha... | java | public static void validateGreaterThan( Number value, Number limit, String identifier )
throws PostConditionException
{
if( value.doubleValue() > limit.doubleValue() )
{
return;
}
throw new PostConditionException( identifier + " was not greater than " + limit + ".... | [
"public",
"static",
"void",
"validateGreaterThan",
"(",
"Number",
"value",
",",
"Number",
"limit",
",",
"String",
"identifier",
")",
"throws",
"PostConditionException",
"{",
"if",
"(",
"value",
".",
"doubleValue",
"(",
")",
">",
"limit",
".",
"doubleValue",
"(... | Validates that the value is greater than a limit.
This method ensures that <code>value > limit</code>.
@param identifier The name of the object.
@param limit The limit that the value must exceed.
@param value The value to be tested.
@throws PostConditionException if the condition is not met. | [
"Validates",
"that",
"the",
"value",
"is",
"greater",
"than",
"a",
"limit",
"."
] | train | https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-lang/src/main/java/org/ops4j/lang/PostConditionException.java#L128-L136 |
respoke/respoke-sdk-android | respokeSDK/src/main/java/com/digium/respokesdk/RespokeEndpoint.java | RespokeEndpoint.startCall | public RespokeCall startCall(RespokeCall.Listener callListener, Context context, GLSurfaceView glView, boolean audioOnly) {
"""
Create a new call with audio and optionally video.
@param callListener A listener to receive notifications of call related events
@param context An application context with whi... | java | public RespokeCall startCall(RespokeCall.Listener callListener, Context context, GLSurfaceView glView, boolean audioOnly) {
RespokeCall call = null;
if ((null != signalingChannel) && (signalingChannel.connected)) {
call = new RespokeCall(signalingChannel, this, false);
call.setL... | [
"public",
"RespokeCall",
"startCall",
"(",
"RespokeCall",
".",
"Listener",
"callListener",
",",
"Context",
"context",
",",
"GLSurfaceView",
"glView",
",",
"boolean",
"audioOnly",
")",
"{",
"RespokeCall",
"call",
"=",
"null",
";",
"if",
"(",
"(",
"null",
"!=",
... | Create a new call with audio and optionally video.
@param callListener A listener to receive notifications of call related events
@param context An application context with which to access system resources
@param glView A GLSurfaceView into which video from the call should be rendered, or null if the cal... | [
"Create",
"a",
"new",
"call",
"with",
"audio",
"and",
"optionally",
"video",
"."
] | train | https://github.com/respoke/respoke-sdk-android/blob/34a15f0558d29b1f1bc8481bbc5c505e855e05ef/respokeSDK/src/main/java/com/digium/respokesdk/RespokeEndpoint.java#L145-L156 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/BidiTransform.java | BidiTransform.shapeArabic | private void shapeArabic(int digitsDir, int lettersDir) {
"""
Performs digit and letter shaping
@param digitsDir Digit shaping option that indicates whether the text
should be treated as logical or visual.
@param lettersDir Letter shaping option that indicates whether the text
should be treated as logical or... | java | private void shapeArabic(int digitsDir, int lettersDir) {
if (digitsDir == lettersDir) {
shapeArabic(shapingOptions | digitsDir);
} else {
/* Honor all shape options other than letters (not necessarily digits
only) */
shapeArabic((shapingOptions & ~Arab... | [
"private",
"void",
"shapeArabic",
"(",
"int",
"digitsDir",
",",
"int",
"lettersDir",
")",
"{",
"if",
"(",
"digitsDir",
"==",
"lettersDir",
")",
"{",
"shapeArabic",
"(",
"shapingOptions",
"|",
"digitsDir",
")",
";",
"}",
"else",
"{",
"/* Honor all shape options... | Performs digit and letter shaping
@param digitsDir Digit shaping option that indicates whether the text
should be treated as logical or visual.
@param lettersDir Letter shaping option that indicates whether the text
should be treated as logical or visual form (can mismatch the digit
option). | [
"Performs",
"digit",
"and",
"letter",
"shaping"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/BidiTransform.java#L350-L362 |
digitalpetri/ethernet-ip | cip-core/src/main/java/com/digitalpetri/enip/cip/structs/ForwardCloseRequest.java | ForwardCloseRequest.encodeConnectionPath | private static void encodeConnectionPath(PaddedEPath path, ByteBuf buffer) {
"""
Encode the connection path.
<p>
{@link PaddedEPath#encode(EPath, ByteBuf)} can't be used here because the {@link ForwardCloseRequest} has an
extra reserved byte after the connection path size for some reason.
@param path the {... | java | private static void encodeConnectionPath(PaddedEPath path, ByteBuf buffer) {
// length placeholder...
int lengthStartIndex = buffer.writerIndex();
buffer.writeByte(0);
// reserved
buffer.writeZero(1);
// encode the path segments...
int dataStartIndex = buffer.wr... | [
"private",
"static",
"void",
"encodeConnectionPath",
"(",
"PaddedEPath",
"path",
",",
"ByteBuf",
"buffer",
")",
"{",
"// length placeholder...",
"int",
"lengthStartIndex",
"=",
"buffer",
".",
"writerIndex",
"(",
")",
";",
"buffer",
".",
"writeByte",
"(",
"0",
")... | Encode the connection path.
<p>
{@link PaddedEPath#encode(EPath, ByteBuf)} can't be used here because the {@link ForwardCloseRequest} has an
extra reserved byte after the connection path size for some reason.
@param path the {@link PaddedEPath} to encode.
@param buffer the {@link ByteBuf} to encode into. | [
"Encode",
"the",
"connection",
"path",
".",
"<p",
">",
"{",
"@link",
"PaddedEPath#encode",
"(",
"EPath",
"ByteBuf",
")",
"}",
"can",
"t",
"be",
"used",
"here",
"because",
"the",
"{",
"@link",
"ForwardCloseRequest",
"}",
"has",
"an",
"extra",
"reserved",
"b... | train | https://github.com/digitalpetri/ethernet-ip/blob/de69faa04f658ff8a086e66012308db851b5b51a/cip-core/src/main/java/com/digitalpetri/enip/cip/structs/ForwardCloseRequest.java#L79-L109 |
greenmail-mail-test/greenmail | greenmail-spring/src/main/java/com/icegreen/greenmail/spring/GreenMailBean.java | GreenMailBean.sendEmail | public void sendEmail(final String theTo, final String theFrom, final String theSubject,
final String theContent) {
"""
Sends a mail message to the GreenMail server.
<p/>
Note: SMTP or SMTPS must be configured.
@param theTo the <em>TO</em> field.
@param theFrom the <em>FROM<... | java | public void sendEmail(final String theTo, final String theFrom, final String theSubject,
final String theContent) {
if (null == smtpServerSetup) {
throw new IllegalStateException("Can not send mail, no SMTP or SMTPS setup found");
}
GreenMailUtil.sendTextEma... | [
"public",
"void",
"sendEmail",
"(",
"final",
"String",
"theTo",
",",
"final",
"String",
"theFrom",
",",
"final",
"String",
"theSubject",
",",
"final",
"String",
"theContent",
")",
"{",
"if",
"(",
"null",
"==",
"smtpServerSetup",
")",
"{",
"throw",
"new",
"... | Sends a mail message to the GreenMail server.
<p/>
Note: SMTP or SMTPS must be configured.
@param theTo the <em>TO</em> field.
@param theFrom the <em>FROM</em>field.
@param theSubject the subject.
@param theContent the message content. | [
"Sends",
"a",
"mail",
"message",
"to",
"the",
"GreenMail",
"server",
".",
"<p",
"/",
">",
"Note",
":",
"SMTP",
"or",
"SMTPS",
"must",
"be",
"configured",
"."
] | train | https://github.com/greenmail-mail-test/greenmail/blob/6d19a62233d1ef6fedbbd1f6fdde2d28e713834a/greenmail-spring/src/main/java/com/icegreen/greenmail/spring/GreenMailBean.java#L395-L401 |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/config/LaunchConfigurationConfigurator.java | LaunchConfigurationConfigurator.setMainJavaClass | protected static void setMainJavaClass(ILaunchConfigurationWorkingCopy wc, String name) {
"""
Change the main java class within the given configuration.
@param wc the configuration to change.
@param name the qualified name of the main Java class.
@since 0.7
"""
wc.setAttribute(
IJavaLaunchConfigurat... | java | protected static void setMainJavaClass(ILaunchConfigurationWorkingCopy wc, String name) {
wc.setAttribute(
IJavaLaunchConfigurationConstants.ATTR_MAIN_TYPE_NAME,
name);
} | [
"protected",
"static",
"void",
"setMainJavaClass",
"(",
"ILaunchConfigurationWorkingCopy",
"wc",
",",
"String",
"name",
")",
"{",
"wc",
".",
"setAttribute",
"(",
"IJavaLaunchConfigurationConstants",
".",
"ATTR_MAIN_TYPE_NAME",
",",
"name",
")",
";",
"}"
] | Change the main java class within the given configuration.
@param wc the configuration to change.
@param name the qualified name of the main Java class.
@since 0.7 | [
"Change",
"the",
"main",
"java",
"class",
"within",
"the",
"given",
"configuration",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/config/LaunchConfigurationConfigurator.java#L201-L205 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/type/TypeHandlerUtils.java | TypeHandlerUtils.convertSqlXml | public static Object convertSqlXml(Connection conn, String value) throws SQLException {
"""
Transfers data from String into sql.SQLXML
@param conn connection for which sql.SQLXML object would be created
@param value String
@return sql.SQLXML from String
@throws SQLException
"""
return convertSql... | java | public static Object convertSqlXml(Connection conn, String value) throws SQLException {
return convertSqlXml(conn, value.getBytes());
} | [
"public",
"static",
"Object",
"convertSqlXml",
"(",
"Connection",
"conn",
",",
"String",
"value",
")",
"throws",
"SQLException",
"{",
"return",
"convertSqlXml",
"(",
"conn",
",",
"value",
".",
"getBytes",
"(",
")",
")",
";",
"}"
] | Transfers data from String into sql.SQLXML
@param conn connection for which sql.SQLXML object would be created
@param value String
@return sql.SQLXML from String
@throws SQLException | [
"Transfers",
"data",
"from",
"String",
"into",
"sql",
".",
"SQLXML"
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/type/TypeHandlerUtils.java#L305-L307 |
pwittchen/prefser | library/src/main/java/com/github/pwittchen/prefser/library/rx2/Prefser.java | Prefser.observePreferences | public Observable<String> observePreferences() {
"""
returns RxJava Observable from SharedPreferences used inside Prefser object.
You can subscribe this Observable and every time,
when SharedPreferences will change, subscriber will be notified
about that and you will be able to read
key of the value, which has... | java | public Observable<String> observePreferences() {
return Observable.create(new ObservableOnSubscribe<String>() {
@Override
public void subscribe(final @io.reactivex.annotations.NonNull ObservableEmitter<String> e) {
preferences.registerOnSharedPreferenceChangeListener(
new SharedPrefe... | [
"public",
"Observable",
"<",
"String",
">",
"observePreferences",
"(",
")",
"{",
"return",
"Observable",
".",
"create",
"(",
"new",
"ObservableOnSubscribe",
"<",
"String",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"subscribe",
"(",
"final",
"@",... | returns RxJava Observable from SharedPreferences used inside Prefser object.
You can subscribe this Observable and every time,
when SharedPreferences will change, subscriber will be notified
about that and you will be able to read
key of the value, which has been changed.
@return Observable with String containing key ... | [
"returns",
"RxJava",
"Observable",
"from",
"SharedPreferences",
"used",
"inside",
"Prefser",
"object",
".",
"You",
"can",
"subscribe",
"this",
"Observable",
"and",
"every",
"time",
"when",
"SharedPreferences",
"will",
"change",
"subscriber",
"will",
"be",
"notified"... | train | https://github.com/pwittchen/prefser/blob/7dc7f980eeb71fd5617f8c749050c2400e4fbb2f/library/src/main/java/com/github/pwittchen/prefser/library/rx2/Prefser.java#L281-L296 |
js-lib-com/template.xhtml | src/main/java/js/template/xhtml/ObjectOperator.java | ObjectOperator.doExec | @Override
protected Object doExec(Element element, Object scope, String propertyPath, Object... arguments) throws TemplateException {
"""
Execute object operator. This operator just returns the new object scope to be used by templates engine. Throws content
exception if given property path does not designate an... | java | @Override
protected Object doExec(Element element, Object scope, String propertyPath, Object... arguments) throws TemplateException {
if (!(propertyPath.equals(".") || isStrictObject(scope))) {
throw new TemplateException("OBJECT operator on element |%s| requires object scope but got value type |%s|.", element... | [
"@",
"Override",
"protected",
"Object",
"doExec",
"(",
"Element",
"element",
",",
"Object",
"scope",
",",
"String",
"propertyPath",
",",
"Object",
"...",
"arguments",
")",
"throws",
"TemplateException",
"{",
"if",
"(",
"!",
"(",
"propertyPath",
".",
"equals",
... | Execute object operator. This operator just returns the new object scope to be used by templates engine. Throws content
exception if given property path does not designate an existing object. If requested object is null warn the event and
return the null value. Templates engine consider returned null as fully processed... | [
"Execute",
"object",
"operator",
".",
"This",
"operator",
"just",
"returns",
"the",
"new",
"object",
"scope",
"to",
"be",
"used",
"by",
"templates",
"engine",
".",
"Throws",
"content",
"exception",
"if",
"given",
"property",
"path",
"does",
"not",
"designate",... | train | https://github.com/js-lib-com/template.xhtml/blob/d50cec08aca9ab9680baebe2a26a341c096564fb/src/main/java/js/template/xhtml/ObjectOperator.java#L73-L85 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.