repository_name stringlengths 7 54 | func_path_in_repository stringlengths 18 218 | func_name stringlengths 5 140 | whole_func_string stringlengths 79 3.99k | language stringclasses 1
value | func_code_string stringlengths 79 3.99k | func_code_tokens listlengths 20 624 | func_documentation_string stringlengths 61 1.96k | func_documentation_tokens listlengths 1 478 | split_name stringclasses 1
value | func_code_url stringlengths 107 339 |
|---|---|---|---|---|---|---|---|---|---|---|
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.getAt | @SuppressWarnings("unchecked")
public static List<Double> getAt(double[] array, Range range) {
return primitiveArrayGet(array, range);
} | java | @SuppressWarnings("unchecked")
public static List<Double> getAt(double[] array, Range range) {
return primitiveArrayGet(array, range);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"List",
"<",
"Double",
">",
"getAt",
"(",
"double",
"[",
"]",
"array",
",",
"Range",
"range",
")",
"{",
"return",
"primitiveArrayGet",
"(",
"array",
",",
"range",
")",
";",
"}"
] | Support the subscript operator with a range for a double array
@param array a double array
@param range a range indicating the indices for the items to retrieve
@return list of the retrieved doubles
@since 1.0 | [
"Support",
"the",
"subscript",
"operator",
"with",
"a",
"range",
"for",
"a",
"double",
"array"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L13688-L13691 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/slim/MapFixture.java | MapFixture.sizeOfIn | public int sizeOfIn(String expr, Map<String, Object> map) {
return getMapHelper().sizeOfIn(expr, map);
} | java | public int sizeOfIn(String expr, Map<String, Object> map) {
return getMapHelper().sizeOfIn(expr, map);
} | [
"public",
"int",
"sizeOfIn",
"(",
"String",
"expr",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
")",
"{",
"return",
"getMapHelper",
"(",
")",
".",
"sizeOfIn",
"(",
"expr",
",",
"map",
")",
";",
"}"
] | Determines size of either (Map or Collection) value in the map.
@param expr expression indicating which (possibly nested) value in the map to determine size of.
@param map map to find value in.
@return size of value.
@throws SlimFixtureException if the value found is not a Map or Collection. | [
"Determines",
"size",
"of",
"either",
"(",
"Map",
"or",
"Collection",
")",
"value",
"in",
"the",
"map",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/slim/MapFixture.java#L158-L160 |
facebook/fresco | samples/zoomable/src/main/java/com/facebook/samples/zoomable/DefaultZoomableController.java | DefaultZoomableController.zoomToPoint | public void zoomToPoint(float scale, PointF imagePoint, PointF viewPoint) {
FLog.v(TAG, "zoomToPoint");
calculateZoomToPointTransform(mActiveTransform, scale, imagePoint, viewPoint, LIMIT_ALL);
onTransformChanged();
} | java | public void zoomToPoint(float scale, PointF imagePoint, PointF viewPoint) {
FLog.v(TAG, "zoomToPoint");
calculateZoomToPointTransform(mActiveTransform, scale, imagePoint, viewPoint, LIMIT_ALL);
onTransformChanged();
} | [
"public",
"void",
"zoomToPoint",
"(",
"float",
"scale",
",",
"PointF",
"imagePoint",
",",
"PointF",
"viewPoint",
")",
"{",
"FLog",
".",
"v",
"(",
"TAG",
",",
"\"zoomToPoint\"",
")",
";",
"calculateZoomToPointTransform",
"(",
"mActiveTransform",
",",
"scale",
"... | Zooms to the desired scale and positions the image so that the given image point corresponds
to the given view point.
@param scale desired scale, will be limited to {min, max} scale factor
@param imagePoint 2D point in image's relative coordinate system (i.e. 0 <= x, y <= 1)
@param viewPoint 2D point in view's absolut... | [
"Zooms",
"to",
"the",
"desired",
"scale",
"and",
"positions",
"the",
"image",
"so",
"that",
"the",
"given",
"image",
"point",
"corresponds",
"to",
"the",
"given",
"view",
"point",
"."
] | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/samples/zoomable/src/main/java/com/facebook/samples/zoomable/DefaultZoomableController.java#L347-L351 |
blinkfox/zealot | src/main/java/com/blinkfox/zealot/core/ZealotKhala.java | ZealotKhala.doLike | private ZealotKhala doLike(String prefix, String field, Object value, boolean match, boolean positive) {
if (match) {
String suffix = positive ? ZealotConst.LIKE_KEY : ZealotConst.NOT_LIKE_KEY;
SqlInfoBuilder.newInstace(this.source.setPrefix(prefix).setSuffix(suffix)).buildLikeSql(field,... | java | private ZealotKhala doLike(String prefix, String field, Object value, boolean match, boolean positive) {
if (match) {
String suffix = positive ? ZealotConst.LIKE_KEY : ZealotConst.NOT_LIKE_KEY;
SqlInfoBuilder.newInstace(this.source.setPrefix(prefix).setSuffix(suffix)).buildLikeSql(field,... | [
"private",
"ZealotKhala",
"doLike",
"(",
"String",
"prefix",
",",
"String",
"field",
",",
"Object",
"value",
",",
"boolean",
"match",
",",
"boolean",
"positive",
")",
"{",
"if",
"(",
"match",
")",
"{",
"String",
"suffix",
"=",
"positive",
"?",
"ZealotConst... | 执行生成like模糊查询SQL片段的方法.
@param prefix 前缀
@param field 数据库字段
@param value 值
@param match 是否匹配
@param positive true则表示是like,否则是not like
@return ZealotKhala实例的当前实例 | [
"执行生成like模糊查询SQL片段的方法",
"."
] | train | https://github.com/blinkfox/zealot/blob/21b00fa3e4ed42188eef3116d494e112e7a4194c/src/main/java/com/blinkfox/zealot/core/ZealotKhala.java#L392-L399 |
youngmonkeys/ezyfox-sfs2x | src/main/java/com/tvd12/ezyfox/sfs2x/serializer/ParameterSerializer.java | ParameterSerializer.parseArrayCollection | @SuppressWarnings("rawtypes")
protected ISFSArray parseArrayCollection(GetterMethodCover method,
Collection collection) {
ISFSArray result = new SFSArray();
SFSDataType dataType = ParamTypeParser
.getParamType(method.getGenericType());
Class<?> type = method.getGe... | java | @SuppressWarnings("rawtypes")
protected ISFSArray parseArrayCollection(GetterMethodCover method,
Collection collection) {
ISFSArray result = new SFSArray();
SFSDataType dataType = ParamTypeParser
.getParamType(method.getGenericType());
Class<?> type = method.getGe... | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"protected",
"ISFSArray",
"parseArrayCollection",
"(",
"GetterMethodCover",
"method",
",",
"Collection",
"collection",
")",
"{",
"ISFSArray",
"result",
"=",
"new",
"SFSArray",
"(",
")",
";",
"SFSDataType",
"dataType... | Serialize collection of array to a SFSArray
@param method structure of getter method
@param collection collection of objects
@return the SFSArray | [
"Serialize",
"collection",
"of",
"array",
"to",
"a",
"SFSArray"
] | train | https://github.com/youngmonkeys/ezyfox-sfs2x/blob/7e004033a3b551c3ae970a0c8f45db7b1ec144de/src/main/java/com/tvd12/ezyfox/sfs2x/serializer/ParameterSerializer.java#L368-L392 |
wisdom-framework/wisdom | core/application-configuration/src/main/java/org/wisdom/configuration/ConfigurationImpl.java | ConfigurationImpl.getDoubleWithDefault | @Override
public Double getDoubleWithDefault(final String key, Double defaultValue) {
return retrieve(new Callable<Double>() {
@Override
public Double call() throws Exception {
return configuration.getDouble(key);
}
}, defaultValue);
} | java | @Override
public Double getDoubleWithDefault(final String key, Double defaultValue) {
return retrieve(new Callable<Double>() {
@Override
public Double call() throws Exception {
return configuration.getDouble(key);
}
}, defaultValue);
} | [
"@",
"Override",
"public",
"Double",
"getDoubleWithDefault",
"(",
"final",
"String",
"key",
",",
"Double",
"defaultValue",
")",
"{",
"return",
"retrieve",
"(",
"new",
"Callable",
"<",
"Double",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Double",
"call",... | Get a Double 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",
"Double",
"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#L193-L201 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncMembersInner.java | SyncMembersInner.beginRefreshMemberSchemaAsync | public Observable<Void> beginRefreshMemberSchemaAsync(String resourceGroupName, String serverName, String databaseName, String syncGroupName, String syncMemberName) {
return beginRefreshMemberSchemaWithServiceResponseAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName).map(new Func1... | java | public Observable<Void> beginRefreshMemberSchemaAsync(String resourceGroupName, String serverName, String databaseName, String syncGroupName, String syncMemberName) {
return beginRefreshMemberSchemaWithServiceResponseAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName).map(new Func1... | [
"public",
"Observable",
"<",
"Void",
">",
"beginRefreshMemberSchemaAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"String",
"syncGroupName",
",",
"String",
"syncMemberName",
")",
"{",
"return",
"beginRefres... | Refreshes a sync member database schema.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database on which the sync group is hos... | [
"Refreshes",
"a",
"sync",
"member",
"database",
"schema",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncMembersInner.java#L1271-L1278 |
acromusashi/acromusashi-stream | src/main/java/acromusashi/stream/topology/BaseTridentTopology.java | BaseTridentTopology.submitTopology | public void submitTopology(StormTopology topology, boolean isLocal) throws Exception
{
if (isLocal)
{
// ローカル環境で実行
LocalCluster cluster = new LocalCluster();
cluster.submitTopology(this.topologyName, this.config, topology);
}
else
{
... | java | public void submitTopology(StormTopology topology, boolean isLocal) throws Exception
{
if (isLocal)
{
// ローカル環境で実行
LocalCluster cluster = new LocalCluster();
cluster.submitTopology(this.topologyName, this.config, topology);
}
else
{
... | [
"public",
"void",
"submitTopology",
"(",
"StormTopology",
"topology",
",",
"boolean",
"isLocal",
")",
"throws",
"Exception",
"{",
"if",
"(",
"isLocal",
")",
"{",
"// ローカル環境で実行",
"LocalCluster",
"cluster",
"=",
"new",
"LocalCluster",
"(",
")",
";",
"cluster",
"... | Topologyを実行する。
@param topology StormTopology
@param isLocal true:ローカルモード、false:分散モード
@throws Exception Topology実行失敗時 | [
"Topologyを実行する。"
] | train | https://github.com/acromusashi/acromusashi-stream/blob/65b1f335d771d657c5640a2056ab5c8546eddec9/src/main/java/acromusashi/stream/topology/BaseTridentTopology.java#L66-L87 |
bazaarvoice/emodb | common/stash/src/main/java/com/bazaarvoice/emodb/common/stash/StandardStashReader.java | StandardStashReader.getLockedView | public StashReader getLockedView() {
return new FixedStashReader(URI.create(String.format("s3://%s/%s", _bucket, getRootPath())), _s3);
} | java | public StashReader getLockedView() {
return new FixedStashReader(URI.create(String.format("s3://%s/%s", _bucket, getRootPath())), _s3);
} | [
"public",
"StashReader",
"getLockedView",
"(",
")",
"{",
"return",
"new",
"FixedStashReader",
"(",
"URI",
".",
"create",
"(",
"String",
".",
"format",
"(",
"\"s3://%s/%s\"",
",",
"_bucket",
",",
"getRootPath",
"(",
")",
")",
")",
",",
"_s3",
")",
";",
"}... | Returns a new StashReader that is locked to the same stash time the instance is currently using. Future calls to
lock or unlock the stash time on this instance will not affect the returned instance. | [
"Returns",
"a",
"new",
"StashReader",
"that",
"is",
"locked",
"to",
"the",
"same",
"stash",
"time",
"the",
"instance",
"is",
"currently",
"using",
".",
"Future",
"calls",
"to",
"lock",
"or",
"unlock",
"the",
"stash",
"time",
"on",
"this",
"instance",
"will... | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/common/stash/src/main/java/com/bazaarvoice/emodb/common/stash/StandardStashReader.java#L194-L196 |
google/gson | proto/src/main/java/com/google/gson/protobuf/ProtoTypeAdapter.java | ProtoTypeAdapter.getCustSerializedName | private String getCustSerializedName(FieldOptions options, String defaultName) {
for (Extension<FieldOptions, String> extension : serializedNameExtensions) {
if (options.hasExtension(extension)) {
return options.getExtension(extension);
}
}
return protoFormat.to(jsonFormat, defaultName);... | java | private String getCustSerializedName(FieldOptions options, String defaultName) {
for (Extension<FieldOptions, String> extension : serializedNameExtensions) {
if (options.hasExtension(extension)) {
return options.getExtension(extension);
}
}
return protoFormat.to(jsonFormat, defaultName);... | [
"private",
"String",
"getCustSerializedName",
"(",
"FieldOptions",
"options",
",",
"String",
"defaultName",
")",
"{",
"for",
"(",
"Extension",
"<",
"FieldOptions",
",",
"String",
">",
"extension",
":",
"serializedNameExtensions",
")",
"{",
"if",
"(",
"options",
... | Retrieves the custom field name from the given options, and if not found, returns the specified
default name. | [
"Retrieves",
"the",
"custom",
"field",
"name",
"from",
"the",
"given",
"options",
"and",
"if",
"not",
"found",
"returns",
"the",
"specified",
"default",
"name",
"."
] | train | https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/proto/src/main/java/com/google/gson/protobuf/ProtoTypeAdapter.java#L333-L340 |
apiman/apiman | gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/ApiRequestExecutorImpl.java | ApiRequestExecutorImpl.createRequestChain | private Chain<ApiRequest> createRequestChain(IAsyncHandler<ApiRequest> requestHandler) {
RequestChain chain = new RequestChain(policyImpls, context);
chain.headHandler(requestHandler);
chain.policyFailureHandler(failure -> {
// Jump straight to the response leg.
// It wil... | java | private Chain<ApiRequest> createRequestChain(IAsyncHandler<ApiRequest> requestHandler) {
RequestChain chain = new RequestChain(policyImpls, context);
chain.headHandler(requestHandler);
chain.policyFailureHandler(failure -> {
// Jump straight to the response leg.
// It wil... | [
"private",
"Chain",
"<",
"ApiRequest",
">",
"createRequestChain",
"(",
"IAsyncHandler",
"<",
"ApiRequest",
">",
"requestHandler",
")",
"{",
"RequestChain",
"chain",
"=",
"new",
"RequestChain",
"(",
"policyImpls",
",",
"context",
")",
";",
"chain",
".",
"headHand... | Creates the chain used to apply policies in order to the api request. | [
"Creates",
"the",
"chain",
"used",
"to",
"apply",
"policies",
"in",
"order",
"to",
"the",
"api",
"request",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/core/src/main/java/io/apiman/gateway/engine/impl/ApiRequestExecutorImpl.java#L805-L819 |
xwiki/xwiki-rendering | xwiki-rendering-syntaxes/xwiki-rendering-syntax-xwiki20/src/main/java/org/xwiki/rendering/internal/renderer/xwiki20/AbstractStackingInlineContentChainingListener.java | AbstractStackingInlineContentChainingListener.stopStacking | protected void stopStacking()
{
if (this.isStacking) {
// Stop stacking in this listener
setLookaheadDepth(0);
this.isStacking = false;
// Flush all stacked events BUT flush them in the Lookahead Listener at the beginning of the stack, in order
//... | java | protected void stopStacking()
{
if (this.isStacking) {
// Stop stacking in this listener
setLookaheadDepth(0);
this.isStacking = false;
// Flush all stacked events BUT flush them in the Lookahead Listener at the beginning of the stack, in order
//... | [
"protected",
"void",
"stopStacking",
"(",
")",
"{",
"if",
"(",
"this",
".",
"isStacking",
")",
"{",
"// Stop stacking in this listener",
"setLookaheadDepth",
"(",
"0",
")",
";",
"this",
".",
"isStacking",
"=",
"false",
";",
"// Flush all stacked events BUT flush the... | Stop stacking events and move them back to the {@link LookaheadChainingListener} to replay them. | [
"Stop",
"stacking",
"events",
"and",
"move",
"them",
"back",
"to",
"the",
"{"
] | train | https://github.com/xwiki/xwiki-rendering/blob/a21cdfcb64ef5b76872e3eedf78c530f26d7beb0/xwiki-rendering-syntaxes/xwiki-rendering-syntax-xwiki20/src/main/java/org/xwiki/rendering/internal/renderer/xwiki20/AbstractStackingInlineContentChainingListener.java#L176-L199 |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/DBObject.java | DBObject.removeFieldValues | public void removeFieldValues(String fieldName, Collection<String> values) {
Utils.require(!Utils.isEmpty(fieldName), "fieldName");
if (values != null && values.size() > 0) {
List<String> valueSet = m_valueRemoveMap.get(fieldName);
if (valueSet == null) {
val... | java | public void removeFieldValues(String fieldName, Collection<String> values) {
Utils.require(!Utils.isEmpty(fieldName), "fieldName");
if (values != null && values.size() > 0) {
List<String> valueSet = m_valueRemoveMap.get(fieldName);
if (valueSet == null) {
val... | [
"public",
"void",
"removeFieldValues",
"(",
"String",
"fieldName",
",",
"Collection",
"<",
"String",
">",
"values",
")",
"{",
"Utils",
".",
"require",
"(",
"!",
"Utils",
".",
"isEmpty",
"(",
"fieldName",
")",
",",
"\"fieldName\"",
")",
";",
"if",
"(",
"v... | Add "remove" values for the given field. This method should only be called for MV
scalar and link fields. When the updates in this DBObject are applied to the
database, the given set of values are removed for the object. An exception is
thrown if the field is not MV. If the given set of values is null or empty, this
me... | [
"Add",
"remove",
"values",
"for",
"the",
"given",
"field",
".",
"This",
"method",
"should",
"only",
"be",
"called",
"for",
"MV",
"scalar",
"and",
"link",
"fields",
".",
"When",
"the",
"updates",
"in",
"this",
"DBObject",
"are",
"applied",
"to",
"the",
"d... | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/DBObject.java#L459-L469 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxWebHook.java | BoxWebHook.validateTrigger | private static void validateTrigger(String targetType, BoxWebHook.Trigger trigger) {
for (String type : trigger.getTypes()) {
if (targetType.equals(type)) {
return;
}
}
throw new IllegalArgumentException(String.format(
"Provided trigger '%s... | java | private static void validateTrigger(String targetType, BoxWebHook.Trigger trigger) {
for (String type : trigger.getTypes()) {
if (targetType.equals(type)) {
return;
}
}
throw new IllegalArgumentException(String.format(
"Provided trigger '%s... | [
"private",
"static",
"void",
"validateTrigger",
"(",
"String",
"targetType",
",",
"BoxWebHook",
".",
"Trigger",
"trigger",
")",
"{",
"for",
"(",
"String",
"type",
":",
"trigger",
".",
"getTypes",
"(",
")",
")",
"{",
"if",
"(",
"targetType",
".",
"equals",
... | Validates that provided {@link BoxWebHook.Trigger} can be applied on the provided {@link BoxResourceType}.
@param targetType
on which targets the trigger should be applied to
@param trigger
for check
@see #validateTriggers(String, Collection) | [
"Validates",
"that",
"provided",
"{",
"@link",
"BoxWebHook",
".",
"Trigger",
"}",
"can",
"be",
"applied",
"on",
"the",
"provided",
"{",
"@link",
"BoxResourceType",
"}",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxWebHook.java#L250-L258 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceWarehouseItemPersistenceImpl.java | CommerceWarehouseItemPersistenceImpl.findByCPI_CPIU | @Override
public List<CommerceWarehouseItem> findByCPI_CPIU(long CProductId,
String CPInstanceUuid, int start, int end) {
return findByCPI_CPIU(CProductId, CPInstanceUuid, start, end, null);
} | java | @Override
public List<CommerceWarehouseItem> findByCPI_CPIU(long CProductId,
String CPInstanceUuid, int start, int end) {
return findByCPI_CPIU(CProductId, CPInstanceUuid, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceWarehouseItem",
">",
"findByCPI_CPIU",
"(",
"long",
"CProductId",
",",
"String",
"CPInstanceUuid",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByCPI_CPIU",
"(",
"CProductId",
",",
"CPInstanceU... | Returns a range of all the commerce warehouse items where CProductId = ? and CPInstanceUuid = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> re... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"warehouse",
"items",
"where",
"CProductId",
"=",
"?",
";",
"and",
"CPInstanceUuid",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceWarehouseItemPersistenceImpl.java#L924-L928 |
michael-rapp/AndroidMaterialPreferences | example/src/main/java/de/mrapp/android/preference/example/PreferenceFragment.java | PreferenceFragment.createDialogPreferenceClickListener | private OnClickListener createDialogPreferenceClickListener() {
return new OnClickListener() {
@Override
public void onClick(final DialogInterface dialog, final int which) {
String button = getString(
which == DialogInterface.BUTTON_POSITIVE ? and... | java | private OnClickListener createDialogPreferenceClickListener() {
return new OnClickListener() {
@Override
public void onClick(final DialogInterface dialog, final int which) {
String button = getString(
which == DialogInterface.BUTTON_POSITIVE ? and... | [
"private",
"OnClickListener",
"createDialogPreferenceClickListener",
"(",
")",
"{",
"return",
"new",
"OnClickListener",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"onClick",
"(",
"final",
"DialogInterface",
"dialog",
",",
"final",
"int",
"which",
")",
"{",
... | Creates and returns a listener, which allows to show a toast, when a button of the {@link
DialogPreference}'s dialog has been clicked.
@return The listener, which has been created, as an instance of the type {@link
OnClickListener} | [
"Creates",
"and",
"returns",
"a",
"listener",
"which",
"allows",
"to",
"show",
"a",
"toast",
"when",
"a",
"button",
"of",
"the",
"{",
"@link",
"DialogPreference",
"}",
"s",
"dialog",
"has",
"been",
"clicked",
"."
] | train | https://github.com/michael-rapp/AndroidMaterialPreferences/blob/73a7e449458313bd041fc8d6038e290506b68eb1/example/src/main/java/de/mrapp/android/preference/example/PreferenceFragment.java#L233-L246 |
elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java | ByteArrayUtil.writeString | public static void writeString(ByteBuffer buffer, String s) throws IOException {
if(s == null) {
s = ""; // Which will be written as Varint 0 = single byte 0.
}
ByteArrayUtil.STRING_SERIALIZER.toByteBuffer(buffer, s);
} | java | public static void writeString(ByteBuffer buffer, String s) throws IOException {
if(s == null) {
s = ""; // Which will be written as Varint 0 = single byte 0.
}
ByteArrayUtil.STRING_SERIALIZER.toByteBuffer(buffer, s);
} | [
"public",
"static",
"void",
"writeString",
"(",
"ByteBuffer",
"buffer",
",",
"String",
"s",
")",
"throws",
"IOException",
"{",
"if",
"(",
"s",
"==",
"null",
")",
"{",
"s",
"=",
"\"\"",
";",
"// Which will be written as Varint 0 = single byte 0.",
"}",
"ByteArray... | Write a string to the buffer.
See {@link StringSerializer} for details.
@param buffer Buffer to write to
@param s String to write | [
"Write",
"a",
"string",
"to",
"the",
"buffer",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/io/ByteArrayUtil.java#L687-L692 |
threerings/gwt-utils | src/main/java/com/threerings/gwt/ui/SmartTable.java | SmartTable.setColumnCellStyles | public void setColumnCellStyles (int column, String... styles)
{
int rowCount = getRowCount();
for (int row = 0; row < rowCount; ++row) {
setStyleNames(row, column, styles);
}
} | java | public void setColumnCellStyles (int column, String... styles)
{
int rowCount = getRowCount();
for (int row = 0; row < rowCount; ++row) {
setStyleNames(row, column, styles);
}
} | [
"public",
"void",
"setColumnCellStyles",
"(",
"int",
"column",
",",
"String",
"...",
"styles",
")",
"{",
"int",
"rowCount",
"=",
"getRowCount",
"(",
")",
";",
"for",
"(",
"int",
"row",
"=",
"0",
";",
"row",
"<",
"rowCount",
";",
"++",
"row",
")",
"{"... | Sets the style of all cells in the given column to the given values. The first style is set
as the primary style and additional styles are added onto that. | [
"Sets",
"the",
"style",
"of",
"all",
"cells",
"in",
"the",
"given",
"column",
"to",
"the",
"given",
"values",
".",
"The",
"first",
"style",
"is",
"set",
"as",
"the",
"primary",
"style",
"and",
"additional",
"styles",
"are",
"added",
"onto",
"that",
"."
] | train | https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/SmartTable.java#L351-L357 |
alkacon/opencms-core | src/org/opencms/ade/contenteditor/shared/CmsContentDefinition.java | CmsContentDefinition.uuidToEntityId | public static String uuidToEntityId(CmsUUID uuid, String locale) {
return ENTITY_ID_PREFIX + locale + "/" + uuid.toString();
} | java | public static String uuidToEntityId(CmsUUID uuid, String locale) {
return ENTITY_ID_PREFIX + locale + "/" + uuid.toString();
} | [
"public",
"static",
"String",
"uuidToEntityId",
"(",
"CmsUUID",
"uuid",
",",
"String",
"locale",
")",
"{",
"return",
"ENTITY_ID_PREFIX",
"+",
"locale",
"+",
"\"/\"",
"+",
"uuid",
".",
"toString",
"(",
")",
";",
"}"
] | Returns the entity id according to the given UUID.<p>
@param uuid the UUID
@param locale the content locale
@return the entity id | [
"Returns",
"the",
"entity",
"id",
"according",
"to",
"the",
"given",
"UUID",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/contenteditor/shared/CmsContentDefinition.java#L376-L379 |
kaazing/gateway | service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/cachecontrol/ConflictResolverUtils.java | ConflictResolverUtils.resolveValueConflicts | private static void resolveValueConflicts(Directive directive, String generalValue, PatternCacheControl specificPattern) {
long generalPatternValue = Long.parseLong(generalValue);
if (specificPattern.hasDirective(directive)) {
long specificPatternValue = Long.parseLong(specificPattern.getDir... | java | private static void resolveValueConflicts(Directive directive, String generalValue, PatternCacheControl specificPattern) {
long generalPatternValue = Long.parseLong(generalValue);
if (specificPattern.hasDirective(directive)) {
long specificPatternValue = Long.parseLong(specificPattern.getDir... | [
"private",
"static",
"void",
"resolveValueConflicts",
"(",
"Directive",
"directive",
",",
"String",
"generalValue",
",",
"PatternCacheControl",
"specificPattern",
")",
"{",
"long",
"generalPatternValue",
"=",
"Long",
".",
"parseLong",
"(",
"generalValue",
")",
";",
... | Resolves the conflicts for a given directive between the general pattern and the specific PatternCacheControl
@param directive
@param generalValue
@param specificPattern | [
"Resolves",
"the",
"conflicts",
"for",
"a",
"given",
"directive",
"between",
"the",
"general",
"pattern",
"and",
"the",
"specific",
"PatternCacheControl"
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/cachecontrol/ConflictResolverUtils.java#L70-L80 |
alkacon/opencms-core | src/org/opencms/workplace/explorer/CmsExplorerTypeAccess.java | CmsExplorerTypeAccess.getPermissionsCacheKey | private String getPermissionsCacheKey(CmsObject cms, CmsResource resource) {
try {
String userName = cms.getRequestContext().getCurrentUser().getName();
StringBuffer key = new StringBuffer(256);
key.append(resource.getRootPath()).append("_");
Iterator<?> itGroups... | java | private String getPermissionsCacheKey(CmsObject cms, CmsResource resource) {
try {
String userName = cms.getRequestContext().getCurrentUser().getName();
StringBuffer key = new StringBuffer(256);
key.append(resource.getRootPath()).append("_");
Iterator<?> itGroups... | [
"private",
"String",
"getPermissionsCacheKey",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"resource",
")",
"{",
"try",
"{",
"String",
"userName",
"=",
"cms",
".",
"getRequestContext",
"(",
")",
".",
"getCurrentUser",
"(",
")",
".",
"getName",
"(",
")",
";"... | Returns the cache key for the roles and groups of the current user and the given resource.<p>
In this way, it does not matter if the resource and/or user permissions changes, so we never need to clean the cache.<p>
And since the cache is a LRU map, old trash entries will be automatically removed.<p>
@param cms the c... | [
"Returns",
"the",
"cache",
"key",
"for",
"the",
"roles",
"and",
"groups",
"of",
"the",
"current",
"user",
"and",
"the",
"given",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/explorer/CmsExplorerTypeAccess.java#L318-L344 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.iiop/src/com/ibm/ws/transport/iiop/yoko/ORBConfigAdapter.java | ORBConfigAdapter.createClientORB | @Override
public ORB createClientORB(Map<String, Object> clientProps, Collection<SubsystemFactory> subsystemFactories) throws ConfigException {
return createORB(translateToClientArgs(clientProps, subsystemFactories), translateToClientProps(clientProps, subsystemFactories));
} | java | @Override
public ORB createClientORB(Map<String, Object> clientProps, Collection<SubsystemFactory> subsystemFactories) throws ConfigException {
return createORB(translateToClientArgs(clientProps, subsystemFactories), translateToClientProps(clientProps, subsystemFactories));
} | [
"@",
"Override",
"public",
"ORB",
"createClientORB",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"clientProps",
",",
"Collection",
"<",
"SubsystemFactory",
">",
"subsystemFactories",
")",
"throws",
"ConfigException",
"{",
"return",
"createORB",
"(",
"translateT... | Create an ORB for a CSSBean client context.
@return An ORB instance configured for this client access.
@exception ConfigException | [
"Create",
"an",
"ORB",
"for",
"a",
"CSSBean",
"client",
"context",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.iiop/src/com/ibm/ws/transport/iiop/yoko/ORBConfigAdapter.java#L63-L66 |
openbase/jul | storage/src/main/java/org/openbase/jul/storage/registry/FileSynchronizedRegistryImpl.java | FileSynchronizedRegistryImpl.activateVersionControl | public void activateVersionControl(final String entryType, final Package converterPackage) throws CouldNotPerformException {
if (!isEmpty()) {
throw new CouldNotPerformException("Could not activate version control because registry already loaded! Please activate version control before loading the re... | java | public void activateVersionControl(final String entryType, final Package converterPackage) throws CouldNotPerformException {
if (!isEmpty()) {
throw new CouldNotPerformException("Could not activate version control because registry already loaded! Please activate version control before loading the re... | [
"public",
"void",
"activateVersionControl",
"(",
"final",
"String",
"entryType",
",",
"final",
"Package",
"converterPackage",
")",
"throws",
"CouldNotPerformException",
"{",
"if",
"(",
"!",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"CouldNotPerformException",
... | This method activates the version control unit of the underlying registry
db. The version check and db upgrade is automatically performed during
the registry db loading phrase. The db will be upgraded to the latest db
format provided by the given converter package. The converter package
should contain only classes impl... | [
"This",
"method",
"activates",
"the",
"version",
"control",
"unit",
"of",
"the",
"underlying",
"registry",
"db",
".",
"The",
"version",
"check",
"and",
"db",
"upgrade",
"is",
"automatically",
"performed",
"during",
"the",
"registry",
"db",
"loading",
"phrase",
... | train | https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/storage/src/main/java/org/openbase/jul/storage/registry/FileSynchronizedRegistryImpl.java#L147-L152 |
VoltDB/voltdb | src/frontend/org/voltdb/iv2/SpScheduler.java | SpScheduler.doLocalInitiateOffer | private void doLocalInitiateOffer(Iv2InitiateTaskMessage msg)
{
final VoltTrace.TraceEventBatch traceLog = VoltTrace.log(VoltTrace.Category.SPI);
if (traceLog != null) {
final String threadName = Thread.currentThread().getName(); // Thread name has to be materialized here
tra... | java | private void doLocalInitiateOffer(Iv2InitiateTaskMessage msg)
{
final VoltTrace.TraceEventBatch traceLog = VoltTrace.log(VoltTrace.Category.SPI);
if (traceLog != null) {
final String threadName = Thread.currentThread().getName(); // Thread name has to be materialized here
tra... | [
"private",
"void",
"doLocalInitiateOffer",
"(",
"Iv2InitiateTaskMessage",
"msg",
")",
"{",
"final",
"VoltTrace",
".",
"TraceEventBatch",
"traceLog",
"=",
"VoltTrace",
".",
"log",
"(",
"VoltTrace",
".",
"Category",
".",
"SPI",
")",
";",
"if",
"(",
"traceLog",
"... | Do the work necessary to turn the Iv2InitiateTaskMessage into a
TransactionTask which can be queued to the TransactionTaskQueue.
This is reused by both the normal message handling path and the repair
path, and assumes that the caller has dealt with or ensured that the
necessary ID, SpHandles, and replication issues are... | [
"Do",
"the",
"work",
"necessary",
"to",
"turn",
"the",
"Iv2InitiateTaskMessage",
"into",
"a",
"TransactionTask",
"which",
"can",
"be",
"queued",
"to",
"the",
"TransactionTaskQueue",
".",
"This",
"is",
"reused",
"by",
"both",
"the",
"normal",
"message",
"handling... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/iv2/SpScheduler.java#L650-L688 |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/mapelement/MapComposedElement.java | MapComposedElement.containsPoint | @Pure
public boolean containsPoint(Point2D<?, ?> point) {
if (point == null) {
return false;
}
for (int i = 0; i < getPointCount(); ++i) {
final Point2d cur = getPointAt(i);
if (cur.epsilonEquals(point, MapElementConstants.POINT_FUSION_DISTANCE)) {
return true;
}
}
return false;
} | java | @Pure
public boolean containsPoint(Point2D<?, ?> point) {
if (point == null) {
return false;
}
for (int i = 0; i < getPointCount(); ++i) {
final Point2d cur = getPointAt(i);
if (cur.epsilonEquals(point, MapElementConstants.POINT_FUSION_DISTANCE)) {
return true;
}
}
return false;
} | [
"@",
"Pure",
"public",
"boolean",
"containsPoint",
"(",
"Point2D",
"<",
"?",
",",
"?",
">",
"point",
")",
"{",
"if",
"(",
"point",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"getPointCoun... | Check if point p is contained in this coordinates collections.
@param point the point to compare with this coordinates
@return true if p is already part of coordinates | [
"Check",
"if",
"point",
"p",
"is",
"contained",
"in",
"this",
"coordinates",
"collections",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/mapelement/MapComposedElement.java#L275-L287 |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/api/PhotosetsApi.java | PhotosetsApi.editMeta | public Response editMeta(String photosetId, String title, String description) throws JinxException {
JinxUtils.validateParams(photosetId, title);
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.photosets.editMeta");
params.put("photoset_id", photosetId);
params.put("title"... | java | public Response editMeta(String photosetId, String title, String description) throws JinxException {
JinxUtils.validateParams(photosetId, title);
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.photosets.editMeta");
params.put("photoset_id", photosetId);
params.put("title"... | [
"public",
"Response",
"editMeta",
"(",
"String",
"photosetId",
",",
"String",
"title",
",",
"String",
"description",
")",
"throws",
"JinxException",
"{",
"JinxUtils",
".",
"validateParams",
"(",
"photosetId",
",",
"title",
")",
";",
"Map",
"<",
"String",
",",
... | Modify the meta-data for a photoset.
<br>
This method requires authentication with 'write' permission.
<br>
This method has no specific response - It returns an empty success response if it completes without error.
@param photosetId id of the photoset to modify. Required.
@param title new title for the photoset... | [
"Modify",
"the",
"meta",
"-",
"data",
"for",
"a",
"photoset",
".",
"<br",
">",
"This",
"method",
"requires",
"authentication",
"with",
"write",
"permission",
".",
"<br",
">",
"This",
"method",
"has",
"no",
"specific",
"response",
"-",
"It",
"returns",
"an"... | train | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/PhotosetsApi.java#L136-L146 |
alkacon/opencms-core | src/org/opencms/flex/CmsFlexResponse.java | CmsFlexResponse.initStream | private void initStream() throws IOException {
if (m_out == null) {
if (!m_writeOnlyToBuffer) {
// we can use the parents output stream
if (m_cachingRequired || (m_controller.getResponseStackSize() > 1)) {
// we are allowed to cache our results (p... | java | private void initStream() throws IOException {
if (m_out == null) {
if (!m_writeOnlyToBuffer) {
// we can use the parents output stream
if (m_cachingRequired || (m_controller.getResponseStackSize() > 1)) {
// we are allowed to cache our results (p... | [
"private",
"void",
"initStream",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"m_out",
"==",
"null",
")",
"{",
"if",
"(",
"!",
"m_writeOnlyToBuffer",
")",
"{",
"// we can use the parents output stream",
"if",
"(",
"m_cachingRequired",
"||",
"(",
"m_control... | Initializes the current responses output stream
and the corresponding print writer.<p>
@throws IOException in case something goes wrong while initializing | [
"Initializes",
"the",
"current",
"responses",
"output",
"stream",
"and",
"the",
"corresponding",
"print",
"writer",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/flex/CmsFlexResponse.java#L1083-L1104 |
code4everything/util | src/main/java/com/zhazhapan/util/BeanUtils.java | BeanUtils.jsonPutIn | public static void jsonPutIn(JSONObject jsonObject, Object object) throws IllegalAccessException {
Field[] fields = object.getClass().getDeclaredFields();
for (Field field : fields) {
field.setAccessible(true);
field.set(object, TypeUtils.castToJavaBean(jsonObject.get(field.getNa... | java | public static void jsonPutIn(JSONObject jsonObject, Object object) throws IllegalAccessException {
Field[] fields = object.getClass().getDeclaredFields();
for (Field field : fields) {
field.setAccessible(true);
field.set(object, TypeUtils.castToJavaBean(jsonObject.get(field.getNa... | [
"public",
"static",
"void",
"jsonPutIn",
"(",
"JSONObject",
"jsonObject",
",",
"Object",
"object",
")",
"throws",
"IllegalAccessException",
"{",
"Field",
"[",
"]",
"fields",
"=",
"object",
".",
"getClass",
"(",
")",
".",
"getDeclaredFields",
"(",
")",
";",
"... | 将JOSNObject转换为Bean
@param jsonObject {@link JSONObject}
@param object {@link Object}
@throws IllegalAccessException 异常
@deprecated 请使用 {@link JSONObject#toJavaObject(JSON, Class)} | [
"将JOSNObject转换为Bean"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/BeanUtils.java#L228-L234 |
mojohaus/webstart | webstart-maven-plugin/src/main/java/org/codehaus/mojo/webstart/AbstractBaseJnlpMojo.java | AbstractBaseJnlpMojo.removeExistingSignatures | private int removeExistingSignatures( File workDirectory )
throws MojoExecutionException
{
getLog().info( "-- Remove existing signatures" );
// cleanup tempDir if exists
File tempDir = new File( workDirectory, "temp_extracted_jars" );
ioUtil.removeDirectory( tempDir );
... | java | private int removeExistingSignatures( File workDirectory )
throws MojoExecutionException
{
getLog().info( "-- Remove existing signatures" );
// cleanup tempDir if exists
File tempDir = new File( workDirectory, "temp_extracted_jars" );
ioUtil.removeDirectory( tempDir );
... | [
"private",
"int",
"removeExistingSignatures",
"(",
"File",
"workDirectory",
")",
"throws",
"MojoExecutionException",
"{",
"getLog",
"(",
")",
".",
"info",
"(",
"\"-- Remove existing signatures\"",
")",
";",
"// cleanup tempDir if exists",
"File",
"tempDir",
"=",
"new",
... | Removes the signature of the files in the specified directory which satisfy the
specified filter.
@param workDirectory working directory used to unsign jars
@return the number of unsigned jars
@throws MojoExecutionException if could not remove signatures | [
"Removes",
"the",
"signature",
"of",
"the",
"files",
"in",
"the",
"specified",
"directory",
"which",
"satisfy",
"the",
"specified",
"filter",
"."
] | train | https://github.com/mojohaus/webstart/blob/38fdd1d21f063f21716cfcd61ebeabd963487576/webstart-maven-plugin/src/main/java/org/codehaus/mojo/webstart/AbstractBaseJnlpMojo.java#L982-L1023 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/data/caching/support/CachingTemplate.java | CachingTemplate.withCacheEvict | @SuppressWarnings("unchecked")
public <T extends VALUE> T withCacheEvict(KEY key, Supplier<VALUE> cacheableOperation) {
Assert.notNull(cacheableOperation, "Supplier is required");
VALUE result = cacheableOperation.get();
evict(getLock(), key);
return (T) result;
} | java | @SuppressWarnings("unchecked")
public <T extends VALUE> T withCacheEvict(KEY key, Supplier<VALUE> cacheableOperation) {
Assert.notNull(cacheableOperation, "Supplier is required");
VALUE result = cacheableOperation.get();
evict(getLock(), key);
return (T) result;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
"extends",
"VALUE",
">",
"T",
"withCacheEvict",
"(",
"KEY",
"key",
",",
"Supplier",
"<",
"VALUE",
">",
"cacheableOperation",
")",
"{",
"Assert",
".",
"notNull",
"(",
"cacheableOperation",
... | This caching data access operation invokes the supplied {@link Supplier cacheable operation} and then evicts
the entry in the {@link Cache} identified with the given {@link KEY key} if present, but only if
the {@link Supplier cacheable operation} completes successfully.
@param <T> {@link Class type} of the return {@li... | [
"This",
"caching",
"data",
"access",
"operation",
"invokes",
"the",
"supplied",
"{",
"@link",
"Supplier",
"cacheable",
"operation",
"}",
"and",
"then",
"evicts",
"the",
"entry",
"in",
"the",
"{",
"@link",
"Cache",
"}",
"identified",
"with",
"the",
"given",
"... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/data/caching/support/CachingTemplate.java#L318-L328 |
audit4j/audit4j-core | src/main/java/org/audit4j/core/extra/scannotation/ClasspathUrlFinder.java | ClasspathUrlFinder.findClassPaths | public static URL[] findClassPaths()
{
List<URL> list = new ArrayList<URL>();
String classpath = System.getProperty("java.class.path");
StringTokenizer tokenizer = new StringTokenizer(classpath, File.pathSeparator);
while (tokenizer.hasMoreTokens())
{
String path = tokenizer.n... | java | public static URL[] findClassPaths()
{
List<URL> list = new ArrayList<URL>();
String classpath = System.getProperty("java.class.path");
StringTokenizer tokenizer = new StringTokenizer(classpath, File.pathSeparator);
while (tokenizer.hasMoreTokens())
{
String path = tokenizer.n... | [
"public",
"static",
"URL",
"[",
"]",
"findClassPaths",
"(",
")",
"{",
"List",
"<",
"URL",
">",
"list",
"=",
"new",
"ArrayList",
"<",
"URL",
">",
"(",
")",
";",
"String",
"classpath",
"=",
"System",
".",
"getProperty",
"(",
"\"java.class.path\"",
")",
"... | Uses the java.class.path system property to obtain a list of URLs that represent the CLASSPATH
@return | [
"Uses",
"the",
"java",
".",
"class",
".",
"path",
"system",
"property",
"to",
"obtain",
"a",
"list",
"of",
"URLs",
"that",
"represent",
"the",
"CLASSPATH"
] | train | https://github.com/audit4j/audit4j-core/blob/dc8569108851e64cb0ecc7a39048db0ad070fba2/src/main/java/org/audit4j/core/extra/scannotation/ClasspathUrlFinder.java#L126-L149 |
iipc/openwayback | wayback-core/src/main/java/org/archive/wayback/liveweb/ARCCacheDirectory.java | ARCCacheDirectory.getResource | public Resource getResource(String path, long offset) throws IOException {
File arc = new File(path);
if(!arc.exists()) {
String base = arc.getName();
arc = new File(arcDir,base);
if(!arc.exists()) {
if(base.endsWith(ArchiveFileConstants.OCCUPIED_SUFFIX)) {
String newBase = base.substring(0,base.l... | java | public Resource getResource(String path, long offset) throws IOException {
File arc = new File(path);
if(!arc.exists()) {
String base = arc.getName();
arc = new File(arcDir,base);
if(!arc.exists()) {
if(base.endsWith(ArchiveFileConstants.OCCUPIED_SUFFIX)) {
String newBase = base.substring(0,base.l... | [
"public",
"Resource",
"getResource",
"(",
"String",
"path",
",",
"long",
"offset",
")",
"throws",
"IOException",
"{",
"File",
"arc",
"=",
"new",
"File",
"(",
"path",
")",
";",
"if",
"(",
"!",
"arc",
".",
"exists",
"(",
")",
")",
"{",
"String",
"base"... | transform an ARCLocation into a Resource. Be sure to call close() on it
when processing is finished.
@param path to ARC file
@param offset within file where record begins
@return the Resource for the location
@throws IOException for usual reasons | [
"transform",
"an",
"ARCLocation",
"into",
"a",
"Resource",
".",
"Be",
"sure",
"to",
"call",
"close",
"()",
"on",
"it",
"when",
"processing",
"is",
"finished",
"."
] | train | https://github.com/iipc/openwayback/blob/da74c3a59a5b5a5c365bd4702dcb45d263535794/wayback-core/src/main/java/org/archive/wayback/liveweb/ARCCacheDirectory.java#L111-L131 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/LocaleData.java | LocaleData.getExemplarSet | public static UnicodeSet getExemplarSet(ULocale locale, int options, int extype) {
return LocaleData.getInstance(locale).getExemplarSet(options, extype);
} | java | public static UnicodeSet getExemplarSet(ULocale locale, int options, int extype) {
return LocaleData.getInstance(locale).getExemplarSet(options, extype);
} | [
"public",
"static",
"UnicodeSet",
"getExemplarSet",
"(",
"ULocale",
"locale",
",",
"int",
"options",
",",
"int",
"extype",
")",
"{",
"return",
"LocaleData",
".",
"getInstance",
"(",
"locale",
")",
".",
"getExemplarSet",
"(",
"options",
",",
"extype",
")",
";... | Returns the set of exemplar characters for a locale.
Equivalent to calling new LocaleData(locale).{@link #getExemplarSet(int, int)}.
@param locale Locale for which the exemplar character set
is to be retrieved.
@param options Bitmask for options to apply to the exemplar pattern.
Specify zero to retrieve the exemp... | [
"Returns",
"the",
"set",
"of",
"exemplar",
"characters",
"for",
"a",
"locale",
".",
"Equivalent",
"to",
"calling",
"new",
"LocaleData",
"(",
"locale",
")",
".",
"{",
"@link",
"#getExemplarSet",
"(",
"int",
"int",
")",
"}",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/LocaleData.java#L155-L157 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpd/MPD9AbstractReader.java | MPD9AbstractReader.getNullOnValue | private Integer getNullOnValue(Integer value, int nullValue)
{
return (NumberHelper.getInt(value) == nullValue ? null : value);
} | java | private Integer getNullOnValue(Integer value, int nullValue)
{
return (NumberHelper.getInt(value) == nullValue ? null : value);
} | [
"private",
"Integer",
"getNullOnValue",
"(",
"Integer",
"value",
",",
"int",
"nullValue",
")",
"{",
"return",
"(",
"NumberHelper",
".",
"getInt",
"(",
"value",
")",
"==",
"nullValue",
"?",
"null",
":",
"value",
")",
";",
"}"
] | This method returns the value it is passed, or null if the value
matches the nullValue argument.
@param value value under test
@param nullValue return null if value under test matches this value
@return value or null | [
"This",
"method",
"returns",
"the",
"value",
"it",
"is",
"passed",
"or",
"null",
"if",
"the",
"value",
"matches",
"the",
"nullValue",
"argument",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpd/MPD9AbstractReader.java#L1283-L1286 |
thinkaurelius/titan | titan-cassandra/src/main/java/com/thinkaurelius/titan/diskstorage/cassandra/thrift/thriftpool/CTConnectionFactory.java | CTConnectionFactory.makeRawConnection | public CTConnection makeRawConnection() throws TTransportException {
final Config cfg = cfgRef.get();
String hostname = cfg.getRandomHost();
log.debug("Creating TSocket({}, {}, {}, {}, {})", hostname, cfg.port, cfg.username, cfg.password, cfg.timeoutMS);
TSocket socket;
if (nu... | java | public CTConnection makeRawConnection() throws TTransportException {
final Config cfg = cfgRef.get();
String hostname = cfg.getRandomHost();
log.debug("Creating TSocket({}, {}, {}, {}, {})", hostname, cfg.port, cfg.username, cfg.password, cfg.timeoutMS);
TSocket socket;
if (nu... | [
"public",
"CTConnection",
"makeRawConnection",
"(",
")",
"throws",
"TTransportException",
"{",
"final",
"Config",
"cfg",
"=",
"cfgRef",
".",
"get",
"(",
")",
";",
"String",
"hostname",
"=",
"cfg",
".",
"getRandomHost",
"(",
")",
";",
"log",
".",
"debug",
"... | Create a Cassandra-Thrift connection, but do not attempt to
set a keyspace on the connection.
@return A CTConnection ready to talk to a Cassandra cluster
@throws TTransportException on any Thrift transport failure | [
"Create",
"a",
"Cassandra",
"-",
"Thrift",
"connection",
"but",
"do",
"not",
"attempt",
"to",
"set",
"a",
"keyspace",
"on",
"the",
"connection",
"."
] | train | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-cassandra/src/main/java/com/thinkaurelius/titan/diskstorage/cassandra/thrift/thriftpool/CTConnectionFactory.java#L66-L104 |
deeplearning4j/deeplearning4j | datavec/datavec-arrow/src/main/java/org/datavec/arrow/ArrowConverter.java | ArrowConverter.toArrowColumnsStringTimeSeries | public static List<FieldVector> toArrowColumnsStringTimeSeries(final BufferAllocator bufferAllocator,
final Schema schema,
List<List<List<String>>> dataVecRecord) {
return toA... | java | public static List<FieldVector> toArrowColumnsStringTimeSeries(final BufferAllocator bufferAllocator,
final Schema schema,
List<List<List<String>>> dataVecRecord) {
return toA... | [
"public",
"static",
"List",
"<",
"FieldVector",
">",
"toArrowColumnsStringTimeSeries",
"(",
"final",
"BufferAllocator",
"bufferAllocator",
",",
"final",
"Schema",
"schema",
",",
"List",
"<",
"List",
"<",
"List",
"<",
"String",
">",
">",
">",
"dataVecRecord",
")"... | Convert a set of input strings to arrow columns
for a time series.
@param bufferAllocator the buffer allocator to use
@param schema the schema to use
@param dataVecRecord the collection of input strings to process
@return the created vectors | [
"Convert",
"a",
"set",
"of",
"input",
"strings",
"to",
"arrow",
"columns",
"for",
"a",
"time",
"series",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-arrow/src/main/java/org/datavec/arrow/ArrowConverter.java#L677-L682 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WLabel.java | WLabel.setText | public void setText(final String text, final Serializable... args) {
Serializable currText = getComponentModel().text;
Serializable textToBeSet = I18nUtilities.asMessage(text, args);
if (!Objects.equals(textToBeSet, currText)) {
getOrCreateComponentModel().text = textToBeSet;
}
} | java | public void setText(final String text, final Serializable... args) {
Serializable currText = getComponentModel().text;
Serializable textToBeSet = I18nUtilities.asMessage(text, args);
if (!Objects.equals(textToBeSet, currText)) {
getOrCreateComponentModel().text = textToBeSet;
}
} | [
"public",
"void",
"setText",
"(",
"final",
"String",
"text",
",",
"final",
"Serializable",
"...",
"args",
")",
"{",
"Serializable",
"currText",
"=",
"getComponentModel",
"(",
")",
".",
"text",
";",
"Serializable",
"textToBeSet",
"=",
"I18nUtilities",
".",
"asM... | Sets the label's text.
@param text the label text, using {@link MessageFormat} syntax.
@param args optional arguments for the message format string. | [
"Sets",
"the",
"label",
"s",
"text",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WLabel.java#L113-L120 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/MappedParametrizedObjectEntry.java | MappedParametrizedObjectEntry.getParameterInteger | public Integer getParameterInteger(String name, Integer defaultValue)
{
String value = getParameterValue(name, null);
if (value != null)
{
try
{
return StringNumberParser.parseInt(value);
}
catch (NumberFormatException e)
{
if (L... | java | public Integer getParameterInteger(String name, Integer defaultValue)
{
String value = getParameterValue(name, null);
if (value != null)
{
try
{
return StringNumberParser.parseInt(value);
}
catch (NumberFormatException e)
{
if (L... | [
"public",
"Integer",
"getParameterInteger",
"(",
"String",
"name",
",",
"Integer",
"defaultValue",
")",
"{",
"String",
"value",
"=",
"getParameterValue",
"(",
"name",
",",
"null",
")",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"try",
"{",
"return",
... | Parse named parameter as Integer.
@param name
parameter name
@param defaultValue
default Integer value
@return Integer value | [
"Parse",
"named",
"parameter",
"as",
"Integer",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/config/MappedParametrizedObjectEntry.java#L135-L155 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AbstractBuilder.java | AbstractBuilder.buildChildren | protected void buildChildren(XMLNode node, Content contentTree) throws DocletException {
for (XMLNode child : node.children)
build(child, contentTree);
} | java | protected void buildChildren(XMLNode node, Content contentTree) throws DocletException {
for (XMLNode child : node.children)
build(child, contentTree);
} | [
"protected",
"void",
"buildChildren",
"(",
"XMLNode",
"node",
",",
"Content",
"contentTree",
")",
"throws",
"DocletException",
"{",
"for",
"(",
"XMLNode",
"child",
":",
"node",
".",
"children",
")",
"build",
"(",
"child",
",",
"contentTree",
")",
";",
"}"
] | Build the documentation, as specified by the children of the given XML element.
@param node the XML element that specifies which components to document.
@param contentTree content tree to which the documentation will be added
@throws DocletException if there is a problem while building the children | [
"Build",
"the",
"documentation",
"as",
"specified",
"by",
"the",
"children",
"of",
"the",
"given",
"XML",
"element",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AbstractBuilder.java#L198-L201 |
Wolfgang-Schuetzelhofer/jcypher | src/main/java/iot/jcypher/query/values/SubString.java | SubString.subLength | public JcString subLength(int len) {
JcNumber sub = new JcNumber(len, this.getPredecessor(), OPERATOR.Common.COMMA_SEPARATOR);
JcString ret = new JcString(null, sub,
new FunctionInstance(FUNCTION.String.SUBSTRING, 3));
QueryRecorder.recordInvocationConditional(this, "subLength", ret, QueryRecorder.literal(le... | java | public JcString subLength(int len) {
JcNumber sub = new JcNumber(len, this.getPredecessor(), OPERATOR.Common.COMMA_SEPARATOR);
JcString ret = new JcString(null, sub,
new FunctionInstance(FUNCTION.String.SUBSTRING, 3));
QueryRecorder.recordInvocationConditional(this, "subLength", ret, QueryRecorder.literal(le... | [
"public",
"JcString",
"subLength",
"(",
"int",
"len",
")",
"{",
"JcNumber",
"sub",
"=",
"new",
"JcNumber",
"(",
"len",
",",
"this",
".",
"getPredecessor",
"(",
")",
",",
"OPERATOR",
".",
"Common",
".",
"COMMA_SEPARATOR",
")",
";",
"JcString",
"ret",
"=",... | <div color='red' style="font-size:24px;color:red"><b><i><u>JCYPHER</u></i></b></div>
<div color='red' style="font-size:18px;color:red"><i>specify the length of a substring to be extracted</i></div>
<br/> | [
"<div",
"color",
"=",
"red",
"style",
"=",
"font",
"-",
"size",
":",
"24px",
";",
"color",
":",
"red",
">",
"<b",
">",
"<i",
">",
"<u",
">",
"JCYPHER<",
"/",
"u",
">",
"<",
"/",
"i",
">",
"<",
"/",
"b",
">",
"<",
"/",
"div",
">",
"<div",
... | train | https://github.com/Wolfgang-Schuetzelhofer/jcypher/blob/0f36914b4d6993a004cc235bb18dd3e02a59d253/src/main/java/iot/jcypher/query/values/SubString.java#L38-L44 |
JakeWharton/butterknife | butterknife-reflect/src/main/java/butterknife/ButterKnife.java | ButterKnife.validateReturnType | private static boolean validateReturnType(Method method, Class<?> expected) {
Class<?> returnType = method.getReturnType();
if (returnType == void.class) {
return false;
}
if (returnType != expected) {
String expectedType = "'" + expected.getName() + "'";
if (expected != void.class) {
... | java | private static boolean validateReturnType(Method method, Class<?> expected) {
Class<?> returnType = method.getReturnType();
if (returnType == void.class) {
return false;
}
if (returnType != expected) {
String expectedType = "'" + expected.getName() + "'";
if (expected != void.class) {
... | [
"private",
"static",
"boolean",
"validateReturnType",
"(",
"Method",
"method",
",",
"Class",
"<",
"?",
">",
"expected",
")",
"{",
"Class",
"<",
"?",
">",
"returnType",
"=",
"method",
".",
"getReturnType",
"(",
")",
";",
"if",
"(",
"returnType",
"==",
"vo... | Returns true when the return value should be propagated. Use a default otherwise. | [
"Returns",
"true",
"when",
"the",
"return",
"value",
"should",
"be",
"propagated",
".",
"Use",
"a",
"default",
"otherwise",
"."
] | train | https://github.com/JakeWharton/butterknife/blob/0ead8a7b21620effcf78c728089fc16ae9d664c0/butterknife-reflect/src/main/java/butterknife/ButterKnife.java#L993-L1010 |
thinkaurelius/titan | titan-es/src/main/java/com/thinkaurelius/titan/diskstorage/es/ElasticSearchIndex.java | ElasticSearchIndex.checkForOrCreateIndex | private void checkForOrCreateIndex(Configuration config) {
Preconditions.checkState(null != client);
//Create index if it does not already exist
IndicesExistsResponse response = client.admin().indices().exists(new IndicesExistsRequest(indexName)).actionGet();
if (!response.isExists()) {... | java | private void checkForOrCreateIndex(Configuration config) {
Preconditions.checkState(null != client);
//Create index if it does not already exist
IndicesExistsResponse response = client.admin().indices().exists(new IndicesExistsRequest(indexName)).actionGet();
if (!response.isExists()) {... | [
"private",
"void",
"checkForOrCreateIndex",
"(",
"Configuration",
"config",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"null",
"!=",
"client",
")",
";",
"//Create index if it does not already exist",
"IndicesExistsResponse",
"response",
"=",
"client",
".",
"admi... | If ES already contains this instance's target index, then do nothing.
Otherwise, create the index, then wait {@link #CREATE_SLEEP}.
<p>
The {@code client} field must point to a live, connected client.
The {@code indexName} field must be non-null and point to the name
of the index to check for existence or create.
@par... | [
"If",
"ES",
"already",
"contains",
"this",
"instance",
"s",
"target",
"index",
"then",
"do",
"nothing",
".",
"Otherwise",
"create",
"the",
"index",
"then",
"wait",
"{",
"@link",
"#CREATE_SLEEP",
"}",
".",
"<p",
">",
"The",
"{",
"@code",
"client",
"}",
"f... | train | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-es/src/main/java/com/thinkaurelius/titan/diskstorage/es/ElasticSearchIndex.java#L217-L239 |
deeplearning4j/deeplearning4j | datavec/datavec-api/src/main/java/org/datavec/api/records/converter/RecordReaderConverter.java | RecordReaderConverter.convert | public static void convert(SequenceRecordReader reader, SequenceRecordWriter writer) throws IOException {
convert(reader, writer, true);
} | java | public static void convert(SequenceRecordReader reader, SequenceRecordWriter writer) throws IOException {
convert(reader, writer, true);
} | [
"public",
"static",
"void",
"convert",
"(",
"SequenceRecordReader",
"reader",
",",
"SequenceRecordWriter",
"writer",
")",
"throws",
"IOException",
"{",
"convert",
"(",
"reader",
",",
"writer",
",",
"true",
")",
";",
"}"
] | Write all sequences from the specified sequence record reader to the specified sequence record writer.
Closes the sequence record writer on completion.
@param reader Sequence record reader (source of data)
@param writer Sequence record writer (location to write data)
@throws IOException If underlying reader/writer thr... | [
"Write",
"all",
"sequences",
"from",
"the",
"specified",
"sequence",
"record",
"reader",
"to",
"the",
"specified",
"sequence",
"record",
"writer",
".",
"Closes",
"the",
"sequence",
"record",
"writer",
"on",
"completion",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-api/src/main/java/org/datavec/api/records/converter/RecordReaderConverter.java#L80-L82 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/transform/fft/GeneralPurposeFFT_F32_1D.java | GeneralPurposeFFT_F32_1D.realForwardFull | public void realForwardFull(final float[] a, final int offa) {
final int twon = 2 * n;
switch (plan) {
case SPLIT_RADIX:{
realForward(a, offa);
int idx1, idx2;
for (int k = 0; k < n / 2; k++) {
idx1 = 2 * k;
idx2 = offa + ((twon - idx1) % twon);
a[idx2] = a[offa + idx1];
a[idx2 ... | java | public void realForwardFull(final float[] a, final int offa) {
final int twon = 2 * n;
switch (plan) {
case SPLIT_RADIX:{
realForward(a, offa);
int idx1, idx2;
for (int k = 0; k < n / 2; k++) {
idx1 = 2 * k;
idx2 = offa + ((twon - idx1) % twon);
a[idx2] = a[offa + idx1];
a[idx2 ... | [
"public",
"void",
"realForwardFull",
"(",
"final",
"float",
"[",
"]",
"a",
",",
"final",
"int",
"offa",
")",
"{",
"final",
"int",
"twon",
"=",
"2",
"*",
"n",
";",
"switch",
"(",
"plan",
")",
"{",
"case",
"SPLIT_RADIX",
":",
"{",
"realForward",
"(",
... | Computes 1D forward DFT of real data leaving the result in <code>a</code>
. This method computes the full real forward transform, i.e. you will get
the same result as from <code>complexForward</code> called with all
imaginary part equal 0. Because the result is stored in <code>a</code>,
the size of the input array must... | [
"Computes",
"1D",
"forward",
"DFT",
"of",
"real",
"data",
"leaving",
"the",
"result",
"in",
"<code",
">",
"a<",
"/",
"code",
">",
".",
"This",
"method",
"computes",
"the",
"full",
"real",
"forward",
"transform",
"i",
".",
"e",
".",
"you",
"will",
"get"... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/fft/GeneralPurposeFFT_F32_1D.java#L383-L426 |
deeplearning4j/deeplearning4j | datavec/datavec-arrow/src/main/java/org/datavec/arrow/ArrowConverter.java | ArrowConverter.toArrowWritablesTimeSeries | public static List<List<List<Writable>>> toArrowWritablesTimeSeries(List<FieldVector> fieldVectors,Schema schema,int timeSeriesLength) {
ArrowWritableRecordTimeSeriesBatch arrowWritableRecordBatch = new ArrowWritableRecordTimeSeriesBatch(fieldVectors,schema,timeSeriesLength);
return arrowWritableRecordB... | java | public static List<List<List<Writable>>> toArrowWritablesTimeSeries(List<FieldVector> fieldVectors,Schema schema,int timeSeriesLength) {
ArrowWritableRecordTimeSeriesBatch arrowWritableRecordBatch = new ArrowWritableRecordTimeSeriesBatch(fieldVectors,schema,timeSeriesLength);
return arrowWritableRecordB... | [
"public",
"static",
"List",
"<",
"List",
"<",
"List",
"<",
"Writable",
">",
">",
">",
"toArrowWritablesTimeSeries",
"(",
"List",
"<",
"FieldVector",
">",
"fieldVectors",
",",
"Schema",
"schema",
",",
"int",
"timeSeriesLength",
")",
"{",
"ArrowWritableRecordTimeS... | Convert the input field vectors (the input data) and
the given schema to a proper list of writables.
@param fieldVectors the field vectors to use
@param schema the schema to use
@param timeSeriesLength the length of the time series
@return the equivalent datavec batch given the input data | [
"Convert",
"the",
"input",
"field",
"vectors",
"(",
"the",
"input",
"data",
")",
"and",
"the",
"given",
"schema",
"to",
"a",
"proper",
"list",
"of",
"writables",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-arrow/src/main/java/org/datavec/arrow/ArrowConverter.java#L324-L327 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getAllEmblemIDs | public void getAllEmblemIDs(Emblem.Type type, Callback<List<Integer>> callback) throws NullPointerException {
gw2API.getAllEmblemIDs(type.name()).enqueue(callback);
} | java | public void getAllEmblemIDs(Emblem.Type type, Callback<List<Integer>> callback) throws NullPointerException {
gw2API.getAllEmblemIDs(type.name()).enqueue(callback);
} | [
"public",
"void",
"getAllEmblemIDs",
"(",
"Emblem",
".",
"Type",
"type",
",",
"Callback",
"<",
"List",
"<",
"Integer",
">",
">",
"callback",
")",
"throws",
"NullPointerException",
"{",
"gw2API",
".",
"getAllEmblemIDs",
"(",
"type",
".",
"name",
"(",
")",
"... | For more info on emblem API go <a href="https://wiki.guildwars2.com/wiki/API:2/emblem">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
@param type foregrounds/backgrounds
@param callback callback that ... | [
"For",
"more",
"info",
"on",
"emblem",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"emblem",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">",
"Give",
"user",
"t... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L1315-L1317 |
landawn/AbacusUtil | src/com/landawn/abacus/util/Matth.java | Matth.addExact | public static long addExact(long a, long b) {
long result = a + b;
checkNoOverflow((a ^ b) < 0 | (a ^ result) >= 0);
return result;
} | java | public static long addExact(long a, long b) {
long result = a + b;
checkNoOverflow((a ^ b) < 0 | (a ^ result) >= 0);
return result;
} | [
"public",
"static",
"long",
"addExact",
"(",
"long",
"a",
",",
"long",
"b",
")",
"{",
"long",
"result",
"=",
"a",
"+",
"b",
";",
"checkNoOverflow",
"(",
"(",
"a",
"^",
"b",
")",
"<",
"0",
"|",
"(",
"a",
"^",
"result",
")",
">=",
"0",
")",
";"... | Returns the sum of {@code a} and {@code b}, provided it does not overflow.
@throws ArithmeticException if {@code a + b} overflows in signed {@code long} arithmetic | [
"Returns",
"the",
"sum",
"of",
"{",
"@code",
"a",
"}",
"and",
"{",
"@code",
"b",
"}",
"provided",
"it",
"does",
"not",
"overflow",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Matth.java#L1382-L1386 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java | JobsImpl.listFromJobScheduleNextAsync | public ServiceFuture<List<CloudJob>> listFromJobScheduleNextAsync(final String nextPageLink, final ServiceFuture<List<CloudJob>> serviceFuture, final ListOperationCallback<CloudJob> serviceCallback) {
return AzureServiceFuture.fromHeaderPageResponse(
listFromJobScheduleNextSinglePageAsync(nextPageLi... | java | public ServiceFuture<List<CloudJob>> listFromJobScheduleNextAsync(final String nextPageLink, final ServiceFuture<List<CloudJob>> serviceFuture, final ListOperationCallback<CloudJob> serviceCallback) {
return AzureServiceFuture.fromHeaderPageResponse(
listFromJobScheduleNextSinglePageAsync(nextPageLi... | [
"public",
"ServiceFuture",
"<",
"List",
"<",
"CloudJob",
">",
">",
"listFromJobScheduleNextAsync",
"(",
"final",
"String",
"nextPageLink",
",",
"final",
"ServiceFuture",
"<",
"List",
"<",
"CloudJob",
">",
">",
"serviceFuture",
",",
"final",
"ListOperationCallback",
... | Lists the jobs that have been created under the specified job schedule.
@param nextPageLink The NextLink from the previous successful call to List operation.
@param serviceFuture the ServiceFuture object tracking the Retrofit calls
@param serviceCallback the async ServiceCallback to handle successful and failed respon... | [
"Lists",
"the",
"jobs",
"that",
"have",
"been",
"created",
"under",
"the",
"specified",
"job",
"schedule",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java#L3578-L3588 |
osglworks/java-tool | src/main/java/org/osgl/Lang.java | F3.applyOrElse | public R applyOrElse(P1 p1, P2 p2, P3 p3, F3<? super P1, ? super P2, ? super P3, ? extends R> fallback) {
try {
return apply(p1, p2, p3);
} catch (RuntimeException e) {
return fallback.apply(p1, p2, p3);
}
} | java | public R applyOrElse(P1 p1, P2 p2, P3 p3, F3<? super P1, ? super P2, ? super P3, ? extends R> fallback) {
try {
return apply(p1, p2, p3);
} catch (RuntimeException e) {
return fallback.apply(p1, p2, p3);
}
} | [
"public",
"R",
"applyOrElse",
"(",
"P1",
"p1",
",",
"P2",
"p2",
",",
"P3",
"p3",
",",
"F3",
"<",
"?",
"super",
"P1",
",",
"?",
"super",
"P2",
",",
"?",
"super",
"P3",
",",
"?",
"extends",
"R",
">",
"fallback",
")",
"{",
"try",
"{",
"return",
... | Applies this partial function to the given argument when it is contained in the function domain.
Applies fallback function where this partial function is not defined.
@param p1
the first argument
@param p2
the second argument
@param p3
the third argument
@param fallback
the function to be called of application of this... | [
"Applies",
"this",
"partial",
"function",
"to",
"the",
"given",
"argument",
"when",
"it",
"is",
"contained",
"in",
"the",
"function",
"domain",
".",
"Applies",
"fallback",
"function",
"where",
"this",
"partial",
"function",
"is",
"not",
"defined",
"."
] | train | https://github.com/osglworks/java-tool/blob/8b6eee2bccb067eb32e6a7bc4a4dfef7a7d9008b/src/main/java/org/osgl/Lang.java#L1202-L1208 |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/constraints/FieldDescriptorConstraints.java | FieldDescriptorConstraints.checkSequenceName | private void checkSequenceName(FieldDescriptorDef fieldDef, String checkLevel) throws ConstraintException
{
if (CHECKLEVEL_NONE.equals(checkLevel))
{
return;
}
String autoIncr = fieldDef.getProperty(PropertyHelper.OJB_PROPERTY_AUTOINCREMENT);
String seqNa... | java | private void checkSequenceName(FieldDescriptorDef fieldDef, String checkLevel) throws ConstraintException
{
if (CHECKLEVEL_NONE.equals(checkLevel))
{
return;
}
String autoIncr = fieldDef.getProperty(PropertyHelper.OJB_PROPERTY_AUTOINCREMENT);
String seqNa... | [
"private",
"void",
"checkSequenceName",
"(",
"FieldDescriptorDef",
"fieldDef",
",",
"String",
"checkLevel",
")",
"throws",
"ConstraintException",
"{",
"if",
"(",
"CHECKLEVEL_NONE",
".",
"equals",
"(",
"checkLevel",
")",
")",
"{",
"return",
";",
"}",
"String",
"a... | Checks that sequence-name is only used with autoincrement='ojb'
@param fieldDef The field descriptor
@param checkLevel The current check level (this constraint is checked in basic and strict)
@exception ConstraintException If the constraint has been violated | [
"Checks",
"that",
"sequence",
"-",
"name",
"is",
"only",
"used",
"with",
"autoincrement",
"=",
"ojb"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/constraints/FieldDescriptorConstraints.java#L339-L356 |
landawn/AbacusUtil | src/com/landawn/abacus/util/Matth.java | Matth.log2 | @SuppressWarnings("fallthrough")
// TODO(kevinb): remove after this warning is disabled globally
public static int log2(BigInteger x, RoundingMode mode) {
checkPositive("x", N.checkArgNotNull(x));
int logFloor = x.bitLength() - 1;
switch (mode) {
case UNNECESSARY:
... | java | @SuppressWarnings("fallthrough")
// TODO(kevinb): remove after this warning is disabled globally
public static int log2(BigInteger x, RoundingMode mode) {
checkPositive("x", N.checkArgNotNull(x));
int logFloor = x.bitLength() - 1;
switch (mode) {
case UNNECESSARY:
... | [
"@",
"SuppressWarnings",
"(",
"\"fallthrough\"",
")",
"// TODO(kevinb): remove after this warning is disabled globally\r",
"public",
"static",
"int",
"log2",
"(",
"BigInteger",
"x",
",",
"RoundingMode",
"mode",
")",
"{",
"checkPositive",
"(",
"\"x\"",
",",
"N",
".",
"... | Returns the base-2 logarithm of {@code x}, rounded according to the specified rounding mode.
@throws IllegalArgumentException if {@code x <= 0}
@throws ArithmeticException if {@code mode} is {@link RoundingMode#UNNECESSARY} and {@code x}
is not a power of two | [
"Returns",
"the",
"base",
"-",
"2",
"logarithm",
"of",
"{",
"@code",
"x",
"}",
"rounded",
"according",
"to",
"the",
"specified",
"rounding",
"mode",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Matth.java#L474-L512 |
mapbox/mapbox-events-android | liblocation/src/main/java/com/mapbox/android/core/location/LocationEngineProvider.java | LocationEngineProvider.getBestLocationEngine | @NonNull
public static LocationEngine getBestLocationEngine(@NonNull Context context) {
checkNotNull(context, "context == null");
boolean hasGoogleLocationServices = isOnClasspath(GOOGLE_LOCATION_SERVICES);
if (isOnClasspath(GOOGLE_API_AVAILABILITY)) {
// Check Google Play services APK is available... | java | @NonNull
public static LocationEngine getBestLocationEngine(@NonNull Context context) {
checkNotNull(context, "context == null");
boolean hasGoogleLocationServices = isOnClasspath(GOOGLE_LOCATION_SERVICES);
if (isOnClasspath(GOOGLE_API_AVAILABILITY)) {
// Check Google Play services APK is available... | [
"@",
"NonNull",
"public",
"static",
"LocationEngine",
"getBestLocationEngine",
"(",
"@",
"NonNull",
"Context",
"context",
")",
"{",
"checkNotNull",
"(",
"context",
",",
"\"context == null\"",
")",
";",
"boolean",
"hasGoogleLocationServices",
"=",
"isOnClasspath",
"(",... | Returns instance to the best location engine, given the included libraries.
@param context {@link Context}.
@return a unique instance of {@link LocationEngine} every time method is called.
@since 1.1.0 | [
"Returns",
"instance",
"to",
"the",
"best",
"location",
"engine",
"given",
"the",
"included",
"libraries",
"."
] | train | https://github.com/mapbox/mapbox-events-android/blob/5b5ca7e04cb8fab31a8dc040b6e7521f930a58a4/liblocation/src/main/java/com/mapbox/android/core/location/LocationEngineProvider.java#L43-L54 |
j256/simplecsv | src/main/java/com/j256/simplecsv/processor/CsvProcessor.java | CsvProcessor.writeRow | public void writeRow(BufferedWriter bufferedWriter, T entity, boolean appendLineTermination) throws IOException {
checkEntityConfig();
String line = buildLine(entity, appendLineTermination);
bufferedWriter.write(line);
} | java | public void writeRow(BufferedWriter bufferedWriter, T entity, boolean appendLineTermination) throws IOException {
checkEntityConfig();
String line = buildLine(entity, appendLineTermination);
bufferedWriter.write(line);
} | [
"public",
"void",
"writeRow",
"(",
"BufferedWriter",
"bufferedWriter",
",",
"T",
"entity",
",",
"boolean",
"appendLineTermination",
")",
"throws",
"IOException",
"{",
"checkEntityConfig",
"(",
")",
";",
"String",
"line",
"=",
"buildLine",
"(",
"entity",
",",
"ap... | Write an entity row to the writer.
@param bufferedWriter
Where to write our header information.
@param entity
The entity we are writing to the buffered writer.
@param appendLineTermination
Set to true to add the newline to the end of the line.
@throws IOException
If there are any IO exceptions thrown when writing. | [
"Write",
"an",
"entity",
"row",
"to",
"the",
"writer",
"."
] | train | https://github.com/j256/simplecsv/blob/964fe53073c43e2a311341e3f8fd2c94372f60cb/src/main/java/com/j256/simplecsv/processor/CsvProcessor.java#L468-L472 |
ggrandes/packer | src/main/java/org/javastack/packer/Packer.java | Packer.useAES | public Packer useAES(final String passphrase, final String sharedIV) throws NoSuchAlgorithmException,
NoSuchPaddingException {
initCipher();
initCipherIV(generateMdfromString(sharedIV, aesCipherLen), AESTYPEIV.SHARED_IV);
initCipherKey(passphrase);
return this;
} | java | public Packer useAES(final String passphrase, final String sharedIV) throws NoSuchAlgorithmException,
NoSuchPaddingException {
initCipher();
initCipherIV(generateMdfromString(sharedIV, aesCipherLen), AESTYPEIV.SHARED_IV);
initCipherKey(passphrase);
return this;
} | [
"public",
"Packer",
"useAES",
"(",
"final",
"String",
"passphrase",
",",
"final",
"String",
"sharedIV",
")",
"throws",
"NoSuchAlgorithmException",
",",
"NoSuchPaddingException",
"{",
"initCipher",
"(",
")",
";",
"initCipherIV",
"(",
"generateMdfromString",
"(",
"sha... | Sets he usage of "AES/CBC/PKCS5Padding" with pre-shared IV for encryption (default no)
@param passphrase shared secret
@param sharedIV shared Initialization Vector
@return
@throws NoSuchAlgorithmException
@throws NoSuchPaddingException | [
"Sets",
"he",
"usage",
"of",
"AES",
"/",
"CBC",
"/",
"PKCS5Padding",
"with",
"pre",
"-",
"shared",
"IV",
"for",
"encryption",
"(",
"default",
"no",
")"
] | train | https://github.com/ggrandes/packer/blob/0b37b286a3d0555050eb2e65419dd74f8d8d3e78/src/main/java/org/javastack/packer/Packer.java#L329-L335 |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/TokenCachingStrategy.java | TokenCachingStrategy.getExpirationDate | public static Date getExpirationDate(Bundle bundle) {
Validate.notNull(bundle, "bundle");
return getDate(bundle, EXPIRATION_DATE_KEY);
} | java | public static Date getExpirationDate(Bundle bundle) {
Validate.notNull(bundle, "bundle");
return getDate(bundle, EXPIRATION_DATE_KEY);
} | [
"public",
"static",
"Date",
"getExpirationDate",
"(",
"Bundle",
"bundle",
")",
"{",
"Validate",
".",
"notNull",
"(",
"bundle",
",",
"\"bundle\"",
")",
";",
"return",
"getDate",
"(",
"bundle",
",",
"EXPIRATION_DATE_KEY",
")",
";",
"}"
] | Gets the cached expiration date from a Bundle.
@param bundle
A Bundle in which the expiration date was stored.
@return the cached expiration date, or null.
@throws NullPointerException if the passed in Bundle is null | [
"Gets",
"the",
"cached",
"expiration",
"date",
"from",
"a",
"Bundle",
"."
] | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/TokenCachingStrategy.java#L185-L188 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/AppServiceCertificateOrdersInner.java | AppServiceCertificateOrdersInner.retrieveCertificateEmailHistoryAsync | public Observable<List<CertificateEmailInner>> retrieveCertificateEmailHistoryAsync(String resourceGroupName, String name) {
return retrieveCertificateEmailHistoryWithServiceResponseAsync(resourceGroupName, name).map(new Func1<ServiceResponse<List<CertificateEmailInner>>, List<CertificateEmailInner>>() {
... | java | public Observable<List<CertificateEmailInner>> retrieveCertificateEmailHistoryAsync(String resourceGroupName, String name) {
return retrieveCertificateEmailHistoryWithServiceResponseAsync(resourceGroupName, name).map(new Func1<ServiceResponse<List<CertificateEmailInner>>, List<CertificateEmailInner>>() {
... | [
"public",
"Observable",
"<",
"List",
"<",
"CertificateEmailInner",
">",
">",
"retrieveCertificateEmailHistoryAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"name",
")",
"{",
"return",
"retrieveCertificateEmailHistoryWithServiceResponseAsync",
"(",
"resourceGroupNa... | Retrieve email history.
Retrieve email history.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the certificate order.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the List<CertificateEmailInner> object | [
"Retrieve",
"email",
"history",
".",
"Retrieve",
"email",
"history",
"."
] | 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/AppServiceCertificateOrdersInner.java#L2351-L2358 |
aws/aws-sdk-java | aws-java-sdk-amplify/src/main/java/com/amazonaws/services/amplify/model/UpdateBranchRequest.java | UpdateBranchRequest.withEnvironmentVariables | public UpdateBranchRequest withEnvironmentVariables(java.util.Map<String, String> environmentVariables) {
setEnvironmentVariables(environmentVariables);
return this;
} | java | public UpdateBranchRequest withEnvironmentVariables(java.util.Map<String, String> environmentVariables) {
setEnvironmentVariables(environmentVariables);
return this;
} | [
"public",
"UpdateBranchRequest",
"withEnvironmentVariables",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"environmentVariables",
")",
"{",
"setEnvironmentVariables",
"(",
"environmentVariables",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Environment Variables for the branch.
</p>
@param environmentVariables
Environment Variables for the branch.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"Environment",
"Variables",
"for",
"the",
"branch",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-amplify/src/main/java/com/amazonaws/services/amplify/model/UpdateBranchRequest.java#L462-L465 |
qiniu/android-sdk | library/src/main/java/com/qiniu/android/utils/Crc32.java | Crc32.bytes | public static long bytes(byte[] data, int offset, int length) {
CRC32 crc32 = new CRC32();
crc32.update(data, offset, length);
return crc32.getValue();
} | java | public static long bytes(byte[] data, int offset, int length) {
CRC32 crc32 = new CRC32();
crc32.update(data, offset, length);
return crc32.getValue();
} | [
"public",
"static",
"long",
"bytes",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"CRC32",
"crc32",
"=",
"new",
"CRC32",
"(",
")",
";",
"crc32",
".",
"update",
"(",
"data",
",",
"offset",
",",
"length",
")",
... | 计算二进制字节校验码
@param data 二进制数据
@param offset 起始字节索引
@param length 校验字节长度
@return 校验码 | [
"计算二进制字节校验码"
] | train | https://github.com/qiniu/android-sdk/blob/dbd2a01fb3bff7a5e75e8934bbf81713124d8466/library/src/main/java/com/qiniu/android/utils/Crc32.java#L21-L25 |
JavaMoney/jsr354-ri | moneta-core/src/main/java/org/javamoney/moneta/CurrencyUnitBuilder.java | CurrencyUnitBuilder.of | public static CurrencyUnitBuilder of(String currencyCode, String providerName) {
return new CurrencyUnitBuilder(currencyCode, CurrencyContextBuilder.of(providerName).build());
} | java | public static CurrencyUnitBuilder of(String currencyCode, String providerName) {
return new CurrencyUnitBuilder(currencyCode, CurrencyContextBuilder.of(providerName).build());
} | [
"public",
"static",
"CurrencyUnitBuilder",
"of",
"(",
"String",
"currencyCode",
",",
"String",
"providerName",
")",
"{",
"return",
"new",
"CurrencyUnitBuilder",
"(",
"currencyCode",
",",
"CurrencyContextBuilder",
".",
"of",
"(",
"providerName",
")",
".",
"build",
... | Creates a new CurrencyUnitBuilder, creates a simple CurrencyContext using the given provider name.
@param currencyCode the (unique) and identifying currency code, not null.
@param providerName the currency provider, not null. | [
"Creates",
"a",
"new",
"CurrencyUnitBuilder",
"creates",
"a",
"simple",
"CurrencyContext",
"using",
"the",
"given",
"provider",
"name",
"."
] | train | https://github.com/JavaMoney/jsr354-ri/blob/cf8ff2bbaf9b115acc05eb9b0c76c8397c308284/moneta-core/src/main/java/org/javamoney/moneta/CurrencyUnitBuilder.java#L70-L72 |
Azure/azure-sdk-for-java | kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabasesInner.java | DatabasesInner.beginUpdate | public DatabaseInner beginUpdate(String resourceGroupName, String clusterName, String databaseName, DatabaseUpdate parameters) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters).toBlocking().single().body();
} | java | public DatabaseInner beginUpdate(String resourceGroupName, String clusterName, String databaseName, DatabaseUpdate parameters) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, clusterName, databaseName, parameters).toBlocking().single().body();
} | [
"public",
"DatabaseInner",
"beginUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
",",
"String",
"databaseName",
",",
"DatabaseUpdate",
"parameters",
")",
"{",
"return",
"beginUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"clust... | Updates a database.
@param resourceGroupName The name of the resource group containing the Kusto cluster.
@param clusterName The name of the Kusto cluster.
@param databaseName The name of the database in the Kusto cluster.
@param parameters The database parameters supplied to the Update operation.
@throws IllegalArgum... | [
"Updates",
"a",
"database",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/kusto/resource-manager/v2018_09_07_preview/src/main/java/com/microsoft/azure/management/kusto/v2018_09_07_preview/implementation/DatabasesInner.java#L676-L678 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/MMCIFFileTools.java | MMCIFFileTools.toLoopMmCifHeaderString | public static String toLoopMmCifHeaderString(String categoryName, String className) throws ClassNotFoundException {
StringBuilder str = new StringBuilder();
str.append(SimpleMMcifParser.LOOP_START+newline);
Class<?> c = Class.forName(className);
for (Field f : getFields(c)) {
str.append(categoryName+"."+f... | java | public static String toLoopMmCifHeaderString(String categoryName, String className) throws ClassNotFoundException {
StringBuilder str = new StringBuilder();
str.append(SimpleMMcifParser.LOOP_START+newline);
Class<?> c = Class.forName(className);
for (Field f : getFields(c)) {
str.append(categoryName+"."+f... | [
"public",
"static",
"String",
"toLoopMmCifHeaderString",
"(",
"String",
"categoryName",
",",
"String",
"className",
")",
"throws",
"ClassNotFoundException",
"{",
"StringBuilder",
"str",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"str",
".",
"append",
"(",
"Simple... | Produces a mmCIF loop header string for the given categoryName and className.
className must be one of the beans in the {@link org.biojava.nbio.structure.io.mmcif.model} package
@param categoryName
@param className
@return
@throws ClassNotFoundException if the given className can not be found | [
"Produces",
"a",
"mmCIF",
"loop",
"header",
"string",
"for",
"the",
"given",
"categoryName",
"and",
"className",
".",
"className",
"must",
"be",
"one",
"of",
"the",
"beans",
"in",
"the",
"{"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/MMCIFFileTools.java#L87-L99 |
kiswanij/jk-util | src/main/java/com/jk/util/validation/builtin/ValidationBundle.java | ValidationBundle.getMessage | public static String getMessage(final Class class1, final String string, final String compName) {
return JKMessage.get(string, compName);
} | java | public static String getMessage(final Class class1, final String string, final String compName) {
return JKMessage.get(string, compName);
} | [
"public",
"static",
"String",
"getMessage",
"(",
"final",
"Class",
"class1",
",",
"final",
"String",
"string",
",",
"final",
"String",
"compName",
")",
"{",
"return",
"JKMessage",
".",
"get",
"(",
"string",
",",
"compName",
")",
";",
"}"
] | Gets the message.
@param class1 the class 1
@param string the string
@param compName the comp name
@return the message | [
"Gets",
"the",
"message",
"."
] | train | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/validation/builtin/ValidationBundle.java#L61-L63 |
cybazeitalia/emaze-dysfunctional | src/main/java/net/emaze/dysfunctional/Spies.java | Spies.spy3rd | public static <T1, T2, T3, R> TriFunction<T1, T2, T3, R> spy3rd(TriFunction<T1, T2, T3, R> function, Box<T3> param3) {
return spy(function, Box.<R>empty(), Box.<T1>empty(), Box.<T2>empty(), param3);
} | java | public static <T1, T2, T3, R> TriFunction<T1, T2, T3, R> spy3rd(TriFunction<T1, T2, T3, R> function, Box<T3> param3) {
return spy(function, Box.<R>empty(), Box.<T1>empty(), Box.<T2>empty(), param3);
} | [
"public",
"static",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"R",
">",
"TriFunction",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"R",
">",
"spy3rd",
"(",
"TriFunction",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"R",
">",
"function",
",",
"Box",
"<",
"T3"... | Proxies a ternary function spying for third parameter.
@param <R> the function result type
@param <T1> the function first parameter type
@param <T2> the function second parameter type
@param <T3> the function third parameter type
@param function the function that will be spied
@param param3 a box that will be containi... | [
"Proxies",
"a",
"ternary",
"function",
"spying",
"for",
"third",
"parameter",
"."
] | train | https://github.com/cybazeitalia/emaze-dysfunctional/blob/98115a436e35335c5e8831f9fdc12f6d93d524be/src/main/java/net/emaze/dysfunctional/Spies.java#L239-L241 |
fabric8io/kubernetes-client | kubernetes-client/src/main/java/io/fabric8/kubernetes/client/utils/Utils.java | Utils.replaceAllWithoutRegex | public static String replaceAllWithoutRegex(String text, String from, String to) {
if (text == null) {
return null;
}
int idx = 0;
while (true) {
idx = text.indexOf(from, idx);
if (idx >= 0) {
text = text.substring(0, idx) + to + text.substring(idx + from.length());
//... | java | public static String replaceAllWithoutRegex(String text, String from, String to) {
if (text == null) {
return null;
}
int idx = 0;
while (true) {
idx = text.indexOf(from, idx);
if (idx >= 0) {
text = text.substring(0, idx) + to + text.substring(idx + from.length());
//... | [
"public",
"static",
"String",
"replaceAllWithoutRegex",
"(",
"String",
"text",
",",
"String",
"from",
",",
"String",
"to",
")",
"{",
"if",
"(",
"text",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"int",
"idx",
"=",
"0",
";",
"while",
"(",
"tr... | Replaces all occurrences of the from text with to text without any regular expressions
@param text text string
@param from from string
@param to to string
@return returns processed string | [
"Replaces",
"all",
"occurrences",
"of",
"the",
"from",
"text",
"with",
"to",
"text",
"without",
"any",
"regular",
"expressions"
] | train | https://github.com/fabric8io/kubernetes-client/blob/141668a882ed8e902c045a5cd0a80f14bd17d132/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/utils/Utils.java#L260-L277 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.changeEmail_POST | public OvhTask changeEmail_POST(String newEmail) throws IOException {
String qPath = "/me/changeEmail";
StringBuilder sb = path(qPath);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "newEmail", newEmail);
String resp = exec(qPath, "POST", sb.toString(), o);
return convertTo(resp, OvhT... | java | public OvhTask changeEmail_POST(String newEmail) throws IOException {
String qPath = "/me/changeEmail";
StringBuilder sb = path(qPath);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "newEmail", newEmail);
String resp = exec(qPath, "POST", sb.toString(), o);
return convertTo(resp, OvhT... | [
"public",
"OvhTask",
"changeEmail_POST",
"(",
"String",
"newEmail",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/changeEmail\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
")",
";",
"HashMap",
"<",
"String",
",",
"Object",
">",... | Initiate an email change procedure
REST: POST /me/changeEmail
@param newEmail [required] New email to associate to your account | [
"Initiate",
"an",
"email",
"change",
"procedure"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L2674-L2681 |
jroyalty/jglm | src/main/java/com/hackoeur/jglm/support/Precision.java | Precision.equalsIncludingNaN | public static boolean equalsIncludingNaN(float x, float y) {
return (Float.isNaN(x) && Float.isNaN(y)) || equals(x, y, 1);
} | java | public static boolean equalsIncludingNaN(float x, float y) {
return (Float.isNaN(x) && Float.isNaN(y)) || equals(x, y, 1);
} | [
"public",
"static",
"boolean",
"equalsIncludingNaN",
"(",
"float",
"x",
",",
"float",
"y",
")",
"{",
"return",
"(",
"Float",
".",
"isNaN",
"(",
"x",
")",
"&&",
"Float",
".",
"isNaN",
"(",
"y",
")",
")",
"||",
"equals",
"(",
"x",
",",
"y",
",",
"1... | Returns true if both arguments are NaN or neither is NaN and they are
equal as defined by {@link #equals(float,float) equals(x, y, 1)}.
@param x first value
@param y second value
@return {@code true} if the values are equal or both are NaN.
@since 2.2 | [
"Returns",
"true",
"if",
"both",
"arguments",
"are",
"NaN",
"or",
"neither",
"is",
"NaN",
"and",
"they",
"are",
"equal",
"as",
"defined",
"by",
"{",
"@link",
"#equals",
"(",
"float",
"float",
")",
"equals",
"(",
"x",
"y",
"1",
")",
"}",
"."
] | train | https://github.com/jroyalty/jglm/blob/9397c2fcf0d4d62844c64d0b14065ee7bf8cafc6/src/main/java/com/hackoeur/jglm/support/Precision.java#L147-L149 |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementBase.java | ElementBase.addChild | protected void addChild(ElementBase child, boolean doEvent) {
if (!child.canAcceptParent(this)) {
CWFException.raise(child.rejectReason);
}
if (!canAcceptChild(child)) {
CWFException.raise(rejectReason);
}
if (doEvent) {
befor... | java | protected void addChild(ElementBase child, boolean doEvent) {
if (!child.canAcceptParent(this)) {
CWFException.raise(child.rejectReason);
}
if (!canAcceptChild(child)) {
CWFException.raise(rejectReason);
}
if (doEvent) {
befor... | [
"protected",
"void",
"addChild",
"(",
"ElementBase",
"child",
",",
"boolean",
"doEvent",
")",
"{",
"if",
"(",
"!",
"child",
".",
"canAcceptParent",
"(",
"this",
")",
")",
"{",
"CWFException",
".",
"raise",
"(",
"child",
".",
"rejectReason",
")",
";",
"}"... | Adds the specified child element. The validity of the operation is first tested and an
exception thrown if the element is not a valid child for this parent.
@param child Element to add as a child.
@param doEvent Fires the add child events if true. | [
"Adds",
"the",
"specified",
"child",
"element",
".",
"The",
"validity",
"of",
"the",
"operation",
"is",
"first",
"tested",
"and",
"an",
"exception",
"thrown",
"if",
"the",
"element",
"is",
"not",
"a",
"valid",
"child",
"for",
"this",
"parent",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementBase.java#L155-L178 |
Netflix/astyanax | astyanax-thrift/src/main/java/com/netflix/astyanax/thrift/ThriftKeyspaceImpl.java | ThriftKeyspaceImpl.toThriftKeyspaceDefinition | private ThriftKeyspaceDefinitionImpl toThriftKeyspaceDefinition(final Map<String, Object> options) {
ThriftKeyspaceDefinitionImpl def = new ThriftKeyspaceDefinitionImpl();
Map<String, Object> internalOptions = Maps.newHashMap();
if (options != null)
internalOptions.putAll(op... | java | private ThriftKeyspaceDefinitionImpl toThriftKeyspaceDefinition(final Map<String, Object> options) {
ThriftKeyspaceDefinitionImpl def = new ThriftKeyspaceDefinitionImpl();
Map<String, Object> internalOptions = Maps.newHashMap();
if (options != null)
internalOptions.putAll(op... | [
"private",
"ThriftKeyspaceDefinitionImpl",
"toThriftKeyspaceDefinition",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"options",
")",
"{",
"ThriftKeyspaceDefinitionImpl",
"def",
"=",
"new",
"ThriftKeyspaceDefinitionImpl",
"(",
")",
";",
"Map",
"<",
"String"... | Convert a Map of options to an internal thrift keyspace definition
@param options | [
"Convert",
"a",
"Map",
"of",
"options",
"to",
"an",
"internal",
"thrift",
"keyspace",
"definition"
] | train | https://github.com/Netflix/astyanax/blob/bcc3fd26e2dda05a923751aa32b139f6209fecdf/astyanax-thrift/src/main/java/com/netflix/astyanax/thrift/ThriftKeyspaceImpl.java#L800-L819 |
telly/groundy | library/src/main/java/com/telly/groundy/TaskResult.java | TaskResult.add | public TaskResult add(String key, ArrayList<CharSequence> value) {
mBundle.putCharSequenceArrayList(key, value);
return this;
} | java | public TaskResult add(String key, ArrayList<CharSequence> value) {
mBundle.putCharSequenceArrayList(key, value);
return this;
} | [
"public",
"TaskResult",
"add",
"(",
"String",
"key",
",",
"ArrayList",
"<",
"CharSequence",
">",
"value",
")",
"{",
"mBundle",
".",
"putCharSequenceArrayList",
"(",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Inserts an ArrayList<CharSequence> value into the mapping of this Bundle, replacing any
existing value for the given key. Either key or value may be null.
@param key a String, or null
@param value an ArrayList<CharSequence> object, or null | [
"Inserts",
"an",
"ArrayList<CharSequence",
">",
"value",
"into",
"the",
"mapping",
"of",
"this",
"Bundle",
"replacing",
"any",
"existing",
"value",
"for",
"the",
"given",
"key",
".",
"Either",
"key",
"or",
"value",
"may",
"be",
"null",
"."
] | train | https://github.com/telly/groundy/blob/e90baf9901a8be20b348bd1575d5ad782560cec8/library/src/main/java/com/telly/groundy/TaskResult.java#L251-L254 |
smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/SearchResourcesImpl.java | SearchResourcesImpl.searchSheet | public SearchResult searchSheet(long sheetId, String query) throws SmartsheetException {
Util.throwIfNull(query);
Util.throwIfEmpty(query);
try {
return this.getResource("search/sheets/" + sheetId + "?query=" + URLEncoder.encode(query,
"utf-8"), SearchResult.class... | java | public SearchResult searchSheet(long sheetId, String query) throws SmartsheetException {
Util.throwIfNull(query);
Util.throwIfEmpty(query);
try {
return this.getResource("search/sheets/" + sheetId + "?query=" + URLEncoder.encode(query,
"utf-8"), SearchResult.class... | [
"public",
"SearchResult",
"searchSheet",
"(",
"long",
"sheetId",
",",
"String",
"query",
")",
"throws",
"SmartsheetException",
"{",
"Util",
".",
"throwIfNull",
"(",
"query",
")",
";",
"Util",
".",
"throwIfEmpty",
"(",
"query",
")",
";",
"try",
"{",
"return",... | Performs a search within a sheet.
It mirrors to the following Smartsheet REST API method: GET /search/sheet/{sheetId}
Exceptions:
IllegalArgumentException : if query is null/empty string
InvalidRequestException : if there is any problem with the REST API request
AuthorizationException : if there is any problem with t... | [
"Performs",
"a",
"search",
"within",
"a",
"sheet",
"."
] | train | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/SearchResourcesImpl.java#L146-L155 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/SimpleAttributeDefinition.java | SimpleAttributeDefinition.marshallAsAttribute | public void marshallAsAttribute(final ModelNode resourceModel, final boolean marshallDefault, final XMLStreamWriter writer) throws XMLStreamException {
getMarshaller().marshallAsAttribute(this, resourceModel, marshallDefault, writer);
} | java | public void marshallAsAttribute(final ModelNode resourceModel, final boolean marshallDefault, final XMLStreamWriter writer) throws XMLStreamException {
getMarshaller().marshallAsAttribute(this, resourceModel, marshallDefault, writer);
} | [
"public",
"void",
"marshallAsAttribute",
"(",
"final",
"ModelNode",
"resourceModel",
",",
"final",
"boolean",
"marshallDefault",
",",
"final",
"XMLStreamWriter",
"writer",
")",
"throws",
"XMLStreamException",
"{",
"getMarshaller",
"(",
")",
".",
"marshallAsAttribute",
... | Marshalls the value from the given {@code resourceModel} as an xml attribute, if it
{@link #isMarshallable(org.jboss.dmr.ModelNode, boolean) is marshallable}.
@param resourceModel the model, a non-null node of {@link org.jboss.dmr.ModelType#OBJECT}.
@param marshallDefault {@code true} if the value should be marshalled ... | [
"Marshalls",
"the",
"value",
"from",
"the",
"given",
"{"
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/SimpleAttributeDefinition.java#L144-L146 |
crowmagnumb/s6-util | src/main/java/net/crowmagnumb/util/string/AlphanumComparator.java | AlphanumComparator.getChunk | private final String getChunk(String s, int slength, int marker)
{
StringBuilder chunk = new StringBuilder();
char c = s.charAt(marker);
chunk.append(c);
marker++;
if (isDigit(c))
{
while (marker < slength)
{
c = s.charAt(marker... | java | private final String getChunk(String s, int slength, int marker)
{
StringBuilder chunk = new StringBuilder();
char c = s.charAt(marker);
chunk.append(c);
marker++;
if (isDigit(c))
{
while (marker < slength)
{
c = s.charAt(marker... | [
"private",
"final",
"String",
"getChunk",
"(",
"String",
"s",
",",
"int",
"slength",
",",
"int",
"marker",
")",
"{",
"StringBuilder",
"chunk",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"char",
"c",
"=",
"s",
".",
"charAt",
"(",
"marker",
")",
";",
... | Length of string is passed in for improved efficiency (only need to calculate it once) * | [
"Length",
"of",
"string",
"is",
"passed",
"in",
"for",
"improved",
"efficiency",
"(",
"only",
"need",
"to",
"calculate",
"it",
"once",
")",
"*"
] | train | https://github.com/crowmagnumb/s6-util/blob/0f9969bc0809e8a617501fa57c135e9b3984fae0/src/main/java/net/crowmagnumb/util/string/AlphanumComparator.java#L90-L118 |
mapfish/mapfish-print | core/src/main/java/org/mapfish/print/config/Template.java | Template.setAttributes | public final void setAttributes(final Map<String, Attribute> attributes) {
for (Map.Entry<String, Attribute> entry: attributes.entrySet()) {
Object attribute = entry.getValue();
if (!(attribute instanceof Attribute)) {
final String msg =
"Attribute... | java | public final void setAttributes(final Map<String, Attribute> attributes) {
for (Map.Entry<String, Attribute> entry: attributes.entrySet()) {
Object attribute = entry.getValue();
if (!(attribute instanceof Attribute)) {
final String msg =
"Attribute... | [
"public",
"final",
"void",
"setAttributes",
"(",
"final",
"Map",
"<",
"String",
",",
"Attribute",
">",
"attributes",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"Attribute",
">",
"entry",
":",
"attributes",
".",
"entrySet",
"(",
")",
... | Set the attributes for this template.
@param attributes the attribute map | [
"Set",
"the",
"attributes",
"for",
"this",
"template",
"."
] | train | https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/config/Template.java#L138-L151 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.osgi/src/com/ibm/ws/logging/internal/osgi/MessageRouterImpl.java | MessageRouterImpl.addMsgToLogHandler | protected void addMsgToLogHandler(String msgId, String handlerId) {
Set<String> logHandlerIdSet = getOrCreateLogHandlerIdSet(msgId);
logHandlerIdSet.add(handlerId);
} | java | protected void addMsgToLogHandler(String msgId, String handlerId) {
Set<String> logHandlerIdSet = getOrCreateLogHandlerIdSet(msgId);
logHandlerIdSet.add(handlerId);
} | [
"protected",
"void",
"addMsgToLogHandler",
"(",
"String",
"msgId",
",",
"String",
"handlerId",
")",
"{",
"Set",
"<",
"String",
">",
"logHandlerIdSet",
"=",
"getOrCreateLogHandlerIdSet",
"(",
"msgId",
")",
";",
"logHandlerIdSet",
".",
"add",
"(",
"handlerId",
")"... | Add the specified log handler to the message ID's routing list. | [
"Add",
"the",
"specified",
"log",
"handler",
"to",
"the",
"message",
"ID",
"s",
"routing",
"list",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.osgi/src/com/ibm/ws/logging/internal/osgi/MessageRouterImpl.java#L170-L173 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/dsl/functions/DateFunctions.java | DateFunctions.millisToStr | public static Expression millisToStr(Expression expression, String format) {
if (format == null || format.isEmpty()) {
return x("MILLIS_TO_STR(" + expression.toString() + ")");
}
return x("MILLIS_TO_STR(" + expression.toString() + ", \"" + format + "\")");
} | java | public static Expression millisToStr(Expression expression, String format) {
if (format == null || format.isEmpty()) {
return x("MILLIS_TO_STR(" + expression.toString() + ")");
}
return x("MILLIS_TO_STR(" + expression.toString() + ", \"" + format + "\")");
} | [
"public",
"static",
"Expression",
"millisToStr",
"(",
"Expression",
"expression",
",",
"String",
"format",
")",
"{",
"if",
"(",
"format",
"==",
"null",
"||",
"format",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"x",
"(",
"\"MILLIS_TO_STR(\"",
"+",
"expr... | Returned expression results in the string in the supported format to which
the UNIX milliseconds has been converted. | [
"Returned",
"expression",
"results",
"in",
"the",
"string",
"in",
"the",
"supported",
"format",
"to",
"which",
"the",
"UNIX",
"milliseconds",
"has",
"been",
"converted",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/dsl/functions/DateFunctions.java#L232-L237 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/LongExtensions.java | LongExtensions.operator_greaterEqualsThan | @Pure
@Inline(value="($1 >= $2)", constantExpression=true)
public static boolean operator_greaterEqualsThan(long a, double b) {
return a >= b;
} | java | @Pure
@Inline(value="($1 >= $2)", constantExpression=true)
public static boolean operator_greaterEqualsThan(long a, double b) {
return a >= b;
} | [
"@",
"Pure",
"@",
"Inline",
"(",
"value",
"=",
"\"($1 >= $2)\"",
",",
"constantExpression",
"=",
"true",
")",
"public",
"static",
"boolean",
"operator_greaterEqualsThan",
"(",
"long",
"a",
",",
"double",
"b",
")",
"{",
"return",
"a",
">=",
"b",
";",
"}"
] | The binary <code>greaterEqualsThan</code> operator. This is the equivalent to the Java <code>>=</code> operator.
@param a a long.
@param b a double.
@return <code>a>=b</code>
@since 2.3 | [
"The",
"binary",
"<code",
">",
"greaterEqualsThan<",
"/",
"code",
">",
"operator",
".",
"This",
"is",
"the",
"equivalent",
"to",
"the",
"Java",
"<code",
">",
">",
";",
"=",
"<",
"/",
"code",
">",
"operator",
"."
] | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/LongExtensions.java#L362-L366 |
cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicBondGenerator.java | BasicBondGenerator.generateBondElement | public IRenderingElement generateBondElement(IBond bond, RendererModel model) {
return generateBondElement(bond, bond.getOrder(), model);
} | java | public IRenderingElement generateBondElement(IBond bond, RendererModel model) {
return generateBondElement(bond, bond.getOrder(), model);
} | [
"public",
"IRenderingElement",
"generateBondElement",
"(",
"IBond",
"bond",
",",
"RendererModel",
"model",
")",
"{",
"return",
"generateBondElement",
"(",
"bond",
",",
"bond",
".",
"getOrder",
"(",
")",
",",
"model",
")",
";",
"}"
] | Generate rendering elements for a bond, without ring elements but
considering the type of the bond (single, double, triple).
@param bond the bond to use when generating elements
@param model the renderer model
@return one or more rendering elements | [
"Generate",
"rendering",
"elements",
"for",
"a",
"bond",
"without",
"ring",
"elements",
"but",
"considering",
"the",
"type",
"of",
"the",
"bond",
"(",
"single",
"double",
"triple",
")",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/BasicBondGenerator.java#L295-L297 |
recruit-mp/android-RMP-Appirater | library/src/main/java/jp/co/recruit_mp/android/rmp_appirater/RmpAppirater.java | RmpAppirater.setFirstLaunchDate | public static void setFirstLaunchDate(Context context, long firstLaunchDate) {
SharedPreferences prefs = getSharedPreferences(context);
SharedPreferences.Editor prefsEditor = prefs.edit();
prefsEditor.putLong(PREF_KEY_APP_FIRST_LAUNCHED_DATE, firstLaunchDate);
prefsEditor.commit();
... | java | public static void setFirstLaunchDate(Context context, long firstLaunchDate) {
SharedPreferences prefs = getSharedPreferences(context);
SharedPreferences.Editor prefsEditor = prefs.edit();
prefsEditor.putLong(PREF_KEY_APP_FIRST_LAUNCHED_DATE, firstLaunchDate);
prefsEditor.commit();
... | [
"public",
"static",
"void",
"setFirstLaunchDate",
"(",
"Context",
"context",
",",
"long",
"firstLaunchDate",
")",
"{",
"SharedPreferences",
"prefs",
"=",
"getSharedPreferences",
"(",
"context",
")",
";",
"SharedPreferences",
".",
"Editor",
"prefsEditor",
"=",
"prefs... | Modify internal value.
<p/>
If you use this method, you might need to have a good understanding of this class code.
@param context Context
@param firstLaunchDate First launch date. | [
"Modify",
"internal",
"value",
".",
"<p",
"/",
">",
"If",
"you",
"use",
"this",
"method",
"you",
"might",
"need",
"to",
"have",
"a",
"good",
"understanding",
"of",
"this",
"class",
"code",
"."
] | train | https://github.com/recruit-mp/android-RMP-Appirater/blob/14fcdf110dfb97120303f39aab1de9393e84b90a/library/src/main/java/jp/co/recruit_mp/android/rmp_appirater/RmpAppirater.java#L341-L348 |
softindex/datakernel | cloud-dataflow/src/main/java/io/datakernel/dataflow/server/DatagraphEnvironment.java | DatagraphEnvironment.setInstance | @SuppressWarnings("unchecked")
public <T> DatagraphEnvironment setInstance(Class<T> type, T value) {
((Map<Class<T>, T>) instances).put(type, value);
return this;
} | java | @SuppressWarnings("unchecked")
public <T> DatagraphEnvironment setInstance(Class<T> type, T value) {
((Map<Class<T>, T>) instances).put(type, value);
return this;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"DatagraphEnvironment",
"setInstance",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"T",
"value",
")",
"{",
"(",
"(",
"Map",
"<",
"Class",
"<",
"T",
">",
",",
"T",
">",
")",
... | Sets the specified instance for the given key (instance type).
@param type instance type
@param value instance
@param <T> type of the instance
@return this environment | [
"Sets",
"the",
"specified",
"instance",
"for",
"the",
"given",
"key",
"(",
"instance",
"type",
")",
"."
] | train | https://github.com/softindex/datakernel/blob/090ca1116416c14d463d49d275cb1daaafa69c56/cloud-dataflow/src/main/java/io/datakernel/dataflow/server/DatagraphEnvironment.java#L80-L84 |
lukas-krecan/JsonUnit | json-unit/src/main/java/net/javacrumbs/jsonunit/JsonAssert.java | JsonAssert.assertJsonStructureEquals | @Deprecated
public static void assertJsonStructureEquals(Object expected, Object actual) {
Diff diff = create(expected, actual, ACTUAL, ROOT, configuration.withOptions(COMPARING_ONLY_STRUCTURE));
diff.failIfDifferent();
} | java | @Deprecated
public static void assertJsonStructureEquals(Object expected, Object actual) {
Diff diff = create(expected, actual, ACTUAL, ROOT, configuration.withOptions(COMPARING_ONLY_STRUCTURE));
diff.failIfDifferent();
} | [
"@",
"Deprecated",
"public",
"static",
"void",
"assertJsonStructureEquals",
"(",
"Object",
"expected",
",",
"Object",
"actual",
")",
"{",
"Diff",
"diff",
"=",
"create",
"(",
"expected",
",",
"actual",
",",
"ACTUAL",
",",
"ROOT",
",",
"configuration",
".",
"w... | Compares structures of two JSON documents. Is too lenient, ignores types, prefer IGNORING_VALUES option instead.
Throws {@link AssertionError} if they are different.
@deprecated Use IGNORING_VALUES option instead | [
"Compares",
"structures",
"of",
"two",
"JSON",
"documents",
".",
"Is",
"too",
"lenient",
"ignores",
"types",
"prefer",
"IGNORING_VALUES",
"option",
"instead",
".",
"Throws",
"{",
"@link",
"AssertionError",
"}",
"if",
"they",
"are",
"different",
"."
] | train | https://github.com/lukas-krecan/JsonUnit/blob/2b12ed792e8dd787bddd6f3b8eb2325737435791/json-unit/src/main/java/net/javacrumbs/jsonunit/JsonAssert.java#L128-L132 |
JodaOrg/joda-time | src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java | DateTimeFormatterBuilder.appendTimeZoneOffset | public DateTimeFormatterBuilder appendTimeZoneOffset(
String zeroOffsetPrintText, String zeroOffsetParseText, boolean showSeparators,
int minFields, int maxFields) {
return append0(new TimeZoneOffset
(zeroOffsetPrintText, zeroOffsetParseText, showSeparators, minFie... | java | public DateTimeFormatterBuilder appendTimeZoneOffset(
String zeroOffsetPrintText, String zeroOffsetParseText, boolean showSeparators,
int minFields, int maxFields) {
return append0(new TimeZoneOffset
(zeroOffsetPrintText, zeroOffsetParseText, showSeparators, minFie... | [
"public",
"DateTimeFormatterBuilder",
"appendTimeZoneOffset",
"(",
"String",
"zeroOffsetPrintText",
",",
"String",
"zeroOffsetParseText",
",",
"boolean",
"showSeparators",
",",
"int",
"minFields",
",",
"int",
"maxFields",
")",
"{",
"return",
"append0",
"(",
"new",
"Ti... | Instructs the printer to emit text and numbers to display time zone
offset from UTC. A parser will use the parsed time zone offset to adjust
the datetime.
<p>
If zero offset print text is supplied, then it will be printed when the zone is zero.
If zero offset parse text is supplied, then either it or the offset will be... | [
"Instructs",
"the",
"printer",
"to",
"emit",
"text",
"and",
"numbers",
"to",
"display",
"time",
"zone",
"offset",
"from",
"UTC",
".",
"A",
"parser",
"will",
"use",
"the",
"parsed",
"time",
"zone",
"offset",
"to",
"adjust",
"the",
"datetime",
".",
"<p",
"... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java#L1116-L1121 |
stapler/stapler | core/src/main/java/org/kohsuke/stapler/Stapler.java | Stapler.setClassLoader | public static void setClassLoader( ServletContext context, ClassLoader classLoader ) {
WebApp.get(context).setClassLoader(classLoader);
} | java | public static void setClassLoader( ServletContext context, ClassLoader classLoader ) {
WebApp.get(context).setClassLoader(classLoader);
} | [
"public",
"static",
"void",
"setClassLoader",
"(",
"ServletContext",
"context",
",",
"ClassLoader",
"classLoader",
")",
"{",
"WebApp",
".",
"get",
"(",
"context",
")",
".",
"setClassLoader",
"(",
"classLoader",
")",
";",
"}"
] | Sets the classloader used by {@link StaplerRequest#bindJSON(Class, JSONObject)} and its sibling methods.
@deprecated
Use {@link WebApp#setClassLoader(ClassLoader)} | [
"Sets",
"the",
"classloader",
"used",
"by",
"{",
"@link",
"StaplerRequest#bindJSON",
"(",
"Class",
"JSONObject",
")",
"}",
"and",
"its",
"sibling",
"methods",
"."
] | train | https://github.com/stapler/stapler/blob/11ad5af185e062fb46e01bf9fbed66f3ebf2a8f7/core/src/main/java/org/kohsuke/stapler/Stapler.java#L956-L958 |
Sciss/abc4j | abc/src/main/java/abc/ui/swing/JTune.java | JTune.getNoteGlyphesBetween | private Collection getNoteGlyphesBetween(NoteAbstract start, NoteAbstract end) {
Collection jnotes = new Vector();
try {
Collection notes = m_music.getVoice(start.getReference().getVoice()).getNotesBetween(start, end);
for (Object note : notes) {
NoteAbstract n = (NoteAbstract) n... | java | private Collection getNoteGlyphesBetween(NoteAbstract start, NoteAbstract end) {
Collection jnotes = new Vector();
try {
Collection notes = m_music.getVoice(start.getReference().getVoice()).getNotesBetween(start, end);
for (Object note : notes) {
NoteAbstract n = (NoteAbstract) n... | [
"private",
"Collection",
"getNoteGlyphesBetween",
"(",
"NoteAbstract",
"start",
",",
"NoteAbstract",
"end",
")",
"{",
"Collection",
"jnotes",
"=",
"new",
"Vector",
"(",
")",
";",
"try",
"{",
"Collection",
"notes",
"=",
"m_music",
".",
"getVoice",
"(",
"start",... | Returns a Collection of JNote representing the note glyphes
between start and end NoteAbstract. | [
"Returns",
"a",
"Collection",
"of",
"JNote",
"representing",
"the",
"note",
"glyphes",
"between",
"start",
"and",
"end",
"NoteAbstract",
"."
] | train | https://github.com/Sciss/abc4j/blob/117b405642c84a7bfca4e3e13668838258b90ca7/abc/src/main/java/abc/ui/swing/JTune.java#L1514-L1526 |
OpenLiberty/open-liberty | dev/com.ibm.ws.org.apache.cxf.cxf.rt.rs.client.3.2/src/com/ibm/ws/jaxrs21/clientconfig/JAXRSClientConfigHolder.java | JAXRSClientConfigHolder.addConfig | public static synchronized void addConfig(String id, String uri, Map<String, String> params) {
uriMap.put(id, uri);
configInfo.put(uri, params);
resolvedConfigInfo.clear();
if (uri.endsWith("*")) {
wildcardsPresentInConfigInfo = true;
}
} | java | public static synchronized void addConfig(String id, String uri, Map<String, String> params) {
uriMap.put(id, uri);
configInfo.put(uri, params);
resolvedConfigInfo.clear();
if (uri.endsWith("*")) {
wildcardsPresentInConfigInfo = true;
}
} | [
"public",
"static",
"synchronized",
"void",
"addConfig",
"(",
"String",
"id",
",",
"String",
"uri",
",",
"Map",
"<",
"String",
",",
"String",
">",
"params",
")",
"{",
"uriMap",
".",
"put",
"(",
"id",
",",
"uri",
")",
";",
"configInfo",
".",
"put",
"(... | add a configuration for a URL
We'd like a set of hashmaps keyed by URL, however when osgi calls
deactivate, we have no arguments, so we have to associate a url with
the object id of the service. That allows us to remove the right one.
@param id - the object id of the service instance that added this.
@param url - the ... | [
"add",
"a",
"configuration",
"for",
"a",
"URL",
"We",
"d",
"like",
"a",
"set",
"of",
"hashmaps",
"keyed",
"by",
"URL",
"however",
"when",
"osgi",
"calls",
"deactivate",
"we",
"have",
"no",
"arguments",
"so",
"we",
"have",
"to",
"associate",
"a",
"url",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.org.apache.cxf.cxf.rt.rs.client.3.2/src/com/ibm/ws/jaxrs21/clientconfig/JAXRSClientConfigHolder.java#L54-L61 |
lessthanoptimal/ddogleg | src/org/ddogleg/sorting/ApproximateSort_F64.java | ApproximateSort_F64.setRange | public void setRange( double minValue , double maxValue ) {
this.maxValue = maxValue;
this.minValue = minValue;
divisor = 1.00001*(maxValue-minValue)/numBins;
histIndexes.resize(numBins);
if( histObjs.length < numBins ) {
histObjs = new FastQueue[ numBins ];
for (int i = 0; i < numBins; i++) {
his... | java | public void setRange( double minValue , double maxValue ) {
this.maxValue = maxValue;
this.minValue = minValue;
divisor = 1.00001*(maxValue-minValue)/numBins;
histIndexes.resize(numBins);
if( histObjs.length < numBins ) {
histObjs = new FastQueue[ numBins ];
for (int i = 0; i < numBins; i++) {
his... | [
"public",
"void",
"setRange",
"(",
"double",
"minValue",
",",
"double",
"maxValue",
")",
"{",
"this",
".",
"maxValue",
"=",
"maxValue",
";",
"this",
".",
"minValue",
"=",
"minValue",
";",
"divisor",
"=",
"1.00001",
"*",
"(",
"maxValue",
"-",
"minValue",
... | Specify the data range
@param minValue Minimum allowed value. (inclusive)
@param maxValue Maximum allowed value. (inclusive) | [
"Specify",
"the",
"data",
"range"
] | train | https://github.com/lessthanoptimal/ddogleg/blob/3786bf448ba23d0e04962dd08c34fa68de276029/src/org/ddogleg/sorting/ApproximateSort_F64.java#L53-L67 |
hibernate/hibernate-ogm | mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/query/parsing/impl/AggregationRenderer.java | AggregationRenderer.getDistinctCountGroup | private List<Document> getDistinctCountGroup() {
// propertyPath is null when the query is a select on an entity
// In this case we can make the distinct on the id of the document
Object groupColumn = propertyPath == null ? "$_id" : propertyPath;
Document group = new Document();
group.append( "$group", new Do... | java | private List<Document> getDistinctCountGroup() {
// propertyPath is null when the query is a select on an entity
// In this case we can make the distinct on the id of the document
Object groupColumn = propertyPath == null ? "$_id" : propertyPath;
Document group = new Document();
group.append( "$group", new Do... | [
"private",
"List",
"<",
"Document",
">",
"getDistinctCountGroup",
"(",
")",
"{",
"// propertyPath is null when the query is a select on an entity",
"// In this case we can make the distinct on the id of the document",
"Object",
"groupColumn",
"=",
"propertyPath",
"==",
"null",
"?",... | /*
A distinct query on the id looks something like:
db.Author.aggregate([{ $group : { _id: "$_id" }}, {$group : {_id:null, n: {$sum: 1}}}, {$project: {n: 1, _id:0}}])
This method returns the "groups" part. | [
"/",
"*",
"A",
"distinct",
"query",
"on",
"the",
"id",
"looks",
"something",
"like",
":"
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/query/parsing/impl/AggregationRenderer.java#L83-L95 |
vincentk/joptimizer | src/main/java/com/joptimizer/functions/SDPLogarithmicBarrier.java | SDPLogarithmicBarrier.createPhase1BarrierFunction | @Override
public BarrierFunction createPhase1BarrierFunction(){
List<double[][]> FiPh1MatrixList = new ArrayList<double[][]>();
for(int i=0; i<this.Fi.length; i++){
FiPh1MatrixList.add(FiPh1MatrixList.size(), this.Fi[i].getData());
}
FiPh1MatrixList.add(FiPh1MatrixList.size(), MatrixUtils.createRealId... | java | @Override
public BarrierFunction createPhase1BarrierFunction(){
List<double[][]> FiPh1MatrixList = new ArrayList<double[][]>();
for(int i=0; i<this.Fi.length; i++){
FiPh1MatrixList.add(FiPh1MatrixList.size(), this.Fi[i].getData());
}
FiPh1MatrixList.add(FiPh1MatrixList.size(), MatrixUtils.createRealId... | [
"@",
"Override",
"public",
"BarrierFunction",
"createPhase1BarrierFunction",
"(",
")",
"{",
"List",
"<",
"double",
"[",
"]",
"[",
"]",
">",
"FiPh1MatrixList",
"=",
"new",
"ArrayList",
"<",
"double",
"[",
"]",
"[",
"]",
">",
"(",
")",
";",
"for",
"(",
"... | Create the barrier function for the Phase I.
It is an instance of this class for the constraint:
<br>G + Sum[x_i * F_i(x),i] < t * I
@see "S.Boyd and L.Vandenberghe, Convex Optimization, 11.6.2" | [
"Create",
"the",
"barrier",
"function",
"for",
"the",
"Phase",
"I",
".",
"It",
"is",
"an",
"instance",
"of",
"this",
"class",
"for",
"the",
"constraint",
":",
"<br",
">",
"G",
"+",
"Sum",
"[",
"x_i",
"*",
"F_i",
"(",
"x",
")",
"i",
"]",
"<",
"t",... | train | https://github.com/vincentk/joptimizer/blob/65064c1bb0b26c7261358021e4c93d06dd43564f/src/main/java/com/joptimizer/functions/SDPLogarithmicBarrier.java#L129-L137 |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/JTB.java | JTB.getEffectiveVisitorDirectory | private File getEffectiveVisitorDirectory ()
{
if (this.visitorDirectory != null)
return this.visitorDirectory;
if (this.outputDirectory != null)
return new File (this.outputDirectory, getLastPackageName (getEffectiveVisitorPackageName ()));
return null;
} | java | private File getEffectiveVisitorDirectory ()
{
if (this.visitorDirectory != null)
return this.visitorDirectory;
if (this.outputDirectory != null)
return new File (this.outputDirectory, getLastPackageName (getEffectiveVisitorPackageName ()));
return null;
} | [
"private",
"File",
"getEffectiveVisitorDirectory",
"(",
")",
"{",
"if",
"(",
"this",
".",
"visitorDirectory",
"!=",
"null",
")",
"return",
"this",
".",
"visitorDirectory",
";",
"if",
"(",
"this",
".",
"outputDirectory",
"!=",
"null",
")",
"return",
"new",
"F... | Gets the absolute path to the output directory for the visitor files.
@return The absolute path to the output directory for the visitor, only
<code>null</code> if neither {@link #outputDirectory} nor
{@link #visitorDirectory} have been set. | [
"Gets",
"the",
"absolute",
"path",
"to",
"the",
"output",
"directory",
"for",
"the",
"visitor",
"files",
"."
] | train | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/JTB.java#L248-L255 |
mgm-tp/jfunk | jfunk-web/src/main/java/com/mgmtp/jfunk/web/util/WebDriverTool.java | WebDriverTool.getCssValue | public String getCssValue(final By by, final String propertyName) {
WebElement element = findElement(by);
return element.getCssValue(propertyName);
} | java | public String getCssValue(final By by, final String propertyName) {
WebElement element = findElement(by);
return element.getCssValue(propertyName);
} | [
"public",
"String",
"getCssValue",
"(",
"final",
"By",
"by",
",",
"final",
"String",
"propertyName",
")",
"{",
"WebElement",
"element",
"=",
"findElement",
"(",
"by",
")",
";",
"return",
"element",
".",
"getCssValue",
"(",
"propertyName",
")",
";",
"}"
] | Delegates to {@link #findElement(By)} and then calls
{@link WebElement#getCssValue(String) getAttribute(String)} on the returned element.
@param by
the {@link By} used to locate the element
@param propertyName
the name of the CSS property
@return The current, computed value of the property. | [
"Delegates",
"to",
"{",
"@link",
"#findElement",
"(",
"By",
")",
"}",
"and",
"then",
"calls",
"{",
"@link",
"WebElement#getCssValue",
"(",
"String",
")",
"getAttribute",
"(",
"String",
")",
"}",
"on",
"the",
"returned",
"element",
"."
] | train | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-web/src/main/java/com/mgmtp/jfunk/web/util/WebDriverTool.java#L543-L546 |
OpenLiberty/open-liberty | dev/com.ibm.ws.channelfw/src/com/ibm/ws/bytebuffer/internal/WsByteBufferPoolManagerImpl.java | WsByteBufferPoolManagerImpl.setLeakDetectionSettings | public void setLeakDetectionSettings(int interval, String output) throws IOException {
this.leakDetectionInterval = interval;
this.leakDetectionOutput = TrConfigurator.getLogLocation() + File.separator + output;
if ((interval > -1) && (output != null)) {
// clear file
Fi... | java | public void setLeakDetectionSettings(int interval, String output) throws IOException {
this.leakDetectionInterval = interval;
this.leakDetectionOutput = TrConfigurator.getLogLocation() + File.separator + output;
if ((interval > -1) && (output != null)) {
// clear file
Fi... | [
"public",
"void",
"setLeakDetectionSettings",
"(",
"int",
"interval",
",",
"String",
"output",
")",
"throws",
"IOException",
"{",
"this",
".",
"leakDetectionInterval",
"=",
"interval",
";",
"this",
".",
"leakDetectionOutput",
"=",
"TrConfigurator",
".",
"getLogLocat... | Set the memory leak detection parameters. If the interval is 0 or
greater, then the detection code will enabled.
@param interval the minimum amount of time between leak detection code
will be ran. Also the minimum amount of time that a buffer can go without
being accessed before it will be flagged as a possible memory... | [
"Set",
"the",
"memory",
"leak",
"detection",
"parameters",
".",
"If",
"the",
"interval",
"is",
"0",
"or",
"greater",
"then",
"the",
"detection",
"code",
"will",
"enabled",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.channelfw/src/com/ibm/ws/bytebuffer/internal/WsByteBufferPoolManagerImpl.java#L329-L338 |
jeffreyning/nh-micro | nh-micro-template/src/main/java/com/nh/micro/template/MicroServiceTemplateSupport.java | MicroServiceTemplateSupport.getSeqByMysql | public Integer getSeqByMysql(String seqKey){
PlatformTransactionManager transactionManager=MicroTranManagerHolder.getTransactionManager(dbName);
DefaultTransactionDefinition def =new DefaultTransactionDefinition();
def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);
Trans... | java | public Integer getSeqByMysql(String seqKey){
PlatformTransactionManager transactionManager=MicroTranManagerHolder.getTransactionManager(dbName);
DefaultTransactionDefinition def =new DefaultTransactionDefinition();
def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW);
Trans... | [
"public",
"Integer",
"getSeqByMysql",
"(",
"String",
"seqKey",
")",
"{",
"PlatformTransactionManager",
"transactionManager",
"=",
"MicroTranManagerHolder",
".",
"getTransactionManager",
"(",
"dbName",
")",
";",
"DefaultTransactionDefinition",
"def",
"=",
"new",
"DefaultTr... | /* public void dbTranNestRollbackAndReStart() throws Exception{
PlatformTransactionManager transactionManager=MicroTranManagerHolder.getTransactionManager(dbName);
DefaultTransactionDefinition def =new DefaultTransactionDefinition();
def.setIsolationLevel(TransactionDefinition.ISOLATION_READ_COMMITTED);
def.setPropaga... | [
"/",
"*",
"public",
"void",
"dbTranNestRollbackAndReStart",
"()",
"throws",
"Exception",
"{",
"PlatformTransactionManager",
"transactionManager",
"=",
"MicroTranManagerHolder",
".",
"getTransactionManager",
"(",
"dbName",
")",
";",
"DefaultTransactionDefinition",
"def",
"="... | train | https://github.com/jeffreyning/nh-micro/blob/f1cb420a092f8ba94317519ede739974decb5617/nh-micro-template/src/main/java/com/nh/micro/template/MicroServiceTemplateSupport.java#L2323-L2349 |
samskivert/samskivert | src/main/java/com/samskivert/util/Folds.java | Folds.foldLeft | public static <A, B> B foldLeft (F<B,A> func, B zero, Iterable<? extends A> values)
{
for (A value : values) {
zero = func.apply(zero, value);
}
return zero;
} | java | public static <A, B> B foldLeft (F<B,A> func, B zero, Iterable<? extends A> values)
{
for (A value : values) {
zero = func.apply(zero, value);
}
return zero;
} | [
"public",
"static",
"<",
"A",
",",
"B",
">",
"B",
"foldLeft",
"(",
"F",
"<",
"B",
",",
"A",
">",
"func",
",",
"B",
"zero",
",",
"Iterable",
"<",
"?",
"extends",
"A",
">",
"values",
")",
"{",
"for",
"(",
"A",
"value",
":",
"values",
")",
"{",
... | Left folds the supplied function over the supplied values using the supplied starting value. | [
"Left",
"folds",
"the",
"supplied",
"function",
"over",
"the",
"supplied",
"values",
"using",
"the",
"supplied",
"starting",
"value",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/util/Folds.java#L30-L36 |
languagetool-org/languagetool | languagetool-core/src/main/java/org/languagetool/rules/patterns/MatchState.java | MatchState.setToken | public final void setToken(AnalyzedTokenReadings[] tokens, int index, int next) {
int idx = index;
if (index >= tokens.length) {
// TODO: hacky workaround, find a proper solution. See EnglishPatternRuleTest.testBug()
idx = tokens.length - 1;
}
setToken(tokens[idx]);
IncludeRange includeS... | java | public final void setToken(AnalyzedTokenReadings[] tokens, int index, int next) {
int idx = index;
if (index >= tokens.length) {
// TODO: hacky workaround, find a proper solution. See EnglishPatternRuleTest.testBug()
idx = tokens.length - 1;
}
setToken(tokens[idx]);
IncludeRange includeS... | [
"public",
"final",
"void",
"setToken",
"(",
"AnalyzedTokenReadings",
"[",
"]",
"tokens",
",",
"int",
"index",
",",
"int",
"next",
")",
"{",
"int",
"idx",
"=",
"index",
";",
"if",
"(",
"index",
">=",
"tokens",
".",
"length",
")",
"{",
"// TODO: hacky work... | Sets the token to be formatted etc. and includes the support for
including the skipped tokens.
@param tokens Array of tokens
@param index Index of the token to be formatted
@param next Position of the next token (the skipped tokens are the ones between the tokens[index] and tokens[next] | [
"Sets",
"the",
"token",
"to",
"be",
"formatted",
"etc",
".",
"and",
"includes",
"the",
"support",
"for",
"including",
"the",
"skipped",
"tokens",
"."
] | train | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/rules/patterns/MatchState.java#L81-L105 |
magik6k/JWWF | src/main/java/net/magik6k/jwwf/core/User.java | User.sendGlobal | public final void sendGlobal(String handler, String data) {
try {
connection.sendMessage("{\"id\":-1,\"type\":\"global\",\"handler\":"
+ Json.escapeString(handler) + ",\"data\":" + data + "}");
} catch (IOException e) {
e.printStackTrace();
}
} | java | public final void sendGlobal(String handler, String data) {
try {
connection.sendMessage("{\"id\":-1,\"type\":\"global\",\"handler\":"
+ Json.escapeString(handler) + ",\"data\":" + data + "}");
} catch (IOException e) {
e.printStackTrace();
}
} | [
"public",
"final",
"void",
"sendGlobal",
"(",
"String",
"handler",
",",
"String",
"data",
")",
"{",
"try",
"{",
"connection",
".",
"sendMessage",
"(",
"\"{\\\"id\\\":-1,\\\"type\\\":\\\"global\\\",\\\"handler\\\":\"",
"+",
"Json",
".",
"escapeString",
"(",
"handler",
... | This function is mainly made for plug-in use, it sends
data to global user handler for example to perform some tasks
that aren't related directly to widgets. Global handler is a javascript
function in array named 'global', under key that is passed to this function as
handler parameter. As first argument the javascript ... | [
"This",
"function",
"is",
"mainly",
"made",
"for",
"plug",
"-",
"in",
"use",
"it",
"sends",
"data",
"to",
"global",
"user",
"handler",
"for",
"example",
"to",
"perform",
"some",
"tasks",
"that",
"aren",
"t",
"related",
"directly",
"to",
"widgets",
".",
"... | train | https://github.com/magik6k/JWWF/blob/8ba334501396c3301495da8708733f6014f20665/src/main/java/net/magik6k/jwwf/core/User.java#L58-L65 |
GoSimpleLLC/nbvcxz | src/main/java/me/gosimple/nbvcxz/matching/DateMatcher.java | DateMatcher.isDateValid | private static ValidDateSplit isDateValid(String day, String month, String year)
{
try
{
int dayInt = Integer.parseInt(day);
int monthInt = Integer.parseInt(month);
int yearInt = Integer.parseInt(year);
if (
dayInt <= 0 || dayInt > ... | java | private static ValidDateSplit isDateValid(String day, String month, String year)
{
try
{
int dayInt = Integer.parseInt(day);
int monthInt = Integer.parseInt(month);
int yearInt = Integer.parseInt(year);
if (
dayInt <= 0 || dayInt > ... | [
"private",
"static",
"ValidDateSplit",
"isDateValid",
"(",
"String",
"day",
",",
"String",
"month",
",",
"String",
"year",
")",
"{",
"try",
"{",
"int",
"dayInt",
"=",
"Integer",
".",
"parseInt",
"(",
"day",
")",
";",
"int",
"monthInt",
"=",
"Integer",
".... | Verify that a date is valid. Year must be
two digit or four digit and between 1900 and 2029.
@param day the day of the date
@param month the moth of the date
@param year the year of the date
@return a valid date split object containing the date information if the
date is valid and {@code null} if the date is not va... | [
"Verify",
"that",
"a",
"date",
"is",
"valid",
".",
"Year",
"must",
"be",
"two",
"digit",
"or",
"four",
"digit",
"and",
"between",
"1900",
"and",
"2029",
"."
] | train | https://github.com/GoSimpleLLC/nbvcxz/blob/a86fb24680e646efdf78d6fda9d68a5410145f56/src/main/java/me/gosimple/nbvcxz/matching/DateMatcher.java#L206-L227 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemModelManipulator.java | ChemModelManipulator.getRelevantAtomContainer | public static IAtomContainer getRelevantAtomContainer(IChemModel chemModel, IBond bond) {
IAtomContainer result = null;
if (chemModel.getMoleculeSet() != null) {
IAtomContainerSet moleculeSet = chemModel.getMoleculeSet();
result = MoleculeSetManipulator.getRelevantAtomContainer(m... | java | public static IAtomContainer getRelevantAtomContainer(IChemModel chemModel, IBond bond) {
IAtomContainer result = null;
if (chemModel.getMoleculeSet() != null) {
IAtomContainerSet moleculeSet = chemModel.getMoleculeSet();
result = MoleculeSetManipulator.getRelevantAtomContainer(m... | [
"public",
"static",
"IAtomContainer",
"getRelevantAtomContainer",
"(",
"IChemModel",
"chemModel",
",",
"IBond",
"bond",
")",
"{",
"IAtomContainer",
"result",
"=",
"null",
";",
"if",
"(",
"chemModel",
".",
"getMoleculeSet",
"(",
")",
"!=",
"null",
")",
"{",
"IA... | Retrieves the first IAtomContainer containing a given IBond from an
IChemModel.
@param chemModel The IChemModel object.
@param bond The IBond object to search.
@return The IAtomContainer object found, null if none is found. | [
"Retrieves",
"the",
"first",
"IAtomContainer",
"containing",
"a",
"given",
"IBond",
"from",
"an",
"IChemModel",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ChemModelManipulator.java#L230-L245 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/core/proxy/AbstractProxyFactory.java | AbstractProxyFactory.createIndirectionHandler | public IndirectionHandler createIndirectionHandler(PBKey brokerKey, Identity id)
{
Object args[] = {brokerKey, id};
try
{
return (IndirectionHandler) getIndirectionHandlerConstructor().newInstance(args);
}
catch(InvocationTargetException ex)
{
... | java | public IndirectionHandler createIndirectionHandler(PBKey brokerKey, Identity id)
{
Object args[] = {brokerKey, id};
try
{
return (IndirectionHandler) getIndirectionHandlerConstructor().newInstance(args);
}
catch(InvocationTargetException ex)
{
... | [
"public",
"IndirectionHandler",
"createIndirectionHandler",
"(",
"PBKey",
"brokerKey",
",",
"Identity",
"id",
")",
"{",
"Object",
"args",
"[",
"]",
"=",
"{",
"brokerKey",
",",
"id",
"}",
";",
"try",
"{",
"return",
"(",
"IndirectionHandler",
")",
"getIndirectio... | Creates a new indirection handler instance.
@param brokerKey The associated {@link PBKey}.
@param id The subject's ids
@return The new instance | [
"Creates",
"a",
"new",
"indirection",
"handler",
"instance",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/core/proxy/AbstractProxyFactory.java#L149-L169 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/application/PropertyNotSetException.java | PropertyNotSetException.throwIfNull | public static void throwIfNull(Object propertyValue, String propertyName, Class beanClass) {
if (propertyValue == null) {
throw new PropertyNotSetException(beanClass, propertyName);
}
} | java | public static void throwIfNull(Object propertyValue, String propertyName, Class beanClass) {
if (propertyValue == null) {
throw new PropertyNotSetException(beanClass, propertyName);
}
} | [
"public",
"static",
"void",
"throwIfNull",
"(",
"Object",
"propertyValue",
",",
"String",
"propertyName",
",",
"Class",
"beanClass",
")",
"{",
"if",
"(",
"propertyValue",
"==",
"null",
")",
"{",
"throw",
"new",
"PropertyNotSetException",
"(",
"beanClass",
",",
... | Throws an instance of this exception if the given {@code propertyValue}
is null.
@param propertyValue The value of the property.
@param propertyName The name of the property.
@param beanClass The class on which the property is supposed to be set.
@throws PropertyNotSetException if {@code propertyValue} is null. | [
"Throws",
"an",
"instance",
"of",
"this",
"exception",
"if",
"the",
"given",
"{",
"@code",
"propertyValue",
"}",
"is",
"null",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/application/PropertyNotSetException.java#L40-L46 |
alkacon/opencms-core | src-modules/org/opencms/workplace/commons/CmsPreferences.java | CmsPreferences.buildSelectExplorerButtonStyle | public String buildSelectExplorerButtonStyle(String htmlAttributes) {
int selectedIndex = Integer.parseInt(getParamTabExButtonStyle());
return buildSelectButtonStyle(htmlAttributes, selectedIndex);
} | java | public String buildSelectExplorerButtonStyle(String htmlAttributes) {
int selectedIndex = Integer.parseInt(getParamTabExButtonStyle());
return buildSelectButtonStyle(htmlAttributes, selectedIndex);
} | [
"public",
"String",
"buildSelectExplorerButtonStyle",
"(",
"String",
"htmlAttributes",
")",
"{",
"int",
"selectedIndex",
"=",
"Integer",
".",
"parseInt",
"(",
"getParamTabExButtonStyle",
"(",
")",
")",
";",
"return",
"buildSelectButtonStyle",
"(",
"htmlAttributes",
",... | Builds the html for the explorer button style select box.<p>
@param htmlAttributes optional html attributes for the &lgt;select> tag
@return the html for the explorer button style select box | [
"Builds",
"the",
"html",
"for",
"the",
"explorer",
"button",
"style",
"select",
"box",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/commons/CmsPreferences.java#L669-L673 |
inaiat/jqplot4java | src/main/java/br/com/digilabs/jqplot/JqPlotUtils.java | JqPlotUtils.jqPlotToJson | public static String jqPlotToJson(ChartConfiguration<?> jqPlot) {
XStream xstream = new XStream(new JsonHierarchicalStreamDriver() {
@Override
public HierarchicalStreamWriter createWriter(Writer writer) {
return new JqPlotJsonMapHierarchicalWriter(writer, JsonWriter.DRO... | java | public static String jqPlotToJson(ChartConfiguration<?> jqPlot) {
XStream xstream = new XStream(new JsonHierarchicalStreamDriver() {
@Override
public HierarchicalStreamWriter createWriter(Writer writer) {
return new JqPlotJsonMapHierarchicalWriter(writer, JsonWriter.DRO... | [
"public",
"static",
"String",
"jqPlotToJson",
"(",
"ChartConfiguration",
"<",
"?",
">",
"jqPlot",
")",
"{",
"XStream",
"xstream",
"=",
"new",
"XStream",
"(",
"new",
"JsonHierarchicalStreamDriver",
"(",
")",
"{",
"@",
"Override",
"public",
"HierarchicalStreamWriter... | Retorna o um json a partir de uma configuração jqplot
@param jqPlot ChartConfiguration
@return String of JSON content | [
"Retorna",
"o",
"um",
"json",
"a",
"partir",
"de",
"uma",
"configuração",
"jqplot"
] | train | https://github.com/inaiat/jqplot4java/blob/35bcd17749442e88695df0438c8330a65a3977cc/src/main/java/br/com/digilabs/jqplot/JqPlotUtils.java#L101-L140 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.