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 |
|---|---|---|---|---|---|---|---|---|---|---|
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/user/UserCoreDao.java | UserCoreDao.buildColumnsAs | public String[] buildColumnsAs(List<TColumn> columns, String value) {
"""
Build "columns as" values for the table columns with the specified
columns as the specified value
@param columns
columns to include as value
@param value
"columns as" value for specified columns
@return "columns as" values
@since 2.... | java | public String[] buildColumnsAs(List<TColumn> columns, String value) {
String[] columnsArray = buildColumnsArray(columns);
return buildColumnsAs(columnsArray, value);
} | [
"public",
"String",
"[",
"]",
"buildColumnsAs",
"(",
"List",
"<",
"TColumn",
">",
"columns",
",",
"String",
"value",
")",
"{",
"String",
"[",
"]",
"columnsArray",
"=",
"buildColumnsArray",
"(",
"columns",
")",
";",
"return",
"buildColumnsAs",
"(",
"columnsAr... | Build "columns as" values for the table columns with the specified
columns as the specified value
@param columns
columns to include as value
@param value
"columns as" value for specified columns
@return "columns as" values
@since 2.0.0 | [
"Build",
"columns",
"as",
"values",
"for",
"the",
"table",
"columns",
"with",
"the",
"specified",
"columns",
"as",
"the",
"specified",
"value"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/user/UserCoreDao.java#L1553-L1558 |
foundation-runtime/service-directory | 1.2/sd-api/src/main/java/com/cisco/oss/foundation/directory/lookup/LookupManagerImpl.java | LookupManagerImpl.addNotificationHandler | @Override
public void addNotificationHandler(String serviceName, NotificationHandler handler) throws ServiceException {
"""
Add a NotificationHandler to the Service.
This method can check the duplicated NotificationHandler for the serviceName, if the NotificationHandler
already exists for the serviceName, ... | java | @Override
public void addNotificationHandler(String serviceName, NotificationHandler handler) throws ServiceException {
ServiceInstanceUtils.validateManagerIsStarted(isStarted.get());
ServiceInstanceUtils.validateServiceName(serviceName);
if (handler == null) {
throw new Service... | [
"@",
"Override",
"public",
"void",
"addNotificationHandler",
"(",
"String",
"serviceName",
",",
"NotificationHandler",
"handler",
")",
"throws",
"ServiceException",
"{",
"ServiceInstanceUtils",
".",
"validateManagerIsStarted",
"(",
"isStarted",
".",
"get",
"(",
")",
"... | Add a NotificationHandler to the Service.
This method can check the duplicated NotificationHandler for the serviceName, if the NotificationHandler
already exists for the serviceName, do nothing.
Throws IllegalArgumentException if serviceName or handler is null.
@param serviceName
the service name.
@param handler
the... | [
"Add",
"a",
"NotificationHandler",
"to",
"the",
"Service",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/1.2/sd-api/src/main/java/com/cisco/oss/foundation/directory/lookup/LookupManagerImpl.java#L358-L374 |
jayantk/jklol | src/com/jayantkrish/jklol/util/Assignment.java | Assignment.fromSortedArrays | public static final Assignment fromSortedArrays(int[] vars, Object[] values) {
"""
Creates an {@code Assignment} mapping each variable in {@code vars} to
the value at the corresponding index of {@code values}. {@code vars}
must be sorted in ascending order. This method does not copy either
{@code vars} or {@cod... | java | public static final Assignment fromSortedArrays(int[] vars, Object[] values) {
// Verify that the assignment is sorted and contains no duplicate values.
for (int i = 1; i < vars.length; i++) {
Preconditions.checkArgument(vars[i - 1] < vars[i], "Illegal assignment variable nums: %s %s",
vars[i - ... | [
"public",
"static",
"final",
"Assignment",
"fromSortedArrays",
"(",
"int",
"[",
"]",
"vars",
",",
"Object",
"[",
"]",
"values",
")",
"{",
"// Verify that the assignment is sorted and contains no duplicate values.",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
"<",
... | Creates an {@code Assignment} mapping each variable in {@code vars} to
the value at the corresponding index of {@code values}. {@code vars}
must be sorted in ascending order. This method does not copy either
{@code vars} or {@code values}; the caller should not read or modify
either of these arrays after invoking this ... | [
"Creates",
"an",
"{",
"@code",
"Assignment",
"}",
"mapping",
"each",
"variable",
"in",
"{",
"@code",
"vars",
"}",
"to",
"the",
"value",
"at",
"the",
"corresponding",
"index",
"of",
"{",
"@code",
"values",
"}",
".",
"{",
"@code",
"vars",
"}",
"must",
"b... | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/util/Assignment.java#L71-L78 |
spring-projects/spring-mobile | spring-mobile-device/src/main/java/org/springframework/mobile/device/switcher/StandardSiteSwitcherHandlerFactory.java | StandardSiteSwitcherHandlerFactory.urlPath | public static SiteSwitcherHandler urlPath(String mobilePath, String tabletPath, String rootPath) {
"""
Creates a site switcher that redirects to a path on the current domain for normal site requests that either
originate from a mobile device or tablet device, or indicate a mobile or tablet site preference.
Allow... | java | public static SiteSwitcherHandler urlPath(String mobilePath, String tabletPath, String rootPath) {
return new StandardSiteSwitcherHandler(
new NormalSitePathUrlFactory(mobilePath, tabletPath, rootPath),
new MobileSitePathUrlFactory(mobilePath, tabletPath, rootPath),
new TabletSitePathUrlFactory(tabletPath... | [
"public",
"static",
"SiteSwitcherHandler",
"urlPath",
"(",
"String",
"mobilePath",
",",
"String",
"tabletPath",
",",
"String",
"rootPath",
")",
"{",
"return",
"new",
"StandardSiteSwitcherHandler",
"(",
"new",
"NormalSitePathUrlFactory",
"(",
"mobilePath",
",",
"tablet... | Creates a site switcher that redirects to a path on the current domain for normal site requests that either
originate from a mobile device or tablet device, or indicate a mobile or tablet site preference.
Allows you to configure a root path for an application. For example, if your app is running at <code>https://www.do... | [
"Creates",
"a",
"site",
"switcher",
"that",
"redirects",
"to",
"a",
"path",
"on",
"the",
"current",
"domain",
"for",
"normal",
"site",
"requests",
"that",
"either",
"originate",
"from",
"a",
"mobile",
"device",
"or",
"tablet",
"device",
"or",
"indicate",
"a"... | train | https://github.com/spring-projects/spring-mobile/blob/a402cbcaf208e24288b957f44c9984bd6e8bf064/spring-mobile-device/src/main/java/org/springframework/mobile/device/switcher/StandardSiteSwitcherHandlerFactory.java#L163-L170 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java | NodeIndexer.createFulltextField | protected Field createFulltextField(String value, boolean store, boolean withOffsets) {
"""
Creates a fulltext field for the string <code>value</code>.
@param value the string value.
@param store if the value of the field should be stored.
@param withOffsets if a term vector with offsets should be stored.
@r... | java | protected Field createFulltextField(String value, boolean store, boolean withOffsets)
{
return new Field(FieldNames.FULLTEXT, value, store ? Field.Store.YES : Field.Store.NO, Field.Index.ANALYZED,
withOffsets ? Field.TermVector.WITH_OFFSETS : Field.TermVector.NO);
} | [
"protected",
"Field",
"createFulltextField",
"(",
"String",
"value",
",",
"boolean",
"store",
",",
"boolean",
"withOffsets",
")",
"{",
"return",
"new",
"Field",
"(",
"FieldNames",
".",
"FULLTEXT",
",",
"value",
",",
"store",
"?",
"Field",
".",
"Store",
".",
... | Creates a fulltext field for the string <code>value</code>.
@param value the string value.
@param store if the value of the field should be stored.
@param withOffsets if a term vector with offsets should be stored.
@return a lucene field. | [
"Creates",
"a",
"fulltext",
"field",
"for",
"the",
"string",
"<code",
">",
"value<",
"/",
"code",
">",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java#L907-L911 |
ops4j/org.ops4j.pax.logging | pax-logging-service/src/main/java/org/apache/log4j/rule/NotEqualsRule.java | NotEqualsRule.getRule | public static Rule getRule(final Stack stack) {
"""
Get new instance from top two elements of stack.
@param stack stack.
@return new instance.
"""
if (stack.size() < 2) {
throw new IllegalArgumentException(
"Invalid NOT EQUALS rule - expected two parameters but received "
+ stack.si... | java | public static Rule getRule(final Stack stack) {
if (stack.size() < 2) {
throw new IllegalArgumentException(
"Invalid NOT EQUALS rule - expected two parameters but received "
+ stack.size());
}
String p2 = stack.pop().toString();
String p1 = stack.pop().toString();
if (p1.equa... | [
"public",
"static",
"Rule",
"getRule",
"(",
"final",
"Stack",
"stack",
")",
"{",
"if",
"(",
"stack",
".",
"size",
"(",
")",
"<",
"2",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Invalid NOT EQUALS rule - expected two parameters but received \"",
... | Get new instance from top two elements of stack.
@param stack stack.
@return new instance. | [
"Get",
"new",
"instance",
"from",
"top",
"two",
"elements",
"of",
"stack",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/rule/NotEqualsRule.java#L88-L103 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/Table.java | Table.insertSys | public int insertSys(PersistentStore store, Result ins) {
"""
Used for system table inserts. No checks. No identity
columns.
"""
RowSetNavigator nav = ins.getNavigator();
int count = 0;
while (nav.hasNext()) {
insertSys(store, nav.getNext());
co... | java | public int insertSys(PersistentStore store, Result ins) {
RowSetNavigator nav = ins.getNavigator();
int count = 0;
while (nav.hasNext()) {
insertSys(store, nav.getNext());
count++;
}
return count;
} | [
"public",
"int",
"insertSys",
"(",
"PersistentStore",
"store",
",",
"Result",
"ins",
")",
"{",
"RowSetNavigator",
"nav",
"=",
"ins",
".",
"getNavigator",
"(",
")",
";",
"int",
"count",
"=",
"0",
";",
"while",
"(",
"nav",
".",
"hasNext",
"(",
")",
")",
... | Used for system table inserts. No checks. No identity
columns. | [
"Used",
"for",
"system",
"table",
"inserts",
".",
"No",
"checks",
".",
"No",
"identity",
"columns",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/Table.java#L2310-L2322 |
ReactiveX/RxJavaAsyncUtil | src/main/java/rx/util/async/Async.java | Async.toAsyncThrowing | public static <T1, T2, R> Func2<T1, T2, Observable<R>> toAsyncThrowing(ThrowingFunc2<? super T1, ? super T2, ? extends R> func) {
"""
Convert a synchronous function call into an asynchronous function call through an Observable.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-oper... | java | public static <T1, T2, R> Func2<T1, T2, Observable<R>> toAsyncThrowing(ThrowingFunc2<? super T1, ? super T2, ? extends R> func) {
return toAsyncThrowing(func, Schedulers.computation());
} | [
"public",
"static",
"<",
"T1",
",",
"T2",
",",
"R",
">",
"Func2",
"<",
"T1",
",",
"T2",
",",
"Observable",
"<",
"R",
">",
">",
"toAsyncThrowing",
"(",
"ThrowingFunc2",
"<",
"?",
"super",
"T1",
",",
"?",
"super",
"T2",
",",
"?",
"extends",
"R",
">... | Convert a synchronous function call into an asynchronous function call through an Observable.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toAsync.png" alt="">
@param <T1> the first parameter type
@param <T2> the second parameter type
@param <R> the result type
@param func... | [
"Convert",
"a",
"synchronous",
"function",
"call",
"into",
"an",
"asynchronous",
"function",
"call",
"through",
"an",
"Observable",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"src",
"=",
"https",
":",
"//",
"raw",
".",
"github",
".",
"com",
"/",
"wiki"... | train | https://github.com/ReactiveX/RxJavaAsyncUtil/blob/6294e1da30e639df79f76399906229314c14e74d/src/main/java/rx/util/async/Async.java#L273-L275 |
febit/wit | wit-core/src/main/java/org/febit/wit_shaded/asm/ClassWriter.java | ClassWriter.newDouble | private Item newDouble(final double value) {
"""
Adds a double to the constant pool of the class being build. Does nothing if the constant pool already contains a
similar item.
@param value the double value.
@return a new or already existing double item.
"""
Item result = get(key.set(DOUBLE, value... | java | private Item newDouble(final double value) {
Item result = get(key.set(DOUBLE, value));
if (result == null) {
pool.putByte(DOUBLE).putLong(Double.doubleToLongBits(value));
result = new Item(poolIndex, key);
put(result);
poolIndex += 2;
}
re... | [
"private",
"Item",
"newDouble",
"(",
"final",
"double",
"value",
")",
"{",
"Item",
"result",
"=",
"get",
"(",
"key",
".",
"set",
"(",
"DOUBLE",
",",
"value",
")",
")",
";",
"if",
"(",
"result",
"==",
"null",
")",
"{",
"pool",
".",
"putByte",
"(",
... | Adds a double to the constant pool of the class being build. Does nothing if the constant pool already contains a
similar item.
@param value the double value.
@return a new or already existing double item. | [
"Adds",
"a",
"double",
"to",
"the",
"constant",
"pool",
"of",
"the",
"class",
"being",
"build",
".",
"Does",
"nothing",
"if",
"the",
"constant",
"pool",
"already",
"contains",
"a",
"similar",
"item",
"."
] | train | https://github.com/febit/wit/blob/89ee29efbc5633b79c30c3c7b953c9f4130575af/wit-core/src/main/java/org/febit/wit_shaded/asm/ClassWriter.java#L666-L675 |
mgormley/prim | src/main/java/edu/jhu/prim/matrix/SparseColDoubleMatrix.java | SparseColDoubleMatrix.multT | public DenseDoubleMatrix multT(DoubleMatrix bMat, boolean transposeA, boolean transposeB) {
"""
Multiplies A x B = C, where A is this matrix.
@param bMat The matrix B.
@param transposeA Whether to transpose A prior to multiplication.
@param transposeB Whether to transpose B prior to multiplication.
@return T... | java | public DenseDoubleMatrix multT(DoubleMatrix bMat, boolean transposeA, boolean transposeB) {
int numRowsC = transposeA ? this.getNumColumns() : this.getNumRows();
int numColsC = transposeB ? bMat.getNumRows() : bMat.getNumColumns();
DenseDoubleMatrix cMat = new DenseDoubleMatrix(numRowsC, numCols... | [
"public",
"DenseDoubleMatrix",
"multT",
"(",
"DoubleMatrix",
"bMat",
",",
"boolean",
"transposeA",
",",
"boolean",
"transposeB",
")",
"{",
"int",
"numRowsC",
"=",
"transposeA",
"?",
"this",
".",
"getNumColumns",
"(",
")",
":",
"this",
".",
"getNumRows",
"(",
... | Multiplies A x B = C, where A is this matrix.
@param bMat The matrix B.
@param transposeA Whether to transpose A prior to multiplication.
@param transposeB Whether to transpose B prior to multiplication.
@return The matrix C. | [
"Multiplies",
"A",
"x",
"B",
"=",
"C",
"where",
"A",
"is",
"this",
"matrix",
"."
] | train | https://github.com/mgormley/prim/blob/5dce5e1ae94a9ae558a6262fc246e1a24f56686c/src/main/java/edu/jhu/prim/matrix/SparseColDoubleMatrix.java#L121-L127 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/executiongraph/ExecutionGraph.java | ExecutionGraph.jobHasFailedOrCanceledStatus | private boolean jobHasFailedOrCanceledStatus() {
"""
Checks whether the job represented by the execution graph has the status <code>CANCELED</code> or
<code>FAILED</code>.
@return <code>true</code> if the job has the status <code>CANCELED</code> or <code>FAILED</code>,
<code>false</code> otherwise
"""
... | java | private boolean jobHasFailedOrCanceledStatus() {
final Iterator<ExecutionVertex> it = new ExecutionGraphIterator(this, true);
while (it.hasNext()) {
final ExecutionState state = it.next().getExecutionState();
if (state != ExecutionState.CANCELED && state != ExecutionState.FAILED && state != ExecutionState... | [
"private",
"boolean",
"jobHasFailedOrCanceledStatus",
"(",
")",
"{",
"final",
"Iterator",
"<",
"ExecutionVertex",
">",
"it",
"=",
"new",
"ExecutionGraphIterator",
"(",
"this",
",",
"true",
")",
";",
"while",
"(",
"it",
".",
"hasNext",
"(",
")",
")",
"{",
"... | Checks whether the job represented by the execution graph has the status <code>CANCELED</code> or
<code>FAILED</code>.
@return <code>true</code> if the job has the status <code>CANCELED</code> or <code>FAILED</code>,
<code>false</code> otherwise | [
"Checks",
"whether",
"the",
"job",
"represented",
"by",
"the",
"execution",
"graph",
"has",
"the",
"status",
"<code",
">",
"CANCELED<",
"/",
"code",
">",
"or",
"<code",
">",
"FAILED<",
"/",
"code",
">",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/executiongraph/ExecutionGraph.java#L1082-L1096 |
Netflix/zuul | zuul-core/src/main/java/com/netflix/zuul/FilterLoader.java | FilterLoader.getFiltersByType | public List<ZuulFilter> getFiltersByType(FilterType filterType) {
"""
Returns a list of filters by the filterType specified
@param filterType
@return a List<ZuulFilter>
"""
List<ZuulFilter> list = hashFiltersByType.get(filterType);
if (list != null) return list;
list = new ArrayLi... | java | public List<ZuulFilter> getFiltersByType(FilterType filterType) {
List<ZuulFilter> list = hashFiltersByType.get(filterType);
if (list != null) return list;
list = new ArrayList<ZuulFilter>();
Collection<ZuulFilter> filters = filterRegistry.getAllFilters();
for (Iterator<ZuulFi... | [
"public",
"List",
"<",
"ZuulFilter",
">",
"getFiltersByType",
"(",
"FilterType",
"filterType",
")",
"{",
"List",
"<",
"ZuulFilter",
">",
"list",
"=",
"hashFiltersByType",
".",
"get",
"(",
"filterType",
")",
";",
"if",
"(",
"list",
"!=",
"null",
")",
"retur... | Returns a list of filters by the filterType specified
@param filterType
@return a List<ZuulFilter> | [
"Returns",
"a",
"list",
"of",
"filters",
"by",
"the",
"filterType",
"specified"
] | train | https://github.com/Netflix/zuul/blob/01bc777cf05e3522d37c9ed902ae13eb38a19692/zuul-core/src/main/java/com/netflix/zuul/FilterLoader.java#L202-L227 |
UrielCh/ovh-java-sdk | ovh-java-sdk-sms/src/main/java/net/minidev/ovh/api/ApiOvhSms.java | ApiOvhSms.serviceName_templatesControl_name_PUT | public void serviceName_templatesControl_name_PUT(String serviceName, String name, OvhTemplateControl body) throws IOException {
"""
Alter this object properties
REST: PUT /sms/{serviceName}/templatesControl/{name}
@param body [required] New object properties
@param serviceName [required] The internal name of... | java | public void serviceName_templatesControl_name_PUT(String serviceName, String name, OvhTemplateControl body) throws IOException {
String qPath = "/sms/{serviceName}/templatesControl/{name}";
StringBuilder sb = path(qPath, serviceName, name);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"serviceName_templatesControl_name_PUT",
"(",
"String",
"serviceName",
",",
"String",
"name",
",",
"OvhTemplateControl",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/sms/{serviceName}/templatesControl/{name}\"",
";",
"StringBuilde... | Alter this object properties
REST: PUT /sms/{serviceName}/templatesControl/{name}
@param body [required] New object properties
@param serviceName [required] The internal name of your SMS offer
@param name [required] Name of the template | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-sms/src/main/java/net/minidev/ovh/api/ApiOvhSms.java#L1621-L1625 |
apptentive/apptentive-android | apptentive/src/main/java/com/apptentive/android/sdk/Apptentive.java | Apptentive.addCustomPersonData | public static void addCustomPersonData(final String key, final String value) {
"""
Add a custom data String to the Person. Custom data will be sent to the server, is displayed
in the Conversation view, and can be used in Interaction targeting. Calls to this method are
idempotent.
@param key The key to stor... | java | public static void addCustomPersonData(final String key, final String value) {
dispatchConversationTask(new ConversationDispatchTask() {
@Override
protected boolean execute(Conversation conversation) {
conversation.getPerson().getCustomData().put(key, trim(value));
return true;
}
}, "add custom per... | [
"public",
"static",
"void",
"addCustomPersonData",
"(",
"final",
"String",
"key",
",",
"final",
"String",
"value",
")",
"{",
"dispatchConversationTask",
"(",
"new",
"ConversationDispatchTask",
"(",
")",
"{",
"@",
"Override",
"protected",
"boolean",
"execute",
"(",... | Add a custom data String to the Person. Custom data will be sent to the server, is displayed
in the Conversation view, and can be used in Interaction targeting. Calls to this method are
idempotent.
@param key The key to store the data under.
@param value A String value. | [
"Add",
"a",
"custom",
"data",
"String",
"to",
"the",
"Person",
".",
"Custom",
"data",
"will",
"be",
"sent",
"to",
"the",
"server",
"is",
"displayed",
"in",
"the",
"Conversation",
"view",
"and",
"can",
"be",
"used",
"in",
"Interaction",
"targeting",
".",
... | train | https://github.com/apptentive/apptentive-android/blob/887c08d7bd5ae6488a90366dfb58f58938861a93/apptentive/src/main/java/com/apptentive/android/sdk/Apptentive.java#L323-L331 |
steveohara/j2mod | src/main/java/com/ghgande/j2mod/modbus/facade/AbstractModbusMaster.java | AbstractModbusMaster.writeSingleRegister | public int writeSingleRegister(int unitId, int ref, Register register) throws ModbusException {
"""
Writes a single register to the slave.
@param unitId the slave unit id.
@param ref the offset of the register to be written.
@param register a <tt>Register</tt> holding the value of the register
to be w... | java | public int writeSingleRegister(int unitId, int ref, Register register) throws ModbusException {
checkTransaction();
if (writeSingleRegisterRequest == null) {
writeSingleRegisterRequest = new WriteSingleRegisterRequest();
}
writeSingleRegisterRequest.setUnitID(unitId);
... | [
"public",
"int",
"writeSingleRegister",
"(",
"int",
"unitId",
",",
"int",
"ref",
",",
"Register",
"register",
")",
"throws",
"ModbusException",
"{",
"checkTransaction",
"(",
")",
";",
"if",
"(",
"writeSingleRegisterRequest",
"==",
"null",
")",
"{",
"writeSingleR... | Writes a single register to the slave.
@param unitId the slave unit id.
@param ref the offset of the register to be written.
@param register a <tt>Register</tt> holding the value of the register
to be written.
@return the value of the register as returned from the slave.
@throws ModbusException if an I/O erro... | [
"Writes",
"a",
"single",
"register",
"to",
"the",
"slave",
"."
] | train | https://github.com/steveohara/j2mod/blob/67162c55d7c02564e50211a9df06b8314953b5f2/src/main/java/com/ghgande/j2mod/modbus/facade/AbstractModbusMaster.java#L254-L265 |
gwtbootstrap3/gwtbootstrap3-extras | src/main/java/org/gwtbootstrap3/extras/bootbox/client/options/DialogOptions.java | DialogOptions.addButton | public final void addButton(String label, String className, SimpleCallback callback) {
"""
Adds a custom button with a class name and a callback.
@param label
@param className
@param callback
"""
addButton(BUTTON_PREFIX + BUTTON_INDEX++, label, className,
callback != null ? callback : ... | java | public final void addButton(String label, String className, SimpleCallback callback) {
addButton(BUTTON_PREFIX + BUTTON_INDEX++, label, className,
callback != null ? callback : SimpleCallback.DEFAULT_SIMPLE_CALLBACK);
} | [
"public",
"final",
"void",
"addButton",
"(",
"String",
"label",
",",
"String",
"className",
",",
"SimpleCallback",
"callback",
")",
"{",
"addButton",
"(",
"BUTTON_PREFIX",
"+",
"BUTTON_INDEX",
"++",
",",
"label",
",",
"className",
",",
"callback",
"!=",
"null"... | Adds a custom button with a class name and a callback.
@param label
@param className
@param callback | [
"Adds",
"a",
"custom",
"button",
"with",
"a",
"class",
"name",
"and",
"a",
"callback",
"."
] | train | https://github.com/gwtbootstrap3/gwtbootstrap3-extras/blob/8e42aaffd2a082e9cb23a14c37a3c87b7cbdfa94/src/main/java/org/gwtbootstrap3/extras/bootbox/client/options/DialogOptions.java#L211-L214 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/FdfWriter.java | FdfWriter.setFieldAsString | public boolean setFieldAsString(String field, String value) {
"""
Sets the field value as a string.
@param field the fully qualified field name
@param value the value
@return <CODE>true</CODE> if the value was inserted,
<CODE>false</CODE> if the name is incompatible with
an existing field
"""
retu... | java | public boolean setFieldAsString(String field, String value) {
return setField(field, new PdfString(value, PdfObject.TEXT_UNICODE));
} | [
"public",
"boolean",
"setFieldAsString",
"(",
"String",
"field",
",",
"String",
"value",
")",
"{",
"return",
"setField",
"(",
"field",
",",
"new",
"PdfString",
"(",
"value",
",",
"PdfObject",
".",
"TEXT_UNICODE",
")",
")",
";",
"}"
] | Sets the field value as a string.
@param field the fully qualified field name
@param value the value
@return <CODE>true</CODE> if the value was inserted,
<CODE>false</CODE> if the name is incompatible with
an existing field | [
"Sets",
"the",
"field",
"value",
"as",
"a",
"string",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/FdfWriter.java#L227-L229 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/query/Tuples.java | Tuples.typeFactory | public static TypeFactory<?> typeFactory( TypeFactory<?> type,
int tupleSize ) {
"""
Create a type factory for uniform tuples.
@param type the type of each/every slot in the tuples
@param tupleSize the size of the tuples
@return the type factory; never null
""... | java | public static TypeFactory<?> typeFactory( TypeFactory<?> type,
int tupleSize ) {
if (tupleSize <= 1) return type;
if (tupleSize == 2) return typeFactory(type, type);
if (tupleSize == 3) return typeFactory(type, type, type);
if (tupleSize == 4... | [
"public",
"static",
"TypeFactory",
"<",
"?",
">",
"typeFactory",
"(",
"TypeFactory",
"<",
"?",
">",
"type",
",",
"int",
"tupleSize",
")",
"{",
"if",
"(",
"tupleSize",
"<=",
"1",
")",
"return",
"type",
";",
"if",
"(",
"tupleSize",
"==",
"2",
")",
"ret... | Create a type factory for uniform tuples.
@param type the type of each/every slot in the tuples
@param tupleSize the size of the tuples
@return the type factory; never null | [
"Create",
"a",
"type",
"factory",
"for",
"uniform",
"tuples",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/Tuples.java#L155-L166 |
Azure/azure-sdk-for-java | servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/ClientFactory.java | ClientFactory.createMessageSenderFromEntityPath | public static IMessageSender createMessageSenderFromEntityPath(MessagingFactory messagingFactory, String entityPath) throws InterruptedException, ServiceBusException {
"""
Creates a message sender to the entity.
@param messagingFactory messaging factory (which represents a connection) on which sender needs to be ... | java | public static IMessageSender createMessageSenderFromEntityPath(MessagingFactory messagingFactory, String entityPath) throws InterruptedException, ServiceBusException {
return Utils.completeFuture(createMessageSenderFromEntityPathAsync(messagingFactory, entityPath));
} | [
"public",
"static",
"IMessageSender",
"createMessageSenderFromEntityPath",
"(",
"MessagingFactory",
"messagingFactory",
",",
"String",
"entityPath",
")",
"throws",
"InterruptedException",
",",
"ServiceBusException",
"{",
"return",
"Utils",
".",
"completeFuture",
"(",
"creat... | Creates a message sender to the entity.
@param messagingFactory messaging factory (which represents a connection) on which sender needs to be created
@param entityPath path of entity
@return IMessageSender instance
@throws InterruptedException if the current thread was interrupted while waiting
@throws ServiceBusExcept... | [
"Creates",
"a",
"message",
"sender",
"to",
"the",
"entity",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/servicebus/data-plane/azure-servicebus/src/main/java/com/microsoft/azure/servicebus/ClientFactory.java#L94-L96 |
grails/gorm-hibernate5 | grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsDomainBinder.java | GrailsDomainBinder.bindSubClass | protected void bindSubClass(HibernatePersistentEntity sub, Subclass subClass, InFlightMetadataCollector mappings,
String sessionFactoryBeanName) {
"""
Binds a sub-class using table-per-hierarchy inheritance mapping
@param sub The Grails domain class instance representing the... | java | protected void bindSubClass(HibernatePersistentEntity sub, Subclass subClass, InFlightMetadataCollector mappings,
String sessionFactoryBeanName) {
bindClass(sub, subClass, mappings);
if (LOG.isDebugEnabled())
LOG.debug("Mapping subclass: " + subClass.getEntit... | [
"protected",
"void",
"bindSubClass",
"(",
"HibernatePersistentEntity",
"sub",
",",
"Subclass",
"subClass",
",",
"InFlightMetadataCollector",
"mappings",
",",
"String",
"sessionFactoryBeanName",
")",
"{",
"bindClass",
"(",
"sub",
",",
"subClass",
",",
"mappings",
")",
... | Binds a sub-class using table-per-hierarchy inheritance mapping
@param sub The Grails domain class instance representing the sub-class
@param subClass The Hibernate SubClass instance
@param mappings The mappings instance | [
"Binds",
"a",
"sub",
"-",
"class",
"using",
"table",
"-",
"per",
"-",
"hierarchy",
"inheritance",
"mapping"
] | train | https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/cfg/GrailsDomainBinder.java#L1635-L1645 |
google/closure-compiler | src/com/google/javascript/jscomp/TypeCheck.java | TypeCheck.visitBinaryOperator | private void visitBinaryOperator(Token op, Node n) {
"""
This function unifies the type checking involved in the core binary operators and the
corresponding assignment operators. The representation used internally is such that common code
can handle both kinds of operators easily.
@param op The operator.
@pa... | java | private void visitBinaryOperator(Token op, Node n) {
Node left = n.getFirstChild();
JSType leftType = getJSType(left);
Node right = n.getLastChild();
JSType rightType = getJSType(right);
switch (op) {
case ASSIGN_LSH:
case ASSIGN_RSH:
case LSH:
case RSH:
case ASSIGN_URS... | [
"private",
"void",
"visitBinaryOperator",
"(",
"Token",
"op",
",",
"Node",
"n",
")",
"{",
"Node",
"left",
"=",
"n",
".",
"getFirstChild",
"(",
")",
";",
"JSType",
"leftType",
"=",
"getJSType",
"(",
"left",
")",
";",
"Node",
"right",
"=",
"n",
".",
"g... | This function unifies the type checking involved in the core binary operators and the
corresponding assignment operators. The representation used internally is such that common code
can handle both kinds of operators easily.
@param op The operator.
@param t The traversal object, needed to report errors.
@param n The n... | [
"This",
"function",
"unifies",
"the",
"type",
"checking",
"involved",
"in",
"the",
"core",
"binary",
"operators",
"and",
"the",
"corresponding",
"assignment",
"operators",
".",
"The",
"representation",
"used",
"internally",
"is",
"such",
"that",
"common",
"code",
... | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/TypeCheck.java#L2884-L2941 |
hal/elemento | core/src/main/java/org/jboss/gwt/elemento/core/Elements.java | Elements.insertBefore | public static void insertBefore(Element newElement, Element before) {
"""
Inserts the specified element into the parent of the before element.
"""
before.parentNode.insertBefore(newElement, before);
} | java | public static void insertBefore(Element newElement, Element before) {
before.parentNode.insertBefore(newElement, before);
} | [
"public",
"static",
"void",
"insertBefore",
"(",
"Element",
"newElement",
",",
"Element",
"before",
")",
"{",
"before",
".",
"parentNode",
".",
"insertBefore",
"(",
"newElement",
",",
"before",
")",
";",
"}"
] | Inserts the specified element into the parent of the before element. | [
"Inserts",
"the",
"specified",
"element",
"into",
"the",
"parent",
"of",
"the",
"before",
"element",
"."
] | train | https://github.com/hal/elemento/blob/26da2d5a1fe2ec55b779737dbaeda25a942eee61/core/src/main/java/org/jboss/gwt/elemento/core/Elements.java#L680-L682 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java | TheMovieDbApi.getTVCredits | public MediaCreditList getTVCredits(int tvID, String language) throws MovieDbException {
"""
Get the cast & crew information about a TV series.
@param tvID tvID
@param language language
@return
@throws com.omertron.themoviedbapi.MovieDbException
"""
return tmdbTv.getTVCredits(tvID, language);
... | java | public MediaCreditList getTVCredits(int tvID, String language) throws MovieDbException {
return tmdbTv.getTVCredits(tvID, language);
} | [
"public",
"MediaCreditList",
"getTVCredits",
"(",
"int",
"tvID",
",",
"String",
"language",
")",
"throws",
"MovieDbException",
"{",
"return",
"tmdbTv",
".",
"getTVCredits",
"(",
"tvID",
",",
"language",
")",
";",
"}"
] | Get the cast & crew information about a TV series.
@param tvID tvID
@param language language
@return
@throws com.omertron.themoviedbapi.MovieDbException | [
"Get",
"the",
"cast",
"&",
"crew",
"information",
"about",
"a",
"TV",
"series",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/TheMovieDbApi.java#L1497-L1499 |
apache/flink | flink-core/src/main/java/org/apache/flink/configuration/Configuration.java | Configuration.getDouble | public double getDouble(String key, double defaultValue) {
"""
Returns the value associated with the given key as a double.
@param key
the key pointing to the associated value
@param defaultValue
the default value which is returned in case there is no value associated with the given key
@return the (default... | java | public double getDouble(String key, double defaultValue) {
Object o = getRawValue(key);
if (o == null) {
return defaultValue;
}
return convertToDouble(o, defaultValue);
} | [
"public",
"double",
"getDouble",
"(",
"String",
"key",
",",
"double",
"defaultValue",
")",
"{",
"Object",
"o",
"=",
"getRawValue",
"(",
"key",
")",
";",
"if",
"(",
"o",
"==",
"null",
")",
"{",
"return",
"defaultValue",
";",
"}",
"return",
"convertToDoubl... | Returns the value associated with the given key as a double.
@param key
the key pointing to the associated value
@param defaultValue
the default value which is returned in case there is no value associated with the given key
@return the (default) value associated with the given key | [
"Returns",
"the",
"value",
"associated",
"with",
"the",
"given",
"key",
"as",
"a",
"double",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/configuration/Configuration.java#L500-L507 |
hsiafan/requests | src/main/java/net/dongliu/requests/Header.java | Header.of | public static Header of(String name, Object value) {
"""
Create new header.
@param name header name
@param value header value
@return header
"""
return new Header(requireNonNull(name), String.valueOf(requireNonNull(value)));
} | java | public static Header of(String name, Object value) {
return new Header(requireNonNull(name), String.valueOf(requireNonNull(value)));
} | [
"public",
"static",
"Header",
"of",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"return",
"new",
"Header",
"(",
"requireNonNull",
"(",
"name",
")",
",",
"String",
".",
"valueOf",
"(",
"requireNonNull",
"(",
"value",
")",
")",
")",
";",
"}"... | Create new header.
@param name header name
@param value header value
@return header | [
"Create",
"new",
"header",
"."
] | train | https://github.com/hsiafan/requests/blob/a6cc6f8293e808cc937d3789aec2616a8383dee0/src/main/java/net/dongliu/requests/Header.java#L45-L47 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/bcc/BccClient.java | BccClient.purchaseReservedVolume | public void purchaseReservedVolume(String volumeId, int reservationLength, String reservationTimeUnit) {
"""
PurchaseReserved the instance with fixed duration.
You can not purchaseReserved the instance which is resizing.
This is an asynchronous interface,
you can get the latest status by invoke {@link #getVol... | java | public void purchaseReservedVolume(String volumeId, int reservationLength, String reservationTimeUnit) {
this.purchaseReservedVolume(new PurchaseReservedVolumeRequest()
.withVolumeId(volumeId)
.withBilling(new Billing().withReservation(new Reservation()
.w... | [
"public",
"void",
"purchaseReservedVolume",
"(",
"String",
"volumeId",
",",
"int",
"reservationLength",
",",
"String",
"reservationTimeUnit",
")",
"{",
"this",
".",
"purchaseReservedVolume",
"(",
"new",
"PurchaseReservedVolumeRequest",
"(",
")",
".",
"withVolumeId",
"... | PurchaseReserved the instance with fixed duration.
You can not purchaseReserved the instance which is resizing.
This is an asynchronous interface,
you can get the latest status by invoke {@link #getVolume(String)}
@param volumeId The id of volume which will be renew.
@param reservationLength The fixed duration to ren... | [
"PurchaseReserved",
"the",
"instance",
"with",
"fixed",
"duration",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bcc/BccClient.java#L1159-L1165 |
mgormley/optimize | src/main/java/edu/jhu/hlt/util/Utilities.java | Utilities.logSubtractExact | public static double logSubtractExact(double x, double y) {
"""
Subtracts two probabilities that are stored as log probabilities.
Note that x >= y.
@param x log(p)
@param y log(q)
@return log(p - q) = log(exp(p) + exp(q))
@throws IllegalStateException if x < y
"""
if (x < y) {
throw ... | java | public static double logSubtractExact(double x, double y) {
if (x < y) {
throw new IllegalStateException("x must be >= y. x=" + x + " y=" + y);
}
// p = 0 or q = 0, where x = log(p), y = log(q)
if (Double.NEGATIVE_INFINITY == y) {
return x;
} else... | [
"public",
"static",
"double",
"logSubtractExact",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"if",
"(",
"x",
"<",
"y",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"x must be >= y. x=\"",
"+",
"x",
"+",
"\" y=\"",
"+",
"y",
")",
";",
... | Subtracts two probabilities that are stored as log probabilities.
Note that x >= y.
@param x log(p)
@param y log(q)
@return log(p - q) = log(exp(p) + exp(q))
@throws IllegalStateException if x < y | [
"Subtracts",
"two",
"probabilities",
"that",
"are",
"stored",
"as",
"log",
"probabilities",
".",
"Note",
"that",
"x",
">",
"=",
"y",
"."
] | train | https://github.com/mgormley/optimize/blob/3d1b93260b99febb8a5ecd9e8543c223e151a8d3/src/main/java/edu/jhu/hlt/util/Utilities.java#L222-L236 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/logging/Logger.java | Logger.logp | public void logp(Level level, String sourceClass, String sourceMethod, String msg) {
"""
Log a message, specifying source class and method,
with no arguments.
<p>
If the logger is currently enabled for the given message
level then the given message is forwarded to all the
registered output Handler objects.
<... | java | public void logp(Level level, String sourceClass, String sourceMethod, String msg) {
if (level.intValue() < levelValue || levelValue == offValue) {
return;
}
LogRecord lr = new LogRecord(level, msg);
lr.setSourceClassName(sourceClass);
lr.setSourceMethodName(sourceMet... | [
"public",
"void",
"logp",
"(",
"Level",
"level",
",",
"String",
"sourceClass",
",",
"String",
"sourceMethod",
",",
"String",
"msg",
")",
"{",
"if",
"(",
"level",
".",
"intValue",
"(",
")",
"<",
"levelValue",
"||",
"levelValue",
"==",
"offValue",
")",
"{"... | Log a message, specifying source class and method,
with no arguments.
<p>
If the logger is currently enabled for the given message
level then the given message is forwarded to all the
registered output Handler objects.
<p>
@param level One of the message level identifiers, e.g., SEVERE
@param sourceClass name ... | [
"Log",
"a",
"message",
"specifying",
"source",
"class",
"and",
"method",
"with",
"no",
"arguments",
".",
"<p",
">",
"If",
"the",
"logger",
"is",
"currently",
"enabled",
"for",
"the",
"given",
"message",
"level",
"then",
"the",
"given",
"message",
"is",
"fo... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/logging/Logger.java#L768-L776 |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/ws/Transaction/JTA/Util.java | Util.equal | public static boolean equal(byte[] a, byte[] b) {
"""
Returns true if the byte arrays are identical; false
otherwise.
"""
if (a == b)
return (true);
if ((a == null) || (b == null))
return (false);
if (a.length != b.length)
return (false);
for (int i = ... | java | public static boolean equal(byte[] a, byte[] b) {
if (a == b)
return (true);
if ((a == null) || (b == null))
return (false);
if (a.length != b.length)
return (false);
for (int i = 0; i < a.length; i++)
if (a[i] != b[i])
return (false);
... | [
"public",
"static",
"boolean",
"equal",
"(",
"byte",
"[",
"]",
"a",
",",
"byte",
"[",
"]",
"b",
")",
"{",
"if",
"(",
"a",
"==",
"b",
")",
"return",
"(",
"true",
")",
";",
"if",
"(",
"(",
"a",
"==",
"null",
")",
"||",
"(",
"b",
"==",
"null",... | Returns true if the byte arrays are identical; false
otherwise. | [
"Returns",
"true",
"if",
"the",
"byte",
"arrays",
"are",
"identical",
";",
"false",
"otherwise",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/ws/Transaction/JTA/Util.java#L269-L280 |
icode/ameba | src/main/java/ameba/core/Requests.java | Requests.readEntity | public static <T> T readEntity(Class<T> rawType, Type type, Annotation[] annotations, PropertiesDelegate propertiesDelegate) {
"""
<p>readEntity.</p>
@param rawType a {@link java.lang.Class} object.
@param type a {@link java.lang.reflect.Type} object.
@param annotations an arra... | java | public static <T> T readEntity(Class<T> rawType, Type type, Annotation[] annotations, PropertiesDelegate propertiesDelegate) {
return getRequest().readEntity(rawType, type, annotations, propertiesDelegate);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"readEntity",
"(",
"Class",
"<",
"T",
">",
"rawType",
",",
"Type",
"type",
",",
"Annotation",
"[",
"]",
"annotations",
",",
"PropertiesDelegate",
"propertiesDelegate",
")",
"{",
"return",
"getRequest",
"(",
")",
".",... | <p>readEntity.</p>
@param rawType a {@link java.lang.Class} object.
@param type a {@link java.lang.reflect.Type} object.
@param annotations an array of {@link java.lang.annotation.Annotation} objects.
@param propertiesDelegate a {@link org.glassfish.jersey.internal.PropertiesDelegate} o... | [
"<p",
">",
"readEntity",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/core/Requests.java#L64-L66 |
RestComm/sip-servlets | sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/ExtendedListeningPoint.java | ExtendedListeningPoint.createRecordRouteURI | public javax.sip.address.SipURI createRecordRouteURI(boolean usePublicAddress) {
"""
Create a Record Route URI based on the host, port and transport of this listening point
@param usePublicAddress if true, the host will be the global ip address found by STUN otherwise
it will be the local network interface ipadd... | java | public javax.sip.address.SipURI createRecordRouteURI(boolean usePublicAddress) {
try {
String host = getIpAddress(usePublicAddress);
SipURI sipUri = SipFactoryImpl.addressFactory.createSipURI(null, host);
sipUri.setPort(port);
sipUri.setTransportParam(transport);
// Do we want to add an ID here?
... | [
"public",
"javax",
".",
"sip",
".",
"address",
".",
"SipURI",
"createRecordRouteURI",
"(",
"boolean",
"usePublicAddress",
")",
"{",
"try",
"{",
"String",
"host",
"=",
"getIpAddress",
"(",
"usePublicAddress",
")",
";",
"SipURI",
"sipUri",
"=",
"SipFactoryImpl",
... | Create a Record Route URI based on the host, port and transport of this listening point
@param usePublicAddress if true, the host will be the global ip address found by STUN otherwise
it will be the local network interface ipaddress
@return the record route uri | [
"Create",
"a",
"Record",
"Route",
"URI",
"based",
"on",
"the",
"host",
"port",
"and",
"transport",
"of",
"this",
"listening",
"point"
] | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/ExtendedListeningPoint.java#L203-L215 |
threerings/nenya | core/src/main/java/com/threerings/media/tile/TileManager.java | TileManager.loadTileSet | public UniformTileSet loadTileSet (String imgPath, int width, int height) {
"""
Loads up a tileset from the specified image with the specified metadata parameters.
"""
return loadCachedTileSet("", imgPath, width, height);
} | java | public UniformTileSet loadTileSet (String imgPath, int width, int height)
{
return loadCachedTileSet("", imgPath, width, height);
} | [
"public",
"UniformTileSet",
"loadTileSet",
"(",
"String",
"imgPath",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"return",
"loadCachedTileSet",
"(",
"\"\"",
",",
"imgPath",
",",
"width",
",",
"height",
")",
";",
"}"
] | Loads up a tileset from the specified image with the specified metadata parameters. | [
"Loads",
"up",
"a",
"tileset",
"from",
"the",
"specified",
"image",
"with",
"the",
"specified",
"metadata",
"parameters",
"."
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/tile/TileManager.java#L64-L67 |
hpsa/hpe-application-automation-tools-plugin | src/main/java/com/hp/application/automation/tools/results/projectparser/performance/LrProjectScenarioResults.java | LrProjectScenarioResults.vUserMapInit | public static void vUserMapInit(SortedMap<String, Integer> map) {
"""
initilize vuser maps with required values
@param map the map
"""
map.put("Passed", 0);
map.put("Stopped", 0);
map.put("Failed", 0);
map.put("Count", 0);
map.put("MaxVuserRun", 0);
} | java | public static void vUserMapInit(SortedMap<String, Integer> map) {
map.put("Passed", 0);
map.put("Stopped", 0);
map.put("Failed", 0);
map.put("Count", 0);
map.put("MaxVuserRun", 0);
} | [
"public",
"static",
"void",
"vUserMapInit",
"(",
"SortedMap",
"<",
"String",
",",
"Integer",
">",
"map",
")",
"{",
"map",
".",
"put",
"(",
"\"Passed\"",
",",
"0",
")",
";",
"map",
".",
"put",
"(",
"\"Stopped\"",
",",
"0",
")",
";",
"map",
".",
"put... | initilize vuser maps with required values
@param map the map | [
"initilize",
"vuser",
"maps",
"with",
"required",
"values"
] | train | https://github.com/hpsa/hpe-application-automation-tools-plugin/blob/987536f5551bc76fd028d746a951d1fd72c7567a/src/main/java/com/hp/application/automation/tools/results/projectparser/performance/LrProjectScenarioResults.java#L106-L112 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/lib/ArrayUtil.java | ArrayUtil.find | public static int find(byte[] arra, int start, int limit, byte[] arrb) {
"""
Returns the index of the first occurence of arrb in arra. Or -1 if not found.
"""
int k = start;
limit = limit - arrb.length + 1;
int value = arrb[0];
for (; k < limit; k++) {
if (arra[k... | java | public static int find(byte[] arra, int start, int limit, byte[] arrb) {
int k = start;
limit = limit - arrb.length + 1;
int value = arrb[0];
for (; k < limit; k++) {
if (arra[k] == value) {
if (arrb.length == 1) {
return k;
... | [
"public",
"static",
"int",
"find",
"(",
"byte",
"[",
"]",
"arra",
",",
"int",
"start",
",",
"int",
"limit",
",",
"byte",
"[",
"]",
"arrb",
")",
"{",
"int",
"k",
"=",
"start",
";",
"limit",
"=",
"limit",
"-",
"arrb",
".",
"length",
"+",
"1",
";"... | Returns the index of the first occurence of arrb in arra. Or -1 if not found. | [
"Returns",
"the",
"index",
"of",
"the",
"first",
"occurence",
"of",
"arrb",
"in",
"arra",
".",
"Or",
"-",
"1",
"if",
"not",
"found",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/ArrayUtil.java#L565-L586 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/HashMap.java | HashMap.put | public V put(K key, V value) {
"""
Associates the specified value with the specified key in this map.
If the map previously contained a mapping for the key, the old
value is replaced.
@param key key with which the specified value is to be associated
@param value value to be associated with the specified key
... | java | public V put(K key, V value) {
return putVal(hash(key), key, value, false, true);
} | [
"public",
"V",
"put",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"return",
"putVal",
"(",
"hash",
"(",
"key",
")",
",",
"key",
",",
"value",
",",
"false",
",",
"true",
")",
";",
"}"
] | Associates the specified value with the specified key in this map.
If the map previously contained a mapping for the key, the old
value is replaced.
@param key key with which the specified value is to be associated
@param value value to be associated with the specified key
@return the previous value associated with <t... | [
"Associates",
"the",
"specified",
"value",
"with",
"the",
"specified",
"key",
"in",
"this",
"map",
".",
"If",
"the",
"map",
"previously",
"contained",
"a",
"mapping",
"for",
"the",
"key",
"the",
"old",
"value",
"is",
"replaced",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/HashMap.java#L616-L618 |
Impetus/Kundera | src/kundera-couchbase/src/main/java/com/impetus/client/couchbase/DefaultCouchbaseDataHandler.java | DefaultCouchbaseDataHandler.iterateAndPopulateEntity | private void iterateAndPopulateEntity(Object entity, JsonObject obj, Iterator<Attribute> iterator) {
"""
Iterate and populate entity.
@param entity
the entity
@param obj
the obj
@param iterator
the iterator
"""
while (iterator.hasNext())
{
Attribute attribute = iterator.next... | java | private void iterateAndPopulateEntity(Object entity, JsonObject obj, Iterator<Attribute> iterator)
{
while (iterator.hasNext())
{
Attribute attribute = iterator.next();
Field field = (Field) attribute.getJavaMember();
String colName = ((AbstractAttribute) attribut... | [
"private",
"void",
"iterateAndPopulateEntity",
"(",
"Object",
"entity",
",",
"JsonObject",
"obj",
",",
"Iterator",
"<",
"Attribute",
">",
"iterator",
")",
"{",
"while",
"(",
"iterator",
".",
"hasNext",
"(",
")",
")",
"{",
"Attribute",
"attribute",
"=",
"iter... | Iterate and populate entity.
@param entity
the entity
@param obj
the obj
@param iterator
the iterator | [
"Iterate",
"and",
"populate",
"entity",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-couchbase/src/main/java/com/impetus/client/couchbase/DefaultCouchbaseDataHandler.java#L82-L97 |
Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/IntegrationAccountsInner.java | IntegrationAccountsInner.logTrackingEvents | public void logTrackingEvents(String resourceGroupName, String integrationAccountName, TrackingEventsDefinition logTrackingEvents) {
"""
Logs the integration account's tracking events.
@param resourceGroupName The resource group name.
@param integrationAccountName The integration account name.
@param logTrack... | java | public void logTrackingEvents(String resourceGroupName, String integrationAccountName, TrackingEventsDefinition logTrackingEvents) {
logTrackingEventsWithServiceResponseAsync(resourceGroupName, integrationAccountName, logTrackingEvents).toBlocking().single().body();
} | [
"public",
"void",
"logTrackingEvents",
"(",
"String",
"resourceGroupName",
",",
"String",
"integrationAccountName",
",",
"TrackingEventsDefinition",
"logTrackingEvents",
")",
"{",
"logTrackingEventsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"integrationAccountName"... | Logs the integration account's tracking events.
@param resourceGroupName The resource group name.
@param integrationAccountName The integration account name.
@param logTrackingEvents The callback URL parameters.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if ... | [
"Logs",
"the",
"integration",
"account",
"s",
"tracking",
"events",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/IntegrationAccountsInner.java#L1130-L1132 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRVertexBuffer.java | GVRVertexBuffer.setIntArray | public void setIntArray(String attributeName, int[] data, int stride, int offset) {
"""
Updates a vertex attribute from an integer array.
All of the entries of the input integer array are copied into
the storage for the named vertex attribute. Other vertex
attributes are not affected.
The attribute name must b... | java | public void setIntArray(String attributeName, int[] data, int stride, int offset)
{
if (!NativeVertexBuffer.setIntArray(getNative(), attributeName, data, stride, offset))
{
throw new IllegalArgumentException("Attribute name " + attributeName + " cannot be updated");
}
} | [
"public",
"void",
"setIntArray",
"(",
"String",
"attributeName",
",",
"int",
"[",
"]",
"data",
",",
"int",
"stride",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"!",
"NativeVertexBuffer",
".",
"setIntArray",
"(",
"getNative",
"(",
")",
",",
"attributeName",... | Updates a vertex attribute from an integer array.
All of the entries of the input integer array are copied into
the storage for the named vertex attribute. Other vertex
attributes are not affected.
The attribute name must be one of the attributes named
in the descriptor passed to the constructor.
<p>
All vertex attribu... | [
"Updates",
"a",
"vertex",
"attribute",
"from",
"an",
"integer",
"array",
".",
"All",
"of",
"the",
"entries",
"of",
"the",
"input",
"integer",
"array",
"are",
"copied",
"into",
"the",
"storage",
"for",
"the",
"named",
"vertex",
"attribute",
".",
"Other",
"v... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRVertexBuffer.java#L285-L291 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.deletePrebuilt | public OperationStatus deletePrebuilt(UUID appId, String versionId, UUID prebuiltId) {
"""
Deletes a prebuilt entity extractor from the application.
@param appId The application ID.
@param versionId The version ID.
@param prebuiltId The prebuilt entity extractor ID.
@throws IllegalArgumentException thrown if... | java | public OperationStatus deletePrebuilt(UUID appId, String versionId, UUID prebuiltId) {
return deletePrebuiltWithServiceResponseAsync(appId, versionId, prebuiltId).toBlocking().single().body();
} | [
"public",
"OperationStatus",
"deletePrebuilt",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"prebuiltId",
")",
"{",
"return",
"deletePrebuiltWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
",",
"prebuiltId",
")",
".",
"toBlocking",
"(",
... | Deletes a prebuilt entity extractor from the application.
@param appId The application ID.
@param versionId The version ID.
@param prebuiltId The prebuilt entity extractor ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseException thrown if the request is rejected by s... | [
"Deletes",
"a",
"prebuilt",
"entity",
"extractor",
"from",
"the",
"application",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L4780-L4782 |
jenkinsci/jenkins | core/src/main/java/hudson/security/SecurityRealm.java | SecurityRealm.doLogout | public void doLogout(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
"""
Handles the logout processing.
<p>
The default implementation erases the session and do a few other clean up, then
redirect the user to the URL specified by {@link #getPostLogOutUrl(StaplerRequest, Authent... | java | public void doLogout(StaplerRequest req, StaplerResponse rsp) throws IOException, ServletException {
HttpSession session = req.getSession(false);
if(session!=null)
session.invalidate();
Authentication auth = SecurityContextHolder.getContext().getAuthentication();
SecurityCont... | [
"public",
"void",
"doLogout",
"(",
"StaplerRequest",
"req",
",",
"StaplerResponse",
"rsp",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"HttpSession",
"session",
"=",
"req",
".",
"getSession",
"(",
"false",
")",
";",
"if",
"(",
"session",
"!=",
... | Handles the logout processing.
<p>
The default implementation erases the session and do a few other clean up, then
redirect the user to the URL specified by {@link #getPostLogOutUrl(StaplerRequest, Authentication)}.
@since 1.314 | [
"Handles",
"the",
"logout",
"processing",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/security/SecurityRealm.java#L286-L302 |
mongodb/stitch-android-sdk | server/services/mongodb-remote/src/main/java/com/mongodb/stitch/server/services/mongodb/remote/internal/RemoteMongoCollectionImpl.java | RemoteMongoCollectionImpl.findOne | public <ResultT> ResultT findOne(final Bson filter, final Class<ResultT> resultClass) {
"""
Finds a document in the collection.
@param filter the query filter
@param resultClass the class to decode each document into
@param <ResultT> the target document type of the iterable.
@return a task containing... | java | public <ResultT> ResultT findOne(final Bson filter, final Class<ResultT> resultClass) {
return proxy.findOne(filter, resultClass);
} | [
"public",
"<",
"ResultT",
">",
"ResultT",
"findOne",
"(",
"final",
"Bson",
"filter",
",",
"final",
"Class",
"<",
"ResultT",
">",
"resultClass",
")",
"{",
"return",
"proxy",
".",
"findOne",
"(",
"filter",
",",
"resultClass",
")",
";",
"}"
] | Finds a document in the collection.
@param filter the query filter
@param resultClass the class to decode each document into
@param <ResultT> the target document type of the iterable.
@return a task containing the result of the find one operation | [
"Finds",
"a",
"document",
"in",
"the",
"collection",
"."
] | train | https://github.com/mongodb/stitch-android-sdk/blob/159b9334b1f1a827285544be5ee20cdf7b04e4cc/server/services/mongodb-remote/src/main/java/com/mongodb/stitch/server/services/mongodb/remote/internal/RemoteMongoCollectionImpl.java#L159-L161 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getSkinInfo | public void getSkinInfo(int[] ids, Callback<List<Skin>> callback) throws GuildWars2Exception, NullPointerException {
"""
For more info on Skin API go <a href="https://wiki.guildwars2.com/wiki/API:2/skins">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailu... | java | public void getSkinInfo(int[] ids, Callback<List<Skin>> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ids));
gw2API.getSkinInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback);
} | [
"public",
"void",
"getSkinInfo",
"(",
"int",
"[",
"]",
"ids",
",",
"Callback",
"<",
"List",
"<",
"Skin",
">",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"ParamChecker",
"(",
"ids",
")"... | For more info on Skin API go <a href="https://wiki.guildwars2.com/wiki/API:2/skins">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
@param ids list of skin id
@param callback callback that is going to... | [
"For",
"more",
"info",
"on",
"Skin",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"skins",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">",
"Give",
"user",
"the"... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L2379-L2382 |
eclipse/hawkbit | hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/report/model/TenantUsage.java | TenantUsage.addUsageData | public TenantUsage addUsageData(final String key, final String value) {
"""
Add a key and value as usage data to the system usage stats.
@param key
the key to set
@param value
the value to set
@return tenant stats element with new usage added
"""
getLazyUsageData().put(key, value);
retur... | java | public TenantUsage addUsageData(final String key, final String value) {
getLazyUsageData().put(key, value);
return this;
} | [
"public",
"TenantUsage",
"addUsageData",
"(",
"final",
"String",
"key",
",",
"final",
"String",
"value",
")",
"{",
"getLazyUsageData",
"(",
")",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Add a key and value as usage data to the system usage stats.
@param key
the key to set
@param value
the value to set
@return tenant stats element with new usage added | [
"Add",
"a",
"key",
"and",
"value",
"as",
"usage",
"data",
"to",
"the",
"system",
"usage",
"stats",
"."
] | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-repository/hawkbit-repository-api/src/main/java/org/eclipse/hawkbit/repository/report/model/TenantUsage.java#L97-L100 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java | AppServiceEnvironmentsInner.listWebWorkerMetricDefinitionsWithServiceResponseAsync | public Observable<ServiceResponse<Page<ResourceMetricDefinitionInner>>> listWebWorkerMetricDefinitionsWithServiceResponseAsync(final String resourceGroupName, final String name, final String workerPoolName) {
"""
Get metric definitions for a worker pool of an App Service Environment.
Get metric definitions for a ... | java | public Observable<ServiceResponse<Page<ResourceMetricDefinitionInner>>> listWebWorkerMetricDefinitionsWithServiceResponseAsync(final String resourceGroupName, final String name, final String workerPoolName) {
return listWebWorkerMetricDefinitionsSinglePageAsync(resourceGroupName, name, workerPoolName)
... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"ResourceMetricDefinitionInner",
">",
">",
">",
"listWebWorkerMetricDefinitionsWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"name",
",",
"final",
"String",... | Get metric definitions for a worker pool of an App Service Environment.
Get metric definitions for a worker pool of an App Service Environment.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service Environment.
@param workerPoolName Name of the worker po... | [
"Get",
"metric",
"definitions",
"for",
"a",
"worker",
"pool",
"of",
"an",
"App",
"Service",
"Environment",
".",
"Get",
"metric",
"definitions",
"for",
"a",
"worker",
"pool",
"of",
"an",
"App",
"Service",
"Environment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java#L5995-L6007 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPRulePersistenceImpl.java | CPRulePersistenceImpl.filterFindByGroupId | @Override
public List<CPRule> filterFindByGroupId(long groupId, int start, int end) {
"""
Returns a range of all the cp rules that the user has permission to view where groupId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>en... | java | @Override
public List<CPRule> filterFindByGroupId(long groupId, int start, int end) {
return filterFindByGroupId(groupId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPRule",
">",
"filterFindByGroupId",
"(",
"long",
"groupId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"filterFindByGroupId",
"(",
"groupId",
",",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
... | Returns a range of all the cp rules that the user has permission to view where groupId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to t... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"cp",
"rules",
"that",
"the",
"user",
"has",
"permission",
"to",
"view",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPRulePersistenceImpl.java#L554-L557 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/operations/common/OrderedChildTypesAttachment.java | OrderedChildTypesAttachment.addOrderedChildResourceTypes | public void addOrderedChildResourceTypes(PathAddress resourceAddress, Resource resource) {
"""
If the resource has ordered child types, those child types will be stored in the attachment. If there are no
ordered child types, this method is a no-op.
@param resourceAddress the address of the resource
@param res... | java | public void addOrderedChildResourceTypes(PathAddress resourceAddress, Resource resource) {
Set<String> orderedChildTypes = resource.getOrderedChildTypes();
if (orderedChildTypes.size() > 0) {
orderedChildren.put(resourceAddress, resource.getOrderedChildTypes());
}
} | [
"public",
"void",
"addOrderedChildResourceTypes",
"(",
"PathAddress",
"resourceAddress",
",",
"Resource",
"resource",
")",
"{",
"Set",
"<",
"String",
">",
"orderedChildTypes",
"=",
"resource",
".",
"getOrderedChildTypes",
"(",
")",
";",
"if",
"(",
"orderedChildTypes... | If the resource has ordered child types, those child types will be stored in the attachment. If there are no
ordered child types, this method is a no-op.
@param resourceAddress the address of the resource
@param resource the resource which may or may not have ordered children. | [
"If",
"the",
"resource",
"has",
"ordered",
"child",
"types",
"those",
"child",
"types",
"will",
"be",
"stored",
"in",
"the",
"attachment",
".",
"If",
"there",
"are",
"no",
"ordered",
"child",
"types",
"this",
"method",
"is",
"a",
"no",
"-",
"op",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/operations/common/OrderedChildTypesAttachment.java#L32-L37 |
DV8FromTheWorld/JDA | src/main/java/net/dv8tion/jda/core/utils/MiscUtil.java | MiscUtil.createRequestBody | public static RequestBody createRequestBody(final MediaType contentType, final InputStream stream) {
"""
Creates a new request body that transmits the provided {@link java.io.InputStream InputStream}.
@param contentType
The {@link okhttp3.MediaType MediaType} of the data
@param stream
The {@link java.io.In... | java | public static RequestBody createRequestBody(final MediaType contentType, final InputStream stream)
{
return new RequestBody()
{
@Override
public MediaType contentType()
{
return contentType;
}
@Override
public v... | [
"public",
"static",
"RequestBody",
"createRequestBody",
"(",
"final",
"MediaType",
"contentType",
",",
"final",
"InputStream",
"stream",
")",
"{",
"return",
"new",
"RequestBody",
"(",
")",
"{",
"@",
"Override",
"public",
"MediaType",
"contentType",
"(",
")",
"{"... | Creates a new request body that transmits the provided {@link java.io.InputStream InputStream}.
@param contentType
The {@link okhttp3.MediaType MediaType} of the data
@param stream
The {@link java.io.InputStream InputStream} to be transmitted
@return RequestBody capable of transmitting the provided InputStream of d... | [
"Creates",
"a",
"new",
"request",
"body",
"that",
"transmits",
"the",
"provided",
"{",
"@link",
"java",
".",
"io",
".",
"InputStream",
"InputStream",
"}",
"."
] | train | https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/utils/MiscUtil.java#L299-L318 |
Impetus/Kundera | src/kundera-redis/src/main/java/com/impetus/client/redis/RedisClient.java | RedisClient.reInitialize | private Object reInitialize(Object connection, Set<String> rowKeys) {
"""
Re initialize.
@param connection
the connection
@param rowKeys
the row keys
@return the object
"""
/*
* if(!rowKeys.isEmpty()) {
*/
connection = getConnection();
// }
return connec... | java | private Object reInitialize(Object connection, Set<String> rowKeys)
{
/*
* if(!rowKeys.isEmpty()) {
*/
connection = getConnection();
// }
return connection;
} | [
"private",
"Object",
"reInitialize",
"(",
"Object",
"connection",
",",
"Set",
"<",
"String",
">",
"rowKeys",
")",
"{",
"/*\n * if(!rowKeys.isEmpty()) {\n */",
"connection",
"=",
"getConnection",
"(",
")",
";",
"// }",
"return",
"connection",
";",
"}"... | Re initialize.
@param connection
the connection
@param rowKeys
the row keys
@return the object | [
"Re",
"initialize",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-redis/src/main/java/com/impetus/client/redis/RedisClient.java#L1836-L1844 |
EdwardRaff/JSAT | JSAT/src/jsat/utils/concurrent/AtomicDouble.java | AtomicDouble.getAndAccumulate | public final double getAndAccumulate(double x, DoubleBinaryOperator accumulatorFunction) {
"""
Atomically updates the current value with the results of
applying the given function to the current and given values,
returning the previous value. The function should be
side-effect-free, since it may be re-applied w... | java | public final double getAndAccumulate(double x, DoubleBinaryOperator accumulatorFunction)
{
double prev, next;
do
{
prev = get();
next = accumulatorFunction.applyAsDouble(prev, x);
}
while (!compareAndSet(prev, next));
return prev;
... | [
"public",
"final",
"double",
"getAndAccumulate",
"(",
"double",
"x",
",",
"DoubleBinaryOperator",
"accumulatorFunction",
")",
"{",
"double",
"prev",
",",
"next",
";",
"do",
"{",
"prev",
"=",
"get",
"(",
")",
";",
"next",
"=",
"accumulatorFunction",
".",
"app... | Atomically updates the current value with the results of
applying the given function to the current and given values,
returning the previous value. The function should be
side-effect-free, since it may be re-applied when attempted
updates fail due to contention among threads. The function
is applied with the current v... | [
"Atomically",
"updates",
"the",
"current",
"value",
"with",
"the",
"results",
"of",
"applying",
"the",
"given",
"function",
"to",
"the",
"current",
"and",
"given",
"values",
"returning",
"the",
"previous",
"value",
".",
"The",
"function",
"should",
"be",
"side... | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/utils/concurrent/AtomicDouble.java#L118-L128 |
Azure/azure-sdk-for-java | storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/BlobContainersInner.java | BlobContainersInner.createAsync | public Observable<BlobContainerInner> createAsync(String resourceGroupName, String accountName, String containerName) {
"""
Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the... | java | public Observable<BlobContainerInner> createAsync(String resourceGroupName, String accountName, String containerName) {
return createWithServiceResponseAsync(resourceGroupName, accountName, containerName).map(new Func1<ServiceResponse<BlobContainerInner>, BlobContainerInner>() {
@Override
... | [
"public",
"Observable",
"<",
"BlobContainerInner",
">",
"createAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"containerName",
")",
"{",
"return",
"createWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName",
"... | Creates a new container under the specified account as described by request body. The container resource includes metadata and properties for that container. It does not include a list of the blobs contained by the container.
@param resourceGroupName The name of the resource group within the user's subscription. The n... | [
"Creates",
"a",
"new",
"container",
"under",
"the",
"specified",
"account",
"as",
"described",
"by",
"request",
"body",
".",
"The",
"container",
"resource",
"includes",
"metadata",
"and",
"properties",
"for",
"that",
"container",
".",
"It",
"does",
"not",
"inc... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/BlobContainersInner.java#L243-L250 |
apache/groovy | src/main/java/org/codehaus/groovy/classgen/EnumCompletionVisitor.java | EnumCompletionVisitor.addImplicitConstructors | private static void addImplicitConstructors(ClassNode enumClass, boolean aic) {
"""
Add map and no-arg constructor or mirror those of the superclass (i.e. base enum).
"""
if (aic) {
ClassNode sn = enumClass.getSuperClass();
List<ConstructorNode> sctors = new ArrayList<Constructo... | java | private static void addImplicitConstructors(ClassNode enumClass, boolean aic) {
if (aic) {
ClassNode sn = enumClass.getSuperClass();
List<ConstructorNode> sctors = new ArrayList<ConstructorNode>(sn.getDeclaredConstructors());
if (sctors.isEmpty()) {
addMapCons... | [
"private",
"static",
"void",
"addImplicitConstructors",
"(",
"ClassNode",
"enumClass",
",",
"boolean",
"aic",
")",
"{",
"if",
"(",
"aic",
")",
"{",
"ClassNode",
"sn",
"=",
"enumClass",
".",
"getSuperClass",
"(",
")",
";",
"List",
"<",
"ConstructorNode",
">",... | Add map and no-arg constructor or mirror those of the superclass (i.e. base enum). | [
"Add",
"map",
"and",
"no",
"-",
"arg",
"constructor",
"or",
"mirror",
"those",
"of",
"the",
"superclass",
"(",
"i",
".",
"e",
".",
"base",
"enum",
")",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/classgen/EnumCompletionVisitor.java#L81-L96 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/hashcode/HashCodeCalculator.java | HashCodeCalculator.append | public static int append (final int nPrevHashCode, @Nullable final Object x) {
"""
Object hash code generation.
@param nPrevHashCode
The previous hash code used as the basis for calculation
@param x
Object to add. May be <code>null</code>.
@return The updated hash code
"""
return append (nPrevHashCo... | java | public static int append (final int nPrevHashCode, @Nullable final Object x)
{
return append (nPrevHashCode, HashCodeImplementationRegistry.getHashCode (x));
} | [
"public",
"static",
"int",
"append",
"(",
"final",
"int",
"nPrevHashCode",
",",
"@",
"Nullable",
"final",
"Object",
"x",
")",
"{",
"return",
"append",
"(",
"nPrevHashCode",
",",
"HashCodeImplementationRegistry",
".",
"getHashCode",
"(",
"x",
")",
")",
";",
"... | Object hash code generation.
@param nPrevHashCode
The previous hash code used as the basis for calculation
@param x
Object to add. May be <code>null</code>.
@return The updated hash code | [
"Object",
"hash",
"code",
"generation",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/hashcode/HashCodeCalculator.java#L173-L176 |
aws/aws-sdk-java | aws-java-sdk-sagemaker/src/main/java/com/amazonaws/services/sagemaker/model/DescribeTransformJobResult.java | DescribeTransformJobResult.withEnvironment | public DescribeTransformJobResult withEnvironment(java.util.Map<String, String> environment) {
"""
<p>
The environment variables to set in the Docker container. We support up to 16 key and values entries in the map.
</p>
@param environment
The environment variables to set in the Docker container. We support ... | java | public DescribeTransformJobResult withEnvironment(java.util.Map<String, String> environment) {
setEnvironment(environment);
return this;
} | [
"public",
"DescribeTransformJobResult",
"withEnvironment",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"environment",
")",
"{",
"setEnvironment",
"(",
"environment",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The environment variables to set in the Docker container. We support up to 16 key and values entries in the map.
</p>
@param environment
The environment variables to set in the Docker container. We support up to 16 key and values entries in
the map.
@return Returns a reference to this object so that method calls c... | [
"<p",
">",
"The",
"environment",
"variables",
"to",
"set",
"in",
"the",
"Docker",
"container",
".",
"We",
"support",
"up",
"to",
"16",
"key",
"and",
"values",
"entries",
"in",
"the",
"map",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sagemaker/src/main/java/com/amazonaws/services/sagemaker/model/DescribeTransformJobResult.java#L604-L607 |
google/closure-compiler | src/com/google/javascript/jscomp/ValidityCheck.java | ValidityCheck.checkNormalization | private void checkNormalization(Node externs, Node root) {
"""
Verifies that the normalization pass does nothing on an already-normalized tree.
"""
// Verify nothing has inappropriately denormalize the AST.
CodeChangeHandler handler = new ForbiddenChange();
compiler.addChangeHandler(handler);
... | java | private void checkNormalization(Node externs, Node root) {
// Verify nothing has inappropriately denormalize the AST.
CodeChangeHandler handler = new ForbiddenChange();
compiler.addChangeHandler(handler);
// TODO(johnlenz): Change these normalization checks Preconditions and
// Exceptions into Erro... | [
"private",
"void",
"checkNormalization",
"(",
"Node",
"externs",
",",
"Node",
"root",
")",
"{",
"// Verify nothing has inappropriately denormalize the AST.",
"CodeChangeHandler",
"handler",
"=",
"new",
"ForbiddenChange",
"(",
")",
";",
"compiler",
".",
"addChangeHandler",... | Verifies that the normalization pass does nothing on an already-normalized tree. | [
"Verifies",
"that",
"the",
"normalization",
"pass",
"does",
"nothing",
"on",
"an",
"already",
"-",
"normalized",
"tree",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/ValidityCheck.java#L80-L100 |
alkacon/opencms-core | src-setup/org/opencms/setup/db/update6to7/CmsUpdateDBProjectId.java | CmsUpdateDBProjectId.dropColumn | private void dropColumn(CmsSetupDb dbCon, String tablename, String column) throws SQLException {
"""
Drops the column of the given table.<p>
@param dbCon the db connection interface
@param tablename the table in which the columns shall be dropped
@param column the column to drop
@throws SQLException if som... | java | private void dropColumn(CmsSetupDb dbCon, String tablename, String column) throws SQLException {
System.out.println(new Exception().getStackTrace()[0].toString());
if (dbCon.hasTableOrColumn(tablename, column)) {
String query = readQuery(QUERY_DROP_COLUMN);
Map<String, String> r... | [
"private",
"void",
"dropColumn",
"(",
"CmsSetupDb",
"dbCon",
",",
"String",
"tablename",
",",
"String",
"column",
")",
"throws",
"SQLException",
"{",
"System",
".",
"out",
".",
"println",
"(",
"new",
"Exception",
"(",
")",
".",
"getStackTrace",
"(",
")",
"... | Drops the column of the given table.<p>
@param dbCon the db connection interface
@param tablename the table in which the columns shall be dropped
@param column the column to drop
@throws SQLException if something goes wrong | [
"Drops",
"the",
"column",
"of",
"the",
"given",
"table",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-setup/org/opencms/setup/db/update6to7/CmsUpdateDBProjectId.java#L558-L570 |
EvidentSolutions/dalesbred | dalesbred/src/main/java/org/dalesbred/Database.java | Database.findOptionalInt | public @NotNull OptionalInt findOptionalInt(@NotNull @SQL String sql, Object... args) {
"""
Finds a unique result from database, converting the database row to int using default mechanisms.
Returns empty if there are no results or if single null result is returned.
@throws NonUniqueResultException if there are... | java | public @NotNull OptionalInt findOptionalInt(@NotNull @SQL String sql, Object... args) {
return findOptionalInt(SqlQuery.query(sql, args));
} | [
"public",
"@",
"NotNull",
"OptionalInt",
"findOptionalInt",
"(",
"@",
"NotNull",
"@",
"SQL",
"String",
"sql",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"findOptionalInt",
"(",
"SqlQuery",
".",
"query",
"(",
"sql",
",",
"args",
")",
")",
";",
"}"
... | Finds a unique result from database, converting the database row to int using default mechanisms.
Returns empty if there are no results or if single null result is returned.
@throws NonUniqueResultException if there are multiple result rows | [
"Finds",
"a",
"unique",
"result",
"from",
"database",
"converting",
"the",
"database",
"row",
"to",
"int",
"using",
"default",
"mechanisms",
".",
"Returns",
"empty",
"if",
"there",
"are",
"no",
"results",
"or",
"if",
"single",
"null",
"result",
"is",
"return... | train | https://github.com/EvidentSolutions/dalesbred/blob/713f5b6e152d97e1672ca68b9ff9c7c6c288ceb1/dalesbred/src/main/java/org/dalesbred/Database.java#L412-L414 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/SourceStream.java | SourceStream.msgCanBeSent | private synchronized boolean msgCanBeSent( long stamp, boolean nackMsg ) {
"""
Method that determines if the message can be sent.
If the message is a NACK message then we should not check the stream for guesses,
but we should still follow the other checks for the stream.
@param stamp
@return
"""
if... | java | private synchronized boolean msgCanBeSent( long stamp, boolean nackMsg )
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "msgCanBeSent", new Object[] { Long.valueOf(stamp),
Boolean.valueOf(nackMsg),
Long.valueOf(firstMsgOutsideWindow),
B... | [
"private",
"synchronized",
"boolean",
"msgCanBeSent",
"(",
"long",
"stamp",
",",
"boolean",
"nackMsg",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
... | Method that determines if the message can be sent.
If the message is a NACK message then we should not check the stream for guesses,
but we should still follow the other checks for the stream.
@param stamp
@return | [
"Method",
"that",
"determines",
"if",
"the",
"message",
"can",
"be",
"sent",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/SourceStream.java#L2037-L2063 |
hibernate/hibernate-ogm | neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/embedded/dialect/impl/EmbeddedNeo4jAssociationQueries.java | EmbeddedNeo4jAssociationQueries.createRelationshipForCollectionOfPrimitivesOrMap | private void createRelationshipForCollectionOfPrimitivesOrMap(AssociationKey associationKey, String collectionRole, String[] columnNames, StringBuilder queryBuilder) {
"""
/*
Append query part related to the creation of a relationship for a collection of primitive or a Map like in the following examples:
1) @E... | java | private void createRelationshipForCollectionOfPrimitivesOrMap(AssociationKey associationKey, String collectionRole, String[] columnNames, StringBuilder queryBuilder) {
String relationshipType = collectionRole;
if ( isPartOfEmbedded( collectionRole ) ) {
queryBuilder.append( " MERGE (owner) " );
String[] pathT... | [
"private",
"void",
"createRelationshipForCollectionOfPrimitivesOrMap",
"(",
"AssociationKey",
"associationKey",
",",
"String",
"collectionRole",
",",
"String",
"[",
"]",
"columnNames",
",",
"StringBuilder",
"queryBuilder",
")",
"{",
"String",
"relationshipType",
"=",
"col... | /*
Append query part related to the creation of a relationship for a collection of primitive or a Map like in the following examples:
1) @ElemntCollection List<String> alternatives
2) @MapKeyColumn(name = "addressType") Map<String, Address> addresses
Query example for embedded collection of primitives or Map:
MATCH (... | [
"/",
"*",
"Append",
"query",
"part",
"related",
"to",
"the",
"creation",
"of",
"a",
"relationship",
"for",
"a",
"collection",
"of",
"primitive",
"or",
"a",
"Map",
"like",
"in",
"the",
"following",
"examples",
":"
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/neo4j/src/main/java/org/hibernate/ogm/datastore/neo4j/embedded/dialect/impl/EmbeddedNeo4jAssociationQueries.java#L274-L299 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/asm/AsmUtils.java | AsmUtils.iincInsnEqual | public static boolean iincInsnEqual(IincInsnNode node1, IincInsnNode node2) {
"""
Checks if two {@link IincInsnNode} are equals.
@param node1 the node1
@param node2 the node2
@return true, if successful
"""
return node1.var == node2.var && node1.incr == node2.incr;
} | java | public static boolean iincInsnEqual(IincInsnNode node1, IincInsnNode node2)
{
return node1.var == node2.var && node1.incr == node2.incr;
} | [
"public",
"static",
"boolean",
"iincInsnEqual",
"(",
"IincInsnNode",
"node1",
",",
"IincInsnNode",
"node2",
")",
"{",
"return",
"node1",
".",
"var",
"==",
"node2",
".",
"var",
"&&",
"node1",
".",
"incr",
"==",
"node2",
".",
"incr",
";",
"}"
] | Checks if two {@link IincInsnNode} are equals.
@param node1 the node1
@param node2 the node2
@return true, if successful | [
"Checks",
"if",
"two",
"{",
"@link",
"IincInsnNode",
"}",
"are",
"equals",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/asm/AsmUtils.java#L249-L252 |
apache/incubator-atlas | client/src/main/java/org/apache/atlas/AtlasClient.java | AtlasClient.deleteTrait | public void deleteTrait(String guid, String traitName) throws AtlasServiceException {
"""
Delete a trait from the given entity
@param guid guid of the entity
@param traitName trait to be deleted
@throws AtlasServiceException
"""
callAPIWithBodyAndParams(API.DELETE_TRAITS, null, guid, TRAITS, traitNa... | java | public void deleteTrait(String guid, String traitName) throws AtlasServiceException {
callAPIWithBodyAndParams(API.DELETE_TRAITS, null, guid, TRAITS, traitName);
} | [
"public",
"void",
"deleteTrait",
"(",
"String",
"guid",
",",
"String",
"traitName",
")",
"throws",
"AtlasServiceException",
"{",
"callAPIWithBodyAndParams",
"(",
"API",
".",
"DELETE_TRAITS",
",",
"null",
",",
"guid",
",",
"TRAITS",
",",
"traitName",
")",
";",
... | Delete a trait from the given entity
@param guid guid of the entity
@param traitName trait to be deleted
@throws AtlasServiceException | [
"Delete",
"a",
"trait",
"from",
"the",
"given",
"entity"
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/client/src/main/java/org/apache/atlas/AtlasClient.java#L542-L544 |
onepf/OpenIAB | library/src/main/java/org/onepf/oms/util/Utils.java | Utils.isPackageInstaller | public static boolean isPackageInstaller(@NotNull final Context context, final String packageName) {
"""
Checks if an application with the passed name is the installer of the calling app.
@param packageName The package name of the tested application.
@return true if the application with the passed package is t... | java | public static boolean isPackageInstaller(@NotNull final Context context, final String packageName) {
final PackageManager packageManager = context.getPackageManager();
final String installerPackageName = packageManager.getInstallerPackageName(context.getPackageName());
boolean isPackageInstaller... | [
"public",
"static",
"boolean",
"isPackageInstaller",
"(",
"@",
"NotNull",
"final",
"Context",
"context",
",",
"final",
"String",
"packageName",
")",
"{",
"final",
"PackageManager",
"packageManager",
"=",
"context",
".",
"getPackageManager",
"(",
")",
";",
"final",... | Checks if an application with the passed name is the installer of the calling app.
@param packageName The package name of the tested application.
@return true if the application with the passed package is the installer. | [
"Checks",
"if",
"an",
"application",
"with",
"the",
"passed",
"name",
"is",
"the",
"installer",
"of",
"the",
"calling",
"app",
"."
] | train | https://github.com/onepf/OpenIAB/blob/90552d53c5303b322940d96a0c4b7cb797d78760/library/src/main/java/org/onepf/oms/util/Utils.java#L71-L77 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/VirtualNetworkTapsInner.java | VirtualNetworkTapsInner.createOrUpdate | public VirtualNetworkTapInner createOrUpdate(String resourceGroupName, String tapName, VirtualNetworkTapInner parameters) {
"""
Creates or updates a Virtual Network Tap.
@param resourceGroupName The name of the resource group.
@param tapName The name of the virtual network tap.
@param parameters Parameters su... | java | public VirtualNetworkTapInner createOrUpdate(String resourceGroupName, String tapName, VirtualNetworkTapInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, tapName, parameters).toBlocking().last().body();
} | [
"public",
"VirtualNetworkTapInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"tapName",
",",
"VirtualNetworkTapInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"tapName",
",",
"par... | Creates or updates a Virtual Network Tap.
@param resourceGroupName The name of the resource group.
@param tapName The name of the virtual network tap.
@param parameters Parameters supplied to the create or update virtual network tap operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@... | [
"Creates",
"or",
"updates",
"a",
"Virtual",
"Network",
"Tap",
"."
] | 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/VirtualNetworkTapsInner.java#L362-L364 |
rolfl/MicroBench | src/main/java/net/tuis/ubench/UBench.java | UBench.addTask | public <T> UBench addTask(String name, Supplier<T> task) {
"""
Include a named task in to the benchmark.
@param <T>
The type of the return value from the task. It is ignored.
@param name
The name of the task. Only one task with any one name is
allowed.
@param task
The task to perform
@return The same o... | java | public <T> UBench addTask(String name, Supplier<T> task) {
return addTask(name, task, null);
} | [
"public",
"<",
"T",
">",
"UBench",
"addTask",
"(",
"String",
"name",
",",
"Supplier",
"<",
"T",
">",
"task",
")",
"{",
"return",
"addTask",
"(",
"name",
",",
"task",
",",
"null",
")",
";",
"}"
] | Include a named task in to the benchmark.
@param <T>
The type of the return value from the task. It is ignored.
@param name
The name of the task. Only one task with any one name is
allowed.
@param task
The task to perform
@return The same object, for chaining calls. | [
"Include",
"a",
"named",
"task",
"in",
"to",
"the",
"benchmark",
"."
] | train | https://github.com/rolfl/MicroBench/blob/f2bfa92dacd7ea0d6b8eae4d4fe2975139d317ce/src/main/java/net/tuis/ubench/UBench.java#L153-L155 |
thymeleaf/thymeleaf | src/main/java/org/thymeleaf/util/TextUtils.java | TextUtils.endsWith | public static boolean endsWith(final boolean caseSensitive, final CharSequence text, final CharSequence suffix) {
"""
<p>
Checks whether a text ends with a specified suffix.
</p>
@param caseSensitive whether the comparison must be done in a case-sensitive or case-insensitive way.
@param text the text to be c... | java | public static boolean endsWith(final boolean caseSensitive, final CharSequence text, final CharSequence suffix) {
if (text == null) {
throw new IllegalArgumentException("Text cannot be null");
}
if (suffix == null) {
throw new IllegalArgumentException("Suffix cannot be n... | [
"public",
"static",
"boolean",
"endsWith",
"(",
"final",
"boolean",
"caseSensitive",
",",
"final",
"CharSequence",
"text",
",",
"final",
"CharSequence",
"suffix",
")",
"{",
"if",
"(",
"text",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
... | <p>
Checks whether a text ends with a specified suffix.
</p>
@param caseSensitive whether the comparison must be done in a case-sensitive or case-insensitive way.
@param text the text to be checked for suffixes.
@param suffix the suffix to be searched.
@return whether the text ends with the suffix or not. | [
"<p",
">",
"Checks",
"whether",
"a",
"text",
"ends",
"with",
"a",
"specified",
"suffix",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/thymeleaf/thymeleaf/blob/2b0e6d6d7571fbe638904b5fd222fc9e77188879/src/main/java/org/thymeleaf/util/TextUtils.java#L680-L695 |
jqm4gwt/jqm4gwt | library/src/main/java/com/sksamuel/jqm4gwt/form/elements/JQMFlip.java | JQMFlip.setValue | @Override
public void setValue(String value, boolean fireEvents) {
"""
Sets the currently selected value.
@param fireEvents - if false then ValueChangeEvent won't be raised (though ChangeEvent will be raised anyway).
"""
int newIdx = value == null ? 0 : value.equals(getValue1()) ? 0
... | java | @Override
public void setValue(String value, boolean fireEvents) {
int newIdx = value == null ? 0 : value.equals(getValue1()) ? 0
: value.equals(getValue2()) ? 1 : 0;
int oldIdx = getSelectedIndex();
String oldVal = fireEvents ? getValue() : null;
... | [
"@",
"Override",
"public",
"void",
"setValue",
"(",
"String",
"value",
",",
"boolean",
"fireEvents",
")",
"{",
"int",
"newIdx",
"=",
"value",
"==",
"null",
"?",
"0",
":",
"value",
".",
"equals",
"(",
"getValue1",
"(",
")",
")",
"?",
"0",
":",
"value"... | Sets the currently selected value.
@param fireEvents - if false then ValueChangeEvent won't be raised (though ChangeEvent will be raised anyway). | [
"Sets",
"the",
"currently",
"selected",
"value",
"."
] | train | https://github.com/jqm4gwt/jqm4gwt/blob/cf59958e9ba6d4b70f42507b2c77f10c2465085b/library/src/main/java/com/sksamuel/jqm4gwt/form/elements/JQMFlip.java#L299-L319 |
microfocus-idol/java-content-parameter-api | src/main/java/com/hp/autonomy/aci/content/fieldtext/FieldTextBuilder.java | FieldTextBuilder.WHEN | @Override
public FieldTextBuilder WHEN(final int depth, final FieldText fieldText) {
"""
Appends the specified fieldtext onto the builder using the WHEN<i>n</i> operator.
@param depth The <i>n</i> in WHEN<i>n</i>
@param fieldText A fieldtext expression or specifier.
@return {@code this}.
"""
... | java | @Override
public FieldTextBuilder WHEN(final int depth, final FieldText fieldText) {
Validate.isTrue(depth >= 1, "Depth must be at least 1");
Validate.notNull(fieldText, "FieldText should not be null");
Validate.isTrue(fieldText.size() >= 1, "FieldText must have a size greater or equal to 1... | [
"@",
"Override",
"public",
"FieldTextBuilder",
"WHEN",
"(",
"final",
"int",
"depth",
",",
"final",
"FieldText",
"fieldText",
")",
"{",
"Validate",
".",
"isTrue",
"(",
"depth",
">=",
"1",
",",
"\"Depth must be at least 1\"",
")",
";",
"Validate",
".",
"notNull"... | Appends the specified fieldtext onto the builder using the WHEN<i>n</i> operator.
@param depth The <i>n</i> in WHEN<i>n</i>
@param fieldText A fieldtext expression or specifier.
@return {@code this}. | [
"Appends",
"the",
"specified",
"fieldtext",
"onto",
"the",
"builder",
"using",
"the",
"WHEN<i",
">",
"n<",
"/",
"i",
">",
"operator",
"."
] | train | https://github.com/microfocus-idol/java-content-parameter-api/blob/8d33dc633f8df2a470a571ac7694e423e7004ad0/src/main/java/com/hp/autonomy/aci/content/fieldtext/FieldTextBuilder.java#L256-L280 |
sebastiangraf/treetank | interfacemodules/jax-rx/src/main/java/org/treetank/service/jaxrx/util/WorkerHelper.java | WorkerHelper.serializeXML | public static XMLSerializer serializeXML(final ISession session, final OutputStream out,
final boolean serializeXMLDec, final boolean serializeRest, final Long revision) {
"""
This method creates a new XMLSerializer reference
@param session
Associated session.
@param out
OutputStream
@param serial... | java | public static XMLSerializer serializeXML(final ISession session, final OutputStream out,
final boolean serializeXMLDec, final boolean serializeRest, final Long revision) {
final XMLSerializerBuilder builder;
if (revision == null)
builder = new XMLSerializerBuilder(session, out);
... | [
"public",
"static",
"XMLSerializer",
"serializeXML",
"(",
"final",
"ISession",
"session",
",",
"final",
"OutputStream",
"out",
",",
"final",
"boolean",
"serializeXMLDec",
",",
"final",
"boolean",
"serializeRest",
",",
"final",
"Long",
"revision",
")",
"{",
"final"... | This method creates a new XMLSerializer reference
@param session
Associated session.
@param out
OutputStream
@param serializeXMLDec
specifies whether XML declaration should be shown
@param serializeRest
specifies whether node id should be shown
@return new XMLSerializer reference | [
"This",
"method",
"creates",
"a",
"new",
"XMLSerializer",
"reference"
] | train | https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/jax-rx/src/main/java/org/treetank/service/jaxrx/util/WorkerHelper.java#L125-L137 |
ineunetOS/knife-commons | knife-commons-utils/src/main/java/com/ineunet/knife/util/StringUtils.java | StringUtils.containsOnly | public static boolean containsOnly(String str, char[] valid) {
"""
<p>Checks if the String contains only certain characters.</p>
<p>A <code>null</code> String will return <code>false</code>.
A <code>null</code> valid character array will return <code>false</code>.
An empty String (length()=0) always returns <... | java | public static boolean containsOnly(String str, char[] valid) {
// All these pre-checks are to maintain API with an older version
if ((valid == null) || (str == null)) {
return false;
}
if (str.length() == 0) {
return true;
}
if (valid.length == 0) ... | [
"public",
"static",
"boolean",
"containsOnly",
"(",
"String",
"str",
",",
"char",
"[",
"]",
"valid",
")",
"{",
"// All these pre-checks are to maintain API with an older version",
"if",
"(",
"(",
"valid",
"==",
"null",
")",
"||",
"(",
"str",
"==",
"null",
")",
... | <p>Checks if the String contains only certain characters.</p>
<p>A <code>null</code> String will return <code>false</code>.
A <code>null</code> valid character array will return <code>false</code>.
An empty String (length()=0) always returns <code>true</code>.</p>
<pre>
StringUtils.containsOnly(null, *) = false... | [
"<p",
">",
"Checks",
"if",
"the",
"String",
"contains",
"only",
"certain",
"characters",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ineunetOS/knife-commons/blob/eae9e59afa020a00ae8977c10d43ac8ae46ae236/knife-commons-utils/src/main/java/com/ineunet/knife/util/StringUtils.java#L1565-L1577 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/FeaturesImpl.java | FeaturesImpl.listWithServiceResponseAsync | public Observable<ServiceResponse<FeaturesResponseObject>> listWithServiceResponseAsync(UUID appId, String versionId, ListFeaturesOptionalParameter listOptionalParameter) {
"""
Gets all the extraction features for the specified application version.
@param appId The application ID.
@param versionId The version ... | java | public Observable<ServiceResponse<FeaturesResponseObject>> listWithServiceResponseAsync(UUID appId, String versionId, ListFeaturesOptionalParameter listOptionalParameter) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cann... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"FeaturesResponseObject",
">",
">",
"listWithServiceResponseAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"ListFeaturesOptionalParameter",
"listOptionalParameter",
")",
"{",
"if",
"(",
"this",
".",
... | Gets all the extraction features for the specified application version.
@param appId The application ID.
@param versionId The version ID.
@param listOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the validat... | [
"Gets",
"all",
"the",
"extraction",
"features",
"for",
"the",
"specified",
"application",
"version",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/FeaturesImpl.java#L424-L438 |
d-michail/jheaps | src/main/java/org/jheaps/tree/CostlessMeldPairingHeap.java | CostlessMeldPairingHeap.linkInPlace | private void linkInPlace(Node<K, V> orphan, Node<K, V> n) {
"""
Put an orphan node into the position of another node. The other node
becomes an orphan.
@param orphan
the orphan node
@param n
the node which will become an orphan
"""
// link orphan at node's position
orphan.y_s = n.y_s;
... | java | private void linkInPlace(Node<K, V> orphan, Node<K, V> n) {
// link orphan at node's position
orphan.y_s = n.y_s;
if (n.y_s != null) {
n.y_s.o_s = orphan;
}
orphan.o_s = n.o_s;
if (n.o_s != null) {
if (n.o_s.o_c == n) { // node is the oldest :(
... | [
"private",
"void",
"linkInPlace",
"(",
"Node",
"<",
"K",
",",
"V",
">",
"orphan",
",",
"Node",
"<",
"K",
",",
"V",
">",
"n",
")",
"{",
"// link orphan at node's position",
"orphan",
".",
"y_s",
"=",
"n",
".",
"y_s",
";",
"if",
"(",
"n",
".",
"y_s",... | Put an orphan node into the position of another node. The other node
becomes an orphan.
@param orphan
the orphan node
@param n
the node which will become an orphan | [
"Put",
"an",
"orphan",
"node",
"into",
"the",
"position",
"of",
"another",
"node",
".",
"The",
"other",
"node",
"becomes",
"an",
"orphan",
"."
] | train | https://github.com/d-michail/jheaps/blob/7146451dd6591c2a8559dc564c9c40428c4a2c10/src/main/java/org/jheaps/tree/CostlessMeldPairingHeap.java#L910-L926 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/client/gui/render/GuiRenderer.java | GuiRenderer.drawItemStack | public void drawItemStack(ItemStack itemStack, int x, int y) {
"""
Draws an itemStack to the GUI at the specified coordinates.
@param itemStack the item stack
@param x the x
@param y the y
"""
drawItemStack(itemStack, x, y, null, null, true);
} | java | public void drawItemStack(ItemStack itemStack, int x, int y)
{
drawItemStack(itemStack, x, y, null, null, true);
} | [
"public",
"void",
"drawItemStack",
"(",
"ItemStack",
"itemStack",
",",
"int",
"x",
",",
"int",
"y",
")",
"{",
"drawItemStack",
"(",
"itemStack",
",",
"x",
",",
"y",
",",
"null",
",",
"null",
",",
"true",
")",
";",
"}"
] | Draws an itemStack to the GUI at the specified coordinates.
@param itemStack the item stack
@param x the x
@param y the y | [
"Draws",
"an",
"itemStack",
"to",
"the",
"GUI",
"at",
"the",
"specified",
"coordinates",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/client/gui/render/GuiRenderer.java#L372-L375 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/URLConnectionTools.java | URLConnectionTools.getInputStream | public static InputStream getInputStream(URL url, boolean acceptGzipEncoding, int timeout) throws IOException {
"""
Open a URL and return an InputStream to it
if acceptGzipEncoding == true, use GZIPEncoding to
compress communication.
<p>
The caller is responsible to close the returned InputStream not to cause
... | java | public static InputStream getInputStream(URL url, boolean acceptGzipEncoding, int timeout) throws IOException {
InputStream inStream = null ;
URLConnection huc = URLConnectionTools.openURLConnection(url,timeout);
if ( acceptGzipEncoding) huc.setRequestProperty("Accept-Encoding", "gzip");
String contentEncodin... | [
"public",
"static",
"InputStream",
"getInputStream",
"(",
"URL",
"url",
",",
"boolean",
"acceptGzipEncoding",
",",
"int",
"timeout",
")",
"throws",
"IOException",
"{",
"InputStream",
"inStream",
"=",
"null",
";",
"URLConnection",
"huc",
"=",
"URLConnectionTools",
... | Open a URL and return an InputStream to it
if acceptGzipEncoding == true, use GZIPEncoding to
compress communication.
<p>
The caller is responsible to close the returned InputStream not to cause
resource leaks.
@param url the input URL to be read
@param acceptGzipEncoding whether to accept Gzip encoding
@param timeout
... | [
"Open",
"a",
"URL",
"and",
"return",
"an",
"InputStream",
"to",
"it",
"if",
"acceptGzipEncoding",
"==",
"true",
"use",
"GZIPEncoding",
"to",
"compress",
"communication",
".",
"<p",
">",
"The",
"caller",
"is",
"responsible",
"to",
"close",
"the",
"returned",
... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/URLConnectionTools.java#L125-L143 |
cdk/cdk | base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/Mappings.java | Mappings.uniqueBonds | public Mappings uniqueBonds() {
"""
Filter the mappings for those which cover a unique set of bonds in the
target.
@return fluent-api instance
@see #uniqueAtoms()
"""
// we need the unique predicate to be reset for each new iterator -
// otherwise multiple iterations are always filtered (s... | java | public Mappings uniqueBonds() {
// we need the unique predicate to be reset for each new iterator -
// otherwise multiple iterations are always filtered (seen before)
final int[][] g = GraphUtil.toAdjList(query);
return new Mappings(query, target, new Iterable<int[]>() {
@Ov... | [
"public",
"Mappings",
"uniqueBonds",
"(",
")",
"{",
"// we need the unique predicate to be reset for each new iterator -",
"// otherwise multiple iterations are always filtered (seen before)",
"final",
"int",
"[",
"]",
"[",
"]",
"g",
"=",
"GraphUtil",
".",
"toAdjList",
"(",
"... | Filter the mappings for those which cover a unique set of bonds in the
target.
@return fluent-api instance
@see #uniqueAtoms() | [
"Filter",
"the",
"mappings",
"for",
"those",
"which",
"cover",
"a",
"unique",
"set",
"of",
"bonds",
"in",
"the",
"target",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/isomorphism/src/main/java/org/openscience/cdk/isomorphism/Mappings.java#L297-L308 |
haraldk/TwelveMonkeys | sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/DebugUtil.java | DebugUtil.printDebug | public static void printDebug(final Enumeration pEnumeration, final String pMethodName) {
"""
Invokes a given method of every element in a {@code java.util.Enumeration} and prints the results to a {@code java.io.PrintStream}.
The method to be invoked must have no formal parameters.
<p>
If an exception is throwe... | java | public static void printDebug(final Enumeration pEnumeration, final String pMethodName) {
printDebug(pEnumeration, pMethodName, System.out);
} | [
"public",
"static",
"void",
"printDebug",
"(",
"final",
"Enumeration",
"pEnumeration",
",",
"final",
"String",
"pMethodName",
")",
"{",
"printDebug",
"(",
"pEnumeration",
",",
"pMethodName",
",",
"System",
".",
"out",
")",
";",
"}"
] | Invokes a given method of every element in a {@code java.util.Enumeration} and prints the results to a {@code java.io.PrintStream}.
The method to be invoked must have no formal parameters.
<p>
If an exception is throwed during the method invocation, the element's {@code toString()} method is called.
For bulk data types... | [
"Invokes",
"a",
"given",
"method",
"of",
"every",
"element",
"in",
"a",
"{"
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/util/DebugUtil.java#L451-L453 |
sarl/sarl | main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java | VimGenerator2.appendCluster | protected IStyleAppendable appendCluster(IStyleAppendable it, String element0, String... elements) {
"""
Append elements to the Vim top cluster.
@param it the receiver of the generated elements.
@param element0 the first element to add into the cluster.
@param elements the other elements to add into the clust... | java | protected IStyleAppendable appendCluster(IStyleAppendable it, String element0, String... elements) {
return appendCluster(it, true, element0, elements);
} | [
"protected",
"IStyleAppendable",
"appendCluster",
"(",
"IStyleAppendable",
"it",
",",
"String",
"element0",
",",
"String",
"...",
"elements",
")",
"{",
"return",
"appendCluster",
"(",
"it",
",",
"true",
",",
"element0",
",",
"elements",
")",
";",
"}"
] | Append elements to the Vim top cluster.
@param it the receiver of the generated elements.
@param element0 the first element to add into the cluster.
@param elements the other elements to add into the cluster.
@return {@code it}. | [
"Append",
"elements",
"to",
"the",
"Vim",
"top",
"cluster",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.mwe2/src/io/sarl/lang/mwe2/externalspec/vim/VimGenerator2.java#L350-L352 |
ops4j/org.ops4j.pax.swissbox | pax-swissbox-core/src/main/java/org/ops4j/pax/swissbox/core/BundleClassLoader.java | BundleClassLoader.newPriviledged | public static BundleClassLoader newPriviledged( final Bundle bundle, final ClassLoader parent ) {
"""
Privileged factory method.
@param bundle bundle to be used for class loading. Cannot be null.
@param parent parent class loader
@return created bundle class loader
@see BundleClassLoader#BundleClassLoade... | java | public static BundleClassLoader newPriviledged( final Bundle bundle, final ClassLoader parent )
{
return AccessController.doPrivileged( new PrivilegedAction<BundleClassLoader>()
{
public BundleClassLoader run()
{
return new BundleClassLoader( bundle, parent );... | [
"public",
"static",
"BundleClassLoader",
"newPriviledged",
"(",
"final",
"Bundle",
"bundle",
",",
"final",
"ClassLoader",
"parent",
")",
"{",
"return",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedAction",
"<",
"BundleClassLoader",
">",
"(",
")",
... | Privileged factory method.
@param bundle bundle to be used for class loading. Cannot be null.
@param parent parent class loader
@return created bundle class loader
@see BundleClassLoader#BundleClassLoader(Bundle,ClassLoader) | [
"Privileged",
"factory",
"method",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.swissbox/blob/00b0ee16cdbe8017984a4d7ba808b10d985c5b5c/pax-swissbox-core/src/main/java/org/ops4j/pax/swissbox/core/BundleClassLoader.java#L85-L94 |
jamesagnew/hapi-fhir | hapi-fhir-base/src/main/java/ca/uhn/fhir/util/DateUtils.java | DateUtils.formatDate | public static String formatDate(final Date date, final String pattern) {
"""
Formats the given date according to the specified pattern. The pattern
must conform to that used by the {@link SimpleDateFormat simple date
format} class.
@param date The date to format.
@param pattern The pattern to use for format... | java | public static String formatDate(final Date date, final String pattern) {
notNull(date, "Date");
notNull(pattern, "Pattern");
final SimpleDateFormat formatter = DateFormatHolder.formatFor(pattern);
return formatter.format(date);
} | [
"public",
"static",
"String",
"formatDate",
"(",
"final",
"Date",
"date",
",",
"final",
"String",
"pattern",
")",
"{",
"notNull",
"(",
"date",
",",
"\"Date\"",
")",
";",
"notNull",
"(",
"pattern",
",",
"\"Pattern\"",
")",
";",
"final",
"SimpleDateFormat",
... | Formats the given date according to the specified pattern. The pattern
must conform to that used by the {@link SimpleDateFormat simple date
format} class.
@param date The date to format.
@param pattern The pattern to use for formatting the date.
@return A formatted date string.
@throws IllegalArgumentException If th... | [
"Formats",
"the",
"given",
"date",
"according",
"to",
"the",
"specified",
"pattern",
".",
"The",
"pattern",
"must",
"conform",
"to",
"that",
"used",
"by",
"the",
"{",
"@link",
"SimpleDateFormat",
"simple",
"date",
"format",
"}",
"class",
"."
] | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/DateUtils.java#L188-L193 |
DDTH/ddth-queue | ddth-queue-core/src/main/java/com/github/ddth/queue/impl/universal/UniversalIdIntQueueMessage.java | UniversalIdIntQueueMessage.newInstance | public static UniversalIdIntQueueMessage newInstance(Map<String, Object> data) {
"""
Create a new {@link UniversalIdIntQueueMessage}.
@param data
@return
@since 0.6.2.3
"""
UniversalIdIntQueueMessage msg = newInstance();
return msg.fromMap(data);
} | java | public static UniversalIdIntQueueMessage newInstance(Map<String, Object> data) {
UniversalIdIntQueueMessage msg = newInstance();
return msg.fromMap(data);
} | [
"public",
"static",
"UniversalIdIntQueueMessage",
"newInstance",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"data",
")",
"{",
"UniversalIdIntQueueMessage",
"msg",
"=",
"newInstance",
"(",
")",
";",
"return",
"msg",
".",
"fromMap",
"(",
"data",
")",
";",
... | Create a new {@link UniversalIdIntQueueMessage}.
@param data
@return
@since 0.6.2.3 | [
"Create",
"a",
"new",
"{",
"@link",
"UniversalIdIntQueueMessage",
"}",
"."
] | train | https://github.com/DDTH/ddth-queue/blob/b20776850d23111d3d71fc8ed6023c590bc3621f/ddth-queue-core/src/main/java/com/github/ddth/queue/impl/universal/UniversalIdIntQueueMessage.java#L96-L99 |
OpenLiberty/open-liberty | dev/com.ibm.ws.session.store/src/com/ibm/ws/session/store/common/BackedSession.java | BackedSession.includeInAppDataChanges | private void includeInAppDataChanges(String name, Object value, int invoker) {
"""
Adds a session attribute to the tracked list of changed data.
Precondition: invoker must be synchronized on BackedSession instance
@param name name of session attribute
@param value value of session attribute
@param invoker ... | java | private void includeInAppDataChanges(String name, Object value, int invoker) {
if (appDataTablesPerThread) {
Thread t = Thread.currentThread();
Hashtable sht = (Hashtable) appDataChanges.get(t);
if (sht == null) {
sht = new Hashtable();
appData... | [
"private",
"void",
"includeInAppDataChanges",
"(",
"String",
"name",
",",
"Object",
"value",
",",
"int",
"invoker",
")",
"{",
"if",
"(",
"appDataTablesPerThread",
")",
"{",
"Thread",
"t",
"=",
"Thread",
".",
"currentThread",
"(",
")",
";",
"Hashtable",
"sht"... | Adds a session attribute to the tracked list of changed data.
Precondition: invoker must be synchronized on BackedSession instance
@param name name of session attribute
@param value value of session attribute
@param invoker constant indicating the invoking method: GET_VALUE_GUTS or PUT_VALUE_GUTS | [
"Adds",
"a",
"session",
"attribute",
"to",
"the",
"tracked",
"list",
"of",
"changed",
"data",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.session.store/src/com/ibm/ws/session/store/common/BackedSession.java#L671-L692 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/extension/related/RelatedTablesCoreExtension.java | RelatedTablesCoreExtension.addRelationship | public ExtendedRelation addRelationship(String baseTableName,
String relatedTableName, UserMappingTable userMappingTable,
String relationName) {
"""
Adds a relationship between the base and related table. Creates the user
mapping table if needed.
@param baseTableName
base table name
@param relatedTable... | java | public ExtendedRelation addRelationship(String baseTableName,
String relatedTableName, UserMappingTable userMappingTable,
String relationName) {
// Validate the relation
validateRelationship(baseTableName, relatedTableName, relationName);
// Create the user mapping table if needed
createUserMappingTable... | [
"public",
"ExtendedRelation",
"addRelationship",
"(",
"String",
"baseTableName",
",",
"String",
"relatedTableName",
",",
"UserMappingTable",
"userMappingTable",
",",
"String",
"relationName",
")",
"{",
"// Validate the relation",
"validateRelationship",
"(",
"baseTableName",
... | Adds a relationship between the base and related table. Creates the user
mapping table if needed.
@param baseTableName
base table name
@param relatedTableName
related table name
@param userMappingTable
user mapping table
@param relationName
relation name
@return The relationship that was added | [
"Adds",
"a",
"relationship",
"between",
"the",
"base",
"and",
"related",
"table",
".",
"Creates",
"the",
"user",
"mapping",
"table",
"if",
"needed",
"."
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/extension/related/RelatedTablesCoreExtension.java#L318-L346 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/internal/workspace/api/ChatApi.java | ChatApi.updateNickname | public ApiSuccessResponse updateNickname(String id, UpdateNicknameData updateNicknameData) throws ApiException {
"""
Update an agent's nickname
Update the agent's nickname for the specified chat.
@param id The ID of the chat interaction. (required)
@param updateNicknameData Request parameters. (optional... | java | public ApiSuccessResponse updateNickname(String id, UpdateNicknameData updateNicknameData) throws ApiException {
ApiResponse<ApiSuccessResponse> resp = updateNicknameWithHttpInfo(id, updateNicknameData);
return resp.getData();
} | [
"public",
"ApiSuccessResponse",
"updateNickname",
"(",
"String",
"id",
",",
"UpdateNicknameData",
"updateNicknameData",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"ApiSuccessResponse",
">",
"resp",
"=",
"updateNicknameWithHttpInfo",
"(",
"id",
",",
"updateN... | Update an agent's nickname
Update the agent's nickname for the specified chat.
@param id The ID of the chat interaction. (required)
@param updateNicknameData Request parameters. (optional)
@return ApiSuccessResponse
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the respon... | [
"Update",
"an",
"agent'",
";",
"s",
"nickname",
"Update",
"the",
"agent'",
";",
"s",
"nickname",
"for",
"the",
"specified",
"chat",
"."
] | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/internal/workspace/api/ChatApi.java#L2207-L2210 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageMiscOps.java | ImageMiscOps.insertBand | public static void insertBand( GrayI8 input, int band , InterleavedI8 output) {
"""
Inserts a single band into a multi-band image overwriting the original band
@param input Single band image
@param band Which band the image is to be inserted into
@param output The multi-band image which the input image is to ... | java | public static void insertBand( GrayI8 input, int band , InterleavedI8 output) {
final int numBands = output.numBands;
for (int y = 0; y < input.height; y++) {
int indexIn = input.getStartIndex() + y * input.getStride();
int indexOut = output.getStartIndex() + y * output.getStride() + band;
int end = index... | [
"public",
"static",
"void",
"insertBand",
"(",
"GrayI8",
"input",
",",
"int",
"band",
",",
"InterleavedI8",
"output",
")",
"{",
"final",
"int",
"numBands",
"=",
"output",
".",
"numBands",
";",
"for",
"(",
"int",
"y",
"=",
"0",
";",
"y",
"<",
"input",
... | Inserts a single band into a multi-band image overwriting the original band
@param input Single band image
@param band Which band the image is to be inserted into
@param output The multi-band image which the input image is to be inserted into | [
"Inserts",
"a",
"single",
"band",
"into",
"a",
"multi",
"-",
"band",
"image",
"overwriting",
"the",
"original",
"band"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/misc/ImageMiscOps.java#L176-L187 |
ACRA/acra | acra-core/src/main/java/org/acra/collector/ConfigurationCollector.java | ConfigurationCollector.getFieldValueName | private Object getFieldValueName(@NonNull Map<String, SparseArray<String>> valueArrays, @NonNull Configuration conf, @NonNull Field f) throws IllegalAccessException {
"""
Retrieve the name of the constant defined in the {@link Configuration}
class which defines the value of a field in a {@link Configuration}
ins... | java | private Object getFieldValueName(@NonNull Map<String, SparseArray<String>> valueArrays, @NonNull Configuration conf, @NonNull Field f) throws IllegalAccessException {
final String fieldName = f.getName();
switch (fieldName) {
case FIELD_MCC:
case FIELD_MNC:
return... | [
"private",
"Object",
"getFieldValueName",
"(",
"@",
"NonNull",
"Map",
"<",
"String",
",",
"SparseArray",
"<",
"String",
">",
">",
"valueArrays",
",",
"@",
"NonNull",
"Configuration",
"conf",
",",
"@",
"NonNull",
"Field",
"f",
")",
"throws",
"IllegalAccessExcep... | Retrieve the name of the constant defined in the {@link Configuration}
class which defines the value of a field in a {@link Configuration}
instance.
@param conf The instance of {@link Configuration} where the value is
stored.
@param f The {@link Field} to be inspected in the {@link Configuration}
instance.
@return ... | [
"Retrieve",
"the",
"name",
"of",
"the",
"constant",
"defined",
"in",
"the",
"{",
"@link",
"Configuration",
"}",
"class",
"which",
"defines",
"the",
"value",
"of",
"a",
"field",
"in",
"a",
"{",
"@link",
"Configuration",
"}",
"instance",
"."
] | train | https://github.com/ACRA/acra/blob/bfa3235ab110328c5ab2f792ddf8ee87be4a32d1/acra-core/src/main/java/org/acra/collector/ConfigurationCollector.java#L201-L225 |
lukas-krecan/JsonUnit | json-unit/src/main/java/net/javacrumbs/jsonunit/JsonAssert.java | JsonAssert.assertJsonPartNotEquals | public static void assertJsonPartNotEquals(Object expected, Object fullJson, String path, Configuration configuration) {
"""
Compares part of the JSON and fails if they are equal.
Path has this format "root.array[0].value".
"""
Diff diff = create(expected, fullJson, FULL_JSON, path, configuration);
... | java | public static void assertJsonPartNotEquals(Object expected, Object fullJson, String path, Configuration configuration) {
Diff diff = create(expected, fullJson, FULL_JSON, path, configuration);
if (diff.similar()) {
if (ROOT.equals(path)) {
doFail("Expected different values bu... | [
"public",
"static",
"void",
"assertJsonPartNotEquals",
"(",
"Object",
"expected",
",",
"Object",
"fullJson",
",",
"String",
"path",
",",
"Configuration",
"configuration",
")",
"{",
"Diff",
"diff",
"=",
"create",
"(",
"expected",
",",
"fullJson",
",",
"FULL_JSON"... | Compares part of the JSON and fails if they are equal.
Path has this format "root.array[0].value". | [
"Compares",
"part",
"of",
"the",
"JSON",
"and",
"fails",
"if",
"they",
"are",
"equal",
".",
"Path",
"has",
"this",
"format",
"root",
".",
"array",
"[",
"0",
"]",
".",
"value",
"."
] | train | https://github.com/lukas-krecan/JsonUnit/blob/2b12ed792e8dd787bddd6f3b8eb2325737435791/json-unit/src/main/java/net/javacrumbs/jsonunit/JsonAssert.java#L111-L120 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/map/impl/mapstore/writebehind/DefaultWriteBehindProcessor.java | DefaultWriteBehindProcessor.callHandler | private List<DelayedEntry> callHandler(Collection<DelayedEntry> delayedEntries,
StoreOperationType operationType) {
"""
Decides how entries should be passed to handlers.
It passes entries to handler's single or batch handling
methods.
@param delayedEntries sorted ent... | java | private List<DelayedEntry> callHandler(Collection<DelayedEntry> delayedEntries,
StoreOperationType operationType) {
final int size = delayedEntries.size();
if (size == 0) {
return Collections.emptyList();
}
// if we want to write all... | [
"private",
"List",
"<",
"DelayedEntry",
">",
"callHandler",
"(",
"Collection",
"<",
"DelayedEntry",
">",
"delayedEntries",
",",
"StoreOperationType",
"operationType",
")",
"{",
"final",
"int",
"size",
"=",
"delayedEntries",
".",
"size",
"(",
")",
";",
"if",
"(... | Decides how entries should be passed to handlers.
It passes entries to handler's single or batch handling
methods.
@param delayedEntries sorted entries to be processed.
@return failed entry list if any. | [
"Decides",
"how",
"entries",
"should",
"be",
"passed",
"to",
"handlers",
".",
"It",
"passes",
"entries",
"to",
"handler",
"s",
"single",
"or",
"batch",
"handling",
"methods",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/map/impl/mapstore/writebehind/DefaultWriteBehindProcessor.java#L121-L153 |
usc/wechat-mp-sdk | wechat-mp-sdk/src/main/java/org/usc/wechat/mp/sdk/util/JsonRtnUtil.java | JsonRtnUtil.parseJsonRtn | public static <T extends JsonRtn> T parseJsonRtn(String jsonRtn, Class<T> jsonRtnClazz) {
"""
parse json text to specified class
@param jsonRtn
@param jsonRtnClazz
@return
"""
T rtn = JSONObject.parseObject(jsonRtn, jsonRtnClazz);
appendErrorHumanMsg(rtn);
return rtn;
} | java | public static <T extends JsonRtn> T parseJsonRtn(String jsonRtn, Class<T> jsonRtnClazz) {
T rtn = JSONObject.parseObject(jsonRtn, jsonRtnClazz);
appendErrorHumanMsg(rtn);
return rtn;
} | [
"public",
"static",
"<",
"T",
"extends",
"JsonRtn",
">",
"T",
"parseJsonRtn",
"(",
"String",
"jsonRtn",
",",
"Class",
"<",
"T",
">",
"jsonRtnClazz",
")",
"{",
"T",
"rtn",
"=",
"JSONObject",
".",
"parseObject",
"(",
"jsonRtn",
",",
"jsonRtnClazz",
")",
";... | parse json text to specified class
@param jsonRtn
@param jsonRtnClazz
@return | [
"parse",
"json",
"text",
"to",
"specified",
"class"
] | train | https://github.com/usc/wechat-mp-sdk/blob/39d9574a8e3ffa3b61f88b4bef534d93645a825f/wechat-mp-sdk/src/main/java/org/usc/wechat/mp/sdk/util/JsonRtnUtil.java#L33-L37 |
ocelotds/ocelot | ocelot-web/src/main/java/org/ocelotds/topic/messageControl/MessageControllerCache.java | MessageControllerCache.saveToCache | public void saveToCache(String topic, Class<? extends JsTopicMessageController> cls) {
"""
Save messageController Factory for topic
@param topic
@param cls
"""
if(null != topic && null != cls) {
messageControllers.put(topic, cls);
}
} | java | public void saveToCache(String topic, Class<? extends JsTopicMessageController> cls) {
if(null != topic && null != cls) {
messageControllers.put(topic, cls);
}
} | [
"public",
"void",
"saveToCache",
"(",
"String",
"topic",
",",
"Class",
"<",
"?",
"extends",
"JsTopicMessageController",
">",
"cls",
")",
"{",
"if",
"(",
"null",
"!=",
"topic",
"&&",
"null",
"!=",
"cls",
")",
"{",
"messageControllers",
".",
"put",
"(",
"t... | Save messageController Factory for topic
@param topic
@param cls | [
"Save",
"messageController",
"Factory",
"for",
"topic"
] | train | https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-web/src/main/java/org/ocelotds/topic/messageControl/MessageControllerCache.java#L32-L36 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/TextModerationsImpl.java | TextModerationsImpl.detectLanguageAsync | public ServiceFuture<DetectedLanguage> detectLanguageAsync(String textContentType, byte[] textContent, final ServiceCallback<DetectedLanguage> serviceCallback) {
"""
This operation will detect the language of given input content. Returns the <a href="http://www-01.sil.org/iso639-3/codes.asp">ISO 639-3 code&l... | java | public ServiceFuture<DetectedLanguage> detectLanguageAsync(String textContentType, byte[] textContent, final ServiceCallback<DetectedLanguage> serviceCallback) {
return ServiceFuture.fromResponse(detectLanguageWithServiceResponseAsync(textContentType, textContent), serviceCallback);
} | [
"public",
"ServiceFuture",
"<",
"DetectedLanguage",
">",
"detectLanguageAsync",
"(",
"String",
"textContentType",
",",
"byte",
"[",
"]",
"textContent",
",",
"final",
"ServiceCallback",
"<",
"DetectedLanguage",
">",
"serviceCallback",
")",
"{",
"return",
"ServiceFuture... | This operation will detect the language of given input content. Returns the <a href="http://www-01.sil.org/iso639-3/codes.asp">ISO 639-3 code</a> for the predominant language comprising the submitted text. Over 110 languages supported.
@param textContentType The content type. Possible values include: 'text... | [
"This",
"operation",
"will",
"detect",
"the",
"language",
"of",
"given",
"input",
"content",
".",
"Returns",
"the",
"<",
";",
"a",
"href",
"=",
"http",
":",
"//",
"www",
"-",
"01",
".",
"sil",
".",
"org",
"/",
"iso639",
"-",
"3",
"/",
"codes",
".... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/TextModerationsImpl.java#L305-L307 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java | JBBPDslBuilder.String | public JBBPDslBuilder String(final String name) {
"""
Add named string field.
@return the builder instance, must not be null
"""
final Item item = new Item(BinType.STRING, name, this.byteOrder);
this.addItem(item);
return this;
} | java | public JBBPDslBuilder String(final String name) {
final Item item = new Item(BinType.STRING, name, this.byteOrder);
this.addItem(item);
return this;
} | [
"public",
"JBBPDslBuilder",
"String",
"(",
"final",
"String",
"name",
")",
"{",
"final",
"Item",
"item",
"=",
"new",
"Item",
"(",
"BinType",
".",
"STRING",
",",
"name",
",",
"this",
".",
"byteOrder",
")",
";",
"this",
".",
"addItem",
"(",
"item",
")",
... | Add named string field.
@return the builder instance, must not be null | [
"Add",
"named",
"string",
"field",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPDslBuilder.java#L1377-L1381 |
classgraph/classgraph | src/main/java/nonapi/io/github/classgraph/utils/ReflectionUtils.java | ReflectionUtils.getStaticFieldVal | public static Object getStaticFieldVal(final Class<?> cls, final String fieldName, final boolean throwException)
throws IllegalArgumentException {
"""
Get the value of the named static field in the given class or any of its superclasses. If an exception is
thrown while trying to read the field value, ... | java | public static Object getStaticFieldVal(final Class<?> cls, final String fieldName, final boolean throwException)
throws IllegalArgumentException {
if (cls == null || fieldName == null) {
if (throwException) {
throw new NullPointerException();
} else {
... | [
"public",
"static",
"Object",
"getStaticFieldVal",
"(",
"final",
"Class",
"<",
"?",
">",
"cls",
",",
"final",
"String",
"fieldName",
",",
"final",
"boolean",
"throwException",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"cls",
"==",
"null",
"||"... | Get the value of the named static field in the given class or any of its superclasses. If an exception is
thrown while trying to read the field value, and throwException is true, then IllegalArgumentException is
thrown wrapping the cause, otherwise this will return null. If passed a null class reference, returns null
u... | [
"Get",
"the",
"value",
"of",
"the",
"named",
"static",
"field",
"in",
"the",
"given",
"class",
"or",
"any",
"of",
"its",
"superclasses",
".",
"If",
"an",
"exception",
"is",
"thrown",
"while",
"trying",
"to",
"read",
"the",
"field",
"value",
"and",
"throw... | train | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/utils/ReflectionUtils.java#L151-L161 |
jenkinsci/jenkins | core/src/main/java/hudson/tasks/BuildWrapper.java | BuildWrapper.decorateLogger | public OutputStream decorateLogger(AbstractBuild build, OutputStream logger) throws IOException, InterruptedException, RunnerAbortedException {
"""
Provides an opportunity for a {@link BuildWrapper} to decorate the {@link BuildListener} logger to be used by the build.
<p>
This hook is called very early on in t... | java | public OutputStream decorateLogger(AbstractBuild build, OutputStream logger) throws IOException, InterruptedException, RunnerAbortedException {
return logger;
} | [
"public",
"OutputStream",
"decorateLogger",
"(",
"AbstractBuild",
"build",
",",
"OutputStream",
"logger",
")",
"throws",
"IOException",
",",
"InterruptedException",
",",
"RunnerAbortedException",
"{",
"return",
"logger",
";",
"}"
] | Provides an opportunity for a {@link BuildWrapper} to decorate the {@link BuildListener} logger to be used by the build.
<p>
This hook is called very early on in the build (even before {@link #setUp(AbstractBuild, Launcher, BuildListener)} is invoked.)
<p>
The default implementation is no-op, which just returns the {... | [
"Provides",
"an",
"opportunity",
"for",
"a",
"{",
"@link",
"BuildWrapper",
"}",
"to",
"decorate",
"the",
"{",
"@link",
"BuildListener",
"}",
"logger",
"to",
"be",
"used",
"by",
"the",
"build",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/tasks/BuildWrapper.java#L214-L216 |
phax/ph-schedule | ph-mini-quartz/src/main/java/com/helger/quartz/TimeOfDay.java | TimeOfDay.hourAndMinuteAndSecondFromDate | @Nullable
public static TimeOfDay hourAndMinuteAndSecondFromDate (@Nullable final Date dateTime, @Nullable final TimeZone tz) {
"""
Create a {@link TimeOfDay} from the given date, in the given TimeZone.
@param dateTime
The {@link Date} from which to extract Hour, Minute and Second.
@param tz
The {@link Tim... | java | @Nullable
public static TimeOfDay hourAndMinuteAndSecondFromDate (@Nullable final Date dateTime, @Nullable final TimeZone tz)
{
if (dateTime == null)
return null;
final Calendar cal = PDTFactory.createCalendar ();
cal.setTime (dateTime);
if (tz != null)
cal.setTimeZone (tz);
return ... | [
"@",
"Nullable",
"public",
"static",
"TimeOfDay",
"hourAndMinuteAndSecondFromDate",
"(",
"@",
"Nullable",
"final",
"Date",
"dateTime",
",",
"@",
"Nullable",
"final",
"TimeZone",
"tz",
")",
"{",
"if",
"(",
"dateTime",
"==",
"null",
")",
"return",
"null",
";",
... | Create a {@link TimeOfDay} from the given date, in the given TimeZone.
@param dateTime
The {@link Date} from which to extract Hour, Minute and Second.
@param tz
The {@link TimeZone} from which relate Hour, Minute and Second for
the given date. If null, system default TimeZone will be used. | [
"Create",
"a",
"{",
"@link",
"TimeOfDay",
"}",
"from",
"the",
"given",
"date",
"in",
"the",
"given",
"TimeZone",
"."
] | train | https://github.com/phax/ph-schedule/blob/b000790b46a9f8d23ad44cc20591f753d07c0229/ph-mini-quartz/src/main/java/com/helger/quartz/TimeOfDay.java#L250-L261 |
dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/history/History.java | History.doWithoutListeners | public void doWithoutListeners(Setting setting, Runnable action) {
"""
Enables to perform an action, without firing the attached ChangeListener of a Setting.
This is used by undo and redo, since those shouldn't cause a new change to be added.
@param setting the setting, whose ChangeListener should be ignored
... | java | public void doWithoutListeners(Setting setting, Runnable action) {
LOGGER.trace(String.format("doWithoutListeners: setting: %s", setting));
setListenerActive(false);
LOGGER.trace("removed listener");
action.run();
LOGGER.trace("performed action");
setListenerActive(true);
LOGGER.trace("add l... | [
"public",
"void",
"doWithoutListeners",
"(",
"Setting",
"setting",
",",
"Runnable",
"action",
")",
"{",
"LOGGER",
".",
"trace",
"(",
"String",
".",
"format",
"(",
"\"doWithoutListeners: setting: %s\"",
",",
"setting",
")",
")",
";",
"setListenerActive",
"(",
"fa... | Enables to perform an action, without firing the attached ChangeListener of a Setting.
This is used by undo and redo, since those shouldn't cause a new change to be added.
@param setting the setting, whose ChangeListener should be ignored
@param action the action to be performed | [
"Enables",
"to",
"perform",
"an",
"action",
"without",
"firing",
"the",
"attached",
"ChangeListener",
"of",
"a",
"Setting",
".",
"This",
"is",
"used",
"by",
"undo",
"and",
"redo",
"since",
"those",
"shouldn",
"t",
"cause",
"a",
"new",
"change",
"to",
"be",... | train | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/history/History.java#L150-L158 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/FitLinesToContour.java | FitLinesToContour.fitLinesUsingCorners | boolean fitLinesUsingCorners( int numLines , GrowQueue_I32 cornerIndexes) {
"""
Fits lines across the sequence of corners
@param numLines number of lines it will fit
"""
for (int i = 1; i <= numLines; i++) {
int index0 = cornerIndexes.get(CircularIndex.addOffset(anchor0, i - 1, cornerIndexes.size));
... | java | boolean fitLinesUsingCorners( int numLines , GrowQueue_I32 cornerIndexes) {
for (int i = 1; i <= numLines; i++) {
int index0 = cornerIndexes.get(CircularIndex.addOffset(anchor0, i - 1, cornerIndexes.size));
int index1 = cornerIndexes.get(CircularIndex.addOffset(anchor0, i, cornerIndexes.size));
if( index0 =... | [
"boolean",
"fitLinesUsingCorners",
"(",
"int",
"numLines",
",",
"GrowQueue_I32",
"cornerIndexes",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"1",
";",
"i",
"<=",
"numLines",
";",
"i",
"++",
")",
"{",
"int",
"index0",
"=",
"cornerIndexes",
".",
"get",
"(",
... | Fits lines across the sequence of corners
@param numLines number of lines it will fit | [
"Fits",
"lines",
"across",
"the",
"sequence",
"of",
"corners"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/FitLinesToContour.java#L270-L288 |
Azure/azure-sdk-for-java | marketplaceordering/resource-manager/v2015_06_01/src/main/java/com/microsoft/azure/management/marketplaceordering/v2015_06_01/implementation/MarketplaceAgreementsInner.java | MarketplaceAgreementsInner.createAsync | public Observable<AgreementTermsInner> createAsync(String publisherId, String offerId, String planId, AgreementTermsInner parameters) {
"""
Save marketplace terms.
@param publisherId Publisher identifier string of image being deployed.
@param offerId Offer identifier string of image being deployed.
@param pla... | java | public Observable<AgreementTermsInner> createAsync(String publisherId, String offerId, String planId, AgreementTermsInner parameters) {
return createWithServiceResponseAsync(publisherId, offerId, planId, parameters).map(new Func1<ServiceResponse<AgreementTermsInner>, AgreementTermsInner>() {
@Overri... | [
"public",
"Observable",
"<",
"AgreementTermsInner",
">",
"createAsync",
"(",
"String",
"publisherId",
",",
"String",
"offerId",
",",
"String",
"planId",
",",
"AgreementTermsInner",
"parameters",
")",
"{",
"return",
"createWithServiceResponseAsync",
"(",
"publisherId",
... | Save marketplace terms.
@param publisherId Publisher identifier string of image being deployed.
@param offerId Offer identifier string of image being deployed.
@param planId Plan identifier string of image being deployed.
@param parameters Parameters supplied to the Create Marketplace Terms operation.
@throws IllegalA... | [
"Save",
"marketplace",
"terms",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/marketplaceordering/resource-manager/v2015_06_01/src/main/java/com/microsoft/azure/management/marketplaceordering/v2015_06_01/implementation/MarketplaceAgreementsInner.java#L223-L230 |
twitter/hraven | hraven-etl/src/main/java/com/twitter/hraven/etl/JobHistoryFileParserFactory.java | JobHistoryFileParserFactory.getVersion | public static HadoopVersion getVersion(byte[] historyFileContents) {
"""
determines the verison of hadoop that the history file belongs to
@return
returns 1 for hadoop 1 (pre MAPREDUCE-1016)
returns 2 for newer job history files
(newer job history files have "AVRO-JSON" as the signature at the start of the f... | java | public static HadoopVersion getVersion(byte[] historyFileContents) {
if(historyFileContents.length > HADOOP2_VERSION_LENGTH) {
// the first 10 bytes in a hadoop2.0 history file contain Avro-Json
String version2Part = new String(historyFileContents, 0, HADOOP2_VERSION_LENGTH);
if (StringUtils.equa... | [
"public",
"static",
"HadoopVersion",
"getVersion",
"(",
"byte",
"[",
"]",
"historyFileContents",
")",
"{",
"if",
"(",
"historyFileContents",
".",
"length",
">",
"HADOOP2_VERSION_LENGTH",
")",
"{",
"// the first 10 bytes in a hadoop2.0 history file contain Avro-Json",
"Strin... | determines the verison of hadoop that the history file belongs to
@return
returns 1 for hadoop 1 (pre MAPREDUCE-1016)
returns 2 for newer job history files
(newer job history files have "AVRO-JSON" as the signature at the start of the file,
REFERENCE: https://issues.apache.org/jira/browse/MAPREDUCE-1016? \
focusedComm... | [
"determines",
"the",
"verison",
"of",
"hadoop",
"that",
"the",
"history",
"file",
"belongs",
"to"
] | train | https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-etl/src/main/java/com/twitter/hraven/etl/JobHistoryFileParserFactory.java#L50-L60 |
Stratio/deep-spark | deep-commons/src/main/java/com/stratio/deep/commons/utils/CellsUtils.java | CellsUtils.subDocumentListCase | private static <T> Object subDocumentListCase(Type type, List<T> jsonObject)
throws IllegalAccessException, InstantiationException, InvocationTargetException {
"""
Sub document list case.
@param <T> the type parameter
@param type the type
@param jsonObject the json object
@return the... | java | private static <T> Object subDocumentListCase(Type type, List<T> jsonObject)
throws IllegalAccessException, InstantiationException, InvocationTargetException {
ParameterizedType listType = (ParameterizedType) type;
Class<?> listClass = (Class<?>) listType.getActualTypeArguments()[0];
... | [
"private",
"static",
"<",
"T",
">",
"Object",
"subDocumentListCase",
"(",
"Type",
"type",
",",
"List",
"<",
"T",
">",
"jsonObject",
")",
"throws",
"IllegalAccessException",
",",
"InstantiationException",
",",
"InvocationTargetException",
"{",
"ParameterizedType",
"l... | Sub document list case.
@param <T> the type parameter
@param type the type
@param jsonObject the json object
@return the object
@throws IllegalAccessException the illegal access exception
@throws InstantiationException the instantiation exception
@throws InvocationTargetException the invocation targ... | [
"Sub",
"document",
"list",
"case",
"."
] | train | https://github.com/Stratio/deep-spark/blob/b9621c9b7a6d996f80fce1d073d696a157bed095/deep-commons/src/main/java/com/stratio/deep/commons/utils/CellsUtils.java#L379-L391 |
datasift/datasift-java | src/main/java/com/datasift/client/push/DataSiftPush.java | DataSiftPush.createPull | public FutureData<PushSubscription> createPull(PullJsonType jsonMeta, Stream stream, String name,
Status initialStatus, long start, long end) {
"""
/*
Create a push subscription to be consumed via {@link #pull(PushSubscription, int, String)} using a live stream
... | java | public FutureData<PushSubscription> createPull(PullJsonType jsonMeta, Stream stream, String name,
Status initialStatus, long start, long end) {
return createPull(jsonMeta, null, stream, name, initialStatus, start, end);
} | [
"public",
"FutureData",
"<",
"PushSubscription",
">",
"createPull",
"(",
"PullJsonType",
"jsonMeta",
",",
"Stream",
"stream",
",",
"String",
"name",
",",
"Status",
"initialStatus",
",",
"long",
"start",
",",
"long",
"end",
")",
"{",
"return",
"createPull",
"("... | /*
Create a push subscription to be consumed via {@link #pull(PushSubscription, int, String)} using a live stream
@param stream the stream which will be consumed via pull
@param name a name for the subscription
@param initialStatus the initial status of the subscription
@param start an option t... | [
"/",
"*",
"Create",
"a",
"push",
"subscription",
"to",
"be",
"consumed",
"via",
"{",
"@link",
"#pull",
"(",
"PushSubscription",
"int",
"String",
")",
"}",
"using",
"a",
"live",
"stream"
] | train | https://github.com/datasift/datasift-java/blob/09de124f2a1a507ff6181e59875c6f325290850e/src/main/java/com/datasift/client/push/DataSiftPush.java#L511-L514 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ComputeNodesImpl.java | ComputeNodesImpl.listAsync | public ServiceFuture<List<ComputeNode>> listAsync(final String poolId, final ListOperationCallback<ComputeNode> serviceCallback) {
"""
Lists the compute nodes in the specified pool.
@param poolId The ID of the pool from which you want to list nodes.
@param serviceCallback the async ServiceCallback to handle su... | java | public ServiceFuture<List<ComputeNode>> listAsync(final String poolId, final ListOperationCallback<ComputeNode> serviceCallback) {
return AzureServiceFuture.fromHeaderPageResponse(
listSinglePageAsync(poolId),
new Func1<String, Observable<ServiceResponseWithHeaders<Page<ComputeNo... | [
"public",
"ServiceFuture",
"<",
"List",
"<",
"ComputeNode",
">",
">",
"listAsync",
"(",
"final",
"String",
"poolId",
",",
"final",
"ListOperationCallback",
"<",
"ComputeNode",
">",
"serviceCallback",
")",
"{",
"return",
"AzureServiceFuture",
".",
"fromHeaderPageResp... | Lists the compute nodes in the specified pool.
@param poolId The ID of the pool from which you want to list nodes.
@param serviceCallback the async ServiceCallback to handle successful and failed responses.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link ServiceFuture} obje... | [
"Lists",
"the",
"compute",
"nodes",
"in",
"the",
"specified",
"pool",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ComputeNodesImpl.java#L2622-L2632 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/XMLValidator.java | XMLValidator.validateAgainst | public boolean validateAgainst(String xmlContent, String xsdContent) {
"""
Validate currently loaded xml against an xsd
@param xsdFileName the XSD schema file to use for validation
@return true if the xml validates against the schema.
Throws a descriptive SlimFixtureException when validation fails
"""
... | java | public boolean validateAgainst(String xmlContent, String xsdContent) {
try {
Source xsd = new SAXSource(new InputSource(new StringReader(xsdContent)));
Source xml = new SAXSource(new InputSource(new StringReader(xmlContent)));
SchemaFactory schemaFactory = SchemaFactory
... | [
"public",
"boolean",
"validateAgainst",
"(",
"String",
"xmlContent",
",",
"String",
"xsdContent",
")",
"{",
"try",
"{",
"Source",
"xsd",
"=",
"new",
"SAXSource",
"(",
"new",
"InputSource",
"(",
"new",
"StringReader",
"(",
"xsdContent",
")",
")",
")",
";",
... | Validate currently loaded xml against an xsd
@param xsdFileName the XSD schema file to use for validation
@return true if the xml validates against the schema.
Throws a descriptive SlimFixtureException when validation fails | [
"Validate",
"currently",
"loaded",
"xml",
"against",
"an",
"xsd"
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/XMLValidator.java#L75-L92 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.