repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
looly/hutool | hutool-core/src/main/java/cn/hutool/core/text/StrSpliter.java | StrSpliter.splitTrim | public static List<String> splitTrim(String str, char separator, boolean ignoreEmpty) {
"""
切分字符串
@param str 被切分的字符串
@param separator 分隔符字符
@param ignoreEmpty 是否忽略空串
@return 切分后的集合
@since 3.2.1
"""
return split(str, separator, 0, true, ignoreEmpty);
} | java | public static List<String> splitTrim(String str, char separator, boolean ignoreEmpty){
return split(str, separator, 0, true, ignoreEmpty);
} | [
"public",
"static",
"List",
"<",
"String",
">",
"splitTrim",
"(",
"String",
"str",
",",
"char",
"separator",
",",
"boolean",
"ignoreEmpty",
")",
"{",
"return",
"split",
"(",
"str",
",",
"separator",
",",
"0",
",",
"true",
",",
"ignoreEmpty",
")",
";",
... | 切分字符串
@param str 被切分的字符串
@param separator 分隔符字符
@param ignoreEmpty 是否忽略空串
@return 切分后的集合
@since 3.2.1 | [
"切分字符串"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/text/StrSpliter.java#L76-L78 |
samskivert/samskivert | src/main/java/com/samskivert/swing/util/MenuUtil.java | MenuUtil.addMenuItem | public static JMenuItem addMenuItem (
ActionListener l, JMenu menu, String name, int mnem, KeyStroke accel) {
"""
Adds a new menu item to the menu with the specified name and
attributes.
@param l the action listener.
@param menu the menu to add the item to.
@param name the item name.
@param mnem the... | java | public static JMenuItem addMenuItem (
ActionListener l, JMenu menu, String name, int mnem, KeyStroke accel)
{
return addMenuItem(l, menu, name, Integer.valueOf(mnem), accel);
} | [
"public",
"static",
"JMenuItem",
"addMenuItem",
"(",
"ActionListener",
"l",
",",
"JMenu",
"menu",
",",
"String",
"name",
",",
"int",
"mnem",
",",
"KeyStroke",
"accel",
")",
"{",
"return",
"addMenuItem",
"(",
"l",
",",
"menu",
",",
"name",
",",
"Integer",
... | Adds a new menu item to the menu with the specified name and
attributes.
@param l the action listener.
@param menu the menu to add the item to.
@param name the item name.
@param mnem the mnemonic key for the item.
@param accel the keystroke for the item or null if none.
@return the new menu item. | [
"Adds",
"a",
"new",
"menu",
"item",
"to",
"the",
"menu",
"with",
"the",
"specified",
"name",
"and",
"attributes",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/MenuUtil.java#L67-L71 |
mockito/mockito | src/main/java/org/mockito/internal/verification/Description.java | Description.verify | @Override
public void verify(VerificationData data) {
"""
Performs verification using the wrapped verification mode implementation.
Prepends the custom failure message if verification fails.
@param data the data to be verified
"""
try {
verification.verify(data);
} catch (Moc... | java | @Override
public void verify(VerificationData data) {
try {
verification.verify(data);
} catch (MockitoAssertionError e) {
throw new MockitoAssertionError(e, description);
}
} | [
"@",
"Override",
"public",
"void",
"verify",
"(",
"VerificationData",
"data",
")",
"{",
"try",
"{",
"verification",
".",
"verify",
"(",
"data",
")",
";",
"}",
"catch",
"(",
"MockitoAssertionError",
"e",
")",
"{",
"throw",
"new",
"MockitoAssertionError",
"(",... | Performs verification using the wrapped verification mode implementation.
Prepends the custom failure message if verification fails.
@param data the data to be verified | [
"Performs",
"verification",
"using",
"the",
"wrapped",
"verification",
"mode",
"implementation",
".",
"Prepends",
"the",
"custom",
"failure",
"message",
"if",
"verification",
"fails",
"."
] | train | https://github.com/mockito/mockito/blob/c5e2b80af76e3192cae7c9550b70c4d1ab312034/src/main/java/org/mockito/internal/verification/Description.java#L37-L45 |
cdk/cdk | misc/extra/src/main/java/org/openscience/cdk/tools/AtomTypeTools.java | AtomTypeTools.getSubgraphSmiles | private static String getSubgraphSmiles(IAtomContainer subgraph, IAtomContainer molecule) throws CDKException {
"""
New SMILES code respects atom valency hence a ring subgraph of 'o1cccc1CCCC' is correctly
written as 'o1ccc[c]1' note there is no hydrogen there since it was an external attachment.
To get unique s... | java | private static String getSubgraphSmiles(IAtomContainer subgraph, IAtomContainer molecule) throws CDKException {
Set<IBond> bonds = new HashSet<>();
for (IBond bond : subgraph.bonds())
bonds.add(bond);
Integer[] hCount = new Integer[subgraph.getAtomCount()];
for (int i = 0; i... | [
"private",
"static",
"String",
"getSubgraphSmiles",
"(",
"IAtomContainer",
"subgraph",
",",
"IAtomContainer",
"molecule",
")",
"throws",
"CDKException",
"{",
"Set",
"<",
"IBond",
">",
"bonds",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"for",
"(",
"IBond",
... | New SMILES code respects atom valency hence a ring subgraph of 'o1cccc1CCCC' is correctly
written as 'o1ccc[c]1' note there is no hydrogen there since it was an external attachment.
To get unique subgraph SMILES we need to adjust valencies of atoms by adding Hydrogens. We
base this on the sum of bond orders removed.
@... | [
"New",
"SMILES",
"code",
"respects",
"atom",
"valency",
"hence",
"a",
"ring",
"subgraph",
"of",
"o1cccc1CCCC",
"is",
"correctly",
"written",
"as",
"o1ccc",
"[",
"c",
"]",
"1",
"note",
"there",
"is",
"no",
"hydrogen",
"there",
"since",
"it",
"was",
"an",
... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/misc/extra/src/main/java/org/openscience/cdk/tools/AtomTypeTools.java#L146-L171 |
undertow-io/undertow | core/src/main/java/io/undertow/websockets/core/WebSockets.java | WebSockets.sendPingBlocking | public static void sendPingBlocking(final PooledByteBuffer pooledData, final WebSocketChannel wsChannel) throws IOException {
"""
Sends a complete ping message using blocking IO
Automatically frees the pooled byte buffer when done.
@param pooledData The data to send, it will be freed when done
@param wsChanne... | java | public static void sendPingBlocking(final PooledByteBuffer pooledData, final WebSocketChannel wsChannel) throws IOException {
sendBlockingInternal(pooledData, WebSocketFrameType.PING, wsChannel);
} | [
"public",
"static",
"void",
"sendPingBlocking",
"(",
"final",
"PooledByteBuffer",
"pooledData",
",",
"final",
"WebSocketChannel",
"wsChannel",
")",
"throws",
"IOException",
"{",
"sendBlockingInternal",
"(",
"pooledData",
",",
"WebSocketFrameType",
".",
"PING",
",",
"w... | Sends a complete ping message using blocking IO
Automatically frees the pooled byte buffer when done.
@param pooledData The data to send, it will be freed when done
@param wsChannel The web socket channel | [
"Sends",
"a",
"complete",
"ping",
"message",
"using",
"blocking",
"IO",
"Automatically",
"frees",
"the",
"pooled",
"byte",
"buffer",
"when",
"done",
"."
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/websockets/core/WebSockets.java#L399-L401 |
timols/java-gitlab-api | src/main/java/org/gitlab/api/GitlabAPI.java | GitlabAPI.deleteLabel | public void deleteLabel(Serializable projectId, String name)
throws IOException {
"""
Deletes an existing label.
@param projectId The ID of the project containing the label.
@param name The name of the label to delete.
@throws IOException on gitlab api call error
"""
Query query =... | java | public void deleteLabel(Serializable projectId, String name)
throws IOException {
Query query = new Query();
query.append("name", name);
String tailUrl = GitlabProject.URL + "/" +
sanitizeProjectId(projectId) +
GitlabLabel.URL +
query.t... | [
"public",
"void",
"deleteLabel",
"(",
"Serializable",
"projectId",
",",
"String",
"name",
")",
"throws",
"IOException",
"{",
"Query",
"query",
"=",
"new",
"Query",
"(",
")",
";",
"query",
".",
"append",
"(",
"\"name\"",
",",
"name",
")",
";",
"String",
"... | Deletes an existing label.
@param projectId The ID of the project containing the label.
@param name The name of the label to delete.
@throws IOException on gitlab api call error | [
"Deletes",
"an",
"existing",
"label",
"."
] | train | https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L2817-L2826 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/storage/translation/AtomDODeserializer.java | AtomDODeserializer.getDSVersionable | private boolean getDSVersionable(DigitalObject obj, Entry entry) {
"""
Note: AUDIT datastreams always return false, otherwise defaults to true.
@param entry
@return
"""
if (getDatastreamId(obj, entry).equals("AUDIT")) {
return false;
}
List<Category> versionable = entry.... | java | private boolean getDSVersionable(DigitalObject obj, Entry entry) {
if (getDatastreamId(obj, entry).equals("AUDIT")) {
return false;
}
List<Category> versionable = entry.getCategories(MODEL.VERSIONABLE.uri);
if (versionable.isEmpty() || versionable.size() > 1) {
re... | [
"private",
"boolean",
"getDSVersionable",
"(",
"DigitalObject",
"obj",
",",
"Entry",
"entry",
")",
"{",
"if",
"(",
"getDatastreamId",
"(",
"obj",
",",
"entry",
")",
".",
"equals",
"(",
"\"AUDIT\"",
")",
")",
"{",
"return",
"false",
";",
"}",
"List",
"<",... | Note: AUDIT datastreams always return false, otherwise defaults to true.
@param entry
@return | [
"Note",
":",
"AUDIT",
"datastreams",
"always",
"return",
"false",
"otherwise",
"defaults",
"to",
"true",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/storage/translation/AtomDODeserializer.java#L465-L475 |
scireum/server-sass | src/main/java/org/serversass/Functions.java | Functions.fade_in | @SuppressWarnings("squid:S00100")
public static Expression fade_in(Generator generator, FunctionCall input) {
"""
Increases the opacity of the given color by the given amount.
@param generator the surrounding generator
@param input the function call to evaluate
@return the result of the evaluation
... | java | @SuppressWarnings("squid:S00100")
public static Expression fade_in(Generator generator, FunctionCall input) {
return opacify(generator, input);
} | [
"@",
"SuppressWarnings",
"(",
"\"squid:S00100\"",
")",
"public",
"static",
"Expression",
"fade_in",
"(",
"Generator",
"generator",
",",
"FunctionCall",
"input",
")",
"{",
"return",
"opacify",
"(",
"generator",
",",
"input",
")",
";",
"}"
] | Increases the opacity of the given color by the given amount.
@param generator the surrounding generator
@param input the function call to evaluate
@return the result of the evaluation | [
"Increases",
"the",
"opacity",
"of",
"the",
"given",
"color",
"by",
"the",
"given",
"amount",
"."
] | train | https://github.com/scireum/server-sass/blob/e74af983567f10c43420d70cd31165dd080ba8fc/src/main/java/org/serversass/Functions.java#L182-L185 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/word2vec/wordstore/inmemory/AbstractCache.java | AbstractCache.addWordToIndex | @Override
public void addWordToIndex(int index, String label) {
"""
This method allows to insert specified label to specified Huffman tree position.
CAUTION: Never use this, unless you 100% sure what are you doing.
@param index
@param label
"""
if (index >= 0) {
T token = tokenFor(... | java | @Override
public void addWordToIndex(int index, String label) {
if (index >= 0) {
T token = tokenFor(label);
if (token != null) {
idxMap.put(index, token);
token.setIndex(index);
}
}
} | [
"@",
"Override",
"public",
"void",
"addWordToIndex",
"(",
"int",
"index",
",",
"String",
"label",
")",
"{",
"if",
"(",
"index",
">=",
"0",
")",
"{",
"T",
"token",
"=",
"tokenFor",
"(",
"label",
")",
";",
"if",
"(",
"token",
"!=",
"null",
")",
"{",
... | This method allows to insert specified label to specified Huffman tree position.
CAUTION: Never use this, unless you 100% sure what are you doing.
@param index
@param label | [
"This",
"method",
"allows",
"to",
"insert",
"specified",
"label",
"to",
"specified",
"Huffman",
"tree",
"position",
".",
"CAUTION",
":",
"Never",
"use",
"this",
"unless",
"you",
"100%",
"sure",
"what",
"are",
"you",
"doing",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/word2vec/wordstore/inmemory/AbstractCache.java#L277-L286 |
HeidelTime/heideltime | src/de/unihd/dbs/uima/annotator/heideltime/resources/RegexHashMap.java | RegexHashMap.putCache | public T putCache(String key, T value) {
"""
associates a key with a value in the cache hashmap.
@param key Key to map from
@param value Value to map to
@return previous value associated with the key, or null if unassociated before
"""
return cache.put(key, value);
} | java | public T putCache(String key, T value) {
return cache.put(key, value);
} | [
"public",
"T",
"putCache",
"(",
"String",
"key",
",",
"T",
"value",
")",
"{",
"return",
"cache",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"}"
] | associates a key with a value in the cache hashmap.
@param key Key to map from
@param value Value to map to
@return previous value associated with the key, or null if unassociated before | [
"associates",
"a",
"key",
"with",
"a",
"value",
"in",
"the",
"cache",
"hashmap",
"."
] | train | https://github.com/HeidelTime/heideltime/blob/4ef5002eb5ecfeb818086ff7e394e792ee360335/src/de/unihd/dbs/uima/annotator/heideltime/resources/RegexHashMap.java#L152-L154 |
aleksandr-m/gitflow-maven-plugin | src/main/java/com/amashchenko/maven/plugin/gitflow/AbstractGitFlowMojo.java | AbstractGitFlowMojo.gitSetConfig | private void gitSetConfig(final String name, String value)
throws MojoFailureException, CommandLineException {
"""
Executes git config command.
@param name
Option name.
@param value
Option value.
@throws MojoFailureException
@throws CommandLineException
"""
if (value == null || valu... | java | private void gitSetConfig(final String name, String value)
throws MojoFailureException, CommandLineException {
if (value == null || value.isEmpty()) {
value = "\"\"";
}
// ignore error exit codes
executeGitCommandExitCode("config", name, value);
} | [
"private",
"void",
"gitSetConfig",
"(",
"final",
"String",
"name",
",",
"String",
"value",
")",
"throws",
"MojoFailureException",
",",
"CommandLineException",
"{",
"if",
"(",
"value",
"==",
"null",
"||",
"value",
".",
"isEmpty",
"(",
")",
")",
"{",
"value",
... | Executes git config command.
@param name
Option name.
@param value
Option value.
@throws MojoFailureException
@throws CommandLineException | [
"Executes",
"git",
"config",
"command",
"."
] | train | https://github.com/aleksandr-m/gitflow-maven-plugin/blob/d7be13c653d885c1cb1d8cd0337fa9db985c381e/src/main/java/com/amashchenko/maven/plugin/gitflow/AbstractGitFlowMojo.java#L416-L424 |
intive-FDV/DynamicJasper | src/main/java/ar/com/fdvs/dj/domain/chart/builder/DJXYLineChartBuilder.java | DJXYLineChartBuilder.addSerie | public DJXYLineChartBuilder addSerie(AbstractColumn column, String label) {
"""
Adds the specified serie column to the dataset with custom label.
@param column the serie column
@param label column the custom label
"""
getDataset().addSerie(column, label);
return this;
} | java | public DJXYLineChartBuilder addSerie(AbstractColumn column, String label) {
getDataset().addSerie(column, label);
return this;
} | [
"public",
"DJXYLineChartBuilder",
"addSerie",
"(",
"AbstractColumn",
"column",
",",
"String",
"label",
")",
"{",
"getDataset",
"(",
")",
".",
"addSerie",
"(",
"column",
",",
"label",
")",
";",
"return",
"this",
";",
"}"
] | Adds the specified serie column to the dataset with custom label.
@param column the serie column
@param label column the custom label | [
"Adds",
"the",
"specified",
"serie",
"column",
"to",
"the",
"dataset",
"with",
"custom",
"label",
"."
] | train | https://github.com/intive-FDV/DynamicJasper/blob/63919574cc401ae40574d13129f628e66d1682a3/src/main/java/ar/com/fdvs/dj/domain/chart/builder/DJXYLineChartBuilder.java#L374-L377 |
apache/flink | flink-core/src/main/java/org/apache/flink/api/common/typeutils/NestedSerializersSnapshotDelegate.java | NestedSerializersSnapshotDelegate.legacyReadNestedSerializerSnapshots | public static NestedSerializersSnapshotDelegate legacyReadNestedSerializerSnapshots(DataInputView in, ClassLoader cl) throws IOException {
"""
Reads the composite snapshot of all the contained serializers in a way that is compatible
with Version 1 of the deprecated {@link CompositeTypeSerializerConfigSnapshot}.
... | java | public static NestedSerializersSnapshotDelegate legacyReadNestedSerializerSnapshots(DataInputView in, ClassLoader cl) throws IOException {
@SuppressWarnings("deprecation")
final List<Tuple2<TypeSerializer<?>, TypeSerializerSnapshot<?>>> serializersAndSnapshots =
TypeSerializerSerializationUtil.readSerializersAn... | [
"public",
"static",
"NestedSerializersSnapshotDelegate",
"legacyReadNestedSerializerSnapshots",
"(",
"DataInputView",
"in",
",",
"ClassLoader",
"cl",
")",
"throws",
"IOException",
"{",
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"final",
"List",
"<",
"Tuple2",
... | Reads the composite snapshot of all the contained serializers in a way that is compatible
with Version 1 of the deprecated {@link CompositeTypeSerializerConfigSnapshot}. | [
"Reads",
"the",
"composite",
"snapshot",
"of",
"all",
"the",
"contained",
"serializers",
"in",
"a",
"way",
"that",
"is",
"compatible",
"with",
"Version",
"1",
"of",
"the",
"deprecated",
"{"
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/typeutils/NestedSerializersSnapshotDelegate.java#L192-L202 |
EvidentSolutions/dalesbred | dalesbred/src/main/java/org/dalesbred/Database.java | Database.updateAndProcessGeneratedKeys | public <T> T updateAndProcessGeneratedKeys(@NotNull ResultSetProcessor<T> generatedKeysProcessor, @NotNull List<String> columnNames, @NotNull SqlQuery query) {
"""
Executes an update against the database and return generated keys as extracted by generatedKeysProcessor.
@param generatedKeysProcessor processor fo... | java | public <T> T updateAndProcessGeneratedKeys(@NotNull ResultSetProcessor<T> generatedKeysProcessor, @NotNull List<String> columnNames, @NotNull SqlQuery query) {
return withCurrentTransaction(query, tx -> {
logQuery(query);
try (PreparedStatement ps = prepareStatement(tx.getConnection(), ... | [
"public",
"<",
"T",
">",
"T",
"updateAndProcessGeneratedKeys",
"(",
"@",
"NotNull",
"ResultSetProcessor",
"<",
"T",
">",
"generatedKeysProcessor",
",",
"@",
"NotNull",
"List",
"<",
"String",
">",
"columnNames",
",",
"@",
"NotNull",
"SqlQuery",
"query",
")",
"{... | Executes an update against the database and return generated keys as extracted by generatedKeysProcessor.
@param generatedKeysProcessor processor for handling the generated keys
@param columnNames names of columns that contain the generated keys. Can be empty, in which case the
returned columns depend on the database
... | [
"Executes",
"an",
"update",
"against",
"the",
"database",
"and",
"return",
"generated",
"keys",
"as",
"extracted",
"by",
"generatedKeysProcessor",
"."
] | train | https://github.com/EvidentSolutions/dalesbred/blob/713f5b6e152d97e1672ca68b9ff9c7c6c288ceb1/dalesbred/src/main/java/org/dalesbred/Database.java#L650-L666 |
apache/incubator-shardingsphere | sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/parser/context/condition/Condition.java | Condition.getConditionValues | public List<Comparable<?>> getConditionValues(final List<?> parameters) {
"""
Get condition values.
@param parameters parameters
@return condition values
"""
List<Comparable<?>> result = new LinkedList<>(positionValueMap.values());
for (Entry<Integer, Integer> entry : positionIndexMap.entry... | java | public List<Comparable<?>> getConditionValues(final List<?> parameters) {
List<Comparable<?>> result = new LinkedList<>(positionValueMap.values());
for (Entry<Integer, Integer> entry : positionIndexMap.entrySet()) {
Object parameter = parameters.get(entry.getValue());
if (!(param... | [
"public",
"List",
"<",
"Comparable",
"<",
"?",
">",
">",
"getConditionValues",
"(",
"final",
"List",
"<",
"?",
">",
"parameters",
")",
"{",
"List",
"<",
"Comparable",
"<",
"?",
">",
">",
"result",
"=",
"new",
"LinkedList",
"<>",
"(",
"positionValueMap",
... | Get condition values.
@param parameters parameters
@return condition values | [
"Get",
"condition",
"values",
"."
] | train | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/old/parser/context/condition/Condition.java#L115-L129 |
jhunters/jprotobuf | android/src/main/java/com/baidu/bjf/remoting/protobuf/utils/FieldUtils.java | FieldUtils.setField | public static void setField(Object t, String name, Object value) {
"""
Set the field represented by the supplied {@link Field field object} on
the specified {@link Object target object} to the specified
<code>value</code>. In accordance with {@link Field#set(Object, Object)}
semantics, the new value is automati... | java | public static void setField(Object t, String name, Object value) {
Field field = findField(t.getClass(), name);
setField(t, field, value);
} | [
"public",
"static",
"void",
"setField",
"(",
"Object",
"t",
",",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"Field",
"field",
"=",
"findField",
"(",
"t",
".",
"getClass",
"(",
")",
",",
"name",
")",
";",
"setField",
"(",
"t",
",",
"field",
... | Set the field represented by the supplied {@link Field field object} on
the specified {@link Object target object} to the specified
<code>value</code>. In accordance with {@link Field#set(Object, Object)}
semantics, the new value is automatically unwrapped if the underlying
field has a primitive type.
<p>
Thrown except... | [
"Set",
"the",
"field",
"represented",
"by",
"the",
"supplied",
"{",
"@link",
"Field",
"field",
"object",
"}",
"on",
"the",
"specified",
"{",
"@link",
"Object",
"target",
"object",
"}",
"to",
"the",
"specified",
"<code",
">",
"value<",
"/",
"code",
">",
"... | train | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/android/src/main/java/com/baidu/bjf/remoting/protobuf/utils/FieldUtils.java#L133-L136 |
cybazeitalia/emaze-dysfunctional | src/main/java/net/emaze/dysfunctional/Spies.java | Spies.spyRes | public static <R, T> Function<T, R> spyRes(Function<T, R> function, Box<R> result) {
"""
Proxies a function spying for result.
@param <R> the function result type
@param <T> the function parameter type
@param function the function that will be spied
@param result a box that will be containing spied result
@... | java | public static <R, T> Function<T, R> spyRes(Function<T, R> function, Box<R> result) {
return spy(function, result, Box.<T>empty());
} | [
"public",
"static",
"<",
"R",
",",
"T",
">",
"Function",
"<",
"T",
",",
"R",
">",
"spyRes",
"(",
"Function",
"<",
"T",
",",
"R",
">",
"function",
",",
"Box",
"<",
"R",
">",
"result",
")",
"{",
"return",
"spy",
"(",
"function",
",",
"result",
",... | Proxies a function spying for result.
@param <R> the function result type
@param <T> the function parameter type
@param function the function that will be spied
@param result a box that will be containing spied result
@return the proxied function | [
"Proxies",
"a",
"function",
"spying",
"for",
"result",
"."
] | train | https://github.com/cybazeitalia/emaze-dysfunctional/blob/98115a436e35335c5e8831f9fdc12f6d93d524be/src/main/java/net/emaze/dysfunctional/Spies.java#L294-L296 |
dottydingo/hyperion | client/src/main/java/com/dottydingo/hyperion/client/builder/query/QueryBuilder.java | QueryBuilder.gt | public QueryExpression gt(String propertyName,String value) {
"""
Create a greater than expression
@param propertyName The propery name
@param value The value
@return The query expression
"""
return new SimpleQueryExpression(propertyName, ComparisonOperator.GREATER_THAN,wrap(value));
} | java | public QueryExpression gt(String propertyName,String value)
{
return new SimpleQueryExpression(propertyName, ComparisonOperator.GREATER_THAN,wrap(value));
} | [
"public",
"QueryExpression",
"gt",
"(",
"String",
"propertyName",
",",
"String",
"value",
")",
"{",
"return",
"new",
"SimpleQueryExpression",
"(",
"propertyName",
",",
"ComparisonOperator",
".",
"GREATER_THAN",
",",
"wrap",
"(",
"value",
")",
")",
";",
"}"
] | Create a greater than expression
@param propertyName The propery name
@param value The value
@return The query expression | [
"Create",
"a",
"greater",
"than",
"expression"
] | train | https://github.com/dottydingo/hyperion/blob/c4d119c90024a88c0335d7d318e9ccdb70149764/client/src/main/java/com/dottydingo/hyperion/client/builder/query/QueryBuilder.java#L158-L161 |
ops4j/org.ops4j.pax.web | pax-web-jetty/src/main/java/org/ops4j/pax/web/service/jetty/internal/util/TypeUtil.java | TypeUtil.parseInt | public static int parseInt(String s, int offset, int length, int base) {
"""
Parse an int from a substring. Negative numbers are not handled.
@param s String
@param offset Offset within string
@param length Length of integer or -1 for remainder of string
@param base base of the integer
@return the pa... | java | public static int parseInt(String s, int offset, int length, int base) {
int value = 0;
//CHECKSTYLE:OFF
if (length < 0) {
length = s.length() - offset;
}
//CHECKSTYLE:ON
for (int i = 0; i < length; i++) {
char c = s.charAt(offset + i);
int digit = c - '0';
if (digit < 0 || digit >= base || d... | [
"public",
"static",
"int",
"parseInt",
"(",
"String",
"s",
",",
"int",
"offset",
",",
"int",
"length",
",",
"int",
"base",
")",
"{",
"int",
"value",
"=",
"0",
";",
"//CHECKSTYLE:OFF",
"if",
"(",
"length",
"<",
"0",
")",
"{",
"length",
"=",
"s",
"."... | Parse an int from a substring. Negative numbers are not handled.
@param s String
@param offset Offset within string
@param length Length of integer or -1 for remainder of string
@param base base of the integer
@return the parsed integer
@throws NumberFormatException if the string cannot be parsed | [
"Parse",
"an",
"int",
"from",
"a",
"substring",
".",
"Negative",
"numbers",
"are",
"not",
"handled",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.web/blob/9ecf3676c1d316be0d43ea7fcfdc8f0defffc2a2/pax-web-jetty/src/main/java/org/ops4j/pax/web/service/jetty/internal/util/TypeUtil.java#L281-L307 |
groupby/api-java | src/main/java/com/groupbyinc/util/UrlBeautifier.java | UrlBeautifier.fromUrl | public Query fromUrl(String uri) throws UrlBeautifier.UrlBeautificationException {
"""
<code>
Convert a URI into a query object. Mappings will be converted to the
correct search and refinement state.
</code>
@param uri
The URI to parse into a query object
@throws UrlBeautifier.UrlBeautificationException
... | java | public Query fromUrl(String uri) throws UrlBeautifier.UrlBeautificationException {
Query query = fromUrl(uri, null);
if (query == null) {
throw new IllegalStateException("URL reference block is invalid, could not convert to query");
}
return query;
} | [
"public",
"Query",
"fromUrl",
"(",
"String",
"uri",
")",
"throws",
"UrlBeautifier",
".",
"UrlBeautificationException",
"{",
"Query",
"query",
"=",
"fromUrl",
"(",
"uri",
",",
"null",
")",
";",
"if",
"(",
"query",
"==",
"null",
")",
"{",
"throw",
"new",
"... | <code>
Convert a URI into a query object. Mappings will be converted to the
correct search and refinement state.
</code>
@param uri
The URI to parse into a query object
@throws UrlBeautifier.UrlBeautificationException | [
"<code",
">",
"Convert",
"a",
"URI",
"into",
"a",
"query",
"object",
".",
"Mappings",
"will",
"be",
"converted",
"to",
"the",
"correct",
"search",
"and",
"refinement",
"state",
".",
"<",
"/",
"code",
">"
] | train | https://github.com/groupby/api-java/blob/257c4ed0777221e5e4ade3b29b9921300fac4e2e/src/main/java/com/groupbyinc/util/UrlBeautifier.java#L295-L301 |
JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/resource/parameter/ParameterBuilder.java | ParameterBuilder.searchConfigurationFiles | public void searchConfigurationFiles(final String wildcard, final String extension) {
"""
Search configuration files according to the parameters provided.
@param wildcard the regex wildcard (must not be null)
@param extension the file extension without the first dot (ie: properties) (must not be null)
"""
... | java | public void searchConfigurationFiles(final String wildcard, final String extension) {
// Store parameters
this.configurationFileWildcard = wildcard;
this.configurationFileExtension = extension;
// Search and analyze all properties files available
readPropertiesFiles();
... | [
"public",
"void",
"searchConfigurationFiles",
"(",
"final",
"String",
"wildcard",
",",
"final",
"String",
"extension",
")",
"{",
"// Store parameters\r",
"this",
".",
"configurationFileWildcard",
"=",
"wildcard",
";",
"this",
".",
"configurationFileExtension",
"=",
"e... | Search configuration files according to the parameters provided.
@param wildcard the regex wildcard (must not be null)
@param extension the file extension without the first dot (ie: properties) (must not be null) | [
"Search",
"configuration",
"files",
"according",
"to",
"the",
"parameters",
"provided",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/resource/parameter/ParameterBuilder.java#L79-L87 |
timols/java-gitlab-api | src/main/java/org/gitlab/api/GitlabAPI.java | GitlabAPI.updateEmailsOnPush | public boolean updateEmailsOnPush(Integer projectId, String emailAddress) throws IOException {
"""
Update recipients for email-on-push service for a projectId.
@param projectId The ID of the project containing the variable.
@param emailAddress The emailaddress of the recipent who is going to receive push no... | java | public boolean updateEmailsOnPush(Integer projectId, String emailAddress) throws IOException {
GitlabServiceEmailOnPush emailOnPush = this.getEmailsOnPush(projectId);
GitlabEmailonPushProperties properties = emailOnPush.getProperties();
String appendedRecipients = properties.getRecipients();
... | [
"public",
"boolean",
"updateEmailsOnPush",
"(",
"Integer",
"projectId",
",",
"String",
"emailAddress",
")",
"throws",
"IOException",
"{",
"GitlabServiceEmailOnPush",
"emailOnPush",
"=",
"this",
".",
"getEmailsOnPush",
"(",
"projectId",
")",
";",
"GitlabEmailonPushProper... | Update recipients for email-on-push service for a projectId.
@param projectId The ID of the project containing the variable.
@param emailAddress The emailaddress of the recipent who is going to receive push notification.
@return
@throws IOException on gitlab api call error | [
"Update",
"recipients",
"for",
"email",
"-",
"on",
"-",
"push",
"service",
"for",
"a",
"projectId",
"."
] | train | https://github.com/timols/java-gitlab-api/blob/f03eedf952cfbb40306be3bf9234dcf78fab029e/src/main/java/org/gitlab/api/GitlabAPI.java#L3786-L3803 |
openzipkin-contrib/brave-opentracing | src/main/java/brave/opentracing/BraveSpan.java | BraveSpan.setBaggageItem | @Override public BraveSpan setBaggageItem(String key, String value) {
"""
This is a NOOP unless {@link ExtraFieldPropagation} is in use
"""
ExtraFieldPropagation.set(delegate.context(), key, value);
return this;
} | java | @Override public BraveSpan setBaggageItem(String key, String value) {
ExtraFieldPropagation.set(delegate.context(), key, value);
return this;
} | [
"@",
"Override",
"public",
"BraveSpan",
"setBaggageItem",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"ExtraFieldPropagation",
".",
"set",
"(",
"delegate",
".",
"context",
"(",
")",
",",
"key",
",",
"value",
")",
";",
"return",
"this",
";",
"... | This is a NOOP unless {@link ExtraFieldPropagation} is in use | [
"This",
"is",
"a",
"NOOP",
"unless",
"{"
] | train | https://github.com/openzipkin-contrib/brave-opentracing/blob/07653ac3a67beb7df71008961051ff03db2b60b7/src/main/java/brave/opentracing/BraveSpan.java#L126-L129 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/container/ContainerRenderer.java | ContainerRenderer.encodeBegin | @Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
"""
This methods generates the HTML code of the current b:container.
<code>encodeBegin</code> generates the start of the component. After the,
the JSF framework calls <code>encodeChildren()</code> to generate the... | java | @Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
if (!component.isRendered()) {
return;
}
Container container = (Container) component;
ResponseWriter rw = context.getResponseWriter();
String clientId = container.getClientId();
boolean fluid = container... | [
"@",
"Override",
"public",
"void",
"encodeBegin",
"(",
"FacesContext",
"context",
",",
"UIComponent",
"component",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"component",
".",
"isRendered",
"(",
")",
")",
"{",
"return",
";",
"}",
"Container",
"contai... | This methods generates the HTML code of the current b:container.
<code>encodeBegin</code> generates the start of the component. After the,
the JSF framework calls <code>encodeChildren()</code> to generate the
HTML code between the beginning and the end of the component. For
instance, in the case of a panel component th... | [
"This",
"methods",
"generates",
"the",
"HTML",
"code",
"of",
"the",
"current",
"b",
":",
"container",
".",
"<code",
">",
"encodeBegin<",
"/",
"code",
">",
"generates",
"the",
"start",
"of",
"the",
"component",
".",
"After",
"the",
"the",
"JSF",
"framework"... | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/container/ContainerRenderer.java#L51-L81 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/Image.java | Image.setColor | public void setColor(int corner, float r, float g, float b, float a) {
"""
Set the color of the given corner when this image is rendered. This is
useful lots of visual effect but especially light maps
@param corner The corner identifier for the corner to be set
@param r The red component value to set (between... | java | public void setColor(int corner, float r, float g, float b, float a) {
if (corners == null) {
corners = new Color[] {new Color(1,1,1,1f),new Color(1,1,1,1f), new Color(1,1,1,1f), new Color(1,1,1,1f)};
}
corners[corner].r = r;
corners[corner].g = g;
corners[corner].b = b;
corners[corner].a = a;... | [
"public",
"void",
"setColor",
"(",
"int",
"corner",
",",
"float",
"r",
",",
"float",
"g",
",",
"float",
"b",
",",
"float",
"a",
")",
"{",
"if",
"(",
"corners",
"==",
"null",
")",
"{",
"corners",
"=",
"new",
"Color",
"[",
"]",
"{",
"new",
"Color",... | Set the color of the given corner when this image is rendered. This is
useful lots of visual effect but especially light maps
@param corner The corner identifier for the corner to be set
@param r The red component value to set (between 0 and 1)
@param g The green component value to set (between 0 and 1)
@param b The b... | [
"Set",
"the",
"color",
"of",
"the",
"given",
"corner",
"when",
"this",
"image",
"is",
"rendered",
".",
"This",
"is",
"useful",
"lots",
"of",
"visual",
"effect",
"but",
"especially",
"light",
"maps"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/Image.java#L375-L384 |
wisdom-framework/wisdom | framework/resource-controller/src/main/java/org/wisdom/resources/CacheUtils.java | CacheUtils.addLastModified | public static void addLastModified(Result result, long lastModified) {
"""
Add the last modified header to the given result. This method handle the HTTP Date format.
@param result the result
@param lastModified the date
"""
result.with(HeaderNames.LAST_MODIFIED, DateUtil.formatForHttpHeader(l... | java | public static void addLastModified(Result result, long lastModified) {
result.with(HeaderNames.LAST_MODIFIED, DateUtil.formatForHttpHeader(lastModified));
} | [
"public",
"static",
"void",
"addLastModified",
"(",
"Result",
"result",
",",
"long",
"lastModified",
")",
"{",
"result",
".",
"with",
"(",
"HeaderNames",
".",
"LAST_MODIFIED",
",",
"DateUtil",
".",
"formatForHttpHeader",
"(",
"lastModified",
")",
")",
";",
"}"... | Add the last modified header to the given result. This method handle the HTTP Date format.
@param result the result
@param lastModified the date | [
"Add",
"the",
"last",
"modified",
"header",
"to",
"the",
"given",
"result",
".",
"This",
"method",
"handle",
"the",
"HTTP",
"Date",
"format",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/framework/resource-controller/src/main/java/org/wisdom/resources/CacheUtils.java#L61-L63 |
FXMisc/UndoFX | undofx/src/main/java/org/fxmisc/undo/impl/UndoManagerImpl.java | UndoManagerImpl.applyChange | private boolean applyChange(boolean isChangeAvailable, Supplier<C> changeToApply) {
"""
Helper method for reducing code duplication
@param isChangeAvailable same as `isUndoAvailable()` [Undo] or `isRedoAvailable()` [Redo]
@param changeToApply same as `invert.apply(queue.prev())` [Undo] or `queue.next()` [Redo]... | java | private boolean applyChange(boolean isChangeAvailable, Supplier<C> changeToApply) {
if (isChangeAvailable) {
canMerge = false;
// perform change
C change = changeToApply.get();
this.expectedChange = change;
performingAction.suspendWhile(() -> apply.ac... | [
"private",
"boolean",
"applyChange",
"(",
"boolean",
"isChangeAvailable",
",",
"Supplier",
"<",
"C",
">",
"changeToApply",
")",
"{",
"if",
"(",
"isChangeAvailable",
")",
"{",
"canMerge",
"=",
"false",
";",
"// perform change",
"C",
"change",
"=",
"changeToApply"... | Helper method for reducing code duplication
@param isChangeAvailable same as `isUndoAvailable()` [Undo] or `isRedoAvailable()` [Redo]
@param changeToApply same as `invert.apply(queue.prev())` [Undo] or `queue.next()` [Redo] | [
"Helper",
"method",
"for",
"reducing",
"code",
"duplication"
] | train | https://github.com/FXMisc/UndoFX/blob/5f9404a657e1dcfcd60bebee0aadef2f072dc2ab/undofx/src/main/java/org/fxmisc/undo/impl/UndoManagerImpl.java#L206-L224 |
kiegroup/drools | drools-compiler/src/main/java/org/drools/compiler/rule/builder/dialect/java/parser/JavaParser.java | JavaParser.booleanLiteral | public final void booleanLiteral() throws RecognitionException {
"""
src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:601:1: booleanLiteral : ( 'true' | 'false' );
"""
int booleanLiteral_StartIndex = input.index();
try {
if ( state.backtracking>0 && alreadyParsedRule(input, 63) ) { r... | java | public final void booleanLiteral() throws RecognitionException {
int booleanLiteral_StartIndex = input.index();
try {
if ( state.backtracking>0 && alreadyParsedRule(input, 63) ) { return; }
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:602:5: ( 'true' | 'false' )
// src/main/reso... | [
"public",
"final",
"void",
"booleanLiteral",
"(",
")",
"throws",
"RecognitionException",
"{",
"int",
"booleanLiteral_StartIndex",
"=",
"input",
".",
"index",
"(",
")",
";",
"try",
"{",
"if",
"(",
"state",
".",
"backtracking",
">",
"0",
"&&",
"alreadyParsedRule... | src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:601:1: booleanLiteral : ( 'true' | 'false' ); | [
"src",
"/",
"main",
"/",
"resources",
"/",
"org",
"/",
"drools",
"/",
"compiler",
"/",
"semantics",
"/",
"java",
"/",
"parser",
"/",
"Java",
".",
"g",
":",
"601",
":",
"1",
":",
"booleanLiteral",
":",
"(",
"true",
"|",
"false",
")",
";"
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-compiler/src/main/java/org/drools/compiler/rule/builder/dialect/java/parser/JavaParser.java#L5161-L5192 |
MenoData/Time4J | base/src/main/java/net/time4j/tz/model/GregorianTimezoneRule.java | GregorianTimezoneRule.ofLastWeekday | public static GregorianTimezoneRule ofLastWeekday(
Month month,
Weekday dayOfWeek,
PlainTime timeOfDay,
OffsetIndicator indicator,
int savings
) {
"""
/*[deutsch]
<p>Konstruiert ein Muster für den letzten Wochentag im angegebenen
Monat. </p>
@param month ... | java | public static GregorianTimezoneRule ofLastWeekday(
Month month,
Weekday dayOfWeek,
PlainTime timeOfDay,
OffsetIndicator indicator,
int savings
) {
return ofLastWeekday(month, dayOfWeek, timeOfDay.getInt(PlainTime.SECOND_OF_DAY), indicator, savings);
} | [
"public",
"static",
"GregorianTimezoneRule",
"ofLastWeekday",
"(",
"Month",
"month",
",",
"Weekday",
"dayOfWeek",
",",
"PlainTime",
"timeOfDay",
",",
"OffsetIndicator",
"indicator",
",",
"int",
"savings",
")",
"{",
"return",
"ofLastWeekday",
"(",
"month",
",",
"da... | /*[deutsch]
<p>Konstruiert ein Muster für den letzten Wochentag im angegebenen
Monat. </p>
@param month calendar month
@param dayOfWeek last day of week
@param timeOfDay clock time when time switch happens
@param indicator offset indicator
@param savings fixed DST-offset in seconds
@retu... | [
"/",
"*",
"[",
"deutsch",
"]",
"<p",
">",
"Konstruiert",
"ein",
"Muster",
"fü",
";",
"r",
"den",
"letzten",
"Wochentag",
"im",
"angegebenen",
"Monat",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/tz/model/GregorianTimezoneRule.java#L203-L213 |
calrissian/mango | mango-core/src/main/java/org/calrissian/mango/collect/FluentCloseableIterable.java | FluentCloseableIterable.append | @SafeVarargs
public final FluentCloseableIterable<T> append(T... elements) {
"""
Returns a fluent iterable whose iterators traverse first the elements of this fluent iterable,
followed by {@code elements}.
"""
return from(wrap(Iterables.concat(this, asList(elements)), this));
} | java | @SafeVarargs
public final FluentCloseableIterable<T> append(T... elements) {
return from(wrap(Iterables.concat(this, asList(elements)), this));
} | [
"@",
"SafeVarargs",
"public",
"final",
"FluentCloseableIterable",
"<",
"T",
">",
"append",
"(",
"T",
"...",
"elements",
")",
"{",
"return",
"from",
"(",
"wrap",
"(",
"Iterables",
".",
"concat",
"(",
"this",
",",
"asList",
"(",
"elements",
")",
")",
",",
... | Returns a fluent iterable whose iterators traverse first the elements of this fluent iterable,
followed by {@code elements}. | [
"Returns",
"a",
"fluent",
"iterable",
"whose",
"iterators",
"traverse",
"first",
"the",
"elements",
"of",
"this",
"fluent",
"iterable",
"followed",
"by",
"{"
] | train | https://github.com/calrissian/mango/blob/a95aa5e77af9aa0e629787228d80806560023452/mango-core/src/main/java/org/calrissian/mango/collect/FluentCloseableIterable.java#L134-L137 |
lordcodes/SnackbarBuilder | snackbarbuilder/src/main/java/com/github/andrewlord1990/snackbarbuilder/SnackbarWrapper.java | SnackbarWrapper.appendMessage | @NonNull
@SuppressWarnings("WeakerAccess")
public SnackbarWrapper appendMessage(@NonNull CharSequence message, @ColorInt int color) {
"""
Append text in the specified color to the Snackbar.
@param message The text to append.
@param color The color to apply to the text.
@return This instance.
"""
... | java | @NonNull
@SuppressWarnings("WeakerAccess")
public SnackbarWrapper appendMessage(@NonNull CharSequence message, @ColorInt int color) {
Spannable spannable = new SpannableString(message);
spannable.setSpan(new ForegroundColorSpan(color), 0, spannable.length(),
Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
... | [
"@",
"NonNull",
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"SnackbarWrapper",
"appendMessage",
"(",
"@",
"NonNull",
"CharSequence",
"message",
",",
"@",
"ColorInt",
"int",
"color",
")",
"{",
"Spannable",
"spannable",
"=",
"new",
"SpannableStr... | Append text in the specified color to the Snackbar.
@param message The text to append.
@param color The color to apply to the text.
@return This instance. | [
"Append",
"text",
"in",
"the",
"specified",
"color",
"to",
"the",
"Snackbar",
"."
] | train | https://github.com/lordcodes/SnackbarBuilder/blob/a104a753c78ed66940c19d295e141a521cf81d73/snackbarbuilder/src/main/java/com/github/andrewlord1990/snackbarbuilder/SnackbarWrapper.java#L392-L400 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java | FSNamesystem.addToInvalidatesNoLog | void addToInvalidatesNoLog(Block b, DatanodeInfo n, boolean ackRequired) {
"""
Adds block to list of blocks which will be invalidated on
specified datanode
@param b block
@param n datanode
"""
// We are the standby avatar and we don't want to add blocks to the
// invalidates list.
if (this.get... | java | void addToInvalidatesNoLog(Block b, DatanodeInfo n, boolean ackRequired) {
// We are the standby avatar and we don't want to add blocks to the
// invalidates list.
if (this.getNameNode().shouldRetryAbsentBlocks()) {
return;
}
LightWeightHashSet<Block> invalidateSet = recentInvalidateSets.get(... | [
"void",
"addToInvalidatesNoLog",
"(",
"Block",
"b",
",",
"DatanodeInfo",
"n",
",",
"boolean",
"ackRequired",
")",
"{",
"// We are the standby avatar and we don't want to add blocks to the",
"// invalidates list.",
"if",
"(",
"this",
".",
"getNameNode",
"(",
")",
".",
"s... | Adds block to list of blocks which will be invalidated on
specified datanode
@param b block
@param n datanode | [
"Adds",
"block",
"to",
"list",
"of",
"blocks",
"which",
"will",
"be",
"invalidated",
"on",
"specified",
"datanode"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSNamesystem.java#L3416-L3435 |
pwall567/jsonutil | src/main/java/net/pwall/json/JSON.java | JSON.parseObject | public static JSONObject parseObject(File f, String csName) throws IOException {
"""
Parse the contents of a {@link File} as a JSON object, specifying the character set by
name.
@param f the {@link File}
@param csName the character set name
@return the JSON object
@throws JSONException ... | java | public static JSONObject parseObject(File f, String csName) throws IOException {
return (JSONObject)parse(f, csName);
} | [
"public",
"static",
"JSONObject",
"parseObject",
"(",
"File",
"f",
",",
"String",
"csName",
")",
"throws",
"IOException",
"{",
"return",
"(",
"JSONObject",
")",
"parse",
"(",
"f",
",",
"csName",
")",
";",
"}"
] | Parse the contents of a {@link File} as a JSON object, specifying the character set by
name.
@param f the {@link File}
@param csName the character set name
@return the JSON object
@throws JSONException if the file does not contain a valid JSON value
@throws IOException on any I/O errors
@throws ... | [
"Parse",
"the",
"contents",
"of",
"a",
"{",
"@link",
"File",
"}",
"as",
"a",
"JSON",
"object",
"specifying",
"the",
"character",
"set",
"by",
"name",
"."
] | train | https://github.com/pwall567/jsonutil/blob/dd5960b9b0bcc9acfe6c52b884fffd9ee5f422fe/src/main/java/net/pwall/json/JSON.java#L306-L308 |
nutzam/nutzwx | src/main/java/org/nutz/weixin/util/Wxs.java | Wxs.checkPayReturn | public static NutMap checkPayReturn(String xml, String key) {
"""
检查一下支付平台返回的 xml,是否签名合法,如果合法,转换成一个 map
@param xml
支付平台返回的 xml
@param key
商户秘钥
@return 合法的 Map
@throws "e.wx.sign.invalid"
@see #checkPayReturnMap(NutMap, String)
@see <a href=
"https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9... | java | public static NutMap checkPayReturn(String xml, String key) {
try {
NutMap map = Xmls.asMap(xmls().parse(new InputSource(new StringReader(xml))).getDocumentElement());
return checkPayReturnMap(map, key);
}
catch (Exception e) {
throw Lang.makeThrow("e.wx.pay.r... | [
"public",
"static",
"NutMap",
"checkPayReturn",
"(",
"String",
"xml",
",",
"String",
"key",
")",
"{",
"try",
"{",
"NutMap",
"map",
"=",
"Xmls",
".",
"asMap",
"(",
"xmls",
"(",
")",
".",
"parse",
"(",
"new",
"InputSource",
"(",
"new",
"StringReader",
"(... | 检查一下支付平台返回的 xml,是否签名合法,如果合法,转换成一个 map
@param xml
支付平台返回的 xml
@param key
商户秘钥
@return 合法的 Map
@throws "e.wx.sign.invalid"
@see #checkPayReturnMap(NutMap, String)
@see <a href=
"https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_1">
支付平台文档</a> | [
"检查一下支付平台返回的",
"xml,是否签名合法,如果合法,转换成一个",
"map"
] | train | https://github.com/nutzam/nutzwx/blob/e6c8831b75f8a96bcc060b0c5562b882eefcf5ee/src/main/java/org/nutz/weixin/util/Wxs.java#L155-L163 |
lessthanoptimal/BoofCV | demonstrations/src/main/java/boofcv/demonstrations/sfm/multiview/DemoThreeViewStereoApp.java | DemoThreeViewStereoApp.scaleBuffered | private BufferedImage scaleBuffered( BufferedImage input ) {
"""
Scale buffered image so that it meets the image size restrictions
"""
int m = Math.max(input.getWidth(),input.getHeight());
if( m <= controls.maxImageSize )
return input;
else {
double scale = controls.maxImageSize/(double)m;
int w... | java | private BufferedImage scaleBuffered( BufferedImage input ) {
int m = Math.max(input.getWidth(),input.getHeight());
if( m <= controls.maxImageSize )
return input;
else {
double scale = controls.maxImageSize/(double)m;
int w = (int)(scale*input.getWidth()+0.5);
int h = (int)(scale*input.getHeight()+0.5)... | [
"private",
"BufferedImage",
"scaleBuffered",
"(",
"BufferedImage",
"input",
")",
"{",
"int",
"m",
"=",
"Math",
".",
"max",
"(",
"input",
".",
"getWidth",
"(",
")",
",",
"input",
".",
"getHeight",
"(",
")",
")",
";",
"if",
"(",
"m",
"<=",
"controls",
... | Scale buffered image so that it meets the image size restrictions | [
"Scale",
"buffered",
"image",
"so",
"that",
"it",
"meets",
"the",
"image",
"size",
"restrictions"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/demonstrations/src/main/java/boofcv/demonstrations/sfm/multiview/DemoThreeViewStereoApp.java#L309-L327 |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/serialize/write/AbstractXMLSerializer.java | AbstractXMLSerializer.handlePutNamespaceContextPrefixInRoot | protected final void handlePutNamespaceContextPrefixInRoot (@Nonnull final Map <QName, String> aAttrMap) {
"""
This method handles the case, if all namespace context entries should be
emitted on the root element.
@param aAttrMap
"""
if (m_aSettings.isEmitNamespaces () &&
m_aNSStack.size () == 1... | java | protected final void handlePutNamespaceContextPrefixInRoot (@Nonnull final Map <QName, String> aAttrMap)
{
if (m_aSettings.isEmitNamespaces () &&
m_aNSStack.size () == 1 &&
m_aSettings.isPutNamespaceContextPrefixesInRoot ())
{
// The only place where the namespace context prefixes are ad... | [
"protected",
"final",
"void",
"handlePutNamespaceContextPrefixInRoot",
"(",
"@",
"Nonnull",
"final",
"Map",
"<",
"QName",
",",
"String",
">",
"aAttrMap",
")",
"{",
"if",
"(",
"m_aSettings",
".",
"isEmitNamespaces",
"(",
")",
"&&",
"m_aNSStack",
".",
"size",
"(... | This method handles the case, if all namespace context entries should be
emitted on the root element.
@param aAttrMap | [
"This",
"method",
"handles",
"the",
"case",
"if",
"all",
"namespace",
"context",
"entries",
"should",
"be",
"emitted",
"on",
"the",
"root",
"element",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/serialize/write/AbstractXMLSerializer.java#L498-L512 |
LGoodDatePicker/LGoodDatePicker | Project/src/main/java/com/github/lgooddatepicker/zinternaltools/DemoPanel.java | DemoPanel.addLabel | public void addLabel(JPanel panel, int x, int pickerRow, String labelText) {
"""
JFormDesigner - End of variables declaration //GEN-END:variables
"""
((GridBagLayout) panel.getLayout()).rowHeights[(pickerRow - 3)] = 6;
JLabel label = new JLabel();
label.setText(labelText);
pan... | java | public void addLabel(JPanel panel, int x, int pickerRow, String labelText) {
((GridBagLayout) panel.getLayout()).rowHeights[(pickerRow - 3)] = 6;
JLabel label = new JLabel();
label.setText(labelText);
panel.add(label, new GridBagConstraints(x, (pickerRow - 2), 1, 1, 0.0, 0.0,
... | [
"public",
"void",
"addLabel",
"(",
"JPanel",
"panel",
",",
"int",
"x",
",",
"int",
"pickerRow",
",",
"String",
"labelText",
")",
"{",
"(",
"(",
"GridBagLayout",
")",
"panel",
".",
"getLayout",
"(",
")",
")",
".",
"rowHeights",
"[",
"(",
"pickerRow",
"-... | JFormDesigner - End of variables declaration //GEN-END:variables | [
"JFormDesigner",
"-",
"End",
"of",
"variables",
"declaration",
"//",
"GEN",
"-",
"END",
":",
"variables"
] | train | https://github.com/LGoodDatePicker/LGoodDatePicker/blob/c7df05a5fe382e1e08a6237e9391d8dc5fd48692/Project/src/main/java/com/github/lgooddatepicker/zinternaltools/DemoPanel.java#L203-L212 |
Graylog2/graylog2-server | graylog2-server/src/main/java/org/graylog2/plugin/Version.java | Version.fromClasspathProperties | public static Version fromClasspathProperties(String path, String gitPath, Version defaultVersion) {
"""
Try to read the version from {@code path} ({@code project.version} property)
and {@code gitPath} ({@code git.commit.id} property) from the classpath.
@param path Path of the properties file on the... | java | public static Version fromClasspathProperties(String path, String gitPath, Version defaultVersion) {
return fromClasspathProperties(path, "project.version", gitPath, "git.commit.id", defaultVersion);
} | [
"public",
"static",
"Version",
"fromClasspathProperties",
"(",
"String",
"path",
",",
"String",
"gitPath",
",",
"Version",
"defaultVersion",
")",
"{",
"return",
"fromClasspathProperties",
"(",
"path",
",",
"\"project.version\"",
",",
"gitPath",
",",
"\"git.commit.id\"... | Try to read the version from {@code path} ({@code project.version} property)
and {@code gitPath} ({@code git.commit.id} property) from the classpath.
@param path Path of the properties file on the classpath which contains the version information.
@param gitPath Path of the properties file on the class... | [
"Try",
"to",
"read",
"the",
"version",
"from",
"{",
"@code",
"path",
"}",
"(",
"{",
"@code",
"project",
".",
"version",
"}",
"property",
")",
"and",
"{",
"@code",
"gitPath",
"}",
"(",
"{",
"@code",
"git",
".",
"commit",
".",
"id",
"}",
"property",
... | train | https://github.com/Graylog2/graylog2-server/blob/50b565dcead6e0a372236d5c2f8530dc5726fa9b/graylog2-server/src/main/java/org/graylog2/plugin/Version.java#L184-L186 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/optimize/solvers/accumulation/BasicGradientsAccumulator.java | BasicGradientsAccumulator.storeUpdate | @Override
public void storeUpdate(INDArray array, int iterationNumber, int epochNumber) {
"""
This method accepts updates suitable for StepFunction, and accumulates/propagates it across all workers
@param array
"""
/*
Here we want to do 4 things:
1) update accumulated val... | java | @Override
public void storeUpdate(INDArray array, int iterationNumber, int epochNumber) {
/*
Here we want to do 4 things:
1) update accumulated values
2) invoke extractor, that'll (optionally) pull all updates above threshold
3) ???
4) PROFIT!
... | [
"@",
"Override",
"public",
"void",
"storeUpdate",
"(",
"INDArray",
"array",
",",
"int",
"iterationNumber",
",",
"int",
"epochNumber",
")",
"{",
"/*\n Here we want to do 4 things:\n 1) update accumulated values\n 2) invoke extractor, that'll (optionall... | This method accepts updates suitable for StepFunction, and accumulates/propagates it across all workers
@param array | [
"This",
"method",
"accepts",
"updates",
"suitable",
"for",
"StepFunction",
"and",
"accumulates",
"/",
"propagates",
"it",
"across",
"all",
"workers"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nn/src/main/java/org/deeplearning4j/optimize/solvers/accumulation/BasicGradientsAccumulator.java#L181-L238 |
casmi/casmi | src/main/java/casmi/graphics/element/Rect.java | Rect.setGradationColor | public void setGradationColor(GradationMode2D mode, ColorSet colorSet1, ColorSet colorSet2) {
"""
Sets the gradation mode and colors.
@param mode The mode of gradation.
@param colorSet1 The colorSet for gradation.
@param colorSet2 The colorSet for gradation.
@see casmi.GradationMode2D
"""
setGr... | java | public void setGradationColor(GradationMode2D mode, ColorSet colorSet1, ColorSet colorSet2) {
setGradationColor(mode, new RGBColor(colorSet1), new RGBColor(colorSet2));
} | [
"public",
"void",
"setGradationColor",
"(",
"GradationMode2D",
"mode",
",",
"ColorSet",
"colorSet1",
",",
"ColorSet",
"colorSet2",
")",
"{",
"setGradationColor",
"(",
"mode",
",",
"new",
"RGBColor",
"(",
"colorSet1",
")",
",",
"new",
"RGBColor",
"(",
"colorSet2"... | Sets the gradation mode and colors.
@param mode The mode of gradation.
@param colorSet1 The colorSet for gradation.
@param colorSet2 The colorSet for gradation.
@see casmi.GradationMode2D | [
"Sets",
"the",
"gradation",
"mode",
"and",
"colors",
"."
] | train | https://github.com/casmi/casmi/blob/90f6514a9cbce0685186e7a92beb69e22a3b11c4/src/main/java/casmi/graphics/element/Rect.java#L277-L279 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java | LambdaToMethod.setVarargsIfNeeded | private void setVarargsIfNeeded(JCTree tree, Type varargsElement) {
"""
Set varargsElement field on a given tree (must be either a new class tree
or a method call tree)
"""
if (varargsElement != null) {
switch (tree.getTag()) {
case APPLY: ((JCMethodInvocation)tree).varargs... | java | private void setVarargsIfNeeded(JCTree tree, Type varargsElement) {
if (varargsElement != null) {
switch (tree.getTag()) {
case APPLY: ((JCMethodInvocation)tree).varargsElement = varargsElement; break;
case NEWCLASS: ((JCNewClass)tree).varargsElement = varargsElement;... | [
"private",
"void",
"setVarargsIfNeeded",
"(",
"JCTree",
"tree",
",",
"Type",
"varargsElement",
")",
"{",
"if",
"(",
"varargsElement",
"!=",
"null",
")",
"{",
"switch",
"(",
"tree",
".",
"getTag",
"(",
")",
")",
"{",
"case",
"APPLY",
":",
"(",
"(",
"JCM... | Set varargsElement field on a given tree (must be either a new class tree
or a method call tree) | [
"Set",
"varargsElement",
"field",
"on",
"a",
"given",
"tree",
"(",
"must",
"be",
"either",
"a",
"new",
"class",
"tree",
"or",
"a",
"method",
"call",
"tree",
")"
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java#L749-L757 |
apache/incubator-atlas | addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java | HiveMetaStoreBridge.getDBQualifiedName | public static String getDBQualifiedName(String clusterName, String dbName) {
"""
Construct the qualified name used to uniquely identify a Database instance in Atlas.
@param clusterName Name of the cluster to which the Hive component belongs
@param dbName Name of the Hive database
@return Unique qualified name t... | java | public static String getDBQualifiedName(String clusterName, String dbName) {
return String.format("%s@%s", dbName.toLowerCase(), clusterName);
} | [
"public",
"static",
"String",
"getDBQualifiedName",
"(",
"String",
"clusterName",
",",
"String",
"dbName",
")",
"{",
"return",
"String",
".",
"format",
"(",
"\"%s@%s\"",
",",
"dbName",
".",
"toLowerCase",
"(",
")",
",",
"clusterName",
")",
";",
"}"
] | Construct the qualified name used to uniquely identify a Database instance in Atlas.
@param clusterName Name of the cluster to which the Hive component belongs
@param dbName Name of the Hive database
@return Unique qualified name to identify the Database instance in Atlas. | [
"Construct",
"the",
"qualified",
"name",
"used",
"to",
"uniquely",
"identify",
"a",
"Database",
"instance",
"in",
"Atlas",
"."
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/addons/hive-bridge/src/main/java/org/apache/atlas/hive/bridge/HiveMetaStoreBridge.java#L239-L241 |
alipay/sofa-rpc | extension-impl/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/factory/MemoryReporterImpl.java | MemoryReporterImpl.getDeclaredField | public static Field getDeclaredField(Object object, String fieldName) {
"""
循环向上转型, 获取对象的 DeclaredField
@param object : 子类对象
@param fieldName : 父类中的属性名
@return 父类中的属性对象
"""
Field field = null;
Class<?> clazz = object.getClass();
for (; clazz != Object.class; clazz = clazz.getSup... | java | public static Field getDeclaredField(Object object, String fieldName) {
Field field = null;
Class<?> clazz = object.getClass();
for (; clazz != Object.class; clazz = clazz.getSuperclass()) {
try {
field = clazz.getDeclaredField(fieldName);
return field... | [
"public",
"static",
"Field",
"getDeclaredField",
"(",
"Object",
"object",
",",
"String",
"fieldName",
")",
"{",
"Field",
"field",
"=",
"null",
";",
"Class",
"<",
"?",
">",
"clazz",
"=",
"object",
".",
"getClass",
"(",
")",
";",
"for",
"(",
";",
"clazz"... | 循环向上转型, 获取对象的 DeclaredField
@param object : 子类对象
@param fieldName : 父类中的属性名
@return 父类中的属性对象 | [
"循环向上转型",
"获取对象的",
"DeclaredField"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/tracer-opentracing/src/main/java/com/alipay/sofa/rpc/tracer/sofatracer/factory/MemoryReporterImpl.java#L141-L154 |
EdwardRaff/JSAT | JSAT/src/jsat/io/CSV.java | CSV.readC | public static ClassificationDataSet readC(int classification_target, Path path, char delimiter, int lines_to_skip, char comment, Set<Integer> cat_cols) throws IOException {
"""
Reads in a CSV dataset as a classification dataset.
@param classification_target the column index (starting from zero) of the
feature ... | java | public static ClassificationDataSet readC(int classification_target, Path path, char delimiter, int lines_to_skip, char comment, Set<Integer> cat_cols) throws IOException
{
BufferedReader br = Files.newBufferedReader(path, Charset.defaultCharset());
ClassificationDataSet ret = readC(classification_t... | [
"public",
"static",
"ClassificationDataSet",
"readC",
"(",
"int",
"classification_target",
",",
"Path",
"path",
",",
"char",
"delimiter",
",",
"int",
"lines_to_skip",
",",
"char",
"comment",
",",
"Set",
"<",
"Integer",
">",
"cat_cols",
")",
"throws",
"IOExceptio... | Reads in a CSV dataset as a classification dataset.
@param classification_target the column index (starting from zero) of the
feature that will be the categorical target value
@param path the CSV file
@param delimiter the delimiter to separate columns, usually a comma
@param lines_to_skip the number of lines to skip w... | [
"Reads",
"in",
"a",
"CSV",
"dataset",
"as",
"a",
"classification",
"dataset",
"."
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/io/CSV.java#L214-L220 |
schallee/alib4j | core/src/main/java/net/darkmist/alib/io/BufferUtil.java | BufferUtil.allocateAndReadAll | public static ByteBuffer allocateAndReadAll(int size, ReadableByteChannel channel) throws IOException {
"""
Allocate a buffer and fill it from a channel. The returned
buffer will be rewound to the begining.
@return Buffer containing size bytes from the channel.
@throws IOException if the channel read does.
@th... | java | public static ByteBuffer allocateAndReadAll(int size, ReadableByteChannel channel) throws IOException
{
ByteBuffer buf = ByteBuffer.allocate(size);
int justRead;
int totalRead = 0;
// FIXME, this will be a tight loop if the channel is non-blocking...
while(totalRead < size)
{
logger.debug("reading tota... | [
"public",
"static",
"ByteBuffer",
"allocateAndReadAll",
"(",
"int",
"size",
",",
"ReadableByteChannel",
"channel",
")",
"throws",
"IOException",
"{",
"ByteBuffer",
"buf",
"=",
"ByteBuffer",
".",
"allocate",
"(",
"size",
")",
";",
"int",
"justRead",
";",
"int",
... | Allocate a buffer and fill it from a channel. The returned
buffer will be rewound to the begining.
@return Buffer containing size bytes from the channel.
@throws IOException if the channel read does.
@throws EOFException if a end of stream is encountered
before the full size is read. | [
"Allocate",
"a",
"buffer",
"and",
"fill",
"it",
"from",
"a",
"channel",
".",
"The",
"returned",
"buffer",
"will",
"be",
"rewound",
"to",
"the",
"begining",
"."
] | train | https://github.com/schallee/alib4j/blob/0e0718aee574bbb62268e1cf58e99286529ce529/core/src/main/java/net/darkmist/alib/io/BufferUtil.java#L57-L73 |
OpenLiberty/open-liberty | dev/com.ibm.ws.request.probes/src/com/ibm/wsspi/request/probe/bci/TransformDescriptorHelper.java | TransformDescriptorHelper.contextInfoRequired | public boolean contextInfoRequired(String eventType, long requestNumber) {
"""
This method will check if context information is required or not by
processing through each active ProbeExtensions available in PE List
@param eventType
@return
"""
boolean needContextInfo = false;
List<ProbeExtension> pr... | java | public boolean contextInfoRequired(String eventType, long requestNumber) {
boolean needContextInfo = false;
List<ProbeExtension> probeExtnList = RequestProbeService
.getProbeExtensions();
for (int i = 0; i < probeExtnList.size(); i++) {
ProbeExtension probeExtension = probeExtnList.get(i);
if (reques... | [
"public",
"boolean",
"contextInfoRequired",
"(",
"String",
"eventType",
",",
"long",
"requestNumber",
")",
"{",
"boolean",
"needContextInfo",
"=",
"false",
";",
"List",
"<",
"ProbeExtension",
">",
"probeExtnList",
"=",
"RequestProbeService",
".",
"getProbeExtensions",... | This method will check if context information is required or not by
processing through each active ProbeExtensions available in PE List
@param eventType
@return | [
"This",
"method",
"will",
"check",
"if",
"context",
"information",
"is",
"required",
"or",
"not",
"by",
"processing",
"through",
"each",
"active",
"ProbeExtensions",
"available",
"in",
"PE",
"List"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.request.probes/src/com/ibm/wsspi/request/probe/bci/TransformDescriptorHelper.java#L45-L68 |
palatable/lambda | src/main/java/com/jnape/palatable/lambda/adt/Maybe.java | Maybe.toEither | public final <L> Either<L, A> toEither(Supplier<L> lSupplier) {
"""
If this value is absent, return the value supplied by <code>lSupplier</code> wrapped in <code>Either.left</code>.
Otherwise, wrap the value in <code>Either.right</code> and return it.
@param lSupplier the supplier for the left value
@param <L... | java | public final <L> Either<L, A> toEither(Supplier<L> lSupplier) {
return fmap(Either::<L, A>right).orElseGet(() -> left(lSupplier.get()));
} | [
"public",
"final",
"<",
"L",
">",
"Either",
"<",
"L",
",",
"A",
">",
"toEither",
"(",
"Supplier",
"<",
"L",
">",
"lSupplier",
")",
"{",
"return",
"fmap",
"(",
"Either",
"::",
"<",
"L",
",",
"A",
">",
"right",
")",
".",
"orElseGet",
"(",
"(",
")... | If this value is absent, return the value supplied by <code>lSupplier</code> wrapped in <code>Either.left</code>.
Otherwise, wrap the value in <code>Either.right</code> and return it.
@param lSupplier the supplier for the left value
@param <L> the left parameter type
@return this value wrapped in an Either.right... | [
"If",
"this",
"value",
"is",
"absent",
"return",
"the",
"value",
"supplied",
"by",
"<code",
">",
"lSupplier<",
"/",
"code",
">",
"wrapped",
"in",
"<code",
">",
"Either",
".",
"left<",
"/",
"code",
">",
".",
"Otherwise",
"wrap",
"the",
"value",
"in",
"<... | train | https://github.com/palatable/lambda/blob/b643ba836c5916d1d8193822e5efb4e7b40c489a/src/main/java/com/jnape/palatable/lambda/adt/Maybe.java#L97-L99 |
artikcloud/artikcloud-java | src/main/java/cloud/artik/api/TokensApi.java | TokensApi.refreshToken | public RefreshTokenResponse refreshToken(String grantType, String refreshToken) throws ApiException {
"""
Refresh Token
Refresh Token
@param grantType Grant Type. (required)
@param refreshToken Refresh Token. (required)
@return RefreshTokenResponse
@throws ApiException If fail to call the API, e.g. server err... | java | public RefreshTokenResponse refreshToken(String grantType, String refreshToken) throws ApiException {
ApiResponse<RefreshTokenResponse> resp = refreshTokenWithHttpInfo(grantType, refreshToken);
return resp.getData();
} | [
"public",
"RefreshTokenResponse",
"refreshToken",
"(",
"String",
"grantType",
",",
"String",
"refreshToken",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"RefreshTokenResponse",
">",
"resp",
"=",
"refreshTokenWithHttpInfo",
"(",
"grantType",
",",
"refreshToke... | Refresh Token
Refresh Token
@param grantType Grant Type. (required)
@param refreshToken Refresh Token. (required)
@return RefreshTokenResponse
@throws ApiException If fail to call the API, e.g. server error or cannot deserialize the response body | [
"Refresh",
"Token",
"Refresh",
"Token"
] | train | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/TokensApi.java#L254-L257 |
restfb/restfb | src/main/java/com/restfb/util/StringUtils.java | StringUtils.fromInputStream | public static String fromInputStream(InputStream inputStream) throws IOException {
"""
Builds and returns a string representation of the given {@code inputStream} .
@param inputStream
The stream from which a string representation is built.
@return A string representation of the given {@code inputStream}.
@... | java | public static String fromInputStream(InputStream inputStream) throws IOException {
if (inputStream == null) {
return null;
}
try (BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream, ENCODING_CHARSET))) {
StringBuilder response = new StringBuilder();
String line;... | [
"public",
"static",
"String",
"fromInputStream",
"(",
"InputStream",
"inputStream",
")",
"throws",
"IOException",
"{",
"if",
"(",
"inputStream",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"try",
"(",
"BufferedReader",
"reader",
"=",
"new",
"BufferedRe... | Builds and returns a string representation of the given {@code inputStream} .
@param inputStream
The stream from which a string representation is built.
@return A string representation of the given {@code inputStream}.
@throws IOException
If an error occurs while processing the {@code inputStream}. | [
"Builds",
"and",
"returns",
"a",
"string",
"representation",
"of",
"the",
"given",
"{",
"@code",
"inputStream",
"}",
"."
] | train | https://github.com/restfb/restfb/blob/fb77ba5486d1339e7deb81b9830670fa209b1047/src/main/java/com/restfb/util/StringUtils.java#L144-L159 |
alkacon/opencms-core | src/org/opencms/xml/content/CmsDefaultXmlContentHandler.java | CmsDefaultXmlContentHandler.addDefaultCheckRules | protected void addDefaultCheckRules(
CmsXmlContentDefinition rootContentDefinition,
I_CmsXmlSchemaType schemaType,
String elementPath)
throws CmsXmlException {
"""
Adds all needed default check rules recursively for the given schema type.<p>
@param rootContentDefinition the root cont... | java | protected void addDefaultCheckRules(
CmsXmlContentDefinition rootContentDefinition,
I_CmsXmlSchemaType schemaType,
String elementPath)
throws CmsXmlException {
if ((schemaType != null) && schemaType.isSimpleType()) {
if ((schemaType.getMinOccurs() == 0)
&... | [
"protected",
"void",
"addDefaultCheckRules",
"(",
"CmsXmlContentDefinition",
"rootContentDefinition",
",",
"I_CmsXmlSchemaType",
"schemaType",
",",
"String",
"elementPath",
")",
"throws",
"CmsXmlException",
"{",
"if",
"(",
"(",
"schemaType",
"!=",
"null",
")",
"&&",
"... | Adds all needed default check rules recursively for the given schema type.<p>
@param rootContentDefinition the root content definition
@param schemaType the schema type to check
@param elementPath the current element path
@throws CmsXmlException if something goes wrong | [
"Adds",
"all",
"needed",
"default",
"check",
"rules",
"recursively",
"for",
"the",
"given",
"schema",
"type",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/content/CmsDefaultXmlContentHandler.java#L1937-L1969 |
Jasig/uPortal | uPortal-security/uPortal-security-mvc/src/main/java/org/apereo/portal/security/filter/CorsFilter.java | CorsFilter.getInitParameter | private String getInitParameter(String name, String defaultValue) {
"""
This method returns the parameter's value if it exists, or defaultValue if not.
@param name The parameter's name
@param defaultValue The default value to return if the parameter does not exist
@return The parameter's value or the default ... | java | private String getInitParameter(String name, String defaultValue) {
String value = getInitParameter(name);
if (value != null) {
return value;
}
return defaultValue;
} | [
"private",
"String",
"getInitParameter",
"(",
"String",
"name",
",",
"String",
"defaultValue",
")",
"{",
"String",
"value",
"=",
"getInitParameter",
"(",
"name",
")",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"return",
"value",
";",
"}",
"return",
... | This method returns the parameter's value if it exists, or defaultValue if not.
@param name The parameter's name
@param defaultValue The default value to return if the parameter does not exist
@return The parameter's value or the default value if the parameter does not exist | [
"This",
"method",
"returns",
"the",
"parameter",
"s",
"value",
"if",
"it",
"exists",
"or",
"defaultValue",
"if",
"not",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-mvc/src/main/java/org/apereo/portal/security/filter/CorsFilter.java#L228-L236 |
alkacon/opencms-core | src/org/opencms/file/CmsObject.java | CmsObject.setDateLastModified | public void setDateLastModified(String resourcename, long dateLastModified, boolean recursive) throws CmsException {
"""
Changes the "last modified" time stamp of a resource.<p>
@param resourcename the name of the resource to change (full current site relative path)
@param dateLastModified time stamp the new t... | java | public void setDateLastModified(String resourcename, long dateLastModified, boolean recursive) throws CmsException {
CmsResource resource = readResource(resourcename, CmsResourceFilter.IGNORE_EXPIRATION);
getResourceType(resource).setDateLastModified(this, m_securityManager, resource, dateLastModified,... | [
"public",
"void",
"setDateLastModified",
"(",
"String",
"resourcename",
",",
"long",
"dateLastModified",
",",
"boolean",
"recursive",
")",
"throws",
"CmsException",
"{",
"CmsResource",
"resource",
"=",
"readResource",
"(",
"resourcename",
",",
"CmsResourceFilter",
"."... | Changes the "last modified" time stamp of a resource.<p>
@param resourcename the name of the resource to change (full current site relative path)
@param dateLastModified time stamp the new time stamp of the changed resource
@param recursive if this operation is to be applied recursively to all resources in a folder
@... | [
"Changes",
"the",
"last",
"modified",
"time",
"stamp",
"of",
"a",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L3782-L3786 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urltemplates/URLTemplateDescriptor.java | URLTemplateDescriptor.getURLTemplateRef | public String getURLTemplateRef( String refGroupName, String key ) {
"""
Returns URL template name of the given type (by key).
@param refGroupName name of a group of templates from the config file.
@param key type of the template
@return template name
"""
String ref = null;
if ( _servletC... | java | public String getURLTemplateRef( String refGroupName, String key )
{
String ref = null;
if ( _servletContext != null )
{
URLTemplatesFactory urlTemplatesFactory = URLTemplatesFactory.getURLTemplatesFactory( _servletContext );
if ( urlTemplatesFactory != null )
... | [
"public",
"String",
"getURLTemplateRef",
"(",
"String",
"refGroupName",
",",
"String",
"key",
")",
"{",
"String",
"ref",
"=",
"null",
";",
"if",
"(",
"_servletContext",
"!=",
"null",
")",
"{",
"URLTemplatesFactory",
"urlTemplatesFactory",
"=",
"URLTemplatesFactory... | Returns URL template name of the given type (by key).
@param refGroupName name of a group of templates from the config file.
@param key type of the template
@return template name | [
"Returns",
"URL",
"template",
"name",
"of",
"the",
"given",
"type",
"(",
"by",
"key",
")",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/core/urltemplates/URLTemplateDescriptor.java#L102-L116 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/ExecutorsUtils.java | ExecutorsUtils.newDaemonThreadFactory | public static ThreadFactory newDaemonThreadFactory(Optional<Logger> logger, Optional<String> nameFormat) {
"""
Get a new {@link ThreadFactory} that uses a {@link LoggingUncaughtExceptionHandler}
to handle uncaught exceptions, uses the given thread name format, and produces daemon threads.
@param logger an {@li... | java | public static ThreadFactory newDaemonThreadFactory(Optional<Logger> logger, Optional<String> nameFormat) {
return newThreadFactory(new ThreadFactoryBuilder().setDaemon(true), logger, nameFormat);
} | [
"public",
"static",
"ThreadFactory",
"newDaemonThreadFactory",
"(",
"Optional",
"<",
"Logger",
">",
"logger",
",",
"Optional",
"<",
"String",
">",
"nameFormat",
")",
"{",
"return",
"newThreadFactory",
"(",
"new",
"ThreadFactoryBuilder",
"(",
")",
".",
"setDaemon",... | Get a new {@link ThreadFactory} that uses a {@link LoggingUncaughtExceptionHandler}
to handle uncaught exceptions, uses the given thread name format, and produces daemon threads.
@param logger an {@link Optional} wrapping the {@link Logger} that the
{@link LoggingUncaughtExceptionHandler} uses to log uncaught exceptio... | [
"Get",
"a",
"new",
"{",
"@link",
"ThreadFactory",
"}",
"that",
"uses",
"a",
"{",
"@link",
"LoggingUncaughtExceptionHandler",
"}",
"to",
"handle",
"uncaught",
"exceptions",
"uses",
"the",
"given",
"thread",
"name",
"format",
"and",
"produces",
"daemon",
"threads"... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/ExecutorsUtils.java#L102-L104 |
lessthanoptimal/ejml | main/ejml-simple/src/org/ejml/equation/TokenList.java | TokenList.insertAfter | public void insertAfter(Token before, TokenList list ) {
"""
Inserts the LokenList immediately following the 'before' token
"""
Token after = before.next;
before.next = list.first;
list.first.previous = before;
if( after == null ) {
last = list.last;
} else ... | java | public void insertAfter(Token before, TokenList list ) {
Token after = before.next;
before.next = list.first;
list.first.previous = before;
if( after == null ) {
last = list.last;
} else {
after.previous = list.last;
list.last.next = after;
... | [
"public",
"void",
"insertAfter",
"(",
"Token",
"before",
",",
"TokenList",
"list",
")",
"{",
"Token",
"after",
"=",
"before",
".",
"next",
";",
"before",
".",
"next",
"=",
"list",
".",
"first",
";",
"list",
".",
"first",
".",
"previous",
"=",
"before",... | Inserts the LokenList immediately following the 'before' token | [
"Inserts",
"the",
"LokenList",
"immediately",
"following",
"the",
"before",
"token"
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-simple/src/org/ejml/equation/TokenList.java#L217-L229 |
metamx/java-util | src/main/java/com/metamx/emitter/core/HttpPostEmitter.java | HttpPostEmitter.onSealExclusive | void onSealExclusive(Batch batch, long elapsedTimeMillis) {
"""
Called from {@link Batch} only once for each Batch in existence.
"""
batchFillingTimeCounter.add((int) Math.max(elapsedTimeMillis, 0));
if (elapsedTimeMillis > 0) {
// If elapsedTimeMillis is 0 or negative, it's likely because System... | java | void onSealExclusive(Batch batch, long elapsedTimeMillis)
{
batchFillingTimeCounter.add((int) Math.max(elapsedTimeMillis, 0));
if (elapsedTimeMillis > 0) {
// If elapsedTimeMillis is 0 or negative, it's likely because System.currentTimeMillis() is not monotonic, so not
// accounting this time for ... | [
"void",
"onSealExclusive",
"(",
"Batch",
"batch",
",",
"long",
"elapsedTimeMillis",
")",
"{",
"batchFillingTimeCounter",
".",
"add",
"(",
"(",
"int",
")",
"Math",
".",
"max",
"(",
"elapsedTimeMillis",
",",
"0",
")",
")",
";",
"if",
"(",
"elapsedTimeMillis",
... | Called from {@link Batch} only once for each Batch in existence. | [
"Called",
"from",
"{"
] | train | https://github.com/metamx/java-util/blob/9d204043da1136e94fb2e2d63e3543a29bf54b4d/src/main/java/com/metamx/emitter/core/HttpPostEmitter.java#L283-L300 |
JoeKerouac/utils | src/main/java/com/joe/utils/common/DateUtil.java | DateUtil.beforeNow | public static boolean beforeNow(String date, String format, DateUnit dateUnit) {
"""
判断指定日期是否在当前时间之前,精确到指定单位
@param date 指定日期
@param format 指定日期的格式
@param dateUnit 精确单位(例如传入年就是精确到年)
@return 如果指定日期在当前时间之前返回<code>true</code>
"""
logger.debug("指定日期为:{}", date);
return calc(new Date(), ... | java | public static boolean beforeNow(String date, String format, DateUnit dateUnit) {
logger.debug("指定日期为:{}", date);
return calc(new Date(), parse(date, format), dateUnit) > 0;
} | [
"public",
"static",
"boolean",
"beforeNow",
"(",
"String",
"date",
",",
"String",
"format",
",",
"DateUnit",
"dateUnit",
")",
"{",
"logger",
".",
"debug",
"(",
"\"指定日期为:{}\", date);",
"",
"",
"",
"",
"return",
"calc",
"(",
"new",
"Date",
"(",
")",
",",
... | 判断指定日期是否在当前时间之前,精确到指定单位
@param date 指定日期
@param format 指定日期的格式
@param dateUnit 精确单位(例如传入年就是精确到年)
@return 如果指定日期在当前时间之前返回<code>true</code> | [
"判断指定日期是否在当前时间之前,精确到指定单位"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/common/DateUtil.java#L218-L221 |
jsonld-java/jsonld-java | core/src/main/java/com/github/jsonldjava/core/JsonLdProcessor.java | JsonLdProcessor.fromRDF | public static Object fromRDF(Object input, JsonLdOptions options, RDFParser parser)
throws JsonLdError {
"""
Converts an RDF dataset to JSON-LD, using a specific instance of
{@link RDFParser}.
@param input
a serialized string of RDF in a format specified by the format
option or an RDF dataset to ... | java | public static Object fromRDF(Object input, JsonLdOptions options, RDFParser parser)
throws JsonLdError {
final RDFDataset dataset = parser.parse(input);
// convert from RDF
final Object rval = new JsonLdApi(options).fromRDF(dataset);
// re-process using the generated conte... | [
"public",
"static",
"Object",
"fromRDF",
"(",
"Object",
"input",
",",
"JsonLdOptions",
"options",
",",
"RDFParser",
"parser",
")",
"throws",
"JsonLdError",
"{",
"final",
"RDFDataset",
"dataset",
"=",
"parser",
".",
"parse",
"(",
"input",
")",
";",
"// convert ... | Converts an RDF dataset to JSON-LD, using a specific instance of
{@link RDFParser}.
@param input
a serialized string of RDF in a format specified by the format
option or an RDF dataset to convert.
@param options
the options to use: [format] the format if input is not an
array: 'application/nquads' for N-Quads (default... | [
"Converts",
"an",
"RDF",
"dataset",
"to",
"JSON",
"-",
"LD",
"using",
"a",
"specific",
"instance",
"of",
"{",
"@link",
"RDFParser",
"}",
"."
] | train | https://github.com/jsonld-java/jsonld-java/blob/efeef6ee96029a0011649633457035fa6be42da1/core/src/main/java/com/github/jsonldjava/core/JsonLdProcessor.java#L440-L462 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPSpecificationOptionPersistenceImpl.java | CPSpecificationOptionPersistenceImpl.fetchByG_K | @Override
public CPSpecificationOption fetchByG_K(long groupId, String key) {
"""
Returns the cp specification option where groupId = ? and key = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param groupId the group ID
@param key the key
@return the matching cp spec... | java | @Override
public CPSpecificationOption fetchByG_K(long groupId, String key) {
return fetchByG_K(groupId, key, true);
} | [
"@",
"Override",
"public",
"CPSpecificationOption",
"fetchByG_K",
"(",
"long",
"groupId",
",",
"String",
"key",
")",
"{",
"return",
"fetchByG_K",
"(",
"groupId",
",",
"key",
",",
"true",
")",
";",
"}"
] | Returns the cp specification option where groupId = ? and key = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param groupId the group ID
@param key the key
@return the matching cp specification option, or <code>null</code> if a matching cp specification option could not be fo... | [
"Returns",
"the",
"cp",
"specification",
"option",
"where",
"groupId",
"=",
"?",
";",
"and",
"key",
"=",
"?",
";",
"or",
"returns",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"it",
"could",
"not",
"be",
"found",
".",
"Uses",
"the",
"finder",
... | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPSpecificationOptionPersistenceImpl.java#L2586-L2589 |
Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/TrackMetadata.java | TrackMetadata.buildColorItem | private ColorItem buildColorItem(int colorId, String label) {
"""
Creates a color item that represents a color field fond for a track.
@param colorId the key of the color as found in the database
@param label the corresponding color label as found in the database (or sent in the dbserver message)
@return th... | java | private ColorItem buildColorItem(int colorId, String label) {
Color color;
String colorName;
switch (colorId) {
case 0:
color = new Color(0, 0, 0, 0);
colorName = "No Color";
break;
case 1:
color = Color.PINK... | [
"private",
"ColorItem",
"buildColorItem",
"(",
"int",
"colorId",
",",
"String",
"label",
")",
"{",
"Color",
"color",
";",
"String",
"colorName",
";",
"switch",
"(",
"colorId",
")",
"{",
"case",
"0",
":",
"color",
"=",
"new",
"Color",
"(",
"0",
",",
"0"... | Creates a color item that represents a color field fond for a track.
@param colorId the key of the color as found in the database
@param label the corresponding color label as found in the database (or sent in the dbserver message)
@return the color metadata field | [
"Creates",
"a",
"color",
"item",
"that",
"represents",
"a",
"color",
"field",
"fond",
"for",
"a",
"track",
"."
] | train | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/TrackMetadata.java#L182-L227 |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/security/CipherUtil.java | CipherUtil.getKeyStore | public static KeyStore getKeyStore(String keystoreLocation, String keystoreType) throws NoSuchAlgorithmException,
CertificateException, IOException,
Key... | java | public static KeyStore getKeyStore(String keystoreLocation, String keystoreType) throws NoSuchAlgorithmException,
CertificateException, IOException,
Key... | [
"public",
"static",
"KeyStore",
"getKeyStore",
"(",
"String",
"keystoreLocation",
",",
"String",
"keystoreType",
")",
"throws",
"NoSuchAlgorithmException",
",",
"CertificateException",
",",
"IOException",
",",
"KeyStoreException",
"{",
"KeyStore",
"keystore",
"=",
"KeyS... | Returns a key store instance of the specified type from the specified resource.
@param keystoreLocation Path to key store location.
@param keystoreType Key store type.
@return A key store instance.
@throws NoSuchAlgorithmException If algorithm not supported.
@throws CertificateException If certificate invalid.
@throws... | [
"Returns",
"a",
"key",
"store",
"instance",
"of",
"the",
"specified",
"type",
"from",
"the",
"specified",
"resource",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/security/CipherUtil.java#L71-L83 |
mygreen/super-csv-annotation | src/main/java/com/github/mygreen/supercsv/builder/FieldAccessor.java | FieldAccessor.getAnnotation | public <A extends Annotation> Optional<A> getAnnotation(final Class<A> annoClass) {
"""
アノテーションのタイプを指定してアノテーションを取得します。
<p>繰り返しのアノテーションの場合、初めに見つかったものを返します。</p>
@param <A> 取得対象のアノテーションのタイプ
@param annoClass 取得対象のアノテーションのタイプ。
@return 指定したアノテーションが見つからない場合は、空を返します。
@throws NullPointerException {@literal annoClass... | java | public <A extends Annotation> Optional<A> getAnnotation(final Class<A> annoClass) {
Objects.requireNonNull(annoClass, "annoClass should not be null.");
return getAnnotationsByType(expandedAnnos, annoClass).stream()
.findFirst();
} | [
"public",
"<",
"A",
"extends",
"Annotation",
">",
"Optional",
"<",
"A",
">",
"getAnnotation",
"(",
"final",
"Class",
"<",
"A",
">",
"annoClass",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"annoClass",
",",
"\"annoClass should not be null.\"",
")",
";",
... | アノテーションのタイプを指定してアノテーションを取得します。
<p>繰り返しのアノテーションの場合、初めに見つかったものを返します。</p>
@param <A> 取得対象のアノテーションのタイプ
@param annoClass 取得対象のアノテーションのタイプ。
@return 指定したアノテーションが見つからない場合は、空を返します。
@throws NullPointerException {@literal annoClass is null.} | [
"アノテーションのタイプを指定してアノテーションを取得します。",
"<p",
">",
"繰り返しのアノテーションの場合、初めに見つかったものを返します。<",
"/",
"p",
">"
] | train | https://github.com/mygreen/super-csv-annotation/blob/9910320cb6dc143be972c7d10d9ab5ffb09c3b84/src/main/java/com/github/mygreen/supercsv/builder/FieldAccessor.java#L75-L81 |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/parameters/Parameters.java | Parameters.getMapped | public <T> T getMapped(final String param, final Map<String, T> possibleValues) {
"""
Looks up a parameter, then uses the value as a key in a map lookup. If the value is not a key
in the map, throws an exception.
@param possibleValues May not be null. May not be empty.
@throws InvalidEnumeratedPropertyExcept... | java | public <T> T getMapped(final String param, final Map<String, T> possibleValues) {
checkNotNull(possibleValues);
checkArgument(!possibleValues.isEmpty());
final String value = getString(param);
final T ret = possibleValues.get(value);
if (ret == null) {
throw new InvalidEnumeratedPropertyExce... | [
"public",
"<",
"T",
">",
"T",
"getMapped",
"(",
"final",
"String",
"param",
",",
"final",
"Map",
"<",
"String",
",",
"T",
">",
"possibleValues",
")",
"{",
"checkNotNull",
"(",
"possibleValues",
")",
";",
"checkArgument",
"(",
"!",
"possibleValues",
".",
... | Looks up a parameter, then uses the value as a key in a map lookup. If the value is not a key
in the map, throws an exception.
@param possibleValues May not be null. May not be empty.
@throws InvalidEnumeratedPropertyException if the parameter value is not on the list. | [
"Looks",
"up",
"a",
"parameter",
"then",
"uses",
"the",
"value",
"as",
"a",
"key",
"in",
"a",
"map",
"lookup",
".",
"If",
"the",
"value",
"is",
"not",
"a",
"key",
"in",
"the",
"map",
"throws",
"an",
"exception",
"."
] | train | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/parameters/Parameters.java#L436-L448 |
bazaarvoice/ostrich | core/src/main/java/com/bazaarvoice/ostrich/pool/SingleThreadedClientServiceCache.java | SingleThreadedClientServiceCache.checkOut | public ServiceHandle<S> checkOut(ServiceEndPoint endPoint) throws Exception {
"""
Retrieves a cached service instance for an end point that is not currently checked out. If no idle cached
instance is available and the cache is not full, a new one will be created, added to the cache, and then checked
out. Once ... | java | public ServiceHandle<S> checkOut(ServiceEndPoint endPoint) throws Exception {
checkNotNull(endPoint);
_requestCount.incrementAndGet();
try {
long revision = _revisionNumber.incrementAndGet();
S service = _pool.borrowObject(endPoint);
ServiceHandle<S> handle =... | [
"public",
"ServiceHandle",
"<",
"S",
">",
"checkOut",
"(",
"ServiceEndPoint",
"endPoint",
")",
"throws",
"Exception",
"{",
"checkNotNull",
"(",
"endPoint",
")",
";",
"_requestCount",
".",
"incrementAndGet",
"(",
")",
";",
"try",
"{",
"long",
"revision",
"=",
... | Retrieves a cached service instance for an end point that is not currently checked out. If no idle cached
instance is available and the cache is not full, a new one will be created, added to the cache, and then checked
out. Once the checked out instance is no longer in use, it should be returned by calling {@link #ch... | [
"Retrieves",
"a",
"cached",
"service",
"instance",
"for",
"an",
"end",
"point",
"that",
"is",
"not",
"currently",
"checked",
"out",
".",
"If",
"no",
"idle",
"cached",
"instance",
"is",
"available",
"and",
"the",
"cache",
"is",
"not",
"full",
"a",
"new",
... | train | https://github.com/bazaarvoice/ostrich/blob/13591867870ab23445253f11fc872662a8028191/core/src/main/java/com/bazaarvoice/ostrich/pool/SingleThreadedClientServiceCache.java#L169-L189 |
facebook/fresco | drawee/src/main/java/com/facebook/drawee/generic/WrappingUtils.java | WrappingUtils.maybeWrapWithScaleType | @Nullable
static Drawable maybeWrapWithScaleType(
@Nullable Drawable drawable,
@Nullable ScalingUtils.ScaleType scaleType,
@Nullable PointF focusPoint) {
"""
Wraps the given drawable with a new {@link ScaleTypeDrawable}.
<p>If the provided drawable or scale type is null, the given drawable i... | java | @Nullable
static Drawable maybeWrapWithScaleType(
@Nullable Drawable drawable,
@Nullable ScalingUtils.ScaleType scaleType,
@Nullable PointF focusPoint) {
if (FrescoSystrace.isTracing()) {
FrescoSystrace.beginSection("WrappingUtils#maybeWrapWithScaleType");
}
if (drawable == null ||... | [
"@",
"Nullable",
"static",
"Drawable",
"maybeWrapWithScaleType",
"(",
"@",
"Nullable",
"Drawable",
"drawable",
",",
"@",
"Nullable",
"ScalingUtils",
".",
"ScaleType",
"scaleType",
",",
"@",
"Nullable",
"PointF",
"focusPoint",
")",
"{",
"if",
"(",
"FrescoSystrace",... | Wraps the given drawable with a new {@link ScaleTypeDrawable}.
<p>If the provided drawable or scale type is null, the given drawable is returned without being
wrapped.
@return the wrapping scale type drawable, or the original drawable if the wrapping didn't take
place | [
"Wraps",
"the",
"given",
"drawable",
"with",
"a",
"new",
"{",
"@link",
"ScaleTypeDrawable",
"}",
"."
] | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/drawee/src/main/java/com/facebook/drawee/generic/WrappingUtils.java#L80-L102 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WCheckBoxSelectExample.java | WCheckBoxSelectExample.addSingleColumnSelectExample | private void addSingleColumnSelectExample() {
"""
adds a WCheckBoxSelect with LAYOUT_COLUMN in 1 column simply by not setting the number of columns. This is
superfluous as you should use LAYOUT_STACKED (the default) instead.
"""
add(new WHeading(HeadingLevel.H3, "WCheckBoxSelect laid out in a single column"... | java | private void addSingleColumnSelectExample() {
add(new WHeading(HeadingLevel.H3, "WCheckBoxSelect laid out in a single column"));
add(new ExplanatoryText("When layout is COLUMN, setting the layoutColumnCount property to one, or forgetting to set it at all (default is "
+ "one) is a little bit pointless."));
fi... | [
"private",
"void",
"addSingleColumnSelectExample",
"(",
")",
"{",
"add",
"(",
"new",
"WHeading",
"(",
"HeadingLevel",
".",
"H3",
",",
"\"WCheckBoxSelect laid out in a single column\"",
")",
")",
";",
"add",
"(",
"new",
"ExplanatoryText",
"(",
"\"When layout is COLUMN,... | adds a WCheckBoxSelect with LAYOUT_COLUMN in 1 column simply by not setting the number of columns. This is
superfluous as you should use LAYOUT_STACKED (the default) instead. | [
"adds",
"a",
"WCheckBoxSelect",
"with",
"LAYOUT_COLUMN",
"in",
"1",
"column",
"simply",
"by",
"not",
"setting",
"the",
"number",
"of",
"columns",
".",
"This",
"is",
"superfluous",
"as",
"you",
"should",
"use",
"LAYOUT_STACKED",
"(",
"the",
"default",
")",
"i... | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WCheckBoxSelectExample.java#L263-L271 |
RestComm/sip-servlets | sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/ExtendedListeningPoint.java | ExtendedListeningPoint.createContactHeader | public ContactHeader createContactHeader(String displayName, String userName, boolean usePublicAddress) {
"""
Create a Contact Header based on the host, port and transport of this listening point
@param usePublicAddress if true, the host will be the global ip address found by STUN otherwise
it will be the local ... | java | public ContactHeader createContactHeader(String displayName, String userName, boolean usePublicAddress) {
return createContactHeader(displayName, userName, usePublicAddress, null);
} | [
"public",
"ContactHeader",
"createContactHeader",
"(",
"String",
"displayName",
",",
"String",
"userName",
",",
"boolean",
"usePublicAddress",
")",
"{",
"return",
"createContactHeader",
"(",
"displayName",
",",
"userName",
",",
"usePublicAddress",
",",
"null",
")",
... | Create a Contact Header based on the host, port and transport of this listening point
@param usePublicAddress if true, the host will be the global ip address found by STUN otherwise
it will be the local network interface ipaddress
@param displayName the display name to use
@return the Contact header | [
"Create",
"a",
"Contact",
"Header",
"based",
"on",
"the",
"host",
"port",
"and",
"transport",
"of",
"this",
"listening",
"point"
] | train | https://github.com/RestComm/sip-servlets/blob/fd7011d2803ab1d205b140768a760c8c69e0c997/sip-servlets-impl/src/main/java/org/mobicents/servlet/sip/core/ExtendedListeningPoint.java#L131-L133 |
mgm-tp/jfunk | jfunk-common/src/main/java/com/mgmtp/jfunk/common/cli/CliUtils.java | CliUtils.executeCommandLine | public static CliOutput executeCommandLine(final Commandline cli, final InputStream inputStream, final int timeoutInSeconds) {
"""
Executes the specified command line and blocks until the process has finished or till the
timeout is reached. The output of the process is captured, returned, as well as logged with
... | java | public static CliOutput executeCommandLine(final Commandline cli, final InputStream inputStream, final int timeoutInSeconds) {
return executeCommandLine(cli, null, inputStream, timeoutInSeconds);
} | [
"public",
"static",
"CliOutput",
"executeCommandLine",
"(",
"final",
"Commandline",
"cli",
",",
"final",
"InputStream",
"inputStream",
",",
"final",
"int",
"timeoutInSeconds",
")",
"{",
"return",
"executeCommandLine",
"(",
"cli",
",",
"null",
",",
"inputStream",
"... | Executes the specified command line and blocks until the process has finished or till the
timeout is reached. The output of the process is captured, returned, as well as logged with
info (stdout) and error (stderr) level, respectively.
@param cli
the command line
@param inputStream
the process input to read from, must... | [
"Executes",
"the",
"specified",
"command",
"line",
"and",
"blocks",
"until",
"the",
"process",
"has",
"finished",
"or",
"till",
"the",
"timeout",
"is",
"reached",
".",
"The",
"output",
"of",
"the",
"process",
"is",
"captured",
"returned",
"as",
"well",
"as",... | train | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-common/src/main/java/com/mgmtp/jfunk/common/cli/CliUtils.java#L108-L110 |
nyla-solutions/nyla | nyla.solutions.core/src/main/java/nyla/solutions/core/util/SettingsInMemory.java | SettingsInMemory.getCharacter | public Character getCharacter(Class<?> aClass,String key,char defaultValue) {
"""
Get a Settings property as an c object.
@param aClass the class the property is related to
@param key the Settings name
@param defaultValue the default value to return if the property does not exist
@return the Settings character... | java | public Character getCharacter(Class<?> aClass,String key,char defaultValue)
{
String results = getText(aClass,key, "");
if(results.length() == 0)
return Character.valueOf(defaultValue);
else return Character.valueOf(results.charAt(0));//return first character
} | [
"public",
"Character",
"getCharacter",
"(",
"Class",
"<",
"?",
">",
"aClass",
",",
"String",
"key",
",",
"char",
"defaultValue",
")",
"{",
"String",
"results",
"=",
"getText",
"(",
"aClass",
",",
"key",
",",
"\"\"",
")",
";",
"if",
"(",
"results",
".",... | Get a Settings property as an c object.
@param aClass the class the property is related to
@param key the Settings name
@param defaultValue the default value to return if the property does not exist
@return the Settings character | [
"Get",
"a",
"Settings",
"property",
"as",
"an",
"c",
"object",
"."
] | train | https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/util/SettingsInMemory.java#L182-L190 |
landawn/AbacusUtil | src/com/landawn/abacus/util/stream/Collectors.java | Collectors.onlyOne | public static <T> Collector<T, ?, Optional<T>> onlyOne(final Predicate<? super T> predicate) {
"""
{@code DuplicatedResultException} is threw if there are more than one values are collected.
@param predicate
@return
"""
final Collector<T, ?, Optional<T>> downstream = onlyOne();
return f... | java | public static <T> Collector<T, ?, Optional<T>> onlyOne(final Predicate<? super T> predicate) {
final Collector<T, ?, Optional<T>> downstream = onlyOne();
return filtering(predicate, downstream);
} | [
"public",
"static",
"<",
"T",
">",
"Collector",
"<",
"T",
",",
"?",
",",
"Optional",
"<",
"T",
">",
">",
"onlyOne",
"(",
"final",
"Predicate",
"<",
"?",
"super",
"T",
">",
"predicate",
")",
"{",
"final",
"Collector",
"<",
"T",
",",
"?",
",",
"Opt... | {@code DuplicatedResultException} is threw if there are more than one values are collected.
@param predicate
@return | [
"{",
"@code",
"DuplicatedResultException",
"}",
"is",
"threw",
"if",
"there",
"are",
"more",
"than",
"one",
"values",
"are",
"collected",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/stream/Collectors.java#L1375-L1379 |
soi-toolkit/soi-toolkit-mule | tools/soitoolkit-generator/soitoolkit-generator/src/main/java/org/soitoolkit/tools/generator/model/ModelFactory.java | ModelFactory.newModel | public static IModel newModel(String groupId, String artifactId, String version, String service, MuleVersionEnum muleVersion, TransportEnum inboundTransport, TransportEnum outboundTransport, TransformerEnum transformerType) {
"""
Constructor-method to use when services with inbound and outbound services
@param ... | java | public static IModel newModel(String groupId, String artifactId, String version, String service, MuleVersionEnum muleVersion, TransportEnum inboundTransport, TransportEnum outboundTransport, TransformerEnum transformerType) {
return doCreateNewModel(groupId, artifactId, version, service, muleVersion, null, null, inbo... | [
"public",
"static",
"IModel",
"newModel",
"(",
"String",
"groupId",
",",
"String",
"artifactId",
",",
"String",
"version",
",",
"String",
"service",
",",
"MuleVersionEnum",
"muleVersion",
",",
"TransportEnum",
"inboundTransport",
",",
"TransportEnum",
"outboundTranspo... | Constructor-method to use when services with inbound and outbound services
@param groupId
@param artifactId
@param version
@param service
@return the new model instance | [
"Constructor",
"-",
"method",
"to",
"use",
"when",
"services",
"with",
"inbound",
"and",
"outbound",
"services"
] | train | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/tools/soitoolkit-generator/soitoolkit-generator/src/main/java/org/soitoolkit/tools/generator/model/ModelFactory.java#L95-L97 |
ironjacamar/ironjacamar | common/src/main/java/org/ironjacamar/common/metadata/common/AbstractParser.java | AbstractParser.rawAttributeText | private String rawAttributeText(XMLStreamReader reader, String attributeName) {
"""
Read the raw attribute
@param reader
@param attributeName
@return the string representing raw attribute textx
"""
String attributeString = reader.getAttributeValue("", attributeName);
if (attributeString == nu... | java | private String rawAttributeText(XMLStreamReader reader, String attributeName)
{
String attributeString = reader.getAttributeValue("", attributeName);
if (attributeString == null)
return null;
return attributeString.trim();
} | [
"private",
"String",
"rawAttributeText",
"(",
"XMLStreamReader",
"reader",
",",
"String",
"attributeName",
")",
"{",
"String",
"attributeString",
"=",
"reader",
".",
"getAttributeValue",
"(",
"\"\"",
",",
"attributeName",
")",
";",
"if",
"(",
"attributeString",
"=... | Read the raw attribute
@param reader
@param attributeName
@return the string representing raw attribute textx | [
"Read",
"the",
"raw",
"attribute"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/metadata/common/AbstractParser.java#L236-L244 |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/reporter/JdtUtils.java | JdtUtils.collectAllAnonymous | private static void collectAllAnonymous(List<IType> list, IParent parent, boolean allowNested) throws JavaModelException {
"""
Traverses down the children tree of this parent and collect all child
anon. classes
@param list
@param parent
@param allowNested
true to search in IType child elements too
@throws ... | java | private static void collectAllAnonymous(List<IType> list, IParent parent, boolean allowNested) throws JavaModelException {
IJavaElement[] children = parent.getChildren();
for (int i = 0; i < children.length; i++) {
IJavaElement childElem = children[i];
if (isAnonymousType(childEl... | [
"private",
"static",
"void",
"collectAllAnonymous",
"(",
"List",
"<",
"IType",
">",
"list",
",",
"IParent",
"parent",
",",
"boolean",
"allowNested",
")",
"throws",
"JavaModelException",
"{",
"IJavaElement",
"[",
"]",
"children",
"=",
"parent",
".",
"getChildren"... | Traverses down the children tree of this parent and collect all child
anon. classes
@param list
@param parent
@param allowNested
true to search in IType child elements too
@throws JavaModelException | [
"Traverses",
"down",
"the",
"children",
"tree",
"of",
"this",
"parent",
"and",
"collect",
"all",
"child",
"anon",
".",
"classes"
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/reporter/JdtUtils.java#L312-L325 |
jbundle/jbundle | app/program/screen/src/main/java/org/jbundle/app/program/screen/ClassProjectScreen.java | ClassProjectScreen.doCommand | public boolean doCommand(String strCommand, ScreenField sourceSField, int iCommandOptions) {
"""
Process the command.
<br />Step 1 - Process the command if possible and return true if processed.
<br />Step 2 - If I can't process, pass to all children (with me as the source).
<br />Step 3 - If children didn't pr... | java | public boolean doCommand(String strCommand, ScreenField sourceSField, int iCommandOptions)
{
boolean bFlag = false;
if (strCommand.indexOf(org.jbundle.app.program.script.process.SetupProjectProcess.class.getName()) != -1)
{
try {
strCommand = Utility.addU... | [
"public",
"boolean",
"doCommand",
"(",
"String",
"strCommand",
",",
"ScreenField",
"sourceSField",
",",
"int",
"iCommandOptions",
")",
"{",
"boolean",
"bFlag",
"=",
"false",
";",
"if",
"(",
"strCommand",
".",
"indexOf",
"(",
"org",
".",
"jbundle",
".",
"app"... | Process the command.
<br />Step 1 - Process the command if possible and return true if processed.
<br />Step 2 - If I can't process, pass to all children (with me as the source).
<br />Step 3 - If children didn't process, pass to parent (with me as the source).
<br />Note: Never pass to a parent or child that matches t... | [
"Process",
"the",
"command",
".",
"<br",
"/",
">",
"Step",
"1",
"-",
"Process",
"the",
"command",
"if",
"possible",
"and",
"return",
"true",
"if",
"processed",
".",
"<br",
"/",
">",
"Step",
"2",
"-",
"If",
"I",
"can",
"t",
"process",
"pass",
"to",
... | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/app/program/screen/src/main/java/org/jbundle/app/program/screen/ClassProjectScreen.java#L123-L139 |
aws/aws-sdk-java | aws-java-sdk-iot/src/main/java/com/amazonaws/services/iot/model/AttributePayload.java | AttributePayload.withAttributes | public AttributePayload withAttributes(java.util.Map<String, String> attributes) {
"""
<p>
A JSON string containing up to three key-value pair in JSON format. For example:
</p>
<p>
<code>{\"attributes\":{\"string1\":\"string2\"}}</code>
</p>
@param attributes
A JSON string containing up to three key-value... | java | public AttributePayload withAttributes(java.util.Map<String, String> attributes) {
setAttributes(attributes);
return this;
} | [
"public",
"AttributePayload",
"withAttributes",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
")",
"{",
"setAttributes",
"(",
"attributes",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A JSON string containing up to three key-value pair in JSON format. For example:
</p>
<p>
<code>{\"attributes\":{\"string1\":\"string2\"}}</code>
</p>
@param attributes
A JSON string containing up to three key-value pair in JSON format. For example:</p>
<p>
<code>{\"attributes\":{\"string1\":\"string2\"}}</code>
@... | [
"<p",
">",
"A",
"JSON",
"string",
"containing",
"up",
"to",
"three",
"key",
"-",
"value",
"pair",
"in",
"JSON",
"format",
".",
"For",
"example",
":",
"<",
"/",
"p",
">",
"<p",
">",
"<code",
">",
"{",
"\\",
"attributes",
"\\",
":",
"{",
"\\",
"str... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iot/src/main/java/com/amazonaws/services/iot/model/AttributePayload.java#L103-L106 |
kochedykov/jlibmodbus | src/com/intelligt/modbus/jlibmodbus/master/ModbusMaster.java | ModbusMaster.writeSingleRegister | final public void writeSingleRegister(int serverAddress, int startAddress, int register) throws
ModbusProtocolException, ModbusNumberException, ModbusIOException {
"""
This function code is used to write a single holding register in a remote device.
The Request PDU specifies the address of the registe... | java | final public void writeSingleRegister(int serverAddress, int startAddress, int register) throws
ModbusProtocolException, ModbusNumberException, ModbusIOException {
processRequest(ModbusRequestBuilder.getInstance().buildWriteSingleRegister(serverAddress, startAddress, register));
} | [
"final",
"public",
"void",
"writeSingleRegister",
"(",
"int",
"serverAddress",
",",
"int",
"startAddress",
",",
"int",
"register",
")",
"throws",
"ModbusProtocolException",
",",
"ModbusNumberException",
",",
"ModbusIOException",
"{",
"processRequest",
"(",
"ModbusReques... | This function code is used to write a single holding register in a remote device.
The Request PDU specifies the address of the register to be written. Registers are addressed
starting at zero. Therefore register numbered 1 is addressed as 0.
@param serverAddress a slave address
@param startAddress the address of the ... | [
"This",
"function",
"code",
"is",
"used",
"to",
"write",
"a",
"single",
"holding",
"register",
"in",
"a",
"remote",
"device",
".",
"The",
"Request",
"PDU",
"specifies",
"the",
"address",
"of",
"the",
"register",
"to",
"be",
"written",
".",
"Registers",
"ar... | train | https://github.com/kochedykov/jlibmodbus/blob/197cb39e2649e61a6fe3cb7dc91a701d847e14be/src/com/intelligt/modbus/jlibmodbus/master/ModbusMaster.java#L300-L303 |
google/j2objc | jre_emul/openjdk/src/share/classes/java/math/BigDecimal.java | BigDecimal.divideToIntegralValue | public BigDecimal divideToIntegralValue(BigDecimal divisor, MathContext mc) {
"""
Returns a {@code BigDecimal} whose value is the integer part
of {@code (this / divisor)}. Since the integer part of the
exact quotient does not depend on the rounding mode, the
rounding mode does not affect the values returned by... | java | public BigDecimal divideToIntegralValue(BigDecimal divisor, MathContext mc) {
if (mc.precision == 0 || // exact result
(this.compareMagnitude(divisor) < 0)) // zero result
return divideToIntegralValue(divisor);
// Calculate preferred scale
int preferredScale = saturateLo... | [
"public",
"BigDecimal",
"divideToIntegralValue",
"(",
"BigDecimal",
"divisor",
",",
"MathContext",
"mc",
")",
"{",
"if",
"(",
"mc",
".",
"precision",
"==",
"0",
"||",
"// exact result",
"(",
"this",
".",
"compareMagnitude",
"(",
"divisor",
")",
"<",
"0",
")"... | Returns a {@code BigDecimal} whose value is the integer part
of {@code (this / divisor)}. Since the integer part of the
exact quotient does not depend on the rounding mode, the
rounding mode does not affect the values returned by this
method. The preferred scale of the result is
{@code (this.scale() - divisor.scale()... | [
"Returns",
"a",
"{",
"@code",
"BigDecimal",
"}",
"whose",
"value",
"is",
"the",
"integer",
"part",
"of",
"{",
"@code",
"(",
"this",
"/",
"divisor",
")",
"}",
".",
"Since",
"the",
"integer",
"part",
"of",
"the",
"exact",
"quotient",
"does",
"not",
"depe... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/openjdk/src/share/classes/java/math/BigDecimal.java#L1829-L1876 |
alkacon/opencms-core | src/org/opencms/file/types/A_CmsResourceType.java | A_CmsResourceType.createRelations | protected CmsResource createRelations(CmsObject cms, CmsSecurityManager securityManager, String resourceName)
throws CmsException {
"""
Creates the relation information for the resource with the given resource name.<p>
@param cms the cms context
@param securityManager the security manager
@param resourceN... | java | protected CmsResource createRelations(CmsObject cms, CmsSecurityManager securityManager, String resourceName)
throws CmsException {
CmsResource resource = securityManager.readResource(
cms.getRequestContext(),
resourceName,
CmsResourceFilter.ALL);
I_CmsResourceTy... | [
"protected",
"CmsResource",
"createRelations",
"(",
"CmsObject",
"cms",
",",
"CmsSecurityManager",
"securityManager",
",",
"String",
"resourceName",
")",
"throws",
"CmsException",
"{",
"CmsResource",
"resource",
"=",
"securityManager",
".",
"readResource",
"(",
"cms",
... | Creates the relation information for the resource with the given resource name.<p>
@param cms the cms context
@param securityManager the security manager
@param resourceName the resource name of the resource to update the relations for
@return the fresh read resource
@throws CmsException if something goes wrong | [
"Creates",
"the",
"relation",
"information",
"for",
"the",
"resource",
"with",
"the",
"given",
"resource",
"name",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/types/A_CmsResourceType.java#L1024-L1039 |
stevespringett/Alpine | alpine/src/main/java/alpine/persistence/AlpineQueryManager.java | AlpineQueryManager.createPermission | public Permission createPermission(final String name, final String description) {
"""
Creates a Permission object.
@param name The name of the permission
@param description the permissions description
@return a Permission
@since 1.1.0
"""
pm.currentTransaction().begin();
final Permission pe... | java | public Permission createPermission(final String name, final String description) {
pm.currentTransaction().begin();
final Permission permission = new Permission();
permission.setName(name);
permission.setDescription(description);
pm.makePersistent(permission);
pm.currentTr... | [
"public",
"Permission",
"createPermission",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"description",
")",
"{",
"pm",
".",
"currentTransaction",
"(",
")",
".",
"begin",
"(",
")",
";",
"final",
"Permission",
"permission",
"=",
"new",
"Permission",
... | Creates a Permission object.
@param name The name of the permission
@param description the permissions description
@return a Permission
@since 1.1.0 | [
"Creates",
"a",
"Permission",
"object",
"."
] | train | https://github.com/stevespringett/Alpine/blob/6c5ef5e1ba4f38922096f1307d3950c09edb3093/alpine/src/main/java/alpine/persistence/AlpineQueryManager.java#L450-L458 |
BoltsFramework/Bolts-Android | bolts-applinks/src/main/java/bolts/AppLinkNavigation.java | AppLinkNavigation.navigateInBackground | public static Task<NavigationResult> navigateInBackground(Context context,
URL destination,
AppLinkResolver resolver) {
"""
Navigates to an {@link AppLink} for the given destination using the App... | java | public static Task<NavigationResult> navigateInBackground(Context context,
URL destination,
AppLinkResolver resolver) {
return navigateInBackground(context, Uri.parse(destination.toString()), reso... | [
"public",
"static",
"Task",
"<",
"NavigationResult",
">",
"navigateInBackground",
"(",
"Context",
"context",
",",
"URL",
"destination",
",",
"AppLinkResolver",
"resolver",
")",
"{",
"return",
"navigateInBackground",
"(",
"context",
",",
"Uri",
".",
"parse",
"(",
... | Navigates to an {@link AppLink} for the given destination using the App Link resolution
strategy specified.
@param context the Context from which the navigation should be performed.
@param destination the destination URL for the App Link.
@param resolver the resolver to use for fetching App Link metadata.
@retu... | [
"Navigates",
"to",
"an",
"{",
"@link",
"AppLink",
"}",
"for",
"the",
"given",
"destination",
"using",
"the",
"App",
"Link",
"resolution",
"strategy",
"specified",
"."
] | train | https://github.com/BoltsFramework/Bolts-Android/blob/54e9cb8bdd4950aa4d418dcbc0ea65414762aef5/bolts-applinks/src/main/java/bolts/AppLinkNavigation.java#L407-L411 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/BaseTable.java | BaseTable.doSetHandle | public boolean doSetHandle(Object bookmark, int iHandleType) throws DBException {
"""
Reposition to this record using this bookmark.
@param bookmark The handle to use to position the record.
@param iHandleType The type of handle (DATA_SOURCE/OBJECT_ID,OBJECT_SOURCE,BOOKMARK).
@return - true - record found/fals... | java | public boolean doSetHandle(Object bookmark, int iHandleType) throws DBException
{
switch (iHandleType)
{
case DBConstants.DATA_SOURCE_HANDLE:
m_dataSource = bookmark;
return true; // Success
case DBConstants.OBJECT_ID_HANDLE:
m_objectID = bookma... | [
"public",
"boolean",
"doSetHandle",
"(",
"Object",
"bookmark",
",",
"int",
"iHandleType",
")",
"throws",
"DBException",
"{",
"switch",
"(",
"iHandleType",
")",
"{",
"case",
"DBConstants",
".",
"DATA_SOURCE_HANDLE",
":",
"m_dataSource",
"=",
"bookmark",
";",
"ret... | Reposition to this record using this bookmark.
@param bookmark The handle to use to position the record.
@param iHandleType The type of handle (DATA_SOURCE/OBJECT_ID,OBJECT_SOURCE,BOOKMARK).
@return - true - record found/false - record not found
@exception FILE_NOT_OPEN.
@exception DBException File exception. | [
"Reposition",
"to",
"this",
"record",
"using",
"this",
"bookmark",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/BaseTable.java#L988-L1016 |
Azure/azure-sdk-for-java | network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java | NetworkWatchersInner.beginGetVMSecurityRulesAsync | public Observable<SecurityGroupViewResultInner> beginGetVMSecurityRulesAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) {
"""
Gets the configured and effective security group rules on the specified VM.
@param resourceGroupName The name of the resource group.
@param networkWat... | java | public Observable<SecurityGroupViewResultInner> beginGetVMSecurityRulesAsync(String resourceGroupName, String networkWatcherName, String targetResourceId) {
return beginGetVMSecurityRulesWithServiceResponseAsync(resourceGroupName, networkWatcherName, targetResourceId).map(new Func1<ServiceResponse<SecurityGroup... | [
"public",
"Observable",
"<",
"SecurityGroupViewResultInner",
">",
"beginGetVMSecurityRulesAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkWatcherName",
",",
"String",
"targetResourceId",
")",
"{",
"return",
"beginGetVMSecurityRulesWithServiceResponseAsync",
"... | Gets the configured and effective security group rules on the specified VM.
@param resourceGroupName The name of the resource group.
@param networkWatcherName The name of the network watcher.
@param targetResourceId ID of the target VM.
@throws IllegalArgumentException thrown if parameters fail the validation
@return ... | [
"Gets",
"the",
"configured",
"and",
"effective",
"security",
"group",
"rules",
"on",
"the",
"specified",
"VM",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2017_10_01/src/main/java/com/microsoft/azure/management/network/v2017_10_01/implementation/NetworkWatchersInner.java#L1397-L1404 |
aws/aws-sdk-java | aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/internal/Utils.java | Utils.createInputShapeMarshaller | public static ShapeMarshaller createInputShapeMarshaller(ServiceMetadata service, Operation operation) {
"""
Create the ShapeMarshaller to the input shape from the specified Operation.
The input shape in the operation could be empty.
@param service
@param operation
@return
"""
if (operation == n... | java | public static ShapeMarshaller createInputShapeMarshaller(ServiceMetadata service, Operation operation) {
if (operation == null)
throw new IllegalArgumentException(
"The operation parameter must be specified!");
ShapeMarshaller marshaller = new ShapeMarshaller()
... | [
"public",
"static",
"ShapeMarshaller",
"createInputShapeMarshaller",
"(",
"ServiceMetadata",
"service",
",",
"Operation",
"operation",
")",
"{",
"if",
"(",
"operation",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The operation parameter must be ... | Create the ShapeMarshaller to the input shape from the specified Operation.
The input shape in the operation could be empty.
@param service
@param operation
@return | [
"Create",
"the",
"ShapeMarshaller",
"to",
"the",
"input",
"shape",
"from",
"the",
"specified",
"Operation",
".",
"The",
"input",
"shape",
"in",
"the",
"operation",
"could",
"be",
"empty",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/internal/Utils.java#L298-L322 |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/MergeUtils.java | MergeUtils.getFirstTopicId | public String getFirstTopicId(final URI file, final boolean useCatalog) {
"""
Get the first topic id.
@param file file URI
@param useCatalog whether use catalog file for validation
@return topic id
"""
assert file.isAbsolute();
if (!(new File(file).exists())) {
return null;
... | java | public String getFirstTopicId(final URI file, final boolean useCatalog) {
assert file.isAbsolute();
if (!(new File(file).exists())) {
return null;
}
final StringBuilder firstTopicId = new StringBuilder();
final TopicIdParser parser = new TopicIdParser(firstTopicId);
... | [
"public",
"String",
"getFirstTopicId",
"(",
"final",
"URI",
"file",
",",
"final",
"boolean",
"useCatalog",
")",
"{",
"assert",
"file",
".",
"isAbsolute",
"(",
")",
";",
"if",
"(",
"!",
"(",
"new",
"File",
"(",
"file",
")",
".",
"exists",
"(",
")",
")... | Get the first topic id.
@param file file URI
@param useCatalog whether use catalog file for validation
@return topic id | [
"Get",
"the",
"first",
"topic",
"id",
"."
] | train | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/MergeUtils.java#L136-L154 |
ksclarke/freelib-utils | src/main/java/info/freelibrary/util/FileUtils.java | FileUtils.toXML | public static String toXML(final String aFilePath, final String aPattern) throws FileNotFoundException,
TransformerException {
"""
Creates a string of XML that describes the supplied file or directory (and all its subdirectories). Includes
absolute path, last modified time, read/write permissions, etc... | java | public static String toXML(final String aFilePath, final String aPattern) throws FileNotFoundException,
TransformerException {
return toXML(aFilePath, aPattern, false);
} | [
"public",
"static",
"String",
"toXML",
"(",
"final",
"String",
"aFilePath",
",",
"final",
"String",
"aPattern",
")",
"throws",
"FileNotFoundException",
",",
"TransformerException",
"{",
"return",
"toXML",
"(",
"aFilePath",
",",
"aPattern",
",",
"false",
")",
";"... | Creates a string of XML that describes the supplied file or directory (and all its subdirectories). Includes
absolute path, last modified time, read/write permissions, etc.
@param aFilePath The file or directory to be returned as XML
@param aPattern A regular expression that file names must match
@return A string of X... | [
"Creates",
"a",
"string",
"of",
"XML",
"that",
"describes",
"the",
"supplied",
"file",
"or",
"directory",
"(",
"and",
"all",
"its",
"subdirectories",
")",
".",
"Includes",
"absolute",
"path",
"last",
"modified",
"time",
"read",
"/",
"write",
"permissions",
"... | train | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/FileUtils.java#L137-L140 |
apache/reef | lang/java/reef-tang/tang/src/main/java/org/apache/reef/tang/formats/ConfigurationModule.java | ConfigurationModule.set | public final <T> ConfigurationModule set(final Impl<List> opt, final List implList) {
"""
Binds a list to a specific optional/required Impl using ConfigurationModule.
@param opt Target optional/required Impl
@param implList List object to be injected
@param <T> a type
@return the configuration module
... | java | public final <T> ConfigurationModule set(final Impl<List> opt, final List implList) {
final ConfigurationModule c = deepCopy();
c.processSet(opt);
c.setImplLists.put(opt, implList);
return c;
} | [
"public",
"final",
"<",
"T",
">",
"ConfigurationModule",
"set",
"(",
"final",
"Impl",
"<",
"List",
">",
"opt",
",",
"final",
"List",
"implList",
")",
"{",
"final",
"ConfigurationModule",
"c",
"=",
"deepCopy",
"(",
")",
";",
"c",
".",
"processSet",
"(",
... | Binds a list to a specific optional/required Impl using ConfigurationModule.
@param opt Target optional/required Impl
@param implList List object to be injected
@param <T> a type
@return the configuration module | [
"Binds",
"a",
"list",
"to",
"a",
"specific",
"optional",
"/",
"required",
"Impl",
"using",
"ConfigurationModule",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-tang/tang/src/main/java/org/apache/reef/tang/formats/ConfigurationModule.java#L126-L131 |
esigate/esigate | esigate-servlet/src/main/java/org/esigate/servlet/impl/RequestUrl.java | RequestUrl.getRelativeUrl | public static String getRelativeUrl(HttpServletRequest request, boolean servlet) {
"""
Get the relative url to the current servlet.
<p>
Uses the request URI and removes : the context path, the servlet path if used.
@param request
The current HTTP request
@param servlet
true to remove the servlet path
@ret... | java | public static String getRelativeUrl(HttpServletRequest request, boolean servlet) {
// Raw request url
String requestURI = request.getRequestURI();
// Application (war) context path
String contextPath = request.getContextPath();
// Servlet mapping
String servletPath = requ... | [
"public",
"static",
"String",
"getRelativeUrl",
"(",
"HttpServletRequest",
"request",
",",
"boolean",
"servlet",
")",
"{",
"// Raw request url",
"String",
"requestURI",
"=",
"request",
".",
"getRequestURI",
"(",
")",
";",
"// Application (war) context path",
"String",
... | Get the relative url to the current servlet.
<p>
Uses the request URI and removes : the context path, the servlet path if used.
@param request
The current HTTP request
@param servlet
true to remove the servlet path
@return the url, relative to the servlet mapping. | [
"Get",
"the",
"relative",
"url",
"to",
"the",
"current",
"servlet",
".",
"<p",
">",
"Uses",
"the",
"request",
"URI",
"and",
"removes",
":",
"the",
"context",
"path",
"the",
"servlet",
"path",
"if",
"used",
"."
] | train | https://github.com/esigate/esigate/blob/50421fb224f16e1ec42715425109a72b3b55527b/esigate-servlet/src/main/java/org/esigate/servlet/impl/RequestUrl.java#L46-L72 |
sniggle/simple-pgp | simple-pgp-java/src/main/java/me/sniggle/pgp/crypt/internal/BasePGPCommon.java | BasePGPCommon.findPublicKey | protected PGPPublicKey findPublicKey(InputStream publicKey, KeyFilter<PGPPublicKey> keyFilter ) {
"""
reads the public key from the given stream
@param publicKey
the input key stream
@param keyFilter
the filter to apply
@return the matching PGP public key
"""
LOGGER.trace("findPublicKey(InputStream,... | java | protected PGPPublicKey findPublicKey(InputStream publicKey, KeyFilter<PGPPublicKey> keyFilter ) {
LOGGER.trace("findPublicKey(InputStream, KeyFilter<PGPPublicKey>)");
LOGGER.trace("Public Key: {}, Key Filter: {}", publicKey == null ? "not set" : "set", keyFilter == null ? "not set" : "set");
return retrieve... | [
"protected",
"PGPPublicKey",
"findPublicKey",
"(",
"InputStream",
"publicKey",
",",
"KeyFilter",
"<",
"PGPPublicKey",
">",
"keyFilter",
")",
"{",
"LOGGER",
".",
"trace",
"(",
"\"findPublicKey(InputStream, KeyFilter<PGPPublicKey>)\"",
")",
";",
"LOGGER",
".",
"trace",
... | reads the public key from the given stream
@param publicKey
the input key stream
@param keyFilter
the filter to apply
@return the matching PGP public key | [
"reads",
"the",
"public",
"key",
"from",
"the",
"given",
"stream"
] | train | https://github.com/sniggle/simple-pgp/blob/2ab83e4d370b8189f767d8e4e4c7e6020e60fbe3/simple-pgp-java/src/main/java/me/sniggle/pgp/crypt/internal/BasePGPCommon.java#L283-L287 |
cdk/cdk | display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/VecmathUtil.java | VecmathUtil.getNearestVector | static Vector2d getNearestVector(Vector2d reference, IAtom fromAtom, List<IBond> bonds) {
"""
Given a list of bonds, find the bond which is nearest to a provided
reference and return the vector for this bond.
@param reference a target vector
@param fromAtom an atom (will be 0,0)
@param bonds list of bonds co... | java | static Vector2d getNearestVector(Vector2d reference, IAtom fromAtom, List<IBond> bonds) {
final List<IAtom> toAtoms = new ArrayList<IAtom>();
for (IBond bond : bonds) {
toAtoms.add(bond.getOther(fromAtom));
}
return getNearestVector(reference, newUnitVectors(fromAtom, toAto... | [
"static",
"Vector2d",
"getNearestVector",
"(",
"Vector2d",
"reference",
",",
"IAtom",
"fromAtom",
",",
"List",
"<",
"IBond",
">",
"bonds",
")",
"{",
"final",
"List",
"<",
"IAtom",
">",
"toAtoms",
"=",
"new",
"ArrayList",
"<",
"IAtom",
">",
"(",
")",
";",... | Given a list of bonds, find the bond which is nearest to a provided
reference and return the vector for this bond.
@param reference a target vector
@param fromAtom an atom (will be 0,0)
@param bonds list of bonds containing 'fromAtom'
@return the nearest vector | [
"Given",
"a",
"list",
"of",
"bonds",
"find",
"the",
"bond",
"which",
"is",
"nearest",
"to",
"a",
"provided",
"reference",
"and",
"return",
"the",
"vector",
"for",
"this",
"bond",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/display/renderbasic/src/main/java/org/openscience/cdk/renderer/generators/standard/VecmathUtil.java#L278-L286 |
BotMill/fb-botmill | src/main/java/co/aurasphere/botmill/fb/model/outcoming/factory/FlightInfoBuilder.java | FlightInfoBuilder.setArrivalAirport | public FlightInfoBuilder<T> setArrivalAirport(String airportCode,
String city, String gate, String terminal) {
"""
Sets the arrival {@link Airport} for the current {@link FlightInfo}
object. This field is mandatory for this object and can't be null.
@param airportCode
the airport code. It can't be empty.
... | java | public FlightInfoBuilder<T> setArrivalAirport(String airportCode,
String city, String gate, String terminal) {
Airport arrivalAirport = new Airport(airportCode, city, gate, terminal);
this.flightInfo.setArrivalAirport(arrivalAirport);
return this;
} | [
"public",
"FlightInfoBuilder",
"<",
"T",
">",
"setArrivalAirport",
"(",
"String",
"airportCode",
",",
"String",
"city",
",",
"String",
"gate",
",",
"String",
"terminal",
")",
"{",
"Airport",
"arrivalAirport",
"=",
"new",
"Airport",
"(",
"airportCode",
",",
"ci... | Sets the arrival {@link Airport} for the current {@link FlightInfo}
object. This field is mandatory for this object and can't be null.
@param airportCode
the airport code. It can't be empty.
@param city
the city name. The city will be displayed over the airport
code in the template. It can't be empty.
@param gate
the ... | [
"Sets",
"the",
"arrival",
"{",
"@link",
"Airport",
"}",
"for",
"the",
"current",
"{",
"@link",
"FlightInfo",
"}",
"object",
".",
"This",
"field",
"is",
"mandatory",
"for",
"this",
"object",
"and",
"can",
"t",
"be",
"null",
"."
] | train | https://github.com/BotMill/fb-botmill/blob/d94da3615a7339822c137ef75c92a03d791ee969/src/main/java/co/aurasphere/botmill/fb/model/outcoming/factory/FlightInfoBuilder.java#L137-L142 |
finmath/finmath-lib | src/main/java/net/finmath/functions/LinearAlgebra.java | LinearAlgebra.getFactorMatrixUsingCommonsMath | private static double[][] getFactorMatrixUsingCommonsMath(double[][] correlationMatrix, int numberOfFactors) {
"""
Returns the matrix of the n Eigenvectors corresponding to the first n largest Eigenvalues of a correlation matrix.
These eigenvectors can also be interpreted as "principal components" (i.e., the meth... | java | private static double[][] getFactorMatrixUsingCommonsMath(double[][] correlationMatrix, int numberOfFactors) {
/*
* Factor reduction
*/
// Create an eigen vector decomposition of the correlation matrix
double[] eigenValues;
double[][] eigenVectorMatrix;
if(isEigenvalueDecompositionViaSVD) {
Singular... | [
"private",
"static",
"double",
"[",
"]",
"[",
"]",
"getFactorMatrixUsingCommonsMath",
"(",
"double",
"[",
"]",
"[",
"]",
"correlationMatrix",
",",
"int",
"numberOfFactors",
")",
"{",
"/*\n\t\t * Factor reduction\n\t\t */",
"// Create an eigen vector decomposition of the cor... | Returns the matrix of the n Eigenvectors corresponding to the first n largest Eigenvalues of a correlation matrix.
These eigenvectors can also be interpreted as "principal components" (i.e., the method implements the PCA).
@param correlationMatrix The given correlation matrix.
@param numberOfFactors The requested numb... | [
"Returns",
"the",
"matrix",
"of",
"the",
"n",
"Eigenvectors",
"corresponding",
"to",
"the",
"first",
"n",
"largest",
"Eigenvalues",
"of",
"a",
"correlation",
"matrix",
".",
"These",
"eigenvectors",
"can",
"also",
"be",
"interpreted",
"as",
"principal",
"componen... | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/functions/LinearAlgebra.java#L376-L429 |
rwl/CSparseJ | src/main/java/edu/emory/mathcs/csparsej/tdcomplex/DZcs_lusol.java | DZcs_lusol.cs_lusol | public static boolean cs_lusol(int order, DZcs A, DZcsa b, double tol) {
"""
Solves Ax=b, where A is square and nonsingular. b overwritten with
solution. Partial pivoting if tol = 1.
@param order
ordering method to use (0 to 3)
@param A
column-compressed matrix
@param b
size n, b on input, x on output
@p... | java | public static boolean cs_lusol(int order, DZcs A, DZcsa b, double tol)
{
DZcsa x ;
DZcss S ;
DZcsn N ;
int n ;
boolean ok ;
if (!CS_CSC (A) || b == null) return (false); /* check inputs */
n = A.n ;
S = cs_sqr (order, A, false) ; /* ordering and symbolic analysis */
N = cs_lu (A, S, tol)... | [
"public",
"static",
"boolean",
"cs_lusol",
"(",
"int",
"order",
",",
"DZcs",
"A",
",",
"DZcsa",
"b",
",",
"double",
"tol",
")",
"{",
"DZcsa",
"x",
";",
"DZcss",
"S",
";",
"DZcsn",
"N",
";",
"int",
"n",
";",
"boolean",
"ok",
";",
"if",
"(",
"!",
... | Solves Ax=b, where A is square and nonsingular. b overwritten with
solution. Partial pivoting if tol = 1.
@param order
ordering method to use (0 to 3)
@param A
column-compressed matrix
@param b
size n, b on input, x on output
@param tol
partial pivoting tolerance
@return true if successful, false on error | [
"Solves",
"Ax",
"=",
"b",
"where",
"A",
"is",
"square",
"and",
"nonsingular",
".",
"b",
"overwritten",
"with",
"solution",
".",
"Partial",
"pivoting",
"if",
"tol",
"=",
"1",
"."
] | train | https://github.com/rwl/CSparseJ/blob/6a6f66bccce1558156a961494358952603b0ac84/src/main/java/edu/emory/mathcs/csparsej/tdcomplex/DZcs_lusol.java#L62-L86 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.mp.jwt_fat/fat/src/com/ibm/ws/security/mp/jwt/fat/CommonMpJwtFat.java | CommonMpJwtFat.setUpAndStartBuilderServer | protected static void setUpAndStartBuilderServer(LibertyServer server, String configFile) throws Exception {
"""
Startup a Liberty Server with the JWT Builder enabled
@param server - the server to startup
@param configFile - the config file to use when starting the serever
@throws Exception
"""
se... | java | protected static void setUpAndStartBuilderServer(LibertyServer server, String configFile) throws Exception {
setUpAndStartBuilderServer(server, configFile, false);
} | [
"protected",
"static",
"void",
"setUpAndStartBuilderServer",
"(",
"LibertyServer",
"server",
",",
"String",
"configFile",
")",
"throws",
"Exception",
"{",
"setUpAndStartBuilderServer",
"(",
"server",
",",
"configFile",
",",
"false",
")",
";",
"}"
] | Startup a Liberty Server with the JWT Builder enabled
@param server - the server to startup
@param configFile - the config file to use when starting the serever
@throws Exception | [
"Startup",
"a",
"Liberty",
"Server",
"with",
"the",
"JWT",
"Builder",
"enabled"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.mp.jwt_fat/fat/src/com/ibm/ws/security/mp/jwt/fat/CommonMpJwtFat.java#L55-L57 |
looly/hutool | hutool-db/src/main/java/cn/hutool/db/AbstractDb.java | AbstractDb.query | public <T> List<T> query(String sql, Class<T> beanClass, Object... params) throws SQLException {
"""
查询
@param <T> 结果集需要处理的对象类型
@param sql 查询语句
@param beanClass 元素Bean类型
@param params 参数
@return 结果对象
@throws SQLException SQL执行异常
@since 3.2.2
"""
return query(sql, new BeanListHandler<T>(beanClass)... | java | public <T> List<T> query(String sql, Class<T> beanClass, Object... params) throws SQLException {
return query(sql, new BeanListHandler<T>(beanClass), params);
} | [
"public",
"<",
"T",
">",
"List",
"<",
"T",
">",
"query",
"(",
"String",
"sql",
",",
"Class",
"<",
"T",
">",
"beanClass",
",",
"Object",
"...",
"params",
")",
"throws",
"SQLException",
"{",
"return",
"query",
"(",
"sql",
",",
"new",
"BeanListHandler",
... | 查询
@param <T> 结果集需要处理的对象类型
@param sql 查询语句
@param beanClass 元素Bean类型
@param params 参数
@return 结果对象
@throws SQLException SQL执行异常
@since 3.2.2 | [
"查询"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/AbstractDb.java#L94-L96 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheOnDisk.java | CacheOnDisk.writeDependency | public int writeDependency(Object id, ValueSet vs) {
"""
Call this method to write a dependency id with a collection of cache ids to the disk.
@param id
- dependency id.
@param vs
- a collection of cache ids.
""" // SKS-O
int returnCode = htod.writeDependency(id, vs);
if (returnCode == HT... | java | public int writeDependency(Object id, ValueSet vs) { // SKS-O
int returnCode = htod.writeDependency(id, vs);
if (returnCode == HTODDynacache.DISK_EXCEPTION) {
stopOnError(this.htod.diskCacheException);
}
return returnCode;
} | [
"public",
"int",
"writeDependency",
"(",
"Object",
"id",
",",
"ValueSet",
"vs",
")",
"{",
"// SKS-O",
"int",
"returnCode",
"=",
"htod",
".",
"writeDependency",
"(",
"id",
",",
"vs",
")",
";",
"if",
"(",
"returnCode",
"==",
"HTODDynacache",
".",
"DISK_EXCEP... | Call this method to write a dependency id with a collection of cache ids to the disk.
@param id
- dependency id.
@param vs
- a collection of cache ids. | [
"Call",
"this",
"method",
"to",
"write",
"a",
"dependency",
"id",
"with",
"a",
"collection",
"of",
"cache",
"ids",
"to",
"the",
"disk",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/CacheOnDisk.java#L1564-L1570 |
Netflix/servo | servo-core/src/main/java/com/netflix/servo/monitor/Monitors.java | Monitors.newCounter | public static Counter newCounter(String name, TaggingContext context) {
"""
Create a new counter with a name and context. The returned counter will maintain separate
sub-monitors for each distinct set of tags returned from the context on an update operation.
"""
final MonitorConfig config = MonitorConfig.... | java | public static Counter newCounter(String name, TaggingContext context) {
final MonitorConfig config = MonitorConfig.builder(name).build();
return new ContextualCounter(config, context, COUNTER_FUNCTION);
} | [
"public",
"static",
"Counter",
"newCounter",
"(",
"String",
"name",
",",
"TaggingContext",
"context",
")",
"{",
"final",
"MonitorConfig",
"config",
"=",
"MonitorConfig",
".",
"builder",
"(",
"name",
")",
".",
"build",
"(",
")",
";",
"return",
"new",
"Context... | Create a new counter with a name and context. The returned counter will maintain separate
sub-monitors for each distinct set of tags returned from the context on an update operation. | [
"Create",
"a",
"new",
"counter",
"with",
"a",
"name",
"and",
"context",
".",
"The",
"returned",
"counter",
"will",
"maintain",
"separate",
"sub",
"-",
"monitors",
"for",
"each",
"distinct",
"set",
"of",
"tags",
"returned",
"from",
"the",
"context",
"on",
"... | train | https://github.com/Netflix/servo/blob/d67b5afce8c50bd9e9e31c288dbf4b78fb2ac815/servo-core/src/main/java/com/netflix/servo/monitor/Monitors.java#L121-L124 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java | Gen.hasFinally | boolean hasFinally(JCTree target, Env<GenContext> env) {
"""
Do any of the structures aborted by a non-local exit have
finalizers that require an empty stack?
@param target The tree representing the structure that's aborted
@param env The environment current at the non-local exit.
"""
w... | java | boolean hasFinally(JCTree target, Env<GenContext> env) {
while (env.tree != target) {
if (env.tree.hasTag(TRY) && env.info.finalize.hasFinalizer())
return true;
env = env.next;
}
return false;
} | [
"boolean",
"hasFinally",
"(",
"JCTree",
"target",
",",
"Env",
"<",
"GenContext",
">",
"env",
")",
"{",
"while",
"(",
"env",
".",
"tree",
"!=",
"target",
")",
"{",
"if",
"(",
"env",
".",
"tree",
".",
"hasTag",
"(",
"TRY",
")",
"&&",
"env",
".",
"i... | Do any of the structures aborted by a non-local exit have
finalizers that require an empty stack?
@param target The tree representing the structure that's aborted
@param env The environment current at the non-local exit. | [
"Do",
"any",
"of",
"the",
"structures",
"aborted",
"by",
"a",
"non",
"-",
"local",
"exit",
"have",
"finalizers",
"that",
"require",
"an",
"empty",
"stack?"
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/Gen.java#L386-L393 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/config/KSMetaData.java | KSMetaData.fromSchema | public static KSMetaData fromSchema(Row serializedKs, Row serializedCFs, Row serializedUserTypes) {
"""
Deserialize Keyspace with nested ColumnFamilies
@param serializedKs Keyspace in serialized form
@param serializedCFs Collection of the serialized ColumnFamilies
@return deserialized keyspace with cf_defs
... | java | public static KSMetaData fromSchema(Row serializedKs, Row serializedCFs, Row serializedUserTypes)
{
Map<String, CFMetaData> cfs = deserializeColumnFamilies(serializedCFs);
UTMetaData userTypes = new UTMetaData(UTMetaData.fromSchema(serializedUserTypes));
return fromSchema(serializedKs, cfs.v... | [
"public",
"static",
"KSMetaData",
"fromSchema",
"(",
"Row",
"serializedKs",
",",
"Row",
"serializedCFs",
",",
"Row",
"serializedUserTypes",
")",
"{",
"Map",
"<",
"String",
",",
"CFMetaData",
">",
"cfs",
"=",
"deserializeColumnFamilies",
"(",
"serializedCFs",
")",
... | Deserialize Keyspace with nested ColumnFamilies
@param serializedKs Keyspace in serialized form
@param serializedCFs Collection of the serialized ColumnFamilies
@return deserialized keyspace with cf_defs | [
"Deserialize",
"Keyspace",
"with",
"nested",
"ColumnFamilies"
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/config/KSMetaData.java#L300-L305 |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingreseller/src/main/java/net/minidev/ovh/api/ApiOvhHostingreseller.java | ApiOvhHostingreseller.serviceName_language_POST | public String serviceName_language_POST(String serviceName, OvhPleskLanguageTypeEnum language) throws IOException {
"""
Change language of the Plesk instance
REST: POST /hosting/reseller/{serviceName}/language
@param serviceName [required] The internal name of your reseller service
@param language [required] ... | java | public String serviceName_language_POST(String serviceName, OvhPleskLanguageTypeEnum language) throws IOException {
String qPath = "/hosting/reseller/{serviceName}/language";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "language", language);
... | [
"public",
"String",
"serviceName_language_POST",
"(",
"String",
"serviceName",
",",
"OvhPleskLanguageTypeEnum",
"language",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/hosting/reseller/{serviceName}/language\"",
";",
"StringBuilder",
"sb",
"=",
"path",
... | Change language of the Plesk instance
REST: POST /hosting/reseller/{serviceName}/language
@param serviceName [required] The internal name of your reseller service
@param language [required] Locale value | [
"Change",
"language",
"of",
"the",
"Plesk",
"instance"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingreseller/src/main/java/net/minidev/ovh/api/ApiOvhHostingreseller.java#L188-L195 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/SlotManager.java | SlotManager.freeSlot | public void freeSlot(SlotID slotId, AllocationID allocationId) {
"""
Free the given slot from the given allocation. If the slot is still allocated by the given
allocation id, then the slot will be marked as free and will be subject to new slot requests.
@param slotId identifying the slot to free
@param alloca... | java | public void freeSlot(SlotID slotId, AllocationID allocationId) {
checkInit();
TaskManagerSlot slot = slots.get(slotId);
if (null != slot) {
if (slot.getState() == TaskManagerSlot.State.ALLOCATED) {
if (Objects.equals(allocationId, slot.getAllocationId())) {
TaskManagerRegistration taskManagerRegist... | [
"public",
"void",
"freeSlot",
"(",
"SlotID",
"slotId",
",",
"AllocationID",
"allocationId",
")",
"{",
"checkInit",
"(",
")",
";",
"TaskManagerSlot",
"slot",
"=",
"slots",
".",
"get",
"(",
"slotId",
")",
";",
"if",
"(",
"null",
"!=",
"slot",
")",
"{",
"... | Free the given slot from the given allocation. If the slot is still allocated by the given
allocation id, then the slot will be marked as free and will be subject to new slot requests.
@param slotId identifying the slot to free
@param allocationId with which the slot is presumably allocated | [
"Free",
"the",
"given",
"slot",
"from",
"the",
"given",
"allocation",
".",
"If",
"the",
"slot",
"is",
"still",
"allocated",
"by",
"the",
"given",
"allocation",
"id",
"then",
"the",
"slot",
"will",
"be",
"marked",
"as",
"free",
"and",
"will",
"be",
"subje... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/slotmanager/SlotManager.java#L436-L463 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.