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 |
|---|---|---|---|---|---|---|---|---|---|---|
lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/collections/sort/RedBlackTreeLong.java | RedBlackTreeLong.contains | @Override
public boolean contains(long value, T element) {
"""
Returns true if the given key exists in the tree and its associated value is the given element.
Comparison of the element is using the equals method.
"""
if (root == null) return false;
if (value < first.value) return false;
... | java | @Override
public boolean contains(long value, T element) {
if (root == null) return false;
if (value < first.value) return false;
if (value > last.value) return false;
if (value == first.value && ObjectUtil.equalsOrNull(element, first.element)) return true;
if (value == last.value && ... | [
"@",
"Override",
"public",
"boolean",
"contains",
"(",
"long",
"value",
",",
"T",
"element",
")",
"{",
"if",
"(",
"root",
"==",
"null",
")",
"return",
"false",
";",
"if",
"(",
"value",
"<",
"first",
".",
"value",
")",
"return",
"false",
";",
"if",
... | Returns true if the given key exists in the tree and its associated value is the given element.
Comparison of the element is using the equals method. | [
"Returns",
"true",
"if",
"the",
"given",
"key",
"exists",
"in",
"the",
"tree",
"and",
"its",
"associated",
"value",
"is",
"the",
"given",
"element",
".",
"Comparison",
"of",
"the",
"element",
"is",
"using",
"the",
"equals",
"method",
"."
] | train | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/collections/sort/RedBlackTreeLong.java#L224-L232 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.setSasDefinition | public SasDefinitionBundle setSasDefinition(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, String templateUri, SasTokenType sasType, String validityPeriod) {
"""
Creates or updates a new SAS definition for the specified storage account. This operation requires the storage/setsas permissi... | java | public SasDefinitionBundle setSasDefinition(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, String templateUri, SasTokenType sasType, String validityPeriod) {
return setSasDefinitionWithServiceResponseAsync(vaultBaseUrl, storageAccountName, sasDefinitionName, templateUri, sasType, vali... | [
"public",
"SasDefinitionBundle",
"setSasDefinition",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"storageAccountName",
",",
"String",
"sasDefinitionName",
",",
"String",
"templateUri",
",",
"SasTokenType",
"sasType",
",",
"String",
"validityPeriod",
")",
"{",
"return"... | Creates or updates a new SAS definition for the specified storage account. This operation requires the storage/setsas permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param storageAccountName The name of the storage account.
@param sasDefinitionName The name of the SAS defi... | [
"Creates",
"or",
"updates",
"a",
"new",
"SAS",
"definition",
"for",
"the",
"specified",
"storage",
"account",
".",
"This",
"operation",
"requires",
"the",
"storage",
"/",
"setsas",
"permission",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L11254-L11256 |
line/armeria | core/src/main/java/com/linecorp/armeria/server/file/AbstractHttpFileBuilder.java | AbstractHttpFileBuilder.cacheControl | public final B cacheControl(CacheControl cacheControl) {
"""
Sets the {@code "cache-control"} header. This method is a shortcut of:
<pre>{@code
builder.setHeader(HttpHeaderNames.CACHE_CONTROL, cacheControl);
}</pre>
"""
requireNonNull(cacheControl, "cacheControl");
return setHeader(HttpHeade... | java | public final B cacheControl(CacheControl cacheControl) {
requireNonNull(cacheControl, "cacheControl");
return setHeader(HttpHeaderNames.CACHE_CONTROL, cacheControl);
} | [
"public",
"final",
"B",
"cacheControl",
"(",
"CacheControl",
"cacheControl",
")",
"{",
"requireNonNull",
"(",
"cacheControl",
",",
"\"cacheControl\"",
")",
";",
"return",
"setHeader",
"(",
"HttpHeaderNames",
".",
"CACHE_CONTROL",
",",
"cacheControl",
")",
";",
"}"... | Sets the {@code "cache-control"} header. This method is a shortcut of:
<pre>{@code
builder.setHeader(HttpHeaderNames.CACHE_CONTROL, cacheControl);
}</pre> | [
"Sets",
"the",
"{"
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/file/AbstractHttpFileBuilder.java#L246-L249 |
vanilladb/vanillacore | src/main/java/org/vanilladb/core/sql/Constant.java | Constant.newInstance | public static Constant newInstance(Type type, byte[] val) {
"""
Constructs a new instance of the specified type with value converted from
the input byte array.
@param type
the specified type
@param val
the byte array contains the value
@return a constant of specified type with value converted from the byte... | java | public static Constant newInstance(Type type, byte[] val) {
switch (type.getSqlType()) {
case (INTEGER):
return new IntegerConstant(val);
case (BIGINT):
return new BigIntConstant(val);
case (DOUBLE):
return new DoubleConstant(val);
case (VARCHAR):
return new VarcharConstant(val, type);
... | [
"public",
"static",
"Constant",
"newInstance",
"(",
"Type",
"type",
",",
"byte",
"[",
"]",
"val",
")",
"{",
"switch",
"(",
"type",
".",
"getSqlType",
"(",
")",
")",
"{",
"case",
"(",
"INTEGER",
")",
":",
"return",
"new",
"IntegerConstant",
"(",
"val",
... | Constructs a new instance of the specified type with value converted from
the input byte array.
@param type
the specified type
@param val
the byte array contains the value
@return a constant of specified type with value converted from the byte
array | [
"Constructs",
"a",
"new",
"instance",
"of",
"the",
"specified",
"type",
"with",
"value",
"converted",
"from",
"the",
"input",
"byte",
"array",
"."
] | train | https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/sql/Constant.java#L44-L56 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java | DiagnosticsInner.listSiteAnalysesSlotWithServiceResponseAsync | public Observable<ServiceResponse<Page<AnalysisDefinitionInner>>> listSiteAnalysesSlotWithServiceResponseAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory, final String slot) {
"""
Get Site Analyses.
Get Site Analyses.
@param resourceGroupName Name of the resource gro... | java | public Observable<ServiceResponse<Page<AnalysisDefinitionInner>>> listSiteAnalysesSlotWithServiceResponseAsync(final String resourceGroupName, final String siteName, final String diagnosticCategory, final String slot) {
return listSiteAnalysesSlotSinglePageAsync(resourceGroupName, siteName, diagnosticCategory, ... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"AnalysisDefinitionInner",
">",
">",
">",
"listSiteAnalysesSlotWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"siteName",
",",
"final",
"String",
"diagnost... | Get Site Analyses.
Get Site Analyses.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Site Name
@param diagnosticCategory Diagnostic Category
@param slot Slot Name
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the ... | [
"Get",
"Site",
"Analyses",
".",
"Get",
"Site",
"Analyses",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java#L1656-L1668 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/RepositoryException.java | RepositoryException.toPersistException | public final PersistException toPersistException(final String message) {
"""
Converts RepositoryException into an appropriate PersistException, prepending
the specified message. If message is null, original exception message is
preserved.
@param message message to prepend, which may be null
"""
T... | java | public final PersistException toPersistException(final String message) {
Throwable cause;
if (this instanceof PersistException) {
cause = this;
} else {
cause = getCause();
}
if (cause == null) {
cause = this;
} else if (caus... | [
"public",
"final",
"PersistException",
"toPersistException",
"(",
"final",
"String",
"message",
")",
"{",
"Throwable",
"cause",
";",
"if",
"(",
"this",
"instanceof",
"PersistException",
")",
"{",
"cause",
"=",
"this",
";",
"}",
"else",
"{",
"cause",
"=",
"ge... | Converts RepositoryException into an appropriate PersistException, prepending
the specified message. If message is null, original exception message is
preserved.
@param message message to prepend, which may be null | [
"Converts",
"RepositoryException",
"into",
"an",
"appropriate",
"PersistException",
"prepending",
"the",
"specified",
"message",
".",
"If",
"message",
"is",
"null",
"original",
"exception",
"message",
"is",
"preserved",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/RepositoryException.java#L139-L161 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/collection/PdfCollectionField.java | PdfCollectionField.getValue | public PdfObject getValue(String v) {
"""
Returns a PdfObject that can be used as the value of a Collection Item.
@param v value the value that has to be changed into a PdfObject (PdfString, PdfDate or PdfNumber)
"""
switch(fieldType) {
case TEXT:
return new PdfString(v, PdfObject.TEXT_UNICODE);
case... | java | public PdfObject getValue(String v) {
switch(fieldType) {
case TEXT:
return new PdfString(v, PdfObject.TEXT_UNICODE);
case DATE:
return new PdfDate(PdfDate.decode(v));
case NUMBER:
return new PdfNumber(v);
}
throw new IllegalArgumentException(v + " is not an acceptable value for the field " + get(P... | [
"public",
"PdfObject",
"getValue",
"(",
"String",
"v",
")",
"{",
"switch",
"(",
"fieldType",
")",
"{",
"case",
"TEXT",
":",
"return",
"new",
"PdfString",
"(",
"v",
",",
"PdfObject",
".",
"TEXT_UNICODE",
")",
";",
"case",
"DATE",
":",
"return",
"new",
"... | Returns a PdfObject that can be used as the value of a Collection Item.
@param v value the value that has to be changed into a PdfObject (PdfString, PdfDate or PdfNumber) | [
"Returns",
"a",
"PdfObject",
"that",
"can",
"be",
"used",
"as",
"the",
"value",
"of",
"a",
"Collection",
"Item",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/collection/PdfCollectionField.java#L118-L128 |
tvesalainen/util | util/src/main/java/org/vesalainen/code/PropertyDispatcher.java | PropertyDispatcher.getInstance | public static <T extends PropertyDispatcher> T getInstance(Class<T> cls) {
"""
Creates a instance of a class PropertyDispatcher subclass.
@param <T> Type of PropertyDispatcher subclass
@param cls PropertyDispatcher subclass class
@return
"""
return getInstance(cls, null);
} | java | public static <T extends PropertyDispatcher> T getInstance(Class<T> cls)
{
return getInstance(cls, null);
} | [
"public",
"static",
"<",
"T",
"extends",
"PropertyDispatcher",
">",
"T",
"getInstance",
"(",
"Class",
"<",
"T",
">",
"cls",
")",
"{",
"return",
"getInstance",
"(",
"cls",
",",
"null",
")",
";",
"}"
] | Creates a instance of a class PropertyDispatcher subclass.
@param <T> Type of PropertyDispatcher subclass
@param cls PropertyDispatcher subclass class
@return | [
"Creates",
"a",
"instance",
"of",
"a",
"class",
"PropertyDispatcher",
"subclass",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/code/PropertyDispatcher.java#L185-L188 |
joniles/mpxj | src/main/java/net/sf/mpxj/merlin/MerlinReader.java | MerlinReader.processDays | private void processDays(ProjectCalendar calendar) throws Exception {
"""
Process normal calendar working and non-working days.
@param calendar parent calendar
"""
// Default all days to non-working
for (Day day : Day.values())
{
calendar.setWorkingDay(day, false);
}
... | java | private void processDays(ProjectCalendar calendar) throws Exception
{
// Default all days to non-working
for (Day day : Day.values())
{
calendar.setWorkingDay(day, false);
}
List<Row> rows = getRows("select * from zcalendarrule where zcalendar1=? and z_ent=?", calendar.getUniq... | [
"private",
"void",
"processDays",
"(",
"ProjectCalendar",
"calendar",
")",
"throws",
"Exception",
"{",
"// Default all days to non-working",
"for",
"(",
"Day",
"day",
":",
"Day",
".",
"values",
"(",
")",
")",
"{",
"calendar",
".",
"setWorkingDay",
"(",
"day",
... | Process normal calendar working and non-working days.
@param calendar parent calendar | [
"Process",
"normal",
"calendar",
"working",
"and",
"non",
"-",
"working",
"days",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/merlin/MerlinReader.java#L285-L323 |
banq/jdonframework | src/main/java/com/jdon/util/UtilValidate.java | UtilValidate.isTime | public static boolean isTime(String time) {
"""
isTime returns true if string argument time forms a valid time.
"""
if (isEmpty(time)) return defaultEmptyOK;
String hour;
String minute;
String second;
int timeColon1 = time.indexOf(":");
int timeColon2 =... | java | public static boolean isTime(String time) {
if (isEmpty(time)) return defaultEmptyOK;
String hour;
String minute;
String second;
int timeColon1 = time.indexOf(":");
int timeColon2 = time.lastIndexOf(":");
if (timeColon1 <= 0) return false;
ho... | [
"public",
"static",
"boolean",
"isTime",
"(",
"String",
"time",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"time",
")",
")",
"return",
"defaultEmptyOK",
";",
"String",
"hour",
";",
"String",
"minute",
";",
"String",
"second",
";",
"int",
"timeColon1",
"=",
"ti... | isTime returns true if string argument time forms a valid time. | [
"isTime",
"returns",
"true",
"if",
"string",
"argument",
"time",
"forms",
"a",
"valid",
"time",
"."
] | train | https://github.com/banq/jdonframework/blob/72b451caac04f775e57f52aaed3d8775044ead53/src/main/java/com/jdon/util/UtilValidate.java#L830-L850 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/el/VariableMapperWrapper.java | VariableMapperWrapper.resolveVariable | public ValueExpression resolveVariable(String variable) {
"""
First tries to resolve agains the inner Map, then the wrapped ValueExpression.
@see javax.el.VariableMapper#resolveVariable(java.lang.String)
"""
ValueExpression ve = null;
try
{
if (_vars != null)
... | java | public ValueExpression resolveVariable(String variable)
{
ValueExpression ve = null;
try
{
if (_vars != null)
{
ve = (ValueExpression) _vars.get(variable);
// Is this code in a block that wants to cache
// the resultin... | [
"public",
"ValueExpression",
"resolveVariable",
"(",
"String",
"variable",
")",
"{",
"ValueExpression",
"ve",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"_vars",
"!=",
"null",
")",
"{",
"ve",
"=",
"(",
"ValueExpression",
")",
"_vars",
".",
"get",
"(",
"var... | First tries to resolve agains the inner Map, then the wrapped ValueExpression.
@see javax.el.VariableMapper#resolveVariable(java.lang.String) | [
"First",
"tries",
"to",
"resolve",
"agains",
"the",
"inner",
"Map",
"then",
"the",
"wrapped",
"ValueExpression",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/view/facelets/el/VariableMapperWrapper.java#L70-L98 |
carewebframework/carewebframework-core | org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/command/Command.java | Command.setCommandTarget | private void setCommandTarget(BaseComponent component, BaseComponent commandTarget) {
"""
Sets or removes the command target for the specified component.
@param component The bound component whose command target is being modified.
@param commandTarget If null, any associated command target is removed. Otherwis... | java | private void setCommandTarget(BaseComponent component, BaseComponent commandTarget) {
if (commandTarget == null) {
commandTarget = (BaseComponent) component.removeAttribute(getTargetAttributeName());
if (commandTarget != null && commandTarget.hasAttribute(ATTR_DUMMY)) {
... | [
"private",
"void",
"setCommandTarget",
"(",
"BaseComponent",
"component",
",",
"BaseComponent",
"commandTarget",
")",
"{",
"if",
"(",
"commandTarget",
"==",
"null",
")",
"{",
"commandTarget",
"=",
"(",
"BaseComponent",
")",
"component",
".",
"removeAttribute",
"("... | Sets or removes the command target for the specified component.
@param component The bound component whose command target is being modified.
@param commandTarget If null, any associated command target is removed. Otherwise, this value
is set as the command target. | [
"Sets",
"or",
"removes",
"the",
"command",
"target",
"for",
"the",
"specified",
"component",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/command/Command.java#L250-L260 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/linsol/qr/LinearSolverQr_DDRM.java | LinearSolverQr_DDRM.setMaxSize | public void setMaxSize( int maxRows , int maxCols ) {
"""
Changes the size of the matrix it can solve for
@param maxRows Maximum number of rows in the matrix it will decompose.
@param maxCols Maximum number of columns in the matrix it will decompose.
"""
this.maxRows = maxRows; this.maxCols = maxCo... | java | public void setMaxSize( int maxRows , int maxCols )
{
this.maxRows = maxRows; this.maxCols = maxCols;
Q = new DMatrixRMaj(maxRows,maxRows);
R = new DMatrixRMaj(maxRows,maxCols);
Y = new DMatrixRMaj(maxRows,1);
Z = new DMatrixRMaj(maxRows,1);
} | [
"public",
"void",
"setMaxSize",
"(",
"int",
"maxRows",
",",
"int",
"maxCols",
")",
"{",
"this",
".",
"maxRows",
"=",
"maxRows",
";",
"this",
".",
"maxCols",
"=",
"maxCols",
";",
"Q",
"=",
"new",
"DMatrixRMaj",
"(",
"maxRows",
",",
"maxRows",
")",
";",
... | Changes the size of the matrix it can solve for
@param maxRows Maximum number of rows in the matrix it will decompose.
@param maxCols Maximum number of columns in the matrix it will decompose. | [
"Changes",
"the",
"size",
"of",
"the",
"matrix",
"it",
"can",
"solve",
"for"
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/linsol/qr/LinearSolverQr_DDRM.java#L69-L78 |
dlemmermann/PreferencesFX | preferencesfx/src/main/java/com/dlsc/preferencesfx/view/NavigationPresenter.java | NavigationPresenter.setupCellValueFactory | public void setupCellValueFactory() {
"""
Makes the TreeItems' text update when the description of a Category changes (due to i18n).
"""
navigationView.treeView.setCellFactory(param -> new TreeCell<Category>() {
@Override
protected void updateItem(Category category, boolean empty) {
sup... | java | public void setupCellValueFactory() {
navigationView.treeView.setCellFactory(param -> new TreeCell<Category>() {
@Override
protected void updateItem(Category category, boolean empty) {
super.updateItem(category, empty);
textProperty().unbind();
if (empty || category == null) {
... | [
"public",
"void",
"setupCellValueFactory",
"(",
")",
"{",
"navigationView",
".",
"treeView",
".",
"setCellFactory",
"(",
"param",
"->",
"new",
"TreeCell",
"<",
"Category",
">",
"(",
")",
"{",
"@",
"Override",
"protected",
"void",
"updateItem",
"(",
"Category",... | Makes the TreeItems' text update when the description of a Category changes (due to i18n). | [
"Makes",
"the",
"TreeItems",
"text",
"update",
"when",
"the",
"description",
"of",
"a",
"Category",
"changes",
"(",
"due",
"to",
"i18n",
")",
"."
] | train | https://github.com/dlemmermann/PreferencesFX/blob/e06a49663ec949c2f7eb56e6b5952c030ed42d33/preferencesfx/src/main/java/com/dlsc/preferencesfx/view/NavigationPresenter.java#L147-L162 |
wellner/jcarafe | jcarafe-core/src/main/java/cern/colt/map/AbstractIntObjectMap.java | AbstractIntObjectMap.pairsSortedByKey | public void pairsSortedByKey(final IntArrayList keyList, final ObjectArrayList valueList) {
"""
Fills all keys and values <i>sorted ascending by key</i> into the specified lists.
Fills into the lists, starting at index 0.
After this call returns the specified lists both have a new size that equals <tt>this.size(... | java | public void pairsSortedByKey(final IntArrayList keyList, final ObjectArrayList valueList) {
keys(keyList);
keyList.sort();
valueList.setSize(keyList.size());
for (int i=keyList.size(); --i >= 0; ) {
valueList.setQuick(i,get(keyList.getQuick(i)));
}
} | [
"public",
"void",
"pairsSortedByKey",
"(",
"final",
"IntArrayList",
"keyList",
",",
"final",
"ObjectArrayList",
"valueList",
")",
"{",
"keys",
"(",
"keyList",
")",
";",
"keyList",
".",
"sort",
"(",
")",
";",
"valueList",
".",
"setSize",
"(",
"keyList",
".",
... | Fills all keys and values <i>sorted ascending by key</i> into the specified lists.
Fills into the lists, starting at index 0.
After this call returns the specified lists both have a new size that equals <tt>this.size()</tt>.
<p>
<b>Example:</b>
<br>
<tt>keys = (8,7,6), values = (1,2,2) --> keyList = (6,7,8), valueList ... | [
"Fills",
"all",
"keys",
"and",
"values",
"<i",
">",
"sorted",
"ascending",
"by",
"key<",
"/",
"i",
">",
"into",
"the",
"specified",
"lists",
".",
"Fills",
"into",
"the",
"lists",
"starting",
"at",
"index",
"0",
".",
"After",
"this",
"call",
"returns",
... | train | https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/map/AbstractIntObjectMap.java#L282-L289 |
rundeck/rundeck | core/src/main/java/com/dtolabs/utils/Mapper.java | Mapper.zip | public static Map zip(Object[] keys, Object[] values) {
"""
Creates a map where the object at index N from the first Iterator is the key for the object at index N of the
second Iterator. <br> By default discards both key and value if either one is null.
@param keys array of keys
@param values array of value... | java | public static Map zip(Object[] keys, Object[] values) {
return zip(java.util.Arrays.asList(keys), java.util.Arrays.asList(values), false);
} | [
"public",
"static",
"Map",
"zip",
"(",
"Object",
"[",
"]",
"keys",
",",
"Object",
"[",
"]",
"values",
")",
"{",
"return",
"zip",
"(",
"java",
".",
"util",
".",
"Arrays",
".",
"asList",
"(",
"keys",
")",
",",
"java",
".",
"util",
".",
"Arrays",
".... | Creates a map where the object at index N from the first Iterator is the key for the object at index N of the
second Iterator. <br> By default discards both key and value if either one is null.
@param keys array of keys
@param values array of values
@return map | [
"Creates",
"a",
"map",
"where",
"the",
"object",
"at",
"index",
"N",
"from",
"the",
"first",
"Iterator",
"is",
"the",
"key",
"for",
"the",
"object",
"at",
"index",
"N",
"of",
"the",
"second",
"Iterator",
".",
"<br",
">",
"By",
"default",
"discards",
"b... | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/utils/Mapper.java#L204-L206 |
threerings/narya | core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java | ChatDirector.translatedReplacements | protected StringBuffer translatedReplacements (String key, StringBuffer buf) {
"""
Do all the replacements (mogrifications) specified in the translation string specified by
the key.
"""
MessageBundle bundle = _ctx.getMessageManager().getBundle(_bundle);
if (!bundle.exists(key)) {
r... | java | protected StringBuffer translatedReplacements (String key, StringBuffer buf)
{
MessageBundle bundle = _ctx.getMessageManager().getBundle(_bundle);
if (!bundle.exists(key)) {
return buf;
}
StringTokenizer st = new StringTokenizer(bundle.get(key), "#");
// apply the... | [
"protected",
"StringBuffer",
"translatedReplacements",
"(",
"String",
"key",
",",
"StringBuffer",
"buf",
")",
"{",
"MessageBundle",
"bundle",
"=",
"_ctx",
".",
"getMessageManager",
"(",
")",
".",
"getBundle",
"(",
"_bundle",
")",
";",
"if",
"(",
"!",
"bundle",... | Do all the replacements (mogrifications) specified in the translation string specified by
the key. | [
"Do",
"all",
"the",
"replacements",
"(",
"mogrifications",
")",
"specified",
"in",
"the",
"translation",
"string",
"specified",
"by",
"the",
"key",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/chat/client/ChatDirector.java#L943-L966 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/synthetic/SyntheticStorableReferenceAccess.java | SyntheticStorableReferenceAccess.copyFromMaster | public void copyFromMaster(Storable reference, S master) throws FetchException {
"""
Sets all the properties of the given reference, using the applicable
properties of the given master.
@param reference reference whose properties will be set
@param master source of property values
"""
try {
... | java | public void copyFromMaster(Storable reference, S master) throws FetchException {
try {
mCopyFromMasterMethod.invoke(reference, master);
} catch (Exception e) {
ThrowUnchecked.fireFirstDeclaredCause(e, FetchException.class);
}
} | [
"public",
"void",
"copyFromMaster",
"(",
"Storable",
"reference",
",",
"S",
"master",
")",
"throws",
"FetchException",
"{",
"try",
"{",
"mCopyFromMasterMethod",
".",
"invoke",
"(",
"reference",
",",
"master",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")... | Sets all the properties of the given reference, using the applicable
properties of the given master.
@param reference reference whose properties will be set
@param master source of property values | [
"Sets",
"all",
"the",
"properties",
"of",
"the",
"given",
"reference",
"using",
"the",
"applicable",
"properties",
"of",
"the",
"given",
"master",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/synthetic/SyntheticStorableReferenceAccess.java#L128-L134 |
jtablesaw/tablesaw | core/src/main/java/tech/tablesaw/joining/DataFrameJoiner.java | DataFrameJoiner.fullOuter | public Table fullOuter(Table table2, String col2Name) {
"""
Full outer join the joiner to the table2, using the given column for the second table and returns the resulting table
@param table2 The table to join with
@param col2Name The column to join on. If col2Name refers to a double column, the join is perf... | java | public Table fullOuter(Table table2, String col2Name) {
return fullOuter(table, table2, false, col2Name);
} | [
"public",
"Table",
"fullOuter",
"(",
"Table",
"table2",
",",
"String",
"col2Name",
")",
"{",
"return",
"fullOuter",
"(",
"table",
",",
"table2",
",",
"false",
",",
"col2Name",
")",
";",
"}"
] | Full outer join the joiner to the table2, using the given column for the second table and returns the resulting table
@param table2 The table to join with
@param col2Name The column to join on. If col2Name refers to a double column, the join is performed after
rounding to integers.
@return The resulting table | [
"Full",
"outer",
"join",
"the",
"joiner",
"to",
"the",
"table2",
"using",
"the",
"given",
"column",
"for",
"the",
"second",
"table",
"and",
"returns",
"the",
"resulting",
"table"
] | train | https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/joining/DataFrameJoiner.java#L369-L371 |
exoplatform/jcr | exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/lock/NullResourceLocksHolder.java | NullResourceLocksHolder.removeLock | public void removeLock(Session session, String path) {
"""
Removes lock from the node.
@param session current session
@param path nodepath
"""
String repoPath = session.getRepository().hashCode() + "/" + session.getWorkspace().getName() + "/" + path;
String token = nullResourceLocks.get(repoP... | java | public void removeLock(Session session, String path)
{
String repoPath = session.getRepository().hashCode() + "/" + session.getWorkspace().getName() + "/" + path;
String token = nullResourceLocks.get(repoPath);
session.removeLockToken(token);
nullResourceLocks.remove(repoPath);
} | [
"public",
"void",
"removeLock",
"(",
"Session",
"session",
",",
"String",
"path",
")",
"{",
"String",
"repoPath",
"=",
"session",
".",
"getRepository",
"(",
")",
".",
"hashCode",
"(",
")",
"+",
"\"/\"",
"+",
"session",
".",
"getWorkspace",
"(",
")",
".",... | Removes lock from the node.
@param session current session
@param path nodepath | [
"Removes",
"lock",
"from",
"the",
"node",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/lock/NullResourceLocksHolder.java#L89-L95 |
VoltDB/voltdb | third_party/java/src/com/google_voltpatches/common/io/Files.java | Files.readBytes | @CanIgnoreReturnValue // some processors won't return a useful result
public static <T> T readBytes(File file, ByteProcessor<T> processor) throws IOException {
"""
Process the bytes of a file.
<p>(If this seems too complicated, maybe you're looking for {@link #toByteArray}.)
@param file the file to read
@... | java | @CanIgnoreReturnValue // some processors won't return a useful result
public static <T> T readBytes(File file, ByteProcessor<T> processor) throws IOException {
return asByteSource(file).read(processor);
} | [
"@",
"CanIgnoreReturnValue",
"// some processors won't return a useful result",
"public",
"static",
"<",
"T",
">",
"T",
"readBytes",
"(",
"File",
"file",
",",
"ByteProcessor",
"<",
"T",
">",
"processor",
")",
"throws",
"IOException",
"{",
"return",
"asByteSource",
"... | Process the bytes of a file.
<p>(If this seems too complicated, maybe you're looking for {@link #toByteArray}.)
@param file the file to read
@param processor the object to which the bytes of the file are passed.
@return the result of the byte processor
@throws IOException if an I/O error occurs | [
"Process",
"the",
"bytes",
"of",
"a",
"file",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/com/google_voltpatches/common/io/Files.java#L566-L569 |
UrielCh/ovh-java-sdk | ovh-java-sdk-vps/src/main/java/net/minidev/ovh/api/ApiOvhVps.java | ApiOvhVps.serviceName_secondaryDnsDomains_domain_GET | public OvhSecondaryDNS serviceName_secondaryDnsDomains_domain_GET(String serviceName, String domain) throws IOException {
"""
Get this object properties
REST: GET /vps/{serviceName}/secondaryDnsDomains/{domain}
@param serviceName [required] The internal name of your VPS offer
@param domain [required] domain o... | java | public OvhSecondaryDNS serviceName_secondaryDnsDomains_domain_GET(String serviceName, String domain) throws IOException {
String qPath = "/vps/{serviceName}/secondaryDnsDomains/{domain}";
StringBuilder sb = path(qPath, serviceName, domain);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo... | [
"public",
"OvhSecondaryDNS",
"serviceName_secondaryDnsDomains_domain_GET",
"(",
"String",
"serviceName",
",",
"String",
"domain",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/vps/{serviceName}/secondaryDnsDomains/{domain}\"",
";",
"StringBuilder",
"sb",
"=",... | Get this object properties
REST: GET /vps/{serviceName}/secondaryDnsDomains/{domain}
@param serviceName [required] The internal name of your VPS offer
@param domain [required] domain on slave server | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-vps/src/main/java/net/minidev/ovh/api/ApiOvhVps.java#L223-L228 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringParser.java | StringParser.parseShort | public static short parseShort (@Nullable final Object aObject, @Nonnegative final int nRadix, final short nDefault) {
"""
Parse the given {@link Object} as short with the specified radix.
@param aObject
The object to parse. May be <code>null</code>.
@param nRadix
The radix to use. Must be ≥ {@link Charac... | java | public static short parseShort (@Nullable final Object aObject, @Nonnegative final int nRadix, final short nDefault)
{
if (aObject == null)
return nDefault;
if (aObject instanceof Number)
return ((Number) aObject).shortValue ();
return parseShort (aObject.toString (), nRadix, nDefault);
} | [
"public",
"static",
"short",
"parseShort",
"(",
"@",
"Nullable",
"final",
"Object",
"aObject",
",",
"@",
"Nonnegative",
"final",
"int",
"nRadix",
",",
"final",
"short",
"nDefault",
")",
"{",
"if",
"(",
"aObject",
"==",
"null",
")",
"return",
"nDefault",
";... | Parse the given {@link Object} as short with the specified radix.
@param aObject
The object to parse. May be <code>null</code>.
@param nRadix
The radix to use. Must be ≥ {@link Character#MIN_RADIX} and ≤
{@link Character#MAX_RADIX}.
@param nDefault
The default value to be returned if the passed object could not ... | [
"Parse",
"the",
"given",
"{",
"@link",
"Object",
"}",
"as",
"short",
"with",
"the",
"specified",
"radix",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringParser.java#L1200-L1207 |
zxing/zxing | core/src/main/java/com/google/zxing/maxicode/MaxiCodeReader.java | MaxiCodeReader.extractPureBits | private static BitMatrix extractPureBits(BitMatrix image) throws NotFoundException {
"""
This method detects a code in a "pure" image -- that is, pure monochrome image
which contains only an unrotated, unskewed, image of a code, with some white border
around it. This is a specialized method that works exceptiona... | java | private static BitMatrix extractPureBits(BitMatrix image) throws NotFoundException {
int[] enclosingRectangle = image.getEnclosingRectangle();
if (enclosingRectangle == null) {
throw NotFoundException.getNotFoundInstance();
}
int left = enclosingRectangle[0];
int top = enclosingRectangle[1];... | [
"private",
"static",
"BitMatrix",
"extractPureBits",
"(",
"BitMatrix",
"image",
")",
"throws",
"NotFoundException",
"{",
"int",
"[",
"]",
"enclosingRectangle",
"=",
"image",
".",
"getEnclosingRectangle",
"(",
")",
";",
"if",
"(",
"enclosingRectangle",
"==",
"null"... | This method detects a code in a "pure" image -- that is, pure monochrome image
which contains only an unrotated, unskewed, image of a code, with some white border
around it. This is a specialized method that works exceptionally fast in this special
case. | [
"This",
"method",
"detects",
"a",
"code",
"in",
"a",
"pure",
"image",
"--",
"that",
"is",
"pure",
"monochrome",
"image",
"which",
"contains",
"only",
"an",
"unrotated",
"unskewed",
"image",
"of",
"a",
"code",
"with",
"some",
"white",
"border",
"around",
"i... | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/maxicode/MaxiCodeReader.java#L86-L110 |
Harium/keel | src/main/java/com/harium/keel/effect/normal/SimpleNormalMap.java | SimpleNormalMap.apply | @Override
public ImageSource apply(ImageSource input) {
"""
Simple method to generate bump map from a height map
@param input - A height map
@return bump map
"""
int w = input.getWidth();
int h = input.getHeight();
MatrixSource output = new MatrixSource(w, h);
Vector3 ... | java | @Override
public ImageSource apply(ImageSource input) {
int w = input.getWidth();
int h = input.getHeight();
MatrixSource output = new MatrixSource(w, h);
Vector3 s = new Vector3(1, 0, 0);
Vector3 t = new Vector3(0, 1, 0);
for (int y = 0; y < h; y++) {
... | [
"@",
"Override",
"public",
"ImageSource",
"apply",
"(",
"ImageSource",
"input",
")",
"{",
"int",
"w",
"=",
"input",
".",
"getWidth",
"(",
")",
";",
"int",
"h",
"=",
"input",
".",
"getHeight",
"(",
")",
";",
"MatrixSource",
"output",
"=",
"new",
"Matrix... | Simple method to generate bump map from a height map
@param input - A height map
@return bump map | [
"Simple",
"method",
"to",
"generate",
"bump",
"map",
"from",
"a",
"height",
"map"
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/effect/normal/SimpleNormalMap.java#L19-L50 |
mygreen/xlsmapper | src/main/java/com/gh/mygreen/xlsmapper/fieldaccessor/ArrayLabelSetterFactory.java | ArrayLabelSetterFactory.createMapField | private Optional<ArrayLabelSetter> createMapField(final Class<?> beanClass, final String fieldName) {
"""
{@link Map}フィールドにラベル情報が格納されている場合。
<p>キーはフィールド名。</p>
@param beanClass フィールドが定義してあるクラスのインスタンス
@param fieldName フィールド名
@return ラベル情報の設定用クラス
"""
final Field labelsField;
try {... | java | private Optional<ArrayLabelSetter> createMapField(final Class<?> beanClass, final String fieldName) {
final Field labelsField;
try {
labelsField = beanClass.getDeclaredField("labels");
labelsField.setAccessible(true);
} catch (NoSuchFieldExcep... | [
"private",
"Optional",
"<",
"ArrayLabelSetter",
">",
"createMapField",
"(",
"final",
"Class",
"<",
"?",
">",
"beanClass",
",",
"final",
"String",
"fieldName",
")",
"{",
"final",
"Field",
"labelsField",
";",
"try",
"{",
"labelsField",
"=",
"beanClass",
".",
"... | {@link Map}フィールドにラベル情報が格納されている場合。
<p>キーはフィールド名。</p>
@param beanClass フィールドが定義してあるクラスのインスタンス
@param fieldName フィールド名
@return ラベル情報の設定用クラス | [
"{",
"@link",
"Map",
"}",
"フィールドにラベル情報が格納されている場合。",
"<p",
">",
"キーはフィールド名。<",
"/",
"p",
">"
] | train | https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/fieldaccessor/ArrayLabelSetterFactory.java#L77-L129 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/LocalTime.java | LocalTime.withNano | public LocalTime withNano(int nanoOfSecond) {
"""
Returns a copy of this {@code LocalTime} with the nano-of-second altered.
<p>
This instance is immutable and unaffected by this method call.
@param nanoOfSecond the nano-of-second to set in the result, from 0 to 999,999,999
@return a {@code LocalTime} based ... | java | public LocalTime withNano(int nanoOfSecond) {
if (this.nano == nanoOfSecond) {
return this;
}
NANO_OF_SECOND.checkValidValue(nanoOfSecond);
return create(hour, minute, second, nanoOfSecond);
} | [
"public",
"LocalTime",
"withNano",
"(",
"int",
"nanoOfSecond",
")",
"{",
"if",
"(",
"this",
".",
"nano",
"==",
"nanoOfSecond",
")",
"{",
"return",
"this",
";",
"}",
"NANO_OF_SECOND",
".",
"checkValidValue",
"(",
"nanoOfSecond",
")",
";",
"return",
"create",
... | Returns a copy of this {@code LocalTime} with the nano-of-second altered.
<p>
This instance is immutable and unaffected by this method call.
@param nanoOfSecond the nano-of-second to set in the result, from 0 to 999,999,999
@return a {@code LocalTime} based on this time with the requested nanosecond, not null
@throws... | [
"Returns",
"a",
"copy",
"of",
"this",
"{",
"@code",
"LocalTime",
"}",
"with",
"the",
"nano",
"-",
"of",
"-",
"second",
"altered",
".",
"<p",
">",
"This",
"instance",
"is",
"immutable",
"and",
"unaffected",
"by",
"this",
"method",
"call",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/LocalTime.java#L914-L920 |
j256/ormlite-core | src/main/java/com/j256/ormlite/table/TableUtils.java | TableUtils.createTable | public static <T> int createTable(ConnectionSource connectionSource, Class<T> dataClass) throws SQLException {
"""
Issue the database statements to create the table associated with a class.
@param connectionSource
Associated connection source.
@param dataClass
The class for which a table will be created.
@r... | java | public static <T> int createTable(ConnectionSource connectionSource, Class<T> dataClass) throws SQLException {
Dao<T, ?> dao = DaoManager.createDao(connectionSource, dataClass);
return doCreateTable(dao, false);
} | [
"public",
"static",
"<",
"T",
">",
"int",
"createTable",
"(",
"ConnectionSource",
"connectionSource",
",",
"Class",
"<",
"T",
">",
"dataClass",
")",
"throws",
"SQLException",
"{",
"Dao",
"<",
"T",
",",
"?",
">",
"dao",
"=",
"DaoManager",
".",
"createDao",
... | Issue the database statements to create the table associated with a class.
@param connectionSource
Associated connection source.
@param dataClass
The class for which a table will be created.
@return The number of statements executed to do so. | [
"Issue",
"the",
"database",
"statements",
"to",
"create",
"the",
"table",
"associated",
"with",
"a",
"class",
"."
] | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/table/TableUtils.java#L53-L56 |
jbundle/jbundle | base/model/src/main/java/org/jbundle/base/model/Utility.java | Utility.getAs | public static Object getAs(Map<String,Object> properties, String strKey, Class<?> classData) {
"""
Get this property from the map and convert it to the target class.
@param properties The map object to get the property from.
@param strKey The key of the property.
@param classData The target class to convert the... | java | public static Object getAs(Map<String,Object> properties, String strKey, Class<?> classData)
{
return Utility.getAs(properties, strKey, classData, null);
} | [
"public",
"static",
"Object",
"getAs",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
",",
"String",
"strKey",
",",
"Class",
"<",
"?",
">",
"classData",
")",
"{",
"return",
"Utility",
".",
"getAs",
"(",
"properties",
",",
"strKey",
",",
"... | Get this property from the map and convert it to the target class.
@param properties The map object to get the property from.
@param strKey The key of the property.
@param classData The target class to convert the property to.
@return The data in the correct class. | [
"Get",
"this",
"property",
"from",
"the",
"map",
"and",
"convert",
"it",
"to",
"the",
"target",
"class",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/model/src/main/java/org/jbundle/base/model/Utility.java#L447-L450 |
io7m/jaffirm | com.io7m.jaffirm.core/src/main/java/com/io7m/jaffirm/core/Preconditions.java | Preconditions.checkPrecondition | public static <T> T checkPrecondition(
final T value,
final Predicate<T> predicate,
final Function<T, String> describer) {
"""
<p>Evaluate the given {@code predicate} using {@code value} as input.</p>
<p>The function throws {@link PreconditionViolationException} if the
predicate is false.</p>
@p... | java | public static <T> T checkPrecondition(
final T value,
final Predicate<T> predicate,
final Function<T, String> describer)
{
final boolean ok;
try {
ok = predicate.test(value);
} catch (final Throwable e) {
final Violations violations = singleViolation(failedPredicate(e));
thro... | [
"public",
"static",
"<",
"T",
">",
"T",
"checkPrecondition",
"(",
"final",
"T",
"value",
",",
"final",
"Predicate",
"<",
"T",
">",
"predicate",
",",
"final",
"Function",
"<",
"T",
",",
"String",
">",
"describer",
")",
"{",
"final",
"boolean",
"ok",
";"... | <p>Evaluate the given {@code predicate} using {@code value} as input.</p>
<p>The function throws {@link PreconditionViolationException} if the
predicate is false.</p>
@param value The value
@param predicate The predicate
@param describer A describer for the predicate
@param <T> The type of values
@return v... | [
"<p",
">",
"Evaluate",
"the",
"given",
"{",
"@code",
"predicate",
"}",
"using",
"{",
"@code",
"value",
"}",
"as",
"input",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/io7m/jaffirm/blob/c97d246242d381e48832838737418cfe4cb57b4d/com.io7m.jaffirm.core/src/main/java/com/io7m/jaffirm/core/Preconditions.java#L202-L217 |
fernandospr/java-wns | src/main/java/ar/com/fernandospr/wns/WnsService.java | WnsService.pushTile | public WnsNotificationResponse pushTile(String channelUri, WnsNotificationRequestOptional optional, WnsTile tile) throws WnsException {
"""
Pushes a tile to channelUri using optional headers
@param channelUri
@param optional
@param tile which should be built with {@link ar.com.fernandospr.wns.model.builders.Wns... | java | public WnsNotificationResponse pushTile(String channelUri, WnsNotificationRequestOptional optional, WnsTile tile) throws WnsException {
return this.client.push(xmlResourceBuilder, channelUri, tile, this.retryPolicy, optional);
} | [
"public",
"WnsNotificationResponse",
"pushTile",
"(",
"String",
"channelUri",
",",
"WnsNotificationRequestOptional",
"optional",
",",
"WnsTile",
"tile",
")",
"throws",
"WnsException",
"{",
"return",
"this",
".",
"client",
".",
"push",
"(",
"xmlResourceBuilder",
",",
... | Pushes a tile to channelUri using optional headers
@param channelUri
@param optional
@param tile which should be built with {@link ar.com.fernandospr.wns.model.builders.WnsTileBuilder}
@return WnsNotificationResponse please see response headers from <a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh465435... | [
"Pushes",
"a",
"tile",
"to",
"channelUri",
"using",
"optional",
"headers"
] | train | https://github.com/fernandospr/java-wns/blob/cd621b9c17d1e706f6284e0913531d834904a90d/src/main/java/ar/com/fernandospr/wns/WnsService.java#L88-L90 |
aoindustries/aocode-public | src/main/java/com/aoindustries/util/StringUtility.java | StringUtility.splitString | public static <C extends Collection<String>> C splitString(String line, char delim, C words) {
"""
Splits a string on the given delimiter.
Does include all empty elements on the split.
@param words the words will be added to this collection.
@return the collection provided in words parameter
"""
re... | java | public static <C extends Collection<String>> C splitString(String line, char delim, C words) {
return splitString(line, 0, line.length(), delim, words);
} | [
"public",
"static",
"<",
"C",
"extends",
"Collection",
"<",
"String",
">",
">",
"C",
"splitString",
"(",
"String",
"line",
",",
"char",
"delim",
",",
"C",
"words",
")",
"{",
"return",
"splitString",
"(",
"line",
",",
"0",
",",
"line",
".",
"length",
... | Splits a string on the given delimiter.
Does include all empty elements on the split.
@param words the words will be added to this collection.
@return the collection provided in words parameter | [
"Splits",
"a",
"string",
"on",
"the",
"given",
"delimiter",
".",
"Does",
"include",
"all",
"empty",
"elements",
"on",
"the",
"split",
"."
] | train | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/StringUtility.java#L923-L925 |
Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/WorkflowTriggersInner.java | WorkflowTriggersInner.runAsync | public Observable<Object> runAsync(String resourceGroupName, String workflowName, String triggerName) {
"""
Runs a workflow trigger.
@param resourceGroupName The resource group name.
@param workflowName The workflow name.
@param triggerName The workflow trigger name.
@throws IllegalArgumentException thrown i... | java | public Observable<Object> runAsync(String resourceGroupName, String workflowName, String triggerName) {
return runWithServiceResponseAsync(resourceGroupName, workflowName, triggerName).map(new Func1<ServiceResponse<Object>, Object>() {
@Override
public Object call(ServiceResponse<Object>... | [
"public",
"Observable",
"<",
"Object",
">",
"runAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"workflowName",
",",
"String",
"triggerName",
")",
"{",
"return",
"runWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"workflowName",
",",
"triggerName... | Runs a workflow trigger.
@param resourceGroupName The resource group name.
@param workflowName The workflow name.
@param triggerName The workflow trigger name.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the Object object | [
"Runs",
"a",
"workflow",
"trigger",
"."
] | 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/WorkflowTriggersInner.java#L573-L580 |
mahjong4j/mahjong4j | src/main/java/org/mahjong4j/hands/Kantsu.java | Kantsu.check | public static boolean check(Tile tile1, Tile tile2, Tile tile3, Tile tile4) {
"""
tile1~4が同一の牌かを調べます
@param tile1 1枚目
@param tile2 2枚目
@param tile3 3枚目
@param tile4 4枚目
@return 槓子の場合true 槓子でない場合false
"""
return tile1 == tile2 && tile2 == tile3 && tile3 == tile4;
} | java | public static boolean check(Tile tile1, Tile tile2, Tile tile3, Tile tile4) {
return tile1 == tile2 && tile2 == tile3 && tile3 == tile4;
} | [
"public",
"static",
"boolean",
"check",
"(",
"Tile",
"tile1",
",",
"Tile",
"tile2",
",",
"Tile",
"tile3",
",",
"Tile",
"tile4",
")",
"{",
"return",
"tile1",
"==",
"tile2",
"&&",
"tile2",
"==",
"tile3",
"&&",
"tile3",
"==",
"tile4",
";",
"}"
] | tile1~4が同一の牌かを調べます
@param tile1 1枚目
@param tile2 2枚目
@param tile3 3枚目
@param tile4 4枚目
@return 槓子の場合true 槓子でない場合false | [
"tile1~4が同一の牌かを調べます"
] | train | https://github.com/mahjong4j/mahjong4j/blob/caa75963286b631ad51953d0d8c71cf6bf79b8f4/src/main/java/org/mahjong4j/hands/Kantsu.java#L52-L54 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/TemplateList.java | TemplateList.insertPatternInTable | private void insertPatternInTable(StepPattern pattern, ElemTemplate template) {
"""
Add a template to the template list.
@param pattern
@param template
"""
String target = pattern.getTargetString();
if (null != target)
{
String pstring = template.getMatch().getPatternString();
Tem... | java | private void insertPatternInTable(StepPattern pattern, ElemTemplate template)
{
String target = pattern.getTargetString();
if (null != target)
{
String pstring = template.getMatch().getPatternString();
TemplateSubPatternAssociation association =
new TemplateSubPatternAssociation(temp... | [
"private",
"void",
"insertPatternInTable",
"(",
"StepPattern",
"pattern",
",",
"ElemTemplate",
"template",
")",
"{",
"String",
"target",
"=",
"pattern",
".",
"getTargetString",
"(",
")",
";",
"if",
"(",
"null",
"!=",
"target",
")",
"{",
"String",
"pstring",
... | Add a template to the template list.
@param pattern
@param template | [
"Add",
"a",
"template",
"to",
"the",
"template",
"list",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/TemplateList.java#L343-L372 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/MariaDbStatement.java | MariaDbStatement.executeLargeUpdate | @Override
public long executeLargeUpdate(String sql, int[] columnIndexes) throws SQLException {
"""
Identical to executeLargeUpdate(String sql, int autoGeneratedKeys) with autoGeneratedKeys =
Statement.RETURN_GENERATED_KEYS set.
@param sql sql command
@param columnIndexes column Indexes
@return u... | java | @Override
public long executeLargeUpdate(String sql, int[] columnIndexes) throws SQLException {
return executeLargeUpdate(sql, Statement.RETURN_GENERATED_KEYS);
} | [
"@",
"Override",
"public",
"long",
"executeLargeUpdate",
"(",
"String",
"sql",
",",
"int",
"[",
"]",
"columnIndexes",
")",
"throws",
"SQLException",
"{",
"return",
"executeLargeUpdate",
"(",
"sql",
",",
"Statement",
".",
"RETURN_GENERATED_KEYS",
")",
";",
"}"
] | Identical to executeLargeUpdate(String sql, int autoGeneratedKeys) with autoGeneratedKeys =
Statement.RETURN_GENERATED_KEYS set.
@param sql sql command
@param columnIndexes column Indexes
@return update counts
@throws SQLException if any error occur during execution | [
"Identical",
"to",
"executeLargeUpdate",
"(",
"String",
"sql",
"int",
"autoGeneratedKeys",
")",
"with",
"autoGeneratedKeys",
"=",
"Statement",
".",
"RETURN_GENERATED_KEYS",
"set",
"."
] | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/MariaDbStatement.java#L656-L659 |
mcxiaoke/Android-Next | core/src/main/java/com/mcxiaoke/next/utils/IOUtils.java | IOUtils.readFully | public static void readFully(Reader input, char[] buffer, int offset, int length) throws IOException {
"""
Read the requested number of characters or fail if there are not enough left.
<p/>
This allows for the possibility that {@link Reader#read(char[], int, int)} may
not read as many characters as requested (m... | java | public static void readFully(Reader input, char[] buffer, int offset, int length) throws IOException {
int actual = read(input, buffer, offset, length);
if (actual != length) {
throw new EOFException("Length to read: " + length + " actual: " + actual);
}
} | [
"public",
"static",
"void",
"readFully",
"(",
"Reader",
"input",
",",
"char",
"[",
"]",
"buffer",
",",
"int",
"offset",
",",
"int",
"length",
")",
"throws",
"IOException",
"{",
"int",
"actual",
"=",
"read",
"(",
"input",
",",
"buffer",
",",
"offset",
"... | Read the requested number of characters or fail if there are not enough left.
<p/>
This allows for the possibility that {@link Reader#read(char[], int, int)} may
not read as many characters as requested (most likely because of reaching EOF).
@param input where to read input from
@param buffer destination
@param offse... | [
"Read",
"the",
"requested",
"number",
"of",
"characters",
"or",
"fail",
"if",
"there",
"are",
"not",
"enough",
"left",
".",
"<p",
"/",
">",
"This",
"allows",
"for",
"the",
"possibility",
"that",
"{",
"@link",
"Reader#read",
"(",
"char",
"[]",
"int",
"int... | train | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/core/src/main/java/com/mcxiaoke/next/utils/IOUtils.java#L991-L996 |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/MapView.java | MapView.setExpectedCenter | public void setExpectedCenter(final IGeoPoint pGeoPoint, final long pOffsetX, final long pOffsetY) {
"""
Deferred setting of the expected next map center computed by the Projection's constructor,
with no guarantee it will be 100% respected.
<a href="https://github.com/osmdroid/osmdroid/issues/868">see issue 868<... | java | public void setExpectedCenter(final IGeoPoint pGeoPoint, final long pOffsetX, final long pOffsetY) {
final GeoPoint before = getProjection().getCurrentCenter();
mCenter = (GeoPoint)pGeoPoint;
setMapScroll(-pOffsetX, -pOffsetY);
resetProjection();
final GeoPoint after = getProjection().getCurrentCente... | [
"public",
"void",
"setExpectedCenter",
"(",
"final",
"IGeoPoint",
"pGeoPoint",
",",
"final",
"long",
"pOffsetX",
",",
"final",
"long",
"pOffsetY",
")",
"{",
"final",
"GeoPoint",
"before",
"=",
"getProjection",
"(",
")",
".",
"getCurrentCenter",
"(",
")",
";",
... | Deferred setting of the expected next map center computed by the Projection's constructor,
with no guarantee it will be 100% respected.
<a href="https://github.com/osmdroid/osmdroid/issues/868">see issue 868</a>
@since 6.0.3 | [
"Deferred",
"setting",
"of",
"the",
"expected",
"next",
"map",
"center",
"computed",
"by",
"the",
"Projection",
"s",
"constructor",
"with",
"no",
"guarantee",
"it",
"will",
"be",
"100%",
"respected",
".",
"<a",
"href",
"=",
"https",
":",
"//",
"github",
".... | train | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/MapView.java#L1825-L1838 |
google/closure-compiler | src/com/google/javascript/jscomp/SubstituteEs6Syntax.java | SubstituteEs6Syntax.maybeSimplifyArrowFunctionBody | private void maybeSimplifyArrowFunctionBody(Node arrowFunction, Node body) {
"""
If possible, replace functions of the form ()=>{ return x; } with ()=>x
"""
checkArgument(arrowFunction.isArrowFunction());
if (!body.isBlock() || !body.hasOneChild() || !body.getFirstChild().isReturn()) {
return;
... | java | private void maybeSimplifyArrowFunctionBody(Node arrowFunction, Node body) {
checkArgument(arrowFunction.isArrowFunction());
if (!body.isBlock() || !body.hasOneChild() || !body.getFirstChild().isReturn()) {
return;
}
Node returnValue = body.getFirstChild().removeFirstChild();
Node replacement ... | [
"private",
"void",
"maybeSimplifyArrowFunctionBody",
"(",
"Node",
"arrowFunction",
",",
"Node",
"body",
")",
"{",
"checkArgument",
"(",
"arrowFunction",
".",
"isArrowFunction",
"(",
")",
")",
";",
"if",
"(",
"!",
"body",
".",
"isBlock",
"(",
")",
"||",
"!",
... | If possible, replace functions of the form ()=>{ return x; } with ()=>x | [
"If",
"possible",
"replace",
"functions",
"of",
"the",
"form",
"()",
"=",
">",
"{",
"return",
"x",
";",
"}",
"with",
"()",
"=",
">",
"x"
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/SubstituteEs6Syntax.java#L68-L77 |
jMetal/jMetal | jmetal-core/src/main/java/org/uma/jmetal/qualityindicator/impl/hypervolume/PISAHypervolume.java | PISAHypervolume.filterNondominatedSet | private int filterNondominatedSet(double[][] front, int noPoints, int noObjectives) {
"""
/* all nondominated points regarding the first 'noObjectives' dimensions
are collected; the points referenced by 'front[0..noPoints-1]' are
considered; 'front' is resorted, such that 'front[0..n-1]' contains
the nondominat... | java | private int filterNondominatedSet(double[][] front, int noPoints, int noObjectives) {
int i, j;
int n;
n = noPoints;
i = 0;
while (i < n) {
j = i + 1;
while (j < n) {
if (dominates(front[i], front[j], noObjectives)) {
/* remove point 'j' */
n--;
swap(front,... | [
"private",
"int",
"filterNondominatedSet",
"(",
"double",
"[",
"]",
"[",
"]",
"front",
",",
"int",
"noPoints",
",",
"int",
"noObjectives",
")",
"{",
"int",
"i",
",",
"j",
";",
"int",
"n",
";",
"n",
"=",
"noPoints",
";",
"i",
"=",
"0",
";",
"while",... | /* all nondominated points regarding the first 'noObjectives' dimensions
are collected; the points referenced by 'front[0..noPoints-1]' are
considered; 'front' is resorted, such that 'front[0..n-1]' contains
the nondominated points; n is returned | [
"/",
"*",
"all",
"nondominated",
"points",
"regarding",
"the",
"first",
"noObjectives",
"dimensions",
"are",
"collected",
";",
"the",
"points",
"referenced",
"by",
"front",
"[",
"0",
"..",
"noPoints",
"-",
"1",
"]",
"are",
"considered",
";",
"front",
"is",
... | train | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-core/src/main/java/org/uma/jmetal/qualityindicator/impl/hypervolume/PISAHypervolume.java#L104-L131 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/models/stream/PendingParser.java | PendingParser.parseRange | @SuppressWarnings("unchecked")
public static List<PendingMessage> parseRange(List<?> xpendingOutput) {
"""
Parse the output of the Redis {@literal XPENDING} command with {@link Range}.
@param xpendingOutput output of the Redis {@literal XPENDING}.
@return list of {@link PendingMessage}s.
"""
L... | java | @SuppressWarnings("unchecked")
public static List<PendingMessage> parseRange(List<?> xpendingOutput) {
LettuceAssert.notNull(xpendingOutput, "XPENDING output must not be null");
List<PendingMessage> result = new ArrayList<>();
for (Object element : xpendingOutput) {
LettuceAs... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"List",
"<",
"PendingMessage",
">",
"parseRange",
"(",
"List",
"<",
"?",
">",
"xpendingOutput",
")",
"{",
"LettuceAssert",
".",
"notNull",
"(",
"xpendingOutput",
",",
"\"XPENDING output must n... | Parse the output of the Redis {@literal XPENDING} command with {@link Range}.
@param xpendingOutput output of the Redis {@literal XPENDING}.
@return list of {@link PendingMessage}s. | [
"Parse",
"the",
"output",
"of",
"the",
"Redis",
"{",
"@literal",
"XPENDING",
"}",
"command",
"with",
"{",
"@link",
"Range",
"}",
"."
] | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/models/stream/PendingParser.java#L43-L65 |
Nordstrom/JUnit-Foundation | src/main/java/com/nordstrom/automation/junit/RunReflectiveCall.java | RunReflectiveCall.fireAfterInvocation | private static boolean fireAfterInvocation(Object runner, Object target, FrameworkMethod method, Throwable thrown) {
"""
Fire the {@link MethodWatcher#afterInvocation(Object, Object, FrameworkMethod, Throwable) event.
<p>
If the {@code afterInvocation} event for the specified method has already been fired, do no... | java | private static boolean fireAfterInvocation(Object runner, Object target, FrameworkMethod method, Throwable thrown) {
if ((runner != null) && (method != null)) {
DepthGauge depthGauge = LifecycleHooks.computeIfAbsent(methodDepth.get(), methodHash(runner, method), newInstance);
if (0 ==... | [
"private",
"static",
"boolean",
"fireAfterInvocation",
"(",
"Object",
"runner",
",",
"Object",
"target",
",",
"FrameworkMethod",
"method",
",",
"Throwable",
"thrown",
")",
"{",
"if",
"(",
"(",
"runner",
"!=",
"null",
")",
"&&",
"(",
"method",
"!=",
"null",
... | Fire the {@link MethodWatcher#afterInvocation(Object, Object, FrameworkMethod, Throwable) event.
<p>
If the {@code afterInvocation} event for the specified method has already been fired, do nothing.
@param runner JUnit test runner
@param target "enhanced" object upon which the method was invoked
@param method {@link F... | [
"Fire",
"the",
"{",
"@link",
"MethodWatcher#afterInvocation",
"(",
"Object",
"Object",
"FrameworkMethod",
"Throwable",
")",
"event",
".",
"<p",
">",
"If",
"the",
"{",
"@code",
"afterInvocation",
"}",
"event",
"for",
"the",
"specified",
"method",
"has",
"already"... | train | https://github.com/Nordstrom/JUnit-Foundation/blob/f24d91f8677d262c27d18ef29ed633eaac717be5/src/main/java/com/nordstrom/automation/junit/RunReflectiveCall.java#L192-L208 |
couchbase/couchbase-lite-java | src/main/java/com/couchbase/lite/LiveQuery.java | LiveQuery.addChangeListener | ListenerToken addChangeListener(Executor executor, QueryChangeListener listener) {
"""
Adds a change listener.
<p>
NOTE: this method is synchronized with Query level.
"""
synchronized (lock) {
if (!observing) { start(); }
return changeNotifier.addChangeListener(executor, liste... | java | ListenerToken addChangeListener(Executor executor, QueryChangeListener listener) {
synchronized (lock) {
if (!observing) { start(); }
return changeNotifier.addChangeListener(executor, listener);
}
} | [
"ListenerToken",
"addChangeListener",
"(",
"Executor",
"executor",
",",
"QueryChangeListener",
"listener",
")",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"if",
"(",
"!",
"observing",
")",
"{",
"start",
"(",
")",
";",
"}",
"return",
"changeNotifier",
".",
"... | Adds a change listener.
<p>
NOTE: this method is synchronized with Query level. | [
"Adds",
"a",
"change",
"listener",
".",
"<p",
">",
"NOTE",
":",
"this",
"method",
"is",
"synchronized",
"with",
"Query",
"level",
"."
] | train | https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/LiveQuery.java#L134-L139 |
jtablesaw/tablesaw | core/src/main/java/tech/tablesaw/aggregate/CrossTab.java | CrossTab.rowPercents | public static Table rowPercents(Table table, String column1, String column2) {
"""
Returns a table containing the row percents made from a source table, after first calculating the counts
cross-tabulated from the given columns
"""
return rowPercents(table, table.categoricalColumn(column1), table.categ... | java | public static Table rowPercents(Table table, String column1, String column2) {
return rowPercents(table, table.categoricalColumn(column1), table.categoricalColumn(column2));
} | [
"public",
"static",
"Table",
"rowPercents",
"(",
"Table",
"table",
",",
"String",
"column1",
",",
"String",
"column2",
")",
"{",
"return",
"rowPercents",
"(",
"table",
",",
"table",
".",
"categoricalColumn",
"(",
"column1",
")",
",",
"table",
".",
"categoric... | Returns a table containing the row percents made from a source table, after first calculating the counts
cross-tabulated from the given columns | [
"Returns",
"a",
"table",
"containing",
"the",
"row",
"percents",
"made",
"from",
"a",
"source",
"table",
"after",
"first",
"calculating",
"the",
"counts",
"cross",
"-",
"tabulated",
"from",
"the",
"given",
"columns"
] | train | https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/aggregate/CrossTab.java#L270-L272 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerExceptionFactory.java | SpannerExceptionFactory.newSpannerException | public static SpannerException newSpannerException(@Nullable Context context, Throwable cause) {
"""
Creates a new exception based on {@code cause}. If {@code cause} indicates cancellation, {@code
context} will be inspected to establish the type of cancellation.
<p>Intended for internal library use; user code ... | java | public static SpannerException newSpannerException(@Nullable Context context, Throwable cause) {
if (cause instanceof SpannerException) {
SpannerException e = (SpannerException) cause;
return newSpannerExceptionPreformatted(e.getErrorCode(), e.getMessage(), e);
} else if (cause instanceof Cancellati... | [
"public",
"static",
"SpannerException",
"newSpannerException",
"(",
"@",
"Nullable",
"Context",
"context",
",",
"Throwable",
"cause",
")",
"{",
"if",
"(",
"cause",
"instanceof",
"SpannerException",
")",
"{",
"SpannerException",
"e",
"=",
"(",
"SpannerException",
"... | Creates a new exception based on {@code cause}. If {@code cause} indicates cancellation, {@code
context} will be inspected to establish the type of cancellation.
<p>Intended for internal library use; user code should use {@link
#newSpannerException(ErrorCode, String)} instead of this method. | [
"Creates",
"a",
"new",
"exception",
"based",
"on",
"{",
"@code",
"cause",
"}",
".",
"If",
"{",
"@code",
"cause",
"}",
"indicates",
"cancellation",
"{",
"@code",
"context",
"}",
"will",
"be",
"inspected",
"to",
"establish",
"the",
"type",
"of",
"cancellatio... | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-spanner/src/main/java/com/google/cloud/spanner/SpannerExceptionFactory.java#L98-L113 |
aws/aws-sdk-java | aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/model/CreateAppRequest.java | CreateAppRequest.withAttributes | public CreateAppRequest withAttributes(java.util.Map<String, String> attributes) {
"""
<p>
One or more user-defined key/value pairs to be added to the stack attributes.
</p>
@param attributes
One or more user-defined key/value pairs to be added to the stack attributes.
@return Returns a reference to this ob... | java | public CreateAppRequest withAttributes(java.util.Map<String, String> attributes) {
setAttributes(attributes);
return this;
} | [
"public",
"CreateAppRequest",
"withAttributes",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
")",
"{",
"setAttributes",
"(",
"attributes",
")",
";",
"return",
"this",
";",
"}"
] | <p>
One or more user-defined key/value pairs to be added to the stack attributes.
</p>
@param attributes
One or more user-defined key/value pairs to be added to the stack attributes.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"One",
"or",
"more",
"user",
"-",
"defined",
"key",
"/",
"value",
"pairs",
"to",
"be",
"added",
"to",
"the",
"stack",
"attributes",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/model/CreateAppRequest.java#L708-L711 |
kiswanij/jk-util | src/main/java/com/jk/util/model/table/JKDefaultTableModel.java | JKDefaultTableModel.getValueAt | @Override
public Object getValueAt(final int row, final int column) {
"""
Returns an attribute value for the cell at <code>row</code> and
<code>column</code>.
@param row the row whose value is to be queried
@param column the column whose value is to be queried
@return the value Object at the specified c... | java | @Override
public Object getValueAt(final int row, final int column) {
final Vector rowVector = (Vector) this.dataVector.elementAt(row);
return rowVector.elementAt(column);
} | [
"@",
"Override",
"public",
"Object",
"getValueAt",
"(",
"final",
"int",
"row",
",",
"final",
"int",
"column",
")",
"{",
"final",
"Vector",
"rowVector",
"=",
"(",
"Vector",
")",
"this",
".",
"dataVector",
".",
"elementAt",
"(",
"row",
")",
";",
"return",
... | Returns an attribute value for the cell at <code>row</code> and
<code>column</code>.
@param row the row whose value is to be queried
@param column the column whose value is to be queried
@return the value Object at the specified cell
@exception ArrayIndexOutOfBoundsException if an invalid row or column was
given | [
"Returns",
"an",
"attribute",
"value",
"for",
"the",
"cell",
"at",
"<code",
">",
"row<",
"/",
"code",
">",
"and",
"<code",
">",
"column<",
"/",
"code",
">",
"."
] | train | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/model/table/JKDefaultTableModel.java#L409-L413 |
wisdom-framework/wisdom | core/application-configuration/src/main/java/org/wisdom/configuration/ConfigurationImpl.java | ConfigurationImpl.getWithDefault | @Override
public String getWithDefault(final String key, String defaultValue) {
"""
Get a String property or a default value when property cannot be found in
any configuration file.
@param key the key used in the configuration file.
@param defaultValue Default value returned, when value cannot be... | java | @Override
public String getWithDefault(final String key, String defaultValue) {
return retrieve(new Callable<String>() {
@Override
public String call() throws Exception {
return configuration.getString(key);
}
}, defaultValue);
} | [
"@",
"Override",
"public",
"String",
"getWithDefault",
"(",
"final",
"String",
"key",
",",
"String",
"defaultValue",
")",
"{",
"return",
"retrieve",
"(",
"new",
"Callable",
"<",
"String",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"String",
"call",
"("... | Get a String property or a default value when property cannot be found in
any configuration file.
@param key the key used in the configuration file.
@param defaultValue Default value returned, when value cannot be found in
configuration.
@return the value of the key or the default value. | [
"Get",
"a",
"String",
"property",
"or",
"a",
"default",
"value",
"when",
"property",
"cannot",
"be",
"found",
"in",
"any",
"configuration",
"file",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/application-configuration/src/main/java/org/wisdom/configuration/ConfigurationImpl.java#L122-L130 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/utility/TextUtility.java | TextUtility.count | public static int count(String keyword, String srcText) {
"""
统计 keyword 在 srcText 中的出现次数
@param keyword
@param srcText
@return
"""
int count = 0;
int leng = srcText.length();
int j = 0;
for (int i = 0; i < leng; i++)
{
if (srcText.charAt(i) == keyword.c... | java | public static int count(String keyword, String srcText)
{
int count = 0;
int leng = srcText.length();
int j = 0;
for (int i = 0; i < leng; i++)
{
if (srcText.charAt(i) == keyword.charAt(j))
{
j++;
if (j == keyword.length... | [
"public",
"static",
"int",
"count",
"(",
"String",
"keyword",
",",
"String",
"srcText",
")",
"{",
"int",
"count",
"=",
"0",
";",
"int",
"leng",
"=",
"srcText",
".",
"length",
"(",
")",
";",
"int",
"j",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
... | 统计 keyword 在 srcText 中的出现次数
@param keyword
@param srcText
@return | [
"统计",
"keyword",
"在",
"srcText",
"中的出现次数"
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/utility/TextUtility.java#L599-L623 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/list/LinkedList.java | LinkedList.xmlWriteOn | public final void xmlWriteOn(FormattedWriter writer, String tagName) throws IOException {
"""
Used when the transactional list is NOT part of a prioritized list.
@param writer
@param tagName
@throws IOException
"""
Link link = getHead();
if (link != null)
{
writer.newLi... | java | public final void xmlWriteOn(FormattedWriter writer, String tagName) throws IOException
{
Link link = getHead();
if (link != null)
{
writer.newLine();
writer.startTag(tagName);
writer.indent();
while (link != null)
{
... | [
"public",
"final",
"void",
"xmlWriteOn",
"(",
"FormattedWriter",
"writer",
",",
"String",
"tagName",
")",
"throws",
"IOException",
"{",
"Link",
"link",
"=",
"getHead",
"(",
")",
";",
"if",
"(",
"link",
"!=",
"null",
")",
"{",
"writer",
".",
"newLine",
"(... | Used when the transactional list is NOT part of a prioritized list.
@param writer
@param tagName
@throws IOException | [
"Used",
"when",
"the",
"transactional",
"list",
"is",
"NOT",
"part",
"of",
"a",
"prioritized",
"list",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.msgstore/src/com/ibm/ws/sib/msgstore/list/LinkedList.java#L274-L294 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/ContainerKeyCache.java | ContainerKeyCache.includeExistingKey | long includeExistingKey(long segmentId, UUID keyHash, long segmentOffset) {
"""
Updates the contents of a Cache Entry associated with the given Segment Id and KeyHash. This method cannot be
used to remove values.
This method should be used for processing existing keys (that have already been indexed), as oppos... | java | long includeExistingKey(long segmentId, UUID keyHash, long segmentOffset) {
SegmentKeyCache cache;
int generation;
synchronized (this.segmentCaches) {
generation = this.currentCacheGeneration;
cache = this.segmentCaches.computeIfAbsent(segmentId, s -> new SegmentKeyCache(... | [
"long",
"includeExistingKey",
"(",
"long",
"segmentId",
",",
"UUID",
"keyHash",
",",
"long",
"segmentOffset",
")",
"{",
"SegmentKeyCache",
"cache",
";",
"int",
"generation",
";",
"synchronized",
"(",
"this",
".",
"segmentCaches",
")",
"{",
"generation",
"=",
"... | Updates the contents of a Cache Entry associated with the given Segment Id and KeyHash. This method cannot be
used to remove values.
This method should be used for processing existing keys (that have already been indexed), as opposed from processing
new (un-indexed) keys.
@param segmentId The Segment Id.
@param k... | [
"Updates",
"the",
"contents",
"of",
"a",
"Cache",
"Entry",
"associated",
"with",
"the",
"given",
"Segment",
"Id",
"and",
"KeyHash",
".",
"This",
"method",
"cannot",
"be",
"used",
"to",
"remove",
"values",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/tables/ContainerKeyCache.java#L154-L163 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/type/TypeHandlerUtils.java | TypeHandlerUtils.convertJavaClassToSqlType | public static String convertJavaClassToSqlType(String simpleClassName) throws SQLException {
"""
Converts Java Class name into SQL Type name
@param simpleClassName Java Class name
@return SQL Type name
@throws SQLException
"""
if ("String".equals(simpleClassName) == true) {
return "VAR... | java | public static String convertJavaClassToSqlType(String simpleClassName) throws SQLException {
if ("String".equals(simpleClassName) == true) {
return "VARCHAR";
}
throw new SQLException(String.format("Could not convert java class %s", simpleClassName));
} | [
"public",
"static",
"String",
"convertJavaClassToSqlType",
"(",
"String",
"simpleClassName",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"\"String\"",
".",
"equals",
"(",
"simpleClassName",
")",
"==",
"true",
")",
"{",
"return",
"\"VARCHAR\"",
";",
"}",
"thro... | Converts Java Class name into SQL Type name
@param simpleClassName Java Class name
@return SQL Type name
@throws SQLException | [
"Converts",
"Java",
"Class",
"name",
"into",
"SQL",
"Type",
"name"
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/type/TypeHandlerUtils.java#L272-L278 |
b3log/latke | latke-core/src/main/java/org/b3log/latke/repository/Query.java | Query.addSort | public Query addSort(final String propertyName, final SortDirection sortDirection) {
"""
Adds sort for the specified property with the specified direction.
@param propertyName the specified property name to sort
@param sortDirection the specified sort
@return the current query object
"""
sorts.pu... | java | public Query addSort(final String propertyName, final SortDirection sortDirection) {
sorts.put(propertyName, sortDirection);
return this;
} | [
"public",
"Query",
"addSort",
"(",
"final",
"String",
"propertyName",
",",
"final",
"SortDirection",
"sortDirection",
")",
"{",
"sorts",
".",
"put",
"(",
"propertyName",
",",
"sortDirection",
")",
";",
"return",
"this",
";",
"}"
] | Adds sort for the specified property with the specified direction.
@param propertyName the specified property name to sort
@param sortDirection the specified sort
@return the current query object | [
"Adds",
"sort",
"for",
"the",
"specified",
"property",
"with",
"the",
"specified",
"direction",
"."
] | train | https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/b3log/latke/repository/Query.java#L137-L141 |
jhy/jsoup | src/main/java/org/jsoup/nodes/Element.java | Element.getElementsMatchingText | public Elements getElementsMatchingText(String regex) {
"""
Find elements whose text matches the supplied regular expression.
@param regex regular expression to match text against. You can use <a href="http://java.sun.com/docs/books/tutorial/essential/regex/pattern.html#embedded">embedded flags</a> (such as (?i) ... | java | public Elements getElementsMatchingText(String regex) {
Pattern pattern;
try {
pattern = Pattern.compile(regex);
} catch (PatternSyntaxException e) {
throw new IllegalArgumentException("Pattern syntax error: " + regex, e);
}
return getElementsMatchingText(... | [
"public",
"Elements",
"getElementsMatchingText",
"(",
"String",
"regex",
")",
"{",
"Pattern",
"pattern",
";",
"try",
"{",
"pattern",
"=",
"Pattern",
".",
"compile",
"(",
"regex",
")",
";",
"}",
"catch",
"(",
"PatternSyntaxException",
"e",
")",
"{",
"throw",
... | Find elements whose text matches the supplied regular expression.
@param regex regular expression to match text against. You can use <a href="http://java.sun.com/docs/books/tutorial/essential/regex/pattern.html#embedded">embedded flags</a> (such as (?i) and (?m) to control regex options.
@return elements matching the s... | [
"Find",
"elements",
"whose",
"text",
"matches",
"the",
"supplied",
"regular",
"expression",
"."
] | train | https://github.com/jhy/jsoup/blob/68ff8cbe7ad847059737a09c567a501a7f1d251f/src/main/java/org/jsoup/nodes/Element.java#L1003-L1011 |
apache/flink | flink-core/src/main/java/org/apache/flink/util/StringUtils.java | StringUtils.generateRandomAlphanumericString | public static String generateRandomAlphanumericString(Random rnd, int length) {
"""
Creates a random alphanumeric string of given length.
@param rnd The random number generator to use.
@param length The number of alphanumeric characters to append.
"""
checkNotNull(rnd);
checkArgument(length >= 0);
S... | java | public static String generateRandomAlphanumericString(Random rnd, int length) {
checkNotNull(rnd);
checkArgument(length >= 0);
StringBuilder buffer = new StringBuilder(length);
for (int i = 0; i < length; i++) {
buffer.append(nextAlphanumericChar(rnd));
}
return buffer.toString();
} | [
"public",
"static",
"String",
"generateRandomAlphanumericString",
"(",
"Random",
"rnd",
",",
"int",
"length",
")",
"{",
"checkNotNull",
"(",
"rnd",
")",
";",
"checkArgument",
"(",
"length",
">=",
"0",
")",
";",
"StringBuilder",
"buffer",
"=",
"new",
"StringBui... | Creates a random alphanumeric string of given length.
@param rnd The random number generator to use.
@param length The number of alphanumeric characters to append. | [
"Creates",
"a",
"random",
"alphanumeric",
"string",
"of",
"given",
"length",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/StringUtils.java#L258-L267 |
ops4j/org.ops4j.pax.swissbox | pax-swissbox-bnd/src/main/java/org/ops4j/pax/swissbox/bnd/BndUtils.java | BndUtils.throwAsMalformedURLException | private static void throwAsMalformedURLException( final String message, final Exception cause )
throws MalformedURLException {
"""
Creates an MalformedURLException with a message and a cause.
@param message exception message
@param cause exception cause
@throws MalformedURLException the created Ma... | java | private static void throwAsMalformedURLException( final String message, final Exception cause )
throws MalformedURLException
{
final MalformedURLException exception = new MalformedURLException( message );
exception.initCause( cause );
throw exception;
} | [
"private",
"static",
"void",
"throwAsMalformedURLException",
"(",
"final",
"String",
"message",
",",
"final",
"Exception",
"cause",
")",
"throws",
"MalformedURLException",
"{",
"final",
"MalformedURLException",
"exception",
"=",
"new",
"MalformedURLException",
"(",
"mes... | Creates an MalformedURLException with a message and a cause.
@param message exception message
@param cause exception cause
@throws MalformedURLException the created MalformedURLException | [
"Creates",
"an",
"MalformedURLException",
"with",
"a",
"message",
"and",
"a",
"cause",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.swissbox/blob/00b0ee16cdbe8017984a4d7ba808b10d985c5b5c/pax-swissbox-bnd/src/main/java/org/ops4j/pax/swissbox/bnd/BndUtils.java#L350-L356 |
aws/aws-sdk-java | src/samples/AmazonEC2SpotInstances-Advanced/Requests.java | Requests.tagResources | private void tagResources(List<String> resources, List<Tag> tags) {
"""
Tag any of the resources we specify.
@param resources
@param tags
"""
// Create a tag request.
CreateTagsRequest createTagsRequest = new CreateTagsRequest();
createTagsRequest.setResources(resources);
... | java | private void tagResources(List<String> resources, List<Tag> tags) {
// Create a tag request.
CreateTagsRequest createTagsRequest = new CreateTagsRequest();
createTagsRequest.setResources(resources);
createTagsRequest.setTags(tags);
// Try to tag the Spot request submitted.... | [
"private",
"void",
"tagResources",
"(",
"List",
"<",
"String",
">",
"resources",
",",
"List",
"<",
"Tag",
">",
"tags",
")",
"{",
"// Create a tag request.\r",
"CreateTagsRequest",
"createTagsRequest",
"=",
"new",
"CreateTagsRequest",
"(",
")",
";",
"createTagsRequ... | Tag any of the resources we specify.
@param resources
@param tags | [
"Tag",
"any",
"of",
"the",
"resources",
"we",
"specify",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/src/samples/AmazonEC2SpotInstances-Advanced/Requests.java#L320-L338 |
jbehave/jbehave-core | jbehave-core/src/main/java/org/jbehave/core/embedder/StoryRunner.java | StoryRunner.storyOfText | public Story storyOfText(Configuration configuration, String storyAsText, String storyId) {
"""
Returns the parsed story from the given text
@param configuration the Configuration used to run story
@param storyAsText the story text
@param storyId the story Id, which will be returned as story path
@return The... | java | public Story storyOfText(Configuration configuration, String storyAsText, String storyId) {
return configuration.storyParser().parseStory(storyAsText, storyId);
} | [
"public",
"Story",
"storyOfText",
"(",
"Configuration",
"configuration",
",",
"String",
"storyAsText",
",",
"String",
"storyId",
")",
"{",
"return",
"configuration",
".",
"storyParser",
"(",
")",
".",
"parseStory",
"(",
"storyAsText",
",",
"storyId",
")",
";",
... | Returns the parsed story from the given text
@param configuration the Configuration used to run story
@param storyAsText the story text
@param storyId the story Id, which will be returned as story path
@return The parsed Story | [
"Returns",
"the",
"parsed",
"story",
"from",
"the",
"given",
"text"
] | train | https://github.com/jbehave/jbehave-core/blob/bdd6a6199528df3c35087e72d4644870655b23e6/jbehave-core/src/main/java/org/jbehave/core/embedder/StoryRunner.java#L208-L210 |
bignerdranch/expandable-recycler-view | expandablerecyclerview/src/main/java/com/bignerdranch/expandablerecyclerview/ExpandableRecyclerAdapter.java | ExpandableRecyclerAdapter.expandViews | @SuppressWarnings("unchecked")
@UiThread
private void expandViews(@NonNull ExpandableWrapper<P, C> parentWrapper, int flatParentPosition) {
"""
Calls through to the ParentViewHolder to expand views for each
RecyclerView the specified parent is a child of.
<p>
These calls to the ParentViewHolder are made... | java | @SuppressWarnings("unchecked")
@UiThread
private void expandViews(@NonNull ExpandableWrapper<P, C> parentWrapper, int flatParentPosition) {
PVH viewHolder;
for (RecyclerView recyclerView : mAttachedRecyclerViewPool) {
viewHolder = (PVH) recyclerView.findViewHolderForAdapterPosition(f... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"UiThread",
"private",
"void",
"expandViews",
"(",
"@",
"NonNull",
"ExpandableWrapper",
"<",
"P",
",",
"C",
">",
"parentWrapper",
",",
"int",
"flatParentPosition",
")",
"{",
"PVH",
"viewHolder",
";",
"fo... | Calls through to the ParentViewHolder to expand views for each
RecyclerView the specified parent is a child of.
<p>
These calls to the ParentViewHolder are made so that animations can be
triggered at the ViewHolder level.
@param flatParentPosition The index of the parent to expand | [
"Calls",
"through",
"to",
"the",
"ParentViewHolder",
"to",
"expand",
"views",
"for",
"each",
"RecyclerView",
"the",
"specified",
"parent",
"is",
"a",
"child",
"of",
".",
"<p",
">",
"These",
"calls",
"to",
"the",
"ParentViewHolder",
"are",
"made",
"so",
"that... | train | https://github.com/bignerdranch/expandable-recycler-view/blob/930912510620894c531d236856fa79d646e2f1ed/expandablerecyclerview/src/main/java/com/bignerdranch/expandablerecyclerview/ExpandableRecyclerAdapter.java#L645-L658 |
amplexus/java-flac-encoder | src/main/java/net/sourceforge/javaflacencoder/Frame.java | Frame.encodeSamples | public int encodeSamples(int[] samples, int count, int start, int skip,
EncodedElement result, long frameNumber) {
"""
Encodes samples into the appropriate compressed format, saving the
result in the given “data” EncodedElement list. Encodes 'count' samples,
from index 'start', to index 'start' times 'skip... | java | public int encodeSamples(int[] samples, int count, int start, int skip,
EncodedElement result, long frameNumber) {
//System.err.println("FRAME::encodeSamples: frame#:"+frameNumber);
if(DEBUG_LEV > 0) {
System.err.println("FRAME::encodeSamplesNew(...)");
if(DEBUG_LEV > 10) {
System.err.... | [
"public",
"int",
"encodeSamples",
"(",
"int",
"[",
"]",
"samples",
",",
"int",
"count",
",",
"int",
"start",
",",
"int",
"skip",
",",
"EncodedElement",
"result",
",",
"long",
"frameNumber",
")",
"{",
"//System.err.println(\"FRAME::encodeSamples: frame#:\"+frameNumbe... | Encodes samples into the appropriate compressed format, saving the
result in the given “data” EncodedElement list. Encodes 'count' samples,
from index 'start', to index 'start' times 'skip', where “skip” is the
format that samples may be packed in an array. For example, 'samples' may
include both left and right samples... | [
"Encodes",
"samples",
"into",
"the",
"appropriate",
"compressed",
"format",
"saving",
"the",
"result",
"in",
"the",
"given",
"“data”",
"EncodedElement",
"list",
".",
"Encodes",
"count",
"samples",
"from",
"index",
"start",
"to",
"index",
"start",
"times",
"skip"... | train | https://github.com/amplexus/java-flac-encoder/blob/3d536b877dee2a3fd4ab2e0d9569e292cae93bc9/src/main/java/net/sourceforge/javaflacencoder/Frame.java#L290-L335 |
casmi/casmi | src/main/java/casmi/graphics/element/Arc.java | Arc.setEdgeColor | public void setEdgeColor(Color color) {
"""
Sets the color of the edge of this Arc.
@param color The color of the edge of the Arc.
"""
if (edgeColor == null) edgeColor = new RGBColor(0.0, 0.0, 0.0);
setGradation(true);
this.edgeColor = color;
} | java | public void setEdgeColor(Color color) {
if (edgeColor == null) edgeColor = new RGBColor(0.0, 0.0, 0.0);
setGradation(true);
this.edgeColor = color;
} | [
"public",
"void",
"setEdgeColor",
"(",
"Color",
"color",
")",
"{",
"if",
"(",
"edgeColor",
"==",
"null",
")",
"edgeColor",
"=",
"new",
"RGBColor",
"(",
"0.0",
",",
"0.0",
",",
"0.0",
")",
";",
"setGradation",
"(",
"true",
")",
";",
"this",
".",
"edge... | Sets the color of the edge of this Arc.
@param color The color of the edge of the Arc. | [
"Sets",
"the",
"color",
"of",
"the",
"edge",
"of",
"this",
"Arc",
"."
] | train | https://github.com/casmi/casmi/blob/90f6514a9cbce0685186e7a92beb69e22a3b11c4/src/main/java/casmi/graphics/element/Arc.java#L436-L440 |
TheHolyWaffle/League-of-Legends-XMPP-Chat-Library | src/main/java/com/github/theholywaffle/lolchatapi/LolChat.java | LolChat.getFriends | public List<Friend> getFriends(Filter<Friend> filter) {
"""
Gets a list of your friends based on a given filter.
@param filter
The filter defines conditions that your Friends must meet.
@return A List of your Friends that meet the condition of your Filter
"""
final ArrayList<Friend> friends = new ArrayL... | java | public List<Friend> getFriends(Filter<Friend> filter) {
final ArrayList<Friend> friends = new ArrayList<>();
for (final RosterEntry e : connection.getRoster().getEntries()) {
final Friend f = new Friend(this, connection, e);
if (filter.accept(f)) {
friends.add(f);
}
}
return friends;
} | [
"public",
"List",
"<",
"Friend",
">",
"getFriends",
"(",
"Filter",
"<",
"Friend",
">",
"filter",
")",
"{",
"final",
"ArrayList",
"<",
"Friend",
">",
"friends",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"final",
"RosterEntry",
"e",
":",
... | Gets a list of your friends based on a given filter.
@param filter
The filter defines conditions that your Friends must meet.
@return A List of your Friends that meet the condition of your Filter | [
"Gets",
"a",
"list",
"of",
"your",
"friends",
"based",
"on",
"a",
"given",
"filter",
"."
] | train | https://github.com/TheHolyWaffle/League-of-Legends-XMPP-Chat-Library/blob/5e4d87d0c054ff2f6510545b0e9f838338695c70/src/main/java/com/github/theholywaffle/lolchatapi/LolChat.java#L553-L562 |
Wootric/WootricSDK-Android | androidsdk/src/main/java/com/wootric/androidsdk/Wootric.java | Wootric.init | public static Wootric init(Activity activity, String clientId, String accountToken) {
"""
It configures the SDK with required parameters.
@param activity Activity where the survey will be presented.
@param clientId Found in API section of the Wootric's admin panel.
@param accountToken Found in Install section... | java | public static Wootric init(Activity activity, String clientId, String accountToken) {
Wootric local = singleton;
if(local == null) {
synchronized (Wootric.class) {
local = singleton;
if (local == null) {
checkNotNull(activity, "Activity");
... | [
"public",
"static",
"Wootric",
"init",
"(",
"Activity",
"activity",
",",
"String",
"clientId",
",",
"String",
"accountToken",
")",
"{",
"Wootric",
"local",
"=",
"singleton",
";",
"if",
"(",
"local",
"==",
"null",
")",
"{",
"synchronized",
"(",
"Wootric",
"... | It configures the SDK with required parameters.
@param activity Activity where the survey will be presented.
@param clientId Found in API section of the Wootric's admin panel.
@param accountToken Found in Install section of the Wootric's admin panel. | [
"It",
"configures",
"the",
"SDK",
"with",
"required",
"parameters",
"."
] | train | https://github.com/Wootric/WootricSDK-Android/blob/ba584f2317ce99452424b9a78d024e361ad6fec4/androidsdk/src/main/java/com/wootric/androidsdk/Wootric.java#L121-L136 |
alkacon/opencms-core | src/org/opencms/xml/content/CmsXmlContentPropertyHelper.java | CmsXmlContentPropertyHelper.getPropValueIds | public static String getPropValueIds(CmsObject cms, String type, String value) {
"""
Returns a converted property value depending on the given type.<p>
If the type is {@link CmsXmlContentProperty.PropType#vfslist}, the value is parsed as a
list of paths and converted to a list of IDs.<p>
@param cms the curr... | java | public static String getPropValueIds(CmsObject cms, String type, String value) {
if (PropType.isVfsList(type)) {
return convertPathsToIds(cms, value);
}
return value;
} | [
"public",
"static",
"String",
"getPropValueIds",
"(",
"CmsObject",
"cms",
",",
"String",
"type",
",",
"String",
"value",
")",
"{",
"if",
"(",
"PropType",
".",
"isVfsList",
"(",
"type",
")",
")",
"{",
"return",
"convertPathsToIds",
"(",
"cms",
",",
"value",... | Returns a converted property value depending on the given type.<p>
If the type is {@link CmsXmlContentProperty.PropType#vfslist}, the value is parsed as a
list of paths and converted to a list of IDs.<p>
@param cms the current CMS context
@param type the property type
@param value the raw property value
@return a co... | [
"Returns",
"a",
"converted",
"property",
"value",
"depending",
"on",
"the",
"given",
"type",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/content/CmsXmlContentPropertyHelper.java#L309-L315 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java | NetworkWatchersInner.beginCheckConnectivityAsync | public Observable<ConnectivityInformationInner> beginCheckConnectivityAsync(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) {
"""
Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary ... | java | public Observable<ConnectivityInformationInner> beginCheckConnectivityAsync(String resourceGroupName, String networkWatcherName, ConnectivityParameters parameters) {
return beginCheckConnectivityWithServiceResponseAsync(resourceGroupName, networkWatcherName, parameters).map(new Func1<ServiceResponse<Connectivit... | [
"public",
"Observable",
"<",
"ConnectivityInformationInner",
">",
"beginCheckConnectivityAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkWatcherName",
",",
"ConnectivityParameters",
"parameters",
")",
"{",
"return",
"beginCheckConnectivityWithServiceResponseAsy... | Verifies the possibility of establishing a direct TCP connection from a virtual machine to a given endpoint including another VM or an arbitrary remote server.
@param resourceGroupName The name of the network watcher resource group.
@param networkWatcherName The name of the network watcher resource.
@param parameters ... | [
"Verifies",
"the",
"possibility",
"of",
"establishing",
"a",
"direct",
"TCP",
"connection",
"from",
"a",
"virtual",
"machine",
"to",
"a",
"given",
"endpoint",
"including",
"another",
"VM",
"or",
"an",
"arbitrary",
"remote",
"server",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java#L2242-L2249 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/HTODDependencyTable.java | HTODDependencyTable.removeEntry | public Result removeEntry(Object dependency, Object entry) {
"""
This removes the specified entry from the specified dependency.
@param dependency The dependency.
@param result
"""
Result result = this.htod.getFromResultPool();
ValueSet valueSet = (ValueSet) dependencyToEntryTable.get(depen... | java | public Result removeEntry(Object dependency, Object entry) {
Result result = this.htod.getFromResultPool();
ValueSet valueSet = (ValueSet) dependencyToEntryTable.get(dependency);
if (valueSet == null) {
return result;
}
result.bExist = HTODDynacache.EXIST;
va... | [
"public",
"Result",
"removeEntry",
"(",
"Object",
"dependency",
",",
"Object",
"entry",
")",
"{",
"Result",
"result",
"=",
"this",
".",
"htod",
".",
"getFromResultPool",
"(",
")",
";",
"ValueSet",
"valueSet",
"=",
"(",
"ValueSet",
")",
"dependencyToEntryTable"... | This removes the specified entry from the specified dependency.
@param dependency The dependency.
@param result | [
"This",
"removes",
"the",
"specified",
"entry",
"from",
"the",
"specified",
"dependency",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/HTODDependencyTable.java#L179-L199 |
OpenLiberty/open-liberty | dev/com.ibm.ws.rest.handler.validator.jca/src/com/ibm/ws/rest/handler/validator/jca/ConnectionFactoryValidator.java | ConnectionFactoryValidator.createConnectionSpec | @FFDCIgnore(Throwable.class)
private ConnectionSpec createConnectionSpec(ConnectionFactory cciConFactory, String conSpecClassName, String userName, @Sensitive String password) {
"""
Utility method that attempts to construct a ConnectionSpec impl of the specified name,
which might or might not exist in the res... | java | @FFDCIgnore(Throwable.class)
private ConnectionSpec createConnectionSpec(ConnectionFactory cciConFactory, String conSpecClassName, String userName, @Sensitive String password) {
try {
@SuppressWarnings("unchecked")
Class<ConnectionSpec> conSpecClass = (Class<ConnectionSpec>) cciConFa... | [
"@",
"FFDCIgnore",
"(",
"Throwable",
".",
"class",
")",
"private",
"ConnectionSpec",
"createConnectionSpec",
"(",
"ConnectionFactory",
"cciConFactory",
",",
"String",
"conSpecClassName",
",",
"String",
"userName",
",",
"@",
"Sensitive",
"String",
"password",
")",
"{... | Utility method that attempts to construct a ConnectionSpec impl of the specified name,
which might or might not exist in the resource adapter.
@param cciConFactory the connection factory class
@param conSpecClassName possible connection spec impl class name to try
@param userName user name to set on the con... | [
"Utility",
"method",
"that",
"attempts",
"to",
"construct",
"a",
"ConnectionSpec",
"impl",
"of",
"the",
"specified",
"name",
"which",
"might",
"or",
"might",
"not",
"exist",
"in",
"the",
"resource",
"adapter",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.rest.handler.validator.jca/src/com/ibm/ws/rest/handler/validator/jca/ConnectionFactoryValidator.java#L69-L83 |
carewebframework/carewebframework-core | org.carewebframework.help-parent/org.carewebframework.help.lucene/src/main/java/org/carewebframework/help/lucene/HelpSearchService.java | HelpSearchService.resolveIndexDirectoryPath | private File resolveIndexDirectoryPath() throws IOException {
"""
Resolves the index directory path. If a path is not specified, one is created within
temporary storage.
@return The resolved index directory path.
@throws IOException Unspecified IO exception.
"""
if (StringUtils.isEmpty(indexDirect... | java | private File resolveIndexDirectoryPath() throws IOException {
if (StringUtils.isEmpty(indexDirectoryPath)) {
indexDirectoryPath = System.getProperty("java.io.tmpdir") + appContext.getApplicationName();
}
File dir = new File(indexDirectoryPath, getClass().getPackage().getName... | [
"private",
"File",
"resolveIndexDirectoryPath",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"StringUtils",
".",
"isEmpty",
"(",
"indexDirectoryPath",
")",
")",
"{",
"indexDirectoryPath",
"=",
"System",
".",
"getProperty",
"(",
"\"java.io.tmpdir\"",
")",
"+"... | Resolves the index directory path. If a path is not specified, one is created within
temporary storage.
@return The resolved index directory path.
@throws IOException Unspecified IO exception. | [
"Resolves",
"the",
"index",
"directory",
"path",
".",
"If",
"a",
"path",
"is",
"not",
"specified",
"one",
"is",
"created",
"within",
"temporary",
"storage",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.help-parent/org.carewebframework.help.lucene/src/main/java/org/carewebframework/help/lucene/HelpSearchService.java#L237-L250 |
cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/ConvexHull.java | ConvexHull.isLeftTurn | private static boolean isLeftTurn(Point2D a, Point2D b, Point2D c) {
"""
Determine if the three points make a left turn.
@param a first point
@param b second point
@param c third point
@return whether the points make a left turn
"""
return winding(a, b, c) > 0;
} | java | private static boolean isLeftTurn(Point2D a, Point2D b, Point2D c) {
return winding(a, b, c) > 0;
} | [
"private",
"static",
"boolean",
"isLeftTurn",
"(",
"Point2D",
"a",
",",
"Point2D",
"b",
",",
"Point2D",
"c",
")",
"{",
"return",
"winding",
"(",
"a",
",",
"b",
",",
"c",
")",
">",
"0",
";",
"}"
] | Determine if the three points make a left turn.
@param a first point
@param b second point
@param c third point
@return whether the points make a left turn | [
"Determine",
"if",
"the",
"three",
"points",
"make",
"a",
"left",
"turn",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/ConvexHull.java#L328-L330 |
google/closure-templates | java/src/com/google/template/soy/shared/internal/AbstractGenerateSoyEscapingDirectiveCode.java | AbstractGenerateSoyEscapingDirectiveCode.writeUnsafeStringLiteral | private void writeUnsafeStringLiteral(char value, StringBuilder out) {
"""
Appends a string literal which may not be printable with the given value onto the given buffer.
"""
if (!isPrintable(value)) {
// Don't emit non-Latin characters or control characters since they don't roundtrip well.
out... | java | private void writeUnsafeStringLiteral(char value, StringBuilder out) {
if (!isPrintable(value)) {
// Don't emit non-Latin characters or control characters since they don't roundtrip well.
out.append(String.format(value >= 0x100 ? "'\\u%04x'" : "'\\x%02x'", (int) value));
} else {
out.append('\... | [
"private",
"void",
"writeUnsafeStringLiteral",
"(",
"char",
"value",
",",
"StringBuilder",
"out",
")",
"{",
"if",
"(",
"!",
"isPrintable",
"(",
"value",
")",
")",
"{",
"// Don't emit non-Latin characters or control characters since they don't roundtrip well.",
"out",
".",... | Appends a string literal which may not be printable with the given value onto the given buffer. | [
"Appends",
"a",
"string",
"literal",
"which",
"may",
"not",
"be",
"printable",
"with",
"the",
"given",
"value",
"onto",
"the",
"given",
"buffer",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/shared/internal/AbstractGenerateSoyEscapingDirectiveCode.java#L462-L469 |
couchbase/couchbase-lite-java | src/main/java/com/couchbase/lite/Join.java | Join.crossJoin | @NonNull
public static Join crossJoin(@NonNull DataSource datasource) {
"""
Create an CROSS JOIN component with the given data source.
Use the returned On component to specify join conditions.
@param datasource The DataSource object of the JOIN clause.
@return The Join object used for specifying join cond... | java | @NonNull
public static Join crossJoin(@NonNull DataSource datasource) {
if (datasource == null) {
throw new IllegalArgumentException("datasource cannot be null.");
}
return new Join(Type.CROSS, datasource);
} | [
"@",
"NonNull",
"public",
"static",
"Join",
"crossJoin",
"(",
"@",
"NonNull",
"DataSource",
"datasource",
")",
"{",
"if",
"(",
"datasource",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"datasource cannot be null.\"",
")",
";",
"}",... | Create an CROSS JOIN component with the given data source.
Use the returned On component to specify join conditions.
@param datasource The DataSource object of the JOIN clause.
@return The Join object used for specifying join conditions. | [
"Create",
"an",
"CROSS",
"JOIN",
"component",
"with",
"the",
"given",
"data",
"source",
".",
"Use",
"the",
"returned",
"On",
"component",
"to",
"specify",
"join",
"conditions",
"."
] | train | https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/Join.java#L154-L160 |
wildfly/wildfly-core | deployment-repository/src/main/java/org/jboss/as/repository/PathUtil.java | PathUtil.createTempDirectory | public static Path createTempDirectory(Path dir, String prefix) throws IOException {
"""
Create a temporary directory with the same attributes as its parent directory.
@param dir
the path to directory in which to create the directory
@param prefix
the prefix string to be used in generating the directory's ... | java | public static Path createTempDirectory(Path dir, String prefix) throws IOException {
try {
return Files.createTempDirectory(dir, prefix);
} catch (UnsupportedOperationException ex) {
}
return Files.createTempDirectory(dir, prefix);
} | [
"public",
"static",
"Path",
"createTempDirectory",
"(",
"Path",
"dir",
",",
"String",
"prefix",
")",
"throws",
"IOException",
"{",
"try",
"{",
"return",
"Files",
".",
"createTempDirectory",
"(",
"dir",
",",
"prefix",
")",
";",
"}",
"catch",
"(",
"Unsupported... | Create a temporary directory with the same attributes as its parent directory.
@param dir
the path to directory in which to create the directory
@param prefix
the prefix string to be used in generating the directory's name;
may be {@code null}
@return the path to the newly created directory that did not exist befo... | [
"Create",
"a",
"temporary",
"directory",
"with",
"the",
"same",
"attributes",
"as",
"its",
"parent",
"directory",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/deployment-repository/src/main/java/org/jboss/as/repository/PathUtil.java#L297-L303 |
mlhartme/sushi | src/main/java/net/oneandone/sushi/util/IntBitSet.java | IntBitSet.removeRange | public void removeRange(int first, int last) {
"""
Remove all elements in the indicated range.
@param first first element to remove
@param last last element to remove
"""
int ele;
for (ele = first; ele <= last; ele++) {
remove(ele);
}
} | java | public void removeRange(int first, int last) {
int ele;
for (ele = first; ele <= last; ele++) {
remove(ele);
}
} | [
"public",
"void",
"removeRange",
"(",
"int",
"first",
",",
"int",
"last",
")",
"{",
"int",
"ele",
";",
"for",
"(",
"ele",
"=",
"first",
";",
"ele",
"<=",
"last",
";",
"ele",
"++",
")",
"{",
"remove",
"(",
"ele",
")",
";",
"}",
"}"
] | Remove all elements in the indicated range.
@param first first element to remove
@param last last element to remove | [
"Remove",
"all",
"elements",
"in",
"the",
"indicated",
"range",
"."
] | train | https://github.com/mlhartme/sushi/blob/4af33414b04bd58584d4febe5cc63ef6c7346a75/src/main/java/net/oneandone/sushi/util/IntBitSet.java#L247-L253 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/util/ShapeGenerator.java | ShapeGenerator.createRectangle | public Shape createRectangle(final int x, final int y, final int w, final int h) {
"""
Return a path for a rectangle with square corners.
@param x the X coordinate of the upper-left corner of the rectangle
@param y the Y coordinate of the upper-left corner of the rectangle
@param w the width of the rectang... | java | public Shape createRectangle(final int x, final int y, final int w, final int h) {
return createRoundRectangleInternal(x, y, w, h, 0, CornerStyle.SQUARE, CornerStyle.SQUARE, CornerStyle.SQUARE, CornerStyle.SQUARE);
} | [
"public",
"Shape",
"createRectangle",
"(",
"final",
"int",
"x",
",",
"final",
"int",
"y",
",",
"final",
"int",
"w",
",",
"final",
"int",
"h",
")",
"{",
"return",
"createRoundRectangleInternal",
"(",
"x",
",",
"y",
",",
"w",
",",
"h",
",",
"0",
",",
... | Return a path for a rectangle with square corners.
@param x the X coordinate of the upper-left corner of the rectangle
@param y the Y coordinate of the upper-left corner of the rectangle
@param w the width of the rectangle
@param h the height of the rectangle
@return a path representing the shape. | [
"Return",
"a",
"path",
"for",
"a",
"rectangle",
"with",
"square",
"corners",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/util/ShapeGenerator.java#L194-L196 |
auth0/java-jwt | lib/src/main/java/com/auth0/jwt/algorithms/Algorithm.java | Algorithm.RSA512 | public static Algorithm RSA512(RSAPublicKey publicKey, RSAPrivateKey privateKey) throws IllegalArgumentException {
"""
Creates a new Algorithm instance using SHA512withRSA. Tokens specify this as "RS512".
@param publicKey the key to use in the verify instance.
@param privateKey the key to use in the signing i... | java | public static Algorithm RSA512(RSAPublicKey publicKey, RSAPrivateKey privateKey) throws IllegalArgumentException {
return RSA512(RSAAlgorithm.providerForKeys(publicKey, privateKey));
} | [
"public",
"static",
"Algorithm",
"RSA512",
"(",
"RSAPublicKey",
"publicKey",
",",
"RSAPrivateKey",
"privateKey",
")",
"throws",
"IllegalArgumentException",
"{",
"return",
"RSA512",
"(",
"RSAAlgorithm",
".",
"providerForKeys",
"(",
"publicKey",
",",
"privateKey",
")",
... | Creates a new Algorithm instance using SHA512withRSA. Tokens specify this as "RS512".
@param publicKey the key to use in the verify instance.
@param privateKey the key to use in the signing instance.
@return a valid RSA512 Algorithm.
@throws IllegalArgumentException if both provided Keys are null. | [
"Creates",
"a",
"new",
"Algorithm",
"instance",
"using",
"SHA512withRSA",
".",
"Tokens",
"specify",
"this",
"as",
"RS512",
"."
] | train | https://github.com/auth0/java-jwt/blob/890538970a9699b7251a4bfe4f26e8d7605ad530/lib/src/main/java/com/auth0/jwt/algorithms/Algorithm.java#L116-L118 |
joniles/mpxj | src/main/java/net/sf/mpxj/mspdi/MSPDIWriter.java | MSPDIWriter.writeAssignmentTimephasedData | private void writeAssignmentTimephasedData(BigInteger assignmentID, List<TimephasedDataType> list, List<TimephasedWork> data, int type) {
"""
Writes a list of timephased data to the MSPDI file.
@param assignmentID current assignment ID
@param list output list of timephased data items
@param data input list of... | java | private void writeAssignmentTimephasedData(BigInteger assignmentID, List<TimephasedDataType> list, List<TimephasedWork> data, int type)
{
for (TimephasedWork mpx : data)
{
TimephasedDataType xml = m_factory.createTimephasedDataType();
list.add(xml);
xml.setStart(mpx.getStart()... | [
"private",
"void",
"writeAssignmentTimephasedData",
"(",
"BigInteger",
"assignmentID",
",",
"List",
"<",
"TimephasedDataType",
">",
"list",
",",
"List",
"<",
"TimephasedWork",
">",
"data",
",",
"int",
"type",
")",
"{",
"for",
"(",
"TimephasedWork",
"mpx",
":",
... | Writes a list of timephased data to the MSPDI file.
@param assignmentID current assignment ID
@param list output list of timephased data items
@param data input list of timephased data
@param type list type (planned or completed) | [
"Writes",
"a",
"list",
"of",
"timephased",
"data",
"to",
"the",
"MSPDI",
"file",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mspdi/MSPDIWriter.java#L1894-L1908 |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/AccessToken.java | AccessToken.createFromExistingAccessToken | public static AccessToken createFromExistingAccessToken(String accessToken, Date expirationTime,
Date lastRefreshTime, AccessTokenSource accessTokenSource, List<String> permissions) {
"""
Creates a new AccessToken using the supplied information from a previously-obtained access
token (for instance, fr... | java | public static AccessToken createFromExistingAccessToken(String accessToken, Date expirationTime,
Date lastRefreshTime, AccessTokenSource accessTokenSource, List<String> permissions) {
if (expirationTime == null) {
expirationTime = DEFAULT_EXPIRATION_TIME;
}
if (lastRefres... | [
"public",
"static",
"AccessToken",
"createFromExistingAccessToken",
"(",
"String",
"accessToken",
",",
"Date",
"expirationTime",
",",
"Date",
"lastRefreshTime",
",",
"AccessTokenSource",
"accessTokenSource",
",",
"List",
"<",
"String",
">",
"permissions",
")",
"{",
"i... | Creates a new AccessToken using the supplied information from a previously-obtained access
token (for instance, from an already-cached access token obtained prior to integration with the
Facebook SDK).
@param accessToken the access token string obtained from Facebook
@param expirationTime the expiration date ... | [
"Creates",
"a",
"new",
"AccessToken",
"using",
"the",
"supplied",
"information",
"from",
"a",
"previously",
"-",
"obtained",
"access",
"token",
"(",
"for",
"instance",
"from",
"an",
"already",
"-",
"cached",
"access",
"token",
"obtained",
"prior",
"to",
"integ... | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/AccessToken.java#L154-L167 |
alkacon/opencms-core | src/org/opencms/module/CmsModuleUpdater.java | CmsModuleUpdater.updateRelations | private void updateRelations(CmsObject cms, CmsResource importResource, List<RelationData> relations)
throws CmsException {
"""
Compares the relation (not defined in content) for a resource with those to be imported, and makes
the necessary modifications.
@param cms the CMS context
@param importResource t... | java | private void updateRelations(CmsObject cms, CmsResource importResource, List<RelationData> relations)
throws CmsException {
Map<String, CmsRelationType> relTypes = new HashMap<>();
for (CmsRelationType relType : OpenCms.getResourceManager().getRelationTypes()) {
relTypes.put(relType.get... | [
"private",
"void",
"updateRelations",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"importResource",
",",
"List",
"<",
"RelationData",
">",
"relations",
")",
"throws",
"CmsException",
"{",
"Map",
"<",
"String",
",",
"CmsRelationType",
">",
"relTypes",
"=",
"new"... | Compares the relation (not defined in content) for a resource with those to be imported, and makes
the necessary modifications.
@param cms the CMS context
@param importResource the resource
@param relations the relations to be imported
@throws CmsException if something goes wrong | [
"Compares",
"the",
"relation",
"(",
"not",
"defined",
"in",
"content",
")",
"for",
"a",
"resource",
"with",
"those",
"to",
"be",
"imported",
"and",
"makes",
"the",
"necessary",
"modifications",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/module/CmsModuleUpdater.java#L740-L776 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/collection/IterUtil.java | IterUtil.join | public static <T> String join(Iterator<T> iterator, CharSequence conjunction) {
"""
以 conjunction 为分隔符将集合转换为字符串<br>
如果集合元素为数组、{@link Iterable}或{@link Iterator},则递归组合其为字符串
@param <T> 集合元素类型
@param iterator 集合
@param conjunction 分隔符
@return 连接后的字符串
"""
return join(iterator, conjunction, null, null);
... | java | public static <T> String join(Iterator<T> iterator, CharSequence conjunction) {
return join(iterator, conjunction, null, null);
} | [
"public",
"static",
"<",
"T",
">",
"String",
"join",
"(",
"Iterator",
"<",
"T",
">",
"iterator",
",",
"CharSequence",
"conjunction",
")",
"{",
"return",
"join",
"(",
"iterator",
",",
"conjunction",
",",
"null",
",",
"null",
")",
";",
"}"
] | 以 conjunction 为分隔符将集合转换为字符串<br>
如果集合元素为数组、{@link Iterable}或{@link Iterator},则递归组合其为字符串
@param <T> 集合元素类型
@param iterator 集合
@param conjunction 分隔符
@return 连接后的字符串 | [
"以",
"conjunction",
"为分隔符将集合转换为字符串<br",
">",
"如果集合元素为数组、",
"{",
"@link",
"Iterable",
"}",
"或",
"{",
"@link",
"Iterator",
"}",
",则递归组合其为字符串"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/IterUtil.java#L296-L298 |
mapbox/mapbox-java | services-turf/src/main/java/com/mapbox/turf/TurfConversion.java | TurfConversion.radiansToLength | public static double radiansToLength(double radians, @NonNull @TurfUnitCriteria String units) {
"""
Convert a distance measurement (assuming a spherical Earth) from radians to a more friendly
unit.
@param radians a double using unit radian
@param units pass in one of the units defined in {@link TurfUnitCrit... | java | public static double radiansToLength(double radians, @NonNull @TurfUnitCriteria String units) {
return radians * FACTORS.get(units);
} | [
"public",
"static",
"double",
"radiansToLength",
"(",
"double",
"radians",
",",
"@",
"NonNull",
"@",
"TurfUnitCriteria",
"String",
"units",
")",
"{",
"return",
"radians",
"*",
"FACTORS",
".",
"get",
"(",
"units",
")",
";",
"}"
] | Convert a distance measurement (assuming a spherical Earth) from radians to a more friendly
unit.
@param radians a double using unit radian
@param units pass in one of the units defined in {@link TurfUnitCriteria}
@return converted radian to distance value
@since 1.2.0 | [
"Convert",
"a",
"distance",
"measurement",
"(",
"assuming",
"a",
"spherical",
"Earth",
")",
"from",
"radians",
"to",
"a",
"more",
"friendly",
"unit",
"."
] | train | https://github.com/mapbox/mapbox-java/blob/c0be138f462f91441388584c668f3760ba0e18e2/services-turf/src/main/java/com/mapbox/turf/TurfConversion.java#L103-L105 |
qiujuer/Genius-Android | caprice/ui/src/main/java/net/qiujuer/genius/ui/Ui.java | Ui.modulateColorAlpha | public static int modulateColorAlpha(int color, int alpha) {
"""
Modulate the color to new alpha
@param color Color
@param alpha Modulate alpha
@return Modulate alpha color
"""
int colorAlpha = color >>> 24;
int scale = alpha + (alpha >> 7);
int newAlpha = colorAlpha * scale >> 8;
... | java | public static int modulateColorAlpha(int color, int alpha) {
int colorAlpha = color >>> 24;
int scale = alpha + (alpha >> 7);
int newAlpha = colorAlpha * scale >> 8;
int r = (color >> 16) & 0xFF;
int g = (color >> 8) & 0xFF;
int b = color & 0xFF;
return newAlpha <... | [
"public",
"static",
"int",
"modulateColorAlpha",
"(",
"int",
"color",
",",
"int",
"alpha",
")",
"{",
"int",
"colorAlpha",
"=",
"color",
">>>",
"24",
";",
"int",
"scale",
"=",
"alpha",
"+",
"(",
"alpha",
">>",
"7",
")",
";",
"int",
"newAlpha",
"=",
"c... | Modulate the color to new alpha
@param color Color
@param alpha Modulate alpha
@return Modulate alpha color | [
"Modulate",
"the",
"color",
"to",
"new",
"alpha"
] | train | https://github.com/qiujuer/Genius-Android/blob/babefaf1321f5883a21cada582b6fa5104adc648/caprice/ui/src/main/java/net/qiujuer/genius/ui/Ui.java#L106-L114 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/data/conversion/provider/SimpleConversionService.java | SimpleConversionService.setDefaultValue | public <T> void setDefaultValue(Class<T> type, T defaultValue) {
"""
Sets the {@link Object default value} for the specified {@link Class type}.
@param <T> {@link Class classification/type} of objects which may have {@link Object default values}.
@param type {@link Class} type to define the {@link Object defau... | java | public <T> void setDefaultValue(Class<T> type, T defaultValue) {
Assert.notNull(type, "Class type is required");
this.defaultValues.put(type, defaultValue);
} | [
"public",
"<",
"T",
">",
"void",
"setDefaultValue",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"T",
"defaultValue",
")",
"{",
"Assert",
".",
"notNull",
"(",
"type",
",",
"\"Class type is required\"",
")",
";",
"this",
".",
"defaultValues",
".",
"put",
"("... | Sets the {@link Object default value} for the specified {@link Class type}.
@param <T> {@link Class classification/type} of objects which may have {@link Object default values}.
@param type {@link Class} type to define the {@link Object default value} for.
@param defaultValue {@link Object default value} to use for th... | [
"Sets",
"the",
"{",
"@link",
"Object",
"default",
"value",
"}",
"for",
"the",
"specified",
"{",
"@link",
"Class",
"type",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/data/conversion/provider/SimpleConversionService.java#L300-L303 |
joniles/mpxj | src/main/java/net/sf/mpxj/explorer/ProjectTreeController.java | ProjectTreeController.addCalendars | private void addCalendars(MpxjTreeNode parentNode, ProjectFile file) {
"""
Add calendars to the tree.
@param parentNode parent tree node
@param file calendar container
"""
for (ProjectCalendar calendar : file.getCalendars())
{
addCalendar(parentNode, calendar);
}
} | java | private void addCalendars(MpxjTreeNode parentNode, ProjectFile file)
{
for (ProjectCalendar calendar : file.getCalendars())
{
addCalendar(parentNode, calendar);
}
} | [
"private",
"void",
"addCalendars",
"(",
"MpxjTreeNode",
"parentNode",
",",
"ProjectFile",
"file",
")",
"{",
"for",
"(",
"ProjectCalendar",
"calendar",
":",
"file",
".",
"getCalendars",
"(",
")",
")",
"{",
"addCalendar",
"(",
"parentNode",
",",
"calendar",
")",... | Add calendars to the tree.
@param parentNode parent tree node
@param file calendar container | [
"Add",
"calendars",
"to",
"the",
"tree",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/explorer/ProjectTreeController.java#L243-L249 |
mijecu25/dsa | src/main/java/com/mijecu25/dsa/algorithms/search/logarithmic/BinarySearch.java | BinarySearch.searchDescending | public static int searchDescending(byte[] byteArray, byte value) {
"""
Search for the value in the reverse sorted byte array and return the index.
@param byteArray array that we are searching in.
@param value value that is being searched in the array.
@return the index where the value is found in the array,... | java | public static int searchDescending(byte[] byteArray, byte value) {
int start = 0;
int end = byteArray.length - 1;
int middle = 0;
while(start <= end) {
middle = (start + end) >> 1;
if(value == byteArray[middle]) {
return middle;
... | [
"public",
"static",
"int",
"searchDescending",
"(",
"byte",
"[",
"]",
"byteArray",
",",
"byte",
"value",
")",
"{",
"int",
"start",
"=",
"0",
";",
"int",
"end",
"=",
"byteArray",
".",
"length",
"-",
"1",
";",
"int",
"middle",
"=",
"0",
";",
"while",
... | Search for the value in the reverse sorted byte array and return the index.
@param byteArray array that we are searching in.
@param value value that is being searched in the array.
@return the index where the value is found in the array, else -1. | [
"Search",
"for",
"the",
"value",
"in",
"the",
"reverse",
"sorted",
"byte",
"array",
"and",
"return",
"the",
"index",
"."
] | train | https://github.com/mijecu25/dsa/blob/a22971b746833e78a3939ae4de65e8f6bf2e3fd4/src/main/java/com/mijecu25/dsa/algorithms/search/logarithmic/BinarySearch.java#L473-L495 |
joelittlejohn/jsonschema2pojo | jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/rules/NotRequiredRule.java | NotRequiredRule.apply | @Override
public JDocCommentable apply(String nodeName, JsonNode node, JsonNode parent, JDocCommentable generatableType, Schema schema) {
"""
Applies this schema rule to take the not required code generation steps.
<p>
The not required rule adds a Nullable annotation if JSR-305 annotations are desired.
@p... | java | @Override
public JDocCommentable apply(String nodeName, JsonNode node, JsonNode parent, JDocCommentable generatableType, Schema schema) {
// Since NotRequiredRule is executed for all fields that do not have "required" present,
// we need to recognize whether the field is part of the RequiredArrayRu... | [
"@",
"Override",
"public",
"JDocCommentable",
"apply",
"(",
"String",
"nodeName",
",",
"JsonNode",
"node",
",",
"JsonNode",
"parent",
",",
"JDocCommentable",
"generatableType",
",",
"Schema",
"schema",
")",
"{",
"// Since NotRequiredRule is executed for all fields that do... | Applies this schema rule to take the not required code generation steps.
<p>
The not required rule adds a Nullable annotation if JSR-305 annotations are desired.
@param nodeName
the name of the schema node for which this "required" rule has
been added
@param node
the "not required" node, having a value <code>false</co... | [
"Applies",
"this",
"schema",
"rule",
"to",
"take",
"the",
"not",
"required",
"code",
"generation",
"steps",
".",
"<p",
">",
"The",
"not",
"required",
"rule",
"adds",
"a",
"Nullable",
"annotation",
"if",
"JSR",
"-",
"305",
"annotations",
"are",
"desired",
"... | train | https://github.com/joelittlejohn/jsonschema2pojo/blob/0552b80db93214eb186e4ae45b40866cc1e7eb84/jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/rules/NotRequiredRule.java#L67-L90 |
cdk/cdk | display/renderawt/src/main/java/org/openscience/cdk/renderer/visitor/AbstractAWTDrawVisitor.java | AbstractAWTDrawVisitor.getTextBounds | protected Rectangle2D getTextBounds(String text, Graphics2D g2) {
"""
Obtain the exact bounding box of the {@code text} in the provided
graphics environment.
@param text the text to obtain the bounds of
@param g2 the graphic environment
@return bounds of the text
@see TextLayout
"""
return new... | java | protected Rectangle2D getTextBounds(String text, Graphics2D g2) {
return new TextLayout(text, g2.getFont(), g2.getFontRenderContext()).getBounds();
} | [
"protected",
"Rectangle2D",
"getTextBounds",
"(",
"String",
"text",
",",
"Graphics2D",
"g2",
")",
"{",
"return",
"new",
"TextLayout",
"(",
"text",
",",
"g2",
".",
"getFont",
"(",
")",
",",
"g2",
".",
"getFontRenderContext",
"(",
")",
")",
".",
"getBounds",... | Obtain the exact bounding box of the {@code text} in the provided
graphics environment.
@param text the text to obtain the bounds of
@param g2 the graphic environment
@return bounds of the text
@see TextLayout | [
"Obtain",
"the",
"exact",
"bounding",
"box",
"of",
"the",
"{",
"@code",
"text",
"}",
"in",
"the",
"provided",
"graphics",
"environment",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderawt/src/main/java/org/openscience/cdk/renderer/visitor/AbstractAWTDrawVisitor.java#L120-L122 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/jdbc/WSJdbcResultSet.java | WSJdbcResultSet.updateArray | public void updateArray(int i, java.sql.Array array) throws SQLException {
"""
<p>Updates the designated column with a java.sql.Array value. The updater methods
are used to update column values in the current row or the insert row. The updater
methods do not update the underlying database; instead the updateRow ... | java | public void updateArray(int i, java.sql.Array array) throws SQLException {
try {
rsetImpl.updateArray(i, array);
} catch (SQLException ex) {
FFDCFilter.processException(ex, "com.ibm.ws.rsadapter.jdbc.WSJdbcResultSet.updateArray", "3993", this);
throw WSJdbcUtil.mapE... | [
"public",
"void",
"updateArray",
"(",
"int",
"i",
",",
"java",
".",
"sql",
".",
"Array",
"array",
")",
"throws",
"SQLException",
"{",
"try",
"{",
"rsetImpl",
".",
"updateArray",
"(",
"i",
",",
"array",
")",
";",
"}",
"catch",
"(",
"SQLException",
"ex",... | <p>Updates the designated column with a java.sql.Array value. The updater methods
are used to update column values in the current row or the insert row. The updater
methods do not update the underlying database; instead the updateRow or insertRow
methods are called to update the database. </p>
@param columnIndex the f... | [
"<p",
">",
"Updates",
"the",
"designated",
"column",
"with",
"a",
"java",
".",
"sql",
".",
"Array",
"value",
".",
"The",
"updater",
"methods",
"are",
"used",
"to",
"update",
"column",
"values",
"in",
"the",
"current",
"row",
"or",
"the",
"insert",
"row",... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jdbc/src/com/ibm/ws/rsadapter/jdbc/WSJdbcResultSet.java#L4567-L4578 |
elibom/jogger | src/main/java/com/elibom/jogger/util/Preconditions.java | Preconditions.notEmpty | public static void notEmpty(String value, String message) throws IllegalArgumentException {
"""
Checks that a string is not null or empty.
@param value the string to be tested.
@param message the message for the exception in case the string is empty.
@throws IllegalArgumentException if the string is empty.
... | java | public static void notEmpty(String value, String message) throws IllegalArgumentException {
if (value == null || "".equals(value.trim())) {
throw new IllegalArgumentException("A precondition failed: " + message);
}
} | [
"public",
"static",
"void",
"notEmpty",
"(",
"String",
"value",
",",
"String",
"message",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"value",
"==",
"null",
"||",
"\"\"",
".",
"equals",
"(",
"value",
".",
"trim",
"(",
")",
")",
")",
"{",
... | Checks that a string is not null or empty.
@param value the string to be tested.
@param message the message for the exception in case the string is empty.
@throws IllegalArgumentException if the string is empty. | [
"Checks",
"that",
"a",
"string",
"is",
"not",
"null",
"or",
"empty",
"."
] | train | https://github.com/elibom/jogger/blob/d5892ff45e76328d444a68b5a38c26e7bdd0692b/src/main/java/com/elibom/jogger/util/Preconditions.java#L37-L41 |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/matrix/TransformStatistics.java | TransformStatistics.extractStatistics | public static MatrixStatistics extractStatistics(
File inputMatrixFile,
Format format,
boolean countRowOccurrances,
boolean countColumnOccurrances) {
"""
Extracts the row, column, and matrix summations based on entries in
the given {@link Matrix}. If {@code countRo... | java | public static MatrixStatistics extractStatistics(
File inputMatrixFile,
Format format,
boolean countRowOccurrances,
boolean countColumnOccurrances) {
// Initialize the statistics.
int numColumns = 0;
int numRows = 0;
double matrixSum = 0;
... | [
"public",
"static",
"MatrixStatistics",
"extractStatistics",
"(",
"File",
"inputMatrixFile",
",",
"Format",
"format",
",",
"boolean",
"countRowOccurrances",
",",
"boolean",
"countColumnOccurrances",
")",
"{",
"// Initialize the statistics.",
"int",
"numColumns",
"=",
"0",... | Extracts the row, column, and matrix summations based on entries in
the given {@link Matrix}. If {@code countRowOccurrances} is true, the
number of non zeros in each row will be counted for the row summation.
If {@code countColumnOccurrances} is true, the same will be done for the
columns. In either case, the matrix ... | [
"Extracts",
"the",
"row",
"column",
"and",
"matrix",
"summations",
"based",
"on",
"entries",
"in",
"the",
"given",
"{",
"@link",
"Matrix",
"}",
".",
"If",
"{",
"@code",
"countRowOccurrances",
"}",
"is",
"true",
"the",
"number",
"of",
"non",
"zeros",
"in",
... | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/matrix/TransformStatistics.java#L144-L198 |
agmip/translator-dssat | src/main/java/org/agmip/translators/dssat/DssatCommonOutput.java | DssatCommonOutput.formatDateStr | protected static String formatDateStr(String startDate, String strDays) {
"""
Translate data str from "yyyymmdd" to "yyddd" plus days you want
@param startDate date string with format of "yyyymmdd"
@param strDays the number of days need to be added on
@return result date string with format of "yyddd"
"""
... | java | protected static String formatDateStr(String startDate, String strDays) {
// Initial Calendar object
Calendar cal = Calendar.getInstance();
int days;
startDate = startDate.replaceAll("/", "");
try {
days = Double.valueOf(strDays).intValue();
// Set date w... | [
"protected",
"static",
"String",
"formatDateStr",
"(",
"String",
"startDate",
",",
"String",
"strDays",
")",
"{",
"// Initial Calendar object",
"Calendar",
"cal",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"int",
"days",
";",
"startDate",
"=",
"startDat... | Translate data str from "yyyymmdd" to "yyddd" plus days you want
@param startDate date string with format of "yyyymmdd"
@param strDays the number of days need to be added on
@return result date string with format of "yyddd" | [
"Translate",
"data",
"str",
"from",
"yyyymmdd",
"to",
"yyddd",
"plus",
"days",
"you",
"want"
] | train | https://github.com/agmip/translator-dssat/blob/4be61d998f106eb7234ea8701b63c3746ae688f4/src/main/java/org/agmip/translators/dssat/DssatCommonOutput.java#L152-L171 |
google/closure-templates | java/src/com/google/template/soy/jssrc/internal/GenJsCodeVisitorAssistantForMsgs.java | GenJsCodeVisitorAssistantForMsgs.getMessageFormatCall | private static Expression getMessageFormatCall(GoogMsgCodeGenInfo codeGenInfo) {
"""
Generates the {@code goog.i18n.MessageFormat} postprocessing call for a child plural/select
message.
"""
return construct(GOOG_I18N_MESSAGE_FORMAT, codeGenInfo.googMsgVar)
.dotAccess("formatIgnoringPound")
... | java | private static Expression getMessageFormatCall(GoogMsgCodeGenInfo codeGenInfo) {
return construct(GOOG_I18N_MESSAGE_FORMAT, codeGenInfo.googMsgVar)
.dotAccess("formatIgnoringPound")
.call(codeGenInfo.placeholders);
} | [
"private",
"static",
"Expression",
"getMessageFormatCall",
"(",
"GoogMsgCodeGenInfo",
"codeGenInfo",
")",
"{",
"return",
"construct",
"(",
"GOOG_I18N_MESSAGE_FORMAT",
",",
"codeGenInfo",
".",
"googMsgVar",
")",
".",
"dotAccess",
"(",
"\"formatIgnoringPound\"",
")",
".",... | Generates the {@code goog.i18n.MessageFormat} postprocessing call for a child plural/select
message. | [
"Generates",
"the",
"{"
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jssrc/internal/GenJsCodeVisitorAssistantForMsgs.java#L375-L379 |
fabric8io/fabric8-forge | addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelXmlHelper.java | CamelXmlHelper.dumpModelAsXml | public static String dumpModelAsXml(Object definition, ClassLoader classLoader, boolean includeEndTag, int indent) throws JAXBException, XMLStreamException {
"""
Dumps the definition as XML
@param definition the definition, such as a {@link org.apache.camel.NamedNode}
@param classLoader the class loader
@ret... | java | public static String dumpModelAsXml(Object definition, ClassLoader classLoader, boolean includeEndTag, int indent) throws JAXBException, XMLStreamException {
JAXBContext jaxbContext = JAXBContext.newInstance(JAXB_CONTEXT_PACKAGES, classLoader);
StringWriter buffer = new StringWriter();
// we d... | [
"public",
"static",
"String",
"dumpModelAsXml",
"(",
"Object",
"definition",
",",
"ClassLoader",
"classLoader",
",",
"boolean",
"includeEndTag",
",",
"int",
"indent",
")",
"throws",
"JAXBException",
",",
"XMLStreamException",
"{",
"JAXBContext",
"jaxbContext",
"=",
... | Dumps the definition as XML
@param definition the definition, such as a {@link org.apache.camel.NamedNode}
@param classLoader the class loader
@return the output in XML (is formatted)
@throws JAXBException is throw if error marshalling to XML | [
"Dumps",
"the",
"definition",
"as",
"XML"
] | train | https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelXmlHelper.java#L434-L475 |
CloudSlang/cs-actions | cs-powershell/src/main/java/io/cloudslang/content/services/WSManRemoteShellService.java | WSManRemoteShellService.buildResultFromResponseStreams | private String buildResultFromResponseStreams(String response, OutputStream outputStream) throws ParserConfigurationException, SAXException, XPathExpressionException, IOException {
"""
Constructs the executed command response from multiple streams of data containing the encoded result of the execution.
@param r... | java | private String buildResultFromResponseStreams(String response, OutputStream outputStream) throws ParserConfigurationException, SAXException, XPathExpressionException, IOException {
StringBuilder commandResult = new StringBuilder();
int noOfStreams = WSManUtils.countStreamElements(response);
for ... | [
"private",
"String",
"buildResultFromResponseStreams",
"(",
"String",
"response",
",",
"OutputStream",
"outputStream",
")",
"throws",
"ParserConfigurationException",
",",
"SAXException",
",",
"XPathExpressionException",
",",
"IOException",
"{",
"StringBuilder",
"commandResult... | Constructs the executed command response from multiple streams of data containing the encoded result of the execution.
@param response
@param outputStream
@return the decoded result of the command in a string.
@throws ParserConfigurationException
@throws SAXException
@throws XPathExpressionException
@throws IOExceptio... | [
"Constructs",
"the",
"executed",
"command",
"response",
"from",
"multiple",
"streams",
"of",
"data",
"containing",
"the",
"encoded",
"result",
"of",
"the",
"execution",
"."
] | train | https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-powershell/src/main/java/io/cloudslang/content/services/WSManRemoteShellService.java#L362-L372 |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/preferences/ExtraLanguagePreferenceAccess.java | ExtraLanguagePreferenceAccess.parseConverterPreferenceValue | public static boolean parseConverterPreferenceValue(String input, Procedure2<? super String, ? super String> output) {
"""
Parse the given input which is the preference string representation.
@param input the string representation from the preferences.
@param output the function to call for saving the parsed e... | java | public static boolean parseConverterPreferenceValue(String input, Procedure2<? super String, ? super String> output) {
final StringTokenizer tokenizer = new StringTokenizer(input, PREFERENCE_SEPARATOR);
String key = null;
boolean foundValue = false;
while (tokenizer.hasMoreTokens()) {
final String token = to... | [
"public",
"static",
"boolean",
"parseConverterPreferenceValue",
"(",
"String",
"input",
",",
"Procedure2",
"<",
"?",
"super",
"String",
",",
"?",
"super",
"String",
">",
"output",
")",
"{",
"final",
"StringTokenizer",
"tokenizer",
"=",
"new",
"StringTokenizer",
... | Parse the given input which is the preference string representation.
@param input the string representation from the preferences.
@param output the function to call for saving the parsed element. The first parameter is the element to be
converted. The second parameter is the target string.
@return {@code true} if a da... | [
"Parse",
"the",
"given",
"input",
"which",
"is",
"the",
"preference",
"string",
"representation",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/extralanguage/preferences/ExtraLanguagePreferenceAccess.java#L271-L286 |
racc/typesafeconfig-guice | src/main/java/com/github/racc/tscg/TypesafeConfigModule.java | TypesafeConfigModule.fromConfigWithPackage | public static TypesafeConfigModule fromConfigWithPackage(Config config, String packageNamePrefix) {
"""
Scans the specified packages for annotated classes, and applies Config values to them.
@param config the Config to derive values from
@param packageNamePrefix the prefix to limit scanning to - e.g. "com.gith... | java | public static TypesafeConfigModule fromConfigWithPackage(Config config, String packageNamePrefix) {
Reflections reflections = createPackageScanningReflections(packageNamePrefix);
return fromConfigWithReflections(config, reflections);
} | [
"public",
"static",
"TypesafeConfigModule",
"fromConfigWithPackage",
"(",
"Config",
"config",
",",
"String",
"packageNamePrefix",
")",
"{",
"Reflections",
"reflections",
"=",
"createPackageScanningReflections",
"(",
"packageNamePrefix",
")",
";",
"return",
"fromConfigWithRe... | Scans the specified packages for annotated classes, and applies Config values to them.
@param config the Config to derive values from
@param packageNamePrefix the prefix to limit scanning to - e.g. "com.github"
@return The constructed TypesafeConfigModule. | [
"Scans",
"the",
"specified",
"packages",
"for",
"annotated",
"classes",
"and",
"applies",
"Config",
"values",
"to",
"them",
"."
] | train | https://github.com/racc/typesafeconfig-guice/blob/95e383ced94fe59f4a651d043f9d1764bc618a94/src/main/java/com/github/racc/tscg/TypesafeConfigModule.java#L77-L80 |
jcustenborder/connect-utils | connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/validators/Validators.java | Validators.validHostAndPort | public static Validator validHostAndPort(Integer defaultPort, boolean requireBracketsForIPv6, boolean portRequired) {
"""
Validator to ensure that a configuration setting is a hostname and port.
@param defaultPort
@param requireBracketsForIPv6
@param portRequired
@return validator
"""
return ValidHos... | java | public static Validator validHostAndPort(Integer defaultPort, boolean requireBracketsForIPv6, boolean portRequired) {
return ValidHostAndPort.of(defaultPort, requireBracketsForIPv6, portRequired);
} | [
"public",
"static",
"Validator",
"validHostAndPort",
"(",
"Integer",
"defaultPort",
",",
"boolean",
"requireBracketsForIPv6",
",",
"boolean",
"portRequired",
")",
"{",
"return",
"ValidHostAndPort",
".",
"of",
"(",
"defaultPort",
",",
"requireBracketsForIPv6",
",",
"po... | Validator to ensure that a configuration setting is a hostname and port.
@param defaultPort
@param requireBracketsForIPv6
@param portRequired
@return validator | [
"Validator",
"to",
"ensure",
"that",
"a",
"configuration",
"setting",
"is",
"a",
"hostname",
"and",
"port",
"."
] | train | https://github.com/jcustenborder/connect-utils/blob/19add138921f59ffcc85282d7aad551eeb582370/connect-utils/src/main/java/com/github/jcustenborder/kafka/connect/utils/config/validators/Validators.java#L182-L184 |
mapbox/mapbox-navigation-android | libandroid-navigation-ui/src/main/java/com/mapbox/services/android/navigation/ui/v5/instruction/InstructionView.java | InstructionView.updateDistanceWith | public void updateDistanceWith(RouteProgress routeProgress) {
"""
Use this method inside a {@link ProgressChangeListener} to update this view with all other information
that is not updated by the {@link InstructionView#updateBannerInstructionsWith(Milestone)}.
<p>
This includes the distance remaining, instructi... | java | public void updateDistanceWith(RouteProgress routeProgress) {
if (routeProgress != null && !isRerouting) {
InstructionModel model = new InstructionModel(distanceFormatter, routeProgress);
updateDataFromInstruction(model);
}
} | [
"public",
"void",
"updateDistanceWith",
"(",
"RouteProgress",
"routeProgress",
")",
"{",
"if",
"(",
"routeProgress",
"!=",
"null",
"&&",
"!",
"isRerouting",
")",
"{",
"InstructionModel",
"model",
"=",
"new",
"InstructionModel",
"(",
"distanceFormatter",
",",
"rout... | Use this method inside a {@link ProgressChangeListener} to update this view with all other information
that is not updated by the {@link InstructionView#updateBannerInstructionsWith(Milestone)}.
<p>
This includes the distance remaining, instruction list, turn lanes, and next step information.
@param routeProgress for ... | [
"Use",
"this",
"method",
"inside",
"a",
"{",
"@link",
"ProgressChangeListener",
"}",
"to",
"update",
"this",
"view",
"with",
"all",
"other",
"information",
"that",
"is",
"not",
"updated",
"by",
"the",
"{",
"@link",
"InstructionView#updateBannerInstructionsWith",
"... | train | https://github.com/mapbox/mapbox-navigation-android/blob/375a89c017d360b9defc2c90d0c03468165162ec/libandroid-navigation-ui/src/main/java/com/mapbox/services/android/navigation/ui/v5/instruction/InstructionView.java#L229-L234 |
NoraUi/NoraUi | src/main/java/com/github/noraui/application/steps/RESTSteps.java | RESTSteps.saveValue | @Conditioned
@Et("Je sauvegarde la valeur de cette API REST '(.*)' '(.*)' '(.*)' dans '(.*)' du contexte[\\.|\\?]")
@And("I save the value of REST API '(.*)' '(.*)' '(.*)' in '(.*)' context key[\\.|\\?]")
public void saveValue(String method, String pageKey, String uri, String targetKey, List<GherkinStepCond... | java | @Conditioned
@Et("Je sauvegarde la valeur de cette API REST '(.*)' '(.*)' '(.*)' dans '(.*)' du contexte[\\.|\\?]")
@And("I save the value of REST API '(.*)' '(.*)' '(.*)' in '(.*)' context key[\\.|\\?]")
public void saveValue(String method, String pageKey, String uri, String targetKey, List<GherkinStepCond... | [
"@",
"Conditioned",
"@",
"Et",
"(",
"\"Je sauvegarde la valeur de cette API REST '(.*)' '(.*)' '(.*)' dans '(.*)' du contexte[\\\\.|\\\\?]\"",
")",
"@",
"And",
"(",
"\"I save the value of REST API '(.*)' '(.*)' '(.*)' in '(.*)' context key[\\\\.|\\\\?]\"",
")",
"public",
"void",
"saveVal... | Save result of REST API in memory if all 'expected' parameters equals 'actual' parameters in conditions.
@param method
GET or POST
@param pageKey
is the key of page (example: GOOGLE_HOME)
@param uri
end of the url
@param targetKey
Target key to save retrieved value.
@param conditions
List of 'expected' values conditio... | [
"Save",
"result",
"of",
"REST",
"API",
"in",
"memory",
"if",
"all",
"expected",
"parameters",
"equals",
"actual",
"parameters",
"in",
"conditions",
"."
] | train | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/application/steps/RESTSteps.java#L61-L77 |
elki-project/elki | elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/datastore/DataStoreUtil.java | DataStoreUtil.makeRecordStorage | public static WritableRecordStore makeRecordStorage(DBIDs ids, int hints, Class<?>... dataclasses) {
"""
Make a new record storage, to associate the given ids with an object of
class dataclass.
@param ids DBIDs to store data for
@param hints Hints for the storage manager
@param dataclasses classes to store
... | java | public static WritableRecordStore makeRecordStorage(DBIDs ids, int hints, Class<?>... dataclasses) {
return DataStoreFactory.FACTORY.makeRecordStorage(ids, hints, dataclasses);
} | [
"public",
"static",
"WritableRecordStore",
"makeRecordStorage",
"(",
"DBIDs",
"ids",
",",
"int",
"hints",
",",
"Class",
"<",
"?",
">",
"...",
"dataclasses",
")",
"{",
"return",
"DataStoreFactory",
".",
"FACTORY",
".",
"makeRecordStorage",
"(",
"ids",
",",
"hin... | Make a new record storage, to associate the given ids with an object of
class dataclass.
@param ids DBIDs to store data for
@param hints Hints for the storage manager
@param dataclasses classes to store
@return new record store | [
"Make",
"a",
"new",
"record",
"storage",
"to",
"associate",
"the",
"given",
"ids",
"with",
"an",
"object",
"of",
"class",
"dataclass",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-dbids/src/main/java/de/lmu/ifi/dbs/elki/database/datastore/DataStoreUtil.java#L138-L140 |
voldemort/voldemort | src/java/voldemort/store/bdb/BdbNativeBackup.java | BdbNativeBackup.verifiedCopyFile | private void verifiedCopyFile(File sourceFile, File destFile) throws IOException {
"""
Copies the jdb log files, with additional verification of the checksums.
@param sourceFile
@param destFile
@throws IOException
"""
if(!destFile.exists()) {
destFile.createNewFile();
}
... | java | private void verifiedCopyFile(File sourceFile, File destFile) throws IOException {
if(!destFile.exists()) {
destFile.createNewFile();
}
FileInputStream source = null;
FileOutputStream destination = null;
LogVerificationInputStream verifyStream = null;
try {
... | [
"private",
"void",
"verifiedCopyFile",
"(",
"File",
"sourceFile",
",",
"File",
"destFile",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"destFile",
".",
"exists",
"(",
")",
")",
"{",
"destFile",
".",
"createNewFile",
"(",
")",
";",
"}",
"FileInputStr... | Copies the jdb log files, with additional verification of the checksums.
@param sourceFile
@param destFile
@throws IOException | [
"Copies",
"the",
"jdb",
"log",
"files",
"with",
"additional",
"verification",
"of",
"the",
"checksums",
"."
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/store/bdb/BdbNativeBackup.java#L264-L295 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.